get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to set channel\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ return -EINVAL;
}
return s32Error;
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ return -EINVAL;
}
return s32Error;
if (s32Error) {
PRINT_ER("Failed to set driver handler\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
- WILC_CATCH(s32Error)
- {
-
+ return -EINVAL;
}
return s32Error;
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);
- } else {
- PRINT_INFO(HOSTINF_DBG, "IP address set\n");
+ PRINT_ER("Failed to set IP address\n");
+ return -EINVAL;
}
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_INFO(HOSTINF_DBG, "IP address set\n");
return s32Error;
}
if (s32Error != WILC_SUCCESS) {
PRINT_ER("Failed to get IP address\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- } 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");
+ return -EINVAL;
}
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx);
+ PRINT_INFO(HOSTINF_DBG, "%pI4\n", gs8GetIP[idx]);
+ PRINT_INFO(HOSTINF_DBG, "\n");
return s32Error;
}
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to set mac address\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
kfree(mac_buf);
return s32Error;
}
get_id_from_handler(drvHandler));
if (s32Error) {
PRINT_ER("Failed to get mac address\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
-
+ s32Error = -EFAULT;
}
up(&hWaitResponse);
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.bss_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.bss_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("check value 6 over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.auth_type = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.auth_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Impossible value \n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.auth_timeout = strHostIFCfgParamAttr->pstrCfgParamVal.auth_timeout;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Range(1 ~ 65535) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.power_mgmt_mode = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.power_mgmt_mode;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Invalide power mode\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.short_retry_limit = strHostIFCfgParamAttr->pstrCfgParamVal.short_retry_limit;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Range(1~256) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.long_retry_limit = strHostIFCfgParamAttr->pstrCfgParamVal.long_retry_limit;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Range(1~256) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.frag_threshold = strHostIFCfgParamAttr->pstrCfgParamVal.frag_threshold;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Threshold Range fail\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.rts_threshold = strHostIFCfgParamAttr->pstrCfgParamVal.rts_threshold;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Threshold Range fail\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.preamble_type = strHostIFCfgParamAttr->pstrCfgParamVal.preamble_type;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Preamle Range(0~2) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.short_slot_allowed = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.short_slot_allowed;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Short slot(2) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.txop_prot_disabled = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.txop_prot_disabled;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("TXOP prot disable\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.beacon_interval = strHostIFCfgParamAttr->pstrCfgParamVal.beacon_interval;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Beacon interval(1~65535) fail\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.dtim_period = strHostIFCfgParamAttr->pstrCfgParamVal.dtim_period;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("DTIM range(1~255) fail\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(char);
pstrWFIDrv->strCfgValues.site_survey_enabled = (u8)strHostIFCfgParamAttr->pstrCfgParamVal.site_survey_enabled;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Site survey disable\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.site_survey_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.site_survey_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Site survey scan time(1~65535) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.active_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.active_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Active scan time(1~65535) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.passive_scan_time = strHostIFCfgParamAttr->pstrCfgParamVal.passive_scan_time;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Passive scan time(1~65535) over\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
strWIDList[u8WidCnt].s32ValueSize = sizeof(u16);
pstrWFIDrv->strCfgValues.curr_tx_rate = (u8)curr_tx_rate;
} else {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("out of TX rate\n");
+ s32Error = -EINVAL;
+ goto ERRORHANDLER;
}
u8WidCnt++;
}
if (s32Error)
PRINT_ER("Error in setting CFG params\n");
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
up(&(pstrWFIDrv->gtOsCfgValuesSem));
return s32Error;
}
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);
+ PRINT_ER("Already scan\n");
+ 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);
+ PRINT_ER("Don't do obss scan\n");
+ s32Error = -EBUSY;
+ goto ERRORHANDLER;
}
#endif
s32Error = SendConfigPkt(SET_CFG, strWIDList, u32WidsCount, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send scan paramters config packet\n");
- WILC_ERRORREPORT(s32Error, s32Error);
- } else {
+ 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);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS) {
+ if (s32Error) {
PRINT_ER("Failed to set abort running scan\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
+ s32Error = -EFAULT;
}
}
MAX_SURVEY_RESULT_FRAG_SIZE);
if (s32Err) {
PRINT_ER("Failed to get site survey results\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
-
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
}
s32Err = ParseSurveyResults(gapu8RcvdSurveyResults, &pstrSurveyResults,
&pstrWFIDrv->u32SurveyResultsCount);
DeallocateSurveyResults(pstrSurveyResults);
} else {
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- PRINT_ER("ParseSurveyResults() Error(%d)\n", s32Err);
+ PRINT_ER("ParseSurveyResults() Error\n");
+ s32Error = -EFAULT;
+ goto ERRORHANDLER;
}
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);
+ PRINT_ER("failed to send config packet\n");
+ 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);
+ s32Error = -ENOENT;
+ goto ERRORHANDLER;
}
#else
ptstrJoinBssParam = (tstrJoinBssParam *)pstrHostIFconnectAttr->pJoinParams;
if (ptstrJoinBssParam == NULL) {
PRINT_ER("Required BSSID not found\n");
- WILC_ERRORREPORT(s32Error, WILC_NOT_FOUND);
+ s32Error = -ENOENT;
+ goto ERRORHANDLER;
}
#endif /*WILC_PARSE_SCAN_IN_HOST*/
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;
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;
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);
+ PRINT_ER("failed to send config packet\n");
+ 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;
del_timer(&pstrWFIDrv->hConnectTimer);
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)
- {
-
+ PRINT_ER("failed to send config packet\n");
+ s32Error = -EINVAL;
}
return s32Error;
ParseNetworkInfo(pstrRcvdNetworkInfo->pu8Buffer, &pstrNetworkInfo);
if ((pstrNetworkInfo == NULL)
|| (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ s32Error = -EINVAL;
+ goto done;
}
/* check whether this network is discovered before */
}
}
-
- WILC_CATCH(s32Error)
- {
-
- }
-
done:
/* Deallocate pstrRcvdNetworkInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
if (pstrRcvdNetworkInfo->pu8Buffer != NULL) {
pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult) {
if ((pstrRcvdGnrlAsyncInfo->pu8Buffer == NULL) ||
(pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult == NULL)) {
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ 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);
+ return -EFAULT;
}
/* Extract message ID */
}
- WILC_CATCH(s32Error)
- {
-
- }
-
/* Deallocate pstrRcvdGnrlAsyncInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
if (pstrRcvdGnrlAsyncInfo->pu8Buffer != NULL) {
kfree(pstrRcvdGnrlAsyncInfo->pu8Buffer);
if (s32Error) {
PRINT_ER("Failed to send dissconect config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
} else {
tstrDisconnectNotifInfo strDisconnectNotifInfo;
}
- WILC_CATCH(s32Error)
- {
-
- }
-
/* ////////////////////////// */
up(&(pstrWFIDrv->hSemTestDisconnectBlock));
/* ///////////////////////// */
if (s32Error) {
PRINT_D(HOSTINF_DBG, "Failed to switch log terminal\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- } else {
- PRINT_INFO(HOSTINF_DBG, "MAC address set ::\n");
-
-
+ PRINT_ER("Failed to switch log terminal\n");
+ return -EINVAL;
}
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_INFO(HOSTINF_DBG, "MAC address set ::\n");
return s32Error;
}
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to get channel number\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ s32Error = -EFAULT;
}
-
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetCHNL));
return s32Error;
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to get RSSI value\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetRSSI));
get_id_from_handler(pstrWFIDrv));
if (s32Error) {
PRINT_ER("Failed to get LINKSPEED value\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ s32Error = -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
up(&(pstrWFIDrv->hSemGetLINKSPEED));
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;
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to SET incative time\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ return -EFAULT;
}
/*get the value by searching the local copy*/
if (s32Error) {
PRINT_ER("Failed to get incative time\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ return -EFAULT;
}
PRINT_D(CFG80211_DBG, "Getting inactive time : %d\n", gu32InactiveTime);
up(&(pstrWFIDrv->hSemInactiveTime));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
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);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send add beacon config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
kfree(pstrSetBeaconParam->pu8Head);
kfree(pstrSetBeaconParam->pu8Tail);
strWID.ps8WidVal = &gu8DelBcn;
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ return;
pu8CurrByte = strWID.ps8WidVal;
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
+ if (s32Error)
PRINT_ER("Failed to send delete beacon config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
-
- WILC_CATCH(s32Error)
- {
- }
}
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);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error != WILC_SUCCESS) {
-
+ if (s32Error != WILC_SUCCESS)
PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(pstrStationParam->pu8Rates);
kfree(strWID.ps8WidVal);
}
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;
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
+ if (s32Error)
PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
up(&hWaitResponse);
strWID.ps8WidVal = kmalloc(strWID.s32ValueSize, GFP_KERNEL);
if (strWID.ps8WidVal == NULL)
- WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
+ goto ERRORHANDLER;
pu8CurrByte = strWID.ps8WidVal;
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
+ if (s32Error)
PRINT_ER("Failed to send add station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
}
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);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
-
+ if (s32Error)
PRINT_ER("Failed to send edit station config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(pstrStationParam->pu8Rates);
kfree(strWID.ps8WidVal);
}
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
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;
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;
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;
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)
- {
+ s32Error = -EINVAL;
}
return s32Error;
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
}
#endif
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true,
get_id_from_handler(pstrWFIDrv));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send power management config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_STATE);
- }
-
- WILC_CATCH(s32Error)
- {
-
- }
}
/**
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);
/*Sending Cfg*/
s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false,
get_id_from_handler(drvHandler));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send setup multicast config packet\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
- }
- WILC_CATCH(s32Error)
- {
- }
+ERRORHANDLER:
kfree(strWID.ps8WidVal);
}
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("Failed to send setup multicast config packet\n");
+ return s32Error;
+ }
/* prepare the Remove Wep Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
PRINT_ER("Error in sending message queue : Request to remove WEP key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
PRINT_ER("Error in sending message queue : Default key index\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
u8 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
PRINT_ER("Error in sending message queue :WEP Key\n");
down(&(pstrWFIDrv->hSemTestKeyBlock));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
u8 u8KeyLen = u8PtkKeylen;
u32 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
if (pu8RxMic != NULL)
u8KeyLen += RX_MIC_KEY_LEN;
if (pu8TxMic != NULL)
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
u8 u8KeyLen = u8GtkKeylen;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
down(&(pstrWFIDrv->hSemTestKeyBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
u32 i;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("driver is null\n");
+ return s32Error;
+ }
/* prepare the Key Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
if (s32Error)
PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error) {
+ if (s32Error)
PRINT_ER("Failed to send message queue: Set mac address\n");
- WILC_ERRORREPORT(s32Error, s32Error);
- }
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
/*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)
- {
-
+ s32Error = -EINVAL;
}
return s32Error;
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
- if (pstrWFIDrv == NULL || pfConnectResult == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL || pfConnectResult == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("Driver is null\n");
+ return s32Error;
+ }
if (hWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: gWFiDrvHandle = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
+ PRINT_ER("Driver is null\n");
+ return -EFAULT;
}
if (pJoinParams == NULL) {
PRINT_ER("Unable to Join - JoinParams is NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_FAIL);
-
+ 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));
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);
+ return -EFAULT;
}
enuScanConnTimer = CONNECT_TIMER;
mod_timer(&pstrWFIDrv->hConnectTimer,
jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
}
- if (hWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (hWFIDrv == NULL) {
+ s32Error = -EFAULT;
+ PRINT_ER("Driver is null\n");
+ return s32Error;
+ }
strHostIFmsg.u16MsgId = HOST_IF_MSG_FLUSH_CONNECT;
strHostIFmsg.drvHandler = hWFIDrv;
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);
+ return -EFAULT;
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
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);
+ PRINT_ER("Driver is null\n");
+ return -EFAULT;
}
/* prepare the Disconnect Message */
down(&(pstrWFIDrv->hSemTestDisconnectBlock));
/* /////// */
- WILC_CATCH(s32Error)
- {
-
- }
-
return s32Error;
}
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("Driver is null\n");
+ return -EFAULT;
}
strWID.u16WIDid = (u16)WID_ASSOC_RES_INFO;
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);
+ PRINT_ER("Failed to send association response config packet\n");
+ return -EINVAL;
} else {
*pu32RcvdAssocRespInfoLen = strWID.s32ValueSize;
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
/* prepare the set channel message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ PRINT_ER("wilc mq send fail\n");
+ s32Error = -EINVAL;
}
return s32Error;
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) {
+ PRINT_ER("wilc mq send fail\n");
+ s32Error = -EINVAL;
}
/* wait untill MSG Q is empty */
strHostIFmsg.drvHandler = u32address;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ PRINT_ER("wilc mq send fail\n");
+ s32Error = -EINVAL;
}
return s32Error;
strHostIFmsg.drvHandler = hWFIDrv;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
+ if (s32Error) {
+ PRINT_ER("wilc mq send fail\n");
+ s32Error = -EINVAL;
}
return s32Error;
tstrHostIFmsg strHostIFmsg;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
}
/* prepare the Get Channel Message */
/* send the message */
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- PRINT_ER("Failed to send get host channel param's message queue ");
+ PRINT_ER("wilc mq send fail\n");
down(&(pstrWFIDrv->hSemGetCHNL));
/* gu8Chnl = 11; */
*pu8ChNo = gu8Chnl;
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
}
/*prepare configuration packet*/
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);
+ PRINT_ER("Failed to set wid value\n");
+ return -EINVAL;
} else {
PRINT_D(HOSTINF_DBG, "Successfully set wid value\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
}
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
*pu32InactiveTime = gu32InactiveTime;
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
}
#endif
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
}
strWID.u16WIDid = (u16)WID_MEMORY_ADDRESS;
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);
+ PRINT_ER("Failed to get wid value\n");
+ return -EINVAL;
} else {
PRINT_D(HOSTINF_DBG, "Successfully got wid value\n");
}
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
tenuScanConnTimer enuScanConnTimer;
- if (pstrWFIDrv == NULL || ScanResult == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
-
+ if (pstrWFIDrv == NULL || ScanResult == NULL) {
+ PRINT_ER("pstrWFIDrv or ScanResult = NULL\n");
+ return -EFAULT;
+ }
/* prepare the Scan Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
/* 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);
+ PRINT_ER("Error in sending message queue\n");
+ return -EINVAL;
}
enuScanConnTimer = SCAN_TIMER;
mod_timer(&pstrWFIDrv->hScanTimer,
jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT));
- WILC_CATCH(s32Error)
- {
-
- }
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("pstrWFIDrv NULL\n");
+ return -EFAULT;
+ }
/* prepare the WiphyParams Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
strHostIFmsg.u16MsgId = HOST_IF_MSG_CFG_PARAMS;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
- WILC_CATCH(s32Error)
- {
- }
-
return s32Error;
}
down(&(pstrWFIDrv->gtOsCfgValuesSem));
if (pstrWFIDrv == NULL) {
- PRINT_ER("Driver not initialized: pstrWFIDrv = NULL\n");
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ PRINT_ER("pstrWFIDrv NULL\n");
+ return -EFAULT;
}
PRINT_D(HOSTINF_DBG, "Getting configuration parameters\n");
switch (u16WID) {
up(&(pstrWFIDrv->gtOsCfgValuesSem));
- WILC_CATCH(s32Error)
- {
- }
return s32Error;
}
/*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;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
/* prepare the remainonchan Message */
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc mq send fail\n");
return s32Error;
}
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
/*Stopping remain-on-channel timer*/
del_timer(&pstrWFIDrv->hRemainOnChannel);
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
+ PRINT_ER("wilc mq send fail\n");
- }
return s32Error;
}
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc mq send fail\n");
return s32Error;
tstrHostIFmsg strHostIFmsg;
tstrHostIFSetBeacon *pstrSetBeaconParam = &strHostIFmsg.uniHostIFmsgBody.strHostIFSetBeacon;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
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;
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
+ PRINT_ER("wilc mq send fail\n");
- WILC_CATCH(s32Error)
- {
+ERRORHANDLER:
+ if (s32Error) {
if (pstrSetBeaconParam->pu8Head != NULL)
kfree(pstrSetBeaconParam->pu8Head);
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
/* prepare the WiphyParams Message */
strHostIFmsg.u16MsgId = HOST_IF_MSG_DEL_BEACON;
if (s32Error)
PRINT_ER("wilc_mq_send fail\n");
- WILC_CATCH(s32Error)
- {
- }
return s32Error;
}
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
tstrHostIFDelSta *pstrDelStationMsg = &strHostIFmsg.uniHostIFmsgBody.strDelStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
}
/**
u8 u8AssocNumb = 0;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
-
- WILC_CATCH(s32Error)
- {
+ PRINT_ER("wilc_mq_send fail\n");
- }
down(&hWaitResponse);
return s32Error;
tstrHostIFmsg strHostIFmsg;
tstrWILC_AddStaParam *pstrAddStationMsg = &strHostIFmsg.uniHostIFmsgBody.strAddStaParam;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting editing station message queue params\n");
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ PRINT_ER("wilc_mq_send fail\n");
+
return s32Error;
}
#endif /*WILC_AP_EXTERNAL_MLME*/
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) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting Power management message queue params\n");
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
}
tstrHostIFSetMulti *pstrMulticastFilterParam = &strHostIFmsg.uniHostIFmsgBody.strHostIfSetMulti;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
PRINT_D(HOSTINF_DBG, "Setting Multicast Filter params\n");
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
}
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
/*BugID_5222*/
down(&hWaitResponse);
tstrHostIFmsg strHostIFmsg;
tstrHostIfBASessionInfo *pBASessionInfo = &strHostIFmsg.uniHostIFmsgBody.strHostIfBASessionInfo;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
/*BugID_5222*/
down(&hWaitResponse);
/* TODO: Enable This feature on softap firmware */
return 0;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
- if (pstrWFIDrv == NULL)
- WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
+ if (pstrWFIDrv == NULL) {
+ PRINT_ER("driver is null\n");
+ return -EFAULT;
+ }
memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
s32Error = wilc_mq_send(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
if (s32Error)
- WILC_ERRORREPORT(s32Error, s32Error);
- WILC_CATCH(s32Error)
- {
-
- }
+ PRINT_ER("wilc_mq_send fail\n");
return s32Error;