Просмотр исходного кода

qcacld-3.0: Cleanup handle & rate_flags from struct wma_txrx_node

As a part of vdev convergence, struct wma_tx_rx_node's handle &
rate_flags members are no more unused. These values are derived
from mlme_obj.

So no more used members of struct wma_txrx_node are cleaned.

Change-Id: I0b536c50717edc293ab27e5d520eb490266ba2ce
CRs-Fixed: 2534222
Abhishek Ambure 5 лет назад
Родитель
Сommit
0b2ea32256

+ 38 - 12
core/wma/inc/wma.h

@@ -676,7 +676,6 @@ struct roam_synch_frame_ind {
 /**
  * struct wma_txrx_node - txrx node
  * @vdev: pointer to vdev object
- * @handle: wma handle
  * @beacon: beacon info
  * @config: per vdev config parameters
  * @scan_info: scan info
@@ -702,7 +701,6 @@ struct roam_synch_frame_ind {
  * @stats_rsp: stats response
  * @del_staself_req: delete sta self request
  * @bss_status: bss status
- * @rate_flags: rate flags
  * @nss: nss value
  * @is_channel_switch: is channel switch
  * @pause_bitmap: pause bitmap
@@ -732,7 +730,6 @@ struct roam_synch_frame_ind {
  */
 struct wma_txrx_node {
 	struct wlan_objmgr_vdev *vdev;
-	struct cdp_vdev *handle;
 	struct beacon_info *beacon;
 	vdev_cli_config_t config;
 	uint32_t type;
@@ -759,7 +756,6 @@ struct wma_txrx_node {
 	void *del_staself_req;
 	bool is_del_sta_defered;
 	qdf_atomic_t bss_status;
-	uint8_t rate_flags;
 	uint8_t nss;
 	uint16_t pause_bitmap;
 	int8_t tx_power;
@@ -1901,7 +1897,7 @@ void wma_vdev_update_pause_bitmap(uint8_t vdev_id, uint16_t value)
 		return;
 	}
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s: Failed to get iface handle: NULL",
 			 __func__);
 		return;
@@ -1935,7 +1931,7 @@ uint16_t wma_vdev_get_pause_bitmap(uint8_t vdev_id)
 		return 0;
 	}
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s: Failed to get iface handle: NULL",
 			 __func__);
 		return 0;
@@ -1972,7 +1968,7 @@ struct cdp_vdev *wma_vdev_get_vdev_dp_handle(uint8_t vdev_id)
 		return NULL;
 	}
 
-	return iface->handle;
+	return wlan_vdev_get_dp_handle(iface->vdev);
 }
 
 /**
@@ -1999,7 +1995,7 @@ static inline bool wma_vdev_is_device_in_low_pwr_mode(uint8_t vdev_id)
 		return 0;
 	}
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s: Failed to get iface handle:NULL",
 			 __func__);
 		return 0;
@@ -2031,7 +2027,7 @@ QDF_STATUS wma_vdev_get_dtim_period(uint8_t vdev_id, uint8_t *value)
 
 	iface = &wma->interfaces[vdev_id];
 
-	if (!iface || !iface->handle)
+	if (!iface || !wlan_vdev_get_dp_handle(iface->vdev))
 		return QDF_STATUS_E_FAILURE;
 
 	*value = iface->dtimPeriod;
@@ -2061,13 +2057,43 @@ QDF_STATUS wma_vdev_get_beacon_interval(uint8_t  vdev_id, uint16_t *value)
 
 	iface = &wma->interfaces[vdev_id];
 
-	if (!iface || !iface->handle)
+	if (!iface || !wlan_vdev_get_dp_handle(iface->vdev))
 		return QDF_STATUS_E_FAILURE;
 
 	*value = iface->beaconInterval;
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * wma_get_vdev_rate_flag - Get beacon rate flag from mlme
+ * @vdev_id: vdev index number
+ * @rate_flag: pointer to the value to fill out
+ *
+ * Note caller must verify return status before using value
+ *
+ * Return: QDF_STATUS_SUCCESS when fetched a valid value from mlme else
+ * QDF_STATUS_E_FAILURE
+ */
+static inline QDF_STATUS
+wma_get_vdev_rate_flag(struct wlan_objmgr_vdev *vdev, uint32_t *rate_flag)
+{
+	struct vdev_mlme_obj *mlme_obj;
+
+	if (!vdev) {
+		WMA_LOGE("%s vdev is NULL", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_obj = wlan_vdev_mlme_get_cmpt_obj(vdev);
+	if (!mlme_obj) {
+		WMA_LOGE("%s Failed to get mlme_obj", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*rate_flag = mlme_obj->mgmt.rate_info.rate_flags;
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * wma_vdev_set_pause_bit() - Set a bit in vdev pause bitmap
  * @vdev_id: the Id of the vdev to configure
@@ -2094,7 +2120,7 @@ void wma_vdev_set_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
 		return;
 	}
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s: Failed to get iface handle: NULL",
 			 __func__);
 		return;
@@ -2129,7 +2155,7 @@ void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
 		return;
 	}
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s: Failed to get iface handle: NULL",
 			 __func__);
 		return;

+ 95 - 2
core/wma/inc/wma_internal.h

@@ -541,7 +541,7 @@ struct cdp_vdev *wma_find_vdev_by_id(tp_wma_handle wma, uint8_t vdev_id)
 	if (vdev_id >= wma->max_bssid)
 		return NULL;
 
-	return wma->interfaces[vdev_id].handle;
+	return wlan_vdev_get_dp_handle(wma->interfaces[vdev_id].vdev);
 }
 
 bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id);
@@ -797,6 +797,13 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id);
 
 int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type);
 
