]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/staging/wilc1000/host_interface.c
staging: wilc1000: fix build warning with setup_timer()
[karo-tx-linux.git] / drivers / staging / wilc1000 / host_interface.c
index cc549c2c5213fd1e2f5f63a50d09a138d35165d3..66fa677015db43e5224eef679b60a690708a7297 100644 (file)
@@ -6,7 +6,7 @@ extern s32 TransportDeInit(void);
 extern u8 connecting;
 
 #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
-extern WILC_TimerHandle hDuringIpTimer;
+extern struct timer_list hDuringIpTimer;
 #endif
 
 /*BugID_5137*/
@@ -466,7 +466,7 @@ typedef union _tuniHostIFmsgBody {
 typedef struct _tstrHostIFmsg {
        u16 u16MsgId;                                           /*!< Message ID */
        tuniHostIFmsgBody uniHostIFmsgBody;             /*!< Message body */
-       void *drvHandler;
+       tstrWILC_WFIDrv *drvHandler;
 } tstrHostIFmsg;
 
 #ifdef CONNECT_DIRECT
@@ -546,7 +546,7 @@ static struct semaphore hSemHostIFthrdEnd;
 struct semaphore hSemDeinitDrvHandle;
 static struct semaphore hWaitResponse;
 struct semaphore hSemHostIntDeinit;
-WILC_TimerHandle g_hPeriodicRSSI;
+struct timer_list g_hPeriodicRSSI;
 
 
 
@@ -601,7 +601,7 @@ extern int linux_wlan_get_num_conn_ifcs(void);
  *  @date
  *  @version   1.0
  */
-static s32 Handle_SetChannel(void *drvHandler, tstrHostIFSetChan *pstrHostIFSetChan)
+static s32 Handle_SetChannel(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetChan *pstrHostIFSetChan)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -681,7 +681,7 @@ static s32 Handle_SetWfiDrvHandler(tstrHostIfSetDrvHandler *pstrHostIfSetDrvHand
  *  @date
  *  @version   1.0
  */
-static s32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperationMode *pstrHostIfSetOperationMode)
+static s32 Handle_SetOperationMode(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetOperationMode *pstrHostIfSetOperationMode)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -726,7 +726,7 @@ static s32 Handle_SetOperationMode(void *drvHandler, tstrHostIfSetOperationMode
  *  @date
  *  @version   1.0
  */
-s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
+s32 Handle_set_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -739,7 +739,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
 
        PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set  IP = %pI4\n", idx, pu8IPAddr);
 
-       WILC_memcpy(gs8SetIP[idx], pu8IPAddr, IP_ALEN);
+       memcpy(gs8SetIP[idx], pu8IPAddr, IP_ALEN);
 
        /*prepare configuration packet*/
        strWID.u16WIDid = (u16)WID_IP_ADDRESS;
@@ -751,7 +751,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
 
 
 
-       host_int_get_ipaddress((WILC_WFIDrvHandle)drvHandler, firmwareIPAddress, idx);
+       host_int_get_ipaddress(drvHandler, firmwareIPAddress, idx);
 
        if (s32Error) {
                PRINT_D(HOSTINF_DBG, "Failed to set IP address\n");
@@ -778,7 +778,7 @@ s32 Handle_set_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
  *  @date
  *  @version   1.0
  */
-s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
+s32 Handle_get_IPAddress(tstrWILC_WFIDrv *drvHandler, u8 *pu8IPAddr, u8 idx)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -788,20 +788,20 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
        /*prepare configuration packet*/
        strWID.u16WIDid = (u16)WID_IP_ADDRESS;
        strWID.enuWIDtype = WID_STR;
-       strWID.ps8WidVal = (u8 *)WILC_MALLOC(IP_ALEN);
+       strWID.ps8WidVal = WILC_MALLOC(IP_ALEN);
        strWID.s32ValueSize = IP_ALEN;
 
        s32Error = SendConfigPkt(GET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
 
        PRINT_INFO(HOSTINF_DBG, "%pI4\n", strWID.ps8WidVal);
 
-       WILC_memcpy(gs8GetIP[idx], strWID.ps8WidVal, IP_ALEN);
+       memcpy(gs8GetIP[idx], strWID.ps8WidVal, IP_ALEN);
 
        /*get the value by searching the local copy*/
-       WILC_FREE(strWID.ps8WidVal);
+       kfree(strWID.ps8WidVal);
 
        if (memcmp(gs8GetIP[idx], gs8SetIP[idx], IP_ALEN) != 0)
-               host_int_setup_ipaddress((WILC_WFIDrvHandle)pstrWFIDrv, gs8SetIP[idx], idx);
+               host_int_setup_ipaddress(pstrWFIDrv, gs8SetIP[idx], idx);
 
        if (s32Error != WILC_SUCCESS) {
                PRINT_ER("Failed to get IP address\n");
@@ -831,19 +831,19 @@ s32 Handle_get_IPAddress(void *drvHandler, u8 *pu8IPAddr, u8 idx)
  *  @date              November 2013
  *  @version   7.0
  */
-static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrHostIfSetMacAddress)
+static s32 Handle_SetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfSetMacAddress *pstrHostIfSetMacAddress)
 {
 
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)drvHandler;
-       u8 *mac_buf = (u8 *)WILC_MALLOC(ETH_ALEN);
+       u8 *mac_buf = WILC_MALLOC(ETH_ALEN);
 
        if (mac_buf == NULL) {
                PRINT_ER("No buffer to send mac address\n");
                return WILC_FAIL;
        }
-       WILC_memcpy(mac_buf, pstrHostIfSetMacAddress->u8MacAddress, ETH_ALEN);
+       memcpy(mac_buf, pstrHostIfSetMacAddress->u8MacAddress, ETH_ALEN);
 
        /*prepare configuration packet*/
        strWID.u16WIDid = (u16)WID_MAC_ADDR;
@@ -862,7 +862,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH
        {
 
        }
-       WILC_FREE(mac_buf);
+       kfree(mac_buf);
        return s32Error;
 }
 
@@ -877,7 +877,7 @@ static s32 Handle_SetMacAddress(void *drvHandler, tstrHostIfSetMacAddress *pstrH
  *  @date              JAN 2013
  *  @version   8.0
  */
-static s32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddress *pstrHostIfGetMacAddress)
+static s32 Handle_GetMacAddress(tstrWILC_WFIDrv *drvHandler, tstrHostIfGetMacAddress *pstrHostIfGetMacAddress)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -914,7 +914,7 @@ static s32 Handle_GetMacAddress(void *drvHandler, tstrHostIfGetMacAddress *pstrH
  *  @date
  *  @version   1.0
  */
-static s32 Handle_CfgParam(void *drvHandler, tstrHostIFCfgParamAttr *strHostIFCfgParamAttr)
+static s32 Handle_CfgParam(tstrWILC_WFIDrv *drvHandler, tstrHostIFCfgParamAttr *strHostIFCfgParamAttr)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWIDList[32];
@@ -1238,7 +1238,7 @@ static s32 Handle_wait_msg_q_empty(void)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
+static s32 Handle_Scan(tstrWILC_WFIDrv *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWIDList[5];
@@ -1293,7 +1293,7 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
 
                for (i = 0; i < pstrHostIFscanAttr->strHiddenNetwork.u8ssidnum; i++) {
                        *pu8Buffer++ = pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen;
-                       WILC_memcpy(pu8Buffer, pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid, pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen);
+                       memcpy(pu8Buffer, pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].pu8ssid, pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen);
                        pu8Buffer += pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo[i].u8ssidlen;
                }
 
@@ -1366,35 +1366,35 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
 
        WILC_CATCH(s32Error)
        {
-               WILC_TimerStop(&(pstrWFIDrv->hScanTimer), NULL);
+               del_timer(&pstrWFIDrv->hScanTimer);
                /*if there is an ongoing scan request*/
                Handle_ScanDone(drvHandler, SCAN_EVENT_ABORTED);
        }
 
        /* Deallocate pstrHostIFscanAttr->u8ChnlListLen which was prevoisuly allocated by the sending thread */
        if (pstrHostIFscanAttr->pu8ChnlFreqList != NULL) {
-               WILC_FREE(pstrHostIFscanAttr->pu8ChnlFreqList);
+               kfree(pstrHostIFscanAttr->pu8ChnlFreqList);
                pstrHostIFscanAttr->pu8ChnlFreqList = NULL;
        }
 
        /* Deallocate pstrHostIFscanAttr->pu8IEs which was previously allocated by the sending thread */
        if (pstrHostIFscanAttr->pu8IEs != NULL) {
-               WILC_FREE(pstrHostIFscanAttr->pu8IEs);
+               kfree(pstrHostIFscanAttr->pu8IEs);
                pstrHostIFscanAttr->pu8IEs = NULL;
        }
        if (pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo != NULL) {
-               WILC_FREE(pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo);
+               kfree(pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo);
                pstrHostIFscanAttr->strHiddenNetwork.pstrHiddenNetworkInfo = NULL;
        }
 
        /* Deallocate pstrHostIFscanAttr->u8ChnlListLen which was prevoisuly allocated by the sending thread */
        if (pstrHostIFscanAttr->pu8ChnlFreqList != NULL) {
-               WILC_FREE(pstrHostIFscanAttr->pu8ChnlFreqList);
+               kfree(pstrHostIFscanAttr->pu8ChnlFreqList);
                pstrHostIFscanAttr->pu8ChnlFreqList = NULL;
        }
 
        if (pu8HdnNtwrksWidVal != NULL)
-               WILC_FREE(pu8HdnNtwrksWidVal);
+               kfree(pu8HdnNtwrksWidVal);
 
        return s32Error;
 }
@@ -1408,7 +1408,7 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent)
+static s32 Handle_ScanDone(tstrWILC_WFIDrv *drvHandler, tenuScanEvent enuEvent)
 {
        s32 s32Error = WILC_SUCCESS;
 
@@ -1468,7 +1468,7 @@ static s32 Handle_ScanDone(void *drvHandler, tenuScanEvent enuEvent)
  *  @version   1.0
  */
 u8 u8ConnectedSSID[6] = {0};
-static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFconnectAttr)
+static s32 Handle_Connect(tstrWILC_WFIDrv *drvHandler, tstrHostIFconnectAttr *pstrHostIFconnectAttr)
 {
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *) drvHandler;
        s32 s32Error = WILC_SUCCESS;
@@ -1497,7 +1497,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
 
 
        PRINT_D(HOSTINF_DBG, "Getting site survey results\n");
-       s32Err = host_int_get_site_survey_results((WILC_WFIDrvHandle)pstrWFIDrv,
+       s32Err = host_int_get_site_survey_results(pstrWFIDrv,
                                                  gapu8RcvdSurveyResults,
                                                  MAX_SURVEY_RESULT_FRAG_SIZE);
        if (s32Err) {
@@ -1513,7 +1513,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
                /* 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++) {
-                       WILC_memcpy(&pstrWFIDrv->astrSurveyResults[i], &pstrSurveyResults[i],
+                       memcpy(&pstrWFIDrv->astrSurveyResults[i], &pstrSurveyResults[i],
                                    sizeof(wid_site_survey_reslts_s));
                }
 
@@ -1558,22 +1558,22 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
                PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n");
 
                if (pstrHostIFconnectAttr->pu8bssid != NULL) {
-                       pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = (u8 *)WILC_MALLOC(6);
-                       WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
+                       pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = WILC_MALLOC(6);
+                       memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
                }
 
                pstrWFIDrv->strWILC_UsrConnReq.ssidLen = pstrHostIFconnectAttr->ssidLen;
                if (pstrHostIFconnectAttr->pu8ssid != NULL) {
-                       pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = (u8 *)WILC_MALLOC(pstrHostIFconnectAttr->ssidLen + 1);
-                       WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->pu8ssid,
+                       pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = WILC_MALLOC(pstrHostIFconnectAttr->ssidLen + 1);
+                       memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->pu8ssid,
                                    pstrHostIFconnectAttr->ssidLen);
                        pstrWFIDrv->strWILC_UsrConnReq.pu8ssid[pstrHostIFconnectAttr->ssidLen] = '\0';
                }
 
                pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = pstrHostIFconnectAttr->IEsLen;
                if (pstrHostIFconnectAttr->pu8IEs != NULL) {
-                       pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = (u8 *)WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
-                       WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->pu8IEs,
+                       pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
+                       memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->pu8IEs,
                                    pstrHostIFconnectAttr->IEsLen);
                }
 
@@ -1665,22 +1665,22 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        #endif /*WILC_PARSE_SCAN_IN_HOST*/
 
        if (pstrHostIFconnectAttr->pu8bssid != NULL) {
-               pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = (u8 *)WILC_MALLOC(6);
-               WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
+               pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = WILC_MALLOC(6);
+               memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
        }
 
        pstrWFIDrv->strWILC_UsrConnReq.ssidLen = pstrHostIFconnectAttr->ssidLen;
        if (pstrHostIFconnectAttr->pu8ssid != NULL) {
-               pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = (u8 *)WILC_MALLOC(pstrHostIFconnectAttr->ssidLen + 1);
-               WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->pu8ssid,
+               pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = WILC_MALLOC(pstrHostIFconnectAttr->ssidLen + 1);
+               memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->pu8ssid,
                            pstrHostIFconnectAttr->ssidLen);
                pstrWFIDrv->strWILC_UsrConnReq.pu8ssid[pstrHostIFconnectAttr->ssidLen] = '\0';
        }
 
        pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = pstrHostIFconnectAttr->IEsLen;
        if (pstrHostIFconnectAttr->pu8IEs != NULL) {
-               pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = (u8 *)WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
-               WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->pu8IEs,
+               pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
+               memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->pu8IEs,
                            pstrHostIFconnectAttr->IEsLen);
        }
 
@@ -1774,7 +1774,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        pu8CurrByte = strWIDList[u32WidsCount].ps8WidVal;
 
        if (pstrHostIFconnectAttr->pu8ssid != NULL) {
-               WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8ssid, pstrHostIFconnectAttr->ssidLen);
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8ssid, pstrHostIFconnectAttr->ssidLen);
                pu8CurrByte[pstrHostIFconnectAttr->ssidLen] = '\0';
        }
        pu8CurrByte += MAX_SSID_LEN;
@@ -1785,7 +1785,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
                *(pu8CurrByte++) = 0xFF;
        }
        if (pstrHostIFconnectAttr->pu8bssid != NULL)
-               WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
        pu8CurrByte += 6;
 
        /* keep the buffer at the start of the allocated pointer to use it with the free*/
@@ -1812,7 +1812,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
 
 
        if (pstrHostIFconnectAttr->pu8ssid != NULL) {
-               WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8ssid, pstrHostIFconnectAttr->ssidLen);
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8ssid, pstrHostIFconnectAttr->ssidLen);
                pu8CurrByte[pstrHostIFconnectAttr->ssidLen] = '\0';
        }
        pu8CurrByte += MAX_SSID_LEN;
