qcacld-3.0: Advertise TWT capability if "enable_twt" ini is true

Currently in SAP and STA mode the driver advertises TWT
capabilities in the HE capabilities IE based on the below ini
values irrespective of the master ini "enable_twt" to enable
the twt feature:
"he_twt_requestor","he_twt_responder", "he_bcast_twt",
"he_flex_twt_sched".
So even with the ini is disabled, twt capabilities are advertised

Advertise TWT capability only if "enable_twt" ini is true.

Change-Id: Iae3a98ee339f3859391e0deb64ddd354634b0cbf
CRs-Fixed: 2844516
This commit is contained in:
Pragaspathi Thilagaraj
2021-01-08 19:37:56 +05:30
committed by snandini
parent 48a6fa835d
commit c4ebe66ee5
13 changed files with 225 additions and 133 deletions

View File

@@ -1001,9 +1001,14 @@ static void mlme_init_he_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_he_caps *he_caps = &mlme_cfg->he_caps; struct wlan_mlme_he_caps *he_caps = &mlme_cfg->he_caps;
he_caps->dot11_he_cap.htc_he = cfg_default(CFG_HE_CONTROL); he_caps->dot11_he_cap.htc_he = cfg_default(CFG_HE_CONTROL);
he_caps->dot11_he_cap.twt_request = cfg_get(psoc, CFG_HE_TWT_REQUESTOR); he_caps->dot11_he_cap.twt_request =
cfg_get(psoc, CFG_TWT_REQUESTOR);
he_caps->dot11_he_cap.twt_responder = he_caps->dot11_he_cap.twt_responder =
cfg_get(psoc, CFG_HE_TWT_RESPONDER); cfg_get(psoc, CFG_TWT_RESPONDER);
he_caps->dot11_he_cap.broadcast_twt = cfg_get(psoc, CFG_BCAST_TWT);
if (mlme_is_twt_enabled(psoc))
he_caps->dot11_he_cap.flex_twt_sched =
cfg_default(CFG_HE_FLEX_TWT_SCHED);
he_caps->dot11_he_cap.fragmentation = he_caps->dot11_he_cap.fragmentation =
cfg_default(CFG_HE_FRAGMENTATION); cfg_default(CFG_HE_FRAGMENTATION);
he_caps->dot11_he_cap.max_num_frag_msdu_amsdu_exp = he_caps->dot11_he_cap.max_num_frag_msdu_amsdu_exp =
@@ -1019,7 +1024,6 @@ static void mlme_init_he_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
he_caps->dot11_he_cap.trigd_rsp_sched = he_caps->dot11_he_cap.trigd_rsp_sched =
cfg_default(CFG_HE_TRIGD_RSP_SCHEDULING); cfg_default(CFG_HE_TRIGD_RSP_SCHEDULING);
he_caps->dot11_he_cap.a_bsr = cfg_default(CFG_HE_BUFFER_STATUS_RPT); he_caps->dot11_he_cap.a_bsr = cfg_default(CFG_HE_BUFFER_STATUS_RPT);
he_caps->dot11_he_cap.broadcast_twt = cfg_default(CFG_HE_BCAST_TWT);
he_caps->dot11_he_cap.ba_32bit_bitmap = cfg_default(CFG_HE_BA_32BIT); he_caps->dot11_he_cap.ba_32bit_bitmap = cfg_default(CFG_HE_BA_32BIT);
he_caps->dot11_he_cap.mu_cascade = cfg_default(CFG_HE_MU_CASCADING); he_caps->dot11_he_cap.mu_cascade = cfg_default(CFG_HE_MU_CASCADING);
he_caps->dot11_he_cap.ack_enabled_multitid = he_caps->dot11_he_cap.ack_enabled_multitid =
@@ -1029,8 +1033,7 @@ static void mlme_init_he_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
he_caps->dot11_he_cap.max_ampdu_len_exp_ext = he_caps->dot11_he_cap.max_ampdu_len_exp_ext =
cfg_default(CFG_HE_MAX_AMPDU_LEN); cfg_default(CFG_HE_MAX_AMPDU_LEN);
he_caps->dot11_he_cap.amsdu_frag = cfg_default(CFG_HE_AMSDU_FRAG); he_caps->dot11_he_cap.amsdu_frag = cfg_default(CFG_HE_AMSDU_FRAG);
he_caps->dot11_he_cap.flex_twt_sched =
cfg_default(CFG_HE_FLEX_TWT_SCHED);
he_caps->dot11_he_cap.rx_ctrl_frame = cfg_default(CFG_HE_RX_CTRL); he_caps->dot11_he_cap.rx_ctrl_frame = cfg_default(CFG_HE_RX_CTRL);
he_caps->dot11_he_cap.bsrp_ampdu_aggr = he_caps->dot11_he_cap.bsrp_ampdu_aggr =
cfg_default(CFG_HE_BSRP_AMPDU_AGGR); cfg_default(CFG_HE_BSRP_AMPDU_AGGR);
@@ -1195,10 +1198,7 @@ static void mlme_init_twt_cfg(struct wlan_objmgr_psoc *psoc,
{ {
uint32_t bcast_conf = cfg_get(psoc, CFG_BCAST_TWT_REQ_RESP); uint32_t bcast_conf = cfg_get(psoc, CFG_BCAST_TWT_REQ_RESP);
twt_cfg->is_twt_bcast_enabled = cfg_get(psoc, CFG_BCAST_TWT);
twt_cfg->is_twt_enabled = cfg_get(psoc, CFG_ENABLE_TWT); twt_cfg->is_twt_enabled = cfg_get(psoc, CFG_ENABLE_TWT);
twt_cfg->is_twt_responder_enabled = cfg_get(psoc, CFG_TWT_RESPONDER);
twt_cfg->is_twt_requestor_enabled = cfg_get(psoc, CFG_TWT_REQUESTOR);
twt_cfg->twt_congestion_timeout = cfg_get(psoc, CFG_TWT_CONGESTION_TIMEOUT); twt_cfg->twt_congestion_timeout = cfg_get(psoc, CFG_TWT_CONGESTION_TIMEOUT);
twt_cfg->is_bcast_requestor_enabled = CFG_TWT_GET_BCAST_REQ(bcast_conf); twt_cfg->is_bcast_requestor_enabled = CFG_TWT_GET_BCAST_REQ(bcast_conf);
twt_cfg->is_bcast_responder_enabled = CFG_TWT_GET_BCAST_RES(bcast_conf); twt_cfg->is_bcast_responder_enabled = CFG_TWT_GET_BCAST_RES(bcast_conf);
@@ -2328,13 +2328,13 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_init_chainmask_cfg(psoc, &mlme_cfg->chainmask_cfg); mlme_init_chainmask_cfg(psoc, &mlme_cfg->chainmask_cfg);
mlme_init_sap_cfg(psoc, &mlme_cfg->sap_cfg); mlme_init_sap_cfg(psoc, &mlme_cfg->sap_cfg);
mlme_init_nss_chains(psoc, &mlme_cfg->nss_chains_ini_cfg); mlme_init_nss_chains(psoc, &mlme_cfg->nss_chains_ini_cfg);
mlme_init_twt_cfg(psoc, &mlme_cfg->twt_cfg);
mlme_init_he_cap_in_cfg(psoc, mlme_cfg); mlme_init_he_cap_in_cfg(psoc, mlme_cfg);
mlme_init_obss_ht40_cfg(psoc, &mlme_cfg->obss_ht40); mlme_init_obss_ht40_cfg(psoc, &mlme_cfg->obss_ht40);
mlme_init_product_details_cfg(&mlme_cfg->product_details); mlme_init_product_details_cfg(&mlme_cfg->product_details);
mlme_init_powersave_params(psoc, &mlme_cfg->ps_params); mlme_init_powersave_params(psoc, &mlme_cfg->ps_params);
mlme_init_sta_cfg(psoc, &mlme_cfg->sta); mlme_init_sta_cfg(psoc, &mlme_cfg->sta);
mlme_init_stats_cfg(psoc, &mlme_cfg->stats); mlme_init_stats_cfg(psoc, &mlme_cfg->stats);
mlme_init_twt_cfg(psoc, &mlme_cfg->twt_cfg);
mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr); mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr);
mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags); mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags);
mlme_init_roam_scoring_cfg(psoc, &mlme_cfg->roam_scoring); mlme_init_roam_scoring_cfg(psoc, &mlme_cfg->roam_scoring);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -28,50 +28,6 @@
0, \ 0, \
"HE Control") "HE Control")
/*
* <ini>
* he_twt_requestor- Enable HE TWT requestor.
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to enable or disable HE TWT requestor.
*
* Related: NA
*
* Supported Feature: 11AX
*
* Usage: External
*
* </ini>
*/
#define CFG_HE_TWT_REQUESTOR CFG_INI_BOOL( \
"he_twt_requestor", \
1, \
"HE Twt Requestor")
/*
* <ini>
* he_twt_responder- Enable HE TWT responder.
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to enable or disable HE TWT responder.
*
* Related: NA
*
* Supported Feature: 11AX
*
* Usage: External
*
* </ini>
*/
#define CFG_HE_TWT_RESPONDER CFG_INI_BOOL( \
"he_twt_responder", \
1, \
"HE Twt Responder")
#define CFG_HE_FRAGMENTATION CFG_UINT( \ #define CFG_HE_FRAGMENTATION CFG_UINT( \
"he_fragmentation", \ "he_fragmentation", \
0, \ 0, \
@@ -135,11 +91,6 @@
0, \ 0, \
"HE Buffer Status Rpt") "HE Buffer Status Rpt")
#define CFG_HE_BCAST_TWT CFG_BOOL( \
"he_bcast_twt", \
0, \
"HE Bcast twt")
#define CFG_HE_BA_32BIT CFG_BOOL( \ #define CFG_HE_BA_32BIT CFG_BOOL( \
"he_ba_32bit", \ "he_ba_32bit", \
0, \ 0, \
@@ -782,8 +733,6 @@
#define CFG_HE_CAPS_ALL \ #define CFG_HE_CAPS_ALL \
CFG(CFG_HE_CONTROL) \ CFG(CFG_HE_CONTROL) \
CFG(CFG_HE_TWT_REQUESTOR) \
CFG(CFG_HE_TWT_RESPONDER) \
CFG(CFG_HE_FRAGMENTATION) \ CFG(CFG_HE_FRAGMENTATION) \
CFG(CFG_HE_MAX_FRAG_MSDU) \ CFG(CFG_HE_MAX_FRAG_MSDU) \
CFG(CFG_HE_MIN_FRAG_SIZE) \ CFG(CFG_HE_MIN_FRAG_SIZE) \
@@ -793,7 +742,6 @@
CFG(CFG_HE_ALL_ACK) \ CFG(CFG_HE_ALL_ACK) \
CFG(CFG_HE_TRIGD_RSP_SCHEDULING) \ CFG(CFG_HE_TRIGD_RSP_SCHEDULING) \
CFG(CFG_HE_BUFFER_STATUS_RPT) \ CFG(CFG_HE_BUFFER_STATUS_RPT) \
CFG(CFG_HE_BCAST_TWT) \
CFG(CFG_HE_BA_32BIT) \ CFG(CFG_HE_BA_32BIT) \
CFG(CFG_HE_MU_CASCADING) \ CFG(CFG_HE_MU_CASCADING) \
CFG(CFG_HE_MULTI_TID) \ CFG(CFG_HE_MULTI_TID) \

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -3050,4 +3050,22 @@ QDF_STATUS mlme_set_ext_opr_rate(struct wlan_objmgr_vdev *vdev, uint8_t *src,
* Return: True if supported * Return: True if supported
*/ */
bool wlan_mlme_is_sta_mon_conc_supported(struct wlan_objmgr_psoc *psoc); bool wlan_mlme_is_sta_mon_conc_supported(struct wlan_objmgr_psoc *psoc);
#ifdef WLAN_SUPPORT_TWT
/**
* mlme_is_twt_enabled() - Get if TWT is enabled via ini.
* @psoc: pointer to psoc object
* @val: pointer to the value to be filled
*
* Return: True if TWT is enabled else false.
*/
bool
mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc);
#else
static inline bool
mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif /* WLAN_SUPPORT_TWT */
#endif /* _WLAN_MLME_API_H_ */ #endif /* _WLAN_MLME_API_H_ */

