ethernet: use eth_hw_addr_set() for dev->addr_len cases
Convert all Ethernet drivers from memcpy(... dev->addr_len) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, dev->addr_len) + eth_hw_addr_set(dev, np) In theory addr_len may not be ETH_ALEN, but we don't expect non-Ethernet devices to live under this directory, and only the following cases of setting addr_len exist: - cxgb4 for mgmt device, and the drivers which set it to ETH_ALEN: s2io, mlx4, vxge. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Родитель
5e8fba848e
Коммит
a05e4c0af4
|
@ -390,7 +390,7 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
|
|||
dev->ethtool_ops = &ne2k_pci_ethtool_ops;
|
||||
NS8390_init(dev, 0);
|
||||
|
||||
memcpy(dev->dev_addr, SA_prom, dev->addr_len);
|
||||
eth_hw_addr_set(dev, SA_prom);
|
||||
|
||||
i = register_netdev(dev);
|
||||
if (i)
|
||||
|
|
|
@ -1173,7 +1173,7 @@ static int owl_emac_ndo_set_mac_addr(struct net_device *netdev, void *addr)
|
|||
if (netif_running(netdev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(netdev->dev_addr, skaddr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, skaddr->sa_data);
|
||||
owl_emac_set_hw_mac_addr(netdev);
|
||||
|
||||
return owl_emac_setup_frame_xmit(netdev_priv(netdev));
|
||||
|
|
|
@ -1025,7 +1025,7 @@ static int greth_set_mac_add(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
GRETH_REGSAVE(regs->esa_msb, dev->dev_addr[0] << 8 | dev->dev_addr[1]);
|
||||
GRETH_REGSAVE(regs->esa_lsb, dev->dev_addr[2] << 24 | dev->dev_addr[3] << 16 |
|
||||
dev->dev_addr[4] << 8 | dev->dev_addr[5]);
|
||||
|
|
|
@ -2718,7 +2718,7 @@ static int ace_set_mac_addr(struct net_device *dev, void *p)
|
|||
if(netif_running(dev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
da = (u8 *)dev->dev_addr;
|
||||
|
||||
|
|
|
@ -1500,7 +1500,7 @@ static int amd8111e_set_mac_address(struct net_device *dev, void *p)
|
|||
int i;
|
||||
struct sockaddr *addr = p;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
spin_lock_irq(&lp->lock);
|
||||
/* Setting the MAC address to the device */
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
|
|
|
@ -1123,7 +1123,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
memcpy( dev->dev_addr, saddr->sa_data, dev->addr_len );
|
||||
eth_hw_addr_set(dev, saddr->sa_data);
|
||||
for( i = 0; i < 6; i++ )
|
||||
MEM->init.hwaddr[i] = dev->dev_addr[i^1]; /* <- 16 bit swap! */
|
||||
lp->memcpy_f( RIEBL_HWADDR_ADDR, dev->dev_addr, 6 );
|
||||
|
|
|
@ -2016,7 +2016,7 @@ static int xgbe_set_mac_address(struct net_device *netdev, void *addr)
|
|||
if (!is_valid_ether_addr(saddr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, saddr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, saddr->sa_data);
|
||||
|
||||
hw_if->set_mac_address(pdata, netdev->dev_addr);
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata)
|
|||
|
||||
netdev->irq = pdata->dev_irq;
|
||||
netdev->base_addr = (unsigned long)pdata->xgmac_regs;
|
||||
memcpy(netdev->dev_addr, pdata->mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, pdata->mac_addr);
|
||||
|
||||
/* Initialize ECC timestamps */
|
||||
pdata->tx_sec_period = jiffies;
|
||||
|
|
|
@ -773,7 +773,7 @@ static int arc_emac_set_address(struct net_device *ndev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
|
||||
arc_emac_set_address_internal(ndev);
|
||||
|
||||
|
|
|
@ -607,7 +607,7 @@ static int alx_set_mac_address(struct net_device *netdev, void *data)
|
|||
if (netdev->addr_assign_type & NET_ADDR_RANDOM)
|
||||
netdev->addr_assign_type ^= NET_ADDR_RANDOM;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(hw->mac_addr, addr->sa_data, netdev->addr_len);
|
||||
alx_set_macaddr(hw, hw->mac_addr);
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
|
|||
if (netif_running(netdev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.mac_addr);
|
||||
|
@ -2767,7 +2767,7 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* got a random MAC address, set NET_ADDR_RANDOM to netdev */
|
||||
netdev->addr_assign_type = NET_ADDR_RANDOM;
|
||||
}
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac_addr);
|
||||
if (netif_msg_probe(adapter))
|
||||
dev_dbg(&pdev->dev, "mac address : %pM\n",
|
||||
adapter->hw.mac_addr);
|
||||
|
|
|
@ -374,7 +374,7 @@ static int atl1e_set_mac_addr(struct net_device *netdev, void *p)
|
|||
if (netif_running(netdev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
atl1e_hw_set_mac_addr(&adapter->hw);
|
||||
|
@ -2390,7 +2390,7 @@ static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
goto err_eeprom;
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac_addr);
|
||||
netdev_dbg(netdev, "mac address : %pM\n", adapter->hw.mac_addr);
|
||||
|
||||
INIT_WORK(&adapter->reset_task, atl1e_reset_task);
|
||||
|
|
|
@ -3027,7 +3027,7 @@ static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* mark random mac */
|
||||
netdev->addr_assign_type = NET_ADDR_RANDOM;
|
||||
}
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac_addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
err = -EIO;
|
||||
|
|
|
@ -931,7 +931,7 @@ static int atl2_set_mac(struct net_device *netdev, void *p)
|
|||
if (netif_running(netdev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
atl2_set_mac_addr(&adapter->hw);
|
||||
|
@ -1405,7 +1405,7 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
|
||||
/* copy the MAC address out of the EEPROM */
|
||||
atl2_read_mac_addr(&adapter->hw);
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac_addr);
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
err = -EIO;
|
||||
goto err_eeprom;
|
||||
|
|
|
@ -69,7 +69,7 @@ static int atlx_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
atlx_set_mac_addr(&adapter->hw);
|
||||
|
|
|
@ -1383,7 +1383,7 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
spin_lock_irq(&bp->lock);
|
||||
|
||||
|
|
|
@ -1850,7 +1850,7 @@ static int bcm_sysport_change_mac(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
/* interface is disabled, changes to MAC will be reflected on next
|
||||
* open call
|
||||
|
|
|
@ -7910,7 +7910,7 @@ bnx2_change_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
if (netif_running(dev))
|
||||
bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);
|
||||
|
||||
|
|
|
@ -4336,7 +4336,7 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p)
|
|||
return rc;
|
||||
}
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
if (netif_running(dev))
|
||||
rc = bnx2x_set_eth_mac(bp, true);
|
||||
|
|
|
@ -12369,7 +12369,7 @@ static int bnxt_change_mac_addr(struct net_device *dev, void *p)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
if (netif_running(dev)) {
|
||||
bnxt_close_nic(bp, false, false);
|
||||
rc = bnxt_open_nic(bp, false, false);
|
||||
|
|
|
@ -9366,7 +9366,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
if (!netif_running(dev))
|
||||
return 0;
|
||||
|
|
|
@ -1479,7 +1479,7 @@ static int xgmac_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
xgmac_set_mac_addr(ioaddr, dev->dev_addr, 0);
|
||||
|
||||
|
|
|
@ -2024,7 +2024,7 @@ static int liquidio_set_mac(struct net_device *netdev, void *p)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(((u8 *)&lio->linfo.hw_addr) + 2, addr->sa_data, ETH_ALEN);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1168,7 +1168,7 @@ static int liquidio_set_mac(struct net_device *netdev, void *p)
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
ether_addr_copy(((u8 *)&lio->linfo.hw_addr) + 2, addr->sa_data);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1611,7 +1611,7 @@ static int nicvf_set_mac_address(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
|
||||
if (nic->pdev->msix_enabled) {
|
||||
if (nicvf_hw_set_mac_addr(nic, netdev))
|
||||
|
|
|
@ -853,7 +853,7 @@ static int t1_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!mac->ops->macaddress_set)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
mac->ops->macaddress_set(mac, dev->dev_addr);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2586,7 +2586,7 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
t3_mac_set_address(&pi->mac, LAN_MAC_IDX, dev->dev_addr);
|
||||
if (offload_running(adapter))
|
||||
write_smt_entry(adapter, pi->port_id);
|
||||
|
|
|
@ -3468,7 +3468,7 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1218,7 +1218,7 @@ static int cxgb4vf_set_mac_addr(struct net_device *dev, void *_addr)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1227,7 +1227,7 @@ static int set_mac_address(struct net_device *dev, void *p)
|
|||
if (netif_running(dev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
cs89_dbg(0, debug, "%s: Setting MAC address to %pM\n",
|
||||
dev->name, dev->dev_addr);
|
||||
|
|
|
@ -985,7 +985,7 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr)
|
|||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -268,7 +268,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
|
|||
|
||||
if (is_valid_ether_addr(mac_addr)) {
|
||||
memcpy(net_dev->perm_addr, mac_addr, net_dev->addr_len);
|
||||
memcpy(net_dev->dev_addr, mac_addr, net_dev->addr_len);
|
||||
eth_hw_addr_set(net_dev, mac_addr);
|
||||
} else {
|
||||
eth_hw_addr_random(net_dev);
|
||||
err = priv->mac_dev->change_addr(priv->mac_dev->fman_mac,
|
||||
|
|
|
@ -4013,7 +4013,7 @@ static int dpaa2_eth_set_mac_addr(struct dpaa2_eth_priv *priv)
|
|||
return err;
|
||||
}
|
||||
}
|
||||
memcpy(net_dev->dev_addr, mac_addr, net_dev->addr_len);
|
||||
eth_hw_addr_set(net_dev, mac_addr);
|
||||
} else if (is_zero_ether_addr(dpni_mac_addr)) {
|
||||
/* No MAC address configured, fill in net_dev->dev_addr
|
||||
* with a random one
|
||||
|
@ -4038,7 +4038,7 @@ static int dpaa2_eth_set_mac_addr(struct dpaa2_eth_priv *priv)
|
|||
/* NET_ADDR_PERM is default, all we have to do is
|
||||
* fill in the device addr.
|
||||
*/
|
||||
memcpy(net_dev->dev_addr, dpni_mac_addr, net_dev->addr_len);
|
||||
eth_hw_addr_set(net_dev, dpni_mac_addr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -980,7 +980,7 @@ static int dpaa2_switch_port_set_mac_addr(struct ethsw_port_priv *port_priv)
|
|||
|
||||
/* First check if firmware has any address configured by bootloader */
|
||||
if (!is_zero_ether_addr(mac_addr)) {
|
||||
memcpy(net_dev->dev_addr, mac_addr, net_dev->addr_len);
|
||||
eth_hw_addr_set(net_dev, mac_addr);
|
||||
} else {
|
||||
/* No MAC address configured, fill in net_dev->dev_addr
|
||||
* with a random one
|
||||
|
|
|
@ -40,7 +40,7 @@ static int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr)
|
|||
if (!is_valid_ether_addr(saddr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(ndev->dev_addr, saddr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, saddr->sa_data);
|
||||
enetc_pf_set_primary_mac_addr(&priv->si->hw, 0, saddr->sa_data);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3326,7 +3326,7 @@ fec_set_mac_address(struct net_device *ndev, void *p)
|
|||
if (addr) {
|
||||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
}
|
||||
|
||||
/* Add netif status check here to avoid system hang in below case:
|
||||
|
|
|
@ -112,7 +112,7 @@ static int mpc52xx_fec_set_mac_address(struct net_device *dev, void *addr)
|
|||
{
|
||||
struct sockaddr *sock = addr;
|
||||
|
||||
memcpy(dev->dev_addr, sock->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, sock->sa_data);
|
||||
|
||||
mpc52xx_fec_set_paddr(dev, sock->sa_data);
|
||||
return 0;
|
||||
|
|
|
@ -3205,7 +3205,7 @@ static int ucc_geth_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
/*
|
||||
* If device is not running, we will set mac addr register
|
||||
|
|
|
@ -555,7 +555,7 @@ static int hisi_femac_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(skaddr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, skaddr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, skaddr->sa_data);
|
||||
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
|
||||
|
||||
hisi_femac_set_hw_mac_addr(priv, dev->dev_addr);
|
||||
|
|
|
@ -1194,7 +1194,7 @@ static int hns_nic_net_set_mac_address(struct net_device *ndev, void *p)
|
|||
return ret;
|
||||
}
|
||||
|
||||
memcpy(ndev->dev_addr, mac_addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, mac_addr->sa_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1741,7 +1741,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
|
|||
goto out_free;
|
||||
}
|
||||
|
||||
memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, mac_addr->sa_data);
|
||||
|
||||
/* Deregister old MAC in pHYP */
|
||||
if (port->state == EHEA_PORT_UP) {
|
||||
|
|
|
@ -1013,7 +1013,7 @@ static int emac_set_mac_address(struct net_device *ndev, void *sa)
|
|||
|
||||
mutex_lock(&dev->link_lock);
|
||||
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
|
||||
emac_rx_disable(dev);
|
||||
emac_tx_disable(dev);
|
||||
|
|
|
@ -2259,7 +2259,7 @@ static int e100_set_mac_address(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
e100_exec_cb(nic, NULL, e100_setup_iaaddr);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1103,7 +1103,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
e_err(probe, "EEPROM Read Error\n");
|
||||
}
|
||||
/* don't block initialization here due to bad MAC address */
|
||||
memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, hw->mac_addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr))
|
||||
e_err(probe, "Invalid MAC Address\n");
|
||||
|
@ -2209,7 +2209,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
|
|||
if (hw->mac_type == e1000_82542_rev2_0)
|
||||
e1000_enter_82542_rst(adapter);
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(hw->mac_addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
e1000_rar_set(hw, hw->mac_addr, 0);
|
||||
|
|
|
@ -4786,7 +4786,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(adapter->hw.mac.addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
hw->mac.ops.rar_set(&adapter->hw, adapter->hw.mac.addr, 0);
|
||||
|
@ -7589,7 +7589,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
dev_err(&pdev->dev,
|
||||
"NVM Read Error while reading MAC address\n");
|
||||
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac.addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
|
||||
|
|
|
@ -5144,7 +5144,7 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
|
|||
netif_addr_lock_bh(netdev);
|
||||
ether_addr_copy(old_mac, netdev->dev_addr);
|
||||
/* change the netdev's MAC address */
|
||||
memcpy(netdev->dev_addr, mac, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, mac);
|
||||
netif_addr_unlock_bh(netdev);
|
||||
|
||||
/* Clean up old MAC filter. Not an error if old filter doesn't exist */
|
||||
|
|
|
@ -3356,7 +3356,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
dev_err(&pdev->dev, "NVM Read Error\n");
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, hw->mac.addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
dev_err(&pdev->dev, "Invalid MAC Address\n");
|
||||
|
@ -4988,7 +4988,7 @@ static int igb_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
/* set the correct pool for the new PF MAC address in entry 0 */
|
||||
|
|
|
@ -1527,8 +1527,7 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
|
|||
spin_unlock_bh(&hw->mbx_lock);
|
||||
|
||||
if (is_valid_ether_addr(adapter->hw.mac.addr)) {
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
|
||||
netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac.addr);
|
||||
memcpy(netdev->perm_addr, adapter->hw.mac.addr,
|
||||
netdev->addr_len);
|
||||
}
|
||||
|
@ -1813,7 +1812,7 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
|
|||
if (!ether_addr_equal(addr->sa_data, hw->mac.addr))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2816,8 +2815,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
else if (is_zero_ether_addr(adapter->hw.mac.addr))
|
||||
dev_info(&pdev->dev,
|
||||
"MAC address not assigned by administrator.\n");
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
|
||||
netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac.addr);
|
||||
}
|
||||
|
||||
spin_unlock_bh(&hw->mbx_lock);
|
||||
|
|
|
@ -949,7 +949,7 @@ static int igc_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
/* set the correct pool for the new PF MAC address in entry 0 */
|
||||
|
@ -6377,7 +6377,7 @@ static int igc_probe(struct pci_dev *pdev,
|
|||
dev_err(&pdev->dev, "NVM Read Error\n");
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, hw->mac.addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
dev_err(&pdev->dev, "Invalid MAC Address\n");
|
||||
|
|
|
@ -1030,7 +1030,7 @@ ixgb_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
|
||||
ixgb_rar_set(&adapter->hw, addr->sa_data, 0);
|
||||
|
||||
|
|
|
@ -8792,7 +8792,7 @@ static int ixgbe_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
|
||||
|
||||
ixgbe_mac_set_default_filter(adapter);
|
||||
|
@ -10927,7 +10927,7 @@ skip_sriov:
|
|||
eth_platform_get_mac_address(&adapter->pdev->dev,
|
||||
adapter->hw.mac.perm_addr);
|
||||
|
||||
memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, hw->mac.perm_addr);
|
||||
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
e_dev_err("invalid MAC address\n");
|
||||
|
|
|
@ -2254,7 +2254,7 @@ jme_set_macaddr(struct net_device *netdev, void *p)
|
|||
return -EBUSY;
|
||||
|
||||
spin_lock_bh(&jme->macaddr_lock);
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
jme_set_unicastaddr(netdev);
|
||||
spin_unlock_bh(&jme->macaddr_lock);
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ int otx2_set_mac_address(struct net_device *netdev, void *p)
|
|||
return -EADDRNOTAVAIL;
|
||||
|
||||
if (!otx2_hw_set_mac_addr(pfvf, addr->sa_data)) {
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
/* update dmac field in vlan offload rule */
|
||||
if (netif_running(netdev) &&
|
||||
pfvf->flags & OTX2_FLAG_RX_VLAN_SUPPORT)
|
||||
|
|
|
@ -674,7 +674,7 @@ static int mlxsw_sp_port_set_mac_address(struct net_device *dev, void *p)
|
|||
err = mlxsw_sp_port_dev_addr_set(mlxsw_sp_port, addr->sa_data);
|
||||
if (err)
|
||||
return err;
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1064,7 +1064,7 @@ static int ks8842_set_mac(struct net_device *netdev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, mac, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, mac);
|
||||
|
||||
ks8842_write_mac_addr(adapter, mac);
|
||||
return 0;
|
||||
|
@ -1191,8 +1191,7 @@ static int ks8842_probe(struct platform_device *pdev)
|
|||
|
||||
if (i < netdev->addr_len)
|
||||
/* an address was passed, use it */
|
||||
memcpy(netdev->dev_addr, pdata->macaddr,
|
||||
netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, pdata->macaddr);
|
||||
}
|
||||
|
||||
if (i == netdev->addr_len) {
|
||||
|
|
|
@ -761,7 +761,7 @@ static int encx24j600_set_mac_address(struct net_device *dev, void *addr)
|
|||
if (!is_valid_ether_addr(address->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, address->sa_data);
|
||||
return encx24j600_set_hw_macaddr(dev);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ static int moxart_set_mac_address(struct net_device *ndev, void *addr)
|
|||
if (!is_valid_ether_addr(address->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, address->sa_data);
|
||||
moxart_update_mac_address(ndev);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -5202,7 +5202,7 @@ static int s2io_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
/* store the MAC address in CAM */
|
||||
return do_s2io_prog_unicast(dev, dev->dev_addr);
|
||||
|
|
|
@ -1328,7 +1328,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
|
|||
}
|
||||
|
||||
if (unlikely(!is_vxge_card_up(vdev))) {
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
return VXGE_HW_OK;
|
||||
}
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -2137,7 +2137,7 @@ static int pch_gbe_set_mac(struct net_device *netdev, void *addr)
|
|||
if (!is_valid_ether_addr(skaddr->sa_data)) {
|
||||
ret_val = -EADDRNOTAVAIL;
|
||||
} else {
|
||||
memcpy(netdev->dev_addr, skaddr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, skaddr->sa_data);
|
||||
memcpy(adapter->hw.mac.addr, skaddr->sa_data, netdev->addr_len);
|
||||
pch_gbe_mac_mar_set(&adapter->hw, adapter->hw.mac.addr, 0);
|
||||
ret_val = 0;
|
||||
|
@ -2555,7 +2555,7 @@ static int pch_gbe_probe(struct pci_dev *pdev,
|
|||
goto err_free_adapter;
|
||||
}
|
||||
|
||||
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, adapter->hw.mac.addr);
|
||||
if (!is_valid_ether_addr(netdev->dev_addr)) {
|
||||
/*
|
||||
* If the MAC is invalid (or just missing), display a warning
|
||||
|
|
|
@ -221,7 +221,7 @@ static int pasemi_mac_set_mac_addr(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
adr0 = dev->dev_addr[2] << 24 |
|
||||
dev->dev_addr[3] << 16 |
|
||||
|
|
|
@ -500,7 +500,7 @@ static int netxen_nic_set_mac(struct net_device *netdev, void *p)
|
|||
}
|
||||
|
||||
memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
adapter->macaddr_set(adapter, addr->sa_data);
|
||||
|
||||
if (netif_running(netdev)) {
|
||||
|
|
|
@ -3564,7 +3564,7 @@ static int ql3xxx_set_mac_address(struct net_device *ndev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
|
||||
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
|
||||
/* Program lower 32 bits of the MAC address */
|
||||
|
|
|
@ -356,7 +356,7 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
|
|||
|
||||
qlcnic_delete_adapter_mac(adapter);
|
||||
memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
|
||||
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, addr->sa_data);
|
||||
qlcnic_set_multi(adapter->netdev);
|
||||
|
||||
if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
|
||||
|
|
|
@ -1624,7 +1624,7 @@ static int cp_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
spin_lock_irq(&cp->lock);
|
||||
|
||||
|
|
|
@ -2238,7 +2238,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
|
|||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
spin_lock_irq(&tp->lock);
|
||||
|
||||
|
|
|
@ -1954,7 +1954,7 @@ static int rocker_port_set_mac_address(struct net_device *dev, void *p)
|
|||
err = rocker_cmd_set_port_settings_macaddr(rocker_port, addr->sa_data);
|
||||
if (err)
|
||||
return err;
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ static int sgiseeq_set_mac_address(struct net_device *dev, void *addr)
|
|||
struct sgiseeq_private *sp = netdev_priv(dev);
|
||||
struct sockaddr *sa = addr;
|
||||
|
||||
memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, sa->sa_data);
|
||||
|
||||
spin_lock_irq(&sp->tx_lock);
|
||||
__sgiseeq_set_mac_address(dev);
|
||||
|
|
|
@ -243,7 +243,7 @@ static int ioc3_set_mac_address(struct net_device *dev, void *addr)
|
|||
struct ioc3_private *ip = netdev_priv(dev);
|
||||
struct sockaddr *sa = addr;
|
||||
|
||||
memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, sa->sa_data);
|
||||
|
||||
spin_lock_irq(&ip->ioc3_lock);
|
||||
__ioc3_set_mac_address(dev);
|
||||
|
|
|
@ -9235,7 +9235,7 @@ static int niu_get_of_props(struct niu *np)
|
|||
netdev_err(dev, "%pOF: OF MAC address prop len (%d) is wrong\n",
|
||||
dp, prop_len);
|
||||
}
|
||||
memcpy(dev->dev_addr, mac_addr, dev->addr_len);
|
||||
eth_hw_addr_set(dev, mac_addr);
|
||||
if (!is_valid_ether_addr(&dev->dev_addr[0])) {
|
||||
netdev_err(dev, "%pOF: OF MAC address is invalid\n", dp);
|
||||
netdev_err(dev, "%pOF: [ %pM ]\n", dp, dev->dev_addr);
|
||||
|
|
|
@ -2437,7 +2437,7 @@ static int gem_set_mac_address(struct net_device *dev, void *addr)
|
|||
if (!is_valid_ether_addr(macaddr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, macaddr->sa_data);
|
||||
|
||||
/* We'll just catch it later when the device is up'd or resumed */
|
||||
if (!netif_running(dev) || !netif_device_present(dev))
|
||||
|
|
|
@ -78,7 +78,7 @@ static int xlgmac_init(struct xlgmac_pdata *pdata)
|
|||
netdev->irq = pdata->dev_irq;
|
||||
netdev->base_addr = (unsigned long)pdata->mac_regs;
|
||||
xlgmac_read_mac_addr(pdata);
|
||||
memcpy(netdev->dev_addr, pdata->mac_addr, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, pdata->mac_addr);
|
||||
|
||||
/* Set all the function pointers */
|
||||
xlgmac_init_all_ops(pdata);
|
||||
|
|
|
@ -798,7 +798,7 @@ static int xlgmac_set_mac_address(struct net_device *netdev, void *addr)
|
|||
if (!is_valid_ether_addr(saddr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
memcpy(netdev->dev_addr, saddr->sa_data, netdev->addr_len);
|
||||
eth_hw_addr_set(netdev, saddr->sa_data);
|
||||
|
||||
hw_ops->set_mac_address(pdata, netdev->dev_addr);
|
||||
|
||||
|
|
|
@ -832,7 +832,7 @@ static int bdx_set_mac(struct net_device *ndev, void *p)
|
|||
if (netif_running(dev))
|
||||
return -EBUSY
|
||||
*/
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
bdx_restore_mac(ndev, priv);
|
||||
RET(0);
|
||||
}
|
||||
|
|
|
@ -1132,7 +1132,7 @@ static int emac_dev_setmac_addr(struct net_device *ndev, void *addr)
|
|||
|
||||
/* Store mac addr in priv and rx channel and set it in EMAC hw */
|
||||
memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len);
|
||||
memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, sa->sa_data);
|
||||
|
||||
/* MAC address is configured only after the interface is enabled. */
|
||||
if (netif_running(ndev)) {
|
||||
|
|
|
@ -511,7 +511,7 @@ static int xemaclite_set_mac_address(struct net_device *dev, void *address)
|
|||
if (netif_running(dev))
|
||||
return -EBUSY;
|
||||
|
||||
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
xemaclite_update_address(lp, dev->dev_addr);
|
||||
return 0;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче