summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaurank kathpalia <gkathpal@codeaurora.org>2018-03-29 14:24:59 +0530
committernshrivas <nshrivas@codeaurora.org>2018-04-09 06:42:30 -0700
commitb9ecaa5d845ed6408cd6cba1d85248b8a2e51111 (patch)
treeed98619beb741cf8cf821237c80b48ae88d6f0fc
parente87d0b8bda005aada0ef3796a944429d3af0a4c6 (diff)
qcacld-3.0: Enhance logging in connect path
The host prints the status and result codes in decimal with which it is unclear to understand the reason of disconnection or the state of the connection Fix is to print the result and status code in string as well to better debug the connection process Change-Id: I6e0f53f0435e1482b7b2768f4c8c404e2e383cc5 CRs-Fixed: 2203559
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c53
-rw-r--r--core/mac/src/pe/lim/lim_api.c22
-rw-r--r--core/wma/src/wma_scan_roam.c70
3 files changed, 121 insertions, 24 deletions
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index 986e714091e3..ad5d1029c3e5 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -1800,7 +1800,8 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,
}
} else {
sta_id = pHddStaCtx->conn_info.staId[0];
- hdd_debug("roamResult: %d", roamResult);
+ hdd_debug("roamResult is: %d %s", roamResult,
+ get_e_csr_roam_result_str(roamResult));
/* clear scan cache for Link Lost */
if (pRoamInfo && !pRoamInfo->reasonCode &&
@@ -2605,9 +2606,12 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
pHddStaCtx->conn_info.connState)) &&
((eCSR_ROAM_RESULT_ASSOCIATED == roamResult) ||
(eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus))) {
- hdd_info("hddDisconInProgress state=%d, result=%d, status=%d",
+ hdd_info("hddDisconInProgress state=%d, result=%d %s, status=%d %s",
pHddStaCtx->conn_info.connState,
- roamResult, roamStatus);
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus));
hddDisconInProgress = true;
}
@@ -2968,10 +2972,13 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
else {
hdd_debug("sending connect indication to nl80211:for bssid "
MAC_ADDRESS_STR
- " result:%d and Status:%d",
+ " result:%d %s and Status:%d %s",
MAC_ADDR_ARRAY
(pRoamInfo->bssid.bytes),
- roamResult, roamStatus);
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus));
/* inform connect result to nl80211 */
hdd_connect_result(dev,
@@ -3105,14 +3112,20 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
if (pRoamInfo)
hdd_err("wlan: connection failed with " MAC_ADDRESS_STR
- " result: %d and Status: %d",
+ " result: %d %s and Status: %d %s",
MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes),
- roamResult, roamStatus);
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus));
else
hdd_err("wlan: connection failed with " MAC_ADDRESS_STR
- " result: %d and Status: %d",
+ " result: %d %s and Status: %d %s",
MAC_ADDR_ARRAY(pWextState->req_bssId.bytes),
- roamResult, roamStatus);
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus));
if ((eCSR_ROAM_RESULT_SCAN_FOR_SSID_FAILURE == roamResult) ||
(pRoamInfo &&
@@ -3142,18 +3155,24 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
if (pRoamInfo) {
hdd_err("send connect failure to nl80211: for bssid "
MAC_ADDRESS_STR
- " result: %d and Status: %d reasoncode: %d",
+ " result: %d %s and Status: %d %s reasoncode: %d",
MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes),
- roamResult, roamStatus,
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus),
pRoamInfo->reasonCode);
pHddStaCtx->conn_info.assoc_status_code =
pRoamInfo->statusCode;
} else {
hdd_err("connect failed: for bssid "
MAC_ADDRESS_STR
- " result: %d and status: %d ",
+ " result: %d %s and status: %d %s",
MAC_ADDR_ARRAY(pWextState->req_bssId.bytes),
- roamResult, roamStatus);
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus));
}
hdd_debug("Invoking packetdump deregistration API");
wlan_deregister_txrx_packetdump();
@@ -5009,8 +5028,12 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId,
hdd_context_t *pHddCtx;
if (eCSR_ROAM_UPDATE_SCAN_RESULT != roamStatus)
- hdd_debug("CSR Callback: status= %d result= %d roamID=%d",
- roamStatus, roamResult, roamId);
+ hdd_debug("CSR Callback: status= %d %s result= %d %s roamID=%d",
+ roamStatus,
+ get_e_roam_cmd_status_str(roamStatus),
+ roamResult,
+ get_e_csr_roam_result_str(roamResult),
+ roamId);
/* Sanity check */
if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
hdd_err("Invalid adapter or adapter has invalid magic");
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index 97f192bcfcdf..2d6f092bb19e 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -2011,6 +2011,21 @@ static inline void lim_copy_and_free_hlp_data_from_session(
{}
#endif
+static const char *pe_roam_op_code_to_string(uint8_t roam_op_code)
+{
+ switch (roam_op_code) {
+ CASE_RETURN_STRING(SIR_ROAM_SYNCH_PROPAGATION);
+ CASE_RETURN_STRING(SIR_ROAMING_DEREGISTER_STA);
+ CASE_RETURN_STRING(SIR_ROAMING_START);
+ CASE_RETURN_STRING(SIR_ROAMING_ABORT);
+ CASE_RETURN_STRING(SIR_ROAM_SYNCH_COMPLETE);
+ CASE_RETURN_STRING(SIR_ROAM_SYNCH_NAPI_OFF);
+ CASE_RETURN_STRING(SIR_ROAMING_INVOKE_FAIL);
+ default:
+ return "none";
+ }
+}
+
/**
* pe_roam_synch_callback() - PE level callback for roam synch propagation
* @mac_ctx: MAC Context
@@ -2053,7 +2068,8 @@ QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx,
return status;
}
- pe_debug("LFR3: PE callback reason: %d", reason);
+ pe_debug("LFR3: PE callback reason: %d %s", reason,
+ pe_roam_op_code_to_string(reason));
switch (reason) {
case SIR_ROAMING_START:
session_ptr->fw_roaming_started = true;
@@ -2085,10 +2101,6 @@ QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx,
return status;
}
- pe_debug("LFR3:Received WMA_ROAM_OFFLOAD_SYNCH_IND LFR3:auth: %d vdevId: %d",
- roam_sync_ind_ptr->authStatus, roam_sync_ind_ptr->roamedVdevId);
- lim_print_mac_addr(mac_ctx, roam_sync_ind_ptr->bssid.bytes,
- QDF_TRACE_LEVEL_DEBUG);
/*
* If deauth from AP already in progress, ignore Roam Synch Indication
* from firmware.
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 542bda7610e7..35742442a5cc 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -1125,6 +1125,63 @@ QDF_STATUS wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
return status;
}
+static const char *wma_roam_reason_to_string(uint32_t roam_reason)
+{
+ switch (roam_reason) {
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_NONE);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_PER);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_BMISS);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_LOW_RSSI);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_HIGH_RSSI);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_PERIODIC);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_MAWC);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_DENSE);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_BACKGROUND);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_FORCED);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_BTM);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_UNIT_TEST);
+ CASE_RETURN_STRING(WMI_ROAM_TRIGGER_REASON_MAX);
+
+ default:
+ return "unknown";
+ }
+}
+
+static const char *wma_roam_event_to_string(uint32_t roam_reason)
+{
+ switch (roam_reason) {
+ CASE_RETURN_STRING(WMI_ROAM_REASON_INVALID);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_BETTER_AP);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_BMISS);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_LOW_RSSI);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_SUITABLE_AP);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_HO_FAILED);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_INVOKE_ROAM_FAIL);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_RSO_STATUS);
+ CASE_RETURN_STRING(WMI_ROAM_REASON_BTM);
+
+ default:
+ return "unknown";
+ }
+}
+
+static const char *wma_roam_notif_to_string(uint32_t notif)
+{
+ switch (notif) {
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_INVALID);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_ROAM_START);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_ROAM_ABORT);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_ROAM_REASSOC);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_SCAN_MODE_SUCCESS);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_SCAN_MODE_FAIL);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_DISCONNECT);
+ CASE_RETURN_STRING(WMI_ROAM_NOTIF_SUBNET_CHANGED);
+
+ default:
+ return "unknown";
+ }
+}
+
/**
* wma_roam_scan_offload_scan_period() - set roam offload scan period
* @wma_handle: wma handle
@@ -2600,9 +2657,11 @@ static int wma_fill_roam_synch_buffer(tp_wma_handle wma,
roam_synch_ind_ptr->rssi = synch_event->rssi;
WMI_MAC_ADDR_TO_CHAR_ARRAY(&synch_event->bssid,
roam_synch_ind_ptr->bssid.bytes);
- WMA_LOGD("%s: roamedVdevId %d authStatus %d roamReason %d rssi %d isBeacon %d",
- __func__, roam_synch_ind_ptr->roamedVdevId,
+ WMA_LOGD(FL("LFR3:- BSSID:- "MAC_ADDRESS_STR" roamedVdevId %d authStatus %d roamReason %d %s rssi %d isBeacon %d"),
+ MAC_ADDR_ARRAY(roam_synch_ind_ptr->bssid.bytes),
+ roam_synch_ind_ptr->roamedVdevId,
roam_synch_ind_ptr->authStatus, roam_synch_ind_ptr->roamReason,
+ wma_roam_reason_to_string(roam_synch_ind_ptr->roamReason),
roam_synch_ind_ptr->rssi, roam_synch_ind_ptr->isBeacon);
if (!QDF_IS_STATUS_SUCCESS(
@@ -6613,8 +6672,11 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
}
wmi_event = param_buf->fixed_param;
- WMA_LOGD("%s: Reason %x, Notif %x for vdevid %x, rssi %d",
- __func__, wmi_event->reason, wmi_event->notif,
+ WMA_LOGD("%s: Reason %x %s, Notif %x %s for vdevid %x, rssi %d",
+ __func__, wmi_event->reason,
+ wma_roam_event_to_string(wmi_event->reason),
+ wmi_event->notif,
+ wma_roam_notif_to_string(wmi_event->notif),
wmi_event->vdev_id, wmi_event->rssi);
wma_peer_debug_log(wmi_event->vdev_id, DEBUG_ROAM_EVENT,
DEBUG_INVALID_PEER_ID, NULL, NULL,