qcacmn: Add support to enable/disable responder 11az ranging

Enable/Disable responder 11az ranging based on the below ini:
"enable_responder_11az_support"

With "enable_responder_11az_support" disabled, the below ext
cap advertisement will be disabled:
Non-TB Ranging Responder
TB Ranging Responder

and below vendor capabilities advertisment will be disabled:
QCA_WLAN_VENDOR_FEATURE_PROT_RANGE_NEGO_AND_MEASURE_AP
QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_AP

Change-Id: I82eb70615f8daf82e98e7600418e07fad0672b76
CRs-Fixed: 3296410
This commit is contained in:
Pragaspathi Thilagaraj
2022-09-21 12:33:58 +05:30
zatwierdzone przez Madan Koyyalamudi
rodzic 1d0d789fe0
commit d95e7863cd
5 zmienionych plików z 71 dodań i 5 usunięć

Wyświetl plik

@@ -39,6 +39,12 @@ void
wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy, wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy,
struct wlan_objmgr_psoc *psoc) struct wlan_objmgr_psoc *psoc)
{ {
bool 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 (wlan_psoc_nif_fw_ext_cap_get(psoc, WLAN_RTT_11AZ_NTB_SUPPORT)) {
wlan_extended_caps_iface[WLAN_EXT_RANGING_CAP_IDX] |= wlan_extended_caps_iface[WLAN_EXT_RANGING_CAP_IDX] |=
WLAN_EXT_CAPA11_NTB_RANGING_RESPONDER; WLAN_EXT_CAPA11_NTB_RANGING_RESPONDER;
@@ -82,21 +88,27 @@ wlan_wifi_pos_set_feature_flags(uint8_t *feature_flags,
void wlan_wifi_pos_cfg80211_set_features(struct wlan_objmgr_psoc *psoc, void wlan_wifi_pos_cfg80211_set_features(struct wlan_objmgr_psoc *psoc,
uint8_t *feature_flags) uint8_t *feature_flags)
{ {
bool rsta_secure_ltf_support; bool rsta_secure_ltf_support, enable_rsta_11az_ranging;
enable_rsta_11az_ranging = ucfg_wifi_pos_get_rsta_11az_ranging_cap();
rsta_secure_ltf_support = enable_rsta_11az_ranging &&
wifi_pos_get_rsta_sec_ltf_cap();
if (wlan_psoc_nif_fw_ext2_cap_get(psoc, if (wlan_psoc_nif_fw_ext2_cap_get(psoc,
WLAN_RTT_11AZ_MAC_PHY_SEC_SUPPORT)) { WLAN_RTT_11AZ_MAC_PHY_SEC_SUPPORT)) {
wlan_wifi_pos_set_feature_flags(feature_flags, wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_STA); QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_STA);
rsta_secure_ltf_support = wifi_pos_get_rsta_sec_ltf_cap();
if (rsta_secure_ltf_support) if (rsta_secure_ltf_support)
wlan_wifi_pos_set_feature_flags(feature_flags, wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_AP); QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_AP);
} }
if (wlan_psoc_nif_fw_ext2_cap_get(psoc, if (wlan_psoc_nif_fw_ext2_cap_get(psoc,
WLAN_RTT_11AZ_MAC_SEC_SUPPORT)) WLAN_RTT_11AZ_MAC_SEC_SUPPORT)) {
wlan_wifi_pos_set_feature_flags(feature_flags, wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_PROT_RANGE_NEGO_AND_MEASURE_STA); QCA_WLAN_VENDOR_FEATURE_PROT_RANGE_NEGO_AND_MEASURE_STA);
if (rsta_secure_ltf_support)
wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_PROT_RANGE_NEGO_AND_MEASURE_AP);
}
} }
#endif #endif

Wyświetl plik

@@ -678,7 +678,7 @@ wifi_pos_get_osif_callbacks(struct wlan_objmgr_psoc *psoc);
* Return: None * Return: None
**/ **/
void void
wifi_pos_set_rsta_sec_ltf_cap(uint32_t val); wifi_pos_set_rsta_sec_ltf_cap(bool val);
/** /**
* wifi_pos_get_rsta_sec_ltf_cap - Get RSTA secure LTF capability * wifi_pos_get_rsta_sec_ltf_cap - Get RSTA secure LTF capability
@@ -686,5 +686,18 @@ wifi_pos_set_rsta_sec_ltf_cap(uint32_t val);
* Return: True or false * Return: True or false
*/ */
bool wifi_pos_get_rsta_sec_ltf_cap(void); 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);
/**
* wifi_pos_get_rsta_11az_ranging_cap() - Get if RSTA 11az ranging is enabled
*
* Return: True if 11az ranging is enabled
*/
bool wifi_pos_get_rsta_11az_ranging_cap(void);
#endif #endif
#endif /* _WIFI_POS_API_H_ */ #endif /* _WIFI_POS_API_H_ */

