qcacmn: Add 11be support WMI peer assoc command

Add 320Mhz band width support and EHT capabilities information in
WMI peer assoc command.

Change-Id: Ie4ee95fb1790c828275e90b384b2bdc04efb3f29
CRs-Fixed: 2882054
This commit is contained in:
Venkateswara Swamy Bandaru
2021-04-01 22:13:25 +05:30
committed by snandini
parent bb3a53e3dd
commit a8e24fd6c0
2 changed files with 125 additions and 1 deletions

View File

@@ -1027,6 +1027,7 @@ typedef struct {
* @bw_40: 40 capabale
* @bw_80: 80 capabale
* @bw_160: 160 capabale
* @bw_320: 320 capabale
* @stbc_flag: STBC flag
* @ldpc_flag: LDPC flag
* @static_mimops_flag: statis MIMO PS flags
@@ -1041,6 +1042,7 @@ typedef struct {
* @amsdu_disable: AMSDU disble
* @peer_mac: Peer mac address
* @he_flag: HE flags
* @eht_flag: EHT flags
* @twt_requester: TWT Requester Support bit in Extended Capabilities element
* @twt_responder: TWT Responder Support bit in Extended Capabilities element
* @peer_he_cap_macinfo: Peer HE Cap MAC info
@@ -1051,6 +1053,12 @@ typedef struct {
* @peer_he_mcs_count: Peer HE MCS TX/RX MAP count
* @peer_he_rx_mcs_set: Peer HE RX MCS MAP
* @peer_he_tx_mcs_set: Peer HE TX MCS MAP
* @peer_eht_cap_macinfo: Peer EHT Cap MAC info
* @peer_eht_ops: Peer EHT operation info
* @peer_eht_cap_phyinfo: Peer EHT Cap PHY info
* @peer_eht_mcs_count: Peer EHT MCS TX/RX MAP count
* @peer_eht_rx_mcs_set: Peer EHT RX MCS MAP
* @peer_eht_tx_mcs_set: Peer EHT TX MCS MAP
* @peer_ppet: Peer HE PPET info
* @peer_bss_max_idle_option: Peer BSS Max Idle option update
* @akm: AKM info
@@ -1087,6 +1095,9 @@ struct peer_assoc_params {
bw_40:1,
bw_80:1,
bw_160:1,
#ifdef WLAN_FEATURE_11BE
bw_320:1,
#endif
stbc_flag:1,
ldpc_flag:1,
static_mimops_flag:1,
@@ -1104,6 +1115,9 @@ struct peer_assoc_params {
/* Use common structure */
uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
bool he_flag;
#ifdef WLAN_FEATURE_11BE
bool eht_flag;
#endif
bool twt_requester;
bool twt_responder;
uint32_t peer_he_cap_macinfo[WMI_HOST_MAX_HECAP_MAC_SIZE];
@@ -1114,6 +1128,14 @@ struct peer_assoc_params {
uint32_t peer_he_mcs_count;
uint32_t peer_he_rx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
uint32_t peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
#ifdef WLAN_FEATURE_11BE
uint32_t peer_eht_cap_macinfo[WMI_HOST_MAX_HECAP_MAC_SIZE];
uint32_t peer_eht_ops;
uint32_t peer_eht_cap_phyinfo[WMI_HOST_MAX_HECAP_PHY_SIZE];
uint32_t peer_eht_mcs_count;
uint32_t peer_eht_rx_mcs_set[WMI_HOST_MAX_EHT_RATE_SET];
uint32_t peer_eht_tx_mcs_set[WMI_HOST_MAX_EHT_RATE_SET];
#endif
struct wmi_host_ppe_threshold peer_ppet;
u_int8_t peer_bsscolor_rept_info;
uint32_t peer_bss_max_idle_option;

View File

@@ -2456,6 +2456,24 @@ static QDF_STATUS send_beacon_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle,
return 0;
}
#ifdef WLAN_FEATURE_11BE
static inline void copy_peer_flags_tlv_11be(
wmi_peer_assoc_complete_cmd_fixed_param * cmd,
struct peer_assoc_params *param)
{
if (param->bw_320)
cmd->peer_flags_ext |= WMI_PEER_EXT_320MHZ;
if (param->eht_flag)
cmd->peer_flags_ext |= WMI_PEER_EXT_EHT;
}
#else
static inline void copy_peer_flags_tlv_11be(
wmi_peer_assoc_complete_cmd_fixed_param * cmd,
struct peer_assoc_params *param)
{
}
#endif
static inline void copy_peer_flags_tlv(
wmi_peer_assoc_complete_cmd_fixed_param * cmd,
struct peer_assoc_params *param)
@@ -2484,6 +2502,8 @@ static inline void copy_peer_flags_tlv(
if (param->bw_160)
cmd->peer_flags |= WMI_PEER_160MHZ;
copy_peer_flags_tlv_11be(cmd, param);
/* Typically if STBC is enabled for VHT it should be enabled
* for HT as well
**/
@@ -2559,6 +2579,85 @@ static inline void copy_peer_mac_addr_tlv(
WMI_CHAR_ARRAY_TO_MAC_ADDR(param->peer_mac, &cmd->peer_macaddr);
}
#ifdef WLAN_FEATURE_11BE
static inline void update_peer_flags_tlv_ehtinfo(
wmi_peer_assoc_complete_cmd_fixed_param * cmd,
struct peer_assoc_params *param, uint8_t *buf_ptr)
{
wmi_he_rate_set *eht_mcs;
int i;
cmd->peer_eht_cap_info =
param->peer_eht_cap_macinfo[WMI_HOST_EHTCAP_MAC_WORD1];
cmd->peer_eht_cap_info_ext =
param->peer_eht_cap_macinfo[WMI_HOST_EHTCAP_MAC_WORD2];
cmd->peer_eht_ops = param->peer_eht_ops;
qdf_mem_copy(&cmd->peer_eht_cap_phy, &param->peer_eht_cap_phyinfo,
sizeof(param->peer_eht_cap_phyinfo));
cmd->peer_eht_num_mcs = param->peer_eht_mcs_count;
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
(param->peer_eht_mcs_count * sizeof(wmi_he_rate_set)));
buf_ptr += WMI_TLV_HDR_SIZE;
/* Loop through the EHT rate set */
for (i = 0; i < param->peer_eht_mcs_count; i++) {
eht_mcs = (wmi_he_rate_set *)buf_ptr;
WMITLV_SET_HDR(eht_mcs, WMITLV_TAG_STRUC_wmi_he_rate_set,
WMITLV_GET_STRUCT_TLVLEN(wmi_he_rate_set));
eht_mcs->rx_mcs_set = param->peer_eht_rx_mcs_set[i];
eht_mcs->tx_mcs_set = param->peer_eht_tx_mcs_set[i];
wmi_debug("EHT idx %d RxMCSmap %x TxMCSmap %x ",
i, eht_mcs->rx_mcs_set, eht_mcs->tx_mcs_set);
buf_ptr += sizeof(wmi_he_rate_set);
}
if ((param->eht_flag) && (param->peer_eht_mcs_count > 1) &&
(param->peer_eht_rx_mcs_set[WMI_HOST_EHT_TXRX_MCS_NSS_IDX_160]
== WMI_HOST_EHT_INVALID_MCSNSSMAP ||
param->peer_eht_tx_mcs_set[WMI_HOST_EHT_TXRX_MCS_NSS_IDX_160]
== WMI_HOST_HE_INVALID_MCSNSSMAP)) {
wmi_debug("param->peer_eht_tx_mcs_set[160MHz]=%x",
param->peer_eht_tx_mcs_set
[WMI_HOST_HE_TXRX_MCS_NSS_IDX_160]);
wmi_debug("param->peer_eht_rx_mcs_set[160MHz]=%x",
param->peer_eht_rx_mcs_set
[WMI_HOST_HE_TXRX_MCS_NSS_IDX_160]);
wmi_debug("peer_mac="QDF_MAC_ADDR_FMT,
QDF_MAC_ADDR_REF(param->peer_mac));
}
wmi_debug("EHT cap_info %x ops %x EHT cap_info_ext %x EHT phy %x %x %x ",
cmd->peer_eht_cap_info,
cmd->peer_eht_ops, cmd->peer_he_cap_info_ext,
cmd->peer_eht_cap_phy[0], cmd->peer_he_cap_phy[1],
cmd->peer_eht_cap_phy[2]);
}
#else
static inline void update_peer_flags_tlv_ehtinfo(
wmi_peer_assoc_complete_cmd_fixed_param * cmd,
struct peer_assoc_params *param, uint8_t *buf_ptr)
{
}
#endif
#ifdef WLAN_FEATURE_11BE
static
uint32_t wmi_eht_rate_set_len(struct peer_assoc_params *param)
{
return (sizeof(wmi_he_rate_set) * param->peer_eht_mcs_count
+ WMI_TLV_HDR_SIZE);
}
#else
static
uint32_t wmi_eht_rate_set_len(struct peer_assoc_params *param)
{
return 0;
}
#endif
/**
* send_peer_assoc_cmd_tlv() - WMI peer assoc function
* @param wmi_handle : handle to WMI.
@@ -2590,7 +2689,8 @@ static QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
(peer_ht_rates_align * sizeof(uint8_t)) +
sizeof(wmi_vht_rate_set) +
(sizeof(wmi_he_rate_set) * param->peer_he_mcs_count
+ WMI_TLV_HDR_SIZE);
+ WMI_TLV_HDR_SIZE)
+ wmi_eht_rate_set_len(param);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf)
@@ -2727,6 +2827,8 @@ static QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
cmd->peer_he_cap_phy[2],
cmd->peer_bw_rxnss_override);
update_peer_flags_tlv_ehtinfo(cmd, param, buf_ptr);
wmi_mtrace(WMI_PEER_ASSOC_CMDID, cmd->vdev_id, 0);
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_PEER_ASSOC_CMDID);