Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Patrick McHardy and committed by
David S. Miller
80d5c368 f646968f

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