From a0d5b2ffb2700739f1231cd67f5d4bab7a6904f3 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Wed, 8 Apr 2020 17:17:06 -0700 Subject: [PATCH] qcacld-3.0: Update HE BW in assoc indication Update ch_width in assoc indication in the API lim_fill_lim_assoc_ind_params if op frequency is 6GHz. Also, create mapping function to map two different ch_width enums. Change-Id: I4f8a19a60a8922cbc6b5d35cbac86233108818da CRs-Fixed: 2656016 --- .../src/pe/lim/lim_process_assoc_req_frame.c | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index ed33a7fa71eb..47b8dfe126bc 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -2647,6 +2647,39 @@ static void fill_mlm_assoc_ind_vht(tpSirAssocReq assocreq, } } +/** + *lim_convert_channel_width_enum() - map between two channel width enums + *@ch_width: channel width of enum type phy_ch_width + * + *Return: channel width of enum type tSirMacHTChannelWidth + */ +static tSirMacHTChannelWidth +lim_convert_channel_width_enum(enum phy_ch_width ch_width) +{ + switch (ch_width) { + case CH_WIDTH_20MHZ: + return eHT_CHANNEL_WIDTH_20MHZ; + case CH_WIDTH_40MHZ: + return eHT_CHANNEL_WIDTH_40MHZ; + case CH_WIDTH_80MHZ: + return eHT_CHANNEL_WIDTH_80MHZ; + case CH_WIDTH_160MHZ: + return eHT_CHANNEL_WIDTH_160MHZ; + case CH_WIDTH_80P80MHZ: + return eHT_CHANNEL_WIDTH_80P80MHZ; + case CH_WIDTH_MAX: + return eHT_MAX_CHANNEL_WIDTH; + case CH_WIDTH_5MHZ: + break; + case CH_WIDTH_10MHZ: + break; + case CH_WIDTH_INVALID: + break; + } + pe_debug("invalid enum: %d", ch_width); + return eHT_CHANNEL_WIDTH_20MHZ; +} + bool lim_fill_lim_assoc_ind_params( tpLimMlmAssocInd assoc_ind, struct mac_context *mac_ctx, @@ -2867,7 +2900,10 @@ bool lim_fill_lim_assoc_ind_params( assoc_ind->he_caps_present = assoc_req->he_cap.present; assoc_ind->is_sae_authenticated = assoc_req->is_sae_authenticated; - + /* updates HE bandwidth in assoc indication */ + if (wlan_reg_is_6ghz_chan_freq(session_entry->curr_op_freq)) + assoc_ind->ch_width = + lim_convert_channel_width_enum(sta_ds->ch_width); return true; }