@@ -1833,12 +1833,12 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
 
        /* sa*/
        if (pstrHostIFconnectAttr->pu8bssid != NULL)
-               WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
        pu8CurrByte += 6;
 
        /* bssid*/
        if (pstrHostIFconnectAttr->pu8bssid != NULL)
-               WILC_memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->pu8bssid, 6);
        pu8CurrByte += 6;
 
        /* Beacon Period*/
@@ -1849,7 +1849,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        *(pu8CurrByte++)  =  ptstrJoinBssParam->dtim_period;
        PRINT_D(HOSTINF_DBG, "* DTIM Period %d*\n", (*(pu8CurrByte - 1)));
        /* Supported rates*/
-       WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
+       memcpy(pu8CurrByte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
        pu8CurrByte += (MAX_RATES_SUPPORTED + 1);
 
        /* wmm cap*/
@@ -1873,15 +1873,15 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        *(pu8CurrByte++) =  ptstrJoinBssParam->mode_802_11i;
        PRINT_D(HOSTINF_DBG, "* mode_802_11i %d*\n", (*(pu8CurrByte - 1)));
        /* rsn pcip policy*/
-       WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
+       memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
        pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
 
        /* rsn auth policy*/
-       WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
+       memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
        pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
 
        /* rsn auth policy*/
-       WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
+       memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
        pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
 
        /*BugID_5137*/
@@ -1906,15 +1906,15 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
 
                *(pu8CurrByte++) = ptstrJoinBssParam->u8Count;
 
-               WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->au8Duration, sizeof(ptstrJoinBssParam->au8Duration));
+               memcpy(pu8CurrByte, ptstrJoinBssParam->au8Duration, sizeof(ptstrJoinBssParam->au8Duration));
 
                pu8CurrByte += sizeof(ptstrJoinBssParam->au8Duration);
 
-               WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->au8Interval, sizeof(ptstrJoinBssParam->au8Interval));
+               memcpy(pu8CurrByte, ptstrJoinBssParam->au8Interval, sizeof(ptstrJoinBssParam->au8Interval));
 
                pu8CurrByte += sizeof(ptstrJoinBssParam->au8Interval);
 
-               WILC_memcpy(pu8CurrByte, ptstrJoinBssParam->au8StartTime, sizeof(ptstrJoinBssParam->au8StartTime));
+               memcpy(pu8CurrByte, ptstrJoinBssParam->au8StartTime, sizeof(ptstrJoinBssParam->au8StartTime));
 
                pu8CurrByte += sizeof(ptstrJoinBssParam->au8StartTime);
 
@@ -1946,7 +1946,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
 
        if (pstrHostIFconnectAttr->pu8bssid != NULL) {
-               WILC_memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->pu8bssid, ETH_ALEN);
+               memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->pu8bssid, ETH_ALEN);
 
                PRINT_D(GENERIC_DBG, "save Bssid = %x:%x:%x:%x:%x:%x\n", (pstrHostIFconnectAttr->pu8bssid[0]), (pstrHostIFconnectAttr->pu8bssid[1]), (pstrHostIFconnectAttr->pu8bssid[2]), (pstrHostIFconnectAttr->pu8bssid[3]), (pstrHostIFconnectAttr->pu8bssid[4]), (pstrHostIFconnectAttr->pu8bssid[5]));
                PRINT_D(GENERIC_DBG, "save bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
@@ -1966,7 +1966,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        {
                tstrConnectInfo strConnectInfo;
 
-               WILC_TimerStop(&(pstrWFIDrv->hConnectTimer), NULL);
+               del_timer(&pstrWFIDrv->hConnectTimer);
 
                PRINT_D(HOSTINF_DBG, "could not start connecting to the required network\n");
 
@@ -1974,12 +1974,12 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
 
                if (pstrHostIFconnectAttr->pfConnectResult != NULL) {
                        if (pstrHostIFconnectAttr->pu8bssid != NULL)
-                               WILC_memcpy(strConnectInfo.au8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
+                               memcpy(strConnectInfo.au8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
 
                        if (pstrHostIFconnectAttr->pu8IEs != NULL) {
                                strConnectInfo.ReqIEsLen = pstrHostIFconnectAttr->IEsLen;
-                               strConnectInfo.pu8ReqIEs = (u8 *)WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
-                               WILC_memcpy(strConnectInfo.pu8ReqIEs,
+                               strConnectInfo.pu8ReqIEs = WILC_MALLOC(pstrHostIFconnectAttr->IEsLen);
+                               memcpy(strConnectInfo.pu8ReqIEs,
                                            pstrHostIFconnectAttr->pu8IEs,
                                            pstrHostIFconnectAttr->IEsLen);
                        }
@@ -1993,7 +1993,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
                        pstrWFIDrv->enuHostIFstate = HOST_IF_IDLE;
                        /* Deallocation */
                        if (strConnectInfo.pu8ReqIEs != NULL) {
-                               WILC_FREE(strConnectInfo.pu8ReqIEs);
+                               kfree(strConnectInfo.pu8ReqIEs);
                                strConnectInfo.pu8ReqIEs = NULL;
                        }
 
@@ -2005,24 +2005,24 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
        PRINT_D(HOSTINF_DBG, "Deallocating connection parameters\n");
        /* Deallocate pstrHostIFconnectAttr->pu8bssid which was prevoisuly allocated by the sending thread */
        if (pstrHostIFconnectAttr->pu8bssid != NULL) {
-               WILC_FREE(pstrHostIFconnectAttr->pu8bssid);
+               kfree(pstrHostIFconnectAttr->pu8bssid);
                pstrHostIFconnectAttr->pu8bssid = NULL;
        }
 
        /* Deallocate pstrHostIFconnectAttr->pu8ssid which was prevoisuly allocated by the sending thread */
        if (pstrHostIFconnectAttr->pu8ssid != NULL) {
-               WILC_FREE(pstrHostIFconnectAttr->pu8ssid);
+               kfree(pstrHostIFconnectAttr->pu8ssid);
                pstrHostIFconnectAttr->pu8ssid = NULL;
        }
 
        /* Deallocate pstrHostIFconnectAttr->pu8IEs which was prevoisuly allocated by the sending thread */
        if (pstrHostIFconnectAttr->pu8IEs != NULL) {
-               WILC_FREE(pstrHostIFconnectAttr->pu8IEs);
+               kfree(pstrHostIFconnectAttr->pu8IEs);
                pstrHostIFconnectAttr->pu8IEs = NULL;
        }
 
        if (pu8CurrByte != NULL)
-               WILC_FREE(pu8CurrByte);
+               kfree(pu8CurrByte);
        return s32Error;
 }
 
@@ -2037,7 +2037,7 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
  *  @version           8.0
  */
 
-static s32 Handle_FlushConnect(void *drvHandler)
+static s32 Handle_FlushConnect(tstrWILC_WFIDrv *drvHandler)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWIDList[5];
@@ -2104,7 +2104,7 @@ static s32 Handle_FlushConnect(void *drvHandler)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_ConnectTimeout(void *drvHandler)
+static s32 Handle_ConnectTimeout(tstrWILC_WFIDrv *drvHandler)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrConnectInfo strConnectInfo;
@@ -2130,14 +2130,14 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
         *   WID_DISCONNECT} */
        if (pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult != NULL) {
                if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
-                       WILC_memcpy(strConnectInfo.au8bssid,
+                       memcpy(strConnectInfo.au8bssid,
                                    pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, 6);
                }
 
                if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
                        strConnectInfo.ReqIEsLen = pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
-                       strConnectInfo.pu8ReqIEs = (u8 *)WILC_MALLOC(pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
-                       WILC_memcpy(strConnectInfo.pu8ReqIEs,
+                       strConnectInfo.pu8ReqIEs = WILC_MALLOC(pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
+                       memcpy(strConnectInfo.pu8ReqIEs,
                                    pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs,
                                    pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
                }
@@ -2150,7 +2150,7 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
 
                /* Deallocation of strConnectInfo.pu8ReqIEs */
                if (strConnectInfo.pu8ReqIEs != NULL) {
-                       WILC_FREE(strConnectInfo.pu8ReqIEs);
+                       kfree(strConnectInfo.pu8ReqIEs);
                        strConnectInfo.pu8ReqIEs = NULL;
                }
        } else {
@@ -2173,18 +2173,18 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
        /* Deallocation of the Saved Connect Request in the global Handle */
        pstrWFIDrv->strWILC_UsrConnReq.ssidLen = 0;
        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ssid != NULL) {
-               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
+               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
                pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = NULL;
        }
 
        if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
-               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
+               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
                pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = NULL;
        }
 
        pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
-               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
+               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
                pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = NULL;
        }
 
@@ -2192,11 +2192,11 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
        /*BugID_5213*/
        /*Freeing flushed join request params on connect timeout*/
        if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-               WILC_FREE(gu8FlushedJoinReq);
+               kfree(gu8FlushedJoinReq);
                gu8FlushedJoinReq = NULL;
        }
        if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-               WILC_FREE(gu8FlushedInfoElemAsoc);
+               kfree(gu8FlushedInfoElemAsoc);
                gu8FlushedInfoElemAsoc = NULL;
        }
 
@@ -2212,7 +2212,7 @@ static s32 Handle_ConnectTimeout(void *drvHandler)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_RcvdNtwrkInfo(void *drvHandler, tstrRcvdNetworkInfo *pstrRcvdNetworkInfo)
+static s32 Handle_RcvdNtwrkInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdNetworkInfo *pstrRcvdNetworkInfo)
 {
        u32 i;
        bool bNewNtwrkFound;
@@ -2274,7 +2274,7 @@ static s32 Handle_RcvdNtwrkInfo(void *drvHandler, tstrRcvdNetworkInfo *pstrRcvdN
 
                                if ((pstrWFIDrv->strWILC_UsrScanReq.astrFoundNetworkInfo[pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid != NULL)
                                    && (pstrNetworkInfo->au8bssid != NULL)) {
-                                       WILC_memcpy(pstrWFIDrv->strWILC_UsrScanReq.astrFoundNetworkInfo[pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid,
+                                       memcpy(pstrWFIDrv->strWILC_UsrScanReq.astrFoundNetworkInfo[pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid,
                                                    pstrNetworkInfo->au8bssid, 6);
 
                                        pstrWFIDrv->strWILC_UsrScanReq.u32RcvdChCount++;
@@ -2312,7 +2312,7 @@ static s32 Handle_RcvdNtwrkInfo(void *drvHandler, tstrRcvdNetworkInfo *pstrRcvdN
 done:
        /* Deallocate pstrRcvdNetworkInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
        if (pstrRcvdNetworkInfo->pu8Buffer != NULL) {
-               WILC_FREE(pstrRcvdNetworkInfo->pu8Buffer);
+               kfree(pstrRcvdNetworkInfo->pu8Buffer);
                pstrRcvdNetworkInfo->pu8Buffer = NULL;
        }
 
@@ -2334,7 +2334,7 @@ done:
  *  @date
  *  @version   1.0
  */
-static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pstrRcvdGnrlAsyncInfo)
+static s32 Handle_RcvdGnrlAsyncInfo(tstrWILC_WFIDrv *drvHandler, tstrRcvdGnrlAsyncInfo *pstrRcvdGnrlAsyncInfo)
 {
        /* 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 */
@@ -2402,7 +2402,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                        if (u8MacStatus == MAC_CONNECTED) {
                                memset(gapu8RcvdAssocResp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
 
-                               host_int_get_assoc_res_info((WILC_WFIDrvHandle)pstrWFIDrv,
+                               host_int_get_assoc_res_info(pstrWFIDrv,
                                                            gapu8RcvdAssocResp,
                                                            MAX_ASSOC_RESP_FRAME_SIZE,
                                                            &u32RcvdAssocRespInfoLen);
@@ -2426,8 +2426,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                                                                strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->u16RespIEsLen;
 
 
-                                                               strConnectInfo.pu8RespIEs = (u8 *)WILC_MALLOC(pstrConnectRespInfo->u16RespIEsLen);
-                                                               WILC_memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->pu8RespIEs,
+                                                               strConnectInfo.pu8RespIEs = WILC_MALLOC(pstrConnectRespInfo->u16RespIEsLen);
+                                                               memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->pu8RespIEs,
                                                                            pstrConnectRespInfo->u16RespIEsLen);
                                                        }
                                                }
@@ -2458,11 +2458,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                        /*               through a structure of type tstrConnectRespInfo */
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
                                PRINT_D(HOSTINF_DBG, "Retrieving actual BSSID from AP\n");
-                               WILC_memcpy(strConnectInfo.au8bssid, pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, 6);
+                               memcpy(strConnectInfo.au8bssid, pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, 6);
 
                                if ((u8MacStatus == MAC_CONNECTED) &&
                                    (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) {
-                                       WILC_memcpy(pstrWFIDrv->au8AssociatedBSSID,
+                                       memcpy(pstrWFIDrv->au8AssociatedBSSID,
                                                    pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, ETH_ALEN);
                                }
                        }
@@ -2470,14 +2470,14 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
 
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
                                strConnectInfo.ReqIEsLen = pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen;
-                               strConnectInfo.pu8ReqIEs = (u8 *)WILC_MALLOC(pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
-                               WILC_memcpy(strConnectInfo.pu8ReqIEs,
+                               strConnectInfo.pu8ReqIEs = WILC_MALLOC(pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
+                               memcpy(strConnectInfo.pu8ReqIEs,
                                            pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs,
                                            pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen);
                        }
 
 
-                       WILC_TimerStop(&(pstrWFIDrv->hConnectTimer), NULL);
+                       del_timer(&pstrWFIDrv->hConnectTimer);
                        pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
                                                                           &strConnectInfo,
                                                                           u8MacStatus,
@@ -2492,7 +2492,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                            (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) {
                                #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
 
-                               host_int_set_power_mgmt((WILC_WFIDrvHandle)pstrWFIDrv, 0, 0);
+                               host_int_set_power_mgmt(pstrWFIDrv, 0, 0);
                                #endif
 
                                PRINT_D(HOSTINF_DBG, "MAC status : CONNECTED and Connect Status : Successful\n");
@@ -2501,7 +2501,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                                #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
                                PRINT_D(GENERIC_DBG, "Obtaining an IP, Disable Scan\n");
                                g_obtainingIP = true;
-                               WILC_TimerStart(&hDuringIpTimer, 10000, NULL, NULL);
+                               mod_timer(&hDuringIpTimer,
+                                         jiffies + msecs_to_jiffies(10000));
                                #endif
 
                                #ifdef WILC_PARSE_SCAN_IN_HOST
@@ -2520,30 +2521,30 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
 
                        /* Deallocation */
                        if (strConnectInfo.pu8RespIEs != NULL) {
-                               WILC_FREE(strConnectInfo.pu8RespIEs);
+                               kfree(strConnectInfo.pu8RespIEs);
                                strConnectInfo.pu8RespIEs = NULL;
                        }
 
                        if (strConnectInfo.pu8ReqIEs != NULL) {
-                               WILC_FREE(strConnectInfo.pu8ReqIEs);
+                               kfree(strConnectInfo.pu8ReqIEs);
                                strConnectInfo.pu8ReqIEs = NULL;
                        }
 
 
                        pstrWFIDrv->strWILC_UsrConnReq.ssidLen = 0;
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ssid != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = NULL;
                        }
 
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = NULL;
                        }
 
                        pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = NULL;
                        }
 
@@ -2556,7 +2557,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
 
                        if (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult) {
                                PRINT_D(HOSTINF_DBG, "\n\n<< Abort the running OBSS Scan >>\n\n");
-                               WILC_TimerStop(&(pstrWFIDrv->hScanTimer), NULL);
+                               del_timer(&pstrWFIDrv->hScanTimer);
                                Handle_ScanDone((void *)pstrWFIDrv, SCAN_EVENT_ABORTED);
                        }
 
@@ -2568,7 +2569,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                                #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
 
                                g_obtainingIP = false;
-                               host_int_set_power_mgmt((WILC_WFIDrvHandle)pstrWFIDrv, 0, 0);
+                               host_int_set_power_mgmt(pstrWFIDrv, 0, 0);
                                #endif
 
                                pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_DISCONN_NOTIF,
@@ -2591,25 +2592,25 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                        /*
                         * if(strDisconnectNotifInfo.ie != NULL)
                         * {
-                        *      WILC_FREE(strDisconnectNotifInfo.ie);
+                        *      kfree(strDisconnectNotifInfo.ie);
                         *      strDisconnectNotifInfo.ie = NULL;
                         * }
                         */
 
                        pstrWFIDrv->strWILC_UsrConnReq.ssidLen = 0;
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ssid != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = NULL;
                        }
 
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = NULL;
                        }
 
                        pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
                        if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
-                               WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
+                               kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
                                pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = NULL;
                        }
 
@@ -2617,11 +2618,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                        /*Freeing flushed join request params on receiving*/
                        /*MAC_DISCONNECTED while connected*/
                        if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-                               WILC_FREE(gu8FlushedJoinReq);
+                               kfree(gu8FlushedJoinReq);
                                gu8FlushedJoinReq = NULL;
                        }
                        if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-                               WILC_FREE(gu8FlushedInfoElemAsoc);
+                               kfree(gu8FlushedInfoElemAsoc);
                                gu8FlushedInfoElemAsoc = NULL;
                        }
 
@@ -2633,9 +2634,9 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
                        PRINT_D(HOSTINF_DBG, "Received MAC_DISCONNECTED from the FW while scanning\n");
                        PRINT_D(HOSTINF_DBG, "\n\n<< Abort the running Scan >>\n\n");
                        /*Abort the running scan*/
-                       WILC_TimerStop(&(pstrWFIDrv->hScanTimer), NULL);
+                       del_timer(&pstrWFIDrv->hScanTimer);
                        if (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult)
-                               Handle_ScanDone((void *)pstrWFIDrv, SCAN_EVENT_ABORTED);
+                               Handle_ScanDone(pstrWFIDrv, SCAN_EVENT_ABORTED);
 
                }
 
@@ -2648,7 +2649,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
 
        /* Deallocate pstrRcvdGnrlAsyncInfo->pu8Buffer which was prevoisuly allocated by the sending thread */
        if (pstrRcvdGnrlAsyncInfo->pu8Buffer != NULL) {
-               WILC_FREE(pstrRcvdGnrlAsyncInfo->pu8Buffer);
+               kfree(pstrRcvdGnrlAsyncInfo->pu8Buffer);
                pstrRcvdGnrlAsyncInfo->pu8Buffer = NULL;
        }
 
@@ -2664,7 +2665,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(void *drvHandler, tstrRcvdGnrlAsyncInfo *pst
  *  @date
  *  @version   1.0
  */
-static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
+static int Handle_Key(tstrWILC_WFIDrv *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -2705,7 +2706,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                        strWIDList[2].s32ValueSize = sizeof(char);
 
 
-                       pu8keybuf = (u8 *)WILC_MALLOC(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen);
+                       pu8keybuf = WILC_MALLOC(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen);
 
 
                        if (pu8keybuf == NULL) {
@@ -2713,11 +2714,11 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                                return -1;
                        }
 
-                       WILC_memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
+                       memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen);
 
 
-                       WILC_FREE(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey);
+                       kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey);
 
                        strWIDList[3].u16WIDid = (u16)WID_WEP_KEY_VALUE;
                        strWIDList[3].enuWIDtype = WID_STR;
@@ -2726,7 +2727,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
 
                        s32Error = SendConfigPkt(SET_CFG, strWIDList, 4, true, (u32)pstrWFIDrv);
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
 
 
                }
@@ -2734,19 +2735,19 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
                if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
                        PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
-                       pu8keybuf = (u8 *)WILC_MALLOC(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen + 2);
+                       pu8keybuf = WILC_MALLOC(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen + 2);
                        if (pu8keybuf == NULL) {
                                PRINT_ER("No buffer to send Key\n");
                                return -1;
                        }
                        pu8keybuf[0] = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx;
 
-                       WILC_memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen, 1);
+                       memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen, 1);
 
-                       WILC_memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
+                       memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen);
 
-                       WILC_FREE(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey);
+                       kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey);
 
                        strWID.u16WIDid = (u16)WID_ADD_WEP_KEY;
                        strWID.enuWIDtype       = WID_STR;
