Kaynağa Gözat

qcacmn: Reserve a TX bank for FW usage

FW has some usecases when it needs to enqueue frames into hardware. In
BE WLAN chips, some hardware TX desc fields are moved into Tx
banks, hence a TX bank is also needed to queue to HW.

Dedicate a bank for FW usage.

Change-Id: I1f19f0ef85aff4c7592b0f07de4631259da743a6
CRs-Fixed: 3016828
Mohit Khanna 3 yıl önce
ebeveyn
işleme
af4c03b546
2 değiştirilmiş dosya ile 15 ekleme ve 3 silme
  1. 4 0
      dp/wifi3.0/be/dp_be_tx.c
  2. 11 3
      hal/wifi3.0/be/hal_be_tx.h

+ 4 - 0
dp/wifi3.0/be/dp_be_tx.c

@@ -230,7 +230,10 @@ QDF_STATUS dp_tx_init_bank_profiles(struct dp_soc_be *be_soc)
 	int i, num_tcl_banks;
 
 	num_tcl_banks = hal_tx_get_num_tcl_banks(be_soc->soc.hal_soc);
+
+	qdf_assert_always(num_tcl_banks);
 	be_soc->num_bank_profiles = num_tcl_banks;
+
 	be_soc->bank_profiles = qdf_mem_malloc(num_tcl_banks *
 					       sizeof(*be_soc->bank_profiles));
 	if (!be_soc->bank_profiles) {
@@ -244,6 +247,7 @@ QDF_STATUS dp_tx_init_bank_profiles(struct dp_soc_be *be_soc)
 		be_soc->bank_profiles[i].is_configured = false;
 		qdf_atomic_init(&be_soc->bank_profiles[i].ref_count);
 	}
+	dp_info("initialized %u bank profiles", be_soc->num_bank_profiles);
 	return QDF_STATUS_SUCCESS;
 }
 

+ 11 - 3
hal/wifi3.0/be/hal_be_tx.h

@@ -22,6 +22,10 @@
 #include "hal_be_hw_headers.h"
 #include "hal_tx.h"
 
+/* Number of TX banks reserved i.e, will not be used by host driver. */
+/* MAX_TCL_BANK reserved for FW use */
+#define HAL_TX_NUM_RESERVED_BANKS 1
+
 enum hal_be_tx_ret_buf_manager {
 	HAL_BE_WBM_SW0_BM_ID = 5,
 	HAL_BE_WBM_SW1_BM_ID = 6,
@@ -416,11 +420,15 @@ static inline uint8_t
 hal_tx_get_num_tcl_banks(hal_soc_handle_t hal_soc_hdl)
 {
 	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+	int  hal_banks = 0;
 
-	if (hal_soc->ops->hal_tx_get_num_tcl_banks)
-		return hal_soc->ops->hal_tx_get_num_tcl_banks();
+	if (hal_soc->ops->hal_tx_get_num_tcl_banks) {
+		hal_banks =  hal_soc->ops->hal_tx_get_num_tcl_banks();
+		hal_banks -= HAL_TX_NUM_RESERVED_BANKS;
+		hal_banks = (hal_banks < 0) ? 0 : hal_banks;
+	}
 
-	return 0;
+	return hal_banks;
 }
 
 /**