Pārlūkot izejas kodu

qcacld-3.0: Remove legacy APIs to modify vdev state machine

This change Removes legacy APIs to modify vdev state machine and
add use new API to get vdev state.

Change-Id: I48aa3744dafc6d13a43a14e48de821c7dadf3a37
CRs-Fixed: 2314730
Abhishek Singh 6 gadi atpakaļ
vecāks
revīzija
5ad797d0b3

+ 0 - 20
components/pmo/core/inc/wlan_pmo_main.h

@@ -320,26 +320,6 @@ void pmo_core_psoc_set_txrx_handle(struct wlan_objmgr_psoc *psoc,
  */
 void *pmo_core_psoc_get_txrx_handle(struct wlan_objmgr_psoc *psoc);
 
-/**
- * pmo_is_vdev_up() - API to check whether vdev is UP
- * @vdev: objmgr vdev handle
- *
- * Return:true if vdev is up else false
- */
-static inline
-bool pmo_is_vdev_up(struct wlan_objmgr_vdev *vdev)
-{
-	enum wlan_vdev_state state = WLAN_VDEV_S_INIT;
-
-	if (!vdev) {
-		pmo_err("vdev context is invalid!");
-		return false;
-	}
-	state = wlan_vdev_mlme_get_state(vdev);
-
-	return state == WLAN_VDEV_S_RUN;
-}
-
 /**
  * pmo_intersect_arp_ns_offload() - intersect config and firmware capability for
  *	the ARP/NS Offload feature

+ 2 - 1
components/pmo/core/src/wlan_pmo_wow.c

@@ -27,6 +27,7 @@
 #include "wlan_pmo_static_config.h"
 #include "wlan_reg_services_api.h"
 #include "cfg_nan_api.h"
+#include "wlan_utility.h"
 
 void pmo_set_wow_event_bitmap(WOW_WAKE_EVENT_TYPE event,
 			      uint32_t wow_bitmap_size,
@@ -239,7 +240,7 @@ bool pmo_is_beaconing_vdev_up(struct wlan_objmgr_psoc *psoc)
 
 		vdev_opmode = pmo_get_vdev_opmode(vdev);
 		is_beaconing = pmo_is_vdev_in_beaconning_mode(vdev_opmode) &&
-			       pmo_is_vdev_up(vdev);
+			       wlan_vdev_is_up(vdev);
 
 		pmo_vdev_put_ref(vdev);
 

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

@@ -2017,6 +2017,7 @@ void wma_mgmt_nbuf_unmap_cb(struct wlan_objmgr_pdev *pdev,
 int wma_chan_info_event_handler(void *handle, uint8_t *event_buf,
 						uint32_t len);
 
+#ifndef CONFIG_VDEV_SM
 /**
  * wma_vdev_set_mlme_state() - Set vdev mlme state
  * @wma: wma handle
@@ -2045,7 +2046,7 @@ void wma_vdev_set_mlme_state(tp_wma_handle wma, uint8_t vdev_id,
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
 	}
 }
-
+#endif
 /**
  * wma_update_vdev_pause_bitmap() - update vdev pause bitmap
  * @vdev_id: the Id of the vdev to configure

+ 20 - 0
core/wma/src/wma_dev_if.c

@@ -1261,13 +1261,17 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 			if (QDF_IS_STATUS_ERROR(status)) {
 				WMA_LOGE("%s:vdev_up failed vdev_id %d",
 					 __func__, resp_event->vdev_id);
+#ifndef CONFIG_VDEV_SM
 				wma_vdev_set_mlme_state(wma,
 					resp_event->vdev_id, WLAN_VDEV_S_STOP);
+#endif
 				policy_mgr_set_do_hw_mode_change_flag(
 					wma->psoc, false);
 			} else {
+#ifndef CONFIG_VDEV_SM
 				wma_vdev_set_mlme_state(wma,
 					resp_event->vdev_id, WLAN_VDEV_S_RUN);
+#endif
 				if (iface->beacon_filter_enabled)
 					wma_add_beacon_filter(wma,
 							&iface->beacon_filter);
@@ -1292,8 +1296,10 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 				wma->psoc, false);
 			return -EEXIST;
 		}
+#ifndef CONFIG_VDEV_SM
 		wma_vdev_set_mlme_state(wma, resp_event->vdev_id,
 			WLAN_VDEV_S_RUN);
+#endif
 		ucfg_ocb_config_channel(wma->pdev);
 	}
 
@@ -2070,7 +2076,9 @@ wma_send_vdev_down_bss(tp_wma_handle wma, struct wma_target_req *req)
 	if (wma_send_vdev_down_to_fw(wma, vdev_id) != QDF_STATUS_SUCCESS) {
 		WMA_LOGE("Failed to send vdev down cmd: vdev %d", vdev_id);
 	} else {
+#ifndef CONFIG_VDEV_SM
 		wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_STOP);
+#endif
 		wma_check_and_find_mcc_ap(wma, vdev_id);
 	}
 
@@ -2917,12 +2925,14 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	}
 
 	if (isRestart) {
+#ifndef CONFIG_VDEV_SM
 		/*
 		 * Marking the VDEV UP STATUS to false
 		 * since, VDEV RESTART will do a VDEV DOWN
 		 * in the firmware.
 		 */
 		wma_vdev_set_mlme_state(wma, params.vdev_id, WLAN_VDEV_S_STOP);
+#endif
 	} else {
 		WMA_LOGD("%s, vdev_id: %d, unpausing tx_ll_queue at VDEV_START",
 			 __func__, params.vdev_id);
@@ -3533,8 +3543,10 @@ void wma_vdev_resp_timer(void *data)
 			WMA_LOGE("Failed to send vdev down cmd: vdev %d",
 				 tgt_req->vdev_id);
 		} else {
+#ifndef CONFIG_VDEV_SM
 			wma_vdev_set_mlme_state(wma, tgt_req->vdev_id,
 				WLAN_VDEV_S_STOP);
+#endif
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 		if (mac_ctx->sap.sap_channel_avoidance)
 			wma_find_mcc_ap(wma, tgt_req->vdev_id, false);
@@ -3631,8 +3643,10 @@ void wma_vdev_resp_timer(void *data)
 
 		WMA_LOGE(FL("Failed to send OCB set config cmd"));
 		iface = &wma->interfaces[tgt_req->vdev_id];
+#ifndef CONFIG_VDEV_SM
 		wma_vdev_set_mlme_state(wma, tgt_req->vdev_id,
 			WLAN_VDEV_S_STOP);
+#endif
 		wma_ocb_set_config_resp(wma, QDF_STATUS_E_TIMEOUT);
 	} else if (tgt_req->msg_type == WMA_HIDDEN_SSID_VDEV_RESTART) {
 		if ((qdf_atomic_read(
@@ -5081,8 +5095,10 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 		status = QDF_STATUS_E_FAILURE;
 	} else {
 		wma_set_vdev_mgmt_rate(wma, params->smesessionId);
+#ifndef CONFIG_VDEV_SM
 		wma_vdev_set_mlme_state(wma, params->smesessionId,
 				WLAN_VDEV_S_RUN);
+#endif
 	}
 
 	qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STARTED);
@@ -5593,7 +5609,9 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 	qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
 	WMA_LOGD("%s: (type %d subtype %d) BSS is stopped",
 			__func__, iface->type, iface->sub_type);
+#ifndef CONFIG_VDEV_SM
 	wma_vdev_set_mlme_state(wma, params->smesessionId, WLAN_VDEV_S_STOP);
+#endif
 	params->status = QDF_STATUS_SUCCESS;
 	if (!iface->peer_count) {
 		WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
@@ -5756,8 +5774,10 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 		roam_synch_in_progress = true;
 		WMA_LOGD("LFR3:%s: Setting vdev_up to FALSE for session %d",
 			__func__, params->smesessionId);
+#ifndef CONFIG_VDEV_SM
 		wma_vdev_set_mlme_state(wma, params->smesessionId,
 			WLAN_VDEV_S_STOP);
+#endif
 		goto detach_peer;
 	}
 	msg = wma_fill_vdev_req(wma, params->smesessionId, WMA_DELETE_BSS_REQ,

+ 4 - 0
core/wma/src/wma_mgmt.c

@@ -2912,7 +2912,9 @@ void wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id)
 					wma->psoc, false);
 				return;
 			}
