Skip to content

Commit

Permalink
igb: update the approach taken to acquiring and releasing the phy lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Oct 6, 2009
1 parent 70d92f8 commit 008c342
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/igb/e1000_82575.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
**/
static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
{
u16 mask;
u16 mask = E1000_SWFW_PHY0_SM;

mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
if (hw->bus.func == E1000_FUNC_1)
mask = E1000_SWFW_PHY1_SM;

return igb_acquire_swfw_sync_82575(hw, mask);
}
Expand All @@ -256,9 +257,11 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
**/
static void igb_release_phy_82575(struct e1000_hw *hw)
{
u16 mask;
u16 mask = E1000_SWFW_PHY0_SM;

if (hw->bus.func == E1000_FUNC_1)
mask = E1000_SWFW_PHY1_SM;

mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
igb_release_swfw_sync_82575(hw, mask);
}

Expand Down

0 comments on commit 008c342

Please sign in to comment.