diff options
-rw-r--r-- | drivers/net/e1000e/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/e1000e/phy.c | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index 41609d5561ba..a7d08dae79c4 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -219,7 +219,7 @@ enum e1e_registers { | |||
219 | E1000_HICR = 0x08F00, /* Host Interface Control */ | 219 | E1000_HICR = 0x08F00, /* Host Interface Control */ |
220 | }; | 220 | }; |
221 | 221 | ||
222 | /* RSS registers */ | 222 | #define E1000_MAX_PHY_ADDR 4 |
223 | 223 | ||
224 | /* IGP01E1000 Specific Registers */ | 224 | /* IGP01E1000 Specific Registers */ |
225 | #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */ | 225 | #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */ |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 0c69649af069..67a718862e70 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -2197,28 +2197,34 @@ enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id) | |||
2197 | s32 e1000e_determine_phy_address(struct e1000_hw *hw) | 2197 | s32 e1000e_determine_phy_address(struct e1000_hw *hw) |
2198 | { | 2198 | { |
2199 | s32 ret_val = -E1000_ERR_PHY_TYPE; | 2199 | s32 ret_val = -E1000_ERR_PHY_TYPE; |
2200 | u32 phy_addr= 0; | 2200 | u32 phy_addr = 0; |
2201 | u32 i = 0; | 2201 | u32 i; |
2202 | enum e1000_phy_type phy_type = e1000_phy_unknown; | 2202 | enum e1000_phy_type phy_type = e1000_phy_unknown; |
2203 | 2203 | ||
2204 | do { | 2204 | hw->phy.id = phy_type; |
2205 | for (phy_addr = 0; phy_addr < 4; phy_addr++) { | 2205 | |
2206 | hw->phy.addr = phy_addr; | 2206 | for (phy_addr = 0; phy_addr < E1000_MAX_PHY_ADDR; phy_addr++) { |
2207 | hw->phy.addr = phy_addr; | ||
2208 | i = 0; | ||
2209 | |||
2210 | do { | ||
2207 | e1000e_get_phy_id(hw); | 2211 | e1000e_get_phy_id(hw); |
2208 | phy_type = e1000e_get_phy_type_from_id(hw->phy.id); | 2212 | phy_type = e1000e_get_phy_type_from_id(hw->phy.id); |
2209 | 2213 | ||
2210 | /* | 2214 | /* |
2211 | * If phy_type is valid, break - we found our | 2215 | * If phy_type is valid, break - we found our |
2212 | * PHY address | 2216 | * PHY address |
2213 | */ | 2217 | */ |
2214 | if (phy_type != e1000_phy_unknown) { | 2218 | if (phy_type != e1000_phy_unknown) { |
2215 | ret_val = 0; | 2219 | ret_val = 0; |
2216 | break; | 2220 | goto out; |
2217 | } | 2221 | } |
2218 | } | 2222 | msleep(1); |
2219 | i++; | 2223 | i++; |
2220 | } while ((ret_val != 0) && (i < 100)); | 2224 | } while (i < 10); |
2225 | } | ||
2221 | 2226 | ||
2227 | out: | ||
2222 | return ret_val; | 2228 | return ret_val; |
2223 | } | 2229 | } |
2224 | 2230 | ||