qcacld-3.0: Enable TDLS 11AX only if supported by FW

Don't fill the 11ax capabilities if FW doesn't support
TDLS 11AX capability.

Change-Id: I267ccaa439bb3cf17d27493172b4f324d112724b
CRs-Fixed: 2925250
Esse commit está contido em:
Utkarsh Bhatnagar
2021-04-20 08:43:23 +05:30
commit de Madan Koyyalamudi
commit c7e32c7021
9 arquivos alterados com 165 adições e 13 exclusões

Ver arquivo

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -191,6 +191,7 @@ struct tdls_set_state_info {
* @runtime_lock: runtime lock
* @tdls_osif_init_cb: Callback to initialize the tdls private
* @tdls_osif_deinit_cb: Callback to deinitialize the tdls private
* @fw_tdls_11ax_capablity: bool for tdls 11ax fw capability
*/
struct tdls_soc_priv_obj {
struct wlan_objmgr_psoc *soc;
@@ -239,6 +240,9 @@ struct tdls_soc_priv_obj {
#endif
tdls_vdev_init_cb tdls_osif_init_cb;
tdls_vdev_deinit_cb tdls_osif_deinit_cb;
#ifdef WLAN_FEATURE_11AX
bool fw_tdls_11ax_capability;
#endif
};
/**

Ver arquivo

@@ -88,6 +88,11 @@
#define INVALID_TDLS_PEER_INDEX 0xFF
#ifdef WLAN_FEATURE_11AX
#define MIN_TDLS_HE_CAP_LEN 17
#define MAX_TDLS_HE_CAP_LEN 29
#endif
/**
* enum tdls_add_oper - add peer type
* @TDLS_OPER_NONE: none

Ver arquivo

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -74,6 +74,41 @@ QDF_STATUS ucfg_tdls_psoc_close(struct wlan_objmgr_psoc *psoc);
QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,
struct tdls_start_params *req);
#ifdef WLAN_FEATURE_11AX
/**
* ucfg_tdls_update_fw_11ax_support() - Update FW TDLS 11ax capability in TLDS
* Component
* @psoc: psoc object
* @is_fw_tdls_11ax_capable: bool if fw is tdls 11ax capable then it is true
*
* Return: void
*/
void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
bool is_fw_tdls_11ax_capable);
/**
* ucfg_tdls_is_fw_11ax_supported() - Get FW TDLS 11ax capability from TLDS
* component.
* @psoc: psoc object
*
* Return: true if fw supports tdls 11ax
*/
bool ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc);
#else
static inline
void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
bool is_fw_tdls_11ax_capable)
{
}
static inline
bool ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif
/**
* ucfg_tdls_psoc_enable() - TDLS module enable API
* @psoc: psoc object
@@ -409,5 +444,16 @@ struct wlan_objmgr_vdev *ucfg_get_tdls_vdev(struct wlan_objmgr_psoc *psoc,
return NULL;
}
static inline
void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
bool is_fw_tdls_11ax_capable)
{
}
static inline
bool ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif /* FEATURE_WLAN_TDLS */
#endif

Ver arquivo

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -317,6 +317,38 @@ QDF_STATUS ucfg_tdls_psoc_open(struct wlan_objmgr_psoc *psoc)
return status;
}
#ifdef WLAN_FEATURE_11AX
void ucfg_tdls_update_fw_11ax_capability(struct wlan_objmgr_psoc *psoc,
bool is_fw_tdls_11ax_capable)
{
struct tdls_soc_priv_obj *soc_obj;
soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TDLS);
if (!soc_obj) {
tdls_err("Failed to get tdls psoc component");
return;
}
soc_obj->fw_tdls_11ax_capability = is_fw_tdls_11ax_capable;
}
bool ucfg_tdls_is_fw_11ax_capable(struct wlan_objmgr_psoc *psoc)
{
struct tdls_soc_priv_obj *soc_obj;
soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_TDLS);
if (!soc_obj) {
tdls_err("Failed to get tdls psoc component");
return false;
}
tdls_debug("FW 11AX capability %d", soc_obj->fw_tdls_11ax_capability);
return soc_obj->fw_tdls_11ax_capability;
}
#endif
QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc,
struct tdls_start_params *req)
{

Ver arquivo

@@ -1683,6 +1683,27 @@ hdd_intersect_igmp_offload_setting(struct wlan_objmgr_psoc *psoc,
{}
#endif
#ifdef FEATURE_WLAN_TDLS
#ifdef WLAN_FEATURE_11AX
static void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
struct wma_tgt_services *cfg)
{
ucfg_tdls_update_fw_11ax_capability(hdd_ctx->psoc,
cfg->en_tdls_11ax_support);
}
#else
static inline
void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
struct wma_tgt_services *cfg)
{}
#endif
#else
static inline
void hdd_update_fw_tdls_11ax_capability(struct hdd_context *hdd_ctx,
struct wma_tgt_services *cfg)
{}
#endif
static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
struct wma_tgt_services *cfg)
{
@@ -1769,6 +1790,7 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx,
cfg->is_fw_therm_throt_supp &&
cfg_get(hdd_ctx->psoc,
CFG_THERMAL_MITIGATION_ENABLE);
hdd_update_fw_tdls_11ax_capability(hdd_ctx, cfg);
}
/**

Ver arquivo

@@ -784,8 +784,6 @@ static void populate_dot11f_tdls_ht_vht_cap(struct mac_context *mac,
#ifdef WLAN_FEATURE_11AX
#define LIM_TDLS_MIN_LEN 21
static void lim_tdls_set_he_chan_width(tDot11fIEhe_cap *heCap,
struct pe_session *session)
{
@@ -888,7 +886,7 @@ lim_tdls_populate_dot11f_he_caps(struct mac_context *mac,
struct he_capability_info he_cap;
} uHECapInfo;
if (add_sta_req->he_cap_len < LIM_TDLS_MIN_LEN) {
if (add_sta_req->he_cap_len < MIN_TDLS_HE_CAP_LEN) {
pe_debug("He_capability invalid");
return QDF_STATUS_E_INVAL;
}

Ver arquivo

@@ -37,6 +37,7 @@
* @en_tdls_offchan: enable tdls offchan
* @en_tdls_uapsd_buf_sta: enable sta tdls uapsd buf
* @en_tdls_uapsd_sleep_sta: enable sta tdls uapsd sleep
* @en_tdls_11ax_support: Get TDLS ax support
* @en_roam_offload: enable roam offload
* @en_11ax: enable 11ax
* @is_fw_mawc_capable: Motion Aided Wireless Connectivity feature
@@ -69,6 +70,9 @@ struct wma_tgt_services {
bool en_tdls_offchan;
bool en_tdls_uapsd_buf_sta;
bool en_tdls_uapsd_sleep_sta;
#ifdef WLAN_FEATURE_11AX
bool en_tdls_11ax_support;
#endif
#endif /* FEATURE_WLAN_TDLS */
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
bool en_roam_offload;

