linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Commit 0711d638 breaks mwifiex
@ 2017-10-17  9:04 Jesse Sung
  2017-10-17  9:51 ` Johannes Berg
  0 siblings, 1 reply; 13+ messages in thread
From: Jesse Sung @ 2017-10-17  9:04 UTC (permalink / raw)
  To: Amitkumar Karwar, Nishant Sarmukadam, Ilan Peer
  Cc: Anthony Wong, Jason Yen, Terry.Wey, linux-wireless

Hi,

While working on an issue that marvell module stops connecting to AP,
bisect reveals that the issue starts to happen from commit 0711d638,
which uses wdev->ssid_len instead of wdev->current_bss to determine
if driver's .disconnect() should be called.

It happens because mwifiex_cfg80211_connect() returns -EALREADY
when it finds wdev->current_bss is valid:

if (priv->wdev.current_bss) {
    [PRINT LOG]
    return -EALREADY;
}

This would make cfg80211_connect() set wdev->ssid_len to 0, and thus
mwifiex_cfg80211_disconnect() won't be called by cfg80211_disconnect().

The easiest way to overcome this is

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 0a49b88..104edb4 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -1142,7 +1142,7 @@ int cfg80211_disconnect(struct
cfg80211_registered_device *rdev,
                err = cfg80211_sme_disconnect(wdev, reason);
        else if (!rdev->ops->disconnect)
                cfg80211_mlme_down(rdev, dev);
-       else if (wdev->ssid_len)
+       else if (wdev->ssid_len || wdev->current_bss)
                err = rdev_disconnect(rdev, dev, reason);

        return err;

but I'm not sure if this is a proper fix for this issue.

Thanks,
Jesse

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-10-28 21:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-17  9:04 Commit 0711d638 breaks mwifiex Jesse Sung
2017-10-17  9:51 ` Johannes Berg
2017-10-17 10:18   ` Jesse Sung
2017-10-17 10:48     ` Johannes Berg
2017-10-17 13:07       ` Jesse Sung
2017-10-17 13:13         ` Johannes Berg
2017-10-17 14:08           ` Jesse Sung
2017-10-17 14:10             ` Jesse Sung
2017-10-17 15:10               ` Johannes Berg
2017-10-17 15:25                 ` Jesse Sung
2017-10-26 21:13       ` Brian Norris
2017-10-27 20:10         ` Johannes Berg
2017-10-28 21:32           ` Arend van Spriel

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).