diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-11 22:17:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-11 22:17:18 -0400 |
commit | ba73d4c84a7344f1b5635c2b4e96796e8c13a126 (patch) | |
tree | d4a3e2cfc5f3a046a2b9baa898f0c201c75ba898 /drivers/net/wireless/ath5k/debug.c | |
parent | b8ad0cbc58f703972e9e37c4e2a8081dd7e6a551 (diff) | |
parent | deedf504302ff747985db081352e045ff7087a11 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.26
Diffstat (limited to 'drivers/net/wireless/ath5k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath5k/debug.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 05bf4fb8f907..41d5fa34b544 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -200,7 +200,8 @@ static ssize_t read_file_tsf(struct file *file, char __user *user_buf, | |||
200 | { | 200 | { |
201 | struct ath5k_softc *sc = file->private_data; | 201 | struct ath5k_softc *sc = file->private_data; |
202 | char buf[100]; | 202 | char buf[100]; |
203 | snprintf(buf, sizeof(buf), "0x%016llx\n", ath5k_hw_get_tsf64(sc->ah)); | 203 | snprintf(buf, sizeof(buf), "0x%016llx\n", |
204 | (unsigned long long)ath5k_hw_get_tsf64(sc->ah)); | ||
204 | return simple_read_from_buffer(user_buf, count, ppos, buf, 19); | 205 | return simple_read_from_buffer(user_buf, count, ppos, buf, 19); |
205 | } | 206 | } |
206 | 207 | ||
@@ -271,7 +272,8 @@ static ssize_t read_file_beacon(struct file *file, char __user *user_buf, | |||
271 | 272 | ||
272 | tsf = ath5k_hw_get_tsf64(sc->ah); | 273 | tsf = ath5k_hw_get_tsf64(sc->ah); |
273 | len += snprintf(buf+len, sizeof(buf)-len, | 274 | len += snprintf(buf+len, sizeof(buf)-len, |
274 | "TSF\t\t0x%016llx\tTU: %08x\n", tsf, TSF_TO_TU(tsf)); | 275 | "TSF\t\t0x%016llx\tTU: %08x\n", |
276 | (unsigned long long)tsf, TSF_TO_TU(tsf)); | ||
275 | 277 | ||
276 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | 278 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); |
277 | } | 279 | } |
@@ -497,15 +499,18 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc) | |||
497 | } | 499 | } |
498 | 500 | ||
499 | static inline void | 501 | static inline void |
500 | ath5k_debug_printrxbuf(struct ath5k_buf *bf, int done) | 502 | ath5k_debug_printrxbuf(struct ath5k_buf *bf, int done, |
503 | struct ath5k_rx_status *rs) | ||
501 | { | 504 | { |
502 | struct ath5k_desc *ds = bf->desc; | 505 | struct ath5k_desc *ds = bf->desc; |
506 | struct ath5k_hw_all_rx_desc *rd = &ds->ud.ds_rx; | ||
503 | 507 | ||
504 | printk(KERN_DEBUG "R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n", | 508 | printk(KERN_DEBUG "R (%p %llx) %08x %08x %08x %08x %08x %08x %c\n", |
505 | ds, (unsigned long long)bf->daddr, | 509 | ds, (unsigned long long)bf->daddr, |
506 | ds->ds_link, ds->ds_data, ds->ds_ctl0, ds->ds_ctl1, | 510 | ds->ds_link, ds->ds_data, |
507 | ds->ds_hw[0], ds->ds_hw[1], | 511 | rd->rx_ctl.rx_control_0, rd->rx_ctl.rx_control_1, |
508 | !done ? ' ' : (ds->ds_rxstat.rs_status == 0) ? '*' : '!'); | 512 | rd->u.rx_stat.rx_status_0, rd->u.rx_stat.rx_status_0, |
513 | !done ? ' ' : (rs->rs_status == 0) ? '*' : '!'); | ||
509 | } | 514 | } |
510 | 515 | ||
511 | void | 516 | void |
@@ -513,6 +518,7 @@ ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) | |||
513 | { | 518 | { |
514 | struct ath5k_desc *ds; | 519 | struct ath5k_desc *ds; |
515 | struct ath5k_buf *bf; | 520 | struct ath5k_buf *bf; |
521 | struct ath5k_rx_status rs = {}; | ||
516 | int status; | 522 | int status; |
517 | 523 | ||
518 | if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET))) | 524 | if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET))) |
@@ -524,9 +530,9 @@ ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) | |||
524 | spin_lock_bh(&sc->rxbuflock); | 530 | spin_lock_bh(&sc->rxbuflock); |
525 | list_for_each_entry(bf, &sc->rxbuf, list) { | 531 | list_for_each_entry(bf, &sc->rxbuf, list) { |
526 | ds = bf->desc; | 532 | ds = bf->desc; |
527 | status = ah->ah_proc_rx_desc(ah, ds); | 533 | status = ah->ah_proc_rx_desc(ah, ds, &rs); |
528 | if (!status) | 534 | if (!status) |
529 | ath5k_debug_printrxbuf(bf, status == 0); | 535 | ath5k_debug_printrxbuf(bf, status == 0, &rs); |
530 | } | 536 | } |
531 | spin_unlock_bh(&sc->rxbuflock); | 537 | spin_unlock_bh(&sc->rxbuflock); |
532 | } | 538 | } |
@@ -550,19 +556,24 @@ ath5k_debug_dump_skb(struct ath5k_softc *sc, | |||
550 | } | 556 | } |
551 | 557 | ||
552 | void | 558 | void |
553 | ath5k_debug_printtxbuf(struct ath5k_softc *sc, | 559 | ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf) |
554 | struct ath5k_buf *bf, int done) | ||
555 | { | 560 | { |
556 | struct ath5k_desc *ds = bf->desc; | 561 | struct ath5k_desc *ds = bf->desc; |
562 | struct ath5k_hw_5212_tx_desc *td = &ds->ud.ds_tx5212; | ||
563 | struct ath5k_tx_status ts = {}; | ||
564 | int done; | ||
557 | 565 | ||
558 | if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET))) | 566 | if (likely(!(sc->debug.level & ATH5K_DEBUG_RESET))) |
559 | return; | 567 | return; |
560 | 568 | ||
569 | done = sc->ah->ah_proc_tx_desc(sc->ah, bf->desc, &ts); | ||
570 | |||
561 | printk(KERN_DEBUG "T (%p %llx) %08x %08x %08x %08x %08x %08x %08x " | 571 | printk(KERN_DEBUG "T (%p %llx) %08x %08x %08x %08x %08x %08x %08x " |
562 | "%08x %c\n", ds, (unsigned long long)bf->daddr, ds->ds_link, | 572 | "%08x %c\n", ds, (unsigned long long)bf->daddr, ds->ds_link, |
563 | ds->ds_data, ds->ds_ctl0, ds->ds_ctl1, | 573 | ds->ds_data, td->tx_ctl.tx_control_0, td->tx_ctl.tx_control_1, |
564 | ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3], | 574 | td->tx_ctl.tx_control_2, td->tx_ctl.tx_control_3, |
565 | !done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!'); | 575 | td->tx_stat.tx_status_0, td->tx_stat.tx_status_1, |
576 | done ? ' ' : (ts.ts_status == 0) ? '*' : '!'); | ||
566 | } | 577 | } |
567 | 578 | ||
568 | #endif /* ifdef CONFIG_ATH5K_DEBUG */ | 579 | #endif /* ifdef CONFIG_ATH5K_DEBUG */ |