aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-17 10:16:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:35:58 -0400
commit3ac64beecd27400d12cc7afb4108eef26c499f6a (patch)
treeda0220085f68e30fe61ba9b8833dc6311d6dc25e /drivers/net/wireless/rtl818x
parentea416a793d2b611f22b42ba094fd2e5bd30fff43 (diff)
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>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_dev.c11
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c11
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index 09f46abc730a..16429c49139c 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -728,10 +728,16 @@ static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,
728 priv->rf->conf_erp(dev, info); 728 priv->rf->conf_erp(dev, info);
729} 729}
730 730
731static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
732 struct dev_addr_list *mc_list)
733{
734 return mc_count;
735}
736
731static void rtl8180_configure_filter(struct ieee80211_hw *dev, 737static void rtl8180_configure_filter(struct ieee80211_hw *dev,
732 unsigned int changed_flags, 738 unsigned int changed_flags,
733 unsigned int *total_flags, 739 unsigned int *total_flags,
734 int mc_count, struct dev_addr_list *mclist) 740 u64 multicast)
735{ 741{
736 struct rtl8180_priv *priv = dev->priv; 742 struct rtl8180_priv *priv = dev->priv;
737 743
@@ -741,7 +747,7 @@ static void rtl8180_configure_filter(struct ieee80211_hw *dev,
741 priv->rx_conf ^= RTL818X_RX_CONF_CTRL; 747 priv->rx_conf ^= RTL818X_RX_CONF_CTRL;
742 if (changed_flags & FIF_OTHER_BSS) 748 if (changed_flags & FIF_OTHER_BSS)
743 priv->rx_conf ^= RTL818X_RX_CONF_MONITOR; 749 priv->rx_conf ^= RTL818X_RX_CONF_MONITOR;
744 if (*total_flags & FIF_ALLMULTI || mc_count > 0) 750 if (*total_flags & FIF_ALLMULTI || multicast > 0)
745 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST; 751 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
746 else 752 else
747 priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST; 753 priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST;
@@ -768,6 +774,7 @@ static const struct ieee80211_ops rtl8180_ops = {
768 .remove_interface = rtl8180_remove_interface, 774 .remove_interface = rtl8180_remove_interface,
769 .config = rtl8180_config, 775 .config = rtl8180_config,
770 .bss_info_changed = rtl8180_bss_info_changed, 776 .bss_info_changed = rtl8180_bss_info_changed,
777 .prepare_multicast = rtl8180_prepare_multicast,
771 .configure_filter = rtl8180_configure_filter, 778 .configure_filter = rtl8180_configure_filter,
772}; 779};
773 780
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 53f57dc52226..90f38357393c 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1192,10 +1192,16 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
1192 info->use_short_preamble); 1192 info->use_short_preamble);
1193} 1193}
1194 1194
1195static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
1196 int mc_count, struct dev_addr_list *mc_list)
1197{
1198 return mc_count;
1199}
1200
1195static void rtl8187_configure_filter(struct ieee80211_hw *dev, 1201static void rtl8187_configure_filter(struct ieee80211_hw *dev,
1196 unsigned int changed_flags, 1202 unsigned int changed_flags,
1197 unsigned int *total_flags, 1203 unsigned int *total_flags,
1198 int mc_count, struct dev_addr_list *mclist) 1204 u64 multicast)
1199{ 1205{
1200 struct rtl8187_priv *priv = dev->priv; 1206 struct rtl8187_priv *priv = dev->priv;
1201 1207
@@ -1205,7 +1211,7 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
1205 priv->rx_conf ^= RTL818X_RX_CONF_CTRL; 1211 priv->rx_conf ^= RTL818X_RX_CONF_CTRL;
1206 if (changed_flags & FIF_OTHER_BSS) 1212 if (changed_flags & FIF_OTHER_BSS)
1207 priv->rx_conf ^= RTL818X_RX_CONF_MONITOR; 1213 priv->rx_conf ^= RTL818X_RX_CONF_MONITOR;
1208 if (*total_flags & FIF_ALLMULTI || mc_count > 0) 1214 if (*total_flags & FIF_ALLMULTI || multicast > 0)
1209 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST; 1215 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
1210 else 1216 else
1211 priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST; 1217 priv->rx_conf &= ~RTL818X_RX_CONF_MULTICAST;
@@ -1268,6 +1274,7 @@ static const struct ieee80211_ops rtl8187_ops = {
1268 .remove_interface = rtl8187_remove_interface, 1274 .remove_interface = rtl8187_remove_interface,
1269 .config = rtl8187_config, 1275 .config = rtl8187_config,
1270 .bss_info_changed = rtl8187_bss_info_changed, 1276 .bss_info_changed = rtl8187_bss_info_changed,
1277 .prepare_multicast = rtl8187_prepare_multicast,
1271 .configure_filter = rtl8187_configure_filter, 1278 .configure_filter = rtl8187_configure_filter,
1272 .conf_tx = rtl8187_conf_tx 1279 .conf_tx = rtl8187_conf_tx
1273}; 1280};