提交 efa2ad89 编写于 作者: O Otavio Salvador 提交者: David S. Miller

net/sis900: store MAC into perm_addr for SiS 900, 630E, 635 and 96x variants

Signed-off-by: NOtavio Salvador <otavio@ossystems.com.br>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0e087858
...@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops; ...@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops;
* @net_dev: the net device to get address for * @net_dev: the net device to get address for
* *
* Older SiS900 and friends, use EEPROM to store MAC address. * Older SiS900 and friends, use EEPROM to store MAC address.
* MAC address is read from read_eeprom() into @net_dev->dev_addr. * MAC address is read from read_eeprom() into @net_dev->dev_addr and
* @net_dev->perm_addr.
*/ */
static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev) static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev)
...@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de ...@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
/* Store MAC Address in perm_addr */
memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
return 1; return 1;
} }
...@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de ...@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
* *
* SiS630E model, use APC CMOS RAM to store MAC address. * SiS630E model, use APC CMOS RAM to store MAC address.
* APC CMOS RAM is accessed through ISA bridge. * APC CMOS RAM is accessed through ISA bridge.
* MAC address is read into @net_dev->dev_addr. * MAC address is read into @net_dev->dev_addr and
* @net_dev->perm_addr.
*/ */
static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
...@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, ...@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
outb(0x09 + i, 0x70); outb(0x09 + i, 0x70);
((u8 *)(net_dev->dev_addr))[i] = inb(0x71); ((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
} }
/* Store MAC Address in perm_addr */
memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
pci_dev_put(isa_bridge); pci_dev_put(isa_bridge);
...@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, ...@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
* *
* SiS635 model, set MAC Reload Bit to load Mac address from APC * SiS635 model, set MAC Reload Bit to load Mac address from APC
* to rfdr. rfdr is accessed through rfcr. MAC address is read into * to rfdr. rfdr is accessed through rfcr. MAC address is read into
* @net_dev->dev_addr. * @net_dev->dev_addr and @net_dev->perm_addr.
*/ */
static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
...@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, ...@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
*( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
} }
/* Store MAC Address in perm_addr */
memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
/* enable packet filtering */ /* enable packet filtering */
outl(rfcrSave | RFEN, rfcr + ioaddr); outl(rfcrSave | RFEN, rfcr + ioaddr);
...@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, ...@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
* EEDONE signal to refuse EEPROM access by LAN. * EEDONE signal to refuse EEPROM access by LAN.
* The EEPROM map of SiS962 or SiS963 is different to SiS900. * The EEPROM map of SiS962 or SiS963 is different to SiS900.
* The signature field in SiS962 or SiS963 spec is meaningless. * The signature field in SiS962 or SiS963 spec is meaningless.
* MAC address is read into @net_dev->dev_addr. * MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr.
*/ */
static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
...@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, ...@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
/* Store MAC Address in perm_addr */
memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
outl(EEDONE, ee_addr); outl(EEDONE, ee_addr);
return 1; return 1;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册