Explorar o código

qcacmn: change enable_responder_11az_support to bitmap

Currently the ini "enable_responder_11az_support" is a boolean value
and applicable for enabling all the RSTA operations- 11az TB and NTB
ranging. Change the usage of existing ini "enable_responder_11az_support"
into a bitmap as below:
BIT 0 - 11az NTB
BIT 1 - 11az TB
Set the wiphy ext caps based on the bitmap values
this change to enable TB/NTB ranging as per user config

Change-Id: I97034677e6ed6840d8d9403b32b823c318a17634
CRs-Fixed: 3640571
Guru Pratap Sharma hai 1 ano
pai
achega
9b80fc511a

+ 6 - 4
os_if/linux/wifi_pos/src/wlan_cfg80211_wifi_pos.c

@@ -69,22 +69,24 @@ void
 wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy,
 					     struct wlan_objmgr_psoc *psoc)
 {
-	bool enable_rsta_11az_ranging;
+	uint32_t enable_rsta_11az_ranging;
 
 	enable_rsta_11az_ranging = ucfg_wifi_pos_get_rsta_11az_ranging_cap();
 	if (!enable_rsta_11az_ranging)
 		return;
 
-	if (wlan_psoc_nif_fw_ext_cap_get(psoc, WLAN_RTT_11AZ_NTB_SUPPORT)) {
+	if ((enable_rsta_11az_ranging & CFG_RESPONDER_11AZ_NTB_SUPPORT) &&
+	    (wlan_psoc_nif_fw_ext_cap_get(psoc, WLAN_RTT_11AZ_NTB_SUPPORT))) {
 		wlan_extended_caps_iface[WLAN_EXT_RANGING_CAP_IDX] |=
 					WLAN_EXT_CAPA11_NTB_RANGING_RESPONDER;
 		wlan_extended_caps_iface_mask[WLAN_EXT_RANGING_CAP_IDX] |=
 					WLAN_EXT_CAPA11_NTB_RANGING_RESPONDER;
 	}
 
-	if (wlan_psoc_nif_fw_ext2_cap_get(psoc, WLAN_RTT_11AZ_TB_SUPPORT) ||
+	if ((enable_rsta_11az_ranging & CFG_RESPONDER_11AZ_TB_SUPPORT) &&
+	    (wlan_psoc_nif_fw_ext2_cap_get(psoc, WLAN_RTT_11AZ_TB_SUPPORT) ||
 	    wlan_psoc_nif_fw_ext2_cap_get(psoc,
-					  WLAN_RTT_11AZ_TB_RSTA_SUPPORT)) {
+					  WLAN_RTT_11AZ_TB_RSTA_SUPPORT))) {
 		wlan_extended_caps_iface[WLAN_EXT_RANGING_CAP_IDX] |=
 					WLAN_EXT_CAPA11_TB_RANGING_RESPONDER;
 		wlan_extended_caps_iface_mask[WLAN_EXT_RANGING_CAP_IDX] |=

+ 3 - 3
umac/wifi_pos/inc/wifi_pos_api.h

@@ -688,13 +688,13 @@ bool wifi_pos_get_rsta_sec_ltf_cap(void);
  * wifi_pos_set_rsta_11az_ranging_cap() - Enable/Disable R-STA 11az ranging
  * @val: Value to set
  */
-void wifi_pos_set_rsta_11az_ranging_cap(bool val);
+void wifi_pos_set_rsta_11az_ranging_cap(uint32_t val);
 
 /**
  * wifi_pos_get_rsta_11az_ranging_cap() - Get if RSTA 11az ranging is enabled
  *
- * Return: True if 11az ranging is enabled
+ * Return: value if 11az TB/NTB ranging is enabled
  */
-bool wifi_pos_get_rsta_11az_ranging_cap(void);
+uint32_t wifi_pos_get_rsta_11az_ranging_cap(void);
 #endif
 #endif /* _WIFI_POS_API_H_ */

+ 5 - 1
umac/wifi_pos/inc/wifi_pos_public_struct.h

@@ -1,5 +1,5 @@
 /*
- * 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
@@ -59,6 +59,10 @@ enum wifi_pos_pasn_peer_delete_actions {
 #define WIFI_POS_IS_FLUSH_KEYS_REQUIRED(flag) \
 			((flag) & WIFI_POS_PEER_DELETE_ACTION_FLUSH_KEYS)
 
+#define CFG_RESPONDER_11AZ_NTB_SUPPORT 0x1
+#define CFG_RESPONDER_11AZ_TB_SUPPORT 0x2
+#define CFG_RESPONDER_11AZ_MAX_SUPPORT (CFG_RESPONDER_11AZ_NTB_SUPPORT | \
+		CFG_RESPONDER_11AZ_TB_SUPPORT)
 /**
  * struct wlan_pasn_request  - PASN peer create request data
  * @peer_mac: Peer mac address

+ 2 - 2
umac/wifi_pos/inc/wifi_pos_ucfg_i.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017, 2020 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
@@ -92,7 +92,7 @@ ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer *peer)
 }
 
 static inline
-bool ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)
+uint32_t ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)
 {
 	return wifi_pos_get_rsta_11az_ranging_cap();
 }

+ 1 - 1
umac/wifi_pos/inc/wifi_pos_utils_i.h

@@ -316,7 +316,7 @@ struct wifi_pos_psoc_priv_obj {
 	qdf_spinlock_t wifi_pos_lock;
 	bool oem_6g_support_disable;
 	bool enable_rsta_secure_ltf_support;
-	bool enable_rsta_11az_ranging;
+	uint32_t enable_rsta_11az_ranging;
 	struct wifi_pos_legacy_ops *legacy_ops;
 	QDF_STATUS (*wifi_pos_req_handler)(struct wlan_objmgr_psoc *psoc,
 				    struct wifi_pos_req_msg *req);

+ 3 - 3
umac/wifi_pos/src/wifi_pos_api.c

@@ -747,7 +747,7 @@ bool wifi_pos_get_rsta_sec_ltf_cap(void)
 	return value;
 }
 
-void wifi_pos_set_rsta_11az_ranging_cap(bool val)
+void wifi_pos_set_rsta_11az_ranging_cap(uint32_t val)
 {
 	struct wifi_pos_psoc_priv_obj *wifi_pos_psoc =
 			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
@@ -762,9 +762,9 @@ void wifi_pos_set_rsta_11az_ranging_cap(bool val)
 	qdf_spin_unlock_bh(&wifi_pos_psoc->wifi_pos_lock);
 }
 
-bool wifi_pos_get_rsta_11az_ranging_cap(void)
+uint32_t wifi_pos_get_rsta_11az_ranging_cap(void)
 {
-	bool value;
+	uint32_t value;
 	struct wifi_pos_psoc_priv_obj *wifi_pos_psoc =
 			wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());