aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2015-01-24 05:14:49 -0500
committerKalle Valo <kvalo@qca.qualcomm.com>2015-01-27 09:04:46 -0500
commitb91251fbe88c9db1a7af29cfe49ca50aa4da9cd2 (patch)
tree6e72c7f27877bf33cd407948aa44cd90cf637326 /drivers/net/wireless
parentd63955b33b3bee45d784ffdfafeb93076c765660 (diff)
ath10k: split fw pdev stats parsing
This will make it easier to implement fw stats parsing for firmware 10.2. This also renames a few structures for consistency. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c117
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.h55
2 files changed, 100 insertions, 72 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 5fe17e80bc6b..ce095dac5b44 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1680,12 +1680,9 @@ int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
1680 return 0; 1680 return 0;
1681} 1681}
1682 1682
1683void ath10k_wmi_pull_pdev_stats(const struct wmi_pdev_stats *src, 1683void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
1684 struct ath10k_fw_stats_pdev *dst) 1684 struct ath10k_fw_stats_pdev *dst)
1685{ 1685{
1686 const struct wal_dbg_tx_stats *tx = &src->wal.tx;
1687 const struct wal_dbg_rx_stats *rx = &src->wal.rx;
1688
1689 dst->ch_noise_floor = __le32_to_cpu(src->chan_nf); 1686 dst->ch_noise_floor = __le32_to_cpu(src->chan_nf);
1690 dst->tx_frame_count = __le32_to_cpu(src->tx_frame_count); 1687 dst->tx_frame_count = __le32_to_cpu(src->tx_frame_count);
1691 dst->rx_frame_count = __le32_to_cpu(src->rx_frame_count); 1688 dst->rx_frame_count = __le32_to_cpu(src->rx_frame_count);
@@ -1693,44 +1690,63 @@ void ath10k_wmi_pull_pdev_stats(const struct wmi_pdev_stats *src,
1693 dst->cycle_count = __le32_to_cpu(src->cycle_count); 1690 dst->cycle_count = __le32_to_cpu(src->cycle_count);
1694 dst->phy_err_count = __le32_to_cpu(src->phy_err_count); 1691 dst->phy_err_count = __le32_to_cpu(src->phy_err_count);
1695 dst->chan_tx_power = __le32_to_cpu(src->chan_tx_pwr); 1692 dst->chan_tx_power = __le32_to_cpu(src->chan_tx_pwr);
1693}
1696 1694
1697 dst->comp_queued = __le32_to_cpu(tx->comp_queued); 1695void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
1698 dst->comp_delivered = __le32_to_cpu(tx->comp_delivered); 1696 struct ath10k_fw_stats_pdev *dst)
1699 dst->msdu_enqued = __le32_to_cpu(tx->msdu_enqued); 1697{
1700 dst->mpdu_enqued = __le32_to_cpu(tx->mpdu_enqued); 1698 dst->comp_queued = __le32_to_cpu(src->comp_queued);
1701 dst->wmm_drop = __le32_to_cpu(tx->wmm_drop); 1699 dst->comp_delivered = __le32_to_cpu(src->comp_delivered);
1702 dst->local_enqued = __le32_to_cpu(tx->local_enqued); 1700 dst->msdu_enqued = __le32_to_cpu(src->msdu_enqued);
1703 dst->local_freed = __le32_to_cpu(tx->local_freed); 1701 dst->mpdu_enqued = __le32_to_cpu(src->mpdu_enqued);
1704 dst->hw_queued = __le32_to_cpu(tx->hw_queued); 1702 dst->wmm_drop = __le32_to_cpu(src->wmm_drop);
1705 dst->hw_reaped = __le32_to_cpu(tx->hw_reaped); 1703 dst->local_enqued = __le32_to_cpu(src->local_enqued);
1706 dst->underrun = __le32_to_cpu(tx->underrun); 1704 dst->local_freed = __le32_to_cpu(src->local_freed);
1707 dst->tx_abort = __le32_to_cpu(tx->tx_abort); 1705 dst->hw_queued = __le32_to_cpu(src->hw_queued);
1708 dst->mpdus_requed = __le32_to_cpu(tx->mpdus_requed); 1706 dst->hw_reaped = __le32_to_cpu(src->hw_reaped);
1709 dst->tx_ko = __le32_to_cpu(tx->tx_ko); 1707 dst->underrun = __le32_to_cpu(src->underrun);
1710 dst->data_rc = __le32_to_cpu(tx->data_rc); 1708 dst->tx_abort = __le32_to_cpu(src->tx_abort);
1711 dst->self_triggers = __le32_to_cpu(tx->self_triggers); 1709 dst->mpdus_requed = __le32_to_cpu(src->mpdus_requed);
1712 dst->sw_retry_failure = __le32_to_cpu(tx->sw_retry_failure); 1710 dst->tx_ko = __le32_to_cpu(src->tx_ko);
1713 dst->illgl_rate_phy_err = __le32_to_cpu(tx->illgl_rate_phy_err); 1711 dst->data_rc = __le32_to_cpu(src->data_rc);
1714 dst->pdev_cont_xretry = __le32_to_cpu(tx->pdev_cont_xretry); 1712 dst->self_triggers = __le32_to_cpu(src->self_triggers);
1715 dst->pdev_tx_timeout = __le32_to_cpu(tx->pdev_tx_timeout); 1713 dst->sw_retry_failure = __le32_to_cpu(src->sw_retry_failure);
1716 dst->pdev_resets = __le32_to_cpu(tx->pdev_resets); 1714 dst->illgl_rate_phy_err = __le32_to_cpu(src->illgl_rate_phy_err);
1717 dst->phy_underrun = __le32_to_cpu(tx->phy_underrun); 1715 dst->pdev_cont_xretry = __le32_to_cpu(src->pdev_cont_xretry);
1718 dst->txop_ovf = __le32_to_cpu(tx->txop_ovf); 1716 dst->pdev_tx_timeout = __le32_to_cpu(src->pdev_tx_timeout);
1719 1717 dst->pdev_resets = __le32_to_cpu(src->pdev_resets);
1720 dst->mid_ppdu_route_change = __le32_to_cpu(rx->mid_ppdu_route_change); 1718 dst->phy_underrun = __le32_to_cpu(src->phy_underrun);
1721 dst->status_rcvd = __le32_to_cpu(rx->status_rcvd); 1719 dst->txop_ovf = __le32_to_cpu(src->txop_ovf);
1722 dst->r0_frags = __le32_to_cpu(rx->r0_frags); 1720}
1723 dst->r1_frags = __le32_to_cpu(rx->r1_frags); 1721
1724 dst->r2_frags = __le32_to_cpu(rx->r2_frags); 1722void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
1725 dst->r3_frags = __le32_to_cpu(rx->r3_frags); 1723 struct ath10k_fw_stats_pdev *dst)
1726 dst->htt_msdus = __le32_to_cpu(rx->htt_msdus); 1724{
1727 dst->htt_mpdus = __le32_to_cpu(rx->htt_mpdus); 1725 dst->mid_ppdu_route_change = __le32_to_cpu(src->mid_ppdu_route_change);
1728 dst->loc_msdus = __le32_to_cpu(rx->loc_msdus); 1726 dst->status_rcvd = __le32_to_cpu(src->status_rcvd);
1729 dst->loc_mpdus = __le32_to_cpu(rx->loc_mpdus); 1727 dst->r0_frags = __le32_to_cpu(src->r0_frags);
1730 dst->oversize_amsdu = __le32_to_cpu(rx->oversize_amsdu); 1728 dst->r1_frags = __le32_to_cpu(src->r1_frags);
1731 dst->phy_errs = __le32_to_cpu(rx->phy_errs); 1729 dst->r2_frags = __le32_to_cpu(src->r2_frags);
1732 dst->phy_err_drop = __le32_to_cpu(rx->phy_err_drop); 1730 dst->r3_frags = __le32_to_cpu(src->r3_frags);
1733 dst->mpdu_errs = __le32_to_cpu(rx->mpdu_errs); 1731 dst->htt_msdus = __le32_to_cpu(src->htt_msdus);
1732 dst->htt_mpdus = __le32_to_cpu(src->htt_mpdus);
1733 dst->loc_msdus = __le32_to_cpu(src->loc_msdus);
1734 dst->loc_mpdus = __le32_to_cpu(src->loc_mpdus);
1735 dst->oversize_amsdu = __le32_to_cpu(src->oversize_amsdu);
1736 dst->phy_errs = __le32_to_cpu(src->phy_errs);
1737 dst->phy_err_drop = __le32_to_cpu(src->phy_err_drop);
1738 dst->mpdu_errs = __le32_to_cpu(src->mpdu_errs);
1739}
1740
1741void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
1742 struct ath10k_fw_stats_pdev *dst)
1743{
1744 dst->ack_rx_bad = __le32_to_cpu(src->ack_rx_bad);
1745 dst->rts_bad = __le32_to_cpu(src->rts_bad);
1746 dst->rts_good = __le32_to_cpu(src->rts_good);
1747 dst->fcs_bad = __le32_to_cpu(src->fcs_bad);
1748 dst->no_beacons = __le32_to_cpu(src->no_beacons);
1749 dst->mib_int_count = __le32_to_cpu(src->mib_int_count);
1734} 1750}
1735 1751
1736void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src, 1752void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
@@ -1768,7 +1784,10 @@ static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k *ar,
1768 if (!dst) 1784 if (!dst)
1769 continue; 1785 continue;
1770 1786
1771 ath10k_wmi_pull_pdev_stats(src, dst); 1787 ath10k_wmi_pull_pdev_stats_base(&src->base, dst);
1788 ath10k_wmi_pull_pdev_stats_tx(&src->tx, dst);
1789 ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
1790
1772 list_add_tail(&dst->list, &stats->pdevs); 1791 list_add_tail(&dst->list, &stats->pdevs);
1773 } 1792 }
1774 1793
@@ -1820,14 +1839,10 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar,
1820 if (!dst) 1839 if (!dst)
1821 continue; 1840 continue;
1822 1841
1823 ath10k_wmi_pull_pdev_stats(&src->old, dst); 1842 ath10k_wmi_pull_pdev_stats_base(&src->base, dst);
1824 1843 ath10k_wmi_pull_pdev_stats_tx(&src->tx, dst);
1825 dst->ack_rx_bad = __le32_to_cpu(src->ack_rx_bad); 1844 ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
1826 dst->rts_bad = __le32_to_cpu(src->rts_bad); 1845 ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);
1827 dst->rts_good = __le32_to_cpu(src->rts_good);
1828 dst->fcs_bad = __le32_to_cpu(src->fcs_bad);
1829 dst->no_beacons = __le32_to_cpu(src->no_beacons);
1830 dst->mib_int_count = __le32_to_cpu(src->mib_int_count);
1831 1846
1832 list_add_tail(&dst->list, &stats->pdevs); 1847 list_add_tail(&dst->list, &stats->pdevs);
1833 } 1848 }
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index bd7f29a3a122..109ed623b82f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2946,7 +2946,7 @@ struct wmi_pdev_set_wmm_params_arg {
2946 struct wmi_wmm_params_arg ac_vo; 2946 struct wmi_wmm_params_arg ac_vo;
2947}; 2947};
2948 2948
2949struct wal_dbg_tx_stats { 2949struct wmi_pdev_stats_tx {
2950 /* Num HTT cookies queued to dispatch list */ 2950 /* Num HTT cookies queued to dispatch list */
2951 __le32 comp_queued; 2951 __le32 comp_queued;
2952 2952
@@ -3016,7 +3016,7 @@ struct wal_dbg_tx_stats {
3016 __le32 txop_ovf; 3016 __le32 txop_ovf;
3017} __packed; 3017} __packed;
3018 3018
3019struct wal_dbg_rx_stats { 3019struct wmi_pdev_stats_rx {
3020 /* Cnts any change in ring routing mid-ppdu */ 3020 /* Cnts any change in ring routing mid-ppdu */
3021 __le32 mid_ppdu_route_change; 3021 __le32 mid_ppdu_route_change;
3022 3022
@@ -3050,17 +3050,11 @@ struct wal_dbg_rx_stats {
3050 __le32 mpdu_errs; 3050 __le32 mpdu_errs;
3051} __packed; 3051} __packed;
3052 3052
3053struct wal_dbg_peer_stats { 3053struct wmi_pdev_stats_peer {
3054 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */ 3054 /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
3055 __le32 dummy; 3055 __le32 dummy;
3056} __packed; 3056} __packed;
3057 3057
3058struct wal_dbg_stats {
3059 struct wal_dbg_tx_stats tx;
3060 struct wal_dbg_rx_stats rx;
3061 struct wal_dbg_peer_stats peer;
3062} __packed;
3063
3064enum wmi_stats_id { 3058enum wmi_stats_id {
3065 WMI_REQUEST_PEER_STAT = 0x01, 3059 WMI_REQUEST_PEER_STAT = 0x01,
3066 WMI_REQUEST_AP_STAT = 0x02 3060 WMI_REQUEST_AP_STAT = 0x02
@@ -3131,19 +3125,24 @@ struct wmi_stats_event {
3131 * PDEV statistics 3125 * PDEV statistics
3132 * TODO: add all PDEV stats here 3126 * TODO: add all PDEV stats here
3133 */ 3127 */
3128struct wmi_pdev_stats_base {
3129 __le32 chan_nf;
3130 __le32 tx_frame_count;
3131 __le32 rx_frame_count;
3132 __le32 rx_clear_count;
3133 __le32 cycle_count;
3134 __le32 phy_err_count;
3135 __le32 chan_tx_pwr;
3136} __packed;
3137
3134struct wmi_pdev_stats { 3138struct wmi_pdev_stats {
3135 __le32 chan_nf; /* Channel noise floor */ 3139 struct wmi_pdev_stats_base base;
3136 __le32 tx_frame_count; /* TX frame count */ 3140 struct wmi_pdev_stats_tx tx;
3137 __le32 rx_frame_count; /* RX frame count */ 3141 struct wmi_pdev_stats_rx rx;
3138 __le32 rx_clear_count; /* rx clear count */ 3142 struct wmi_pdev_stats_peer peer;
3139 __le32 cycle_count; /* cycle count */
3140 __le32 phy_err_count; /* Phy error count */
3141 __le32 chan_tx_pwr; /* channel tx power */
3142 struct wal_dbg_stats wal; /* WAL dbg stats */
3143} __packed; 3143} __packed;
3144 3144
3145struct wmi_10x_pdev_stats { 3145struct wmi_pdev_stats_extra {
3146 struct wmi_pdev_stats old;
3147 __le32 ack_rx_bad; 3146 __le32 ack_rx_bad;
3148 __le32 rts_bad; 3147 __le32 rts_bad;
3149 __le32 rts_good; 3148 __le32 rts_good;
@@ -3152,6 +3151,14 @@ struct wmi_10x_pdev_stats {
3152 __le32 mib_int_count; 3151 __le32 mib_int_count;
3153} __packed; 3152} __packed;
3154 3153
3154struct wmi_10x_pdev_stats {
3155 struct wmi_pdev_stats_base base;
3156 struct wmi_pdev_stats_tx tx;
3157 struct wmi_pdev_stats_rx rx;
3158 struct wmi_pdev_stats_peer peer;
3159 struct wmi_pdev_stats_extra extra;
3160} __packed;
3161
3155/* 3162/*
3156 * VDEV statistics 3163 * VDEV statistics
3157 * TODO: add all VDEV stats here 3164 * TODO: add all VDEV stats here
@@ -4772,8 +4779,14 @@ int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,
4772 u32 cmd_id); 4779 u32 cmd_id);
4773void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *); 4780void ath10k_wmi_start_scan_init(struct ath10k *ar, struct wmi_start_scan_arg *);
4774 4781
4775void ath10k_wmi_pull_pdev_stats(const struct wmi_pdev_stats *src, 4782void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base *src,
4776 struct ath10k_fw_stats_pdev *dst); 4783 struct ath10k_fw_stats_pdev *dst);
4784void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx *src,
4785 struct ath10k_fw_stats_pdev *dst);
4786void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx *src,
4787 struct ath10k_fw_stats_pdev *dst);
4788void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra *src,
4789 struct ath10k_fw_stats_pdev *dst);
4777void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src, 4790void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats *src,
4778 struct ath10k_fw_stats_peer *dst); 4791 struct ath10k_fw_stats_peer *dst);
4779void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar, 4792void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar,