Parcourir la source

qcacld-3.0: Log BSSID for roam result

In connectivity logging for ROAM RESULT log
bssid if ap type is Roamed AP in case of roaming
success and Current connected AP if roaming fails.
Also the vdev id field is not filled for mgmt frame
Tx and is always printed as 0.
Fill the vdev id for mgmt frame TX.

Change-Id: I7d6fe7ba47b508fadaf9b9872e644d8b737bf001
CRs-Fixed: 3068229
Amruta Kulkarni il y a 3 ans
Parent
commit
8c81446ade

+ 14 - 3
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -4876,7 +4876,13 @@ void cm_roam_scan_info_event(struct wmi_roam_scan_data *scan, uint8_t vdev_id)
 
 	qdf_copy_macaddr(&log_record->bssid, &ap->bssid);
 
-	log_record->roam_scan.cand_ap_count = scan->num_ap;
+	/*
+	 * scan->num_ap includes current connected AP also
+	 * so subtract 1 from the count to get total candidate APs
+	 */
+	if (scan->num_ap)
+		log_record->roam_scan.cand_ap_count = scan->num_ap - 1;
+
 	if (scan->num_chan > MAX_ROAM_SCAN_CHAN)
 		scan->num_chan = MAX_ROAM_SCAN_CHAN;
 
@@ -4944,7 +4950,6 @@ void cm_roam_candidate_info_event(struct wmi_roam_candidate_info *ap,
 	qdf_mem_free(log_record);
 }
 
-#define TYPE_ROAMED_AP 2
 void cm_roam_result_info_event(struct wmi_roam_result *res,
 			       struct wmi_roam_scan_data *scan_data,
 			       uint8_t vdev_id)
@@ -4973,7 +4978,13 @@ void cm_roam_result_info_event(struct wmi_roam_result *res,
 			if (i >= MAX_ROAM_CANDIDATE_AP)
 				break;
 
-			if (scan_data->ap[i].type == TYPE_ROAMED_AP) {
+			if (scan_data->ap[i].type == WLAN_ROAM_SCAN_ROAMED_AP &&
+			    log_record->roam_result.is_roam_successful) {
+				log_record->bssid = scan_data->ap[i].bssid;
+				break;
+			} else if (scan_data->ap[i].type ==
+				   WLAN_ROAM_SCAN_CURRENT_AP &&
+				   !log_record->roam_result.is_roam_successful) {
 				log_record->bssid = scan_data->ap[i].bssid;
 				break;
 			}

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

@@ -1796,6 +1796,10 @@ enum roam_offload_state {
 	WLAN_ROAM_SYNCH_IN_PROG,
 };
 
+#define WLAN_ROAM_SCAN_CANDIDATE_AP 0
+#define WLAN_ROAM_SCAN_CURRENT_AP   1
+#define WLAN_ROAM_SCAN_ROAMED_AP    2
+
 /**
  *  struct roam_btm_response_data - BTM response related data
  *  @present:       Flag to check if the roam btm_rsp tlv is present

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

@@ -2737,6 +2737,7 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 
 	if (pe_session->opmode == QDF_STA_MODE) {
 		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)mac_hdr;
+		mgmt_data.vdev_id = pe_session->vdev_id;
 		mgmt_data.status_code = STATUS_SUCCESS;
 		mgmt_data.frame_subtype = MGMT_SUBTYPE_ASSOC_REQ;
 		mgmt_data.rssi = peer_rssi;
@@ -3250,6 +3251,7 @@ alloc_packet:
 
 	if (session->opmode == QDF_STA_MODE) {
 		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)mac_hdr;
+		mgmt_data.vdev_id = session->vdev_id;
 		mgmt_data.status_code = auth_frame->authStatusCode;
 		mgmt_data.rssi = peer_rssi;
 		mgmt_data.frame_subtype = MGMT_SUBTYPE_AUTH;
@@ -3793,6 +3795,7 @@ lim_send_disassoc_mgmt_frame(struct mac_context *mac,
 
 		if (pe_session->opmode == QDF_STA_MODE) {
 			mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)pMacHdr;
+			mgmt_data.vdev_id = pe_session->vdev_id;
 			mgmt_data.status_code = nReason;
 			mgmt_data.frame_subtype = MGMT_SUBTYPE_DISASSOC;
 			mgmt_data.rssi = mac->lim.bss_rssi;
@@ -4032,6 +4035,7 @@ lim_send_deauth_mgmt_frame(struct mac_context *mac,
 
 		if (pe_session->opmode == QDF_STA_MODE) {
 			mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)pMacHdr;
+			mgmt_data.vdev_id = pe_session->vdev_id;
 			mgmt_data.status_code = nReason;
 			mgmt_data.rssi = mac->lim.bss_rssi;
 			mgmt_data.frame_subtype = MGMT_SUBTYPE_DEAUTH;
@@ -5949,6 +5953,7 @@ static void lim_tx_mgmt_frame(struct mac_context *mac_ctx, uint8_t vdev_id,
 	    msg_len >= (sizeof(struct wlan_frame_hdr) +
 			MAC_AUTH_FRAME_STATUS_CODE_OFFSET + 2)) {
 		mgmt_data.mac_hdr = *(struct wlan_frame_hdr *)frame;
+		mgmt_data.vdev_id = vdev_id;
 		mgmt_data.status_code =
 			*(uint16_t *)(frame + sizeof(struct wlan_frame_hdr) +
 				      MAC_AUTH_FRAME_STATUS_CODE_OFFSET);