Эх сурвалжийг харах

qcacmn: Add WMI support for native 160MHZ

A service bit is added to indicate Firmware supports sending NSS ratio
information to Host and Host receives the NSS ratio information from
Firmware as part of service ready ext event. Save this service bit in
soc's extcap feature bit. Extract the NSS ratio info from service ready
ext event and save the results in wlan_psoc_host_mac_phy_caps structure
to calculate NSS value.

Change-Id: I8fbee48d872b0724bbb629ad38b3c959736a3c39
CRs-Fixed: 2612959
Shashikala Prabhu 5 жил өмнө
parent
commit
29aca291c5

+ 6 - 1
target_if/init_deinit/inc/service_ready_param.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 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
@@ -180,6 +180,9 @@ struct wlan_psoc_host_hal_reg_cap_ext {
  * @lmac_id: hw mac id
  * @reg_cap_ext: extended regulatory capabilities
  * @tgt_pdev_id: target pdev id assigned and used by firmware
+ * @nss_ratio_enabled: This flag is set if nss ratio is received from FW as part
+ *                     of service ready ext event.
+ * @nss_ratio: nss ratio is used to calculate the NSS value for 160MHz.
  */
 struct wlan_psoc_host_mac_phy_caps {
 	uint32_t hw_mode_id;
@@ -219,6 +222,8 @@ struct wlan_psoc_host_mac_phy_caps {
 	uint32_t lmac_id;
 	struct wlan_psoc_host_hal_reg_cap_ext reg_cap_ext;
 	uint32_t tgt_pdev_id;
+	bool nss_ratio_enabled;
+	uint8_t nss_ratio_info;
 };
 
 /**

+ 5 - 0
target_if/init_deinit/src/init_event_handler.c

@@ -130,6 +130,11 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
 		wlan_psoc_nif_fw_ext_cap_set(psoc,
 					     WLAN_SOC_RESTRICTED_80P80_SUPPORT);
 
+	if (wmi_service_enabled(wmi_handle,
+				wmi_service_nss_ratio_to_host_support))
+		wlan_psoc_nif_fw_ext_cap_set(
+				psoc, WLAN_SOC_NSS_RATIO_TO_HOST_SUPPORT);
+
 	target_if_debug(" TT support %d, Wide BW Scan %d, SW cal %d",
 		wlan_psoc_nif_fw_ext_cap_get(psoc, WLAN_SOC_CEXT_TT_SUPPORT),
 		wlan_psoc_nif_fw_ext_cap_get(psoc, WLAN_SOC_CEXT_WIDEBAND_SCAN),

+ 21 - 0
umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h

@@ -138,6 +138,8 @@
 #define WLAN_SOC_CEXT_DYNAMIC_HW_MODE  0x00080000
 	/* Restricted 80+80 MHz support */
 #define WLAN_SOC_RESTRICTED_80P80_SUPPORT 0x00100000
+	/* Indicates Firmware supports sending NSS ratio info to host */
+#define WLAN_SOC_NSS_RATIO_TO_HOST_SUPPORT 0x00200000
 
 /* feature_flags */
 	/* CONF: ATH FF enabled */
@@ -202,6 +204,25 @@
 	/* Invalid VHT cap */
 #define WLAN_SOC_OP_VHT_INVALID_CAP    0x00000001
 
+/* enum wlan_nss_ratio - NSS ratio received from FW during service ready ext
+ *                       event.
+ * WLAN_NSS_RATIO_1BY2_NSS : Max nss of 160MHz is equals to half of the max nss
+ *                           of 80MHz
+ * WLAN_NSS_RATIO_3BY4_NSS : Max nss of 160MHz is equals to 3/4 of the max nss
+ *                           of 80MHz
+ * WLAN_NSS_RATIO_1_NSS    : Max nss of 160MHz is equals to the max nss of 80MHz
+ * WLAN_NSS_RATIO_2_NSS    : Max nss of 160MHz is equals to two times the max
+ *                           nss of 80MHz
+ * Values of this enum should be in sync with WMI_NSS_RATIO_INFO value provided
+ * in wmi_unified.h.
+ */
+enum wlan_nss_ratio {
+	WLAN_NSS_RATIO_1BY2_NSS = 0x0,
+	WLAN_NSS_RATIO_3BY4_NSS = 0x1,
+	WLAN_NSS_RATIO_1_NSS = 0x2,
+	WLAN_NSS_RATIO_2_NSS = 0x3,
+};
+
 /**
  * struct wlan_objmgr_psoc_regulatory -  Regulatory sub structure of PSOC
  * @country_code:  Country code

+ 1 - 0
wmi/inc/wmi_unified_param.h

@@ -5059,6 +5059,7 @@ typedef enum {
 	wmi_service_multiple_vdev_restart_ext,
 	wmi_service_peer_delete_no_peer_flush_tids_cmd,
 	wmi_service_time_sync_ftm,
+	wmi_service_nss_ratio_to_host_support,
 	wmi_services_max,
 } wmi_conv_service_ids;
 #define WMI_SERVICE_UNAVAILABLE 0xFFFF

+ 5 - 0
wmi/src/wmi_unified_tlv.c

@@ -10524,6 +10524,9 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv(
 	param->reg_cap_ext.high_2ghz_chan = mac_phy_caps->high_2ghz_chan_freq;
 	param->reg_cap_ext.low_5ghz_chan  = mac_phy_caps->low_5ghz_chan_freq;
 	param->reg_cap_ext.high_5ghz_chan = mac_phy_caps->high_5ghz_chan_freq;
+	param->nss_ratio_enabled = WMI_NSS_RATIO_ENABLE_DISABLE_GET(
+			mac_phy_caps->nss_ratio);
+	param->nss_ratio_info = WMI_NSS_RATIO_INFO_GET(mac_phy_caps->nss_ratio);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -14036,6 +14039,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
 			WMI_SERVICE_UNAVAILABLE;
 	wmi_service[wmi_service_time_sync_ftm] =
 			WMI_SERVICE_AUDIO_SYNC_SUPPORT;
+	wmi_service[wmi_service_nss_ratio_to_host_support] =
+			WMI_SERVICE_NSS_RATIO_TO_HOST_SUPPORT;
 }
 
 /**