diff options
Diffstat (limited to 'drivers/net/e1000e/lib.c')
-rw-r--r-- | drivers/net/e1000e/lib.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c index b32361dc340e..a968e3a416ac 100644 --- a/drivers/net/e1000e/lib.c +++ b/drivers/net/e1000e/lib.c | |||
@@ -2272,6 +2272,11 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) | |||
2272 | u32 hicr; | 2272 | u32 hicr; |
2273 | u8 i; | 2273 | u8 i; |
2274 | 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 | |||
2275 | /* Check that the host interface is enabled. */ | 2280 | /* Check that the host interface is enabled. */ |
2276 | hicr = er32(HICR); | 2281 | hicr = er32(HICR); |
2277 | if ((hicr & E1000_HICR_EN) == 0) { | 2282 | if ((hicr & E1000_HICR_EN) == 0) { |
@@ -2530,9 +2535,9 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2530 | manc = er32(MANC); | 2535 | manc = er32(MANC); |
2531 | 2536 | ||
2532 | if (!(manc & E1000_MANC_RCV_TCO_EN)) | 2537 | if (!(manc & E1000_MANC_RCV_TCO_EN)) |
2533 | return ret_val; | 2538 | goto out; |
2534 | 2539 | ||
2535 | if (hw->mac.arc_subsystem_valid) { | 2540 | if (hw->mac.has_fwsm) { |
2536 | fwsm = er32(FWSM); | 2541 | fwsm = er32(FWSM); |
2537 | factps = er32(FACTPS); | 2542 | factps = er32(FACTPS); |
2538 | 2543 | ||
@@ -2540,16 +2545,28 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw) | |||
2540 | ((fwsm & E1000_FWSM_MODE_MASK) == | 2545 | ((fwsm & E1000_FWSM_MODE_MASK) == |
2541 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { | 2546 | (e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) { |
2542 | ret_val = true; | 2547 | ret_val = true; |
2543 | return ret_val; | 2548 | goto out; |
2544 | } | 2549 | } |
2545 | } else { | 2550 | } else if ((hw->mac.type == e1000_82574) || |
2546 | if ((manc & E1000_MANC_SMBUS_EN) && | 2551 | (hw->mac.type == e1000_82583)) { |
2547 | !(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))) { | ||
2548 | ret_val = true; | 2560 | ret_val = true; |
2549 | return ret_val; | 2561 | goto out; |
2550 | } | 2562 | } |
2563 | } else if ((manc & E1000_MANC_SMBUS_EN) && | ||
2564 | !(manc & E1000_MANC_ASF_EN)) { | ||
2565 | ret_val = true; | ||
2566 | goto out; | ||
2551 | } | 2567 | } |
2552 | 2568 | ||
2569 | out: | ||
2553 | return ret_val; | 2570 | return ret_val; |
2554 | } | 2571 | } |
2555 | 2572 | ||