Failed to connect an AP vai WPS on kernel >= 3.11

Jouni Malinen j
Fri Aug 28 02:38:02 PDT 2015

On Wed, Aug 26, 2015 at 02:26:01PM +0000, Vinayak Kamath wrote:
> In this scenario "locally_generated" flag will not be true as NL80211_ATTR_DISCONNECTED_BY_AP is present and hence supplicant thinks it as genuine disconnect from driver.
> wlan driver should  call "cfg80211_disconnected()"in any case  ie. driver calls cfg80211_disconnected() even if AP sends disassoc frame or  even in case disconnect process is initiated by wpa_supplicant.

Sure, but why would the driver indicate that the disconnection was not
locally_generated when handling a case that was initiated by

Is this specific version of the driver source code available somewhere
or can you at least note what are the exact arguments passed to
cfg80211_disconnected() in the case where disconnection happens due to a
request from wpa_supplicant? I'm particularly interested in what the
locally_generated parameter is in that case since that determines
whether NL80211_ATTR_DISCONNECTED_BY_AP is added..

> Otherwise there will be warning thrown by cfg80211 while unloading wlan driver.  Below is the kernel commit which enforce the wlan driver to do so.

Well.. That is just enforcing proper cleanup, but anyway, yes, the
driver should indicate disconnections regardless of whether this commit
is in place.

> I am attaching fail log to this mail. Please find the attachment.
> Line of interest given below:
> 08-26 11:11:05.211 W/wpa_supplicant( 1755): nl80211: Was expecting local disconnect but got another disconnect event first.

What happened after this? The log ends at that millisecond.. In any
case, there was a wpa_supplicant initiated disconnection request with
reason code 3 at 11:11:05.159, so I'm assuming this
NL80211_CMD_DISCONNECT event at 11:11:05.211 being based on that. If so,
it looks like the driver is reporting this incorrectly in the
cfg80211_disconnected() call unless there was a race condition and the
AP had sent out Deauthentication/Disassociation frame with reason code 3
and that frame happened to be processed prior to the local
NL80211_CMD_DISCONNECT command.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list