use eth_hw_addr_set() in arch-specific drivers
Subsystems (4)
Jakub Kicinski
maintainercover use eth_hw_addr_set() in arch-specific drivers
Fixups for more arch-specific drivers.
With these (and another patch which didn't fit) the build is more or less clean with all cross-compilers available on kernel.org. I say more or less because around half of the arches fail to build for unrelated reasons right now.
Most of the changes here are for m68k, 32bit x86 and alpha.
Jakub Kicinski (15):
amd: lance: use eth_hw_addr_set()
amd: ni65: use eth_hw_addr_set()
amd: a2065/ariadne: use eth_hw_addr_set()
amd: hplance: use eth_hw_addr_set()
amd: atarilance: use eth_hw_addr_set()
amd: mvme147: use eth_hw_addr_set()
8390: smc-ultra: use eth_hw_addr_set()
8390: hydra: use eth_hw_addr_set()
8390: mac8390: use eth_hw_addr_set()
8390: wd: use eth_hw_addr_set()
smc9194: use eth_hw_addr_set()
lasi_82594: use eth_hw_addr_set()
apple: macmace: use eth_hw_addr_set()
cirrus: mac89x0: use eth_hw_addr_set()
natsemi: macsonic: use eth_hw_addr_set()
drivers/net/ethernet/8390/hydra.c | 4 +++- drivers/net/ethernet/8390/mac8390.c | 4 +++- drivers/net/ethernet/8390/smc-ultra.c | 4 +++- drivers/net/ethernet/8390/wd.c | 4 +++- drivers/net/ethernet/amd/a2065.c | 18 +++++++++------- drivers/net/ethernet/amd/ariadne.c | 20 ++++++++++-------- drivers/net/ethernet/amd/atarilance.c | 7 ++++-- drivers/net/ethernet/amd/hplance.c | 4 +++- drivers/net/ethernet/amd/lance.c | 4 +++- drivers/net/ethernet/amd/mvme147.c | 14 ++++++------ drivers/net/ethernet/amd/ni65.c | 8 ++++--- drivers/net/ethernet/apple/macmace.c | 14 +++++++----- drivers/net/ethernet/cirrus/mac89x0.c | 7 ++++-- drivers/net/ethernet/i825xx/lasi_82596.c | 6 ++++-- drivers/net/ethernet/natsemi/macsonic.c | 27 +++++++++++++++--------- drivers/net/ethernet/smsc/smc9194.c | 6 ++++-- 16 files changed, 96 insertions(+), 55 deletions(-)
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 1/15 amd: lance: use eth_hw_addr_set()
IO reads, so save to an array then eth_hw_addr_set().
Fixes build on x86 (32bit).
--- drivers/net/ethernet/amd/lance.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/amd/lance.c +3 -1
@@ -480,6 +480,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, intunsigned long flags;int err = -ENOMEM ;void __iomem *bios; +u8 addr[ETH_ALEN ];/* First we look for special cases. Check for HP's on-board ethernet by looking for 'HP' in the BIOS.
@@ -541,7 +542,8 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int/* There is a 16 byte station address PROM at the base address. The first six bytes are the station address. */ for (i =0 ; i <6 ; i++) - dev->dev_addr[i] =inb (ioaddr + i); + addr[i] =inb (ioaddr + i); +eth_hw_addr_set (dev, addr);printk ("%pM" , dev->dev_addr); dev->base_addr = ioaddr;
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 2/15 amd: ni65: use eth_hw_addr_set()
In reply to Jakub KicinskiIO reads, so save to an array then eth_hw_addr_set().
Fixes build on x86 (32bit).
--- drivers/net/ethernet/amd/ni65.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/amd/ni65.c +5 -3
@@ -251,7 +251,7 @@ static void ni65_recv_intr(struct net_device *dev,int);static void ni65_xmit_intr (struct net_device *dev,int );static int ni65_open (struct net_device *dev);static int ni65_lance_reinit (struct net_device *dev); -static void ni65_init_lance (struct priv *p,unsigned char *,int ,int ); +static void ni65_init_lance (struct priv *p,const unsigned char *,int ,int );static netdev_tx_t ni65_send_packet (struct sk_buff *skb,struct net_device *dev);static void ni65_timeout (struct net_device *dev,unsigned int txqueue);
@@ -418,6 +418,7 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr) {int i,j;struct priv *p; +u8 addr[ETH_ALEN ];unsigned long flags; dev->irq = irq;
@@ -444,7 +445,8 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)return -ENODEV ;for (j=0 ;j<6 ;j++) - dev->dev_addr[j] =inb (ioaddr+cards[i].addr_offset+j); + addr[j] =inb (ioaddr+cards[i].addr_offset+j); +eth_hw_addr_set (dev, addr);if ( (j=ni65_alloc_buffer (dev)) <0 ) {release_region (ioaddr, cards[i].total_size);
@@ -566,7 +568,7 @@ static int __init ni65_probe1(struct net_device *dev,int ioaddr)/* * set lance register and trigger init */ -static void ni65_init_lance (struct priv *p,unsigned char *daddr,int filter,int mode) +static void ni65_init_lance (struct priv *p,const unsigned char *daddr,int filter,int mode) {int i;u32 pib;
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 3/15 amd: a2065/ariadne: use eth_hw_addr_set()
In reply to Jakub Kicinskidev_addr is initialized byte by byte from series.
Fixes build on x86 (32bit).
--- drivers/net/ethernet/amd/a2065.c | 18 ++++++++++-------- drivers/net/ethernet/amd/ariadne.c | 20 +++++++++++--------- 2 files changed, 21 insertions(+), 17 deletions(-)
drivers/net/ethernet/amd/a2065.c +10 -8
@@ -680,6 +680,7 @@ static int a2065_init_one(struct zorro_dev *z,unsigned long base_addr = board +A2065_LANCE ;unsigned long mem_start = board +A2065_RAM ;struct resource *r1, *r2; +u8 addr[ETH_ALEN ];u32 serial;int err;
@@ -706,17 +707,18 @@ static int a2065_init_one(struct zorro_dev *z, r2->name = dev->name; serial =be32_to_cpu (z->rom.er_SerialNumber); - dev->dev_addr[0 ] =0x00 ; + addr[0 ] =0x00 ;if (z->id !=ZORRO_PROD_AMERISTAR_A2065 ) {/* Commodore */ - dev->dev_addr[1 ] =0x80 ; - dev->dev_addr[2 ] =0x10 ; + addr[1 ] =0x80 ; + addr[2 ] =0x10 ; }else {/* Ameristar */ - dev->dev_addr[1 ] =0x00 ; - dev->dev_addr[2 ] =0x9f ; + addr[1 ] =0x00 ; + addr[2 ] =0x9f ; } - dev->dev_addr[3 ] = (serial >>16 ) &0xff ; - dev->dev_addr[4 ] = (serial >>8 ) &0xff ; - dev->dev_addr[5 ] = serial &0xff ; + addr[3 ] = (serial >>16 ) &0xff ; + addr[4 ] = (serial >>8 ) &0xff ; + addr[5 ] = serial &0xff ; +eth_hw_addr_set (dev, addr); dev->base_addr = (unsigned long )ZTWO_VADDR (base_addr); dev->mem_start = (unsigned long )ZTWO_VADDR (mem_start); dev->mem_end = dev->mem_start +A2065_RAM_SIZE ;
drivers/net/ethernet/amd/ariadne.c +11 -9
@@ -441,11 +441,11 @@ static int ariadne_open(struct net_device *dev)/* Set the Ethernet Hardware Address */ lance->RAP =CSR12 ;/* Physical Address Register, PADR[15:0] */ - lance->RDP = ((u_short *)&dev->dev_addr[0 ])[0 ]; + lance->RDP = ((const u_short *)&dev->dev_addr[0 ])[0 ]; lance->RAP =CSR13 ;/* Physical Address Register, PADR[31:16] */ - lance->RDP = ((u_short *)&dev->dev_addr[0 ])[1 ]; + lance->RDP = ((const u_short *)&dev->dev_addr[0 ])[1 ]; lance->RAP =CSR14 ;/* Physical Address Register, PADR[47:32] */ - lance->RDP = ((u_short *)&dev->dev_addr[0 ])[2 ]; + lance->RDP = ((const u_short *)&dev->dev_addr[0 ])[2 ];/* Set the Init Block Mode */ lance->RAP =CSR15 ;/* Mode Register */
@@ -717,6 +717,7 @@ static int ariadne_init_one(struct zorro_dev *z,unsigned long mem_start = board +ARIADNE_RAM ;struct resource *r1, *r2;struct net_device *dev; +u8 addr[ETH_ALEN ];u32 serial;int err;
@@ -740,12 +741,13 @@ static int ariadne_init_one(struct zorro_dev *z, r2->name = dev->name; serial =be32_to_cpu (z->rom.er_SerialNumber); - dev->dev_addr[0 ] =0x00 ; - dev->dev_addr[1 ] =0x60 ; - dev->dev_addr[2 ] =0x30 ; - dev->dev_addr[3 ] = (serial >>16 ) &0xff ; - dev->dev_addr[4 ] = (serial >>8 ) &0xff ; - dev->dev_addr[5 ] = serial &0xff ; + addr[0 ] =0x00 ; + addr[1 ] =0x60 ; + addr[2 ] =0x30 ; + addr[3 ] = (serial >>16 ) &0xff ; + addr[4 ] = (serial >>8 ) &0xff ; + addr[5 ] = serial &0xff ; +eth_hw_addr_set (dev, addr); dev->base_addr = (unsigned long )ZTWO_VADDR (base_addr); dev->mem_start = (unsigned long )ZTWO_VADDR (mem_start); dev->mem_end = dev->mem_start +ARIADNE_RAM_SIZE ;
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 4/15 amd: hplance: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/amd/hplance.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/amd/hplance.c +3 -1
@@ -129,6 +129,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d) {unsigned long va = (d->resource.start +DIO_VIRADDRBASE );struct hplance_private *lp; +u8 addr[ETH_ALEN ];int i;/* reset the board */
@@ -144,9 +145,10 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d)/* The NVRAM holds our ethernet address, one nibble per byte, * at bytes NVRAMOFF+1,3,5,7,9... */ - dev->dev_addr[i] = ((in_8 (va +HPLANCE_NVRAMOFF + i*4 +1 ) &0xF ) <<4 ) + addr[i] = ((in_8 (va +HPLANCE_NVRAMOFF + i*4 +1 ) &0xF ) <<4 ) | (in_8 (va +HPLANCE_NVRAMOFF + i*4 +3 ) &0xF ); } +eth_hw_addr_set (dev, addr); lp =netdev_priv (dev); lp->lance.name = d->name;
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 5/15 amd: atarilance: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/amd/atarilance.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/atarilance.c +5 -2
@@ -471,6 +471,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,int i;static int did_version;unsigned short save1, save2; +u8 addr[ETH_ALEN ];PROBE_PRINT (("Probing for Lance card at mem %#lx io %#lx\n" , (long )memaddr, (long )ioaddr ));
@@ -585,14 +586,16 @@ static unsigned long __init lance_probe1( struct net_device *dev,eth_hw_addr_set (dev, OldRieblDefHwaddr);break ;case NEW_RIEBL : - lp->memcpy_f (dev->dev_addr,RIEBL_HWADDR_ADDR ,ETH_ALEN ); + lp->memcpy_f (addr,RIEBL_HWADDR_ADDR ,ETH_ALEN ); +eth_hw_addr_set (dev, addr);break ;case PAM_CARD : i =IO ->eeprom;for ( i =0 ; i <6 ; ++i ) - dev->dev_addr[i] = + addr[i] = ((((unsigned short *)MEM )[i*2 ] &0x0f ) <<4 ) | ((((unsigned short *)MEM )[i*2 +1 ] &0x0f )); +eth_hw_addr_set (dev, addr); i =IO ->mem;break ; }
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 6/15 amd: mvme147: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/amd/mvme147.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/net/ethernet/amd/mvme147.c +8 -6
@@ -74,6 +74,7 @@ static struct net_device * __init mvme147lance_probe(void)static int called;static const char name[] ="MVME147 LANCE" ;struct m147lance_private *lp; +u8 macaddr[ETH_ALEN ];u_long *addr;u_long address;int err;
@@ -93,15 +94,16 @@ static struct net_device * __init mvme147lance_probe(void) addr = (u_long *)ETHERNET_ADDRESS ; address = *addr; - dev->dev_addr[0 ] =0x08 ; - dev->dev_addr[1 ] =0x00 ; - dev->dev_addr[2 ] =0x3e ; + macaddr[0 ] =0x08 ; + macaddr[1 ] =0x00 ; + macaddr[2 ] =0x3e ; address = address >>8 ; - dev->dev_addr[5 ] = address&0xff ; + macaddr[5 ] = address&0xff ; address = address >>8 ; - dev->dev_addr[4 ] = address&0xff ; + macaddr[4 ] = address&0xff ; address = address >>8 ; - dev->dev_addr[3 ] = address&0xff ; + macaddr[3 ] = address&0xff ; +eth_hw_addr_set (dev, macaddr); printk("%s: MVME147 at 0x%08lx, irq %d, Hardware Address %pM\n", dev->name, dev->base_addr, MVME147_LANCE_IRQ,
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 7/15 8390: smc-ultra: use eth_hw_addr_set()
In reply to Jakub KicinskiIO reads, so save to an array then eth_hw_addr_set().
Fixes build on Alpha.
--- drivers/net/ethernet/8390/smc-ultra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/8390/smc-ultra.c +3 -1
@@ -204,6 +204,7 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr) {int i, retval;int checksum =0 ; +u8 macaddr[ETH_ALEN ];const char *model_name;unsigned char eeprom_irq =0 ;static unsigned version_printed;
@@ -239,7 +240,8 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr) model_name = (idreg &0xF0 ) ==0x20 ?"SMC Ultra" :"SMC EtherEZ" ;for (i =0 ; i <6 ; i++) - dev->dev_addr[i] =inb (ioaddr +8 + i); + macaddr[i] =inb (ioaddr +8 + i); +eth_hw_addr_set (dev, macaddr);netdev_info (dev,"%s at %#3x, %pM" , model_name, ioaddr, dev->dev_addr);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 8/15 8390: hydra: use eth_hw_addr_set()
In reply to Jakub KicinskiLoop with offsetting to every second byte, so use a temp buffer.
Fixes m68k build.
--- drivers/net/ethernet/8390/hydra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/8390/hydra.c +3 -1
@@ -116,6 +116,7 @@ static int hydra_init(struct zorro_dev *z)unsigned long ioaddr = board+HYDRA_NIC_BASE ;const char name[] ="NE2000" ;int start_page, stop_page; +u8 macaddr[ETH_ALEN ];int j;int err;
@@ -129,7 +130,8 @@ static int hydra_init(struct zorro_dev *z)return -ENOMEM ;for (j =0 ; j <ETH_ALEN ; j++) - dev->dev_addr[j] = *((u8 *)(board +HYDRA_ADDRPROM +2 *j)); + macaddr[j] = *((u8 *)(board +HYDRA_ADDRPROM +2 *j)); +eth_hw_addr_set (dev, macaddr);/* We must set the 8390 for word mode. */ z_writeb (0x4b , ioaddr +NE_EN0_DCFG );
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 9/15 8390: mac8390: use eth_hw_addr_set()
In reply to Jakub KicinskiUse temp to pass to the reading function, the function is generic so can't fix there.
Fixes m68k build.
--- drivers/net/ethernet/8390/mac8390.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/8390/mac8390.c +3 -1
@@ -292,6 +292,7 @@ static bool mac8390_rsrc_init(struct net_device *dev,struct nubus_dirent ent;int offset;volatile unsigned short *i; +u8 addr[ETH_ALEN ]; dev->irq =SLOT2IRQ (board->slot);/* This is getting to be a habit */
@@ -314,7 +315,8 @@ static bool mac8390_rsrc_init(struct net_device *dev,return false; } -nubus_get_rsrc_mem (dev->dev_addr, &ent,6 ); +nubus_get_rsrc_mem (addr, &ent,6 ); +eth_hw_addr_set (dev, addr);if (useresources[cardtype] ==1 ) {nubus_rewinddir (&dir);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 10/15 8390: wd: use eth_hw_addr_set()
In reply to Jakub KicinskiIO reads, so save to an array then eth_hw_addr_set().
Fixes build on x86 (32bit).
--- drivers/net/ethernet/8390/wd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/8390/wd.c +3 -1
@@ -168,6 +168,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)int checksum =0 ;int ancient =0 ;/* An old card without config registers. */ int word16 =0 ;/* 0 = 8 bit, 1 = 16 bit */ +u8 addr[ETH_ALEN ];const char *model_name;static unsigned version_printed;struct ei_device *ei_local =netdev_priv (dev);
@@ -191,7 +192,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)netdev_info (dev, version);for (i =0 ; i <6 ; i++) - dev->dev_addr[i] =inb (ioaddr +8 + i); + addr[i] =inb (ioaddr +8 + i); +eth_hw_addr_set (dev, addr);netdev_info (dev,"WD80x3 at %#3x, %pM" , ioaddr, dev->dev_addr);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 11/15 smc9194: use eth_hw_addr_set()
In reply to Jakub Kicinskidev_addr is set from IO reads, and broken from a u16 value.
Fixes build on Alpha.
--- drivers/net/ethernet/smsc/smc9194.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/smsc/smc9194.c +4 -2
@@ -856,6 +856,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)word configuration_register;word memory_info_register;word memory_cfg_register; +u8 addr[ETH_ALEN ];/* Grab the region so that no one else tries to probe our ioports. */ if (!request_region (ioaddr,SMC_IO_EXTENT ,DRV_NAME ))
@@ -924,9 +925,10 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)word address; address =inw ( ioaddr +ADDR0 + i ); - dev->dev_addr[ i +1 ] = address >>8 ; - dev->dev_addr[ i ] = address &0xFF ; + addr[i +1 ] = address >>8 ; + addr[i] = address &0xFF ; } +eth_hw_addr_set (dev, addr);/* get the memory information */
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 12/15 lasi_82594: use eth_hw_addr_set()
In reply to Jakub Kicinskidev_addr is set from IO reads, passed to an arch-specific helper. Note that the helper never reads it so uninitialized temp is fine.
Fixes build on parisc.
--- drivers/net/ethernet/i825xx/lasi_82596.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/i825xx/lasi_82596.c +4 -2
@@ -147,6 +147,7 @@ lan_init_chip(struct parisc_device *dev)struct net_device *netdevice;struct i596_private *lp;int retval = -ENOMEM ; +u8 addr[ETH_ALEN ];int i;if (!dev->irq) {
@@ -167,13 +168,14 @@ lan_init_chip(struct parisc_device *dev) netdevice->base_addr = dev->hpa.start; netdevice->irq = dev->irq; -if (pdc_lan_station_id (netdevice->dev_addr, netdevice->base_addr)) { +if (pdc_lan_station_id (addr, netdevice->base_addr)) {for (i =0 ; i <6 ; i++) { - netdevice->dev_addr[i] =gsc_readb (LAN_PROM_ADDR + i); + addr[i] =gsc_readb (LAN_PROM_ADDR + i); }printk (KERN_INFO "%s: MAC of HP700 LAN read from EEPROM\n" , __FILE__); } +eth_hw_addr_set (netdevice, addr); lp =netdev_priv (netdevice); lp->options = dev->id.sversion ==0x72 ?OPT_SWAP_PORT :0 ;
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 13/15 apple: macmace: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/apple/macmace.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/ethernet/apple/macmace.c +9 -5
@@ -92,7 +92,7 @@ static void mace_reset(struct net_device *dev);static irqreturn_t mace_interrupt (int irq,void *dev_id);static irqreturn_t mace_dma_intr (int irq,void *dev_id);static void mace_tx_timeout (struct net_device *dev,unsigned int txqueue); -static void __mace_set_address (struct net_device *dev,void *addr); +static void __mace_set_address (struct net_device *dev,const void *addr);/* * Load a receive DMA channel with a base address and ring length
@@ -197,6 +197,7 @@ static int mace_probe(struct platform_device *pdev)unsigned char *addr;struct net_device *dev;unsigned char checksum =0 ; +u8 macaddr[ETH_ALEN ];int err; dev =alloc_etherdev (PRIV_BYTES );
@@ -229,8 +230,9 @@ static int mace_probe(struct platform_device *pdev)for (j =0 ; j <6 ; ++j) {u8 v =bitrev8 (addr[j<<4 ]); checksum ^= v; - dev->dev_addr[j] = v; + macaddr[j] = v; } +eth_hw_addr_set (dev, macaddr);for (; j <8 ; ++j) { checksum ^=bitrev8 (addr[j<<4 ]); }
@@ -315,11 +317,12 @@ static void mace_reset(struct net_device *dev)* Load the address on a mace controller. */ -static void __mace_set_address (struct net_device *dev,void *addr) +static void __mace_set_address (struct net_device *dev,const void *addr) {struct mace_data *mp =netdev_priv (dev);volatile struct mace *mb = mp->mace; -unsigned char *p = addr; +const unsigned char *p = addr; +u8 macaddr[ETH_ALEN ];int i;/* load up the hardware address */
@@ -331,7 +334,8 @@ static void __mace_set_address(struct net_device *dev, void *addr) ; }for (i =0 ; i <6 ; ++i) - mb->padr = dev->dev_addr[i] = p[i]; + mb->padr = macaddr[i] = p[i]; +eth_hw_addr_set (dev, macaddr);if (mp->chipid !=BROKEN_ADDRCHG_REV ) mb->iac =0 ; }
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 14/15 cirrus: mac89x0: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/cirrus/mac89x0.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/cirrus/mac89x0.c +5 -2
@@ -242,12 +242,15 @@ static int mac89x0_device_probe(struct platform_device *pdev)pr_info ("No EEPROM, giving up now.\n" ); goto out1; }else { +u8 addr[ETH_ALEN ]; +for (i =0 ; i <ETH_ALEN ; i +=2 ) {/* Big-endian (why??!) */ unsigned short s =readreg (dev,PP_IA + i); - dev->dev_addr[i] = s >>8 ; - dev->dev_addr[i+1 ] = s &0xff ; + addr[i] = s >>8 ; + addr[i+1 ] = s &0xff ; } +eth_hw_addr_set (dev, addr); } dev->irq =SLOT2IRQ (slot);
Signature · 1 line
2.31.1
Jakub Kicinski
maintainerPATCH 15/15 natsemi: macsonic: use eth_hw_addr_set()
In reply to Jakub KicinskiByte by byte assignments.
Fixes build on m68k.
--- drivers/net/ethernet/natsemi/macsonic.c | 27 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-)
drivers/net/ethernet/natsemi/macsonic.c +17 -10
@@ -203,6 +203,7 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)struct sonic_local *lp =netdev_priv (dev);const int prom_addr =ONBOARD_SONIC_PROM_BASE ;unsigned short val; +u8 addr[ETH_ALEN ];/* * On NuBus boards we can sometimes look in the ROM resources.
@@ -213,7 +214,8 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)int i;for (i =0 ; i <6 ; i++) - dev->dev_addr[i] =SONIC_READ_PROM (i); + addr[i] =SONIC_READ_PROM (i); +eth_hw_addr_set (dev, addr);if (!INVALID_MAC (dev->dev_addr))return ;
@@ -222,7 +224,8 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)* source has a rather long and detailed historical account of * why this is so. */ -bit_reverse_addr (dev->dev_addr); +bit_reverse_addr (addr); +eth_hw_addr_set (dev, addr);if (!INVALID_MAC (dev->dev_addr))return ;
@@ -243,14 +246,15 @@ static void mac_onboard_sonic_ethernet_addr(struct net_device *dev)SONIC_WRITE (SONIC_CEP ,15 ); val =SONIC_READ (SONIC_CAP2 ); - dev->dev_addr[5 ] = val >>8 ; - dev->dev_addr[4 ] = val &0xff ; + addr[5 ] = val >>8 ; + addr[4 ] = val &0xff ; val =SONIC_READ (SONIC_CAP1 ); - dev->dev_addr[3 ] = val >>8 ; - dev->dev_addr[2 ] = val &0xff ; + addr[3 ] = val >>8 ; + addr[2 ] = val &0xff ; val =SONIC_READ (SONIC_CAP0 ); - dev->dev_addr[1 ] = val >>8 ; - dev->dev_addr[0 ] = val &0xff ; + addr[1 ] = val >>8 ; + addr[0 ] = val &0xff ; +eth_hw_addr_set (dev, addr);if (!INVALID_MAC (dev->dev_addr))return ;
@@ -355,13 +359,16 @@ static int mac_onboard_sonic_probe(struct net_device *dev)static int mac_sonic_nubus_ethernet_addr (struct net_device *dev,unsigned long prom_addr,int id) { +u8 addr[ETH_ALEN ];int i; +for (i =0 ; i <6 ; i++) - dev->dev_addr[i] =SONIC_READ_PROM (i); + addr[i] =SONIC_READ_PROM (i);/* Some of the addresses are bit-reversed */ if (id !=MACSONIC_DAYNA ) -bit_reverse_addr (dev->dev_addr); +bit_reverse_addr (addr); +eth_hw_addr_set (dev, addr);return 0 ; }
Signature · 1 line
2.31.1
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Thu, 18 Nov 2021 23:10:18 -0800 you wrote:
Fixups for more arch-specific drivers.
With these (and another patch which didn't fit) the build is more or less clean with all cross-compilers available on kernel.org. I say more or less because around half of the arches fail to build for unrelated reasons right now.
[...]
Here is the summary with links:
- [net-next,01/15] amd: lance: use eth_hw_addr_set()
https://git.kernel.org/netdev/net-next/c/0222ee53c483 - [net-next,02/15] amd: ni65: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/69ede3097b87 - [net-next,03/15] amd: a2065/ariadne: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/285e4c664d64 - [net-next,04/15] amd: hplance: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/21942eef0627 - [net-next,05/15] amd: atarilance: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/c3dc2f7196ca - [net-next,06/15] amd: mvme147: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/cc71b8b9376f - [net-next,07/15] 8390: smc-ultra: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/5114ddf8dd88 - [net-next,08/15] 8390: hydra: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/d7d28e90e229 - [net-next,09/15] 8390: mac8390: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/973a34c087f4 - [net-next,10/15] 8390: wd: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/f95f8e890a2a - [net-next,11/15] smc9194: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/80db345e7df0 - [net-next,12/15] lasi_82594: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/5b6d5affd274 - [net-next,13/15] apple: macmace: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/e217fc4affc8 - [net-next,14/15] cirrus: mac89x0: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/9a962aedd30f - [net-next,15/15] natsemi: macsonic: use eth_hw_addr_set() https://git.kernel.org/netdev/net-next/c/bb52aff3e321
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html