igb: fix PHY config access on 82580
authorNick Nunley <nicholasx.d.nunley@intel.com>
Thu, 1 Jul 2010 13:37:54 +0000 (13:37 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Jul 2010 05:45:55 +0000 (22:45 -0700)
82580 NICs can have up to 4 functions. This fixes phy accesses
to use the correct locks for functions 2 and 3.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@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>
drivers/net/igb/e1000_82575.c
drivers/net/igb/e1000_defines.h

index 86438b59fa214e9f2f5c4c62f71b23f48c1e88d8..06251a9e9f1b65711e2bfaf6367119a11f68dd6d 100644 (file)
@@ -295,6 +295,10 @@ static s32 igb_acquire_phy_82575(struct e1000_hw *hw)
 
        if (hw->bus.func == E1000_FUNC_1)
                mask = E1000_SWFW_PHY1_SM;
+       else if (hw->bus.func == E1000_FUNC_2)
+               mask = E1000_SWFW_PHY2_SM;
+       else if (hw->bus.func == E1000_FUNC_3)
+               mask = E1000_SWFW_PHY3_SM;
 
        return igb_acquire_swfw_sync_82575(hw, mask);
 }
@@ -312,6 +316,10 @@ static void igb_release_phy_82575(struct e1000_hw *hw)
 
        if (hw->bus.func == E1000_FUNC_1)
                mask = E1000_SWFW_PHY1_SM;
+       else if (hw->bus.func == E1000_FUNC_2)
+               mask = E1000_SWFW_PHY2_SM;
+       else if (hw->bus.func == E1000_FUNC_3)
+               mask = E1000_SWFW_PHY3_SM;
 
        igb_release_swfw_sync_82575(hw, mask);
 }
index 24d9be64342ff91d75119c149618194a9e1485ae..90bc29d7e182800b29ed7a507a92aa72daf3d936 100644 (file)
 #define E1000_SWFW_EEP_SM   0x1
 #define E1000_SWFW_PHY0_SM  0x2
 #define E1000_SWFW_PHY1_SM  0x4
+#define E1000_SWFW_PHY2_SM  0x20
+#define E1000_SWFW_PHY3_SM  0x40
 
 /* FACTPS Definitions */
 /* Device Control */