+/**
+ * wma_set_vdev_intrabss_fwd() - set intra_fwd value to wni_in.
+ * @wma_handle: wma handle
+ * @pdis_intra_fwd: Pointer to DisableIntraBssFwd struct
+ *
+ * Return: none
+ */
 void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
 				      tpDisableIntraBssFwd pdis_intra_fwd);
 
@@ -840,6 +847,20 @@ int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len);
 int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 				       uint32_t len);
 
+/**
+ * wma_unified_bcntx_status_event_handler() - beacon tx status event handler
+ * @handle: wma handle
+ * @cmd_param_info: event data
+ * @len: data length
+ *
+ * WMI Handler for WMI_OFFLOAD_BCN_TX_STATUS_EVENTID event from firmware.
+ * This event is generated by FW when the beacon transmission is offloaded
+ * and the host performs beacon template modification using WMI_BCN_TMPL_CMDID
+ * The FW generates this event when the first successful beacon transmission
+ * after template update
+ *
+ * Return: 0 for success or error code
+ */
 int wma_unified_bcntx_status_event_handler(void *handle,
 					   uint8_t *cmd_param_info,
 					   uint32_t len);
@@ -870,8 +891,22 @@ void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id,
 void wma_process_update_beacon_params(tp_wma_handle wma,
 				 tUpdateBeaconParams *bcn_params);
 
+/**
+ * wma_update_rts_params() - update cfg parameters to target
+ * @wma: wma handle
+ * @value: rts_threshold
+ *
+ * Return: none
+ */
 void wma_update_rts_params(tp_wma_handle wma, uint32_t value);
 
+/**
+ * wma_update_frag_params() - update cfg parameters to target
+ * @wma: wma handle
+ * @value: frag_threshold
+ *
+ * Return: none
+ */
 void wma_update_frag_params(tp_wma_handle wma, uint32_t value);
 
 #ifdef CRYPTO_SET_KEY_CONVERGED
@@ -910,6 +945,14 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info);
 QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
 						    tEdcaParams *edca_params);
 
+/**
+ * wma_tbttoffset_update_event_handler() - tbtt offset update handler
+ * @handle: wma handle
+ * @event: event buffer
+ * @len: data length
+ *
+ * Return: 0 for success or error code
+ */
 int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
 					       uint32_t len);
 
@@ -949,6 +992,13 @@ void wma_process_update_userpos(tp_wma_handle wma_handle,
  * wma_power.c functions declarations
  */
 
+/**
+ * wma_enable_sta_ps_mode() - enable sta powersave params in fw
+ * @wma: wma handle
+ * @ps_req: power save request
+ *
+ * Return: none
+ */
 void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req);
 
 QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
@@ -971,6 +1021,13 @@ void wma_set_max_tx_power(WMA_HANDLE handle,
 
 void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req);
 
+/**
+ * wma_enable_uapsd_mode() - enable uapsd mode in fw
+ * @wma: wma handle
+ * @ps_req: power save request
+ *
+ * Return: none
+ */
 void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req);
 
 void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req);
@@ -1003,7 +1060,14 @@ QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id,
 /*
  * wma_data.c functions declarations
  */
-
+/**
+ * wma_set_bss_rate_flags() - set rate flags based on BSS capability
+ * @wma: pointer to wma handle
+ * @vdev_id: vdev id
+ * @add_bss: pointer to bss params
+ *
+ * Return: none
+ */
 void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 			    struct bss_params *add_bss);
 
@@ -1034,6 +1098,16 @@ QDF_STATUS wma_set_mcc_channel_time_quota
 	uint32_t adapter_1_chan_number,
 	uint32_t adapter_1_quota, uint32_t adapter_2_chan_number);
 
+/**
+ * wma_process_rate_update_indate() - rate update indication
+ * @wma: wma handle
+ * @pRateUpdateParams: Rate update params
+ *
+ * This function update rate & short GI interval to fw based on params
+ * send by SME.
+ *
+ * Return: QDF status
+ */
 QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 					    tSirRateUpdateInd *
 					    pRateUpdateParams);
@@ -1045,6 +1119,17 @@ QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle);
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
 	defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
 
+/**
+ * wma_mcc_vdev_tx_pause_evt_handler() - pause event handler
+ * @handle: wma handle
+ * @event: event buffer
+ * @len: data length
+ *
+ * This function handle pause event from fw and pause/unpause
+ * vdev.
+ *
+ * Return: 0 for success or error code.
+ */
 int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 					     uint32_t len);
 #endif
@@ -1124,6 +1209,14 @@ void wma_config_stats_ext_threshold(tp_wma_handle wma,
 void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
 			  uint8_t link_status);
 
+/**
+ * wma_link_status_event_handler() - link status event handler
+ * @handle: wma handle
+ * @cmd_param_info: data from event
+ * @len: length
+ *
+ * Return: 0 for success or error code
+ */
 int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
 				  uint32_t len);
 

+ 53 - 52
core/wma/src/wma_data.c

@@ -743,6 +743,8 @@ static void wma_cp_stats_set_rate_flag(tp_wma_handle wma, uint8_t vdev_id)
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_psoc *psoc = wma->psoc;
 	struct wma_txrx_node *iface = &wma->interfaces[vdev_id];
+	uint32_t rate_flag;
+	QDF_STATUS status;
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
 						    WLAN_LEGACY_WMA_ID);
@@ -752,49 +754,58 @@ static void wma_cp_stats_set_rate_flag(tp_wma_handle wma, uint8_t vdev_id)
 		return;
 	}
 
-	ucfg_mc_cp_stats_set_rate_flags(vdev, iface->rate_flags);
+	status = wma_get_vdev_rate_flag(iface->vdev, &rate_flag);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		WMA_LOGE("%s, vdev not found for id: %d", __func__,
+			 vdev_id);
+		return;
+	}
+	ucfg_mc_cp_stats_set_rate_flags(vdev, rate_flag);
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
 }
 
