linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Ivo van Doorn <ivdoorn@gmail.com>, Chr <chunkeey@web.de>,
	Tomas Winkler <tomasw@gmail.com>,
	"Luis R. Rodriguez" <mcgrof@gmail.com>,
	Nick Kossifidis <mickflemm@gmail.com>,
	Bob Copeland <me@bobcopeland.com>,
	Sujith Manoharan <Sujith.Manoharan@atheros.com>,
	Kalle Valo <kalle.valo@nokia.com>
Subject: Re: [RFT] mac80211: clean up set_key callback
Date: Mon, 8 Dec 2008 21:11:22 +0100	[thread overview]
Message-ID: <200812082111.22996.mb@bu3sch.de> (raw)
In-Reply-To: <1228757035.22164.94.camel@johannes.berg>

On Monday 08 December 2008 18:23:55 Johannes Berg wrote:
> --- everything.orig/drivers/net/wireless/b43/main.c	2008-12-08 17:42:05.000000000 +0100
> +++ everything/drivers/net/wireless/b43/main.c	2008-12-08 17:49:40.000000000 +0100
> @@ -3508,8 +3508,8 @@ static void b43_op_bss_info_changed(stru
>  }
>  
>  static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> -			   const u8 *local_addr, const u8 *addr,
> -			   struct ieee80211_key_conf *key)
> +			  struct ieee80211_vif *vif, struct ieee80211_sta *sta,
> +			  struct ieee80211_key_conf *key)
>  {
>  	struct b43_wl *wl = hw_to_b43_wl(hw);
>  	struct b43_wldev *dev;
> @@ -3567,17 +3567,13 @@ static int b43_op_set_key(struct ieee802
>  			goto out_unlock;
>  		}
>  
> -		if (is_broadcast_ether_addr(addr)) {
> +		if (!sta) {
>  			/* addr is FF:FF:FF:FF:FF:FF for default keys */

Please also remove this comment.

>  			err = b43_key_write(dev, index, algorithm,
>  					    key->key, key->keylen, NULL, key);
>  		} else {
> -			/*
> -			 * either pairwise key or address is 00:00:00:00:00:00
> -			 * for transmit-only keys
> -			 */
> -			err = b43_key_write(dev, -1, algorithm,
> -					    key->key, key->keylen, addr, key);
> +			err = b43_key_write(dev, -1, algorithm, key->key,
> +					    key->keylen, sta->addr, key);
>  		}
>  		if (err)
>  			goto out_unlock;
> @@ -3604,10 +3600,12 @@ out_unlock:
>  	spin_unlock_irqrestore(&wl->irq_lock, flags);
>  	mutex_unlock(&wl->mutex);
>  	if (!err) {
> +		static const u8 bcast_addr[ETH_ALEN] =
> +			{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>  		b43dbg(wl, "%s hardware based encryption for keyidx: %d, "
>  		       "mac: %s\n",
>  		       cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
> -		       print_mac(mac, addr));
> +		       print_mac(mac, sta ? sta->addr : bcast_addr));

Will throw "unused variable bcast_addr" for !DEBUG.
Use something like
		sta ? print_mac(mac, sta->addr) : "group/tx-only");

-- 
Greetings Michael.

  reply	other threads:[~2008-12-08 20:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-08 17:23 [RFT] mac80211: clean up set_key callback Johannes Berg
2008-12-08 20:11 ` Michael Buesch [this message]
2008-12-08 20:13   ` Johannes Berg
2008-12-08 22:53 ` Ivo van Doorn
2008-12-08 23:01   ` Johannes Berg
2008-12-09  1:01 ` Bob Copeland
2008-12-09  1:07   ` Johannes Berg
2008-12-09 10:23 ` Kalle Valo
2008-12-09 10:38 ` Samuel Ortiz
2008-12-09 12:36 ` Christian Lamparter

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=200812082111.22996.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=Sujith.Manoharan@atheros.com \
    --cc=chunkeey@web.de \
    --cc=ivdoorn@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=kalle.valo@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@gmail.com \
    --cc=me@bobcopeland.com \
    --cc=mickflemm@gmail.com \
    --cc=tomasw@gmail.com \
    /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).