@@ -2754,7 +2755,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                        strWID.s32ValueSize = pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwepAttr.u8WepKeylen + 2;
 
                        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
                } else if (pstrHostIFkeyAttr->u8KeyAction & REMOVEKEY)    {
 
                        PRINT_D(HOSTINF_DBG, "Removing key\n");
@@ -2782,7 +2783,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
        case WPARxGtk:
                        #ifdef WILC_AP_EXTERNAL_MLME
                if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) {
-                       pu8keybuf = (u8 *)WILC_MALLOC(RX_MIC_KEY_MSG_LEN);
+                       pu8keybuf = WILC_MALLOC(RX_MIC_KEY_MSG_LEN);
                        if (pu8keybuf == NULL) {
                                PRINT_ER("No buffer to send RxGTK Key\n");
                                ret = -1;
@@ -2800,14 +2801,14 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
 
                        if (pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq != NULL)
-                               WILC_memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8);
+                               memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8);
 
 
-                       WILC_memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
+                       memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
 
-                       WILC_memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
+                       memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
 
-                       WILC_memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+                       memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen);
                        /* pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Ciphermode =  0X51; */
                        strWIDList[0].u16WIDid = (u16)WID_11I_MODE;
@@ -2822,7 +2823,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
                        s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, true, (u32)pstrWFIDrv);
 
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
 
                        /* ////////////////////////// */
                        up(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -2833,7 +2834,7 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
                        PRINT_D(HOSTINF_DBG, "Handling group key(Rx) function\n");
 
-                       pu8keybuf = (u8 *)WILC_MALLOC(RX_MIC_KEY_MSG_LEN);
+                       pu8keybuf = WILC_MALLOC(RX_MIC_KEY_MSG_LEN);
                        if (pu8keybuf == NULL) {
                                PRINT_ER("No buffer to send RxGTK Key\n");
                                ret = -1;
@@ -2849,16 +2850,16 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
                         |      6 bytes  | 8 byte  |1 byte |  1 byte    |   16 bytes    |         8 bytes        |*/
 
                        if (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED)
-                               WILC_memcpy(pu8keybuf, pstrWFIDrv->au8AssociatedBSSID, ETH_ALEN);
+                               memcpy(pu8keybuf, pstrWFIDrv->au8AssociatedBSSID, ETH_ALEN);
                        else
                                PRINT_ER("Couldn't handle WPARxGtk while enuHostIFstate is not HOST_IF_CONNECTED\n");
 
-                       WILC_memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8);
+                       memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq, 8);
 
-                       WILC_memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
+                       memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
 
-                       WILC_memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
-                       WILC_memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+                       memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
+                       memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen);
 
                        strWID.u16WIDid = (u16)WID_ADD_RX_GTK;
@@ -2868,15 +2869,15 @@ static int Handle_Key(void *drvHandler, tstrHostIFkeyAttr *pstrHostIFkeyAttr)
 
                        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
 
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
 
                        /* ////////////////////////// */
                        up(&(pstrWFIDrv->hSemTestKeyBlock));
                        /* ///////////////////////// */
                }
 _WPARxGtk_end_case_:
-               WILC_FREE(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key);
-               WILC_FREE(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq);
+               kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key);
+               kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq);
                if (ret == -1)
                        return ret;
 
@@ -2887,7 +2888,7 @@ _WPARxGtk_end_case_:
                if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY_AP) {
 
 
-                       pu8keybuf = (u8 *)WILC_MALLOC(PTK_KEY_MSG_LEN + 1);
+                       pu8keybuf = WILC_MALLOC(PTK_KEY_MSG_LEN + 1);
 
 
 
@@ -2904,12 +2905,12 @@ _WPARxGtk_end_case_:
                         |      6 bytes    |    1 byte    |   1byte      |   16 bytes    |        8 bytes         |        8 bytes        |
                         |-----------------------------------------------------------------------------|*/
 
-                       WILC_memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8macaddr, 6);  /*1 bytes Key Length */
+                       memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8macaddr, 6);  /*1 bytes Key Length */
 
-                       WILC_memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
-                       WILC_memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
+                       memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8keyidx, 1);
+                       memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
                        /*16 byte TK*/
-                       WILC_memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+                       memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen);
 
 
@@ -2924,7 +2925,7 @@ _WPARxGtk_end_case_:
                        strWIDList[1].s32ValueSize = PTK_KEY_MSG_LEN + 1;
 
                        s32Error = SendConfigPkt(SET_CFG, strWIDList, 2, true, (u32)pstrWFIDrv);
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
 
                        /* ////////////////////////// */
                        up(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -2934,7 +2935,7 @@ _WPARxGtk_end_case_:
                if (pstrHostIFkeyAttr->u8KeyAction & ADDKEY) {
 
 
-                       pu8keybuf = (u8 *)WILC_MALLOC(PTK_KEY_MSG_LEN);
+                       pu8keybuf = WILC_MALLOC(PTK_KEY_MSG_LEN);
 
 
 
@@ -2951,11 +2952,11 @@ _WPARxGtk_end_case_:
                         |      6 bytes          |      1byte     |   16 bytes   |        8 bytes         |        8 bytes        |
                         |-----------------------------------------------------------------------------|*/
 
-                       WILC_memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8macaddr, 6);  /*1 bytes Key Length */
+                       memcpy(pu8keybuf, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8macaddr, 6);  /*1 bytes Key Length */
 
-                       WILC_memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
+                       memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen, 1);
                        /*16 byte TK*/
-                       WILC_memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+                       memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                                    pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen);
 
 
@@ -2965,7 +2966,7 @@ _WPARxGtk_end_case_:
                        strWID.s32ValueSize = PTK_KEY_MSG_LEN;
 
                        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
-                       WILC_FREE(pu8keybuf);
+                       kfree(pu8keybuf);
 
                        /* ////////////////////////// */
                        up(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -2973,7 +2974,7 @@ _WPARxGtk_end_case_:
                }
 
 _WPAPtk_end_case_:
-               WILC_FREE(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key);
+               kfree(pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFwpaAttr.pu8key);
                if (ret == -1)
                        return ret;
 
@@ -2984,7 +2985,7 @@ _WPAPtk_end_case_:
 
                PRINT_D(HOSTINF_DBG, "Handling PMKSA key\n");
 
-               pu8keybuf = (u8 *)WILC_MALLOC((pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid * PMKSA_KEY_LEN) + 1);
+               pu8keybuf = WILC_MALLOC((pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid * PMKSA_KEY_LEN) + 1);
                if (pu8keybuf == NULL) {
                        PRINT_ER("No buffer to send PMKSA Key\n");
                        return -1;
@@ -2994,8 +2995,8 @@ _WPAPtk_end_case_:
 
                for (i = 0; i < pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.numpmkid; i++) {
 
-                       WILC_memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, ETH_ALEN);
-                       WILC_memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, PMKID_LEN);
+                       memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, ETH_ALEN);
+                       memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, PMKID_LEN);
                }
 
                strWID.u16WIDid = (u16)WID_PMKID_INFO;
@@ -3005,7 +3006,7 @@ _WPAPtk_end_case_:
 
                s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
 
-               WILC_FREE(pu8keybuf);
+               kfree(pu8keybuf);
                break;
        }
 
@@ -3026,7 +3027,7 @@ _WPAPtk_end_case_:
  *  @date
  *  @version   1.0
  */
-static void Handle_Disconnect(void *drvHandler)
+static void Handle_Disconnect(tstrWILC_WFIDrv *drvHandler)
 {
        tstrWID strWID;
 
@@ -3047,7 +3048,7 @@ static void Handle_Disconnect(void *drvHandler)
        #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
 
        g_obtainingIP = false;
-       host_int_set_power_mgmt((WILC_WFIDrvHandle)pstrWFIDrv, 0, 0);
+       host_int_set_power_mgmt(pstrWFIDrv, 0, 0);
        #endif
 
        memset(u8ConnectedSSID, 0, ETH_ALEN);
@@ -3067,7 +3068,7 @@ static void Handle_Disconnect(void *drvHandler)
                strDisconnectNotifInfo.ie_len = 0;
 
                if (pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult) {
-                       WILC_TimerStop(&(pstrWFIDrv->hScanTimer), NULL);
+                       del_timer(&pstrWFIDrv->hScanTimer);
                        pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
                                                                        pstrWFIDrv->strWILC_UsrScanReq.u32UserScanPvoid, NULL);
 
@@ -3080,7 +3081,7 @@ static void Handle_Disconnect(void *drvHandler)
                        /*Stop connect timer, if connection in progress*/
                        if (pstrWFIDrv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) {
                                PRINT_D(HOSTINF_DBG, "Upper layer requested termination of connection\n");
-                               WILC_TimerStop(&(pstrWFIDrv->hConnectTimer), NULL);
+                               del_timer(&pstrWFIDrv->hConnectTimer);
                        }
 
                        pstrWFIDrv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_DISCONN_NOTIF, NULL,
@@ -3099,29 +3100,29 @@ static void Handle_Disconnect(void *drvHandler)
                /* Deallocation */
                pstrWFIDrv->strWILC_UsrConnReq.ssidLen = 0;
                if (pstrWFIDrv->strWILC_UsrConnReq.pu8ssid != NULL) {
-                       WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
+                       kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ssid);
                        pstrWFIDrv->strWILC_UsrConnReq.pu8ssid = NULL;
                }
 
                if (pstrWFIDrv->strWILC_UsrConnReq.pu8bssid != NULL) {
-                       WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
+                       kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid);
                        pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = NULL;
                }
 
                pstrWFIDrv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
                if (pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
-                       WILC_FREE(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
+                       kfree(pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs);
                        pstrWFIDrv->strWILC_UsrConnReq.pu8ConnReqIEs = NULL;
                }
 
 
                /*BugID_5137*/
                if (gu8FlushedJoinReq != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-                       WILC_FREE(gu8FlushedJoinReq);
+                       kfree(gu8FlushedJoinReq);
                        gu8FlushedJoinReq = NULL;
                }
                if (gu8FlushedInfoElemAsoc != NULL && gu8FlushedJoinReqDrvHandler == (u32)drvHandler) {
-                       WILC_FREE(gu8FlushedInfoElemAsoc);
+                       kfree(gu8FlushedInfoElemAsoc);
                        gu8FlushedInfoElemAsoc = NULL;
                }
 
@@ -3139,7 +3140,7 @@ static void Handle_Disconnect(void *drvHandler)
 }
 
 