-/**
- * wma_set_bss_rate_flags() - set rate flags based on BSS capability
- * @iface: txrx_node ctx
- * @add_bss: add_bss params
- *
- * Return: none
- */
 void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id,
 			    struct bss_params *add_bss)
 {
 	struct wma_txrx_node *iface = &wma->interfaces[vdev_id];
+	struct vdev_mlme_obj *vdev_mlme;
+	uint32_t *rate_flags;
+
 
-	iface->rate_flags = 0;
+	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(iface->vdev);
+	if (!vdev_mlme) {
+		WMA_LOGE("%s: Failed to get mlme obj for vdev_%d",
+			 __func__, vdev_id);
+		return;
+	}
+	rate_flags = &vdev_mlme->mgmt.rate_info.rate_flags;
+	*rate_flags = 0;
 	if (add_bss->vhtCapable) {
 		if (add_bss->ch_width == CH_WIDTH_80P80MHZ)
-			iface->rate_flags |= TX_RATE_VHT80;
+			*rate_flags |= TX_RATE_VHT80;
 		if (add_bss->ch_width == CH_WIDTH_160MHZ)
-			iface->rate_flags |= TX_RATE_VHT80;
+			*rate_flags |= TX_RATE_VHT80;
 		if (add_bss->ch_width == CH_WIDTH_80MHZ)
-			iface->rate_flags |= TX_RATE_VHT80;
+			*rate_flags |= TX_RATE_VHT80;
 		else if (add_bss->ch_width)
-			iface->rate_flags |= TX_RATE_VHT40;
+			*rate_flags |= TX_RATE_VHT40;
 		else
-			iface->rate_flags |= TX_RATE_VHT20;
+			*rate_flags |= TX_RATE_VHT20;
 	}
 	/* avoid to conflict with htCapable flag */
 	else if (add_bss->htCapable) {
 		if (add_bss->ch_width)
-			iface->rate_flags |= TX_RATE_HT40;
+			*rate_flags |= TX_RATE_HT40;
 		else
-			iface->rate_flags |= TX_RATE_HT20;
+			*rate_flags |= TX_RATE_HT20;
 	}
 
 	if (add_bss->staContext.fShortGI20Mhz ||
 	    add_bss->staContext.fShortGI40Mhz)
-		iface->rate_flags |= TX_RATE_SGI;
+		*rate_flags |= TX_RATE_SGI;
 
 	if (!add_bss->htCapable && !add_bss->vhtCapable)
-		iface->rate_flags = TX_RATE_LEGACY;
+		*rate_flags = TX_RATE_LEGACY;
 
 	wma_cp_stats_set_rate_flag(wma, vdev_id);
 }
@@ -1168,16 +1179,6 @@ QDF_STATUS wma_set_mcc_channel_time_quota(tp_wma_handle wma,
 						chan2_freq);
 }
 
-/**
- * wma_process_rate_update_indate() - rate update indication
- * @wma: wma handle
- * @pRateUpdateParams: Rate update params
- *
- * This function update rate & short GI interval to fw based on params
- * send by SME.
- *
- * Return: QDF status
- */
 QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 					    tSirRateUpdateInd *
 					    pRateUpdateParams)
@@ -1188,7 +1189,7 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 	int32_t mbpsx10_rate = -1;
 	uint32_t paramId;
 	uint8_t rate = 0;
-	uint32_t short_gi;
+	uint32_t short_gi, rate_flag;
 	struct wma_txrx_node *intr = wma->interfaces;
 	QDF_STATUS status;
 
@@ -1202,9 +1203,17 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 		return QDF_STATUS_E_INVAL;
 	}
 	short_gi = intr[vdev_id].config.shortgi;
+
+	status = wma_get_vdev_rate_flag(intr[vdev_id].vdev, &rate_flag);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		WMA_LOGE("%s: Failed to get rate_flag for VDEV_%d",
+			 __func__, vdev_id);
+		qdf_mem_free(pRateUpdateParams);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	if (short_gi == 0)
-		short_gi = (intr[vdev_id].rate_flags & TX_RATE_SGI) ?
-								 true : false;
+		short_gi = (rate_flag & TX_RATE_SGI) ? true : false;
 	/* first check if reliable TX mcast rate is used. If not check the bcast
 	 * Then is mcast. Mcast rate is saved in mcastDataRate24GHz
 	 */
@@ -1229,7 +1238,7 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 		 pRateUpdateParams->dev_mode);
 	WMA_LOGE("%s: mac = %pM, config.shortgi = %d, rate_flags = 0x%x",
 		 __func__, pRateUpdateParams->bssid.bytes,
-		 intr[vdev_id].config.shortgi, intr[vdev_id].rate_flags);
+		 intr[vdev_id].config.shortgi, rate_flag);
 	ret = wma_encode_mc_rate(short_gi, intr[vdev_id].config.chwidth,
 				 intr[vdev_id].chanmode, intr[vdev_id].mhz,
 				 mbpsx10_rate, pRateUpdateParams->nss, &rate);
@@ -1397,17 +1406,6 @@ QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle)
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
 	defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
 
