Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18809
b: refs/heads/master
c: 0fadb05
h: refs/heads/master
i:
  18807: ff9609b
v: v3
  • Loading branch information
Jeff Kirsher authored and Jeff Garzik committed Jan 17, 2006
1 parent 2587119 commit 787b7a6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47028635d17c7b9c7ffc67499be5fed579bdfe72
refs/heads/master: 0fadb0597d240d4ed279042cab632d567510a1a3
9 changes: 7 additions & 2 deletions trunk/drivers/net/e1000/e1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,14 +1933,19 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
void
e1000_config_collision_dist(struct e1000_hw *hw)
{
uint32_t tctl;
uint32_t tctl, coll_dist;

DEBUGFUNC("e1000_config_collision_dist");

if (hw->mac_type < e1000_82543)
coll_dist = E1000_COLLISION_DISTANCE_82542;
else
coll_dist = E1000_COLLISION_DISTANCE;

tctl = E1000_READ_REG(hw, TCTL);

tctl &= ~E1000_TCTL_COLD;
tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
tctl |= coll_dist << E1000_COLD_SHIFT;

E1000_WRITE_REG(hw, TCTL, tctl);
E1000_WRITE_FLUSH(hw);
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/e1000/e1000_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,10 @@ struct e1000_host_command_info {
/* Collision related configuration parameters */
#define E1000_COLLISION_THRESHOLD 15
#define E1000_CT_SHIFT 4
#define E1000_COLLISION_DISTANCE 64
/* Collision distance is a 0-based value that applies to
* half-duplex-capable hardware only. */
#define E1000_COLLISION_DISTANCE 63
#define E1000_COLLISION_DISTANCE_82542 64
#define E1000_FDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
#define E1000_HDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
#define E1000_COLD_SHIFT 12
Expand Down
28 changes: 18 additions & 10 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ e1000_configure_tx(struct e1000_adapter *adapter)
uint64_t tdba;
struct e1000_hw *hw = &adapter->hw;
uint32_t tdlen, tctl, tipg, tarc;
uint32_t ipgr1, ipgr2;

/* Setup the HW Tx Head and Tail descriptor pointers */

Expand Down Expand Up @@ -1375,22 +1376,26 @@ e1000_configure_tx(struct e1000_adapter *adapter)

/* Set the default values for the Tx Inter Packet Gap timer */

if (hw->media_type == e1000_media_type_fiber ||
hw->media_type == e1000_media_type_internal_serdes)
tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER;

switch (hw->mac_type) {
case e1000_82542_rev2_0:
case e1000_82542_rev2_1:
tipg = DEFAULT_82542_TIPG_IPGT;
tipg |= DEFAULT_82542_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
ipgr1 = DEFAULT_82542_TIPG_IPGR1;
ipgr2 = DEFAULT_82542_TIPG_IPGR2;
break;
default:
if (hw->media_type == e1000_media_type_fiber ||
hw->media_type == e1000_media_type_internal_serdes)
tipg = DEFAULT_82543_TIPG_IPGT_FIBER;
else
tipg = DEFAULT_82543_TIPG_IPGT_COPPER;
tipg |= DEFAULT_82543_TIPG_IPGR1 << E1000_TIPG_IPGR1_SHIFT;
tipg |= DEFAULT_82543_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT;
ipgr1 = DEFAULT_82543_TIPG_IPGR1;
ipgr2 = DEFAULT_82543_TIPG_IPGR2;
break;
}
tipg |= ipgr1 << E1000_TIPG_IPGR1_SHIFT;
tipg |= ipgr2 << E1000_TIPG_IPGR2_SHIFT;
E1000_WRITE_REG(hw, TIPG, tipg);

/* Set the Tx Interrupt Delay register */
Expand Down Expand Up @@ -1600,7 +1605,10 @@ e1000_setup_rctl(struct e1000_adapter *adapter)
E1000_RCTL_LBM_NO | E1000_RCTL_RDMTS_HALF |
(adapter->hw.mc_filter_type << E1000_RCTL_MO_SHIFT);

if(adapter->hw.tbi_compatibility_on == 1)
if (adapter->hw.mac_type > e1000_82543)
rctl |= E1000_RCTL_SECRC;

if (adapter->hw.tbi_compatibility_on == 1)
rctl |= E1000_RCTL_SBP;
else
rctl &= ~E1000_RCTL_SBP;
Expand Down

0 comments on commit 787b7a6

Please sign in to comment.