aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-12-10 07:51:47 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-12 14:02:12 -0500
commitb7a530d82cb36bb43901c196039b0fccee3ffcc3 (patch)
tree402f4b19586b969cf236eea951e4b4510403e0bc
parent14a4dfe2ff8c353f59ae8324059ded1cfe22c7d9 (diff)
mac80211: Disable requests for new scans in AP mode
AP mode operations are seriously affected if mac80211 runs through a multi-second scan while the AP is trying to send Beacon frames on the operation channel. While this could be implemented in a way that does not cause too many problems, it is not very simple and will require synchronization with Beacon frame scheduling in the drivers (scan one channel at a time between Beacon frames). Furthermore, such scanning takes quite a bit longer time and existing userspace applications would be likely to timeout while waiting for the results. For now, just refuse requests for new scans (SIOCSIWSCAN) when in AP mode. In practice, this moves the rejection from iwl* drivers into mac80211 to make it apply to every mac80211-based driver. This issue shows up in associated stations getting disconnected when something (e.g., Network Manager) requests a scan while the interface is in AP mode. When doing this continuously (e.g., NM does it every 120 seconds), the network gets close to useless. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c11
-rw-r--r--net/mac80211/wext.c3
3 files changed, 1 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 3f425f68b2ca..06e268245077 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2960,12 +2960,6 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
2960 goto out_unlock; 2960 goto out_unlock;
2961 } 2961 }
2962 2962
2963 if (priv->iw_mode == NL80211_IFTYPE_AP) { /* APs don't scan */
2964 ret = -EIO;
2965 IWL_ERROR("ERROR: APs don't scan\n");
2966 goto out_unlock;
2967 }
2968
2969 /* We don't schedule scan within next_scan_jiffies period. 2963 /* We don't schedule scan within next_scan_jiffies period.
2970 * Avoid scanning during possible EAPOL exchange, return 2964 * Avoid scanning during possible EAPOL exchange, return
2971 * success immediately. 2965 * success immediately.
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 953ce9d84ce8..f88300683879 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2103,11 +2103,6 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
2103 2103
2104static int iwl3945_scan_initiate(struct iwl3945_priv *priv) 2104static int iwl3945_scan_initiate(struct iwl3945_priv *priv)
2105{ 2105{
2106 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2107 IWL_ERROR("APs don't scan.\n");
2108 return 0;
2109 }
2110
2111 if (!iwl3945_is_ready_rf(priv)) { 2106 if (!iwl3945_is_ready_rf(priv)) {
2112 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 2107 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
2113 return -EIO; 2108 return -EIO;
@@ -6976,12 +6971,6 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
6976 goto out_unlock; 6971 goto out_unlock;
6977 } 6972 }
6978 6973
6979 if (priv->iw_mode == NL80211_IFTYPE_AP) { /* APs don't scan */
6980 rc = -EIO;
6981 IWL_ERROR("ERROR: APs don't scan\n");
6982 goto out_unlock;
6983 }
6984
6985 /* we don't schedule scan within next_scan_jiffies period */ 6974 /* we don't schedule scan within next_scan_jiffies period */
6986 if (priv->next_scan_jiffies && 6975 if (priv->next_scan_jiffies &&
6987 time_after(priv->next_scan_jiffies, jiffies)) { 6976 time_after(priv->next_scan_jiffies, jiffies)) {
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index fbeb927c116b..15428048d01a 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -418,8 +418,7 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
418 418
419 if (sdata->vif.type != NL80211_IFTYPE_STATION && 419 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
420 sdata->vif.type != NL80211_IFTYPE_ADHOC && 420 sdata->vif.type != NL80211_IFTYPE_ADHOC &&
421 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && 421 sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
422 sdata->vif.type != NL80211_IFTYPE_AP)
423 return -EOPNOTSUPP; 422 return -EOPNOTSUPP;
424 423
425 /* if SSID was specified explicitly then use that */ 424 /* if SSID was specified explicitly then use that */