net: Update API for VF vlan protocol 802.1ad support
[cascardo/linux.git] / drivers / net / ethernet / emulex / benet / be_main.c
index a1c9920..ac513e6 100644 (file)
@@ -316,7 +316,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
        /* Proceed further only if, User provided MAC is different
         * from active MAC
         */
-       if (ether_addr_equal(addr->sa_data, netdev->dev_addr))
+       if (ether_addr_equal(addr->sa_data, adapter->dev_mac))
                return 0;
 
        /* if device is not running, copy MAC to netdev->dev_addr */
@@ -357,6 +357,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
                goto err;
        }
 done:
+       ether_addr_copy(adapter->dev_mac, addr->sa_data);
        ether_addr_copy(netdev->dev_addr, addr->sa_data);
        dev_info(dev, "MAC address changed to %pM\n", addr->sa_data);
        return 0;
@@ -1662,7 +1663,7 @@ static void be_clear_mc_list(struct be_adapter *adapter)
 static int be_uc_mac_add(struct be_adapter *adapter, int uc_idx)
 {
        if (ether_addr_equal((u8 *)&adapter->uc_list[uc_idx * ETH_ALEN],
-                            adapter->netdev->dev_addr)) {
+                            adapter->dev_mac)) {
                adapter->pmac_id[uc_idx + 1] = adapter->pmac_id[0];
                return 0;
        }
@@ -1894,7 +1895,8 @@ static int be_clear_vf_tvt(struct be_adapter *adapter, int vf)
        return 0;
 }
 
-static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
+static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
+                         __be16 vlan_proto)
 {
        struct be_adapter *adapter = netdev_priv(netdev);
        struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf];
@@ -1906,6 +1908,9 @@ static int be_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos)
        if (vf >= adapter->num_vfs || vlan > 4095 || qos > 7)
                return -EINVAL;
 
+       if (vlan_proto != htons(ETH_P_8021Q))
+               return -EPROTONOSUPPORT;
+
        if (vlan || qos) {
                vlan |= qos << VLAN_PRIO_SHIFT;
                status = be_set_vf_tvt(adapter, vf, vlan);
@@ -3774,6 +3779,7 @@ static int be_enable_if_filters(struct be_adapter *adapter)
                status = be_dev_mac_add(adapter, adapter->netdev->dev_addr);
                if (status)
                        return status;
+               ether_addr_copy(adapter->dev_mac, adapter->netdev->dev_addr);
        }
 
        if (adapter->vlans_added)
@@ -4363,7 +4369,7 @@ static void be_setup_init(struct be_adapter *adapter)
  * for distribution between the VFs. This self-imposed limit will determine the
  * no: of VFs for which RSS can be enabled.
  */
-void be_calculate_pf_pool_rss_tables(struct be_adapter *adapter)
+static void be_calculate_pf_pool_rss_tables(struct be_adapter *adapter)
 {
        struct be_port_resources port_res = {0};
        u8 rss_tables_on_port;