-void resolve_disconnect_aberration(void *drvHandler)
+void resolve_disconnect_aberration(tstrWILC_WFIDrv *drvHandler)
 {
        tstrWILC_WFIDrv *pstrWFIDrv;
 
@@ -3148,10 +3149,10 @@ void resolve_disconnect_aberration(void *drvHandler)
                return;
        if ((pstrWFIDrv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) || (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTING)) {
                PRINT_D(HOSTINF_DBG, "\n\n<< correcting Supplicant state machine >>\n\n");
-               host_int_disconnect((WILC_WFIDrvHandle)pstrWFIDrv, 1);
+               host_int_disconnect(pstrWFIDrv, 1);
        }
 }
-static s32 Switch_Log_Terminal(void *drvHandler)
+static s32 Switch_Log_Terminal(tstrWILC_WFIDrv *drvHandler)
 {
 
 
@@ -3195,7 +3196,7 @@ static s32 Switch_Log_Terminal(void *drvHandler)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_GetChnl(void *drvHandler)
+static s32 Handle_GetChnl(tstrWILC_WFIDrv *drvHandler)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -3240,7 +3241,7 @@ static s32 Handle_GetChnl(void *drvHandler)
  *  @date
  *  @version   1.0
  */
-static void Handle_GetRssi(void *drvHandler)
+static void Handle_GetRssi(tstrWILC_WFIDrv *drvHandler)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3270,7 +3271,7 @@ static void Handle_GetRssi(void *drvHandler)
 }
 
 
-static void Handle_GetLinkspeed(void *drvHandler)
+static void Handle_GetLinkspeed(tstrWILC_WFIDrv *drvHandler)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3300,7 +3301,7 @@ static void Handle_GetLinkspeed(void *drvHandler)
 
 }
 
-s32 Handle_GetStatistics(void *drvHandler, tstrStatistics *pstrStatistics)
+s32 Handle_GetStatistics(tstrWILC_WFIDrv *drvHandler, tstrStatistics *pstrStatistics)
 {
        tstrWID strWIDList[5];
        uint32_t u32WidsCount = 0, s32Error = 0;
@@ -3361,7 +3362,7 @@ s32 Handle_GetStatistics(void *drvHandler, tstrStatistics *pstrStatistics)
  *  @date
  *  @version   1.0
  */
-static s32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInactiveT *strHostIfStaInactiveT)
+static s32 Handle_Get_InActiveTime(tstrWILC_WFIDrv *drvHandler, tstrHostIfStaInactiveT *strHostIfStaInactiveT)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -3373,11 +3374,11 @@ static s32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInactiveT *str
        strWID.u16WIDid = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
        strWID.enuWIDtype = WID_STR;
        strWID.s32ValueSize = ETH_ALEN;
-       strWID.ps8WidVal = (u8 *)WILC_MALLOC(strWID.s32ValueSize);
+       strWID.ps8WidVal = WILC_MALLOC(strWID.s32ValueSize);
 
 
        stamac = strWID.ps8WidVal;
-       WILC_memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);
+       memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);
 
 
        PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
@@ -3430,7 +3431,7 @@ static s32 Handle_Get_InActiveTime(void *drvHandler, tstrHostIfStaInactiveT *str
  *  @date
  *  @version   1.0
  */
-static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaconParam)
+static void Handle_AddBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetBeacon *pstrSetBeaconParam)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3487,9 +3488,9 @@ static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
-       WILC_FREE_IF_TRUE(pstrSetBeaconParam->pu8Head);
-       WILC_FREE_IF_TRUE(pstrSetBeaconParam->pu8Tail);
+       kfree(strWID.ps8WidVal);
+       kfree(pstrSetBeaconParam->pu8Head);
+       kfree(pstrSetBeaconParam->pu8Tail);
 }
 
 
