summaryrefslogtreecommitdiff
path: root/core/mac/src
diff options
context:
space:
mode:
authorSreelakshmi Konamki <skonam@codeaurora.org>2016-11-09 17:06:44 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-11-23 05:24:45 -0800
commit4c77cef296578c270ba2169dfc9c0acb66f24451 (patch)
tree482b29b773aeccddc9b37954b170ae12853ba660 /core/mac/src
parentd2bea4761150178939f79b1e5f334187a1fc4e82 (diff)
qcacld-3.0: report RSSI at disconnection time in STA mode
qcacld-2.0 to qcacld-3.0 propagation Save RSSI of current connected AP when disconnection happens. User space has to use getRSSI private IOCTL to query the RSSI value after disconnected event. Change-Id: I51ab69f2b0bda7c6b3a2689297ca56941471b1cc CRs-Fixed: 910970
Diffstat (limited to 'core/mac/src')
-rw-r--r--core/mac/src/pe/include/lim_api.h11
-rw-r--r--core/mac/src/pe/lim/lim_api.c33
-rw-r--r--core/mac/src/pe/lim/lim_process_deauth_frame.c10
-rw-r--r--core/mac/src/pe/lim/lim_process_disassoc_frame.c8
-rw-r--r--core/mac/src/sys/legacy/src/utils/src/mac_trace.c1
5 files changed, 58 insertions, 5 deletions
diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h
index 5c42317df51d..c5c350ebef3d 100644
--- a/core/mac/src/pe/include/lim_api.h
+++ b/core/mac/src/pe/include/lim_api.h
@@ -222,6 +222,17 @@ static inline QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx,
#endif
/**
+ * lim_update_lost_link_info() - update lost link information to SME
+ * @mac: global MAC handle
+ * @session: PE session
+ * @rssi: rssi value from the received frame
+ *
+ * Return: None
+ */
+void lim_update_lost_link_info(tpAniSirGlobal mac, tpPESession session,
+ int32_t rssi);
+
+/**
* lim_mon_init_session() - create PE session for monitor mode operation
* @mac_ptr: mac pointer
* @msg: Pointer to struct sir_create_session type.
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index e1ee86334f6c..478868ab32b5 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -2179,6 +2179,39 @@ tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(tpAniSirGlobal pMac,
return eMGMT_DROP_NO_DROP;
}
+void lim_update_lost_link_info(tpAniSirGlobal mac, tpPESession session,
+ int32_t rssi)
+{
+ struct sir_lost_link_info *lost_link_info;
+ tSirMsgQ mmh_msg;
+
+ if ((NULL == mac) || (NULL == session)) {
+ lim_log(mac, LOGE, FL("parameter NULL"));
+ return;
+ }
+ if (!LIM_IS_STA_ROLE(session)) {
+ lim_log(mac, LOGE, FL("not STA mode, do nothing"));
+ return;
+ }
+
+ lost_link_info = qdf_mem_malloc(sizeof(*lost_link_info));
+ if (NULL == lost_link_info) {
+ lim_log(mac, LOGE, FL("lost_link_info allocation failure"));
+ return;
+ }
+
+ lost_link_info->vdev_id = session->smeSessionId;
+ lost_link_info->rssi = rssi;
+ mmh_msg.type = eWNI_SME_LOST_LINK_INFO_IND;
+ mmh_msg.bodyptr = lost_link_info;
+ mmh_msg.bodyval = 0;
+ lim_log(mac, LOG1,
+ FL("post eWNI_SME_LOST_LINK_INFO_IND, bss_idx %d, rssi %d"),
+ lost_link_info->vdev_id, lost_link_info->rssi);
+
+ lim_sys_process_mmh_msg_api(mac, &mmh_msg, ePROT);
+}
+
QDF_STATUS pe_acquire_global_lock(tAniSirLim *psPe)
{
QDF_STATUS status = QDF_STATUS_E_INVAL;
diff --git a/core/mac/src/pe/lim/lim_process_deauth_frame.c b/core/mac/src/pe/lim/lim_process_deauth_frame.c
index 6a434856408b..f9a19bb44b31 100644
--- a/core/mac/src/pe/lim/lim_process_deauth_frame.c
+++ b/core/mac/src/pe/lim/lim_process_deauth_frame.c
@@ -81,10 +81,12 @@ lim_process_deauth_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
#ifdef WLAN_FEATURE_11W
uint32_t frameLen;
#endif
+ int32_t frame_rssi;
pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
+ frame_rssi = (int32_t)WMA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo);
if (LIM_IS_STA_ROLE(psessionEntry) &&
((eLIM_SME_WT_DISASSOC_STATE == psessionEntry->limSmeState) ||
@@ -170,12 +172,12 @@ lim_process_deauth_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
PELOGE(lim_log(pMac, LOGE,
FL("Received Deauth frame for Addr: " MAC_ADDRESS_STR
- " (mlm state = %s,"
- " sme state = %d systemrole = %d) with reason code %d [%s] from "
+ "(mlm state = %s, sme state = %d systemrole = %d "
+ "RSSI = %d) with reason code %d [%s] from "
MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
lim_mlm_state_str(psessionEntry->limMlmState),
psessionEntry->limSmeState,
- GET_LIM_SYSTEM_ROLE(psessionEntry),
+ GET_LIM_SYSTEM_ROLE(psessionEntry), frame_rssi,
reasonCode, lim_dot11_reason_str(reasonCode),
MAC_ADDR_ARRAY(pHdr->sa));
)
@@ -593,6 +595,8 @@ lim_process_deauth_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
if (LIM_IS_STA_ROLE(psessionEntry))
wma_tx_abort(psessionEntry->smeSessionId);
+ lim_update_lost_link_info(pMac, psessionEntry, frame_rssi);
+
/* / Deauthentication from peer MAC entity */
if (LIM_IS_STA_ROLE(psessionEntry))
lim_post_sme_message(pMac, LIM_MLM_DEAUTH_IND,
diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
index b90b1ed11cea..ae26794f77f1 100644
--- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c
+++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
@@ -81,10 +81,13 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
#ifdef WLAN_FEATURE_11W
uint32_t frameLen;
#endif
+ int32_t frame_rssi;
pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo);
pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
+ frame_rssi = (int32_t)WMA_GET_RX_RSSI_NORMALIZED(pRxPacketInfo);
+
if (lim_is_group_addr(pHdr->sa)) {
/* Received Disassoc frame from a BC/MC address */
/* Log error and ignore it */
@@ -165,11 +168,11 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
PELOG2(lim_log(pMac, LOGE,
FL("Received Disassoc frame for Addr: " MAC_ADDRESS_STR
- "(mlm state=%s, sme state=%d),"
+ "(mlm state=%s, sme state=%d RSSI=%d),"
"with reason code %d [%s] from " MAC_ADDRESS_STR),
MAC_ADDR_ARRAY(pHdr->da),
lim_mlm_state_str(psessionEntry->limMlmState),
- psessionEntry->limSmeState, reasonCode,
+ psessionEntry->limSmeState, frame_rssi, reasonCode,
lim_dot11_reason_str(reasonCode), MAC_ADDR_ARRAY(pHdr->sa));
)
@@ -368,6 +371,7 @@ lim_process_disassoc_frame(tpAniSirGlobal pMac, uint8_t *pRxPacketInfo,
return;
}
+ lim_update_lost_link_info(pMac, psessionEntry, frame_rssi);
lim_post_sme_message(pMac, LIM_MLM_DISASSOC_IND,
(uint32_t *) &mlmDisassocInd);
diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
index 0845d33f82c9..a7b007895737 100644
--- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
+++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
@@ -368,6 +368,7 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL);
CASE_RETURN_STRING(eWNI_SME_EXT_CHANGE_CHANNEL_IND);
CASE_RETURN_STRING(eWNI_SME_REGISTER_P2P_ACK_CB);
+ CASE_RETURN_STRING(eWNI_SME_LOST_LINK_INFO_IND);
CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END);
default:
return (uint8_t *) "UNKNOWN";