staging: wilc1000: rename strWILC_UsrScanReq of struct host_if_drv
[firefly-linux-kernel-4.4.55.git] / drivers / staging / wilc1000 / host_interface.c
index 948b986238ec86f87e83e30b94f2b3b7867c18b7..2df22e205adcb46fcfee843518941680b9c22148 100644 (file)
@@ -7,6 +7,7 @@
 #include "wilc_wlan_if.h"
 #include "wilc_msgqueue.h"
 #include <linux/etherdevice.h>
+#include "wilc_wfi_netdevice.h"
 
 extern u8 connecting;
 
@@ -227,7 +228,7 @@ struct join_bss_param {
        u8 idx;
        u8 duration[4];
        u8 interval[4];
-       u8 au8StartTime[4];
+       u8 start_time[4];
 };
 
 static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1];
@@ -327,17 +328,17 @@ static s32 Handle_SetChannel(struct host_if_drv *hif_drv,
                             struct channel_attr *pstrHostIFSetChan)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_CURRENT_CHANNEL;
-       strWID.type = WID_CHAR;
-       strWID.val = (char *)&(pstrHostIFSetChan->set_ch);
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_CURRENT_CHANNEL;
+       wid.type = WID_CHAR;
+       wid.val = (char *)&pstrHostIFSetChan->set_ch;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Setting channel\n");
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to set channel\n");
@@ -351,15 +352,15 @@ static s32 Handle_SetWfiDrvHandler(struct host_if_drv *hif_drv,
                                   struct drv_handler *pstrHostIfSetDrvHandler)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_SET_DRV_HANDLER;
-       strWID.type = WID_INT;
-       strWID.val = (s8 *)&(pstrHostIfSetDrvHandler->u32Address);
-       strWID.size = sizeof(u32);
+       wid.id = (u16)WID_SET_DRV_HANDLER;
+       wid.type = WID_INT;
+       wid.val = (s8 *)&pstrHostIfSetDrvHandler->handler;
+       wid.size = sizeof(u32);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  pstrHostIfSetDrvHandler->u32Address);
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                pstrHostIfSetDrvHandler->handler);
 
        if (!hif_drv)
                up(&hif_sema_driver);
@@ -376,17 +377,17 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
                                   struct op_mode *pstrHostIfSetOperationMode)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_SET_OPERATION_MODE;
-       strWID.type = WID_INT;
-       strWID.val = (s8 *)&(pstrHostIfSetOperationMode->u32Mode);
-       strWID.size = sizeof(u32);
+       wid.id = (u16)WID_SET_OPERATION_MODE;
+       wid.type = WID_INT;
+       wid.val = (s8 *)&pstrHostIfSetOperationMode->mode;
+       wid.size = sizeof(u32);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
-       if ((pstrHostIfSetOperationMode->u32Mode) == IDLE_MODE)
+       if ((pstrHostIfSetOperationMode->mode) == IDLE_MODE)
                up(&hif_sema_driver);
 
        if (result) {
@@ -400,7 +401,7 @@ static s32 Handle_SetOperationMode(struct host_if_drv *hif_drv,
 s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        char firmwareIPAddress[4] = {0};
 
        if (pu8IPAddr[0] < 192)
@@ -410,13 +411,13 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
 
        memcpy(set_ip[idx], pu8IPAddr, IP_ALEN);
 
-       strWID.id = (u16)WID_IP_ADDRESS;
-       strWID.type = WID_STR;
-       strWID.val = (u8 *)pu8IPAddr;
-       strWID.size = IP_ALEN;
+       wid.id = (u16)WID_IP_ADDRESS;
+       wid.type = WID_STR;
+       wid.val = (u8 *)pu8IPAddr;
+       wid.size = IP_ALEN;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx);
 
@@ -433,21 +434,21 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
 s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_IP_ADDRESS;
-       strWID.type = WID_STR;
-       strWID.val = kmalloc(IP_ALEN, GFP_KERNEL);
-       strWID.size = IP_ALEN;
+       wid.id = (u16)WID_IP_ADDRESS;
+       wid.type = WID_STR;
+       wid.val = kmalloc(IP_ALEN, GFP_KERNEL);
+       wid.size = IP_ALEN;
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
-       PRINT_INFO(HOSTINF_DBG, "%pI4\n", strWID.val);
+       PRINT_INFO(HOSTINF_DBG, "%pI4\n", wid.val);
 
-       memcpy(get_ip[idx], strWID.val, IP_ALEN);
+       memcpy(get_ip[idx], wid.val, IP_ALEN);
 
-       kfree(strWID.val);
+       kfree(wid.val);
 
        if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
                host_int_setup_ipaddress(hif_drv, set_ip[idx], idx);
@@ -468,23 +469,23 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
                                struct set_mac_addr *pstrHostIfSetMacAddress)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *mac_buf = kmalloc(ETH_ALEN, GFP_KERNEL);
 
-       if (mac_buf == NULL) {
+       if (!mac_buf) {
                PRINT_ER("No buffer to send mac address\n");
                return -EFAULT;
        }
-       memcpy(mac_buf, pstrHostIfSetMacAddress->u8MacAddress, ETH_ALEN);
+       memcpy(mac_buf, pstrHostIfSetMacAddress->mac_addr, ETH_ALEN);
 
-       strWID.id = (u16)WID_MAC_ADDR;
-       strWID.type = WID_STR;
-       strWID.val = mac_buf;
-       strWID.size = ETH_ALEN;
-       PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", strWID.val);
+       wid.id = (u16)WID_MAC_ADDR;
+       wid.type = WID_STR;
+       wid.val = mac_buf;
+       wid.size = ETH_ALEN;
+       PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", wid.val);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to set mac address\n");
                result = -EFAULT;
@@ -498,15 +499,15 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
                                struct get_mac_addr *pstrHostIfGetMacAddress)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_MAC_ADDR;
-       strWID.type = WID_STR;
-       strWID.val = pstrHostIfGetMacAddress->u8MacAddress;
-       strWID.size = ETH_ALEN;
+       wid.id = (u16)WID_MAC_ADDR;
+       wid.type = WID_STR;
+       wid.val = pstrHostIfGetMacAddress->mac_addr;
+       wid.size = ETH_ALEN;
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to get mac address\n");
@@ -526,7 +527,6 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
 
        down(&hif_drv->gtOsCfgValuesSem);
 
-
        PRINT_D(HOSTINF_DBG, "Setting CFG params\n");
 
        if (strHostIFCfgParamAttr->cfg_attr_info.flag & BSS_TYPE) {
@@ -615,7 +615,6 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
                u8WidCnt++;
        }
        if (strHostIFCfgParamAttr->cfg_attr_info.flag & FRAG_THRESHOLD) {
-
                if (strHostIFCfgParamAttr->cfg_attr_info.frag_threshold > 255 && strHostIFCfgParamAttr->cfg_attr_info.frag_threshold < 7937) {
                        strWIDList[u8WidCnt].id = WID_FRAG_THRESHOLD;
                        strWIDList[u8WidCnt].val = (s8 *)&strHostIFCfgParamAttr->cfg_attr_info.frag_threshold;
@@ -771,6 +770,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
        }
        if (strHostIFCfgParamAttr->cfg_attr_info.flag & CURRENT_TX_RATE) {
                enum CURRENT_TXRATE curr_tx_rate = strHostIFCfgParamAttr->cfg_attr_info.curr_tx_rate;
+
                if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1
                    || curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5
                    || curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6
@@ -791,7 +791,7 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
        }
 
        result = send_config_pkt(SET_CFG, strWIDList, u8WidCnt,
-                                  get_id_from_handler(hif_drv));
+                                get_id_from_handler(hif_drv));
 
        if (result)
                PRINT_ER("Error in setting CFG params\n");
@@ -822,8 +822,8 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
        PRINT_D(HOSTINF_DBG, "Setting SCAN params\n");
        PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", hif_drv->enuHostIFstate);
 
-       hif_drv->strWILC_UsrScanReq.pfUserScanResult = pstrHostIFscanAttr->result;
-       hif_drv->strWILC_UsrScanReq.u32UserScanPvoid = pstrHostIFscanAttr->arg;
+       hif_drv->usr_scan_req.pfUserScanResult = pstrHostIFscanAttr->result;
+       hif_drv->usr_scan_req.u32UserScanPvoid = pstrHostIFscanAttr->arg;
 
        if ((hif_drv->enuHostIFstate >= HOST_IF_SCANNING) && (hif_drv->enuHostIFstate < HOST_IF_CONNECTED)) {
                PRINT_D(GENERIC_DBG, "Don't scan we are already in [%d] state\n", hif_drv->enuHostIFstate);
@@ -841,8 +841,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
 
        PRINT_D(HOSTINF_DBG, "Setting SCAN params\n");
 
-
-       hif_drv->strWILC_UsrScanReq.u32RcvdChCount = 0;
+       hif_drv->usr_scan_req.u32RcvdChCount = 0;
 
        strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ;
        strWIDList[u32WidsCount].type = WID_STR;
@@ -851,7 +850,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
                valuesize += ((pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].u8ssidlen) + 1);
        pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
        strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal;
-       if (strWIDList[u32WidsCount].val != NULL) {
+       if (strWIDList[u32WidsCount].val) {
                pu8Buffer = strWIDList[u32WidsCount].val;
 
                *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.u8ssidnum;
@@ -864,8 +863,6 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
                        pu8Buffer += pstrHostIFscanAttr->hidden_network.pstrHiddenNetworkInfo[i].u8ssidlen;
                }
 
-
-
                strWIDList[u32WidsCount].size = (s32)(valuesize + 1);
                u32WidsCount++;
        }
@@ -881,13 +878,14 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
        strWIDList[u32WidsCount].id = WID_SCAN_TYPE;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrHostIFscanAttr->type));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrHostIFscanAttr->type;
        u32WidsCount++;
 
        strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
        strWIDList[u32WidsCount].type = WID_BIN_DATA;
 
-       if (pstrHostIFscanAttr->ch_freq_list != NULL && pstrHostIFscanAttr->ch_list_len > 0) {
+       if (pstrHostIFscanAttr->ch_freq_list &&
+           pstrHostIFscanAttr->ch_list_len > 0) {
                int i;
 
                for (i = 0; i < pstrHostIFscanAttr->ch_list_len; i++)   {
@@ -903,7 +901,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
        strWIDList[u32WidsCount].id = WID_START_SCAN_REQ;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrHostIFscanAttr->src));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrHostIFscanAttr->src;
        u32WidsCount++;
 
        if (hif_drv->enuHostIFstate == HOST_IF_CONNECTED)
@@ -912,7 +910,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
                scan_while_connected = false;
 
        result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
-                                  get_id_from_handler(hif_drv));
+                                get_id_from_handler(hif_drv));
 
        if (result)
                PRINT_ER("Failed to send scan paramters config packet\n");
