fix typos using codespell utility
[dpdk.git] / lib / librte_eal / linuxapp / kni / ethtool / igb / igb_main.c
index 2b150f4..99338c5 100644 (file)
@@ -76,7 +76,7 @@ static const char igb_driver_string[] =
 static const char igb_copyright[] =
                                "Copyright (c) 2007-2013 Intel Corporation.";
 
-DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
+const struct pci_device_id igb_pci_tbl[] = {
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_SGMII) },
        { PCI_VDEVICE(INTEL, E1000_DEV_ID_I354_BACKPLANE_2_5GBPS) },
@@ -195,7 +195,11 @@ static void igb_process_mdd_event(struct igb_adapter *);
 #ifdef IFLA_VF_MAX
 static int igb_ndo_set_vf_mac( struct net_device *netdev, int vf, u8 *mac);
 static int igb_ndo_set_vf_vlan(struct net_device *netdev,
+#ifdef HAVE_VF_VLAN_PROTO
+                               int vf, u16 vlan, u8 qos, __be16 vlan_proto);
+#else
                                int vf, u16 vlan, u8 qos);
+#endif
 #ifdef HAVE_VF_SPOOFCHK_CONFIGURE
 static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
                                bool setting);
@@ -1027,8 +1031,15 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter, bool msix)
                        for (i = 0; i < numvecs; i++)
                                adapter->msix_entries[i].entry = i;
 
+#ifdef HAVE_PCI_ENABLE_MSIX
                        err = pci_enable_msix(pdev,
                                              adapter->msix_entries, numvecs);
+#else
+                       err = pci_enable_msix_range(pdev,
+                                       adapter->msix_entries,
+                                       numvecs,
+                                       numvecs);
+#endif
                        if (err == 0)
                                break;
                }
@@ -1122,7 +1133,7 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter,
        /* initialize pointer to rings */
        ring = q_vector->ring;
 
-       /* intialize ITR */
+       /* initialize ITR */
        if (rxr_count) {
                /* rx or rx/tx vector */
                if (!adapter->rx_itr_setting || adapter->rx_itr_setting > 3)
@@ -1625,7 +1636,7 @@ static void igb_check_swap_media(struct igb_adapter *adapter)
  */
 static int igb_get_i2c_data(void *data)
 {
-       struct igb_adapter *adapter = (struct igb_adapter *)data;
+       struct igb_adapter *adapter = data;
        struct e1000_hw *hw = &adapter->hw;
        s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1640,7 +1651,7 @@ static int igb_get_i2c_data(void *data)
  */
 static void igb_set_i2c_data(void *data, int state)
 {
-       struct igb_adapter *adapter = (struct igb_adapter *)data;
+       struct igb_adapter *adapter = data;
        struct e1000_hw *hw = &adapter->hw;
        s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1665,7 +1676,7 @@ static void igb_set_i2c_data(void *data, int state)
  */
 static void igb_set_i2c_clk(void *data, int state)
 {
-       struct igb_adapter *adapter = (struct igb_adapter *)data;
+       struct igb_adapter *adapter = data;
        struct e1000_hw *hw = &adapter->hw;
        s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1687,7 +1698,7 @@ static void igb_set_i2c_clk(void *data, int state)
  */
 static int igb_get_i2c_clk(void *data)
 {
-       struct igb_adapter *adapter = (struct igb_adapter *)data;
+       struct igb_adapter *adapter = data;
        struct e1000_hw *hw = &adapter->hw;
        s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -6412,7 +6423,11 @@ static void igb_set_vmvir(struct igb_adapter *adapter, u32 vid, u32 vf)
 }
 
 static int igb_ndo_set_vf_vlan(struct net_device *netdev,
+#ifdef HAVE_VF_VLAN_PROTO
+                              int vf, u16 vlan, u8 qos, __be16 vlan_proto)
+#else
                               int vf, u16 vlan, u8 qos)
+#endif
 {
        int err = 0;
        struct igb_adapter *adapter = netdev_priv(netdev);
@@ -6420,6 +6435,12 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev,
        /* VLAN IDs accepted range 0-4094 */
        if ((vf >= adapter->vfs_allocated_count) || (vlan > VLAN_VID_MASK-1) || (qos > 7))
                return -EINVAL;
+
+#ifdef HAVE_VF_VLAN_PROTO
+       if (vlan_proto != htons(ETH_P_8021Q))
+               return -EPROTONOSUPPORT;
+#endif
+
        if (vlan || qos) {
                err = igb_vlvf_set(adapter, vlan, !!vlan, vf);
                if (err)
@@ -6580,7 +6601,12 @@ static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
        if (adapter->vf_data[vf].pf_vlan)
                igb_ndo_set_vf_vlan(adapter->netdev, vf,
                                    adapter->vf_data[vf].pf_vlan,
+#ifdef HAVE_VF_VLAN_PROTO
+                                   adapter->vf_data[vf].pf_qos,
+                                   htons(ETH_P_8021Q));
+#else
                                    adapter->vf_data[vf].pf_qos);
+#endif
        else
                igb_clear_vf_vfta(adapter, vf);
 #endif