aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2007-10-03 20:59:30 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:42 -0400
commit0795af5729b18218767fab27c44b1384f72dc9ad (patch)
tree67c16df84aa6ec219340b8ea1b5cfb0e8150a216 /net/mac80211/tx.c
parent95ea36275f3c9a1d3d04c217b4b576c657c4e70e (diff)
[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ca262a99e56f..04b4fa9c69ea 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -54,6 +54,7 @@ static void ieee80211_dump_frame(const char *ifname, const char *title,
54 const struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 54 const struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
55 u16 fc; 55 u16 fc;
56 int hdrlen; 56 int hdrlen;
57 DECLARE_MAC_BUF(mac);
57 58
58 printk(KERN_DEBUG "%s: %s (len=%d)", ifname, title, skb->len); 59 printk(KERN_DEBUG "%s: %s (len=%d)", ifname, title, skb->len);
59 if (skb->len < 4) { 60 if (skb->len < 4) {
@@ -69,13 +70,13 @@ static void ieee80211_dump_frame(const char *ifname, const char *title,
69 printk(" FC=0x%04x DUR=0x%04x", 70 printk(" FC=0x%04x DUR=0x%04x",
70 fc, le16_to_cpu(hdr->duration_id)); 71 fc, le16_to_cpu(hdr->duration_id));
71 if (hdrlen >= 10) 72 if (hdrlen >= 10)
72 printk(" A1=" MAC_FMT, MAC_ARG(hdr->addr1)); 73 printk(" A1=%s", print_mac(mac, hdr->addr1));
73 if (hdrlen >= 16) 74 if (hdrlen >= 16)
74 printk(" A2=" MAC_FMT, MAC_ARG(hdr->addr2)); 75 printk(" A2=%s", print_mac(mac, hdr->addr2));
75 if (hdrlen >= 24) 76 if (hdrlen >= 24)
76 printk(" A3=" MAC_FMT, MAC_ARG(hdr->addr3)); 77 printk(" A3=%s", print_mac(mac, hdr->addr3));
77 if (hdrlen >= 30) 78 if (hdrlen >= 30)
78 printk(" A4=" MAC_FMT, MAC_ARG(hdr->addr4)); 79 printk(" A4=%s", print_mac(mac, hdr->addr4));
79 printk("\n"); 80 printk("\n");
80} 81}
81#else /* CONFIG_MAC80211_LOWTX_FRAME_DUMP */ 82#else /* CONFIG_MAC80211_LOWTX_FRAME_DUMP */
@@ -236,9 +237,10 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
236 tx->sdata->type != IEEE80211_IF_TYPE_IBSS && 237 tx->sdata->type != IEEE80211_IF_TYPE_IBSS &&
237 (tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) { 238 (tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)) {
238#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 239#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
240 DECLARE_MAC_BUF(mac);
239 printk(KERN_DEBUG "%s: dropped data frame to not " 241 printk(KERN_DEBUG "%s: dropped data frame to not "
240 "associated station " MAC_FMT "\n", 242 "associated station %s\n",
241 tx->dev->name, MAC_ARG(hdr->addr1)); 243 tx->dev->name, print_mac(mac, hdr->addr1));
242#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 244#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
243 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); 245 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc);
244 return TXRX_DROP; 246 return TXRX_DROP;
@@ -259,9 +261,10 @@ ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx)
259 if (unlikely(!tx->u.tx.mgmt_interface && tx->sdata->ieee802_1x && 261 if (unlikely(!tx->u.tx.mgmt_interface && tx->sdata->ieee802_1x &&
260 !(sta_flags & WLAN_STA_AUTHORIZED))) { 262 !(sta_flags & WLAN_STA_AUTHORIZED))) {
261#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 263#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
262 printk(KERN_DEBUG "%s: dropped frame to " MAC_FMT 264 DECLARE_MAC_BUF(mac);
265 printk(KERN_DEBUG "%s: dropped frame to %s"
263 " (unauthorized port)\n", tx->dev->name, 266 " (unauthorized port)\n", tx->dev->name,
264 MAC_ARG(hdr->addr1)); 267 print_mac(mac, hdr->addr1));
265#endif 268#endif
266 I802_DEBUG_INC(tx->local->tx_handlers_drop_unauth_port); 269 I802_DEBUG_INC(tx->local->tx_handlers_drop_unauth_port);
267 return TXRX_DROP; 270 return TXRX_DROP;
@@ -357,6 +360,7 @@ static inline ieee80211_txrx_result
357ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx) 360ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
358{ 361{
359 struct sta_info *sta = tx->sta; 362 struct sta_info *sta = tx->sta;
363 DECLARE_MAC_BUF(mac);
360 364
361 if (unlikely(!sta || 365 if (unlikely(!sta ||
362 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && 366 ((tx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT &&
@@ -366,9 +370,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
366 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) { 370 if (unlikely((sta->flags & WLAN_STA_PS) && !sta->pspoll)) {
367 struct ieee80211_tx_packet_data *pkt_data; 371 struct ieee80211_tx_packet_data *pkt_data;
368#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 372#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
369 printk(KERN_DEBUG "STA " MAC_FMT " aid %d: PS buffer (entries " 373 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries "
370 "before %d)\n", 374 "before %d)\n",
371 MAC_ARG(sta->addr), sta->aid, 375 print_mac(mac, sta->addr), sta->aid,
372 skb_queue_len(&sta->ps_tx_buf)); 376 skb_queue_len(&sta->ps_tx_buf));
373#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 377#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
374 sta->flags |= WLAN_STA_TIM; 378 sta->flags |= WLAN_STA_TIM;
@@ -377,9 +381,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
377 if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) { 381 if (skb_queue_len(&sta->ps_tx_buf) >= STA_MAX_TX_BUFFER) {
378 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf); 382 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf);
379 if (net_ratelimit()) { 383 if (net_ratelimit()) {
380 printk(KERN_DEBUG "%s: STA " MAC_FMT " TX " 384 printk(KERN_DEBUG "%s: STA %s TX "
381 "buffer full - dropping oldest frame\n", 385 "buffer full - dropping oldest frame\n",
382 tx->dev->name, MAC_ARG(sta->addr)); 386 tx->dev->name, print_mac(mac, sta->addr));
383 } 387 }
384 dev_kfree_skb(old); 388 dev_kfree_skb(old);
385 } else 389 } else
@@ -399,9 +403,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_txrx_data *tx)
399 } 403 }
400#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 404#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
401 else if (unlikely(sta->flags & WLAN_STA_PS)) { 405 else if (unlikely(sta->flags & WLAN_STA_PS)) {
402 printk(KERN_DEBUG "%s: STA " MAC_FMT " in PS mode, but pspoll " 406 printk(KERN_DEBUG "%s: STA %s in PS mode, but pspoll "
403 "set -> send frame\n", tx->dev->name, 407 "set -> send frame\n", tx->dev->name,
404 MAC_ARG(sta->addr)); 408 print_mac(mac, sta->addr));
405 } 409 }
406#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 410#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
407 sta->pspoll = 0; 411 sta->pspoll = 0;