qcacld-3.0: WLAN logs cleanup
This is a qcacld-2.0 to qcacld-3.0 propagation.
1. Add log to print ssid, bssid, rssi, channel and country code
while connecting to an AP.
2. Add log to print disconnect reason when disconnect request is
received from user space.
3. Cleanup some of the logs moving it to appropriate log level
which are showing up as ERROR level in bug report.
Change-Id: Id8ea69a14a18565c226f89a8a5e10be46741d76d
CRs-Fixed: 914336
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index a7ef23f..8f5ec40 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -3060,11 +3060,7 @@
ol_txrx_ll_set_tx_pause_q_depth(
adapter->sessionId,
hdd_ctx->config->TxFlowMaxQueueDepth);
- /* Temporary set log level as error
- * TX Flow control feature settled down,
- * will lower log level
- */
- cds_err("MODE %d,CH %d,LWM %d,HWM %d,TXQDEP %d",
+ cds_info("MODE %d,CH %d,LWM %d,HWM %d,TXQDEP %d",
adapter->device_mode,
targetChannel,
adapter->tx_flow_low_watermark,
@@ -3090,7 +3086,7 @@
adapter->sessionId,
hdd_ctx->config->
TxHbwFlowMaxQueueDepth);
- cds_err("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
+ cds_info("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
hdd_device_mode_to_string(
adapter->device_mode),
adapter->device_mode,
@@ -3116,12 +3112,7 @@
preAdapterContext->sessionId,
hdd_ctx->config->
TxHbwFlowMaxQueueDepth);
- /*
- * Temporary set log level as error
- * TX Flow control feature settled down,
- * will lower log level
- */
- cds_err("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
+ cds_info("SCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
hdd_device_mode_to_string(
preAdapterContext->device_mode
),
@@ -3171,12 +3162,7 @@
adapter5->sessionId,
hdd_ctx->config->
TxHbwFlowMaxQueueDepth);
- /*
- * Temporary set log level as error
- * TX Flow control feature settled down,
- * will lower log level
- */
- cds_err("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
+ cds_info("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
hdd_device_mode_to_string(
adapter5->device_mode),
adapter5->device_mode,
@@ -3204,12 +3190,7 @@
adapter2_4->sessionId,
hdd_ctx->config->
TxLbwFlowMaxQueueDepth);
- /*
- * Temporary set log level as error
- * TX Flow control feature settled down,
- * will lower log level
- */
- cds_err("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
+ cds_info("MCC: MODE %s(%d), CH %d, LWM %d, HWM %d, TXQDEP %d",
hdd_device_mode_to_string(
adapter2_4->device_mode),
adapter2_4->device_mode,
diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c
index a0bed55..836ff93 100644
--- a/core/cds/src/cds_reg_service.c
+++ b/core/cds/src/cds_reg_service.c
@@ -1005,11 +1005,8 @@
&& band_capability == eCSR_BAND_24)
continue;
- if (wiphy->bands[i] == NULL) {
- CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
- "error: wiphy->bands is NULL, i = %d", i);
+ if (wiphy->bands[i] == NULL)
continue;
- }
if (i == 0)
m = 0;
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 9332e40..97b3fef 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -3241,7 +3241,7 @@
}
start_log.ring_id = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_RING_ID]);
- hddLog(LOGE, FL("Ring ID=%d"), start_log.ring_id);
+ hdd_info("Ring ID=%d", start_log.ring_id);
/* Parse and fetch verbose level */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]) {
@@ -3250,7 +3250,7 @@
}
start_log.verbose_level = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_VERBOSE_LEVEL]);
- hddLog(LOGE, FL("verbose_level=%d"), start_log.verbose_level);
+ hdd_info("verbose_level=%d", start_log.verbose_level);
/* Parse and fetch flag */
if (!tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]) {
@@ -3259,7 +3259,7 @@
}
start_log.flag = nla_get_u32(
tb[QCA_WLAN_VENDOR_ATTR_WIFI_LOGGER_FLAGS]);
- hddLog(LOGE, FL("flag=%d"), start_log.flag);
+ hdd_info("flag=%d", start_log.flag);
cds_set_ring_log_level(start_log.ring_id, start_log.verbose_level);
@@ -4705,12 +4705,8 @@
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
- if (NULL == wiphy->bands[i]) {
- hddLog(CDF_TRACE_LEVEL_ERROR,
- "%s: wiphy->bands[i] is NULL, i = %d", __func__,
- i);
+ if (NULL == wiphy->bands[i])
continue;
- }
for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
struct ieee80211_supported_band *band = wiphy->bands[i];
@@ -4911,12 +4907,8 @@
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
- if (NULL == wiphy->bands[i]) {
- hddLog(CDF_TRACE_LEVEL_ERROR,
- "%s: wiphy->bands[i] is NULL, i = %d", __func__,
- i);
+ if (NULL == wiphy->bands[i])
continue;
- }
for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
struct ieee80211_supported_band *band = wiphy->bands[i];
@@ -7690,8 +7682,7 @@
ENTER();
if (!cipher) {
- hddLog(LOGE,
- FL("received cipher %d - considering none"), cipher);
+ hdd_info("received cipher %d - considering none", cipher);
encryptionType = eCSR_ENCRYPT_TYPE_NONE;
} else {
@@ -8474,6 +8465,70 @@
}
/**
+ * hdd_ieee80211_reason_code_to_str() - return string conversion of reason code
+ * @reason: ieee80211 reason code.
+ *
+ * This utility function helps log string conversion of reason code.
+ *
+ * Return: string conversion of reason code, if match found;
+ * "Unknown" otherwise.
+ */
+static const char *hdd_ieee80211_reason_code_to_str(uint16_t reason)
+{
+ switch (reason) {
+ CASE_RETURN_STRING(WLAN_REASON_UNSPECIFIED);
+ CASE_RETURN_STRING(WLAN_REASON_PREV_AUTH_NOT_VALID);
+ CASE_RETURN_STRING(WLAN_REASON_DEAUTH_LEAVING);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_AP_BUSY);
+ CASE_RETURN_STRING(WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA);
+ CASE_RETURN_STRING(WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_STA_HAS_LEFT);
+ CASE_RETURN_STRING(WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_BAD_POWER);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_BAD_SUPP_CHAN);
+ CASE_RETURN_STRING(WLAN_REASON_INVALID_IE);
+ CASE_RETURN_STRING(WLAN_REASON_MIC_FAILURE);
+ CASE_RETURN_STRING(WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT);
+ CASE_RETURN_STRING(WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT);
+ CASE_RETURN_STRING(WLAN_REASON_IE_DIFFERENT);
+ CASE_RETURN_STRING(WLAN_REASON_INVALID_GROUP_CIPHER);
+ CASE_RETURN_STRING(WLAN_REASON_INVALID_PAIRWISE_CIPHER);
+ CASE_RETURN_STRING(WLAN_REASON_INVALID_AKMP);
+ CASE_RETURN_STRING(WLAN_REASON_UNSUPP_RSN_VERSION);
+ CASE_RETURN_STRING(WLAN_REASON_INVALID_RSN_IE_CAP);
+ CASE_RETURN_STRING(WLAN_REASON_IEEE8021X_FAILED);
+ CASE_RETURN_STRING(WLAN_REASON_CIPHER_SUITE_REJECTED);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_UNSPECIFIED_QOS);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_LOW_ACK);
+ CASE_RETURN_STRING(WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP);
+ CASE_RETURN_STRING(WLAN_REASON_QSTA_LEAVE_QBSS);
+ CASE_RETURN_STRING(WLAN_REASON_QSTA_NOT_USE);
+ CASE_RETURN_STRING(WLAN_REASON_QSTA_REQUIRE_SETUP);
+ CASE_RETURN_STRING(WLAN_REASON_QSTA_TIMEOUT);
+ CASE_RETURN_STRING(WLAN_REASON_QSTA_CIPHER_NOT_SUPP);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_PEER_CANCELED);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_MAX_PEERS);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_CONFIG);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_CLOSE);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_MAX_RETRIES);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_CONFIRM_TIMEOUT);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_INVALID_GTK);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_INCONSISTENT_PARAM);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_INVALID_SECURITY);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_ERROR);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_NOFORWARD);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_PATH_DEST_UNREACHABLE);
+ CASE_RETURN_STRING(WLAN_REASON_MAC_EXISTS_IN_MBSS);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_CHAN_REGULATORY);
+ CASE_RETURN_STRING(WLAN_REASON_MESH_CHAN);
+ default:
+ return "Unknown";
+ }
+}
+
+/**
* __wlan_hdd_cfg80211_disconnect() - cfg80211 disconnect api
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
@@ -8584,6 +8639,8 @@
#endif
hddLog(LOG1, FL("Disconnecting with reasoncode:%u"),
reasonCode);
+ hdd_info("Disconnect request from user space with reason: %s",
+ hdd_ieee80211_reason_code_to_str(reason));
status = wlan_hdd_disconnect(pAdapter, reasonCode);
if (0 != status) {
hddLog(LOGE,
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index 1e8db57..39192ef 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -5762,7 +5762,7 @@
adapter->mc_addr_list.addr[i],
sizeof(adapter->mc_addr_list.addr[i]));
filter->ulMulticastAddrCnt++;
- hdd_err("%s RX filter : addr ="
+ hdd_info("%s RX filter : addr ="
MAC_ADDRESS_STR,
action ? "setting" : "clearing",
MAC_ADDR_ARRAY(filter->multicastAddr[i]));
@@ -5772,7 +5772,7 @@
sme_8023_multicast_list(handle, adapter->sessionId, filter);
cdf_mem_free(filter);
} else {
- hdd_err("mode %d mc_cnt %d",
+ hdd_info("mode %d mc_cnt %d",
adapter->device_mode, adapter->mc_addr_list.mc_cnt);
}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index da721d1..8cdc4c4 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1651,7 +1651,7 @@
ETH_ALEN)) ||
(adapter->addr_filter_pattern && (!memcmp(ha->addr,
&adapter->addr_filter_pattern, 1)))) {
- hdd_err("MC/BC filtering Skip addr ="MAC_ADDRESS_STR,
+ hdd_info("MC/BC filtering Skip addr ="MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(ha->addr));
adapter->mc_addr_list.mc_cnt--;
continue;
@@ -3349,7 +3349,7 @@
if (ret)
hddLog(LOGE, FL("Failed to register IPv6 notifier"));
else
- hddLog(LOGE, FL("Registered IPv6 notifier"));
+ hdd_info("Registered IPv6 notifier");
return;
}
@@ -5423,7 +5423,7 @@
if (ret)
hddLog(LOGE, FL("Failed to register IPv4 notifier"));
else
- hddLog(LOGE, FL("Registered IPv4 notifier"));
+ hdd_info("Registered IPv4 notifier");
wlan_hdd_dcc_register_for_dcc_stats_event(hdd_ctx);
diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c
index ccee1b9..549b3de 100644
--- a/core/hdd/src/wlan_hdd_stats.c
+++ b/core/hdd/src/wlan_hdd_stats.c
@@ -1458,9 +1458,7 @@
return -EINVAL;
if (!pAdapter->isLinkLayerStatsSet) {
- hddLog(CDF_TRACE_LEVEL_FATAL,
- "%s: isLinkLayerStatsSet : %d",
- __func__, pAdapter->isLinkLayerStatsSet);
+ hdd_warn("isLinkLayerStatsSet : %d", pAdapter->isLinkLayerStatsSet);
return -EINVAL;
}
@@ -2455,10 +2453,8 @@
hdd_wlan_get_freq(channel, &freq);
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
- if (NULL == wiphy->bands[i]) {
- hddLog(LOG1, FL("wiphy->bands[i] is NULL, i = %d"), i);
+ if (NULL == wiphy->bands[i])
continue;
- }
for (j = 0; j < wiphy->bands[i]->n_channels; j++) {
struct ieee80211_supported_band *band = wiphy->bands[i];
diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
index 455e103..fcee43b 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
@@ -2452,9 +2452,7 @@
eLIM_PERIODIC_JOIN_PROBE_REQ_TIMER);
/* Issue MLM join confirm with timeout reason code */
lim_log(mac_ctx, LOGE,
- FL("In state eLIM_MLM_WT_JOIN_BEACON_STATE."));
- lim_log(mac_ctx, LOGE,
- FL("Join Failure Timeout occurred for session %d with BSS "
+ FL("Join Failure Timeout, In eLIM_MLM_WT_JOIN_BEACON_STATE session:%d "
MAC_ADDRESS_STR),
session->peSessionId, MAC_ADDR_ARRAY(session->bssId));
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 0494579..f06d2e3 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -1713,8 +1713,7 @@
((uint8_t *)&bss_desc.ieFields), ie_len);
if (NULL != vendor_ie) {
- lim_log(mac_ctx, LOGE,
- FL("DUT is trying to connect to Cisco AP"));
+ lim_log(mac_ctx, LOG1, FL("Cisco vendor OUI present"));
session->isCiscoVendorAP = true;
} else {
session->isCiscoVendorAP = false;
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index 484a5d7..80bd967 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -3159,7 +3159,7 @@
(pe_session->is11Rconnection)) &&
(disassoc_req->reasonCode !=
eSIR_MAC_DISASSOC_DUE_TO_FTHANDOFF_REASON)) {
- lim_log(mac_ctx, LOGE,
+ lim_log(mac_ctx, LOG1,
FL("FT Preauth Session (%p,%d) Clean up"),
pe_session, pe_session->peSessionId);
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 81f59e1..37ff4d1 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -2485,7 +2485,7 @@
/* channel avoid message arrived, send IND to client */
case eWNI_SME_CH_AVOID_IND:
if (pMac->sme.pChAvoidNotificationCb) {
- CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR,
+ CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_INFO,
FL("CH avoid notification"));
pMac->sme.pChAvoidNotificationCb(pMac->hHdd,
pMsg->bodyptr);
@@ -7396,8 +7396,8 @@
}
if (pSession == NULL) {
- CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR,
- "%s: Unable to find " "the session Id: %d", __func__,
+ CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_WARN,
+ "%s: Unable to find the session Id: %d", __func__,
sessionId);
return CDF_STATUS_E_FAILURE;
}
@@ -12630,7 +12630,7 @@
}
if (!pSession->QosMapSet.present) {
- CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR,
+ CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_WARN,
FL("QOS Mapping IE not present"));
sme_release_global_lock(&pMac->sme);
return CDF_STATUS_E_FAILURE;
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 1c70373..0511549 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -13539,6 +13539,14 @@
csr_join_req->ssId.length = 0;
cdf_mem_copy(&csr_join_req->selfMacAddr, &pSession->selfMacAddr,
sizeof(tSirMacAddr));
+ sms_log(pMac, LOGE,
+ "Connecting to ssid:%.*s bssid: "
+ MAC_ADDRESS_STR" rssi: %d channel: %d country_code: %c%c",
+ pIes->SSID.num_ssid, pIes->SSID.ssid,
+ MAC_ADDR_ARRAY(pBssDescription->bssId),
+ pBssDescription->rssi, pBssDescription->channelId,
+ pMac->scan.countryCodeCurrent[0],
+ pMac->scan.countryCodeCurrent[1]);
/* bsstype */
dwTmp = csr_translate_bsstype_to_mac_type
(pProfile->BSSType);
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index b15eb9a..c1de651 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -529,7 +529,7 @@
goto out;
}
- WMA_LOGA("vdev_id:%hu vdev_hdl:%p", vdev_id, iface->handle);
+ WMA_LOGD("vdev_id:%hu vdev_hdl:%p", vdev_id, iface->handle);
if (!generateRsp) {
WMA_LOGE("Call txrx detach w/o callback for vdev %d", vdev_id);
ol_txrx_vdev_detach(iface->handle, NULL, NULL);
@@ -545,7 +545,7 @@
status = CDF_STATUS_E_NOMEM;
goto out;
}
- WMA_LOGE("Call txrx detach with callback for vdev %d", vdev_id);
+ WMA_LOGD("Call txrx detach with callback for vdev %d", vdev_id);
ol_txrx_vdev_detach(iface->handle, NULL, NULL);
wma_vdev_detach_callback(iface);
return status;
@@ -1711,7 +1711,7 @@
txrx_vdev_type);
wma_handle->interfaces[self_sta_req->session_id].pause_bitmap = 0;
- WMA_LOGA("vdev_id %hu, txrx_vdev_handle = %p", self_sta_req->session_id,
+ WMA_LOGD("vdev_id %hu, txrx_vdev_handle = %p", self_sta_req->session_id,
txrx_vdev_handle);
if (NULL == txrx_vdev_handle) {
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index 775785c..5c8fc2f 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -4551,7 +4551,7 @@
int i;
if (mcbc_param->ulMulticastAddrCnt <= 0) {
- WMA_LOGE("Number of multicast addresses is 0");
+ WMA_LOGW("Number of multicast addresses is 0");
return CDF_STATUS_E_FAILURE;
}
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 2956990..e7f83f1 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -4926,7 +4926,7 @@
event->first_entry_index);
WMA_LOGI("num_entries_in_page %d", numap);
if (!src_hotlist || !src_rssi || !numap) {
- WMA_LOGE("%s: Cached results empty, send 0 results", __func__);
+ WMA_LOGW("%s: Cached results empty, send 0 results", __func__);
goto noresults;
}
if (event->first_entry_index +