net: convert multicast list to list_head
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a748ee2426
commit
22bedad3ce
@@ -383,12 +383,12 @@ static void am79c961_setmulticastlist (struct net_device *dev)
|
||||
} else if (dev->flags & IFF_ALLMULTI) {
|
||||
memset(multi_hash, 0xff, sizeof(multi_hash));
|
||||
} else {
|
||||
struct dev_mc_list *dmi;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
memset(multi_hash, 0x00, sizeof(multi_hash));
|
||||
|
||||
netdev_for_each_mc_addr(dmi, dev)
|
||||
am79c961_mc_hash(dmi->dmi_addr, multi_hash);
|
||||
netdev_for_each_mc_addr(ha, dev)
|
||||
am79c961_mc_hash(ha->addr, multi_hash);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&priv->chip_lock, flags);
|
||||
|
@@ -556,14 +556,14 @@ static int hash_get_index(__u8 *addr)
|
||||
*/
|
||||
static void at91ether_sethashtable(struct net_device *dev)
|
||||
{
|
||||
struct dev_mc_list *curr;
|
||||
struct netdev_hw_addr *ha;
|
||||
unsigned long mc_filter[2];
|
||||
unsigned int bitnr;
|
||||
|
||||
mc_filter[0] = mc_filter[1] = 0;
|
||||
|
||||
netdev_for_each_mc_addr(curr, dev) {
|
||||
bitnr = hash_get_index(curr->dmi_addr);
|
||||
netdev_for_each_mc_addr(ha, dev) {
|
||||
bitnr = hash_get_index(ha->addr);
|
||||
mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
|
||||
}
|
||||
|
||||
|
@@ -735,7 +735,7 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
static void eth_set_mcast_list(struct net_device *dev)
|
||||
{
|
||||
struct port *port = netdev_priv(dev);
|
||||
struct dev_mc_list *mclist;
|
||||
struct netdev_hw_addr *ha;
|
||||
u8 diffs[ETH_ALEN], *addr;
|
||||
int i;
|
||||
|
||||
@@ -748,11 +748,11 @@ static void eth_set_mcast_list(struct net_device *dev)
|
||||
memset(diffs, 0, ETH_ALEN);
|
||||
|
||||
addr = NULL;
|
||||
netdev_for_each_mc_addr(mclist, dev) {
|
||||
netdev_for_each_mc_addr(ha, dev) {
|
||||
if (!addr)
|
||||
addr = mclist->dmi_addr; /* first MAC address */
|
||||
addr = ha->addr; /* first MAC address */
|
||||
for (i = 0; i < ETH_ALEN; i++)
|
||||
diffs[i] |= addr[i] ^ mclist->dmi_addr[i];
|
||||
diffs[i] |= addr[i] ^ ha->addr[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
|
@@ -331,16 +331,16 @@ ks8695_init_partial_multicast(struct ks8695_priv *ksp,
|
||||
{
|
||||
u32 low, high;
|
||||
int i;
|
||||
struct dev_mc_list *dmi;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
i = 0;
|
||||
netdev_for_each_mc_addr(dmi, ndev) {
|
||||
netdev_for_each_mc_addr(ha, ndev) {
|
||||
/* Ran out of space in chip? */
|
||||
BUG_ON(i == KS8695_NR_ADDRESSES);
|
||||
|
||||
low = (dmi->dmi_addr[2] << 24) | (dmi->dmi_addr[3] << 16) |
|
||||
(dmi->dmi_addr[4] << 8) | (dmi->dmi_addr[5]);
|
||||
high = (dmi->dmi_addr[0] << 8) | (dmi->dmi_addr[1]);
|
||||
low = (ha->addr[2] << 24) | (ha->addr[3] << 16) |
|
||||
(ha->addr[4] << 8) | (ha->addr[5]);
|
||||
high = (ha->addr[0] << 8) | (ha->addr[1]);
|
||||
|
||||
ks8695_writereg(ksp, KS8695_AAL_(i), low);
|
||||
ks8695_writereg(ksp, KS8695_AAH_(i), AAH_E | high);
|
||||
|
Reference in New Issue
Block a user