mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
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:
@@ -2364,7 +2364,7 @@ static void c5471_reset(struct c5471_driver_s *priv)
|
||||
static void c5471_macassign(struct c5471_driver_s *priv)
|
||||
{
|
||||
struct net_driver_s *dev = &priv->c_dev;
|
||||
uint8_t *mptr = dev->d_mac.ether_addr_octet;
|
||||
uint8_t *mptr = dev->d_mac.ether.ether_addr_octet;
|
||||
register uint32_t tmp;
|
||||
|
||||
ninfo("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n",
|
||||
|
||||
@@ -1125,7 +1125,7 @@ static int kinetis_ifup(struct net_driver_s *dev)
|
||||
{
|
||||
FAR struct kinetis_driver_s *priv =
|
||||
(FAR struct kinetis_driver_s *)dev->d_private;
|
||||
uint8_t *mac = dev->d_mac.ether_addr_octet;
|
||||
uint8_t *mac = dev->d_mac.ether.ether_addr_octet;
|
||||
uint32_t regval;
|
||||
int ret;
|
||||
|
||||
@@ -2144,7 +2144,7 @@ int kinetis_netinitialize(int intf)
|
||||
|
||||
uidl = getreg32(KINETIS_SIM_UIDL);
|
||||
uidml = getreg32(KINETIS_SIM_UIDML);
|
||||
mac = priv->dev.d_mac.ether_addr_octet;
|
||||
mac = priv->dev.d_mac.ether.ether_addr_octet;
|
||||
|
||||
uidml |= 0x00000200;
|
||||
uidml &= 0x0000FEFF;
|
||||
|
||||
@@ -1591,16 +1591,16 @@ static int lpc17_ifup(struct net_driver_s *dev)
|
||||
|
||||
/* Configure the MAC station address */
|
||||
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[5] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[4];
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[5] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[4];
|
||||
lpc17_putreg(regval, LPC17_ETH_SA0);
|
||||
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[3] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[2];
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[3] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[2];
|
||||
lpc17_putreg(regval, LPC17_ETH_SA1);
|
||||
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether_addr_octet[0];
|
||||
regval = (uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)priv->lp_dev.d_mac.ether.ether_addr_octet[0];
|
||||
lpc17_putreg(regval, LPC17_ETH_SA2);
|
||||
|
||||
#ifdef CONFIG_NET_ICMPv6
|
||||
|
||||
@@ -3535,22 +3535,22 @@ static void lpc43_macaddress(FAR struct lpc43_ethmac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address high register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[4];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
|
||||
lpc43_putreg(regval, LPC43_ETH_MACA0HI);
|
||||
|
||||
/* Set the MAC address low register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[0];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
|
||||
lpc43_putreg(regval, LPC43_ETH_MACA0LO);
|
||||
}
|
||||
|
||||
|
||||
@@ -3416,20 +3416,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
|
||||
sam_putreg(priv, SAM_EMAC_SAB1, regval);
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
|
||||
sam_putreg(priv, SAM_EMAC_SAT1, regval);
|
||||
}
|
||||
|
||||
|
||||
@@ -3458,20 +3458,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
|
||||
sam_putreg(priv, SAM_EMAC_SA1B, regval);
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
|
||||
sam_putreg(priv, SAM_EMAC_SA1T, regval);
|
||||
}
|
||||
|
||||
|
||||
@@ -4106,20 +4106,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
|
||||
sam_putreg(priv, SAM_EMAC_SAB1_OFFSET, regval);
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
|
||||
sam_putreg(priv, SAM_EMAC_SAT1_OFFSET, regval);
|
||||
}
|
||||
|
||||
|
||||
@@ -3506,20 +3506,20 @@ static void sam_macaddress(struct sam_gmac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
|
||||
sam_putreg(priv, SAM_GMAC_SAB1, regval);
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
|
||||
sam_putreg(priv, SAM_GMAC_SAT1, regval);
|
||||
}
|
||||
|
||||
|
||||
@@ -4668,20 +4668,20 @@ static void sam_macaddress(struct sam_emac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address */
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[3] << 24;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[0] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24;
|
||||
sam_putreg(priv, SAM_EMAC_SAB1_OFFSET, regval);
|
||||
|
||||
regval = (uint32_t)dev->d_mac.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[5] << 8;
|
||||
regval = (uint32_t)dev->d_mac.ether.ether_addr_octet[4] |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8;
|
||||
sam_putreg(priv, SAM_EMAC_SAT1_OFFSET, regval);
|
||||
}
|
||||
|
||||
@@ -5160,13 +5160,13 @@ int sam_emac_setmacaddr(int intf, uint8_t mac[6])
|
||||
/* Copy the MAC address into the device structure */
|
||||
|
||||
dev = &priv->dev;
|
||||
memcpy(dev->d_mac.ether_addr_octet, mac, 6);
|
||||
memcpy(dev->d_mac.ether.ether_addr_octet, mac, 6);
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -3674,22 +3674,22 @@ static void stm32_macaddress(FAR struct stm32_ethmac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address high register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[4];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
|
||||
stm32_putreg(regval, STM32_ETH_MACA0HR);
|
||||
|
||||
/* Set the MAC address low register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[0];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
|
||||
stm32_putreg(regval, STM32_ETH_MACA0LR);
|
||||
}
|
||||
|
||||
|
||||
@@ -3780,22 +3780,22 @@ static void stm32_macaddress(struct stm32_ethmac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address high register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[4];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
|
||||
stm32_putreg(regval, STM32_ETH_MACA0HR);
|
||||
|
||||
/* Set the MAC address low register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[0];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
|
||||
stm32_putreg(regval, STM32_ETH_MACA0LR);
|
||||
}
|
||||
|
||||
|
||||
@@ -1389,14 +1389,14 @@ static int tiva_ifup(struct net_driver_s *dev)
|
||||
|
||||
/* Program the hardware with it's MAC address (for filtering) */
|
||||
|
||||
regval = (uint32_t)priv->ld_dev.d_mac.ether_addr_octet[3] << 24 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[0];
|
||||
regval = (uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[3] << 24 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[2] << 16 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[1] << 8 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[0];
|
||||
tiva_ethout(priv, TIVA_MAC_IA0_OFFSET, regval);
|
||||
|
||||
regval = (uint32_t)priv->ld_dev.d_mac.ether_addr_octet[5] << 8 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether_addr_octet[4];
|
||||
regval = (uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[5] << 8 |
|
||||
(uint32_t)priv->ld_dev.d_mac.ether.ether_addr_octet[4];
|
||||
tiva_ethout(priv, TIVA_MAC_IA1_OFFSET, regval);
|
||||
|
||||
/* Set and activate a timer process */
|
||||
@@ -1696,13 +1696,13 @@ static inline int tiva_ethinitialize(int intf)
|
||||
priv->ld_txpoll = wd_create(); /* Create periodic poll timer */
|
||||
priv->ld_txtimeout = wd_create(); /* Create TX timeout timer */
|
||||
|
||||
#ifdef CONFIG_TIVA_BOARDMAC
|
||||
/* If the board can provide us with a MAC address, get the address
|
||||
* from the board now. The MAC will not be applied until tiva_ifup()
|
||||
* is called (and the MAC can be overwritten with a netdev ioctl call).
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_TIVA_BOARDMAC
|
||||
tiva_ethernetmac(&priv->ld_dev.d_mac);
|
||||
tiva_ethernetmac(&priv->ld_dev.d_mac.ether);
|
||||
#endif
|
||||
|
||||
/* Perform minimal, one-time initialization -- just reset the controller and
|
||||
|
||||
@@ -3755,22 +3755,22 @@ static void tiva_macaddress(FAR struct tiva_ethmac_s *priv)
|
||||
|
||||
ninfo("%s MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
dev->d_ifname,
|
||||
dev->d_mac.ether_addr_octet[0], dev->d_mac.ether_addr_octet[1],
|
||||
dev->d_mac.ether_addr_octet[2], dev->d_mac.ether_addr_octet[3],
|
||||
dev->d_mac.ether_addr_octet[4], dev->d_mac.ether_addr_octet[5]);
|
||||
dev->d_mac.ether.ether_addr_octet[0], dev->d_mac.ether.ether_addr_octet[1],
|
||||
dev->d_mac.ether.ether_addr_octet[2], dev->d_mac.ether.ether_addr_octet[3],
|
||||
dev->d_mac.ether.ether_addr_octet[4], dev->d_mac.ether.ether_addr_octet[5]);
|
||||
|
||||
/* Set the MAC address high register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[4];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[5] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[4];
|
||||
tiva_putreg(regval, TIVA_EMAC_ADDR0H);
|
||||
|
||||
/* Set the MAC address low register */
|
||||
|
||||
regval = ((uint32_t)dev->d_mac.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether_addr_octet[0];
|
||||
regval = ((uint32_t)dev->d_mac.ether.ether_addr_octet[3] << 24) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[2] << 16) |
|
||||
((uint32_t)dev->d_mac.ether.ether_addr_octet[1] << 8) |
|
||||
(uint32_t)dev->d_mac.ether.ether_addr_octet[0];
|
||||
tiva_putreg(regval, TIVA_EMAC_ADDR0L);
|
||||
}
|
||||
|
||||
@@ -4056,7 +4056,7 @@ int tiva_ethinitialize(int intf)
|
||||
* is called (and the MAC can be overwritten with a netdev ioctl call).
|
||||
*/
|
||||
|
||||
tiva_ethernetmac(&priv->dev.d_mac);
|
||||
tiva_ethernetmac(&priv->dev.d_mac.ether);
|
||||
#endif
|
||||
|
||||
/* Enable power and clocking to the Ethernet MAC
|
||||
|
||||
Reference in New Issue
Block a user