View File

@@ -1399,21 +1399,19 @@ struct wlan_mlme_acs {
/* /*
* struct wlan_mlme_cfg_twt - All twt related cfg items * struct wlan_mlme_cfg_twt - All twt related cfg items
* @is_twt_bcast_enabled: twt capability for the session
* @is_twt_enabled: global twt configuration * @is_twt_enabled: global twt configuration
* @is_twt_responder_enabled: twt responder * @bcast_requestor_tgt_cap: Broadcast requestor target capability
* @is_twt_requestor_enabled: twt requestor * @bcast_responder_tgt_cap: Broadcast responder target capability
* @is_bcast_responder_enabled: bcast responder enable/disable * @is_bcast_responder_enabled: bcast responder enable/disable
* @is_bcast_requestor_enabled: bcast requestor enable/disable * @is_bcast_requestor_enabled: bcast requestor enable/disable
* @twt_congestion_timeout: congestion timeout value * @twt_congestion_timeout: congestion timeout value
*/ */
struct wlan_mlme_cfg_twt { struct wlan_mlme_cfg_twt {
bool is_twt_bcast_enabled;
bool is_twt_enabled; bool is_twt_enabled;
bool is_twt_responder_enabled;
bool is_twt_requestor_enabled;
bool is_bcast_responder_enabled; bool is_bcast_responder_enabled;
bool is_bcast_requestor_enabled; bool is_bcast_requestor_enabled;
bool bcast_requestor_tgt_cap;
bool bcast_responder_tgt_cap;
uint32_t twt_congestion_timeout; uint32_t twt_congestion_timeout;
}; };

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -889,7 +889,7 @@ QDF_STATUS
ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc *psoc, ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc *psoc,
uint32_t val); uint32_t val);
#ifdef WLAN_SUPPORT_TWT #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_FEATURE_11AX)
/** /**
* ucfg_mlme_get_twt_requestor() - Get twt requestor * ucfg_mlme_get_twt_requestor() - Get twt requestor
* @psoc: pointer to psoc object * @psoc: pointer to psoc object
@@ -979,15 +979,16 @@ ucfg_mlme_set_twt_congestion_timeout(struct wlan_objmgr_psoc *psoc,
uint32_t val); uint32_t val);
/** /**
* ucfg_mlme_get_enable_twt() - Get global twt config support * ucfg_mlme_is_twt_enabled() - Get global twt config support
* @psoc: pointer to psoc object * @psoc: pointer to psoc object
* @val: Pointer to the value which will be filled for the caller
* *
* Return: QDF Status * Return: True if TWT is enabled else false.
*/ */
QDF_STATUS static inline bool
ucfg_mlme_get_enable_twt(struct wlan_objmgr_psoc *psoc, ucfg_mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc)
bool *val); {
return mlme_is_twt_enabled(psoc);
}
/** /**
* ucfg_mlme_set_enable_twt() - Set global twt config support * ucfg_mlme_set_enable_twt() - Set global twt config support
@@ -1042,6 +1043,30 @@ ucfg_mlme_get_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
QDF_STATUS QDF_STATUS
ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc, ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
bool val); bool val);
/**
* ucfg_mlme_set_twt_bcast_requestor_tgt_cap() - Update the broadast requestor
* target capability
* @psoc: pointer to psoc object
* @val: Value to be set to config
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_set_twt_bcast_requestor_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* ucfg_mlme_set_twt_bcast_responder_tgt_cap() - Update the broadast responder
* target capability
* @psoc: pointer to psoc object
* @val: Value to be set to config
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_set_twt_bcast_responder_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val);
#else #else
static inline QDF_STATUS static inline QDF_STATUS
ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc, ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc,
@@ -1103,11 +1128,9 @@ ucfg_mlme_set_twt_congestion_timeout(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_NOSUPPORT; return QDF_STATUS_E_NOSUPPORT;
} }
static inline QDF_STATUS static inline bool
ucfg_mlme_get_enable_twt(struct wlan_objmgr_psoc *psoc, ucfg_mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc)
bool *val)
{ {
*val = false;
return QDF_STATUS_E_NOSUPPORT; return QDF_STATUS_E_NOSUPPORT;
} }
@@ -1147,7 +1170,22 @@ ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
{ {
return QDF_STATUS_E_NOSUPPORT; return QDF_STATUS_E_NOSUPPORT;
} }
static inline QDF_STATUS
ucfg_mlme_set_twt_bcast_requestor_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_bcast_responder_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif #endif
/** /**
* ucfg_mlme_get_dot11p_mode() - Get the setting about 802.11p mode * ucfg_mlme_get_dot11p_mode() - Get the setting about 802.11p mode
* @psoc: pointer to psoc object * @psoc: pointer to psoc object

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -591,10 +591,6 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
mlme_obj->cfg.he_caps.dot11_he_cap.twt_request); mlme_obj->cfg.he_caps.dot11_he_cap.twt_request);
mlme_obj->cfg.he_caps.dot11_he_cap.twt_request = value; mlme_obj->cfg.he_caps.dot11_he_cap.twt_request = value;
value = QDF_MIN(he_cap->twt_responder,
mlme_obj->cfg.he_caps.dot11_he_cap.twt_responder);
mlme_obj->cfg.he_caps.dot11_he_cap.twt_responder = value;
value = QDF_MIN(he_cap->fragmentation, value = QDF_MIN(he_cap->fragmentation,
mlme_obj->cfg.he_caps.he_dynamic_fragmentation); mlme_obj->cfg.he_caps.he_dynamic_fragmentation);
@@ -625,8 +621,15 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
mlme_obj->cfg.he_caps.dot11_he_cap.trigd_rsp_sched = mlme_obj->cfg.he_caps.dot11_he_cap.trigd_rsp_sched =
he_cap->trigd_rsp_sched; he_cap->trigd_rsp_sched;
mlme_obj->cfg.he_caps.dot11_he_cap.a_bsr = he_cap->a_bsr; mlme_obj->cfg.he_caps.dot11_he_cap.a_bsr = he_cap->a_bsr;
mlme_obj->cfg.he_caps.dot11_he_cap.broadcast_twt =
he_cap->broadcast_twt; value = QDF_MIN(he_cap->broadcast_twt,
mlme_obj->cfg.he_caps.dot11_he_cap.broadcast_twt);
mlme_obj->cfg.he_caps.dot11_he_cap.broadcast_twt = value;
value = QDF_MIN(he_cap->flex_twt_sched,
mlme_obj->cfg.he_caps.dot11_he_cap.flex_twt_sched);
mlme_obj->cfg.he_caps.dot11_he_cap.flex_twt_sched = value;
mlme_obj->cfg.he_caps.dot11_he_cap.ba_32bit_bitmap = mlme_obj->cfg.he_caps.dot11_he_cap.ba_32bit_bitmap =
he_cap->ba_32bit_bitmap; he_cap->ba_32bit_bitmap;
mlme_obj->cfg.he_caps.dot11_he_cap.mu_cascade = he_cap->mu_cascade; mlme_obj->cfg.he_caps.dot11_he_cap.mu_cascade = he_cap->mu_cascade;
@@ -638,8 +641,6 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
mlme_obj->cfg.he_caps.dot11_he_cap.max_ampdu_len_exp_ext = mlme_obj->cfg.he_caps.dot11_he_cap.max_ampdu_len_exp_ext =
he_cap->max_ampdu_len_exp_ext; he_cap->max_ampdu_len_exp_ext;
mlme_obj->cfg.he_caps.dot11_he_cap.amsdu_frag = he_cap->amsdu_frag; mlme_obj->cfg.he_caps.dot11_he_cap.amsdu_frag = he_cap->amsdu_frag;
mlme_obj->cfg.he_caps.dot11_he_cap.flex_twt_sched =
he_cap->flex_twt_sched;
mlme_obj->cfg.he_caps.dot11_he_cap.rx_ctrl_frame = mlme_obj->cfg.he_caps.dot11_he_cap.rx_ctrl_frame =
he_cap->rx_ctrl_frame; he_cap->rx_ctrl_frame;
mlme_obj->cfg.he_caps.dot11_he_cap.bsrp_ampdu_aggr = mlme_obj->cfg.he_caps.dot11_he_cap.bsrp_ampdu_aggr =
@@ -4707,3 +4708,16 @@ bool wlan_mlme_is_sta_mon_conc_supported(struct wlan_objmgr_psoc *psoc)
return false; return false;
} }
#ifdef WLAN_SUPPORT_TWT
bool mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj)
return cfg_default(CFG_ENABLE_TWT);
return mlme_obj->cfg.twt_cfg.is_twt_enabled;
}
#endif

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -508,7 +508,7 @@ ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#ifdef WLAN_SUPPORT_TWT #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_FEATURE_11AX)
QDF_STATUS QDF_STATUS
ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc, ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc,
bool *val) bool *val)
@@ -521,7 +521,7 @@ ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
*val = mlme_obj->cfg.twt_cfg.is_twt_requestor_enabled; *val = mlme_obj->cfg.he_caps.dot11_he_cap.twt_request;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -536,7 +536,7 @@ ucfg_mlme_set_twt_requestor(struct wlan_objmgr_psoc *psoc,
if (!mlme_obj) if (!mlme_obj)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
mlme_obj->cfg.twt_cfg.is_twt_requestor_enabled = val; mlme_obj->cfg.he_caps.dot11_he_cap.twt_request = val;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -553,7 +553,7 @@ ucfg_mlme_get_twt_responder(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
*val = mlme_obj->cfg.twt_cfg.is_twt_responder_enabled; *val = mlme_obj->cfg.he_caps.dot11_he_cap.twt_responder;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -568,7 +568,7 @@ ucfg_mlme_set_twt_responder(struct wlan_objmgr_psoc *psoc,
if (!mlme_obj) if (!mlme_obj)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
mlme_obj->cfg.twt_cfg.is_twt_responder_enabled = val; mlme_obj->cfg.he_caps.dot11_he_cap.twt_responder = val;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -585,7 +585,7 @@ ucfg_mlme_get_bcast_twt(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
*val = mlme_obj->cfg.twt_cfg.is_twt_bcast_enabled; *val = mlme_obj->cfg.he_caps.dot11_he_cap.broadcast_twt;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -600,7 +600,7 @@ ucfg_mlme_set_bcast_twt(struct wlan_objmgr_psoc *psoc,
if (!mlme_obj) if (!mlme_obj)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
mlme_obj->cfg.twt_cfg.is_twt_bcast_enabled = val; mlme_obj->cfg.he_caps.dot11_he_cap.broadcast_twt = val;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -637,23 +637,6 @@ ucfg_mlme_set_twt_congestion_timeout(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
QDF_STATUS
ucfg_mlme_get_enable_twt(struct wlan_objmgr_psoc *psoc,
bool *val)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj) {
*val = cfg_default(CFG_ENABLE_TWT);
return QDF_STATUS_E_INVAL;
}
*val = mlme_obj->cfg.twt_cfg.is_twt_enabled;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS QDF_STATUS
ucfg_mlme_set_enable_twt(struct wlan_objmgr_psoc *psoc, ucfg_mlme_set_enable_twt(struct wlan_objmgr_psoc *psoc,
bool val) bool val)
@@ -738,6 +721,36 @@ ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
QDF_STATUS
ucfg_mlme_set_twt_bcast_requestor_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj)
return QDF_STATUS_E_INVAL;
mlme_obj->cfg.twt_cfg.bcast_requestor_tgt_cap = val;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
ucfg_mlme_set_twt_bcast_responder_tgt_cap(struct wlan_objmgr_psoc *psoc,
bool val)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj)
return QDF_STATUS_E_INVAL;
mlme_obj->cfg.twt_cfg.bcast_responder_tgt_cap = val;
return QDF_STATUS_SUCCESS;
}
#endif #endif
QDF_STATUS QDF_STATUS

View File

@@ -2612,13 +2612,6 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
if (QDF_IS_STATUS_ERROR(status)) if (QDF_IS_STATUS_ERROR(status))
hdd_err("Failed to set WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD"); hdd_err("Failed to set WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD");
ucfg_mlme_get_bcast_twt(hdd_ctx->psoc, &bval);
if (bval)
ucfg_mlme_set_bcast_twt(hdd_ctx->psoc, cfg->bcast_twt_support);
else
hdd_debug("bcast twt is disable in ini, fw cap %d",
cfg->bcast_twt_support);
hdd_update_score_config(hdd_ctx); hdd_update_score_config(hdd_ctx);
hdd_update_multi_client_thermal_support(hdd_ctx); hdd_update_multi_client_thermal_support(hdd_ctx);

View File

@@ -2234,10 +2234,11 @@ void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
bool twt_bcast_req; bool twt_bcast_req;
bool twt_bcast_res; bool twt_bcast_res;
bool enable_twt; bool enable_twt;
bool bcast_twt;
bool twt_req; bool twt_req;
bool twt_res; bool twt_res;
ucfg_mlme_get_enable_twt(hdd_ctx->psoc, &enable_twt); enable_twt = ucfg_mlme_is_twt_enabled(hdd_ctx->psoc);
ucfg_mlme_get_twt_requestor(hdd_ctx->psoc, &twt_req); ucfg_mlme_get_twt_requestor(hdd_ctx->psoc, &twt_req);
@@ -2249,6 +2250,15 @@ void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
ucfg_mlme_get_twt_bcast_responder(hdd_ctx->psoc, ucfg_mlme_get_twt_bcast_responder(hdd_ctx->psoc,
&twt_bcast_res); &twt_bcast_res);
ucfg_mlme_get_bcast_twt(hdd_ctx->psoc, &bcast_twt);
if (bcast_twt)
ucfg_mlme_set_bcast_twt(hdd_ctx->psoc,
QDF_MIN(cfg->bcast_twt_support,
enable_twt));
else
hdd_debug("bcast twt is disable in ini, fw cap %d",
cfg->bcast_twt_support);
hdd_debug("ini: enable_twt=%d, bcast_req=%d, bcast_res=%d", hdd_debug("ini: enable_twt=%d, bcast_req=%d, bcast_res=%d",
enable_twt, twt_bcast_req, twt_bcast_res); enable_twt, twt_bcast_req, twt_bcast_res);
hdd_debug("ini: twt_req=%d, twt_res=%d", twt_req, twt_res); hdd_debug("ini: twt_req=%d, twt_res=%d", twt_req, twt_res);
@@ -2265,11 +2275,15 @@ void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
(enable_twt && twt_res))); (enable_twt && twt_res)));
twt_req = enable_twt && twt_bcast_req; twt_req = enable_twt && twt_bcast_req;
ucfg_mlme_set_twt_bcast_requestor_tgt_cap(hdd_ctx->psoc,
cfg->twt_bcast_req_support);
ucfg_mlme_set_twt_bcast_requestor(hdd_ctx->psoc, ucfg_mlme_set_twt_bcast_requestor(hdd_ctx->psoc,
QDF_MIN(cfg->twt_bcast_req_support, QDF_MIN(cfg->twt_bcast_req_support,
twt_req)); twt_req));
twt_res = enable_twt && twt_bcast_res; twt_res = enable_twt && twt_bcast_res;
ucfg_mlme_set_twt_bcast_responder_tgt_cap(hdd_ctx->psoc,
cfg->twt_bcast_res_support);
ucfg_mlme_set_twt_bcast_responder(hdd_ctx->psoc, ucfg_mlme_set_twt_bcast_responder(hdd_ctx->psoc,
QDF_MIN(cfg->twt_bcast_res_support, QDF_MIN(cfg->twt_bcast_res_support,
twt_res)); twt_res));

View File

@@ -1212,7 +1212,7 @@ static inline QDF_STATUS populate_dot11f_he_bss_color_change(
} }
#endif #endif
#ifdef WLAN_SUPPORT_TWT #if defined(WLAN_FEATURE_11AX) && defined(WLAN_SUPPORT_TWT)
/** /**
* populate_dot11f_twt_extended_caps() - populate TWT extended capabilities * populate_dot11f_twt_extended_caps() - populate TWT extended capabilities
* @mac_ctx: Global MAC context. * @mac_ctx: Global MAC context.

View File

@@ -2576,18 +2576,26 @@ static ePhyChanBondState lim_get_cb_mode(struct mac_context *mac,
return cb_mode; return cb_mode;
} }
#ifdef WLAN_FEATURE_11AX
static bool lim_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie) static bool lim_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
{ {
if (mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled && ie && if (mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request && ie &&
(ie->qcn_ie.present || ie->he_cap.twt_responder)) { (ie->qcn_ie.present || ie->he_cap.twt_responder)) {
pe_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d", pe_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d",
mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled, mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request,
ie->he_cap.twt_responder, ie->he_cap.twt_responder,
ie->qcn_ie.present); ie->qcn_ie.present);
return true; return true;
} }
return false; return false;
} }
#else
static inline bool
lim_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
{
return false;
}
#endif
static int8_t lim_get_cfg_max_tx_power(struct mac_context *mac, static int8_t lim_get_cfg_max_tx_power(struct mac_context *mac,
uint32_t ch_freq) uint32_t ch_freq)

View File

@@ -6061,6 +6061,45 @@ populate_dot11f_timing_advert_frame(struct mac_context *mac_ctx,
} }
#ifdef WLAN_FEATURE_11AX #ifdef WLAN_FEATURE_11AX
#ifdef WLAN_SUPPORT_TWT
static void
populate_dot11f_broadcast_twt_he_cap(struct mac_context *mac,
struct pe_session *session,
tDot11fIEhe_cap *he_cap)
{
bool enable_bcast_twt =
mac->mlme_cfg->he_caps.dot11_he_cap.broadcast_twt;
bool requestor_tgt_cap =
mac->mlme_cfg->twt_cfg.bcast_requestor_tgt_cap;
bool responder_tgt_cap =
mac->mlme_cfg->twt_cfg.bcast_responder_tgt_cap;
bool requestor_cfg =
mac->mlme_cfg->twt_cfg.is_bcast_requestor_enabled;
bool responder_cfg =
mac->mlme_cfg->twt_cfg.is_bcast_responder_enabled;
he_cap->broadcast_twt = 0;
if (session->opmode == QDF_STA_MODE) {
if (enable_bcast_twt && requestor_tgt_cap)
he_cap->broadcast_twt = requestor_cfg;
else if (enable_bcast_twt)
he_cap->broadcast_twt = 1;
} else if (session->opmode == QDF_SAP_MODE) {
if (enable_bcast_twt && responder_tgt_cap)
he_cap->broadcast_twt = responder_cfg;
else if (enable_bcast_twt)
he_cap->broadcast_twt = 1;
}
}
#else
static inline void
populate_dot11f_broadcast_twt_he_cap(struct mac_context *mac_ctx,
struct pe_session *session,
tDot11fIEhe_cap *he_cap)
{
he_cap->broadcast_twt = 0;
}
#endif
/** /**
* populate_dot11f_he_caps() - pouldate HE Capability IE * populate_dot11f_he_caps() - pouldate HE Capability IE
* @mac_ctx: Global MAC context * @mac_ctx: Global MAC context
@@ -6082,6 +6121,7 @@ QDF_STATUS populate_dot11f_he_caps(struct mac_context *mac_ctx, struct pe_sessio
sizeof(tDot11fIEhe_cap)); sizeof(tDot11fIEhe_cap));
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
/** TODO: String items needs attention. **/ /** TODO: String items needs attention. **/
qdf_mem_copy(he_cap, &session->he_config, sizeof(*he_cap)); qdf_mem_copy(he_cap, &session->he_config, sizeof(*he_cap));
if (he_cap->ppet_present) { if (he_cap->ppet_present) {
@@ -6102,6 +6142,7 @@ QDF_STATUS populate_dot11f_he_caps(struct mac_context *mac_ctx, struct pe_sessio
} else { } else {
he_cap->ppet.ppe_threshold.num_ppe_th = 0; he_cap->ppet.ppe_threshold.num_ppe_th = 0;
} }
populate_dot11f_broadcast_twt_he_cap(mac_ctx, session, he_cap);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -6210,7 +6251,7 @@ populate_dot11f_he_bss_color_change(struct mac_context *mac_ctx,
#endif /* WLAN_FEATURE_11AX_BSS_COLOR */ #endif /* WLAN_FEATURE_11AX_BSS_COLOR */
#endif /* WLAN_FEATURE_11AX */ #endif /* WLAN_FEATURE_11AX */
#ifdef WLAN_SUPPORT_TWT #if defined(WLAN_FEATURE_11AX) && defined(WLAN_SUPPORT_TWT)
QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx, QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
struct pe_session *pe_session, struct pe_session *pe_session,
tDot11fIEExtCap *dot11f) tDot11fIEExtCap *dot11f)
@@ -6225,10 +6266,11 @@ QDF_STATUS populate_dot11f_twt_extended_caps(struct mac_context *mac_ctx,
if (pe_session->opmode == QDF_STA_MODE) if (pe_session->opmode == QDF_STA_MODE)
p_ext_cap->twt_requestor_support = p_ext_cap->twt_requestor_support =
mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled; mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request;
if (pe_session->opmode == QDF_SAP_MODE) if (pe_session->opmode == QDF_SAP_MODE)
p_ext_cap->twt_responder_support = p_ext_cap->twt_responder_support =
mac_ctx->mlme_cfg->twt_cfg.is_twt_responder_enabled; mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_responder;
dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f); dot11f->num_bytes = lim_compute_ext_cap_ie_length(dot11f);

