Prechádzať zdrojové kódy

qcacld-3.0: Add vdev valid check for vdev level wmi commands

Check if vdev is active for the following vdev commands before
sending it to firmware:
1. WMI_SCAN_PROB_REQ_OUI_CMDID
2. WMI_VDEV_WMM_ADDTS_CMDID
3. WMI_VDEV_SET_WMM_PARAMS_CMDID
4. WMI_BCN_TMPL_CMDID

This will avoid the race condition where the vdev is deleted
and the vdev related commands for the deleted vdev are sent
to firmware before wmi_stop_inprogress is set at wmi.

Change-Id: Ib3eacc191002395de9640516b9088b01b3a64966
CRs-Fixed: 2392770
Pragaspathi Thilagaraj 6 rokov pred
rodič
commit
d5cb9e8196

+ 8 - 3
core/wma/src/wma_features.c

@@ -3036,11 +3036,16 @@ void wma_del_ts_req(tp_wma_handle wma, struct del_ts_params *msg)
 }
 
 void wma_aggr_qos_req(tp_wma_handle wma,
-		      struct aggr_add_ts_param *pAggrQosRspMsg)
+		      struct aggr_add_ts_param *aggr_qos_rsp_msg)
 {
-	wmi_unified_aggr_qos_cmd(wma->wmi_handle, pAggrQosRspMsg);
+	if (!wma_is_vdev_valid(aggr_qos_rsp_msg->vdev_id)) {
+		WMA_LOGE("%s: vdev id:%d is not active ", __func__,
+			 aggr_qos_rsp_msg->vdev_id);
+		return;
+	}
+	wmi_unified_aggr_qos_cmd(wma->wmi_handle, aggr_qos_rsp_msg);
 	/* send response to upper layers from here only. */
-	wma_send_msg_high_priority(wma, WMA_AGGR_QOS_RSP, pAggrQosRspMsg, 0);
+	wma_send_msg_high_priority(wma, WMA_AGGR_QOS_RSP, aggr_qos_rsp_msg, 0);
 }
 
 #ifdef FEATURE_WLAN_ESE

+ 2 - 2
core/wma/src/wma_main.c

@@ -7585,7 +7585,7 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle,
 		return;
 	}
 	if (!wma_is_vdev_valid(req_buf->vdev_id)) {
-		WMA_LOGE("vdev id not active or not valid");
+		WMA_LOGE("vdev id:%d is not active", req_buf->vdev_id);
 		return;
 	}
 
@@ -7617,7 +7617,7 @@ static void wma_get_arp_req_stats(WMA_HANDLE handle,
 		return;
 	}
 	if (!wma_is_vdev_valid(req_buf->vdev_id)) {
-		WMA_LOGE("vdev id not active or not valid");
+		WMA_LOGE("vdev id:%d is not active", req_buf->vdev_id);
 		return;
 	}
 

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

@@ -2599,6 +2599,10 @@ QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	vdev_id = edca_params->bssIdx;
+	if (!wma_is_vdev_valid(vdev_id)) {
+		WMA_LOGE("%s: vdev id:%d is not active ", __func__, vdev_id);
+		goto fail;
+	}
 
 	for (ac = 0; ac < WME_NUM_AC; ac++) {
 		switch (ac) {
@@ -2707,6 +2711,11 @@ static QDF_STATUS wma_unified_bcn_tmpl_send(tp_wma_handle wma,
 	uint64_t adjusted_tsf_le;
 	struct ieee80211_frame *wh;
 
+	if (!wma_is_vdev_valid(vdev_id)) {
+		WMA_LOGE("%s: vdev id:%d is not active ", __func__, vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	WMA_LOGD("Send beacon template for vdev %d", vdev_id);
 
 	if (bcn_info->p2pIeOffset) {

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

@@ -4829,6 +4829,12 @@ QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma,
 		return QDF_STATUS_E_INVAL;
 	}
 
+	if (!wma_is_vdev_valid(set_oui->vdev_id)) {
+		WMA_LOGE("%s: vdev_id: %d is not active", __func__,
+			 set_oui->vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	return wmi_unified_scan_probe_setoui_cmd(wma->wmi_handle, set_oui);
 }