Skip to contentSkip to conversation

ath11k: cleanup in htt pktlog

PATCH In review Anilkumar Kolli 2 participants 2 messages Jun 12, 2019 – Jun 17, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ath11k: cleanup in htt pktlog

Addressed below comments,
* debug: move enum ath11k_wmi_pktlog_enable to wmi.h
* dp_rx: ath11k_htt_pktlog(): 'u32 *data' needs a proper struct, avoids pointer arithmetic.

---
V2:
- addressed sathish's comments

 drivers/net/wireless/ath/ath11k/debug.h |  5 -----
 drivers/net/wireless/ath/ath11k/dp.h    | 39 +++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/dp_rx.c | 10 ++++-----
 drivers/net/wireless/ath/ath11k/wmi.h   |  5 +++++
 4 files changed, 49 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/debug.h +0 -5
index 13973d972169..5774f531f268 100644
@@ -80,11 +80,6 @@ enum ath11k_pktlog_filter {
 	ATH11K_PKTLOG_ANY		= 0x00000006f,
 };
 
-enum ath11k_wmi_pktlog_enable {
-    ATH11K_WMI_PKTLOG_ENABLE_AUTO  = 0,
-    ATH11K_WMI_PKTLOG_ENABLE_FORCE = 1,
-};
-
 enum ath11k_pktlog_mode {
 	ATH11K_PKTLOG_MODE_LITE = 1,
 	ATH11K_PKTLOG_MODE_FULL = 2,
drivers/net/wireless/ath/ath11k/dp.h +39 -0
index 79b665816378..a4b32abbeaee 100644
@@ -1214,6 +1214,45 @@ struct htt_ppdu_stats_info {
 };
 
 /**
+ * @brief target -> host packet log message
+ *
+ * @details
+ * The following field definitions describe the format of the packet log
+ * message sent from the target to the host.
+ * The message consists of a 4-octet header,followed by a variable number
+ * of 32-bit character values.
+ *
+ * |31                         16|15  12|11   10|9    8|7            0|
+ * |------------------------------------------------------------------|
+ * |        payload_size         | rsvd |pdev_id|mac_id|   msg type   |
+ * |------------------------------------------------------------------|
+ * |                              payload                             |
+ * |------------------------------------------------------------------|
+ *   - MSG_TYPE
+ *     Bits 7:0
+ *     Purpose: identifies this as a pktlog message
+ *     Value: HTT_T2H_MSG_TYPE_PKTLOG
+ *   - mac_id
+ *     Bits 9:8
+ *     Purpose: identifies which MAC/PHY instance generated this pktlog info
+ *     Value: 0-3
+ *   - pdev_id
+ *     Bits 11:10
+ *     Purpose: pdev_id
+ *     Value: 0-3
+ *     0 (for rings at SOC level),
+ *     1/2/3 PDEV -> 0/1/2
+ *   - payload_size
+ *     Bits 31:16
+ *     Purpose: explicitly specify the payload size
+ *     Value: payload size in bytes (payload size is a multiple of 4 bytes)
+ */
+struct htt_pktlog_msg {
+	u32 hdr;
+	u8 payload[0];
+};
+
+/**
  * @brief host -> target FW extended statistics retrieve
  *
  * @details
drivers/net/wireless/ath/ath11k/dp_rx.c +5 -5
index 59d2605c0ce2..e18ca4c0cda4 100644
@@ -1084,11 +1084,12 @@ static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab,
 static void ath11k_htt_pktlog(struct ath11k_base *ab,
 				     struct sk_buff *skb)
 {
-	u32 *data = (u32 *)skb->data, len;
+	struct htt_pktlog_msg *data = (struct htt_pktlog_msg *)skb->data;
 	struct ath11k *ar;
+	u32 len;
 	u8 pdev_id;
 
-	len = FIELD_GET(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M, *data);
+	len = FIELD_GET(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M, data->hdr);
 
 	if (len > ATH11K_HTT_PKTLOG_MAX_SIZE)
 	{
@@ -1098,12 +1099,11 @@ static void ath11k_htt_pktlog(struct ath11k_base *ab,
 		return;
 	}
 
-	pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_PDEV_ID_M, *data);
+	pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_PDEV_ID_M, data->hdr);
 	pdev_id = DP_HW2SW_MACID(pdev_id);
 	ar = ab->pdevs[pdev_id].ar;
-	++data;
 
-	trace_ath11k_htt_pktlog(ar, data, len);
+	trace_ath11k_htt_pktlog(ar, data->payload, len);
 }
 
 void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,
drivers/net/wireless/ath/ath11k/wmi.h +5 -0
index f30542e2d090..d5b3de2e7e87 100644
@@ -4148,6 +4148,11 @@ struct wmi_pdev_pktlog_filter_cmd {
 	u32 num_mac;
 } __packed;
 
+enum ath11k_wmi_pktlog_enable {
+	ATH11K_WMI_PKTLOG_ENABLE_AUTO  = 0,
+	ATH11K_WMI_PKTLOG_ENABLE_FORCE = 1,
+};
+
 struct wmi_pktlog_enable_cmd {
 	u32 tlv_header;
 	u32 pdev_id;
Signature · 7 lines
1.9.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw
Quoted 7 lines · Anilkumar Kolli

Addressed below comments,
* debug: move enum ath11k_wmi_pktlog_enable to wmi.h
* dp_rx: ath11k_htt_pktlog(): 'u32 *data' needs a proper struct, avoids pointer arithmetic.

Patch applied to ath11k-bringup branch of ath.git, thanks.

3fb4abcf11d6 ath11k: cleanup in htt pktlog

Signature · 9 lines
https://patchwork.kernel.org/patch/10989367/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k