Commit 17449078 authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

[PATCH] e1000: flow control

* Bug fix: flow control high/low watermark settings not
  within Rx FIFO range: math error.
parent b948add3
......@@ -113,7 +113,7 @@ struct e1000_adapter;
#define E1000_SMARTSPEED_MAX 15
/* Packet Buffer allocations */
#define E1000_TX_FIFO_SIZE_SHIFT 0xA
#define E1000_PBA_BYTES_SHIFT 0xA
#define E1000_TX_HEAD_ADDR_SHIFT 7
#define E1000_PBA_TX_MASK 0xFFFF0000
......
......@@ -328,14 +328,16 @@ e1000_reset(struct e1000_adapter *adapter)
adapter->tx_fifo_head = 0;
adapter->tx_head_addr = pba << E1000_TX_HEAD_ADDR_SHIFT;
adapter->tx_fifo_size =
(E1000_PBA_40K - pba) << E1000_TX_FIFO_SIZE_SHIFT;
(E1000_PBA_40K - pba) << E1000_PBA_BYTES_SHIFT;
atomic_set(&adapter->tx_fifo_stall, 0);
}
E1000_WRITE_REG(&adapter->hw, PBA, pba);
/* flow control settings */
adapter->hw.fc_high_water = pba - E1000_FC_HIGH_DIFF;
adapter->hw.fc_low_water = pba - E1000_FC_LOW_DIFF;
adapter->hw.fc_high_water =
(pba << E1000_PBA_BYTES_SHIFT) - E1000_FC_HIGH_DIFF;
adapter->hw.fc_low_water =
(pba << E1000_PBA_BYTES_SHIFT) - E1000_FC_LOW_DIFF;
adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME;
adapter->hw.fc_send_xon = 1;
adapter->hw.fc = adapter->hw.original_fc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment