Browse Source

qcacld-3.0: Add support to print aid and btcoex field

Add new tags for reassociation request and reassociation
response. Parse the association id from roam stats event
and send it over the connectivity logging event

Add support to print AID and BT-COEX field.

Change-Id: I7926b5c69a84404b666acfd5e2db30426d085881
CRs-Fixed: 3221624
Pragaspathi Thilagaraj 2 years ago
parent
commit
701003d5dd

+ 12 - 3
components/cmn_services/logging/inc/wlan_connectivity_logging.h

@@ -37,6 +37,8 @@
  * @WLAN_AUTH_RESP: Authentication response frame
  * @WLAN_ASSOC_REQ: Association request frame
  * @WLAN_ASSOC_RESP: Association response frame
+ * @WLAN_REASSOC_REQ: Reassociation request frame
+ * @WLAN_REASSOC_RSP: Reassociation response frame
  * @WLAN_DEAUTH_RX: Deauthentication frame received
  * @WLAN_DEAUTH_TX: Deauthentication frame sent
  * @WLAN_DISASSOC_RX: Disassociation frame received
@@ -78,6 +80,8 @@ enum wlan_main_tag {
 	WLAN_AUTH_RESP,
 	WLAN_ASSOC_REQ,
 	WLAN_ASSOC_RSP,
+	WLAN_REASSOC_REQ,
+	WLAN_REASSOC_RSP,
 	WLAN_DEAUTH_RX,
 	WLAN_DEAUTH_TX,
 	WLAN_DISASSOC_RX,
@@ -140,11 +144,13 @@ struct wlan_roam_candidate_info {
  * struct wlan_roam_scan_info  - Roam scan related information
  * @cand_ap_count: Roam candidate AP count
  * @num_scanned_frequencies: Number of scanned frequencies
+ * @is_btcoex_active: Is bluetooth coex active
  * @scan_freq: Array of scanned frequencies value in MHz
  */
 struct wlan_roam_scan_info {
 	uint8_t cand_ap_count;
 	uint16_t num_scanned_freq;
+	bool is_btcoex_active;
 	qdf_freq_t scan_freq[NUM_CHANNELS];
 };
 
@@ -241,8 +247,10 @@ struct wlan_roam_btm_info {
  * values:
  * 1 - SAE commit frame
  * 2 - SAE confirm frame
+ * @assoc_id: Association ID received in association response frame as
+ * defined in IEEE Std 802.11-2020 Figure 9-91-AID field format.
  * @frame_status_code: Frame status code as defined in IEEE Std
- * 802.11‐2020 Table 9-50—Status codes.
+ * 802.11 2020 Table 9-50—Status codes.
  * @seq_num: Frame sequence number
  * @rssi: Peer RSSI in dBm
  * @is_retry_frame: is frame retried
@@ -254,6 +262,7 @@ struct wlan_packet_info {
 	uint8_t auth_algo;
 	uint8_t auth_seq_num;
 	uint8_t auth_type;
+	uint16_t assoc_id;
 	uint16_t frame_status_code;
 	uint16_t seq_num;
 	int32_t rssi;
@@ -512,7 +521,7 @@ wlan_connectivity_mgmt_event(struct wlan_frame_hdr *mac_hdr,
 			     enum qdf_dp_tx_rx_status tx_status,
 			     int8_t peer_rssi,
 			     uint8_t auth_algo, uint8_t auth_type,
-			     uint8_t auth_seq,
+			     uint8_t auth_seq, uint16_t aid,
 			     enum wlan_main_tag tag);
 #else
 static inline
@@ -541,7 +550,7 @@ wlan_connectivity_mgmt_event(struct wlan_frame_hdr *mac_hdr,
 			     enum qdf_dp_tx_rx_status tx_status,
 			     int8_t peer_rssi,
 			     uint8_t auth_algo, uint8_t auth_type,
-			     uint8_t auth_seq,
+			     uint8_t auth_seq, uint16_t aid,
 			     enum wlan_main_tag tag)
 {}
 #endif

+ 3 - 1
components/cmn_services/logging/src/wlan_connectivity_logging.c

@@ -306,7 +306,8 @@ wlan_connectivity_mgmt_event(struct wlan_frame_hdr *mac_hdr,
 			     enum qdf_dp_tx_rx_status tx_status,
 			     int8_t peer_rssi,
 			     uint8_t auth_algo, uint8_t auth_type,
-			     uint8_t auth_seq, enum wlan_main_tag tag)
+			     uint8_t auth_seq, uint16_t aid,
+			     enum wlan_main_tag tag)
 {
 	struct wlan_log_record *new_rec;
 	struct wlan_objmgr_vdev *vdev;
@@ -332,6 +333,7 @@ wlan_connectivity_mgmt_event(struct wlan_frame_hdr *mac_hdr,
 	new_rec->pkt_info.auth_algo = auth_algo;
 	new_rec->pkt_info.auth_type = auth_type;
 	new_rec->pkt_info.auth_seq_num = auth_seq;
+	new_rec->pkt_info.assoc_id = aid;
 	new_rec->pkt_info.is_retry_frame =
 		(mac_hdr->i_fc[1] & IEEE80211_FC1_RETRY);
 

+ 5 - 2
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -5427,6 +5427,8 @@ void cm_roam_scan_info_event(struct wlan_objmgr_psoc *psoc,
 			log_record->roam_scan.scan_freq[i] = scan->chan_freq[i];
 	}
 
+	log_record->roam_scan.is_btcoex_active = scan->is_btcoex_active;
+
 out:
 	wlan_connectivity_log_enqueue(log_record);
 	qdf_mem_free(log_record);
@@ -5848,9 +5850,9 @@ cm_roam_get_tag(enum mgmt_subtype subtype, bool is_tx)
 	case MGMT_SUBTYPE_ASSOC_RESP:
 		return WLAN_ASSOC_RSP;
 	case MGMT_SUBTYPE_REASSOC_REQ:
-		return WLAN_ASSOC_REQ;
+		return WLAN_REASSOC_REQ;
 	case MGMT_SUBTYPE_REASSOC_RESP:
-		return WLAN_ASSOC_RSP;
+		return WLAN_REASSOC_RSP;
 	case MGMT_SUBTYPE_DISASSOC:
 		if (is_tx)
 			return WLAN_DISASSOC_TX;
@@ -6104,6 +6106,7 @@ cm_roam_mgmt_frame_event(struct roam_frame_info *frame_data,
 	log_record->pkt_info.rssi = (-1) * frame_data->rssi;
 	log_record->pkt_info.tx_status = frame_data->tx_status;
 	log_record->pkt_info.frame_status_code = frame_data->status_code;
+	log_record->pkt_info.assoc_id = frame_data->assoc_id;
 
 	if (scan_data->present) {
 		for (i = 0; i < scan_data->num_ap; i++) {

+ 3 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -1942,6 +1942,8 @@ enum roam_rt_stats_type {
  * applicable only for tx frames
  * @rssi: Frame rssi
  * @retry_count: Frame retry count
+ * @assoc_id: Association id received in the association response/
+ * reassociation response frame
  */
 struct roam_frame_info {
 	bool present;
@@ -1956,6 +1958,7 @@ struct roam_frame_info {
 	uint16_t status_code;
 	int32_t rssi;
 	uint16_t retry_count;
+	uint16_t assoc_id;
 };
 
 /**

+ 2 - 0
components/wmi/src/wmi_unified_roam_tlv.c

@@ -2072,6 +2072,8 @@ extract_roam_frame_info_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 
 		dst_buf->retry_count = src_data->retry_count;
 		dst_buf->rssi = (-1) * src_data->rssi_dbm_abs;
+		dst_buf->assoc_id =
+			WMI_GET_ASSOC_ID(src_data->frame_info_ext);
 
 		dst_buf++;
 		src_data++;

+ 52 - 0
core/hdd/src/wlan_hdd_connectivity_logging.c

@@ -52,6 +52,8 @@ hdd_connectivity_log_attr_table[WLAN_TAG_MAX] = {
 	[WLAN_AUTH_RESP] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_AUTH_RESP,
 	[WLAN_ASSOC_REQ] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_ASSOC_REQ,
 	[WLAN_ASSOC_RSP] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_ASSOC_RESP,
+	[WLAN_REASSOC_REQ] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_REASSOC_REQ,
+	[WLAN_REASSOC_RSP] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_REASSOC_RES,
 	[WLAN_DEAUTH_RX] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DEAUTH_RX,
 	[WLAN_DEAUTH_TX] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DEAUTH_TX,
 	[WLAN_DISASSOC_RX] = QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DISASSOC_RX,
@@ -238,9 +240,57 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 GET_ATTR_OFFSET(pkt_info.seq_num)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_STATUS_CODE, NLA_U8,  sizeof(uint8_t),
 	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_ASSOC_ID,   NLA_U16, sizeof(uint16_t),
+	 GET_ATTR_OFFSET(pkt_info.assoc_id)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
 
+	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_REASSOC_REQ] = {
+	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
+	 GET_ATTR_OFFSET(log_subtype)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
+	 GET_ATTR_OFFSET(timestamp_us)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_KERNEL_TIMESTAMP, NLA_U64, sizeof(uint64_t),
+	 GET_ATTR_OFFSET(ktime_us)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
+	 GET_ATTR_OFFSET(vdev_id)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID,       NLA_BINARY, QDF_MAC_ADDR_SIZE,
+	 GET_ATTR_OFFSET(bssid)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_RSSI,        NLA_S32,  sizeof(int32_t),
+	 GET_ATTR_OFFSET(pkt_info.rssi)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	 GET_ATTR_OFFSET(pkt_info.seq_num)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_FRAME_TX_STATUS,   NLA_U8, sizeof(uint8_t),
+	 GET_ATTR_OFFSET(pkt_info.tx_status)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IS_RETRY_FRAME,    NLA_FLAG, sizeof(uint8_t),
+	 GET_ATTR_OFFSET(pkt_info.is_retry_frame)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
+	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
+	{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
+	},
+
+	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_REASSOC_RES] = {
+	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
+	 GET_ATTR_OFFSET(log_subtype)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_HOST_TIMESTAMP,   NLA_U64,  sizeof(uint64_t),
+	 GET_ATTR_OFFSET(timestamp_us)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_KERNEL_TIMESTAMP, NLA_U64, sizeof(uint64_t),
+	 GET_ATTR_OFFSET(ktime_us)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_IFINDEX,     NLA_U8,   sizeof(uint8_t),
+	 GET_ATTR_OFFSET(vdev_id)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BSSID,       NLA_BINARY, QDF_MAC_ADDR_SIZE,
+	 GET_ATTR_OFFSET(bssid)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_SEQUENCE_NUMBER,   NLA_U16, sizeof(uint16_t),
+	 GET_ATTR_OFFSET(pkt_info.seq_num)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_STATUS_CODE, NLA_U8,  sizeof(uint8_t),
+	 GET_ATTR_OFFSET(pkt_info.frame_status_code)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_ASSOC_ID,   NLA_U16, sizeof(uint16_t),
+	 GET_ATTR_OFFSET(pkt_info.assoc_id)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_FIRMWARE_TIMESTAMP, NLA_U64,
+	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
+	{WLAN_CONNECTIVITY_ATTR_END, 0, 0, 0},
+	},
+
 	[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_DEAUTH_RX] = {
 	{QCA_WLAN_VENDOR_ATTR_DIAG_EVENT_TYPE,  NLA_U32,  sizeof(uint32_t),
 	 GET_ATTR_OFFSET(log_subtype)},
@@ -380,6 +430,8 @@ connectivity_attr_table[QCA_WLAN_VENDOR_DIAG_EVENT_TYPE_MAX + 1]
 	 sizeof(uint64_t), GET_ATTR_OFFSET(fw_timestamp_us)},
 	{QCA_WLAN_VENDOR_ATTR_DIAG_ROAM_FREQ_LIST, NLA_NESTED, sizeof(uint16_t),
 	 GET_ATTR_OFFSET(roam_scan.scan_freq)},
+	{QCA_WLAN_VENDOR_ATTR_DIAG_BT_COEX_ACTIVE,   NLA_FLAG, sizeof(uint8_t),
+	 GET_ATTR_OFFSET(roam_scan.is_btcoex_active)},
 	{WLAN_CONNECTIVITY_ATTR_END,   0, 0, 0},
 	},
 

+ 1 - 1
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -1252,7 +1252,7 @@ lim_process_assoc_rsp_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 		wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)hdr,
 					     session_entry->vdev_id,
 					     assoc_rsp->status_code, 0, rssi,
-					     0, 0, 0,
+					     0, 0, 0, assoc_rsp->aid,
 					     WLAN_ASSOC_RSP);
 
 	ap_nss = lim_get_nss_supported_by_ap(&assoc_rsp->VHTCaps,

+ 3 - 3
core/mac/src/pe/lim/lim_process_auth_frame.c

@@ -489,7 +489,7 @@ static void lim_process_sae_auth_frame(struct mac_context *mac_ctx,
 		wlan_connectivity_mgmt_event(
 			(struct wlan_frame_hdr *)mac_hdr, pe_session->vdev_id,
 			sae_status_code, 0,
-			WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info), auth_algo,
+			WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info), auth_algo, 0,
 			sae_auth_seq, sae_auth_seq, WLAN_AUTH_RESP);
 	}
 
@@ -1710,7 +1710,7 @@ lim_process_auth_frame(struct mac_context *mac_ctx, uint8_t *rx_pkt_info,
 				     0, WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info),
 				     auth_alg, 0,
 				     rx_auth_frm_body->authTransactionSeqNumber,
-				     WLAN_AUTH_RESP);
+				     0, WLAN_AUTH_RESP);
 	switch (rx_auth_frm_body->authTransactionSeqNumber) {
 	case SIR_MAC_AUTH_FRAME_1:
 		lim_process_auth_frame_type1(mac_ctx,
@@ -1804,7 +1804,7 @@ bool lim_process_sae_preauth_frame(struct mac_context *mac, uint8_t *rx_pkt)
 				     vdev_id, sae_status_code,
 				     0, WMA_GET_RX_RSSI_NORMALIZED(rx_pkt),
 				     auth_alg, sae_auth_seq,
-				     sae_auth_seq, WLAN_AUTH_RESP);
+				     sae_auth_seq, 0, WLAN_AUTH_RESP);
 
 	lim_send_sme_mgmt_frame_ind(mac, dot11_hdr->fc.subType,
 				    (uint8_t *)dot11_hdr,

+ 1 - 1
core/mac/src/pe/lim/lim_process_deauth_frame.c

@@ -157,7 +157,7 @@ lim_process_deauth_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 
 	wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)pHdr,
 				     pe_session->vdev_id, reasonCode,
-				     0, frame_rssi, 0, 0, 0,
+				     0, frame_rssi, 0, 0, 0, 0,
 				     WLAN_DEAUTH_RX);
 	lim_diag_event_report(mac, WLAN_PE_DIAG_DEAUTH_FRAME_EVENT,
 		pe_session, 0, reasonCode);

+ 1 - 1
core/mac/src/pe/lim/lim_process_disassoc_frame.c

@@ -154,7 +154,7 @@ lim_process_disassoc_frame(struct mac_context *mac, uint8_t *pRxPacketInfo,
 			GET_LIM_SYSTEM_ROLE(pe_session));
 	wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)pHdr,
 				     pe_session->vdev_id, reasonCode,
-				     0, frame_rssi, 0, 0, 0,
+				     0, frame_rssi, 0, 0, 0, 0,
 				     WLAN_DISASSOC_RX);
 	lim_diag_event_report(mac, WLAN_PE_DIAG_DISASSOC_FRAME_EVENT,
 		pe_session, 0, reasonCode);

+ 4 - 4
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -2249,7 +2249,7 @@ static void wlan_send_tx_complete_event(struct mac_context *mac, qdf_nbuf_t buf,
 			wlan_connectivity_mgmt_event(
 					mac_hdr, params->vdev_id, status,
 					qdf_tx_complete, mac->lim.bss_rssi,
-					algo, type, seq, WLAN_AUTH_REQ);
+					algo, type, seq, 0, WLAN_AUTH_REQ);
 			return;
 		}
 
@@ -2259,7 +2259,7 @@ static void wlan_send_tx_complete_event(struct mac_context *mac, qdf_nbuf_t buf,
 		wlan_connectivity_mgmt_event(
 					mac_hdr, params->vdev_id, reason_code,
 					qdf_tx_complete, mac->lim.bss_rssi,
-					0, 0, 0, tag);
+					0, 0, 0, 0, tag);
 	}
 }
 
@@ -4185,7 +4185,7 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 		wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)pMacHdr,
 					     pe_session->vdev_id, nReason,
 					     QDF_TX_RX_STATUS_OK,
-					     mac->lim.bss_rssi, 0, 0, 0,
+					     mac->lim.bss_rssi, 0, 0, 0, 0,
 					     WLAN_DISASSOC_TX);
 
 		/* Queue Disassociation frame in high priority WQ */
@@ -4431,7 +4431,7 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 		wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)pMacHdr,
 					     pe_session->vdev_id, nReason,
 					     QDF_TX_RX_STATUS_OK,
-					     mac->lim.bss_rssi, 0, 0, 0,
+					     mac->lim.bss_rssi, 0, 0, 0, 0,
 					     WLAN_DEAUTH_TX);
 
 		/* Queue Disassociation frame in high priority WQ */