Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203110
b: refs/heads/master
c: e52997f
h: refs/heads/master
v: v3
  • Loading branch information
Bruce Allan authored and David S. Miller committed Jun 19, 2010
1 parent f32e4eb commit 8e8c3a1
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 2 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: d3738bb8203acf8552c3ec8b3447133fc0938ddd
refs/heads/master: e52997f96008fda655d7ec3aa4297d1272e8a385
1 change: 1 addition & 0 deletions trunk/drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ struct e1000_info {
#define FLAG2_IS_DISCARDING (1 << 2)
#define FLAG2_DISABLE_ASPM_L1 (1 << 3)
#define FLAG2_HAS_PHY_STATS (1 << 4)
#define FLAG2_HAS_EEE (1 << 5)

#define E1000_RX_DESC_PS(R, i) \
(&(((union e1000_rx_desc_packet_split *)((R).desc))[i]))
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 @@ -937,6 +937,7 @@ struct e1000_dev_spec_ich8lan {
bool kmrn_lock_loss_workaround_enabled;
struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
bool nvm_k1_enabled;
bool eee_disable;
};

struct e1000_hw {
Expand Down
41 changes: 40 additions & 1 deletion trunk/drivers/net/e1000e/ich8lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
/* PHY Power Management Control */
#define HV_PM_CTRL PHY_REG(770, 17)

/* PHY Low Power Idle Control */
#define I82579_LPI_CTRL PHY_REG(772, 20)
#define I82579_LPI_CTRL_ENABLE_MASK 0x6000

/* Strapping Option Register - RO */
#define E1000_STRAP 0x0000C
#define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
Expand Down Expand Up @@ -568,6 +572,35 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter)
return 0;
}

/**
* e1000_set_eee_pchlan - Enable/disable EEE support
* @hw: pointer to the HW structure
*
* Enable/disable EEE based on setting in dev_spec structure. The bits in
* the LPI Control register will remain set only if/when link is up.
**/
static s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
{
s32 ret_val = 0;
u16 phy_reg;

if (hw->phy.type != e1000_phy_82579)
goto out;

ret_val = e1e_rphy(hw, I82579_LPI_CTRL, &phy_reg);
if (ret_val)
goto out;

if (hw->dev_spec.ich8lan.eee_disable)
phy_reg &= ~I82579_LPI_CTRL_ENABLE_MASK;
else
phy_reg |= I82579_LPI_CTRL_ENABLE_MASK;

ret_val = e1e_wphy(hw, I82579_LPI_CTRL, phy_reg);
out:
return ret_val;
}

/**
* e1000_check_for_copper_link_ich8lan - Check for link (Copper)
* @hw: pointer to the HW structure
Expand Down Expand Up @@ -625,6 +658,11 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
*/
e1000e_check_downshift(hw);

/* Enable/Disable EEE after link up */
ret_val = e1000_set_eee_pchlan(hw);
if (ret_val)
goto out;

/*
* If we are forcing speed/duplex, then we simply return since
* we have already determined whether we have link or not.
Expand Down Expand Up @@ -3820,7 +3858,8 @@ struct e1000_info e1000_pch2_info = {
| FLAG_HAS_FLASH
| FLAG_HAS_JUMBO_FRAMES
| FLAG_APME_IN_WUC,
.flags2 = FLAG2_HAS_PHY_STATS,
.flags2 = FLAG2_HAS_PHY_STATS
| FLAG2_HAS_EEE,
.pba = 18,
.max_hw_frame_size = DEFAULT_JUMBO,
.get_variants = e1000_get_variants_ich8lan,
Expand Down
28 changes: 28 additions & 0 deletions trunk/drivers/net/e1000e/param.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lea
E1000_PARAM(CrcStripping, "Enable CRC Stripping, disable if your BMC needs " \
"the CRC");

/*
* Enable/disable EEE (a.k.a. IEEE802.3az)
*
* Valid Range: 0, 1
*
* Default Value: 1
*/
E1000_PARAM(EEE, "Enable/disable on parts that support the feature");

struct e1000_option {
enum { enable_option, range_option, list_option } type;
const char *name;
Expand Down Expand Up @@ -477,4 +486,23 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
}
}
}
{ /* EEE for parts supporting the feature */
static const struct e1000_option opt = {
.type = enable_option,
.name = "EEE Support",
.err = "defaulting to Enabled",
.def = OPTION_ENABLED
};

if (adapter->flags2 & FLAG2_HAS_EEE) {
/* Currently only supported on 82579 */
if (num_EEE > bd) {
unsigned int eee = EEE[bd];
e1000_validate_option(&eee, &opt, adapter);
hw->dev_spec.ich8lan.eee_disable = !eee;
} else {
hw->dev_spec.ich8lan.eee_disable = !opt.def;
}
}
}
}

0 comments on commit 8e8c3a1

Please sign in to comment.