diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h index 018a744..ce54825 100644 --- a/include/net.h +++ b/include/net.h @@ -128,7 +128,18 @@ extern int eth_get_dev_index (void); /* get the device index */ extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr); extern int eth_getenv_enetaddr(char *name, uchar *enetaddr); extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr); -extern int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr); + +/* + * Get the hardware address for an ethernet interface . + * Args: + * base_name - base name for device (normally "eth") + * index - device index number (0 for first) + * enetaddr - returns 6 byte hardware address + * Returns: + * Return true if the address is valid. + */ +extern int eth_getenv_enetaddr_by_index(const char *base_name, int index, + uchar *enetaddr); extern int usb_eth_initialize(bd_t *bi); extern int eth_init(bd_t *bis); /* Initialize the device */ @@ -141,6 +152,18 @@ extern int eth_rx(void); /* Check for received packets */ extern void eth_halt(void); /* stop SCC */ extern char *eth_get_name(void); /* get name of current device */ +/* + * Set the hardware address for an ethernet interface based on 'eth%daddr' + * environment variable (or just 'ethaddr' if eth_number is 0). + * Args: + * base_name - base name for device (normally "eth") + * eth_number - value of %d (0 for first device of this type) + * Returns: + * 0 is success, non-zero is error status from driver. + */ +int eth_write_hwaddr(struct eth_device *dev, const char *base_name, + int eth_number); + #ifdef CONFIG_MCAST_TFTP int eth_mcast_join( IPaddr_t mcast_addr, u8 join); u32 ether_crc (size_t len, unsigned char const *p); |