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>
Esse commit está contido em:
@@ -1266,11 +1266,11 @@ struct wl1271_filter_params {
|
||||
u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
|
||||
};
|
||||
|
||||
static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
|
||||
struct dev_addr_list *mc_list)
|
||||
static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
|
||||
struct netdev_hw_addr_list *mc_list)
|
||||
{
|
||||
struct wl1271_filter_params *fp;
|
||||
int i;
|
||||
struct netdev_hw_addr *ha;
|
||||
|
||||
fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
|
||||
if (!fp) {
|
||||
@@ -1279,21 +1279,16 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
|
||||
}
|
||||
|
||||
/* update multicast filtering parameters */
|
||||
fp->enabled = true;
|
||||
if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
|
||||
mc_count = 0;
|
||||
fp->enabled = false;
|
||||
}
|
||||
|
||||
fp->mc_list_length = 0;
|
||||
for (i = 0; i < mc_count; i++) {
|
||||
if (mc_list->da_addrlen == ETH_ALEN) {
|
||||
if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
|
||||
fp->enabled = false;
|
||||
} else {
|
||||
fp->enabled = true;
|
||||
netdev_hw_addr_list_for_each(ha, mc_list) {
|
||||
memcpy(fp->mc_list[fp->mc_list_length],
|
||||
mc_list->da_addr, ETH_ALEN);
|
||||
ha->addr, ETH_ALEN);
|
||||
fp->mc_list_length++;
|
||||
} else
|
||||
wl1271_warning("Unknown mc address length.");
|
||||
mc_list = mc_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
return (u64)(unsigned long)fp;
|
||||
|
Referência em uma nova issue
Block a user