Эх сурвалжийг харах

qcacld-3.0: wmi_desc cleanup for UMAC convergence

wmi_desc cleanup for UMAC convergence as mgmt_txrx_desc
to be used in place of wmi_desc.

Change-Id: I48c1b965096610373a850fcf834288a15bd2ad19
CRs-Fixed: 1103247
Himanshu Agarwal 8 жил өмнө
parent
commit
6023b6b980

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

@@ -1176,36 +1176,6 @@ struct mac_ss_bw_info {
 	uint32_t mac_bw;
 };
 
-/* Current HTC credit is 2, pool size of 50 is sufficient */
-#define WMI_DESC_POOL_MAX 50
-
-/**
- * struct wmi_desc_t - wmi management Tx descriptor.
- * @tx_cmpl_cb_func:	completion callback function, when DL completion and
- *			OTA done.
- * @ota_post_proc_func:	Post process callback function registered.
- * @nbuf:		Network buffer to be freed.
- * @desc_id:		WMI descriptor.
- */
-
-struct wmi_desc_t {
-	wma_tx_dwnld_comp_callback tx_cmpl_cb;
-	wma_tx_ota_comp_callback  ota_post_proc_cb;
-	qdf_nbuf_t	 nbuf;
-	uint32_t	 desc_id;
-	uint8_t vdev_id;
-};
-
-/**
- * union wmi_desc_elem_t - linked list wmi desc pool.
- * @next: Pointer next descritor in the pool.
- * @wmi_desc: wmi descriptor element.
- */
-union wmi_desc_elem_t {
-	union wmi_desc_elem_t *next;
-	struct wmi_desc_t wmi_desc;
-};
-
 /**
  * struct dual_mac_config - Dual MAC configurations
  * @prev_scan_config: Previous scan configuration
@@ -1222,10 +1192,8 @@ struct dual_mac_config {
 	uint32_t cur_fw_mode_config;
 	uint32_t req_scan_config;
 	uint32_t req_fw_mode_config;
-
 };
 
-
 /**
  * struct wma_ini_config - Structure to hold wma ini configuration
  * @max_no_of_peers: Max Number of supported
@@ -1552,13 +1520,6 @@ typedef struct {
 	/* OCB request contexts */
 	struct sir_ocb_config *ocb_config_req;
 	struct dual_mac_config dual_mac_cfg;
-	struct {
-		uint16_t pool_size;
-		uint16_t num_free;
-		union wmi_desc_elem_t *array;
-		union wmi_desc_elem_t *freelist;
-		qdf_spinlock_t wmi_desc_pool_lock;
-	} wmi_desc_pool;
 	uint8_t max_scan;
 	uint16_t self_gen_frm_pwr;
 	bool tx_chain_mask_cck;
@@ -2235,10 +2196,6 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 void wma_remove_vdev_req(tp_wma_handle wma, uint8_t vdev_id,
 				uint8_t type);
 
-int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size);
-void wmi_desc_pool_deinit(tp_wma_handle wma_handle);
-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,

+ 0 - 103
core/wma/src/wma_data.c

@@ -2383,109 +2383,6 @@ static int32_t wma_ieee80211_hdrsize(const void *data)
 	return size;
 }
 
