Эх сурвалжийг харах

qcacld-3.0: Fix connectivity logging for SAE Auth Tx/Rx

In WPA3 SAE TX case, auth_algo, auth_type and auth_seq_num
are not filled to the connectivity logging.
In SAE RX case, the auth frames are not getting logged.

Fix connectivity logging to handle SAE RX and TX case
by adding the params mentiioned above.

Change-Id: I388dd154f9d80aaf51f45bb571139072c77bf782
CRs-Fixed: 3057861
Amruta Kulkarni 3 жил өмнө
parent
commit
4931766cd1

+ 24 - 8
core/mac/src/pe/lim/lim_process_auth_frame.c

@@ -44,6 +44,7 @@
 #include "lim_process_fils.h"
 #include "wlan_mlme_api.h"
 #include "wlan_connectivity_logging.h"
+#include "lim_types.h"
 
 /**
  * is_auth_valid
@@ -414,6 +415,8 @@ static void lim_process_sae_auth_frame(struct mac_context *mac_ctx,
 	uint8_t *body_ptr;
 	enum rxmgmt_flags rx_flags = RXMGMT_FLAG_NONE;
 	struct sae_auth_retry *sae_retry;
+	uint16_t sae_auth_seq = 0, sae_status_code = 0;
+	uint16_t auth_algo;
 
 	mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 	body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
@@ -459,6 +462,24 @@ static void lim_process_sae_auth_frame(struct mac_context *mac_ctx,
 			lim_sae_auth_cleanup_retry(mac_ctx,
 						   pe_session->vdev_id);
 	}
+
+	if (LIM_IS_STA_ROLE(pe_session)) {
+		auth_algo = *(uint16_t *)body_ptr;
+		if (frame_len > (SAE_AUTH_STATUS_CODE_OFFSET + 2)) {
+			sae_auth_seq =
+				*(uint16_t *)(body_ptr +
+					      SAE_AUTH_SEQ_NUM_OFFSET);
+			sae_status_code =
+				*(uint16_t *)(body_ptr +
+					      SAE_AUTH_STATUS_CODE_OFFSET);
+		}
+		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,
+			sae_auth_seq, sae_auth_seq, WLAN_AUTH_RESP);
+	}
+
 	lim_send_sme_mgmt_frame_ind(mac_ctx, mac_hdr->fc.subType,
 				    (uint8_t *)mac_hdr,
 				    frame_len + sizeof(tSirMacMgmtHdr),
@@ -1648,10 +1669,6 @@ free:
 		qdf_mem_free(plainbody);
 }
 
-#define SAE_AUTH_SEQ_NUM_OFFSET       2
-#define SAE_AUTH_STATUS_CODE_OFFSET   4
-#define SAE_MESSAGE_TYPE_OFFSET       6
-
 /**
  * lim_process_sae_preauth_frame() - Send the WPA3 preauth SAE frame received
  * to the user space.
@@ -1668,7 +1685,7 @@ bool lim_process_sae_preauth_frame(struct mac_context *mac, uint8_t *rx_pkt)
 {
 	tpSirMacMgmtHdr dot11_hdr;
 	uint16_t auth_alg, frm_len;
-	uint16_t sae_auth_seq = 0, sae_status_code = 0, sae_type = 0;
+	uint16_t sae_auth_seq = 0, sae_status_code = 0;
 	uint8_t *frm_body, pdev_id, vdev_id = 0;
 	struct wlan_objmgr_vdev *vdev;
 
@@ -1685,12 +1702,11 @@ bool lim_process_sae_preauth_frame(struct mac_context *mac, uint8_t *rx_pkt)
 	if (auth_alg != eSIR_AUTH_TYPE_SAE)
 		return false;
 
-	if (frm_len > (SAE_MESSAGE_TYPE_OFFSET + 2)) {
+	if (frm_len > (SAE_AUTH_STATUS_CODE_OFFSET + 2)) {
 		sae_auth_seq =
 			*(uint16_t *)(frm_body + SAE_AUTH_SEQ_NUM_OFFSET);
 		sae_status_code =
 			*(uint16_t *)(frm_body + SAE_AUTH_STATUS_CODE_OFFSET);
-		sae_type = *(uint16_t *)(frm_body + SAE_MESSAGE_TYPE_OFFSET);
 	}
 
 	pe_debug("LFR3: SAE auth frame: seq_ctrl:0x%X auth_transaction_num:%d",
@@ -1710,7 +1726,7 @@ bool lim_process_sae_preauth_frame(struct mac_context *mac, uint8_t *rx_pkt)
 	wlan_connectivity_mgmt_event((struct wlan_frame_hdr *)dot11_hdr,
 				     vdev_id, sae_status_code,
 				     0, WMA_GET_RX_RSSI_NORMALIZED(rx_pkt),
-				     auth_alg, sae_type,
+				     auth_alg, sae_auth_seq,
 				     sae_auth_seq, WLAN_AUTH_RESP);
 
 	lim_send_sme_mgmt_frame_ind(mac, dot11_hdr->fc.subType,

+ 11 - 0
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -5901,6 +5901,7 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx, uint8_t vdev_id,
 	struct pe_session *session;
 	uint16_t auth_ack_status;
 	enum rateid min_rid = RATEID_DEFAULT;
+	uint16_t sae_auth_seq = 0;
 
 	session = pe_find_session_by_vdev_id(mac_ctx, vdev_id);
 	if (!session) {
@@ -5926,6 +5927,16 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx, uint8_t vdev_id,
 				      MAC_AUTH_FRAME_STATUS_CODE_OFFSET);
 		mgmt_data.rssi = mac_ctx->lim.bss_rssi;
 		mgmt_data.frame_subtype = MGMT_SUBTYPE_AUTH;
+		mgmt_data.auth_algo = *(uint16_t *)(frame +
+					  sizeof(tSirMacMgmtHdr));
+		if (mgmt_data.auth_algo == eSIR_AUTH_TYPE_SAE) {
+			sae_auth_seq =
+			    *(uint16_t *)(frame +
+					  sizeof(struct wlan_frame_hdr) +
+					  SAE_AUTH_SEQ_NUM_OFFSET);
+			mgmt_data.auth_seq = sae_auth_seq;
+			mgmt_data.auth_type = sae_auth_seq;
+		}
 		mgmt_frame_info = &mgmt_data;
 	}
 

+ 3 - 0
core/mac/src/pe/lim/lim_types.h

@@ -50,6 +50,9 @@
 #define TRACE_EVENT_AUTH_RSP_TIMER_DEACT   0x6602
 #define TRACE_EVENT_AUTH_RSP_TIMER_ACT     0x6603
 
+#define SAE_AUTH_SEQ_NUM_OFFSET       2
+#define SAE_AUTH_STATUS_CODE_OFFSET   4
+
 /* MLM message types */
 enum mlmmsgtype {
 	LIM_MLM_MSG_START = 1000,