]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ixgbevf: Fix link speed display
authorGreg Rose <gregory.v.rose@intel.com>
Tue, 27 Apr 2010 11:31:45 +0000 (11:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Apr 2010 21:35:55 +0000 (14:35 -0700)
The ixgbevf driver would always report 10Gig speeds even when the link
speed is downshifted to 1Gig.  This patch fixes that problem.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbevf/defines.h
drivers/net/ixgbevf/vf.c

index c44fdb05447adfc274ca5bff611dc61692249f2d..ca2c81f49a0567a133b34bd98ba08afb1495da7f 100644 (file)
@@ -41,11 +41,13 @@ typedef u32 ixgbe_link_speed;
 #define IXGBE_LINK_SPEED_1GB_FULL       0x0020
 #define IXGBE_LINK_SPEED_10GB_FULL      0x0080
 
-#define IXGBE_CTRL_RST          0x04000000 /* Reset (SW) */
-#define IXGBE_RXDCTL_ENABLE     0x02000000 /* Enable specific Rx Queue */
-#define IXGBE_TXDCTL_ENABLE     0x02000000 /* Enable specific Tx Queue */
-#define IXGBE_LINKS_UP          0x40000000
-#define IXGBE_LINKS_SPEED       0x20000000
+#define IXGBE_CTRL_RST              0x04000000 /* Reset (SW) */
+#define IXGBE_RXDCTL_ENABLE         0x02000000 /* Enable specific Rx Queue */
+#define IXGBE_TXDCTL_ENABLE         0x02000000 /* Enable specific Tx Queue */
+#define IXGBE_LINKS_UP              0x40000000
+#define IXGBE_LINKS_SPEED_82599     0x30000000
+#define IXGBE_LINKS_SPEED_10G_82599 0x30000000
+#define IXGBE_LINKS_SPEED_1G_82599  0x20000000
 
 /* Number of Transmit and Receive Descriptors must be a multiple of 8 */
 #define IXGBE_REQ_TX_DESCRIPTOR_MULTIPLE  8
index 852e9c4fd93484f6f70f653ca413b7e90cc3d342..f6f929958ba0beb3cb3ec60970042976f1062247 100644 (file)
@@ -359,7 +359,8 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
        else
                *link_up = false;
 
-       if (links_reg & IXGBE_LINKS_SPEED)
+       if ((links_reg & IXGBE_LINKS_SPEED_82599) ==
+           IXGBE_LINKS_SPEED_10G_82599)
                *speed = IXGBE_LINK_SPEED_10GB_FULL;
        else
                *speed = IXGBE_LINK_SPEED_1GB_FULL;