qcacmn: Set 11az Ranging related feature capabilities

Set 11az Ranging related extended capabilities over the
wiphy extended capabilities. Mask these fields for SAP iface

Change-Id: Ib6ce92f42d7125b4e9532d5c893ffe955be0f0dc
CRs-Fixed: 3235143
这个提交包含在:
Pragaspathi Thilagaraj
2022-07-04 00:17:31 +05:30
提交者 Madan Koyyalamudi
父节点 ba8cfc391a
当前提交 788ca7bb89
修改 3 个文件,包含 78 行新增10 行删除

查看文件

@@ -29,15 +29,27 @@
#include <net/netlink.h>
#include <net/cfg80211.h>
#if defined(CFG80211_PASN_SUPPORT) && defined(WIFI_POS_CONVERGED) && \
defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
void
wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy,
struct wlan_objmgr_psoc *psoc);
/**
* wlan_wifi_pos_cfg80211_set_features - Set the vendor feature flags
* @psoc: Global PSOC pointer
* @feature_flags: feature flags
*/
void wlan_wifi_pos_cfg80211_set_features(struct wlan_objmgr_psoc *psoc,
uint8_t *feature_flags);
#else
static inline
void wlan_wifi_pos_cfg80211_set_features(struct wlan_objmgr_psoc *psoc,
uint8_t *feature_flags)
{}
static inline void
wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy,
struct wlan_objmgr_psoc *psoc)
{}
#endif /* WIFI_POS_CONVERGED */
#endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT*/
#endif /* _WLAN_CFG80211_WIFI_POS_H_ */

查看文件

@@ -24,21 +24,71 @@
#include "wlan_cfg80211.h"
#include "wlan_objmgr_psoc_obj.h"
#include "wlan_cfg80211_wifi_pos.h"
#include "wlan_cmn_ieee80211.h"
#if defined(CFG80211_PASN_SUPPORT) && defined(WIFI_POS_CONVERGED) && \
defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
u8 wlan_extended_caps_iface[WLAN_EXTCAP_IE_MAX_LEN] = {0};
u8 wlan_extended_caps_iface_mask[WLAN_EXTCAP_IE_MAX_LEN] = {0};
struct wiphy_iftype_ext_capab iftype_ext_cap;
#define WLAN_EXT_RANGING_CAP_IDX 11
void
wlan_wifi_pos_cfg80211_set_wiphy_ext_feature(struct wiphy *wiphy,
struct wlan_objmgr_psoc *psoc)
{
if (wlan_psoc_nif_fw_ext2_cap_get(psoc,
WLAN_RTT_11AZ_MAC_SEC_SUPPORT)) {
wiphy_ext_feature_set(wiphy,
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE);
if (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)) {
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] |=
WLAN_EXT_CAPA11_TB_RANGING_RESPONDER;
}
iftype_ext_cap.iftype = NL80211_IFTYPE_AP;
iftype_ext_cap.extended_capabilities =
wlan_extended_caps_iface,
iftype_ext_cap.extended_capabilities_mask =
wlan_extended_caps_iface_mask,
iftype_ext_cap.extended_capabilities_len =
ARRAY_SIZE(wlan_extended_caps_iface),
wiphy->num_iftype_ext_capab = 0;
wiphy->iftype_ext_capab = &iftype_ext_cap;
wiphy->num_iftype_ext_capab++;
}
#define NUM_BITS_IN_BYTE 8
static void
wlan_wifi_pos_set_feature_flags(uint8_t *feature_flags,
enum qca_wlan_vendor_features feature)
{
uint32_t index;
uint8_t bit_mask;
index = feature / NUM_BITS_IN_BYTE;
bit_mask = 1 << (feature % NUM_BITS_IN_BYTE);
feature_flags[index] |= bit_mask;
}
void wlan_wifi_pos_cfg80211_set_features(struct wlan_objmgr_psoc *psoc,
uint8_t *feature_flags)
{
if (wlan_psoc_nif_fw_ext2_cap_get(psoc,
WLAN_RTT_11AZ_MAC_PHY_SEC_SUPPORT))
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_SECURE_LTF);
wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_SECURE_LTF_STA);
if (wlan_psoc_nif_fw_ext2_cap_get(psoc,
WLAN_RTT_11AZ_MAC_SEC_SUPPORT))
wlan_wifi_pos_set_feature_flags(feature_flags,
QCA_WLAN_VENDOR_FEATURE_PROT_RANGE_NEGO_AND_MEASURE_STA);
}
#endif