net: wireless: Add CFG80211_ALLOW_RECONNECT option
Dmitry Shmidt [Thu, 15 Sep 2011 16:22:35 +0000 (09:22 -0700)]
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

net/wireless/Kconfig
net/wireless/sme.c

index 1f1ef70..8e2a668 100644 (file)
@@ -159,3 +159,14 @@ config LIB80211_DEBUG
          from lib80211.
 
          If unsure, say N.
+
+config CFG80211_ALLOW_RECONNECT
+       bool "Allow reconnect while already connected"
+       depends on CFG80211
+       default n
+       help
+         cfg80211 stack doesn't allow to connect if you are already
+         connected. This option allows to make a connection in this case.
+
+         Select this option ONLY for wlan drivers that are specifically
+         built for such purposes.
index dec0fa2..a346241 100644 (file)
@@ -760,8 +760,10 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
 
        ASSERT_WDEV_LOCK(wdev);
 
+#ifndef CONFIG_CFG80211_ALLOW_RECONNECT
        if (wdev->sme_state != CFG80211_SME_IDLE)
                return -EALREADY;
+#endif
 
        if (WARN_ON(wdev->connect_keys)) {
                kfree(wdev->connect_keys);