aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
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 /drivers/net/bonding
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>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c17
1 files changed, 10 insertions, 7 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