-/**
- * wma_mcc_vdev_tx_pause_evt_handler() - pause event handler
- * @handle: wma handle
- * @event: event buffer
- * @len: data length
- *
- * This function handle pause event from fw and pause/unpause
- * vdev.
- *
- * Return: 0 for success or error code.
- */
 int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 				      uint32_t len)
 {
@@ -1416,6 +1414,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 	wmi_tx_pause_event_fixed_param *wmi_event;
 	uint8_t vdev_id;
 	A_UINT32 vdev_map;
+	struct cdp_vdev *dp_handle;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	param_buf = (WMI_TX_PAUSE_EVENTID_param_tlvs *) event;
@@ -1445,7 +1444,9 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 		if (!(vdev_map & 0x1)) {
 			/* No Vdev */
 		} else {
-			if (!wma->interfaces[vdev_id].handle) {
+			dp_handle = wlan_vdev_get_dp_handle
+					(wma->interfaces[vdev_id].vdev);
+			if (!dp_handle) {
 				WMA_LOGE("%s: invalid vdev ID %d", __func__,
 					 vdev_id);
 				/* Test Next VDEV */
@@ -1461,8 +1462,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 				 */
 				if (!wma_vdev_get_pause_bitmap(vdev_id))
 					cdp_fc_vdev_pause(soc,
-						wma->
-						interfaces[vdev_id].handle,
+						dp_handle,
 						OL_TXQ_PAUSE_REASON_FW);
 				wma_vdev_set_pause_bit(vdev_id,
 					wmi_event->pause_type);
@@ -1480,8 +1480,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 						 * UNPAUSE VDEV
 						 */
 						cdp_fc_vdev_unpause(soc,
-							wma->interfaces[vdev_id]
-							.handle,
+							dp_handle,
 							OL_TXQ_PAUSE_REASON_FW);
 					}
 				}
@@ -2388,7 +2387,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 	}
 	iface = &wma_handle->interfaces[vdev_id];
 	/* Get the vdev handle from vdev id */
-	txrx_vdev = wma_handle->interfaces[vdev_id].handle;
+	txrx_vdev = wlan_vdev_get_dp_handle(iface->vdev);
 
 	if (!txrx_vdev) {
 		WMA_LOGE("TxRx Vdev Handle is NULL");
@@ -3009,6 +3008,7 @@ void wma_tx_abort(uint8_t vdev_id)
 	uint32_t peer_tid_bitmap = PEER_ALL_TID_BITMASK;
 	struct wma_txrx_node *iface;
 	uint8_t *bssid;
+	struct cdp_vdev *handle;
 	struct peer_flush_params param = {0};
 
 	wma = cds_get_context(QDF_MODULE_ID_WMA);
@@ -3016,9 +3016,10 @@ void wma_tx_abort(uint8_t vdev_id)
 		return;
 
 	iface = &wma->interfaces[vdev_id];
-	if (!iface->handle) {
+	handle = wlan_vdev_get_dp_handle(iface->vdev);
+	if (!handle) {
 		WMA_LOGE("%s: Failed to get iface handle: %pK",
-			 __func__, iface->handle);
+			 __func__, handle);
 		return;
 	}
 	bssid = wma_get_vdev_bssid(iface->vdev);
@@ -3031,7 +3032,7 @@ void wma_tx_abort(uint8_t vdev_id)
 	WMA_LOGD("%s: vdevid %d bssid %pM", __func__, vdev_id, bssid);
 	wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
 	cdp_fc_vdev_pause(cds_get_context(QDF_MODULE_ID_SOC),
-			iface->handle,
+			handle,
 			OL_TXQ_PAUSE_REASON_TX_ABORT);
 
 	/* Flush all TIDs except MGMT TID for this peer in Target */

+ 44 - 53
core/wma/src/wma_dev_if.c

@@ -100,7 +100,7 @@ struct cdp_vdev *wma_find_vdev_by_addr(tp_wma_handle wma, uint8_t *addr,
 			(struct qdf_mac_addr *)wlan_vdev_mlme_get_macaddr(vdev),
 			(struct qdf_mac_addr *)addr) == true) {
 			*vdev_id = i;
-			return wma->interfaces[i].handle;
+			return wlan_vdev_get_dp_handle(wma->interfaces[i].vdev);
 		}
 	}
 	return NULL;
@@ -218,6 +218,8 @@ struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
 	uint8_t *bssid_addr;
 
 	for (i = 0; i < wma->max_bssid; i++) {
+		if (!wma->interfaces[i].vdev)
+			continue;
 		bssid_addr = wma_get_vdev_bssid(wma->interfaces[i].vdev);
 		if (!bssid_addr)
 			continue;
@@ -226,7 +228,7 @@ struct cdp_vdev *wma_find_vdev_by_bssid(tp_wma_handle wma, uint8_t *bssid,
 			(struct qdf_mac_addr *)bssid_addr,
 			(struct qdf_mac_addr *)bssid) == true) {
 			*vdev_id = i;
-			return wma->interfaces[i].handle;
+			return wlan_vdev_get_dp_handle(wma->interfaces[i].vdev);
 		}
 	}
 
@@ -489,7 +491,6 @@ QDF_STATUS wma_vdev_detach_callback(
  *
  * Return: success if peer delete command sent to firmware, else failure.
  */
-
 static QDF_STATUS wma_self_peer_remove(tp_wma_handle wma_handle,
 			struct del_vdev_params *del_vdev_req_param)
 {
@@ -559,17 +560,6 @@ error:
 	return qdf_status;
 }
 
-static void
-wma_cdp_vdev_detach(ol_txrx_soc_handle soc,
-		    tp_wma_handle wma_handle,
-		    uint8_t vdev_id)
-{
-	struct wma_txrx_node *iface = &wma_handle->interfaces[vdev_id];
-
-	cdp_vdev_detach(soc, iface->handle, NULL, NULL);
-	iface->handle = NULL;
-}
-
 /**
  * wma_release_vdev_ref() - Release vdev object reference count
  * @iface: wma interface txrx node
@@ -612,6 +602,13 @@ static void wma_handle_monitor_mode_vdev_detach(tp_wma_handle wma,
 	iface->vdev_active = false;
 }
 
+/**
+ * wma_handle_vdev_detach() - wma vdev detach handler
+ * @wma_handle: pointer to wma handle
+ * @del_vdev_req_param: pointer to del req param
+ *
+ * Return: none.
+ */
 static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 			struct del_vdev_params *del_vdev_req_param)
 {
@@ -630,7 +627,6 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 	if (!vdev_mlme) {
 		wma_err("Failed to get vdev mlme obj for vdev id %d",
 			del_vdev_req_param->vdev_id);
-		wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 		goto out;
 	}
 
@@ -638,8 +634,6 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 		wma_handle_monitor_mode_vdev_detach(wma_handle, vdev_id);
 
 	iface->del_staself_req = del_vdev_req_param;
-	wlan_vdev_set_dp_handle(iface->vdev, NULL);
-	wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 	wma_release_vdev_ref(iface);
 
 	status = vdev_mgr_delete_send(vdev_mlme);
@@ -795,12 +789,11 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
 			struct del_vdev_params *pdel_vdev_req_param)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t vdev_id = pdel_vdev_req_param->vdev_id;
 	struct wma_txrx_node *iface = &wma_handle->interfaces[vdev_id];
 	uint32_t vdev_stop_type;
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("handle of vdev_id %d is NULL vdev is already freed",
 			 vdev_id);
 		goto send_rsp;