@@ -943,21 +941,20 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
 {
        s32 result = 0;
        u8 u8abort_running_scan;
-       struct wid strWID;
-
+       struct wid wid;
 
        PRINT_D(HOSTINF_DBG, "in Handle_ScanDone()\n");
 
        if (enuEvent == SCAN_EVENT_ABORTED) {
                PRINT_D(GENERIC_DBG, "Abort running scan\n");
                u8abort_running_scan = 1;
-               strWID.id = (u16)WID_ABORT_RUNNING_SCAN;
-               strWID.type = WID_CHAR;
-               strWID.val = (s8 *)&u8abort_running_scan;
-               strWID.size = sizeof(char);
+               wid.id = (u16)WID_ABORT_RUNNING_SCAN;
+               wid.type = WID_CHAR;
+               wid.val = (s8 *)&u8abort_running_scan;
+               wid.size = sizeof(char);
 
-               result = send_config_pkt(SET_CFG, &strWID, 1,
-                                          get_id_from_handler(hif_drv));
+               result = send_config_pkt(SET_CFG, &wid, 1,
+                                        get_id_from_handler(hif_drv));
 
                if (result) {
                        PRINT_ER("Failed to set abort running scan\n");
@@ -970,10 +967,10 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
                return result;
        }
 
-       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
-               hif_drv->strWILC_UsrScanReq.pfUserScanResult(enuEvent, NULL,
-                                                               hif_drv->strWILC_UsrScanReq.u32UserScanPvoid, NULL);
-               hif_drv->strWILC_UsrScanReq.pfUserScanResult = NULL;
+       if (hif_drv->usr_scan_req.pfUserScanResult) {
+               hif_drv->usr_scan_req.pfUserScanResult(enuEvent, NULL,
+                                                      hif_drv->usr_scan_req.u32UserScanPvoid, NULL);
+               hif_drv->usr_scan_req.pfUserScanResult = NULL;
        }
 
        return result;
@@ -1000,30 +997,32 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
        PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n");
 
        ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params;
-       if (ptstrJoinBssParam == NULL) {
+       if (!ptstrJoinBssParam) {
                PRINT_ER("Required BSSID not found\n");
                result = -ENOENT;
                goto ERRORHANDLER;
        }
 
-       if (pstrHostIFconnectAttr->bssid != NULL) {
+       if (pstrHostIFconnectAttr->bssid) {
                hif_drv->strWILC_UsrConnReq.pu8bssid = kmalloc(6, GFP_KERNEL);
                memcpy(hif_drv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->bssid, 6);
        }
 
        hif_drv->strWILC_UsrConnReq.ssidLen = pstrHostIFconnectAttr->ssid_len;
-       if (pstrHostIFconnectAttr->ssid != NULL) {
+       if (pstrHostIFconnectAttr->ssid) {
                hif_drv->strWILC_UsrConnReq.pu8ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
-               memcpy(hif_drv->strWILC_UsrConnReq.pu8ssid, pstrHostIFconnectAttr->ssid,
-                           pstrHostIFconnectAttr->ssid_len);
+               memcpy(hif_drv->strWILC_UsrConnReq.pu8ssid,
+                      pstrHostIFconnectAttr->ssid,
+                      pstrHostIFconnectAttr->ssid_len);
                hif_drv->strWILC_UsrConnReq.pu8ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
        }
 
        hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = pstrHostIFconnectAttr->ies_len;
-       if (pstrHostIFconnectAttr->ies != NULL) {
+       if (pstrHostIFconnectAttr->ies) {
                hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
-               memcpy(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs, pstrHostIFconnectAttr->ies,
-                           pstrHostIFconnectAttr->ies_len);
+               memcpy(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
+                      pstrHostIFconnectAttr->ies,
+                      pstrHostIFconnectAttr->ies_len);
        }
 
        hif_drv->strWILC_UsrConnReq.u8security = pstrHostIFconnectAttr->security;
@@ -1066,7 +1065,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
        strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
-       strWIDList[u32WidsCount].val = (s8 *)(&(hif_drv->strWILC_UsrConnReq.u8security));
+       strWIDList[u32WidsCount].val = (s8 *)&hif_drv->strWILC_UsrConnReq.u8security;
        u32WidsCount++;
 
        if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
@@ -1074,7 +1073,6 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
 
        PRINT_INFO(HOSTINF_DBG, "Encrypt Mode = %x\n", hif_drv->strWILC_UsrConnReq.u8security);
 
-
        strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
@@ -1097,15 +1095,14 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
                join_req_size = strWIDList[u32WidsCount].size;
                join_req = kmalloc(join_req_size, GFP_KERNEL);
        }
-       if (strWIDList[u32WidsCount].val == NULL) {
+       if (!strWIDList[u32WidsCount].val) {
                result = -EFAULT;
                goto ERRORHANDLER;
        }
 
        pu8CurrByte = strWIDList[u32WidsCount].val;
 
-
-       if (pstrHostIFconnectAttr->ssid != NULL) {
+       if (pstrHostIFconnectAttr->ssid) {
                memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
                pu8CurrByte[pstrHostIFconnectAttr->ssid_len] = '\0';
        }
@@ -1122,7 +1119,11 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
        *(pu8CurrByte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
        PRINT_D(HOSTINF_DBG, "* Cap Info %0x*\n", (*(pu8CurrByte - 2) | ((*(pu8CurrByte - 1)) << 8)));
 
-       if (pstrHostIFconnectAttr->bssid != NULL)
+       if (pstrHostIFconnectAttr->bssid)
+               memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
+       pu8CurrByte += 6;
+
+       if (pstrHostIFconnectAttr->bssid)
                memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
        pu8CurrByte += 6;
 
@@ -1183,10 +1184,8 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
                memcpy(pu8CurrByte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
                pu8CurrByte += sizeof(ptstrJoinBssParam->interval);
 
-               memcpy(pu8CurrByte, ptstrJoinBssParam->au8StartTime, sizeof(ptstrJoinBssParam->au8StartTime));
-
-               pu8CurrByte += sizeof(ptstrJoinBssParam->au8StartTime);
-
+               memcpy(pu8CurrByte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
+               pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
        } else
                PRINT_D(HOSTINF_DBG, "NOA not present\n");
 
@@ -1200,7 +1199,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
 
        PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
 
-       if (pstrHostIFconnectAttr->bssid != NULL) {
+       if (pstrHostIFconnectAttr->bssid) {
                memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->bssid, ETH_ALEN);
 
                PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->bssid);
@@ -1208,7 +1207,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
        }
 
        result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
-                                  get_id_from_handler(hif_drv));
+                                get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("failed to send config packet\n");
                result = -EFAULT;
@@ -1228,16 +1227,16 @@ ERRORHANDLER:
 
                memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
 
-               if (pstrHostIFconnectAttr->result != NULL) {
-                       if (pstrHostIFconnectAttr->bssid != NULL)
+               if (pstrHostIFconnectAttr->result) {
+                       if (pstrHostIFconnectAttr->bssid)
                                memcpy(strConnectInfo.au8bssid, pstrHostIFconnectAttr->bssid, 6);
 
-                       if (pstrHostIFconnectAttr->ies != NULL) {
+                       if (pstrHostIFconnectAttr->ies) {
                                strConnectInfo.ReqIEsLen = pstrHostIFconnectAttr->ies_len;
                                strConnectInfo.pu8ReqIEs = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
                                memcpy(strConnectInfo.pu8ReqIEs,
-                                           pstrHostIFconnectAttr->ies,
-                                           pstrHostIFconnectAttr->ies_len);
+                                      pstrHostIFconnectAttr->ies,
+                                      pstrHostIFconnectAttr->ies_len);
                        }
 
                        pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
@@ -1287,8 +1286,6 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
        strWIDList[u32WidsCount].val = (s8 *)(&(mode_11i));
        u32WidsCount++;
 
-
-
        strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
@@ -1307,7 +1304,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
        u32WidsCount++;
 
        result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
-                                  get_id_from_handler(join_req_drv));
+                                get_id_from_handler(join_req_drv));
        if (result) {
                PRINT_ER("failed to send config packet\n");
                result = -EINVAL;
@@ -1320,7 +1317,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
        tstrConnectInfo strConnectInfo;
-       struct wid strWID;
+       struct wid wid;
        u16 u16DummyReasonCode = 0;
 
        if (!hif_drv) {
@@ -1334,18 +1331,18 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
 
        memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
 
-       if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL)    {
-               if (hif_drv->strWILC_UsrConnReq.pu8bssid != NULL) {
+       if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
+               if (hif_drv->strWILC_UsrConnReq.pu8bssid) {
                        memcpy(strConnectInfo.au8bssid,
-                                   hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
+                              hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
                }
 
-               if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
+               if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs) {
                        strConnectInfo.ReqIEsLen = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
                        strConnectInfo.pu8ReqIEs = kmalloc(hif_drv->strWILC_UsrConnReq.ConnReqIEsLen, GFP_KERNEL);
                        memcpy(strConnectInfo.pu8ReqIEs,
-                                   hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
-                                   hif_drv->strWILC_UsrConnReq.ConnReqIEsLen);
+                              hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs,
+                              hif_drv->strWILC_UsrConnReq.ConnReqIEsLen);
                }
 
                hif_drv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
@@ -1360,15 +1357,15 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
                PRINT_ER("Connect callback function pointer is NULL\n");
        }
 
-       strWID.id = (u16)WID_DISCONNECT;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)&u16DummyReasonCode;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_DISCONNECT;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)&u16DummyReasonCode;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send dissconect config packet\n");
 
@@ -1380,12 +1377,12 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
 
        eth_zero_addr(u8ConnectedSSID);
 
-       if (join_req != NULL && join_req_drv == hif_drv) {
+       if (join_req && join_req_drv == hif_drv) {
                kfree(join_req);
                join_req = NULL;
        }
 
-       if (info_element != NULL && join_req_drv == hif_drv) {
+       if (info_element && join_req_drv == hif_drv) {
                kfree(info_element);
                info_element = NULL;
        }
@@ -1405,27 +1402,26 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
        bNewNtwrkFound = true;
        PRINT_INFO(HOSTINF_DBG, "Handling received network info\n");
 
-       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
+       if (hif_drv->usr_scan_req.pfUserScanResult) {
                PRINT_D(HOSTINF_DBG, "State: Scanning, parsing network information received\n");
                parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
-               if ((pstrNetworkInfo == NULL)
-                   || (hif_drv->strWILC_UsrScanReq.pfUserScanResult == NULL)) {
+               if ((!pstrNetworkInfo) ||
+                   (!hif_drv->usr_scan_req.pfUserScanResult)) {
                        PRINT_ER("driver is null\n");
                        result = -EINVAL;
                        goto done;
                }
 
-               for (i = 0; i < hif_drv->strWILC_UsrScanReq.u32RcvdChCount; i++) {
-
-                       if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid != NULL) &&
-                           (pstrNetworkInfo->au8bssid != NULL)) {
-                               if (memcmp(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].au8bssid,
-                                               pstrNetworkInfo->au8bssid, 6) == 0) {
-                                       if (pstrNetworkInfo->s8rssi <= hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].s8rssi) {
+               for (i = 0; i < hif_drv->usr_scan_req.u32RcvdChCount; i++) {
+                       if ((hif_drv->usr_scan_req.astrFoundNetworkInfo[i].au8bssid) &&
+                           (pstrNetworkInfo->au8bssid)) {
+                               if (memcmp(hif_drv->usr_scan_req.astrFoundNetworkInfo[i].au8bssid,
+                                          pstrNetworkInfo->au8bssid, 6) == 0) {
+                                       if (pstrNetworkInfo->s8rssi <= hif_drv->usr_scan_req.astrFoundNetworkInfo[i].s8rssi) {
                                                PRINT_D(HOSTINF_DBG, "Network previously discovered\n");
                                                goto done;
                                        } else {
-                                               hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[i].s8rssi = pstrNetworkInfo->s8rssi;
+                                               hif_drv->usr_scan_req.astrFoundNetworkInfo[i].s8rssi = pstrNetworkInfo->s8rssi;
                                                bNewNtwrkFound = false;
                                                break;
                                        }
@@ -1433,35 +1429,33 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
                        }
                }
 
-               if (bNewNtwrkFound == true) {
+               if (bNewNtwrkFound) {
                        PRINT_D(HOSTINF_DBG, "New network found\n");
 
-                       if (hif_drv->strWILC_UsrScanReq.u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
-                               hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].s8rssi = pstrNetworkInfo->s8rssi;
+                       if (hif_drv->usr_scan_req.u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) {
+                               hif_drv->usr_scan_req.astrFoundNetworkInfo[hif_drv->usr_scan_req.u32RcvdChCount].s8rssi = pstrNetworkInfo->s8rssi;
 
-                               if ((hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid != NULL)
-                                   && (pstrNetworkInfo->au8bssid != NULL)) {
-                                       memcpy(hif_drv->strWILC_UsrScanReq.astrFoundNetworkInfo[hif_drv->strWILC_UsrScanReq.u32RcvdChCount].au8bssid,
-                                                   pstrNetworkInfo->au8bssid, 6);
+                               if (hif_drv->usr_scan_req.astrFoundNetworkInfo[hif_drv->usr_scan_req.u32RcvdChCount].au8bssid &&
+                                   pstrNetworkInfo->au8bssid) {
+                                       memcpy(hif_drv->usr_scan_req.astrFoundNetworkInfo[hif_drv->usr_scan_req.u32RcvdChCount].au8bssid,
+                                              pstrNetworkInfo->au8bssid, 6);
 
-                                       hif_drv->strWILC_UsrScanReq.u32RcvdChCount++;
+                                       hif_drv->usr_scan_req.u32RcvdChCount++;
 
                                        pstrNetworkInfo->bNewNetwork = true;
                                        pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);
 
-                                       hif_drv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
-                                                                                       hif_drv->strWILC_UsrScanReq.u32UserScanPvoid,
-                                                                                       pJoinParams);
-
-
+                                       hif_drv->usr_scan_req.pfUserScanResult(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
+                                                                              hif_drv->usr_scan_req.u32UserScanPvoid,
+                                                                              pJoinParams);
                                }
                        } else {
                                PRINT_WRN(HOSTINF_DBG, "Discovered networks exceeded max. limit\n");
                        }
                } else {
                        pstrNetworkInfo->bNewNetwork = false;
-                       hif_drv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
-                                                                       hif_drv->strWILC_UsrScanReq.u32UserScanPvoid, NULL);
+                       hif_drv->usr_scan_req.pfUserScanResult(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
+                                                              hif_drv->usr_scan_req.u32UserScanPvoid, NULL);
                }
        }
 
@@ -1469,7 +1463,7 @@ done:
        kfree(pstrRcvdNetworkInfo->buffer);
        pstrRcvdNetworkInfo->buffer = NULL;
 
-       if (pstrNetworkInfo != NULL) {
+       if (pstrNetworkInfo) {
                DeallocateNetworkInfo(pstrNetworkInfo);
                pstrNetworkInfo = NULL;
        }
@@ -1502,9 +1496,9 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
 
        if ((hif_drv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) ||
            (hif_drv->enuHostIFstate == HOST_IF_CONNECTED) ||
-           hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
-               if ((pstrRcvdGnrlAsyncInfo->buffer == NULL) ||
-                   (hif_drv->strWILC_UsrConnReq.pfUserConnectResult == NULL)) {
+           hif_drv->usr_scan_req.pfUserScanResult) {
+               if (!pstrRcvdGnrlAsyncInfo->buffer ||
+                   !hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
                        PRINT_ER("driver is null\n");
                        return -EINVAL;
                }
@@ -1543,7 +1537,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                PRINT_INFO(HOSTINF_DBG, "Received association response with length = %d\n", u32RcvdAssocRespInfoLen);
 
                                if (u32RcvdAssocRespInfoLen != 0) {
-
                                        PRINT_D(HOSTINF_DBG, "Parsing association response\n");
                                        s32Err = ParseAssocRespInfo(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
                                                                    &pstrConnectRespInfo);
@@ -1554,17 +1547,15 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
 
                                                if (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) {
                                                        PRINT_INFO(HOSTINF_DBG, "Association response received : Successful connection status\n");
-                                                       if (pstrConnectRespInfo->pu8RespIEs != NULL) {
+                                                       if (pstrConnectRespInfo->pu8RespIEs) {
                                                                strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->u16RespIEsLen;
-
-
                                                                strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->u16RespIEsLen, GFP_KERNEL);
                                                                memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->pu8RespIEs,
                                                                            pstrConnectRespInfo->u16RespIEsLen);
                                                        }
                                                }
 
-                                               if (pstrConnectRespInfo != NULL) {
+                                               if (pstrConnectRespInfo) {
                                                        DeallocateAssocRespInfo(pstrConnectRespInfo);
                                                        pstrConnectRespInfo = NULL;
                                                }
@@ -1582,7 +1573,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                eth_zero_addr(u8ConnectedSSID);
                        }
 
-                       if (hif_drv->strWILC_UsrConnReq.pu8bssid != NULL) {
+                       if (hif_drv->strWILC_UsrConnReq.pu8bssid) {
                                PRINT_D(HOSTINF_DBG, "Retrieving actual BSSID from AP\n");
                                memcpy(strConnectInfo.au8bssid, hif_drv->strWILC_UsrConnReq.pu8bssid, 6);
 
@@ -1593,8 +1584,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                }
                        }
 
-
-                       if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs != NULL) {
+                       if (hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs) {
                                strConnectInfo.ReqIEsLen = hif_drv->strWILC_UsrConnReq.ConnReqIEsLen;
                                strConnectInfo.pu8ReqIEs = kmalloc(hif_drv->strWILC_UsrConnReq.ConnReqIEsLen, GFP_KERNEL);
                                memcpy(strConnectInfo.pu8ReqIEs,
@@ -1602,7 +1592,6 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                            hif_drv->strWILC_UsrConnReq.ConnReqIEsLen);
                        }
 
-
                        del_timer(&hif_drv->hConnectTimer);
                        hif_drv->strWILC_UsrConnReq.pfUserConnectResult(CONN_DISCONN_EVENT_CONN_RESP,
                                                                           &strConnectInfo,
@@ -1643,7 +1632,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
 
                        memset(&strDisconnectNotifInfo, 0, sizeof(tstrDisconnectNotifInfo));
 
-                       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
+                       if (hif_drv->usr_scan_req.pfUserScanResult) {
                                PRINT_D(HOSTINF_DBG, "\n\n<< Abort the running OBSS Scan >>\n\n");
                                del_timer(&hif_drv->hScanTimer);
                                Handle_ScanDone((void *)hif_drv, SCAN_EVENT_ABORTED);
@@ -1653,7 +1642,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                        strDisconnectNotifInfo.ie = NULL;
                        strDisconnectNotifInfo.ie_len = 0;
 
-                       if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL)    {
+                       if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
                                g_obtainingIP = false;
                                host_int_set_power_mgmt(hif_drv, 0, 0);
 
@@ -1675,12 +1664,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                        hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
                        kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
 
-                       if (join_req != NULL && join_req_drv == hif_drv) {
+                       if (join_req && join_req_drv == hif_drv) {
                                kfree(join_req);
                                join_req = NULL;
                        }
 
-                       if (info_element != NULL && join_req_drv == hif_drv) {
+                       if (info_element && join_req_drv == hif_drv) {
                                kfree(info_element);
                                info_element = NULL;
                        }
@@ -1689,16 +1678,14 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                        scan_while_connected = false;
 
                } else if ((u8MacStatus == MAC_DISCONNECTED) &&
-                          (hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL)) {
+                          (hif_drv->usr_scan_req.pfUserScanResult)) {
                        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");
 
                        del_timer(&hif_drv->hScanTimer);
-                       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult)
+                       if (hif_drv->usr_scan_req.pfUserScanResult)
                                Handle_ScanDone(hif_drv, SCAN_EVENT_ABORTED);
-
                }
-
        }
 
        kfree(pstrRcvdGnrlAsyncInfo->buffer);
@@ -1711,7 +1698,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                      struct key_attr *pstrHostIFkeyAttr)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        struct wid strWIDList[5];
        u8 i;
        u8 *pu8keybuf;
@@ -1719,28 +1706,25 @@ static int Handle_Key(struct host_if_drv *hif_drv,
        s8 ret = 0;
 
        switch (pstrHostIFkeyAttr->type) {
-
-
        case WEP:
 
                if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
-
                        PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
-                       PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", (pstrHostIFkeyAttr->attr.wep.index));
+                       PRINT_D(GENERIC_DBG, "ID Hostint is %d\n", pstrHostIFkeyAttr->attr.wep.index);
                        strWIDList[0].id = (u16)WID_11I_MODE;
                        strWIDList[0].type = WID_CHAR;
                        strWIDList[0].size = sizeof(char);
-                       strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->attr.wep.mode));
+                       strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
 
                        strWIDList[1].id = WID_AUTH_TYPE;
                        strWIDList[1].type = WID_CHAR;
                        strWIDList[1].size = sizeof(char);
-                       strWIDList[1].val = (s8 *)(&(pstrHostIFkeyAttr->attr.wep.auth_type));
+                       strWIDList[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
 
                        strWIDList[2].id = (u16)WID_KEY_ID;
                        strWIDList[2].type = WID_CHAR;
 
-                       strWIDList[2].val = (s8 *)(&(pstrHostIFkeyAttr->attr.wep.index));
+                       strWIDList[2].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index;
                        strWIDList[2].size = sizeof(char);
 
                        pu8keybuf = kmemdup(pstrHostIFkeyAttr->attr.wep.key,
@@ -1749,7 +1733,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 
                        if (pu8keybuf == NULL) {
                                PRINT_ER("No buffer to send Key\n");
-                               return -1;
+                               return -ENOMEM;
                        }
 
                        kfree(pstrHostIFkeyAttr->attr.wep.key);
@@ -1760,55 +1744,52 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        strWIDList[3].val = (s8 *)pu8keybuf;
 
                        result = send_config_pkt(SET_CFG, strWIDList, 4,
-                                                  get_id_from_handler(hif_drv));
+                                                get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
-
-
                }
 
                if (pstrHostIFkeyAttr->action & ADDKEY) {
                        PRINT_D(HOSTINF_DBG, "Handling WEP key\n");
                        pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL);
-                       if (pu8keybuf == NULL) {
+                       if (!pu8keybuf) {
                                PRINT_ER("No buffer to send Key\n");
-                               return -1;
+                               return -ENOMEM;
                        }
                        pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
                        memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->attr.wep.key_len, 1);
                        memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key,
-                                   pstrHostIFkeyAttr->attr.wep.key_len);
+                              pstrHostIFkeyAttr->attr.wep.key_len);
                        kfree(pstrHostIFkeyAttr->attr.wep.key);
 
-                       strWID.id = (u16)WID_ADD_WEP_KEY;
-                       strWID.type = WID_STR;
-                       strWID.val = (s8 *)pu8keybuf;
-                       strWID.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+                       wid.id = (u16)WID_ADD_WEP_KEY;
+                       wid.type = WID_STR;
+                       wid.val = (s8 *)pu8keybuf;
+                       wid.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
 
-                       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                                  get_id_from_handler(hif_drv));
+                       result = send_config_pkt(SET_CFG, &wid, 1,
+                                                get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                } else if (pstrHostIFkeyAttr->action & REMOVEKEY) {
-
                        PRINT_D(HOSTINF_DBG, "Removing key\n");
-                       strWID.id = (u16)WID_REMOVE_WEP_KEY;
-                       strWID.type = WID_STR;
+                       wid.id = (u16)WID_REMOVE_WEP_KEY;
+                       wid.type = WID_STR;
 
                        s8idxarray[0] = (s8)pstrHostIFkeyAttr->attr.wep.index;
-                       strWID.val = s8idxarray;
-                       strWID.size = 1;
+                       wid.val = s8idxarray;
+                       wid.size = 1;
 
-                       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                                  get_id_from_handler(hif_drv));
+                       result = send_config_pkt(SET_CFG, &wid, 1,
+                                                get_id_from_handler(hif_drv));
                } else {
-                       strWID.id = (u16)WID_KEY_ID;
-                       strWID.type = WID_CHAR;
-                       strWID.val = (s8 *)(&(pstrHostIFkeyAttr->attr.wep.index));
-                       strWID.size = sizeof(char);
+                       wid.id = (u16)WID_KEY_ID;
+                       wid.type = WID_CHAR;
+                       wid.val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index;
+                       wid.size = sizeof(char);
 
                        PRINT_D(HOSTINF_DBG, "Setting default key index\n");
 
-                       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                                  get_id_from_handler(hif_drv));
+                       result = send_config_pkt(SET_CFG, &wid, 1,
+                                                get_id_from_handler(hif_drv));
                }
                up(&hif_drv->hSemTestKeyBlock);
                break;
@@ -1816,24 +1797,24 @@ static int Handle_Key(struct host_if_drv *hif_drv,
        case WPARxGtk:
                if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
                        pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
-                       if (pu8keybuf == NULL) {
+                       if (!pu8keybuf) {
                                PRINT_ER("No buffer to send RxGTK Key\n");
-                               ret = -1;
+                               ret = -ENOMEM;
                                goto _WPARxGtk_end_case_;
                        }
 
-                       if (pstrHostIFkeyAttr->attr.wpa.seq != NULL)
+                       if (pstrHostIFkeyAttr->attr.wpa.seq)
                                memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8);
 
                        memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
                        memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
                        memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
-                                   pstrHostIFkeyAttr->attr.wpa.key_len);
+                              pstrHostIFkeyAttr->attr.wpa.key_len);
 
                        strWIDList[0].id = (u16)WID_11I_MODE;
                        strWIDList[0].type = WID_CHAR;
                        strWIDList[0].size = sizeof(char);
-                       strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->attr.wpa.mode));
+                       strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
 
                        strWIDList[1].id = (u16)WID_ADD_RX_GTK;
                        strWIDList[1].type = WID_STR;
@@ -1841,7 +1822,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
 
                        result = send_config_pkt(SET_CFG, strWIDList, 2,
-                                                  get_id_from_handler(hif_drv));
+                                                get_id_from_handler(hif_drv));
 
                        kfree(pu8keybuf);
                        up(&hif_drv->hSemTestKeyBlock);
@@ -1853,7 +1834,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
                        if (pu8keybuf == NULL) {
                                PRINT_ER("No buffer to send RxGTK Key\n");
-                               ret = -1;
+                               ret = -ENOMEM;
                                goto _WPARxGtk_end_case_;
                        }
 
@@ -1866,15 +1847,15 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
                        memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
                        memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
-                                   pstrHostIFkeyAttr->attr.wpa.key_len);
+                              pstrHostIFkeyAttr->attr.wpa.key_len);
 
-                       strWID.id = (u16)WID_ADD_RX_GTK;
-                       strWID.type = WID_STR;
-                       strWID.val = (s8 *)pu8keybuf;
-                       strWID.size = RX_MIC_KEY_MSG_LEN;
+                       wid.id = (u16)WID_ADD_RX_GTK;
+                       wid.type = WID_STR;
+                       wid.val = (s8 *)pu8keybuf;
+                       wid.size = RX_MIC_KEY_MSG_LEN;
 
-                       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                                  get_id_from_handler(hif_drv));
+                       result = send_config_pkt(SET_CFG, &wid, 1,
+                                                get_id_from_handler(hif_drv));
 
                        kfree(pu8keybuf);
                        up(&hif_drv->hSemTestKeyBlock);
@@ -1882,36 +1863,30 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 _WPARxGtk_end_case_:
                kfree(pstrHostIFkeyAttr->attr.wpa.key);
                kfree(pstrHostIFkeyAttr->attr.wpa.seq);
-               if (ret == -1)
+               if (ret)
                        return ret;
 
                break;
 
        case WPAPtk:
                if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
-
-
                        pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
-
-
-
-                       if (pu8keybuf == NULL) {
+                       if (!pu8keybuf) {
                                PRINT_ER("No buffer to send PTK Key\n");
-                               ret = -1;
+                               ret = -ENOMEM;
                                goto _WPAPtk_end_case_;
-
                        }
 
                        memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6);
                        memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.index, 1);
                        memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
                        memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key,
