瀏覽代碼

qcacmn: Fix disable channel list command

Currently driver is using sap notify api of regulatory to
update channel list for disable channel list command
which is not the correct way as sap notify api is designed
to be used by sap releted operations.

To address above issue write a separate api for
disable channel list command.

Change-Id: I79ded748bd46ec4be431c1ff6ab64c6ac8bf46be
CRs-Fixed: 2875324
Ashish Kumar Dhanotiya 4 年之前
父節點
當前提交
5796dd49e2

+ 1 - 2
umac/regulatory/core/src/reg_callbacks.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -346,7 +346,6 @@ QDF_STATUS reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
 		return QDF_STATUS_SUCCESS;
 
 	pdev_priv_obj->sap_state = sap_state;
-	set_disable_channel_state(pdev_priv_obj);
 
 	reg_compute_pdev_current_chan_list(pdev_priv_obj);
 	status = reg_send_scheduler_msg_sb(psoc, pdev);

+ 22 - 10
umac/regulatory/core/src/reg_utils.c

@@ -519,7 +519,6 @@ QDF_STATUS reg_get_band(struct wlan_objmgr_pdev *pdev,
 #ifdef DISABLE_CHANNEL_LIST
 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 {
-	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
 	struct wlan_objmgr_psoc *psoc;
 	QDF_STATUS status;
@@ -536,13 +535,31 @@ QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 		return QDF_STATUS_E_INVAL;
 	}
 
-	psoc_priv_obj = reg_get_psoc_obj(psoc);
-	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
-		reg_err("psoc reg component is NULL");
+	pdev_priv_obj->disable_cached_channels = false;
+	reg_compute_pdev_current_chan_list(pdev_priv_obj);
+	status = reg_send_scheduler_msg_sb(psoc, pdev);
+	return status;
+}
+
+QDF_STATUS reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("pdev reg component is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
-	pdev_priv_obj->disable_cached_channels = false;
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		reg_err("psoc is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	pdev_priv_obj->disable_cached_channels = true;
 	reg_compute_pdev_current_chan_list(pdev_priv_obj);
 	status = reg_send_scheduler_msg_sb(psoc, pdev);
 	return status;
@@ -661,11 +678,6 @@ QDF_STATUS reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_SUCCESS;
 }
 #endif /* CONFIG_CHAN_NUM_API */
-void set_disable_channel_state(
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
-{
-	pdev_priv_obj->disable_cached_channels = pdev_priv_obj->sap_state;
-}
 #endif
 
 #ifdef CONFIG_REG_CLIENT

+ 13 - 16
umac/regulatory/core/src/reg_utils.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -129,7 +129,12 @@ reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
 
 #ifdef DISABLE_CHANNEL_LIST
 /**
- * reg_restore_cached_channels() - Cache the current state of the channels
+ * reg_disable_cached_channels() - Disable cached channels
+ * @pdev: The physical dev to cache the channels for
+ */
+QDF_STATUS reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev);
+/**
+ * reg_restore_cached_channels() - Restore disabled cached channels
  * @pdev: The physical dev to cache the channels for
  */
 QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev);
@@ -139,6 +144,12 @@ QDF_STATUS reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline
+QDF_STATUS reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif /* DISABLE_CHANNEL_LIST */
 
 #if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_FREQ_API)
@@ -601,18 +612,4 @@ static inline bool reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
-#if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_REG_CLIENT)
-/**
- * set_disable_channel_state() - Set disable channel state flag
- * @pdev_priv_obj: Pointer to pdev object
- */
-void set_disable_channel_state(
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj);
-#else
-static inline void set_disable_channel_state(
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
-{
-}
-#endif
-
 #endif

+ 17 - 4
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -104,15 +104,28 @@ void ucfg_reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
 }
 #endif /* CONFIG_CHAN_FREQ_API */
 
+#ifdef DISABLE_CHANNEL_LIST
 /**
- * ucfg_reg_restore_cached_channels() - Cache the current state of the channles
+ * ucfg_reg_disable_cached_channels() - Disable cached channels
  * @pdev: The physical dev to cache the channels for
  *
- * Return: QDF_STATUS
+ * Return: Void
+ */
+void ucfg_reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * ucfg_reg_restore_cached_channels() - Restore disabled cached channels
+ * @pdev: The physical dev to cache the channels for
+ *
+ * Return: Void
  */
-#ifdef DISABLE_CHANNEL_LIST
 void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev);
 #else
+static inline
+void ucfg_reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev)
+{
+}
+
 static inline
 void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 {

+ 7 - 5
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -326,14 +326,16 @@ void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
 }
 #endif /* CONFIG_CHAN_NUM_API */
 
-/**
- * ucfg_reg_restore_cached_channels() - Cache the current state of the channles
- * @pdev: The physical dev to cache the channels for
- */
 void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
 {
 	reg_restore_cached_channels(pdev);
 }
+
+void ucfg_reg_disable_cached_channels(struct wlan_objmgr_pdev *pdev)
+{
+	reg_disable_cached_channels(pdev);
+}
+
 #endif
 
 QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)