Merge branch 'ethernet-more-netdev-dev_addr-write-removals'
Jakub Kicinski says: ==================== ethernet: more netdev->dev_addr write removals Another series removing direct writes to netdev->dev_addr. ==================== Link: https://lore.kernel.org/r/20211013204435.322561-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
2b4731b153
@ -567,6 +567,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
|
||||
{
|
||||
struct corkscrew_private *vp = netdev_priv(dev);
|
||||
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
|
||||
__be16 addr[ETH_ALEN / 2];
|
||||
int i;
|
||||
int irq;
|
||||
|
||||
@ -619,7 +620,6 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
|
||||
/* Read the station address from the EEPROM. */
|
||||
EL3WINDOW(0);
|
||||
for (i = 0; i < 0x18; i++) {
|
||||
__be16 *phys_addr = (__be16 *) dev->dev_addr;
|
||||
int timer;
|
||||
outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd);
|
||||
/* Pause for at least 162 us. for the read to take place. */
|
||||
@ -631,8 +631,9 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
|
||||
eeprom[i] = inw(ioaddr + Wn0EepromData);
|
||||
checksum ^= eeprom[i];
|
||||
if (i < 3)
|
||||
phys_addr[i] = htons(eeprom[i]);
|
||||
addr[i] = htons(eeprom[i]);
|
||||
}
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
checksum = (checksum ^ (checksum >> 8)) & 0xff;
|
||||
if (checksum != 0x00)
|
||||
pr_cont(" ***INVALID CHECKSUM %4.4x*** ", checksum);
|
||||
|
@ -305,15 +305,13 @@ static int tc574_config(struct pcmcia_device *link)
|
||||
struct net_device *dev = link->priv;
|
||||
struct el3_private *lp = netdev_priv(dev);
|
||||
int ret, i, j;
|
||||
__be16 addr[ETH_ALEN / 2];
|
||||
unsigned int ioaddr;
|
||||
__be16 *phys_addr;
|
||||
char *cardname;
|
||||
__u32 config;
|
||||
u8 *buf;
|
||||
size_t len;
|
||||
|
||||
phys_addr = (__be16 *)dev->dev_addr;
|
||||
|
||||
dev_dbg(&link->dev, "3c574_config()\n");
|
||||
|
||||
link->io_lines = 16;
|
||||
@ -347,19 +345,20 @@ static int tc574_config(struct pcmcia_device *link)
|
||||
len = pcmcia_get_tuple(link, 0x88, &buf);
|
||||
if (buf && len >= 6) {
|
||||
for (i = 0; i < 3; i++)
|
||||
phys_addr[i] = htons(le16_to_cpu(buf[i * 2]));
|
||||
addr[i] = htons(le16_to_cpu(buf[i * 2]));
|
||||
kfree(buf);
|
||||
} else {
|
||||
kfree(buf); /* 0 < len < 6 */
|
||||
EL3WINDOW(0);
|
||||
for (i = 0; i < 3; i++)
|
||||
phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));
|
||||
if (phys_addr[0] == htons(0x6060)) {
|
||||
addr[i] = htons(read_eeprom(ioaddr, i + 10));
|
||||
if (addr[0] == htons(0x6060)) {
|
||||
pr_notice("IO port conflict at 0x%03lx-0x%03lx\n",
|
||||
dev->base_addr, dev->base_addr+15);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
if (link->prod_id[1])
|
||||
cardname = link->prod_id[1];
|
||||
else
|
||||
|
@ -237,8 +237,8 @@ static void tc589_detach(struct pcmcia_device *link)
|
||||
static int tc589_config(struct pcmcia_device *link)
|
||||
{
|
||||
struct net_device *dev = link->priv;
|
||||
__be16 *phys_addr;
|
||||
int ret, i, j, multi = 0, fifo;
|
||||
__be16 addr[ETH_ALEN / 2];
|
||||
unsigned int ioaddr;
|
||||
static const char * const ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
|
||||
u8 *buf;
|
||||
@ -246,7 +246,6 @@ static int tc589_config(struct pcmcia_device *link)
|
||||
|
||||
dev_dbg(&link->dev, "3c589_config\n");
|
||||
|
||||
phys_addr = (__be16 *)dev->dev_addr;
|
||||
/* Is this a 3c562? */
|
||||
if (link->manf_id != MANFID_3COM)
|
||||
dev_info(&link->dev, "hmmm, is this really a 3Com card??\n");
|
||||
@ -285,18 +284,19 @@ static int tc589_config(struct pcmcia_device *link)
|
||||
len = pcmcia_get_tuple(link, 0x88, &buf);
|
||||
if (buf && len >= 6) {
|
||||
for (i = 0; i < 3; i++)
|
||||
phys_addr[i] = htons(le16_to_cpu(buf[i*2]));
|
||||
addr[i] = htons(le16_to_cpu(buf[i*2]));
|
||||
kfree(buf);
|
||||
} else {
|
||||
kfree(buf); /* 0 < len < 6 */
|
||||
for (i = 0; i < 3; i++)
|
||||
phys_addr[i] = htons(read_eeprom(ioaddr, i));
|
||||
if (phys_addr[0] == htons(0x6060)) {
|
||||
addr[i] = htons(read_eeprom(ioaddr, i));
|
||||
if (addr[0] == htons(0x6060)) {
|
||||
dev_err(&link->dev, "IO port conflict at 0x%03lx-0x%03lx\n",
|
||||
dev->base_addr, dev->base_addr+15);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
|
||||
/* The address and resource configuration register aren't loaded from
|
||||
* the EEPROM and *must* be set to 0 and IRQ3 for the PCMCIA version.
|
||||
|
@ -1091,6 +1091,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
|
||||
struct vortex_private *vp;
|
||||
int option;
|
||||
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
|
||||
__be16 addr[ETH_ALEN / 2];
|
||||
int i, step;
|
||||
struct net_device *dev;
|
||||
static int printed_version;
|
||||
@ -1284,7 +1285,8 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
|
||||
if ((checksum != 0x00) && !(vci->drv_flags & IS_TORNADO))
|
||||
pr_cont(" ***INVALID CHECKSUM %4.4x*** ", checksum);
|
||||
for (i = 0; i < 3; i++)
|
||||
((__be16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
|
||||
addr[i] = htons(eeprom[i + 10]);
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
if (print_info)
|
||||
pr_cont(" %pM", dev->dev_addr);
|
||||
/* Unfortunately an all zero eeprom passes the checksum and this
|
||||
|
@ -342,7 +342,7 @@ static u32 owl_emac_dma_cmd_stop(struct owl_emac_priv *priv)
|
||||
static void owl_emac_set_hw_mac_addr(struct net_device *netdev)
|
||||
{
|
||||
struct owl_emac_priv *priv = netdev_priv(netdev);
|
||||
u8 *mac_addr = netdev->dev_addr;
|
||||
const u8 *mac_addr = netdev->dev_addr;
|
||||
u32 addr_high, addr_low;
|
||||
|
||||
addr_high = mac_addr[0] << 8 | mac_addr[1];
|
||||
|
@ -955,7 +955,7 @@ static int netdev_open(struct net_device *dev)
|
||||
writew(0, ioaddr + PerfFilterTable + 4);
|
||||
writew(0, ioaddr + PerfFilterTable + 8);
|
||||
for (i = 1; i < 16; i++) {
|
||||
__be16 *eaddrs = (__be16 *)dev->dev_addr;
|
||||
const __be16 *eaddrs = (const __be16 *)dev->dev_addr;
|
||||
void __iomem *setup_frm = ioaddr + PerfFilterTable + i * 16;
|
||||
writew(be16_to_cpu(eaddrs[2]), setup_frm); setup_frm += 4;
|
||||
writew(be16_to_cpu(eaddrs[1]), setup_frm); setup_frm += 4;
|
||||
@ -1787,14 +1787,14 @@ static void set_rx_mode(struct net_device *dev)
|
||||
} else if (netdev_mc_count(dev) <= 14) {
|
||||
/* Use the 16 element perfect filter, skip first two entries. */
|
||||
void __iomem *filter_addr = ioaddr + PerfFilterTable + 2 * 16;
|
||||
__be16 *eaddrs;
|
||||
const __be16 *eaddrs;
|
||||
netdev_for_each_mc_addr(ha, dev) {
|
||||
eaddrs = (__be16 *) ha->addr;
|
||||
writew(be16_to_cpu(eaddrs[2]), filter_addr); filter_addr += 4;
|
||||
writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4;
|
||||
writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 8;
|
||||
}
|
||||
eaddrs = (__be16 *)dev->dev_addr;
|
||||
eaddrs = (const __be16 *)dev->dev_addr;
|
||||
i = netdev_mc_count(dev) + 2;
|
||||
while (i++ < 16) {
|
||||
writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 4;
|
||||
@ -1805,7 +1805,7 @@ static void set_rx_mode(struct net_device *dev)
|
||||
} else {
|
||||
/* Must use a multicast hash table. */
|
||||
void __iomem *filter_addr;
|
||||
__be16 *eaddrs;
|
||||
const __be16 *eaddrs;
|
||||
__le16 mc_filter[32] __attribute__ ((aligned(sizeof(long)))); /* Multicast hash filter */
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
@ -1819,7 +1819,7 @@ static void set_rx_mode(struct net_device *dev)
|
||||
}
|
||||
/* Clear the perfect filter list, skip first two entries. */
|
||||
filter_addr = ioaddr + PerfFilterTable + 2 * 16;
|
||||
eaddrs = (__be16 *)dev->dev_addr;
|
||||
eaddrs = (const __be16 *)dev->dev_addr;
|
||||
for (i = 2; i < 16; i++) {
|
||||
writew(be16_to_cpu(eaddrs[0]), filter_addr); filter_addr += 4;
|
||||
writew(be16_to_cpu(eaddrs[1]), filter_addr); filter_addr += 4;
|
||||
|
@ -1008,7 +1008,7 @@ static void slic_set_link_autoneg(struct slic_device *sdev)
|
||||
|
||||
static void slic_set_mac_address(struct slic_device *sdev)
|
||||
{
|
||||
u8 *addr = sdev->netdev->dev_addr;
|
||||
const u8 *addr = sdev->netdev->dev_addr;
|
||||
u32 val;
|
||||
|
||||
val = addr[5] | addr[4] << 8 | addr[3] << 16 | addr[2] << 24;
|
||||
|
@ -2712,7 +2712,7 @@ static int ace_set_mac_addr(struct net_device *dev, void *p)
|
||||
struct ace_private *ap = netdev_priv(dev);
|
||||
struct ace_regs __iomem *regs = ap->regs;
|
||||
struct sockaddr *addr=p;
|
||||
u8 *da;
|
||||
const u8 *da;
|
||||
struct cmd cmd;
|
||||
|
||||
if(netif_running(dev))
|
||||
@ -2720,7 +2720,7 @@ static int ace_set_mac_addr(struct net_device *dev, void *p)
|
||||
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
da = (u8 *)dev->dev_addr;
|
||||
da = (const u8 *)dev->dev_addr;
|
||||
|
||||
writel(da[0] << 8 | da[1], ®s->MacAddrHi);
|
||||
writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5],
|
||||
|
@ -849,7 +849,7 @@ static int init_phy(struct net_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void tse_update_mac_addr(struct altera_tse_private *priv, u8 *addr)
|
||||
static void tse_update_mac_addr(struct altera_tse_private *priv, const u8 *addr)
|
||||
{
|
||||
u32 msb;
|
||||
u32 lsb;
|
||||
|
@ -529,7 +529,8 @@ static void mace_write(mace_private *lp, unsigned int ioaddr, int reg,
|
||||
mace_init
|
||||
Resets the MACE chip.
|
||||
---------------------------------------------------------------------------- */
|
||||
static int mace_init(mace_private *lp, unsigned int ioaddr, char *enet_addr)
|
||||
static int mace_init(mace_private *lp, unsigned int ioaddr,
|
||||
const char *enet_addr)
|
||||
{
|
||||
int i;
|
||||
int ct = 0;
|
||||
|
@ -305,7 +305,6 @@ static int __init lance_probe( struct net_device *dev)
|
||||
unsigned long ioaddr;
|
||||
|
||||
struct lance_private *lp;
|
||||
int i;
|
||||
static int did_version;
|
||||
volatile unsigned short *ioaddr_probe;
|
||||
unsigned short tmp1, tmp2;
|
||||
@ -373,8 +372,7 @@ static int __init lance_probe( struct net_device *dev)
|
||||
dev->irq);
|
||||
|
||||
/* copy in the ethernet address from the prom */
|
||||
for(i = 0; i < 6 ; i++)
|
||||
dev->dev_addr[i] = idprom->id_ethaddr[i];
|
||||
eth_hw_addr_set(dev, idprom->id_ethaddr);
|
||||
|
||||
/* tell the card it's ether address, bytes swapped */
|
||||
MEM->init.hwaddr[0] = dev->dev_addr[1];
|
||||
|
@ -1301,7 +1301,6 @@ static int sparc_lance_probe_one(struct platform_device *op,
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
struct lance_private *lp;
|
||||
struct net_device *dev;
|
||||
int i;
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct lance_private) + 8);
|
||||
if (!dev)
|
||||
@ -1315,8 +1314,7 @@ static int sparc_lance_probe_one(struct platform_device *op,
|
||||
* will copy the address in the device structure to the lance
|
||||
* initialization block.
|
||||
*/
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = idprom->id_ethaddr[i];
|
||||
eth_hw_addr_set(dev, idprom->id_ethaddr);
|
||||
|
||||
/* Get the IO region */
|
||||
lp->lregs = of_ioremap(&op->resource[0], 0,
|
||||
|
@ -1080,7 +1080,7 @@ static int xgbe_add_mac_addresses(struct xgbe_prv_data *pdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xgbe_set_mac_address(struct xgbe_prv_data *pdata, u8 *addr)
|
||||
static int xgbe_set_mac_address(struct xgbe_prv_data *pdata, const u8 *addr)
|
||||
{
|
||||
unsigned int mac_addr_hi, mac_addr_lo;
|
||||
|
||||
|
@ -729,7 +729,7 @@ struct xgbe_ext_stats {
|
||||
struct xgbe_hw_if {
|
||||
int (*tx_complete)(struct xgbe_ring_desc *);
|
||||
|
||||
int (*set_mac_address)(struct xgbe_prv_data *, u8 *addr);
|
||||
int (*set_mac_address)(struct xgbe_prv_data *, const u8 *addr);
|
||||
int (*config_rx_mode)(struct xgbe_prv_data *);
|
||||
|
||||
int (*enable_rx_csum)(struct xgbe_prv_data *);
|
||||
|
@ -65,7 +65,7 @@ void xge_mac_set_speed(struct xge_pdata *pdata)
|
||||
|
||||
void xge_mac_set_station_addr(struct xge_pdata *pdata)
|
||||
{
|
||||
u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
const u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
u32 addr0, addr1;
|
||||
|
||||
addr0 = (dev_addr[3] << 24) | (dev_addr[2] << 16) |
|
||||
|
@ -378,8 +378,8 @@ u32 xgene_enet_rd_stat(struct xgene_enet_pdata *pdata, u32 rd_addr)
|
||||
|
||||
static void xgene_gmac_set_mac_addr(struct xgene_enet_pdata *pdata)
|
||||
{
|
||||
const u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
u32 addr0, addr1;
|
||||
u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
|
||||
addr0 = (dev_addr[3] << 24) | (dev_addr[2] << 16) |
|
||||
(dev_addr[1] << 8) | dev_addr[0];
|
||||
|
@ -165,8 +165,8 @@ static void xgene_sgmac_reset(struct xgene_enet_pdata *p)
|
||||
|
||||
static void xgene_sgmac_set_mac_addr(struct xgene_enet_pdata *p)
|
||||
{
|
||||
const u8 *dev_addr = p->ndev->dev_addr;
|
||||
u32 addr0, addr1;
|
||||
u8 *dev_addr = p->ndev->dev_addr;
|
||||
|
||||
addr0 = (dev_addr[3] << 24) | (dev_addr[2] << 16) |
|
||||
(dev_addr[1] << 8) | dev_addr[0];
|
||||
|
@ -207,8 +207,8 @@ static void xgene_pcs_reset(struct xgene_enet_pdata *pdata)
|
||||
|
||||
static void xgene_xgmac_set_mac_addr(struct xgene_enet_pdata *pdata)
|
||||
{
|
||||
const u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
u32 addr0, addr1;
|
||||
u8 *dev_addr = pdata->ndev->dev_addr;
|
||||
|
||||
addr0 = (dev_addr[3] << 24) | (dev_addr[2] << 16) |
|
||||
(dev_addr[1] << 8) | dev_addr[0];
|
||||
|
@ -308,7 +308,7 @@ bmac_init_registers(struct net_device *dev)
|
||||
{
|
||||
struct bmac_data *bp = netdev_priv(dev);
|
||||
volatile unsigned short regValue;
|
||||
unsigned short *pWord16;
|
||||
const unsigned short *pWord16;
|
||||
int i;
|
||||
|
||||
/* XXDEBUG(("bmac: enter init_registers\n")); */
|
||||
@ -371,7 +371,7 @@ bmac_init_registers(struct net_device *dev)
|
||||
bmwrite(dev, BHASH1, bp->hash_table_mask[2]); /* bits 47 - 32 */
|
||||
bmwrite(dev, BHASH0, bp->hash_table_mask[3]); /* bits 63 - 48 */
|
||||
|
||||
pWord16 = (unsigned short *)dev->dev_addr;
|
||||
pWord16 = (const unsigned short *)dev->dev_addr;
|
||||
bmwrite(dev, MADD0, *pWord16++);
|
||||
bmwrite(dev, MADD1, *pWord16++);
|
||||
bmwrite(dev, MADD2, *pWord16);
|
||||
@ -521,19 +521,16 @@ static int bmac_resume(struct macio_dev *mdev)
|
||||
static int bmac_set_address(struct net_device *dev, void *addr)
|
||||
{
|
||||
struct bmac_data *bp = netdev_priv(dev);
|
||||
unsigned char *p = addr;
|
||||
unsigned short *pWord16;
|
||||
const unsigned short *pWord16;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
XXDEBUG(("bmac: enter set_address\n"));
|
||||
spin_lock_irqsave(&bp->lock, flags);
|
||||
|
||||
for (i = 0; i < 6; ++i) {
|
||||
dev->dev_addr[i] = p[i];
|
||||
}
|
||||
eth_hw_addr_set(dev, addr);
|
||||
|
||||
/* load up the hardware address */
|
||||
pWord16 = (unsigned short *)dev->dev_addr;
|
||||
pWord16 = (const unsigned short *)dev->dev_addr;
|
||||
bmwrite(dev, MADD0, *pWord16++);
|
||||
bmwrite(dev, MADD1, *pWord16++);
|
||||
bmwrite(dev, MADD2, *pWord16);
|
||||
|
@ -217,7 +217,7 @@ struct aq_hw_ops {
|
||||
int (*hw_ring_tx_head_update)(struct aq_hw_s *self,
|
||||
struct aq_ring_s *aq_ring);
|
||||
|
||||
int (*hw_set_mac_address)(struct aq_hw_s *self, u8 *mac_addr);
|
||||
int (*hw_set_mac_address)(struct aq_hw_s *self, const u8 *mac_addr);
|
||||
|
||||
int (*hw_soft_reset)(struct aq_hw_s *self);
|
||||
|
||||
@ -226,7 +226,7 @@ struct aq_hw_ops {
|
||||
|
||||
int (*hw_reset)(struct aq_hw_s *self);
|
||||
|
||||
int (*hw_init)(struct aq_hw_s *self, u8 *mac_addr);
|
||||
int (*hw_init)(struct aq_hw_s *self, const u8 *mac_addr);
|
||||
|
||||
int (*hw_start)(struct aq_hw_s *self);
|
||||
|
||||
@ -373,7 +373,7 @@ struct aq_fw_ops {
|
||||
int (*set_phyloopback)(struct aq_hw_s *self, u32 mode, bool enable);
|
||||
|
||||
int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
|
||||
u8 *mac);
|
||||
const u8 *mac);
|
||||
|
||||
int (*send_fw_request)(struct aq_hw_s *self,
|
||||
const struct hw_fw_request_iface *fw_req,
|
||||
|
@ -35,7 +35,7 @@ static int aq_apply_macsec_cfg(struct aq_nic_s *nic);
|
||||
static int aq_apply_secy_cfg(struct aq_nic_s *nic,
|
||||
const struct macsec_secy *secy);
|
||||
|
||||
static void aq_ether_addr_to_mac(u32 mac[2], unsigned char *emac)
|
||||
static void aq_ether_addr_to_mac(u32 mac[2], const unsigned char *emac)
|
||||
{
|
||||
u32 tmp[2] = { 0 };
|
||||
|
||||
|
@ -322,7 +322,7 @@ static int hw_atl_a0_hw_init_rx_path(struct aq_hw_s *self)
|
||||
return aq_hw_err_from_flags(self);
|
||||
}
|
||||
|
||||
static int hw_atl_a0_hw_mac_addr_set(struct aq_hw_s *self, u8 *mac_addr)
|
||||
static int hw_atl_a0_hw_mac_addr_set(struct aq_hw_s *self, const u8 *mac_addr)
|
||||
{
|
||||
unsigned int h = 0U;
|
||||
unsigned int l = 0U;
|
||||
@ -348,7 +348,7 @@ err_exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int hw_atl_a0_hw_init(struct aq_hw_s *self, u8 *mac_addr)
|
||||
static int hw_atl_a0_hw_init(struct aq_hw_s *self, const u8 *mac_addr)
|
||||
{
|
||||
static u32 aq_hw_atl_igcr_table_[4][2] = {
|
||||
[AQ_HW_IRQ_INVALID] = { 0x20000000U, 0x20000000U },
|
||||
|
@ -533,7 +533,7 @@ static int hw_atl_b0_hw_init_rx_path(struct aq_hw_s *self)
|
||||
return aq_hw_err_from_flags(self);
|
||||
}
|
||||
|
||||
int hw_atl_b0_hw_mac_addr_set(struct aq_hw_s *self, u8 *mac_addr)
|
||||
int hw_atl_b0_hw_mac_addr_set(struct aq_hw_s *self, const u8 *mac_addr)
|
||||
{
|
||||
unsigned int h = 0U;
|
||||
unsigned int l = 0U;
|
||||
@ -558,7 +558,7 @@ err_exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int hw_atl_b0_hw_init(struct aq_hw_s *self, u8 *mac_addr)
|
||||
static int hw_atl_b0_hw_init(struct aq_hw_s *self, const u8 *mac_addr)
|
||||
{
|
||||
static u32 aq_hw_atl_igcr_table_[4][2] = {
|
||||
[AQ_HW_IRQ_INVALID] = { 0x20000000U, 0x20000000U },
|
||||
|
@ -58,7 +58,7 @@ int hw_atl_b0_hw_ring_rx_stop(struct aq_hw_s *self, struct aq_ring_s *ring);
|
||||
|
||||
void hw_atl_b0_hw_init_rx_rss_ctrl1(struct aq_hw_s *self);
|
||||
|
||||
int hw_atl_b0_hw_mac_addr_set(struct aq_hw_s *self, u8 *mac_addr);
|
||||
int hw_atl_b0_hw_mac_addr_set(struct aq_hw_s *self, const u8 *mac_addr);
|
||||
|
||||
int hw_atl_b0_set_fc(struct aq_hw_s *self, u32 fc, u32 tc);
|
||||
int hw_atl_b0_set_loopback(struct aq_hw_s *self, u32 mode, bool enable);
|
||||
|
@ -944,7 +944,7 @@ u32 hw_atl_utils_get_fw_version(struct aq_hw_s *self)
|
||||
}
|
||||
|
||||
static int aq_fw1x_set_wake_magic(struct aq_hw_s *self, bool wol_enabled,
|
||||
u8 *mac)
|
||||
const u8 *mac)
|
||||
{
|
||||
struct hw_atl_utils_fw_rpc *prpc = NULL;
|
||||
unsigned int rpc_size = 0U;
|
||||
@ -987,7 +987,7 @@ err_exit:
|
||||
}
|
||||
|
||||
static int aq_fw1x_set_power(struct aq_hw_s *self, unsigned int power_state,
|
||||
u8 *mac)
|
||||
const u8 *mac)
|
||||
{
|
||||
struct hw_atl_utils_fw_rpc *prpc = NULL;
|
||||
unsigned int rpc_size = 0U;
|
||||
|
@ -358,7 +358,7 @@ static int aq_fw2x_get_phy_temp(struct aq_hw_s *self, int *temp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aq_fw2x_set_wol(struct aq_hw_s *self, u8 *mac)
|
||||
static int aq_fw2x_set_wol(struct aq_hw_s *self, const u8 *mac)
|
||||
{
|
||||
struct hw_atl_utils_fw_rpc *rpc = NULL;
|
||||
struct offload_info *info = NULL;
|
||||
@ -404,7 +404,7 @@ err_exit:
|
||||
}
|
||||
|
||||
static int aq_fw2x_set_power(struct aq_hw_s *self, unsigned int power_state,
|
||||
u8 *mac)
|
||||
const u8 *mac)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
@ -516,7 +516,7 @@ static int hw_atl2_hw_init_rx_path(struct aq_hw_s *self)
|
||||
return aq_hw_err_from_flags(self);
|
||||
}
|
||||
|
||||
static int hw_atl2_hw_init(struct aq_hw_s *self, u8 *mac_addr)
|
||||
static int hw_atl2_hw_init(struct aq_hw_s *self, const u8 *mac_addr)
|
||||
{
|
||||
static u32 aq_hw_atl2_igcr_table_[4][2] = {
|
||||
[AQ_HW_IRQ_INVALID] = { 0x20000000U, 0x20000000U },
|
||||
|
@ -1971,7 +1971,7 @@ static int ag71xx_probe(struct platform_device *pdev)
|
||||
err = of_get_ethdev_address(np, ndev);
|
||||
if (err) {
|
||||
netif_err(ag, probe, ndev, "invalid MAC address, using random address\n");
|
||||
eth_random_addr(ndev->dev_addr);
|
||||
eth_hw_addr_random(ndev);
|
||||
}
|
||||
|
||||
err = of_get_phy_mode(np, &ag->phy_if_mode);
|
||||
|
@ -218,7 +218,8 @@ static inline void __b44_cam_read(struct b44 *bp, unsigned char *data, int index
|
||||
data[1] = (val >> 0) & 0xFF;
|
||||
}
|
||||
|
||||
static inline void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
|
||||
static inline void __b44_cam_write(struct b44 *bp,
|
||||
const unsigned char *data, int index)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@ -1507,7 +1508,8 @@ static void bwfilter_table(struct b44 *bp, u8 *pp, u32 bytes, u32 table_offset)
|
||||
}
|
||||
}
|
||||
|
||||
static int b44_magic_pattern(u8 *macaddr, u8 *ppattern, u8 *pmask, int offset)
|
||||
static int b44_magic_pattern(const u8 *macaddr, u8 *ppattern, u8 *pmask,
|
||||
int offset)
|
||||
{
|
||||
int magicsync = 6;
|
||||
int k, j, len = offset;
|
||||
|
@ -1818,7 +1818,7 @@ static inline void umac_reset(struct bcm_sysport_priv *priv)
|
||||
}
|
||||
|
||||
static void umac_set_hw_addr(struct bcm_sysport_priv *priv,
|
||||
unsigned char *addr)
|
||||
const unsigned char *addr)
|
||||
{
|
||||
u32 mac0 = (addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) |
|
||||
addr[3];
|
||||
|
@ -768,7 +768,7 @@ static void bgmac_umac_cmd_maskset(struct bgmac *bgmac, u32 mask, u32 set,
|
||||
udelay(2);
|
||||
}
|
||||
|
||||
static void bgmac_write_mac_address(struct bgmac *bgmac, u8 *addr)
|
||||
static void bgmac_write_mac_address(struct bgmac *bgmac, const u8 *addr)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
|
@ -2704,7 +2704,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp)
|
||||
}
|
||||
|
||||
static void
|
||||
bnx2_set_mac_addr(struct bnx2 *bp, u8 *mac_addr, u32 pos)
|
||||
bnx2_set_mac_addr(struct bnx2 *bp, const u8 *mac_addr, u32 pos)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
|
@ -1994,7 +1994,7 @@ int bnx2x_idle_chk(struct bnx2x *bp);
|
||||
* operation has been successfully scheduled and a negative - if a requested
|
||||
* operations has failed.
|
||||
*/
|
||||
int bnx2x_set_mac_one(struct bnx2x *bp, u8 *mac,
|
||||
int bnx2x_set_mac_one(struct bnx2x *bp, const u8 *mac,
|
||||
struct bnx2x_vlan_mac_obj *obj, bool set,
|
||||
int mac_type, unsigned long *ramrod_flags);
|
||||
|
||||
|
@ -8417,7 +8417,7 @@ alloc_mem_err:
|
||||
* Init service functions
|
||||
*/
|
||||
|
||||
int bnx2x_set_mac_one(struct bnx2x *bp, u8 *mac,
|
||||
int bnx2x_set_mac_one(struct bnx2x *bp, const u8 *mac,
|
||||
struct bnx2x_vlan_mac_obj *obj, bool set,
|
||||
int mac_type, unsigned long *ramrod_flags)
|
||||
{
|
||||
@ -9146,7 +9146,7 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode)
|
||||
|
||||
else if (bp->wol) {
|
||||
u32 emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
|
||||
u8 *mac_addr = bp->dev->dev_addr;
|
||||
const u8 *mac_addr = bp->dev->dev_addr;
|
||||
struct pci_dev *pdev = bp->pdev;
|
||||
u32 val;
|
||||
u16 pmc;
|
||||
|
@ -508,7 +508,8 @@ int bnx2x_vfpf_init(struct bnx2x *bp);
|
||||
void bnx2x_vfpf_close_vf(struct bnx2x *bp);
|
||||
int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp,
|
||||
bool is_leading);
|
||||
int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set);
|
||||
int bnx2x_vfpf_config_mac(struct bnx2x *bp, const u8 *addr, u8 vf_qid,
|
||||
bool set);
|
||||
int bnx2x_vfpf_config_rss(struct bnx2x *bp,
|
||||
struct bnx2x_config_rss_params *params);
|
||||
int bnx2x_vfpf_set_mcast(struct net_device *dev);
|
||||
|
@ -721,7 +721,7 @@ out:
|
||||
}
|
||||
|
||||
/* request pf to add a mac for the vf */
|
||||
int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set)
|
||||
int bnx2x_vfpf_config_mac(struct bnx2x *bp, const u8 *addr, u8 vf_qid, bool set)
|
||||
{
|
||||
struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters;
|
||||
struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp;
|
||||
|
@ -4869,7 +4869,7 @@ static int bnxt_hwrm_cfa_ntuple_filter_alloc(struct bnxt *bp,
|
||||
#endif
|
||||
|
||||
static int bnxt_hwrm_set_vnic_filter(struct bnxt *bp, u16 vnic_id, u16 idx,
|
||||
u8 *mac_addr)
|
||||
const u8 *mac_addr)
|
||||
{
|
||||
struct hwrm_cfa_l2_filter_alloc_output *resp;
|
||||
struct hwrm_cfa_l2_filter_alloc_input *req;
|
||||
|
@ -1151,7 +1151,7 @@ void bnxt_hwrm_exec_fwd_req(struct bnxt *bp)
|
||||
}
|
||||
}
|
||||
|
||||
int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
|
||||
int bnxt_approve_mac(struct bnxt *bp, const u8 *mac, bool strict)
|
||||
{
|
||||
struct hwrm_func_vf_cfg_input *req;
|
||||
int rc = 0;
|
||||
@ -1246,7 +1246,7 @@ void bnxt_update_vf_mac(struct bnxt *bp)
|
||||
{
|
||||
}
|
||||
|
||||
int bnxt_approve_mac(struct bnxt *bp, u8 *mac, bool strict)
|
||||
int bnxt_approve_mac(struct bnxt *bp, const u8 *mac, bool strict)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,5 +41,5 @@ int bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset);
|
||||
void bnxt_sriov_disable(struct bnxt *);
|
||||
void bnxt_hwrm_exec_fwd_req(struct bnxt *);
|
||||
void bnxt_update_vf_mac(struct bnxt *);
|
||||
int bnxt_approve_mac(struct bnxt *, u8 *, bool);
|
||||
int bnxt_approve_mac(struct bnxt *, const u8 *, bool);
|
||||
#endif
|
||||
|
@ -3266,7 +3266,7 @@ static void bcmgenet_umac_reset(struct bcmgenet_priv *priv)
|
||||
}
|
||||
|
||||
static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv,
|
||||
unsigned char *addr)
|
||||
const unsigned char *addr)
|
||||
{
|
||||
bcmgenet_umac_writel(priv, get_unaligned_be32(&addr[0]), UMAC_MAC0);
|
||||
bcmgenet_umac_writel(priv, get_unaligned_be16(&addr[4]), UMAC_MAC1);
|
||||
@ -3560,7 +3560,7 @@ static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
#define MAX_MDF_FILTER 17
|
||||
|
||||
static inline void bcmgenet_set_mdf_addr(struct bcmgenet_priv *priv,
|
||||
unsigned char *addr,
|
||||
const unsigned char *addr,
|
||||
int *i)
|
||||
{
|
||||
bcmgenet_umac_writel(priv, addr[0] << 8 | addr[1],
|
||||
|
@ -313,7 +313,7 @@ static void macb_get_hwaddr(struct macb *bp)
|
||||
addr[5] = (top >> 8) & 0xff;
|
||||
|
||||
if (is_valid_ether_addr(addr)) {
|
||||
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
|
||||
eth_hw_addr_set(bp->dev, addr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ static inline void xgmac_mac_disable(void __iomem *ioaddr)
|
||||
writel(value, ioaddr + XGMAC_CONTROL);
|
||||
}
|
||||
|
||||
static void xgmac_set_mac_addr(void __iomem *ioaddr, unsigned char *addr,
|
||||
static void xgmac_set_mac_addr(void __iomem *ioaddr, const unsigned char *addr,
|
||||
int num)
|
||||
{
|
||||
u32 data;
|
||||
|
@ -117,7 +117,7 @@ struct cmac_ops {
|
||||
const struct cmac_statistics *(*statistics_update)(struct cmac *, int);
|
||||
|
||||
int (*macaddress_get)(struct cmac *, u8 mac_addr[6]);
|
||||
int (*macaddress_set)(struct cmac *, u8 mac_addr[6]);
|
||||
int (*macaddress_set)(struct cmac *, const u8 mac_addr[6]);
|
||||
};
|
||||
|
||||
typedef struct _cmac_instance cmac_instance;
|
||||
|
@ -496,7 +496,7 @@ static int pm3393_macaddress_get(struct cmac *cmac, u8 mac_addr[6])
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pm3393_macaddress_set(struct cmac *cmac, u8 ma[6])
|
||||
static int pm3393_macaddress_set(struct cmac *cmac, const u8 ma[6])
|
||||
{
|
||||
u32 val, lo, mid, hi, enabled = cmac->instance->enabled;
|
||||
|
||||
|
@ -379,7 +379,7 @@ static int mac_intr_clear(struct cmac *mac)
|
||||
}
|
||||
|
||||
/* Expect MAC address to be in network byte order. */
|
||||
static int mac_set_address(struct cmac* mac, u8 addr[6])
|
||||
static int mac_set_address(struct cmac* mac, const u8 addr[6])
|
||||
{
|
||||
u32 val;
|
||||
int port = mac->instance->index;
|
||||
|
@ -710,7 +710,7 @@ int t3_mac_enable(struct cmac *mac, int which);
|
||||
int t3_mac_disable(struct cmac *mac, int which);
|
||||
int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
|
||||
int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev);
|
||||
int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6]);
|
||||
int t3_mac_set_address(struct cmac *mac, unsigned int idx, const u8 addr[6]);
|
||||
int t3_mac_set_num_ucast(struct cmac *mac, int n);
|
||||
const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
|
||||
int t3_mac_set_speed_duplex_fc(struct cmac *mac, int speed, int duplex, int fc);
|
||||
|
@ -240,7 +240,7 @@ static void set_addr_filter(struct cmac *mac, int idx, const u8 * addr)
|
||||
}
|
||||
|
||||
/* Set one of the station's unicast MAC addresses. */
|
||||
int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6])
|
||||
int t3_mac_set_address(struct cmac *mac, unsigned int idx, const u8 addr[6])
|
||||
{
|
||||
if (idx >= mac->nucast)
|
||||
return -EINVAL;
|
||||
|
@ -73,9 +73,9 @@ static int enic_set_port_profile(struct enic *enic, int vf)
|
||||
struct vic_provinfo *vp;
|
||||
const u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
|
||||
const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
|
||||
const u8 *client_mac;
|
||||
char uuid_str[38];
|
||||
char client_mac_str[18];
|
||||
u8 *client_mac;
|
||||
int err;
|
||||
|
||||
ENIC_PP_BY_INDEX(enic, vf, pp, &err);
|
||||
|
@ -2473,7 +2473,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
|
||||
port->mac_addr[0], port->mac_addr[1],
|
||||
port->mac_addr[2]);
|
||||
dev_info(dev, "using a random ethernet address\n");
|
||||
eth_random_addr(netdev->dev_addr);
|
||||
eth_hw_addr_random(netdev);
|
||||
}
|
||||
gmac_write_mac_address(netdev);
|
||||
|
||||
|
@ -355,6 +355,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
int chip_idx = ent->driver_data;
|
||||
int irq;
|
||||
int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
|
||||
__le16 addr[ETH_ALEN / 2];
|
||||
void __iomem *ioaddr;
|
||||
|
||||
i = pcim_enable_device(pdev);
|
||||
@ -382,7 +383,8 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
goto err_out_netdev;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i));
|
||||
addr[i] = cpu_to_le16(eeprom_read(ioaddr, i));
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
|
||||
/* Reset the chip to erase previous misconfiguration.
|
||||
No hold time required! */
|
||||
|
@ -349,8 +349,7 @@ parse_eeprom (struct net_device *dev)
|
||||
}
|
||||
|
||||
/* Set MAC address */
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = psrom->mac_addr[i];
|
||||
eth_hw_addr_set(dev, psrom->mac_addr);
|
||||
|
||||
if (np->chip_id == CHIP_IP1000A) {
|
||||
np->led_mode = psrom->led_mode;
|
||||
@ -567,7 +566,7 @@ static void rio_hw_init(struct net_device *dev)
|
||||
*/
|
||||
for (i = 0; i < 3; i++)
|
||||
dw16(StationAddr0 + 2 * i,
|
||||
cpu_to_le16(((u16 *)dev->dev_addr)[i]));
|
||||
cpu_to_le16(((const u16 *)dev->dev_addr)[i]));
|
||||
|
||||
set_multicast (dev);
|
||||
if (np->coalesce) {
|
||||
|
@ -508,6 +508,7 @@ static int sundance_probe1(struct pci_dev *pdev,
|
||||
int bar = 1;
|
||||
#endif
|
||||
int phy, phy_end, phy_idx = 0;
|
||||
__le16 addr[ETH_ALEN / 2];
|
||||
|
||||
if (pci_enable_device(pdev))
|
||||
return -EIO;
|
||||
@ -528,8 +529,9 @@ static int sundance_probe1(struct pci_dev *pdev,
|
||||
goto err_out_res;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
((__le16 *)dev->dev_addr)[i] =
|
||||
addr[i] =
|
||||
cpu_to_le16(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET));
|
||||
eth_hw_addr_set(dev, (u8 *)addr);
|
||||
|
||||
np = netdev_priv(dev);
|
||||
np->ndev = dev;
|
||||
|
@ -60,11 +60,11 @@ static void __dnet_set_hwaddr(struct dnet *bp)
|
||||
{
|
||||
u16 tmp;
|
||||
|
||||
tmp = be16_to_cpup((__be16 *)bp->dev->dev_addr);
|
||||
tmp = be16_to_cpup((const __be16 *)bp->dev->dev_addr);
|
||||
dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
|
||||
tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 2));
|
||||
tmp = be16_to_cpup((const __be16 *)(bp->dev->dev_addr + 2));
|
||||
dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
|
||||
tmp = be16_to_cpup((__be16 *)(bp->dev->dev_addr + 4));
|
||||
tmp = be16_to_cpup((const __be16 *)(bp->dev->dev_addr + 4));
|
||||
dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ static void dnet_get_hwaddr(struct dnet *bp)
|
||||
*((__be16 *)(addr + 4)) = cpu_to_be16(tmp);
|
||||
|
||||
if (is_valid_ether_addr(addr))
|
||||
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
|
||||
eth_hw_addr_set(bp->dev, addr);
|
||||
}
|
||||
|
||||
static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
|
||||
|
@ -1080,7 +1080,7 @@ err:
|
||||
}
|
||||
|
||||
/* Uses synchronous MCCQ */
|
||||
int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
|
||||
int be_cmd_pmac_add(struct be_adapter *adapter, const u8 *mac_addr,
|
||||
u32 if_id, u32 *pmac_id, u32 domain)
|
||||
{
|
||||
struct be_mcc_wrb *wrb;
|
||||
|
@ -2385,7 +2385,7 @@ int be_pci_fnum_get(struct be_adapter *adapter);
|
||||
int be_fw_wait_ready(struct be_adapter *adapter);
|
||||
int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
|
||||
bool permanent, u32 if_handle, u32 pmac_id);
|
||||
int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, u32 if_id,
|
||||
int be_cmd_pmac_add(struct be_adapter *adapter, const u8 *mac_addr, u32 if_id,
|
||||
u32 *pmac_id, u32 domain);
|
||||
int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id,
|
||||
u32 domain);
|
||||
|
@ -272,7 +272,7 @@ void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
|
||||
iowrite32(val, adapter->db + DB_CQ_OFFSET);
|
||||
}
|
||||
|
||||
static int be_dev_mac_add(struct be_adapter *adapter, u8 *mac)
|
||||
static int be_dev_mac_add(struct be_adapter *adapter, const u8 *mac)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -802,8 +802,8 @@ static int ethoc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
|
||||
static void ethoc_do_set_mac_address(struct net_device *dev)
|
||||
{
|
||||
const unsigned char *mac = dev->dev_addr;
|
||||
struct ethoc *priv = netdev_priv(dev);
|
||||
unsigned char *mac = dev->dev_addr;
|
||||
|
||||
ethoc_write(priv, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
|
||||
(mac[4] << 8) | (mac[5] << 0));
|
||||
|
@ -827,7 +827,7 @@ static int netdev_open(struct net_device *dev)
|
||||
return -EAGAIN;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
iowrite16(((unsigned short*)dev->dev_addr)[i],
|
||||
iowrite16(((const unsigned short *)dev->dev_addr)[i],
|
||||
ioaddr + PAR0 + i*2);
|
||||
|
||||
init_ring(dev);
|
||||
|
@ -272,7 +272,7 @@ static int dpaa_netdev_init(struct net_device *net_dev,
|
||||
} else {
|
||||
eth_hw_addr_random(net_dev);
|
||||
err = priv->mac_dev->change_addr(priv->mac_dev->fman_mac,
|
||||
(enet_addr_t *)net_dev->dev_addr);
|
||||
(const enet_addr_t *)net_dev->dev_addr);
|
||||
if (err) {
|
||||
dev_err(dev, "Failed to set random MAC address\n");
|
||||
return -EINVAL;
|
||||
@ -452,7 +452,7 @@ static int dpaa_set_mac_address(struct net_device *net_dev, void *addr)
|
||||
mac_dev = priv->mac_dev;
|
||||
|
||||
err = mac_dev->change_addr(mac_dev->fman_mac,
|
||||
(enet_addr_t *)net_dev->dev_addr);
|
||||
(const enet_addr_t *)net_dev->dev_addr);
|
||||
if (err < 0) {
|
||||
netif_err(priv, drv, net_dev, "mac_dev->change_addr() = %d\n",
|
||||
err);
|
||||
|
@ -366,7 +366,7 @@ static void set_dflts(struct dtsec_cfg *cfg)
|
||||
cfg->maximum_frame = DEFAULT_MAXIMUM_FRAME;
|
||||
}
|
||||
|
||||
static void set_mac_address(struct dtsec_regs __iomem *regs, u8 *adr)
|
||||
static void set_mac_address(struct dtsec_regs __iomem *regs, const u8 *adr)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
@ -516,7 +516,7 @@ static int init(struct dtsec_regs __iomem *regs, struct dtsec_cfg *cfg,
|
||||
|
||||
if (addr) {
|
||||
MAKE_ENET_ADDR_FROM_UINT64(addr, eth_addr);
|
||||
set_mac_address(regs, (u8 *)eth_addr);
|
||||
set_mac_address(regs, (const u8 *)eth_addr);
|
||||
}
|
||||
|
||||
/* HASH */
|
||||
@ -1022,7 +1022,7 @@ int dtsec_accept_rx_pause_frames(struct fman_mac *dtsec, bool en)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dtsec_modify_mac_address(struct fman_mac *dtsec, enet_addr_t *enet_addr)
|
||||
int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr)
|
||||
{
|
||||
struct dtsec_regs __iomem *regs = dtsec->regs;
|
||||
enum comm_mode mode = COMM_MODE_NONE;
|
||||
@ -1041,7 +1041,7 @@ int dtsec_modify_mac_address(struct fman_mac *dtsec, enet_addr_t *enet_addr)
|
||||
* Station address have to be swapped (big endian to little endian
|
||||
*/
|
||||
dtsec->addr = ENET_ADDR_TO_UINT64(*enet_addr);
|
||||
set_mac_address(dtsec->regs, (u8 *)(*enet_addr));
|
||||
set_mac_address(dtsec->regs, (const u8 *)(*enet_addr));
|
||||
|
||||
graceful_start(dtsec, mode);
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
struct fman_mac *dtsec_config(struct fman_mac_params *params);
|
||||
int dtsec_set_promiscuous(struct fman_mac *dtsec, bool new_val);
|
||||
int dtsec_modify_mac_address(struct fman_mac *dtsec, enet_addr_t *enet_addr);
|
||||
int dtsec_modify_mac_address(struct fman_mac *dtsec, const enet_addr_t *enet_addr);
|
||||
int dtsec_adjust_link(struct fman_mac *dtsec,
|
||||
u16 speed);
|
||||
int dtsec_restart_autoneg(struct fman_mac *dtsec);
|
||||
|
@ -354,7 +354,7 @@ struct fman_mac {
|
||||
bool allmulti_enabled;
|
||||
};
|
||||
|
||||
static void add_addr_in_paddr(struct memac_regs __iomem *regs, u8 *adr,
|
||||
static void add_addr_in_paddr(struct memac_regs __iomem *regs, const u8 *adr,
|
||||
u8 paddr_num)
|
||||
{
|
||||
u32 tmp0, tmp1;
|
||||
@ -897,12 +897,12 @@ int memac_accept_rx_pause_frames(struct fman_mac *memac, bool en)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int memac_modify_mac_address(struct fman_mac *memac, enet_addr_t *enet_addr)
|
||||
int memac_modify_mac_address(struct fman_mac *memac, const enet_addr_t *enet_addr)
|
||||
{
|
||||
if (!is_init_done(memac->memac_drv_param))
|
||||
return -EINVAL;
|
||||
|
||||
add_addr_in_paddr(memac->regs, (u8 *)(*enet_addr), 0);
|
||||
add_addr_in_paddr(memac->regs, (const u8 *)(*enet_addr), 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1058,7 +1058,7 @@ int memac_init(struct fman_mac *memac)
|
||||
/* MAC Address */
|
||||
if (memac->addr != 0) {
|
||||
MAKE_ENET_ADDR_FROM_UINT64(memac->addr, eth_addr);
|
||||
add_addr_in_paddr(memac->regs, (u8 *)eth_addr, 0);
|
||||
add_addr_in_paddr(memac->regs, (const u8 *)eth_addr, 0);
|
||||
}
|
||||
|
||||
fixed_link = memac_drv_param->fixed_link;
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
struct fman_mac *memac_config(struct fman_mac_params *params);
|
||||
int memac_set_promiscuous(struct fman_mac *memac, bool new_val);
|
||||
int memac_modify_mac_address(struct fman_mac *memac, enet_addr_t *enet_addr);
|
||||
int memac_modify_mac_address(struct fman_mac *memac, const enet_addr_t *enet_addr);
|
||||
int memac_adjust_link(struct fman_mac *memac, u16 speed);
|
||||
int memac_cfg_max_frame_len(struct fman_mac *memac, u16 new_val);
|
||||
int memac_cfg_reset_on_init(struct fman_mac *memac, bool enable);
|
||||
|
@ -221,7 +221,7 @@ struct fman_mac {
|
||||
bool allmulti_enabled;
|
||||
};
|
||||
|
||||
static void set_mac_address(struct tgec_regs __iomem *regs, u8 *adr)
|
||||
static void set_mac_address(struct tgec_regs __iomem *regs, const u8 *adr)
|
||||
{
|
||||
u32 tmp0, tmp1;
|
||||
|
||||
@ -514,13 +514,13 @@ int tgec_accept_rx_pause_frames(struct fman_mac *tgec, bool en)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tgec_modify_mac_address(struct fman_mac *tgec, enet_addr_t *p_enet_addr)
|
||||
int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *p_enet_addr)
|
||||
{
|
||||
if (!is_init_done(tgec->cfg))
|
||||
return -EINVAL;
|
||||
|
||||
tgec->addr = ENET_ADDR_TO_UINT64(*p_enet_addr);
|
||||
set_mac_address(tgec->regs, (u8 *)(*p_enet_addr));
|
||||
set_mac_address(tgec->regs, (const u8 *)(*p_enet_addr));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -704,7 +704,7 @@ int tgec_init(struct fman_mac *tgec)
|
||||
|
||||
if (tgec->addr) {
|
||||
MAKE_ENET_ADDR_FROM_UINT64(tgec->addr, eth_addr);
|
||||
set_mac_address(tgec->regs, (u8 *)eth_addr);
|
||||
set_mac_address(tgec->regs, (const u8 *)eth_addr);
|
||||
}
|
||||
|
||||
/* interrupts */
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
struct fman_mac *tgec_config(struct fman_mac_params *params);
|
||||
int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val);
|
||||
int tgec_modify_mac_address(struct fman_mac *tgec, enet_addr_t *enet_addr);
|
||||
int tgec_modify_mac_address(struct fman_mac *tgec, const enet_addr_t *enet_addr);
|
||||
int tgec_cfg_max_frame_len(struct fman_mac *tgec, u16 new_val);
|
||||
int tgec_enable(struct fman_mac *tgec, enum comm_mode mode);
|
||||
int tgec_disable(struct fman_mac *tgec, enum comm_mode mode);
|
||||
|
@ -66,7 +66,7 @@ struct mac_device {
|
||||
int (*stop)(struct mac_device *mac_dev);
|
||||
void (*adjust_link)(struct mac_device *mac_dev);
|
||||
int (*set_promisc)(struct fman_mac *mac_dev, bool enable);
|
||||
int (*change_addr)(struct fman_mac *mac_dev, enet_addr_t *enet_addr);
|
||||
int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr);
|
||||
int (*set_allmulti)(struct fman_mac *mac_dev, bool enable);
|
||||
int (*set_tstamp)(struct fman_mac *mac_dev, bool enable);
|
||||
int (*set_multi)(struct net_device *net_dev,
|
||||
|
@ -468,8 +468,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
|
||||
goto failed;
|
||||
}
|
||||
/* Read MACID from CIS */
|
||||
for (i = 0; i < 6; i++)
|
||||
dev->dev_addr[i] = buf[i + 5];
|
||||
eth_hw_addr_set(dev, &buf[5]);
|
||||
kfree(buf);
|
||||
} else {
|
||||
if (pcmcia_get_mac_from_cis(link, dev))
|
||||
@ -499,9 +498,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
|
||||
pr_notice("unable to read hardware net address\n");
|
||||
goto failed;
|
||||
}
|
||||
for (i = 0 ; i < 6; i++) {
|
||||
dev->dev_addr[i] = buggybuf[i];
|
||||
}
|
||||
eth_hw_addr_set(dev, buggybuf);
|
||||
card_name = "FMV-J182";
|
||||
break;
|
||||
case MBH10302:
|
||||
|
@ -998,7 +998,7 @@ static int hip04_mac_probe(struct platform_device *pdev)
|
||||
hip04_config_port(ndev, SPEED_100, DUPLEX_FULL);
|
||||
|
||||
hip04_config_fifo(priv);
|
||||
eth_random_addr(ndev->dev_addr);
|
||||
eth_hw_addr_random(ndev);
|
||||
hip04_update_mac_address(ndev);
|
||||
|
||||
ret = hip04_alloc_ring(ndev, d);
|
||||
|
@ -427,7 +427,7 @@ static void hisi_femac_free_skb_rings(struct hisi_femac_priv *priv)
|
||||
}
|
||||
|
||||
static int hisi_femac_set_hw_mac_addr(struct hisi_femac_priv *priv,
|
||||
unsigned char *mac)
|
||||
const unsigned char *mac)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
|
@ -429,7 +429,7 @@ static void hix5hd2_port_disable(struct hix5hd2_priv *priv)
|
||||
static void hix5hd2_hw_set_mac_addr(struct net_device *dev)
|
||||
{
|
||||
struct hix5hd2_priv *priv = netdev_priv(dev);
|
||||
unsigned char *mac = dev->dev_addr;
|
||||
const unsigned char *mac = dev->dev_addr;
|
||||
u32 val;
|
||||
|
||||
val = mac[1] | (mac[0] << 8);
|
||||
|
@ -499,7 +499,7 @@ struct hnae_ae_ops {
|
||||
u32 *tx_usecs_high, u32 *rx_usecs_high);
|
||||
void (*set_promisc_mode)(struct hnae_handle *handle, u32 en);
|
||||
int (*get_mac_addr)(struct hnae_handle *handle, void **p);
|
||||
int (*set_mac_addr)(struct hnae_handle *handle, void *p);
|
||||
int (*set_mac_addr)(struct hnae_handle *handle, const void *p);
|
||||
int (*add_uc_addr)(struct hnae_handle *handle,
|
||||
const unsigned char *addr);
|
||||
int (*rm_uc_addr)(struct hnae_handle *handle,
|
||||
|
@ -206,7 +206,7 @@ static void hns_ae_fini_queue(struct hnae_queue *q)
|
||||
hns_rcb_reset_ring_hw(q);
|
||||
}
|
||||
|
||||
static int hns_ae_set_mac_address(struct hnae_handle *handle, void *p)
|
||||
static int hns_ae_set_mac_address(struct hnae_handle *handle, const void *p)
|
||||
{
|
||||
int ret;
|
||||
struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle);
|
||||
|
@ -450,7 +450,7 @@ static void hns_gmac_update_stats(void *mac_drv)
|
||||
+= dsaf_read_dev(drv, GMAC_TX_PAUSE_FRAMES_REG);
|
||||
}
|
||||
|
||||
static void hns_gmac_set_mac_addr(void *mac_drv, char *mac_addr)
|
||||
static void hns_gmac_set_mac_addr(void *mac_drv, const char *mac_addr)
|
||||
{
|
||||
struct mac_driver *drv = (struct mac_driver *)mac_drv;
|
||||
|
||||
|
@ -240,7 +240,7 @@ int hns_mac_get_inner_port_num(struct hns_mac_cb *mac_cb, u8 vmid, u8 *port_num)
|
||||
*@addr:mac address
|
||||
*/
|
||||
int hns_mac_change_vf_addr(struct hns_mac_cb *mac_cb,
|
||||
u32 vmid, char *addr)
|
||||
u32 vmid, const char *addr)
|
||||
{
|
||||
int ret;
|
||||
struct mac_driver *mac_ctrl_drv = hns_mac_get_drv(mac_cb);
|
||||
|
@ -348,7 +348,7 @@ struct mac_driver {
|
||||
/*disable mac when disable nic or dsaf*/
|
||||
void (*mac_disable)(void *mac_drv, enum mac_commom_mode mode);
|
||||
/* config mac address*/
|
||||
void (*set_mac_addr)(void *mac_drv, char *mac_addr);
|
||||
void (*set_mac_addr)(void *mac_drv, const char *mac_addr);
|
||||
/*adjust mac mode of port,include speed and duplex*/
|
||||
int (*adjust_link)(void *mac_drv, enum mac_speed speed,
|
||||
u32 full_duplex);
|
||||
@ -425,7 +425,8 @@ int hns_mac_init(struct dsaf_device *dsaf_dev);
|
||||
void mac_adjust_link(struct net_device *net_dev);
|
||||
bool hns_mac_need_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex);
|
||||
void hns_mac_get_link_status(struct hns_mac_cb *mac_cb, u32 *link_status);
|
||||
int hns_mac_change_vf_addr(struct hns_mac_cb *mac_cb, u32 vmid, char *addr);
|
||||
int hns_mac_change_vf_addr(struct hns_mac_cb *mac_cb, u32 vmid,
|
||||
const char *addr);
|
||||
int hns_mac_set_multi(struct hns_mac_cb *mac_cb,
|
||||
u32 port_num, char *addr, bool enable);
|
||||
int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vm, bool enable);
|
||||
|
@ -255,7 +255,7 @@ static void hns_xgmac_pausefrm_cfg(void *mac_drv, u32 rx_en, u32 tx_en)
|
||||
dsaf_write_dev(drv, XGMAC_MAC_PAUSE_CTRL_REG, origin);
|
||||
}
|
||||
|
||||
static void hns_xgmac_set_pausefrm_mac_addr(void *mac_drv, char *mac_addr)
|
||||
static void hns_xgmac_set_pausefrm_mac_addr(void *mac_drv, const char *mac_addr)
|
||||
{
|
||||
struct mac_driver *drv = (struct mac_driver *)mac_drv;
|
||||
|
||||
|
@ -595,7 +595,7 @@ struct hnae3_ae_ops {
|
||||
u32 *tx_usecs_high, u32 *rx_usecs_high);
|
||||
|
||||
void (*get_mac_addr)(struct hnae3_handle *handle, u8 *p);
|
||||
int (*set_mac_addr)(struct hnae3_handle *handle, void *p,
|
||||
int (*set_mac_addr)(struct hnae3_handle *handle, const void *p,
|
||||
bool is_first);
|
||||
int (*do_ioctl)(struct hnae3_handle *handle,
|
||||
struct ifreq *ifr, int cmd);
|
||||
|
@ -9442,7 +9442,7 @@ int hclge_update_mac_node_for_dev_addr(struct hclge_vport *vport,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hclge_set_mac_addr(struct hnae3_handle *handle, void *p,
|
||||
static int hclge_set_mac_addr(struct hnae3_handle *handle, const void *p,
|
||||
bool is_first)
|
||||
{
|
||||
const unsigned char *new_addr = (const unsigned char *)p;
|
||||
|
@ -1349,7 +1349,7 @@ static void hclgevf_get_mac_addr(struct hnae3_handle *handle, u8 *p)
|
||||
ether_addr_copy(p, hdev->hw.mac.mac_addr);
|
||||
}
|
||||
|
||||
static int hclgevf_set_mac_addr(struct hnae3_handle *handle, void *p,
|
||||
static int hclgevf_set_mac_addr(struct hnae3_handle *handle, const void *p,
|
||||
bool is_first)
|
||||
{
|
||||
struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle);
|
||||
|
@ -339,14 +339,13 @@ static const struct net_device_ops sun3_82586_netdev_ops = {
|
||||
|
||||
static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
|
||||
{
|
||||
int i, size, retval;
|
||||
int size, retval;
|
||||
|
||||
if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, DRV_NAME))
|
||||
return -EBUSY;
|
||||
|
||||
/* copy in the ethernet address from the prom */
|
||||
for(i = 0; i < 6 ; i++)
|
||||
dev->dev_addr[i] = idprom->id_ethaddr[i];
|
||||
eth_hw_addr_set(dev, idprom->id_ethaddr);
|
||||
|
||||
printk("%s: SUN3 Intel 82586 found at %lx, ",dev->name,dev->base_addr);
|
||||
|
||||
@ -461,7 +460,7 @@ static int init586(struct net_device *dev)
|
||||
ias_cmd->cmd_cmd = swab16(CMD_IASETUP | CMD_LAST);
|
||||
ias_cmd->cmd_link = 0xffff;
|
||||
|
||||
memcpy((char *)&ias_cmd->iaddr,(char *) dev->dev_addr,ETH_ALEN);
|
||||
memcpy((char *)&ias_cmd->iaddr,(const char *) dev->dev_addr,ETH_ALEN);
|
||||
|
||||
p->scb->cbl_offset = make16(ias_cmd);
|
||||
|
||||
|
@ -2975,7 +2975,7 @@ static int emac_init_config(struct emac_instance *dev)
|
||||
}
|
||||
|
||||
/* Read MAC-address */
|
||||
err = of_get_mac_address(np, dev->ndev->dev_addr);
|
||||
err = of_get_ethdev_address(np, dev->ndev);
|
||||
if (err) {
|
||||
if (err != -EPROBE_DEFER)
|
||||
dev_err(&dev->ofdev->dev, "Can't get valid [local-]mac-address from OF !\n");
|
||||
|
@ -435,7 +435,7 @@ static inline bool i40e_is_channel_macvlan(struct i40e_channel *ch)
|
||||
return !!ch->fwd;
|
||||
}
|
||||
|
||||
static inline u8 *i40e_channel_mac(struct i40e_channel *ch)
|
||||
static inline const u8 *i40e_channel_mac(struct i40e_channel *ch)
|
||||
{
|
||||
if (i40e_is_channel_macvlan(ch))
|
||||
return ch->fwd->netdev->dev_addr;
|
||||
|
@ -549,7 +549,7 @@ ixgb_mta_set(struct ixgb_hw *hw,
|
||||
*****************************************************************************/
|
||||
void
|
||||
ixgb_rar_set(struct ixgb_hw *hw,
|
||||
u8 *addr,
|
||||
const u8 *addr,
|
||||
u32 index)
|
||||
{
|
||||
u32 rar_low, rar_high;
|
||||
|
@ -740,7 +740,7 @@ bool ixgb_adapter_start(struct ixgb_hw *hw);
|
||||
void ixgb_check_for_link(struct ixgb_hw *hw);
|
||||
bool ixgb_check_for_bad_link(struct ixgb_hw *hw);
|
||||
|
||||
void ixgb_rar_set(struct ixgb_hw *hw, u8 *addr, u32 index);
|
||||
void ixgb_rar_set(struct ixgb_hw *hw, const u8 *addr, u32 index);
|
||||
|
||||
/* Filters (multicast, vlan, receive) */
|
||||
void ixgb_mc_addr_list_update(struct ixgb_hw *hw, u8 *mc_addr_list,
|
||||
|
@ -1770,7 +1770,7 @@ static void uc_addr_get(struct mv643xx_eth_private *mp, unsigned char *addr)
|
||||
addr[5] = mac_l & 0xff;
|
||||
}
|
||||
|
||||
static void uc_addr_set(struct mv643xx_eth_private *mp, unsigned char *addr)
|
||||
static void uc_addr_set(struct mv643xx_eth_private *mp, const u8 *addr)
|
||||
{
|
||||
wrlp(mp, MAC_ADDR_HIGH,
|
||||
(addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) | addr[3]);
|
||||
|
@ -1623,8 +1623,8 @@ static void mvneta_set_ucast_addr(struct mvneta_port *pp, u8 last_nibble,
|
||||
}
|
||||
|
||||
/* Set mac address */
|
||||
static void mvneta_mac_addr_set(struct mvneta_port *pp, unsigned char *addr,
|
||||
int queue)
|
||||
static void mvneta_mac_addr_set(struct mvneta_port *pp,
|
||||
const unsigned char *addr, int queue)
|
||||
{
|
||||
unsigned int mac_h;
|
||||
unsigned int mac_l;
|
||||
|
@ -389,7 +389,7 @@ static void inverse_every_nibble(unsigned char *mac_addr)
|
||||
* Outputs
|
||||
* return the calculated entry.
|
||||
*/
|
||||
static u32 hash_function(unsigned char *mac_addr_orig)
|
||||
static u32 hash_function(const unsigned char *mac_addr_orig)
|
||||
{
|
||||
u32 hash_result;
|
||||
u32 addr0;
|
||||
@ -434,7 +434,7 @@ static u32 hash_function(unsigned char *mac_addr_orig)
|
||||
* -ENOSPC if table full
|
||||
*/
|
||||
static int add_del_hash_entry(struct pxa168_eth_private *pep,
|
||||
unsigned char *mac_addr,
|
||||
const unsigned char *mac_addr,
|
||||
u32 rd, u32 skip, int del)
|
||||
{
|
||||
struct addr_table_entry *entry, *start;
|
||||
@ -521,7 +521,7 @@ static int add_del_hash_entry(struct pxa168_eth_private *pep,
|
||||
*/
|
||||
static void update_hash_table_mac_address(struct pxa168_eth_private *pep,
|
||||
unsigned char *oaddr,
|
||||
unsigned char *addr)
|
||||
const unsigned char *addr)
|
||||
{
|
||||
/* Delete old entry */
|
||||
if (oaddr)
|
||||
|
@ -523,7 +523,7 @@ static void mtk_star_dma_resume_tx(struct mtk_star_priv *priv)
|
||||
static void mtk_star_set_mac_addr(struct net_device *ndev)
|
||||
{
|
||||
struct mtk_star_priv *priv = netdev_priv(ndev);
|
||||
u8 *mac_addr = ndev->dev_addr;
|
||||
const u8 *mac_addr = ndev->dev_addr;
|
||||
unsigned int high, low;
|
||||
|
||||
high = mac_addr[0] << 8 | mac_addr[1] << 0;
|
||||
|
@ -71,12 +71,12 @@ struct mlx5e_l2_hash_node {
|
||||
bool mpfs;
|
||||
};
|
||||
|
||||
static inline int mlx5e_hash_l2(u8 *addr)
|
||||
static inline int mlx5e_hash_l2(const u8 *addr)
|
||||
{
|
||||
return addr[5];
|
||||
}
|
||||
|
||||
static void mlx5e_add_l2_to_hash(struct hlist_head *hash, u8 *addr)
|
||||
static void mlx5e_add_l2_to_hash(struct hlist_head *hash, const u8 *addr)
|
||||
{
|
||||
struct mlx5e_l2_hash_node *hn;
|
||||
int ix = mlx5e_hash_l2(addr);
|
||||
|
@ -219,7 +219,7 @@ void mlx5i_uninit_underlay_qp(struct mlx5e_priv *priv)
|
||||
|
||||
int mlx5i_create_underlay_qp(struct mlx5e_priv *priv)
|
||||
{
|
||||
unsigned char *dev_addr = priv->netdev->dev_addr;
|
||||
const unsigned char *dev_addr = priv->netdev->dev_addr;
|
||||
u32 out[MLX5_ST_SZ_DW(create_qp_out)] = {};
|
||||
u32 in[MLX5_ST_SZ_DW(create_qp_in)] = {};
|
||||
struct mlx5i_priv *ipriv = priv->ppriv;
|
||||
|
@ -380,7 +380,7 @@ static void ks8842_read_mac_addr(struct ks8842_adapter *adapter, u8 *dest)
|
||||
}
|
||||
}
|
||||
|
||||
static void ks8842_write_mac_addr(struct ks8842_adapter *adapter, u8 *mac)
|
||||
static void ks8842_write_mac_addr(struct ks8842_adapter *adapter, const u8 *mac)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned i;
|
||||
|
@ -4033,7 +4033,7 @@ static void hw_set_add_addr(struct ksz_hw *hw)
|
||||
}
|
||||
}
|
||||
|
||||
static int hw_add_addr(struct ksz_hw *hw, u8 *mac_addr)
|
||||
static int hw_add_addr(struct ksz_hw *hw, const u8 *mac_addr)
|
||||
{
|
||||
int i;
|
||||
int j = ADDITIONAL_ENTRIES;
|
||||
@ -4054,7 +4054,7 @@ static int hw_add_addr(struct ksz_hw *hw, u8 *mac_addr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int hw_del_addr(struct ksz_hw *hw, u8 *mac_addr)
|
||||
static int hw_del_addr(struct ksz_hw *hw, const u8 *mac_addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -796,7 +796,8 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp, int adopt)
|
||||
return status;
|
||||
}
|
||||
|
||||
static int myri10ge_update_mac_address(struct myri10ge_priv *mgp, u8 * addr)
|
||||
static int myri10ge_update_mac_address(struct myri10ge_priv *mgp,
|
||||
const u8 * addr)
|
||||
{
|
||||
struct myri10ge_cmd cmd;
|
||||
int status;
|
||||
@ -3738,7 +3739,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
struct net_device *netdev;
|
||||
struct myri10ge_priv *mgp;
|
||||
struct device *dev = &pdev->dev;
|
||||
int i;
|
||||
int status = -ENXIO;
|
||||
int dac_enabled;
|
||||
unsigned hdr_offset, ss_offset;
|
||||
@ -3828,8 +3828,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (status)
|
||||
goto abort_with_ioremap;
|
||||
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
netdev->dev_addr[i] = mgp->mac_addr[i];
|
||||
eth_hw_addr_set(netdev, mgp->mac_addr);
|
||||
|
||||
myri10ge_select_firmware(mgp);
|
||||
|
||||
|
@ -5217,7 +5217,7 @@ static int s2io_set_mac_addr(struct net_device *dev, void *p)
|
||||
* as defined in errno.h file on failure.
|
||||
*/
|
||||
|
||||
static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr)
|
||||
static int do_s2io_prog_unicast(struct net_device *dev, const u8 *addr)
|
||||
{
|
||||
struct s2io_nic *sp = netdev_priv(dev);
|
||||
register u64 mac_addr = 0, perm_addr = 0;
|
||||
|
@ -1073,7 +1073,7 @@ static void s2io_reset(struct s2io_nic * sp);
|
||||
static int s2io_poll_msix(struct napi_struct *napi, int budget);
|
||||
static int s2io_poll_inta(struct napi_struct *napi, int budget);
|
||||
static void s2io_init_pci(struct s2io_nic * sp);
|
||||
static int do_s2io_prog_unicast(struct net_device *dev, u8 *addr);
|
||||
static int do_s2io_prog_unicast(struct net_device *dev, const u8 *addr);
|
||||
static void s2io_alarm_handle(struct timer_list *t);
|
||||
static irqreturn_t
|
||||
s2io_msix_ring_handle(int irq, void *dev_id);
|
||||
|
@ -837,7 +837,7 @@ nfp_tunnel_put_ipv6_off(struct nfp_app *app, struct nfp_ipv6_addr_entry *entry)
|
||||
}
|
||||
|
||||
static int
|
||||
__nfp_tunnel_offload_mac(struct nfp_app *app, u8 *mac, u16 idx, bool del)
|
||||
__nfp_tunnel_offload_mac(struct nfp_app *app, const u8 *mac, u16 idx, bool del)
|
||||
{
|
||||
struct nfp_tun_mac_addr_offload payload;
|
||||
|
||||
@ -886,7 +886,7 @@ static bool nfp_tunnel_is_mac_idx_global(u16 nfp_mac_idx)
|
||||
}
|
||||
|
||||
static struct nfp_tun_offloaded_mac *
|
||||
nfp_tunnel_lookup_offloaded_macs(struct nfp_app *app, u8 *mac)
|
||||
nfp_tunnel_lookup_offloaded_macs(struct nfp_app *app, const u8 *mac)
|
||||
{
|
||||
struct nfp_flower_priv *priv = app->priv;
|
||||
|
||||
@ -1005,7 +1005,7 @@ err_free_ida:
|
||||
|
||||
static int
|
||||
nfp_tunnel_del_shared_mac(struct nfp_app *app, struct net_device *netdev,
|
||||
u8 *mac, bool mod)
|
||||
const u8 *mac, bool mod)
|
||||
{
|
||||
struct nfp_flower_priv *priv = app->priv;
|
||||
struct nfp_flower_repr_priv *repr_priv;
|
||||
|
@ -419,7 +419,7 @@ struct netdata_local {
|
||||
/*
|
||||
* MAC support functions
|
||||
*/
|
||||
static void __lpc_set_mac(struct netdata_local *pldat, u8 *mac)
|
||||
static void __lpc_set_mac(struct netdata_local *pldat, const u8 *mac)
|
||||
{
|
||||
u32 tmp;
|
||||
|
||||
|
@ -1722,7 +1722,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
err = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
memcpy(dev->dev_addr, mac->mac_addr, sizeof(mac->mac_addr));
|
||||
eth_hw_addr_set(dev, mac->mac_addr);
|
||||
|
||||
ret = mac_to_intf(mac);
|
||||
if (ret < 0) {
|
||||
|
@ -952,7 +952,7 @@ qed_llh_remove_filter(struct qed_hwfn *p_hwfn,
|
||||
}
|
||||
|
||||
int qed_llh_add_mac_filter(struct qed_dev *cdev,
|
||||
u8 ppfid, u8 mac_addr[ETH_ALEN])
|
||||
u8 ppfid, const u8 mac_addr[ETH_ALEN])
|
||||
{
|
||||
struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
|
||||
struct qed_ptt *p_ptt = qed_ptt_acquire(p_hwfn);
|
||||
|
@ -364,7 +364,7 @@ int qed_llh_set_roce_affinity(struct qed_dev *cdev, enum qed_eng eng);
|
||||
* Return: Int.
|
||||
*/
|
||||
int qed_llh_add_mac_filter(struct qed_dev *cdev,
|
||||
u8 ppfid, u8 mac_addr[ETH_ALEN]);
|
||||
u8 ppfid, const u8 mac_addr[ETH_ALEN]);
|
||||
|
||||
/**
|
||||
* qed_llh_remove_mac_filter(): Remove a LLH MAC filter from the given
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user