Browse Source

qcacld-3.0: Fix invalid vdev id passed to lim_send_sme_mgmt_frame_ind

BTM frames offloaded to userspace are sent from
lim_check_mgmt_registered_frames() ->
lim_send_sme_mgmt_frame_ind(). But the vdev id passed to the
lim_send_sme_mgmt_frame_ind() API is retrieved from the
registered mgmt frames list pointer. So invalid vdev id is
passed and MLD address translation doesn't happen. This
causes the BTM frame to be dropped at the userspace.

Pass the vdev id from session id

Change-Id: If6a3c65c73349f176531ba6d8cc9590374a00440
CRs-Fixed: 3541821
Pragaspathi Thilagaraj 1 year ago
parent
commit
c3ddc7cace

+ 5 - 2
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1070,7 +1070,7 @@ lim_check_mgmt_registered_frames(struct mac_context *mac_ctx, uint8_t *buff_desc
 	uint8_t type, sub_type;
 	bool match = false;
 	tpSirMacActionFrameHdr action_hdr;
-	uint8_t actionID, category;
+	uint8_t actionID, category, vdev_id = WLAN_INVALID_VDEV_ID;
 	QDF_STATUS qdf_status;
 
 	hdr = WMA_GET_RX_MAC_HEADER(buff_desc);
@@ -1149,11 +1149,14 @@ lim_check_mgmt_registered_frames(struct mac_context *mac_ctx, uint8_t *buff_desc
 				}
 			}
 		}
+		if (session_entry)
+			vdev_id = session_entry->vdev_id;
+
 		/* Indicate this to SME */
 		lim_send_sme_mgmt_frame_ind(mac_ctx, hdr->fc.subType,
 			(uint8_t *) hdr,
 			WMA_GET_RX_PAYLOAD_LEN(buff_desc) +
-			sizeof(tSirMacMgmtHdr), mgmt_frame->sessionId,
+			sizeof(tSirMacMgmtHdr), vdev_id,
 			WMA_GET_RX_FREQ(buff_desc),
 			WMA_GET_RX_RSSI_NORMALIZED(buff_desc),
 			RXMGMT_FLAG_NONE);

+ 4 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -9721,8 +9721,11 @@ void lim_send_sme_mgmt_frame_ind(struct mac_context *mac_ctx, uint8_t frame_type
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
 						    WLAN_LEGACY_MAC_ID);
 
-	if (!vdev)
+	if (!vdev) {
+		pe_debug("Action frame received with invalid vdev id:%d",
+			 vdev_id);
 		goto fill_frame;
+	}
 
 	wlan_mlo_update_action_frame_to_user(vdev, frame, frame_len);
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);