aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2013-04-18 22:04:28 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-19 14:45:27 -0400
commit80d5c3689b886308247da295a228a54df49a44f6 (patch)
treece7b1e6898c3f9fea945e67fd06b125dfcc61fe7
parentf646968f8f7c624587de729115d802372b9063dd (diff)
net: vlan: prepare for 802.1ad VLAN filtering offload
Change the rx_{add,kill}_vid callbacks to take a protocol argument in preparation of 802.1ad support. The protocol argument used so far is always htons(ETH_P_8021Q). Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_main.c17
-rw-r--r--drivers/net/ethernet/adaptec/starfire.c6
-rw-r--r--drivers/net/ethernet/brocade/bna/bnad.c6
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_dev.c4
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_dev.h4
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c4
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c4
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c22
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c20
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c12
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c8
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c12
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c6
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c8
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c8
-rw-r--r--drivers/net/ethernet/qlogic/qlge/qlge_main.c4
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c6
-rw-r--r--drivers/net/ethernet/tehuti/tehuti.c4
-rw-r--r--drivers/net/ethernet/ti/cpsw.c4
-rw-r--r--drivers/net/ethernet/via/via-rhine.c10
-rw-r--r--drivers/net/ethernet/via/via-velocity.c6
-rw-r--r--drivers/net/macvlan.c8
-rw-r--r--drivers/net/team/team.c10
-rw-r--r--drivers/net/virtio_net.c6
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c4
-rw-r--r--drivers/s390/net/qeth_l2_main.c6
-rw-r--r--drivers/s390/net/qeth_l3_main.c6
-rw-r--r--include/linux/if_vlan.h4
-rw-r--r--include/linux/netdevice.h16
-rw-r--r--net/8021q/vlan.c10
-rw-r--r--net/8021q/vlan_core.c47
-rw-r--r--net/bridge/br_vlan.c10
34 files changed, 184 insertions, 137 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8d324f8a1757..35e89e12a1f7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -428,14 +428,15 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
428 * @bond_dev: bonding net device that got called 428 * @bond_dev: bonding net device that got called
429 * @vid: vlan id being added 429 * @vid: vlan id being added
430 */ 430 */
431static int bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) 431static int bond_vlan_rx_add_vid(struct net_device *bond_dev,
432 __be16 proto, u16 vid)
432{ 433{
433 struct bonding *bond = netdev_priv(bond_dev); 434 struct bonding *bond = netdev_priv(bond_dev);
434 struct slave *slave, *stop_at; 435 struct slave *slave, *stop_at;
435 int i, res; 436 int i, res;
436 437
437 bond_for_each_slave(bond, slave, i) { 438 bond_for_each_slave(bond, slave, i) {
438 res = vlan_vid_add(slave->dev, vid); 439 res = vlan_vid_add(slave->dev, proto, vid);
439 if (res) 440 if (res)
440 goto unwind; 441 goto unwind;
441 } 442 }
@@ -453,7 +454,7 @@ unwind:
453 /* unwind from head to the slave that failed */ 454 /* unwind from head to the slave that failed */
454 stop_at = slave; 455 stop_at = slave;
455 bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at) 456 bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at)
456 vlan_vid_del(slave->dev, vid); 457 vlan_vid_del(slave->dev, proto, vid);
457 458
458 return res; 459 return res;
459} 460}
@@ -463,14 +464,15 @@ unwind:
463 * @bond_dev: bonding net device that got called 464 * @bond_dev: bonding net device that got called
464 * @vid: vlan id being removed 465 * @vid: vlan id being removed
465 */ 466 */
466static int bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) 467static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
468 __be16 proto, u16 vid)
467{ 469{
468 struct bonding *bond = netdev_priv(bond_dev); 470 struct bonding *bond = netdev_priv(bond_dev);
469 struct slave *slave; 471 struct slave *slave;
470 int i, res; 472 int i, res;
471 473
472 bond_for_each_slave(bond, slave, i) 474 bond_for_each_slave(bond, slave, i)
473 vlan_vid_del(slave->dev, vid); 475 vlan_vid_del(slave->dev, proto, vid);
474 476
475 res = bond_del_vlan(bond, vid); 477 res = bond_del_vlan(bond, vid);
476 if (res) { 478 if (res) {
@@ -488,7 +490,8 @@ static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *sla
488 int res; 490 int res;
489 491
490 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { 492 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
491 res = vlan_vid_add(slave_dev, vlan->vlan_id); 493 res = vlan_vid_add(slave_dev, htons(ETH_P_8021Q),
494 vlan->vlan_id);
492 if (res) 495 if (res)
493 pr_warning("%s: Failed to add vlan id %d to device %s\n", 496 pr_warning("%s: Failed to add vlan id %d to device %s\n",
494 bond->dev->name, vlan->vlan_id, 497 bond->dev->name, vlan->vlan_id,
@@ -504,7 +507,7 @@ static void bond_del_vlans_from_slave(struct bonding *bond,
504 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { 507 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
505 if (!vlan->vlan_id) 508 if (!vlan->vlan_id)
506 continue; 509 continue;
507 vlan_vid_del(slave_dev, vlan->vlan_id); 510 vlan_vid_del(slave_dev, htons(ETH_P_8021Q), vlan->vlan_id);
508 } 511 }
509} 512}
510 513
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 365865130f7c..cdbc5443ae3b 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -594,7 +594,8 @@ static const struct ethtool_ops ethtool_ops;
594 594
595 595
596#ifdef VLAN_SUPPORT 596#ifdef VLAN_SUPPORT
597static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 597static int netdev_vlan_rx_add_vid(struct net_device *dev,
598 __be16 proto, u16 vid)
598{ 599{
599 struct netdev_private *np = netdev_priv(dev); 600 struct netdev_private *np = netdev_priv(dev);
600 601
@@ -608,7 +609,8 @@ static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
608 return 0; 609 return 0;
609} 610}
610 611
611static int netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 612static int netdev_vlan_rx_kill_vid(struct net_device *dev,
613 __be16 proto, u16 vid)
612{ 614{
613 struct netdev_private *np = netdev_priv(dev); 615 struct netdev_private *np = netdev_priv(dev);
614 616
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 1d9d0371a743..c0bc44e51fa9 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -3068,8 +3068,7 @@ bnad_change_mtu(struct net_device *netdev, int new_mtu)
3068} 3068}
3069 3069
3070static int 3070static int
3071bnad_vlan_rx_add_vid(struct net_device *netdev, 3071bnad_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
3072 unsigned short vid)
3073{ 3072{
3074 struct bnad *bnad = netdev_priv(netdev); 3073 struct bnad *bnad = netdev_priv(netdev);
3075 unsigned long flags; 3074 unsigned long flags;
@@ -3090,8 +3089,7 @@ bnad_vlan_rx_add_vid(struct net_device *netdev,
3090} 3089}
3091 3090
3092static int 3091static int
3093bnad_vlan_rx_kill_vid(struct net_device *netdev, 3092bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
3094 unsigned short vid)
3095{ 3093{
3096 struct bnad *bnad = netdev_priv(netdev); 3094 struct bnad *bnad = netdev_priv(netdev);
3097 unsigned long flags; 3095 unsigned long flags;
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.c b/drivers/net/ethernet/cisco/enic/enic_dev.c
index bf0fc56dba19..4b6e5695b263 100644
--- a/drivers/net/ethernet/cisco/enic/enic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/enic_dev.c
@@ -212,7 +212,7 @@ int enic_dev_deinit_done(struct enic *enic, int *status)
212} 212}
213 213
214/* rtnl lock is held */ 214/* rtnl lock is held */
215int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 215int enic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
216{ 216{
217 struct enic *enic = netdev_priv(netdev); 217 struct enic *enic = netdev_priv(netdev);
218 int err; 218 int err;
@@ -225,7 +225,7 @@ int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
225} 225}
226 226
227/* rtnl lock is held */ 227/* rtnl lock is held */
228int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 228int enic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
229{ 229{
230 struct enic *enic = netdev_priv(netdev); 230 struct enic *enic = netdev_priv(netdev);
231 int err; 231 int err;
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.h b/drivers/net/ethernet/cisco/enic/enic_dev.h
index da1cba3c410e..08bded051b93 100644
--- a/drivers/net/ethernet/cisco/enic/enic_dev.h
+++ b/drivers/net/ethernet/cisco/enic/enic_dev.h
@@ -46,8 +46,8 @@ int enic_dev_packet_filter(struct enic *enic, int directed, int multicast,
46 int broadcast, int promisc, int allmulti); 46 int broadcast, int promisc, int allmulti);
47int enic_dev_add_addr(struct enic *enic, u8 *addr); 47int enic_dev_add_addr(struct enic *enic, u8 *addr);
48int enic_dev_del_addr(struct enic *enic, u8 *addr); 48int enic_dev_del_addr(struct enic *enic, u8 *addr);
49int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid); 49int enic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid);
50int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); 50int enic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid);
51int enic_dev_notify_unset(struct enic *enic); 51int enic_dev_notify_unset(struct enic *enic);
52int enic_dev_hang_notify(struct enic *enic); 52int enic_dev_hang_notify(struct enic *enic);
53int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic); 53int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index bde26d4d52ec..b41333184916 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -902,7 +902,7 @@ set_vlan_promisc:
902 return status; 902 return status;
903} 903}
904 904
905static int be_vlan_add_vid(struct net_device *netdev, u16 vid) 905static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
906{ 906{
907 struct be_adapter *adapter = netdev_priv(netdev); 907 struct be_adapter *adapter = netdev_priv(netdev);
908 int status = 0; 908 int status = 0;
@@ -928,7 +928,7 @@ ret:
928 return status; 928 return status;
929} 929}
930 930
931static int be_vlan_rem_vid(struct net_device *netdev, u16 vid) 931static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
932{ 932{
933 struct be_adapter *adapter = netdev_priv(netdev); 933 struct be_adapter *adapter = netdev_priv(netdev);
934 int status = 0; 934 int status = 0;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 9c9fa745ff82..d1812aacbc7b 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -2110,7 +2110,7 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
2110 return NETDEV_TX_OK; 2110 return NETDEV_TX_OK;
2111} 2111}
2112 2112
2113static int ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 2113static int ehea_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
2114{ 2114{
2115 struct ehea_port *port = netdev_priv(dev); 2115 struct ehea_port *port = netdev_priv(dev);
2116 struct ehea_adapter *adapter = port->adapter; 2116 struct ehea_adapter *adapter = port->adapter;
@@ -2148,7 +2148,7 @@ out:
2148 return err; 2148 return err;
2149} 2149}
2150 2150
2151static int ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 2151static int ehea_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
2152{ 2152{
2153 struct ehea_port *port = netdev_priv(dev); 2153 struct ehea_port *port = netdev_priv(dev);
2154 struct ehea_adapter *adapter = port->adapter; 2154 struct ehea_adapter *adapter = port->adapter;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 8d0d0d420c21..8239dafdd8e7 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -166,8 +166,10 @@ static void e1000_vlan_mode(struct net_device *netdev,
166 netdev_features_t features); 166 netdev_features_t features);
167static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter, 167static void e1000_vlan_filter_on_off(struct e1000_adapter *adapter,
168 bool filter_on); 168 bool filter_on);
169static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); 169static int e1000_vlan_rx_add_vid(struct net_device *netdev,
170static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); 170 __be16 proto, u16 vid);
171static int e1000_vlan_rx_kill_vid(struct net_device *netdev,
172 __be16 proto, u16 vid);
171static void e1000_restore_vlan(struct e1000_adapter *adapter); 173static void e1000_restore_vlan(struct e1000_adapter *adapter);
172 174
173#ifdef CONFIG_PM 175#ifdef CONFIG_PM
@@ -333,7 +335,7 @@ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
333 if (!test_bit(vid, adapter->active_vlans)) { 335 if (!test_bit(vid, adapter->active_vlans)) {
334 if (hw->mng_cookie.status & 336 if (hw->mng_cookie.status &
335 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) { 337 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) {
336 e1000_vlan_rx_add_vid(netdev, vid); 338 e1000_vlan_rx_add_vid(netdev, htons(ETH_P_8021Q), vid);
337 adapter->mng_vlan_id = vid; 339 adapter->mng_vlan_id = vid;
338 } else { 340 } else {
339 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; 341 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
@@ -341,7 +343,8 @@ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
341 if ((old_vid != (u16)E1000_MNG_VLAN_NONE) && 343 if ((old_vid != (u16)E1000_MNG_VLAN_NONE) &&
342 (vid != old_vid) && 344 (vid != old_vid) &&
343 !test_bit(old_vid, adapter->active_vlans)) 345 !test_bit(old_vid, adapter->active_vlans))
344 e1000_vlan_rx_kill_vid(netdev, old_vid); 346 e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q),
347 old_vid);
345 } else { 348 } else {
346 adapter->mng_vlan_id = vid; 349 adapter->mng_vlan_id = vid;
347 } 350 }
@@ -1457,7 +1460,8 @@ static int e1000_close(struct net_device *netdev)
1457 if ((hw->mng_cookie.status & 1460 if ((hw->mng_cookie.status &
1458 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && 1461 E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) &&
1459 !test_bit(adapter->mng_vlan_id, adapter->active_vlans)) { 1462 !test_bit(adapter->mng_vlan_id, adapter->active_vlans)) {
1460 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); 1463 e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q),
1464 adapter->mng_vlan_id);
1461 } 1465 }
1462 1466
1463 return 0; 1467 return 0;
@@ -4837,7 +4841,8 @@ static void e1000_vlan_mode(struct net_device *netdev,
4837 e1000_irq_enable(adapter); 4841 e1000_irq_enable(adapter);
4838} 4842}
4839 4843
4840static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 4844static int e1000_vlan_rx_add_vid(struct net_device *netdev,
4845 __be16 proto, u16 vid)
4841{ 4846{
4842 struct e1000_adapter *adapter = netdev_priv(netdev); 4847 struct e1000_adapter *adapter = netdev_priv(netdev);
4843 struct e1000_hw *hw = &adapter->hw; 4848 struct e1000_hw *hw = &adapter->hw;
@@ -4862,7 +4867,8 @@ static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
4862 return 0; 4867 return 0;
4863} 4868}
4864 4869
4865static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 4870static int e1000_vlan_rx_kill_vid(struct net_device *netdev,
4871 __be16 proto, u16 vid)
4866{ 4872{
4867 struct e1000_adapter *adapter = netdev_priv(netdev); 4873 struct e1000_adapter *adapter = netdev_priv(netdev);
4868 struct e1000_hw *hw = &adapter->hw; 4874 struct e1000_hw *hw = &adapter->hw;
@@ -4896,7 +4902,7 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter)
4896 4902
4897 e1000_vlan_filter_on_off(adapter, true); 4903 e1000_vlan_filter_on_off(adapter, true);
4898 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 4904 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
4899 e1000_vlan_rx_add_vid(adapter->netdev, vid); 4905 e1000_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
4900} 4906}
4901 4907
4902int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx) 4908int e1000_set_spd_dplx(struct e1000_adapter *adapter, u32 spd, u8 dplx)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index a2e7db33bf9d..8c17f01a155f 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2672,7 +2672,8 @@ static int e1000e_poll(struct napi_struct *napi, int weight)
2672 return work_done; 2672 return work_done;
2673} 2673}
2674 2674
2675static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 2675static int e1000_vlan_rx_add_vid(struct net_device *netdev,
2676 __be16 proto, u16 vid)
2676{ 2677{
2677 struct e1000_adapter *adapter = netdev_priv(netdev); 2678 struct e1000_adapter *adapter = netdev_priv(netdev);
2678 struct e1000_hw *hw = &adapter->hw; 2679 struct e1000_hw *hw = &adapter->hw;
@@ -2697,7 +2698,8 @@ static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
2697 return 0; 2698 return 0;
2698} 2699}
2699 2700
2700static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 2701static int e1000_vlan_rx_kill_vid(struct net_device *netdev,
2702 __be16 proto, u16 vid)
2701{ 2703{
2702 struct e1000_adapter *adapter = netdev_priv(netdev); 2704 struct e1000_adapter *adapter = netdev_priv(netdev);
2703 struct e1000_hw *hw = &adapter->hw; 2705 struct e1000_hw *hw = &adapter->hw;
@@ -2741,7 +2743,8 @@ static void e1000e_vlan_filter_disable(struct e1000_adapter *adapter)
2741 ew32(RCTL, rctl); 2743 ew32(RCTL, rctl);
2742 2744
2743 if (adapter->mng_vlan_id != (u16)E1000_MNG_VLAN_NONE) { 2745 if (adapter->mng_vlan_id != (u16)E1000_MNG_VLAN_NONE) {
2744 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); 2746 e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q),
2747 adapter->mng_vlan_id);
2745 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE; 2748 adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
2746 } 2749 }
2747 } 2750 }
@@ -2802,22 +2805,22 @@ static void e1000_update_mng_vlan(struct e1000_adapter *adapter)
2802 u16 old_vid = adapter->mng_vlan_id; 2805 u16 old_vid = adapter->mng_vlan_id;
2803 2806
2804 if (adapter->hw.mng_cookie.status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN) { 2807 if (adapter->hw.mng_cookie.status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN) {
2805 e1000_vlan_rx_add_vid(netdev, vid); 2808 e1000_vlan_rx_add_vid(netdev, htons(ETH_P_8021Q), vid);
2806 adapter->mng_vlan_id = vid; 2809 adapter->mng_vlan_id = vid;
2807 } 2810 }
2808 2811
2809 if ((old_vid != (u16)E1000_MNG_VLAN_NONE) && (vid != old_vid)) 2812 if ((old_vid != (u16)E1000_MNG_VLAN_NONE) && (vid != old_vid))
2810 e1000_vlan_rx_kill_vid(netdev, old_vid); 2813 e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q), old_vid);
2811} 2814}
2812 2815
2813static void e1000_restore_vlan(struct e1000_adapter *adapter) 2816static void e1000_restore_vlan(struct e1000_adapter *adapter)
2814{ 2817{
2815 u16 vid; 2818 u16 vid;
2816 2819
2817 e1000_vlan_rx_add_vid(adapter->netdev, 0); 2820 e1000_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
2818 2821
2819 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 2822 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
2820 e1000_vlan_rx_add_vid(adapter->netdev, vid); 2823 e1000_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
2821} 2824}
2822 2825
2823static void e1000_init_manageability_pt(struct e1000_adapter *adapter) 2826static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
@@ -4384,7 +4387,8 @@ static int e1000_close(struct net_device *netdev)
4384 * the same ID is registered on the host OS (let 8021q kill it) 4387 * the same ID is registered on the host OS (let 8021q kill it)
4385 */ 4388 */
4386 if (adapter->hw.mng_cookie.status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN) 4389 if (adapter->hw.mng_cookie.status & E1000_MNG_DHCP_COOKIE_STATUS_VLAN)
4387 e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); 4390 e1000_vlan_rx_kill_vid(netdev, htons(ETH_P_8021Q),
4391 adapter->mng_vlan_id);
4388 4392
4389 /* If AMT is enabled, let the firmware know that the network 4393 /* If AMT is enabled, let the firmware know that the network
4390 * interface is now closed 4394 * interface is now closed
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b0b1777c0af6..d13ea71c7c1f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -159,8 +159,8 @@ static int igb_ioctl(struct net_device *, struct ifreq *, int cmd);
159static void igb_tx_timeout(struct net_device *); 159static void igb_tx_timeout(struct net_device *);
160static void igb_reset_task(struct work_struct *); 160static void igb_reset_task(struct work_struct *);
161static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features); 161static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features);
162static int igb_vlan_rx_add_vid(struct net_device *, u16); 162static int igb_vlan_rx_add_vid(struct net_device *, __be16, u16);
163static int igb_vlan_rx_kill_vid(struct net_device *, u16); 163static int igb_vlan_rx_kill_vid(struct net_device *, __be16, u16);
164static void igb_restore_vlan(struct igb_adapter *); 164static void igb_restore_vlan(struct igb_adapter *);
165static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8); 165static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8);
166static void igb_ping_all_vfs(struct igb_adapter *); 166static void igb_ping_all_vfs(struct igb_adapter *);
@@ -6976,7 +6976,8 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features)
6976 igb_rlpml_set(adapter); 6976 igb_rlpml_set(adapter);
6977} 6977}
6978 6978
6979static int igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 6979static int igb_vlan_rx_add_vid(struct net_device *netdev,
6980 __be16 proto, u16 vid)
6980{ 6981{
6981 struct igb_adapter *adapter = netdev_priv(netdev); 6982 struct igb_adapter *adapter = netdev_priv(netdev);
6982 struct e1000_hw *hw = &adapter->hw; 6983 struct e1000_hw *hw = &adapter->hw;
@@ -6993,7 +6994,8 @@ static int igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
6993 return 0; 6994 return 0;
6994} 6995}
6995 6996
6996static int igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 6997static int igb_vlan_rx_kill_vid(struct net_device *netdev,
6998 __be16 proto, u16 vid)
6997{ 6999{
6998 struct igb_adapter *adapter = netdev_priv(netdev); 7000 struct igb_adapter *adapter = netdev_priv(netdev);
6999 struct e1000_hw *hw = &adapter->hw; 7001 struct e1000_hw *hw = &adapter->hw;
@@ -7019,7 +7021,7 @@ static void igb_restore_vlan(struct igb_adapter *adapter)
7019 igb_vlan_mode(adapter->netdev, adapter->netdev->features); 7021 igb_vlan_mode(adapter->netdev, adapter->netdev->features);
7020 7022
7021 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 7023 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
7022 igb_vlan_rx_add_vid(adapter->netdev, vid); 7024 igb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
7023} 7025}
7024 7026
7025int igb_set_spd_dplx(struct igb_adapter *adapter, u32 spd, u8 dplx) 7027int igb_set_spd_dplx(struct igb_adapter *adapter, u32 spd, u8 dplx)
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 33e7b3069fb6..3854fd698b85 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1230,7 +1230,8 @@ static void igbvf_set_rlpml(struct igbvf_adapter *adapter)
1230 e1000_rlpml_set_vf(hw, max_frame_size); 1230 e1000_rlpml_set_vf(hw, max_frame_size);
1231} 1231}
1232 1232
1233static int igbvf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 1233static int igbvf_vlan_rx_add_vid(struct net_device *netdev,
1234 __be16 proto, u16 vid)
1234{ 1235{
1235 struct igbvf_adapter *adapter = netdev_priv(netdev); 1236 struct igbvf_adapter *adapter = netdev_priv(netdev);
1236 struct e1000_hw *hw = &adapter->hw; 1237 struct e1000_hw *hw = &adapter->hw;
@@ -1243,7 +1244,8 @@ static int igbvf_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
1243 return 0; 1244 return 0;
1244} 1245}
1245 1246
1246static int igbvf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 1247static int igbvf_vlan_rx_kill_vid(struct net_device *netdev,
1248 __be16 proto, u16 vid)
1247{ 1249{
1248 struct igbvf_adapter *adapter = netdev_priv(netdev); 1250 struct igbvf_adapter *adapter = netdev_priv(netdev);
1249 struct e1000_hw *hw = &adapter->hw; 1251 struct e1000_hw *hw = &adapter->hw;
@@ -1262,7 +1264,7 @@ static void igbvf_restore_vlan(struct igbvf_adapter *adapter)
1262 u16 vid; 1264 u16 vid;
1263 1265
1264 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 1266 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
1265 igbvf_vlan_rx_add_vid(adapter->netdev, vid); 1267 igbvf_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
1266} 1268}
1267 1269
1268/** 1270/**
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index e65d9e910227..a32f274acd36 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -101,8 +101,10 @@ static void ixgb_tx_timeout_task(struct work_struct *work);
101 101
102static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter); 102static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter);
103static void ixgb_vlan_strip_disable(struct ixgb_adapter *adapter); 103static void ixgb_vlan_strip_disable(struct ixgb_adapter *adapter);
104static int ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid); 104static int ixgb_vlan_rx_add_vid(struct net_device *netdev,
105static int ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); 105 __be16 proto, u16 vid);
106static int ixgb_vlan_rx_kill_vid(struct net_device *netdev,
107 __be16 proto, u16 vid);
106static void ixgb_restore_vlan(struct ixgb_adapter *adapter); 108static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
107 109
108#ifdef CONFIG_NET_POLL_CONTROLLER 110#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2209,7 +2211,7 @@ ixgb_vlan_strip_disable(struct ixgb_adapter *adapter)
2209} 2211}
2210 2212
2211static int 2213static int
2212ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 2214ixgb_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
2213{ 2215{
2214 struct ixgb_adapter *adapter = netdev_priv(netdev); 2216 struct ixgb_adapter *adapter = netdev_priv(netdev);
2215 u32 vfta, index; 2217 u32 vfta, index;
@@ -2226,7 +2228,7 @@ ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
2226} 2228}
2227 2229
2228static int 2230static int
2229ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 2231ixgb_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
2230{ 2232{
2231 struct ixgb_adapter *adapter = netdev_priv(netdev); 2233 struct ixgb_adapter *adapter = netdev_priv(netdev);
2232 u32 vfta, index; 2234 u32 vfta, index;
@@ -2248,7 +2250,7 @@ ixgb_restore_vlan(struct ixgb_adapter *adapter)
2248 u16 vid; 2250 u16 vid;
2249 2251
2250 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 2252 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
2251 ixgb_vlan_rx_add_vid(adapter->netdev, vid); 2253 ixgb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
2252} 2254}
2253 2255
2254#ifdef CONFIG_NET_POLL_CONTROLLER 2256#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 0316b65dfe06..3becffc77321 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3467,7 +3467,8 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
3467 hw->mac.ops.enable_rx_dma(hw, rxctrl); 3467 hw->mac.ops.enable_rx_dma(hw, rxctrl);
3468} 3468}
3469 3469
3470static int ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 3470static int ixgbe_vlan_rx_add_vid(struct net_device *netdev,
3471 __be16 proto, u16 vid)
3471{ 3472{
3472 struct ixgbe_adapter *adapter = netdev_priv(netdev); 3473 struct ixgbe_adapter *adapter = netdev_priv(netdev);
3473 struct ixgbe_hw *hw = &adapter->hw; 3474 struct ixgbe_hw *hw = &adapter->hw;
@@ -3479,7 +3480,8 @@ static int ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
3479 return 0; 3480 return 0;
3480} 3481}
3481 3482
3482static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 3483static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev,
3484 __be16 proto, u16 vid)
3483{ 3485{
3484 struct ixgbe_adapter *adapter = netdev_priv(netdev); 3486 struct ixgbe_adapter *adapter = netdev_priv(netdev);
3485 struct ixgbe_hw *hw = &adapter->hw; 3487 struct ixgbe_hw *hw = &adapter->hw;
@@ -3584,10 +3586,10 @@ static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
3584{ 3586{
3585 u16 vid; 3587 u16 vid;
3586 3588
3587 ixgbe_vlan_rx_add_vid(adapter->netdev, 0); 3589 ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
3588 3590
3589 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 3591 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
3590 ixgbe_vlan_rx_add_vid(adapter->netdev, vid); 3592 ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
3591} 3593}
3592 3594
3593/** 3595/**
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 8f907b7af319..4bc1f84c9352 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1179,7 +1179,8 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter)
1179 } 1179 }
1180} 1180}
1181 1181
1182static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 1182static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev,
1183 __be16 proto, u16 vid)
1183{ 1184{
1184 struct ixgbevf_adapter *adapter = netdev_priv(netdev); 1185 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
1185 struct ixgbe_hw *hw = &adapter->hw; 1186 struct ixgbe_hw *hw = &adapter->hw;
@@ -1204,7 +1205,8 @@ static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
1204 return err; 1205 return err;
1205} 1206}
1206 1207
1207static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 1208static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev,
1209 __be16 proto, u16 vid)
1208{ 1210{
1209 struct ixgbevf_adapter *adapter = netdev_priv(netdev); 1211 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
1210 struct ixgbe_hw *hw = &adapter->hw; 1212 struct ixgbe_hw *hw = &adapter->hw;
@@ -1227,7 +1229,8 @@ static void ixgbevf_restore_vlan(struct ixgbevf_adapter *adapter)
1227 u16 vid; 1229 u16 vid;
1228 1230
1229 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) 1231 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
1230 ixgbevf_vlan_rx_add_vid(adapter->netdev, vid); 1232 ixgbevf_vlan_rx_add_vid(adapter->netdev,
1233 htons(ETH_P_8021Q), vid);
1231} 1234}
1232 1235
1233static int ixgbevf_write_uc_addr_list(struct net_device *netdev) 1236static int ixgbevf_write_uc_addr_list(struct net_device *netdev)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index b2ba39c7143a..e7e27842d8d4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -356,7 +356,8 @@ static void mlx4_en_filter_rfs_expire(struct mlx4_en_priv *priv)
356} 356}
357#endif 357#endif
358 358
359static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 359static int mlx4_en_vlan_rx_add_vid(struct net_device *dev,
360 __be16 proto, u16 vid)
360{ 361{
361 struct mlx4_en_priv *priv = netdev_priv(dev); 362 struct mlx4_en_priv *priv = netdev_priv(dev);
362 struct mlx4_en_dev *mdev = priv->mdev; 363 struct mlx4_en_dev *mdev = priv->mdev;
@@ -381,7 +382,8 @@ static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
381 return 0; 382 return 0;
382} 383}
383 384
384static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 385static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev,
386 __be16 proto, u16 vid)
385{ 387{
386 struct mlx4_en_priv *priv = netdev_priv(dev); 388 struct mlx4_en_priv *priv = netdev_priv(dev);
387 struct mlx4_en_dev *mdev = priv->mdev; 389 struct mlx4_en_dev *mdev = priv->mdev;
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index e9e58aadf87e..a9396142201c 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -3300,12 +3300,13 @@ static void vxge_tx_watchdog(struct net_device *dev)
3300/** 3300/**
3301 * vxge_vlan_rx_add_vid 3301 * vxge_vlan_rx_add_vid
3302 * @dev: net device pointer. 3302 * @dev: net device pointer.
3303 * @proto: vlan protocol
3303 * @vid: vid 3304 * @vid: vid
3304 * 3305 *
3305 * Add the vlan id to the devices vlan id table 3306 * Add the vlan id to the devices vlan id table
3306 */ 3307 */
3307static int 3308static int
3308vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 3309vxge_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
3309{ 3310{
3310 struct vxgedev *vdev = netdev_priv(dev); 3311 struct vxgedev *vdev = netdev_priv(dev);
3311 struct vxge_vpath *vpath; 3312 struct vxge_vpath *vpath;
@@ -3323,14 +3324,15 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
3323} 3324}
3324 3325
3325/** 3326/**
3326 * vxge_vlan_rx_add_vid 3327 * vxge_vlan_rx_kill_vid
3327 * @dev: net device pointer. 3328 * @dev: net device pointer.
3329 * @proto: vlan protocol
3328 * @vid: vid 3330 * @vid: vid
3329 * 3331 *
3330 * Remove the vlan id from the device's vlan id table 3332 * Remove the vlan id from the device's vlan id table
3331 */ 3333 */
3332static int 3334static int
3333vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 3335vxge_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
3334{ 3336{
3335 struct vxgedev *vdev = netdev_priv(dev); 3337 struct vxgedev *vdev = netdev_priv(dev);
3336 struct vxge_vpath *vpath; 3338 struct vxge_vpath *vpath;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 845ba1d1c3c9..e88e01312c67 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -86,8 +86,8 @@ static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *);
86static int qlcnicvf_start_firmware(struct qlcnic_adapter *); 86static int qlcnicvf_start_firmware(struct qlcnic_adapter *);
87static void qlcnic_set_netdev_features(struct qlcnic_adapter *, 87static void qlcnic_set_netdev_features(struct qlcnic_adapter *,
88 struct qlcnic_esw_func_cfg *); 88 struct qlcnic_esw_func_cfg *);
89static int qlcnic_vlan_rx_add(struct net_device *, u16); 89static int qlcnic_vlan_rx_add(struct net_device *, __be16, u16);
90static int qlcnic_vlan_rx_del(struct net_device *, u16); 90static int qlcnic_vlan_rx_del(struct net_device *, __be16, u16);
91 91
92#define QLCNIC_IS_TSO_CAPABLE(adapter) \ 92#define QLCNIC_IS_TSO_CAPABLE(adapter) \
93 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO) 93 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
@@ -902,7 +902,7 @@ void qlcnic_set_vlan_config(struct qlcnic_adapter *adapter,
902} 902}
903 903
904static int 904static int
905qlcnic_vlan_rx_add(struct net_device *netdev, u16 vid) 905qlcnic_vlan_rx_add(struct net_device *netdev, __be16 proto, u16 vid)
906{ 906{
907 struct qlcnic_adapter *adapter = netdev_priv(netdev); 907 struct qlcnic_adapter *adapter = netdev_priv(netdev);
908 set_bit(vid, adapter->vlans); 908 set_bit(vid, adapter->vlans);
@@ -910,7 +910,7 @@ qlcnic_vlan_rx_add(struct net_device *netdev, u16 vid)
910} 910}
911 911
912static int 912static int
913qlcnic_vlan_rx_del(struct net_device *netdev, u16 vid) 913qlcnic_vlan_rx_del(struct net_device *netdev, __be16 proto, u16 vid)
914{ 914{
915 struct qlcnic_adapter *adapter = netdev_priv(netdev); 915 struct qlcnic_adapter *adapter = netdev_priv(netdev);
916 916
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 8e3f43c75665..a9016acc2d6a 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -2326,7 +2326,7 @@ static int __qlge_vlan_rx_add_vid(struct ql_adapter *qdev, u16 vid)
2326 return err; 2326 return err;
2327} 2327}
2328 2328
2329static int qlge_vlan_rx_add_vid(struct net_device *ndev, u16 vid) 2329static int qlge_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)
2330{ 2330{
2331 struct ql_adapter *qdev = netdev_priv(ndev); 2331 struct ql_adapter *qdev = netdev_priv(ndev);
2332 int status; 2332 int status;
@@ -2357,7 +2357,7 @@ static int __qlge_vlan_rx_kill_vid(struct ql_adapter *qdev, u16 vid)
2357 return err; 2357 return err;
2358} 2358}
2359 2359
2360static int qlge_vlan_rx_kill_vid(struct net_device *ndev, u16 vid) 2360static int qlge_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid)
2361{ 2361{
2362 struct ql_adapter *qdev = netdev_priv(ndev); 2362 struct ql_adapter *qdev = netdev_priv(ndev);
2363 int status; 2363 int status;
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 3d4a1ed0a7ab..b8e52cd1a698 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2448,7 +2448,8 @@ static int sh_eth_get_vtag_index(struct sh_eth_private *mdp)
2448 return TSU_VTAG1; 2448 return TSU_VTAG1;
2449} 2449}
2450 2450
2451static int sh_eth_vlan_rx_add_vid(struct net_device *ndev, u16 vid) 2451static int sh_eth_vlan_rx_add_vid(struct net_device *ndev,
2452 __be16 proto, u16 vid)
2452{ 2453{
2453 struct sh_eth_private *mdp = netdev_priv(ndev); 2454 struct sh_eth_private *mdp = netdev_priv(ndev);
2454 int vtag_reg_index = sh_eth_get_vtag_index(mdp); 2455 int vtag_reg_index = sh_eth_get_vtag_index(mdp);
@@ -2478,7 +2479,8 @@ static int sh_eth_vlan_rx_add_vid(struct net_device *ndev, u16 vid)
2478 return 0; 2479 return 0;
2479} 2480}
2480 2481
2481static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev, u16 vid) 2482static int sh_eth_vlan_rx_kill_vid(struct net_device *ndev,
2483 __be16 proto, u16 vid)
2482{ 2484{
2483 struct sh_eth_private *mdp = netdev_priv(ndev); 2485 struct sh_eth_private *mdp = netdev_priv(ndev);
2484 int vtag_reg_index = sh_eth_get_vtag_index(mdp); 2486 int vtag_reg_index = sh_eth_get_vtag_index(mdp);
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 5ca4b33fc4c1..f7050c573519 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -733,7 +733,7 @@ static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable)
733 * @ndev: network device 733 * @ndev: network device
734 * @vid: VLAN vid to add 734 * @vid: VLAN vid to add
735 */ 735 */
736static int bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid) 736static int bdx_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)
737{ 737{
738 __bdx_vlan_rx_vid(ndev, vid, 1); 738 __bdx_vlan_rx_vid(ndev, vid, 1);
739 return 0; 739 return 0;
@@ -744,7 +744,7 @@ static int bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid)
744 * @ndev: network device 744 * @ndev: network device
745 * @vid: VLAN vid to kill 745 * @vid: VLAN vid to kill
746 */ 746 */
747static int bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) 747static int bdx_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid)
748{ 748{
749 __bdx_vlan_rx_vid(ndev, vid, 0); 749 __bdx_vlan_rx_vid(ndev, vid, 0);
750 return 0; 750 return 0;
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 084992981cef..5cf8d03b8cae 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1251,7 +1251,7 @@ clean_vid:
1251} 1251}
1252 1252
1253static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev, 1253static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev,
1254 unsigned short vid) 1254 __be16 proto, u16 vid)
1255{ 1255{
1256 struct cpsw_priv *priv = netdev_priv(ndev); 1256 struct cpsw_priv *priv = netdev_priv(ndev);
1257 1257
@@ -1263,7 +1263,7 @@ static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev,
1263} 1263}
1264 1264
1265static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev, 1265static int cpsw_ndo_vlan_rx_kill_vid(struct net_device *ndev,
1266 unsigned short vid) 1266 __be16 proto, u16 vid)
1267{ 1267{
1268 struct cpsw_priv *priv = netdev_priv(ndev); 1268 struct cpsw_priv *priv = netdev_priv(ndev);
1269 int ret; 1269 int ret;
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 37b02c3768be..c6014916f622 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -508,8 +508,10 @@ static struct rtnl_link_stats64 *rhine_get_stats64(struct net_device *dev,
508static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 508static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
509static const struct ethtool_ops netdev_ethtool_ops; 509static const struct ethtool_ops netdev_ethtool_ops;
510static int rhine_close(struct net_device *dev); 510static int rhine_close(struct net_device *dev);
511static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid); 511static int rhine_vlan_rx_add_vid(struct net_device *dev,
512static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); 512 __be16 proto, u16 vid);
513static int rhine_vlan_rx_kill_vid(struct net_device *dev,
514 __be16 proto, u16 vid);
513static void rhine_restart_tx(struct net_device *dev); 515static void rhine_restart_tx(struct net_device *dev);
514 516
515static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low) 517static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool low)
@@ -1415,7 +1417,7 @@ static void rhine_update_vcam(struct net_device *dev)
1415 rhine_set_vlan_cam_mask(ioaddr, vCAMmask); 1417 rhine_set_vlan_cam_mask(ioaddr, vCAMmask);
1416} 1418}
1417 1419
1418static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 1420static int rhine_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
1419{ 1421{
1420 struct rhine_private *rp = netdev_priv(dev); 1422 struct rhine_private *rp = netdev_priv(dev);
1421 1423
@@ -1426,7 +1428,7 @@ static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
1426 return 0; 1428 return 0;
1427} 1429}
1428 1430
1429static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 1431static int rhine_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
1430{ 1432{
1431 struct rhine_private *rp = netdev_priv(dev); 1433 struct rhine_private *rp = netdev_priv(dev);
1432 1434
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index c1c55a7da941..91cd59146c24 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -525,7 +525,8 @@ static void velocity_init_cam_filter(struct velocity_info *vptr)
525 mac_set_vlan_cam_mask(regs, vptr->vCAMmask); 525 mac_set_vlan_cam_mask(regs, vptr->vCAMmask);
526} 526}
527 527
528static int velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 528static int velocity_vlan_rx_add_vid(struct net_device *dev,
529 __be16 proto, u16 vid)
529{ 530{
530 struct velocity_info *vptr = netdev_priv(dev); 531 struct velocity_info *vptr = netdev_priv(dev);
531 532
@@ -536,7 +537,8 @@ static int velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
536 return 0; 537 return 0;
537} 538}
538 539
539static int velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 540static int velocity_vlan_rx_kill_vid(struct net_device *dev,
541 __be16 proto, u16 vid)
540{ 542{
541 struct velocity_info *vptr = netdev_priv(dev); 543 struct velocity_info *vptr = netdev_priv(dev);
542 544
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index fedd34cff91c..7347cdbe736f 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -567,21 +567,21 @@ static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
567} 567}
568 568
569static int macvlan_vlan_rx_add_vid(struct net_device *dev, 569static int macvlan_vlan_rx_add_vid(struct net_device *dev,
570 unsigned short vid) 570 __be16 proto, u16 vid)
571{ 571{
572 struct macvlan_dev *vlan = netdev_priv(dev); 572 struct macvlan_dev *vlan = netdev_priv(dev);
573 struct net_device *lowerdev = vlan->lowerdev; 573 struct net_device *lowerdev = vlan->lowerdev;
574 574
575 return vlan_vid_add(lowerdev, vid); 575 return vlan_vid_add(lowerdev, proto, vid);
576} 576}
577 577
578static int macvlan_vlan_rx_kill_vid(struct net_device *dev, 578static int macvlan_vlan_rx_kill_vid(struct net_device *dev,
579 unsigned short vid) 579 __be16 proto, u16 vid)
580{ 580{
581 struct macvlan_dev *vlan = netdev_priv(dev); 581 struct macvlan_dev *vlan = netdev_priv(dev);
582 struct net_device *lowerdev = vlan->lowerdev; 582 struct net_device *lowerdev = vlan->lowerdev;
583 583
584 vlan_vid_del(lowerdev, vid); 584 vlan_vid_del(lowerdev, proto, vid);
585 return 0; 585 return 0;
586} 586}
587 587
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 9290eb23d664..7c43261975bd 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1598,7 +1598,7 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1598 return stats; 1598 return stats;
1599} 1599}
1600 1600
1601static int team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid) 1601static int team_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
1602{ 1602{
1603 struct team *team = netdev_priv(dev); 1603 struct team *team = netdev_priv(dev);
1604 struct team_port *port; 1604 struct team_port *port;
@@ -1610,7 +1610,7 @@ static int team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
1610 */ 1610 */
1611 mutex_lock(&team->lock); 1611 mutex_lock(&team->lock);
1612 list_for_each_entry(port, &team->port_list, list) { 1612 list_for_each_entry(port, &team->port_list, list) {
1613 err = vlan_vid_add(port->dev, vid); 1613 err = vlan_vid_add(port->dev, proto, vid);
1614 if (err) 1614 if (err)
1615 goto unwind; 1615 goto unwind;
1616 } 1616 }
@@ -1620,20 +1620,20 @@ static int team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid)
1620 1620
1621unwind: 1621unwind:
1622 list_for_each_entry_continue_reverse(port, &team->port_list, list) 1622 list_for_each_entry_continue_reverse(port, &team->port_list, list)
1623 vlan_vid_del(port->dev, vid); 1623 vlan_vid_del(port->dev, proto, vid);
1624 mutex_unlock(&team->lock); 1624 mutex_unlock(&team->lock);
1625 1625
1626 return err; 1626 return err;
1627} 1627}
1628 1628
1629static int team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) 1629static int team_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
1630{ 1630{
1631 struct team *team = netdev_priv(dev); 1631 struct team *team = netdev_priv(dev);
1632 struct team_port *port; 1632 struct team_port *port;
1633 1633
1634 rcu_read_lock(); 1634 rcu_read_lock();
1635 list_for_each_entry_rcu(port, &team->port_list, list) 1635 list_for_each_entry_rcu(port, &team->port_list, list)
1636 vlan_vid_del(port->dev, vid); 1636 vlan_vid_del(port->dev, proto, vid);
1637 rcu_read_unlock(); 1637 rcu_read_unlock();
1638 1638
1639 return 0; 1639 return 0;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b61d57ab3c63..50077753a0e5 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1006,7 +1006,8 @@ static void virtnet_set_rx_mode(struct net_device *dev)
1006 kfree(buf); 1006 kfree(buf);
1007} 1007}
1008 1008
1009static int virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) 1009static int virtnet_vlan_rx_add_vid(struct net_device *dev,
1010 __be16 proto, u16 vid)
1010{ 1011{
1011 struct virtnet_info *vi = netdev_priv(dev); 1012 struct virtnet_info *vi = netdev_priv(dev);
1012 struct scatterlist sg; 1013 struct scatterlist sg;
@@ -1019,7 +1020,8 @@ static int virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid)
1019 return 0; 1020 return 0;
1020} 1021}
1021 1022
1022static int virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) 1023static int virtnet_vlan_rx_kill_vid(struct net_device *dev,
1024 __be16 proto, u16 vid)
1023{ 1025{
1024 struct virtnet_info *vi = netdev_priv(dev); 1026 struct virtnet_info *vi = netdev_priv(dev);
1025 struct scatterlist sg; 1027 struct scatterlist sg;
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index ba9bdad39986..27b889992ab8 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1931,7 +1931,7 @@ vmxnet3_restore_vlan(struct vmxnet3_adapter *adapter)
1931 1931
1932 1932
1933static int 1933static int
1934vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid) 1934vmxnet3_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
1935{ 1935{
1936 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1936 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
1937 1937
@@ -1953,7 +1953,7 @@ vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
1953 1953
1954 1954
1955static int 1955static int
1956vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) 1956vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
1957{ 1957{
1958 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 1958 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
1959 1959
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 90ddd823605c..e68f79b38556 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -302,7 +302,8 @@ static void qeth_l2_process_vlans(struct qeth_card *card)
302 spin_unlock_bh(&card->vlanlock); 302 spin_unlock_bh(&card->vlanlock);
303} 303}
304 304
305static int qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 305static int qeth_l2_vlan_rx_add_vid(struct net_device *dev,
306 __be16 proto, u16 vid)
306{ 307{
307 struct qeth_card *card = dev->ml_priv; 308 struct qeth_card *card = dev->ml_priv;
308 struct qeth_vlan_vid *id; 309 struct qeth_vlan_vid *id;
@@ -331,7 +332,8 @@ static int qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
331 return 0; 332 return 0;
332} 333}
333 334
334static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 335static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev,
336 __be16 proto, u16 vid)
335{ 337{
336 struct qeth_vlan_vid *id, *tmpid = NULL; 338 struct qeth_vlan_vid *id, *tmpid = NULL;
337 struct qeth_card *card = dev->ml_priv; 339 struct qeth_card *card = dev->ml_priv;
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 04261bc08f20..642686846a14 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1824,7 +1824,8 @@ static void qeth_l3_free_vlan_addresses(struct qeth_card *card,
1824 rcu_read_unlock(); 1824 rcu_read_unlock();
1825} 1825}
1826 1826
1827static int qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) 1827static int qeth_l3_vlan_rx_add_vid(struct net_device *dev,
1828 __be16 proto, u16 vid)
1828{ 1829{
1829 struct qeth_card *card = dev->ml_priv; 1830 struct qeth_card *card = dev->ml_priv;
1830 1831
@@ -1832,7 +1833,8 @@ static int qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
1832 return 0; 1833 return 0;
1833} 1834}
1834 1835
1835static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) 1836static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev,
1837 __be16 proto, u16 vid)
1836{ 1838{
1837 struct qeth_card *card = dev->ml_priv; 1839 struct qeth_card *card = dev->ml_priv;
1838 unsigned long flags; 1840 unsigned long flags;
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index fee28291a824..fcb9ef82aae1 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -93,8 +93,8 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
93extern bool vlan_do_receive(struct sk_buff **skb); 93extern bool vlan_do_receive(struct sk_buff **skb);
94extern struct sk_buff *vlan_untag(struct sk_buff *skb); 94extern struct sk_buff *vlan_untag(struct sk_buff *skb);
95 95
96extern int vlan_vid_add(struct net_device *dev, unsigned short vid); 96extern int vlan_vid_add(struct net_device *dev, __be16 proto, u16 vid);
97extern void vlan_vid_del(struct net_device *dev, unsigned short vid); 97extern void vlan_vid_del(struct net_device *dev, __be16 proto, u16 vid);
98 98
99extern int vlan_vids_add_by_dev(struct net_device *dev, 99extern int vlan_vids_add_by_dev(struct net_device *dev,
100 const struct net_device *by_dev); 100 const struct net_device *by_dev);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 7eb7e03ee417..f8898a435dc5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -784,15 +784,13 @@ struct netdev_fcoe_hbainfo {
784 * 3. Update dev->stats asynchronously and atomically, and define 784 * 3. Update dev->stats asynchronously and atomically, and define
785 * neither operation. 785 * neither operation.
786 * 786 *
787 * int (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); 787 * int (*ndo_vlan_rx_add_vid)(struct net_device *dev, __be16 proto, u16t vid);
788 * If device support VLAN filtering (dev->features & 788 * If device support VLAN filtering this function is called when a
789 * NETIF_F_HW_VLAN_CTAG_FILTER) 789 * VLAN id is registered.
790 * this function is called when a VLAN id is registered.
791 * 790 *
792 * int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); 791 * int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid);
793 * If device support VLAN filtering (dev->features & 792 * If device support VLAN filtering this function is called when a
794 * NETIF_F_HW_VLAN_CTAG_FILTER) 793 * VLAN id is unregistered.
795 * this function is called when a VLAN id is unregistered.
796 * 794 *
797 * void (*ndo_poll_controller)(struct net_device *dev); 795 * void (*ndo_poll_controller)(struct net_device *dev);
798 * 796 *
@@ -936,9 +934,9 @@ struct net_device_ops {
936 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 934 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
937 935
938 int (*ndo_vlan_rx_add_vid)(struct net_device *dev, 936 int (*ndo_vlan_rx_add_vid)(struct net_device *dev,
939 unsigned short vid); 937 __be16 proto, u16 vid);
940 int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 938 int (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
941 unsigned short vid); 939 __be16 proto, u16 vid);
942#ifdef CONFIG_NET_POLL_CONTROLLER 940#ifdef CONFIG_NET_POLL_CONTROLLER
943 void (*ndo_poll_controller)(struct net_device *dev); 941 void (*ndo_poll_controller)(struct net_device *dev);
944 int (*ndo_netpoll_setup)(struct net_device *dev, 942 int (*ndo_netpoll_setup)(struct net_device *dev,
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index d913feed0757..447c5c93434f 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -112,7 +112,7 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
112 * VLAN is not 0 (leave it there for 802.1p). 112 * VLAN is not 0 (leave it there for 802.1p).
113 */ 113 */
114 if (vlan_id) 114 if (vlan_id)
115 vlan_vid_del(real_dev, vlan_id); 115 vlan_vid_del(real_dev, htons(ETH_P_8021Q), vlan_id);
116 116
117 /* Get rid of the vlan's reference to real_dev */ 117 /* Get rid of the vlan's reference to real_dev */
118 dev_put(real_dev); 118 dev_put(real_dev);
@@ -142,7 +142,7 @@ int register_vlan_dev(struct net_device *dev)
142 struct vlan_group *grp; 142 struct vlan_group *grp;
143 int err; 143 int err;
144 144
145 err = vlan_vid_add(real_dev, vlan_id); 145 err = vlan_vid_add(real_dev, htons(ETH_P_8021Q), vlan_id);
146 if (err) 146 if (err)
147 return err; 147 return err;
148 148
@@ -195,7 +195,7 @@ out_uninit_gvrp:
195 if (grp->nr_vlan_devs == 0) 195 if (grp->nr_vlan_devs == 0)
196 vlan_gvrp_uninit_applicant(real_dev); 196 vlan_gvrp_uninit_applicant(real_dev);
197out_vid_del: 197out_vid_del:
198 vlan_vid_del(real_dev, vlan_id); 198 vlan_vid_del(real_dev, htons(ETH_P_8021Q), vlan_id);
199 return err; 199 return err;
200} 200}
201 201
@@ -350,7 +350,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
350 (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { 350 (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
351 pr_info("adding VLAN 0 to HW filter on device %s\n", 351 pr_info("adding VLAN 0 to HW filter on device %s\n",
352 dev->name); 352 dev->name);
353 vlan_vid_add(dev, 0); 353 vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
354 } 354 }
355 355
356 vlan_info = rtnl_dereference(dev->vlan_info); 356 vlan_info = rtnl_dereference(dev->vlan_info);
@@ -416,7 +416,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
416 416
417 case NETDEV_DOWN: 417 case NETDEV_DOWN:
418 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) 418 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)
419 vlan_vid_del(dev, 0); 419 vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
420 420
421 /* Put all VLANs for this dev in the down state too. */ 421 /* Put all VLANs for this dev in the down state too. */
422 for (i = 0; i < VLAN_N_VID; i++) { 422 for (i = 0; i < VLAN_N_VID; i++) {
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 3df29d344704..04e3b95a0d48 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -185,35 +185,37 @@ static struct vlan_info *vlan_info_alloc(struct net_device *dev)
185 185
186struct vlan_vid_info { 186struct vlan_vid_info {
187 struct list_head list; 187 struct list_head list;
188 unsigned short vid; 188 __be16 proto;
189 u16 vid;
189 int refcount; 190 int refcount;
190}; 191};
191 192
192static struct vlan_vid_info *vlan_vid_info_get(struct vlan_info *vlan_info, 193static struct vlan_vid_info *vlan_vid_info_get(struct vlan_info *vlan_info,
193 unsigned short vid) 194 __be16 proto, u16 vid)
194{ 195{
195 struct vlan_vid_info *vid_info; 196 struct vlan_vid_info *vid_info;
196 197
197 list_for_each_entry(vid_info, &vlan_info->vid_list, list) { 198 list_for_each_entry(vid_info, &vlan_info->vid_list, list) {
198 if (vid_info->vid == vid) 199 if (vid_info->proto == proto && vid_info->vid == vid)
199 return vid_info; 200 return vid_info;
200 } 201 }
201 return NULL; 202 return NULL;
202} 203}
203 204
204static struct vlan_vid_info *vlan_vid_info_alloc(unsigned short vid) 205static struct vlan_vid_info *vlan_vid_info_alloc(__be16 proto, u16 vid)
205{ 206{
206 struct vlan_vid_info *vid_info; 207 struct vlan_vid_info *vid_info;
207 208
208 vid_info = kzalloc(sizeof(struct vlan_vid_info), GFP_KERNEL); 209 vid_info = kzalloc(sizeof(struct vlan_vid_info), GFP_KERNEL);
209 if (!vid_info) 210 if (!vid_info)
210 return NULL; 211 return NULL;
212 vid_info->proto = proto;
211 vid_info->vid = vid; 213 vid_info->vid = vid;
212 214
213 return vid_info; 215 return vid_info;
214} 216}
215 217
216static int __vlan_vid_add(struct vlan_info *vlan_info, unsigned short vid, 218static int __vlan_vid_add(struct vlan_info *vlan_info, __be16 proto, u16 vid,
217 struct vlan_vid_info **pvid_info) 219 struct vlan_vid_info **pvid_info)
218{ 220{
219 struct net_device *dev = vlan_info->real_dev; 221 struct net_device *dev = vlan_info->real_dev;
@@ -221,12 +223,13 @@ static int __vlan_vid_add(struct vlan_info *vlan_info, unsigned short vid,
221 struct vlan_vid_info *vid_info; 223 struct vlan_vid_info *vid_info;
222 int err; 224 int err;
223 225
224 vid_info = vlan_vid_info_alloc(vid); 226 vid_info = vlan_vid_info_alloc(proto, vid);
225 if (!vid_info) 227 if (!vid_info)
226 return -ENOMEM; 228 return -ENOMEM;
227 229
228 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) { 230 if (proto == htons(ETH_P_8021Q) &&
229 err = ops->ndo_vlan_rx_add_vid(dev, vid); 231 dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
232 err = ops->ndo_vlan_rx_add_vid(dev, proto, vid);
230 if (err) { 233 if (err) {
231 kfree(vid_info); 234 kfree(vid_info);
232 return err; 235 return err;
@@ -238,7 +241,7 @@ static int __vlan_vid_add(struct vlan_info *vlan_info, unsigned short vid,
238 return 0; 241 return 0;
239} 242}
240 243
241int vlan_vid_add(struct net_device *dev, unsigned short vid) 244int vlan_vid_add(struct net_device *dev, __be16 proto, u16 vid)
242{ 245{
243 struct vlan_info *vlan_info; 246 struct vlan_info *vlan_info;
244 struct vlan_vid_info *vid_info; 247 struct vlan_vid_info *vid_info;
@@ -254,9 +257,9 @@ int vlan_vid_add(struct net_device *dev, unsigned short vid)
254 return -ENOMEM; 257 return -ENOMEM;
255 vlan_info_created = true; 258 vlan_info_created = true;
256 } 259 }
257 vid_info = vlan_vid_info_get(vlan_info, vid); 260 vid_info = vlan_vid_info_get(vlan_info, proto, vid);
258 if (!vid_info) { 261 if (!vid_info) {
259 err = __vlan_vid_add(vlan_info, vid, &vid_info); 262 err = __vlan_vid_add(vlan_info, proto, vid, &vid_info);
260 if (err) 263 if (err)
261 goto out_free_vlan_info; 264 goto out_free_vlan_info;
262 } 265 }
@@ -279,14 +282,16 @@ static void __vlan_vid_del(struct vlan_info *vlan_info,
279{ 282{
280 struct net_device *dev = vlan_info->real_dev; 283 struct net_device *dev = vlan_info->real_dev;
281 const struct net_device_ops *ops = dev->netdev_ops; 284 const struct net_device_ops *ops = dev->netdev_ops;
282 unsigned short vid = vid_info->vid; 285 __be16 proto = vid_info->proto;
286 u16 vid = vid_info->vid;
283 int err; 287 int err;
284 288
285 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) { 289 if (proto == htons(ETH_P_8021Q) &&
286 err = ops->ndo_vlan_rx_kill_vid(dev, vid); 290 dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) {
291 err = ops->ndo_vlan_rx_kill_vid(dev, proto, vid);
287 if (err) { 292 if (err) {
288 pr_warn("failed to kill vid %d for device %s\n", 293 pr_warn("failed to kill vid %04x/%d for device %s\n",
289 vid, dev->name); 294 proto, vid, dev->name);
290 } 295 }
291 } 296 }
292 list_del(&vid_info->list); 297 list_del(&vid_info->list);
@@ -294,7 +299,7 @@ static void __vlan_vid_del(struct vlan_info *vlan_info,
294 vlan_info->nr_vids--; 299 vlan_info->nr_vids--;
295} 300}
296 301
297void vlan_vid_del(struct net_device *dev, unsigned short vid) 302void vlan_vid_del(struct net_device *dev, __be16 proto, u16 vid)
298{ 303{
299 struct vlan_info *vlan_info; 304 struct vlan_info *vlan_info;
300 struct vlan_vid_info *vid_info; 305 struct vlan_vid_info *vid_info;
@@ -305,7 +310,7 @@ void vlan_vid_del(struct net_device *dev, unsigned short vid)
305 if (!vlan_info) 310 if (!vlan_info)
306 return; 311 return;
307 312
308 vid_info = vlan_vid_info_get(vlan_info, vid); 313 vid_info = vlan_vid_info_get(vlan_info, proto, vid);
309 if (!vid_info) 314 if (!vid_info)
310 return; 315 return;
311 vid_info->refcount--; 316 vid_info->refcount--;
@@ -333,7 +338,7 @@ int vlan_vids_add_by_dev(struct net_device *dev,
333 return 0; 338 return 0;
334 339
335 list_for_each_entry(vid_info, &vlan_info->vid_list, list) { 340 list_for_each_entry(vid_info, &vlan_info->vid_list, list) {
336 err = vlan_vid_add(dev, vid_info->vid); 341 err = vlan_vid_add(dev, vid_info->proto, vid_info->vid);
337 if (err) 342 if (err)
338 goto unwind; 343 goto unwind;
339 } 344 }
@@ -343,7 +348,7 @@ unwind:
343 list_for_each_entry_continue_reverse(vid_info, 348 list_for_each_entry_continue_reverse(vid_info,
344 &vlan_info->vid_list, 349 &vlan_info->vid_list,
345 list) { 350 list) {
346 vlan_vid_del(dev, vid_info->vid); 351 vlan_vid_del(dev, vid_info->proto, vid_info->vid);
347 } 352 }
348 353
349 return err; 354 return err;
@@ -363,7 +368,7 @@ void vlan_vids_del_by_dev(struct net_device *dev,
363 return; 368 return;
364 369
365 list_for_each_entry(vid_info, &vlan_info->vid_list, list) 370 list_for_each_entry(vid_info, &vlan_info->vid_list, list)
366 vlan_vid_del(dev, vid_info->vid); 371 vlan_vid_del(dev, vid_info->proto, vid_info->vid);
367} 372}
368EXPORT_SYMBOL(vlan_vids_del_by_dev); 373EXPORT_SYMBOL(vlan_vids_del_by_dev);
369 374
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 0b3dbbec80d0..c3076e2c4294 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -34,6 +34,7 @@ static void __vlan_add_flags(struct net_port_vlans *v, u16 vid, u16 flags)
34 34
35static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) 35static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
36{ 36{
37 const struct net_device_ops *ops;
37 struct net_bridge_port *p = NULL; 38 struct net_bridge_port *p = NULL;
38 struct net_bridge *br; 39 struct net_bridge *br;
39 struct net_device *dev; 40 struct net_device *dev;
@@ -53,6 +54,7 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
53 br = v->parent.br; 54 br = v->parent.br;
54 dev = br->dev; 55 dev = br->dev;
55 } 56 }
57 ops = dev->netdev_ops;
56 58
57 if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { 59 if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
58 /* Add VLAN to the device filter if it is supported. 60 /* Add VLAN to the device filter if it is supported.
@@ -61,7 +63,8 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
61 * that ever changes this code will allow tagged 63 * that ever changes this code will allow tagged
62 * traffic to enter the bridge. 64 * traffic to enter the bridge.
63 */ 65 */
64 err = dev->netdev_ops->ndo_vlan_rx_add_vid(dev, vid); 66 err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q),
67 vid);
65 if (err) 68 if (err)
66 return err; 69 return err;
67 } 70 }
@@ -83,7 +86,7 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
83 86
84out_filt: 87out_filt:
85 if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) 88 if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
86 dev->netdev_ops->ndo_vlan_rx_kill_vid(dev, vid); 89 ops->ndo_vlan_rx_kill_vid(dev, htons(ETH_P_8021Q), vid);
87 return err; 90 return err;
88} 91}
89 92
@@ -97,9 +100,10 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)
97 100
98 if (v->port_idx && vid) { 101 if (v->port_idx && vid) {
99 struct net_device *dev = v->parent.port->dev; 102 struct net_device *dev = v->parent.port->dev;
103 const struct net_device_ops *ops = dev->netdev_ops;
100 104
101 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) 105 if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)
102 dev->netdev_ops->ndo_vlan_rx_kill_vid(dev, vid); 106 ops->ndo_vlan_rx_kill_vid(dev, htons(ETH_P_8021Q), vid);
103 } 107 }
104 108
105 clear_bit(vid, v->vlan_bitmap); 109 clear_bit(vid, v->vlan_bitmap);