Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195054
b: refs/heads/master
c: a65a4a0
h: refs/heads/master
v: v3
  • Loading branch information
Bruce Allan authored and David S. Miller committed May 13, 2010
1 parent 606ee9d commit 7f486da
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eab50ffb222808b5053a82325be3e5d26faa08df
refs/heads/master: a65a4a0d51eaf9e5715dc24f8820c8689c3719a5
19 changes: 15 additions & 4 deletions trunk/drivers/net/e1000e/82571.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
mac->mta_reg_count = 128;
/* Set rar entry count */
mac->rar_entry_count = E1000_RAR_ENTRIES;
/* Set if manageability features are enabled. */
mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
? true : false;
/* Adaptive IFS supported */
mac->adaptive_ifs = true;

Expand Down Expand Up @@ -271,6 +268,16 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
func->set_lan_id = e1000_set_lan_id_single_port;
func->check_mng_mode = e1000e_check_mng_mode_generic;
func->led_on = e1000e_led_on_generic;

/* FWSM register */
mac->has_fwsm = true;
/*
* ARC supported; valid only if manageability features are
* enabled.
*/
mac->arc_subsystem_valid =
(er32(FWSM) & E1000_FWSM_MODE_MASK)
? true : false;
break;
case e1000_82574:
case e1000_82583:
Expand All @@ -281,6 +288,9 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
default:
func->check_mng_mode = e1000e_check_mng_mode_generic;
func->led_on = e1000e_led_on_generic;

/* FWSM register */
mac->has_fwsm = true;
break;
}

Expand Down Expand Up @@ -993,9 +1003,10 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
/* ...for both queues. */
switch (mac->type) {
case e1000_82573:
e1000e_enable_tx_pkt_filtering(hw);
/* fall through */
case e1000_82574:
case e1000_82583:
e1000e_enable_tx_pkt_filtering(hw);
reg_data = er32(GCR);
reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
ew32(GCR, reg_data);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/e1000e/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@
#define NVM_ALT_MAC_ADDR_PTR 0x0037
#define NVM_CHECKSUM_REG 0x003F

#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */

#define E1000_NVM_CFG_DONE_PORT_0 0x40000 /* MNG config cycle done */
#define E1000_NVM_CFG_DONE_PORT_1 0x80000 /* ...for second port */

Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/e1000e/es2lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,12 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
mac->mta_reg_count = 128;
/* Set rar entry count */
mac->rar_entry_count = E1000_RAR_ENTRIES;
/* Set if manageability features are enabled. */
mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
? true : false;
/* FWSM register */
mac->has_fwsm = true;
/* ARC supported; valid only if manageability features are enabled. */
mac->arc_subsystem_valid =
(er32(FWSM) & E1000_FWSM_MODE_MASK)
? true : false;
/* Adaptive IFS not supported */
mac->adaptive_ifs = false;

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/e1000e/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ struct e1000_mac_info {
u8 forced_speed_duplex;

bool adaptive_ifs;
bool has_fwsm;
bool arc_subsystem_valid;
bool autoneg;
bool autoneg_failed;
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/e1000e/ich8lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
mac->rar_entry_count = E1000_ICH_RAR_ENTRIES;
if (mac->type == e1000_ich8lan)
mac->rar_entry_count--;
/* Set if manageability features are enabled. */
mac->arc_subsystem_valid = true;
/* FWSM register */
mac->has_fwsm = true;
/* ARC subsystem not supported */
mac->arc_subsystem_valid = false;
/* Adaptive IFS supported */
mac->adaptive_ifs = true;

Expand Down
31 changes: 24 additions & 7 deletions trunk/drivers/net/e1000e/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,11 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
u32 hicr;
u8 i;

if (!(hw->mac.arc_subsystem_valid)) {
e_dbg("ARC subsystem not valid.\n");
return -E1000_ERR_HOST_INTERFACE_COMMAND;
}

/* Check that the host interface is enabled. */
hicr = er32(HICR);
if ((hicr & E1000_HICR_EN) == 0) {
Expand Down Expand Up @@ -2530,26 +2535,38 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
manc = er32(MANC);

if (!(manc & E1000_MANC_RCV_TCO_EN))
return ret_val;
goto out;

if (hw->mac.arc_subsystem_valid) {
if (hw->mac.has_fwsm) {
fwsm = er32(FWSM);
factps = er32(FACTPS);

if (!(factps & E1000_FACTPS_MNGCG) &&
((fwsm & E1000_FWSM_MODE_MASK) ==
(e1000_mng_mode_pt << E1000_FWSM_MODE_SHIFT))) {
ret_val = true;
return ret_val;
goto out;
}
} else {
if ((manc & E1000_MANC_SMBUS_EN) &&
!(manc & E1000_MANC_ASF_EN)) {
} else if ((hw->mac.type == e1000_82574) ||
(hw->mac.type == e1000_82583)) {
u16 data;

factps = er32(FACTPS);
e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);

if (!(factps & E1000_FACTPS_MNGCG) &&
((data & E1000_NVM_INIT_CTRL2_MNGM) ==
(e1000_mng_mode_pt << 13))) {
ret_val = true;
return ret_val;
goto out;
}
} else if ((manc & E1000_MANC_SMBUS_EN) &&
!(manc & E1000_MANC_ASF_EN)) {
ret_val = true;
goto out;
}

out:
return ret_val;
}

Expand Down

0 comments on commit 7f486da

Please sign in to comment.