#define E1000_TX_HEAD_ADDR_SHIFT 7
#define E1000_PBA_TX_MASK 0xFFFF0000
-/* Flow Control High-Watermark: 43464 bytes */
-#define E1000_FC_HIGH_THRESH 0xA9C8
+/* Flow Control High-Watermark: 5688 bytes below Rx FIFO size */
+#define E1000_FC_HIGH_DIFF 0x1638
-/* Flow Control Low-Watermark: 43456 bytes */
-#define E1000_FC_LOW_THRESH 0xA9C0
+/* Flow Control Low-Watermark: 5696 bytes below Rx FIFO size */
+#define E1000_FC_LOW_DIFF 0x1640
/* Flow Control Pause Time: 858 usec */
#define E1000_FC_PAUSE_TIME 0x0680
hw->original_fc = hw->fc;
- if(netif_running(adapter->netdev)) {
- e1000_down(adapter);
- e1000_up(adapter);
- } else
- e1000_reset(adapter);
+ if(adapter->fc_autoneg == AUTONEG_ENABLE) {
+ if(netif_running(adapter->netdev)) {
+ e1000_down(adapter);
+ e1000_up(adapter);
+ } else
+ e1000_reset(adapter);
+ }
+ else
+ return e1000_force_mac_fc(hw);
return 0;
}
* be asked to delay transmission of packets than asking
* our link partner to pause transmission of frames.
*/
- else if(hw->original_fc == e1000_fc_none ||
- hw->original_fc == e1000_fc_tx_pause) {
+ else if((hw->original_fc == e1000_fc_none ||
+ hw->original_fc == e1000_fc_tx_pause) ||
+ hw->fc_strict_ieee) {
hw->fc = e1000_fc_none;
DEBUGOUT("Flow Control = NONE.\r\n");
- } else if(!hw->fc_strict_ieee) {
+ } else {
hw->fc = e1000_fc_rx_pause;
DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n");
}
}
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_pause_time = E1000_FC_PAUSE_TIME;
+ adapter->hw.fc_send_xon = 1;
adapter->hw.fc = adapter->hw.original_fc;
+
e1000_reset_hw(&adapter->hw);
if(adapter->hw.mac_type >= e1000_82544)
E1000_WRITE_REG(&adapter->hw, WUC, 0);
e1000_init_eeprom_params(hw);
- /* flow control settings */
-
- hw->fc_high_water = E1000_FC_HIGH_THRESH;
- hw->fc_low_water = E1000_FC_LOW_THRESH;
- hw->fc_pause_time = E1000_FC_PAUSE_TIME;
- hw->fc_send_xon = 1;
-
if((hw->mac_type == e1000_82541) ||
(hw->mac_type == e1000_82547) ||
(hw->mac_type == e1000_82541_rev_2) ||