@@ -814,9 +807,7 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
 	 * CDP Vdev.
 	 */
 	if (!cds_is_target_ready()) {
-		wlan_vdev_set_dp_handle(iface->vdev, NULL);
 		wma_release_vdev_and_peer_ref(wma_handle, iface);
-		wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 		goto send_rsp;
 	}
 
@@ -1633,15 +1624,21 @@ static bool wma_find_duplicate_peer_on_other_vdev(tp_wma_handle wma,
 {
 	int i;
 	uint8_t peer_id;
+	struct cdp_vdev *handle;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+	struct wlan_objmgr_vdev *vdev;
 
 	for (i = 0; i < wma->max_bssid; i++) {
+		vdev = wma->interfaces[i].vdev;
+		if (!vdev)
+			continue;
+		handle = wlan_vdev_get_dp_handle(wma->interfaces[i].vdev);
 		/* Need to check vdevs other than the vdev_id */
 		if (vdev_id == i ||
-		   !wma->interfaces[i].handle)
+		   !handle)
 			continue;
 		if (cdp_peer_find_by_addr_and_vdev(soc, pdev,
-			wma->interfaces[i].handle, peer_mac, &peer_id)) {
+			handle, peer_mac, &peer_id)) {
 			WMA_LOGE("%s :Duplicate peer %pM (peer id %d) already exist on vdev %d",
 				__func__, peer_mac, peer_id, i);
 			return true;
@@ -2080,6 +2077,7 @@ void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp)
 	struct wma_txrx_node *iface;
 	struct beacon_info *bcn;
 	uint8_t vdev_id;
+	struct cdp_vdev *handle;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (!resp) {
@@ -2089,7 +2087,8 @@ void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp)
 
 	vdev_id = resp->vdev_id;
 	iface = &wma->interfaces[vdev_id];
-	if (!iface->handle) {
+	handle = wlan_vdev_get_dp_handle(iface->vdev);
+	if (!handle) {
 		WMA_LOGE("%s vdev id %d is already deleted",
 			 __func__, vdev_id);
 		if (resp)
@@ -2097,11 +2096,10 @@ void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp)
 		return;
 	}
 
-	cdp_fc_vdev_flush(soc, iface->handle);
+	cdp_fc_vdev_flush(soc, handle);
 	WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
 		 __func__, vdev_id);
