Browse Source

qcacld-3.0: Send assoc request IEs in STA_INFO in SAP mode

Userspace expects the assoc request IEs of a disconnected station
to derive 11kv capabilities. Send the same in STA_INFO as part
of remote station info.

Change-Id: Iab5f39de833cd06e814e83f0149a0d21caf59b9f
CRs-Fixed: 2624922
Srinivas Dasari 5 years ago
parent
commit
fc3aea42ea

+ 0 - 10
components/mlme/core/inc/wlan_mlme_main.h

@@ -43,16 +43,6 @@ struct wlan_mlme_psoc_ext_obj {
 	struct wlan_mlme_cfg cfg;
 };
 
-/**
- * struct wlan_ies - Generic WLAN Information Element(s) format
- * @len: Total length of the IEs
- * @data: IE data
- */
-struct wlan_ies {
-	uint16_t len;
-	uint8_t *data;
-};
-
 /**
  * struct wlan_disconnect_info - WLAN Disconnection Information
  * @self_discon_ies: Disconnect IEs to be sent in deauth/disassoc frames

+ 9 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -2335,4 +2335,13 @@ struct mlme_roam_debug_info {
 	struct wmi_neighbor_report_data data_11kv;
 };
 
+/**
+ * struct wlan_ies - Generic WLAN Information Element(s) format
+ * @len: Total length of the IEs
+ * @data: IE data
+ */
+struct wlan_ies {
+	uint16_t len;
+	uint8_t *data;
+};
 #endif

+ 7 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -1532,6 +1532,13 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter,
 			return;
 
 		qdf_mem_copy(cache_sta_info, stainfo, sizeof(*cache_sta_info));
+		cache_sta_info->assoc_req_ies.data =
+				qdf_mem_malloc(event->ies_len);
+		if (cache_sta_info->assoc_req_ies.data) {
+			qdf_mem_copy(cache_sta_info->assoc_req_ies.data,
+				     event->ies, event->ies_len);
+			cache_sta_info->assoc_req_ies.len = event->ies_len;
+		}
 		qdf_mem_zero(&cache_sta_info->sta_node,
 			     sizeof(cache_sta_info->sta_node));
 

+ 10 - 2
core/hdd/src/wlan_hdd_sta_info.c

@@ -75,18 +75,26 @@ QDF_STATUS hdd_sta_info_attach(struct hdd_sta_info_obj *sta_info_container,
 void hdd_sta_info_detach(struct hdd_sta_info_obj *sta_info_container,
 			 struct hdd_station_info **sta_info)
 {
+	struct hdd_station_info *info;
+
 	if (!sta_info_container || !sta_info) {
 		hdd_err("Parameter(s) null");
 		return;
 	}
 
+	info = *sta_info;
 	qdf_spin_lock_bh(&sta_info_container->sta_obj_lock);
 
-	qdf_ht_remove(&((*sta_info)->sta_node));
+	qdf_ht_remove(&(info->sta_node));
 
 	qdf_spin_unlock_bh(&sta_info_container->sta_obj_lock);
 
-	qdf_mem_free(*sta_info);
+	if (info->assoc_req_ies.len) {
+		qdf_mem_free(info->assoc_req_ies.data);
+		info->assoc_req_ies.data = NULL;
+		info->assoc_req_ies.len = 0;
+	}
+	qdf_mem_free(info);
 	*sta_info = NULL;
 }
 

+ 3 - 0
core/hdd/src/wlan_hdd_sta_info.h

@@ -32,6 +32,7 @@
 #include "cdp_txrx_cmn_struct.h"
 #include "sir_mac_prot_def.h"
 #include <linux/ieee80211.h>
+#include <wlan_mlme_public_struct.h>
 
 /* A bucket size of 2^4 = 16 */
 #define WLAN_HDD_STA_INFO_SIZE 4
@@ -120,6 +121,7 @@ enum dhcp_nego_status {
  * feature or not, if first bit is 1 it indicates that FW supports this
  * feature, if it is 0 it indicates FW doesn't support this feature
  * @sta_info: The sta_info node for the station info list maintained in adapter
+ * @assoc_req_ies: Assoc request IEs of the peer station
  */
 struct hdd_station_info {
 	bool in_use;
@@ -168,6 +170,7 @@ struct hdd_station_info {
 	uint32_t rx_retry_cnt;
 	uint32_t rx_mc_bc_cnt;
 	struct qdf_ht_entry sta_node;
+	struct wlan_ies assoc_req_ies;
 };
 
 /**

+ 12 - 0
core/hdd/src/wlan_hdd_station_info.c

@@ -108,6 +108,8 @@
 	QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_DRIVER_DISCONNECT_REASON
 #define BEACON_IES \
 	QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_BEACON_IES
+#define ASSOC_REQ_IES \
+	QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_ASSOC_REQ_IES
 
 /*
  * MSB of rx_mc_bc_cnt indicates whether FW supports rx_mc_bc_cnt
@@ -1136,6 +1138,9 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx,
 			 NLA_HDRLEN) +
 			(sizeof(stainfo->rx_retry_cnt) +
 			 NLA_HDRLEN);
+	if (stainfo->assoc_req_ies.len)
+		nl_buf_len += stainfo->assoc_req_ies.len + NLA_HDRLEN;
+
 	skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len);
 	if (!skb) {
 		hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed");
@@ -1196,6 +1201,13 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx,
 		}
 	}
 
+	if (stainfo->assoc_req_ies.len) {
+		if (nla_put(skb, ASSOC_REQ_IES, stainfo->assoc_req_ies.len,
+			    stainfo->assoc_req_ies.data)) {
+			hdd_err("Failed to put assoc req IEs");
+			goto fail;
+		}
+	}
 	hdd_sta_info_detach(&adapter->cache_sta_info_list, &stainfo);
 	qdf_atomic_dec(&adapter->cache_sta_count);