aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2006-10-24 17:45:53 -0400
committerAuke Kok <juke-jan.h.kok@intel.com>2006-10-24 17:45:53 -0400
commit4ccc12aeece8ab14ad96461c4db269aea080715d (patch)
tree59254158c25392eace26fe200f92739b64387b1f /drivers/net
parent5826cade4341a6298eb10d476dccc5f403ca7ad8 (diff)
e1000: FIX: don't poke at manageability registers for incompatible adapters
The MANC register should not be read for PCI-E adapters at all, as well as 82543 and older where 82543 would master abort when this register was accessed. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c3
-rw-r--r--drivers/net/e1000/e1000_main.c21
2 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 773821e4cf57..71fb27880f65 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -461,7 +461,8 @@ e1000_get_regs(struct net_device *netdev,
461 regs_buff[24] = (uint32_t)phy_data; /* phy local receiver status */ 461 regs_buff[24] = (uint32_t)phy_data; /* phy local receiver status */
462 regs_buff[25] = regs_buff[24]; /* phy remote receiver status */ 462 regs_buff[25] = regs_buff[24]; /* phy remote receiver status */
463 if (hw->mac_type >= e1000_82540 && 463 if (hw->mac_type >= e1000_82540 &&
464 hw->media_type == e1000_media_type_copper) { 464 hw->mac_type < e1000_82571 &&
465 hw->media_type == e1000_media_type_copper) {
465 regs_buff[26] = E1000_READ_REG(hw, MANC); 466 regs_buff[26] = E1000_READ_REG(hw, MANC);
466 } 467 }
467} 468}
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index fa849831d099..fb83082c4f75 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -699,7 +699,10 @@ e1000_reset(struct e1000_adapter *adapter)
699 phy_data); 699 phy_data);
700 } 700 }
701 701
702 if ((adapter->en_mng_pt) && (adapter->hw.mac_type < e1000_82571)) { 702 if ((adapter->en_mng_pt) &&
703 (adapter->hw.mac_type >= e1000_82540) &&
704 (adapter->hw.mac_type < e1000_82571) &&
705 (adapter->hw.media_type == e1000_media_type_copper)) {
703 manc = E1000_READ_REG(&adapter->hw, MANC); 706 manc = E1000_READ_REG(&adapter->hw, MANC);
704 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST); 707 manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
705 E1000_WRITE_REG(&adapter->hw, MANC, manc); 708 E1000_WRITE_REG(&adapter->hw, MANC, manc);
@@ -1076,8 +1079,9 @@ e1000_remove(struct pci_dev *pdev)
1076 1079
1077 flush_scheduled_work(); 1080 flush_scheduled_work();
1078 1081
1079 if (adapter->hw.mac_type < e1000_82571 && 1082 if (adapter->hw.mac_type >= e1000_82540 &&
1080 adapter->hw.media_type == e1000_media_type_copper) { 1083 adapter->hw.mac_type < e1000_82571 &&
1084 adapter->hw.media_type == e1000_media_type_copper) {
1081 manc = E1000_READ_REG(&adapter->hw, MANC); 1085 manc = E1000_READ_REG(&adapter->hw, MANC);
1082 if (manc & E1000_MANC_SMBUS_EN) { 1086 if (manc & E1000_MANC_SMBUS_EN) {
1083 manc |= E1000_MANC_ARP_EN; 1087 manc |= E1000_MANC_ARP_EN;
@@ -4773,8 +4777,9 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
4773 pci_enable_wake(pdev, PCI_D3cold, 0); 4777 pci_enable_wake(pdev, PCI_D3cold, 0);
4774 } 4778 }
4775 4779
4776 if (adapter->hw.mac_type < e1000_82571 && 4780 if (adapter->hw.mac_type >= e1000_82540 &&
4777 adapter->hw.media_type == e1000_media_type_copper) { 4781 adapter->hw.mac_type < e1000_82571 &&
4782 adapter->hw.media_type == e1000_media_type_copper) {
4778 manc = E1000_READ_REG(&adapter->hw, MANC); 4783 manc = E1000_READ_REG(&adapter->hw, MANC);
4779 if (manc & E1000_MANC_SMBUS_EN) { 4784 if (manc & E1000_MANC_SMBUS_EN) {
4780 manc |= E1000_MANC_ARP_EN; 4785 manc |= E1000_MANC_ARP_EN;
@@ -4825,8 +4830,9 @@ e1000_resume(struct pci_dev *pdev)
4825 4830
4826 netif_device_attach(netdev); 4831 netif_device_attach(netdev);
4827 4832
4828 if (adapter->hw.mac_type < e1000_82571 && 4833 if (adapter->hw.mac_type >= e1000_82540 &&
4829 adapter->hw.media_type == e1000_media_type_copper) { 4834 adapter->hw.mac_type < e1000_82571 &&
4835 adapter->hw.media_type == e1000_media_type_copper) {
4830 manc = E1000_READ_REG(&adapter->hw, MANC); 4836 manc = E1000_READ_REG(&adapter->hw, MANC);
4831 manc &= ~(E1000_MANC_ARP_EN); 4837 manc &= ~(E1000_MANC_ARP_EN);
4832 E1000_WRITE_REG(&adapter->hw, MANC, manc); 4838 E1000_WRITE_REG(&adapter->hw, MANC, manc);
@@ -4944,6 +4950,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
4944 netif_device_attach(netdev); 4950 netif_device_attach(netdev);
4945 4951
4946 if (adapter->hw.mac_type >= e1000_82540 && 4952 if (adapter->hw.mac_type >= e1000_82540 &&
4953 adapter->hw.mac_type < e1000_82571 &&
4947 adapter->hw.media_type == e1000_media_type_copper) { 4954 adapter->hw.media_type == e1000_media_type_copper) {
4948 manc = E1000_READ_REG(&adapter->hw, MANC); 4955 manc = E1000_READ_REG(&adapter->hw, MANC);
4949 manc &= ~(E1000_MANC_ARP_EN); 4956 manc &= ~(E1000_MANC_ARP_EN);