]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/ixgbe/ixgbe_ethtool.c
ixgbe: Cleanup DCB logic, whitespace, and comments in ixgbe_ethtool.c
[net-next-2.6.git] / drivers / net / ixgbe / ixgbe_ethtool.c
index 9483faf91ea41c060b0e4186b0a20f3b0420f53e..6871b2be64f6ed1fe484d8e9b81ee42cb43554b7 100644 (file)
@@ -185,6 +185,16 @@ static int ixgbe_get_settings(struct net_device *netdev,
                                             ADVERTISED_FIBRE);
                        ecmd->port = PORT_FIBRE;
                        ecmd->autoneg = AUTONEG_DISABLE;
+               } else if ((hw->device_id == IXGBE_DEV_ID_82599_COMBO_BACKPLANE) ||
+                          (hw->device_id == IXGBE_DEV_ID_82599_KX4_MEZZ)) {
+                       ecmd->supported |= (SUPPORTED_1000baseT_Full |
+                                           SUPPORTED_Autoneg |
+                                           SUPPORTED_FIBRE);
+                       ecmd->advertising = (ADVERTISED_10000baseT_Full |
+                                            ADVERTISED_1000baseT_Full |
+                                            ADVERTISED_Autoneg |
+                                            ADVERTISED_FIBRE);
+                       ecmd->port = PORT_FIBRE;
                } else {
                        ecmd->supported |= (SUPPORTED_1000baseT_Full |
                                            SUPPORTED_FIBRE);
@@ -332,13 +342,6 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
        else
                pause->autoneg = 1;
 
-#ifdef CONFIG_DCB
-       if (hw->fc.current_mode == ixgbe_fc_pfc) {
-               pause->rx_pause = 0;
-               pause->tx_pause = 0;
-       }
-
-#endif
        if (hw->fc.current_mode == ixgbe_fc_rx_pause) {
                pause->rx_pause = 1;
        } else if (hw->fc.current_mode == ixgbe_fc_tx_pause) {
@@ -346,6 +349,11 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
        } else if (hw->fc.current_mode == ixgbe_fc_full) {
                pause->rx_pause = 1;
                pause->tx_pause = 1;
+#ifdef CONFIG_DCB
+       } else if (hw->fc.current_mode == ixgbe_fc_pfc) {
+               pause->rx_pause = 0;
+               pause->tx_pause = 0;
+#endif
        }
 }
 
@@ -363,7 +371,6 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
                return -EINVAL;
 
 #endif
-
        fc = hw->fc;
 
        if (pause->autoneg != AUTONEG_ENABLE)
@@ -425,13 +432,12 @@ static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data)
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
        if (data) {
-               netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
+               netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
                if (adapter->hw.mac.type == ixgbe_mac_82599EB)
                        netdev->features |= NETIF_F_SCTP_CSUM;
        } else {
-               netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
-               if (adapter->hw.mac.type == ixgbe_mac_82599EB)
-                       netdev->features &= ~NETIF_F_SCTP_CSUM;
+               netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
+                                     NETIF_F_SCTP_CSUM);
        }
 
        return 0;
@@ -620,6 +626,7 @@ static void ixgbe_get_regs(struct net_device *netdev,
        regs_buff[827] = IXGBE_READ_REG(hw, IXGBE_WUPM);
        regs_buff[828] = IXGBE_READ_REG(hw, IXGBE_FHFT(0));
 
+       /* DCB */
        regs_buff[829] = IXGBE_READ_REG(hw, IXGBE_RMCS);
        regs_buff[830] = IXGBE_READ_REG(hw, IXGBE_DPMCS);
        regs_buff[831] = IXGBE_READ_REG(hw, IXGBE_PDPMCS);
@@ -1863,6 +1870,13 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
        int retval = 1;
 
        switch(hw->device_id) {
+       case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
+               /* All except this subdevice support WOL */
+               if (hw->subsystem_device_id ==
+                   IXGBE_SUBDEV_ID_82599_KX4_KR_MEZZ) {
+                       wol->supported = 0;
+                       break;
+               }
        case IXGBE_DEV_ID_82599_KX4:
                retval = 0;
                break;