]> err.no Git - linux-2.6/blobdiff - drivers/net/cxgb3/cxgb3_main.c
cxgb3 - Use wild card for PCI subdevice ID match
[linux-2.6] / drivers / net / cxgb3 / cxgb3_main.c
index a6723ae79bdd35ad303c3971ab91bb4968f61727..d92da8fe4a506e7013e577b520dfc638856fcbdd 100644 (file)
@@ -76,20 +76,20 @@ enum {
 
 #define EEPROM_MAGIC 0x38E2F10C
 
-#define CH_DEVICE(devid, ssid, idx) \
-       { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, ssid, 0, 0, idx }
+#define CH_DEVICE(devid, idx) \
+       { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, PCI_ANY_ID, 0, 0, idx }
 
 static const struct pci_device_id cxgb3_pci_tbl[] = {
-       CH_DEVICE(0x20, 1, 0),  /* PE9000 */
-       CH_DEVICE(0x21, 1, 1),  /* T302E */
-       CH_DEVICE(0x22, 1, 2),  /* T310E */
-       CH_DEVICE(0x23, 1, 3),  /* T320X */
-       CH_DEVICE(0x24, 1, 1),  /* T302X */
-       CH_DEVICE(0x25, 1, 3),  /* T320E */
-       CH_DEVICE(0x26, 1, 2),  /* T310X */
-       CH_DEVICE(0x30, 1, 2),  /* T3B10 */
-       CH_DEVICE(0x31, 1, 3),  /* T3B20 */
-       CH_DEVICE(0x32, 1, 1),  /* T3B02 */
+       CH_DEVICE(0x20, 0),     /* PE9000 */
+       CH_DEVICE(0x21, 1),     /* T302E */
+       CH_DEVICE(0x22, 2),     /* T310E */
+       CH_DEVICE(0x23, 3),     /* T320X */
+       CH_DEVICE(0x24, 1),     /* T302X */
+       CH_DEVICE(0x25, 3),     /* T320E */
+       CH_DEVICE(0x26, 2),     /* T310X */
+       CH_DEVICE(0x30, 2),     /* T3B10 */
+       CH_DEVICE(0x31, 3),     /* T3B20 */
+       CH_DEVICE(0x32, 1),     /* T3B02 */
        {0,}
 };
 
@@ -740,7 +740,7 @@ static inline char t3rev2char(struct adapter *adapter)
        return rev;
 }
 
-int update_tpsram(struct adapter *adap)
+static int update_tpsram(struct adapter *adap)
 {
        const struct firmware *tpsram;
        char buf[64];
@@ -839,7 +839,8 @@ static int cxgb_up(struct adapter *adap)
                if (err)
                        goto irq_err;
 
-               if (request_msix_data_irqs(adap)) {
+               err = request_msix_data_irqs(adap);
+               if (err) {
                        free_irq(adap->msix_info[0].vec, adap);
                        goto irq_err;
                }
@@ -1131,9 +1132,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)
@@ -1634,20 +1640,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,
 };
 
@@ -1767,7 +1770,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
        }
        case CHELSIO_SET_QSET_NUM:{
                struct ch_reg edata;
-               struct port_info *pi = netdev_priv(dev);
                unsigned int i, first_qset = 0, other_qsets = 0;
 
                if (!capable(CAP_NET_ADMIN))
@@ -1799,7 +1801,6 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
        }
        case CHELSIO_GET_QSET_NUM:{
                struct ch_reg edata;
-               struct port_info *pi = netdev_priv(dev);
 
                edata.cmd = CHELSIO_GET_QSET_NUM;
                edata.val = pi->nqsets;
@@ -2465,7 +2466,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;