diff options
author | PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> | 2009-04-09 18:28:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-11 05:48:01 -0400 |
commit | 1eb99d5ac44e2a9ac0b2856c579ba4d7cc349ada (patch) | |
tree | cc2609d6b53ff31586d2fdbb04c960213fbf118c /drivers/net/ixgbe/ixgbe_82598.c | |
parent | 553b449784e27bb7244c41aa27397d29f213e5a3 (diff) |
ixgbe: Update the usage of orig_autoc to be more consistent
The orig_autoc variable tracks the original setting of the autonegotiate
state prior to trying a new speed. The usage is inconsistent and not very
maintainable. This patch updates the usage to make it more consistent.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@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/ixgbe/ixgbe_82598.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index a8151f25a4d0..361c9d1d0117 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -165,12 +165,19 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, | |||
165 | bool *autoneg) | 165 | bool *autoneg) |
166 | { | 166 | { |
167 | s32 status = 0; | 167 | s32 status = 0; |
168 | u32 autoc = 0; | ||
168 | 169 | ||
169 | /* | 170 | /* |
170 | * Determine link capabilities based on the stored value of AUTOC, | 171 | * Determine link capabilities based on the stored value of AUTOC, |
171 | * which represents EEPROM defaults. | 172 | * which represents EEPROM defaults. If AUTOC value has not been |
173 | * stored, use the current register value. | ||
172 | */ | 174 | */ |
173 | switch (hw->mac.orig_autoc & IXGBE_AUTOC_LMS_MASK) { | 175 | if (hw->mac.orig_link_settings_stored) |
176 | autoc = hw->mac.orig_autoc; | ||
177 | else | ||
178 | autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); | ||
179 | |||
180 | switch (autoc & IXGBE_AUTOC_LMS_MASK) { | ||
174 | case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: | 181 | case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: |
175 | *speed = IXGBE_LINK_SPEED_1GB_FULL; | 182 | *speed = IXGBE_LINK_SPEED_1GB_FULL; |
176 | *autoneg = false; | 183 | *autoneg = false; |
@@ -189,9 +196,9 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, | |||
189 | case IXGBE_AUTOC_LMS_KX4_AN: | 196 | case IXGBE_AUTOC_LMS_KX4_AN: |
190 | case IXGBE_AUTOC_LMS_KX4_AN_1G_AN: | 197 | case IXGBE_AUTOC_LMS_KX4_AN_1G_AN: |
191 | *speed = IXGBE_LINK_SPEED_UNKNOWN; | 198 | *speed = IXGBE_LINK_SPEED_UNKNOWN; |
192 | if (hw->mac.orig_autoc & IXGBE_AUTOC_KX4_SUPP) | 199 | if (autoc & IXGBE_AUTOC_KX4_SUPP) |
193 | *speed |= IXGBE_LINK_SPEED_10GB_FULL; | 200 | *speed |= IXGBE_LINK_SPEED_10GB_FULL; |
194 | if (hw->mac.orig_autoc & IXGBE_AUTOC_KX_SUPP) | 201 | if (autoc & IXGBE_AUTOC_KX_SUPP) |
195 | *speed |= IXGBE_LINK_SPEED_1GB_FULL; | 202 | *speed |= IXGBE_LINK_SPEED_1GB_FULL; |
196 | *autoneg = true; | 203 | *autoneg = true; |
197 | break; | 204 | break; |