-                                   pstrHostIFkeyAttr->attr.wpa.key_len);
+                              pstrHostIFkeyAttr->attr.wpa.key_len);
 
                        strWIDList[0].id = (u16)WID_11I_MODE;
                        strWIDList[0].type = WID_CHAR;
                        strWIDList[0].size = sizeof(char);
-                       strWIDList[0].val = (s8 *)(&(pstrHostIFkeyAttr->attr.wpa.mode));
+                       strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
 
                        strWIDList[1].id = (u16)WID_ADD_PTK;
                        strWIDList[1].type = WID_STR;
@@ -1919,56 +1894,49 @@ _WPARxGtk_end_case_:
                        strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
 
                        result = send_config_pkt(SET_CFG, strWIDList, 2,
-                                                  get_id_from_handler(hif_drv));
+                                                get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                        up(&hif_drv->hSemTestKeyBlock);
                }
                if (pstrHostIFkeyAttr->action & ADDKEY) {
-
-
                        pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
-
-
-
-                       if (pu8keybuf == NULL) {
+                       if (!pu8keybuf) {
                                PRINT_ER("No buffer to send PTK Key\n");
-                               ret = -1;
+                               ret = -ENOMEM;
                                goto _WPAPtk_end_case_;
-
                        }
 
                        memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6);
                        memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
                        memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->attr.wpa.key,
-                                   pstrHostIFkeyAttr->attr.wpa.key_len);
+                              pstrHostIFkeyAttr->attr.wpa.key_len);
 
