Browse Source

qcacld-3.0: Abort roam invoke if BSSID is present in reject list

Driver adds a BSSID to the reject list due to multiple
DE authentication triggers from associated AP. If DUT tries the
FASTREASSOC command for the same BSSID multiple times, the host
triggers disconnection to handle roaming failure, and this results
in DUT losing the current connection.

To keep the current connection DUT should not trigger a roaming
event if the BSSID is already added to the reject list in the
host.

The fix is to add logic to avoid the FASTREASSOC trigger command
for AP(s) present in the reject list of HOST.

Change-Id: I315da12b3f93d5d9d67396a5dd9e12fa2be5fda0
CRs-Fixed: 3328847
abhinav kumar 2 years ago
parent
commit
9988950c6d

+ 11 - 0
components/denylist_mgr/core/inc/wlan_dlm_core.h

@@ -290,6 +290,17 @@ dlm_get_bssid_reject_list(struct wlan_objmgr_pdev *pdev,
  */
 void dlm_dump_denylist_bssid(struct wlan_objmgr_pdev *pdev);
 
+/**
+ * dlm_is_bssid_in_reject_list - Check whether a BSSID is present in
+ * reject list or not.
+ * @pdev: pdev object
+ * @bssid: bssid to check
+ *
+ * Return: true if BSSID is present in reject list
+ */
+bool dlm_is_bssid_in_reject_list(struct wlan_objmgr_pdev *pdev,
+				 struct qdf_mac_addr *bssid);
+
 /**
  * dlm_get_rssi_denylist_threshold() - Get rssi denylist threshold value
  * @pdev: pdev object

+ 40 - 0
components/denylist_mgr/core/src/wlan_dlm_core.c

@@ -791,6 +791,46 @@ dlm_get_reject_ap_type(struct dlm_reject_ap *dlm_entry)
 	return REJECT_REASON_UNKNOWN;
 }
 
+bool dlm_is_bssid_in_reject_list(struct wlan_objmgr_pdev *pdev,
+				 struct qdf_mac_addr *bssid)
+{
+	struct dlm_pdev_priv_obj *dlm_ctx;
+	struct dlm_reject_ap *dlm_entry = NULL;
+	qdf_list_node_t *cur_node = NULL, *next_node = NULL;
+	QDF_STATUS status;
+
+	dlm_ctx = dlm_get_pdev_obj(pdev);
+	if (!dlm_ctx) {
+		dlm_err("dlm_ctx is NULL");
+		return false;
+	}
+
+	status = qdf_mutex_acquire(&dlm_ctx->reject_ap_list_lock);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		dlm_err("failed to acquire reject_ap_list_lock");
+		return false;
+	}
+
+	qdf_list_peek_front(&dlm_ctx->reject_ap_list, &cur_node);
+	while (cur_node) {
+		qdf_list_peek_next(&dlm_ctx->reject_ap_list, cur_node,
+				   &next_node);
+		dlm_entry =
+			qdf_container_of(cur_node, struct dlm_reject_ap, node);
+		if (qdf_is_macaddr_equal(&dlm_entry->bssid, bssid)) {
+			dlm_debug("BSSID is present in reject_ap_list");
+			qdf_mutex_release(&dlm_ctx->reject_ap_list_lock);
+			return true;
+		}
+		cur_node = next_node;
+		next_node = NULL;
+	}
+
+	qdf_mutex_release(&dlm_ctx->reject_ap_list_lock);
+
+	return false;
+}
+
 /**
  * dlm_dump_denylist_bssid() - Function to dump denylisted bssid
  * @pdev:  pdev object

+ 21 - 0
components/denylist_mgr/dispatcher/inc/wlan_dlm_api.h

@@ -91,6 +91,21 @@ wlan_dlm_get_bssid_reject_list(struct wlan_objmgr_pdev *pdev,
 					 reject_ap_type);
 }
 
+/**
+ * wlan_dlm_is_bssid_in_reject_list() - Check whether a BSSID is present in
+ * reject list or not
+ * @pdev: pdev object
+ * @bssid: bssid to check
+ *
+ * Return: true if BSSID is present in reject list
+ */
+static inline bool
+wlan_dlm_is_bssid_in_reject_list(struct wlan_objmgr_pdev *pdev,
+				 struct qdf_mac_addr *bssid)
+{
+	return dlm_is_bssid_in_reject_list(pdev, bssid);
+}
+
 /**
  * wlan_dlm_dump_denylist_bssid() - dump the denylisted BSSIDs from DLM
  * @pdev: pdev object
@@ -119,6 +134,12 @@ wlan_dlm_get_rssi_denylist_threshold(struct wlan_objmgr_pdev *pdev)
 }
 
 #else
+static inline bool
+wlan_dlm_is_bssid_in_reject_list(struct wlan_objmgr_pdev *pdev,
+				 struct qdf_mac_addr *bssid)
+{
+	return false;
+}
 
 static inline QDF_STATUS
 wlan_dlm_add_bssid_to_reject_list(struct wlan_objmgr_pdev *pdev,

+ 44 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -5528,6 +5528,43 @@ rel_vdev_ref:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 }
 
+/**
+ * cm_dlm_is_bssid_in_reject_list() - Check whether a BSSID is present in
+ * reject list or not
+ * @psoc: psoc pointer
+ * @bssid: bssid to check
+ * @vdev_id: vdev id
+ *
+ * Return: true if BSSID is present in reject list
+ */
+static bool cm_dlm_is_bssid_in_reject_list(struct wlan_objmgr_psoc *psoc,
+					   struct qdf_mac_addr *bssid,
+					   uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_objmgr_pdev *pdev;
+	bool is_bssid_in_reject_list = false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return is_bssid_in_reject_list;
+	}
+
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		goto rel_vdev_ref;
+
+	is_bssid_in_reject_list =
+			wlan_dlm_is_bssid_in_reject_list(pdev, bssid);
+
+rel_vdev_ref:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+	return is_bssid_in_reject_list;
+}
+
 QDF_STATUS cm_start_roam_invoke(struct wlan_objmgr_psoc *psoc,
 				struct wlan_objmgr_vdev *vdev,
 				struct qdf_mac_addr *bssid,
@@ -5555,6 +5592,7 @@ QDF_STATUS cm_start_roam_invoke(struct wlan_objmgr_psoc *psoc,
 
 	if (wlan_vdev_mlme_get_is_mlo_link(psoc, vdev_id)) {
 		mlme_err("MLO ROAM: Invalid Roam req on link vdev %d", vdev_id);
+		qdf_mem_free(cm_req);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -5562,6 +5600,12 @@ QDF_STATUS cm_start_roam_invoke(struct wlan_objmgr_psoc *psoc,
 	if (source == CM_ROAMING_FW)
 		goto send_evt;
 
+	if (cm_dlm_is_bssid_in_reject_list(psoc, bssid, vdev_id)) {
+		mlme_debug("BSSID is in reject list, aborting roam invoke");
+		qdf_mem_free(cm_req);
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	if (qdf_is_macaddr_zero(bssid)) {
 		if (!wlan_mlme_is_data_stall_recovery_fw_supported(psoc)) {
 			mlme_debug("FW does not support data stall recovery, aborting roam invoke");