Bladeren bron

qcacld-3.0: Changes to support wmi tx bundle completion

Changes to support wmi tx bundle completion.

Change-Id: I4c8d9b284d4616ce48b48f0a3424a03459dbefb0
CRs-fixed: 1023818
Nirav Shah 8 jaren geleden
bovenliggende
commit
2048997252
3 gewijzigde bestanden met toevoegingen van 91 en 31 verwijderingen
  1. 2 0
      core/wma/inc/wma.h
  2. 12 0
      core/wma/src/wma_main.c
  3. 77 31
      core/wma/src/wma_mgmt.c

+ 2 - 0
core/wma/inc/wma.h

@@ -2077,6 +2077,8 @@ struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle);
 void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc);
 int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
 				   uint32_t len);
+int wma_mgmt_tx_bundle_completion_handler(void *handle,
+	uint8_t *cmpl_event_params, uint32_t len);
 void wma_set_dfs_region(tp_wma_handle wma, uint8_t dfs_region);
 uint32_t wma_get_vht_ch_width(void);
 QDF_STATUS

+ 12 - 0
core/wma/src/wma_main.c

@@ -238,6 +238,8 @@ static void wma_set_default_tgt_config(tp_wma_handle wma_handle)
 	tgt_cfg.num_tids = (2 * (no_of_peers_supported + CFG_TGT_NUM_VDEV + 2));
 	tgt_cfg.scan_max_pending_req = wma_handle->max_scan;
 
+	WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_SET(tgt_cfg.flag1, 1);
+
 	WMITLV_SET_HDR(&tgt_cfg.tlv_header,
 		       WMITLV_TAG_STRUC_wmi_resource_config,
 		       WMITLV_GET_STRUCT_TLVLEN(wmi_resource_config));
@@ -4318,6 +4320,16 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 			return -EINVAL;
 		}
 
+		status = wmi_unified_register_event_handler(
+				wma_handle->wmi_handle,
+				WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID,
+				wma_mgmt_tx_bundle_completion_handler,
+				WMA_RX_SERIALIZER_CTX);
+		if (status) {
+			WMA_LOGE("Failed to register MGMT over WMI completion handler");
+			return -EINVAL;
+		}
+
 	} else {
 		WMA_LOGE("FW doesnot support WMI_SERVICE_MGMT_TX_WMI, Use HTT interface for Management Tx");
 	}

+ 77 - 31
core/wma/src/wma_mgmt.c

@@ -2452,46 +2452,28 @@ void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id)
 }
 
 /**
- * wma_mgmt_tx_completion_handler() - wma mgmt Tx completion event handler
- * @handle: wma handle
- * @cmpl_event_params: completion event handler data
- * @len: length of @cmpl_event_params
+ * wma_process_mgmt_tx_completion() - process mgmt completion
+ * @wma_handle: wma handle
+ * @desc_id: descriptor id
+ * @status: status
  *
- * Return: 0 on success; error number otherwise
+ * Return: 0 for success or error code
  */
