aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorNick Nunley <nicholasx.d.nunley@intel.com>2010-02-16 20:02:59 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 16:21:34 -0500
commit2d0b0f693578109aff347e055d47f2797c802261 (patch)
tree5b8f07bbf94a0c4d8aa5ece1aeb2cc44c9b3b48e /drivers/net/igb
parent3025a446b6d0255ae4399ca5f9b259bd1b51539e (diff)
igb: remove adaptive IFS from driver
Adaptive IFS support has been included in the igb driver since its initial release, but it is not a feature on any igb NICs. This patch removes it from the driver. Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/e1000_defines.h6
-rw-r--r--drivers/net/igb/e1000_hw.h7
-rw-r--r--drivers/net/igb/e1000_mac.c70
-rw-r--r--drivers/net/igb/e1000_mac.h2
-rw-r--r--drivers/net/igb/igb_main.c10
5 files changed, 2 insertions, 93 deletions
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index c01715070764..fe6cf1b696c7 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -313,12 +313,6 @@
313#define E1000_PBA_34K 0x0022 313#define E1000_PBA_34K 0x0022
314#define E1000_PBA_64K 0x0040 /* 64KB */ 314#define E1000_PBA_64K 0x0040 /* 64KB */
315 315
316#define IFS_MAX 80
317#define IFS_MIN 40
318#define IFS_RATIO 4
319#define IFS_STEP 10
320#define MIN_NUM_XMITS 1000
321
322/* SW Semaphore Register */ 316/* SW Semaphore Register */
323#define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */ 317#define E1000_SWSM_SMBI 0x00000001 /* Driver Semaphore bit */
324#define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */ 318#define E1000_SWSM_SWESMBI 0x00000002 /* FW Semaphore bit */
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index dbaeb5f5e0c7..448005276b26 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -339,19 +339,12 @@ struct e1000_mac_info {
339 339
340 enum e1000_mac_type type; 340 enum e1000_mac_type type;
341 341
342 u32 collision_delta;
343 u32 ledctl_default; 342 u32 ledctl_default;
344 u32 ledctl_mode1; 343 u32 ledctl_mode1;
345 u32 ledctl_mode2; 344 u32 ledctl_mode2;
346 u32 mc_filter_type; 345 u32 mc_filter_type;
347 u32 tx_packet_delta;
348 u32 txcw; 346 u32 txcw;
349 347
350 u16 current_ifs_val;
351 u16 ifs_max_val;
352 u16 ifs_min_val;
353 u16 ifs_ratio;
354 u16 ifs_step_size;
355 u16 mta_reg_count; 348 u16 mta_reg_count;
356 u16 uta_reg_count; 349 u16 uta_reg_count;
357 350
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index 2ad358a240bf..2a8a886b37eb 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -1304,76 +1304,6 @@ out:
1304} 1304}
1305 1305
1306/** 1306/**
1307 * igb_reset_adaptive - Reset Adaptive Interframe Spacing
1308 * @hw: pointer to the HW structure
1309 *
1310 * Reset the Adaptive Interframe Spacing throttle to default values.
1311 **/
1312void igb_reset_adaptive(struct e1000_hw *hw)
1313{
1314 struct e1000_mac_info *mac = &hw->mac;
1315
1316 if (!mac->adaptive_ifs) {
1317 hw_dbg("Not in Adaptive IFS mode!\n");
1318 goto out;
1319 }
1320
1321 if (!mac->ifs_params_forced) {
1322 mac->current_ifs_val = 0;
1323 mac->ifs_min_val = IFS_MIN;
1324 mac->ifs_max_val = IFS_MAX;
1325 mac->ifs_step_size = IFS_STEP;
1326 mac->ifs_ratio = IFS_RATIO;
1327 }
1328
1329 mac->in_ifs_mode = false;
1330 wr32(E1000_AIT, 0);
1331out:
1332 return;
1333}
1334
1335/**
1336 * igb_update_adaptive - Update Adaptive Interframe Spacing
1337 * @hw: pointer to the HW structure
1338 *
1339 * Update the Adaptive Interframe Spacing Throttle value based on the
1340 * time between transmitted packets and time between collisions.
1341 **/
1342void igb_update_adaptive(struct e1000_hw *hw)
1343{
1344 struct e1000_mac_info *mac = &hw->mac;
1345
1346 if (!mac->adaptive_ifs) {
1347 hw_dbg("Not in Adaptive IFS mode!\n");
1348 goto out;
1349 }
1350
1351 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
1352 if (mac->tx_packet_delta > MIN_NUM_XMITS) {
1353 mac->in_ifs_mode = true;
1354 if (mac->current_ifs_val < mac->ifs_max_val) {
1355 if (!mac->current_ifs_val)
1356 mac->current_ifs_val = mac->ifs_min_val;
1357 else
1358 mac->current_ifs_val +=
1359 mac->ifs_step_size;
1360 wr32(E1000_AIT,
1361 mac->current_ifs_val);
1362 }
1363 }
1364 } else {
1365 if (mac->in_ifs_mode &&
1366 (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
1367 mac->current_ifs_val = 0;
1368 mac->in_ifs_mode = false;
1369 wr32(E1000_AIT, 0);
1370 }
1371 }
1372out:
1373 return;
1374}
1375
1376/**
1377 * igb_validate_mdi_setting - Verify MDI/MDIx settings 1307 * igb_validate_mdi_setting - Verify MDI/MDIx settings
1378 * @hw: pointer to the HW structure 1308 * @hw: pointer to the HW structure
1379 * 1309 *
diff --git a/drivers/net/igb/e1000_mac.h b/drivers/net/igb/e1000_mac.h
index bca17d882417..601be99711c2 100644
--- a/drivers/net/igb/e1000_mac.h
+++ b/drivers/net/igb/e1000_mac.h
@@ -67,8 +67,6 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
67void igb_put_hw_semaphore(struct e1000_hw *hw); 67void igb_put_hw_semaphore(struct e1000_hw *hw);
68void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); 68void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
69s32 igb_check_alt_mac_addr(struct e1000_hw *hw); 69s32 igb_check_alt_mac_addr(struct e1000_hw *hw);
70void igb_reset_adaptive(struct e1000_hw *hw);
71void igb_update_adaptive(struct e1000_hw *hw);
72 70
73bool igb_enable_mng_pass_thru(struct e1000_hw *hw); 71bool igb_enable_mng_pass_thru(struct e1000_hw *hw);
74 72
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 30fb5a89c42d..eb48e1a084dd 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1365,7 +1365,6 @@ void igb_reset(struct igb_adapter *adapter)
1365 /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ 1365 /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
1366 wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE); 1366 wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
1367 1367
1368 igb_reset_adaptive(hw);
1369 igb_get_phy_info(hw); 1368 igb_get_phy_info(hw);
1370} 1369}
1371 1370
@@ -1508,7 +1507,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1508 igb_get_bus_info_pcie(hw); 1507 igb_get_bus_info_pcie(hw);
1509 1508
1510 hw->phy.autoneg_wait_to_complete = false; 1509 hw->phy.autoneg_wait_to_complete = false;
1511 hw->mac.adaptive_ifs = true;
1512 1510
1513 /* Copper options */ 1511 /* Copper options */
1514 if (hw->phy.media_type == e1000_media_type_copper) { 1512 if (hw->phy.media_type == e1000_media_type_copper) {
@@ -3159,7 +3157,6 @@ static void igb_watchdog_task(struct work_struct *work)
3159 } 3157 }
3160 3158
3161 igb_update_stats(adapter); 3159 igb_update_stats(adapter);
3162 igb_update_adaptive(hw);
3163 3160
3164 for (i = 0; i < adapter->num_tx_queues; i++) { 3161 for (i = 0; i < adapter->num_tx_queues; i++) {
3165 struct igb_ring *tx_ring = adapter->tx_ring[i]; 3162 struct igb_ring *tx_ring = adapter->tx_ring[i];
@@ -4064,11 +4061,8 @@ void igb_update_stats(struct igb_adapter *adapter)
4064 adapter->stats.mptc += rd32(E1000_MPTC); 4061 adapter->stats.mptc += rd32(E1000_MPTC);
4065 adapter->stats.bptc += rd32(E1000_BPTC); 4062 adapter->stats.bptc += rd32(E1000_BPTC);
4066 4063
4067 /* used for adaptive IFS */ 4064 adapter->stats.tpt += rd32(E1000_TPT);
4068 hw->mac.tx_packet_delta = rd32(E1000_TPT); 4065 adapter->stats.colc += rd32(E1000_COLC);
4069 adapter->stats.tpt += hw->mac.tx_packet_delta;
4070 hw->mac.collision_delta = rd32(E1000_COLC);
4071 adapter->stats.colc += hw->mac.collision_delta;
4072 4066
4073 adapter->stats.algnerrc += rd32(E1000_ALGNERRC); 4067 adapter->stats.algnerrc += rd32(E1000_ALGNERRC);
4074 adapter->stats.rxerrc += rd32(E1000_RXERRC); 4068 adapter->stats.rxerrc += rd32(E1000_RXERRC);