Parcourir la source

qcacmn: Add ucfg_dcs_switch_chan API

Add ucfg_dcs_switch_chan public API that
invokes wlan_dcs_switch_chan and can be used
when CSA is required due to DCS.

Change-Id: I4f91b0a70dde29520797c7b92cdecd01b96e55c2
CRs-Fixed: 3403459
Sheenam Monga il y a 2 ans
Parent
commit
a65ece1c4d

+ 1 - 9
umac/dcs/core/src/wlan_dcs.c

@@ -714,15 +714,7 @@ static void wlan_dcs_frequency_control(struct wlan_objmgr_psoc *psoc,
 	}
 }
 
-/**
- * wlan_dcs_switch_chan() - switch channel for vdev
- * @vdev: vdev ptr
- * @tgt_freq: target frequency
- * @tgt_width: target channel width
- *
- * Return: QDF_STATUS
- */
-static QDF_STATUS
+QDF_STATUS
 wlan_dcs_switch_chan(struct wlan_objmgr_vdev *vdev, qdf_freq_t tgt_freq,
 		     enum phy_ch_width tgt_width)
 {

+ 12 - 0
umac/dcs/core/src/wlan_dcs.h

@@ -391,4 +391,16 @@ static inline void wlan_dcs_pdev_obj_unlock(struct dcs_pdev_priv_obj *dcs_pdev)
 {
 	qdf_spin_unlock_bh(&dcs_pdev->lock);
 }
+
+/**
+ * wlan_dcs_switch_chan() - switch channel for vdev
+ * @vdev: vdev ptr
+ * @tgt_freq: target frequency
+ * @tgt_width: target channel width
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_dcs_switch_chan(struct wlan_objmgr_vdev *vdev, qdf_freq_t tgt_freq,
+		     enum phy_ch_width tgt_width);
 #endif  /* _WLAN_DCS_H_ */

+ 20 - 2
umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. 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 above
@@ -228,7 +228,17 @@ void ucfg_dcs_set_user_request(struct wlan_objmgr_psoc *psoc, uint8_t mac_id,
  */
 QDF_STATUS ucfg_dcs_get_ch_util(struct wlan_objmgr_psoc *psoc, uint8_t mac_id,
 				struct wlan_host_dcs_ch_util_stats *dcs_stats);
-
+/**
+ * ucfg_dcs_switch_chan() - switch channel for vdev
+ * @vdev: vdev ptr
+ * @tgt_freq: target frequency
+ * @tgt_width: target channel width
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+ucfg_dcs_switch_chan(struct wlan_objmgr_vdev *vdev, qdf_freq_t tgt_freq,
+		     enum phy_ch_width tgt_width);
 #else
 static inline void
 ucfg_dcs_register_cb(struct wlan_objmgr_psoc *psoc, dcs_callback cbk, void *arg)
@@ -297,5 +307,13 @@ ucfg_dcs_get_ch_util(struct wlan_objmgr_psoc *psoc, uint8_t mac_id,
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline QDF_STATUS
+ucfg_dcs_switch_chan(struct wlan_objmgr_vdev *vdev, qdf_freq_t tgt_freq,
+		     enum phy_ch_width tgt_width)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 #endif
 #endif /* _WLAN_DCS_UCFG_API_H_ */

+ 10 - 1
umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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 above
@@ -221,3 +221,12 @@ QDF_STATUS ucfg_dcs_get_ch_util(struct wlan_objmgr_psoc *psoc, uint8_t mac_id,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+#ifdef DCS_INTERFERENCE_DETECTION
+QDF_STATUS
+ucfg_dcs_switch_chan(struct wlan_objmgr_vdev *vdev, qdf_freq_t tgt_freq,
+		     enum phy_ch_width tgt_width)
+{
+	return wlan_dcs_switch_chan(vdev, tgt_freq, tgt_width);
+}
+#endif