-                       strWID.id = (u16)WID_ADD_PTK;
-                       strWID.type = WID_STR;
-                       strWID.val = (s8 *)pu8keybuf;
-                       strWID.size = PTK_KEY_MSG_LEN;
+                       wid.id = (u16)WID_ADD_PTK;
+                       wid.type = WID_STR;
+                       wid.val = (s8 *)pu8keybuf;
+                       wid.size = PTK_KEY_MSG_LEN;
 
-                       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                                  get_id_from_handler(hif_drv));
+                       result = send_config_pkt(SET_CFG, &wid, 1,
+                                                get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                        up(&hif_drv->hSemTestKeyBlock);
                }
 
 _WPAPtk_end_case_:
                kfree(pstrHostIFkeyAttr->attr.wpa.key);
-               if (ret == -1)
+               if (ret)
                        return ret;
 
                break;
 
-
        case PMKSA:
 
                PRINT_D(HOSTINF_DBG, "Handling PMKSA key\n");
 
                pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
-               if (pu8keybuf == NULL) {
+               if (!pu8keybuf) {
                        PRINT_ER("No buffer to send PMKSA Key\n");
-                       return -1;
+                       return -ENOMEM;
                }
 
                pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid;
@@ -1978,13 +1946,13 @@ _WPAPtk_end_case_:
                        memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN);
                }
 
-               strWID.id = (u16)WID_PMKID_INFO;
-               strWID.type = WID_STR;
-               strWID.val = (s8 *)pu8keybuf;
-               strWID.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
+               wid.id = (u16)WID_PMKID_INFO;
+               wid.type = WID_STR;
+               wid.val = (s8 *)pu8keybuf;
+               wid.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
 
-               result = send_config_pkt(SET_CFG, &strWID, 1,
-                                          get_id_from_handler(hif_drv));
+               result = send_config_pkt(SET_CFG, &wid, 1,
+                                        get_id_from_handler(hif_drv));
 
                kfree(pu8keybuf);
                break;
@@ -1998,17 +1966,15 @@ _WPAPtk_end_case_:
 
 static void Handle_Disconnect(struct host_if_drv *hif_drv)
 {
-       struct wid strWID;
+       struct wid wid;
 
        s32 result = 0;
        u16 u16DummyReasonCode = 0;
 
-       strWID.id = (u16)WID_DISCONNECT;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)&u16DummyReasonCode;
-       strWID.size = sizeof(char);
-
-
+       wid.id = (u16)WID_DISCONNECT;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)&u16DummyReasonCode;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
 
@@ -2017,8 +1983,8 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
 
        eth_zero_addr(u8ConnectedSSID);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to send dissconect config packet\n");
@@ -2031,15 +1997,15 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
                strDisconnectNotifInfo.ie = NULL;
                strDisconnectNotifInfo.ie_len = 0;
 
-               if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
+               if (hif_drv->usr_scan_req.pfUserScanResult) {
                        del_timer(&hif_drv->hScanTimer);
-                       hif_drv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
-                                                                       hif_drv->strWILC_UsrScanReq.u32UserScanPvoid, NULL);
+                       hif_drv->usr_scan_req.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
+                                                              hif_drv->usr_scan_req.u32UserScanPvoid, NULL);
 
-                       hif_drv->strWILC_UsrScanReq.pfUserScanResult = NULL;
+                       hif_drv->usr_scan_req.pfUserScanResult = NULL;
                }
 
-               if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult != NULL)    {
+               if (hif_drv->strWILC_UsrConnReq.pfUserConnectResult) {
                        if (hif_drv->enuHostIFstate == HOST_IF_WAITING_CONN_RESP) {
                                PRINT_D(HOSTINF_DBG, "Upper layer requested termination of connection\n");
                                del_timer(&hif_drv->hConnectTimer);
@@ -2063,22 +2029,20 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
                hif_drv->strWILC_UsrConnReq.ConnReqIEsLen = 0;
                kfree(hif_drv->strWILC_UsrConnReq.pu8ConnReqIEs);
 
-               if (join_req != NULL && join_req_drv == hif_drv) {
+               if (join_req && join_req_drv == hif_drv) {
                        kfree(join_req);
                        join_req = NULL;
                }
 
-               if (info_element != NULL && join_req_drv == hif_drv) {
+               if (info_element && join_req_drv == hif_drv) {
                        kfree(info_element);
                        info_element = NULL;
                }
-
        }
 
        up(&hif_drv->hSemTestDisconnectBlock);
 }
 
-
 void resolve_disconnect_aberration(struct host_if_drv *hif_drv)
 {
        if (!hif_drv)
@@ -2092,17 +2056,17 @@ void resolve_disconnect_aberration(struct host_if_drv *hif_drv)
 static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_CURRENT_CHANNEL;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)&ch_no;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_CURRENT_CHANNEL;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)&ch_no;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Getting channel value\n");
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to get channel number\n");
@@ -2117,52 +2081,47 @@ static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
 static void Handle_GetRssi(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_RSSI;
-       strWID.type = WID_CHAR;
-       strWID.val = &rssi;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_RSSI;
+       wid.type = WID_CHAR;
+       wid.val = &rssi;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to get RSSI value\n");
                result = -EFAULT;
        }
 
        up(&hif_drv->hSemGetRSSI);
-
-
 }
 
-
 static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
        link_speed = 0;
 
-       strWID.id = (u16)WID_LINKSPEED;
-       strWID.type = WID_CHAR;
-       strWID.val = &link_speed;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_LINKSPEED;
+       wid.type = WID_CHAR;
+       wid.val = &link_speed;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to get LINKSPEED value\n");
                result = -EFAULT;
        }
 
-       up(&(hif_drv->hSemGetLINKSPEED));
-
-
+       up(&hif_drv->hSemGetLINKSPEED);
 }
 
 s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
@@ -2173,42 +2132,41 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
        strWIDList[u32WidsCount].id = WID_LINKSPEED;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->u8LinkSpeed));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->u8LinkSpeed;
        u32WidsCount++;
 
        strWIDList[u32WidsCount].id = WID_RSSI;
        strWIDList[u32WidsCount].type = WID_CHAR;
        strWIDList[u32WidsCount].size = sizeof(char);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->s8RSSI));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->s8RSSI;
        u32WidsCount++;
 
        strWIDList[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
        strWIDList[u32WidsCount].type = WID_INT;
        strWIDList[u32WidsCount].size = sizeof(u32);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->u32TxCount));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->u32TxCount;
        u32WidsCount++;
 
        strWIDList[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
        strWIDList[u32WidsCount].type = WID_INT;
        strWIDList[u32WidsCount].size = sizeof(u32);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->u32RxCount));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->u32RxCount;
        u32WidsCount++;
 
        strWIDList[u32WidsCount].id = WID_FAILED_COUNT;
        strWIDList[u32WidsCount].type = WID_INT;
        strWIDList[u32WidsCount].size = sizeof(u32);
