e1000e: perform 10/100 adaptive IFS only on parts that support it

Adaptive IFS which involves writing to the Adaptive IFS Throttle register
was being done for all devices supported by the driver even though it is
not supported (i.e. the register doesn't even exist) on some devices. The
feature is supported on 8257x/82583 and ICH/PCH based devices, but not
on ESB2.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Bruce Allan and committed by David S. Miller f464ba87 29477e24

+21
+2
drivers/net/e1000e/82571.c
··· 237 /* Set if manageability features are enabled. */ 238 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 239 ? true : false; 240 241 /* check for link */ 242 switch (hw->phy.media_type) {
··· 237 /* Set if manageability features are enabled. */ 238 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 239 ? true : false; 240 + /* Adaptive IFS supported */ 241 + mac->adaptive_ifs = true; 242 243 /* check for link */ 244 switch (hw->phy.media_type) {
+2
drivers/net/e1000e/es2lan.c
··· 224 /* Set if manageability features are enabled. */ 225 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 226 ? true : false; 227 228 /* check for link */ 229 switch (hw->phy.media_type) {
··· 224 /* Set if manageability features are enabled. */ 225 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 226 ? true : false; 227 + /* Adaptive IFS not supported */ 228 + mac->adaptive_ifs = false; 229 230 /* check for link */ 231 switch (hw->phy.media_type) {
+1
drivers/net/e1000e/hw.h
··· 818 819 u8 forced_speed_duplex; 820 821 bool arc_subsystem_valid; 822 bool autoneg; 823 bool autoneg_failed;
··· 818 819 u8 forced_speed_duplex; 820 821 + bool adaptive_ifs; 822 bool arc_subsystem_valid; 823 bool autoneg; 824 bool autoneg_failed;
+2
drivers/net/e1000e/ich8lan.c
··· 454 mac->rar_entry_count--; 455 /* Set if manageability features are enabled. */ 456 mac->arc_subsystem_valid = true; 457 458 /* LED operations */ 459 switch (mac->type) {
··· 454 mac->rar_entry_count--; 455 /* Set if manageability features are enabled. */ 456 mac->arc_subsystem_valid = true; 457 + /* Adaptive IFS supported */ 458 + mac->adaptive_ifs = true; 459 460 /* LED operations */ 461 switch (mac->type) {
+14
drivers/net/e1000e/lib.c
··· 1609 { 1610 struct e1000_mac_info *mac = &hw->mac; 1611 1612 mac->current_ifs_val = 0; 1613 mac->ifs_min_val = IFS_MIN; 1614 mac->ifs_max_val = IFS_MAX; ··· 1622 1623 mac->in_ifs_mode = false; 1624 ew32(AIT, 0); 1625 } 1626 1627 /** ··· 1636 void e1000e_update_adaptive(struct e1000_hw *hw) 1637 { 1638 struct e1000_mac_info *mac = &hw->mac; 1639 1640 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { 1641 if (mac->tx_packet_delta > MIN_NUM_XMITS) { ··· 1662 ew32(AIT, 0); 1663 } 1664 } 1665 } 1666 1667 /**
··· 1609 { 1610 struct e1000_mac_info *mac = &hw->mac; 1611 1612 + if (!mac->adaptive_ifs) { 1613 + e_dbg("Not in Adaptive IFS mode!\n"); 1614 + goto out; 1615 + } 1616 + 1617 mac->current_ifs_val = 0; 1618 mac->ifs_min_val = IFS_MIN; 1619 mac->ifs_max_val = IFS_MAX; ··· 1617 1618 mac->in_ifs_mode = false; 1619 ew32(AIT, 0); 1620 + out: 1621 + return; 1622 } 1623 1624 /** ··· 1629 void e1000e_update_adaptive(struct e1000_hw *hw) 1630 { 1631 struct e1000_mac_info *mac = &hw->mac; 1632 + 1633 + if (!mac->adaptive_ifs) { 1634 + e_dbg("Not in Adaptive IFS mode!\n"); 1635 + goto out; 1636 + } 1637 1638 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { 1639 if (mac->tx_packet_delta > MIN_NUM_XMITS) { ··· 1650 ew32(AIT, 0); 1651 } 1652 } 1653 + out: 1654 + return; 1655 } 1656 1657 /**