|
@@ -102,7 +102,14 @@ extern int eth_register(struct eth_device* dev);/* Register network device */
|
|
extern int eth_unregister(struct eth_device *dev);/* Remove network device */
|
|
extern int eth_unregister(struct eth_device *dev);/* Remove network device */
|
|
extern void eth_try_another(int first_restart); /* Change the device */
|
|
extern void eth_try_another(int first_restart); /* Change the device */
|
|
extern void eth_set_current(void); /* set nterface to ethcur var */
|
|
extern void eth_set_current(void); /* set nterface to ethcur var */
|
|
-extern struct eth_device *eth_get_dev(void); /* get the current device MAC */
|
|
|
|
|
|
+/* get the current device MAC */
|
|
|
|
+static inline __attribute__((always_inline))
|
|
|
|
+struct eth_device *eth_get_dev(void)
|
|
|
|
+{
|
|
|
|
+ extern struct eth_device *eth_current;
|
|
|
|
+
|
|
|
|
+ return eth_current;
|
|
|
|
+}
|
|
extern struct eth_device *eth_get_dev_by_name(const char *devname);
|
|
extern struct eth_device *eth_get_dev_by_name(const char *devname);
|
|
extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */
|
|
extern struct eth_device *eth_get_dev_by_index(int index); /* get dev @ index */
|
|
extern int eth_get_dev_index(void); /* get the device index */
|
|
extern int eth_get_dev_index(void); /* get the device index */
|
|
@@ -151,6 +158,19 @@ extern int eth_rx(void); /* Check for received packets */
|
|
extern void eth_halt(void); /* stop SCC */
|
|
extern void eth_halt(void); /* stop SCC */
|
|
extern char *eth_get_name(void); /* get name of current device */
|
|
extern char *eth_get_name(void); /* get name of current device */
|
|
|
|
|
|
|
|
+/* Set active state */
|
|
|
|
+static inline __attribute__((always_inline)) int eth_init_state_only(bd_t *bis)
|
|
|
|
+{
|
|
|
|
+ eth_get_dev()->state = ETH_STATE_ACTIVE;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+/* Set passive state */
|
|
|
|
+static inline __attribute__((always_inline)) void eth_halt_state_only(void)
|
|
|
|
+{
|
|
|
|
+ eth_get_dev()->state = ETH_STATE_PASSIVE;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Set the hardware address for an ethernet interface based on 'eth%daddr'
|
|
* Set the hardware address for an ethernet interface based on 'eth%daddr'
|
|
* environment variable (or just 'ethaddr' if eth_number is 0).
|
|
* environment variable (or just 'ethaddr' if eth_number is 0).
|
|
@@ -532,6 +552,26 @@ void NcStart(void);
|
|
int nc_input_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len);
|
|
int nc_input_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static inline __attribute__((always_inline)) int eth_is_on_demand_init(void)
|
|
|
|
+{
|
|
|
|
+#ifdef CONFIG_NETCONSOLE
|
|
|
|
+ extern enum proto_t net_loop_last_protocol;
|
|
|
|
+
|
|
|
|
+ return net_loop_last_protocol != NETCONS;
|
|
|
|
+#else
|
|
|
|
+ return 1;
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void eth_set_last_protocol(int protocol)
|
|
|
|
+{
|
|
|
|
+#ifdef CONFIG_NETCONSOLE
|
|
|
|
+ extern enum proto_t net_loop_last_protocol;
|
|
|
|
+
|
|
|
|
+ net_loop_last_protocol = protocol;
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Check if autoload is enabled. If so, use either NFS or TFTP to download
|
|
* Check if autoload is enabled. If so, use either NFS or TFTP to download
|
|
* the boot file.
|
|
* the boot file.
|