diff options
Diffstat (limited to 'net/irda/irlan')
-rw-r--r-- | net/irda/irlan/irlan_client.c | 1 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 29 | ||||
-rw-r--r-- | net/irda/irlan/irlan_eth.c | 5 | ||||
-rw-r--r-- | net/irda/irlan/irlan_provider.c | 1 |
4 files changed, 10 insertions, 26 deletions
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 42f7d960d055..7ed3af957935 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
33 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 315ead3cb926..a788f9e9427d 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
30 | #include <linux/gfp.h> | ||
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
32 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
@@ -1128,34 +1129,14 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) | |||
1128 | */ | 1129 | */ |
1129 | static void *irlan_seq_start(struct seq_file *seq, loff_t *pos) | 1130 | static void *irlan_seq_start(struct seq_file *seq, loff_t *pos) |
1130 | { | 1131 | { |
1131 | int i = 1; | ||
1132 | struct irlan_cb *self; | ||
1133 | |||
1134 | rcu_read_lock(); | 1132 | rcu_read_lock(); |
1135 | if (*pos == 0) | 1133 | return seq_list_start_head(&irlans, *pos); |
1136 | return SEQ_START_TOKEN; | ||
1137 | |||
1138 | list_for_each_entry(self, &irlans, dev_list) { | ||
1139 | if (*pos == i) | ||
1140 | return self; | ||
1141 | ++i; | ||
1142 | } | ||
1143 | return NULL; | ||
1144 | } | 1134 | } |
1145 | 1135 | ||
1146 | /* Return entry after v, and increment pos */ | 1136 | /* Return entry after v, and increment pos */ |
1147 | static void *irlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 1137 | static void *irlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
1148 | { | 1138 | { |
1149 | struct list_head *nxt; | 1139 | return seq_list_next(v, &irlans, pos); |
1150 | |||
1151 | ++*pos; | ||
1152 | if (v == SEQ_START_TOKEN) | ||
1153 | nxt = irlans.next; | ||
1154 | else | ||
1155 | nxt = ((struct irlan_cb *)v)->dev_list.next; | ||
1156 | |||
1157 | return (nxt == &irlans) ? NULL | ||
1158 | : list_entry(nxt, struct irlan_cb, dev_list); | ||
1159 | } | 1140 | } |
1160 | 1141 | ||
1161 | /* End of reading /proc file */ | 1142 | /* End of reading /proc file */ |
@@ -1170,10 +1151,10 @@ static void irlan_seq_stop(struct seq_file *seq, void *v) | |||
1170 | */ | 1151 | */ |
1171 | static int irlan_seq_show(struct seq_file *seq, void *v) | 1152 | static int irlan_seq_show(struct seq_file *seq, void *v) |
1172 | { | 1153 | { |
1173 | if (v == SEQ_START_TOKEN) | 1154 | if (v == &irlans) |
1174 | seq_puts(seq, "IrLAN instances:\n"); | 1155 | seq_puts(seq, "IrLAN instances:\n"); |
1175 | else { | 1156 | else { |
1176 | struct irlan_cb *self = v; | 1157 | struct irlan_cb *self = list_entry(v, struct irlan_cb, dev_list); |
1177 | 1158 | ||
1178 | IRDA_ASSERT(self != NULL, return -1;); | 1159 | IRDA_ASSERT(self != NULL, return -1;); |
1179 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 1160 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index d340110f5c0c..9616c32d1076 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -321,14 +321,15 @@ static void irlan_eth_set_multicast_list(struct net_device *dev) | |||
321 | /* Enable promiscuous mode */ | 321 | /* Enable promiscuous mode */ |
322 | IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); | 322 | IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); |
323 | } | 323 | } |
324 | else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) { | 324 | else if ((dev->flags & IFF_ALLMULTI) || |
325 | netdev_mc_count(dev) > HW_MAX_ADDRS) { | ||
325 | /* Disable promiscuous mode, use normal mode. */ | 326 | /* Disable promiscuous mode, use normal mode. */ |
326 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); | 327 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); |
327 | /* hardware_set_filter(NULL); */ | 328 | /* hardware_set_filter(NULL); */ |
328 | 329 | ||
329 | irlan_set_multicast_filter(self, TRUE); | 330 | irlan_set_multicast_filter(self, TRUE); |
330 | } | 331 | } |
331 | else if (dev->mc_count) { | 332 | else if (!netdev_mc_empty(dev)) { |
332 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); | 333 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); |
333 | /* Walk the address list, and load the filter */ | 334 | /* Walk the address list, and load the filter */ |
334 | /* hardware_set_filter(dev->mc_list); */ | 335 | /* hardware_set_filter(dev->mc_list); */ |
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 3f81f81b2dfa..5cf5e6c872bb 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/random.h> | 35 | #include <linux/random.h> |
36 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <asm/system.h> | 39 | #include <asm/system.h> |
39 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |