Return-path: Received: from s3.sipsolutions.net ([144.76.43.152]:36789 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753747Ab3KKRBP (ORCPT ); Mon, 11 Nov 2013 12:01:15 -0500 Message-ID: <1384189271.14334.49.camel@jlt4.sipsolutions.net> (sfid-20131111_180123_077152_4ABE90F5) Subject: Re: [PATCH v2] mac80211: add assoc beacon timeout logic From: Johannes Berg To: Felipe Contreras Cc: linux-wireless Mailing List , netdev , "John W. Linville" , "David S. Miller" Date: Mon, 11 Nov 2013 18:01:11 +0100 In-Reply-To: (sfid-20131111_175658_138899_90A747C6) References: <1384119945-31213-1-git-send-email-felipe.contreras@gmail.com> <1384160932.14334.6.camel@jlt4.sipsolutions.net> <1384184624.14334.31.camel@jlt4.sipsolutions.net> <1384188067.14334.45.camel@jlt4.sipsolutions.net> (sfid-20131111_175658_138899_90A747C6) Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, 2013-11-11 at 10:56 -0600, Felipe Contreras wrote: > On Mon, Nov 11, 2013 at 10:53 AM, Felipe Contreras > wrote: > > On Mon, Nov 11, 2013 at 10:41 AM, Johannes Berg > > wrote: > >> On Mon, 2013-11-11 at 10:23 -0600, Felipe Contreras wrote: > > >>> > This isn't really true like I said above - the kernel can only drop the > >>> > association, if userspace *insists* then it will try again and again. > >>> > >>> But it's not doing this: > >>> > >>> ieee80211_destroy_assoc_data(sdata, false); > >>> cfg80211_assoc_timeout(sdata->dev, bss); > >>> > >>> Which is what causes the association to stop for me. > >>> > >>> So where exactly in the code is the association being "dropped"? > >> > >> This does get called in my setup. > > > > Yes, because your setup is receiving beacons. > > > > Check the code: > > > > if ((ifmgd->assoc_data->need_beacon && !ifmgd->have_beacon) || > > ieee80211_do_assoc(sdata)) { > > struct cfg80211_bss *bss = ifmgd->assoc_data->bss; > > > > ieee80211_destroy_assoc_data(sdata, false); > > cfg80211_assoc_timeout(sdata->dev, bss); > > } > > > > If there's no beacon, cfg80211_assoc_timeout() is not called. > > > > I'm sure if you don't call ieee80211_rx_mgmt_beacon() at all you will > > see the same behavior I see. > > My bad, actually the code that is not being called is: > > cfg80211_unlink_bss(local->hw.wiphy, assoc_data->bss); > > In ieee80211_do_assoc(). That's not really interesting though, it just deletes the scan entry. If it was deleted, then the supplicant would just scan again and probably retry the connection. johannes