-       strWIDList[u32WidsCount].val = (s8 *)(&(pstrStatistics->u32TxFailureCount));
+       strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->u32TxFailureCount;
        u32WidsCount++;
 
        result = send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
-                                  get_id_from_handler(hif_drv));
+                                get_id_from_handler(hif_drv));
 
        if (result)
                PRINT_ER("Failed to send scan paramters config packet\n");
 
        up(&hif_sema_wait_response);
        return 0;
-
 }
 
 static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
@@ -2216,36 +2174,33 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
 {
        s32 result = 0;
        u8 *stamac;
-       struct wid strWID;
-
-       strWID.id = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
-       strWID.type = WID_STR;
-       strWID.size = ETH_ALEN;
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
+       struct wid wid;
 
+       wid.id = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
+       wid.type = WID_STR;
+       wid.size = ETH_ALEN;
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
 
-       stamac = strWID.val;
+       stamac = wid.val;
        memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);
 
-
        PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to SET incative time\n");
                return -EFAULT;
        }
 
+       wid.id = (u16)WID_GET_INACTIVE_TIME;
+       wid.type = WID_INT;
+       wid.val = (s8 *)&inactive_time;
+       wid.size = sizeof(u32);
 
-       strWID.id = (u16)WID_GET_INACTIVE_TIME;
-       strWID.type = WID_INT;
-       strWID.val = (s8 *)&inactive_time;
-       strWID.size = sizeof(u32);
-
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to get incative time\n");
@@ -2263,19 +2218,19 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
                             struct beacon_attr *pstrSetBeaconParam)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
        PRINT_D(HOSTINF_DBG, "Adding BEACON\n");
 
-       strWID.id = (u16)WID_ADD_BEACON;
-       strWID.type = WID_BIN;
-       strWID.size = pstrSetBeaconParam->head_len + pstrSetBeaconParam->tail_len + 16;
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.id = (u16)WID_ADD_BEACON;
+       wid.type = WID_BIN;
+       wid.size = pstrSetBeaconParam->head_len + pstrSetBeaconParam->tail_len + 16;
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
        *pu8CurrByte++ = (pstrSetBeaconParam->interval & 0xFF);
        *pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 8) & 0xFF);
        *pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 16) & 0xFF);
@@ -2303,13 +2258,13 @@ static void Handle_AddBeacon(struct host_if_drv *hif_drv,
                memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
        pu8CurrByte += pstrSetBeaconParam->tail_len;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send add beacon config packet\n");
 
 ERRORHANDLER:
-       kfree(strWID.val);
+       kfree(wid.val);
        kfree(pstrSetBeaconParam->head);
        kfree(pstrSetBeaconParam->tail);
 }
@@ -2317,23 +2272,23 @@ ERRORHANDLER:
 static void Handle_DelBeacon(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
-       strWID.id = (u16)WID_DEL_BEACON;
-       strWID.type = WID_CHAR;
-       strWID.size = sizeof(char);
-       strWID.val = &del_beacon;
+       wid.id = (u16)WID_DEL_BEACON;
+       wid.type = WID_CHAR;
+       wid.size = sizeof(char);
+       wid.val = &del_beacon;
 
-       if (strWID.val == NULL)
+       if (!wid.val)
                return;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
 
        PRINT_D(HOSTINF_DBG, "Deleting BEACON\n");
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send delete beacon config packet\n");
 }
@@ -2388,52 +2343,51 @@ static void Handle_AddStation(struct host_if_drv *hif_drv,
                              struct add_sta_param *pstrStationParam)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
        PRINT_D(HOSTINF_DBG, "Handling add station\n");
-       strWID.id = (u16)WID_ADD_STA;
-       strWID.type = WID_BIN;
-       strWID.size = WILC_ADD_STA_LENGTH + pstrStationParam->u8NumRates;
+       wid.id = (u16)WID_ADD_STA;
+       wid.type = WID_BIN;
+       wid.size = WILC_ADD_STA_LENGTH + pstrStationParam->u8NumRates;
 
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
        pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result != 0)
                PRINT_ER("Failed to send add station config packet\n");
 
 ERRORHANDLER:
        kfree(pstrStationParam->pu8Rates);
-       kfree(strWID.val);
+       kfree(wid.val);
 }
 
 static void Handle_DelAllSta(struct host_if_drv *hif_drv,
                             struct del_all_sta *pstrDelAllStaParam)
 {
        s32 result = 0;
-
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
        u8 i;
        u8 au8Zero_Buff[6] = {0};
 
-       strWID.id = (u16)WID_DEL_ALL_STA;
-       strWID.type = WID_STR;
-       strWID.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
+       wid.id = (u16)WID_DEL_ALL_STA;
+       wid.type = WID_STR;
+       wid.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
 
        PRINT_D(HOSTINF_DBG, "Handling delete station\n");
 
-       strWID.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
 
        *(pu8CurrByte++) = pstrDelAllStaParam->assoc_sta;
 
@@ -2446,13 +2400,13 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
                pu8CurrByte += ETH_ALEN;
        }
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send add station config packet\n");
 
 ERRORHANDLER:
-       kfree(strWID.val);
+       kfree(wid.val);
 
        up(&hif_sema_wait_response);
 }
@@ -2461,59 +2415,59 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,
                              struct del_sta *pstrDelStaParam)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
-       strWID.id = (u16)WID_REMOVE_STA;
-       strWID.type = WID_BIN;
-       strWID.size = ETH_ALEN;
+       wid.id = (u16)WID_REMOVE_STA;
+       wid.type = WID_BIN;
+       wid.size = ETH_ALEN;
 
        PRINT_D(HOSTINF_DBG, "Handling delete station\n");
 
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
 
        memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send add station config packet\n");
 
 ERRORHANDLER:
-       kfree(strWID.val);
+       kfree(wid.val);
 }
 
 static void Handle_EditStation(struct host_if_drv *hif_drv,
                               struct add_sta_param *pstrStationParam)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
-       strWID.id = (u16)WID_EDIT_STA;
-       strWID.type = WID_BIN;
-       strWID.size = WILC_ADD_STA_LENGTH + pstrStationParam->u8NumRates;
+       wid.id = (u16)WID_EDIT_STA;
+       wid.type = WID_BIN;
+       wid.size = WILC_ADD_STA_LENGTH + pstrStationParam->u8NumRates;
 
        PRINT_D(HOSTINF_DBG, "Handling edit station\n");
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
        pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send edit station config packet\n");
 
 ERRORHANDLER:
        kfree(pstrStationParam->pu8Rates);
-       kfree(strWID.val);
+       kfree(wid.val);
 }
 
 static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
@@ -2521,7 +2475,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
 {
        s32 result = 0;
        u8 u8remain_on_chan_flag;
-       struct wid strWID;
+       struct wid wid;
 
        if (!hif_drv->u8RemainOnChan_pendingreq) {
                hif_drv->strHostIfRemainOnChan.pVoid = pstrHostIfRemainOnChan->pVoid;
@@ -2533,7 +2487,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
                pstrHostIfRemainOnChan->u16Channel = hif_drv->strHostIfRemainOnChan.u16Channel;
        }
 
-       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
+       if (hif_drv->usr_scan_req.pfUserScanResult) {
                PRINT_INFO(GENERIC_DBG, "Required to remain on chan while scanning return\n");
                hif_drv->u8RemainOnChan_pendingreq = 1;
                result = -EBUSY;
@@ -2554,21 +2508,20 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
        PRINT_D(HOSTINF_DBG, "Setting channel :%d\n", pstrHostIfRemainOnChan->u16Channel);
 
        u8remain_on_chan_flag = true;
-       strWID.id = (u16)WID_REMAIN_ON_CHAN;
-       strWID.type = WID_STR;
-       strWID.size = 2;
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-
-       if (strWID.val == NULL) {
+       wid.id = (u16)WID_REMAIN_ON_CHAN;
+       wid.type = WID_STR;
+       wid.size = 2;
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val) {
                result = -ENOMEM;
                goto ERRORHANDLER;
        }
 
-       strWID.val[0] = u8remain_on_chan_flag;
-       strWID.val[1] = (s8)pstrHostIfRemainOnChan->u16Channel;
+       wid.val[0] = u8remain_on_chan_flag;
+       wid.val[1] = (s8)pstrHostIfRemainOnChan->u16Channel;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result != 0)
                PRINT_ER("Failed to set remain on channel\n");
 
@@ -2594,28 +2547,28 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
                                struct reg_frame *pstrHostIfRegisterFrame)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
        PRINT_D(HOSTINF_DBG, "Handling frame register Flag : %d FrameType: %d\n", pstrHostIfRegisterFrame->bReg, pstrHostIfRegisterFrame->u16FrameType);
 
-       strWID.id = (u16)WID_REGISTER_FRAME;
-       strWID.type = WID_STR;
-       strWID.val = kmalloc(sizeof(u16) + 2, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.id = (u16)WID_REGISTER_FRAME;
+       wid.type = WID_STR;
+       wid.val = kmalloc(sizeof(u16) + 2, GFP_KERNEL);
+       if (!wid.val)
                return -ENOMEM;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
 
        *pu8CurrByte++ = pstrHostIfRegisterFrame->bReg;
        *pu8CurrByte++ = pstrHostIfRegisterFrame->u8Regid;
-       memcpy(pu8CurrByte, &(pstrHostIfRegisterFrame->u16FrameType), sizeof(u16));
-
+       memcpy(pu8CurrByte, &pstrHostIfRegisterFrame->u16FrameType,
+              sizeof(u16));
 
-       strWID.size = sizeof(u16) + 2;
+       wid.size = sizeof(u16) + 2;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to frame register config packet\n");
                result = -EINVAL;
@@ -2628,26 +2581,26 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
                                     struct remain_ch *pstrHostIfRemainOnChan)
 {
        u8 u8remain_on_chan_flag;
-       struct wid strWID;
+       struct wid wid;
        s32 result = 0;
 
        PRINT_D(HOSTINF_DBG, "CANCEL REMAIN ON CHAN\n");
 
        if (P2P_LISTEN_STATE) {
                u8remain_on_chan_flag = false;
-               strWID.id = (u16)WID_REMAIN_ON_CHAN;
-               strWID.type = WID_STR;
-               strWID.size = 2;
-               strWID.val = kmalloc(strWID.size, GFP_KERNEL);
+               wid.id = (u16)WID_REMAIN_ON_CHAN;
+               wid.type = WID_STR;
+               wid.size = 2;
+               wid.val = kmalloc(wid.size, GFP_KERNEL);
 
-               if (strWID.val == NULL)
+               if (!wid.val)
                        PRINT_ER("Failed to allocate memory\n");
 
-               strWID.val[0] = u8remain_on_chan_flag;
-               strWID.val[1] = FALSE_FRMWR_CHANNEL;
+               wid.val[0] = u8remain_on_chan_flag;
+               wid.val[1] = FALSE_FRMWR_CHANNEL;
 
-               result = send_config_pkt(SET_CFG, &strWID, 1,
-                                          get_id_from_handler(hif_drv));
+               result = send_config_pkt(SET_CFG, &wid, 1,
+                                        get_id_from_handler(hif_drv));
                if (result != 0) {
                        PRINT_ER("Failed to set remain on channel\n");
                        goto _done_;
@@ -2689,23 +2642,23 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,
                                   struct power_mgmt_param *strPowerMgmtParam)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        s8 s8PowerMode;
 
-       strWID.id = (u16)WID_POWER_MANAGEMENT;
+       wid.id = (u16)WID_POWER_MANAGEMENT;
 
-       if (strPowerMgmtParam->enabled == true)
+       if (strPowerMgmtParam->enabled)
                s8PowerMode = MIN_FAST_PS;
        else
                s8PowerMode = NO_POWERSAVE;
        PRINT_D(HOSTINF_DBG, "Handling power mgmt to %d\n", s8PowerMode);
-       strWID.val = &s8PowerMode;
-       strWID.size = sizeof(char);
+       wid.val = &s8PowerMode;
+       wid.size = sizeof(char);
 
        PRINT_D(HOSTINF_DBG, "Handling Power Management\n");
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send power management config packet\n");
 }
@@ -2714,19 +2667,19 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
                                      struct set_multicast *strHostIfSetMulti)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        u8 *pu8CurrByte;
 
        PRINT_D(HOSTINF_DBG, "Setup Multicast Filter\n");
 
