diff options
author | Rakesh Pillai <pillair@codeaurora.org> | 2017-08-10 20:17:37 +0530 |
---|---|---|
committer | Rakesh Pillai <pillair@codeaurora.org> | 2017-08-14 12:18:22 +0530 |
commit | 473722a7fce16c7fb5b7802904c34921bb8415fd (patch) | |
tree | 7de8a5615209c4f3675500047f30e00be0300de5 /drivers/net/wireless/ath/ath10k/debug.c | |
parent | 2e035860df80737a7885e61dfc0e37cf14672494 (diff) |
ath10k: Enable pktlog for rx data packets
Pktlog was not enabled for rx data packets.
Enable pktlog capture for rx data packets.
CRs-Fixed: 2091228
Change-Id: I8f489065081ba4da7ad7f5b8e271272279124abc
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.c | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index cb152bb4a222..42aab9b86af3 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2644,14 +2644,14 @@ static void ath10k_process_ieee_hdr(void *data) dir = (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK); if (dir == IEEE80211_FC1_DIR_TODS) - ath10k_extract_frame_header(&wh->i_addr1, &wh->i_addr2, - &wh->i_addr3); + ath10k_extract_frame_header(wh->i_addr1, wh->i_addr2, + wh->i_addr3); else if (dir == IEEE80211_FC1_DIR_FROMDS) - ath10k_extract_frame_header(&wh->i_addr2, &wh->i_addr3, - &wh->i_addr1); + ath10k_extract_frame_header(wh->i_addr2, wh->i_addr3, + wh->i_addr1); else - ath10k_extract_frame_header(&wh->i_addr3, &wh->i_addr2, - &wh->i_addr1); + ath10k_extract_frame_header(wh->i_addr3, wh->i_addr2, + wh->i_addr1); } static void ath10k_pktlog_process_rx(struct ath10k *ar, struct sk_buff *skb) @@ -2717,6 +2717,46 @@ static void ath10k_pktlog_process_rx(struct ath10k *ar, struct sk_buff *skb) } } +int ath10k_rx_record_pktlog(struct ath10k *ar, struct sk_buff *skb) +{ + struct sk_buff *pktlog_skb; + struct ath_pktlog_hdr *pl_hdr; + struct ath_pktlog_rx_info *pktlog_rx_info; + struct htt_rx_desc *rx_desc = (void *)skb->data - sizeof(*rx_desc); + + if (!ar->debug.pktlog_filter) + return 0; + + pktlog_skb = dev_alloc_skb(sizeof(struct ath_pktlog_hdr) + + sizeof(struct htt_rx_desc) - + sizeof(struct htt_host_fw_desc_base)); + if (!pktlog_skb) + return -ENOMEM; + + pktlog_rx_info = (struct ath_pktlog_rx_info *)pktlog_skb->data; + pl_hdr = &pktlog_rx_info->pl_hdr; + + pl_hdr->flags = (1 << ATH10K_PKTLOG_FLG_FRM_TYPE_REMOTE_S); + pl_hdr->missed_cnt = 0; + pl_hdr->mac_id = 0; + pl_hdr->log_type = ATH10K_PKTLOG_TYPE_RX_STAT; + pl_hdr->flags |= ATH10K_PKTLOG_HDR_SIZE_16; + pl_hdr->size = sizeof(*rx_desc) - + sizeof(struct htt_host_fw_desc_base); + + pl_hdr->timestamp = + cpu_to_le32(rx_desc->ppdu_end.wcn3990.rx_pkt_end.phy_timestamp_1); + + pl_hdr->type_specific_data = 0xDEADAA; + memcpy((void *)pktlog_rx_info + sizeof(struct ath_pktlog_hdr), + (void *)rx_desc + sizeof(struct htt_host_fw_desc_base), + pl_hdr->size); + + ath10k_pktlog_process_rx(ar, pktlog_skb); + dev_kfree_skb_any(pktlog_skb); + return 0; +} + static void ath10k_pktlog_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb) { |