From ad50c378770a855ea81cf3a1ef3e73ea16b218df Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Fri, 14 Feb 2020 18:00:29 +0530 Subject: [PATCH] qcacld-3.0: Update bit position of the supp mode in sta info Currently there is no bit reserved to indicate the support for 11bg/11abg 802.11 mode. As per new requirement update the meaning of bit positions in sta info structure to indicate all the required mode information. Change-Id: I37e72442f512020c25fec3ca66fb6facb50f92f2 CRs-Fixed: 2623453 --- core/hdd/src/wlan_hdd_hostapd.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index dc05c1891329..63864a2b6238 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -95,12 +95,15 @@ #define ACS_SCAN_EXPIRY_TIMEOUT_S 4 -/* Defines the BIT position of HT caps is support mode field of stainfo */ -#define HDD_HT_CAPS_PRESENT 0 -/* Defines the BIT position of VHT caps is support mode field of stainfo */ -#define HDD_VHT_CAPS_PRESENT 1 -/* Defines the BIT position of HE caps is support mode field of stainfo */ -#define HDD_HE_CAPS_PRESENT 2 +/* + * Defines the BIT position of 11bg/11abg/11abgn 802.11 support mode field + * of stainfo + */ +#define HDD_80211_MODE_ABGN 0 +/* Defines the BIT position of 11ac support mode field of stainfo */ +#define HDD_80211_MODE_AC 1 +/* Defines the BIT position of 11ax support mode field of stainfo */ +#define HDD_80211_MODE_AX 2 #define HDD_MAX_CUSTOM_START_EVENT_SIZE 64 @@ -1446,6 +1449,7 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter, struct hdd_station_info *oldest_disassoc_sta_info = NULL; uint8_t index = 0; qdf_time_t oldest_disassoc_sta_ts = 0; + bool is_dot11_mode_abgn; stainfo = hdd_get_sta_info_by_mac(&adapter->sta_info_list, event->staMac.bytes); @@ -1488,20 +1492,27 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter, /* expect max_phy_rate report in kbps */ stainfo->max_phy_rate *= 100; + /* + * Connected Peer always supports atleast one of the + * 802.11 mode out of 11bg/11abg/11abgn, hence this field + * should always be true. + */ + is_dot11_mode_abgn = true; + stainfo->support_mode |= is_dot11_mode_abgn << HDD_80211_MODE_ABGN; + if (event->vht_caps.present) { stainfo->vht_present = true; hdd_copy_vht_caps(&stainfo->vht_caps, &event->vht_caps); stainfo->support_mode |= - (stainfo->vht_present << HDD_VHT_CAPS_PRESENT); + (stainfo->vht_present << HDD_80211_MODE_AC); } if (event->ht_caps.present) { stainfo->ht_present = true; hdd_copy_ht_caps(&stainfo->ht_caps, &event->ht_caps); - stainfo->support_mode |= - (stainfo->ht_present << HDD_HT_CAPS_PRESENT); } + stainfo->support_mode |= - (event->he_caps_present << HDD_HE_CAPS_PRESENT); + (event->he_caps_present << HDD_80211_MODE_AX); /* Initialize DHCP info */ stainfo->dhcp_phase = DHCP_PHASE_ACK;