Browse Source

qcacmn: Add enhancements to support SET_FCC_CHANNEL 2

Currently in host support is there for SET_FCC_CHANNEL
command for values 0, -1, 1.
Add changes to support SET_FCC_CHANNEL command for value 2.

Change-Id: I151ce33677406670bebc7a8861e34da3e4c5917a
CRs-Fixed: 3537395
Asutosh Mohapatra 2 years ago
parent
commit
17ed1cfc4f

+ 17 - 6
umac/regulatory/core/src/reg_utils.c

@@ -929,7 +929,6 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
 	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
 	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_objmgr_psoc *psoc;
-	QDF_STATUS status;
 
 
 	pdev_priv_obj = reg_get_pdev_obj(pdev);
 	pdev_priv_obj = reg_get_pdev_obj(pdev);
 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
@@ -959,11 +958,7 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
 	psoc_priv_obj->set_fcc_channel = fcc_constraint;
 	psoc_priv_obj->set_fcc_channel = fcc_constraint;
 	pdev_priv_obj->set_fcc_channel = fcc_constraint;
 	pdev_priv_obj->set_fcc_channel = fcc_constraint;
 
 
-	reg_compute_pdev_current_chan_list(pdev_priv_obj);
-
-	status = reg_send_scheduler_msg_sb(psoc, pdev);
-
-	return status;
+	return QDF_STATUS_SUCCESS;
 }
 }
 
 
 bool reg_is_6ghz_band_set(struct wlan_objmgr_pdev *pdev)
 bool reg_is_6ghz_band_set(struct wlan_objmgr_pdev *pdev)
@@ -1020,6 +1015,22 @@ bool reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc)
 	return true;
 	return true;
 }
 }
 
 
+bool reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	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 false;
+	}
+
+	if (!pdev_priv_obj->set_fcc_channel)
+		return false;
+
+	return true;
+}
+
 #ifdef CONFIG_BAND_6GHZ
 #ifdef CONFIG_BAND_6GHZ
 enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
 enum reg_6g_ap_type reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
 {
 {

+ 8 - 1
umac/regulatory/core/src/reg_utils.h

@@ -200,6 +200,14 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
  */
  */
 bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq);
 bool reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq);
 
 
+/**
+ * reg_is_fcc_constraint_set() - Check if FCC constraint set
+ * @pdev: physical dev to get
+ *
+ * Return: True if FCC constraint is set, else false.
+ */
+bool reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev);
+
 /**
 /**
  * reg_is_6ghz_band_set - Check if 6 GHz band set
  * reg_is_6ghz_band_set - Check if 6 GHz band set
  * @pdev: Pointer to pdev
  * @pdev: Pointer to pdev
@@ -646,5 +654,4 @@ reg_get_6ghz_cli_pwr_type_per_ap_pwr_type(
 				enum reg_6g_ap_type ap_pwr_type,
 				enum reg_6g_ap_type ap_pwr_type,
 				enum supported_6g_pwr_types *cli_pwr_type);
 				enum supported_6g_pwr_types *cli_pwr_type);
 #endif
 #endif
-
 #endif
 #endif

+ 15 - 1
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -774,6 +774,13 @@ bool ucfg_reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc)
 {
 {
 	return true;
 	return true;
 }
 }
+
+static inline bool
+ucfg_reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev)
+{
+	return false;
+}
+
 #else
 #else
 static inline QDF_STATUS
 static inline QDF_STATUS
 ucfg_reg_enable_disable_opclass_chans(struct wlan_objmgr_pdev *pdev,
 ucfg_reg_enable_disable_opclass_chans(struct wlan_objmgr_pdev *pdev,
@@ -794,6 +801,13 @@ ucfg_reg_enable_disable_opclass_chans(struct wlan_objmgr_pdev *pdev,
  * Return: bool
  * Return: bool
  */
  */
 bool ucfg_reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc);
 bool ucfg_reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc);
-#endif
 
 
+/**
+ * ucfg_reg_is_fcc_constraint_set() - Check if fcc constraint is set
+ * @pdev: pointer to pdev
+ *
+ * Return: Return true if fcc constraint is set
+ */
+bool ucfg_reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev);
+#endif
 #endif
 #endif

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

@@ -176,6 +176,11 @@ bool ucfg_reg_is_user_country_set_allowed(struct wlan_objmgr_psoc *psoc)
 {
 {
 	return reg_is_user_country_set_allowed(psoc);
 	return reg_is_user_country_set_allowed(psoc);
 }
 }
+
+bool ucfg_reg_is_fcc_constraint_set(struct wlan_objmgr_pdev *pdev)
+{
+	return reg_is_fcc_constraint_set(pdev);
+}
 #endif
 #endif
 
 
 QDF_STATUS ucfg_reg_get_default_country(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS ucfg_reg_get_default_country(struct wlan_objmgr_psoc *psoc,