aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000e/lib.c')
-rw-r--r--drivers/net/e1000e/lib.c60
1 files changed, 37 insertions, 23 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index a8b2c0de27c4..a968e3a416ac 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -1262,24 +1262,21 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup
1262 u32 status; 1262 u32 status;
1263 1263
1264 status = er32(STATUS); 1264 status = er32(STATUS);
1265 if (status & E1000_STATUS_SPEED_1000) { 1265 if (status & E1000_STATUS_SPEED_1000)
1266 *speed = SPEED_1000; 1266 *speed = SPEED_1000;
1267 e_dbg("1000 Mbs, "); 1267 else if (status & E1000_STATUS_SPEED_100)
1268 } else if (status & E1000_STATUS_SPEED_100) {
1269 *speed = SPEED_100; 1268 *speed = SPEED_100;
1270 e_dbg("100 Mbs, "); 1269 else
1271 } else {
1272 *speed = SPEED_10; 1270 *speed = SPEED_10;
1273 e_dbg("10 Mbs, ");
1274 }
1275 1271
1276 if (status & E1000_STATUS_FD) { 1272 if (status & E1000_STATUS_FD)
1277 *duplex = FULL_DUPLEX; 1273 *duplex = FULL_DUPLEX;
1278 e_dbg("Full Duplex\n"); 1274 else
1279 } else {
1280 *duplex = HALF_DUPLEX; 1275 *duplex = HALF_DUPLEX;
1281 e_dbg("Half Duplex\n"); 1276
1282 } 1277 e_dbg("%u Mbps, %s Duplex\n",
1278 *speed == SPEED_1000 ? 1000 : *speed == SPEED_100 ? 100 : 10,
1279 *duplex == FULL_DUPLEX ? "Full" : "Half");
1283 1280
1284 return 0; 1281 return 0;
1285} 1282}
@@ -2275,6 +2272,11 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
2275 u32 hicr; 2272 u32 hicr;
2276 u8 i; 2273 u8 i;
2277 2274
2275 if (!(hw->mac.arc_subsystem_valid)) {
2276 e_dbg("ARC subsystem not valid.\n");
2277 return -E1000_ERR_HOST_INTERFACE_COMMAND;
2278 }
2279
2278 /* Check that the host interface is enabled. */ 2280 /* Check that the host interface is enabled. */
2279 hicr = er32(HICR); 2281 hicr = er32(HICR);
2280 if ((hicr & E1000_HICR_EN) == 0) { 2282 if ((hicr & E1000_HICR_EN) == 0) {
@@ -2518,10 +2520,11 @@ s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
2518} 2520}
2519 2521
2520/** 2522/**
2521 * e1000e_enable_mng_pass_thru - Enable processing of ARP's 2523 * e1000e_enable_mng_pass_thru - Check if management passthrough is needed
2522 * @hw: pointer to the HW structure 2524 * @hw: pointer to the HW structure
2523 * 2525 *
2524 * Verifies the hardware needs to allow ARPs to be processed by the host. 2526 * Verifies the hardware needs to leave interface enabled so that frames can
2527 * be directed to and from the management interface.
2525 **/ 2528 **/
2526bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) 2529bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
2527{ 2530{
@@ -2531,11 +2534,10 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
2531 2534
2532 manc = er32(MANC); 2535 manc = er32(MANC);
2533 2536
2534 if (!(manc & E1000_MANC_RCV_TCO_EN) || 2537 if (!(manc & E1000_MANC_RCV_TCO_EN))
2535 !(manc & E1000_MANC_EN_MAC_ADDR_FILTER)) 2538 goto out;
2536 return ret_val;
2537 2539
2538 if (hw->mac.arc_subsystem_valid) { 2540 if (hw->mac.has_fwsm) {
2539 fwsm = er32(FWSM); 2541 fwsm = er32(FWSM);
2540 factps = er32(FACTPS); 2542 factps = er32(FACTPS);
2541 2543
@@ -2543,16 +2545,28 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
2543 ((fwsm & E1000_FWSM_MODE_MASK) == 2545 ((fwsm & E1000_FWSM_MODE_MASK) ==
2544 (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { 2546 (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
2545 ret_val = true; 2547 ret_val = true;
2546 return ret_val; 2548 goto out;
2547 } 2549 }
2548 } else { 2550 } else if ((hw->mac.type == e1000_82574) ||
2549 if ((manc & E1000_MANC_SMBUS_EN) && 2551 (hw->mac.type == e1000_82583)) {
2550 !(manc & E1000_MANC_ASF_EN)) { 2552 u16 data;
2553
2554 factps = er32(FACTPS);
2555 e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
2556
2557 if (!(factps & E1000_FACTPS_MNGCG) &&
2558 ((data & E1000_NVM_INIT_CTRL2_MNGM) ==
2559 (e1000_mng_mode_pt << 13))) {
2551 ret_val = true; 2560 ret_val = true;
2552 return ret_val; 2561 goto out;
2553 } 2562 }
2563 } else if ((manc & E1000_MANC_SMBUS_EN) &&
2564 !(manc & E1000_MANC_ASF_EN)) {
2565 ret_val = true;
2566 goto out;
2554 } 2567 }
2555 2568
2569out:
2556 return ret_val; 2570 return ret_val;
2557} 2571}
2558 2572