public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Wu <flamingice@sourmilk.net>
To: linville@tuxdriver.com
Cc: Jiri Benc <jbenc@suse.cz>, Michael Buesch <mb@bu3sch.de>,
	netdev@vger.kernel.org
Subject: [PATCH wireless-dev] d80211: Make MACSTR/MAC2STR macro available to drivers
Date: Sun, 23 Jul 2006 01:43:25 -0700	[thread overview]
Message-ID: <200607230143.31375.flamingice@sourmilk.net> (raw)

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

d80211: Make MACSTR/MAC2STR macro available to drivers

This patch moves the MACSTR/MAC2STR macros to d80211.h
so that they are available to drivers. It also converts the adm8211
and bcm43xx drivers to use this macro.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>
---

 drivers/net/wireless/d80211/adm8211/adm8211.c      |    7 ++-----
 drivers/net/wireless/d80211/bcm43xx/bcm43xx.h      |    6 ------
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c |    8 ++++----
 drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c |    4 ++--
 include/net/d80211.h                               |    4 ++++
 net/d80211/ieee80211_i.h                           |    5 -----
 6 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/d80211/adm8211/adm8211.c b/drivers/net/wireless/d80211/adm8211/adm8211.c
index be4a058..0a762d7 100644
--- a/drivers/net/wireless/d80211/adm8211/adm8211.c
+++ b/drivers/net/wireless/d80211/adm8211/adm8211.c
@@ -74,9 +74,6 @@ #define PLCP_SIGNAL_2M		0x14
 #define PLCP_SIGNAL_5M5		0x37
 #define PLCP_SIGNAL_11M		0x6e
 
-#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
-#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
-
 struct adm8211_tx_hdr {
 	u8 da[6];
 	u8 signal; /* PLCP signal / TX rate in 100 Kbps */
@@ -2085,8 +2082,8 @@ #endif
 		goto err_free_desc;
 	}
 
-	printk("%s: hwaddr " MAC_FMT ", Rev 0x%02x\n",
-	       dev->name, MAC_ARG(dev->dev_addr), priv->revid);
+	printk("%s: hwaddr " MACSTR ", Rev 0x%02x\n",
+	       dev->name, MAC2STR(dev->dev_addr), priv->revid);
 
 	return 0;
 
diff --git a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
index af4bb46..91a98a9 100644
--- a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
@@ -991,10 +991,4 @@ #define limit_value(value, min, max)  \
 	 	__value;				\
 	})
 
-/** Helpers to print MAC addresses. */
-#define BCM43xx_MACFMT		"%02x:%02x:%02x:%02x:%02x:%02x"
-#define BCM43xx_MACARG(x)	((u8*)(x))[0], ((u8*)(x))[1], \
-				((u8*)(x))[2], ((u8*)(x))[3], \
-				((u8*)(x))[4], ((u8*)(x))[5]
-
 #endif /* BCM43xx_H_ */
diff --git a/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
index b6425e3..82985f2 100644
--- a/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
@@ -4561,9 +4561,9 @@ static int bcm43xx_add_interface(struct 
 
 	dprintk(KERN_INFO PFX "Virtual interface added "
 			      "(type: 0x%08X, ID: %d, MAC: "
-			      BCM43xx_MACFMT ")\n",
+			      MACSTR ")\n",
 		conf->type, conf->if_id,
-		BCM43xx_MACARG(conf->mac_addr));
+		MAC2STR(conf->mac_addr));
 
 out_unlock:
 	bcm43xx_unlock_irqsafe(bcm, flags);
@@ -4589,9 +4589,9 @@ static void bcm43xx_remove_interface(str
 
 	dprintk(KERN_INFO PFX "Virtual interface removed "
 			      "(type: 0x%08X, ID: %d, MAC: "
-			      BCM43xx_MACFMT ")\n",
+			      MACSTR ")\n",
 		conf->type, conf->if_id,
-		BCM43xx_MACARG(conf->mac_addr));
+		MAC2STR(conf->mac_addr));
 }
 
 static int bcm43xx_config_interface(struct net_device *net_dev,
diff --git a/drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c b/drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c
index 562c6a1..6ebe9fa 100644
--- a/drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c
+++ b/drivers/net/wireless/d80211/bcm43xx/bcm43xx_xmit.c
@@ -259,8 +259,8 @@ assert(dur);
 
 	txhdr->rts_cts_frame_control = cpu_to_le16(fctl);
 	txhdr->rts_cts_dur = cpu_to_le16(dur);
-//printk(BCM43xx_MACFMT "  " BCM43xx_MACFMT "  " BCM43xx_MACFMT "\n", BCM43xx_MACARG(wlhdr->addr1), BCM43xx_MACARG(wlhdr->addr2), BCM43xx_MACARG(wlhdr->addr3));
-//printk(BCM43xx_MACFMT "  " BCM43xx_MACFMT "\n", BCM43xx_MACARG(sa), BCM43xx_MACARG(da));
+//printk(MACSTR "  " MACSTR "  " MACSTR "\n", MAC2STR(wlhdr->addr1), MAC2STR(wlhdr->addr2), MAC2STR(wlhdr->addr3));
+//printk(MACSTR "  " MACSTR "\n", MAC2STR(sa), MAC2STR(da));
 	memcpy(txhdr->rts_cts_mac1, wlhdr->addr1, ETH_ALEN);//FIXME!
 	memcpy(txhdr->rts_cts_mac2, sa, ETH_ALEN);
 
diff --git a/include/net/d80211.h b/include/net/d80211.h
index e6dcb0e..b9d4b24 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -999,4 +999,8 @@ static inline int ieee80211_get_morefrag
 	return (le16_to_cpu(hdr->frame_control) & WLAN_FC_MOREFRAG) != 0;
 }
 
+#define MAC2STR(a) ((a)[0] & 0xff), ((a)[1] & 0xff), ((a)[2] & 0xff), \
+		   ((a)[3] & 0xff), ((a)[4] & 0xff), ((a)[5] & 0xff)
+#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
+
 #endif /* D80211_H */
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index 691edd0..df8a43e 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -46,11 +46,6 @@ #define AP_MAX_BC_BUFFER 128
 #define TOTAL_MAX_TX_BUFFER 512
 
 
-#define MAC2STR(a) ((a)[0] & 0xff), ((a)[1] & 0xff), ((a)[2] & 0xff), \
-		   ((a)[3] & 0xff), ((a)[4] & 0xff), ((a)[5] & 0xff)
-#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
-
 /* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent
  * reception of at least three fragmented frames. This limit can be increased
  * by changing this define, at the cost of slower frame reassembly and

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-07-23  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-23  8:43 Michael Wu [this message]
2006-07-23  9:10 ` [PATCH wireless-dev] d80211: Make MACSTR/MAC2STR macro available to drivers Michael Buesch
2006-07-23  9:31   ` Michael Wu
2006-07-24 13:54 ` Jiri Benc
2006-07-24 16:40   ` Michael Wu

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=200607230143.31375.flamingice@sourmilk.net \
    --to=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=netdev@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