* [PATCH 3.10] cfg80211: fix interface down/disconnect state handling
@ 2013-05-14 7:36 Johannes Berg
2013-05-22 17:31 ` Ben Greear
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2013-05-14 7:36 UTC (permalink / raw)
To: linux-wireless; +Cc: greearb, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
When the interface goes down, there's no need to call
cfg80211_mlme_down() after __cfg80211_disconnect() as
the latter will call the former (if appropriate.)
Also, in __cfg80211_disconnect(), if the cfg80211 SME
isn't used, __cfg80211_disconnected() may still need
to be called (depending on the current state) so that
the SME state gets cleared.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/core.c | 1 -
net/wireless/sme.c | 3 ++-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 6c9f800..73405e0 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -870,7 +870,6 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
#endif
__cfg80211_disconnect(rdev, dev,
WLAN_REASON_DEAUTH_LEAVING, true);
- cfg80211_mlme_down(rdev, dev);
wdev_unlock(wdev);
break;
case NL80211_IFTYPE_MESH_POINT:
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index a9dc5c7..8b5eddf 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -961,7 +961,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
/* was it connected by userspace SME? */
if (!wdev->conn) {
cfg80211_mlme_down(rdev, dev);
- return 0;
+ goto disconnect;
}
if (wdev->sme_state == CFG80211_SME_CONNECTING &&
@@ -987,6 +987,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
return err;
}
+ disconnect:
if (wdev->sme_state == CFG80211_SME_CONNECTED)
__cfg80211_disconnected(dev, NULL, 0, 0, false);
else if (wdev->sme_state == CFG80211_SME_CONNECTING)
--
1.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 3.10] cfg80211: fix interface down/disconnect state handling
2013-05-14 7:36 [PATCH 3.10] cfg80211: fix interface down/disconnect state handling Johannes Berg
@ 2013-05-22 17:31 ` Ben Greear
2013-05-22 18:15 ` Ben Greear
0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2013-05-22 17:31 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Johannes Berg
On 05/14/2013 12:36 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> When the interface goes down, there's no need to call
> cfg80211_mlme_down() after __cfg80211_disconnect() as
> the latter will call the former (if appropriate.)
>
> Also, in __cfg80211_disconnect(), if the cfg80211 SME
> isn't used, __cfg80211_disconnected() may still need
> to be called (depending on the current state) so that
> the SME state gets cleared.
3.9.3 with this patch (and others) was running well until I
tweaked user-space to drive a bit harder/differently and removed the
noisy printk from my sme state debugging patches.
Now, it appears the problem is back..though of course I
don't have useful debugging as to why :P
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3.10] cfg80211: fix interface down/disconnect state handling
2013-05-22 17:31 ` Ben Greear
@ 2013-05-22 18:15 ` Ben Greear
0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2013-05-22 18:15 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Johannes Berg
On 05/22/2013 10:31 AM, Ben Greear wrote:
> On 05/14/2013 12:36 AM, Johannes Berg wrote:
>> From: Johannes Berg <johannes.berg@intel.com>
>>
>> When the interface goes down, there's no need to call
>> cfg80211_mlme_down() after __cfg80211_disconnect() as
>> the latter will call the former (if appropriate.)
>>
>> Also, in __cfg80211_disconnect(), if the cfg80211 SME
>> isn't used, __cfg80211_disconnected() may still need
>> to be called (depending on the current state) so that
>> the SME state gets cleared.
>
> 3.9.3 with this patch (and others) was running well until I
> tweaked user-space to drive a bit harder/differently and removed the
> noisy printk from my sme state debugging patches.
>
> Now, it appears the problem is back..though of course I
> don't have useful debugging as to why :P
Err, maybe it's something elsewhere in my logic.
Kernel debugging seems to show proper activity so far...
Ben
>
> Ben
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-22 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 7:36 [PATCH 3.10] cfg80211: fix interface down/disconnect state handling Johannes Berg
2013-05-22 17:31 ` Ben Greear
2013-05-22 18:15 ` Ben Greear
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).