Merge branch 'for-rmk/samsung6' of git://git.fluff.org/bjdooks/linux into devel-stable
[linux-2.6.git] / drivers / net / ixgbe / ixgbe_ethtool.c
index 9d2cc83..d77961f 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2009 Intel Corporation.
+  Copyright(c) 1999 - 2010 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -79,7 +79,8 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
        {"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)},
        {"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)},
        {"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)},
-       {"hw_rsc_count", IXGBE_STAT(rsc_count)},
+       {"hw_rsc_aggregated", IXGBE_STAT(rsc_total_count)},
+       {"hw_rsc_flushed", IXGBE_STAT(rsc_total_flush)},
        {"fdir_match", IXGBE_STAT(stats.fdirmatch)},
        {"fdir_miss", IXGBE_STAT(stats.fdirmiss)},
        {"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)},
@@ -92,16 +93,11 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
        {"tx_restart_queue", IXGBE_STAT(restart_queue)},
        {"rx_long_length_errors", IXGBE_STAT(stats.roc)},
        {"rx_short_length_errors", IXGBE_STAT(stats.ruc)},
-       {"tx_tcp4_seg_ctxt", IXGBE_STAT(hw_tso_ctxt)},
-       {"tx_tcp6_seg_ctxt", IXGBE_STAT(hw_tso6_ctxt)},
        {"tx_flow_control_xon", IXGBE_STAT(stats.lxontxc)},
        {"rx_flow_control_xon", IXGBE_STAT(stats.lxonrxc)},
        {"tx_flow_control_xoff", IXGBE_STAT(stats.lxofftxc)},
        {"rx_flow_control_xoff", IXGBE_STAT(stats.lxoffrxc)},
-       {"rx_csum_offload_good", IXGBE_STAT(hw_csum_rx_good)},
        {"rx_csum_offload_errors", IXGBE_STAT(hw_csum_rx_error)},
-       {"tx_csum_offload_ctxt", IXGBE_STAT(hw_csum_tx_good)},
-       {"rx_header_split", IXGBE_STAT(rx_hdr_split)},
        {"alloc_rx_page_failed", IXGBE_STAT(alloc_rx_page_failed)},
        {"alloc_rx_buff_failed", IXGBE_STAT(alloc_rx_buff_failed)},
        {"rx_no_dma_resources", IXGBE_STAT(hw_rx_no_dma_resources)},
@@ -204,6 +200,56 @@ static int ixgbe_get_settings(struct net_device *netdev,
                ecmd->autoneg = AUTONEG_DISABLE;
        }
 
+       /* Get PHY type */
+       switch (adapter->hw.phy.type) {
+       case ixgbe_phy_tn:
+       case ixgbe_phy_cu_unknown:
+               /* Copper 10G-BASET */
+               ecmd->port = PORT_TP;
+               break;
+       case ixgbe_phy_qt:
+               ecmd->port = PORT_FIBRE;
+               break;
+       case ixgbe_phy_nl:
+       case ixgbe_phy_tw_tyco:
+       case ixgbe_phy_tw_unknown:
+       case ixgbe_phy_sfp_ftl:
+       case ixgbe_phy_sfp_avago:
+       case ixgbe_phy_sfp_intel:
+       case ixgbe_phy_sfp_unknown:
+               switch (adapter->hw.phy.sfp_type) {
+               /* SFP+ devices, further checking needed */
+               case ixgbe_sfp_type_da_cu:
+               case ixgbe_sfp_type_da_cu_core0:
+               case ixgbe_sfp_type_da_cu_core1:
+                       ecmd->port = PORT_DA;
+                       break;
+               case ixgbe_sfp_type_sr:
+               case ixgbe_sfp_type_lr:
+               case ixgbe_sfp_type_srlr_core0:
+               case ixgbe_sfp_type_srlr_core1:
+                       ecmd->port = PORT_FIBRE;
+                       break;
+               case ixgbe_sfp_type_not_present:
+                       ecmd->port = PORT_NONE;
+                       break;
+               case ixgbe_sfp_type_unknown:
+               default:
+                       ecmd->port = PORT_OTHER;
+                       break;
+               }
+               break;
+       case ixgbe_phy_xaui:
+               ecmd->port = PORT_NONE;
+               break;
+       case ixgbe_phy_unknown:
+       case ixgbe_phy_generic:
+       case ixgbe_phy_sfp_unsupported:
+       default:
+               ecmd->port = PORT_OTHER;
+               break;
+       }
+
        hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
        if (link_up) {
                ecmd->speed = (link_speed == IXGBE_LINK_SPEED_10GB_FULL) ?
@@ -944,6 +990,7 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
        char *p = NULL;
 
        ixgbe_update_stats(adapter);
+       dev_get_stats(netdev);
        for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) {
                switch (ixgbe_gstrings_stats[i].type) {
                case NETDEV_STATS:
@@ -1274,15 +1321,15 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
                return 0;
        } else if (adapter->flags & IXGBE_FLAG_MSI_ENABLED) {
                shared_int = false;
-               if (request_irq(irq, &ixgbe_test_intr, 0, netdev->name,
+               if (request_irq(irq, ixgbe_test_intr, 0, netdev->name,
                                netdev)) {
                        *data = 1;
                        return -1;
                }
-       } else if (!request_irq(irq, &ixgbe_test_intr, IRQF_PROBE_SHARED,
+       } else if (!request_irq(irq, ixgbe_test_intr, IRQF_PROBE_SHARED,
                                netdev->name, netdev)) {
                shared_int = false;
-       } else if (request_irq(irq, &ixgbe_test_intr, IRQF_SHARED,
+       } else if (request_irq(irq, ixgbe_test_intr, IRQF_SHARED,
                               netdev->name, netdev)) {
                *data = 1;
                return -1;
@@ -1971,6 +2018,10 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
                break;
        }
 
+       /* if in mixed tx/rx queues per vector mode, report only rx settings */
+       if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
+               return 0;
+
        /* only valid if in constant ITR mode */
        switch (adapter->tx_itr_setting) {
        case 0:
@@ -1996,12 +2047,9 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
        struct ixgbe_q_vector *q_vector;
        int i;
 
-       /*
-        * don't accept tx specific changes if we've got mixed RxTx vectors
-        * test and jump out here if needed before changing the rx numbers
-        */
-       if ((1000000/ec->tx_coalesce_usecs) != adapter->tx_eitr_param &&
-           adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count)
+       /* don't accept tx specific changes if we've got mixed RxTx vectors */
+       if (adapter->q_vector[0]->txr_count && adapter->q_vector[0]->rxr_count
+          && ec->tx_coalesce_usecs)
                return -EINVAL;
 
        if (ec->tx_max_coalesced_frames_irq)