aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c65
1 files changed, 38 insertions, 27 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 67f87a79154..cec2f4e8c61 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2008 Intel Corporation. 4 Copyright(c) 1999 - 2009 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -89,8 +89,6 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
89 {"rx_header_split", IXGBE_STAT(rx_hdr_split)}, 89 {"rx_header_split", IXGBE_STAT(rx_hdr_split)},
90 {"alloc_rx_page_failed", IXGBE_STAT(alloc_rx_page_failed)}, 90 {"alloc_rx_page_failed", IXGBE_STAT(alloc_rx_page_failed)},
91 {"alloc_rx_buff_failed", IXGBE_STAT(alloc_rx_buff_failed)}, 91 {"alloc_rx_buff_failed", IXGBE_STAT(alloc_rx_buff_failed)},
92 {"lro_aggregated", IXGBE_STAT(lro_aggregated)},
93 {"lro_flushed", IXGBE_STAT(lro_flushed)},
94}; 92};
95 93
96#define IXGBE_QUEUE_STATS_LEN \ 94#define IXGBE_QUEUE_STATS_LEN \
@@ -132,6 +130,26 @@ static int ixgbe_get_settings(struct net_device *netdev,
132 ecmd->advertising |= ADVERTISED_1000baseT_Full; 130 ecmd->advertising |= ADVERTISED_1000baseT_Full;
133 131
134 ecmd->port = PORT_TP; 132 ecmd->port = PORT_TP;
133 } else if (hw->phy.media_type == ixgbe_media_type_backplane) {
134 /* Set as FIBRE until SERDES defined in kernel */
135 switch (hw->device_id) {
136 case IXGBE_DEV_ID_82598:
137 ecmd->supported |= (SUPPORTED_1000baseT_Full |
138 SUPPORTED_FIBRE);
139 ecmd->advertising = (ADVERTISED_10000baseT_Full |
140 ADVERTISED_1000baseT_Full |
141 ADVERTISED_FIBRE);
142 ecmd->port = PORT_FIBRE;
143 break;
144 case IXGBE_DEV_ID_82598_BX:
145 ecmd->supported = (SUPPORTED_1000baseT_Full |
146 SUPPORTED_FIBRE);
147 ecmd->advertising = (ADVERTISED_1000baseT_Full |
148 ADVERTISED_FIBRE);
149 ecmd->port = PORT_FIBRE;
150 ecmd->autoneg = AUTONEG_DISABLE;
151 break;
152 }
135 } else { 153 } else {
136 ecmd->supported |= SUPPORTED_FIBRE; 154 ecmd->supported |= SUPPORTED_FIBRE;
137 ecmd->advertising = (ADVERTISED_10000baseT_Full | 155 ecmd->advertising = (ADVERTISED_10000baseT_Full |
@@ -206,13 +224,13 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
206 struct ixgbe_adapter *adapter = netdev_priv(netdev); 224 struct ixgbe_adapter *adapter = netdev_priv(netdev);
207 struct ixgbe_hw *hw = &adapter->hw; 225 struct ixgbe_hw *hw = &adapter->hw;
208 226
209 pause->autoneg = (hw->fc.type == ixgbe_fc_full ? 1 : 0); 227 pause->autoneg = (hw->fc.current_mode == ixgbe_fc_full ? 1 : 0);
210 228
211 if (hw->fc.type == ixgbe_fc_rx_pause) { 229 if (hw->fc.current_mode == ixgbe_fc_rx_pause) {
212 pause->rx_pause = 1; 230 pause->rx_pause = 1;
213 } else if (hw->fc.type == ixgbe_fc_tx_pause) { 231 } else if (hw->fc.current_mode == ixgbe_fc_tx_pause) {
214 pause->tx_pause = 1; 232 pause->tx_pause = 1;
215 } else if (hw->fc.type == ixgbe_fc_full) { 233 } else if (hw->fc.current_mode == ixgbe_fc_full) {
216 pause->rx_pause = 1; 234 pause->rx_pause = 1;
217 pause->tx_pause = 1; 235 pause->tx_pause = 1;
218 } 236 }
@@ -226,22 +244,17 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
226 244
227 if ((pause->autoneg == AUTONEG_ENABLE) || 245 if ((pause->autoneg == AUTONEG_ENABLE) ||
228 (pause->rx_pause && pause->tx_pause)) 246 (pause->rx_pause && pause->tx_pause))
229 hw->fc.type = ixgbe_fc_full; 247 hw->fc.requested_mode = ixgbe_fc_full;
230 else if (pause->rx_pause && !pause->tx_pause) 248 else if (pause->rx_pause && !pause->tx_pause)
231 hw->fc.type = ixgbe_fc_rx_pause; 249 hw->fc.requested_mode = ixgbe_fc_rx_pause;
232 else if (!pause->rx_pause && pause->tx_pause) 250 else if (!pause->rx_pause && pause->tx_pause)
233 hw->fc.type = ixgbe_fc_tx_pause; 251 hw->fc.requested_mode = ixgbe_fc_tx_pause;
234 else if (!pause->rx_pause && !pause->tx_pause) 252 else if (!pause->rx_pause && !pause->tx_pause)
235 hw->fc.type = ixgbe_fc_none; 253 hw->fc.requested_mode = ixgbe_fc_none;
236 else 254 else
237 return -EINVAL; 255 return -EINVAL;
238 256
239 hw->fc.original_type = hw->fc.type; 257 hw->mac.ops.setup_fc(hw, 0);
240
241 if (netif_running(netdev))
242 ixgbe_reinit_locked(adapter);
243 else
244 ixgbe_reset(adapter);
245 258
246 return 0; 259 return 0;
247} 260}
@@ -661,10 +674,17 @@ static void ixgbe_get_drvinfo(struct net_device *netdev,
661 struct ethtool_drvinfo *drvinfo) 674 struct ethtool_drvinfo *drvinfo)
662{ 675{
663 struct ixgbe_adapter *adapter = netdev_priv(netdev); 676 struct ixgbe_adapter *adapter = netdev_priv(netdev);
677 char firmware_version[32];
664 678
665 strncpy(drvinfo->driver, ixgbe_driver_name, 32); 679 strncpy(drvinfo->driver, ixgbe_driver_name, 32);
666 strncpy(drvinfo->version, ixgbe_driver_version, 32); 680 strncpy(drvinfo->version, ixgbe_driver_version, 32);
667 strncpy(drvinfo->fw_version, "N/A", 32); 681
682 sprintf(firmware_version, "%d.%d-%d",
683 (adapter->eeprom_version & 0xF000) >> 12,
684 (adapter->eeprom_version & 0x0FF0) >> 4,
685 adapter->eeprom_version & 0x000F);
686
687 strncpy(drvinfo->fw_version, firmware_version, 32);
668 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); 688 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
669 drvinfo->n_stats = IXGBE_STATS_LEN; 689 drvinfo->n_stats = IXGBE_STATS_LEN;
670 drvinfo->regdump_len = ixgbe_get_regs_len(netdev); 690 drvinfo->regdump_len = ixgbe_get_regs_len(netdev);
@@ -808,15 +828,6 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
808 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64); 828 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64);
809 int j, k; 829 int j, k;
810 int i; 830 int i;
811 u64 aggregated = 0, flushed = 0, no_desc = 0;
812 for (i = 0; i < adapter->num_rx_queues; i++) {
813 aggregated += adapter->rx_ring[i].lro_mgr.stats.aggregated;
814 flushed += adapter->rx_ring[i].lro_mgr.stats.flushed;
815 no_desc += adapter->rx_ring[i].lro_mgr.stats.no_desc;
816 }
817 adapter->lro_aggregated = aggregated;
818 adapter->lro_flushed = flushed;
819 adapter->lro_no_desc = no_desc;
820 831
821 ixgbe_update_stats(adapter); 832 ixgbe_update_stats(adapter);
822 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) { 833 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) {