-/**
- * wmi_desc_pool_init() - Initialize the WMI descriptor pool
- * @wma_handle: handle to wma
- * @pool_size: Size of wma pool
- *
- * Return: 0 for success, error code on failure.
- */
-int wmi_desc_pool_init(tp_wma_handle wma_handle, uint32_t pool_size)
-{
-	int i;
-
-	if (!pool_size) {
-		WMA_LOGE("%s: failed to allocate desc pool", __func__);
-		qdf_assert_always(pool_size);
-		return -EINVAL;
-	}
-	WMA_LOGE("%s: initialize desc pool of size %d", __func__, pool_size);
-	wma_handle->wmi_desc_pool.pool_size = pool_size;
-	wma_handle->wmi_desc_pool.num_free = pool_size;
-	wma_handle->wmi_desc_pool.array = qdf_mem_malloc(pool_size *
-					sizeof(union wmi_desc_elem_t));
-	if (!wma_handle->wmi_desc_pool.array) {
-		WMA_LOGE("%s: failed to allocate desc pool", __func__);
-		return -ENOMEM;
-	}
-	wma_handle->wmi_desc_pool.freelist = &wma_handle->
-		wmi_desc_pool.array[0];
-
-	for (i = 0; i < (pool_size - 1); i++) {
-		wma_handle->wmi_desc_pool.array[i].wmi_desc.desc_id = i;
-		wma_handle->wmi_desc_pool.array[i].next =
-			&wma_handle->wmi_desc_pool.array[i + 1];
-	}
-
-	wma_handle->wmi_desc_pool.array[i].next = NULL;
-	wma_handle->wmi_desc_pool.array[i].wmi_desc.desc_id = i;
-
-	qdf_spinlock_create(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-	return 0;
-}
-
-/**
- * wmi_desc_pool_deinit() - Deinitialize the WMI descriptor pool
- * @wma_handle: handle to wma
- *
- * Return: None
- */
-void wmi_desc_pool_deinit(tp_wma_handle wma_handle)
-{
-	qdf_spin_lock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-	if (wma_handle->wmi_desc_pool.array) {
-		qdf_mem_free(wma_handle->wmi_desc_pool.array);
-		wma_handle->wmi_desc_pool.array = NULL;
-	} else {
-		WMA_LOGE("%s: Empty WMI descriptor pool", __func__);
-	}
-
-	wma_handle->wmi_desc_pool.freelist = NULL;
-	wma_handle->wmi_desc_pool.pool_size = 0;
-	wma_handle->wmi_desc_pool.num_free = 0;
-	qdf_spin_unlock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-	qdf_spinlock_destroy(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-}
-
-/**
- * wmi_desc_get() - Get wmi descriptor from wmi free descriptor pool
- * @wma_handle: handle to wma
- *
- * Return: pointer to wmi descriptor, NULL on failure
- */
-struct wmi_desc_t *wmi_desc_get(tp_wma_handle wma_handle)
-{
-	struct wmi_desc_t *wmi_desc = NULL;
-
-	qdf_spin_lock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-	if (wma_handle->wmi_desc_pool.freelist) {
-		wma_handle->wmi_desc_pool.num_free--;
-		wmi_desc = &wma_handle->wmi_desc_pool.freelist->wmi_desc;
-		wma_handle->wmi_desc_pool.freelist =
-			wma_handle->wmi_desc_pool.freelist->next;
-	}
-	qdf_spin_unlock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-
-	return wmi_desc;
-}
-
-/**
- * wmi_desc_put() - Put wmi descriptor to wmi free descriptor pool
- * @wma_handle: handle to wma
- * @wmi_desc: wmi descriptor
- *
- * Return: None
- */
-void wmi_desc_put(tp_wma_handle wma_handle, struct wmi_desc_t *wmi_desc)
-{
-	qdf_spin_lock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-	((union wmi_desc_elem_t *)wmi_desc)->next =
-		wma_handle->wmi_desc_pool.freelist;
-	wma_handle->wmi_desc_pool.freelist = (union wmi_desc_elem_t *)wmi_desc;
-	wma_handle->wmi_desc_pool.num_free++;
-	qdf_spin_unlock_bh(&wma_handle->wmi_desc_pool.wmi_desc_pool_lock);
-}
-
 /**
  * wma_tx_packet() - Sends Tx Frame to TxRx
  * @wma_context: wma context

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

@@ -3584,11 +3584,6 @@ QDF_STATUS wma_close(void *cds_ctx)
 
 	wma_ndp_unregister_all_event_handlers(wma_handle);
 
-	if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
-				   WMI_SERVICE_MGMT_TX_WMI)) {
-		wmi_desc_pool_deinit(wma_handle);
-	}
-
 	wlan_objmgr_psoc_release_ref(wma_handle->psoc, WLAN_LEGACY_WMA_ID);
 	wma_handle->psoc = NULL;
 	target_if_close();
@@ -4657,11 +4652,6 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 	if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 				   WMI_SERVICE_MGMT_TX_WMI)) {
 		WMA_LOGE("Firmware supports management TX over WMI,use WMI interface instead of HTT for management Tx");
-		status = wmi_desc_pool_init(wma_handle, WMI_DESC_POOL_MAX);
-		if (status) {
-			WMA_LOGE("Failed to initialize wmi descriptor pool");
-			return -EINVAL;
-		}
 		/*
 		 * Register Tx completion event handler for MGMT Tx over WMI
 		 * case