-       strWID.id = (u16)WID_SETUP_MULTICAST_FILTER;
-       strWID.type = WID_BIN;
-       strWID.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
-       strWID.val = kmalloc(strWID.size, GFP_KERNEL);
-       if (strWID.val == NULL)
+       wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
+       wid.type = WID_BIN;
+       wid.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
+       wid.val = kmalloc(wid.size, GFP_KERNEL);
+       if (!wid.val)
                goto ERRORHANDLER;
 
-       pu8CurrByte = strWID.val;
+       pu8CurrByte = wid.val;
        *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF);
        *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF);
        *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF);
@@ -2740,21 +2693,20 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
        if ((strHostIfSetMulti->cnt) > 0)
                memcpy(pu8CurrByte, gau8MulticastMacAddrList, ((strHostIfSetMulti->cnt) * ETH_ALEN));
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send setup multicast config packet\n");
 
 ERRORHANDLER:
-       kfree(strWID.val);
-
+       kfree(wid.val);
 }
 
 static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
                               struct ba_session_info *strHostIfBASessionInfo)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        int AddbaTimeout = 100;
        char *ptr = NULL;
 
@@ -2766,11 +2718,11 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
                strHostIfBASessionInfo->u16SessionTimeout,
                strHostIfBASessionInfo->u8Ted);
 
-       strWID.id = (u16)WID_11E_P_ACTION_REQ;
-       strWID.type = WID_STR;
-       strWID.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
-       strWID.size = BLOCK_ACK_REQ_SIZE;
-       ptr = strWID.val;
+       wid.id = (u16)WID_11E_P_ACTION_REQ;
+       wid.type = WID_STR;
+       wid.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
+       wid.size = BLOCK_ACK_REQ_SIZE;
+       ptr = wid.val;
        *ptr++ = 0x14;
        *ptr++ = 0x3;
        *ptr++ = 0x0;
@@ -2787,16 +2739,15 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
        *ptr++ = 8;
        *ptr++ = 0;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_D(HOSTINF_DBG, "Couldn't open BA Session\n");
 
-
-       strWID.id = (u16)WID_11E_P_ACTION_REQ;
-       strWID.type = WID_STR;
-       strWID.size = 15;
-       ptr = strWID.val;
+       wid.id = (u16)WID_11E_P_ACTION_REQ;
+       wid.type = WID_STR;
+       wid.size = 15;
+       ptr = wid.val;
        *ptr++ = 15;
        *ptr++ = 7;
        *ptr++ = 0x2;
@@ -2807,20 +2758,19 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
        *ptr++ = (strHostIfBASessionInfo->u16BufferSize & 0xFF);
        *ptr++ = ((strHostIfBASessionInfo->u16SessionTimeout >> 16) & 0xFF);
        *ptr++ = 3;
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
-       kfree(strWID.val);
+       kfree(wid.val);
 
        return result;
-
 }
 
 static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
                                     struct ba_session_info *strHostIfBASessionInfo)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
        char *ptr = NULL;
 
        PRINT_D(GENERIC_DBG, "Delete Block Ack session with\nBSSID = %.2x:%.2x:%.2x\nTID=%d\n",
@@ -2829,11 +2779,11 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
                strHostIfBASessionInfo->au8Bssid[2],
                strHostIfBASessionInfo->u8Ted);
 
-       strWID.id = (u16)WID_DEL_ALL_RX_BA;
-       strWID.type = WID_STR;
-       strWID.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
-       strWID.size = BLOCK_ACK_REQ_SIZE;
-       ptr = strWID.val;
+       wid.id = (u16)WID_DEL_ALL_RX_BA;
+       wid.type = WID_STR;
+       wid.val = kmalloc(BLOCK_ACK_REQ_SIZE, GFP_KERNEL);
+       wid.size = BLOCK_ACK_REQ_SIZE;
+       ptr = wid.val;
        *ptr++ = 0x14;
        *ptr++ = 0x3;
        *ptr++ = 0x2;
@@ -2843,13 +2793,12 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
        *ptr++ = 0;
        *ptr++ = 32;
 
-       result = send_config_pkt(SET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(SET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result)
                PRINT_D(HOSTINF_DBG, "Couldn't delete BA Session\n");
 
-
-       kfree(strWID.val);
+       kfree(wid.val);
 
        up(&hif_sema_wait_response);
 
@@ -2879,7 +2828,8 @@ static int hostIFthread(void *pvArg)
                        continue;
                }
 
-               if (msg.id == HOST_IF_MSG_CONNECT && hif_drv->strWILC_UsrScanReq.pfUserScanResult != NULL) {
+               if (msg.id == HOST_IF_MSG_CONNECT &&
+                   hif_drv->usr_scan_req.pfUserScanResult) {
                        PRINT_D(HOSTINF_DBG, "Requeue connect request till scan done received\n");
                        wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
                        usleep_range(2 * 1000, 2 * 1000);
@@ -3092,12 +3042,12 @@ static void TimerCB_Connect(unsigned long arg)
 
 s32 host_int_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_REMOVE_KEY;
-       strWID.type = WID_STR;
-       strWID.val = (s8 *)pu8StaAddress;
-       strWID.size = 6;
+       wid.id = (u16)WID_REMOVE_KEY;
+       wid.type = WID_STR;
+       wid.val = (s8 *)pu8StaAddress;
+       wid.size = 6;
 
        return 0;
 }
@@ -3129,12 +3079,11 @@ int host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
        return result;
 }
 
-s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index)
+int host_int_set_wep_default_key(struct host_if_drv *hif_drv, u8 index)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
 
-
        if (!hif_drv) {
                result = -EFAULT;
                PRINT_ER("driver is null\n");
@@ -3143,12 +3092,11 @@ s32 host_int_set_WEPDefaultKeyID(struct host_if_drv *hif_drv, u8 u8Index)
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-
        msg.id = HOST_IF_MSG_KEY;
        msg.body.key_info.type = WEP;
        msg.body.key_info.action = DEFAULTKEY;
        msg.drv = hif_drv;
-       msg.body.key_info.attr.wep.index = u8Index;
+       msg.body.key_info.attr.wep.index = index;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
        if (result)
@@ -3167,14 +3115,12 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
        struct host_if_msg msg;
 
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("driver is null\n");
-               return result;
+               return -EFAULT;
        }
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-
        msg.id = HOST_IF_MSG_KEY;
        msg.body.key_info.type = WEP;
        msg.body.key_info.action = ADDKEY;
@@ -3204,9 +3150,8 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
        u8 i;
 
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("driver is null\n");
-               return result;
+               return -EFAULT;
        }
 
        memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3246,18 +3191,18 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
        u32 i;
 
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("driver is null\n");
-               return result;
+               return -EFAULT;
        }
-       if (pu8RxMic != NULL)
+
+       if (pu8RxMic)
                u8KeyLen += RX_MIC_KEY_LEN;
-       if (pu8TxMic != NULL)
+
+       if (pu8TxMic)
                u8KeyLen += TX_MIC_KEY_LEN;
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-
        msg.id = HOST_IF_MSG_KEY;
        msg.body.key_info.type = WPAPtk;
        if (mode == AP_MODE) {
@@ -3270,14 +3215,14 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
        msg.body.key_info.attr.wpa.key = kmalloc(u8PtkKeylen, GFP_KERNEL);
        memcpy(msg.body.key_info.attr.wpa.key, pu8Ptk, u8PtkKeylen);
 
-       if (pu8RxMic != NULL) {
+       if (pu8RxMic) {
                memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN);
                if (INFO) {
                        for (i = 0; i < RX_MIC_KEY_LEN; i++)
                                PRINT_INFO(CFG80211_DBG, "PairwiseRx[%d] = %x\n", i, pu8RxMic[i]);
                }
        }
-       if (pu8TxMic != NULL) {
+       if (pu8TxMic) {
                memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN);
                if (INFO) {
                        for (i = 0; i < TX_MIC_KEY_LEN; i++)
@@ -3311,23 +3256,22 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
        u8 u8KeyLen = u8GtkKeylen;
 
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("driver is null\n");
-               return result;
+               return -EFAULT;
        }
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-
-       if (pu8RxMic != NULL)
+       if (pu8RxMic)
                u8KeyLen += RX_MIC_KEY_LEN;
-       if (pu8TxMic != NULL)
+
+       if (pu8TxMic)
                u8KeyLen += TX_MIC_KEY_LEN;
-       if (KeyRSC != NULL) {
+
+       if (KeyRSC) {
                msg.body.key_info.attr.wpa.seq = kmalloc(u32KeyRSClen, GFP_KERNEL);
                memcpy(msg.body.key_info.attr.wpa.seq, KeyRSC, u32KeyRSClen);
        }
 
-
        msg.id = HOST_IF_MSG_KEY;
        msg.body.key_info.type = WPARxGtk;
        msg.drv = hif_drv;
@@ -3342,12 +3286,13 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
        msg.body.key_info.attr.wpa.key = kmalloc(u8KeyLen, GFP_KERNEL);
        memcpy(msg.body.key_info.attr.wpa.key, pu8RxGtk, u8GtkKeylen);
 
-       if (pu8RxMic != NULL) {
-               memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN);
-       }
-       if (pu8TxMic != NULL) {
-               memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN);
-       }
+       if (pu8RxMic)
+               memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic,
+                      RX_MIC_KEY_LEN);
+
+       if (pu8TxMic)
+               memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic,
+                      TX_MIC_KEY_LEN);
 
        msg.body.key_info.attr.wpa.index = u8KeyIdx;
        msg.body.key_info.attr.wpa.key_len = u8KeyLen;
@@ -3368,11 +3313,9 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
        struct host_if_msg msg;
        u32 i;
 
-
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("driver is null\n");
-               return result;
+               return -EFAULT;
        }
 
        memset(&msg, 0, sizeof(struct host_if_msg));
@@ -3383,10 +3326,10 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
        msg.drv = hif_drv;
 
        for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) {
-               memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid, &pu8PmkidInfoArray->pmkidlist[i].bssid,
-                           ETH_ALEN);
-               memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid, &pu8PmkidInfoArray->pmkidlist[i].pmkid,
-                           PMKID_LEN);
+               memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid,
+                      &pu8PmkidInfoArray->pmkidlist[i].bssid, ETH_ALEN);
+               memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid,
+                      &pu8PmkidInfoArray->pmkidlist[i].pmkid, PMKID_LEN);
        }
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3400,12 +3343,12 @@ s32 host_int_get_pmkid_info(struct host_if_drv *hif_drv,
                            u8 *pu8PmkidInfoArray,
                            u32 u32PmkidInfoLen)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_PMKID_INFO;
