From b6a4d75f2a32e5aa5c0be999ffd1c9fd35091b70 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Thu, 15 Sep 2011 09:22:35 -0700 Subject: [PATCH] net: wireless: Add CFG80211_ALLOW_RECONNECT option Signed-off-by: Dmitry Shmidt --- net/wireless/Kconfig | 11 +++++++++++ net/wireless/sme.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index 16d08b399210..4c602d100480 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig @@ -166,3 +166,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. diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 3ed35c345cae..c260e39ea055 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -785,8 +785,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); -- 2.34.1