Sfoglia il codice sorgente

qcacld-3.0: Send BMISS disconnect event only when teardown happens

The driver sends BMISS disconnection logging event when firmware
sends the bmiss event to host. But if the AP responds after
sending the unicast probe request then we stay connected to
same AP. This could cause the BMISS disconnection log sent
earlier to be a false alarm.

Send the BMISS disconnection logging event only when host driver
initiates teardown with the AP.

Change-Id: I021b335071f803829bdc55249f1071ceaa92edc9
CRs-Fixed: 3083568
Pragaspathi Thilagaraj 3 anni fa
parent
commit
71f5251684

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

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -1278,6 +1279,7 @@ struct missed_beacon_ind {
 	uint16_t messageType;   /* eWNI_SME_MISSED_BEACON_IND */
 	uint16_t length;
 	uint8_t bss_idx;
+	int32_t rssi;
 };
 
 /* / Definition for Set Context request */

+ 2 - 0
core/mac/src/pe/include/lim_session.h

@@ -440,6 +440,8 @@ struct pe_session {
 
 	/*Flag to Track Status/Indicate HBFailure on this session */
 	bool LimHBFailureStatus;
+	int32_t hb_failure_ap_rssi;
+
 	uint32_t gLimPhyMode;
 	uint8_t txLdpcIniFeatureEnabled;
 	/**

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

@@ -1730,6 +1730,7 @@ void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac,
 
 	/* Set Beacon Miss in Powersave Offload */
 	pe_session->pmmOffloadInfo.bcnmiss = true;
+	pe_session->hb_failure_ap_rssi = missed_beacon_ind->rssi;
 	pe_err("Received Heart Beat Failure");
 
 	/*  Do AP probing immediately */

+ 14 - 1
core/mac/src/pe/lim/lim_link_monitoring_algo.c

@@ -370,6 +370,7 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId,
 
 	if (sta) {
 		tLimMlmDeauthInd mlmDeauthInd;
+		struct qdf_mac_addr connected_bssid;
 
 		if ((sta->mlmStaContext.disassocReason ==
 		    REASON_DEAUTH_NETWORK_LEAVING) ||
@@ -418,9 +419,21 @@ lim_tear_down_link_with_ap(struct mac_context *mac, uint8_t sessionId,
 		mlmDeauthInd.deauthTrigger =
 			sta->mlmStaContext.cleanupTrigger;
 
-		if (LIM_IS_STA_ROLE(pe_session))
+		if (LIM_IS_STA_ROLE(pe_session)) {
+			if (reasonCode == REASON_BEACON_MISSED) {
+				qdf_copy_macaddr(
+					&connected_bssid,
+					(struct qdf_mac_addr *)sta->staAddr);
+				cm_roam_beacon_loss_disconnect_event(
+					connected_bssid,
+					pe_session->hb_failure_ap_rssi,
+					pe_session->vdev_id);
+			}
+;
 			lim_post_sme_message(mac, LIM_MLM_DEAUTH_IND,
 				     (uint32_t *) &mlmDeauthInd);
+		}
+
 		if (mac->mlme_cfg->gen.fatal_event_trigger)
 			cds_flush_logs(WLAN_LOG_TYPE_FATAL,
 					WLAN_LOG_INDICATOR_HOST_DRIVER,

+ 1 - 6
core/wma/src/wma_mgmt.c

@@ -2538,7 +2538,6 @@ void wma_set_keepalive_req(tp_wma_handle wma,
 void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id, int32_t rssi)
 {
 	struct missed_beacon_ind *beacon_miss_ind;
-	struct qdf_mac_addr connected_bssid;
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 
 	beacon_miss_ind = qdf_mem_malloc(sizeof(*beacon_miss_ind));
@@ -2552,17 +2551,13 @@ void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id, int32_t rssi)
 	beacon_miss_ind->messageType = WMA_MISSED_BEACON_IND;
 	beacon_miss_ind->length = sizeof(*beacon_miss_ind);
 	beacon_miss_ind->bss_idx = vdev_id;
+	beacon_miss_ind->rssi = rssi;
 
 	wma_send_msg(wma, WMA_MISSED_BEACON_IND, beacon_miss_ind, 0);
 	if (!wmi_service_enabled(wma->wmi_handle,
 				 wmi_service_hw_db2dbm_support))
 		rssi += WMA_TGT_NOISE_FLOOR_DBM;
 	wma_lost_link_info_handler(wma, vdev_id, rssi);
-
-	/* Send BMISS Logging event */
-	wlan_vdev_get_bss_peer_mac(wma->interfaces[vdev_id].vdev,
-				   &connected_bssid);
-	cm_roam_beacon_loss_disconnect_event(connected_bssid, rssi, vdev_id);
 }
 
 void wlan_cm_send_beacon_miss(uint8_t vdev_id, int32_t rssi)