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