-	cdp_fc_vdev_unpause(soc, iface->handle,
-		OL_TXQ_PAUSE_REASON_VDEV_STOP);
+	cdp_fc_vdev_unpause(soc, handle, OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	wma_vdev_clear_pause_bit(vdev_id, PAUSE_TYPE_HOST);
 	qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
 	WMA_LOGD("%s: (type %d subtype %d) BSS is stopped",
@@ -2312,7 +2310,7 @@ __wma_handle_vdev_stop_rsp(struct vdev_stop_response *resp_event)
 	    vdev_stop_type == WMA_SET_LINK_STATE) {
 		uint8_t type;
 
-		if (!iface->handle) {
+		if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 			WMA_LOGE("%s vdev id %d is already deleted",
 				 __func__, resp_event->vdev_id);
 			status = -EINVAL;
@@ -2442,12 +2440,11 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 
 	vdev_id = wlan_vdev_get_id(vdev);
 	txrx_vdev_handle = wlan_vdev_get_dp_handle(vdev);
+	wma_handle->interfaces[vdev_id].vdev = vdev;
 
 	wma_handle->interfaces[vdev_id].vdev_active = true;
-	wma_handle->interfaces[vdev_id].handle = txrx_vdev_handle;
 	wma_vdev_update_pause_bitmap(vdev_id, 0);
 
-	wma_handle->interfaces[vdev_id].vdev = vdev;
 	wma_handle->interfaces[vdev_id].type =
 		vdev_mlme->mgmt.generic.type;
 	wma_handle->interfaces[vdev_id].sub_type =
@@ -2698,7 +2695,6 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 
 end:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
-	wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 	wma_handle->interfaces[vdev_id].vdev_active = false;
 	txrx_vdev_handle = NULL;
 
@@ -2814,7 +2810,7 @@ QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
 		WMA_LOGD("%s, vdev_id: %d, unpausing tx_ll_queue at VDEV_START",
 			 __func__, vdev_id);
 		cdp_fc_vdev_unpause(cds_get_context(QDF_MODULE_ID_SOC),
-				    wma->interfaces[vdev_id].handle,
+			wlan_vdev_get_dp_handle(wma->interfaces[vdev_id].vdev),
 			0xffffffff);
 		wma_vdev_update_pause_bitmap(vdev_id, 0);
 	}
@@ -3374,7 +3370,7 @@ QDF_STATUS wma_pre_vdev_start_setup(uint8_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	vdev = iface->handle;
+	vdev = wlan_vdev_get_dp_handle(iface->vdev);
 	if (!vdev) {
 		wma_err("Failed to get vdev handle: %d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
@@ -4838,7 +4834,7 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id)
 {
 	struct cdp_pdev *pdev;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	struct cdp_vdev *txrx_vdev = NULL;
+	struct cdp_vdev *txrx_vdev = NULL, *handle;
 	struct wma_txrx_node *iface;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct vdev_stop_response resp_event;
@@ -4853,7 +4849,8 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id)
 	}
 
 	iface = &wma->interfaces[vdev_id];
-	if (!iface || !iface->handle) {
+	handle = wlan_vdev_get_dp_handle(iface->vdev);
+	if (!iface || !handle) {
 		WMA_LOGE("%s vdev id %d is already deleted",
 				__func__, vdev_id);
 		goto fail_del_bss_ho_fail;
@@ -4895,14 +4892,12 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id)
 
 	WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)",
 		 __func__,  vdev_id);
-	cdp_fc_vdev_pause(soc, iface->handle,
-			   OL_TXQ_PAUSE_REASON_VDEV_STOP);
+	cdp_fc_vdev_pause(soc, handle, OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
-	cdp_fc_vdev_flush(soc, iface->handle);
+	cdp_fc_vdev_flush(soc, handle);
 	WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
-			__func__,  vdev_id);
-	cdp_fc_vdev_unpause(soc, iface->handle,
-			OL_TXQ_PAUSE_REASON_VDEV_STOP);
+		 __func__,  vdev_id);
+	cdp_fc_vdev_unpause(soc, handle, OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	wma_vdev_clear_pause_bit(vdev_id, PAUSE_TYPE_HOST);
 	qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
 	WMA_LOGD("%s: (type %d subtype %d) BSS is stopped",
@@ -4998,7 +4993,7 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
 	}
 
 	iface = &wma->interfaces[vdev_id];
-	if (!iface || !iface->handle) {
+	if (!iface || !wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("%s vdev id %d is already deleted",
 			 __func__, vdev_id);
 		goto out;
@@ -5104,7 +5099,7 @@ void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id)
 		 __func__, vdev_id);
 	wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST);
 	cdp_fc_vdev_pause(soc,
-		wma->interfaces[vdev_id].handle,
+		wlan_vdev_get_dp_handle(iface->vdev),
 		OL_TXQ_PAUSE_REASON_VDEV_STOP);
 
 	if (wma_send_vdev_stop_to_fw(wma, vdev_id)) {
@@ -5157,23 +5152,18 @@ int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type)
 	return -EFAULT;
 }
 
-/**
- * wma_set_vdev_intrabss_fwd() - set intra_fwd value to wni_in.
- * @wma_handle: wma handle
- * @pdis_intra_fwd: Pointer to DisableIntraBssFwd struct
- *
- * Return: none
- */
 void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
 				      tpDisableIntraBssFwd pdis_intra_fwd)
 {
 	struct cdp_vdev *txrx_vdev;
+	struct wlan_objmgr_vdev *vdev;
 
 	WMA_LOGD("%s:intra_fwd:vdev(%d) intrabss_dis=%s",
 		 __func__, pdis_intra_fwd->sessionId,
 		 (pdis_intra_fwd->disableintrabssfwd ? "true" : "false"));
 
-	txrx_vdev = wma_handle->interfaces[pdis_intra_fwd->sessionId].handle;
+	vdev = wma_handle->interfaces[pdis_intra_fwd->sessionId].vdev;
+	txrx_vdev = wlan_vdev_get_dp_handle(vdev);
 	cdp_cfg_vdev_rx_set_intrabss_fwd(cds_get_context(QDF_MODULE_ID_SOC),
 				    txrx_vdev,
 				    pdis_intra_fwd->disableintrabssfwd);
@@ -5322,8 +5312,9 @@ QDF_STATUS wma_send_vdev_stop(uint8_t vdev_id)
 
 	WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP",
 		 __func__, vdev_id);
-	cdp_fc_vdev_pause(soc, wma->interfaces[vdev_id].handle,
-			  OL_TXQ_PAUSE_REASON_VDEV_STOP);
+	cdp_fc_vdev_pause
+		(soc, wlan_vdev_get_dp_handle(wma->interfaces[vdev_id].vdev),
+		 OL_TXQ_PAUSE_REASON_VDEV_STOP);
 
 	status = mlme_set_vdev_stop_type(
 				wma->interfaces[vdev_id].vdev,

+ 21 - 13
core/wma/src/wma_main.c

@@ -2023,6 +2023,8 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size)
 	struct wma_txrx_node *iface;
 	struct wake_lock_stats stats;
 	struct wlan_objmgr_vdev *vdev;
+	uint32_t rate_flag;
+	QDF_STATUS status;
 
 	wma = cds_get_context(QDF_MODULE_ID_WMA);
 	if (!wma) {
@@ -2034,7 +2036,15 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size)
 
 	for (vdev_id = 0; vdev_id < wma->max_bssid; vdev_id++) {
 		iface = &wma->interfaces[vdev_id];
-		if (!iface->handle)
+		vdev = iface->vdev;
+		if (!vdev)
+			continue;
+
+		if (!wlan_vdev_get_dp_handle(iface->vdev))
+			continue;
+
+		status = wma_get_vdev_rate_flag(iface->vdev, &rate_flag);
+		if (QDF_IS_STATUS_ERROR(status))
 			continue;
 
 		vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc,
@@ -2095,7 +2105,7 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size)
 			iface->vdev_active,
 			wma_is_vdev_up(vdev_id),
 			iface->aid,
