Explorar el Código

qcacmn: Add service bit to support backward compatibility

The host will send TPC power to FW via the new WMI cmd
WMI_VDEV_SET_TPC_POWER_CMDID going forward instead of
WMI_VDEV_PARAM_TX_PWRLIMIT to accommodate 6GHz channels.
But, to support backward compatibility for New Host+old FW
the TPC power will be sent to FW via legacy WMI cmds
WMI_VDEV_SET_PARAM_CMDID (during initial connection) or
WMI_VDEV_PARAM_TX_PWRLIMIT (power value change during RRM
req/bcn processing from connected AP) with the help of a
service bit WMI_SERVICE_EXT_TPC_REG_SUPPORT.

Change-Id: I727fd5a055e4e400ebc174cfb504d60e3335c3c4
CRs-Fixed: 2872244
Gururaj Pandurangi hace 4 años
padre
commit
ae259a4256

+ 2 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1231,6 +1231,8 @@ struct wlan_lmac_if_reg_rx_ops {
 	bool (*reg_ignore_fw_reg_offload_ind)(struct wlan_objmgr_psoc *psoc);
 	QDF_STATUS (*reg_get_unii_5g_bitmap)(struct wlan_objmgr_pdev *pdev,
 					     uint8_t *bitmap);
+	QDF_STATUS (*reg_set_ext_tpc_supported)(struct wlan_objmgr_psoc *psoc,
+						bool val);
 };
 
 #ifdef CONVERGED_P2P_ENABLE

+ 3 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -370,6 +370,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
 
 	rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap =
 		ucfg_reg_get_unii_5g_bitmap;
+
+	rx_ops->reg_rx_ops.reg_set_ext_tpc_supported =
+		tgt_reg_set_ext_tpc_supported;
 }
 
 #ifdef CONVERGED_P2P_ENABLE

+ 2 - 1
umac/regulatory/core/src/reg_priv_objs.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
@@ -120,6 +120,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 	soc_reg_obj->five_dot_nine_ghz_supported = false;
 	reg_set_5dot9_ghz_chan_in_master_mode(soc_reg_obj);
 	soc_reg_obj->retain_nol_across_regdmn_update = false;
+	soc_reg_obj->is_ext_tpc_supported = false;
 
 	for (i = 0; i < MAX_STA_VDEV_CNT; i++)
 		soc_reg_obj->vdev_ids_11d[i] = INVALID_VDEV_ID;

+ 2 - 0
umac/regulatory/core/src/reg_priv_objs.h

@@ -104,6 +104,7 @@ struct chan_change_cbk_entry {
  *	changes.
  * @domain_code_6g_ap: domain code for 6G AP
  * @domain_code_6g_client: domain code for 6G client
+ * @is_ext_tpc_supported: Whether FW supports new WMI command for TPC
  */
 struct wlan_regulatory_psoc_priv_obj {
 	struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
@@ -160,6 +161,7 @@ struct wlan_regulatory_psoc_priv_obj {
 	uint8_t domain_code_6g_ap[REG_CURRENT_MAX_AP_TYPE];
 	uint8_t domain_code_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE];
 #endif
+	bool is_ext_tpc_supported;
 };
 
 /**

+ 31 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -4508,3 +4508,34 @@ bool reg_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc)
 
 	return psoc_priv_obj->offload_enabled;
 }
+
+QDF_STATUS
+reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc, bool val)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	psoc_priv_obj->is_ext_tpc_supported = val;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return  false;
+	}
+
+	return psoc_priv_obj->is_ext_tpc_supported;
+}

+ 19 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -1590,4 +1590,23 @@ bool reg_is_phymode_unallowed(enum reg_phymode phy_in, uint32_t phymode_bitmap);
  * Return: true if regdb is offloaded, else false
  */
 bool reg_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * reg_set_ext_tpc_supported() - Set if FW supports new WMI command for TPC
+ * @psoc: Pointer to psoc
+ * @val: value
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc,
+				     bool val);
+
+/**
+ * reg_is_ext_tpc_supported() - Whether FW supports new WMI command for TPC
+ *
+ * @psoc: pointer to psoc
+ *
+ * Return: true if FW supports the new TPC command, else false
+ */
+bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc);
 #endif

+ 9 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -1793,4 +1793,13 @@ wlan_reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
 	return REG_INDOOR_AP;
 }
 #endif
+
+/**
+ * wlan_reg_is_ext_tpc_supported() - Checks if FW supports new WMI cmd for TPC
+ *
+ * @psoc: psoc ptr
+ *
+ * Return: true if FW supports new command or false otherwise
+ */
+bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc);
 #endif

+ 10 - 0
umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h

@@ -106,4 +106,14 @@ QDF_STATUS tgt_reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS tgt_reg_set_5dot9_ghz_supported(struct wlan_objmgr_psoc *psoc,
 					   bool val);
 
+/**
+ * tgt_reg_set_ext_tpc_supported() - Whether FW supports new WMI cmd for TPC
+ * @psoc: Pointer to psoc
+ * @val: value
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc,
+					 bool val);
+
 #endif

+ 6 - 1
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -1350,4 +1350,9 @@ wlan_reg_decide_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev)
 {
 	return reg_decide_6g_ap_pwr_type(pdev);
 }
-#endif
+#endif /* CONFIG_BAND_6GHZ */
+
+bool wlan_reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc)
+{
+	return reg_is_ext_tpc_supported(psoc);
+}

+ 6 - 0
umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c

@@ -117,3 +117,9 @@ QDF_STATUS tgt_reg_set_5dot9_ghz_supported(struct wlan_objmgr_psoc *psoc,
 {
 	return reg_set_5dot9_ghz_supported(psoc, val);
 }
+
+QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc,
+					 bool val)
+{
+	return reg_set_ext_tpc_supported(psoc, val);
+}