~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to net/8021q/vlan.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
const char vlan_fullname[] = "802.1Q VLAN Support";
48
48
const char vlan_version[] = DRV_VERSION;
49
 
static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>";
50
 
static const char vlan_buggyright[] = "David S. Miller <davem@redhat.com>";
51
 
 
52
 
static struct packet_type vlan_packet_type __read_mostly = {
53
 
        .type = cpu_to_be16(ETH_P_8021Q),
54
 
        .func = vlan_skb_recv, /* VLAN receive method */
55
 
};
56
49
 
57
50
/* End of global variables definitions. */
58
51
 
128
121
                vlan_gvrp_request_leave(dev);
129
122
 
130
123
        vlan_group_set_device(grp, vlan_id, NULL);
131
 
        if (!grp->killall)
132
 
                synchronize_net();
133
 
 
 
124
        /* Because unregister_netdevice_queue() makes sure at least one rcu
 
125
         * grace period is respected before device freeing,
 
126
         * we dont need to call synchronize_net() here.
 
127
         */
134
128
        unregister_netdevice_queue(dev, head);
135
129
 
136
130
        /* If the group is now empty, kill off the group. */
211
205
        grp->nr_vlans++;
212
206
 
213
207
        if (ngrp) {
214
 
                if (ops->ndo_vlan_rx_register)
 
208
                if (ops->ndo_vlan_rx_register && (real_dev->features & NETIF_F_HW_VLAN_RX))
215
209
                        ops->ndo_vlan_rx_register(real_dev, ngrp);
216
210
                rcu_assign_pointer(real_dev->vlgrp, ngrp);
217
211
        }
330
324
static void vlan_transfer_features(struct net_device *dev,
331
325
                                   struct net_device *vlandev)
332
326
{
333
 
        u32 old_features = vlandev->features;
334
 
 
335
 
        vlandev->features &= ~dev->vlan_features;
336
 
        vlandev->features |= dev->features & dev->vlan_features;
337
327
        vlandev->gso_max_size = dev->gso_max_size;
338
328
 
339
329
        if (dev->features & NETIF_F_HW_VLAN_TX)
344
334
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
345
335
        vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid;
346
336
#endif
347
 
        if (old_features != vlandev->features)
348
 
                netdev_features_change(vlandev);
 
337
 
 
338
        netdev_update_features(vlandev);
349
339
}
350
340
 
351
341
static void __vlan_device_event(struct net_device *dev, unsigned long event)
490
480
                if (dev->reg_state != NETREG_UNREGISTERING)
491
481
                        break;
492
482
 
493
 
                /* Delete all VLANs for this dev. */
494
 
                grp->killall = 1;
495
 
 
496
483
                for (i = 0; i < VLAN_N_VID; i++) {
497
484
                        vlandev = vlan_group_get_device(grp, i);
498
485
                        if (!vlandev)
511
498
        case NETDEV_PRE_TYPE_CHANGE:
512
499
                /* Forbid underlaying device to change its type. */
513
500
                return NOTIFY_BAD;
 
501
 
 
502
        case NETDEV_NOTIFY_PEERS:
 
503
        case NETDEV_BONDING_FAILOVER:
 
504
                /* Propagate to vlan devices */
 
505
                for (i = 0; i < VLAN_N_VID; i++) {
 
506
                        vlandev = vlan_group_get_device(grp, i);
 
507
                        if (!vlandev)
 
508
                                continue;
 
509
 
 
510
                        call_netdevice_notifiers(event, vlandev);
 
511
                }
 
512
                break;
514
513
        }
515
514
 
516
515
out:
672
671
{
673
672
        int err;
674
673
 
675
 
        pr_info("%s v%s %s\n", vlan_fullname, vlan_version, vlan_copyright);
676
 
        pr_info("All bugs added by %s\n", vlan_buggyright);
 
674
        pr_info("%s v%s\n", vlan_fullname, vlan_version);
677
675
 
678
676
        err = register_pernet_subsys(&vlan_net_ops);
679
677
        if (err < 0)
691
689
        if (err < 0)
692
690
                goto err4;
693
691
 
694
 
        dev_add_pack(&vlan_packet_type);
695
692
        vlan_ioctl_set(vlan_ioctl_handler);
696
693
        return 0;
697
694
 
712
709
 
713
710
        unregister_netdevice_notifier(&vlan_notifier_block);
714
711
 
715
 
        dev_remove_pack(&vlan_packet_type);
716
 
 
717
712
        unregister_pernet_subsys(&vlan_net_ops);
718
713
        rcu_barrier(); /* Wait for completion of call_rcu()'s */
719
714