浏览代码

qcacld-3.0: Don't allow roam invoke if roaming offload is not initialized

Roam invoke is done by driver if reconnect to same bssid is
received or driver FASTREASSOC command is received from the
supplicant. If roaming module is not initialized at firmware,
then still we send roam invoke to firmware and firmware sends
roam invoke failure as part of which disconnection occurs.

Check if roaming module is initialized at firmware, else return
failure for the reassociation request from userspace.
Send failure only if the kernel version is greater than 4.9,
since the fix to handle reassociation failure is available from
this version.

Change-Id: I0feae326be751e50f7327c91739cd7dddab500e9
CRs-Fixed: 2724686
Pragaspathi Thilagaraj 4 年之前
父节点
当前提交
ef4302f003
共有 2 个文件被更改,包括 37 次插入2 次删除
  1. 3 2
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 34 0
      core/hdd/src/wlan_hdd_ioctl.c

+ 3 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -20342,10 +20342,11 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
 	}
 
 	/*
-	 * Check if this is reassoc to same bssid, if reassoc is success, return
+	 * Check if this is reassoc to same bssid, if reassoc is success or if
+	 * roam invoke is not allowed, return the status
 	 */
 	status = wlan_hdd_reassoc_bssid_hint(adapter, req);
-	if (!status)
+	if (!status || status == -EPERM)
 		return status;
 
 	/* Try disconnecting if already in connected state */

+ 34 - 0
core/hdd/src/wlan_hdd_ioctl.c

@@ -515,6 +515,32 @@ QDF_STATUS hdd_wma_send_fastreassoc_cmd(struct hdd_adapter *adapter,
 }
 #endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
+/**
+ * hdd_is_fast_reassoc_allowed  - check if roaming offload init is
+ * done. If roaming offload is not initialized, don't allow roam invoke
+ * to be triggered.
+ * @psoc: Pointer to psoc object
+ * @vdev_id: vdev_id
+ *
+ * This API should return true if kernel version is less than 4.9, because
+ * the earlier versions don't have the fix to handle reassociation failure.
+ *
+ * Return: true if roaming module initialization is done else false
+ */
+static bool
+hdd_is_fast_reassoc_allowed(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
+{
+	return MLME_IS_ROAM_INITIALIZED(psoc, vdev_id);
+}
+#else
+static inline bool
+hdd_is_fast_reassoc_allowed(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
+{
+	return true;
+}
+#endif
+
 int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
 		uint32_t ch_freq, const handoff_src src)
 {
@@ -573,6 +599,14 @@ int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid,
 
 	/* Proceed with reassoc */
 	if (roaming_offload_enabled(hdd_ctx)) {
+		if (!hdd_is_fast_reassoc_allowed(hdd_ctx->psoc,
+						adapter->vdev_id)) {
+			hdd_err("LFR3: vdev[%d] Roaming module is not initialized",
+				adapter->vdev_id);
+			ret = -EPERM;
+			goto exit;
+		}
+
 		status = hdd_wma_send_fastreassoc_cmd(adapter, bssid, ch_freq);
 		if (status != QDF_STATUS_SUCCESS) {
 			hdd_err("Failed to send fast reassoc cmd");