commit a2af4e7b6948a9a6647ff59e84ba16da1de2e1d5 Author: Jiri Slaby Date: Sat Jul 7 14:22:37 2007 +0200 ath_dump_skb diff --git a/ath/if_ath_pci.c b/ath/if_ath_pci.c index 086d5aa..9047f78 100644 --- a/ath/if_ath_pci.c +++ b/ath/if_ath_pci.c @@ -37,6 +37,7 @@ #include "if_athvar.h" #define ATH_DEBUG_MODES 0 /* Show found modes in the log? */ +#define ATH_DUMP_SKB 0 /* show skb contents */ #define AR_DEBUG 1 #define KASSERT(exp, msg...) do { \ @@ -139,6 +140,23 @@ static void ath_printtxbuf(struct ath_buf *bf, int done) } #endif +#ifdef ATH_DUMP_SKB +static void ath_dump_skb(struct sk_buff *skb, unsigned int rx) +{ + unsigned int a; + + printk(KERN_DEBUG "%c", rx ? 'r' : 't'); + for (a = 0; a < min(200U, skb->len) + 4; a++) { + printk("%.2x %s", skb->data[a], ((a+1) % 8) ? "" : " "); + if (!((a+1) % 16)) + printk("\n" KERN_DEBUG " "); + } + printk("\n"); +} +#else +static inline void ath_dump_skb(struct sk_buff *skb, unsigned int rx) {} +#endif + static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) { struct ieee80211_tx_status txs = {}; @@ -373,6 +391,8 @@ accept: // rxs.flag |= RX_FLAG_DECRYPTED; // printk(KERN_DEBUG "stat: %x, dlen: %u (hdr: %u), rssi: %d, rate: %u\n", ds->ds_rxstat.rs_status, len, ieee80211_get_hdrlen_from_skb(skb), ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_rate); + ath_dump_skb(skb, 1); + __ieee80211_rx(sc->hw, skb, &rxs); next: list_move_tail(&bf->list, &sc->rxbuf); @@ -847,16 +867,8 @@ static int ath_tx(struct ieee80211_hw *hw, struct sk_buff *skb, struct ath_softc *sc = hw->priv; struct ath_buf *bf; unsigned long flags; -// unsigned int a; -/* skb_pad(skb, 4); - printk(KERN_DEBUG "%p/%p, %p/%p, %u, %u\n" KERN_DEBUG, skb->head, skb->data, skb->tail, skb->end, skb->len, skb->data_len); - for (a = 0; a < min(200U, skb->len) + 4; a++) { - printk("%.2x %s", skb->data[a], ((a+1) % 8) ? "" : " "); - if (!((a+1) % 16)) - printk("\n" KERN_DEBUG); - } - printk("\n");*/ + ath_dump_skb(skb, 0); spin_lock_irqsave(&sc->txbuflock, flags); if (list_empty(&sc->txbuf)) {