linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dave <kilroyd@googlemail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC 5/5] cfg80211: scan before connect if we don't have the bss
Date: Wed, 19 Aug 2009 21:37:28 +0200	[thread overview]
Message-ID: <1250710648.8073.9.camel@johannes.local> (raw)
In-Reply-To: <4A8C52BD.5070609@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2732 bytes --]

On Wed, 2009-08-19 at 20:30 +0100, Dave wrote:

> > Hmm. What if the bssid isn't set? Then the card might select a different
> > BSS than the one we have on the scan list.
> 
> That's correct. For the Agere driver that's also true when bssid is set
> - we can't specify which AP the firmware connects to.

Ok. We may want a feature flag for the latter case so we know what's
going on, and reject a BSSID setting.

> >> +		} else {
> >> +			cfg80211_put_bss(bss);
> > 
> >>  		err = rdev->ops->connect(&rdev->wiphy, dev, connect);
> > 
> > And it's all racy too -- by the time the driver calls connect_result(),
> > the BSS might have expired after it was found here now.
> 
> Agreed, but with a 15s expiry period I wouldn't expect this to be a
> problem in practice.

Well, the user could scan, take 12 seconds to pick out the AP manually,
enter the paramters in another 2.5 seconds, and then it would already
happen, I think?

> > I don't think this is really feasible to implement in cfg80211.
> 
> cfg80211 seemed like the appropriate place because it avoids different
> (fullmac) drivers having to re-implement this.

True.

> > Couldn't
> > the driver do a probe to the BSS that the device selected, and report
> > that before the connect result?
> 
> Yes, that's possible. If we went this way it would make sense to encode
> this in the interface by changing the cfg80211_connect_result prototype to:
> 
> void cfg80211_connect_result(struct net_device *dev,
>                              const struct bss *bss,
> 			     const u8 *req_ie, size_t req_ie_len,
> 			     const u8 *resp_ie, size_t resp_ie_len,
> 			     u16 status, gfp_t gfp);
> 
> So on connecting:
> 
>  * the driver has to call cfg80211_get_bss() to get the bss pointer.
> 
>  * if it is not available, scan/probe to get the information, call
> cfg80211_inform_bss(), and then use the returned pointer in the
> cfg80211_connect_result call.
> 
> This means the driver may have to hold onto the IE info to use after the
> scan returns.

Indeed, that would work, although it seems somewhat pointless to pass
around the BSS pointer and require the driver to do the lookup, but it
nicely avoids any races that we have even now.

> Another alternative is for cfg80211_connect_result to trigger the scan
> if it doesn't have the bss, and only complete the connect when the scan
> returns. I think I like the sound of this best.

Good option too, though then it would be useful to pass the channel
pointer if available to scan only on that channel. Of course, if it
still can't be found things are really amiss and we should probably
disconnect and send a failed event to userspace.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2009-08-19 19:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19  0:04 [RFC v2 0/5] orinoco: use cfg80211 for key manipulation David Kilroy
2009-08-19  0:04 ` [RFC 1/5] orinoco: add cfg80211 connect and disconnect David Kilroy
2009-08-19  0:04 ` [RFC 2/5] orinoco: add cfg80211 join_ibss and leave_ibss David Kilroy
2009-08-19  0:04 ` [RFC 3/5] orinoco: implement cfg80211 key manipulation functions David Kilroy
2009-08-19  0:04 ` [RFC 4/5] orinoco: do WE via cfg80211 David Kilroy
2009-08-19  0:04 ` [RFC 5/5] cfg80211: scan before connect if we don't have the bss David Kilroy
2009-08-19  7:48   ` Johannes Berg
2009-08-19 19:30     ` Dave
2009-08-19 19:37       ` Johannes Berg [this message]
2009-08-20 18:01         ` Dave
2009-08-20  6:39       ` Jussi Kivilinna
2009-08-31 17:59 ` [RFC v2 0/5] orinoco: use cfg80211 for key manipulation John W. Linville
2009-09-12 23:54   ` Dave Kilroy
2009-10-23 19:05     ` Dave
2009-10-26 13:17       ` Only device wlan1 but no connection Fritz!WLAN USB stick N2.4 Ed Vaessen
2009-10-26 14:57         ` Luis R. Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1250710648.8073.9.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=kilroyd@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).