From patchwork Sat Sep 5 02:08:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 45915 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8528Xgd008627 for ; Sat, 5 Sep 2009 02:08:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934540AbZIECI2 (ORCPT ); Fri, 4 Sep 2009 22:08:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934538AbZIECI2 (ORCPT ); Fri, 4 Sep 2009 22:08:28 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:59928 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934532AbZIECI2 (ORCPT ); Fri, 4 Sep 2009 22:08:28 -0400 Received: by fg-out-1718.google.com with SMTP id 22so1227371fge.1 for ; Fri, 04 Sep 2009 19:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=XsxRbYendAzKTJ5r/ncvvSfDkM4svE0ak1pIXFb+T2M=; b=Nw5aA6eQFzZ7/fo0nOnicVK+R5MHhF4F1G/Hu/FF+d7BdX0CMcHA0JT7Z1EC9RAulU gNxOavkuBHbkU3KTa01PNFA9DjPd2T2D3BRXNkWorTP61/fZrEw29x0D2gktWz9tch/i oeD4S+IhCw4XwQCwuUow0ypatTY6n6sTcIl5w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=xiv2tmkGJeEka+qp4dGf5dxsuqmfVsNK1SfoMjnrlHloISNSVXkrOJ/bMA0NI6x8IW 3R/Bgq6elYy1GB1Ix+MlXwAIl0b3eYbcYiU9nZCa1qu9NyGwTWrWh4SFySG6nGvDmIYo 5bjcGa+ZR7d0mLap+rS06QAGsWUMVctjnj/tY= Received: by 10.86.228.16 with SMTP id a16mr5634346fgh.49.1252116509484; Fri, 04 Sep 2009 19:08:29 -0700 (PDT) Received: from ?10.1.0.2? ([77.125.73.168]) by mx.google.com with ESMTPS id e20sm2990745fga.10.2009.09.04.19.08.25 (version=SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 19:08:27 -0700 (PDT) Subject: Re: driver_nl80211 broken again From: Maxim Levitsky To: Johannes Berg Cc: linux-wireless In-Reply-To: <1251147515.20161.3.camel@johannes.local> References: <1251117161.22951.4.camel@maxim-laptop> <1251122885.12007.12.camel@johannes.local> <1251144381.9374.4.camel@maxim-laptop> <1251147515.20161.3.camel@johannes.local> Date: Sat, 05 Sep 2009 05:08:23 +0300 Message-Id: <1252116503.2398.26.camel@maxim-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 2009-08-24 at 22:58 +0200, Johannes Berg wrote: > On Mon, 2009-08-24 at 23:06 +0300, Maxim Levitsky wrote: > > > This is typical output of iwconfig, after failure > > (and I know that this output means trouble): > > Hmm, thanks for the info and especially the log. Unfortunately, I can't > reproduce this at all. > > Can you run wpa_supplicant with timing info (add -t to the command line) > and at the same time run "iw event -t" please? > > johannes I have finally got to the bottom of this, ad it doesn't look good. There are two bugs that overlap: 1 - when connecting again to the access point (same or another), wpa_supplicant does the following: deassoc auth assoc So it assumes that deassoc command disconnects completely, but it not longer true. Yet, I have tried to make its dissassoc function do both, but it failed. I used following patch: With this ugly hack, everything works just fine. ----------------------------------------------------------------------------------------------- 2 - independent of the above, the ieee80211_set_disassoc doesn't work right if deauth==false. If it is, then a work item is added to station work thread, and it is never removed: } else { struct ieee80211_mgd_work *wk = ifmgd->old_associate_work; wk->state = IEEE80211_MGD_STATE_IDLE; list_add(&wk->list, &ifmgd->work_list); } iee80211_sta_work just ignores the IEEE80211_MGD_STATE_IDLE, thus it work item remains forever. This breaks scanning, since __ieee80211_start_scan will refuses to run until, ifmgd->work_list is empty. Best regards, Maxim Levitsky --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index c68dd82..50afeeb 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1278,8 +1278,10 @@ void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s, if (!is_zero_ether_addr(wpa_s->bssid)) { if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) ieee80211_sta_disassociate(wpa_s, reason_code); - else + else { wpa_drv_disassociate(wpa_s, wpa_s->bssid, reason_code); + wpa_drv_deauthenticate(wpa_s, wpa_s->bssid, reason_code); + } addr = wpa_s->bssid; } wpa_clear_keys(wpa_s, addr); I got this. EAPOL: startWhen --> 0 EAPOL: disable timer tick wpa_driver_nl80211_disassociate wpa_driver_nl80211_deauthenticate nl80211: MLME command failed: ret=-67 (Link has been severed) However, this "hack", did the trick: diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 97a278a..60c4355 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2561,7 +2561,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, return -ENOLINK; } - ieee80211_set_disassoc(sdata, false); + ieee80211_set_disassoc(sdata, true); mutex_unlock(&ifmgd->mtx); diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 79d2eec..fec34a7 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c @@ -222,7 +222,7 @@ static void __cfg80211_send_disassoc(struct net_device *dev, for (i = 0; i < MAX_AUTH_BSSES; i++) { if (wdev->authtry_bsses[i] || wdev->auth_bsses[i]) continue; - wdev->auth_bsses[i] = wdev->current_bss; + /*wdev->auth_bsses[i] = wdev->current_bss;*/ wdev->current_bss = NULL; done = true; cfg80211_sme_disassoc(dev, i);