diff options
Diffstat (limited to 'drivers/net/e1000e/lib.c')
-rw-r--r-- | drivers/net/e1000e/lib.c | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index 16f35fadb74b..95f75a43c9f9 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -589,9 +589,6 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw) | |||
589 | s32 ret_val; | 589 | s32 ret_val; |
590 | u16 nvm_data; | 590 | u16 nvm_data; |
591 | 591 | ||
592 | if (mac->fc != e1000_fc_default) | ||
593 | return 0; | ||
594 | |||
595 | /* Read and store word 0x0F of the EEPROM. This word contains bits | 592 | /* Read and store word 0x0F of the EEPROM. This word contains bits |
596 | * that determine the hardware's default PAUSE (flow control) mode, | 593 | * that determine the hardware's default PAUSE (flow control) mode, |
597 | * a bit that determines whether the HW defaults to enabling or | 594 | * a bit that determines whether the HW defaults to enabling or |
@@ -1107,34 +1104,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1107 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { | 1104 | (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { |
1108 | mac->fc = e1000_fc_rx_pause; | 1105 | mac->fc = e1000_fc_rx_pause; |
1109 | hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); | 1106 | hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); |
1110 | } | 1107 | } else { |
1111 | /* Per the IEEE spec, at this point flow control should be | 1108 | /* |
1112 | * disabled. However, we want to consider that we could | 1109 | * Per the IEEE spec, at this point flow control |
1113 | * be connected to a legacy switch that doesn't advertise | 1110 | * should be disabled. |
1114 | * desired flow control, but can be forced on the link | 1111 | */ |
1115 | * partner. So if we advertised no flow control, that is | ||
1116 | * what we will resolve to. If we advertised some kind of | ||
1117 | * receive capability (Rx Pause Only or Full Flow Control) | ||
1118 | * and the link partner advertised none, we will configure | ||
1119 | * ourselves to enable Rx Flow Control only. We can do | ||
1120 | * this safely for two reasons: If the link partner really | ||
1121 | * didn't want flow control enabled, and we enable Rx, no | ||
1122 | * harm done since we won't be receiving any PAUSE frames | ||
1123 | * anyway. If the intent on the link partner was to have | ||
1124 | * flow control enabled, then by us enabling RX only, we | ||
1125 | * can at least receive pause frames and process them. | ||
1126 | * This is a good idea because in most cases, since we are | ||
1127 | * predominantly a server NIC, more times than not we will | ||
1128 | * be asked to delay transmission of packets than asking | ||
1129 | * our link partner to pause transmission of frames. | ||
1130 | */ | ||
1131 | else if ((mac->original_fc == e1000_fc_none) || | ||
1132 | (mac->original_fc == e1000_fc_tx_pause)) { | ||
1133 | mac->fc = e1000_fc_none; | 1112 | mac->fc = e1000_fc_none; |
1134 | hw_dbg(hw, "Flow Control = NONE.\r\n"); | 1113 | hw_dbg(hw, "Flow Control = NONE.\r\n"); |
1135 | } else { | ||
1136 | mac->fc = e1000_fc_rx_pause; | ||
1137 | hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); | ||
1138 | } | 1114 | } |
1139 | 1115 | ||
1140 | /* Now we need to do one last check... If we auto- | 1116 | /* Now we need to do one last check... If we auto- |
@@ -1164,7 +1140,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw) | |||
1164 | } | 1140 | } |
1165 | 1141 | ||
1166 | /** | 1142 | /** |
1167 | * e1000e_get_speed_and_duplex_copper - Retreive current speed/duplex | 1143 | * e1000e_get_speed_and_duplex_copper - Retrieve current speed/duplex |
1168 | * @hw: pointer to the HW structure | 1144 | * @hw: pointer to the HW structure |
1169 | * @speed: stores the current speed | 1145 | * @speed: stores the current speed |
1170 | * @duplex: stores the current duplex | 1146 | * @duplex: stores the current duplex |
@@ -1200,7 +1176,7 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup | |||
1200 | } | 1176 | } |
1201 | 1177 | ||
1202 | /** | 1178 | /** |
1203 | * e1000e_get_speed_and_duplex_fiber_serdes - Retreive current speed/duplex | 1179 | * e1000e_get_speed_and_duplex_fiber_serdes - Retrieve current speed/duplex |
1204 | * @hw: pointer to the HW structure | 1180 | * @hw: pointer to the HW structure |
1205 | * @speed: stores the current speed | 1181 | * @speed: stores the current speed |
1206 | * @duplex: stores the current duplex | 1182 | * @duplex: stores the current duplex |
@@ -1410,7 +1386,7 @@ s32 e1000e_cleanup_led_generic(struct e1000_hw *hw) | |||
1410 | * e1000e_blink_led - Blink LED | 1386 | * e1000e_blink_led - Blink LED |
1411 | * @hw: pointer to the HW structure | 1387 | * @hw: pointer to the HW structure |
1412 | * | 1388 | * |
1413 | * Blink the led's which are set to be on. | 1389 | * Blink the LEDs which are set to be on. |
1414 | **/ | 1390 | **/ |
1415 | s32 e1000e_blink_led(struct e1000_hw *hw) | 1391 | s32 e1000e_blink_led(struct e1000_hw *hw) |
1416 | { | 1392 | { |
@@ -1515,7 +1491,7 @@ void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop) | |||
1515 | * @hw: pointer to the HW structure | 1491 | * @hw: pointer to the HW structure |
1516 | * | 1492 | * |
1517 | * Returns 0 if successful, else returns -10 | 1493 | * Returns 0 if successful, else returns -10 |
1518 | * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not casued | 1494 | * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused |
1519 | * the master requests to be disabled. | 1495 | * the master requests to be disabled. |
1520 | * | 1496 | * |
1521 | * Disables PCI-Express master access and verifies there are no pending | 1497 | * Disables PCI-Express master access and verifies there are no pending |
@@ -1876,7 +1852,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw) | |||
1876 | } | 1852 | } |
1877 | 1853 | ||
1878 | /** | 1854 | /** |
1879 | * e1000e_read_nvm_spi - Read EEPROM's using SPI | 1855 | * e1000e_read_nvm_spi - Reads EEPROM using SPI |
1880 | * @hw: pointer to the HW structure | 1856 | * @hw: pointer to the HW structure |
1881 | * @offset: offset of word in the EEPROM to read | 1857 | * @offset: offset of word in the EEPROM to read |
1882 | * @words: number of words to read | 1858 | * @words: number of words to read |
@@ -1980,7 +1956,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | |||
1980 | * Writes data to EEPROM at offset using SPI interface. | 1956 | * Writes data to EEPROM at offset using SPI interface. |
1981 | * | 1957 | * |
1982 | * If e1000e_update_nvm_checksum is not called after this function , the | 1958 | * If e1000e_update_nvm_checksum is not called after this function , the |
1983 | * EEPROM will most likley contain an invalid checksum. | 1959 | * EEPROM will most likely contain an invalid checksum. |
1984 | **/ | 1960 | **/ |
1985 | s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 1961 | s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
1986 | { | 1962 | { |
@@ -2222,7 +2198,7 @@ static u8 e1000_calculate_checksum(u8 *buffer, u32 length) | |||
2222 | * | 2198 | * |
2223 | * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND | 2199 | * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND |
2224 | * | 2200 | * |
2225 | * This function checks whether the HOST IF is enabled for command operaton | 2201 | * This function checks whether the HOST IF is enabled for command operation |
2226 | * and also checks whether the previous command is completed. It busy waits | 2202 | * and also checks whether the previous command is completed. It busy waits |
2227 | * in case of previous command is not completed. | 2203 | * in case of previous command is not completed. |
2228 | **/ | 2204 | **/ |
@@ -2254,7 +2230,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) | |||
2254 | } | 2230 | } |
2255 | 2231 | ||
2256 | /** | 2232 | /** |
2257 | * e1000e_check_mng_mode - check managament mode | 2233 | * e1000e_check_mng_mode - check management mode |
2258 | * @hw: pointer to the HW structure | 2234 | * @hw: pointer to the HW structure |
2259 | * | 2235 | * |
2260 | * Reads the firmware semaphore register and returns true (>0) if | 2236 | * Reads the firmware semaphore register and returns true (>0) if |