aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-11-27 15:49:29 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:08 -0500
commit4d8dd66c1659ba0d1b110ed0488f4f6ffbc90e71 (patch)
tree03ae5e8fc993ec504f099ddb5d1f40f3a371289d /drivers/net/wireless/rt2x00/rt2x00dev.c
parent08992f7fb139c7dbaf593402312ee5a055352f05 (diff)
rt2x00: Add TX/RX frame dumping facility
This adds TX/RX frame dumping capabilities through debugfs. The intention is that with this approach debugging of rt2x00 is simplified since _all_ frames going in and out of the device are send to debugfs as well along with additional information like the hardware descriptor. Based on the patch by Mattias Nissler. Mattias also has some tools that will make the dumped frames available to wireshark: http://www-user.rhrk.uni-kl.de/~nissler/rt2x00/ Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 4f32ee8f4cb7..48e251561f83 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -28,6 +28,7 @@
28 28
29#include "rt2x00.h" 29#include "rt2x00.h"
30#include "rt2x00lib.h" 30#include "rt2x00lib.h"
31#include "rt2x00dump.h"
31 32
32/* 33/*
33 * Ring handler. 34 * Ring handler.
@@ -511,9 +512,11 @@ void rt2x00lib_txdone(struct data_entry *entry,
511 } 512 }
512 513
513 /* 514 /*
514 * Send the tx_status to mac80211, 515 * Send the tx_status to mac80211 & debugfs.
515 * that method also cleans up the skb structure. 516 * mac80211 will clean up the skb structure.
516 */ 517 */
518 get_skb_desc(entry->skb)->frame_type = DUMP_FRAME_TXDONE;
519 rt2x00debug_dump_frame(rt2x00dev, entry->skb);
517 ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb, tx_status); 520 ieee80211_tx_status_irqsafe(rt2x00dev->hw, entry->skb, tx_status);
518 entry->skb = NULL; 521 entry->skb = NULL;
519} 522}
@@ -563,8 +566,10 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
563 rx_status->antenna = rt2x00dev->link.ant.active.rx; 566 rx_status->antenna = rt2x00dev->link.ant.active.rx;
564 567
565 /* 568 /*
566 * Send frame to mac80211 569 * Send frame to mac80211 & debugfs
567 */ 570 */
571 get_skb_desc(skb)->frame_type = DUMP_FRAME_RXDONE;
572 rt2x00debug_dump_frame(rt2x00dev, skb);
568 ieee80211_rx_irqsafe(rt2x00dev->hw, skb, rx_status); 573 ieee80211_rx_irqsafe(rt2x00dev->hw, skb, rx_status);
569} 574}
570EXPORT_SYMBOL_GPL(rt2x00lib_rxdone); 575EXPORT_SYMBOL_GPL(rt2x00lib_rxdone);
@@ -715,6 +720,15 @@ void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
715 */ 720 */
716 skbdesc->entry->skb = skb; 721 skbdesc->entry->skb = skb;
717 memcpy(&skbdesc->entry->tx_status.control, control, sizeof(*control)); 722 memcpy(&skbdesc->entry->tx_status.control, control, sizeof(*control));
723
724 /*
725 * The frame has been completely initialized and ready
726 * for sending to the device. The caller will push the
727 * frame to the device, but we are going to push the
728 * frame to debugfs here.
729 */
730 skbdesc->frame_type = DUMP_FRAME_TX;
731 rt2x00debug_dump_frame(rt2x00dev, skb);
718} 732}
719EXPORT_SYMBOL_GPL(rt2x00lib_write_tx_desc); 733EXPORT_SYMBOL_GPL(rt2x00lib_write_tx_desc);
720 734