public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Holger Schurig <hs4233@mail.mn-solutions.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: Questions about cfg80211's cfg80211_connect_params->crypto settings
Date: Mon, 26 Oct 2009 13:59:13 +0100	[thread overview]
Message-ID: <200910261359.13658.hs4233@mail.mn-solutions.de> (raw)
In-Reply-To: <1256559734.28230.23.camel@johannes.local>

> > inside .connect() if I check sme->crypto.cipher_suite for
> > 
> >   WLAN_CIPHER_SUITE_WEP40
> >   WLAN_CIPHER_SUITE_WEP104
> >   WLAN_CIPHER_SUITE_TKIP
> >   WLAN_CIPHER_SUITE_CCMP
> >   0  (meaning no encryption/WEP obfuscation)
> 
> But why would you look at that? It sounds like you want 
sme->privacy to
> know whether to select an AP that advertises privacy or not?

Libertas' firmware doesn't have a capability of to "select an AP
that advertises privacy". So in practice it's wpa_supplicant that 
selects this, because pure iw/cfg80211 can't select an AP for 
me.

My connect method does this:

lbs_cfg_connect:
    if (sme->bssid set)  {
        # I need a full cfg80211_bss entry, because I can only
        # associate to a specific bss via CMD_802_11_ASSOCIATE
	# and I need
	#   bss->capability
	#   bss->bssid
	#   bss->get_ie(WLAN_EID_SSID)
	#   bss->channel
	#   bss->rates
        bss = cfg80211_get_bss()
    } else {
        error_out
    }

    clear_local_wep_key_copy
    switch (sme->cryto.cipher_group) {
    case WEP40, WEP104:
        store_key_keyidx_locally
        set_wep_keys
        enable_wep_in_lbs_mac
        disable_rsn
        break;
    case no_encryption:
    case WPA, WPA2:
        remove_wep_keys
        disable_wep_in_lbs_mac
        clear_wpa_wpa2_unicast_multicast_key
        unless no_encryption:
           enable_rsn
    }
    build_and_submit_set_authtype_command_for_the_firmware
    build_and_submit_associate_command_for_the_firmware
        

You see, nowhere do I actually need sme->privacy, all info is in 
sme->crypto.cipher_group.


However, this current setup makes "iw abc connect SSID" 
non-working with libertas. It would work with libertas if I 
would use the .auth/.assoc API, because then net/wireless/sme.c 
would scan for me. But in the .connect API case, it doesn't do 
this.

But information I get in the .connect() call aren't sufficuent 
for the Libertas firmware interface, I need more data, which I 
can get from a cfg80211_bss entry.

One possiblity is that net/wireless/sme.c get's more general and 
does scan in the .connect() case, too.

Or I could substitute the "error_out" with a local scan, and then 
select the "best" AP from the bss list. I fear however that such 
a selection function might already be somewhere inside 
net/wireless/*.c, I'll need to search for that.

-- 
http://www.holgerschurig.de

  reply	other threads:[~2009-10-26 12:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26  8:47 Questions about cfg80211's cfg80211_connect_params->crypto settings Holger Schurig
2009-10-26  9:22 ` Johannes Berg
2009-10-26 12:11   ` Holger Schurig
2009-10-26 12:22     ` Johannes Berg
2009-10-26 12:59       ` Holger Schurig [this message]
2009-10-26 13:03         ` Johannes Berg
2009-10-26 19:57 ` Dan Williams

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=200910261359.13658.hs4233@mail.mn-solutions.de \
    --to=hs4233@mail.mn-solutions.de \
    --cc=johannes@sipsolutions.net \
    --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