-			iface->rate_flags,
+			rate_flag,
 			iface->nss,
 			iface->tx_power,
 			iface->max_tx_power,
@@ -2862,11 +2872,6 @@ void wma_vdev_deinit(struct wma_txrx_node *vdev)
 		vdev->beacon = NULL;
 	}
 
-	if (vdev->handle) {
-		qdf_mem_free(vdev->handle);
-		vdev->handle = NULL;
-	}
-
 	if (vdev->addBssStaContext) {
 		qdf_mem_free(vdev->addBssStaContext);
 		vdev->addBssStaContext = NULL;
@@ -4484,6 +4489,7 @@ QDF_STATUS wma_stop(void)
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	int i;
 	struct mac_context *mac = NULL;
+	struct wlan_objmgr_vdev *vdev;
 
 	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
 	WMA_LOGD("%s: Enter", __func__);
@@ -4521,12 +4527,14 @@ QDF_STATUS wma_stop(void)
 		WMA_LOGE("Failed to destroy the log completion timer");
 	/* clean up ll-queue for all vdev */
 	for (i = 0; i < wma_handle->max_bssid; i++) {
-		if (wma_handle->interfaces[i].handle &&
-				wma_is_vdev_up(i)) {
-			cdp_fc_vdev_flush(
-				cds_get_context(QDF_MODULE_ID_SOC),
-				wma_handle->
-				interfaces[i].handle);
+		vdev = wma_handle->interfaces[i].vdev;
+		if (!vdev)
+			continue;
+		if (wlan_vdev_get_dp_handle(vdev) && wma_is_vdev_up(i)) {
+			cdp_fc_vdev_flush
+			(cds_get_context(QDF_MODULE_ID_SOC),
+			 wlan_vdev_get_dp_handle
+				(wma_handle->interfaces[i].vdev));
 		}
 	}
 

+ 25 - 41
core/wma/src/wma_mgmt.c

@@ -516,20 +516,6 @@ exit_handler:
 	return 0;
 }
 
-/**
- * wma_unified_bcntx_status_event_handler() - beacon tx status event handler
- * @handle: wma handle
- * @cmd_param_info: event data
- * @len: data length
- *
- * WMI Handler for WMI_OFFLOAD_BCN_TX_STATUS_EVENTID event from firmware.
- * This event is generated by FW when the beacon transmission is offloaded
- * and the host performs beacon template modification using WMI_BCN_TMPL_CMDID
- * The FW generates this event when the first successful beacon transmission
- * after template update
- *
- * Return: 0 for success or error code
- */
 int wma_unified_bcntx_status_event_handler(void *handle,
 					   uint8_t *cmd_param_info,
 					   uint32_t len)
@@ -538,6 +524,7 @@ int wma_unified_bcntx_status_event_handler(void *handle,
 	WMI_OFFLOAD_BCN_TX_STATUS_EVENTID_param_tlvs *param_buf;
 	wmi_offload_bcn_tx_status_event_fixed_param *resp_event;
 	tSirFirstBeaconTxCompleteInd *beacon_tx_complete_ind;
+	struct cdp_vdev *dp_handle;
 
 	param_buf =
 		(WMI_OFFLOAD_BCN_TX_STATUS_EVENTID_param_tlvs *) cmd_param_info;
@@ -559,7 +546,9 @@ int wma_unified_bcntx_status_event_handler(void *handle,
 	/* Check for valid handle to ensure session is not
 	 * deleted in any race
 	 */
-	if (!wma->interfaces[resp_event->vdev_id].handle) {
+	dp_handle = wlan_vdev_get_dp_handle
+			(wma->interfaces[resp_event->vdev_id].vdev);
+	if (!dp_handle) {
 		WMA_LOGE("%s: The session does not exist", __func__);
 		return -EINVAL;
 	}
@@ -1838,20 +1827,19 @@ wma_process_update_beacon_params(tp_wma_handle wma,
 				     bcn_params);
 }
 
-/**
- * wma_update_rts_params() - update cfg parameters to target
- * @wma: wma handle
- * @value: rts_threshold
- *
- * Return: none
- */
 void wma_update_rts_params(tp_wma_handle wma, uint32_t value)
 {
 	uint8_t vdev_id;
 	QDF_STATUS ret;
+	struct cdp_vdev *handle;
+	struct wlan_objmgr_vdev *vdev;
 
 	for (vdev_id = 0; vdev_id < wma->max_bssid; vdev_id++) {
-		if (wma->interfaces[vdev_id].handle != 0) {
+		vdev = wma->interfaces[vdev_id].vdev;
+		if (!vdev)
+			continue;
+		handle = wlan_vdev_get_dp_handle(vdev);
+		if (handle) {
 			ret = wma_vdev_set_param(wma->wmi_handle,
 						 vdev_id,
 						 WMI_VDEV_PARAM_RTS_THRESHOLD,
@@ -1863,20 +1851,19 @@ void wma_update_rts_params(tp_wma_handle wma, uint32_t value)
 	}
 }
 
-/**
- * wma_update_frag_params() - update cfg parameters to target
- * @wma: wma handle
- * @value: frag_threshold
- *
- * Return: none
- */
 void wma_update_frag_params(tp_wma_handle wma, uint32_t value)
 {
 	uint8_t vdev_id;
 	QDF_STATUS ret;
+	struct cdp_vdev *handle;
+	struct wlan_objmgr_vdev *vdev;
 
 	for (vdev_id = 0; vdev_id < wma->max_bssid; vdev_id++) {
-		if (wma->interfaces[vdev_id].handle != 0) {
+		vdev = wma->interfaces[vdev_id].vdev;
+		if (!vdev)
+			continue;
+		handle = wlan_vdev_get_dp_handle(vdev);
+		if (handle) {
 			ret = wma_vdev_set_param(wma->wmi_handle,
 					vdev_id,
 					WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD,
@@ -3036,14 +3023,6 @@ static QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * wma_tbttoffset_update_event_handler() - tbtt offset update handler
- * @handle: wma handle
- * @event: event buffer
- * @len: data length
- *
- * Return: 0 for success or error code
- */
 int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
 					       uint32_t len)
 {
@@ -3077,7 +3056,11 @@ int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
 	}
 
 	for (; (if_id < wma->max_bssid && vdev_map); vdev_map >>= 1, if_id++) {
-		if (!(vdev_map & 0x1) || (!(intf[if_id].handle)))
+		if (!intf[if_id].vdev)
+			continue;
+
+		if (!(vdev_map & 0x1) ||
+		    (!wlan_vdev_get_dp_handle(intf[if_id].vdev)))
 			continue;
 
 		bcn = intf[if_id].beacon;
@@ -4747,7 +4730,8 @@ QDF_STATUS wma_mgmt_unified_cmd_send(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	txrx_vdev = wma_handle->interfaces[mgmt_params->vdev_id].handle;
+	txrx_vdev = wlan_vdev_get_dp_handle
+			(wma_handle->interfaces[mgmt_params->vdev_id].vdev);
 
 	if (wmi_service_enabled(wma_handle->wmi_handle,
 				   wmi_service_mgmt_tx_wmi)) {

+ 2 - 16
core/wma/src/wma_power.c

@@ -714,13 +714,6 @@ static enum powersave_qpower_mode wma_get_qpower_config(tp_wma_handle wma)
 	}
 }
 
-/**
- * wma_enable_sta_ps_mode() - enable sta powersave params in fw
- * @wma: wma handle
- * @ps_req: power save request
- *
- * Return: none
- */
 void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req)
 {
 	uint32_t vdev_id = ps_req->sessionid;
@@ -728,7 +721,7 @@ void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req)
 	enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma);
 	struct wma_txrx_node *iface = &wma->interfaces[vdev_id];
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("vdev id %d is not active", vdev_id);
 		return;
 	}
@@ -863,13 +856,6 @@ QDF_STATUS wma_set_qpower_config(uint8_t vdev_id, uint8_t qpower)
 					    wma_get_qpower_config(wma));
 }
 
-/**
- * wma_enable_uapsd_mode() - enable uapsd mode in fw
- * @wma: wma handle
- * @ps_req: power save request
- *
- * Return: none
- */
 void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req)
 {
 	QDF_STATUS ret;
@@ -878,7 +864,7 @@ void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req)
 	enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma);
 	struct wma_txrx_node *iface = &wma->interfaces[vdev_id];
 
-	if (!iface->handle) {
+	if (!wlan_vdev_get_dp_handle(iface->vdev)) {
 		WMA_LOGE("vdev id %d is not active", vdev_id);
 		return;
 	}

+ 13 - 12
core/wma/src/wma_utils.c

@@ -1976,17 +1976,18 @@ void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle)
 QDF_STATUS wma_process_ll_stats_clear_req(tp_wma_handle wma,
 				 const tpSirLLStatsClearReq clearReq)
 {
-	struct wlan_objmgr_vdev *vdev;
 	uint8_t *addr;
 	struct ll_stats_clear_params cmd = {0};
 	int ret;
+	struct wlan_objmgr_vdev *vdev;
 
 	if (!clearReq || !wma) {
 		WMA_LOGE("%s: input pointer is NULL", __func__);
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (!wma->interfaces[clearReq->staId].handle) {
+	vdev = wma->interfaces[clearReq->staId].vdev;
+	if (!wlan_vdev_get_dp_handle(vdev)) {
 		WMA_LOGE("%s: vdev_id %d handle is NULL",
 			 __func__, clearReq->staId);
 		return QDF_STATUS_E_FAILURE;
@@ -2439,14 +2440,6 @@ void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus,
 	}
 }
 
-/**
- * wma_link_status_event_handler() - link status event handler
- * @handle: wma handle
- * @cmd_param_info: data from event
- * @len: length
- *
- * Return: 0 for success or error code
- */
 int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
 				  uint32_t len)
 {
@@ -2456,7 +2449,8 @@ int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
 	wmi_vdev_rate_ht_info *ht_info;
 	struct wma_txrx_node *intr = wma->interfaces;
 	uint8_t link_status = LINK_STATUS_LEGACY;
-	uint32_t i;
+	uint32_t i, rate_flag;
+	QDF_STATUS status;
 
 	param_buf =
 	      (WMI_UPDATE_VDEV_RATE_STATS_EVENTID_param_tlvs *) cmd_param_info;
@@ -2479,6 +2473,13 @@ int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
 			param_buf->num_ht_info);
 		return -EINVAL;
 	}
+
+	status = wma_get_vdev_rate_flag(intr[ht_info->vdevid].vdev, &rate_flag);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		WMA_LOGE("%s: Failed to get rate flag",	__func__);
+		return -EINVAL;
+	}
+
 	for (i = 0; (i < event->num_vdev_stats) && ht_info; i++) {
 		WMA_LOGD("%s vdevId:%d  tx_nss:%d rx_nss:%d tx_preamble:%d rx_preamble:%d",
 			__func__, ht_info->vdevid, ht_info->tx_nss,
@@ -2496,7 +2497,7 @@ int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info,
 			if (intr[ht_info->vdevid].nss == 2)
 				link_status |= LINK_SUPPORT_MIMO;
 
-			if (intr[ht_info->vdevid].rate_flags &
+			if (rate_flag &
 				(TX_RATE_VHT20 | TX_RATE_VHT40 |
 				TX_RATE_VHT80))
 				link_status |= LINK_SUPPORT_VHT;