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>
Этот коммит содержится в:

коммит произвёл
David S. Miller

родитель
a748ee2426
Коммит
22bedad3ce
@@ -557,16 +557,14 @@ static void asix_set_multicast(struct net_device *net)
|
||||
* for our 8 byte filter buffer
|
||||
* to avoid allocating memory that
|
||||
* is tricky to free later */
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
u32 crc_bits;
|
||||
|
||||
memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
|
||||
|
||||
/* Build the multicast hash filter. */
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
crc_bits =
|
||||
ether_crc(ETH_ALEN,
|
||||
mc_list->dmi_addr) >> 26;
|
||||
netdev_for_each_mc_addr(ha, net) {
|
||||
crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
||||
data->multi_filter[crc_bits >> 3] |=
|
||||
1 << (crc_bits & 7);
|
||||
}
|
||||
@@ -793,16 +791,14 @@ static void ax88172_set_multicast(struct net_device *net)
|
||||
* for our 8 byte filter buffer
|
||||
* to avoid allocating memory that
|
||||
* is tricky to free later */
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
u32 crc_bits;
|
||||
|
||||
memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
|
||||
|
||||
/* Build the multicast hash filter. */
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
crc_bits =
|
||||
ether_crc(ETH_ALEN,
|
||||
mc_list->dmi_addr) >> 26;
|
||||
netdev_for_each_mc_addr(ha, net) {
|
||||
crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
||||
data->multi_filter[crc_bits >> 3] |=
|
||||
1 << (crc_bits & 7);
|
||||
}
|
||||
|
@@ -629,7 +629,7 @@ static void catc_multicast(unsigned char *addr, u8 *multicast)
|
||||
static void catc_set_multicast_list(struct net_device *netdev)
|
||||
{
|
||||
struct catc *catc = netdev_priv(netdev);
|
||||
struct dev_mc_list *mc;
|
||||
struct netdev_hw_addr *ha;
|
||||
u8 broadcast[6];
|
||||
u8 rx = RxEnable | RxPolarity | RxMultiCast;
|
||||
|
||||
@@ -647,8 +647,8 @@ static void catc_set_multicast_list(struct net_device *netdev)
|
||||
if (netdev->flags & IFF_ALLMULTI) {
|
||||
memset(catc->multicast, 0xff, 64);
|
||||
} else {
|
||||
netdev_for_each_mc_addr(mc, netdev) {
|
||||
u32 crc = ether_crc_le(6, mc->dmi_addr);
|
||||
netdev_for_each_mc_addr(ha, netdev) {
|
||||
u32 crc = ether_crc_le(6, ha->addr);
|
||||
if (!catc->is_f5u011) {
|
||||
catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
|
||||
} else {
|
||||
|
@@ -386,10 +386,10 @@ static void dm9601_set_multicast(struct net_device *net)
|
||||
netdev_mc_count(net) > DM_MAX_MCAST) {
|
||||
rx_ctl |= 0x04;
|
||||
} else if (!netdev_mc_empty(net)) {
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26;
|
||||
netdev_for_each_mc_addr(ha, net) {
|
||||
u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
||||
hashes[crc >> 3] |= 1 << (crc & 0x7);
|
||||
}
|
||||
}
|
||||
|
@@ -452,12 +452,12 @@ static void mcs7830_data_set_multicast(struct net_device *net)
|
||||
* for our 8 byte filter buffer
|
||||
* to avoid allocating memory that
|
||||
* is tricky to free later */
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
u32 crc_bits;
|
||||
|
||||
/* Build the multicast hash filter. */
|
||||
netdev_for_each_mc_addr(mc_list, net) {
|
||||
crc_bits = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26;
|
||||
netdev_for_each_mc_addr(ha, net) {
|
||||
crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
||||
data->multi_filter[crc_bits >> 3] |= 1 << (crc_bits & 7);
|
||||
}
|
||||
}
|
||||
|
@@ -444,14 +444,14 @@ static void smsc75xx_set_multicast(struct net_device *netdev)
|
||||
netif_dbg(dev, drv, dev->net, "receive all multicast enabled");
|
||||
pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF;
|
||||
} else if (!netdev_mc_empty(dev->net)) {
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
netif_dbg(dev, drv, dev->net, "receive multicast hash filter");
|
||||
|
||||
pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF;
|
||||
|
||||
netdev_for_each_mc_addr(mc_list, netdev) {
|
||||
u32 bitnum = smsc75xx_hash(mc_list->dmi_addr);
|
||||
netdev_for_each_mc_addr(ha, netdev) {
|
||||
u32 bitnum = smsc75xx_hash(ha->addr);
|
||||
pdata->multicast_hash_table[bitnum / 32] |=
|
||||
(1 << (bitnum % 32));
|
||||
}
|
||||
|
@@ -384,13 +384,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
|
||||
pdata->mac_cr |= MAC_CR_MCPAS_;
|
||||
pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_HPFILT_);
|
||||
} else if (!netdev_mc_empty(dev->net)) {
|
||||
struct dev_mc_list *mc_list;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
pdata->mac_cr |= MAC_CR_HPFILT_;
|
||||
pdata->mac_cr &= ~(MAC_CR_PRMS_ | MAC_CR_MCPAS_);
|
||||
|
||||
netdev_for_each_mc_addr(mc_list, netdev) {
|
||||
u32 bitnum = smsc95xx_hash(mc_list->dmi_addr);
|
||||
netdev_for_each_mc_addr(ha, netdev) {
|
||||
u32 bitnum = smsc95xx_hash(ha->addr);
|
||||
u32 mask = 0x01 << (bitnum & 0x1F);
|
||||
if (bitnum & 0x20)
|
||||
hash_hi |= mask;
|
||||
|
Ссылка в новой задаче
Block a user