X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=net%2Fcore%2Fdev_mcast.c;h=5a54053386c83253430b3f18b764fe3cb89bef30;hb=5351fb106a84d6ac584c2501e3b335093d38a58c;hp=b22648d04d365f1ce92a9eecf370effd6d32b202;hpb=c730f5b621afa33e9f4939da9078669162ebff4e;p=powerpc.git diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index b22648d04d..5a54053386 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c @@ -1,12 +1,12 @@ /* - * Linux NET3: Multicast List maintenance. + * Linux NET3: Multicast List maintenance. * * Authors: - * Tim Kordas + * Tim Kordas * Richard Underwood * * Stir fried together from the IP multicast and CAP patches above - * Alan Cox + * Alan Cox * * Fixes: * Alan Cox : Update the device on a real delete @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -50,11 +49,11 @@ /* - * Device multicast list maintenance. + * Device multicast list maintenance. * - * This is used both by IP and by the user level maintenance functions. - * Unlike BSD we maintain a usage count on a given multicast address so - * that a casual user application can add/delete multicasts used by + * This is used both by IP and by the user level maintenance functions. + * Unlike BSD we maintain a usage count on a given multicast address so + * that a casual user application can add/delete multicasts used by * protocols without doing damage to the protocols when it deletes the * entries. It also helps IP as it tracks overlapping maps. * @@ -67,7 +66,7 @@ /* * Update the multicast list into the physical NIC controller. */ - + static void __dev_mc_upload(struct net_device *dev) { /* Don't do anything till we up the interface @@ -100,7 +99,7 @@ void dev_mc_upload(struct net_device *dev) /* * Delete a device level multicast */ - + int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl) { int err = 0; @@ -137,7 +136,7 @@ int dev_mc_delete(struct net_device *dev, void *addr, int alen, int glbl) * loaded filter is now wrong. Fix it */ __dev_mc_upload(dev); - + netif_tx_unlock_bh(dev); return 0; } @@ -151,7 +150,7 @@ done: /* * Add a device level multicast */ - + int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) { int err = 0; @@ -187,7 +186,7 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) dev->mc_count++; __dev_mc_upload(dev); - + netif_tx_unlock_bh(dev); return 0; @@ -204,7 +203,7 @@ done: void dev_mc_discard(struct net_device *dev) { netif_tx_lock_bh(dev); - + while (dev->mc_list != NULL) { struct dev_mc_list *tmp = dev->mc_list; dev->mc_list = tmp->next; @@ -224,8 +223,8 @@ static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) loff_t off = 0; read_lock(&dev_base_lock); - for (dev = dev_base; dev; dev = dev->next) { - if (off++ == *pos) + for_each_netdev(dev) { + if (off++ == *pos) return dev; } return NULL; @@ -233,9 +232,8 @@ static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { - struct net_device *dev = v; ++*pos; - return dev->next; + return next_net_device((struct net_device *)v); } static void dev_mc_seq_stop(struct seq_file *seq, void *v) @@ -265,7 +263,7 @@ static int dev_mc_seq_show(struct seq_file *seq, void *v) return 0; } -static struct seq_operations dev_mc_seq_ops = { +static const struct seq_operations dev_mc_seq_ops = { .start = dev_mc_seq_start, .next = dev_mc_seq_next, .stop = dev_mc_seq_stop, @@ -277,7 +275,7 @@ static int dev_mc_seq_open(struct inode *inode, struct file *file) return seq_open(file, &dev_mc_seq_ops); } -static struct file_operations dev_mc_seq_fops = { +static const struct file_operations dev_mc_seq_fops = { .owner = THIS_MODULE, .open = dev_mc_seq_open, .read = seq_read,