Prechádzať zdrojové kódy

qcacmn: After NOL timeout add channels to ETSI PreCAC Required List

After NOL timeout, if ETSI PreCAC is supported, add the HT20 Channel
to ETSI PreCAC Required List. Also, move NOL detach after ETSI PreCAC
detach to avoid channels being added to ETSI PreCAC Required List when
NOL expiry happens after ETSI PreCAC detach.

Change-Id: I9cdb359eb6905f4f4cfb9d1c784865af0bf39119
CRs-Fixed: 2403489
Hariharan Basuthkar 6 rokov pred
rodič
commit
1720fd98a6

+ 17 - 1
umac/dfs/core/src/dfs_etsi_precac.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
  * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
@@ -87,6 +87,22 @@ static inline void dfs_reset_etsiprecaclists(struct wlan_dfs *dfs)
 }
 #endif
 
+/**
+ * dfs_add_to_etsi_precac_required_list()- Add channel to ETSI PreCAC Required
+ * list.
+ *
+ * @dfs: Pointer to wlan_dfs structure.
+ * @chan: Pointer to channel to be added to ETSI PreCAC Required List.
+ */
+#if defined(QCA_SUPPORT_ETSI_PRECAC_DFS)
+void dfs_add_to_etsi_precac_required_list(struct wlan_dfs *dfs, uint8_t *chan);
+#else
+static inline void dfs_add_to_etsi_precac_required_list(struct wlan_dfs *dfs,
+							uint8_t *chan)
+{
+}
+#endif
+
 /**
  * dfs_deinit_etsi_precac_list() - Clears the etsi precac list.
  * @dfs: Pointer to wlan_dfs dtructure.

+ 1 - 1
umac/dfs/core/src/misc/dfs.c

@@ -255,9 +255,9 @@ void dfs_detach(struct wlan_dfs *dfs)
 	dfs_timer_detach(dfs);
 	if (!dfs->dfs_is_offload_enabled)
 		dfs_main_detach(dfs);
-	dfs_etsi_precac_detach(dfs);
 	dfs_zero_cac_detach(dfs);
 	dfs_nol_detach(dfs);
+	dfs_etsi_precac_detach(dfs);
 }
 
 #ifndef WLAN_DFS_STATIC_MEM_ALLOC

+ 2 - 0
umac/dfs/core/src/misc/dfs_nol.c

@@ -251,6 +251,8 @@ static os_timer_func(dfs_remove_from_nol)
 	chan = utils_dfs_freq_to_chan(delfreq);
 	dfs_debug(dfs, WLAN_DEBUG_DFS_NOL,
 		    "remove channel %d from nol", chan);
+	utils_dfs_add_to_etsi_precac_required_list(dfs->dfs_pdev_obj,
+						   &chan);
 	utils_dfs_reg_update_nol_ch(dfs->dfs_pdev_obj,
 				    &chan, 1, DFS_NOL_RESET);
 	utils_dfs_save_nol(dfs->dfs_pdev_obj);

+ 17 - 0
umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h

@@ -145,6 +145,23 @@ static inline QDF_STATUS utils_dfs_reset_etsi_precaclists(
 }
 #endif
 
+/** utils_dfs_add_to_etsi_precac_required_list() - Add channel to ETSI PreCAC
+ * Required list.
+ * @pdev: Pointer to DFS pdev object.
+ * @chan: Pointer to channel to be added to ETSI PreCAC Required List.
+ *
+ * Return: void
+ */
+#ifdef QCA_SUPPORT_ETSI_PRECAC_DFS
+void utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev,
+						uint8_t *chan);
+#else
+static inline void
+utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev,
+					   uint8_t *chan)
+{
+}
+#endif
 /**
  * utils_dfs_cancel_precac_timer() - Cancel the precac timer.
  * @pdev: Pointer to DFS pdev object.

+ 14 - 0
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -115,6 +115,20 @@ QDF_STATUS utils_dfs_reset_etsi_precaclists(struct wlan_objmgr_pdev *pdev)
 }
 
 qdf_export_symbol(utils_dfs_reset_etsi_precaclists);
+
+void utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev,
+						uint8_t *chan)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = wlan_pdev_get_dfs_obj(pdev);
+	if (!dfs)
+		return;
+
+	dfs_add_to_etsi_precac_required_list(dfs, chan);
+}
+
+qdf_export_symbol(utils_dfs_add_to_etsi_precac_required_list);
 #endif
 
 QDF_STATUS utils_dfs_cancel_precac_timer(struct wlan_objmgr_pdev *pdev)