| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008-2009 Atheros Communications Inc. | 2 * Copyright (c) 2008-2009 Atheros Communications Inc. |
| 3 * | 3 * |
| 4 * Permission to use, copy, modify, and/or distribute this software for any | 4 * Permission to use, copy, modify, and/or distribute this software for any |
| 5 * purpose with or without fee is hereby granted, provided that the above | 5 * purpose with or without fee is hereby granted, provided that the above |
| 6 * copyright notice and this permission notice appear in all copies. | 6 * copyright notice and this permission notice appear in all copies. |
| 7 * | 7 * |
| 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 .read = read_file_wiphy, | 623 .read = read_file_wiphy, |
| 624 .write = write_file_wiphy, | 624 .write = write_file_wiphy, |
| 625 .open = ath9k_debugfs_open, | 625 .open = ath9k_debugfs_open, |
| 626 .owner = THIS_MODULE | 626 .owner = THIS_MODULE |
| 627 }; | 627 }; |
| 628 | 628 |
| 629 #define PR(str, elem) \ | 629 #define PR(str, elem) \ |
| 630 do { \ | 630 do { \ |
| 631 len += snprintf(buf + len, size - len, \ | 631 len += snprintf(buf + len, size - len, \ |
| 632 "%s%13u%11u%10u%10u\n", str, \ | 632 "%s%13u%11u%10u%10u\n", str, \ |
| 633 » » sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BE]].elem, \ | 633 » » sc->debug.stats.txstats[WME_AC_BE].elem, \ |
| 634 » » sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BK]].elem, \ | 634 » » sc->debug.stats.txstats[WME_AC_BK].elem, \ |
| 635 » » sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VI]].elem, \ | 635 » » sc->debug.stats.txstats[WME_AC_VI].elem, \ |
| 636 » » sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VO]].elem); \ | 636 » » sc->debug.stats.txstats[WME_AC_VO].elem); \ |
| 637 } while(0) | 637 } while(0) |
| 638 | 638 |
| 639 static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | 639 static ssize_t read_file_xmit(struct file *file, char __user *user_buf, |
| 640 size_t count, loff_t *ppos) | 640 size_t count, loff_t *ppos) |
| 641 { | 641 { |
| 642 struct ath_softc *sc = file->private_data; | 642 struct ath_softc *sc = file->private_data; |
| 643 char *buf; | 643 char *buf; |
| 644 unsigned int len = 0, size = 2048; | 644 unsigned int len = 0, size = 2048; |
| 645 ssize_t retval = 0; | 645 ssize_t retval = 0; |
| 646 | 646 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 666 | 666 |
| 667 if (len > size) | 667 if (len > size) |
| 668 len = size; | 668 len = size; |
| 669 | 669 |
| 670 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | 670 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); |
| 671 kfree(buf); | 671 kfree(buf); |
| 672 | 672 |
| 673 return retval; | 673 return retval; |
| 674 } | 674 } |
| 675 | 675 |
| 676 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq, | 676 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, |
| 677 » » struct ath_buf *bf, struct ath_tx_status *ts) | 677 » » struct ath_tx_status *ts) |
| 678 { | 678 { |
| 679 int qnum = skb_get_queue_mapping(bf->bf_mpdu); |
| 680 |
| 679 if (bf_isampdu(bf)) { | 681 if (bf_isampdu(bf)) { |
| 680 if (bf_isxretried(bf)) | 682 if (bf_isxretried(bf)) |
| 681 » » » TX_STAT_INC(txq->axq_qnum, a_xretries); | 683 » » » TX_STAT_INC(qnum, a_xretries); |
| 682 else | 684 else |
| 683 » » » TX_STAT_INC(txq->axq_qnum, a_completed); | 685 » » » TX_STAT_INC(qnum, a_completed); |
| 684 } else { | 686 } else { |
| 685 » » TX_STAT_INC(txq->axq_qnum, completed); | 687 » » TX_STAT_INC(qnum, completed); |
| 686 } | 688 } |
| 687 | 689 |
| 688 if (ts->ts_status & ATH9K_TXERR_FIFO) | 690 if (ts->ts_status & ATH9K_TXERR_FIFO) |
| 689 » » TX_STAT_INC(txq->axq_qnum, fifo_underrun); | 691 » » TX_STAT_INC(qnum, fifo_underrun); |
| 690 if (ts->ts_status & ATH9K_TXERR_XTXOP) | 692 if (ts->ts_status & ATH9K_TXERR_XTXOP) |
| 691 » » TX_STAT_INC(txq->axq_qnum, xtxop); | 693 » » TX_STAT_INC(qnum, xtxop); |
| 692 if (ts->ts_status & ATH9K_TXERR_TIMER_EXPIRED) | 694 if (ts->ts_status & ATH9K_TXERR_TIMER_EXPIRED) |
| 693 » » TX_STAT_INC(txq->axq_qnum, timer_exp); | 695 » » TX_STAT_INC(qnum, timer_exp); |
| 694 if (ts->ts_flags & ATH9K_TX_DESC_CFG_ERR) | 696 if (ts->ts_flags & ATH9K_TX_DESC_CFG_ERR) |
| 695 » » TX_STAT_INC(txq->axq_qnum, desc_cfg_err); | 697 » » TX_STAT_INC(qnum, desc_cfg_err); |
| 696 if (ts->ts_flags & ATH9K_TX_DATA_UNDERRUN) | 698 if (ts->ts_flags & ATH9K_TX_DATA_UNDERRUN) |
| 697 » » TX_STAT_INC(txq->axq_qnum, data_underrun); | 699 » » TX_STAT_INC(qnum, data_underrun); |
| 698 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN) | 700 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN) |
| 699 » » TX_STAT_INC(txq->axq_qnum, delim_underrun); | 701 » » TX_STAT_INC(qnum, delim_underrun); |
| 700 } | 702 } |
| 701 | 703 |
| 702 static const struct file_operations fops_xmit = { | 704 static const struct file_operations fops_xmit = { |
| 703 .read = read_file_xmit, | 705 .read = read_file_xmit, |
| 704 .open = ath9k_debugfs_open, | 706 .open = ath9k_debugfs_open, |
| 705 .owner = THIS_MODULE | 707 .owner = THIS_MODULE |
| 706 }; | 708 }; |
| 707 | 709 |
| 708 static ssize_t read_file_recv(struct file *file, char __user *user_buf, | 710 static ssize_t read_file_recv(struct file *file, char __user *user_buf, |
| 709 size_t count, loff_t *ppos) | 711 size_t count, loff_t *ppos) |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 return -ENOENT; | 984 return -ENOENT; |
| 983 | 985 |
| 984 return 0; | 986 return 0; |
| 985 } | 987 } |
| 986 | 988 |
| 987 void ath9k_debug_remove_root(void) | 989 void ath9k_debug_remove_root(void) |
| 988 { | 990 { |
| 989 debugfs_remove(ath9k_debugfs_root); | 991 debugfs_remove(ath9k_debugfs_root); |
| 990 ath9k_debugfs_root = NULL; | 992 ath9k_debugfs_root = NULL; |
| 991 } | 993 } |
| OLD | NEW |