-       strWID.type = WID_STR;
-       strWID.size = u32PmkidInfoLen;
-       strWID.val = pu8PmkidInfoArray;
+       wid.id = (u16)WID_PMKID_INFO;
+       wid.type = WID_STR;
+       wid.size = u32PmkidInfoLen;
+       wid.val = pu8PmkidInfoArray;
 
        return 0;
 }
@@ -3414,13 +3357,13 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
                                         u8 *pu8PassPhrase,
                                         u8 u8Psklength)
 {
-       struct wid strWID;
+       struct wid wid;
 
        if ((u8Psklength > 7) && (u8Psklength < 65)) {
-               strWID.id = (u16)WID_11I_PSK;
-               strWID.type = WID_STR;
-               strWID.val = pu8PassPhrase;
-               strWID.size = u8Psklength;
+               wid.id = (u16)WID_11I_PSK;
+               wid.type = WID_STR;
+               wid.val = pu8PassPhrase;
+               wid.size = u8Psklength;
        }
 
        return 0;
@@ -3434,7 +3377,7 @@ s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
        memset(&msg, 0, sizeof(struct host_if_msg));
 
        msg.id = HOST_IF_MSG_GET_MAC_ADDRESS;
-       msg.body.get_mac_info.u8MacAddress = pu8MacAddress;
+       msg.body.get_mac_info.mac_addr = pu8MacAddress;
        msg.drv = hif_drv;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3456,7 +3399,7 @@ s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
 
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_SET_MAC_ADDRESS;
-       memcpy(msg.body.set_mac_info.u8MacAddress, pu8MacAddress, ETH_ALEN);
+       memcpy(msg.body.set_mac_info.mac_addr, pu8MacAddress, ETH_ALEN);
        msg.drv = hif_drv;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3469,36 +3412,36 @@ s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
 s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
                                         u8 *pu8PassPhrase, u8 u8Psklength)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_11I_PSK;
-       strWID.type = WID_STR;
-       strWID.size = u8Psklength;
-       strWID.val = pu8PassPhrase;
+       wid.id = (u16)WID_11I_PSK;
+       wid.type = WID_STR;
+       wid.size = u8Psklength;
+       wid.val = pu8PassPhrase;
 
        return 0;
 }
 
 s32 host_int_set_start_scan_req(struct host_if_drv *hif_drv, u8 scanSource)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_START_SCAN_REQ;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)&scanSource;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_START_SCAN_REQ;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)&scanSource;
+       wid.size = sizeof(char);
 
        return 0;
 }
 
 s32 host_int_get_start_scan_req(struct host_if_drv *hif_drv, u8 *pu8ScanSource)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_START_SCAN_REQ;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)pu8ScanSource;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_START_SCAN_REQ;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)pu8ScanSource;
+       wid.size = sizeof(char);
 
        return 0;
 }
@@ -3513,13 +3456,12 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
        s32 result = 0;
        struct host_if_msg msg;
 
-       if (!hif_drv || pfConnectResult == NULL) {
-               result = -EFAULT;
+       if (!hif_drv || !pfConnectResult) {
                PRINT_ER("Driver is null\n");
-               return result;
+               return -EFAULT;
        }
 
-       if (pJoinParams == NULL) {
+       if (!pJoinParams) {
                PRINT_ER("Unable to Join - JoinParams is NULL\n");
                return -EFAULT;
        }
@@ -3536,18 +3478,18 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
        msg.body.con_info.params = pJoinParams;
        msg.drv = hif_drv ;
 
-       if (pu8bssid != NULL) {
+       if (pu8bssid) {
                msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL);
                memcpy(msg.body.con_info.bssid, pu8bssid, 6);
        }
 
-       if (pu8ssid != NULL) {
+       if (pu8ssid) {
                msg.body.con_info.ssid_len = ssidLen;
                msg.body.con_info.ssid = kmalloc(ssidLen, GFP_KERNEL);
                memcpy(msg.body.con_info.ssid, pu8ssid, ssidLen);
        }
 
-       if (pu8IEs != NULL) {
+       if (pu8IEs) {
                msg.body.con_info.ies_len = IEsLen;
                msg.body.con_info.ies = kmalloc(IEsLen, GFP_KERNEL);
                memcpy(msg.body.con_info.ies, pu8IEs, IEsLen);
@@ -3575,16 +3517,12 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
        s32 result = 0;
        struct host_if_msg msg;
 
-       if (!join_req) {
-               result = -EFAULT;
-               return result;
-       }
-
+       if (!join_req)
+               return -EFAULT;
 
        if (!hif_drv) {
-               result = -EFAULT;
                PRINT_ER("Driver is null\n");
-               return result;
+               return -EFAULT;
        }
 
        msg.id = HOST_IF_MSG_FLUSH_CONNECT;
@@ -3625,67 +3563,71 @@ s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
 
 s32 host_int_disconnect_station(struct host_if_drv *hif_drv, u8 assoc_id)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_DISCONNECT;
-       strWID.type = WID_CHAR;
-       strWID.val = (s8 *)&assoc_id;
-       strWID.size = sizeof(char);
+       wid.id = (u16)WID_DISCONNECT;
+       wid.type = WID_CHAR;
+       wid.val = (s8 *)&assoc_id;
+       wid.size = sizeof(char);
 
        return 0;
 }
 
-s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv, u8 *pu8AssocReqInfo,
-                                       u32 u32AssocReqInfoLen)
+s32 host_int_get_assoc_req_info(struct host_if_drv *hif_drv,
+                               u8 *pu8AssocReqInfo,
+                               u32 u32AssocReqInfoLen)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_ASSOC_REQ_INFO;
-       strWID.type = WID_STR;
-       strWID.val = pu8AssocReqInfo;
-       strWID.size = u32AssocReqInfoLen;
+       wid.id = (u16)WID_ASSOC_REQ_INFO;
+       wid.type = WID_STR;
+       wid.val = pu8AssocReqInfo;
+       wid.size = u32AssocReqInfoLen;
 
        return 0;
 }
 
-s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv, u8 *pu8AssocRespInfo,
-                                       u32 u32MaxAssocRespInfoLen, u32 *pu32RcvdAssocRespInfoLen)
+s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
+                               u8 *pu8AssocRespInfo,
+                               u32 u32MaxAssocRespInfoLen,
+                               u32 *pu32RcvdAssocRespInfoLen)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
        if (!hif_drv) {
                PRINT_ER("Driver is null\n");
                return -EFAULT;
        }
 
-       strWID.id = (u16)WID_ASSOC_RES_INFO;
-       strWID.type = WID_STR;
-       strWID.val = pu8AssocRespInfo;
-       strWID.size = u32MaxAssocRespInfoLen;
+       wid.id = (u16)WID_ASSOC_RES_INFO;
+       wid.type = WID_STR;
+       wid.val = pu8AssocRespInfo;
+       wid.size = u32MaxAssocRespInfoLen;
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
        if (result) {
                *pu32RcvdAssocRespInfoLen = 0;
                PRINT_ER("Failed to send association response config packet\n");
                return -EINVAL;
        } else {
-               *pu32RcvdAssocRespInfoLen = strWID.size;
+               *pu32RcvdAssocRespInfoLen = wid.size;
        }
 
        return result;
 }
 
-s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv, u8 *pu8RxPowerLevel,
-                                       u32 u32RxPowerLevelLen)
+s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv,
+                               u8 *pu8RxPowerLevel,
+                               u32 u32RxPowerLevelLen)
 {
-       struct wid strWID;
+       struct wid wid;
 
-       strWID.id = (u16)WID_RX_POWER_LEVEL;
-       strWID.type = WID_STR;
-       strWID.val = pu8RxPowerLevel;
-       strWID.size = u32RxPowerLevelLen;
+       wid.id = (u16)WID_RX_POWER_LEVEL;
+       wid.type = WID_STR;
+       wid.val = pu8RxPowerLevel;
+       wid.size = u32RxPowerLevelLen;
 
        return 0;
 }
