Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jiri Benc <jbenc@suse.cz>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH] mac80211: use is_broadcast_ether_addr
Date: Tue, 27 Mar 2007 23:52:39 +0200	[thread overview]
Message-ID: <1175032359.5151.8.camel@johannes.berg> (raw)

Change a whole bunch of places to use is_broadcast_ether_addr.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
 net/mac80211/ieee80211_ioctl.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-03-27 23:50:18.051396904 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-03-27 23:51:03.501396904 +0200
@@ -410,9 +410,7 @@ static int ieee80211_ioctl_get_info_sta(
 	struct ieee80211_hw_mode *mode;
 	struct sta_info *sta;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		struct net_device_stats *stats;
 
 		stats = ieee80211_dev_stats(local->mdev);
@@ -531,9 +529,7 @@ static int ieee80211_set_encryption(stru
 
 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
-	if (sta_addr[0] == 0xff && sta_addr[1] == 0xff &&
-	    sta_addr[2] == 0xff && sta_addr[3] == 0xff &&
-	    sta_addr[4] == 0xff && sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(sta_addr)) {
 		sta = NULL;
 		if (idx >= NUM_DEFAULT_KEYS) {
 			printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
@@ -799,9 +795,7 @@ static int ieee80211_ioctl_get_encryptio
 	if (max_key_len < 0)
 		return -EINVAL;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		sta = NULL;
 		if (param->u.crypt.idx >= NUM_DEFAULT_KEYS) {
 			param->u.crypt.idx = sdata->default_key ?
@@ -903,9 +897,7 @@ static int ieee80211_ioctl_wpa_trigger(s
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct sta_info *sta;
 
-	if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-	    param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-	    param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+	if (is_broadcast_ether_addr(param->sta_addr)) {
 		local->wpa_trigger = param->u.wpa_trigger.trigger;
 		return 0;
 	}



                 reply	other threads:[~2007-03-28  9:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1175032359.5151.8.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=jbenc@suse.cz \
    --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