+#ifndef CONFIG_VDEV_SM
 			wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_RUN);
+#endif
 			wma_set_sap_keepalive(wma, vdev_id);
 			wma_set_vdev_mgmt_rate(wma, vdev_id);
 		}
@@ -3441,7 +3443,9 @@ void wma_hidden_ssid_vdev_restart(tp_wma_handle wma,
 	params.reg_info_1 = intr[vdev_id].vdev_restart_params.chan.reg_info_1;
 	params.reg_info_2 = intr[vdev_id].vdev_restart_params.chan.reg_info_2;
 
+#ifndef CONFIG_VDEV_SM
 	wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_STOP);
+#endif
 	status = wmi_unified_hidden_ssid_vdev_restart_send(wma->wmi_handle,
 							   &params);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 2 - 0
core/wma/src/wma_scan_roam.c

@@ -2245,7 +2245,9 @@ static void wma_roam_update_vdev(tp_wma_handle wma,
 	wma_set_linkstate(wma, set_link_params);
 	wma_add_bss(wma, (tpAddBssParams)roam_synch_ind_ptr->add_bss_params);
 	wma_add_sta(wma, add_sta_params);
+#ifndef CONFIG_VDEV_SM
 	wma_vdev_set_mlme_state(wma, vdev_id, WLAN_VDEV_S_RUN);
+#endif
 	qdf_mem_copy(wma->interfaces[vdev_id].bssid,
 			roam_synch_ind_ptr->bssid.bytes, IEEE80211_ADDR_LEN);
 	qdf_mem_free(del_bss_params);

+ 6 - 6
core/wma/src/wma_utils.c

@@ -59,6 +59,8 @@
 #include <cdp_txrx_handle.h>
 #include "cds_reg_service.h"
 #include "target_if.h"
+#include <wlan_utility.h>
+
 
 /* MCS Based rate table */
 /* HT MCS parameters with Nss = 1 */
@@ -4350,22 +4352,20 @@ bool wma_is_vdev_up(uint8_t vdev_id)
 {
 	struct wlan_objmgr_vdev *vdev;
 	tp_wma_handle wma = (tp_wma_handle)cds_get_context(QDF_MODULE_ID_WMA);
-	enum wlan_vdev_state state = WLAN_VDEV_S_INIT;
+	bool is_up = false;
 
 	if (!wma) {
 		WMA_LOGE("%s: WMA context is invald!", __func__);
-		return false;
+		return is_up;
 	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
 			WLAN_LEGACY_WMA_ID);
 	if (vdev) {
-		wlan_vdev_obj_lock(vdev);
-		state = wlan_vdev_mlme_get_state(vdev);
-		wlan_vdev_obj_unlock(vdev);
+		is_up = wlan_vdev_is_up(vdev);
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
 	}
-	return (state == WLAN_VDEV_S_RUN) ? true : false;
+	return is_up;
 }
 
 void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec)