mac80211: allow configure_filter callback to sleep
Over time, a whole bunch of drivers have come up with their own scheme to delay the configure_filter operation to a workqueue. To be able to simplify things, allow configure_filter to sleep, and add a new prepare_multicast callback that drivers that need the multicast address list implement. This new callback must be atomic, but most drivers either don't care or just calculate a hash which can be done atomically and then uploaded to the hardware non-atomically. A cursory look suggests that at76c50x-usb, ar9170, mwl8k (which is actually very broken now), rt2x00, wl1251, wl1271 and zd1211 should make use of this new capability. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
ea416a793d
commit
3ac64beecd
@@ -728,10 +728,16 @@ static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,
|
||||
priv->rf->conf_erp(dev, info);
|
||||
}
|
||||
|
||||
static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
|
||||
struct dev_addr_list *mc_list)
|
||||
{
|
||||
return mc_count;
|
||||
}
|
||||
|
||||
static void rtl8180_configure_filter(struct ieee80211_hw *dev,
|
||||
unsigned int changed_flags,
|
||||
unsigned int *total_flags,
|
||||
int mc_count, struct dev_addr_list *mclist)
|
||||
u64 multicast)
|
||||
{
|
||||
struct rtl8180_priv *priv = dev->priv;
|
||||
|
||||
@@ -741,7 +747,7 @@ static void rtl8180_configure_filter(struct ieee80211_hw *dev,
|
||||
priv->rx_conf ^= RTL818X_RX_CONF_CTRL;
|
||||
if (changed_flags & FIF_OTHER_BSS)
|
||||
priv->rx_conf ^= RTL818X_RX_CONF_MONITOR;
|
||||
if (*total_flags & FIF_ALLMULTI || mc_count > 0)
|
||||
if (*total_flags & FIF_ALLMULTI || multicast > 0)
|
||||
priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
|
||||
else
|
||||
priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST;
|
||||
@@ -768,6 +774,7 @@ static const struct ieee80211_ops rtl8180_ops = {
|
||||
.remove_interface = rtl8180_remove_interface,
|
||||
.config = rtl8180_config,
|
||||
.bss_info_changed = rtl8180_bss_info_changed,
|
||||
.prepare_multicast = rtl8180_prepare_multicast,
|
||||
.configure_filter = rtl8180_configure_filter,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user