Browse Source

qcacmn: Reset vdev id for 11d scan after vdev destroy

In regulatory component, currently, default vdev id for 11d scan is
not reset after last sta vdev delete.

When SAP is stopped/started after last sta destroy, above behavior can
lead to invocation of WMI command to start/stop 11d scan for destroyed
vdev. Sometimes, this leads to firmware assert.

To address this, reset vdev_id_for_11d_scan to INVALID_VDEV_ID (0xFF)
after the last sta vdev destroy.

Change-Id: Ic8abaf6ac680b22fa9218c058a34cbf3c3b5bf1f
CRs-Fixed: 2415462
Rajeev Kumar Sirasanagandla 6 years ago
parent
commit
e565a27cdd

+ 21 - 3
umac/regulatory/core/src/reg_offload_11d_scan.c

@@ -125,7 +125,13 @@ static QDF_STATUS reg_send_11d_msg_cbk(struct scheduler_msg *msg)
 	psoc_priv_obj = reg_get_psoc_obj(psoc);
 	if (!psoc_priv_obj) {
 		reg_err("psoc priv obj is NULL");
-		return QDF_STATUS_E_FAILURE;
+		goto end;
+	}
+
+	if (psoc_priv_obj->vdev_id_for_11d_scan == INVALID_VDEV_ID) {
+		psoc_priv_obj->enable_11d_supp = false;
+		reg_err("No valid vdev for 11d scan command");
+		goto end;
 	}
 
 	if (psoc_priv_obj->enable_11d_supp) {
@@ -140,6 +146,7 @@ static QDF_STATUS reg_send_11d_msg_cbk(struct scheduler_msg *msg)
 		tx_ops->stop_11d_scan(psoc, &stop_req);
 	}
 
+end:
 	wlan_objmgr_psoc_release_ref(psoc, WLAN_REGULATORY_SB_ID);
 	return QDF_STATUS_SUCCESS;
 }
@@ -186,6 +193,12 @@ void reg_run_11d_state_machine(struct wlan_objmgr_psoc *psoc)
 		return;
 	}
 
+	if (psoc_priv_obj->vdev_id_for_11d_scan == INVALID_VDEV_ID) {
+		psoc_priv_obj->enable_11d_supp = false;
+		reg_err("No valid vdev for 11d scan command");
+		return;
+	}
+
 	world_mode = reg_is_world_alpha2(psoc_priv_obj->cur_country);
 
 	temp_11d_support = psoc_priv_obj->enable_11d_supp;
@@ -309,9 +322,14 @@ QDF_STATUS reg_11d_vdev_delete_update(struct wlan_objmgr_vdev *vdev)
 			}
 		}
 
-		if ((psoc_priv_obj->vdev_id_for_11d_scan != vdev_id) ||
-		    !psoc_priv_obj->vdev_cnt_11d)
+		if (psoc_priv_obj->vdev_id_for_11d_scan != vdev_id)
+			return QDF_STATUS_SUCCESS;
+
+		if (!psoc_priv_obj->vdev_cnt_11d) {
+			psoc_priv_obj->vdev_id_for_11d_scan = INVALID_VDEV_ID;
+			psoc_priv_obj->enable_11d_supp = false;
 			return QDF_STATUS_SUCCESS;
+		}
 
 		for (i = 0; i < MAX_STA_VDEV_CNT; i++) {
 			if (psoc_priv_obj->vdev_ids_11d[i] == INVALID_VDEV_ID)

+ 1 - 0
umac/regulatory/core/src/reg_priv_objs.c

@@ -89,6 +89,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 	soc_reg_obj->force_ssc_disable_indoor_channel = false;
 	soc_reg_obj->master_vdev_cnt = 0;
 	soc_reg_obj->vdev_cnt_11d = 0;
+	soc_reg_obj->vdev_id_for_11d_scan = INVALID_VDEV_ID;
 	soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART;
 	soc_reg_obj->enable_srd_chan_in_master_mode = false;
 	soc_reg_obj->enable_11d_in_world_mode = false;