[netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count
[linux-2.6-block.git] / drivers / net / cxgb3 / cxgb3_main.c
index c00f2df05bccb02b3630805dd4f34f7ecdc51441..e22d06531051b98f6e52597baa7671a2e76f86af 100644 (file)
@@ -733,6 +733,9 @@ static inline char t3rev2char(struct adapter *adapter)
        case T3_REV_B2:
                rev = 'b';
                break;
+       case T3_REV_C:
+               rev = 'c';
+               break;
        }
        return rev;
 }
@@ -797,11 +800,12 @@ static int cxgb_up(struct adapter *adap)
        int must_load;
 
        if (!(adap->flags & FULL_INIT_DONE)) {
-               err = t3_check_fw_version(adap);
-               if (err == -EINVAL)
+               err = t3_check_fw_version(adap, &must_load);
+               if (err == -EINVAL) {
                        err = upgrade_fw(adap);
-               if (err)
-                       goto out;
+                       if (err && must_load)
+                               goto out;
+               }
 
                err = t3_check_tpsram_version(adap, &must_load);
                if (err == -EINVAL) {
@@ -1127,9 +1131,14 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
 
 };
 
-static int get_stats_count(struct net_device *dev)
+static int get_sset_count(struct net_device *dev, int sset)
 {
-       return ARRAY_SIZE(stats_strings);
+       switch (sset) {
+       case ETH_SS_STATS:
+               return ARRAY_SIZE(stats_strings);
+       default:
+               return -EOPNOTSUPP;
+       }
 }
 
 #define T3_REGMAP_SIZE (3 * 1024)
@@ -1630,20 +1639,17 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
        .set_pauseparam = set_pauseparam,
        .get_rx_csum = get_rx_csum,
        .set_rx_csum = set_rx_csum,
-       .get_tx_csum = ethtool_op_get_tx_csum,
        .set_tx_csum = ethtool_op_set_tx_csum,
-       .get_sg = ethtool_op_get_sg,
        .set_sg = ethtool_op_set_sg,
        .get_link = ethtool_op_get_link,
        .get_strings = get_strings,
        .phys_id = cxgb3_phys_id,
        .nway_reset = restart_autoneg,
-       .get_stats_count = get_stats_count,
+       .get_sset_count = get_sset_count,
        .get_ethtool_stats = get_stats,
        .get_regs_len = get_regs_len,
        .get_regs = get_regs,
        .get_wol = get_wol,
-       .get_tso = ethtool_op_get_tso,
        .set_tso = ethtool_op_set_tso,
 };
 
@@ -2360,10 +2366,12 @@ static void __devinit print_port_info(struct adapter *adap,
                       (adap->flags & USING_MSIX) ? " MSI-X" :
                       (adap->flags & USING_MSI) ? " MSI" : "");
                if (adap->name == dev->name && adap->params.vpd.mclk)
-                       printk(KERN_INFO "%s: %uMB CM, %uMB PMTX, %uMB PMRX\n",
+                       printk(KERN_INFO
+                              "%s: %uMB CM, %uMB PMTX, %uMB PMRX, S/N: %s\n",
                               adap->name, t3_mc7_size(&adap->cm) >> 20,
                               t3_mc7_size(&adap->pmtx) >> 20,
-                              t3_mc7_size(&adap->pmrx) >> 20);
+                              t3_mc7_size(&adap->pmrx) >> 20,
+                              adap->params.vpd.sn);
        }
 }
 
@@ -2459,7 +2467,6 @@ static int __devinit init_one(struct pci_dev *pdev,
                        goto out_free_dev;
                }
 
-               SET_MODULE_OWNER(netdev);
                SET_NETDEV_DEV(netdev, &pdev->dev);
 
                adapter->port[i] = netdev;