Ver arquivo

@@ -4554,6 +4554,36 @@ wma_get_igmp_offload_enable(struct wmi_unified *wmi_handle,
{}
#endif
#ifdef WLAN_FEATURE_11AX
#ifdef FEATURE_WLAN_TDLS
/**
* wma_get_tdls_ax_support() - update tgt service with service tdls ax support
* @wmi_handle: Unified wmi handle
* @cfg: target services
*
* Return: none
*/
static inline void
wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
struct wma_tgt_services *cfg)
{
cfg->en_tdls_11ax_support = wmi_service_enabled(
wmi_handle,
wmi_service_tdls_ax_support);
}
#else
static inline void
wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
struct wma_tgt_services *cfg)
{}
#endif
#else
static inline void
wma_get_tdls_ax_support(struct wmi_unified *wmi_handle,
struct wma_tgt_services *cfg)
{}
#endif
/**
* wma_update_target_services() - update target services from wma handle
* @wmi_handle: Unified wmi handle
@@ -4696,6 +4726,7 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle,
wma_get_service_cap_club_get_sta_in_ll_stats_req(wmi_handle, cfg);
wma_get_igmp_offload_enable(wmi_handle, cfg);
wma_get_tdls_ax_support(wmi_handle, cfg);
}
/**

Ver arquivo

@@ -35,7 +35,7 @@
#include <wlan_reg_services_api.h>
#include "wlan_cfg80211_mc_cp_stats.h"
#include "sir_api.h"
#include "wlan_tdls_ucfg_api.h"
#define TDLS_MAX_NO_OF_2_4_CHANNELS 14
@@ -238,8 +238,6 @@ tdls_calc_channels_from_staparams(struct tdls_update_peer_params *req_info,
}
#ifdef WLAN_FEATURE_11AX
#define MIN_TDLS_HE_CAP_LEN 17
#define MAX_TDLS_HE_CAP_LEN 29
static void
wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
@@ -276,7 +274,8 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info,
static void
wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
struct station_parameters *params)
struct station_parameters *params,
bool tdls_11ax_support)
{
int i;
@@ -356,8 +355,10 @@ wlan_cfg80211_tdls_extract_params(struct tdls_update_peer_params *req_info,
osif_debug("TDLS peer pmf capable");
req_info->is_pmf = 1;
}
wlan_cfg80211_tdls_extract_he_params(req_info, params);
if (tdls_11ax_support)
wlan_cfg80211_tdls_extract_he_params(req_info, params);
else
osif_debug("tdls ax disabled");
}
int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
@@ -369,6 +370,8 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
struct vdev_osif_priv *osif_priv;
struct osif_tdls_vdev *tdls_priv;
unsigned long rc;
struct wlan_objmgr_psoc *psoc;
bool tdls_11ax_support = false;
status = wlan_cfg80211_tdls_validate_mac_addr(mac);
@@ -382,7 +385,14 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_vdev *vdev,
if (!req_info)
return -EINVAL;
wlan_cfg80211_tdls_extract_params(req_info, params);
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc) {
osif_err_rl("Invalid psoc");
return -EINVAL;
}
tdls_11ax_support = ucfg_tdls_is_fw_11ax_capable(psoc);
wlan_cfg80211_tdls_extract_params(req_info, params, tdls_11ax_support);
osif_priv = wlan_vdev_get_ospriv(vdev);
if (!osif_priv || !osif_priv->osif_tdls) {