@@ -3717,8 +3659,8 @@ int host_int_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
 int host_int_wait_msg_queue_idle(void)
 {
        int result = 0;
-
        struct host_if_msg msg;
+
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_Q_IDLE;
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3735,11 +3677,11 @@ int host_int_wait_msg_queue_idle(void)
 int host_int_set_wfi_drv_handler(struct host_if_drv *hif_drv)
 {
        int result = 0;
-
        struct host_if_msg msg;
+
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER;
-       msg.body.drv.u32Address = get_id_from_handler(hif_drv);
+       msg.body.drv.handler = get_id_from_handler(hif_drv);
        msg.drv = hif_drv;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3754,11 +3696,11 @@ int host_int_set_wfi_drv_handler(struct host_if_drv *hif_drv)
 int host_int_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
 {
        int result = 0;
-
        struct host_if_msg msg;
+
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_SET_OPERATION_MODE;
-       msg.body.mode.u32Mode = mode;
+       msg.body.mode.mode = mode;
        msg.drv = hif_drv;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3807,10 +3749,7 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
        }
 
        memset(&msg, 0, sizeof(struct host_if_msg));
-
-
-       memcpy(msg.body.mac_info.mac,
-                   mac, ETH_ALEN);
+       memcpy(msg.body.mac_info.mac, mac, ETH_ALEN);
 
        msg.id = HOST_IF_MSG_GET_INACTIVETIME;
        msg.drv = hif_drv;
@@ -3829,27 +3768,26 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
 s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
 {
        s32 result = 0;
-       struct wid strWID;
+       struct wid wid;
 
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
                return -EFAULT;
        }
 
-       strWID.id = (u16)WID_MEMORY_ADDRESS;
-       strWID.type = WID_INT;
-       strWID.val = (s8 *)pu32TestMemAddr;
-       strWID.size = sizeof(u32);
+       wid.id = (u16)WID_MEMORY_ADDRESS;
+       wid.type = WID_INT;
+       wid.val = (s8 *)pu32TestMemAddr;
+       wid.size = sizeof(u32);
 
-       result = send_config_pkt(GET_CFG, &strWID, 1,
-                                  get_id_from_handler(hif_drv));
+       result = send_config_pkt(GET_CFG, &wid, 1,
+                                get_id_from_handler(hif_drv));
 
        if (result) {
                PRINT_ER("Failed to get wid value\n");
                return -EINVAL;
        } else {
                PRINT_D(HOSTINF_DBG, "Successfully got wid value\n");
-
        }
 
        return result;
@@ -3859,8 +3797,8 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
 {
        s32 result = 0;
        struct host_if_msg msg;
-       memset(&msg, 0, sizeof(struct host_if_msg));
 
+       memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_GET_RSSI;
        msg.drv = hif_drv;
 
@@ -3872,8 +3810,7 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
 
        down(&hif_drv->hSemGetRSSI);
 
-
-       if (ps8Rssi == NULL) {
+       if (!ps8Rssi) {
                PRINT_ER("RSS pointer value is null");
                return -EFAULT;
        }
@@ -3887,8 +3824,8 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
 {
        struct host_if_msg msg;
        s32 result = 0;
-       memset(&msg, 0, sizeof(struct host_if_msg));
 
+       memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_GET_LINKSPEED;
        msg.drv = hif_drv;
 
@@ -3900,8 +3837,7 @@ s32 host_int_get_link_speed(struct host_if_drv *hif_drv, s8 *ps8lnkspd)
 
        down(&hif_drv->hSemGetLINKSPEED);
 
-
-       if (ps8lnkspd == NULL) {
+       if (!ps8lnkspd) {
                PRINT_ER("LINKSPEED pointer value is null");
                return -EFAULT;
        }
@@ -3915,8 +3851,8 @@ s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrSta
 {
        s32 result = 0;
        struct host_if_msg msg;
-       memset(&msg, 0, sizeof(struct host_if_msg));
 
+       memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_GET_STATISTICS;
        msg.body.data = (char *)pstrStatistics;
        msg.drv = hif_drv;
@@ -3940,7 +3876,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
        s32 result = 0;
        struct host_if_msg msg;
 
-       if (!hif_drv || ScanResult == NULL) {
+       if (!hif_drv || !ScanResult) {
                PRINT_ER("hif_drv or ScanResult = NULL\n");
                return -EFAULT;
        }
@@ -3949,7 +3885,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
 
        msg.id = HOST_IF_MSG_SCAN;
 
-       if (pstrHiddenNetwork != NULL) {
+       if (pstrHiddenNetwork) {
                msg.body.scan_info.hidden_network.pstrHiddenNetworkInfo = pstrHiddenNetwork->pstrHiddenNetworkInfo;
                msg.body.scan_info.hidden_network.u8ssidnum = pstrHiddenNetwork->u8ssidnum;
 
@@ -3990,7 +3926,6 @@ s32 hif_set_cfg(struct host_if_drv *hif_drv,
        s32 result = 0;
        struct host_if_msg msg;
 
-
        if (!hif_drv) {
                PRINT_ER("hif_drv NULL\n");
                return -EFAULT;
@@ -4018,7 +3953,6 @@ s32 hif_get_cfg(struct host_if_drv *hif_drv, u16 u16WID, u16 *pu16WID_Value)
        }
        PRINT_D(HOSTINF_DBG, "Getting configuration parameters\n");
        switch (u16WID) {
-
        case WID_BSS_TYPE:
                *pu16WID_Value = (u16)hif_drv->strCfgValues.bss_type;
                break;
@@ -4100,11 +4034,6 @@ s32 hif_get_cfg(struct host_if_drv *hif_drv, u16 u16WID, u16 *pu16WID_Value)
        return result;
 }
 
-void host_int_send_join_leave_info_to_host
-       (u16 assocId, u8 *stationAddr, bool joining)
-{
-}
-
 static void GetPeriodicRSSI(unsigned long arg)
 {
        struct host_if_drv *hif_drv = (struct host_if_drv *)arg;
@@ -4133,17 +4062,16 @@ static void GetPeriodicRSSI(unsigned long arg)
        mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000));
 }
 
-
-void host_int_send_network_info_to_host
-       (u8 *macStartAddress, u16 u16RxFrameLen, s8 s8Rssi)
-{
-}
-
-s32 host_int_init(struct host_if_drv **hif_drv_handler)
+s32 host_int_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 {
        s32 result = 0;
        struct host_if_drv *hif_drv;
        int err;
+       perInterface_wlan_t *nic;
+       struct wilc *wilc;
+
+       nic = netdev_priv(dev);
+       wilc = nic->wilc;
 
        PRINT_D(HOSTINF_DBG, "Initializing host interface for client %d\n", clients_count + 1);
 
@@ -4189,7 +4117,8 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
                        goto _fail_;
                }
 
-               hif_thread_handler = kthread_run(hostIFthread, NULL, "WILC_kthread");
+               hif_thread_handler = kthread_run(hostIFthread, wilc,
+                                                "WILC_kthread");
 
                if (IS_ERR(hif_thread_handler)) {
                        PRINT_ER("Failed to creat Thread\n");
@@ -4207,7 +4136,7 @@ s32 host_int_init(struct host_if_drv **hif_drv_handler)
 
        setup_timer(&hif_drv->hRemainOnChannel, ListenTimerCB, 0);
 
-       sema_init(&(hif_drv->gtOsCfgValuesSem), 1);
+       sema_init(&hif_drv->gtOsCfgValuesSem, 1);
        down(&hif_drv->gtOsCfgValuesSem);
 
        hif_drv->enuHostIFstate = HOST_IF_IDLE;
@@ -4258,13 +4187,11 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
        terminated_handle = hif_drv;
        PRINT_D(HOSTINF_DBG, "De-initializing host interface for client %d\n", clients_count);
 
-       if (del_timer_sync(&hif_drv->hScanTimer)) {
+       if (del_timer_sync(&hif_drv->hScanTimer))
                PRINT_D(HOSTINF_DBG, ">> Scan timer is active\n");
-       }
 
-       if (del_timer_sync(&hif_drv->hConnectTimer)) {
+       if (del_timer_sync(&hif_drv->hConnectTimer))
                PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
-       }
 
        if (del_timer_sync(&periodic_rssi))
                PRINT_D(HOSTINF_DBG, ">> Connect timer is active\n");
@@ -4274,11 +4201,11 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
        host_int_set_wfi_drv_handler(NULL);
        down(&hif_sema_driver);
 
-       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
-               hif_drv->strWILC_UsrScanReq.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
-                                                               hif_drv->strWILC_UsrScanReq.u32UserScanPvoid, NULL);
+       if (hif_drv->usr_scan_req.pfUserScanResult) {
+               hif_drv->usr_scan_req.pfUserScanResult(SCAN_EVENT_ABORTED, NULL,
+                                                      hif_drv->usr_scan_req.u32UserScanPvoid, NULL);
 
-               hif_drv->strWILC_UsrScanReq.pfUserScanResult = NULL;
+               hif_drv->usr_scan_req.pfUserScanResult = NULL;
        }
 
        hif_drv->enuHostIFstate = HOST_IF_IDLE;
@@ -4303,7 +4230,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
                wilc_mq_destroy(&hif_msg_q);
        }
 
-       down(&(hif_drv->gtOsCfgValuesSem));
+       down(&hif_drv->gtOsCfgValuesSem);
 
        ret = remove_handler_in_list(hif_drv);
        if (ret)
@@ -4327,9 +4254,6 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
        id = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
        hif_drv = get_handler_from_id(id);
 
-
-
-
        if (!hif_drv || hif_drv == terminated_handle)   {
                PRINT_ER("NetworkInfo received but driver not init[%p]\n", hif_drv);
                return;
@@ -4362,7 +4286,6 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
        hif_drv = get_handler_from_id(id);
        PRINT_D(HOSTINF_DBG, "General asynchronous info packet received\n");
 
-
        if (!hif_drv || hif_drv == terminated_handle) {
                PRINT_D(HOSTINF_DBG, "Wifi driver handler is equal to NULL\n");
                up(&hif_sema_deinit);
@@ -4377,7 +4300,6 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-
        msg.id = HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO;
        msg.drv = hif_drv;
 
@@ -4402,13 +4324,12 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
        id = ((pu8Buffer[u32Length - 4]) | (pu8Buffer[u32Length - 3] << 8) | (pu8Buffer[u32Length - 2] << 16) | (pu8Buffer[u32Length - 1] << 24));
        hif_drv = get_handler_from_id(id);
 
-
        PRINT_D(GENERIC_DBG, "Scan notification received %p\n", hif_drv);
 
        if (!hif_drv || hif_drv == terminated_handle)
                return;
 
-       if (hif_drv->strWILC_UsrScanReq.pfUserScanResult) {
+       if (hif_drv->usr_scan_req.pfUserScanResult) {
                memset(&msg, 0, sizeof(struct host_if_msg));
 
                msg.id = HOST_IF_MSG_RCVD_SCAN_COMPLETE;
@@ -4419,9 +4340,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
                        PRINT_ER("Error in sending message queue scan complete parameters: Error(%d)\n", result);
        }
 
-
        return;
-
 }
 
 s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
@@ -4542,7 +4461,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
        pstrSetBeaconParam->dtim_period = u32DTIMPeriod;
        pstrSetBeaconParam->head_len = u32HeadLen;
        pstrSetBeaconParam->head = kmemdup(pu8Head, u32HeadLen, GFP_KERNEL);
-       if (pstrSetBeaconParam->head == NULL) {
+       if (!pstrSetBeaconParam->head) {
                result = -ENOMEM;
                goto ERRORHANDLER;
        }
@@ -4551,7 +4470,7 @@ s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
        if (u32TailLen > 0) {
                pstrSetBeaconParam->tail = kmemdup(pu8Tail, u32TailLen,
                                                   GFP_KERNEL);
-               if (pstrSetBeaconParam->tail == NULL) {
+               if (!pstrSetBeaconParam->tail) {
                        result = -ENOMEM;
                        goto ERRORHANDLER;
                }
@@ -4571,7 +4490,6 @@ ERRORHANDLER:
        }
 
        return result;
-
 }
 
 s32 host_int_del_beacon(struct host_if_drv *hif_drv)
@@ -4602,7 +4520,6 @@ s32 host_int_add_station(struct host_if_drv *hif_drv,
        struct host_if_msg msg;
        struct add_sta_param *pstrAddStationMsg = &msg.body.add_sta_info;
 
-
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
                return -EFAULT;
@@ -4650,7 +4567,7 @@ s32 host_int_del_station(struct host_if_drv *hif_drv, const u8 *pu8MacAddr)
        msg.id = HOST_IF_MSG_DEL_STATION;
        msg.drv = hif_drv;
 
-       if (pu8MacAddr == NULL)
+       if (!pu8MacAddr)
                memset(pstrDelStationMsg->mac_addr, 255, ETH_ALEN);
        else
                memcpy(pstrDelStationMsg->mac_addr, pu8MacAddr, ETH_ALEN);
@@ -4671,7 +4588,6 @@ s32 host_int_del_allstation(struct host_if_drv *hif_drv,
        u32 i;
        u8 u8AssocNumb = 0;
 
-
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
                return -EFAULT;
@@ -4789,7 +4705,6 @@ s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
        struct host_if_msg msg;
        struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
 
-
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
                return -EFAULT;
@@ -4830,7 +4745,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
        u16IEsLen = ptstrNetworkInfo->u16IEsLen;
 
        pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL);
-       if (pNewJoinBssParam != NULL) {
+       if (pNewJoinBssParam) {
                pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod;
                pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod;
                pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo;
@@ -4846,9 +4761,9 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                pNewJoinBssParam->supp_rates[0] = suppRatesNo;
                                index += 2;
 
-                               for (i = 0; i < suppRatesNo; i++) {
+                               for (i = 0; i < suppRatesNo; i++)
                                        pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i];
-                               }
+
                                index += suppRatesNo;
                                continue;
                        } else if (pu8IEs[index] == EXT_SUPP_RATES_IE) {
@@ -4858,9 +4773,9 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                else
                                        pNewJoinBssParam->supp_rates[0] += extSuppRatesNo;
                                index += 2;
-                               for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++) {
+                               for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++)
                                        pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i];
-                               }
+
                                index += extSuppRatesNo;
                                continue;
                        } else if (pu8IEs[index] == HT_CAPABILITY_IE) {
@@ -4909,7 +4824,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
                                u16P2P_count += 4;
 
-                               memcpy(pNewJoinBssParam->au8StartTime, pu8IEs + u16P2P_count, 4);
+                               memcpy(pNewJoinBssParam->start_time, pu8IEs + u16P2P_count, 4);
 
                                index += pu8IEs[index + 1] + 2;
                                continue;
@@ -4935,9 +4850,9 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
                                rsnIndex += 2;
 
-                               for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++) {
+                               for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++)
                                        pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
-                               }
+
                                pcipherTotalCount += pcipherCount;
                                rsnIndex += jumpOffset;
 
@@ -4946,9 +4861,9 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
                                rsnIndex += 2;
 
-                               for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++) {
+                               for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)
                                        pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
-                               }
+
                                authTotalCount += authCount;
                                rsnIndex += jumpOffset;
 
@@ -4962,19 +4877,15 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
                                continue;
                        } else
                                index += pu8IEs[index + 1] + 2;
-
                }
-
-
        }
 
        return (void *)pNewJoinBssParam;
-
 }
 
 void host_int_freeJoinParams(void *pJoinParams)
 {
-       if ((struct bss_param *)pJoinParams != NULL)
+       if ((struct bss_param *)pJoinParams)
                kfree((struct bss_param *)pJoinParams);
        else
                PRINT_ER("Unable to FREE null pointer\n");