diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 4912c80661fe..a7fc30d4beaf 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1046,15 +1046,19 @@ static CDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, * To avoid wpa_supplicant sending "HANGED" CMD * to ICS UI. */ - if (eCSR_ROAM_LOSTLINK == roamStatus) + if (eCSR_ROAM_LOSTLINK == roamStatus) { + if (pRoamInfo->reasonCode == + eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON) + pr_info("wlan: disconnected due to poor signal, rssi is %d dB\n", pRoamInfo->rxRssi); cfg80211_disconnected(dev, pRoamInfo-> reasonCode, NULL, 0, GFP_KERNEL); - else + } else { cfg80211_disconnected(dev, WLAN_REASON_UNSPECIFIED, NULL, 0, GFP_KERNEL); + } hdd_info("sent disconnected event to nl80211, rssi: %d", pAdapter->rssi); diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index a627a09d4785..d73049243280 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1398,6 +1398,7 @@ typedef struct sSirSmeDeauthInd { uint16_t staId; uint32_t reasonCode; + int8_t rssi; } tSirSmeDeauthInd, *tpSirSmeDeauthInd; /* / Definition for stop BSS request message */ diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h index abeacf4f521c..30a8e2903b07 100644 --- a/core/mac/src/include/dph_global.h +++ b/core/mac/src/include/dph_global.h @@ -240,6 +240,8 @@ typedef struct sDphHashNode { uint8_t is_disassoc_deauth_in_progress; uint8_t nss; + int8_t del_sta_ctx_rssi; + /* * When a station with already an existing dph entry tries to * associate again, the old dph entry will be zeroed out except diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c index c4626c66c037..c61e18930916 100644 --- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c +++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c @@ -92,6 +92,7 @@ static void lim_delete_sta_util(tpAniSirGlobal mac_ctx, tpDeleteStaContext msg, cdf_mem_free(msg); return; } + stads->del_sta_ctx_rssi = msg->rssi; /* check and see if same staId. This is to avoid the scenario * where we're trying to delete a staId we just added. diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index c7d1517d2523..326dfc7576a0 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1125,6 +1125,9 @@ lim_send_sme_deauth_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason; pSirSmeDeauthInd->staId = pStaDs->staIndex; + if (eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON == + pStaDs->mlmStaContext.disassocReason) + pSirSmeDeauthInd->rssi = pStaDs->del_sta_ctx_rssi; mmhMsg.type = eWNI_SME_DEAUTH_IND; mmhMsg.bodyptr = pSirSmeDeauthInd; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 60a45ad85bb4..7c1c12de50b4 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -11336,6 +11336,7 @@ CDF_STATUS csr_roam_lost_link(tpAniSirGlobal pMac, uint32_t sessionId, sizeof(tSirMacAddr)); roamInfo.staId = (uint8_t) pDeauthIndMsg->staId; roamInfo.reasonCode = pDeauthIndMsg->reasonCode; + roamInfo.rxRssi = pDeauthIndMsg->rssi; } sms_log(pMac, LOGW, FL("roamInfo.staId (%d)"), roamInfo.staId); diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 52e313908ff6..f5875316f781 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -592,6 +592,7 @@ typedef enum eSmpsModeValue { * @bssId: mac address * @addr2: mac address * @reasonCode: reason code + * @rssi: rssi value during disconnection */ typedef struct { uint16_t assocId; @@ -599,6 +600,7 @@ typedef struct { tSirMacAddr bssId; tSirMacAddr addr2; uint16_t reasonCode; + int8_t rssi; } tDeleteStaContext, *tpDeleteStaContext; /** diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index bad92a00f21c..52719d97b35b 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -440,6 +440,7 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len) cdf_mem_copy(del_sta_ctx->bssId, wma->interfaces[vdev_id].addr, IEEE80211_ADDR_LEN); del_sta_ctx->reasonCode = HAL_DEL_STA_REASON_CODE_KEEP_ALIVE; + del_sta_ctx->rssi = kickout_event->rssi + WMA_TGT_NOISE_FLOOR_DBM; wma_send_msg(wma, SIR_LIM_DELETE_STA_CONTEXT_IND, (void *)del_sta_ctx, 0);