summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhani Shaik <subhanis@codeaurora.org>2017-03-17 11:21:01 -0700
committerSubhani Shaik <subhanis@codeaurora.org>2017-03-20 22:17:49 -0700
commitfa2853e01eb9884a1965f7746811e2eed60a00f2 (patch)
tree89a5afc9cbeee4afc2a3c6fba78d2a43df9aab80
parentbc1b4b824528f683c25de28dc6996492486ae115 (diff)
downloadandroid_hardware_qcom_wlan-fa2853e01eb9884a1965f7746811e2eed60a00f2.tar.gz
android_hardware_qcom_wlan-fa2853e01eb9884a1965f7746811e2eed60a00f2.tar.bz2
android_hardware_qcom_wlan-fa2853e01eb9884a1965f7746811e2eed60a00f2.zip
Wifi-Hal: Provide additional debug info incase of NAN error
Bug: 35625752 Change-Id: Ic582e5b79fa5822b4b7042e3edb22b9d4cbfaf43
-rw-r--r--qcwcn/wifi_hal/nan.cpp5
-rw-r--r--qcwcn/wifi_hal/nan_req.cpp3
-rw-r--r--qcwcn/wifi_hal/nan_rsp.cpp29
3 files changed, 25 insertions, 12 deletions
diff --git a/qcwcn/wifi_hal/nan.cpp b/qcwcn/wifi_hal/nan.cpp
index f3a7457..7efa503 100644
--- a/qcwcn/wifi_hal/nan.cpp
+++ b/qcwcn/wifi_hal/nan.cpp
@@ -674,6 +674,7 @@ wifi_error nan_data_interface_create(transaction_id id,
wifi_interface_handle iface,
char* iface_name)
{
+ ALOGV("NAN_DP_INTERFACE_CREATE");
int ret = WIFI_SUCCESS;
struct nlattr *nlData;
NanCommand *nanCommand = NULL;
@@ -721,6 +722,7 @@ wifi_error nan_data_interface_delete(transaction_id id,
wifi_interface_handle iface,
char* iface_name)
{
+ ALOGV("NAN_DP_INTERFACE_DELETE");
int ret = WIFI_SUCCESS;
struct nlattr *nlData;
NanCommand *nanCommand = NULL;
@@ -768,6 +770,7 @@ wifi_error nan_data_request_initiator(transaction_id id,
wifi_interface_handle iface,
NanDataPathInitiatorRequest* msg)
{
+ ALOGV("NAN_DP_REQUEST_INITIATOR");
int ret = WIFI_SUCCESS;
struct nlattr *nlData, *nlCfgSecurity, *nlCfgQos;
NanCommand *nanCommand = NULL;
@@ -870,6 +873,7 @@ wifi_error nan_data_indication_response(transaction_id id,
wifi_interface_handle iface,
NanDataPathIndicationResponse* msg)
{
+ ALOGV("NAN_DP_INDICATION_RESPONSE");
int ret = WIFI_SUCCESS;
struct nlattr *nlData, *nlCfgSecurity, *nlCfgQos;
NanCommand *nanCommand = NULL;
@@ -961,6 +965,7 @@ wifi_error nan_data_end(transaction_id id,
wifi_interface_handle iface,
NanDataPathEndRequest* msg)
{
+ ALOGV("NAN_DP_END");
int ret = WIFI_SUCCESS;
struct nlattr *nlData;
NanCommand *nanCommand = NULL;
diff --git a/qcwcn/wifi_hal/nan_req.cpp b/qcwcn/wifi_hal/nan_req.cpp
index 964aa79..735936d 100644
--- a/qcwcn/wifi_hal/nan_req.cpp
+++ b/qcwcn/wifi_hal/nan_req.cpp
@@ -1470,6 +1470,7 @@ int NanCommand::calcNanFurtherAvailabilityMapSize(
int NanCommand::putNanCapabilities(transaction_id id)
{
+ ALOGV("NAN_CAPABILITIES");
size_t message_len = sizeof(NanCapabilitiesReqMsg);
pNanCapabilitiesReqMsg pFwReq = (pNanCapabilitiesReqMsg)malloc(message_len);
@@ -1499,7 +1500,7 @@ int NanCommand::putNanCapabilities(transaction_id id)
int NanCommand::putNanAvailabilityDebug(NanAvailabilityDebug debug)
{
-
+ ALOGV("NAN_AVAILABILITY_DEBUG");
size_t message_len = sizeof(NanTestModeReqMsg);
ALOGV("Message Len %zu", message_len);
diff --git a/qcwcn/wifi_hal/nan_rsp.cpp b/qcwcn/wifi_hal/nan_rsp.cpp
index f7d786d..3521b99 100644
--- a/qcwcn/wifi_hal/nan_rsp.cpp
+++ b/qcwcn/wifi_hal/nan_rsp.cpp
@@ -341,27 +341,36 @@ void NanCommand::NanErrorTranslation(NanInternalStatusType firmwareErrorRecvd,
u32 valueRcvd,
void* pResponse)
{
- int i = 0;
+ int i = 0, j = 0;
u16 msg_id; /* Based on the message_id in the header determine the Indication type */
NanResponseMsg *pRsp;
NanPublishTerminatedInd* pRspInd;
NanDisabledInd* pRspdInd;
+ char tlvInfo[NAN_ERROR_STR_LEN];
if (isNanResponse()) {
pRsp = (NanResponseMsg*)pResponse;
for (i = 0; i < (int)(sizeof(errorCodeTranslation)/ sizeof(errorCode)); i++) {
- if (errorCodeTranslation[i].firmwareError == firmwareErrorRecvd) {
- pRsp->status = errorCodeTranslation[i].frameworkError;
- strlcpy(pRsp->nan_error, errorCodeTranslation[i].nan_error, NAN_ERROR_STR_LEN);
- break;
+ if (errorCodeTranslation[i].firmwareError == firmwareErrorRecvd) {
+ pRsp->status = errorCodeTranslation[i].frameworkError;
+ strlcpy(pRsp->nan_error, errorCodeTranslation[i].nan_error, NAN_ERROR_STR_LEN);
+ if (NAN_I_STATUS_INVALID_TLV_TYPE == firmwareErrorRecvd) {
+ for (j = 0; j < (int)(sizeof(tlvToStr)/sizeof(verboseTlv)); j++) {
+ if (tlvToStr[j].tlvType == valueRcvd) {
+ strlcpy(tlvInfo, tlvToStr[i].strTlv, NAN_ERROR_STR_LEN);
+ break;
+ }
+ }
}
+ strlcat(pRsp->nan_error, tlvInfo, sizeof(pRsp->nan_error));
+ break;
+ }
}
if (i == (int)(sizeof(errorCodeTranslation)/sizeof(errorCode))) {
pRsp->status = NAN_STATUS_INTERNAL_FAILURE;
strlcpy(pRsp->nan_error, "NAN Discovery engine failure", NAN_ERROR_STR_LEN);
}
- ALOGD("%s: Status : %d", __FUNCTION__, pRsp->status);
- ALOGD("%s: Value : %s", __FUNCTION__, pRsp->nan_error);
+ ALOGD("%s: Status: %d Error Info[value %d]: %s", __FUNCTION__, pRsp->status, valueRcvd, pRsp->nan_error);
} else {
msg_id = getIndicationType();
@@ -381,8 +390,7 @@ void NanCommand::NanErrorTranslation(NanInternalStatusType firmwareErrorRecvd,
pRspInd->reason = NAN_STATUS_INTERNAL_FAILURE;
strlcpy(pRspInd->nan_reason, "NAN Discovery engine failure", NAN_ERROR_STR_LEN);
}
- ALOGD("%s: Status : %d", __FUNCTION__, pRspInd->reason);
- ALOGD("%s: Value : %s", __FUNCTION__, pRspInd->nan_reason);
+ ALOGD("%s: Status: %d Error Info[value %d]: %s", __FUNCTION__, pRspInd->reason, valueRcvd, pRspInd->nan_reason);
break;
case NAN_INDICATION_DISABLED:
pRspdInd = (NanDisabledInd*)pResponse;
@@ -397,8 +405,7 @@ void NanCommand::NanErrorTranslation(NanInternalStatusType firmwareErrorRecvd,
pRspdInd->reason = NAN_STATUS_INTERNAL_FAILURE;
strlcpy(pRspdInd->nan_reason, "NAN Discovery engine failure", NAN_ERROR_STR_LEN);
}
- ALOGD("%s: Status : %d", __FUNCTION__, pRspdInd->reason);
- ALOGD("%s: Value : %s", __FUNCTION__, pRspdInd->nan_reason);
+ ALOGD("%s: Status: %d Error Info[value %d]: %s", __FUNCTION__, pRspdInd->reason, valueRcvd, pRspdInd->nan_reason);
break;
}
}