Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
[pandora-kernel.git] / drivers / net / ucc_geth_ethtool.c
index a8994c7..f5839c4 100644 (file)
@@ -73,6 +73,7 @@ static char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
        "tx-frames-ok",
        "tx-excessive-differ-frames",
        "tx-256-511-frames",
+       "tx-512-1023-frames",
        "tx-1024-1518-frames",
        "tx-jumbo-frames",
 };
@@ -108,12 +109,6 @@ static char rx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
 #define UEC_TX_FW_STATS_LEN ARRAY_SIZE(tx_fw_stat_gstrings)
 #define UEC_RX_FW_STATS_LEN ARRAY_SIZE(rx_fw_stat_gstrings)
 
-extern int init_flow_control_params(u32 automatic_flow_control_mode,
-               int rx_flow_control_enable,
-               int tx_flow_control_enable, u16 pause_period,
-               u16 extension_field, volatile u32 *upsmr_register,
-               volatile u32 *uempr_register, volatile u32 *maccfg1_register);
-
 static int
 uec_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 {
@@ -276,20 +271,26 @@ uec_set_ringparam(struct net_device *netdev,
        return ret;
 }
 
-static int uec_get_stats_count(struct net_device *netdev)
+static int uec_get_sset_count(struct net_device *netdev, int sset)
 {
        struct ucc_geth_private *ugeth = netdev_priv(netdev);
        u32 stats_mode = ugeth->ug_info->statisticsMode;
        int len = 0;
 
-       if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE)
-               len += UEC_HW_STATS_LEN;
-       if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX)
-               len += UEC_TX_FW_STATS_LEN;
-       if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
-               len += UEC_RX_FW_STATS_LEN;
+       switch (sset) {
+       case ETH_SS_STATS:
+               if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_HARDWARE)
+                       len += UEC_HW_STATS_LEN;
+               if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_TX)
+                       len += UEC_TX_FW_STATS_LEN;
+               if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
+                       len += UEC_RX_FW_STATS_LEN;
 
-       return len;
+               return len;
+
+       default:
+               return -EOPNOTSUPP;
+       }
 }
 
 static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
@@ -308,7 +309,7 @@ static void uec_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
                buf += UEC_TX_FW_STATS_LEN * ETH_GSTRING_LEN;
        }
        if (stats_mode & UCC_GETH_STATISTICS_GATHERING_MODE_FIRMWARE_RX)
-               memcpy(buf, tx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN *
+               memcpy(buf, rx_fw_stat_gstrings, UEC_RX_FW_STATS_LEN *
                                ETH_GSTRING_LEN);
 }
 
@@ -353,8 +354,6 @@ uec_get_drvinfo(struct net_device *netdev,
        strncpy(drvinfo->version, DRV_VERSION, 32);
        strncpy(drvinfo->fw_version, "N/A", 32);
        strncpy(drvinfo->bus_info, "QUICC ENGINE", 32);
-       drvinfo->n_stats = uec_get_stats_count(netdev);
-       drvinfo->testinfo_len = 0;
        drvinfo->eedump_len = 0;
        drvinfo->regdump_len = uec_get_regs_len(netdev);
 }
@@ -373,13 +372,10 @@ static const struct ethtool_ops uec_ethtool_ops = {
        .set_ringparam          = uec_set_ringparam,
        .get_pauseparam         = uec_get_pauseparam,
        .set_pauseparam         = uec_set_pauseparam,
-       .get_sg                 = ethtool_op_get_sg,
        .set_sg                 = ethtool_op_set_sg,
-       .get_tso                = ethtool_op_get_tso,
-       .get_stats_count        = uec_get_stats_count,
+       .get_sset_count         = uec_get_sset_count,
        .get_strings            = uec_get_strings,
        .get_ethtool_stats      = uec_get_ethtool_stats,
-       .get_perm_addr          = ethtool_op_get_perm_addr,
 };
 
 void uec_set_ethtool_ops(struct net_device *netdev)