From 7d5d5cbcb745591443682d091d4c3e4cdcab9a7b Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 19 Jul 2021 14:54:33 +0530 Subject: [PATCH] qcacld-3.0: Add support for TDLS 11AX for 6Ghz band Add support for TDLS 11AX for operations on 6Ghz band. Change-Id: I56e27f1e3560cd4374ba186f161bbc2ad945fe1d CRs-Fixed: 2990682 --- .../tdls/core/src/wlan_tdls_cmds_process.c | 9 +++ .../dispatcher/inc/wlan_tdls_public_structs.h | 11 +++ core/mac/inc/sir_mac_prot_def.h | 13 ++++ core/mac/src/include/dph_global.h | 1 + core/mac/src/pe/lim/lim_process_tdls.c | 78 ++++++++++++++++++- os_if/tdls/src/wlan_cfg80211_tdls.c | 24 ++++++ 6 files changed, 132 insertions(+), 4 deletions(-) diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index 8c2f44982f83..843b6fd211c1 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -244,6 +244,13 @@ error: } #ifdef WLAN_FEATURE_11AX +static void tdls_pe_update_peer_6ghz_capa(struct tdls_add_sta_req *addstareq, + struct tdls_update_peer_params *update_peer) +{ + qdf_mem_copy(&addstareq->he_6ghz_cap, &update_peer->he_6ghz_cap, + sizeof(update_peer->he_6ghz_cap)); +} + static void tdls_pe_update_peer_he_capa(struct tdls_add_sta_req *addstareq, struct tdls_update_peer_params *update_peer) { @@ -251,6 +258,8 @@ static void tdls_pe_update_peer_he_capa(struct tdls_add_sta_req *addstareq, qdf_mem_copy(&addstareq->he_cap, &update_peer->he_cap, sizeof(update_peer->he_cap)); + + tdls_pe_update_peer_6ghz_capa(addstareq, update_peer); } #else static void tdls_pe_update_peer_he_capa(struct tdls_add_sta_req *addstareq, diff --git a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h index b4644cf631a4..16a70575b71a 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h @@ -787,6 +787,15 @@ struct hecap { uint16_t tx_he_mcs_map_80_80; } he_cap_mcs_info; } qdf_packed; + +struct hecap_6ghz { + /* Minimum MPDU Start Spacing B0..B2 + * Maximum A-MPDU Length Exponent B3..B5 + * Maximum MPDU Length B6..B7 */ + uint8_t a_mpdu_params; /* B0..B7 */ + uint8_t info; /* B8..B15 */ +}; + #endif struct tdls_update_peer_params { @@ -804,6 +813,7 @@ struct tdls_update_peer_params { #ifdef WLAN_FEATURE_11AX uint8_t he_cap_len; struct hecap he_cap; + struct hecap_6ghz he_6ghz_cap; #endif uint8_t uapsd_queues; uint8_t max_sp; @@ -1351,6 +1361,7 @@ struct tdls_add_sta_req { #ifdef WLAN_FEATURE_11AX uint8_t he_cap_len; struct hecap he_cap; + struct hecap_6ghz he_6ghz_cap; #endif uint8_t uapsd_queues; uint8_t max_sp; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 69df8a7c689a..60573d8f66eb 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1719,6 +1719,19 @@ struct he_capability_info { uint16_t tx_he_mcs_map_80_80; #endif } qdf_packed; + +struct he_6ghz_capability_info { + uint16_t min_mpdu_start_spacing:3; + uint16_t max_ampdu_len_exp:3; + uint16_t max_mpdu_len:2; + + uint16_t reserved:1; + uint16_t sm_pow_save:2; + uint16_t rd_responder:1; + uint16_t rx_ant_pattern_consistency:1; + uint16_t tx_ant_pattern_consistency:1; + uint16_t reserved2:2; +} qdf_packed; #endif /* diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h index 77a676467243..c1e0dded4d17 100644 --- a/core/mac/src/include/dph_global.h +++ b/core/mac/src/include/dph_global.h @@ -188,6 +188,7 @@ typedef struct sDphHashNode { #ifdef WLAN_FEATURE_11AX tDot11fIEhe_cap he_config; uint16_t he_mcs_12_13_map; + tDot11fIEhe_6ghz_band_cap he_6g_band_cap; #endif /* Peer operation class, extracted from ASSOC request frame*/ tDot11fIESuppOperatingClasses supp_operating_classes; diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 9bb350f6c2bd..c6de42ef9dcd 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -699,7 +699,8 @@ static void populate_dot11f_tdls_ht_vht_cap(struct mac_context *mac, nss = mac->vdev_type_nss_2g.tdls; nss = QDF_MIN(nss, mac->user_configured_nss); - if (IS_DOT11_MODE_HT(selfDot11Mode)) { + if (IS_DOT11_MODE_HT(selfDot11Mode) && + !lim_is_he_6ghz_band(pe_session)) { /* Include HT Capability IE */ populate_dot11f_ht_caps(mac, pe_session, htCap); val_len = SIZE_OF_SUPPORTED_MCS_SET; @@ -781,6 +782,64 @@ static void populate_dot11f_tdls_ht_vht_cap(struct mac_context *mac, } #ifdef WLAN_FEATURE_11AX +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) +static void +lim_tdls_populate_dot11f_6hgz_he_caps(struct mac_context *mac, + struct tdls_add_sta_req *add_sta_req, + tDot11fIEhe_6ghz_band_cap *pDot11f) +{ + union { + struct hecap_6ghz he_6ghz_cap; + struct he_6ghz_capability_info dot11f; + } peer_cfg; + + if (!add_sta_req->he_6ghz_cap.a_mpdu_params && + !add_sta_req->he_6ghz_cap.info) { + tdls_debug("6Ghz HE capabilities not present"); + return; + } + + qdf_mem_copy(&peer_cfg.he_6ghz_cap, + &add_sta_req->he_6ghz_cap, + sizeof(add_sta_req->he_6ghz_cap)); + + pDot11f->present = 1; + pDot11f->min_mpdu_start_spacing = + peer_cfg.dot11f.min_mpdu_start_spacing; + pDot11f->max_ampdu_len_exp = peer_cfg.dot11f.max_ampdu_len_exp; + pDot11f->max_mpdu_len = peer_cfg.dot11f.max_mpdu_len; + pDot11f->sm_pow_save = peer_cfg.dot11f.sm_pow_save; + pDot11f->rd_responder = peer_cfg.dot11f.rd_responder; + pDot11f->rx_ant_pattern_consistency = + peer_cfg.dot11f.rx_ant_pattern_consistency; + pDot11f->tx_ant_pattern_consistency = + peer_cfg.dot11f.tx_ant_pattern_consistency; + + lim_log_he_6g_cap(mac, pDot11f); +} + +static void lim_populate_tdls_setup_6g_cap(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *hecap_6g, + struct pe_session *session) +{ + if (hecap_6g) + populate_dot11f_he_6ghz_cap(mac, session, hecap_6g); +} + +#else +static void +lim_tdls_populate_dot11f_6hgz_he_caps(struct mac_context *mac, + struct tdls_add_sta_req *add_sta_req, + tDot11fIEhe_6ghz_band_cap *pDot11f) +{ +} + +static void lim_populate_tdls_setup_6g_cap(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *hecap_6g, + struct pe_session *session) +{ +} +#endif static void lim_tdls_set_he_chan_width(tDot11fIEhe_cap *heCap, struct pe_session *session) @@ -814,12 +873,14 @@ static void lim_tdls_set_he_chan_width(tDot11fIEhe_cap *heCap, static void populate_dot11f_set_tdls_he_cap(struct mac_context *mac, uint32_t selfDot11Mode, tDot11fIEhe_cap *heCap, + tDot11fIEhe_6ghz_band_cap *hecap_6g, struct pe_session *session) { if (IS_DOT11_MODE_HE(selfDot11Mode)) { populate_dot11f_he_caps(mac, NULL, heCap); lim_tdls_set_he_chan_width(heCap, session); lim_log_he_cap(mac, heCap); + lim_populate_tdls_setup_6g_cap(mac, hecap_6g, session); } } @@ -829,7 +890,8 @@ static void lim_tdls_fill_dis_rsp_he_cap(struct mac_context *mac, struct pe_session *pe_session) { populate_dot11f_set_tdls_he_cap(mac, selfDot11Mode, - &tdls_dis_rsp->he_cap, pe_session); + &tdls_dis_rsp->he_cap, NULL, + pe_session); } static void lim_tdls_fill_setup_req_he_cap(struct mac_context *mac, @@ -838,7 +900,9 @@ static void lim_tdls_fill_setup_req_he_cap(struct mac_context *mac, struct pe_session *pe_session) { populate_dot11f_set_tdls_he_cap(mac, selfDot11Mode, - &tdls_setup_req->he_cap, pe_session); + &tdls_setup_req->he_cap, + &tdls_setup_req->he_6ghz_band_cap, + pe_session); } static void lim_tdls_fill_setup_rsp_he_cap(struct mac_context *mac, @@ -847,7 +911,9 @@ static void lim_tdls_fill_setup_rsp_he_cap(struct mac_context *mac, struct pe_session *pe_session) { populate_dot11f_set_tdls_he_cap(mac, selfDot11Mode, - &tdls_setup_rsp->he_cap, pe_session); + &tdls_setup_rsp->he_cap, + &tdls_setup_rsp->he_6ghz_band_cap, + pe_session); } static void lim_tdls_fill_setup_cnf_he_op(struct mac_context *mac, @@ -1034,6 +1100,10 @@ static void lim_tdls_update_node_he_caps(struct mac_context *mac, lim_tdls_set_he_chan_width(&sta->he_config, pe_session); lim_log_he_cap(mac, &sta->he_config); + + if (lim_is_he_6ghz_band(pe_session)) + lim_tdls_populate_dot11f_6hgz_he_caps(mac, add_sta_req, + &sta->he_6g_band_cap); } #else diff --git a/os_if/tdls/src/wlan_cfg80211_tdls.c b/os_if/tdls/src/wlan_cfg80211_tdls.c index 4cb44ab163eb..bd1ff1af5b17 100644 --- a/os_if/tdls/src/wlan_cfg80211_tdls.c +++ b/os_if/tdls/src/wlan_cfg80211_tdls.c @@ -292,6 +292,28 @@ tdls_calc_channels_from_staparams(struct tdls_update_peer_params *req_info, } #ifdef WLAN_FEATURE_11AX +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) +static void +wlan_cfg80211_tdls_extract_6ghz_params(struct tdls_update_peer_params *req_info, + struct station_parameters *params) +{ + if (!params->he_6ghz_capa) { + osif_debug("6 Ghz he_capa not present"); + return; + } + + qdf_mem_copy(&req_info->he_6ghz_cap, params->he_6ghz_capa, + sizeof(params->he_6ghz_capa)); +} +#else +static void +wlan_cfg80211_tdls_extract_6ghz_params(struct tdls_update_peer_params *req_info, + struct station_parameters *params) +{ + osif_debug("kernel don't support tdls 6 ghz band"); +} +#endif + static void wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info, struct station_parameters *params) @@ -314,6 +336,8 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info, qdf_mem_copy(&req_info->he_cap, params->he_capa, req_info->he_cap_len); + wlan_cfg80211_tdls_extract_6ghz_params(req_info, params); + return; }