Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / chelsio / cxgb / cxgb2.c
index c8fdeaae56c0a70bbb28e147979738f5533e2fdb..9624cfe7df57154a7377f34253e3d42801762d23 100644 (file)
@@ -131,7 +131,7 @@ static void t1_set_rxmode(struct net_device *dev)
 static void link_report(struct port_info *p)
 {
        if (!netif_carrier_ok(p->dev))
-               printk(KERN_INFO "%s: link down\n", p->dev->name);
+               netdev_info(p->dev, "link down\n");
        else {
                const char *s = "10Mbps";
 
@@ -141,9 +141,9 @@ static void link_report(struct port_info *p)
                        case SPEED_100:   s = "100Mbps"; break;
                }
 
-               printk(KERN_INFO "%s: link up, %s, %s-duplex\n",
-                      p->dev->name, s,
-                      p->link_config.duplex == DUPLEX_FULL ? "full" : "half");
+               netdev_info(p->dev, "link up, %s, %s-duplex\n",
+                           s, p->link_config.duplex == DUPLEX_FULL
+                           ? "full" : "half");
        }
 }
 
@@ -856,10 +856,10 @@ static netdev_features_t t1_fix_features(struct net_device *dev,
         * Since there is no support for separate rx/tx vlan accel
         * enable/disable make sure tx flag is always in same state as rx.
         */
-       if (features & NETIF_F_HW_VLAN_RX)
-               features |= NETIF_F_HW_VLAN_TX;
+       if (features & NETIF_F_HW_VLAN_CTAG_RX)
+               features |= NETIF_F_HW_VLAN_CTAG_TX;
        else
-               features &= ~NETIF_F_HW_VLAN_TX;
+               features &= ~NETIF_F_HW_VLAN_CTAG_TX;
 
        return features;
 }
@@ -869,7 +869,7 @@ static int t1_set_features(struct net_device *dev, netdev_features_t features)
        netdev_features_t changed = dev->features ^ features;
        struct adapter *adapter = dev->ml_priv;
 
-       if (changed & NETIF_F_HW_VLAN_RX)
+       if (changed & NETIF_F_HW_VLAN_CTAG_RX)
                t1_vlan_mode(adapter, features);
 
        return 0;
@@ -976,19 +976,13 @@ static const struct net_device_ops cxgb_netdev_ops = {
 
 static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static int version_printed;
-
        int i, err, pci_using_dac = 0;
        unsigned long mmio_start, mmio_len;
        const struct board_info *bi;
        struct adapter *adapter = NULL;
        struct port_info *pi;
 
-       if (!version_printed) {
-               printk(KERN_INFO "%s - version %s\n", DRV_DESCRIPTION,
-                      DRV_VERSION);
-               ++version_printed;
-       }
+       pr_info_once("%s - version %s\n", DRV_DESCRIPTION, DRV_VERSION);
 
        err = pci_enable_device(pdev);
        if (err)
@@ -1091,8 +1085,9 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                        netdev->features |= NETIF_F_HIGHDMA;
                if (vlan_tso_capable(adapter)) {
                        netdev->features |=
-                               NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-                       netdev->hw_features |= NETIF_F_HW_VLAN_RX;
+                               NETIF_F_HW_VLAN_CTAG_TX |
+                               NETIF_F_HW_VLAN_CTAG_RX;
+                       netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
 
                        /* T204: disable TSO */
                        if (!(is_T2(adapter)) || bi->port_number != 4) {
@@ -1124,8 +1119,8 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        for (i = 0; i < bi->port_number; ++i) {
                err = register_netdev(adapter->port[i].dev);
                if (err)
-                       pr_warning("%s: cannot register net device %s, skipping\n",
-                                  pci_name(pdev), adapter->port[i].dev->name);
+                       pr_warn("%s: cannot register net device %s, skipping\n",
+                               pci_name(pdev), adapter->port[i].dev->name);
                else {
                        /*
                         * Change the name we use for messages to the name of
@@ -1143,10 +1138,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto out_release_adapter_res;
        }
 
-       printk(KERN_INFO "%s: %s (rev %d), %s %dMHz/%d-bit\n", adapter->name,
-              bi->desc, adapter->params.chip_revision,
-              adapter->params.pci.is_pcix ? "PCIX" : "PCI",
-              adapter->params.pci.speed, adapter->params.pci.width);
+       pr_info("%s: %s (rev %d), %s %dMHz/%d-bit\n",
+               adapter->name, bi->desc, adapter->params.chip_revision,
+               adapter->params.pci.is_pcix ? "PCIX" : "PCI",
+               adapter->params.pci.speed, adapter->params.pci.width);
 
        /*
         * Set the T1B ASIC and memory clocks.