-
-int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
-				   uint32_t len)
+int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
+		uint32_t desc_id, uint32_t status)
 {
-	tp_wma_handle wma_handle = (tp_wma_handle)handle;
-	WMI_MGMT_TX_COMPLETION_EVENTID_param_tlvs *param_buf;
-	wmi_mgmt_tx_compl_event_fixed_param	*cmpl_params;
 	struct wmi_desc_t *wmi_desc;
-
 	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
-	if (!pdev) {
-		WMA_LOGE("%s: txrx pdev is NULL", __func__);
-		return -EINVAL;
-	}
 
 	if (pdev == NULL) {
 		WMA_LOGE("%s: NULL pdev pointer", __func__);
 		return -EINVAL;
 	}
 
-	param_buf = (WMI_MGMT_TX_COMPLETION_EVENTID_param_tlvs *)
-		cmpl_event_params;
-	if (!param_buf || !wma_handle) {
-		WMA_LOGE("%s: Invalid mgmt Tx completion event", __func__);
-		return -EINVAL;
-	}
-	cmpl_params = param_buf->fixed_param;
-
-	WMA_LOGI("%s: status:%d wmi_desc_id:%d", __func__, cmpl_params->status,
-		 cmpl_params->desc_id);
+	WMA_LOGI("%s: status:%d wmi_desc_id:%d", __func__, status, desc_id);
 
 	wmi_desc = (struct wmi_desc_t *)
-		(&wma_handle->wmi_desc_pool.array[cmpl_params->desc_id]);
+			(&wma_handle->wmi_desc_pool.array[desc_id]);
 
 	if (!wmi_desc) {
 		WMA_LOGE("%s: Invalid wmi desc", __func__);
@@ -2500,18 +2482,82 @@ int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
 
 	if (wmi_desc->nbuf)
 		qdf_nbuf_unmap_single(pdev->osdev, wmi_desc->nbuf,
-				      QDF_DMA_TO_DEVICE);
+					  QDF_DMA_TO_DEVICE);
 	if (wmi_desc->tx_cmpl_cb)
 		wmi_desc->tx_cmpl_cb(wma_handle->mac_context,
-				       wmi_desc->nbuf, 1);
+					   wmi_desc->nbuf, 1);
 
 	if (wmi_desc->ota_post_proc_cb)
 		wmi_desc->ota_post_proc_cb((tpAniSirGlobal)
-					     wma_handle->mac_context,
-					     cmpl_params->status);
+						 wma_handle->mac_context,
+						 status);
 
 	wmi_desc_put(wma_handle, wmi_desc);
+	return 0;
+}
+
+/**
+ * wma_mgmt_tx_completion_handler() - wma mgmt Tx completion event handler
+ * @handle: wma handle
+ * @cmpl_event_params: completion event handler data
+ * @len: length of @cmpl_event_params
+ *
+ * Return: 0 on success; error number otherwise
+ */
+
+int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
+				   uint32_t len)
+{
+	tp_wma_handle wma_handle = (tp_wma_handle)handle;
+	WMI_MGMT_TX_COMPLETION_EVENTID_param_tlvs *param_buf;
+	wmi_mgmt_tx_compl_event_fixed_param	*cmpl_params;
+
+	param_buf = (WMI_MGMT_TX_COMPLETION_EVENTID_param_tlvs *)
+		cmpl_event_params;
+	if (!param_buf || !wma_handle) {
+		WMA_LOGE("%s: Invalid mgmt Tx completion event", __func__);
+		return -EINVAL;
+	}
+	cmpl_params = param_buf->fixed_param;
+
+	wma_process_mgmt_tx_completion(wma_handle,
+		cmpl_params->desc_id, cmpl_params->status);
+
+	return 0;
+}
+
+/**
+ * wma_mgmt_tx_bundle_completion_handler() - mgmt bundle comp handler
+ * @handle: wma handle
+ * @buf: buffer
+ * @len: length
+ *
+ * Return: 0 for success or error code
+ */
+int wma_mgmt_tx_bundle_completion_handler(void *handle, uint8_t *buf,
+				   uint32_t len)
+{
+	tp_wma_handle wma_handle = (tp_wma_handle)handle;
+	WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID_param_tlvs *param_buf;
+	wmi_mgmt_tx_compl_bundle_event_fixed_param	*cmpl_params;
+	uint32_t num_reports;
+	uint32_t *desc_ids;
+	uint32_t *status;
+	int i;
+
+	param_buf = (WMI_MGMT_TX_BUNDLE_COMPLETION_EVENTID_param_tlvs *)buf;
+	if (!param_buf && !wma_handle) {
+		WMA_LOGE("%s: Invalid mgmt Tx completion event", __func__);
+		return -EINVAL;
+	}
+	cmpl_params = param_buf->fixed_param;
+	num_reports = cmpl_params->num_reports;
+	desc_ids = (uint32_t *)(param_buf->desc_ids);
+	status = (uint32_t *)(param_buf->status);
 
+	for (i = 0; i < num_reports; i++)
+		wma_process_mgmt_tx_completion(wma_handle,
+			desc_ids[i], status[i]);
 	return 0;
 }