From bd3980cc095af1728b994cdd8bf1ac430b6289e6 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 21 Nov 2008 12:04:18 +0900 Subject: sh: sh_eth: Change new network API sh_eth used old network API. This patch changed new API. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/netdev.h b/include/netdev.h index 751f0dab55..a7d662d757 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -70,6 +70,7 @@ int skge_initialize(bd_t *bis); int tsi108_eth_initialize(bd_t *bis); int uec_initialize(int index); int uli526x_initialize(bd_t *bis); +int sh_eth_initialize(bd_t *bis); /* Boards with PCI network controllers can call this from their board_eth_init() * function to initialize whatever's on board. -- cgit From ba705b5b1a97b47388ed48858bef6bf7b6bfcd56 Mon Sep 17 00:00:00 2001 From: Gary Jennejohn Date: Thu, 20 Nov 2008 12:28:38 +0100 Subject: mgcoge make ether_scc.c work with CONFIG_NET_MULTI This change is needed for mgcoge because it uses two ethernet drivers. Add a check for the presence of the PIGGY board on mgcoge. Without this board networking cannot work and the initialization must be aborted. Only allocate rtx once to prevent DPRAM exhaustion. Initialize ether_scc.c and the keymile-specific HDLC driver (to be added soon) in eth.c. Signed-off-by: Gary Jennejohn Signed-off-by: Ben Warren --- include/netdev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/netdev.h b/include/netdev.h index a7d662d757..ce1ecbd8e8 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -57,6 +57,7 @@ int mcffec_initialize(bd_t *bis); int mpc512x_fec_initialize(bd_t *bis); int mpc5xxx_fec_initialize(bd_t *bis); int mpc8220_fec_initialize(bd_t *bis); +int mpc82xx_scc_enet_initialize(bd_t *bis); int natsemi_initialize(bd_t *bis); int npe_initialize(bd_t *bis); int ns8382x_initialize(bd_t *bis); -- cgit From 71a040f4f556cca4d30f06805d82e717b3ef1020 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Fri, 21 Nov 2008 12:06:26 +0900 Subject: sh: sh7763rdp: Update sh7763rdp config Add CONFIG_NET_MULTI in config file, because sh_eth changed new newwork API. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Ben Warren --- include/configs/sh7763rdp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h index 8a76dad5d9..4ea79cf33b 100644 --- a/include/configs/sh7763rdp.h +++ b/include/configs/sh7763rdp.h @@ -118,6 +118,7 @@ #define CONFIG_SYS_HZ (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER) /* Ether */ +#define CONFIG_NET_MULTI 1 #define CONFIG_SH_ETHER 1 #define CONFIG_SH_ETHER_USE_PORT (1) #define CONFIG_SH_ETHER_PHY_ADDR (0x01) -- cgit From 75edebe3011c963a7cd84be0f4a987477f2aaf89 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 27 Jan 2009 16:53:39 -0500 Subject: Move is_valid_ether_addr() to include/net.h Import the is_valid_ether_addr() function from the Linux kernel. Signed-off-by: Mike Frysinger Signed-off-by: Ben Warren --- include/net.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/net.h b/include/net.h index d2d394f0da..bbe0d4b5a2 100644 --- a/include/net.h +++ b/include/net.h @@ -474,6 +474,22 @@ static inline int is_multicast_ether_addr(const u8 *addr) return (0x01 & addr[0]); } +/** + * is_valid_ether_addr - Determine if the given Ethernet address is valid + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not + * a multicast address, and is not FF:FF:FF:FF:FF:FF. + * + * Return true if the address is valid. + */ +static inline int is_valid_ether_addr(const u8 * addr) +{ + /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to + * explicitly check for it here. */ + return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); +} + /* Convert an IP address to a string */ extern void ip_to_string (IPaddr_t x, char *s); -- cgit