Wyświetl plik

@@ -90,5 +90,11 @@ ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer *peer)
{ {
return wifi_pos_is_ltf_keyseed_required_for_peer(peer); return wifi_pos_is_ltf_keyseed_required_for_peer(peer);
} }
static inline
bool ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)
{
return wifi_pos_get_rsta_11az_ranging_cap();
}
#endif #endif
#endif /* _WIFI_POS_UCFG_H_ */ #endif /* _WIFI_POS_UCFG_H_ */

Wyświetl plik

@@ -259,6 +259,7 @@ struct wifi_pos_legacy_ops {
* @wifi_pos_lock: lock to access wifi pos priv object * @wifi_pos_lock: lock to access wifi pos priv object
* @oem_6g_support_disable: oem target 6ghz support is disabled if set * @oem_6g_support_disable: oem target 6ghz support is disabled if set
* @enable_rsta_secure_ltf_support: Enable RSTA secure LTF support * @enable_rsta_secure_ltf_support: Enable RSTA secure LTF support
* @enable_rsta_11az_ranging: Enable RSTA 802.11 az secure ranging support
* @wifi_pos_req_handler: function pointer to handle TLV or non-TLV * @wifi_pos_req_handler: function pointer to handle TLV or non-TLV
* @wifi_pos_send_rsp: function pointer to send msg to userspace APP * @wifi_pos_send_rsp: function pointer to send msg to userspace APP
* @wifi_pos_get_phy_mode: function pointer to get wlan phymode for given * @wifi_pos_get_phy_mode: function pointer to get wlan phymode for given
@@ -314,6 +315,7 @@ struct wifi_pos_psoc_priv_obj {
qdf_spinlock_t wifi_pos_lock; qdf_spinlock_t wifi_pos_lock;
bool oem_6g_support_disable; bool oem_6g_support_disable;
bool enable_rsta_secure_ltf_support; bool enable_rsta_secure_ltf_support;
bool enable_rsta_11az_ranging;
struct wifi_pos_legacy_ops *legacy_ops; struct wifi_pos_legacy_ops *legacy_ops;
QDF_STATUS (*wifi_pos_req_handler)(struct wlan_objmgr_psoc *psoc, QDF_STATUS (*wifi_pos_req_handler)(struct wlan_objmgr_psoc *psoc,
struct wifi_pos_req_msg *req); struct wifi_pos_req_msg *req);

Wyświetl plik

@@ -705,7 +705,7 @@ wifi_pos_get_osif_callbacks(struct wlan_objmgr_psoc *psoc)
} }
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT) #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
void wifi_pos_set_rsta_sec_ltf_cap(uint32_t val) void wifi_pos_set_rsta_sec_ltf_cap(bool val)
{ {
struct wifi_pos_psoc_priv_obj *wifi_pos_psoc = struct wifi_pos_psoc_priv_obj *wifi_pos_psoc =
wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc()); wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
@@ -737,4 +737,37 @@ bool wifi_pos_get_rsta_sec_ltf_cap(void)
return value; return value;
} }
void wifi_pos_set_rsta_11az_ranging_cap(bool val)
{
struct wifi_pos_psoc_priv_obj *wifi_pos_psoc =
wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
if (!wifi_pos_psoc) {
wifi_pos_alert("unable to get wifi_pos psoc obj");
return;
}
qdf_spin_lock_bh(&wifi_pos_psoc->wifi_pos_lock);
wifi_pos_psoc->enable_rsta_11az_ranging = val;
qdf_spin_unlock_bh(&wifi_pos_psoc->wifi_pos_lock);
}
bool wifi_pos_get_rsta_11az_ranging_cap(void)
{
bool value;
struct wifi_pos_psoc_priv_obj *wifi_pos_psoc =
wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
if (!wifi_pos_psoc) {
wifi_pos_alert("unable to get wifi_pos psoc obj");
return false;
}
qdf_spin_lock_bh(&wifi_pos_psoc->wifi_pos_lock);
value = wifi_pos_psoc->enable_rsta_11az_ranging;
qdf_spin_unlock_bh(&wifi_pos_psoc->wifi_pos_lock);
return value;
}
#endif #endif