net: network drver now retains Ethernet MAC address in a union so that other link layer addresses may be used in a MULTILINK environment.

This commit is contained in:
Gregory Nutt
2017-04-22 11:10:30 -06:00
parent 1d4aee87a0
commit 79256573e1
40 changed files with 196 additions and 189 deletions
+1 -1
View File
@@ -1006,7 +1006,7 @@ int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno)
cs89x0->cs_txpoll = wd_create(); /* Create periodic poll timer */
cs89x0->cs_txtimeout = wd_create(); /* Create TX timeout timer */
/* Read the MAC address from the hardware into cs89x0->cs_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into cs89x0->cs_dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */
+1 -1
View File
@@ -1955,7 +1955,7 @@ int dm9x_initialize(void)
/* Read the MAC address */
mptr = g_dm9x[0].dm_dev.d_mac.ether_addr_octet;
mptr = g_dm9x[0].dm_dev.d_mac.ether.ether_addr_octet;
for (i = 0, j = DM9X_PAB0; i < ETHER_ADDR_LEN; i++, j++)
{
mptr[i] = getreg(j);
+6 -6
View File
@@ -2440,12 +2440,12 @@ static void enc_setmacaddr(FAR struct enc_driver_s *priv)
* MAADR6 MAC Address Byte 6 (MAADR<7:0>)
*/
enc_wrbreg(priv, ENC_MAADR1, priv->dev.d_mac.ether_addr_octet[0]);
enc_wrbreg(priv, ENC_MAADR2, priv->dev.d_mac.ether_addr_octet[1]);
enc_wrbreg(priv, ENC_MAADR3, priv->dev.d_mac.ether_addr_octet[2]);
enc_wrbreg(priv, ENC_MAADR4, priv->dev.d_mac.ether_addr_octet[3]);
enc_wrbreg(priv, ENC_MAADR5, priv->dev.d_mac.ether_addr_octet[4]);
enc_wrbreg(priv, ENC_MAADR6, priv->dev.d_mac.ether_addr_octet[5]);
enc_wrbreg(priv, ENC_MAADR1, priv->dev.d_mac.ether.ether_addr_octet[0]);
enc_wrbreg(priv, ENC_MAADR2, priv->dev.d_mac.ether.ether_addr_octet[1]);
enc_wrbreg(priv, ENC_MAADR3, priv->dev.d_mac.ether.ether_addr_octet[2]);
enc_wrbreg(priv, ENC_MAADR4, priv->dev.d_mac.ether.ether_addr_octet[3]);
enc_wrbreg(priv, ENC_MAADR5, priv->dev.d_mac.ether.ether_addr_octet[4]);
enc_wrbreg(priv, ENC_MAADR6, priv->dev.d_mac.ether.ether_addr_octet[5]);
}
/****************************************************************************
+3 -3
View File
@@ -2591,7 +2591,7 @@ static void enc_pwrsave(FAR struct enc_driver_s *priv)
static void enc_ldmacaddr(FAR struct enc_driver_s *priv)
{
uint16_t regval;
uint8_t *mac = priv->dev.d_mac.ether_addr_octet;
uint8_t *mac = priv->dev.d_mac.ether.ether_addr_octet;
ninfo("Using ENCX24J600's built in MAC address\n");
@@ -2629,12 +2629,12 @@ static void enc_ldmacaddr(FAR struct enc_driver_s *priv)
static void enc_setmacaddr(FAR struct enc_driver_s *priv)
{
uint8_t *mac = priv->dev.d_mac.ether_addr_octet;
uint8_t *mac = priv->dev.d_mac.ether.ether_addr_octet;
struct ether_addr zmac;
memset(&zmac, 0, sizeof(zmac));
if (memcmp(&priv->dev.d_mac, &zmac, sizeof(zmac)) == 0)
if (memcmp(&priv->dev.d_mac.ether, &zmac, sizeof(zmac)) == 0)
{
/* No user defined MAC address. Read it from the device. */
+4 -4
View File
@@ -1185,9 +1185,9 @@ static int ftmac100_ifup(struct net_driver_s *dev)
ftmac100_init(priv);
/* Instantiate the MAC address from priv->ft_dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->ft_dev.d_mac.ether.ether_addr_octet */
ftmac100_set_mac(priv, priv->ft_dev.d_mac.ether_addr_octet);
ftmac100_set_mac(priv, priv->ft_dev.d_mac.ether.ether_addr_octet);
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@@ -1566,9 +1566,9 @@ int ftmac100_initialize(int intf)
*/
ftmac100_reset(priv);
/* Read the MAC address from the hardware into priv->ft_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->ft_dev.d_mac.ether.ether_addr_octet */
memcpy(priv->ft_dev.d_mac.ether_addr_octet, (void *)(CONFIG_FTMAC100_MAC0_ENV_ADDR), 6);
memcpy(priv->ft_dev.d_mac.ether.ether_addr_octet, (void *)(CONFIG_FTMAC100_MAC0_ENV_ADDR), 6);
/* Register the device with the OS so that socket IOCTLs can be performed */
+2 -2
View File
@@ -803,7 +803,7 @@ static int skel_ifup(FAR struct net_driver_s *dev)
/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
/* Instantiate the MAC address from priv->sk_dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->sk_dev.d_mac.ether.ether_addr_octet */
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */
@@ -1187,7 +1187,7 @@ int skel_initialize(int intf)
* the device and/or calling skel_ifdown().
*/
/* Read the MAC address from the hardware into priv->sk_dev.d_mac.ether_addr_octet */
/* Read the MAC address from the hardware into priv->sk_dev.d_mac.ether.ether_addr_octet */
/* Register the device with the OS so that socket IOCTLs can be performed */
+1 -1
View File
@@ -631,7 +631,7 @@ static int tun_ifup(struct net_driver_s *dev)
/* Initialize PHYs, the Ethernet interface, and setup up Ethernet interrupts */
/* Instantiate the MAC address from priv->dev.d_mac.ether_addr_octet */
/* Instantiate the MAC address from priv->dev.d_mac.ether.ether_addr_octet */
#ifdef CONFIG_NET_ICMPv6
/* Set up IPv6 multicast address filtering */