Explorar o código

qcacmn: Return invalid agile detector ID if agile dfs is not supported

When QCA_SUPPORT_AGILE_DFS is not defined, dfs->dfs_agile_detector_id
will not be set and it will be 0, which is also a meaningful detector id.

Currently, if radar_found->detector_id is not set, or set as 0, the
detector ID is recognized as a valid agile detector which is incorrect.

Return invalid agile detector id if agile dfs is not supported.

Change-Id: I259fa6f3f9fbcb4a76567090a8f084e15ee6af93
CRs-Fixed: 2646946
bings %!s(int64=5) %!d(string=hai) anos
pai
achega
f5067f066b
Modificáronse 2 ficheiros con 11 adicións e 2 borrados
  1. 9 2
      umac/dfs/core/src/dfs.h
  2. 2 0
      umac/dfs/core/src/misc/dfs.c

+ 9 - 2
umac/dfs/core/src/dfs.h

@@ -412,7 +412,7 @@
  * @DETECTOR_ID_2: Detector ID 2 (Agile detector in 80p80MHZ supported devices).
  * @AGILE_DETECTOR_ID_TRUE_160MHZ:  Agile detector ID in true 160MHz devices.
  * @AGILE_DETECTOR_ID_80p80: Agile detector ID in 80p80MHz supported devices.
- * @DETECTOR_ID_MAX: Maximum detector ID value.
+ * @INVALID_DETECTOR_ID: Invalid detector id.
  */
 enum detector_id {
 	DETECTOR_ID_0,
@@ -420,7 +420,7 @@ enum detector_id {
 	DETECTOR_ID_2,
 	AGILE_DETECTOR_ID_TRUE_160MHZ = DETECTOR_ID_1,
 	AGILE_DETECTOR_ID_80P80 = DETECTOR_ID_2,
-	DETECTOR_ID_MAX,
+	INVALID_DETECTOR_ID,
 };
 
 /**
@@ -2882,5 +2882,12 @@ static inline bool dfs_is_restricted_80p80mhz_supported(struct wlan_dfs *dfs)
  *
  * Return: Agile detector value (uint8_t).
  */
+#ifdef QCA_SUPPORT_AGILE_DFS
 uint8_t dfs_get_agile_detector_id(struct wlan_dfs *dfs);
+#else
+static inline uint8_t dfs_get_agile_detector_id(struct wlan_dfs *dfs)
+{
+	return INVALID_DETECTOR_ID;
+}
+#endif
 #endif  /* _DFS_H_ */

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

@@ -978,7 +978,9 @@ bool dfs_is_restricted_80p80mhz_supported(struct wlan_dfs *dfs)
 }
 #endif
 
+#ifdef QCA_SUPPORT_AGILE_DFS
 uint8_t dfs_get_agile_detector_id(struct wlan_dfs *dfs)
 {
 	return dfs->dfs_agile_detector_id;
 }
+#endif