diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2010-06-16 09:27:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-19 01:12:16 -0400 |
commit | eb7700dc0344564b0b9857d1f5e331a0dd629e92 (patch) | |
tree | 0d8df01136477c3546bdfd15db1507e3d3cdb37d /drivers/net/e1000e/ich8lan.c | |
parent | 8c7bbb925337705dd1459070ac620aeec6a29666 (diff) |
e1000e: fix check for manageability on ICHx/PCH
Do not check for all the bits in E1000_FWSM_MODE_MASK when checking for
manageability on 82577/82578; only check if iAMT is enabled. Both of the
manageability checks (for 82577/82578 and ICHx) must check the firmware
valid bit too since the other bits are only valid when the latter is set.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/ich8lan.c')
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 70cd681fd1ce..7e2f98c24f96 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -226,6 +226,8 @@ static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw); | |||
226 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); | 226 | static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); |
227 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); | 227 | static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); |
228 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | 228 | static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); |
229 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); | ||
230 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); | ||
229 | 231 | ||
230 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 232 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
231 | { | 233 | { |
@@ -515,6 +517,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
515 | case e1000_ich8lan: | 517 | case e1000_ich8lan: |
516 | case e1000_ich9lan: | 518 | case e1000_ich9lan: |
517 | case e1000_ich10lan: | 519 | case e1000_ich10lan: |
520 | /* check management mode */ | ||
521 | mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan; | ||
518 | /* ID LED init */ | 522 | /* ID LED init */ |
519 | mac->ops.id_led_init = e1000e_id_led_init; | 523 | mac->ops.id_led_init = e1000e_id_led_init; |
520 | /* setup LED */ | 524 | /* setup LED */ |
@@ -526,6 +530,8 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
526 | mac->ops.led_off = e1000_led_off_ich8lan; | 530 | mac->ops.led_off = e1000_led_off_ich8lan; |
527 | break; | 531 | break; |
528 | case e1000_pchlan: | 532 | case e1000_pchlan: |
533 | /* check management mode */ | ||
534 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; | ||
529 | /* ID LED init */ | 535 | /* ID LED init */ |
530 | mac->ops.id_led_init = e1000_id_led_init_pchlan; | 536 | mac->ops.id_led_init = e1000_id_led_init_pchlan; |
531 | /* setup LED */ | 537 | /* setup LED */ |
@@ -774,7 +780,7 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) | |||
774 | * e1000_check_mng_mode_ich8lan - Checks management mode | 780 | * e1000_check_mng_mode_ich8lan - Checks management mode |
775 | * @hw: pointer to the HW structure | 781 | * @hw: pointer to the HW structure |
776 | * | 782 | * |
777 | * This checks if the adapter has manageability enabled. | 783 | * This checks if the adapter has any manageability enabled. |
778 | * This is a function pointer entry point only called by read/write | 784 | * This is a function pointer entry point only called by read/write |
779 | * routines for the PHY and NVM parts. | 785 | * routines for the PHY and NVM parts. |
780 | **/ | 786 | **/ |
@@ -783,9 +789,26 @@ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw) | |||
783 | u32 fwsm; | 789 | u32 fwsm; |
784 | 790 | ||
785 | fwsm = er32(FWSM); | 791 | fwsm = er32(FWSM); |
792 | return (fwsm & E1000_ICH_FWSM_FW_VALID) && | ||
793 | ((fwsm & E1000_FWSM_MODE_MASK) == | ||
794 | (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT)); | ||
795 | } | ||
786 | 796 | ||
787 | return (fwsm & E1000_FWSM_MODE_MASK) == | 797 | /** |
788 | (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT); | 798 | * e1000_check_mng_mode_pchlan - Checks management mode |
799 | * @hw: pointer to the HW structure | ||
800 | * | ||
801 | * This checks if the adapter has iAMT enabled. | ||
802 | * This is a function pointer entry point only called by read/write | ||
803 | * routines for the PHY and NVM parts. | ||
804 | **/ | ||
805 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw) | ||
806 | { | ||
807 | u32 fwsm; | ||
808 | |||
809 | fwsm = er32(FWSM); | ||
810 | return (fwsm & E1000_ICH_FWSM_FW_VALID) && | ||
811 | (fwsm & (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT)); | ||
789 | } | 812 | } |
790 | 813 | ||
791 | /** | 814 | /** |
@@ -3396,7 +3419,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
3396 | 3419 | ||
3397 | static struct e1000_mac_operations ich8_mac_ops = { | 3420 | static struct e1000_mac_operations ich8_mac_ops = { |
3398 | .id_led_init = e1000e_id_led_init, | 3421 | .id_led_init = e1000e_id_led_init, |
3399 | .check_mng_mode = e1000_check_mng_mode_ich8lan, | 3422 | /* check_mng_mode dependent on mac type */ |
3400 | .check_for_link = e1000_check_for_copper_link_ich8lan, | 3423 | .check_for_link = e1000_check_for_copper_link_ich8lan, |
3401 | /* cleanup_led dependent on mac type */ | 3424 | /* cleanup_led dependent on mac type */ |
3402 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, | 3425 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, |