qcacld-3.0: Add support to enable TWT roles

There are cases where only a few TWT roles may be required
to be enabled. For example TWT Requestor role alone or
TWT Respondor role alone. Also, it could be unicast TWT only
and disable broadcast TWT.

Support broadcast TWT  configuration in requestor and responder
role by adding new INI.
Extend the use of existing requestor and responder INIs to further
enable requestor and responder roles itself.

Change-Id: I3dfa196edfda9cafd01fa56c0bb6ce73e27b4144
CRs-Fixed: 2828718
This commit is contained in:
Subrat Dash
2020-11-18 17:07:09 +05:30
committed by snandini
parent d0af3d781f
commit fec051ecae
12 changed files with 587 additions and 62 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2018, 2020 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
@@ -28,7 +28,7 @@
* twt_requestor - twt requestor.
* @Min: 0
* @Max: 1
* @Default: 0
* @Default: 1
*
* This cfg is used to store twt requestor config.
*
@@ -42,14 +42,14 @@
*/
#define CFG_TWT_REQUESTOR CFG_INI_BOOL( \
"twt_requestor", \
0, \
1, \
"TWT requestor")
/*
* <ini>
* twt_responder - twt responder.
* @Min: 0
* @Max: 1
* @Default: 0
* @Default: 1
*
* This cfg is used to store twt responder config.
*
@@ -63,7 +63,7 @@
*/
#define CFG_TWT_RESPONDER CFG_INI_BOOL( \
"twt_responder", \
0, \
1, \
"TWT responder")
/*
@@ -138,12 +138,58 @@
100, \
CFG_VALUE_OR_DEFAULT, \
"twt congestion timeout")
/*
* <ini>
* twt_bcast_req_resp_config - To enable broadcast twt requestor and responder.
* @Min: 0 Disable the extended twt capability
* @Max: 3
* @Default: 0
*
* This cfg is used to configure the broadcast TWT requestor and responder.
* Bitmap for enabling the broadcast twt requestor and responder.
* BIT 0: Enable/Disable broadcast twt requestor.
* BIT 1: Enable/Disable broadcast twt responder.
* BIT 2-31: Reserved
*
* Related: CFG_ENABLE_TWT
* Related: CFG_TWT_RESPONDER
* Related: CFG_TWT_REQUESTOR
*
* Supported Feature: 11AX
*
* Usage: External
*
* </ini>
*/
/* defines to extract the requestor/responder capabilities from cfg */
#define TWT_BCAST_REQ_INDEX 0
#define TWT_BCAST_REQ_BITS 1
#define TWT_BCAST_RES_INDEX 1
#define TWT_BCAST_RES_BITS 1
#define CFG_BCAST_TWT_REQ_RESP CFG_INI_UINT( \
"twt_bcast_req_resp_config", \
0, \
3, \
0, \
CFG_VALUE_OR_DEFAULT, \
"BROADCAST TWT CAPABILITY")
#define CFG_TWT_GET_BCAST_REQ(_bcast_conf) \
QDF_GET_BITS(_bcast_conf, \
TWT_BCAST_REQ_INDEX, \
TWT_BCAST_REQ_BITS)
#define CFG_TWT_GET_BCAST_RES(_bcast_conf) \
QDF_GET_BITS(_bcast_conf, \
TWT_BCAST_RES_INDEX, \
TWT_BCAST_RES_BITS)
#define CFG_TWT_ALL \
CFG(CFG_BCAST_TWT) \
CFG(CFG_ENABLE_TWT) \
CFG(CFG_TWT_REQUESTOR) \
CFG(CFG_TWT_RESPONDER) \
CFG(CFG_TWT_CONGESTION_TIMEOUT)
CFG(CFG_TWT_CONGESTION_TIMEOUT) \
CFG(CFG_BCAST_TWT_REQ_RESP)
#endif /* __CFG_MLME_TWT_H */

View File

@@ -1396,6 +1396,8 @@ struct wlan_mlme_acs {
* @is_twt_enabled: global twt configuration
* @is_twt_responder_enabled: twt responder
* @is_twt_requestor_enabled: twt requestor
* @is_bcast_responder_enabled: bcast responder enable/disable
* @is_bcast_requestor_enabled: bcast requestor enable/disable
* @twt_congestion_timeout: congestion timeout value
*/
struct wlan_mlme_cfg_twt {
@@ -1403,6 +1405,8 @@ struct wlan_mlme_cfg_twt {
bool is_twt_enabled;
bool is_twt_responder_enabled;
bool is_twt_requestor_enabled;
bool is_bcast_responder_enabled;
bool is_bcast_requestor_enabled;
uint32_t twt_congestion_timeout;
};

View File

@@ -889,6 +889,7 @@ QDF_STATUS
ucfg_mlme_set_pmkid_modes(struct wlan_objmgr_psoc *psoc,
uint32_t val);
#ifdef WLAN_SUPPORT_TWT
/**
* ucfg_mlme_get_twt_requestor() - Get twt requestor
* @psoc: pointer to psoc object
@@ -999,6 +1000,154 @@ QDF_STATUS
ucfg_mlme_set_enable_twt(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* ucfg_mlme_get_twt_bcast_requestor() - Get twt requestor enabled
* @psoc: pointer to psoc object
* @val: Pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_get_twt_bcast_requestor(struct wlan_objmgr_psoc *psoc,
bool *val);
/**
* ucfg_mlme_set_twt_bcast_requestor() - Set Global twt bcast requestor support
* @psoc: pointer to psoc object
* @val: Value to be set to config
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_set_twt_bcast_requestor(struct wlan_objmgr_psoc *psoc,
bool val);
/**
* ucfg_mlme_get_twt_bcast_responder() - Get twt responder enabled
* @psoc: pointer to psoc object
* @val: Pointer to the value which will be filled for the caller
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_get_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
bool *val);
/**
* ucfg_mlme_set_twt_bcast_responder() - Set Global twt bcast responder support
* @psoc: pointer to psoc object
* @val: Value to be set to config
*
* Return: QDF Status
*/
QDF_STATUS
ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
bool val);
#else
static inline QDF_STATUS
ucfg_mlme_get_twt_requestor(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_requestor(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_twt_responder(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_responder(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_bcast_twt(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_bcast_twt(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_twt_congestion_timeout(struct wlan_objmgr_psoc *psoc,
uint32_t *val)
{
*val = 0;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_congestion_timeout(struct wlan_objmgr_psoc *psoc,
uint32_t val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_enable_twt(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_enable_twt(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_twt_bcast_requestor(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_bcast_requestor(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_get_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
bool *val)
{
*val = false;
return QDF_STATUS_E_NOSUPPORT;
}
static inline QDF_STATUS
ucfg_mlme_set_twt_bcast_responder(struct wlan_objmgr_psoc *psoc,
bool val)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
/**
* ucfg_mlme_get_dot11p_mode() - Get the setting about 802.11p mode
* @psoc: pointer to psoc object