@@ -3502,7 +3503,7 @@ static void Handle_AddBeacon(void *drvHandler, tstrHostIFSetBeacon *pstrSetBeaco
  *  @date
  *  @version   1.0
  */
-static void Handle_DelBeacon(void *drvHandler, tstrHostIFDelBeacon *pstrDelBeacon)
+static void Handle_DelBeacon(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelBeacon *pstrDelBeacon)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3552,7 +3553,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer, tstrWILC_AddStaParam *pstrSta
        pu8CurrByte = pu8Buffer;
 
        PRINT_D(HOSTINF_DBG, "Packing STA params\n");
-       WILC_memcpy(pu8CurrByte, pstrStationParam->au8BSSID, ETH_ALEN);
+       memcpy(pu8CurrByte, pstrStationParam->au8BSSID, ETH_ALEN);
        pu8CurrByte +=  ETH_ALEN;
 
        *pu8CurrByte++ = pstrStationParam->u16AssocID & 0xFF;
@@ -3560,7 +3561,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer, tstrWILC_AddStaParam *pstrSta
 
        *pu8CurrByte++ = pstrStationParam->u8NumRates;
        if (pstrStationParam->u8NumRates > 0)
-               WILC_memcpy(pu8CurrByte, pstrStationParam->pu8Rates, pstrStationParam->u8NumRates);
+               memcpy(pu8CurrByte, pstrStationParam->pu8Rates, pstrStationParam->u8NumRates);
        pu8CurrByte += pstrStationParam->u8NumRates;
 
        *pu8CurrByte++ = pstrStationParam->bIsHTSupported;
@@ -3568,7 +3569,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer, tstrWILC_AddStaParam *pstrSta
        *pu8CurrByte++ = (pstrStationParam->u16HTCapInfo >> 8) & 0xFF;
 
        *pu8CurrByte++ = pstrStationParam->u8AmpduParams;
-       WILC_memcpy(pu8CurrByte, pstrStationParam->au8SuppMCsSet, WILC_SUPP_MCS_SET_SIZE);
+       memcpy(pu8CurrByte, pstrStationParam->au8SuppMCsSet, WILC_SUPP_MCS_SET_SIZE);
        pu8CurrByte += WILC_SUPP_MCS_SET_SIZE;
 
        *pu8CurrByte++ = pstrStationParam->u16HTExtParams & 0xFF;
@@ -3599,7 +3600,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer, tstrWILC_AddStaParam *pstrSta
  *  @date
  *  @version   1.0
  */
-static void Handle_AddStation(void *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
+static void Handle_AddStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3629,8 +3630,8 @@ static void Handle_AddStation(void *drvHandler, tstrWILC_AddStaParam *pstrStatio
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(pstrStationParam->pu8Rates);
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
+       kfree(pstrStationParam->pu8Rates);
+       kfree(strWID.ps8WidVal);
 }
 
 /**
@@ -3642,7 +3643,7 @@ static void Handle_AddStation(void *drvHandler, tstrWILC_AddStaParam *pstrStatio
  *  @date
  *  @version   1.0
  */
-static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllStaParam)
+static void Handle_DelAllSta(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelAllSta *pstrDelAllStaParam)
 {
        s32 s32Error = WILC_SUCCESS;
 
@@ -3668,7 +3669,7 @@ static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllSt
 
        for (i = 0; i < MAX_NUM_STA; i++) {
                if (memcmp(pstrDelAllStaParam->au8Sta_DelAllSta[i], au8Zero_Buff, ETH_ALEN))
-                       WILC_memcpy(pu8CurrByte, pstrDelAllStaParam->au8Sta_DelAllSta[i], ETH_ALEN);
+                       memcpy(pu8CurrByte, pstrDelAllStaParam->au8Sta_DelAllSta[i], ETH_ALEN);
                else
                        continue;
 
@@ -3686,7 +3687,7 @@ static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllSt
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
+       kfree(strWID.ps8WidVal);
 
        up(&hWaitResponse);
 }
@@ -3701,7 +3702,7 @@ static void Handle_DelAllSta(void *drvHandler, tstrHostIFDelAllSta *pstrDelAllSt
  *  @date
  *  @version   1.0
  */
-static void Handle_DelStation(void *drvHandler, tstrHostIFDelSta *pstrDelStaParam)
+static void Handle_DelStation(tstrWILC_WFIDrv *drvHandler, tstrHostIFDelSta *pstrDelStaParam)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3720,7 +3721,7 @@ static void Handle_DelStation(void *drvHandler, tstrHostIFDelSta *pstrDelStaPara
 
        pu8CurrByte = strWID.ps8WidVal;
 
-       WILC_memcpy(pu8CurrByte, pstrDelStaParam->au8MacAddr, ETH_ALEN);
+       memcpy(pu8CurrByte, pstrDelStaParam->au8MacAddr, ETH_ALEN);
 
        /*Sending Cfg*/
        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, false, (u32)pstrWFIDrv);
@@ -3733,7 +3734,7 @@ static void Handle_DelStation(void *drvHandler, tstrHostIFDelSta *pstrDelStaPara
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
+       kfree(strWID.ps8WidVal);
 }
 
 
@@ -3746,7 +3747,7 @@ static void Handle_DelStation(void *drvHandler, tstrHostIFDelSta *pstrDelStaPara
  *  @date
  *  @version   1.0
  */
-static void Handle_EditStation(void *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
+static void Handle_EditStation(tstrWILC_WFIDrv *drvHandler, tstrWILC_AddStaParam *pstrStationParam)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3776,8 +3777,8 @@ static void Handle_EditStation(void *drvHandler, tstrWILC_AddStaParam *pstrStati
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(pstrStationParam->pu8Rates);
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
+       kfree(pstrStationParam->pu8Rates);
+       kfree(strWID.ps8WidVal);
 }
 #endif /*WILC_AP_EXTERNAL_MLME*/
 
@@ -3791,7 +3792,7 @@ static void Handle_EditStation(void *drvHandler, tstrWILC_AddStaParam *pstrStati
  *  @date
  *  @version   1.0
  */
-static int Handle_RemainOnChan(void *drvHandler, tstrHostIfRemainOnChan *pstrHostIfRemainOnChan)
+static int Handle_RemainOnChan(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnChan *pstrHostIfRemainOnChan)
 {
        s32 s32Error = WILC_SUCCESS;
        u8 u8remain_on_chan_flag;
@@ -3833,7 +3834,7 @@ static int Handle_RemainOnChan(void *drvHandler, tstrHostIfRemainOnChan *pstrHos
        strWID.u16WIDid = (u16)WID_REMAIN_ON_CHAN;
        strWID.enuWIDtype       = WID_STR;
        strWID.s32ValueSize = 2;
-       strWID.ps8WidVal = (s8 *)WILC_MALLOC(strWID.s32ValueSize);
+       strWID.ps8WidVal = WILC_MALLOC(strWID.s32ValueSize);
 
        if (strWID.ps8WidVal == NULL)
                WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
@@ -3849,7 +3850,10 @@ static int Handle_RemainOnChan(void *drvHandler, tstrHostIfRemainOnChan *pstrHos
        WILC_CATCH(-1)
        {
                P2P_LISTEN_STATE = 1;
-               WILC_TimerStart(&(pstrWFIDrv->hRemainOnChannel), pstrHostIfRemainOnChan->u32duration, (void *)pstrWFIDrv, NULL);
+               pstrWFIDrv->hRemainOnChannel.data = (unsigned long)pstrWFIDrv;
+               mod_timer(&pstrWFIDrv->hRemainOnChannel,
+                         jiffies +
+                         msecs_to_jiffies(pstrHostIfRemainOnChan->u32duration));
 
                /*Calling CFG ready_on_channel*/
                if (pstrWFIDrv->strHostIfRemainOnChan.pRemainOnChanReady)
@@ -3870,7 +3874,7 @@ static int Handle_RemainOnChan(void *drvHandler, tstrHostIfRemainOnChan *pstrHos
  *  @date
  *  @version   1.0
  */
-static int Handle_RegisterFrame(void *drvHandler, tstrHostIfRegisterFrame *pstrHostIfRegisterFrame)
+static int Handle_RegisterFrame(tstrWILC_WFIDrv *drvHandler, tstrHostIfRegisterFrame *pstrHostIfRegisterFrame)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -3890,7 +3894,7 @@ static int Handle_RegisterFrame(void *drvHandler, tstrHostIfRegisterFrame *pstrH
 
        *pu8CurrByte++ = pstrHostIfRegisterFrame->bReg;
        *pu8CurrByte++ = pstrHostIfRegisterFrame->u8Regid;
-       WILC_memcpy(pu8CurrByte, &(pstrHostIfRegisterFrame->u16FrameType), sizeof(u16));
+       memcpy(pu8CurrByte, &(pstrHostIfRegisterFrame->u16FrameType), sizeof(u16));
 
 
        strWID.s32ValueSize = sizeof(u16) + 2;
@@ -3922,7 +3926,7 @@ static int Handle_RegisterFrame(void *drvHandler, tstrHostIfRegisterFrame *pstrH
  *  @version           1.0
  */
 #define FALSE_FRMWR_CHANNEL 100
-static u32 Handle_ListenStateExpired(void *drvHandler, tstrHostIfRemainOnChan *pstrHostIfRemainOnChan)
+static u32 Handle_ListenStateExpired(tstrWILC_WFIDrv *drvHandler, tstrHostIfRemainOnChan *pstrHostIfRemainOnChan)
 {
        u8 u8remain_on_chan_flag;
        tstrWID strWID;
@@ -3978,13 +3982,13 @@ _done_:
  *  @date
  *  @version           1.0
  */
-static void ListenTimerCB(void *pvArg)
+static void ListenTimerCB(unsigned long arg)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
-       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg;
+       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg;
        /*Stopping remain-on-channel timer*/
-       WILC_TimerStop(&(pstrWFIDrv->hRemainOnChannel), NULL);
+       del_timer(&pstrWFIDrv->hRemainOnChannel);
 
        /* prepare the Timer Callback message */
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -3993,7 +3997,7 @@ static void ListenTimerCB(void *pvArg)
        strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan.u32ListenSessionID = pstrWFIDrv->strHostIfRemainOnChan.u32ListenSessionID;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -4013,7 +4017,7 @@ static void ListenTimerCB(void *pvArg)
  *  @date
  *  @version   1.0
  */
-static void Handle_PowerManagement(void *drvHandler, tstrHostIfPowerMgmtParam *strPowerMgmtParam)
+static void Handle_PowerManagement(tstrWILC_WFIDrv *drvHandler, tstrHostIfPowerMgmtParam *strPowerMgmtParam)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4054,7 +4058,7 @@ static void Handle_PowerManagement(void *drvHandler, tstrHostIfPowerMgmtParam *s
  *  @date
  *  @version   1.0
  */
-static void Handle_SetMulticastFilter(void *drvHandler, tstrHostIFSetMulti *strHostIfSetMulti)
+static void Handle_SetMulticastFilter(tstrWILC_WFIDrv *drvHandler, tstrHostIFSetMulti *strHostIfSetMulti)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4093,7 +4097,7 @@ static void Handle_SetMulticastFilter(void *drvHandler, tstrHostIFSetMulti *strH
        WILC_CATCH(s32Error)
        {
        }
-       WILC_FREE_IF_TRUE(strWID.ps8WidVal);
+       kfree(strWID.ps8WidVal);
 
 }
 
@@ -4108,7 +4112,7 @@ static void Handle_SetMulticastFilter(void *drvHandler, tstrHostIFSetMulti *strH
  *  @date                      Feb. 2014
  *  @version           9.0
  */
-static s32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
+static s32 Handle_AddBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4126,14 +4130,14 @@ static s32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
 
        strWID.u16WIDid = (u16)WID_11E_P_ACTION_REQ;
        strWID.enuWIDtype = WID_STR;
-       strWID.ps8WidVal = (u8 *)WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
+       strWID.ps8WidVal = WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
        strWID.s32ValueSize = BLOCK_ACK_REQ_SIZE;
        ptr = strWID.ps8WidVal;
        /* *ptr++ = 0x14; */
        *ptr++ = 0x14;
        *ptr++ = 0x3;
        *ptr++ = 0x0;
-       WILC_memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
+       memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
        ptr += ETH_ALEN;
        *ptr++ = strHostIfBASessionInfo->u8Ted;
        /* BA Policy*/
@@ -4165,7 +4169,7 @@ static s32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
        *ptr++ = 15;
        *ptr++ = 7;
        *ptr++ = 0x2;
-       WILC_memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
+       memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
        ptr += ETH_ALEN;
        /* TID*/
        *ptr++ = strHostIfBASessionInfo->u8Ted;
@@ -4179,7 +4183,7 @@ static s32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
 
        if (strWID.ps8WidVal != NULL)
-               WILC_FREE(strWID.ps8WidVal);
+               kfree(strWID.ps8WidVal);
 
        return s32Error;
 
@@ -4196,7 +4200,7 @@ static s32 Handle_AddBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
  *  @date                      Feb. 2013
  *  @version           9.0
  */
-static s32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
+static s32 Handle_DelBASession(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4211,14 +4215,14 @@ static s32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
 
        strWID.u16WIDid = (u16)WID_11E_P_ACTION_REQ;
        strWID.enuWIDtype = WID_STR;
-       strWID.ps8WidVal = (u8 *)WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
+       strWID.ps8WidVal = WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
        strWID.s32ValueSize = BLOCK_ACK_REQ_SIZE;
        ptr = strWID.ps8WidVal;
        /* *ptr++ = 0x14; */
        *ptr++ = 0x14;
        *ptr++ = 0x3;
        *ptr++ = 0x2;
-       WILC_memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
+       memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
        ptr += ETH_ALEN;
        *ptr++ = strHostIfBASessionInfo->u8Ted;
        /* BA direction = recipent*/
@@ -4239,7 +4243,7 @@ static s32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
        *ptr++ = 15;
        *ptr++ = 7;
        *ptr++ = 0x3;
-       WILC_memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
+       memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
        ptr += ETH_ALEN;
        /* TID*/
        *ptr++ = strHostIfBASessionInfo->u8Ted;
@@ -4247,7 +4251,7 @@ static s32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
        s32Error = SendConfigPkt(SET_CFG, &strWID, 1, true, (u32)pstrWFIDrv);
 
        if (strWID.ps8WidVal != NULL)
-               WILC_FREE(strWID.ps8WidVal);
+               kfree(strWID.ps8WidVal);
 
        /*BugID_5222*/
        up(&hWaitResponse);
@@ -4266,7 +4270,7 @@ static s32 Handle_DelBASession(void *drvHandler, tstrHostIfBASessionInfo *strHos
  *  @date                      Feb. 2013
  *  @version           9.0
  */
-static s32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
+static s32 Handle_DelAllRxBASessions(tstrWILC_WFIDrv *drvHandler, tstrHostIfBASessionInfo *strHostIfBASessionInfo)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4281,13 +4285,13 @@ static s32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessionInfo *
 
        strWID.u16WIDid = (u16)WID_DEL_ALL_RX_BA;
        strWID.enuWIDtype = WID_STR;
-       strWID.ps8WidVal = (u8 *)WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
+       strWID.ps8WidVal = WILC_MALLOC(BLOCK_ACK_REQ_SIZE);
        strWID.s32ValueSize = BLOCK_ACK_REQ_SIZE;
        ptr = strWID.ps8WidVal;
        *ptr++ = 0x14;
        *ptr++ = 0x3;
        *ptr++ = 0x2;
-       WILC_memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
+       memcpy(ptr, strHostIfBASessionInfo->au8Bssid, ETH_ALEN);
        ptr += ETH_ALEN;
        *ptr++ = strHostIfBASessionInfo->u8Ted;
        /* BA direction = recipent*/
@@ -4301,7 +4305,7 @@ static s32 Handle_DelAllRxBASessions(void *drvHandler, tstrHostIfBASessionInfo *
 
 
        if (strWID.ps8WidVal != NULL)
-               WILC_FREE(strWID.ps8WidVal);
+               kfree(strWID.ps8WidVal);
 
        /*BugID_5222*/
        up(&hWaitResponse);
@@ -4328,7 +4332,7 @@ static int hostIFthread(void *pvArg)
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
 
        while (1) {
-               WILC_MsgQueueRecv(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), &u32Ret, NULL);
+               WILC_MsgQueueRecv(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), &u32Ret);
                pstrWFIDrv = (tstrWILC_WFIDrv *)strHostIFmsg.drvHandler;
                if (strHostIFmsg.u16MsgId == HOST_IF_MSG_EXIT) {
                        PRINT_D(GENERIC_DBG, "THREAD: Exiting HostIfThread\n");
@@ -4339,15 +4343,15 @@ static int hostIFthread(void *pvArg)
                /*Re-Queue HIF message*/
                if ((!g_wilc_initialized)) {
                        PRINT_D(GENERIC_DBG, "--WAIT--");
-                       WILC_Sleep(200);
-                       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+                       usleep_range(200 * 1000, 200 * 1000);
+                       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
                        continue;
                }
 
                if (strHostIFmsg.u16MsgId == HOST_IF_MSG_CONNECT && pstrWFIDrv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
                        PRINT_D(HOSTINF_DBG, "Requeue connect request till scan done received\n");
-                       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
-                       WILC_Sleep(2);
+                       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
+                       usleep_range(2 * 1000, 2 * 1000);
                        continue;
                }
 
@@ -4395,7 +4399,7 @@ static int hostIFthread(void *pvArg)
                        break;
 
                case HOST_IF_MSG_RCVD_SCAN_COMPLETE:
-                       WILC_TimerStop(&(pstrWFIDrv->hScanTimer), NULL);
+                       del_timer(&pstrWFIDrv->hScanTimer);
                        PRINT_D(HOSTINF_DBG, "scan completed successfully\n");
 
                        /*BugID_5213*/
@@ -4542,8 +4546,9 @@ static int hostIFthread(void *pvArg)
        return 0;
 }
 
-static void TimerCB_Scan(void *pvArg)
+static void TimerCB_Scan(unsigned long arg)
 {
+       void *pvArg = (void *)arg;
        tstrHostIFmsg strHostIFmsg;
 
        /* prepare the Timer Callback message */
@@ -4552,11 +4557,12 @@ static void TimerCB_Scan(void *pvArg)
        strHostIFmsg.u16MsgId = HOST_IF_MSG_SCAN_TIMER_FIRED;
 
        /* send the message */
-       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 }
 
-static void TimerCB_Connect(void *pvArg)
+static void TimerCB_Connect(unsigned long arg)
 {
+       void *pvArg = (void *)arg;
        tstrHostIFmsg strHostIFmsg;
 
        /* prepare the Timer Callback message */
@@ -4565,7 +4571,7 @@ static void TimerCB_Connect(void *pvArg)
        strHostIFmsg.u16MsgId = HOST_IF_MSG_CONNECT_TIMER_FIRED;
 
        /* send the message */
-       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 }
 
 
@@ -4582,7 +4588,7 @@ static void TimerCB_Connect(void *pvArg)
  *  @version           1.0
  */
 /* Check implementation in core adding 9 bytes to the input! */
-s32 host_int_remove_key(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8StaAddress)
+s32 host_int_remove_key(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8StaAddress)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -4611,7 +4617,7 @@ s32 host_int_remove_key(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8StaAddress)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv, u8 u8keyIdx)
+s32 host_int_remove_wep_key(tstrWILC_WFIDrv *hWFIDrv, u8 u8keyIdx)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -4636,7 +4642,7 @@ s32 host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv, u8 u8keyIdx)
        uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8keyIdx;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending message queue : Request to remove WEP key\n");
        down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4660,7 +4666,7 @@ s32 host_int_remove_wep_key(WILC_WFIDrvHandle hWFIDrv, u8 u8keyIdx)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv, u8 u8Index)
+s32 host_int_set_WEPDefaultKeyID(tstrWILC_WFIDrv *hWFIDrv, u8 u8Index)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -4684,7 +4690,7 @@ s32 host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv, u8 u8Index)
        uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Index;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending message queue : Default key index\n");
        down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4716,7 +4722,7 @@ s32 host_int_set_WEPDefaultKeyID(WILC_WFIDrvHandle hWFIDrv, u8 u8Index)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx)
+s32 host_int_add_wep_key_bss_sta(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -4738,9 +4744,9 @@ s32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
 
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
-       uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = (u8 *)WILC_MALLOC(u8WepKeylen);
+       uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = WILC_MALLOC(u8WepKeylen);
 
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
                    pu8WepKey, u8WepKeylen);
 
 
@@ -4751,7 +4757,7 @@ s32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
        uniHostIFkeyAttr.strHostIFwepAttr.u8Wepidx = u8Keyidx;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending message queue :WEP Key\n");
        down(&(pstrWFIDrv->hSemTestKeyBlock));
@@ -4781,7 +4787,7 @@ s32 host_int_add_wep_key_bss_sta(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
  *  @date              28 FEB 2013
  *  @version           1.0
  */
-s32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey, u8 u8WepKeylen, u8 u8Keyidx, u8 u8mode, AUTHTYPE_T tenuAuth_type)
+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;
@@ -4807,10 +4813,10 @@ s32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
 
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
-       uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = (u8 *)WILC_MALLOC((u8WepKeylen));
+       uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey = WILC_MALLOC((u8WepKeylen));
 
 
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwepAttr.pu8WepKey,
                    pu8WepKey, (u8WepKeylen));
 
 
@@ -4826,7 +4832,7 @@ s32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
        strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
        uniHostIFkeyAttr.strHostIFwepAttr.tenuAuth_type = tenuAuth_type;
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 
        if (s32Error)
                PRINT_ER("Error in sending message queue :WEP Key\n");
@@ -4856,7 +4862,7 @@ s32 host_int_add_wep_key_bss_ap(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8WepKey,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen,
+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;
@@ -4890,15 +4896,15 @@ s32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen
 
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
-       uniHostIFkeyAttr.strHostIFwpaAttr.pu8key = (u8 *)WILC_MALLOC(u8PtkKeylen);
+       uniHostIFkeyAttr.strHostIFwpaAttr.pu8key = WILC_MALLOC(u8PtkKeylen);
 
 
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                    pu8Ptk, u8PtkKeylen);
 
        if (pu8RxMic != NULL) {
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 16,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 16,
                            pu8RxMic, RX_MIC_KEY_LEN);
                if (INFO) {
                        for (i = 0; i < RX_MIC_KEY_LEN; i++)
@@ -4907,7 +4913,7 @@ s32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen
        }
        if (pu8TxMic != NULL) {
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 24,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 24,
                            pu8TxMic, TX_MIC_KEY_LEN);
                if (INFO) {
                        for (i = 0; i < TX_MIC_KEY_LEN; i++)
@@ -4925,14 +4931,13 @@ s32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 
        if (s32Error)
                PRINT_ER("Error in sending message queue:  PTK Key\n");
 
        /* ////////////// */
        down(&(pstrWFIDrv->hSemTestKeyBlock));
-       /* WILC_Sleep(100); */
        /* /////// */
 
        WILC_CATCH(s32Error)
@@ -4956,7 +4961,7 @@ s32 host_int_add_ptk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8Ptk, u8 u8PtkKeylen
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
+s32 host_int_add_rx_gtk(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkKeylen,
                                u8 u8KeyIdx, u32 u32KeyRSClen, const u8 *KeyRSC,
                                const u8 *pu8RxMic, const u8 *pu8TxMic, u8 mode, u8 u8Ciphermode)
 {
@@ -4977,9 +4982,9 @@ s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkK
                u8KeyLen += TX_MIC_KEY_LEN;
        if (KeyRSC != NULL) {
                strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
-               uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq = (u8 *)WILC_MALLOC(u32KeyRSClen);
+               uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq = WILC_MALLOC(u32KeyRSClen);
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8seq,
                            KeyRSC, u32KeyRSClen);
        }
 
@@ -4999,20 +5004,20 @@ s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkK
 
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
-       uniHostIFkeyAttr.strHostIFwpaAttr.pu8key = (u8 *)WILC_MALLOC(u8KeyLen);
+       uniHostIFkeyAttr.strHostIFwpaAttr.pu8key = WILC_MALLOC(u8KeyLen);
 
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
                    pu8RxGtk, u8GtkKeylen);
 
        if (pu8RxMic != NULL) {
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 16,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 16,
                            pu8RxMic, RX_MIC_KEY_LEN);
 
        }
        if (pu8TxMic != NULL) {
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 24,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key + 24,
                            pu8TxMic, TX_MIC_KEY_LEN);
 
        }
@@ -5028,12 +5033,11 @@ s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkK
 
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending message queue:  RX GTK\n");
        /* ////////////// */
        down(&(pstrWFIDrv->hSemTestKeyBlock));
-       /* WILC_Sleep(100); */
        /* /////// */
 
        WILC_CATCH(s32Error)
@@ -5063,7 +5067,7 @@ s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkK
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_pmkid_info(WILC_WFIDrvHandle hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray)
+s32 host_int_set_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, tstrHostIFpmkidAttr *pu8PmkidInfoArray)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5084,15 +5088,15 @@ s32 host_int_set_pmkid_info(WILC_WFIDrvHandle hWFIDrv, tstrHostIFpmkidAttr *pu8P
 
        for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) {
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid,
                            ETH_ALEN);
 
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid,
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFpmkidAttr.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid,
                            PMKID_LEN);
        }
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER(" Error in sending messagequeue: PMKID Info\n");
 
@@ -5125,7 +5129,7 @@ s32 host_int_set_pmkid_info(WILC_WFIDrvHandle hWFIDrv, tstrHostIFpmkidAttr *pu8P
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_pmkid_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PmkidInfoArray,
+s32 host_int_get_pmkid_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PmkidInfoArray,
                                    u32 u32PmkidInfoLen)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -5154,14 +5158,12 @@ s32 host_int_get_pmkid_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PmkidInfoArray,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PassPhrase,
+s32 host_int_set_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8PassPhrase,
                                                 u8 u8Psklength)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
-       /* tstrWILC_WFIDrv * pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv; */
 
-       /* u8 u8Psklength = WILC_strlen(pu8PassPhrase); */
        /*validating psk length*/
        if ((u8Psklength > 7) && (u8Psklength < 65)) {
                strWID.u16WIDid = (u16)WID_11I_PSK;
@@ -5183,7 +5185,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv, u8 *pu8PassP
  *  @date              19 April 2012
  *  @version           1.0
  */
-s32 host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
+s32 host_int_get_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -5196,7 +5198,7 @@ s32 host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
        strHostIFmsg.uniHostIFmsgBody.strHostIfGetMacAddress.u8MacAddress = pu8MacAddress;
        strHostIFmsg.drvHandler = hWFIDrv;
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send get mac address\n");
                return WILC_FAIL;
@@ -5217,7 +5219,7 @@ s32 host_int_get_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
  *  @date              16 July 2012
  *  @version           1.0
  */
-s32 host_int_set_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
+s32 host_int_set_MacAddress(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8MacAddress)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -5227,10 +5229,10 @@ s32 host_int_set_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
        /* prepare setting mac address message */
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
        strHostIFmsg.u16MsgId = HOST_IF_MSG_SET_MAC_ADDRESS;
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIfSetMacAddress.u8MacAddress, pu8MacAddress, ETH_ALEN);
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIfSetMacAddress.u8MacAddress, pu8MacAddress, ETH_ALEN);
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send message queue: Set mac address\n");
                WILC_ERRORREPORT(s32Error, s32Error);
@@ -5258,7 +5260,7 @@ s32 host_int_set_MacAddress(WILC_WFIDrvHandle hWFIDrv, u8 *pu8MacAddress)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv,
+s32 host_int_get_RSNAConfigPSKPassPhrase(tstrWILC_WFIDrv *hWFIDrv,
                                                 u8 *pu8PassPhrase, u8 u8Psklength)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -5305,7 +5307,7 @@ s32 host_int_get_RSNAConfigPSKPassPhrase(WILC_WFIDrvHandle hWFIDrv,
  *  @version           1.0
  */
 #ifndef CONNECT_DIRECT
-s32 host_int_get_site_survey_results(WILC_WFIDrvHandle hWFIDrv,
+s32 host_int_get_site_survey_results(tstrWILC_WFIDrv *hWFIDrv,
                                             u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZE],
                                             u32 u32MaxSiteSrvyFragLen)
 {
@@ -5355,7 +5357,7 @@ s32 host_int_get_site_survey_results(WILC_WFIDrvHandle hWFIDrv,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 scanSource)
+s32 host_int_set_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 scanSource)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -5385,7 +5387,7 @@ s32 host_int_set_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 scanSource)
  *  @version           1.0
  */
 
-s32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ScanSource)
+s32 host_int_get_start_scan_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ScanSource)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -5410,7 +5412,7 @@ s32 host_int_get_start_scan_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ScanSource)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
+s32 host_int_set_join_req(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8bssid,
                                  const u8 *pu8ssid, size_t ssidLen,
                                  const u8 *pu8IEs, size_t IEsLen,
                                  tWILCpfConnectResult pfConnectResult, void *pvUserArg,
@@ -5457,23 +5459,23 @@ s32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
        strHostIFmsg.drvHandler = hWFIDrv;
 
        if (pu8bssid != NULL) {
-               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8bssid = (u8 *)WILC_MALLOC(6); /* will be deallocated by the receiving thread */
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8bssid,
+               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8bssid = WILC_MALLOC(6); /* will be deallocated by the receiving thread */
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8bssid,
                            pu8bssid, 6);
        }
 
        if (pu8ssid != NULL) {
                strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.ssidLen = ssidLen;
-               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8ssid = (u8 *)WILC_MALLOC(ssidLen); /* will be deallocated by the receiving thread */
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8ssid,
+               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8ssid = WILC_MALLOC(ssidLen); /* will be deallocated by the receiving thread */
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8ssid,
 
                            pu8ssid, ssidLen);
        }
 
        if (pu8IEs != NULL) {
                strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.IEsLen = IEsLen;
-               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8IEs = (u8 *)WILC_MALLOC(IEsLen); /* will be deallocated by the receiving thread */
-               WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8IEs,
+               strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8IEs = WILC_MALLOC(IEsLen); /* will be deallocated by the receiving thread */
+               memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFconnectAttr.pu8IEs,
                            pu8IEs, IEsLen);
        }
        if (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTING)
