net: wireless: Add CFG80211_ALLOW_RECONNECT option
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 15 Sep 2011 16:22:35 +0000 (09:22 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:24:03 +0000 (12:24 -0800)
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 b7b6ff8..f8d266a 100644 (file)
@@ -758,8 +758,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);