ethernet: manual netdev->dev_addr conversions (part 2)
Subsystems (16)
Jakub Kicinski
maintainercover ethernet: manual netdev->dev_addr conversions (part 2)
Manual conversions of Ethernet drivers writing directly to netdev->dev_addr (part 2 out of 3).
Jakub Kicinski (12):
ethernet: mv643xx: use eth_hw_addr_set()
ethernet: sky2/skge: use eth_hw_addr_set()
ethernet: lpc: use eth_hw_addr_set()
ethernet: netxen: use eth_hw_addr_set()
ethernet: r8169: use eth_hw_addr_set()
ethernet: renesas: use eth_hw_addr_set()
ethernet: rocker: use eth_hw_addr_set()
ethernet: sxgbe: use eth_hw_addr_set()
ethernet: sis190: use eth_hw_addr_set()
ethernet: sis900: use eth_hw_addr_set()
ethernet: smc91x: use eth_hw_addr_set()
ethernet: smsc: use eth_hw_addr_set()
drivers/net/ethernet/marvell/mv643xx_eth.c | 10 +++++++--- drivers/net/ethernet/marvell/skge.c | 4 +++- drivers/net/ethernet/marvell/sky2.c | 9 ++++++--- drivers/net/ethernet/nxp/lpc_eth.c | 4 +++- .../ethernet/qlogic/netxen/netxen_nic_main.c | 4 +++- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- drivers/net/ethernet/renesas/ravb_main.c | 16 +++++++++------- drivers/net/ethernet/renesas/sh_eth.c | 16 +++++++++------- drivers/net/ethernet/rocker/rocker_main.c | 8 +++++--- .../net/ethernet/samsung/sxgbe/sxgbe_main.c | 9 ++++++--- drivers/net/ethernet/sis/sis190.c | 4 +++- drivers/net/ethernet/sis/sis900.c | 4 +++- drivers/net/ethernet/smsc/smc911x.c | 4 +++- drivers/net/ethernet/smsc/smc91x.c | 4 +++- drivers/net/ethernet/smsc/smsc911x.c | 16 +++++++++------- drivers/net/ethernet/smsc/smsc9420.c | 18 ++++++++++-------- 16 files changed, 84 insertions(+), 49 deletions(-)
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 1/12 ethernet: mv643xx: use eth_hw_addr_set()
Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +7 -3
@@ -2925,10 +2925,14 @@ static void set_params(struct mv643xx_eth_private *mp,struct net_device *dev = mp->dev;unsigned int tx_ring_size; -if (is_valid_ether_addr (pd->mac_addr)) +if (is_valid_ether_addr (pd->mac_addr)) {eth_hw_addr_set (dev, pd->mac_addr); -else -uc_addr_get (mp, dev->dev_addr); + }else { +u8 addr[ETH_ALEN ]; + +uc_addr_get (mp, addr); +eth_hw_addr_set (dev, addr); + } mp->rx_ring_size =DEFAULT_RX_QUEUE_SIZE ;if (pd->rx_queue_size)
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 2/12 ethernet: sky2/skge: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/marvell/skge.c | 4 +++- drivers/net/ethernet/marvell/sky2.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/skge.c +3 -1
@@ -3810,6 +3810,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, {struct skge_port *skge;struct net_device *dev =alloc_etherdev (sizeof (*skge)); +u8 addr[ETH_ALEN ];if (!dev)return NULL ;
@@ -3862,7 +3863,8 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, }/* read the mac address */ -memcpy_fromio (dev->dev_addr, hw->regs +B2_MAC_1 + port*8 ,ETH_ALEN ); +memcpy_fromio (addr, hw->regs +B2_MAC_1 + port*8 ,ETH_ALEN ); +eth_hw_addr_set (dev, addr);return dev; }
drivers/net/ethernet/marvell/sky2.c +6 -3
@@ -4721,9 +4721,12 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,* 2) from internal registers set by bootloader */ ret =of_get_ethdev_address (hw->pdev->dev.of_node, dev); -if (ret) -memcpy_fromio (dev->dev_addr, hw->regs +B2_MAC_1 + port *8 , -ETH_ALEN ); +if (ret) { +u8 addr[ETH_ALEN ]; + +memcpy_fromio (addr, hw->regs +B2_MAC_1 + port *8 ,ETH_ALEN ); +eth_hw_addr_set (dev, addr); + }/* if the address is invalid, use a random value */ if (!is_valid_ether_addr (dev->dev_addr)) {
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 3/12 ethernet: lpc: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/nxp/lpc_eth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/nxp/lpc_eth.c +3 -1
@@ -1232,6 +1232,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)struct net_device *ndev;dma_addr_t dma_handle;struct resource *res; +u8 addr[ETH_ALEN ];int irq, ret;/* Setup network interface for RMII or MII mode */
@@ -1347,7 +1348,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) pldat->phy_node =of_parse_phandle (np,"phy-handle" ,0 );/* Get MAC address from current HW setting (POR state is all zeros) */ -__lpc_get_mac (pldat, ndev->dev_addr); +__lpc_get_mac (pldat, addr); +eth_hw_addr_set (ndev, addr);if (!is_valid_ether_addr (ndev->dev_addr)) {of_get_ethdev_address (np, ndev);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 5/12 ethernet: r8169: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/realtek/r8169_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169_main.c +2 -1
@@ -5217,7 +5217,7 @@ static int rtl_get_ether_clk(struct rtl8169_private *tp)static void rtl_init_mac_address (struct rtl8169_private *tp) {struct net_device *dev = tp->dev; -u8 *mac_addr = dev->dev_addr; +u8 mac_addr[ETH_ALEN ];int rc; rc =eth_platform_get_mac_address (tp_to_dev (tp), mac_addr);
@@ -5235,6 +5235,7 @@ static void rtl_init_mac_address(struct rtl8169_private *tp)eth_hw_addr_random (dev);dev_warn (tp_to_dev (tp),"can't read MAC address, setting random one\n" ); done: +eth_hw_addr_set (dev, mac_addr);rtl_rar_set (tp, mac_addr); }
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 4/12 ethernet: netxen: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Invert the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +3 -1
@@ -463,6 +463,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)u64 mac_addr;struct net_device *netdev = adapter->netdev;struct pci_dev *pdev = adapter->pdev; +u8 addr[ETH_ALEN ];if (NX_IS_REVISION_P3 (adapter->ahw.revision_id)) {if (netxen_p3_get_mac_addr (adapter, &mac_addr) !=0 )
@@ -474,7 +475,8 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) p = (unsigned char *)&mac_addr;for (i =0 ; i <6 ; i++) - netdev->dev_addr[i] = *(p +5 - i); + addr[i] = *(p +5 - i); +eth_hw_addr_set (netdev, addr);memcpy (adapter->mac_addr, netdev->dev_addr, netdev->addr_len);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 6/12 ethernet: renesas: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Break the address up into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- drivers/net/ethernet/renesas/ravb_main.c | 16 +++++++++------- drivers/net/ethernet/renesas/sh_eth.c | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-)
drivers/net/ethernet/renesas/ravb_main.c +9 -7
@@ -136,13 +136,15 @@ static void ravb_read_mac_address(struct device_node *np,if (ret) {u32 mahr =ravb_read (ndev,MAHR );u32 malr =ravb_read (ndev,MALR ); - - ndev->dev_addr[0 ] = (mahr >>24 ) &0xFF ; - ndev->dev_addr[1 ] = (mahr >>16 ) &0xFF ; - ndev->dev_addr[2 ] = (mahr >>8 ) &0xFF ; - ndev->dev_addr[3 ] = (mahr >>0 ) &0xFF ; - ndev->dev_addr[4 ] = (malr >>8 ) &0xFF ; - ndev->dev_addr[5 ] = (malr >>0 ) &0xFF ; +u8 addr[ETH_ALEN ]; + + addr[0 ] = (mahr >>24 ) &0xFF ; + addr[1 ] = (mahr >>16 ) &0xFF ; + addr[2 ] = (mahr >>8 ) &0xFF ; + addr[3 ] = (mahr >>0 ) &0xFF ; + addr[4 ] = (malr >>8 ) &0xFF ; + addr[5 ] = (malr >>0 ) &0xFF ; +eth_hw_addr_set (ndev, addr); } }
drivers/net/ethernet/renesas/sh_eth.c +9 -7
@@ -1157,13 +1157,15 @@ static void read_mac_address(struct net_device *ndev, unsigned char *mac) }else {u32 mahr =sh_eth_read (ndev,MAHR );u32 malr =sh_eth_read (ndev,MALR ); - - ndev->dev_addr[0 ] = (mahr >>24 ) &0xFF ; - ndev->dev_addr[1 ] = (mahr >>16 ) &0xFF ; - ndev->dev_addr[2 ] = (mahr >>8 ) &0xFF ; - ndev->dev_addr[3 ] = (mahr >>0 ) &0xFF ; - ndev->dev_addr[4 ] = (malr >>8 ) &0xFF ; - ndev->dev_addr[5 ] = (malr >>0 ) &0xFF ; +u8 addr[ETH_ALEN ]; + + addr[0 ] = (mahr >>24 ) &0xFF ; + addr[1 ] = (mahr >>16 ) &0xFF ; + addr[2 ] = (mahr >>8 ) &0xFF ; + addr[3 ] = (mahr >>0 ) &0xFF ; + addr[4 ] = (malr >>8 ) &0xFF ; + addr[5 ] = (malr >>0 ) &0xFF ; +eth_hw_addr_set (ndev, addr); } }
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 7/12 ethernet: rocker: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/rocker/rocker_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/rocker/rocker_main.c +5 -3
@@ -2545,11 +2545,13 @@ static void rocker_port_dev_addr_init(struct rocker_port *rocker_port) {const struct rocker *rocker = rocker_port->rocker;const struct pci_dev *pdev = rocker->pdev; +u8 addr[ETH_ALEN ];int err; - err =rocker_cmd_get_port_settings_macaddr (rocker_port, - rocker_port->dev->dev_addr); -if (err) { + err =rocker_cmd_get_port_settings_macaddr (rocker_port, addr); +if (!err) { +eth_hw_addr_set (rocker_port->dev, addr); + }else {dev_warn (&pdev->dev,"failed to get mac address, using random\n" );eth_hw_addr_random (rocker_port->dev); }
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 9/12 ethernet: sis190: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/sis/sis190.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sis/sis190.c +3 -1
@@ -1631,6 +1631,7 @@ static int sis190_get_mac_addr_from_apc(struct pci_dev *pdev,static const u16 ids[] = {0x0965 ,0x0966 ,0x0968 };struct sis190_private *tp =netdev_priv (dev);struct pci_dev *isa_bridge; +u8 addr[ETH_ALEN ];u8 reg, tmp8;unsigned int i;
@@ -1659,8 +1660,9 @@ static int sis190_get_mac_addr_from_apc(struct pci_dev *pdev,for (i =0 ; i <ETH_ALEN ; i++) {outb (0x9 + i,0x78 ); - dev->dev_addr[i] =inb (0x79 ); + addr[i] =inb (0x79 ); } +eth_hw_addr_set (dev, addr);outb (0x12 ,0x78 ); reg =inb (0x79 );
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 8/12 ethernet: sxgbe: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +6 -3
@@ -931,10 +931,13 @@ static int sxgbe_get_hw_features(struct sxgbe_priv_data * const priv)static void sxgbe_check_ether_addr (struct sxgbe_priv_data *priv) {if (!is_valid_ether_addr (priv->dev->dev_addr)) { +u8 addr[ETH_ALEN ]; + priv->hw->mac->get_umac_addr ((void __iomem *) - priv->ioaddr, - priv->dev->dev_addr,0 ); -if (!is_valid_ether_addr (priv->dev->dev_addr)) + priv->ioaddr, addr,0 ); +if (is_valid_ether_addr (addr)) +eth_hw_addr_set (priv->dev, addr); +else eth_hw_addr_random (priv->dev); } dev_info(priv->device, "device MAC address %pM\n",
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 10/12 ethernet: sis900: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/sis/sis900.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/sis/sis900.c +3 -1
@@ -292,6 +292,7 @@ static int sis630e_get_mac_addr(struct pci_dev *pci_dev, struct net_device *net_dev) {struct pci_dev *isa_bridge =NULL ; +u8 addr[ETH_ALEN ];u8 reg;int i;
@@ -308,8 +309,9 @@ static int sis630e_get_mac_addr(struct pci_dev *pci_dev,for (i =0 ; i <6 ; i++) {outb (0x09 + i,0x70 ); - ((u8 *)(net_dev->dev_addr))[i] =inb (0x71 ); + addr[i] =inb (0x71 ); } +eth_hw_addr_set (net_dev, addr);pci_write_config_byte (isa_bridge,0x48 , reg & ~0x40 );pci_dev_put (isa_bridge);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 11/12 ethernet: smc91x: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Read the address into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/smsc/smc911x.c | 4 +++- drivers/net/ethernet/smsc/smc91x.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smc911x.c +3 -1
@@ -1788,6 +1788,7 @@ static int smc911x_probe(struct net_device *dev)struct dma_slave_config config;dma_cap_mask_t mask;#endif +u8 addr[ETH_ALEN ];DBG (SMC_DEBUG_FUNC , dev,"--> %s\n" , __func__);
@@ -1892,7 +1893,8 @@ static int smc911x_probe(struct net_device *dev)spin_lock_init (&lp->lock);/* Get the MAC address */ -SMC_GET_MAC_ADDR (lp, dev->dev_addr); +SMC_GET_MAC_ADDR (lp, addr); +eth_hw_addr_set (dev, addr);/* now, reset the chip, and put it into a known state */ smc911x_reset (dev);
drivers/net/ethernet/smsc/smc91x.c +3 -1
@@ -1851,6 +1851,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr,int retval;unsigned int val, revision_register;const char *version_string; +u8 addr[ETH_ALEN ];DBG (2 , dev,"%s: %s\n" ,CARDNAME , __func__);
@@ -1922,7 +1923,8 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr,/* Get the MAC address */ SMC_SELECT_BANK (lp,1 ); -SMC_GET_MAC_ADDR (lp, dev->dev_addr); +SMC_GET_MAC_ADDR (lp, addr); +eth_hw_addr_set (dev, addr);/* now, reset the chip, and put it into a known state */ smc_reset (dev);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 12/12 ethernet: smsc: use eth_hw_addr_set()
In reply to Jakub KicinskiCommit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers.
Break the address up into an array on the stack, then call eth_hw_addr_set().
---
CC: [email protected]
--- drivers/net/ethernet/smsc/smsc911x.c | 16 +++++++++------- drivers/net/ethernet/smsc/smsc9420.c | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-)
drivers/net/ethernet/smsc/smsc911x.c +9 -7
@@ -2162,13 +2162,15 @@ static void smsc911x_read_mac_address(struct net_device *dev)struct smsc911x_data *pdata =netdev_priv (dev);u32 mac_high16 =smsc911x_mac_read (pdata,ADDRH );u32 mac_low32 =smsc911x_mac_read (pdata,ADDRL ); - - dev->dev_addr[0 ] = (u8)(mac_low32); - dev->dev_addr[1 ] = (u8)(mac_low32 >>8 ); - dev->dev_addr[2 ] = (u8)(mac_low32 >>16 ); - dev->dev_addr[3 ] = (u8)(mac_low32 >>24 ); - dev->dev_addr[4 ] = (u8)(mac_high16); - dev->dev_addr[5 ] = (u8)(mac_high16 >>8 ); +u8 addr[ETH_ALEN ]; + + addr[0 ] = (u8)(mac_low32); + addr[1 ] = (u8)(mac_low32 >>8 ); + addr[2 ] = (u8)(mac_low32 >>16 ); + addr[3 ] = (u8)(mac_low32 >>24 ); + addr[4 ] = (u8)(mac_high16); + addr[5 ] = (u8)(mac_high16 >>8 ); +eth_hw_addr_set (dev, addr); }/* Initializing private device structures, only called from probe */
drivers/net/ethernet/smsc/smsc9420.c +10 -8
@@ -416,6 +416,7 @@ static void smsc9420_set_mac_address(struct net_device *dev)static void smsc9420_check_mac_address (struct net_device *dev) {struct smsc9420_pdata *pd =netdev_priv (dev); +u8 addr[ETH_ALEN ];/* Check if mac address has been specified when bringing interface up */ if (is_valid_ether_addr (dev->dev_addr)) {
@@ -427,15 +428,16 @@ static void smsc9420_check_mac_address(struct net_device *dev)* it will already have been set */ u32 mac_high16 =smsc9420_reg_read (pd,ADDRH );u32 mac_low32 =smsc9420_reg_read (pd,ADDRL ); - dev->dev_addr[0 ] = (u8)(mac_low32); - dev->dev_addr[1 ] = (u8)(mac_low32 >>8 ); - dev->dev_addr[2 ] = (u8)(mac_low32 >>16 ); - dev->dev_addr[3 ] = (u8)(mac_low32 >>24 ); - dev->dev_addr[4 ] = (u8)(mac_high16); - dev->dev_addr[5 ] = (u8)(mac_high16 >>8 ); - -if (is_valid_ether_addr (dev->dev_addr)) { + addr[0 ] = (u8)(mac_low32); + addr[1 ] = (u8)(mac_low32 >>8 ); + addr[2 ] = (u8)(mac_low32 >>16 ); + addr[3 ] = (u8)(mac_low32 >>24 ); + addr[4 ] = (u8)(mac_high16); + addr[5 ] = (u8)(mac_high16 >>8 ); + +if (is_valid_ether_addr (addr)) {/* eeprom values are valid so use them */ +eth_hw_addr_set (dev, addr);netif_dbg (pd, probe, pd->dev,"Mac Address is read from EEPROM\n" ); }else {
Signature · 1 line
2.31.1
Re: [PATCH net-next 02/12] ethernet: sky2/skge: use eth_hw_addr_set()
In reply to Jakub KicinskiQuoted 5 lines · On Mon, 18 Oct 2021 07:29:22 -0700 Jakub Kicinski <[email protected]> wrote:
Commit
406f42fa0d3c("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintainnetdev->dev_addrin this tree we need to make all the writes to it got through appropriate helpers.
Quoted 7 lines
Read the address into an array on the stack, then call
eth_hw_addr_set().Signed-off-by Jakub Kicinski <[email protected]>---
CC: [email protected]
CC: [email protected]
Looks ok. Don't even use any of that hardware anymore.
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 17 lines · On Mon, 18 Oct 2021 07:29:20 -0700 you wrote:
Manual conversions of Ethernet drivers writing directly to
netdev->dev_addr(part 2 out of 3).Jakub Kicinski (12):
ethernet: mv643xx: useeth_hw_addr_set()
ethernet: sky2/skge: useeth_hw_addr_set()
ethernet: lpc: useeth_hw_addr_set()
ethernet: netxen: useeth_hw_addr_set()
ethernet: r8169: useeth_hw_addr_set()
ethernet: renesas: useeth_hw_addr_set()
ethernet: rocker: useeth_hw_addr_set()
ethernet: sxgbe: useeth_hw_addr_set()
ethernet: sis190: useeth_hw_addr_set()
ethernet: sis900: useeth_hw_addr_set()
ethernet: smc91x: useeth_hw_addr_set()
ethernet: smsc: useeth_hw_addr_set()
Quoted 1 line
[...]
Here is the summary with links:
- [net-next,01/12] ethernet: mv643xx: use eth_hw_addr_set()
https://git.kernel.org/netdev/net-next/c/15c343eb0588 - [net-next,02/12] ethernet: sky2/skge: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/4789b57af37f - [net-next,03/12] ethernet: lpc: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/b814d3286923 - [net-next,04/12] ethernet: netxen: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/88e102e8777e - [net-next,05/12] ethernet: r8169: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/1c5d09d58748 - [net-next,06/12] ethernet: renesas: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/0b08956cd532 - [net-next,07/12] ethernet: rocker: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/298b0e0c5fec - [net-next,08/12] ethernet: sxgbe: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/15fa05bf41ab - [net-next,09/12] ethernet: sis190: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/f60e8b06e0cc - [net-next,10/12] ethernet: sis900: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/74fad215ee3d - [net-next,11/12] ethernet: smc91x: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/02bfb6beb695 - [net-next,12/12] ethernet: smsc: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/f15fef4c0675
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html