summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2019-03-26 14:50:22 +0530
committerAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2019-03-26 14:58:09 +0530
commit3d0f4aedf43254e78972f4f866a3010806317a67 (patch)
treea47448c14e2a99996785c5e4ac41832fe25b4e85
parent414a39f429d46a2923ff09f9000747b175872c72 (diff)
qcacld-3.0: Cache supported mode of connected STA for SAP
Currently in case of SAP, supported mode of station received in assoc request is not getting cached. Add support to cache the supported mode of station received in assoc request request in sta_info. Change-Id: I9820ae2d65fc529a1ab16424f6732fd273da3ae0 CRs-fixed: 2419957
-rw-r--r--core/hdd/inc/wlan_hdd_main.h3
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c10
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c11
3 files changed, 20 insertions, 4 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index a2d1ae143ddb..5d9ff82231a5 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1062,6 +1062,8 @@ enum dhcp_nego_status {
* MSB of rx_mc_bc_cnt indicates whether FW supports rx_mc_bc_cnt
* feature or not, if first bit is 1 it indictes that FW supports this
* feature, if it is 0 it indicates FW doesn't support this feature
+ * @support_mode: Max supported mode of a station currently
+ * connected to sap
*/
typedef struct {
bool isUsed;
@@ -1107,6 +1109,7 @@ typedef struct {
uint16_t capability;
uint32_t rx_mc_bc_cnt;
uint32_t rx_retry_cnt;
+ uint8_t support_mode;
} hdd_station_info_t;
/**
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 4e342f1a4b1d..2f7862debf6a 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -4551,7 +4551,8 @@ static int hdd_get_cached_station_remote(hdd_context_t *hdd_ctx,
(sizeof(stainfo->rx_mc_bc_cnt) +
NLA_HDRLEN) +
(sizeof(stainfo->rx_retry_cnt) +
- NLA_HDRLEN);
+ NLA_HDRLEN) +
+ (sizeof(stainfo->support_mode) + NLA_HDRLEN);
skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
if (!skb) {
@@ -4575,7 +4576,7 @@ static int hdd_get_cached_station_remote(hdd_context_t *hdd_ctx,
stainfo->ch_width = hdd_decode_ch_width((tSirMacHTChannelWidth)
stainfo->ch_width);
- if (nla_put_u32(skb, REMOTE_SUPPORTED_MODE, stainfo->dot11_mode) ||
+ if (nla_put_u32(skb, REMOTE_SUPPORTED_MODE, stainfo->support_mode) ||
nla_put_u8(skb, REMOTE_CH_WIDTH, stainfo->ch_width)) {
hdd_err("remote ch put fail");
goto fail;
@@ -4612,7 +4613,10 @@ static int hdd_get_cached_station_remote(hdd_context_t *hdd_ctx,
goto fail;
}
}
-
+ if (nla_put_u32(skb, WLAN802_11_MODE, stainfo->dot11_mode)) {
+ hdd_err("dot11 mode put fail");
+ goto fail;
+ }
qdf_mem_zero(stainfo, sizeof(*stainfo));
return cfg80211_vendor_cmd_reply(skb);
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 532f961ca6c3..26c19c3670d9 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -88,6 +88,11 @@
#define SAP_24GHZ_CH_COUNT (14)
#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
+
/*
* 11B, 11G Rate table include Basic rate and Extended rate
* The IDX field is the rate index
@@ -1486,10 +1491,14 @@ static void hdd_fill_station_info(hdd_adapter_t *pHostapdAdapter,
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);
}
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);
}
/* Initialize DHCP info */