Commit 6683ece3 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: use helpers to access mc list V2

This patch introduces the similar helpers as those already done for uc list.
However multicast lists are no list_head lists but "mademanually". The three
macros added by this patch will make the transition of mc_list to list_head
smooth in two steps:

1) convert all drivers to use these macros (with the original iterator of type
   "struct dev_mc_list")
2) once all drivers are converted, convert list type and iterators to "struct
   netdev_hw_addr" in one patch.

>From now on, drivers can (and should) use "netdev_for_each_mc_addr" to iterate
over the addresses with iterator of type "struct netdev_hw_addr". Also macros
"netdev_mc_count" and "netdev_mc_empty" to read list's length. This is the state
which should be reached in all drivers.
Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b924032
...@@ -268,6 +268,12 @@ struct netdev_hw_addr_list { ...@@ -268,6 +268,12 @@ struct netdev_hw_addr_list {
#define netdev_for_each_uc_addr(ha, dev) \ #define netdev_for_each_uc_addr(ha, dev) \
list_for_each_entry(ha, &dev->uc.list, list) list_for_each_entry(ha, &dev->uc.list, list)
#define netdev_mc_count(dev) ((dev)->mc_count)
#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
#define netdev_for_each_mc_addr(mclist, dev) \
for (mclist = dev->mc_list; mclist; mclist = mclist->next)
struct hh_cache { struct hh_cache {
struct hh_cache *hh_next; /* Next entry */ struct hh_cache *hh_next; /* Next entry */
atomic_t hh_refcnt; /* number of users */ atomic_t hh_refcnt; /* number of users */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment