Skip to contentSkip to conversation

ath11k: removed duplicated functionality

PATCH In review Muna Sinada 2 participants 5 messages Jun 28, 2019 – Jul 16, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 ath11k: removed duplicated functionality

Removed duplicated functionality in ath11k_hal_desc_reo_parse_err() and replaced with function call to ath11k_hal_rx_reo_entl_paddr_get().

---
 drivers/net/wireless/ath/ath11k/hal_rx.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/wireless/ath/ath11k/hal_rx.c +1 -6
index 63da0d29147c..f3c0e3e13dfd 100644
@@ -351,12 +351,7 @@ int ath11k_hal_desc_reo_parse_err(struct ath11k_base *ab, u32 *rx_desc,
 		return -EINVAL;
 	}
 
-	*paddr = (((u64)FIELD_GET(BUFFER_ADDR_INFO1_ADDR,
-				  desc->buf_addr_info.info1)) << 32) |
-		FIELD_GET(BUFFER_ADDR_INFO0_ADDR,
-			  desc->buf_addr_info.info0);
-	*desc_bank = FIELD_GET(BUFFER_ADDR_INFO1_SW_COOKIE,
-			       desc->buf_addr_info.info1);
+	ath11k_hal_rx_reo_ent_paddr_get(ab, rx_desc, paddr, desc_bank);
 
 	return 0;
 }
Signature · 7 lines
2.7.4


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

PATCH v2 2/4 ath11k: changed parameter from u8 * to struct sk_buff *

Changed ath11k_hal_rx_parse_mon_status() to take sk_buff pointer instead of opaque u8 pointer. Removed variables that became unused.

---
 drivers/net/wireless/ath/ath11k/dp_rx.c  | 8 ++------
 drivers/net/wireless/ath/ath11k/hal_rx.c | 6 +++---
 drivers/net/wireless/ath/ath11k/hal_rx.h | 2 +-
 3 files changed, 6 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -6
index 9a1c24705a32..df15e446b76f 100644
@@ -2602,8 +2602,7 @@ int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
 		if (ath11k_debug_is_pktlog_rx_stats_enabled(ar))
 			trace_ath11k_htt_rxdesc(ar, skb->data, DP_RX_BUFFER_SIZE);
 
-		hal_status = ath11k_hal_rx_parse_mon_status(ab, &ppdu_info,
-							    (u8 *)skb->data);
+		hal_status = ath11k_hal_rx_parse_mon_status(ab, &ppdu_info, skb);
 
 		if (ppdu_info.peer_id == HAL_INVALID_PEERID ||
 		    hal_status != HAL_RX_MON_STATUS_PPDU_DONE) {
@@ -4026,7 +4025,6 @@ static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar,
 	struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data;
 	struct hal_rx_mon_ppdu_info *ppdu_info;
 	struct sk_buff *status_skb;
-	u8 *rx_tlv;
 	u32 tlv_status = HAL_TLV_STATUS_BUF_DONE;
 	struct ath11k_pdev_mon_stats *rx_mon_stats;
 
@@ -4039,10 +4037,8 @@ static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar,
 	while (!skb_queue_empty(&pmon->rx_status_q)) {
 		status_skb = skb_dequeue(&pmon->rx_status_q);
 
-		rx_tlv = status_skb->data;
-
 		tlv_status = ath11k_hal_rx_parse_mon_status(ar->ab, ppdu_info,
-							    rx_tlv);
+							    status_skb);
 		if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) {
 			rx_mon_stats->status_ppdu_done++;
 			pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE;
drivers/net/wireless/ath/ath11k/hal_rx.c +3 -3
index f3c0e3e13dfd..347e485e60c7 100644
@@ -1158,13 +1158,13 @@ ath11k_hal_rx_parse_mon_status_tlv(struct ath11k_base *ab,
 enum hal_rx_mon_status
 ath11k_hal_rx_parse_mon_status(struct ath11k_base *ab,
 			       struct hal_rx_mon_ppdu_info *ppdu_info,
-			       u8 *data)
+			       struct sk_buff *skb)
 {
 	struct hal_tlv_hdr *tlv;
 	enum hal_rx_mon_status hal_status = HAL_RX_MON_STATUS_BUF_DONE;
 	u16 tlv_tag;
 	u16 tlv_len;
-	u8 *ptr = data;
+	u8 *ptr = skb->data;
 
 	do {
 		tlv = (struct hal_tlv_hdr *)ptr;
@@ -1185,7 +1185,7 @@ ath11k_hal_rx_parse_mon_status(struct ath11k_base *ab,
 		ptr += tlv_len;
 		ptr = PTR_ALIGN(ptr, HAL_TLV_ALIGN);
 
-		if ((ptr - data) >= DP_RX_BUFFER_SIZE)
+		if ((ptr - skb->data) >= DP_RX_BUFFER_SIZE)
 			break;
 	} while (hal_status == HAL_RX_MON_STATUS_PPDU_NOT_DONE);
 
drivers/net/wireless/ath/ath11k/hal_rx.h +1 -1
index bd6b8d2e9d5e..2c9b19194149 100644
@@ -336,7 +336,7 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get(void *rx_desc,
 enum hal_rx_mon_status
 ath11k_hal_rx_parse_mon_status(struct ath11k_base *ab,
 			       struct hal_rx_mon_ppdu_info *ppdu_info,
-			       u8 *data);
+			       struct sk_buff *skb);
 #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_0 0xDDBEEF
 #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_1 0xADBEEF
 #define REO_QUEUE_DESC_MAGIC_DEBUG_PATTERN_2 0xBDBEEF
Signature · 7 lines
2.7.4


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

PATCH v2 3/4 ath11k: comments added to explain purpose

In reply to Muna Sinada

Added comments for ath11k_hal_tx_desc_sync() and ath11k_hal_tx_status_desc_sync() to explain their purpose.

---
 drivers/net/wireless/ath/ath11k/hal_tx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath11k/hal_tx.c +2 -0
index 3c04ebe23c22..2b1789a260d2 100644
@@ -73,12 +73,14 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,
 				    ti->bss_ast_hash);
 }
 
+/* Commit the descriptor to hardware */
 void ath11k_hal_tx_desc_sync(void *tx_desc_cached, void *hw_desc)
 {
 	memcpy(hw_desc + sizeof(struct hal_tlv_hdr), tx_desc_cached,
 	       sizeof(struct hal_tcl_data_cmd));
 }
 
+/* Get the descriptor status from hardware */
 void ath11k_hal_tx_status_desc_sync(void *hw_desc, void *local_desc)
 {
 	memcpy(local_desc, hw_desc, HAL_TX_STATUS_DESC_LEN);
Signature · 7 lines
2.7.4


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

PATCH v2 4/4 ath11k: added RMB to return_buffer_manager description

In reply to Muna Sinada

Added "(RBM)" to return_buffer_manager description to clarify what it stands for when utilized.

---
 drivers/net/wireless/ath/ath11k/hal_desc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/hal_desc.h +1 -1
index b13001d272a7..dbfb82130db6 100644
@@ -26,7 +26,7 @@ struct ath11k_buffer_addr {
  *		Address (upper 8 bits) of the msdu buffer or msdu extension
  *		descriptor or Link descriptor
  *
- * return_buffer_manager
+ * return_buffer_manager (RBM)
  *		Consumer: WBM
  *		Producer: SW/FW
  *		Indicates to which buffer manager the buffer or MSDU_EXTENSION
Signature · 7 lines
2.7.4


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw
In reply to Muna Sinada
Quoted 5 lines · Muna Sinada

Removed duplicated functionality in ath11k_hal_desc_reo_parse_err() and replaced with function call to ath11k_hal_rx_reo_entl_paddr_get().

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

3305d94f75cc ath11k: removed duplicated functionality 8bc3b7e41ab2 ath11k: changed parameter from u8 * to struct sk_buff * a9cd19921cc8 ath11k: comments added to explain purpose c6f7e826a450 ath11k: added RMB to return_buffer_manager description

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

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


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