@@ -5482,14 +5484,16 @@ s32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
                PRINT_D(GENERIC_DBG, "Don't set state to 'connecting' as state is %d\n", pstrWFIDrv->enuHostIFstate);
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send message queue: Set join request\n");
                WILC_ERRORREPORT(s32Error, WILC_FAIL);
        }
 
        enuScanConnTimer = CONNECT_TIMER;
-       WILC_TimerStart(&(pstrWFIDrv->hConnectTimer), HOST_IF_CONNECT_TIMEOUT, (void *) hWFIDrv, NULL);
+       pstrWFIDrv->hConnectTimer.data = (unsigned long)hWFIDrv;
+       mod_timer(&pstrWFIDrv->hConnectTimer,
+                 jiffies + msecs_to_jiffies(HOST_IF_CONNECT_TIMEOUT));
 
        WILC_CATCH(s32Error)
        {
@@ -5511,7 +5515,7 @@ s32 host_int_set_join_req(WILC_WFIDrvHandle hWFIDrv, u8 *pu8bssid,
  *  @version   8.0
  */
 
-s32 host_int_flush_join_req(WILC_WFIDrvHandle hWFIDrv)
+s32 host_int_flush_join_req(tstrWILC_WFIDrv *hWFIDrv)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -5530,7 +5534,7 @@ s32 host_int_flush_join_req(WILC_WFIDrvHandle hWFIDrv)
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send message queue: Flush join request\n");
                WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -5554,7 +5558,7 @@ s32 host_int_flush_join_req(WILC_WFIDrvHandle hWFIDrv)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_disconnect(WILC_WFIDrvHandle hWFIDrv, u16 u16ReasonCode)
+s32 host_int_disconnect(tstrWILC_WFIDrv *hWFIDrv, u16 u16ReasonCode)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -5577,7 +5581,7 @@ s32 host_int_disconnect(WILC_WFIDrvHandle hWFIDrv, u16 u16ReasonCode)
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Failed to send message queue: disconnect\n");
        /* ////////////// */
@@ -5603,7 +5607,7 @@ s32 host_int_disconnect(WILC_WFIDrvHandle hWFIDrv, u16 u16ReasonCode)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_disconnect_station(WILC_WFIDrvHandle hWFIDrv, u8 assoc_id)
+s32 host_int_disconnect_station(tstrWILC_WFIDrv *hWFIDrv, u8 assoc_id)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -5643,7 +5647,7 @@ s32 host_int_disconnect_station(WILC_WFIDrvHandle hWFIDrv, u8 assoc_id)
  *  @version           1.0
  */
 
-s32 host_int_get_assoc_req_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocReqInfo,
+s32 host_int_get_assoc_req_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocReqInfo,
                                        u32 u32AssocReqInfoLen)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -5670,7 +5674,7 @@ s32 host_int_get_assoc_req_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocReqInfo,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_assoc_res_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocRespInfo,
+s32 host_int_get_assoc_res_info(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8AssocRespInfo,
                                        u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -5720,7 +5724,7 @@ s32 host_int_get_assoc_res_info(WILC_WFIDrvHandle hWFIDrv, u8 *pu8AssocRespInfo,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_rx_power_level(WILC_WFIDrvHandle hWFIDrv, u8 *pu8RxPowerLevel,
+s32 host_int_get_rx_power_level(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8RxPowerLevel,
                                        u32 u32RxPowerLevelLen)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -5751,7 +5755,7 @@ s32 host_int_get_rx_power_level(WILC_WFIDrvHandle hWFIDrv, u8 *pu8RxPowerLevel,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_set_mac_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 u8ChNum)
+s32 host_int_set_mac_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 u8ChNum)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5766,7 +5770,7 @@ s32 host_int_set_mac_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 u8ChNum)
        strHostIFmsg.uniHostIFmsgBody.strHostIFSetChan.u8SetChan = u8ChNum;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -5788,7 +5792,7 @@ s32 host_int_wait_msg_queue_idle(void)
 
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
        strHostIFmsg.u16MsgId = HOST_IF_MSG_Q_IDLE;
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -5803,7 +5807,7 @@ s32 host_int_wait_msg_queue_idle(void)
 
 }
 
-s32 host_int_set_wfi_drv_handler(u32 u32address)
+s32 host_int_set_wfi_drv_handler(tstrWILC_WFIDrv *u32address)
 {
        s32 s32Error = WILC_SUCCESS;
 
@@ -5817,7 +5821,7 @@ s32 host_int_set_wfi_drv_handler(u32 u32address)
        strHostIFmsg.uniHostIFmsgBody.strHostIfSetDrvHandler.u32Address = u32address;
        /* strHostIFmsg.drvHandler=hWFIDrv; */
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -5830,7 +5834,7 @@ s32 host_int_set_wfi_drv_handler(u32 u32address)
 
 
 
-s32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, u32 u32mode)
+s32 host_int_set_operation_mode(tstrWILC_WFIDrv *hWFIDrv, u32 u32mode)
 {
        s32 s32Error = WILC_SUCCESS;
 
@@ -5844,7 +5848,7 @@ s32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, u32 u32mode)
        strHostIFmsg.uniHostIFmsgBody.strHostIfSetOperationMode.u32Mode = u32mode;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -5870,7 +5874,7 @@ s32 host_int_set_operation_mode(WILC_WFIDrvHandle hWFIDrv, u32 u32mode)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ChNo)
+s32 host_int_get_host_chnl_num(tstrWILC_WFIDrv *hWFIDrv, u8 *pu8ChNo)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5888,7 +5892,7 @@ s32 host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ChNo)
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Failed to send get host channel param's message queue ");
        down(&(pstrWFIDrv->hSemGetCHNL));
@@ -5916,7 +5920,7 @@ s32 host_int_get_host_chnl_num(WILC_WFIDrvHandle hWFIDrv, u8 *pu8ChNo)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_test_set_int_wid(WILC_WFIDrvHandle hWFIDrv, u32 u32TestMemAddr)
+s32 host_int_test_set_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 u32TestMemAddr)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWID strWID;
@@ -5963,7 +5967,7 @@ s32 host_int_test_set_int_wid(WILC_WFIDrvHandle hWFIDrv, u32 u32TestMemAddr)
  *  @date
  *  @version           1.0
  */
-s32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
+s32 host_int_get_inactive_time(tstrWILC_WFIDrv *hWFIDrv, const u8 *mac, u32 *pu32InactiveTime)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -5977,14 +5981,14 @@ s32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, u32 *pu
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
 
 
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIfStaInactiveT.mac,
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIfStaInactiveT.mac,
                    mac, ETH_ALEN);
 
        strHostIFmsg.u16MsgId = HOST_IF_MSG_GET_INACTIVETIME;
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Failed to send get host channel param's message queue ");
 
@@ -6009,7 +6013,7 @@ s32 host_int_get_inactive_time(WILC_WFIDrvHandle hWFIDrv, const u8 *mac, u32 *pu
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_test_get_int_wid(WILC_WFIDrvHandle hWFIDrv, u32 *pu32TestMemAddr)
+s32 host_int_test_get_int_wid(tstrWILC_WFIDrv *hWFIDrv, u32 *pu32TestMemAddr)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -6058,7 +6062,7 @@ s32 host_int_test_get_int_wid(WILC_WFIDrvHandle hWFIDrv, u32 *pu32TestMemAddr)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv, s8 *ps8Rssi)
+s32 host_int_get_rssi(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8Rssi)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -6072,7 +6076,7 @@ s32 host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv, s8 *ps8Rssi)
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send get host channel param's message queue ");
                return WILC_FAIL;
@@ -6093,7 +6097,7 @@ s32 host_int_get_rssi(WILC_WFIDrvHandle hWFIDrv, s8 *ps8Rssi)
        return s32Error;
 }
 
-s32 host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv, s8 *ps8lnkspd)
+s32 host_int_get_link_speed(tstrWILC_WFIDrv *hWFIDrv, s8 *ps8lnkspd)
 {
        tstrHostIFmsg strHostIFmsg;
        s32 s32Error = WILC_SUCCESS;
@@ -6109,7 +6113,7 @@ s32 host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv, s8 *ps8lnkspd)
        strHostIFmsg.drvHandler = hWFIDrv;
 
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send GET_LINKSPEED to message queue ");
                return WILC_FAIL;
@@ -6130,7 +6134,7 @@ s32 host_int_get_link_speed(WILC_WFIDrvHandle hWFIDrv, s8 *ps8lnkspd)
        return s32Error;
 }
 
-s32 host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv, tstrStatistics *pstrStatistics)
+s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -6143,7 +6147,7 @@ s32 host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv, tstrStatistics *pstrStati
        strHostIFmsg.uniHostIFmsgBody.pUserData = (char *)pstrStatistics;
        strHostIFmsg.drvHandler = hWFIDrv;
        /* send the message */
