aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2006-01-12 19:51:05 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-17 07:44:51 -0500
commit0fadb0597d240d4ed279042cab632d567510a1a3 (patch)
tree83786788f8bf5ef24b3b2cc871b84030c4d59fdf /drivers/net/e1000
parent47028635d17c7b9c7ffc67499be5fed579bdfe72 (diff)
[PATCH] e1000: Fix collision distance
Fixed the collision distance for 82543 controllers and newer. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_hw.c9
-rw-r--r--drivers/net/e1000/e1000_hw.h5
-rw-r--r--drivers/net/e1000/e1000_main.c28
3 files changed, 29 insertions, 13 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index f79d2a06ee7f..ac227c7847ff 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -1933,14 +1933,19 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
1933void 1933void
1934e1000_config_collision_dist(struct e1000_hw *hw) 1934e1000_config_collision_dist(struct e1000_hw *hw)
1935{ 1935{
1936 uint32_t tctl; 1936 uint32_t tctl, coll_dist;
1937 1937
1938 DEBUGFUNC("e1000_config_collision_dist"); 1938 DEBUGFUNC("e1000_config_collision_dist");
1939 1939
1940 if (hw->mac_type < e1000_82543)
1941 coll_dist = E1000_COLLISION_DISTANCE_82542;
1942 else
1943 coll_dist = E1000_COLLISION_DISTANCE;
1944
1940 tctl = E1000_READ_REG(hw, TCTL); 1945 tctl = E1000_READ_REG(hw, TCTL);
1941 1946
1942 tctl &= ~E1000_TCTL_COLD; 1947 tctl &= ~E1000_TCTL_COLD;
1943 tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT; 1948 tctl |= coll_dist << E1000_COLD_SHIFT;
1944 1949
1945 E1000_WRITE_REG(hw, TCTL, tctl); 1950 E1000_WRITE_REG(hw, TCTL, tctl);
1946 E1000_WRITE_FLUSH(hw); 1951 E1000_WRITE_FLUSH(hw);
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 1ddfd56fc5df..600570ff254b 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -2078,7 +2078,10 @@ struct e1000_host_command_info {
2078/* Collision related configuration parameters */ 2078/* Collision related configuration parameters */
2079#define E1000_COLLISION_THRESHOLD 15 2079#define E1000_COLLISION_THRESHOLD 15
2080#define E1000_CT_SHIFT 4 2080#define E1000_CT_SHIFT 4
2081#define E1000_COLLISION_DISTANCE 64 2081/* Collision distance is a 0-based value that applies to
2082 * half-duplex-capable hardware only. */
2083#define E1000_COLLISION_DISTANCE 63
2084#define E1000_COLLISION_DISTANCE_82542 64
2082#define E1000_FDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE 2085#define E1000_FDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
2083#define E1000_HDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE 2086#define E1000_HDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
2084#define E1000_COLD_SHIFT 12 2087#define E1000_COLD_SHIFT 12
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d2e77ee103bb..36b04d42252f 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1342,6 +1342,7 @@ e1000_configure_tx(struct e1000_adapter *adapter)
1342 uint64_t tdba; 1342 uint64_t tdba;
1343 struct e1000_hw *hw = &adapter->hw; 1343 struct e1000_hw *hw = &adapter->hw;
1344 uint32_t tdlen, tctl, tipg, tarc; 1344 uint32_t tdlen, tctl, tipg, tarc;
1345 uint32_t ipgr1, ipgr2;
1345 1346
1346 /* Setup the HW Tx Head and Tail descriptor pointers */ 1347 /* Setup the HW Tx Head and Tail descriptor pointers */
1347 1348
@@ -1375,22 +1376,26 @@ e1000_configure_tx(struct e1000_adapter *adapter)
1375 1376
1376 /* Set the default values for the Tx Inter Packet Gap timer */ 1377 /* Set the default values for the Tx Inter Packet Gap timer */
1377 1378
1379 if (hw->media_type == e1000_media_type_fiber ||
1380 hw->media_type == e1000_media_type_internal_serdes)
1381 tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
1382 else
1383 tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
1384
1378 switch (hw->mac_type) { 1385 switch (hw->mac_type) {
1379 case e1000_82542_rev2_0: 1386 case e1000_82542_rev2_0:
1380 case e1000_82542_rev2_1: 1387 case e1000_82542_rev2_1:
1381 tipg = DEFAULT_82542_TIPG_IPGT; 1388 tipg = DEFAULT_82542_TIPG_IPGT;
1382 tipg |= DEFAULT_82542_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT; 1389 ipgr1 = DEFAULT_82542_TIPG_IPGR1;
1383 tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; 1390 ipgr2 = DEFAULT_82542_TIPG_IPGR2;
1384 break; 1391 break;
1385 default: 1392 default:
1386 if (hw->media_type == e1000_media_type_fiber || 1393 ipgr1 = DEFAULT_82543_TIPG_IPGR1;
1387 hw->media_type == e1000_media_type_internal_serdes) 1394 ipgr2 = DEFAULT_82543_TIPG_IPGR2;
1388 tipg = DEFAULT_82543_TIPG_IPGT_FIBER; 1395 break;
1389 else
1390 tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
1391 tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
1392 tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
1393 } 1396 }
1397 tipg |= ipgr1 << E1000_TIPG_IPGR1_SHIFT;
1398 tipg |= ipgr2 << E1000_TIPG_IPGR2_SHIFT;
1394 E1000_WRITE_REG(hw, TIPG, tipg); 1399 E1000_WRITE_REG(hw, TIPG, tipg);
1395 1400
1396 /* Set the Tx Interrupt Delay register */ 1401 /* Set the Tx Interrupt Delay register */
@@ -1600,7 +1605,10 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
1600 E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF | 1605 E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
1601 (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT); 1606 (adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT);
1602 1607
1603 if(adapter->hw.tbi_compatibility_on == 1) 1608 if (adapter->hw.mac_type > e1000_82543)
1609 rctl |= E1000_RCTL_SECRC;
1610
1611 if (adapter->hw.tbi_compatibility_on == 1)
1604 rctl |= E1000_RCTL_SBP; 1612 rctl |= E1000_RCTL_SBP;
1605 else 1613 else
1606 rctl &= ~E1000_RCTL_SBP; 1614 rctl &= ~E1000_RCTL_SBP;