diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-05 02:32:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-06 17:59:17 -0400 |
commit | 008c3422d48b217792789bdea822dbc2efe2165c (patch) | |
tree | 2eee3430313f30a7b35959554ad072c6d66a19c2 /drivers/net/igb/e1000_82575.c | |
parent | 70d92f86dc162fc24e13cd79fd3481ae39b66f72 (diff) |
igb: update the approach taken to acquiring and releasing the phy lock
The current approach is just using a ?: type mechanism to set the phy
locking bit. This if fine for now but limits us to only 2. Switch to a
nested if statement for future compatiblity with more than 2 phys.
Signed-off-by: Alexander Duyck <alexander.h.duyck@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/igb/e1000_82575.c')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 5604b3e08f35..65b900028bca 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -240,9 +240,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
240 | **/ | 240 | **/ |
241 | static s32 igb_acquire_phy_82575(struct e1000_hw *hw) | 241 | static s32 igb_acquire_phy_82575(struct e1000_hw *hw) |
242 | { | 242 | { |
243 | u16 mask; | 243 | u16 mask = E1000_SWFW_PHY0_SM; |
244 | 244 | ||
245 | mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; | 245 | if (hw->bus.func == E1000_FUNC_1) |
246 | mask = E1000_SWFW_PHY1_SM; | ||
246 | 247 | ||
247 | return igb_acquire_swfw_sync_82575(hw, mask); | 248 | return igb_acquire_swfw_sync_82575(hw, mask); |
248 | } | 249 | } |
@@ -256,9 +257,11 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw) | |||
256 | **/ | 257 | **/ |
257 | static void igb_release_phy_82575(struct e1000_hw *hw) | 258 | static void igb_release_phy_82575(struct e1000_hw *hw) |
258 | { | 259 | { |
259 | u16 mask; | 260 | u16 mask = E1000_SWFW_PHY0_SM; |
261 | |||
262 | if (hw->bus.func == E1000_FUNC_1) | ||
263 | mask = E1000_SWFW_PHY1_SM; | ||
260 | 264 | ||
261 | mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; | ||
262 | igb_release_swfw_sync_82575(hw, mask); | 265 | igb_release_swfw_sync_82575(hw, mask); |
263 | } | 266 | } |
264 | 267 | ||