View File

@@ -14602,6 +14602,7 @@ static inline void csr_update_sae_config(struct join_req *csr_join_req,
{ } { }
#endif #endif
#if defined(WLAN_FEATURE_11AX) && defined(WLAN_SUPPORT_TWT)
/** /**
* csr_enable_twt() - Check if its allowed to enable twt for this session * csr_enable_twt() - Check if its allowed to enable twt for this session
* @ie: pointer to beacon/probe resp ie's * @ie: pointer to beacon/probe resp ie's
@@ -14614,16 +14615,21 @@ static inline void csr_update_sae_config(struct join_req *csr_join_req,
static bool csr_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie) static bool csr_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
{ {
if (mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled && ie && if (mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request && ie &&
(ie->qcn_ie.present || ie->he_cap.twt_responder)) { (ie->qcn_ie.present || ie->he_cap.twt_responder)) {
sme_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d", sme_debug("TWT is supported, hence disable UAPSD; twt req supp: %d,twt respon supp: %d, QCN_IE: %d",
mac_ctx->mlme_cfg->twt_cfg.is_twt_requestor_enabled, mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request,
ie->he_cap.twt_responder, ie->he_cap.twt_responder, ie->qcn_ie.present);
ie->qcn_ie.present);
return true; return true;
} }
return false; return false;
} }
#else
static bool csr_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
{
return false;
}
#endif
#ifdef WLAN_ADAPTIVE_11R #ifdef WLAN_ADAPTIVE_11R
/** /**