-       s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Failed to send get host channel param's message queue ");
                return WILC_FAIL;
@@ -6170,7 +6174,7 @@ s32 host_int_get_statistics(WILC_WFIDrvHandle hWFIDrv, tstrStatistics *pstrStati
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 host_int_scan(WILC_WFIDrvHandle hWFIDrv, u8 u8ScanSource,
+s32 host_int_scan(tstrWILC_WFIDrv *hWFIDrv, u8 u8ScanSource,
                          u8 u8ScanType, u8 *pu8ChnlFreqList,
                          u8 u8ChnlListLen, const u8 *pu8IEs,
                          size_t IEsLen, tWILCpfScanResult ScanResult,
@@ -6204,17 +6208,17 @@ s32 host_int_scan(WILC_WFIDrvHandle hWFIDrv, u8 u8ScanSource,
        strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pvUserArg = pvUserArg;
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.u8ChnlListLen = u8ChnlListLen;
-       strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8ChnlFreqList = (u8 *)WILC_MALLOC(u8ChnlListLen);        /* will be deallocated by the receiving thread */
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8ChnlFreqList,
+       strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8ChnlFreqList = WILC_MALLOC(u8ChnlListLen);        /* will be deallocated by the receiving thread */
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8ChnlFreqList,
                    pu8ChnlFreqList, u8ChnlListLen);
 
        strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.IEsLen = IEsLen;
-       strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8IEs = (u8 *)WILC_MALLOC(IEsLen);        /* will be deallocated by the receiving thread */
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8IEs,
+       strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8IEs = WILC_MALLOC(IEsLen);        /* will be deallocated by the receiving thread */
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFscanAttr.pu8IEs,
                    pu8IEs, IEsLen);
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error) {
                PRINT_ER("Error in sending message queue scanning parameters: Error(%d)\n", s32Error);
                WILC_ERRORREPORT(s32Error, WILC_FAIL);
@@ -6222,8 +6226,9 @@ s32 host_int_scan(WILC_WFIDrvHandle hWFIDrv, u8 u8ScanSource,
 
        enuScanConnTimer = SCAN_TIMER;
        PRINT_D(HOSTINF_DBG, ">> Starting the SCAN timer\n");
-       WILC_TimerStart(&(pstrWFIDrv->hScanTimer), HOST_IF_SCAN_TIMEOUT, (void *) hWFIDrv, NULL);
-
+       pstrWFIDrv->hScanTimer.data = (unsigned long)hWFIDrv;
+       mod_timer(&pstrWFIDrv->hScanTimer,
+                 jiffies + msecs_to_jiffies(HOST_IF_SCAN_TIMEOUT));
 
        WILC_CATCH(s32Error)
        {
@@ -6243,7 +6248,7 @@ s32 host_int_scan(WILC_WFIDrvHandle hWFIDrv, u8 u8ScanSource,
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 hif_set_cfg(WILC_WFIDrvHandle hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
+s32 hif_set_cfg(tstrWILC_WFIDrv *hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
 {
 
        s32 s32Error = WILC_SUCCESS;
@@ -6260,7 +6265,7 @@ s32 hif_set_cfg(WILC_WFIDrvHandle hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
        strHostIFmsg.uniHostIFmsgBody.strHostIFCfgParamAttr.pstrCfgParamVal = *pstrCfgParamVal;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 
        WILC_CATCH(s32Error)
        {
@@ -6284,7 +6289,7 @@ s32 hif_set_cfg(WILC_WFIDrvHandle hWFIDrv, tstrCfgParamVal *pstrCfgParamVal)
  *  @date              8 March 2012
  *  @version           1.0
  */
-s32 hif_get_cfg(WILC_WFIDrvHandle hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
+s32 hif_get_cfg(tstrWILC_WFIDrv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6419,9 +6424,9 @@ void host_int_send_join_leave_info_to_host
  *  @version           1.0
  */
 
-void GetPeriodicRSSI(void *pvArg)
+static void GetPeriodicRSSI(unsigned long arg)
 {
-       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)pvArg;
+       tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)arg;
 
        if (pstrWFIDrv == NULL) {
                PRINT_ER("Driver handler is NULL\n");
@@ -6439,13 +6444,14 @@ void GetPeriodicRSSI(void *pvArg)
                strHostIFmsg.drvHandler = pstrWFIDrv;
 
                /* send the message */
-               s32Error =      WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+               s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
                if (s32Error) {
                        PRINT_ER("Failed to send get host channel param's message queue ");
                        return;
                }
        }
-       WILC_TimerStart(&(g_hPeriodicRSSI), 5000, (void *)pstrWFIDrv, NULL);
+       g_hPeriodicRSSI.data = (unsigned long)pstrWFIDrv;
+       mod_timer(&g_hPeriodicRSSI, jiffies + msecs_to_jiffies(5000));
 }
 
 
@@ -6466,7 +6472,7 @@ static u32 u32Intialized;
 static u32 msgQ_created;
 static u32 clients_count;
 
-s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
+s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv;
@@ -6486,7 +6492,7 @@ s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 
 
        /*Allocate host interface private structure*/
-       pstrWFIDrv  = (tstrWILC_WFIDrv *)WILC_MALLOC(sizeof(tstrWILC_WFIDrv));
+       pstrWFIDrv  = WILC_MALLOC(sizeof(tstrWILC_WFIDrv));
        if (pstrWFIDrv == NULL) {
                /* WILC_ERRORREPORT(s32Error,WILC_NO_MEM); */
                s32Error = WILC_NO_MEM;
@@ -6495,7 +6501,7 @@ s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
        }
        memset(pstrWFIDrv, 0, sizeof(tstrWILC_WFIDrv));
        /*return driver handle to user*/
-       *phWFIDrv = (WILC_WFIDrvHandle)pstrWFIDrv;
+       *phWFIDrv = pstrWFIDrv;
        /*save into globl handle*/
 
        #ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
@@ -6526,9 +6532,7 @@ s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
        PRINT_D(HOSTINF_DBG, "INIT: CLIENT COUNT %d\n", clients_count);
 
        if (clients_count == 0) {
-
-               s32Error = WILC_MsgQueueCreate(&gMsgQHostIF, NULL);
-
+               s32Error = WILC_MsgQueueCreate(&gMsgQHostIF);
 
                if (s32Error < 0) {
                        PRINT_ER("Failed to creat MQ\n");
@@ -6541,36 +6545,19 @@ s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
                        s32Error = WILC_FAIL;
                        goto _fail_mq_;
                }
-               s32Error = WILC_TimerCreate(&(g_hPeriodicRSSI), GetPeriodicRSSI, NULL);
-               if (s32Error < 0) {
-                       PRINT_ER("Failed to creat Timer\n");
-                       goto _fail_timer_1;
-               }
-               WILC_TimerStart(&(g_hPeriodicRSSI), 5000, (void *)pstrWFIDrv, NULL);
-
+               setup_timer(&g_hPeriodicRSSI, GetPeriodicRSSI,
+                           (unsigned long)pstrWFIDrv);
+               mod_timer(&g_hPeriodicRSSI, jiffies + msecs_to_jiffies(5000));
        }
 
 
-       s32Error = WILC_TimerCreate(&(pstrWFIDrv->hScanTimer), TimerCB_Scan, NULL);
-       if (s32Error < 0) {
-               PRINT_ER("Failed to creat Timer\n");
-               goto _fail_thread_;
-       }
-
-       s32Error = WILC_TimerCreate(&(pstrWFIDrv->hConnectTimer), TimerCB_Connect, NULL);
-       if (s32Error < 0) {
-               PRINT_ER("Failed to creat Timer\n");
-               goto _fail_timer_1;
-       }
+       setup_timer(&pstrWFIDrv->hScanTimer, TimerCB_Scan, 0);
 
+       setup_timer(&pstrWFIDrv->hConnectTimer, TimerCB_Connect, 0);
 
        #ifdef WILC_P2P
        /*Remain on channel timer*/
-       s32Error = WILC_TimerCreate(&(pstrWFIDrv->hRemainOnChannel), ListenTimerCB, NULL);
-       if (s32Error < 0) {
-               PRINT_ER("Failed to creat Remain-on-channel Timer\n");
-               goto _fail_timer_3;
-       }
+       setup_timer(&pstrWFIDrv->hRemainOnChannel, ListenTimerCB, 0);
        #endif
 
        sema_init(&(pstrWFIDrv->gtOsCfgValuesSem), 1);
@@ -6619,20 +6606,17 @@ s32 host_int_init(WILC_WFIDrvHandle *phWFIDrv)
 
 _fail_mem_:
        if (pstrWFIDrv != NULL)
-               WILC_FREE(pstrWFIDrv);
+               kfree(pstrWFIDrv);
 #ifdef WILC_P2P
-_fail_timer_3:
-       WILC_TimerDestroy(&(pstrWFIDrv->hRemainOnChannel), NULL);
+       del_timer_sync(&pstrWFIDrv->hRemainOnChannel);
 #endif
 _fail_timer_2:
        up(&(pstrWFIDrv->gtOsCfgValuesSem));
-       WILC_TimerDestroy(&(pstrWFIDrv->hConnectTimer), NULL);
-_fail_timer_1:
-       WILC_TimerDestroy(&(pstrWFIDrv->hScanTimer), NULL);
-_fail_thread_:
+       del_timer_sync(&pstrWFIDrv->hConnectTimer);
+       del_timer_sync(&pstrWFIDrv->hScanTimer);
        kthread_stop(HostIFthreadHandler);
 _fail_mq_:
-       WILC_MsgQueueDestroy(&gMsgQHostIF, NULL);
+       WILC_MsgQueueDestroy(&gMsgQHostIF);
 _fail_:
        return s32Error;
 
@@ -6648,7 +6632,7 @@ _fail_:
  *  @version           1.0
  */
 
-s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
+s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrHostIFmsg strHostIFmsg;
@@ -6677,28 +6661,28 @@ s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
        /*BugID_5348*/
        /*Destroy all timers before acquiring hSemDeinitDrvHandle*/
        /*to guarantee handling all messages befor proceeding*/
-       if (WILC_TimerDestroy(&(pstrWFIDrv->hScanTimer), NULL)) {
+       if (del_timer_sync(&pstrWFIDrv->hScanTimer)) {
                PRINT_D(HOSTINF_DBG, ">> Scan timer is active\n");
                /* msleep(HOST_IF_SCAN_TIMEOUT+1000); */
        }
 
-       if (WILC_TimerDestroy(&(pstrWFIDrv->hConnectTimer), NULL)) {
+       if (del_timer_sync(&pstrWFIDrv->hConnectTimer)) {
                PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
                /* msleep(HOST_IF_CONNECT_TIMEOUT+1000); */
        }
 
 
-       if (WILC_TimerDestroy(&(g_hPeriodicRSSI), NULL)) {
+       if (del_timer_sync(&g_hPeriodicRSSI)) {
                PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
                /* msleep(HOST_IF_CONNECT_TIMEOUT+1000); */
        }
 
        #ifdef WILC_P2P
        /*Destroy Remain-onchannel Timer*/
-       WILC_TimerDestroy(&(pstrWFIDrv->hRemainOnChannel), NULL);
+       del_timer_sync(&pstrWFIDrv->hRemainOnChannel);
        #endif
 
-       host_int_set_wfi_drv_handler((u32)NULL);
+       host_int_set_wfi_drv_handler(NULL);
        down(&hSemDeinitDrvHandle);
 
 
@@ -6719,7 +6703,7 @@ s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
 
        if (clients_count == 1) {
-               if (WILC_TimerDestroy(&g_hPeriodicRSSI, NULL)) {
+               if (del_timer_sync(&g_hPeriodicRSSI)) {
                        PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
                        /* msleep(HOST_IF_CONNECT_TIMEOUT+1000); */
                }
@@ -6727,15 +6711,13 @@ s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
                strHostIFmsg.drvHandler = hWFIDrv;
 
 
-               s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+               s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
                if (s32Error != WILC_SUCCESS)
                        PRINT_ER("Error in sending deinit's message queue message function: Error(%d)\n", s32Error);
 
                down(&hSemHostIFthrdEnd);
 
-
-
-               WILC_MsgQueueDestroy(&gMsgQHostIF, NULL);
+               WILC_MsgQueueDestroy(&gMsgQHostIF);
                msgQ_created = 0;
        }
 
@@ -6745,7 +6727,7 @@ s32 host_int_deinit(WILC_WFIDrvHandle hWFIDrv)
        u32Intialized = 0;
        /* gWFiDrvHandle = NULL; */
        if (pstrWFIDrv != NULL) {
-               WILC_FREE(pstrWFIDrv);
+               kfree(pstrWFIDrv);
                /* pstrWFIDrv=NULL; */
 
        }
@@ -6793,17 +6775,14 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
        strHostIFmsg.drvHandler = pstrWFIDrv;
 
        strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.u32Length = u32Length;
-       strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.pu8Buffer = (u8 *)WILC_MALLOC(u32Length); /* will be deallocated by the receiving thread */
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.pu8Buffer,
+       strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.pu8Buffer = WILC_MALLOC(u32Length); /* will be deallocated by the receiving thread */
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strRcvdNetworkInfo.pu8Buffer,
                    pu8Buffer, u32Length);
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", s32Error);
-
-
-       return;
 }
 
 /**
@@ -6856,18 +6835,17 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
 
 
        strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.u32Length = u32Length;
-       strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.pu8Buffer = (u8 *)WILC_MALLOC(u32Length); /* will be deallocated by the receiving thread */
-       WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.pu8Buffer,
+       strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.pu8Buffer = WILC_MALLOC(u32Length); /* will be deallocated by the receiving thread */
+       memcpy(strHostIFmsg.uniHostIFmsgBody.strRcvdGnrlAsyncInfo.pu8Buffer,
                    pu8Buffer, u32Length);
 
        /* send the message */
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                PRINT_ER("Error in sending message queue asynchronous message info: Error(%d)\n", s32Error);
 
        /*BugID_5348*/
        up(&hSemHostIntDeinit);
-       return;
 }
 
 /**
@@ -6909,11 +6887,11 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
 
                /*strHostIFmsg.uniHostIFmsgBody.strScanComplete.u32Length = u32Length;
                 * strHostIFmsg.uniHostIFmsgBody.strScanComplete.pu8Buffer  = (u8*)WILC_MALLOC(u32Length);
-                * WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strScanComplete.pu8Buffer,
+                * memcpy(strHostIFmsg.uniHostIFmsgBody.strScanComplete.pu8Buffer,
                 *                        pu8Buffer, u32Length); */
 
                /* send the message */
-               s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+               s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
                if (s32Error)
                        PRINT_ER("Error in sending message queue scan complete parameters: Error(%d)\n", s32Error);
        }
@@ -6938,7 +6916,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
  *  @date
  *  @version           1.0
  */
-s32 host_int_remain_on_channel(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID, u32 u32duration, u16 chan, tWILCpfRemainOnChanExpired RemainOnChanExpired, tWILCpfRemainOnChanReady RemainOnChanReady, void *pvUserArg)
+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;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6960,7 +6938,7 @@ s32 host_int_remain_on_channel(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID, u32
        strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan.u32ListenSessionID = u32SessionID;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -6985,7 +6963,7 @@ s32 host_int_remain_on_channel(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID, u32
  *  @date
  *  @version           1.0
  */
-s32 host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID)
+s32 host_int_ListenStateExpired(tstrWILC_WFIDrv *hWFIDrv, u32 u32SessionID)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -6995,7 +6973,7 @@ s32 host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID)
                WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
 
        /*Stopping remain-on-channel timer*/
-       WILC_TimerStop(&(pstrWFIDrv->hRemainOnChannel), NULL);
+       del_timer(&pstrWFIDrv->hRemainOnChannel);
 
        /* prepare the timer fire Message */
        memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
@@ -7003,7 +6981,7 @@ s32 host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID)
        strHostIFmsg.drvHandler = hWFIDrv;
        strHostIFmsg.uniHostIFmsgBody.strHostIfRemainOnChan.u32ListenSessionID = u32SessionID;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7021,7 +6999,7 @@ s32 host_int_ListenStateExpired(WILC_WFIDrvHandle hWFIDrv, u32 u32SessionID)
  *  @author
  *  @date
  *  @version           1.0*/
-s32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, u16 u16FrameType, bool bReg)
+s32 host_int_frame_register(tstrWILC_WFIDrv *hWFIDrv, u16 u16FrameType, bool bReg)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7053,7 +7031,7 @@ s32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, u16 u16FrameType, bool bR
        strHostIFmsg.uniHostIFmsgBody.strHostIfRegisterFrame.bReg = bReg;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7079,7 +7057,7 @@ s32 host_int_frame_register(WILC_WFIDrvHandle hWFIDrv, u16 u16FrameType, bool bR
  *  @date
  *  @version   1.0
  */
-s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval,
+s32 host_int_add_beacon(tstrWILC_WFIDrv *hWFIDrv, u32 u32Interval,
                                u32 u32DTIMPeriod,
                                u32 u32HeadLen, u8 *pu8Head,
                                u32 u32TailLen, u8 *pu8Tail)
@@ -7103,33 +7081,33 @@ s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval,
        pstrSetBeaconParam->u32Interval = u32Interval;
        pstrSetBeaconParam->u32DTIMPeriod = u32DTIMPeriod;
        pstrSetBeaconParam->u32HeadLen = u32HeadLen;
-       pstrSetBeaconParam->pu8Head = (u8 *)WILC_MALLOC(u32HeadLen);
+       pstrSetBeaconParam->pu8Head = WILC_MALLOC(u32HeadLen);
        if (pstrSetBeaconParam->pu8Head == NULL)
                WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
-       WILC_memcpy(pstrSetBeaconParam->pu8Head, pu8Head, u32HeadLen);
+       memcpy(pstrSetBeaconParam->pu8Head, pu8Head, u32HeadLen);
        pstrSetBeaconParam->u32TailLen = u32TailLen;
 
        /* Bug 4599 : if tail length = 0 skip allocating & copying */
        if (u32TailLen > 0) {
-               pstrSetBeaconParam->pu8Tail = (u8 *)WILC_MALLOC(u32TailLen);
+               pstrSetBeaconParam->pu8Tail = WILC_MALLOC(u32TailLen);
                if (pstrSetBeaconParam->pu8Tail == NULL)
                        WILC_ERRORREPORT(s32Error, WILC_NO_MEM);
-               WILC_memcpy(pstrSetBeaconParam->pu8Tail, pu8Tail, u32TailLen);
+               memcpy(pstrSetBeaconParam->pu8Tail, pu8Tail, u32TailLen);
        } else {
                pstrSetBeaconParam->pu8Tail = NULL;
        }
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
 
        WILC_CATCH(s32Error)
        {
                if (pstrSetBeaconParam->pu8Head != NULL)
-                       WILC_FREE(pstrSetBeaconParam->pu8Head);
+                       kfree(pstrSetBeaconParam->pu8Head);
 
                if (pstrSetBeaconParam->pu8Tail != NULL)
-                       WILC_FREE(pstrSetBeaconParam->pu8Tail);
+                       kfree(pstrSetBeaconParam->pu8Tail);
        }
 
        return s32Error;
@@ -7146,7 +7124,7 @@ s32 host_int_add_beacon(WILC_WFIDrvHandle hWFIDrv, u32 u32Interval,
  *  @date
  *  @version   1.0
  */
-s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
+s32 host_int_del_beacon(tstrWILC_WFIDrv *hWFIDrv)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7160,7 +7138,7 @@ s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
        strHostIFmsg.drvHandler = hWFIDrv;
        PRINT_D(HOSTINF_DBG, "Setting deleting beacon message queue params\n");
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        WILC_ERRORCHECK(s32Error);
 
        WILC_CATCH(s32Error)
@@ -7179,7 +7157,7 @@ s32 host_int_del_beacon(WILC_WFIDrvHandle hWFIDrv)
  *  @date
  *  @version   1.0
  */
-s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
+s32 host_int_add_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7199,18 +7177,18 @@ s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrSt
        strHostIFmsg.u16MsgId = HOST_IF_MSG_ADD_STATION;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       WILC_memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
+       memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
        if (pstrAddStationMsg->u8NumRates > 0) {
                u8 *rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
 
                WILC_NULLCHECK(s32Error, rates);
 
-               WILC_memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
+               memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
                pstrAddStationMsg->pu8Rates = rates;
        }
 
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
 
@@ -7229,7 +7207,7 @@ s32 host_int_add_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrSt
  *  @date
  *  @version   1.0
  */
-s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr)
+s32 host_int_del_station(tstrWILC_WFIDrv *hWFIDrv, const u8 *pu8MacAddr)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7253,9 +7231,9 @@ s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr)
        if (pu8MacAddr == NULL)
                memset(pstrDelStationMsg->au8MacAddr, 255, ETH_ALEN);
        else
-               WILC_memcpy(pstrDelStationMsg->au8MacAddr, pu8MacAddr, ETH_ALEN);
+               memcpy(pstrDelStationMsg->au8MacAddr, pu8MacAddr, ETH_ALEN);
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
 
@@ -7273,7 +7251,7 @@ s32 host_int_del_station(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8MacAddr)
  *  @date
  *  @version   1.0
  */
-s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
+s32 host_int_del_allstation(tstrWILC_WFIDrv *hWFIDrv, u8 pu8MacAddr[][ETH_ALEN])
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7298,7 +7276,7 @@ s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]
        /* Handling situation of deauthenticing all associated stations*/
        for (i = 0; i < MAX_NUM_STA; i++) {
                if (memcmp(pu8MacAddr[i], au8Zero_Buff, ETH_ALEN)) {
-                       WILC_memcpy(pstrDelAllStationMsg->au8Sta_DelAllSta[i], pu8MacAddr[i], ETH_ALEN);
+                       memcpy(pstrDelAllStationMsg->au8Sta_DelAllSta[i], pu8MacAddr[i], ETH_ALEN);
                        PRINT_D(CFG80211_DBG, "BSSID = %x%x%x%x%x%x\n", pstrDelAllStationMsg->au8Sta_DelAllSta[i][0], pstrDelAllStationMsg->au8Sta_DelAllSta[i][1], pstrDelAllStationMsg->au8Sta_DelAllSta[i][2], pstrDelAllStationMsg->au8Sta_DelAllSta[i][3], pstrDelAllStationMsg->au8Sta_DelAllSta[i][4],
                                pstrDelAllStationMsg->au8Sta_DelAllSta[i][5]);
                        u8AssocNumb++;
@@ -7310,7 +7288,7 @@ s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]
        }
 
        pstrDelAllStationMsg->u8Num_AssocSta = u8AssocNumb;
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
 
 
        if (s32Error)
@@ -7335,7 +7313,7 @@ s32 host_int_del_allstation(WILC_WFIDrvHandle hWFIDrv, u8 pu8MacAddr[][ETH_ALEN]
  *  @date
  *  @version   1.0
  */
-s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
+s32 host_int_edit_station(tstrWILC_WFIDrv *hWFIDrv, tstrWILC_AddStaParam *pstrStaParams)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7354,16 +7332,16 @@ s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrS
        strHostIFmsg.u16MsgId = HOST_IF_MSG_EDIT_STATION;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       WILC_memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
+       memcpy(pstrAddStationMsg, pstrStaParams, sizeof(tstrWILC_AddStaParam));
        if (pstrAddStationMsg->u8NumRates > 0) {
                u8 *rates = WILC_MALLOC(pstrAddStationMsg->u8NumRates);
 
                WILC_NULLCHECK(s32Error, rates);
-               WILC_memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
+               memcpy(rates, pstrStaParams->pu8Rates, pstrAddStationMsg->u8NumRates);
                pstrAddStationMsg->pu8Rates = rates;
        }
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7374,7 +7352,7 @@ s32 host_int_edit_station(WILC_WFIDrvHandle hWFIDrv, tstrWILC_AddStaParam *pstrS
 #endif /*WILC_AP_EXTERNAL_MLME*/
 uint32_t wilc_get_chipid(uint8_t);
 
-s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32Timeout)
+s32 host_int_set_power_mgmt(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32Timeout)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7399,7 +7377,7 @@ s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32T
        pstrPowerMgmtParam->u32Timeout = u32Timeout;
 
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7408,7 +7386,7 @@ s32 host_int_set_power_mgmt(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32T
        return s32Error;
 }
 
-s32 host_int_setup_multicast_filter(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled, u32 u32count)
+s32 host_int_setup_multicast_filter(tstrWILC_WFIDrv *hWFIDrv, bool bIsEnabled, u32 u32count)
 {
        s32 s32Error = WILC_SUCCESS;
 
@@ -7432,7 +7410,7 @@ s32 host_int_setup_multicast_filter(WILC_WFIDrvHandle hWFIDrv, bool bIsEnabled,
        pstrMulticastFilterParam->bIsEnabled = bIsEnabled;
        pstrMulticastFilterParam->u32count = u32count;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7479,10 +7457,10 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
                pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
                pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
-               WILC_memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
+               memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6);
                /*for(i=0; i<6;i++)
                 *      PRINT_D(HOSTINF_DBG,"%c",pNewJoinBssParam->au8bssid[i]);*/
-               WILC_memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1);
+               memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1);
                pNewJoinBssParam->ssidLen = ptstrNetworkInfo->u8SsidLen;
                memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
                memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
@@ -7570,13 +7548,13 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                pNewJoinBssParam->u8Count = pu8IEs[index + 11];
                                u16P2P_count = index + 12;
 
-                               WILC_memcpy(pNewJoinBssParam->au8Duration, pu8IEs + u16P2P_count, 4);
+                               memcpy(pNewJoinBssParam->au8Duration, pu8IEs + u16P2P_count, 4);
                                u16P2P_count += 4;
 
-                               WILC_memcpy(pNewJoinBssParam->au8Interval, pu8IEs + u16P2P_count, 4);
+                               memcpy(pNewJoinBssParam->au8Interval, pu8IEs + u16P2P_count, 4);
                                u16P2P_count += 4;
 
-                               WILC_memcpy(pNewJoinBssParam->au8StartTime, pu8IEs + u16P2P_count, 4);
+                               memcpy(pNewJoinBssParam->au8StartTime, pu8IEs + u16P2P_count, 4);
 
                                index += pu8IEs[index + 1] + 2;
                                continue;
@@ -7662,7 +7640,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
 void host_int_freeJoinParams(void *pJoinParams)
 {
        if ((tstrJoinBssParam *)pJoinParams != NULL)
-               WILC_FREE((tstrJoinBssParam *)pJoinParams);
+               kfree((tstrJoinBssParam *)pJoinParams);
        else
                PRINT_ER("Unable to FREE null pointer\n");
 }
@@ -7678,7 +7656,7 @@ void host_int_freeJoinParams(void *pJoinParams)
  *  @date
  *  @version           1.0**/
 
-static int host_int_addBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID, short int BufferSize,
+static int host_int_addBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID, short int BufferSize,
                                 short int SessionTimeout, void *drvHandler)
 {
        s32 s32Error = WILC_SUCCESS;
@@ -7700,7 +7678,7 @@ static int host_int_addBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char T
        pBASessionInfo->u16SessionTimeout = SessionTimeout;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7712,7 +7690,7 @@ static int host_int_addBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char T
 }
 
 
-s32 host_int_delBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID)
+s32 host_int_delBASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7731,7 +7709,7 @@ s32 host_int_delBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID)
        pBASessionInfo->u8Ted = TID;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7745,7 +7723,7 @@ s32 host_int_delBASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID)
        return s32Error;
 }
 
-s32 host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char TID)
+s32 host_int_del_All_Rx_BASession(tstrWILC_WFIDrv *hWFIDrv, char *pBSSID, char TID)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7764,7 +7742,7 @@ s32 host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char
        pBASessionInfo->u8Ted = TID;
        strHostIFmsg.drvHandler = hWFIDrv;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7786,7 +7764,7 @@ s32 host_int_del_All_Rx_BASession(WILC_WFIDrvHandle hWFIDrv, char *pBSSID, char
  *  @author            Abdelrahman Sobhy
  *  @date
  *  @version           1.0*/
-s32 host_int_setup_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *u16ipadd, u8 idx)
+s32 host_int_setup_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7807,7 +7785,7 @@ s32 host_int_setup_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *u16ipadd, u8 idx)
        strHostIFmsg.drvHandler = hWFIDrv;
        strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx = idx;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)
@@ -7828,7 +7806,7 @@ s32 host_int_setup_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *u16ipadd, u8 idx)
  *  @author            Abdelrahman Sobhy
  *  @date
  *  @version           1.0*/
-s32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *u16ipadd, u8 idx)
+s32 host_int_get_ipaddress(tstrWILC_WFIDrv *hWFIDrv, u8 *u16ipadd, u8 idx)
 {
        s32 s32Error = WILC_SUCCESS;
        tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
@@ -7846,7 +7824,7 @@ s32 host_int_get_ipaddress(WILC_WFIDrvHandle hWFIDrv, u8 *u16ipadd, u8 idx)
        strHostIFmsg.drvHandler = hWFIDrv;
        strHostIFmsg.uniHostIFmsgBody.strHostIfSetIP.idx = idx;
 
-       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
+       s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg));
        if (s32Error)
                WILC_ERRORREPORT(s32Error, s32Error);
        WILC_CATCH(s32Error)