Sfoglia il codice sorgente

qcacld-3.0: Add support to cache peer capability info

Currently connected peer capability information is not getting
cached for SAP.

Add support to cache the capability info from assoc request

Change-Id: I0088bd20a98e2491f6ffb452417bc73f21e69e63
CRs-Fixed: 2392939
Ashish Kumar Dhanotiya 6 anni fa
parent
commit
c617106eea

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -913,6 +913,7 @@ enum dhcp_nego_status {
  * @vht_caps: VHT capabilities of current station
  * @reason_code: Disconnection reason code for current station
  * @rssi: RSSI of the current station reported from F/W
+ * @capability: Capability information of current station
  */
 struct hdd_station_info {
 	bool in_use;
@@ -956,6 +957,7 @@ struct hdd_station_info {
 	int8_t rssi;
 	enum dhcp_phase dhcp_phase;
 	enum dhcp_nego_status dhcp_nego_status;
+	uint16_t capability;
 };
 
 /**

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

@@ -1413,6 +1413,8 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter,
 		return;
 	}
 
+	qdf_mem_copy(&stainfo->capability, &event->capability_info,
+		     sizeof(uint16_t));
 	stainfo->freq = cds_chan_to_freq(event->chan_info.chan_id);
 	stainfo->sta_type = event->staType;
 	stainfo->dot11_mode =

+ 13 - 3
core/hdd/src/wlan_hdd_station_info.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
@@ -675,6 +675,11 @@ static uint32_t hdd_add_tx_bitrate_sap_get_len(void)
 	return ((NLA_HDRLEN) + (sizeof(uint8_t) + NLA_HDRLEN));
 }
 
+static uint32_t hdd_add_sta_capability_get_len(void)
+{
+	return nla_total_size(sizeof(uint16_t));
+}
+
 /**
  * hdd_add_tx_bitrate_sap - add vhs nss info attribute
  * @skb: pointer to response skb buffer
@@ -717,7 +722,8 @@ fail:
 static uint32_t hdd_add_sta_info_sap_get_len(void)
 {
 	return ((NLA_HDRLEN) + (sizeof(uint8_t) + NLA_HDRLEN) +
-		hdd_add_tx_bitrate_sap_get_len());
+		hdd_add_tx_bitrate_sap_get_len() +
+		hdd_add_sta_capability_get_len());
 }
 
 /**
@@ -797,7 +803,11 @@ static int hdd_add_link_standard_info_sap(struct sk_buff *skb, int8_t rssi,
 		hdd_err("Reason code put fail");
 		goto fail;
 	}
-
+	if (nla_put_u16(skb, NL80211_ATTR_STA_CAPABILITY,
+			stainfo->capability)) {
+		hdd_err("put fail");
+		goto fail;
+	}
 	nla_nest_end(skb, nla_attr);
 	return 0;
 fail:

+ 1 - 0
core/mac/inc/sir_api.h

@@ -1128,6 +1128,7 @@ typedef struct sSirSmeAssocInd {
 	uint8_t ecsa_capable;
 	tDot11fIEHTCaps HTCaps;
 	tDot11fIEVHTCaps VHTCaps;
+	tSirMacCapabilityInfo capability_info;
 } tSirSmeAssocInd, *tpSirSmeAssocInd;
 
 /* / Definition for Association confirm */

+ 1 - 0
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -756,6 +756,7 @@ lim_fill_assoc_ind_params(struct mac_context *mac_ctx,
 		sme_assoc_ind->HTCaps = assoc_ind->ht_caps;
 	if (assoc_ind->vht_caps.present)
 		sme_assoc_ind->VHTCaps = assoc_ind->vht_caps;
+	sme_assoc_ind->capability_info = assoc_ind->capabilityInfo;
 }
 
 /**

+ 1 - 0
core/sap/inc/sap_api.h

@@ -280,6 +280,7 @@ typedef struct sap_StationAssocReassocCompleteEvent_s {
 	uint8_t ecsa_capable;
 	tDot11fIEHTCaps ht_caps;
 	tDot11fIEVHTCaps vht_caps;
+	tSirMacCapabilityInfo capability_info;
 } tSap_StationAssocReassocCompleteEvent;
 
 typedef struct sap_StationDisassocCompleteEvent_s {

+ 2 - 0
core/sap/src/sap_fsm.c

@@ -1562,6 +1562,8 @@ QDF_STATUS sap_signal_hdd_event(struct sap_context *sap_ctx,
 			reassoc_complete->ht_caps = csr_roaminfo->ht_caps;
 		if (csr_roaminfo->vht_caps.present)
 			reassoc_complete->vht_caps = csr_roaminfo->vht_caps;
+		reassoc_complete->capability_info =
+						csr_roaminfo->capability_info;
 
 		break;
 

+ 2 - 0
core/sme/inc/csr_api.h

@@ -1173,6 +1173,7 @@ struct csr_roam_info {
 	int rssi;
 	int tx_rate;
 	int rx_rate;
+	tSirMacCapabilityInfo capability_info;
 #ifdef WLAN_FEATURE_SAE
 	struct sir_sae_info *sae_info;
 #endif
@@ -1211,6 +1212,7 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf {
 
 	tDot11fIEHTCaps ht_caps;
 	tDot11fIEVHTCaps vht_caps;
+	tSirMacCapabilityInfo capability_info;
 } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;
 
 typedef struct tagCsrSummaryStatsInfo {

+ 5 - 0
core/sme/src/csr/csr_api_roam.c

@@ -9638,6 +9638,9 @@ void csr_roam_joined_state_msg_processor(struct mac_context *mac, void *pMsgBuf)
 			roam_info->ht_caps = pUpperLayerAssocCnf->ht_caps;
 		if (pUpperLayerAssocCnf->vht_caps.present)
 			roam_info->vht_caps = pUpperLayerAssocCnf->vht_caps;
+		roam_info->capability_info =
+					pUpperLayerAssocCnf->capability_info;
+
 		if (CSR_IS_INFRA_AP(roam_info->u.pConnectedProfile)) {
 			mac->roam.roamSession[sessionId].connectState =
 				eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED;
@@ -10584,6 +10587,7 @@ csr_roam_chk_lnk_assoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 		qdf_mem_copy(&roam_info_ptr->vht_caps,
 			     &pAssocInd->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
+	roam_info_ptr->capability_info = pAssocInd->capability_info;
 
 	if (CSR_IS_INFRA_AP(roam_info_ptr->u.pConnectedProfile)) {
 		if (session->pCurRoamProfile &&
@@ -15623,6 +15627,7 @@ QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(struct mac_context *mac,
 			pMsg->ht_caps = pAssocInd->HTCaps;
 		if (pAssocInd->VHTCaps.present)
 			pMsg->vht_caps = pAssocInd->VHTCaps;
+		pMsg->capability_info = pAssocInd->capability_info;
 
 		msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF;
 		msgQ.bodyptr = pMsg;