diff options
author | Tanmay Garg <tanmayg@codeaurora.org> | 2020-12-24 17:00:04 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-01-06 07:51:36 -0800 |
commit | b7273d697ccef3b964bb659370784de1592a290c (patch) | |
tree | b51197f6f1dccda9a0e8112556b3d8428778e4d5 | |
parent | 9f1c012809ec347a1b1325cabd745a3bdf98c689 (diff) |
Correct the bw derivation from the HE operation element
Enhance the bw derivation from the HE operation element by
bringing it in sync with wpa_supplicant_8 implementation.
Also apply some minor code cleaning.
Change-Id: I88759122292714ab1acb9b11f9da436afd957ea9
CRs-Fixed: 2833018
-rw-r--r-- | qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c | 63 | ||||
-rw-r--r-- | qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h | 11 |
2 files changed, 51 insertions, 23 deletions
diff --git a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c index 5f95979..ea62d53 100644 --- a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c +++ b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c @@ -209,7 +209,7 @@ static int parse_station_info(struct resp_info *info, struct nlattr *vendata, struct nlattr *attr, *attr1, *attr2; u8 *beacon_ies = NULL; size_t beacon_ies_len = 0; - u8 seg0, seg1; + u8 seg1; os_memset(&data, 0, sizeof(struct bss_info)); @@ -330,12 +330,9 @@ static int parse_station_info(struct resp_info *info, struct nlattr *vendata, } break; case CHANWIDTH_80MHZ: - seg0 = info->vht_op_info_chan_center_freq_seg0_idx; seg1 = info->vht_op_info_chan_center_freq_seg1_idx; - if (seg1 && abs(seg1 - seg0) == 8) - data.bw = 160; - else if (seg1) - /* Notifying 80P80 as bandwidth = 160 */ + if (seg1) + /* Notifying 80P80 also as bandwidth = 160 */ data.bw = 160; else data.bw = 80; @@ -377,6 +374,27 @@ static int parse_station_info(struct resp_info *info, struct nlattr *vendata, if (he_info->he_oper_params & IEEE80211_HE_OPERATION_VHT_OPER_MASK) { ch_bw = opr[HE_OPER_VHT_CH_WIDTH_OFFSET]; + switch (ch_bw) { + case CHANWIDTH_USE_HT: + /* TO DO */ + break; + case CHANWIDTH_80MHZ: + seg1 = opr[HE_OPER_VHT_CENTER_FRQ_SEG1_OFFSET]; + if (seg1) + /* Notifying 80P80 also as bandwidth = 160 */ + data.bw = 160; + else + data.bw = 80; + break; + case CHANWIDTH_160MHZ: + data.bw = 160; + break; + case CHANWIDTH_80P80MHZ: + data.bw = 160; + break; + default: + break; + } opr += (HE_OPER_VHT_MAX_OFFSET + 1); } @@ -389,24 +407,25 @@ static int parse_station_info(struct resp_info *info, struct nlattr *vendata, IEEE80211_HE_OPERATION_6G_OPER_MASK) { ch_bw = (opr[HE_OPER_6G_PARAMS_OFFSET] & HE_OPER_6G_PARAMS_SUB_CH_BW_MASK); + switch (ch_bw) { + case HE_CHANWIDTH_20MHZ: + data.bw = 20; + break; + case HE_CHANWIDTH_40MHZ: + data.bw = 40; + break; + case HE_CHANWIDTH_80MHZ: + data.bw = 80; + break; + case HE_CHANWIDTH_160MHZ: + /* Notifying 80P80 also as bandwidth = 160 */ + data.bw = 160; + break; + default: + wpa_printf(MSG_ERROR,"Invalid channel width received : %u", ch_bw); + } } - switch (ch_bw) { - case CHANWIDTH_USE_HT: - /* TO DO */ - break; - case CHANWIDTH_80MHZ: - data.bw = 80; - break; - case CHANWIDTH_160MHZ: - data.bw = 160; - break; - case CHANWIDTH_80P80MHZ: - data.bw = 160; - break; - default: - wpa_printf(MSG_ERROR,"Invalid channel width received : %u", ch_bw); - } } parse_beacon_ies: diff --git a/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h b/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h index ee335ac..d975eec 100644 --- a/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h +++ b/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h @@ -30,7 +30,7 @@ #ifndef WPA_DRIVER_COMMON_LIB #define WPA_DRIVER_COMMON_LIB -#include "android_drv.h" //needed? +#include "android_drv.h" #define OUI_LEN 3 #define MAX_CMD_LEN 32 #define MAC_ADDR_LEN 6 @@ -40,6 +40,8 @@ #define IEEE80211_HE_OPERATION_6G_OPER_MASK 0x00020000 #define HE_OPER_VHT_CH_WIDTH_OFFSET 0 +#define HE_OPER_VHT_CENTER_FRQ_SEG0_OFFSET 1 +#define HE_OPER_VHT_CENTER_FRQ_SEG1_OFFSET 2 #define HE_OPER_VHT_MAX_OFFSET 2 #define HE_OPER_CO_LOCATED_MAX_OFFSET 0 @@ -101,6 +103,13 @@ struct resp_info { #define CHANWIDTH_80P80MHZ VHT_CHANWIDTH_80P80MHZ #endif /* CHANWIDTH_80P80MHZ */ +/* HE channel widths */ + +#define HE_CHANWIDTH_20MHZ 0 +#define HE_CHANWIDTH_40MHZ 1 +#define HE_CHANWIDTH_80MHZ 2 +#define HE_CHANWIDTH_160MHZ 3 + /** * enum qca_wlan_vendor_attr_get_station - Sub commands used by * QCA_NL80211_VENDOR_SUBCMD_GET_STATION to get the corresponding |