diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 439 |
1 files changed, 287 insertions, 152 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 6727b566d294..13ff9edc2401 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -512,62 +512,19 @@ static const struct file_operations fops_interrupt = { | |||
512 | .llseek = default_llseek, | 512 | .llseek = default_llseek, |
513 | }; | 513 | }; |
514 | 514 | ||
515 | #define PR_QNUM(_n) sc->tx.txq_map[_n]->axq_qnum | ||
516 | #define PR(str, elem) \ | ||
517 | do { \ | ||
518 | len += snprintf(buf + len, size - len, \ | ||
519 | "%s%13u%11u%10u%10u\n", str, \ | ||
520 | sc->debug.stats.txstats[PR_QNUM(WME_AC_BE)].elem, \ | ||
521 | sc->debug.stats.txstats[PR_QNUM(WME_AC_BK)].elem, \ | ||
522 | sc->debug.stats.txstats[PR_QNUM(WME_AC_VI)].elem, \ | ||
523 | sc->debug.stats.txstats[PR_QNUM(WME_AC_VO)].elem); \ | ||
524 | if (len >= size) \ | ||
525 | goto done; \ | ||
526 | } while(0) | ||
527 | |||
528 | #define PRX(str, elem) \ | ||
529 | do { \ | ||
530 | len += snprintf(buf + len, size - len, \ | ||
531 | "%s%13u%11u%10u%10u\n", str, \ | ||
532 | (unsigned int)(sc->tx.txq_map[WME_AC_BE]->elem), \ | ||
533 | (unsigned int)(sc->tx.txq_map[WME_AC_BK]->elem), \ | ||
534 | (unsigned int)(sc->tx.txq_map[WME_AC_VI]->elem), \ | ||
535 | (unsigned int)(sc->tx.txq_map[WME_AC_VO]->elem)); \ | ||
536 | if (len >= size) \ | ||
537 | goto done; \ | ||
538 | } while(0) | ||
539 | |||
540 | #define PRQLE(str, elem) \ | ||
541 | do { \ | ||
542 | len += snprintf(buf + len, size - len, \ | ||
543 | "%s%13i%11i%10i%10i\n", str, \ | ||
544 | list_empty(&sc->tx.txq_map[WME_AC_BE]->elem), \ | ||
545 | list_empty(&sc->tx.txq_map[WME_AC_BK]->elem), \ | ||
546 | list_empty(&sc->tx.txq_map[WME_AC_VI]->elem), \ | ||
547 | list_empty(&sc->tx.txq_map[WME_AC_VO]->elem)); \ | ||
548 | if (len >= size) \ | ||
549 | goto done; \ | ||
550 | } while (0) | ||
551 | |||
552 | static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | 515 | static ssize_t read_file_xmit(struct file *file, char __user *user_buf, |
553 | size_t count, loff_t *ppos) | 516 | size_t count, loff_t *ppos) |
554 | { | 517 | { |
555 | struct ath_softc *sc = file->private_data; | 518 | struct ath_softc *sc = file->private_data; |
556 | char *buf; | 519 | char *buf; |
557 | unsigned int len = 0, size = 8000; | 520 | unsigned int len = 0, size = 2048; |
558 | int i; | ||
559 | ssize_t retval = 0; | 521 | ssize_t retval = 0; |
560 | char tmp[32]; | ||
561 | 522 | ||
562 | buf = kzalloc(size, GFP_KERNEL); | 523 | buf = kzalloc(size, GFP_KERNEL); |
563 | if (buf == NULL) | 524 | if (buf == NULL) |
564 | return -ENOMEM; | 525 | return -ENOMEM; |
565 | 526 | ||
566 | len += sprintf(buf, "Num-Tx-Queues: %i tx-queues-setup: 0x%x" | 527 | len += sprintf(buf, "%30s %10s%10s%10s\n\n", |
567 | " poll-work-seen: %u\n" | ||
568 | "%30s %10s%10s%10s\n\n", | ||
569 | ATH9K_NUM_TX_QUEUES, sc->tx.txqsetup, | ||
570 | sc->tx_complete_poll_work_seen, | ||
571 | "BE", "BK", "VI", "VO"); | 528 | "BE", "BK", "VI", "VO"); |
572 | 529 | ||
573 | PR("MPDUs Queued: ", queued); | 530 | PR("MPDUs Queued: ", queued); |
@@ -587,62 +544,11 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | |||
587 | PR("DELIM Underrun: ", delim_underrun); | 544 | PR("DELIM Underrun: ", delim_underrun); |
588 | PR("TX-Pkts-All: ", tx_pkts_all); | 545 | PR("TX-Pkts-All: ", tx_pkts_all); |
589 | PR("TX-Bytes-All: ", tx_bytes_all); | 546 | PR("TX-Bytes-All: ", tx_bytes_all); |
590 | PR("hw-put-tx-buf: ", puttxbuf); | 547 | PR("HW-put-tx-buf: ", puttxbuf); |
591 | PR("hw-tx-start: ", txstart); | 548 | PR("HW-tx-start: ", txstart); |
592 | PR("hw-tx-proc-desc: ", txprocdesc); | 549 | PR("HW-tx-proc-desc: ", txprocdesc); |
593 | PR("TX-Failed: ", txfailed); | 550 | PR("TX-Failed: ", txfailed); |
594 | len += snprintf(buf + len, size - len, | ||
595 | "%s%11p%11p%10p%10p\n", "txq-memory-address:", | ||
596 | sc->tx.txq_map[WME_AC_BE], | ||
597 | sc->tx.txq_map[WME_AC_BK], | ||
598 | sc->tx.txq_map[WME_AC_VI], | ||
599 | sc->tx.txq_map[WME_AC_VO]); | ||
600 | if (len >= size) | ||
601 | goto done; | ||
602 | |||
603 | PRX("axq-qnum: ", axq_qnum); | ||
604 | PRX("axq-depth: ", axq_depth); | ||
605 | PRX("axq-ampdu_depth: ", axq_ampdu_depth); | ||
606 | PRX("axq-stopped ", stopped); | ||
607 | PRX("tx-in-progress ", axq_tx_inprogress); | ||
608 | PRX("pending-frames ", pending_frames); | ||
609 | PRX("txq_headidx: ", txq_headidx); | ||
610 | PRX("txq_tailidx: ", txq_headidx); | ||
611 | |||
612 | PRQLE("axq_q empty: ", axq_q); | ||
613 | PRQLE("axq_acq empty: ", axq_acq); | ||
614 | for (i = 0; i < ATH_TXFIFO_DEPTH; i++) { | ||
615 | snprintf(tmp, sizeof(tmp) - 1, "txq_fifo[%i] empty: ", i); | ||
616 | PRQLE(tmp, txq_fifo[i]); | ||
617 | } | ||
618 | |||
619 | /* Print out more detailed queue-info */ | ||
620 | for (i = 0; i <= WME_AC_BK; i++) { | ||
621 | struct ath_txq *txq = &(sc->tx.txq[i]); | ||
622 | struct ath_atx_ac *ac; | ||
623 | struct ath_atx_tid *tid; | ||
624 | if (len >= size) | ||
625 | goto done; | ||
626 | spin_lock_bh(&txq->axq_lock); | ||
627 | if (!list_empty(&txq->axq_acq)) { | ||
628 | ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, | ||
629 | list); | ||
630 | len += snprintf(buf + len, size - len, | ||
631 | "txq[%i] first-ac: %p sched: %i\n", | ||
632 | i, ac, ac->sched); | ||
633 | if (list_empty(&ac->tid_q) || (len >= size)) | ||
634 | goto done_for; | ||
635 | tid = list_first_entry(&ac->tid_q, struct ath_atx_tid, | ||
636 | list); | ||
637 | len += snprintf(buf + len, size - len, | ||
638 | " first-tid: %p sched: %i paused: %i\n", | ||
639 | tid, tid->sched, tid->paused); | ||
640 | } | ||
641 | done_for: | ||
642 | spin_unlock_bh(&txq->axq_lock); | ||
643 | } | ||
644 | 551 | ||
645 | done: | ||
646 | if (len > size) | 552 | if (len > size) |
647 | len = size; | 553 | len = size; |
648 | 554 | ||
@@ -652,62 +558,41 @@ done: | |||
652 | return retval; | 558 | return retval; |
653 | } | 559 | } |
654 | 560 | ||
655 | static ssize_t read_file_stations(struct file *file, char __user *user_buf, | 561 | static ssize_t read_file_queues(struct file *file, char __user *user_buf, |
656 | size_t count, loff_t *ppos) | 562 | size_t count, loff_t *ppos) |
657 | { | 563 | { |
658 | struct ath_softc *sc = file->private_data; | 564 | struct ath_softc *sc = file->private_data; |
565 | struct ath_txq *txq; | ||
659 | char *buf; | 566 | char *buf; |
660 | unsigned int len = 0, size = 64000; | 567 | unsigned int len = 0, size = 1024; |
661 | struct ath_node *an = NULL; | ||
662 | ssize_t retval = 0; | 568 | ssize_t retval = 0; |
663 | int q; | 569 | int i; |
570 | char *qname[4] = {"VO", "VI", "BE", "BK"}; | ||
664 | 571 | ||
665 | buf = kzalloc(size, GFP_KERNEL); | 572 | buf = kzalloc(size, GFP_KERNEL); |
666 | if (buf == NULL) | 573 | if (buf == NULL) |
667 | return -ENOMEM; | 574 | return -ENOMEM; |
668 | 575 | ||
669 | len += snprintf(buf + len, size - len, | 576 | for (i = 0; i < IEEE80211_NUM_ACS; i++) { |
670 | "Stations:\n" | 577 | txq = sc->tx.txq_map[i]; |
671 | " tid: addr sched paused buf_q-empty an ac baw\n" | 578 | len += snprintf(buf + len, size - len, "(%s): ", qname[i]); |
672 | " ac: addr sched tid_q-empty txq\n"); | ||
673 | |||
674 | spin_lock(&sc->nodes_lock); | ||
675 | list_for_each_entry(an, &sc->nodes, list) { | ||
676 | unsigned short ma = an->maxampdu; | ||
677 | if (ma == 0) | ||
678 | ma = 65535; /* see ath_lookup_rate */ | ||
679 | len += snprintf(buf + len, size - len, | ||
680 | "iface: %pM sta: %pM max-ampdu: %hu mpdu-density: %uus\n", | ||
681 | an->vif->addr, an->sta->addr, ma, | ||
682 | (unsigned int)(an->mpdudensity)); | ||
683 | if (len >= size) | ||
684 | goto done; | ||
685 | |||
686 | for (q = 0; q < WME_NUM_TID; q++) { | ||
687 | struct ath_atx_tid *tid = &(an->tid[q]); | ||
688 | len += snprintf(buf + len, size - len, | ||
689 | " tid: %p %s %s %i %p %p %hu\n", | ||
690 | tid, tid->sched ? "sched" : "idle", | ||
691 | tid->paused ? "paused" : "running", | ||
692 | skb_queue_empty(&tid->buf_q), | ||
693 | tid->an, tid->ac, tid->baw_size); | ||
694 | if (len >= size) | ||
695 | goto done; | ||
696 | } | ||
697 | 579 | ||
698 | for (q = 0; q < WME_NUM_AC; q++) { | 580 | ath_txq_lock(sc, txq); |
699 | struct ath_atx_ac *ac = &(an->ac[q]); | 581 | |
700 | len += snprintf(buf + len, size - len, | 582 | len += snprintf(buf + len, size - len, "%s: %d ", |
701 | " ac: %p %s %i %p\n", | 583 | "qnum", txq->axq_qnum); |
702 | ac, ac->sched ? "sched" : "idle", | 584 | len += snprintf(buf + len, size - len, "%s: %2d ", |
703 | list_empty(&ac->tid_q), ac->txq); | 585 | "qdepth", txq->axq_depth); |
704 | if (len >= size) | 586 | len += snprintf(buf + len, size - len, "%s: %2d ", |
705 | goto done; | 587 | "ampdu-depth", txq->axq_ampdu_depth); |
706 | } | 588 | len += snprintf(buf + len, size - len, "%s: %3d ", |
589 | "pending", txq->pending_frames); | ||
590 | len += snprintf(buf + len, size - len, "%s: %d\n", | ||
591 | "stopped", txq->stopped); | ||
592 | |||
593 | ath_txq_unlock(sc, txq); | ||
707 | } | 594 | } |
708 | 595 | ||
709 | done: | ||
710 | spin_unlock(&sc->nodes_lock); | ||
711 | if (len > size) | 596 | if (len > size) |
712 | len = size; | 597 | len = size; |
713 | 598 | ||
@@ -837,6 +722,9 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf, | |||
837 | len += snprintf(buf + len, sizeof(buf) - len, | 722 | len += snprintf(buf + len, sizeof(buf) - len, |
838 | "%17s: %2d\n", "PLL RX Hang", | 723 | "%17s: %2d\n", "PLL RX Hang", |
839 | sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); | 724 | sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); |
725 | len += snprintf(buf + len, sizeof(buf) - len, | ||
726 | "%17s: %2d\n", "MCI Reset", | ||
727 | sc->debug.stats.reset[RESET_TYPE_MCI]); | ||
840 | 728 | ||
841 | if (len > sizeof(buf)) | 729 | if (len > sizeof(buf)) |
842 | len = sizeof(buf); | 730 | len = sizeof(buf); |
@@ -919,8 +807,8 @@ static const struct file_operations fops_xmit = { | |||
919 | .llseek = default_llseek, | 807 | .llseek = default_llseek, |
920 | }; | 808 | }; |
921 | 809 | ||
922 | static const struct file_operations fops_stations = { | 810 | static const struct file_operations fops_queues = { |
923 | .read = read_file_stations, | 811 | .read = read_file_queues, |
924 | .open = simple_open, | 812 | .open = simple_open, |
925 | .owner = THIS_MODULE, | 813 | .owner = THIS_MODULE, |
926 | .llseek = default_llseek, | 814 | .llseek = default_llseek, |
@@ -1586,6 +1474,250 @@ static const struct file_operations fops_samps = { | |||
1586 | 1474 | ||
1587 | #endif | 1475 | #endif |
1588 | 1476 | ||
1477 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT | ||
1478 | static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, | ||
1479 | size_t count, loff_t *ppos) | ||
1480 | { | ||
1481 | struct ath_softc *sc = file->private_data; | ||
1482 | u32 len = 0, size = 1500; | ||
1483 | char *buf; | ||
1484 | size_t retval; | ||
1485 | |||
1486 | buf = kzalloc(size, GFP_KERNEL); | ||
1487 | if (buf == NULL) | ||
1488 | return -ENOMEM; | ||
1489 | |||
1490 | if (!sc->sc_ah->common.btcoex_enabled) { | ||
1491 | len = snprintf(buf, size, "%s\n", | ||
1492 | "BTCOEX is disabled"); | ||
1493 | goto exit; | ||
1494 | } | ||
1495 | |||
1496 | len = ath9k_dump_btcoex(sc, buf, size); | ||
1497 | exit: | ||
1498 | retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
1499 | kfree(buf); | ||
1500 | |||
1501 | return retval; | ||
1502 | } | ||
1503 | |||
1504 | static const struct file_operations fops_btcoex = { | ||
1505 | .read = read_file_btcoex, | ||
1506 | .open = simple_open, | ||
1507 | .owner = THIS_MODULE, | ||
1508 | .llseek = default_llseek, | ||
1509 | }; | ||
1510 | #endif | ||
1511 | |||
1512 | static ssize_t read_file_node_stat(struct file *file, char __user *user_buf, | ||
1513 | size_t count, loff_t *ppos) | ||
1514 | { | ||
1515 | struct ath_node *an = file->private_data; | ||
1516 | struct ath_softc *sc = an->sc; | ||
1517 | struct ath_atx_tid *tid; | ||
1518 | struct ath_atx_ac *ac; | ||
1519 | struct ath_txq *txq; | ||
1520 | u32 len = 0, size = 4096; | ||
1521 | char *buf; | ||
1522 | size_t retval; | ||
1523 | int tidno, acno; | ||
1524 | |||
1525 | buf = kzalloc(size, GFP_KERNEL); | ||
1526 | if (buf == NULL) | ||
1527 | return -ENOMEM; | ||
1528 | |||
1529 | if (!an->sta->ht_cap.ht_supported) { | ||
1530 | len = snprintf(buf, size, "%s\n", | ||
1531 | "HT not supported"); | ||
1532 | goto exit; | ||
1533 | } | ||
1534 | |||
1535 | len = snprintf(buf, size, "Max-AMPDU: %d\n", | ||
1536 | an->maxampdu); | ||
1537 | len += snprintf(buf + len, size - len, "MPDU Density: %d\n\n", | ||
1538 | an->mpdudensity); | ||
1539 | |||
1540 | len += snprintf(buf + len, size - len, | ||
1541 | "%2s%7s\n", "AC", "SCHED"); | ||
1542 | |||
1543 | for (acno = 0, ac = &an->ac[acno]; | ||
1544 | acno < IEEE80211_NUM_ACS; acno++, ac++) { | ||
1545 | txq = ac->txq; | ||
1546 | ath_txq_lock(sc, txq); | ||
1547 | len += snprintf(buf + len, size - len, | ||
1548 | "%2d%7d\n", | ||
1549 | acno, ac->sched); | ||
1550 | ath_txq_unlock(sc, txq); | ||
1551 | } | ||
1552 | |||
1553 | len += snprintf(buf + len, size - len, | ||
1554 | "\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n", | ||
1555 | "TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE", | ||
1556 | "BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED"); | ||
1557 | |||
1558 | for (tidno = 0, tid = &an->tid[tidno]; | ||
1559 | tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { | ||
1560 | txq = tid->ac->txq; | ||
1561 | ath_txq_lock(sc, txq); | ||
1562 | len += snprintf(buf + len, size - len, | ||
1563 | "%3d%11d%10d%10d%10d%10d%9d%6d%8d\n", | ||
1564 | tid->tidno, tid->seq_start, tid->seq_next, | ||
1565 | tid->baw_size, tid->baw_head, tid->baw_tail, | ||
1566 | tid->bar_index, tid->sched, tid->paused); | ||
1567 | ath_txq_unlock(sc, txq); | ||
1568 | } | ||
1569 | exit: | ||
1570 | retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
1571 | kfree(buf); | ||
1572 | |||
1573 | return retval; | ||
1574 | } | ||
1575 | |||
1576 | static const struct file_operations fops_node_stat = { | ||
1577 | .read = read_file_node_stat, | ||
1578 | .open = simple_open, | ||
1579 | .owner = THIS_MODULE, | ||
1580 | .llseek = default_llseek, | ||
1581 | }; | ||
1582 | |||
1583 | void ath9k_sta_add_debugfs(struct ieee80211_hw *hw, | ||
1584 | struct ieee80211_vif *vif, | ||
1585 | struct ieee80211_sta *sta, | ||
1586 | struct dentry *dir) | ||
1587 | { | ||
1588 | struct ath_node *an = (struct ath_node *)sta->drv_priv; | ||
1589 | an->node_stat = debugfs_create_file("node_stat", S_IRUGO, | ||
1590 | dir, an, &fops_node_stat); | ||
1591 | } | ||
1592 | |||
1593 | void ath9k_sta_remove_debugfs(struct ieee80211_hw *hw, | ||
1594 | struct ieee80211_vif *vif, | ||
1595 | struct ieee80211_sta *sta, | ||
1596 | struct dentry *dir) | ||
1597 | { | ||
1598 | struct ath_node *an = (struct ath_node *)sta->drv_priv; | ||
1599 | debugfs_remove(an->node_stat); | ||
1600 | } | ||
1601 | |||
1602 | /* Ethtool support for get-stats */ | ||
1603 | |||
1604 | #define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO" | ||
1605 | static const char ath9k_gstrings_stats[][ETH_GSTRING_LEN] = { | ||
1606 | "tx_pkts_nic", | ||
1607 | "tx_bytes_nic", | ||
1608 | "rx_pkts_nic", | ||
1609 | "rx_bytes_nic", | ||
1610 | AMKSTR(d_tx_pkts), | ||
1611 | AMKSTR(d_tx_bytes), | ||
1612 | AMKSTR(d_tx_mpdus_queued), | ||
1613 | AMKSTR(d_tx_mpdus_completed), | ||
1614 | AMKSTR(d_tx_mpdu_xretries), | ||
1615 | AMKSTR(d_tx_aggregates), | ||
1616 | AMKSTR(d_tx_ampdus_queued_hw), | ||
1617 | AMKSTR(d_tx_ampdus_queued_sw), | ||
1618 | AMKSTR(d_tx_ampdus_completed), | ||
1619 | AMKSTR(d_tx_ampdu_retries), | ||
1620 | AMKSTR(d_tx_ampdu_xretries), | ||
1621 | AMKSTR(d_tx_fifo_underrun), | ||
1622 | AMKSTR(d_tx_op_exceeded), | ||
1623 | AMKSTR(d_tx_timer_expiry), | ||
1624 | AMKSTR(d_tx_desc_cfg_err), | ||
1625 | AMKSTR(d_tx_data_underrun), | ||
1626 | AMKSTR(d_tx_delim_underrun), | ||
1627 | "d_rx_decrypt_crc_err", | ||
1628 | "d_rx_phy_err", | ||
1629 | "d_rx_mic_err", | ||
1630 | "d_rx_pre_delim_crc_err", | ||
1631 | "d_rx_post_delim_crc_err", | ||
1632 | "d_rx_decrypt_busy_err", | ||
1633 | |||
1634 | "d_rx_phyerr_radar", | ||
1635 | "d_rx_phyerr_ofdm_timing", | ||
1636 | "d_rx_phyerr_cck_timing", | ||
1637 | |||
1638 | }; | ||
1639 | #define ATH9K_SSTATS_LEN ARRAY_SIZE(ath9k_gstrings_stats) | ||
1640 | |||
1641 | void ath9k_get_et_strings(struct ieee80211_hw *hw, | ||
1642 | struct ieee80211_vif *vif, | ||
1643 | u32 sset, u8 *data) | ||
1644 | { | ||
1645 | if (sset == ETH_SS_STATS) | ||
1646 | memcpy(data, *ath9k_gstrings_stats, | ||
1647 | sizeof(ath9k_gstrings_stats)); | ||
1648 | } | ||
1649 | |||
1650 | int ath9k_get_et_sset_count(struct ieee80211_hw *hw, | ||
1651 | struct ieee80211_vif *vif, int sset) | ||
1652 | { | ||
1653 | if (sset == ETH_SS_STATS) | ||
1654 | return ATH9K_SSTATS_LEN; | ||
1655 | return 0; | ||
1656 | } | ||
1657 | |||
1658 | #define AWDATA(elem) \ | ||
1659 | do { \ | ||
1660 | data[i++] = sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].elem; \ | ||
1661 | data[i++] = sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BK)].elem; \ | ||
1662 | data[i++] = sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VI)].elem; \ | ||
1663 | data[i++] = sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VO)].elem; \ | ||
1664 | } while (0) | ||
1665 | |||
1666 | #define AWDATA_RX(elem) \ | ||
1667 | do { \ | ||
1668 | data[i++] = sc->debug.stats.rxstats.elem; \ | ||
1669 | } while (0) | ||
1670 | |||
1671 | void ath9k_get_et_stats(struct ieee80211_hw *hw, | ||
1672 | struct ieee80211_vif *vif, | ||
1673 | struct ethtool_stats *stats, u64 *data) | ||
1674 | { | ||
1675 | struct ath_softc *sc = hw->priv; | ||
1676 | int i = 0; | ||
1677 | |||
1678 | data[i++] = (sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_pkts_all + | ||
1679 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BK)].tx_pkts_all + | ||
1680 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VI)].tx_pkts_all + | ||
1681 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VO)].tx_pkts_all); | ||
1682 | data[i++] = (sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BE)].tx_bytes_all + | ||
1683 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_BK)].tx_bytes_all + | ||
1684 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VI)].tx_bytes_all + | ||
1685 | sc->debug.stats.txstats[PR_QNUM(IEEE80211_AC_VO)].tx_bytes_all); | ||
1686 | AWDATA_RX(rx_pkts_all); | ||
1687 | AWDATA_RX(rx_bytes_all); | ||
1688 | |||
1689 | AWDATA(tx_pkts_all); | ||
1690 | AWDATA(tx_bytes_all); | ||
1691 | AWDATA(queued); | ||
1692 | AWDATA(completed); | ||
1693 | AWDATA(xretries); | ||
1694 | AWDATA(a_aggr); | ||
1695 | AWDATA(a_queued_hw); | ||
1696 | AWDATA(a_queued_sw); | ||
1697 | AWDATA(a_completed); | ||
1698 | AWDATA(a_retries); | ||
1699 | AWDATA(a_xretries); | ||
1700 | AWDATA(fifo_underrun); | ||
1701 | AWDATA(xtxop); | ||
1702 | AWDATA(timer_exp); | ||
1703 | AWDATA(desc_cfg_err); | ||
1704 | AWDATA(data_underrun); | ||
1705 | AWDATA(delim_underrun); | ||
1706 | |||
1707 | AWDATA_RX(decrypt_crc_err); | ||
1708 | AWDATA_RX(phy_err); | ||
1709 | AWDATA_RX(mic_err); | ||
1710 | AWDATA_RX(pre_delim_crc_err); | ||
1711 | AWDATA_RX(post_delim_crc_err); | ||
1712 | AWDATA_RX(decrypt_busy_err); | ||
1713 | |||
1714 | AWDATA_RX(phy_err_stats[ATH9K_PHYERR_RADAR]); | ||
1715 | AWDATA_RX(phy_err_stats[ATH9K_PHYERR_OFDM_TIMING]); | ||
1716 | AWDATA_RX(phy_err_stats[ATH9K_PHYERR_CCK_TIMING]); | ||
1717 | |||
1718 | WARN_ON(i != ATH9K_SSTATS_LEN); | ||
1719 | } | ||
1720 | |||
1589 | int ath9k_init_debug(struct ath_hw *ah) | 1721 | int ath9k_init_debug(struct ath_hw *ah) |
1590 | { | 1722 | { |
1591 | struct ath_common *common = ath9k_hw_common(ah); | 1723 | struct ath_common *common = ath9k_hw_common(ah); |
@@ -1609,16 +1741,16 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
1609 | &fops_interrupt); | 1741 | &fops_interrupt); |
1610 | debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, | 1742 | debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, |
1611 | &fops_xmit); | 1743 | &fops_xmit); |
1744 | debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc, | ||
1745 | &fops_queues); | ||
1612 | debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1746 | debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
1613 | &sc->tx.txq_max_pending[WME_AC_BK]); | 1747 | &sc->tx.txq_max_pending[IEEE80211_AC_BK]); |
1614 | debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1748 | debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
1615 | &sc->tx.txq_max_pending[WME_AC_BE]); | 1749 | &sc->tx.txq_max_pending[IEEE80211_AC_BE]); |
1616 | debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1750 | debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
1617 | &sc->tx.txq_max_pending[WME_AC_VI]); | 1751 | &sc->tx.txq_max_pending[IEEE80211_AC_VI]); |
1618 | debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, | 1752 | debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, |
1619 | &sc->tx.txq_max_pending[WME_AC_VO]); | 1753 | &sc->tx.txq_max_pending[IEEE80211_AC_VO]); |
1620 | debugfs_create_file("stations", S_IRUSR, sc->debug.debugfs_phy, sc, | ||
1621 | &fops_stations); | ||
1622 | debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, | 1754 | debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, |
1623 | &fops_misc); | 1755 | &fops_misc); |
1624 | debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc, | 1756 | debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc, |
@@ -1658,6 +1790,9 @@ int ath9k_init_debug(struct ath_hw *ah) | |||
1658 | sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); | 1790 | sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); |
1659 | debugfs_create_file("diversity", S_IRUSR | S_IWUSR, | 1791 | debugfs_create_file("diversity", S_IRUSR | S_IWUSR, |
1660 | sc->debug.debugfs_phy, sc, &fops_ant_diversity); | 1792 | sc->debug.debugfs_phy, sc, &fops_ant_diversity); |
1661 | 1793 | #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT | |
1794 | debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc, | ||
1795 | &fops_btcoex); | ||
1796 | #endif | ||
1662 | return 0; | 1797 | return 0; |
1663 | } | 1798 | } |