mac80211: Disable requests for new scans in AP mode
authorJouni Malinen <j@w1.fi>
Wed, 10 Dec 2008 12:51:47 +0000 (14:51 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Dec 2008 19:02:12 +0000 (14:02 -0500)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
net/mac80211/wext.c

index 3f425f68b2caac4e5a4263d987771c250b3d6057..06e2682450772d45036ddf0c58f1ec5fc96b8c2d 100644 (file)
@@ -2960,12 +2960,6 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
                goto out_unlock;
        }
 
-       if (priv->iw_mode == NL80211_IFTYPE_AP) {       /* APs don't scan */
-               ret = -EIO;
-               IWL_ERROR("ERROR: APs don't scan\n");
-               goto out_unlock;
-       }
-
        /* We don't schedule scan within next_scan_jiffies period.
         * Avoid scanning during possible EAPOL exchange, return
         * success immediately.
index 953ce9d84ce89d6f515550d5a3b8ae276027af89..f88300683879d1ffd5fe23ff8feec6c8c7473f5e 100644 (file)
@@ -2103,11 +2103,6 @@ static void iwl3945_setup_rxon_timing(struct iwl3945_priv *priv)
 
 static int iwl3945_scan_initiate(struct iwl3945_priv *priv)
 {
-       if (priv->iw_mode == NL80211_IFTYPE_AP) {
-               IWL_ERROR("APs don't scan.\n");
-               return 0;
-       }
-
        if (!iwl3945_is_ready_rf(priv)) {
                IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
                return -EIO;
@@ -6976,12 +6971,6 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
                goto out_unlock;
        }
 
-       if (priv->iw_mode == NL80211_IFTYPE_AP) {       /* APs don't scan */
-               rc = -EIO;
-               IWL_ERROR("ERROR: APs don't scan\n");
-               goto out_unlock;
-       }
-
        /* we don't schedule scan within next_scan_jiffies period */
        if (priv->next_scan_jiffies &&
                        time_after(priv->next_scan_jiffies, jiffies)) {
index fbeb927c116bb61a559346af517d9d281af64fe1..15428048d01a516843dcf09b9a7a26bb969bd03e 100644 (file)
@@ -418,8 +418,7 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
 
        if (sdata->vif.type != NL80211_IFTYPE_STATION &&
            sdata->vif.type != NL80211_IFTYPE_ADHOC &&
-           sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
-           sdata->vif.type != NL80211_IFTYPE_AP)
+           sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
                return -EOPNOTSUPP;
 
        /* if SSID was specified explicitly then use that */