diff options
author | stephen hemminger <shemming@brocade.com> | 2013-12-13 15:35:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-17 15:14:04 -0500 |
commit | 477bb93320cec7ae74d5ccfad4f2bfa0b28fbe90 (patch) | |
tree | c9aad9574baba6c3988d496f766ed743ea32a5cf /net/core | |
parent | 6ea09d8a096487b6418364c3b501c228f1889121 (diff) |
net: remove dead code for add/del multiple
These function to manipulate multiple addresses are not used anywhere
in current net-next tree. Some out of tree code maybe using these but
too bad; they should submit their code upstream..
Also, make __hw_addr_flush local since only used by dev_addr_lists.c
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev_addr_lists.c | 97 |
1 files changed, 1 insertions, 96 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c index ec40a849fc42..bb504a919e33 100644 --- a/net/core/dev_addr_lists.c +++ b/net/core/dev_addr_lists.c | |||
@@ -186,47 +186,6 @@ static int __hw_addr_sync_multiple(struct netdev_hw_addr_list *to_list, | |||
186 | return err; | 186 | return err; |
187 | } | 187 | } |
188 | 188 | ||
189 | int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list, | ||
190 | struct netdev_hw_addr_list *from_list, | ||
191 | int addr_len, unsigned char addr_type) | ||
192 | { | ||
193 | int err; | ||
194 | struct netdev_hw_addr *ha, *ha2; | ||
195 | unsigned char type; | ||
196 | |||
197 | list_for_each_entry(ha, &from_list->list, list) { | ||
198 | type = addr_type ? addr_type : ha->type; | ||
199 | err = __hw_addr_add(to_list, ha->addr, addr_len, type); | ||
200 | if (err) | ||
201 | goto unroll; | ||
202 | } | ||
203 | return 0; | ||
204 | |||
205 | unroll: | ||
206 | list_for_each_entry(ha2, &from_list->list, list) { | ||
207 | if (ha2 == ha) | ||
208 | break; | ||
209 | type = addr_type ? addr_type : ha2->type; | ||
210 | __hw_addr_del(to_list, ha2->addr, addr_len, type); | ||
211 | } | ||
212 | return err; | ||
213 | } | ||
214 | EXPORT_SYMBOL(__hw_addr_add_multiple); | ||
215 | |||
216 | void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list, | ||
217 | struct netdev_hw_addr_list *from_list, | ||
218 | int addr_len, unsigned char addr_type) | ||
219 | { | ||
220 | struct netdev_hw_addr *ha; | ||
221 | unsigned char type; | ||
222 | |||
223 | list_for_each_entry(ha, &from_list->list, list) { | ||
224 | type = addr_type ? addr_type : ha->type; | ||
225 | __hw_addr_del(to_list, ha->addr, addr_len, type); | ||
226 | } | ||
227 | } | ||
228 | EXPORT_SYMBOL(__hw_addr_del_multiple); | ||
229 | |||
230 | /* This function only works where there is a strict 1-1 relationship | 189 | /* This function only works where there is a strict 1-1 relationship |
231 | * between source and destionation of they synch. If you ever need to | 190 | * between source and destionation of they synch. If you ever need to |
232 | * sync addresses to more then 1 destination, you need to use | 191 | * sync addresses to more then 1 destination, you need to use |
@@ -264,7 +223,7 @@ void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, | |||
264 | } | 223 | } |
265 | EXPORT_SYMBOL(__hw_addr_unsync); | 224 | EXPORT_SYMBOL(__hw_addr_unsync); |
266 | 225 | ||
267 | void __hw_addr_flush(struct netdev_hw_addr_list *list) | 226 | static void __hw_addr_flush(struct netdev_hw_addr_list *list) |
268 | { | 227 | { |
269 | struct netdev_hw_addr *ha, *tmp; | 228 | struct netdev_hw_addr *ha, *tmp; |
270 | 229 | ||
@@ -274,7 +233,6 @@ void __hw_addr_flush(struct netdev_hw_addr_list *list) | |||
274 | } | 233 | } |
275 | list->count = 0; | 234 | list->count = 0; |
276 | } | 235 | } |
277 | EXPORT_SYMBOL(__hw_addr_flush); | ||
278 | 236 | ||
279 | void __hw_addr_init(struct netdev_hw_addr_list *list) | 237 | void __hw_addr_init(struct netdev_hw_addr_list *list) |
280 | { | 238 | { |
@@ -400,59 +358,6 @@ int dev_addr_del(struct net_device *dev, const unsigned char *addr, | |||
400 | } | 358 | } |
401 | EXPORT_SYMBOL(dev_addr_del); | 359 | EXPORT_SYMBOL(dev_addr_del); |
402 | 360 | ||
403 | /** | ||
404 | * dev_addr_add_multiple - Add device addresses from another device | ||
405 | * @to_dev: device to which addresses will be added | ||
406 | * @from_dev: device from which addresses will be added | ||
407 | * @addr_type: address type - 0 means type will be used from from_dev | ||
408 | * | ||
409 | * Add device addresses of the one device to another. | ||
410 | ** | ||
411 | * The caller must hold the rtnl_mutex. | ||
412 | */ | ||
413 | int dev_addr_add_multiple(struct net_device *to_dev, | ||
414 | struct net_device *from_dev, | ||
415 | unsigned char addr_type) | ||
416 | { | ||
417 | int err; | ||
418 | |||
419 | ASSERT_RTNL(); | ||
420 | |||
421 | if (from_dev->addr_len != to_dev->addr_len) | ||
422 | return -EINVAL; | ||
423 | err = __hw_addr_add_multiple(&to_dev->dev_addrs, &from_dev->dev_addrs, | ||
424 | to_dev->addr_len, addr_type); | ||
425 | if (!err) | ||
426 | call_netdevice_notifiers(NETDEV_CHANGEADDR, to_dev); | ||
427 | return err; | ||
428 | } | ||
429 | EXPORT_SYMBOL(dev_addr_add_multiple); | ||
430 | |||
431 | /** | ||
432 | * dev_addr_del_multiple - Delete device addresses by another device | ||
433 | * @to_dev: device where the addresses will be deleted | ||
434 | * @from_dev: device supplying the addresses to be deleted | ||
435 | * @addr_type: address type - 0 means type will be used from from_dev | ||
436 | * | ||
437 | * Deletes addresses in to device by the list of addresses in from device. | ||
438 | * | ||
439 | * The caller must hold the rtnl_mutex. | ||
440 | */ | ||
441 | int dev_addr_del_multiple(struct net_device *to_dev, | ||
442 | struct net_device *from_dev, | ||
443 | unsigned char addr_type) | ||
444 | { | ||
445 | ASSERT_RTNL(); | ||
446 | |||
447 | if (from_dev->addr_len != to_dev->addr_len) | ||
448 | return -EINVAL; | ||
449 | __hw_addr_del_multiple(&to_dev->dev_addrs, &from_dev->dev_addrs, | ||
450 | to_dev->addr_len, addr_type); | ||
451 | call_netdevice_notifiers(NETDEV_CHANGEADDR, to_dev); | ||
452 | return 0; | ||
453 | } | ||
454 | EXPORT_SYMBOL(dev_addr_del_multiple); | ||
455 | |||
456 | /* | 361 | /* |
457 | * Unicast list handling functions | 362 | * Unicast list handling functions |
458 | */ | 363 | */ |