* [PATCH 4/7] staging: wilc1000: remove definition WILC_ERRORREPORT
2015-09-15 2:53 [PATCH 0/7] remove wilc_errorsupport.h from the wilc driver Tony Cho
` (2 preceding siblings ...)
2015-09-15 2:53 ` [PATCH 3/7] staging: wilc1000: remove definition WILC_ERRORCHECK Tony Cho
@ 2015-09-15 2:53 ` Tony Cho
2015-09-15 2:53 ` [PATCH 5/7] staging: wilc1000: remove definitions unused Tony Cho
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Tony Cho @ 2015-09-15 2:53 UTC (permalink / raw)
To: gregkh
Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
adham.abozaeid, Nicolas.FERRE
From: Leo Kim <leo.kim@atmel.com>
This patch removes the definition WILC_ERRORREPORT which is not used
anymore, and also replace PRINT_ER with printk error log.
The compiler complains the build warnings in some functions for WILC_CATCH and
ERRORHANDLER as unused definitions. So, this patch also removes WILC_CATCH and
ERRORHANDLER in some of functions.
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 6 +-
drivers/staging/wilc1000/host_interface.c | 919 +++++++++-------------
drivers/staging/wilc1000/wilc_errorsupport.h | 5 -
drivers/staging/wilc1000/wilc_msgqueue.c | 98 ++-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 +-
5 files changed, 425 insertions(+), 612 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index e0a41c5..8389565 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -13,6 +13,7 @@
/* File Includes */
/*****************************************************************************/
#include "coreconfigurator.h"
+#include <linux/errno.h>
/*****************************************************************************/
/* Constants */
/*****************************************************************************/
@@ -428,8 +429,8 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
/* Check whether the received message type is 'N' */
if ('N' != u8MsgType) {
- PRINT_ER("Received Message format incorrect.\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Received Message format incorrect.\n", __func__);
+ return -EFAULT;
}
/* Extract message ID */
@@ -525,7 +526,6 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
*ppstrNetworkInfo = pstrNetworkInfo;
-ERRORHANDLER:
return s32Error;
}
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 273d547..86d1828 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -670,12 +670,8 @@ static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetChan *pst
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to set channel\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Failed to set channel\n", __func__);
+ return -EINVAL;
}
return s32Error;
@@ -714,12 +710,8 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv *drvHandler,
if (s32Error) {
- PRINT_ER("Failed to set driver handler\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Failed to set driver handler\n", __func__);
+ return -EINVAL;
}
return s32Error;
@@ -760,12 +752,8 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetOpe
if (s32Error) {
- PRINT_ER("Failed to set driver handler\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Failed to set driver handler\n", __func__);
+ return -EINVAL;
}
return s32Error;
@@ -808,17 +796,12 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
host_int_get_ipaddress(drvHandler, firmwareIPAddress, idx);
if (s32Error) {
- PRINT_D(HOSTINF_DBG, "Failed to set IP address\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Failed to set IP address\n", __func__);
+ return -EINVAL;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address set\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -859,19 +842,14 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
host_int_setup_ipaddress(pstrWFIDrv, gs8SetIP[idx], idx);
if (s32Error != WILC_SUCCESS) {
- PRINT_ER("Failed to get IP address\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Failed to get IP address\n", __func__);
+ return -EINVAL;
} else {
PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx);
PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
PRINT_INFO(HOSTINF_DBG, "\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -910,14 +888,10 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetMacAdd
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to set mac address\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to set mac address\n", __func__);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
kfree(mac_buf);
return s32Error;
}
@@ -949,12 +923,8 @@ static s32 Handle_GetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfGetMacAdd
s32Error = SendConfigPkt(GET_CFG, &strWID, 1, false,
get_id_from_handler(drvHandler));
if (s32Error) {
- PRINT_ER("Failed to get mac address\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Failed to get mac address\n", __func__);
+ s32Error = -EFAULT;
}
up(&hWaitResponse);
@@ -998,7 +968,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.bss_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.bss_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1016,7 +988,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.auth_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.auth_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1029,7 +1003,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.auth_timeout = strHostIFCfgParamAttr->pstrCfgParamVal.auth_timeout;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1048,7 +1024,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.power_mgmt_mode = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.power_mgmt_mode;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1061,7 +1039,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.short_retry_limit = strHostIFCfgParamAttr->pstrCfgParamVal.short_retry_limit;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1075,7 +1055,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.long_retry_limit = strHostIFCfgParamAttr->pstrCfgParamVal.long_retry_limit;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1088,7 +1070,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.frag_threshold = strHostIFCfgParamAttr->pstrCfgParamVal.frag_threshold;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1101,7 +1085,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.rts_threshold = strHostIFCfgParamAttr->pstrCfgParamVal.rts_threshold;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1118,7 +1104,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.preamble_type = strHostIFCfgParamAttr->pstrCfgParamVal.preamble_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1130,7 +1118,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.short_slot_allowed = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.short_slot_allowed;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1146,7 +1136,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.txop_prot_disabled = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.txop_prot_disabled;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1159,7 +1151,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.beacon_interval = strHostIFCfgParamAttr->pstrCfgParamVal.beacon_interval;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1172,7 +1166,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.dtim_period = strHostIFCfgParamAttr->pstrCfgParamVal.dtim_period;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1189,7 +1185,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.site_survey_enabled = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.site_survey_enabled;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1202,7 +1200,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.site_survey_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.site_survey_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1215,7 +1215,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.active_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.active_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1228,7 +1230,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.passive_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.passive_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1251,7 +1255,9 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.curr_tx_rate = (u8)curr_tx_rate;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
@@ -1261,9 +1267,7 @@ static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *
if (s32Error)
PRINT_ER("Error in setting CFG params\n");
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER :
up(&(pstrWFIDrv->gtOsCfgValuesSem));
return s32Error;
}
@@ -1319,13 +1323,17 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, tstrHostIFscanAttr *pstrHost
if ((pstrWFIDrv->enuHostIFstate >= HOST_IF_SCANNING) && (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTED)) {
/* here we either in HOST_IF_SCANNING, HOST_IF_WAITING_CONN_REQ or HOST_IF_WAITING_CONN_RESP */
PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] state\n", pstrWFIDrv->enuHostIFstate);
- WILC_ERRORREPORT(s32Error, WILC_BUSY);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
if (g_obtainingIP || connecting) {
PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
- WILC_ERRORREPORT(s32Error, WILC_BUSY);
+ printk(KERN_ERR "%s \n", __func__);
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
#endif
@@ -1416,15 +1424,13 @@ static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, tstrHostIFscanAttr *pstrHost
s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
- PRINT_ER("Failed to send scan paramters config packet\n");
- WILC_ERRORREPORT(s32Error, s32Error);
- } else {
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send scan paramters config packet\n", __func__);
+ else
PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config packet\n");
- }
- WILC_CATCH(s32Error)
- {
+ERRORHANDLER:
+ if (s32Error) {
del_timer(&pstrWFIDrv->hScanTimer);
/*if there is an ongoing scan request*/
Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
@@ -1493,12 +1499,9 @@ static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS) {
- PRINT_ER("Failed to set abort running scan\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
+ if (s32Error) {
+ printk(KERN_ERR "%s : Failed to set abort running scan\n", __func__);
+ s32Error = -EFAULT;
}
}
@@ -1560,9 +1563,9 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
gapu8RcvdSurveyResults,
MAX_SURVEY_RESULT_FRAG_SIZE);
if (s32Err) {
- PRINT_ER("Failed to get site survey results\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
-
+ printk(KERN_ERR "%s : Failed to get site survey results\n", __func__);
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
}
s32Err = ParseSurveyResults(gapu8RcvdSurveyResults, &pstrSurveyResults,
&pstrWFIDrv->u32SurveyResultsCount);
@@ -1578,8 +1581,9 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
DeallocateSurveyResults(pstrSurveyResults);
} else {
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- PRINT_ER("ParseSurveyResults() Error(%d)\n", s32Err);
+ printk(KERN_ERR "%s : ParseSurveyResults() Error(%d)\n", __func__, s32Err);
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
}
@@ -1691,15 +1695,17 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Handle_Connect()] failed to send config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Handle_Connect()] failed to send config packet\n", __func__);
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
} else {
pstrWFIDrv->enuHostIFstate = HOST_IF_WAITING_CONN_RESP;
}
} else {
- PRINT_ER("Required BSSID not found\n");
- WILC_ERRORREPORT(s32Error, WILC_NOT_FOUND);
+ printk(KERN_ERR "%s : Required BSSID not found\n", __func__);
+ s32Error = -ENOENT;
+ goto ERRORHANDLER;
}
#else
@@ -1719,8 +1725,9 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
#ifdef WILC_PARSE_SCAN_IN_HOST
ptstrJoinBssParam = (tstrJoinBssParam *)pstrHostIFconnectAttr->pJoinParams;
if (ptstrJoinBssParam == NULL) {
- PRINT_ER("Required BSSID not found\n");
- WILC_ERRORREPORT(s32Error, WILC_NOT_FOUND);
+ printk(KERN_ERR "%s : Required BSSID not found\n", __func__);
+ s32Error = -ENOENT;
+ goto ERRORHANDLER;
}
#endif /*WILC_PARSE_SCAN_IN_HOST*/
@@ -1828,8 +1835,10 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
strWIDList[u32WidsCount].s32ValueSize = MAX_SSID_LEN + 7;
strWIDList[u32WidsCount].ps8WidVal = kmalloc(strWIDList[u32WidsCount].s32ValueSize, GFP_KERNEL);
- if (strWIDList[u32WidsCount].ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
+ }
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
@@ -1865,8 +1874,10 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
gu32FlushedJoinReqSize = strWIDList[u32WidsCount].s32ValueSize;
gu8FlushedJoinReq = kmalloc(gu32FlushedJoinReqSize, GFP_KERNEL);
}
- if (strWIDList[u32WidsCount].ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ if (strWIDList[u32WidsCount].ps8WidVal == NULL) {
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
+ }
pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
@@ -2015,15 +2026,17 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Handle_Connect()] failed to send config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Handle_Connect() failed to send config packet\n", __func__);
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
} else {
PRINT_D(GENERIC_DBG, "set HOST_IF_WAITING_CONN_RESP\n");
pstrWFIDrv->enuHostIFstate = HOST_IF_WAITING_CONN_RESP;
}
#endif
- WILC_CATCH(s32Error)
+ERRORHANDLER:
+ if (s32Error)
{
tstrConnectInfo strConnectInfo;
@@ -2145,13 +2158,8 @@ static s32 Handle_FlushConnect(tstrWILC_WFIDrv *drvHandler)
s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(gu8FlushedJoinReqDrvHandler));
if (s32Error) {
- PRINT_ER("Handle_Flush_Connect()] failed to send config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
-
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Handle_Flush_Connect()] failed to send config packet\n", __func__);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -2299,7 +2307,9 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdNetworkInfo
ParseNetworkInfo(pstrRcvdNetworkInfo->pu8Buffer, &pstrNetworkInfo);
if ((pstrNetworkInfo == NULL)
|| (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s : \n", __func__);
+ s32Error = -EINVAL;
+ goto done;
}
/* check whether this network is discovered before */
@@ -2366,12 +2376,6 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdNetworkInfo
}
}
-
- WILC_CATCH(s32Error)
- {
-
- }
-
done:
/* Deallocate pstrRcvdNetworkInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
if (pstrRcvdNetworkInfo->pu8Buffer != NULL) {
@@ -2425,15 +2429,16 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult) {
if ((pstrRcvdGnrlAsyncInfo->pu8Buffer == NULL) ||
(pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult == NULL)) {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EINVAL;
}
u8MsgType = pstrRcvdGnrlAsyncInfo->pu8Buffer[0];
/* Check whether the received message type is 'I' */
if ('I' != u8MsgType) {
- PRINT_ER("Received Message format incorrect.\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Received Message format incorrect.\n", __func__);
+ return -EFAULT;
}
/* Extract message ID */
@@ -2705,11 +2710,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
}
- WILC_CATCH(s32Error)
- {
-
- }
-
/* Deallocate pstrRcvdGnrlAsyncInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
if (pstrRcvdGnrlAsyncInfo->pu8Buffer != NULL) {
kfree(pstrRcvdGnrlAsyncInfo->pu8Buffer);
@@ -3129,8 +3129,7 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to send dissconect config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to send dissconect config packet\n", __func__);
} else {
tstrDisconnectNotifInfo strDisconnectNotifInfo;
@@ -3201,11 +3200,6 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
}
- WILC_CATCH(s32Error)
- {
-
- }
-
/* ////////////////////////// */
up(&(pstrWFIDrv->hSemTestDisconnectBlock));
/* ///////////////////////// */
@@ -3245,16 +3239,10 @@ static s32 Switch_Log_Terminal(tstrWILC_WFIDrv *drvHandler)
if (s32Error) {
PRINT_D(HOSTINF_DBG, "Failed to switch log terminal\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EINVAL;
} else {
PRINT_INFO(HOSTINF_DBG, "MAC address set ::\n");
-
-
- }
-
- WILC_CATCH(s32Error)
- {
-
}
return s32Error;
@@ -3289,15 +3277,10 @@ static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
get_id_from_handler(pstrWFIDrv));
/*get the value by searching the local copy*/
if (s32Error) {
- PRINT_ER("Failed to get channel number\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to get channel number\n", __func__);
+ s32Error = -EFAULT;
}
-
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetCHNL));
return s32Error;
@@ -3333,14 +3316,10 @@ static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
s32Error = SendConfigPkt(GET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to get RSSI value\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to get RSSI value\n", __func__);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetRSSI));
@@ -3365,14 +3344,10 @@ static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
s32Error = SendConfigPkt(GET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to get LINKSPEED value\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to get LINKSPEED value\n", __func__);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetLINKSPEED));
@@ -3416,10 +3391,9 @@ s32 Handle_GetStatistics(tstrWILC_WFIDrv *drvHandler, tstrStatistics *pstrStatis
s32Error = SendConfigPkt(GET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(drvHandler));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send scan paramters config packet\n");
- /* WILC_ERRORREPORT(s32Error, s32Error); */
- }
+
up(&hWaitResponse);
return 0;
@@ -3466,8 +3440,8 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, tstrHostIfStaIna
get_id_from_handler(pstrWFIDrv));
/*get the value by searching the local copy*/
if (s32Error) {
- PRINT_ER("Failed to SET incative time\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to SET incative time\n", __func__);
+ return -EFAULT;
}
@@ -3481,19 +3455,14 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, tstrHostIfStaIna
get_id_from_handler(pstrWFIDrv));
/*get the value by searching the local copy*/
if (s32Error) {
- PRINT_ER("Failed to get incative time\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to get incative time\n", __func__);
+ return -EFAULT;
}
PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", gu32InactiveTime);
up(&(pstrWFIDrv->hSemInactiveTime));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
@@ -3525,7 +3494,7 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetBeacon *p
strWID.s32ValueSize = pstrSetBeaconParam->u32HeadLen + pstrSetBeaconParam->u32TailLen + 16;
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
*pu8CurrByte++ = (pstrSetBeaconParam->u32Interval & 0xFF);
@@ -3561,14 +3530,10 @@ static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetBeacon *p
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
- PRINT_ER("Failed to send add beacon config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send add beacon config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
kfree(pstrSetBeaconParam->pu8Head);
kfree(pstrSetBeaconParam->pu8Tail);
@@ -3597,7 +3562,7 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelBeacon *p
strWID.ps8WidVal = &gu8DelBcn;
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ return;
pu8CurrByte = strWID.ps8WidVal;
@@ -3607,15 +3572,8 @@ static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelBeacon *p
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
- PRINT_ER("Failed to send delete beacon config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
-
- WILC_CATCH(s32Error)
- {
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send delete beacon config packet\n", __func__);
}
@@ -3696,7 +3654,7 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
@@ -3704,15 +3662,10 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS) {
-
- PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error != WILC_SUCCESS)
+ printk(KERN_ERR "%s : Failed to send add station config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(pstrStationParam->pu8Rates);
kfree(strWID.ps8WidVal);
}
@@ -3744,7 +3697,7 @@ static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelAllSta *p
strWID.ps8WidVal = kmalloc((pstrDelAllStaParam->u8Num_AssocSta * ETH_ALEN) + 1, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
@@ -3762,15 +3715,10 @@ static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelAllSta *p
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
- PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send add station config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
up(&hWaitResponse);
@@ -3801,7 +3749,7 @@ static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelSta *pst
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
@@ -3810,15 +3758,10 @@ static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelSta *pst
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
- PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send add station config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
}
@@ -3846,7 +3789,7 @@ static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam
PRINT_D(HOSTINF_DBG, "Handling edit station\n");
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
@@ -3854,15 +3797,10 @@ static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
- PRINT_ER("Failed to send edit station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send edit station config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(pstrStationParam->pu8Rates);
kfree(strWID.ps8WidVal);
}
@@ -3900,17 +3838,20 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnCh
if (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
PRINT_INFO(GENERIC_DBG, "Required to remain on chan while scanning return\n");
pstrWFIDrv->u8RemainOnChan_pendingreq = 1;
- WILC_ERRORREPORT(s32Error, WILC_BUSY);
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
if (pstrWFIDrv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) {
PRINT_INFO(GENERIC_DBG, "Required to remain on chan while connecting return\n");
- WILC_ERRORREPORT(s32Error, WILC_BUSY);
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
if (g_obtainingIP || connecting) {
PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
- WILC_ERRORREPORT(s32Error, WILC_BUSY);
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
#endif
@@ -3922,8 +3863,10 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnCh
strWID.s32ValueSize = 2;
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
- if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ if (strWID.ps8WidVal == NULL) {
+ s32Error = -ENOMEM;
+ goto ERRORHANDLER;
+ }
strWID.ps8WidVal[0] = u8remain_on_chan_flag;
strWID.ps8WidVal[1] = (s8)pstrHostIfRemainOnChan->u16Channel;
@@ -3934,7 +3877,7 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnCh
if (s32Error != WILC_SUCCESS)
PRINT_ER("Failed to set remain on channel\n");
- WILC_CATCH(-1)
+ERRORHANDLER:
{
P2P_LISTEN_STATE = 1;
pstrWFIDrv->hRemainOnChannel.data = (unsigned long)pstrWFIDrv;
@@ -3975,7 +3918,7 @@ static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler, tstrHostIfRegisterF
strWID.enuWIDtype = WID_STR;
strWID.ps8WidVal = kmalloc(sizeof(u16) + 2, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ return -ENOMEM;
pu8CurrByte = strWID.ps8WidVal;
@@ -3991,13 +3934,8 @@ static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler, tstrHostIfRegisterF
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to frame register config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
-
-
- WILC_CATCH(s32Error)
- {
+ printk(KERN_ERR "%s : Failed to frame register config packet\n", __func__);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -4088,11 +4026,7 @@ static void ListenTimerCB(unsigned long arg)
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s : wilc_mq_send fail\n", __func__);
}
#endif
@@ -4128,15 +4062,8 @@ static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler, tstrHostIfPowerM
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
- PRINT_ER("Failed to send power management config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
-
- WILC_CATCH(s32Error)
- {
-
- }
+ if (s32Error)
+ printk(KERN_ERR "%s :Failed to send power management config packet\n", __func__);
}
/**
@@ -4161,7 +4088,7 @@ static void Handle_SetMulticastFilter(tstrWILC_WFIDrv *drvHandler, tstrHostIFSet
strWID.s32ValueSize = sizeof(tstrHostIFSetMulti) + ((strHostIfSetMulti->u32count) * ETH_ALEN);
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
*pu8CurrByte++ = (strHostIfSetMulti->bIsEnabled & 0xFF);
@@ -4180,14 +4107,10 @@ static void Handle_SetMulticastFilter(tstrWILC_WFIDrv *drvHandler, tstrHostIFSet
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(drvHandler));
- if (s32Error) {
- PRINT_ER("Failed to send setup multicast config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
+ if (s32Error)
+ printk(KERN_ERR "%s :Failed to send setup multicast config packet\n", __func__);
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
}
@@ -4721,8 +4644,11 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx)
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Remove Wep Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -4744,10 +4670,6 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx)
PRINT_ER("Error in sending message queue : Request to remove WEP key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -4770,8 +4692,11 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -4792,11 +4717,6 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
PRINT_ER("Error in sending message queue : Default key index\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -4826,9 +4746,11 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -4859,10 +4781,6 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -4892,9 +4810,11 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
tstrHostIFmsg strHostIFmsg;
u8 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -4935,10 +4855,6 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -4968,8 +4884,11 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
u8 u8KeyLen = u8PtkKeylen;
u32 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
if (pu8RxMic != NULL)
u8KeyLen += RX_MIC_KEY_LEN;
if (pu8TxMic != NULL)
@@ -5037,11 +4956,6 @@ s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -5067,8 +4981,11 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
tstrHostIFmsg strHostIFmsg;
u8 u8KeyLen = u8GtkKeylen;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -5137,10 +5054,6 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -5172,8 +5085,11 @@ s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8Pm
u32 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -5197,11 +5113,6 @@ s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8Pm
if (s32Error)
PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -5330,14 +5241,8 @@ s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error) {
- PRINT_ER("Failed to send message queue: Set mac address\n");
- WILC_ERRORREPORT(s32Error, s32Error);
- }
- WILC_CATCH(s32Error)
- {
-
- }
+ if (s32Error)
+ printk(KERN_ERR "%s : Failed to send message queue: Set mac address\n", __func__);
return s32Error;
@@ -5427,13 +5332,8 @@ s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
/*get the value by searching the local copy*/
if (s32Error) {
- PRINT_ER("Failed to send config packet to get survey results\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
-
- WILC_CATCH(s32Error)
- {
-
+ printk(KERN_ERR "%s : Failed to send config packet to get survey results\n", __func__);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -5523,26 +5423,22 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
- if (pstrWFIDrv == NULL || pfConnectResult == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL || pfConnectResult == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
if (hWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: gWFiDrvHandle = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
if (pJoinParams == NULL) {
- PRINT_ER("Unable to Join - JoinParams is NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
-
+ printk(KERN_ERR "%s : Unable to Join - JoinParams is NULL\n", __func__);
+ return -EFAULT;
}
-/*
- * if(gWFiDrvHandle->strWILC_UsrScanReq.u32RcvdChCount == 0)
- * {
- * PRINT_ER("No scan results exist: Scanning should be done\n");
- * WILC_ERRORREPORT(s32Error, WILC_FAIL);
- * }
- */
+
/* prepare the Connect Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -5584,8 +5480,8 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
- PRINT_ER("Failed to send message queue: Set join request\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to send message queue: Set join request\n", __func__);
+ return -EFAULT;
}
enuScanConnTimer = CONNECT_TIMER;
@@ -5593,11 +5489,6 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
mod_timer(&pstrWFIDrv->hConnectTimer,
jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -5624,9 +5515,11 @@ s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv)
}
- if (hWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (hWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+ return s32Error;
+ }
strHostIFmsg.u16MsgId = HOST_IF_MSG_FLUSH_CONNECT;
strHostIFmsg.drvHandler = hWFIDrv;
@@ -5634,14 +5527,10 @@ s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv)
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
- PRINT_ER("Failed to send message queue: Flush join request\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Failed to send message queue: Flush join request\n", __func__);
+ return -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -5663,13 +5552,8 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
- }
-
- if (pstrWFIDrv == NULL) {
- PRINT_ER("gWFiDrvHandle = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
/* prepare the Disconnect Message */
@@ -5686,11 +5570,6 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
down(&(pstrWFIDrv->hSemTestDisconnectBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
@@ -5780,8 +5659,8 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
strWID.u16WIDid = (u16)WID_ASSOC_RES_INFO;
@@ -5794,17 +5673,13 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
s32Error = SendConfigPkt(GET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Failed to send association response config packet\n");
*pu32RcvdAssocRespInfoLen = 0;
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Failed to send association response config packet\n", __func__);
+ return -EINVAL;
} else {
*pu32RcvdAssocRespInfoLen = strWID.s32ValueSize;
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -5860,8 +5735,10 @@ s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
/* prepare the set channel message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -5870,11 +5747,9 @@ s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum)
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ printk(KERN_ERR "%s :\n", __func__);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -5892,11 +5767,9 @@ s32 host_int_wait_msg_queue_idle(void)
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
strHostIFmsg.u16MsgId = HOST_IF_MSG_Q_IDLE;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
+ s32Error = -EINVAL;
}
/* wait untill MSG Q is empty */
@@ -5921,11 +5794,9 @@ s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address)
strHostIFmsg.drvHandler = u32address;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -5948,11 +5819,9 @@ s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode)
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
+ s32Error = -EINVAL;
}
return s32Error;
@@ -5980,8 +5849,8 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
tstrHostIFmsg strHostIFmsg;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
/* prepare the Get Channel Message */
@@ -5999,10 +5868,6 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
*pu8ChNo = gu8Chnl;
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
@@ -6027,8 +5892,8 @@ s32 host_int_test_set_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 u32TestMemAddr)
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
/*prepare configuration packet*/
@@ -6041,17 +5906,13 @@ s32 host_int_test_set_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 u32TestMemAddr)
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
- PRINT_ER("Test Function: Failed to set wid value\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Test Function: Failed to set wid value\n", __func__);
+ return -EINVAL;
} else {
PRINT_D(HOSTINF_DBG, "Successfully set wid value\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -6074,8 +5935,8 @@ s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu3
tstrHostIFmsg strHostIFmsg;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -6096,10 +5957,6 @@ s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu3
*pu32InactiveTime = gu32InactiveTime;
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
}
#endif
@@ -6122,8 +5979,8 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
strWID.u16WIDid = (u16)WID_MEMORY_ADDRESS;
@@ -6135,17 +5992,13 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
get_id_from_handler(pstrWFIDrv));
/*get the value by searching the local copy*/
if (s32Error) {
- PRINT_ER("Test Function: Failed to get wid value\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
+ printk(KERN_ERR "%s : Test Function: Failed to get wid value\n", __func__);
+ return -EINVAL;
} else {
PRINT_D(HOSTINF_DBG, "Successfully got wid value\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -6286,9 +6139,10 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
- if (pstrWFIDrv == NULL || ScanResult == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL || ScanResult == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv or ScanResult = NULL\n", __func__);
+ return -EFAULT;
+ }
/* prepare the Scan Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -6321,8 +6175,8 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
- PRINT_ER("Error in sending message queue scanning parameters: Error(%d)\n", s32Error);
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : Error in sending message queue scanning parameters: Error(%d)\n", __func__, s32Error);
+ return -EINVAL;
}
enuScanConnTimer = SCAN_TIMER;
@@ -6331,10 +6185,6 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
mod_timer(&pstrWFIDrv->hScanTimer,
jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
@@ -6358,8 +6208,10 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
/* prepare the WiphyParams Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
strHostIFmsg.u16MsgId = HOST_IF_MSG_CFG_PARAMS;
@@ -6368,10 +6220,6 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
}
@@ -6398,8 +6246,8 @@ s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
down(&(pstrWFIDrv->gtOsCfgValuesSem));
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
}
PRINT_D(HOSTINF_DBG, "Getting configuration parameters\n");
switch (u16WID) {
@@ -6482,9 +6330,6 @@ s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
up(&(pstrWFIDrv->gtOsCfgValuesSem));
- WILC_CATCH(s32Error)
- {
- }
return s32Error;
}
@@ -6596,7 +6441,6 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
/*Allocate host interface private structure*/
pstrWFIDrv = kmalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
if (pstrWFIDrv == NULL) {
- /* WILC_ERRORREPORT(s32Error,WILC_NO_MEM); */
s32Error = WILC_NO_MEM;
PRINT_ER("Failed to allocate memory\n");
goto _fail_timer_2;
@@ -7033,8 +6877,10 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
/* prepare the remainonchan Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7051,11 +6897,7 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
return s32Error;
}
@@ -7080,8 +6922,10 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
/*Stopping remain-on-channel timer*/
del_timer(&pstrWFIDrv->hRemainOnChannel);
@@ -7094,11 +6938,8 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
- }
return s32Error;
}
@@ -7116,8 +6957,10 @@ s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bRe
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7144,11 +6987,7 @@ s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bRe
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
return s32Error;
@@ -7178,8 +7017,10 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
tstrHostIFmsg strHostIFmsg;
tstrHostIFSetBeacon *pstrSetBeaconParam = &strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7193,16 +7034,20 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
pstrSetBeaconParam->u32DTIMPeriod = u32DTIMPeriod;
pstrSetBeaconParam->u32HeadLen = u32HeadLen;
pstrSetBeaconParam->pu8Head = kmalloc(u32HeadLen, GFP_KERNEL);
- if (pstrSetBeaconParam->pu8Head == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ if (pstrSetBeaconParam->pu8Head == NULL) {
+ s32Error = -ENOMEM;
+ goto ERRORHANDLER;
+ }
memcpy(pstrSetBeaconParam->pu8Head, pu8Head, u32HeadLen);
pstrSetBeaconParam->u32TailLen = u32TailLen;
/* Bug 4599 : if tail length = 0 skip allocating & copying */
if (u32TailLen > 0) {
pstrSetBeaconParam->pu8Tail = kmalloc(u32TailLen, GFP_KERNEL);
- if (pstrSetBeaconParam->pu8Tail == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ if (pstrSetBeaconParam->pu8Tail == NULL) {
+ s32Error = -ENOMEM;
+ goto ERRORHANDLER;
+ }
memcpy(pstrSetBeaconParam->pu8Tail, pu8Tail, u32TailLen);
} else {
pstrSetBeaconParam->pu8Tail = NULL;
@@ -7210,9 +7055,10 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
+ printk(KERN_ERR "%s : %d\n", __func__, s32Error);
- WILC_CATCH(s32Error)
+ERRORHANDLER:
+ if (s32Error)
{
if (pstrSetBeaconParam->pu8Head != NULL)
kfree(pstrSetBeaconParam->pu8Head);
@@ -7241,8 +7087,10 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
/* prepare the WiphyParams Message */
strHostIFmsg.u16MsgId = HOST_IF_MSG_DEL_BEACON;
@@ -7253,9 +7101,6 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
if (s32Error)
printk(KERN_ERR "%s: %d\n", __func__, s32Error);
- WILC_CATCH(s32Error)
- {
- }
return s32Error;
}
@@ -7277,8 +7122,10 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSta
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7303,11 +7150,7 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSta
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
}
@@ -7327,8 +7170,10 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
tstrHostIFmsg strHostIFmsg;
tstrHostIFDelSta *pstrDelStationMsg = &strHostIFmsg.uniHostIFmsgBody.strDelStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7348,11 +7193,7 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
}
/**
@@ -7375,8 +7216,10 @@ s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
u8 u8AssocNumb = 0;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7405,12 +7248,8 @@ s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
- }
down(&hWaitResponse);
return s32Error;
@@ -7433,8 +7272,10 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSt
tstrHostIFmsg strHostIFmsg;
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting editing station message queue params\n");
@@ -7458,10 +7299,8 @@ s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSt
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
+
return s32Error;
}
#endif /*WILC_AP_EXTERNAL_MLME*/
@@ -7476,8 +7315,10 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", bIsEnabled);
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting Power management message queue params\n");
@@ -7494,10 +7335,7 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
}
@@ -7510,8 +7348,10 @@ s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u
tstrHostIFSetMulti *pstrMulticastFilterParam = &strHostIFmsg.uniHostIFmsgBody.strHostIfSetMulti;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting Multicast Filter params\n");
@@ -7527,10 +7367,7 @@ s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
}
@@ -7779,8 +7616,10 @@ static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TI
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7795,11 +7634,7 @@ static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TI
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
}
@@ -7812,8 +7647,10 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7826,11 +7663,7 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
/*BugID_5222*/
down(&hWaitResponse);
@@ -7845,8 +7678,10 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7859,11 +7694,7 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
/*BugID_5222*/
down(&hWaitResponse);
@@ -7888,8 +7719,10 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
/* TODO: Enable This feature on softap firmware */
return 0;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7902,11 +7735,7 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
@@ -7927,8 +7756,10 @@ s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ printk(KERN_ERR "%s: pstrWFIDrv = NULL\n", __func__);
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7941,11 +7772,7 @@ s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ printk(KERN_ERR "%s: %d\n", __func__, s32Error);
return s32Error;
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h
index 769cef0..99ded3d 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -38,11 +38,6 @@
-#define WILC_ERRORREPORT(__status__, __err__) do { \
- PRINT_ER("PRINT_ER(%d)\n", __err__); \
- __status__ = __err__; \
- goto ERRORHANDLER; \
-} while (0)
#define WILC_CATCH(__status__) \
ERRORHANDLER: \
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index 2f77e71..7543149 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -59,11 +59,15 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
Message *pstrMessage = NULL;
if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
- WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s: \n", __func__);
+ s32RetStatus = -EFAULT;
+ goto ERRORHANDLER;
}
if (pHandle->bExiting) {
- WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
+ printk(KERN_ERR "%s: \n", __func__);
+ s32RetStatus = -EFAULT;
+ goto ERRORHANDLER;
}
spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -97,13 +101,11 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
up(&pHandle->hSem);
- WILC_CATCH(s32RetStatus)
- {
- /* error occured, free any allocations */
- if (pstrMessage) {
- kfree(pstrMessage->pvBuffer);
- kfree(pstrMessage);
- }
+ERRORHANDLER:
+ /* error occured, free any allocations */
+ if (pstrMessage) {
+ kfree(pstrMessage->pvBuffer);
+ kfree(pstrMessage);
}
return s32RetStatus;
@@ -125,11 +127,13 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
if ((!pHandle) || (u32RecvBufferSize == 0)
|| (!pvRecvBuffer) || (!pu32ReceivedLength)) {
- WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EINVAL;
}
if (pHandle->bExiting) {
- WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EFAULT;
}
spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -138,52 +142,44 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
down(&pHandle->hSem);
- if (s32RetStatus == WILC_TIMEOUT) {
- /* timed out, just exit without consumeing the message */
- spin_lock_irqsave(&pHandle->strCriticalSection, flags);
- pHandle->u32ReceiversCount--;
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- } else {
- /* other non-timeout scenarios */
- if (s32RetStatus) {
- printk(KERN_ERR "%s: %d\n", __func__, s32RetStatus);
- return s32RetStatus;
- }
-
- if (pHandle->bExiting) {
- WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
- }
-
- spin_lock_irqsave(&pHandle->strCriticalSection, flags);
-
- pstrMessage = pHandle->pstrMessageList;
- if (!pstrMessage) {
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
- }
- /* check buffer size */
- if (u32RecvBufferSize < pstrMessage->u32Length) {
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- up(&pHandle->hSem);
- WILC_ERRORREPORT(s32RetStatus, WILC_BUFFER_OVERFLOW);
- }
-
- /* consume the message */
- pHandle->u32ReceiversCount--;
- memcpy(pvRecvBuffer, pstrMessage->pvBuffer, pstrMessage->u32Length);
- *pu32ReceivedLength = pstrMessage->u32Length;
+ /* other non-timeout scenarios */
+ if (s32RetStatus) {
+ printk(KERN_ERR "%s: WILC_MsgQueueHandle is fail\n", __func__);
+ return s32RetStatus;
+ }
- pHandle->pstrMessageList = pstrMessage->pstrNext;
+ if (pHandle->bExiting) {
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EFAULT;
+ }
- kfree(pstrMessage->pvBuffer);
- kfree(pstrMessage);
+ spin_lock_irqsave(&pHandle->strCriticalSection, flags);
+ pstrMessage = pHandle->pstrMessageList;
+ if (!pstrMessage) {
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EFAULT;
}
-
- WILC_CATCH(s32RetStatus)
- {
+ /* check buffer size */
+ if (u32RecvBufferSize < pstrMessage->u32Length) {
+ spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ up(&pHandle->hSem);
+ printk(KERN_ERR "%s : \n", __func__);
+ return -EOVERFLOW;
}
+ /* consume the message */
+ pHandle->u32ReceiversCount--;
+ memcpy(pvRecvBuffer, pstrMessage->pvBuffer, pstrMessage->u32Length);
+ *pu32ReceivedLength = pstrMessage->u32Length;
+
+ pHandle->pstrMessageList = pstrMessage->pstrNext;
+
+ kfree(pstrMessage->pvBuffer);
+ kfree(pstrMessage);
+
+ spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+
return s32RetStatus;
}
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 7083c77..f7d3392 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -375,7 +375,6 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
struct wiphy *wiphy;
s32 s32Freq;
struct ieee80211_channel *channel;
- s32 s32Error = WILC_SUCCESS;
struct cfg80211_bss *bss = NULL;
priv = (struct WILC_WFI_priv *)pUserVoid;
@@ -392,7 +391,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
||
(((s32)pstrNetworkInfo->s8rssi) * 100) > 100)
) {
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ printk(KERN_ERR "%s : \n", __func__);
+ return;
}
if (pstrNetworkInfo != NULL) {
@@ -486,11 +486,6 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
up(&(priv->hSemScanReq));
}
}
-
-
- WILC_CATCH(s32Error)
- {
- }
}
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/7] staging: wilc1000: replace wilc error types with kernel generic error type.
2015-09-15 2:53 [PATCH 0/7] remove wilc_errorsupport.h from the wilc driver Tony Cho
` (4 preceding siblings ...)
2015-09-15 2:53 ` [PATCH 5/7] staging: wilc1000: remove definitions unused Tony Cho
@ 2015-09-15 2:53 ` Tony Cho
2015-09-15 2:53 ` [PATCH 7/7] staging: wilc1000: remove wilc_errorsupport Tony Cho
2015-09-15 6:27 ` [PATCH 0/7] remove wilc_errorsupport.h from the wilc driver Sudip Mukherjee
7 siblings, 0 replies; 11+ messages in thread
From: Tony Cho @ 2015-09-15 2:53 UTC (permalink / raw)
To: gregkh
Cc: devel, linux-wireless, johnny.kim, chris.park, rachel.kim,
tony.cho, glen.lee, leo.kim, austin.shin, adel.noureldin,
adham.abozaeid, Nicolas.FERRE
From: Leo Kim <leo.kim@atmel.com>
This patch replaces the wilc error types with kernel generic error type.
- WILC_SUCCESS 0
- WILC_FAIL -EFAULT
- WILC_BUSY -EBUSY
- WILC_INVALID_ARGUMENT -EINVAL
- WILC_INVALID_STATE -EINVAL
- WILC_BUFFER_OVERFLOW -EOVERFLOW
- WILC_NULL_PTR -EFAULT
- WILC_TIMEOUT -ETIMEDOUT
- WILC_NOT_FOUND -ENOENT
- WILC_NO_MEM -ENOMEM
After then removes all wilc error types.
Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 24 +--
drivers/staging/wilc1000/host_interface.c | 238 +++++++++++-----------
drivers/staging/wilc1000/linux_mon.c | 14 +-
drivers/staging/wilc1000/linux_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_errorsupport.h | 14 --
drivers/staging/wilc1000/wilc_msgqueue.c | 8 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 76 +++----
7 files changed, 181 insertions(+), 195 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 8389565..ccb5957 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -340,7 +340,7 @@ INLINE u16 get_asoc_id(u8 *data)
s32 CoreConfiguratorInit(void)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");
@@ -415,7 +415,7 @@ u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
*/
s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrNetworkInfo *pstrNetworkInfo = NULL;
u8 u8MsgType = 0;
u8 u8MsgID = 0;
@@ -541,21 +541,21 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
*/
s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
if (pstrNetworkInfo != NULL) {
if (pstrNetworkInfo->pu8IEs != NULL) {
kfree(pstrNetworkInfo->pu8IEs);
pstrNetworkInfo->pu8IEs = NULL;
} else {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
}
kfree(pstrNetworkInfo);
pstrNetworkInfo = NULL;
} else {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
}
return s32Error;
@@ -575,7 +575,7 @@ s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
tstrConnectRespInfo **ppstrConnectRespInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrConnectRespInfo *pstrConnectRespInfo = NULL;
u16 u16AssocRespLen = 0;
u8 *pu8IEs = 0;
@@ -632,21 +632,21 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
*/
s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
if (pstrConnectRespInfo != NULL) {
if (pstrConnectRespInfo->pu8RespIEs != NULL) {
kfree(pstrConnectRespInfo->pu8RespIEs);
pstrConnectRespInfo->pu8RespIEs = NULL;
} else {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
}
kfree(pstrConnectRespInfo);
pstrConnectRespInfo = NULL;
} else {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
}
return s32Error;
@@ -657,7 +657,7 @@ s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ
wid_site_survey_reslts_s **ppstrSurveyResults,
u32 *pu32SurveyResultsCount)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
wid_site_survey_reslts_s *pstrSurveyResults = NULL;
u32 u32SurveyResultsCount = 0;
u32 u32SurveyBytesLength = 0;
@@ -712,7 +712,7 @@ ERRORHANDLER:
s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
if (pstrSurveyResults != NULL) {
kfree(pstrSurveyResults);
@@ -734,7 +734,7 @@ s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)
s32 CoreConfiguratorDeInit(void)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
PRINT_D(CORECONFIG_DBG, "CoreConfiguratorDeInit()\n");
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 86d1828..a92610a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -655,7 +655,7 @@ static tstrWILC_WFIDrv *get_handler_from_id(int id)
static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetChan *pstrHostIFSetChan)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -689,7 +689,7 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv *drvHandler,
tstrHostIfSetDrvHandler *pstrHostIfSetDrvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = drvHandler;
@@ -729,7 +729,7 @@ static s32 Handle_SetWfiDrvHandler(tstrWILC_WFIDrv *drvHandler,
static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetOperationMode *pstrHostIfSetOperationMode)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -771,7 +771,7 @@ static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetOpe
s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
char firmwareIPAddress[4] = {0};
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -818,7 +818,7 @@ s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -841,7 +841,7 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
if (memcmp(gs8GetIP[idx], gs8SetIP[idx], IP_ALEN) != 0)
host_int_setup_ipaddress(pstrWFIDrv, gs8SetIP[idx], idx);
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error != 0) {
printk(KERN_ERR "%s : Failed to get IP address\n", __func__);
return -EINVAL;
} else {
@@ -867,14 +867,14 @@ s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetMacAddress *pstrHostIfSetMacAddress)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
if (mac_buf == NULL) {
PRINT_ER("No buffer to send mac address\n");
- return WILC_FAIL;
+ return -EFAULT;
}
memcpy(mac_buf, pstrHostIfSetMacAddress->u8MacAddress, ETH_ALEN);
@@ -910,7 +910,7 @@ static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetMacAdd
static s32 Handle_GetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfGetMacAddress *pstrHostIfGetMacAddress)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/*prepare configuration packet*/
@@ -943,7 +943,7 @@ static s32 Handle_GetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfGetMacAdd
*/
static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *strHostIFCfgParamAttr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWIDList[32];
u8 u8WidCnt = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -1284,7 +1284,7 @@ ERRORHANDLER :
*/
static s32 Handle_wait_msg_q_empty(void)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
g_wilc_initialized = 0;
up(&hWaitResponse);
@@ -1302,7 +1302,7 @@ static s32 Handle_wait_msg_q_empty(void)
*/
static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWIDList[5];
u32 u32WidsCount = 0;
u32 i;
@@ -1475,7 +1475,7 @@ ERRORHANDLER:
*/
static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -1534,12 +1534,12 @@ u8 u8ConnectedSSID[6] = {0};
static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *pstrHostIFconnectAttr)
{
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWIDList[8];
u32 u32WidsCount = 0, dummyval = 0;
/* char passphrase[] = "12345678"; */
#ifndef CONNECT_DIRECT
- s32 s32Err = WILC_SUCCESS;
+ s32 s32Err = 0;
u32 i;
u8 u8bssDscListIndex;
wid_site_survey_reslts_s *pstrSurveyResults = NULL;
@@ -1571,7 +1571,7 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
&pstrWFIDrv->u32SurveyResultsCount);
- if (s32Err == WILC_SUCCESS) {
+ if (s32Err == 0) {
/* use the parsed info in pstrSurveyResults, then deallocate it */
PRINT_D(HOSTINF_DBG, "Copying site survey results in global structure, then deallocate\n");
for (i = 0; i < pstrWFIDrv->u32SurveyResultsCount; i++) {
@@ -1714,7 +1714,7 @@ static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *ps
if (memcmp(pstrHostIFconnectAttr->pu8bssid, u8ConnectedSSID, ETH_ALEN) == 0) {
- s32Error = WILC_SUCCESS;
+ s32Error = 0;
PRINT_ER("Trying to connect to an already connected AP, Discard connect request\n");
return s32Error;
}
@@ -2113,7 +2113,7 @@ ERRORHANDLER:
static s32 Handle_FlushConnect(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWIDList[5];
u32 u32WidsCount = 0;
u8 *pu8CurrByte = NULL;
@@ -2176,7 +2176,7 @@ static s32 Handle_FlushConnect(tstrWILC_WFIDrv *drvHandler)
*/
static s32 Handle_ConnectTimeout(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrConnectInfo strConnectInfo;
tstrWID strWID;
u16 u16DummyReasonCode = 0;
@@ -2290,7 +2290,7 @@ static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdNetworkInfo
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrNetworkInfo *pstrNetworkInfo = NULL;
void *pJoinParams = NULL;
@@ -2405,7 +2405,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
{
/* TODO: mostafa: till now, this function just handles only the received mac status msg, */
/* which carries only 1 WID which have WID ID = WID_STATUS */
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u8 u8MsgType = 0;
u8 u8MsgID = 0;
u16 u16MsgLen = 0;
@@ -2416,7 +2416,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
u8 u8MacStatusAdditionalInfo;
tstrConnectInfo strConnectInfo;
tstrDisconnectNotifInfo strDisconnectNotifInfo;
- s32 s32Err = WILC_SUCCESS;
+ s32 s32Err = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
if (pstrWFIDrv == NULL)
@@ -2730,7 +2730,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsy
*/
static int Handle_Key(tstrWILC_WFIDrv *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
#ifdef WILC_AP_EXTERNAL_MLME
tstrWID strWIDList[5];
@@ -3103,7 +3103,7 @@ static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
{
tstrWID strWID;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u16 u16DummyReasonCode = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3223,7 +3223,7 @@ static s32 Switch_Log_Terminal(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
static char dummy = 9;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3261,7 +3261,7 @@ static s32 Switch_Log_Terminal(tstrWILC_WFIDrv *drvHandler)
static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3301,7 +3301,7 @@ static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
*/
static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3328,7 +3328,7 @@ static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3417,7 +3417,7 @@ s32 Handle_GetStatistics(tstrWILC_WFIDrv *drvHandler, tstrStatistics *pstrStatis
static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, tstrHostIfStaInactiveT *strHostIfStaInactiveT)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u8 *stamac;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3482,7 +3482,7 @@ static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, tstrHostIfStaIna
*/
static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetBeacon *pstrSetBeaconParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3551,7 +3551,7 @@ ERRORHANDLER:
*/
static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelBeacon *pstrDelBeacon)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3642,7 +3642,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer, tstrWILC_AddStaParam *pstrSta
*/
static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3662,7 +3662,7 @@ static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
printk(KERN_ERR "%s : Failed to send add station config packet\n", __func__);
ERRORHANDLER:
@@ -3681,7 +3681,7 @@ ERRORHANDLER:
*/
static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelAllSta *pstrDelAllStaParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
@@ -3736,7 +3736,7 @@ ERRORHANDLER:
*/
static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelSta *pstrDelStaParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3777,7 +3777,7 @@ ERRORHANDLER:
*/
static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3818,7 +3818,7 @@ ERRORHANDLER:
*/
static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnChan *pstrHostIfRemainOnChan)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u8 u8remain_on_chan_flag;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
@@ -3874,7 +3874,7 @@ static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnCh
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
PRINT_ER("Failed to set remain on channel\n");
ERRORHANDLER:
@@ -3906,7 +3906,7 @@ ERRORHANDLER:
*/
static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler, tstrHostIfRegisterFrame *pstrHostIfRegisterFrame)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -3956,7 +3956,7 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler, tstrHostIfRema
{
u8 u8remain_on_chan_flag;
tstrWID strWID;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
@@ -3980,7 +3980,7 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler, tstrHostIfRema
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error != 0) {
PRINT_ER("Failed to set remain on channel\n");
goto _done_;
}
@@ -3992,7 +3992,7 @@ static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler, tstrHostIfRema
P2P_LISTEN_STATE = 0;
} else {
PRINT_D(GENERIC_DBG, "Not in listen state\n");
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
}
_done_:
@@ -4011,7 +4011,7 @@ _done_:
*/
static void ListenTimerCB(unsigned long arg)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg;
/*Stopping remain-on-channel timer*/
@@ -4042,7 +4042,7 @@ static void ListenTimerCB(unsigned long arg)
*/
static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler, tstrHostIfPowerMgmtParam *strPowerMgmtParam)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
s8 s8PowerMode;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -4077,7 +4077,7 @@ static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler, tstrHostIfPowerM
*/
static void Handle_SetMulticastFilter(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetMulti *strHostIfSetMulti)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
u8 *pu8CurrByte;
@@ -4128,7 +4128,7 @@ ERRORHANDLER:
*/
static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
int AddbaTimeout = 100;
char *ptr = NULL;
@@ -4218,7 +4218,7 @@ static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionI
*/
static s32 Handle_DelBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
char *ptr = NULL;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -4290,7 +4290,7 @@ static s32 Handle_DelBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionI
*/
static s32 Handle_DelAllRxBASessions(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
char *ptr = NULL;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
@@ -4610,7 +4610,7 @@ static void TimerCB_Connect(unsigned long arg)
/* Check implementation in core adding 9 bytes to the input! */
s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -4639,7 +4639,7 @@ s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress)
*/
s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -4687,7 +4687,7 @@ s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx)
*/
s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -4742,7 +4742,7 @@ s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -4805,7 +4805,7 @@ s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey,
s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
u8 i;
@@ -4878,7 +4878,7 @@ s32 host_int_add_wep_key_bss_ap(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u
s32 host_int_add_ptk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
const u8 *mac_addr, const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode, u8 u8Idx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
u8 u8KeyLen = u8PtkKeylen;
@@ -4976,7 +4976,7 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
u8 u8KeyLen = u8GtkKeylen;
@@ -5079,7 +5079,7 @@ s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKe
*/
s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
u32 i;
@@ -5140,7 +5140,7 @@ s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8Pm
s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
u32 u32PmkidInfoLen)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5169,7 +5169,7 @@ s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
u8 u8Psklength)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/*validating psk length*/
@@ -5195,7 +5195,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPh
*/
s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
@@ -5209,7 +5209,7 @@ s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
PRINT_ER("Failed to send get mac address\n");
- return WILC_FAIL;
+ return -EFAULT;
}
down(&hWaitResponse);
@@ -5229,7 +5229,7 @@ s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
*/
s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
PRINT_D(GENERIC_DBG, "mac addr = %x:%x:%x\n", pu8MacAddress[0], pu8MacAddress[1], pu8MacAddress[2]);
@@ -5265,7 +5265,7 @@ s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
u8 *pu8PassPhrase, u8 u8Psklength)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5313,7 +5313,7 @@ s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
u32 u32MaxSiteSrvyFragLen)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID astrWIDList[2];
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5357,7 +5357,7 @@ s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
*/
s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5387,7 +5387,7 @@ s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource)
s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5418,7 +5418,7 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
u8 u8channel,
void *pJoinParams)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
@@ -5506,11 +5506,11 @@ s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
if (!gu8FlushedJoinReq) {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
return s32Error;
}
@@ -5547,7 +5547,7 @@ s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv)
*/
s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5586,7 +5586,7 @@ s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
*/
s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5627,7 +5627,7 @@ s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id)
s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
u32 u32AssocReqInfoLen)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5654,7 +5654,7 @@ s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5701,7 +5701,7 @@ s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
u32 u32RxPowerLevelLen)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
/* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
@@ -5731,7 +5731,7 @@ s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
*/
s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -5758,7 +5758,7 @@ s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum)
s32 host_int_wait_msg_queue_idle(void)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
@@ -5781,7 +5781,7 @@ s32 host_int_wait_msg_queue_idle(void)
s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
@@ -5806,7 +5806,7 @@ s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address)
s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
@@ -5844,7 +5844,7 @@ s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode)
*/
s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -5886,7 +5886,7 @@ s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
*/
s32 host_int_test_set_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 u32TestMemAddr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5930,7 +5930,7 @@ s32 host_int_test_set_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 u32TestMemAddr)
*/
s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -5973,7 +5973,7 @@ s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu3
s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWID strWID;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6018,7 +6018,7 @@ s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
*/
s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6033,7 +6033,7 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
PRINT_ER("Failed to send get host channel param's message queue ");
- return WILC_FAIL;
+ return -EFAULT;
}
down(&(pstrWFIDrv->hSemGetRSSI));
@@ -6041,7 +6041,7 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
if (ps8Rssi == NULL) {
PRINT_ER("RSS pointer value is null");
- return WILC_FAIL;
+ return -EFAULT;
}
@@ -6054,7 +6054,7 @@ s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
{
tstrHostIFmsg strHostIFmsg;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6070,7 +6070,7 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
PRINT_ER("Failed to send GET_LINKSPEED to message queue ");
- return WILC_FAIL;
+ return -EFAULT;
}
down(&(pstrWFIDrv->hSemGetLINKSPEED));
@@ -6078,7 +6078,7 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
if (ps8lnkspd == NULL) {
PRINT_ER("LINKSPEED pointer value is null");
- return WILC_FAIL;
+ return -EFAULT;
}
@@ -6090,7 +6090,7 @@ s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
@@ -6104,7 +6104,7 @@ s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatis
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error) {
PRINT_ER("Failed to send get host channel param's message queue ");
- return WILC_FAIL;
+ return -EFAULT;
}
down(&hWaitResponse);
@@ -6134,7 +6134,7 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
size_t IEsLen, tWILCpfScanResult ScanResult,
void *pvUserArg, tstrHiddenNetwork *pstrHiddenNetwork)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
@@ -6202,7 +6202,7 @@ s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -6240,7 +6240,7 @@ s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
*/
s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
down(&(pstrWFIDrv->gtOsCfgValuesSem));
@@ -6380,7 +6380,7 @@ static void GetPeriodicRSSI(unsigned long arg)
}
if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED) {
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
/* prepare the Get RSSI Message */
@@ -6420,7 +6420,7 @@ static u32 clients_count;
s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv;
int err;
@@ -6441,7 +6441,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
/*Allocate host interface private structure*/
pstrWFIDrv = kmalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
if (pstrWFIDrv == NULL) {
- s32Error = WILC_NO_MEM;
+ s32Error = -ENOMEM;
PRINT_ER("Failed to allocate memory\n");
goto _fail_timer_2;
}
@@ -6451,7 +6451,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
/*save into globl handle*/
err = add_handler_in_list(pstrWFIDrv);
if (err) {
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
goto _fail_timer_2;
}
@@ -6493,7 +6493,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
HostIFthreadHandler = kthread_run(hostIFthread, NULL, "WILC_kthread");
if (IS_ERR(HostIFthreadHandler)) {
PRINT_ER("Failed to creat Thread\n");
- s32Error = WILC_FAIL;
+ s32Error = -EFAULT;
goto _fail_mq_;
}
setup_timer(&g_hPeriodicRSSI, GetPeriodicRSSI,
@@ -6585,7 +6585,7 @@ _fail_:
s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
int ret;
@@ -6663,7 +6663,7 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
down(&hSemHostIFthrdEnd);
@@ -6679,7 +6679,7 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
/* gWFiDrvHandle = NULL; */
ret = remove_handler_in_list(pstrWFIDrv);
if (ret)
- s32Error = WILC_NOT_FOUND;
+ s32Error = -ENOENT;
if (pstrWFIDrv != NULL) {
kfree(pstrWFIDrv);
@@ -6707,7 +6707,7 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
*/
void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
int id;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;
@@ -6753,7 +6753,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
*/
void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
int id;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;
@@ -6814,7 +6814,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
*/
void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrHostIFmsg strHostIFmsg;
int id;
tstrWILC_WFIDrv *pstrWFIDrv = NULL;
@@ -6873,7 +6873,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
*/
s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -6918,7 +6918,7 @@ s32 host_int_remain_on_channel(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID, u32 u
*/
s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -6953,7 +6953,7 @@ s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
* @version 1.0*/
s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -7012,7 +7012,7 @@ s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
u32 u32HeadLen, u8 *pu8Head,
u32 u32TailLen, u8 *pu8Tail)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIFSetBeacon *pstrSetBeaconParam = &strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon;
@@ -7083,7 +7083,7 @@ ERRORHANDLER:
*/
s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -7116,7 +7116,7 @@ s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
*/
s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
@@ -7165,7 +7165,7 @@ s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrSta
*/
s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIFDelSta *pstrDelStationMsg = &strHostIFmsg.uniHostIFmsgBody.strDelStaParam;
@@ -7207,7 +7207,7 @@ s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
*/
s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIFDelAllSta *pstrDelAllStationMsg = &strHostIFmsg.uniHostIFmsgBody.strHostIFDelAllSta;
@@ -7267,7 +7267,7 @@ s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
*/
s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
@@ -7308,7 +7308,7 @@ uint32_t wilc_get_chipid(uint8_t);
s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIfPowerMgmtParam *pstrPowerMgmtParam = &strHostIFmsg.uniHostIFmsgBody.strPowerMgmtparam;
@@ -7341,7 +7341,7 @@ s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Ti
s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -7611,7 +7611,7 @@ void host_int_freeJoinParams(void *pJoinParams)
static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
short int SessionTimeout, void *drvHandler)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
@@ -7642,7 +7642,7 @@ static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TI
s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
@@ -7673,7 +7673,7 @@ s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
@@ -7712,7 +7712,7 @@ s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char T
* @version 1.0*/
s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
@@ -7752,7 +7752,7 @@ s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
* @version 1.0*/
s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index d873877..a15d76d 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -227,21 +227,21 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
if (dev == NULL) {
PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n");
- return WILC_FAIL;
+ return -EFAULT;
}
netif_stop_queue(dev);
mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC);
if (mgmt_tx == NULL) {
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
- return WILC_FAIL;
+ return -EFAULT;
}
mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
if (mgmt_tx->buff == NULL) {
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx);
- return WILC_FAIL;
+ return -EFAULT;
}
@@ -274,7 +274,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
/* Bug 4601 */
if (wilc_wfi_mon == NULL)
- return WILC_FAIL;
+ return -EFAULT;
/* if(skb->data[3] == 0x10 || skb->data[3] == 0xb0) */
@@ -282,7 +282,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
if (mon_priv == NULL) {
PRINT_ER("Monitor interface private structure is NULL\n");
- return WILC_FAIL;
+ return -EFAULT;
}
@@ -409,7 +409,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
{
- u32 ret = WILC_SUCCESS;
+ u32 ret = 0;
struct WILC_WFI_mon_priv *priv;
/*If monitor interface is already initialized, return it*/
@@ -475,7 +475,7 @@ int WILC_WFI_deinit_mon_interface(void)
}
wilc_wfi_mon = NULL;
}
- return WILC_SUCCESS;
+ return 0;
}
#endif /* WILC_AP_EXTERNAL_MLME */
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 9be0282..e8ae560 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1902,7 +1902,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
u32 size = 0, length = 0;
perInterface_wlan_t *nic;
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
/* struct iwreq *wrq = (struct iwreq *) req; // tony moved to case SIOCSIWPRIV */
nic = netdev_priv(ndev);
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h
index 054ed76..b0babbd 100644
--- a/drivers/staging/wilc1000/wilc_errorsupport.h
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -12,18 +12,4 @@
#include "linux_wlan_common.h"
-/* Generic success will return 0 */
-#define WILC_SUCCESS 0 /** Generic success */
-
-/* Negative numbers to indicate failures */
-#define WILC_FAIL -100 /** Generic Fail */
-#define WILC_BUSY -101 /** Busy with another operation*/
-#define WILC_INVALID_ARGUMENT -102 /** A given argument is invalid*/
-#define WILC_INVALID_STATE -103 /** An API request would violate the Driver state machine (i.e. to start PID while not camped)*/
-#define WILC_BUFFER_OVERFLOW -104 /** In copy operations if the copied data is larger than the allocated buffer*/
-#define WILC_NULL_PTR -105 /** null pointer is passed or used */
-#define WILC_TIMEOUT -109
-#define WILC_NOT_FOUND -113 /** Cant find the file to load */
-#define WILC_NO_MEM -114
-
#endif
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index 7543149..e4338a5 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -16,7 +16,7 @@ int wilc_mq_create(WILC_MsgQueueHandle *pHandle)
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
pHandle->bExiting = false;
- return WILC_SUCCESS;
+ return 0;
}
/*!
@@ -42,7 +42,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
pHandle->pstrMessageList = pstrMessge;
}
- return WILC_SUCCESS;
+ return 0;
}
/*!
@@ -54,7 +54,7 @@ int wilc_mq_destroy(WILC_MsgQueueHandle *pHandle)
int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
const void *pvSendBuffer, u32 u32SendBufferSize)
{
- int s32RetStatus = WILC_SUCCESS;
+ int s32RetStatus = 0;
unsigned long flags;
Message *pstrMessage = NULL;
@@ -122,7 +122,7 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
u32 *pu32ReceivedLength)
{
Message *pstrMessage;
- int s32RetStatus = WILC_SUCCESS;
+ int s32RetStatus = 0;
unsigned long flags;
if ((!pHandle) || (u32RecvBufferSize == 0)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f7d3392..8cdd1d5 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -501,7 +501,7 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
int WILC_WFI_Set_PMKSA(u8 *bssid, struct WILC_WFI_priv *priv)
{
u32 i;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
@@ -513,7 +513,7 @@ int WILC_WFI_Set_PMKSA(u8 *bssid, struct WILC_WFI_priv *priv)
/*If bssid is found, set the values*/
s32Error = host_int_set_pmkid_info(priv->hWILCWFIDrv, &priv->pmkid_list);
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
PRINT_ER("Error in pmkid\n");
break;
@@ -694,7 +694,7 @@ static int set_channel(struct wiphy *wiphy,
u32 channelnum = 0;
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
priv = wiphy_priv(wiphy);
@@ -704,7 +704,7 @@ static int set_channel(struct wiphy *wiphy,
u8CurrChannel = channelnum;
s32Error = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
PRINT_ER("Error in setting channel %d\n", channelnum);
return s32Error;
@@ -731,7 +731,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
{
struct WILC_WFI_priv *priv;
u32 i;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u8 au8ScanChanList[MAX_NUM_SCANNED_NETWORKS];
tstrHiddenNetwork strHiddenNetwork;
@@ -796,7 +796,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
" channels\n");
}
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error != 0) {
s32Error = -EBUSY;
PRINT_WRN(CFG80211_DBG, "Device is busy: Error(%d)\n", s32Error);
}
@@ -819,7 +819,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
static int connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u32 i;
u8 u8security = NO_ENCRYPT;
AUTHTYPE_T tenuAuth_type = ANY;
@@ -1050,7 +1050,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
CfgConnectResult, (void *)priv, u8security,
tenuAuth_type, pstrNetworkInfo->u8channel,
pstrNetworkInfo->pJoinParams);
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error != 0) {
PRINT_ER("host_int_set_join_req(): Error(%d)\n", s32Error);
s32Error = -ENOENT;
goto done;
@@ -1073,7 +1073,7 @@ done:
*/
static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_code)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
#ifdef WILC_P2P
tstrWILC_WFIDrv *pstrWFIDrv;
@@ -1102,7 +1102,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co
#endif
s32Error = host_int_disconnect(priv->hWILCWFIDrv, reason_code);
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error != 0) {
PRINT_ER("Error in disconnecting: Error(%d)\n", s32Error);
s32Error = -EINVAL;
}
@@ -1125,7 +1125,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
const u8 *mac_addr, struct key_params *params)
{
- s32 s32Error = WILC_SUCCESS, KeyLen = params->key_len;
+ s32 s32Error = 0, KeyLen = params->key_len;
u32 i;
struct WILC_WFI_priv *priv;
const u8 *pu8RxMic = NULL;
@@ -1417,7 +1417,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
const u8 *mac_addr)
{
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
priv = wiphy_priv(wiphy);
@@ -1527,7 +1527,7 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
const u8 *mac_addr, void *cookie, void (*callback)(void *cookie, struct key_params *))
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
struct key_params key_params;
@@ -1576,7 +1576,7 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
bool unicast, bool multicast)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
@@ -1604,7 +1604,7 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 ke
static int WILC_WFI_dump_survey(struct wiphy *wiphy, struct net_device *netdev,
int idx, struct survey_info *info)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
if (idx != 0) {
@@ -1630,7 +1630,7 @@ static int WILC_WFI_dump_survey(struct wiphy *wiphy, struct net_device *netdev,
static int get_station(struct wiphy *wiphy, struct net_device *dev,
const u8 *mac, struct station_info *sinfo)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
#ifdef WILC_AP_EXTERNAL_MLME
@@ -1812,7 +1812,7 @@ static int WILC_WFI_disassoc(struct wiphy *wiphy, struct net_device *dev,
*/
static int set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrCfgParamVal pstrCfgParamVal;
struct WILC_WFI_priv *priv;
@@ -1871,7 +1871,7 @@ static int WILC_WFI_set_bitrate_mask(struct wiphy *wiphy,
struct net_device *dev, const u8 *peer,
const struct cfg80211_bitrate_mask *mask)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
PRINT_D(CFG80211_DBG, "Setting Bitrate mask function\n");
return s32Error;
@@ -1893,7 +1893,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev,
struct cfg80211_pmksa *pmksa)
{
u32 i;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
u8 flag = 0;
struct WILC_WFI_priv *priv = wiphy_priv(wiphy);
@@ -1945,7 +1945,7 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev,
u32 i;
u8 flag = 0;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv = wiphy_priv(wiphy);
@@ -2407,7 +2407,7 @@ static int remain_on_channel(struct wiphy *wiphy,
struct ieee80211_channel *chan,
unsigned int duration, u64 *cookie)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
priv = wiphy_priv(wiphy);
@@ -2459,7 +2459,7 @@ static int cancel_remain_on_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
u64 cookie)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
priv = wiphy_priv(wiphy);
@@ -2507,7 +2507,7 @@ int mgmt_tx(struct wiphy *wiphy,
const struct ieee80211_mgmt *mgmt;
struct p2p_mgmt_data *mgmt_tx;
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
tstrWILC_WFIDrv *pstrWFIDrv;
u32 i;
perInterface_wlan_t *nic;
@@ -2527,13 +2527,13 @@ int mgmt_tx(struct wiphy *wiphy,
mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
if (mgmt_tx == NULL) {
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
- return WILC_FAIL;
+ return -EFAULT;
}
mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
if (mgmt_tx->buff == NULL) {
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx);
- return WILC_FAIL;
+ return -EFAULT;
}
memcpy(mgmt_tx->buff, buf, len);
mgmt_tx->size = len;
@@ -2821,7 +2821,7 @@ int WILC_WFI_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
host_int_set_power_mgmt(priv->hWILCWFIDrv, enabled, timeout);
- return WILC_SUCCESS;
+ return 0;
}
#ifdef WILC_AP_EXTERNAL_MLME
@@ -2841,7 +2841,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic);
static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
enum nl80211_iftype type, u32 *flags, struct vif_params *params)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
u8 interface_type;
@@ -3221,7 +3221,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
{
struct cfg80211_beacon_data *beacon = &(settings->beacon);
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
priv = wiphy_priv(wiphy);
PRINT_D(HOSTAPD_DBG, "Starting ap\n");
@@ -3231,7 +3231,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
s32Error = set_channel(wiphy, &settings->chandef);
- if (s32Error != WILC_SUCCESS)
+ if (s32Error != 0)
PRINT_ER("Error in setting channel\n");
linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
@@ -3261,7 +3261,7 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_beacon_data *beacon)
{
struct WILC_WFI_priv *priv;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
priv = wiphy_priv(wiphy);
PRINT_D(HOSTAPD_DBG, "Setting beacon\n");
@@ -3287,7 +3287,7 @@ static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
*/
static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
u8 NullBssid[ETH_ALEN] = {0};
@@ -3321,7 +3321,7 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
static int add_station(struct wiphy *wiphy, struct net_device *dev,
const u8 *mac, struct station_parameters *params)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
tstrWILC_AddStaParam strStaParams = { {0} };
perInterface_wlan_t *nic;
@@ -3391,7 +3391,7 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev,
struct station_del_parameters *params)
{
const u8 *mac = params->mac;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
@@ -3432,7 +3432,7 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev,
static int change_station(struct wiphy *wiphy, struct net_device *dev,
const u8 *mac, struct station_parameters *params)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
tstrWILC_AddStaParam strStaParams = { {0} };
perInterface_wlan_t *nic;
@@ -3543,7 +3543,7 @@ struct wireless_dev *add_virtual_intf(struct wiphy *wiphy, const char *name,
int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) /* tony for v3.8 support */
{
PRINT_D(HOSTAPD_DBG, "Deleting virtual interface\n");
- return WILC_SUCCESS;
+ return 0;
}
@@ -3702,7 +3702,7 @@ struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net)
{
struct WILC_WFI_priv *priv;
struct wireless_dev *wdev;
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
PRINT_D(CFG80211_DBG, "Registering wifi device\n");
@@ -3784,7 +3784,7 @@ struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net)
int WILC_WFI_InitHostInt(struct net_device *net)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
@@ -3825,7 +3825,7 @@ int WILC_WFI_InitHostInt(struct net_device *net)
*/
int WILC_WFI_DeInitHostInt(struct net_device *net)
{
- s32 s32Error = WILC_SUCCESS;
+ s32 s32Error = 0;
struct WILC_WFI_priv *priv;
--
1.9.1
^ permalink raw reply related [flat|nested] 11+ messages in thread