staging: wilc1000: Merge wilc-branch-arnd into work-testing
[cascardo/linux.git] / drivers / staging / wilc1000 / host_interface.c
index d5b7725..4acd936 100644 (file)
@@ -4,17 +4,12 @@
 #include <linux/delay.h>
 #include "host_interface.h"
 #include "coreconfigurator.h"
+#include "wilc_wlan.h"
 #include "wilc_wlan_if.h"
 #include "wilc_msgqueue.h"
 #include <linux/etherdevice.h>
 #include "wilc_wfi_netdevice.h"
 
-extern u8 connecting;
-
-extern struct timer_list hDuringIpTimer;
-
-extern u8 g_wilc_initialized;
-
 #define HOST_IF_MSG_SCAN                        0
 #define HOST_IF_MSG_CONNECT                     1
 #define HOST_IF_MSG_RCVD_GNRL_ASYNC_INFO        2
@@ -233,8 +228,8 @@ struct join_bss_param {
 
 static struct host_if_drv *wfidrv_list[NUM_CONCURRENT_IFC + 1];
 struct host_if_drv *terminated_handle;
-bool g_obtainingIP;
-u8 P2P_LISTEN_STATE;
+bool wilc_optaining_ip;
+static u8 P2P_LISTEN_STATE;
 static struct task_struct *hif_thread_handler;
 static WILC_MsgQueueHandle hif_msg_q;
 static struct semaphore hif_sema_thread;
@@ -243,7 +238,7 @@ static struct semaphore hif_sema_wait_response;
 static struct semaphore hif_sema_deinit;
 static struct timer_list periodic_rssi;
 
-u8 multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
+u8 wilc_multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
 
 static u8 rcv_assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
 
@@ -259,10 +254,10 @@ static u8 del_beacon;
 static u32 clients_count;
 
 static u8 *join_req;
-u8 *info_element;
+static u8 *info_element;
 static u8 mode_11i;
-u8 auth_type;
-u32 join_req_size;
+static u8 auth_type;
+static u32 join_req_size;
 static u32 info_element_size;
 static struct host_if_drv *join_req_drv;
 #define REAL_JOIN_REQ 0
@@ -271,8 +266,6 @@ static struct host_if_drv *join_req_drv;
 
 static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo);
 
-extern int linux_wlan_get_num_conn_ifcs(void);
-
 static int add_handler_in_list(struct host_if_drv *handler)
 {
        int i;
@@ -336,7 +329,7 @@ static s32 handle_set_channel(struct host_if_drv *hif_drv,
 
        PRINT_D(HOSTINF_DBG, "Setting channel\n");
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -358,7 +351,7 @@ static s32 handle_set_wfi_drv_handler(struct host_if_drv *hif_drv,
        wid.val = (s8 *)&hif_drv_handler->handler;
        wid.size = sizeof(u32);
 
-       result = send_config_pkt(SET_CFG, &wid, 1, hif_drv_handler->handler);
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1, hif_drv_handler->handler);
 
        if (!hif_drv)
                up(&hif_sema_driver);
@@ -382,7 +375,7 @@ static s32 handle_set_operation_mode(struct host_if_drv *hif_drv,
        wid.val = (s8 *)&hif_op_mode->mode;
        wid.size = sizeof(u32);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if ((hif_op_mode->mode) == IDLE_MODE)
@@ -396,7 +389,9 @@ static s32 handle_set_operation_mode(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
+static s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx);
+
+static s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
 {
        s32 result = 0;
        struct wid wid;
@@ -415,7 +410,7 @@ s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
        wid.val = (u8 *)ip_addr;
        wid.size = IP_ALEN;
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        host_int_get_ipaddress(hif_drv, firmware_ip_addr, idx);
@@ -430,7 +425,7 @@ s32 handle_set_ip_address(struct host_if_drv *hif_drv, u8 *ip_addr, u8 idx)
        return result;
 }
 
-s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
+static s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
 {
        s32 result = 0;
        struct wid wid;
@@ -440,7 +435,7 @@ s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
        wid.val = kmalloc(IP_ALEN, GFP_KERNEL);
        wid.size = IP_ALEN;
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        PRINT_INFO(HOSTINF_DBG, "%pI4\n", wid.val);
@@ -450,7 +445,7 @@ s32 handle_get_ip_address(struct host_if_drv *hif_drv, u8 idx)
        kfree(wid.val);
 
        if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
-               host_int_setup_ipaddress(hif_drv, set_ip[idx], idx);
+               wilc_setup_ipaddress(hif_drv, set_ip[idx], idx);
 
        if (result != 0) {
                PRINT_ER("Failed to get IP address\n");
@@ -483,7 +478,7 @@ static s32 handle_set_mac_address(struct host_if_drv *hif_drv,
        wid.size = ETH_ALEN;
        PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", wid.val);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to set mac address\n");
@@ -505,7 +500,7 @@ static s32 handle_get_mac_address(struct host_if_drv *hif_drv,
        wid.val = get_mac_addr->mac_addr;
        wid.size = ETH_ALEN;
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -800,7 +795,7 @@ static s32 handle_cfg_param(struct host_if_drv *hif_drv,
                wid_cnt++;
        }
 
-       result = send_config_pkt(SET_CFG, wid_list, wid_cnt,
+       result = wilc_send_config_pkt(SET_CFG, wid_list, wid_cnt,
                                 get_id_from_handler(hif_drv));
 
        if (result)
@@ -813,10 +808,13 @@ ERRORHANDLER:
 
 static void Handle_wait_msg_q_empty(void)
 {
-       g_wilc_initialized = 0;
+       wilc_initialized = 0;
        up(&hif_sema_wait_response);
 }
 
+static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
+                          enum scan_event enuEvent);
+
 static s32 Handle_Scan(struct host_if_drv *hif_drv,
                       struct scan_attr *pstrHostIFscanAttr)
 {
@@ -843,7 +841,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
                goto ERRORHANDLER;
        }
 
-       if (g_obtainingIP || connecting) {
+       if (wilc_optaining_ip || wilc_connecting) {
                PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
                PRINT_ER("Don't do obss scan\n");
                result = -EBUSY;
@@ -920,7 +918,7 @@ static s32 Handle_Scan(struct host_if_drv *hif_drv,
        else if (hif_drv->hif_state == HOST_IF_IDLE)
                scan_while_connected = false;
 
-       result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+       result = wilc_send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
                                 get_id_from_handler(hif_drv));
 
        if (result)
@@ -964,7 +962,7 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
                wid.val = (s8 *)&u8abort_running_scan;
                wid.size = sizeof(char);
 
-               result = send_config_pkt(SET_CFG, &wid, 1,
+               result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                         get_id_from_handler(hif_drv));
 
                if (result) {
@@ -987,7 +985,7 @@ static s32 Handle_ScanDone(struct host_if_drv *hif_drv,
        return result;
 }
 
-u8 u8ConnectedSSID[6] = {0};
+u8 wilc_connected_SSID[6] = {0};
 static s32 Handle_Connect(struct host_if_drv *hif_drv,
                          struct connect_attr *pstrHostIFconnectAttr)
 {
@@ -999,7 +997,7 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
 
        PRINT_D(GENERIC_DBG, "Handling connect request\n");
 
-       if (memcmp(pstrHostIFconnectAttr->bssid, u8ConnectedSSID, ETH_ALEN) == 0) {
+       if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_SSID, ETH_ALEN) == 0) {
                result = 0;
                PRINT_ER("Trying to connect to an already connected AP, Discard connect request\n");
                return result;
@@ -1212,13 +1210,13 @@ static s32 Handle_Connect(struct host_if_drv *hif_drv,
        PRINT_D(GENERIC_DBG, "send HOST_IF_WAITING_CONN_RESP\n");
 
        if (pstrHostIFconnectAttr->bssid) {
-               memcpy(u8ConnectedSSID, pstrHostIFconnectAttr->bssid, ETH_ALEN);
+               memcpy(wilc_connected_SSID, pstrHostIFconnectAttr->bssid, ETH_ALEN);
 
                PRINT_D(GENERIC_DBG, "save Bssid = %pM\n", pstrHostIFconnectAttr->bssid);
-               PRINT_D(GENERIC_DBG, "save bssid = %pM\n", u8ConnectedSSID);
+               PRINT_D(GENERIC_DBG, "save bssid = %pM\n", wilc_connected_SSID);
        }
 
-       result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+       result = wilc_send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
                                 get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("failed to send config packet\n");
@@ -1235,7 +1233,7 @@ ERRORHANDLER:
 
                del_timer(&hif_drv->connect_timer);
 
-               PRINT_D(HOSTINF_DBG, "could not start connecting to the required network\n");
+               PRINT_D(HOSTINF_DBG, "could not start wilc_connecting to the required network\n");
 
                memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
 
@@ -1315,7 +1313,7 @@ static s32 Handle_FlushConnect(struct host_if_drv *hif_drv)
 
        u32WidsCount++;
 
-       result = send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
+       result = wilc_send_config_pkt(SET_CFG, strWIDList, u32WidsCount,
                                 get_id_from_handler(join_req_drv));
        if (result) {
                PRINT_ER("failed to send config packet\n");
@@ -1376,7 +1374,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result)
                PRINT_ER("Failed to send dissconect config packet\n");
@@ -1387,7 +1385,7 @@ static s32 Handle_ConnectTimeout(struct host_if_drv *hif_drv)
        hif_drv->usr_conn_req.ies_len = 0;
        kfree(hif_drv->usr_conn_req.ies);
 
-       eth_zero_addr(u8ConnectedSSID);
+       eth_zero_addr(wilc_connected_SSID);
 
        if (join_req && join_req_drv == hif_drv) {
                kfree(join_req);
@@ -1416,7 +1414,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv,
 
        if (hif_drv->usr_scan_req.scan_result) {
                PRINT_D(HOSTINF_DBG, "State: Scanning, parsing network information received\n");
-               parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
+               wilc_parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
                if ((!pstrNetworkInfo) ||
                    (!hif_drv->usr_scan_req.scan_result)) {
                        PRINT_ER("driver is null\n");
@@ -1476,13 +1474,18 @@ done:
        pstrRcvdNetworkInfo->buffer = NULL;
 
        if (pstrNetworkInfo) {
-               DeallocateNetworkInfo(pstrNetworkInfo);
+               wilc_dealloc_network_info(pstrNetworkInfo);
                pstrNetworkInfo = NULL;
        }
 
        return result;
 }
 
+static s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
+                                      u8 *pu8AssocRespInfo,
+                                      u32 u32MaxAssocRespInfoLen,
+                                      u32 *pu32RcvdAssocRespInfoLen);
+
 static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                    struct rcvd_async_info *pstrRcvdGnrlAsyncInfo)
 {
@@ -1550,10 +1553,10 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
 
                                if (u32RcvdAssocRespInfoLen != 0) {
                                        PRINT_D(HOSTINF_DBG, "Parsing association response\n");
-                                       s32Err = ParseAssocRespInfo(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
+                                       s32Err = wilc_parse_assoc_resp_info(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
                                                                    &pstrConnectRespInfo);
                                        if (s32Err) {
-                                               PRINT_ER("ParseAssocRespInfo() returned error %d\n", s32Err);
+                                               PRINT_ER("wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
                                        } else {
                                                strConnectInfo.u16ConnectStatus = pstrConnectRespInfo->u16ConnectStatus;
 
@@ -1568,7 +1571,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                                                }
 
                                                if (pstrConnectRespInfo) {
-                                                       DeallocateAssocRespInfo(pstrConnectRespInfo);
+                                                       wilc_dealloc_assoc_resp_info(pstrConnectRespInfo);
                                                        pstrConnectRespInfo = NULL;
                                                }
                                        }
@@ -1578,11 +1581,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                        if ((u8MacStatus == MAC_CONNECTED) &&
                            (strConnectInfo.u16ConnectStatus != SUCCESSFUL_STATUSCODE)) {
                                PRINT_ER("Received MAC status is MAC_CONNECTED while the received status code in Asoc Resp is not SUCCESSFUL_STATUSCODE\n");
-                               eth_zero_addr(u8ConnectedSSID);
+                               eth_zero_addr(wilc_connected_SSID);
 
                        } else if (u8MacStatus == MAC_DISCONNECTED)    {
                                PRINT_ER("Received MAC status is MAC_DISCONNECTED\n");
-                               eth_zero_addr(u8ConnectedSSID);
+                               eth_zero_addr(wilc_connected_SSID);
                        }
 
                        if (hif_drv->usr_conn_req.pu8bssid) {
@@ -1613,14 +1616,14 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
 
                        if ((u8MacStatus == MAC_CONNECTED) &&
                            (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE)) {
-                               host_int_set_power_mgmt(hif_drv, 0, 0);
+                               wilc_set_power_mgmt(hif_drv, 0, 0);
 
                                PRINT_D(HOSTINF_DBG, "MAC status : CONNECTED and Connect Status : Successful\n");
                                hif_drv->hif_state = HOST_IF_CONNECTED;
 
                                PRINT_D(GENERIC_DBG, "Obtaining an IP, Disable Scan\n");
-                               g_obtainingIP = true;
-                               mod_timer(&hDuringIpTimer,
+                               wilc_optaining_ip = true;
+                               mod_timer(&wilc_during_ip_timer,
                                          jiffies + msecs_to_jiffies(10000));
                        } else {
                                PRINT_D(HOSTINF_DBG, "MAC status : %d and Connect Status : %d\n", u8MacStatus, strConnectInfo.u16ConnectStatus);
@@ -1655,8 +1658,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct host_if_drv *hif_drv,
                        strDisconnectNotifInfo.ie_len = 0;
 
                        if (hif_drv->usr_conn_req.conn_result) {
-                               g_obtainingIP = false;
-                               host_int_set_power_mgmt(hif_drv, 0, 0);
+                               wilc_optaining_ip = false;
+                               wilc_set_power_mgmt(hif_drv, 0, 0);
 
                                hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
                                                                  NULL,
@@ -1754,7 +1757,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        strWIDList[3].size = pstrHostIFkeyAttr->attr.wep.key_len;
                        strWIDList[3].val = (s8 *)pu8keybuf;
 
-                       result = send_config_pkt(SET_CFG, strWIDList, 4,
+                       result = wilc_send_config_pkt(SET_CFG, strWIDList, 4,
                                                 get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                }
@@ -1777,7 +1780,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        wid.val = (s8 *)pu8keybuf;
                        wid.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
 
-                       result = send_config_pkt(SET_CFG, &wid, 1,
+                       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                                 get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                } else if (pstrHostIFkeyAttr->action & REMOVEKEY) {
@@ -1789,7 +1792,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        wid.val = s8idxarray;
                        wid.size = 1;
 
-                       result = send_config_pkt(SET_CFG, &wid, 1,
+                       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                                 get_id_from_handler(hif_drv));
                } else {
                        wid.id = (u16)WID_KEY_ID;
@@ -1799,7 +1802,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
 
                        PRINT_D(HOSTINF_DBG, "Setting default key index\n");
 
-                       result = send_config_pkt(SET_CFG, &wid, 1,
+                       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                                 get_id_from_handler(hif_drv));
                }
                up(&hif_drv->sem_test_key_block);
@@ -1832,7 +1835,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        strWIDList[1].val = (s8 *)pu8keybuf;
                        strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
 
-                       result = send_config_pkt(SET_CFG, strWIDList, 2,
+                       result = wilc_send_config_pkt(SET_CFG, strWIDList, 2,
                                                 get_id_from_handler(hif_drv));
 
                        kfree(pu8keybuf);
@@ -1865,7 +1868,7 @@ static int Handle_Key(struct host_if_drv *hif_drv,
                        wid.val = (s8 *)pu8keybuf;
                        wid.size = RX_MIC_KEY_MSG_LEN;
 
-                       result = send_config_pkt(SET_CFG, &wid, 1,
+                       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                                 get_id_from_handler(hif_drv));
 
                        kfree(pu8keybuf);
@@ -1904,7 +1907,7 @@ _WPARxGtk_end_case_:
                        strWIDList[1].val = (s8 *)pu8keybuf;
                        strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
 
-                       result = send_config_pkt(SET_CFG, strWIDList, 2,
+                       result = wilc_send_config_pkt(SET_CFG, strWIDList, 2,
                                                 get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                        up(&hif_drv->sem_test_key_block);
@@ -1927,7 +1930,7 @@ _WPARxGtk_end_case_:
                        wid.val = (s8 *)pu8keybuf;
                        wid.size = PTK_KEY_MSG_LEN;
 
-                       result = send_config_pkt(SET_CFG, &wid, 1,
+                       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                                 get_id_from_handler(hif_drv));
                        kfree(pu8keybuf);
                        up(&hif_drv->sem_test_key_block);
@@ -1962,7 +1965,7 @@ _WPAPtk_end_case_:
                wid.val = (s8 *)pu8keybuf;
                wid.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
 
-               result = send_config_pkt(SET_CFG, &wid, 1,
+               result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                         get_id_from_handler(hif_drv));
 
                kfree(pu8keybuf);
@@ -1989,12 +1992,12 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Sending disconnect request\n");
 
-       g_obtainingIP = false;
-       host_int_set_power_mgmt(hif_drv, 0, 0);
+       wilc_optaining_ip = false;
+       wilc_set_power_mgmt(hif_drv, 0, 0);
 
-       eth_zero_addr(u8ConnectedSSID);
+       eth_zero_addr(wilc_connected_SSID);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -2058,14 +2061,14 @@ static void Handle_Disconnect(struct host_if_drv *hif_drv)
        up(&hif_drv->sem_test_disconn_block);
 }
 
-void resolve_disconnect_aberration(struct host_if_drv *hif_drv)
+void wilc_resolve_disconnect_aberration(struct host_if_drv *hif_drv)
 {
        if (!hif_drv)
                return;
        if ((hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
            (hif_drv->hif_state == HOST_IF_CONNECTING)) {
                PRINT_D(HOSTINF_DBG, "\n\n<< correcting Supplicant state machine >>\n\n");
-               host_int_disconnect(hif_drv, 1);
+               wilc_disconnect(hif_drv, 1);
        }
 }
 
@@ -2081,7 +2084,7 @@ static s32 Handle_GetChnl(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Getting channel value\n");
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -2106,7 +2109,7 @@ static void Handle_GetRssi(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Getting RSSI value\n");
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to get RSSI value\n");
@@ -2130,7 +2133,7 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Getting LINKSPEED value\n");
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to get LINKSPEED value\n");
@@ -2140,7 +2143,7 @@ static void Handle_GetLinkspeed(struct host_if_drv *hif_drv)
        up(&hif_drv->sem_get_link_speed);
 }
 
-s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
+static s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
 {
        struct wid strWIDList[5];
        u32 u32WidsCount = 0, result = 0;
@@ -2175,7 +2178,7 @@ s32 Handle_GetStatistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatis
        strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
        u32WidsCount++;
 
-       result = send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
+       result = wilc_send_config_pkt(GET_CFG, strWIDList, u32WidsCount,
                                 get_id_from_handler(hif_drv));
 
        if (result)
@@ -2202,7 +2205,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
 
        PRINT_D(CFG80211_DBG, "SETING STA inactive time\n");
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -2215,7 +2218,7 @@ static s32 Handle_Get_InActiveTime(struct host_if_drv *hif_drv,
        wid.val = (s8 *)&inactive_time;
        wid.size = sizeof(u32);
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        if (result) {
@@ -2274,7 +2277,7 @@ 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, &wid, 1,
+       result = wilc_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");
@@ -2303,7 +2306,7 @@ static void Handle_DelBeacon(struct host_if_drv *hif_drv)
 
        PRINT_D(HOSTINF_DBG, "Deleting BEACON\n");
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2376,7 +2379,7 @@ static void Handle_AddStation(struct host_if_drv *hif_drv,
        pu8CurrByte = wid.val;
        pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2418,7 +2421,7 @@ static void Handle_DelAllSta(struct host_if_drv *hif_drv,
                pu8CurrByte += ETH_ALEN;
        }
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2450,7 +2453,7 @@ static void Handle_DelStation(struct host_if_drv *hif_drv,
 
        memcpy(pu8CurrByte, pstrDelStaParam->mac_addr, ETH_ALEN);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2478,7 +2481,7 @@ static void Handle_EditStation(struct host_if_drv *hif_drv,
        pu8CurrByte = wid.val;
        pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2517,7 +2520,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
                goto ERRORHANDLER;
        }
 
-       if (g_obtainingIP || connecting) {
+       if (wilc_optaining_ip || wilc_connecting) {
                PRINT_D(GENERIC_DBG, "[handle_scan]: Don't do obss scan until IP adresss is obtained\n");
                result = -EBUSY;
                goto ERRORHANDLER;
@@ -2539,7 +2542,7 @@ static int Handle_RemainOnChan(struct host_if_drv *hif_drv,
        wid.val[0] = u8remain_on_chan_flag;
        wid.val[1] = (s8)pstrHostIfRemainOnChan->ch;
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2587,7 +2590,7 @@ static int Handle_RegisterFrame(struct host_if_drv *hif_drv,
 
        wid.size = sizeof(u16) + 2;
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result) {
                PRINT_ER("Failed to frame register config packet\n");
@@ -2619,7 +2622,7 @@ static u32 Handle_ListenStateExpired(struct host_if_drv *hif_drv,
                wid.val[0] = u8remain_on_chan_flag;
                wid.val[1] = FALSE_FRMWR_CHANNEL;
 
-               result = send_config_pkt(SET_CFG, &wid, 1,
+               result = wilc_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");
@@ -2677,7 +2680,7 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv,
 
        PRINT_D(HOSTINF_DBG, "Handling Power Management\n");
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2711,10 +2714,10 @@ static void Handle_SetMulticastFilter(struct host_if_drv *hif_drv,
        *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
 
        if ((strHostIfSetMulti->cnt) > 0)
-               memcpy(pu8CurrByte, multicast_mac_addr_list,
+               memcpy(pu8CurrByte, wilc_multicast_mac_addr_list,
                       ((strHostIfSetMulti->cnt) * ETH_ALEN));
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2760,7 +2763,7 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
        *ptr++ = 8;
        *ptr++ = 0;
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2779,7 +2782,7 @@ static s32 Handle_AddBASession(struct host_if_drv *hif_drv,
        *ptr++ = (strHostIfBASessionInfo->buf_size & 0xFF);
        *ptr++ = ((strHostIfBASessionInfo->time_out >> 16) & 0xFF);
        *ptr++ = 3;
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(SET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
 
        kfree(wid.val);
@@ -2814,7 +2817,7 @@ static s32 Handle_DelAllRxBASessions(struct host_if_drv *hif_drv,
        *ptr++ = 0;
        *ptr++ = 32;
 
-       result = send_config_pkt(SET_CFG, &wid, 1,
+       result = wilc_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");
@@ -2842,7 +2845,7 @@ static int hostIFthread(void *pvArg)
                        break;
                }
 
-               if ((!g_wilc_initialized)) {
+               if ((!wilc_initialized)) {
                        PRINT_D(GENERIC_DBG, "--WAIT--");
                        usleep_range(200 * 1000, 200 * 1000);
                        wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -2902,8 +2905,8 @@ static int hostIFthread(void *pvArg)
                        del_timer(&hif_drv->scan_timer);
                        PRINT_D(HOSTINF_DBG, "scan completed successfully\n");
 
-                       if (!linux_wlan_get_num_conn_ifcs())
-                               chip_sleep_manually();
+                       if (!wilc_wlan_get_num_conn_ifcs(wilc_dev))
+                               wilc_chip_sleep_manually();
 
                        Handle_ScanDone(msg.drv, SCAN_EVENT_DONE);
 
@@ -3063,7 +3066,7 @@ static void TimerCB_Connect(unsigned long arg)
        wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
 }
 
-s32 host_int_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
+s32 wilc_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
 {
        struct wid wid;
 
@@ -3075,7 +3078,7 @@ s32 host_int_remove_key(struct host_if_drv *hif_drv, const u8 *pu8StaAddress)
        return 0;
 }
 
-int host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
+int wilc_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3102,7 +3105,7 @@ int host_int_remove_wep_key(struct host_if_drv *hif_drv, u8 index)
        return result;
 }
 
-int host_int_set_wep_default_key(struct host_if_drv *hif_drv, u8 index)
+int wilc_set_wep_default_keyid(struct host_if_drv *hif_drv, u8 index)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3129,7 +3132,7 @@ int host_int_set_wep_default_key(struct host_if_drv *hif_drv, u8 index)
        return result;
 }
 
-int host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
+int wilc_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
                                 const u8 *key,
                                 u8 len,
                                 u8 index)
@@ -3163,12 +3166,12 @@ int host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
        return result;
 }
 
-int host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
-                               const u8 *key,
-                               u8 len,
-                               u8 index,
-                               u8 mode,
-                               enum AUTHTYPE auth_type)
+int wilc_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
+                           const u8 *key,
+                           u8 len,
+                           u8 index,
+                           u8 mode,
+                           enum AUTHTYPE auth_type)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3207,26 +3210,26 @@ int host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
-                    u8 u8PtkKeylen, const u8 *mac_addr,
-                    const u8 *pu8RxMic, const u8 *pu8TxMic,
-                    u8 mode, u8 u8Ciphermode, u8 u8Idx)
+int wilc_add_ptk(struct host_if_drv *hif_drv, const u8 *ptk,
+                    u8 ptk_key_len, const u8 *mac_addr,
+                    const u8 *rx_mic, const u8 *tx_mic,
+                    u8 mode, u8 cipher_mode, u8 index)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
-       u8 u8KeyLen = u8PtkKeylen;
-       u32 i;
+       u8 key_len = ptk_key_len;
+       int i;
 
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
                return -EFAULT;
        }
 
-       if (pu8RxMic)
-               u8KeyLen += RX_MIC_KEY_LEN;
+       if (rx_mic)
+               key_len += RX_MIC_KEY_LEN;
 
-       if (pu8TxMic)
-               u8KeyLen += TX_MIC_KEY_LEN;
+       if (tx_mic)
+               key_len += TX_MIC_KEY_LEN;
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
@@ -3234,32 +3237,33 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
        msg.body.key_info.type = WPA_PTK;
        if (mode == AP_MODE) {
                msg.body.key_info.action = ADDKEY_AP;
-               msg.body.key_info.attr.wpa.index = u8Idx;
+               msg.body.key_info.attr.wpa.index = index;
        }
        if (mode == STATION_MODE)
                msg.body.key_info.action = ADDKEY;
 
-       msg.body.key_info.attr.wpa.key = kmalloc(u8PtkKeylen, GFP_KERNEL);
-       memcpy(msg.body.key_info.attr.wpa.key, pu8Ptk, u8PtkKeylen);
+       msg.body.key_info.attr.wpa.key = kmemdup(ptk, ptk_key_len, GFP_KERNEL);
+       if (!msg.body.key_info.attr.wpa.key)
+               return -ENOMEM;
 
-       if (pu8RxMic) {
-               memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic, RX_MIC_KEY_LEN);
+       if (rx_mic) {
+               memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic, 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]);
+                               PRINT_INFO(CFG80211_DBG, "PairwiseRx[%d] = %x\n", i, rx_mic[i]);
                }
        }
-       if (pu8TxMic) {
-               memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic, TX_MIC_KEY_LEN);
+       if (tx_mic) {
+               memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic, TX_MIC_KEY_LEN);
                if (INFO) {
                        for (i = 0; i < TX_MIC_KEY_LEN; i++)
-                               PRINT_INFO(CFG80211_DBG, "PairwiseTx[%d] = %x\n", i, pu8TxMic[i]);
+                               PRINT_INFO(CFG80211_DBG, "PairwiseTx[%d] = %x\n", i, tx_mic[i]);
                }
        }
 
-       msg.body.key_info.attr.wpa.key_len = u8KeyLen;
+       msg.body.key_info.attr.wpa.key_len = key_len;
        msg.body.key_info.attr.wpa.mac_addr = mac_addr;
-       msg.body.key_info.attr.wpa.mode = u8Ciphermode;
+       msg.body.key_info.attr.wpa.mode = cipher_mode;
        msg.drv = hif_drv;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3272,15 +3276,15 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk,
        return result;
 }
 
-s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
-                       u8 u8GtkKeylen, u8 u8KeyIdx,
-                       u32 u32KeyRSClen, const u8 *KeyRSC,
-                       const u8 *pu8RxMic, const u8 *pu8TxMic,
-                       u8 mode, u8 u8Ciphermode)
+int wilc_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *rx_gtk,
+                       u8 gtk_key_len, u8 index,
+                       u32 key_rsc_len, const u8 *key_rsc,
+                       const u8 *rx_mic, const u8 *tx_mic,
+                       u8 mode, u8 cipher_mode)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
-       u8 u8KeyLen = u8GtkKeylen;
+       u8 key_len = gtk_key_len;
 
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
@@ -3288,15 +3292,18 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
        }
        memset(&msg, 0, sizeof(struct host_if_msg));
 
-       if (pu8RxMic)
-               u8KeyLen += RX_MIC_KEY_LEN;
+       if (rx_mic)
+               key_len += RX_MIC_KEY_LEN;
 
-       if (pu8TxMic)
-               u8KeyLen += TX_MIC_KEY_LEN;
+       if (tx_mic)
+               key_len += TX_MIC_KEY_LEN;
 
-       if (KeyRSC) {
-               msg.body.key_info.attr.wpa.seq = kmalloc(u32KeyRSClen, GFP_KERNEL);
-               memcpy(msg.body.key_info.attr.wpa.seq, KeyRSC, u32KeyRSClen);
+       if (key_rsc) {
+               msg.body.key_info.attr.wpa.seq = kmemdup(key_rsc,
+                                                        key_rsc_len,
+                                                        GFP_KERNEL);
+               if (!msg.body.key_info.attr.wpa.seq)
+                       return -ENOMEM;
        }
 
        msg.id = HOST_IF_MSG_KEY;
@@ -3305,25 +3312,28 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
 
        if (mode == AP_MODE) {
                msg.body.key_info.action = ADDKEY_AP;
-               msg.body.key_info.attr.wpa.mode = u8Ciphermode;
+               msg.body.key_info.attr.wpa.mode = cipher_mode;
        }
        if (mode == STATION_MODE)
                msg.body.key_info.action = ADDKEY;
 
-       msg.body.key_info.attr.wpa.key = kmalloc(u8KeyLen, GFP_KERNEL);
-       memcpy(msg.body.key_info.attr.wpa.key, pu8RxGtk, u8GtkKeylen);
+       msg.body.key_info.attr.wpa.key = kmemdup(rx_gtk,
+                                                key_len,
+                                                GFP_KERNEL);
+       if (!msg.body.key_info.attr.wpa.key)
+               return -ENOMEM;
 
-       if (pu8RxMic)
-               memcpy(msg.body.key_info.attr.wpa.key + 16, pu8RxMic,
+       if (rx_mic)
+               memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic,
                       RX_MIC_KEY_LEN);
 
-       if (pu8TxMic)
-               memcpy(msg.body.key_info.attr.wpa.key + 24, pu8TxMic,
+       if (tx_mic)
+               memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic,
                       TX_MIC_KEY_LEN);
 
-       msg.body.key_info.attr.wpa.index = u8KeyIdx;
-       msg.body.key_info.attr.wpa.key_len = u8KeyLen;
-       msg.body.key_info.attr.wpa.seq_len = u32KeyRSClen;
+       msg.body.key_info.attr.wpa.index = index;
+       msg.body.key_info.attr.wpa.key_len = key_len;
+       msg.body.key_info.attr.wpa.seq_len = key_rsc_len;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
        if (result)
@@ -3334,7 +3344,7 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk,
        return result;
 }
 
-s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
+s32 wilc_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_attr *pu8PmkidInfoArray)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3366,37 +3376,7 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at
        return result;
 }
 
-s32 host_int_get_pmkid_info(struct host_if_drv *hif_drv,
-                           u8 *pu8PmkidInfoArray,
-                           u32 u32PmkidInfoLen)
-{
-       struct wid wid;
-
-       wid.id = (u16)WID_PMKID_INFO;
-       wid.type = WID_STR;
-       wid.size = u32PmkidInfoLen;
-       wid.val = pu8PmkidInfoArray;
-
-       return 0;
-}
-
-s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
-                                        u8 *pu8PassPhrase,
-                                        u8 u8Psklength)
-{
-       struct wid wid;
-
-       if ((u8Psklength > 7) && (u8Psklength < 65)) {
-               wid.id = (u16)WID_11I_PSK;
-               wid.type = WID_STR;
-               wid.val = pu8PassPhrase;
-               wid.size = u8Psklength;
-       }
-
-       return 0;
-}
-
-s32 hif_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 wilc_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3417,7 +3397,7 @@ s32 hif_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
        return result;
 }
 
-s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 wilc_set_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3436,44 +3416,7 @@ s32 host_int_set_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
        return result;
 }
 
-s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hif_drv,
-                                        u8 *pu8PassPhrase, u8 u8Psklength)
-{
-       struct wid wid;
-
-       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 wid;
-
-       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 wid;
-
-       wid.id = (u16)WID_START_SCAN_REQ;
-       wid.type = WID_CHAR;
-       wid.val = (s8 *)pu8ScanSource;
-       wid.size = sizeof(char);
-
-       return 0;
-}
-
-s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
+s32 wilc_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
                          const u8 *pu8ssid, size_t ssidLen,
                          const u8 *pu8IEs, size_t IEsLen,
                          wilc_connect_result pfConnectResult, void *pvUserArg,
@@ -3540,7 +3483,7 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid,
        return result;
 }
 
-s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
+s32 wilc_flush_join_req(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3565,7 +3508,7 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv)
        return result;
 }
 
-s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
+s32 wilc_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3589,36 +3532,10 @@ s32 host_int_disconnect(struct host_if_drv *hif_drv, u16 u16ReasonCode)
        return result;
 }
 
-s32 host_int_disconnect_station(struct host_if_drv *hif_drv, u8 assoc_id)
-{
-       struct wid wid;
-
-       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)
-{
-       struct wid wid;
-
-       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)
+static s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
+                                      u8 *pu8AssocRespInfo,
+                                      u32 u32MaxAssocRespInfoLen,
+                                      u32 *pu32RcvdAssocRespInfoLen)
 {
        s32 result = 0;
        struct wid wid;
@@ -3633,7 +3550,7 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
        wid.val = pu8AssocRespInfo;
        wid.size = u32MaxAssocRespInfoLen;
 
-       result = send_config_pkt(GET_CFG, &wid, 1,
+       result = wilc_send_config_pkt(GET_CFG, &wid, 1,
                                 get_id_from_handler(hif_drv));
        if (result) {
                *pu32RcvdAssocRespInfoLen = 0;
@@ -3646,21 +3563,7 @@ s32 host_int_get_assoc_res_info(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_get_rx_power_level(struct host_if_drv *hif_drv,
-                               u8 *pu8RxPowerLevel,
-                               u32 u32RxPowerLevelLen)
-{
-       struct wid wid;
-
-       wid.id = (u16)WID_RX_POWER_LEVEL;
-       wid.type = WID_STR;
-       wid.val = pu8RxPowerLevel;
-       wid.size = u32RxPowerLevelLen;
-
-       return 0;
-}
-
-int host_int_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
+int wilc_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
 {
        int result;
        struct host_if_msg msg;
@@ -3684,7 +3587,7 @@ int host_int_set_mac_chnl_num(struct host_if_drv *hif_drv, u8 channel)
        return 0;
 }
 
-int host_int_wait_msg_queue_idle(void)
+int wilc_wait_msg_queue_idle(void)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3702,7 +3605,7 @@ int host_int_wait_msg_queue_idle(void)
        return result;
 }
 
-int host_int_set_wfi_drv_handler(struct host_if_drv *hif_drv)
+int wilc_set_wfi_drv_handler(struct host_if_drv *hif_drv)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3721,7 +3624,7 @@ int host_int_set_wfi_drv_handler(struct host_if_drv *hif_drv)
        return result;
 }
 
-int host_int_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
+int wilc_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -3740,32 +3643,7 @@ int host_int_set_operation_mode(struct host_if_drv *hif_drv, u32 mode)
        return result;
 }
 
-s32 host_int_get_host_chnl_num(struct host_if_drv *hif_drv, u8 *pu8ChNo)
-{
-       s32 result = 0;
-       struct host_if_msg msg;
-
-       if (!hif_drv) {
-               PRINT_ER("driver is null\n");
-               return -EFAULT;
-       }
-
-       memset(&msg, 0, sizeof(struct host_if_msg));
-
-       msg.id = HOST_IF_MSG_GET_CHNL;
-       msg.drv = hif_drv;
-
-       result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
-       if (result)
-               PRINT_ER("wilc mq send fail\n");
-       down(&hif_drv->sem_get_chnl);
-
-       *pu8ChNo = ch_no;
-
-       return result;
-}
-
-s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
+s32 wilc_get_inactive_time(struct host_if_drv *hif_drv,
                               const u8 *mac, u32 *pu32InactiveTime)
 {
        s32 result = 0;
@@ -3793,35 +3671,7 @@ s32 host_int_get_inactive_time(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_test_get_int_wid(struct host_if_drv *hif_drv, u32 *pu32TestMemAddr)
-{
-       s32 result = 0;
-       struct wid wid;
-
-       if (!hif_drv) {
-               PRINT_ER("driver is null\n");
-               return -EFAULT;
-       }
-
-       wid.id = (u16)WID_MEMORY_ADDRESS;
-       wid.type = WID_INT;
-       wid.val = (s8 *)pu32TestMemAddr;
-       wid.size = sizeof(u32);
-
-       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;
-}
-
-s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
+s32 wilc_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3848,34 +3698,7 @@ s32 host_int_get_rssi(struct host_if_drv *hif_drv, s8 *ps8Rssi)
        return result;
 }
 
-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));
-       msg.id = HOST_IF_MSG_GET_LINKSPEED;
-       msg.drv = hif_drv;
-
-       result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
-       if (result) {
-               PRINT_ER("Failed to send GET_LINKSPEED to message queue ");
-               return -EFAULT;
-       }
-
-       down(&hif_drv->sem_get_link_speed);
-
-       if (!ps8lnkspd) {
-               PRINT_ER("LINKSPEED pointer value is null");
-               return -EFAULT;
-       }
-
-       *ps8lnkspd = link_speed;
-
-       return result;
-}
-
-s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
+s32 wilc_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrStatistics)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -3895,7 +3718,7 @@ s32 host_int_get_statistics(struct host_if_drv *hif_drv, struct rf_info *pstrSta
        return result;
 }
 
-s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
+s32 wilc_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
                  u8 u8ScanType, u8 *pu8ChnlFreqList,
                  u8 u8ChnlListLen, const u8 *pu8IEs,
                  size_t IEsLen, wilc_scan_result ScanResult,
@@ -3948,7 +3771,7 @@ s32 host_int_scan(struct host_if_drv *hif_drv, u8 u8ScanSource,
        return result;
 }
 
-s32 hif_set_cfg(struct host_if_drv *hif_drv,
+s32 wilc_hif_set_cfg(struct host_if_drv *hif_drv,
                struct cfg_param_val *pstrCfgParamVal)
 {
        s32 result = 0;
@@ -3969,99 +3792,6 @@ s32 hif_set_cfg(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 hif_get_cfg(struct host_if_drv *hif_drv, u16 u16WID, u16 *pu16WID_Value)
-{
-       s32 result = 0;
-
-       down(&hif_drv->sem_cfg_values);
-
-       if (!hif_drv) {
-               PRINT_ER("hif_drv NULL\n");
-               return -EFAULT;
-       }
-       PRINT_D(HOSTINF_DBG, "Getting configuration parameters\n");
-       switch (u16WID) {
-       case WID_BSS_TYPE:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.bss_type;
-               break;
-
-       case WID_AUTH_TYPE:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.auth_type;
-               break;
-
-       case WID_AUTH_TIMEOUT:
-               *pu16WID_Value = hif_drv->cfg_values.auth_timeout;
-               break;
-
-       case WID_POWER_MANAGEMENT:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.power_mgmt_mode;
-               break;
-
-       case WID_SHORT_RETRY_LIMIT:
-               *pu16WID_Value = hif_drv->cfg_values.short_retry_limit;
-               break;
-
-       case WID_LONG_RETRY_LIMIT:
-               *pu16WID_Value = hif_drv->cfg_values.long_retry_limit;
-               break;
-
-       case WID_FRAG_THRESHOLD:
-               *pu16WID_Value = hif_drv->cfg_values.frag_threshold;
-               break;
-
-       case WID_RTS_THRESHOLD:
-               *pu16WID_Value = hif_drv->cfg_values.rts_threshold;
-               break;
-
-       case WID_PREAMBLE:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.preamble_type;
-               break;
-
-       case WID_SHORT_SLOT_ALLOWED:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.short_slot_allowed;
-               break;
-
-       case WID_11N_TXOP_PROT_DISABLE:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.txop_prot_disabled;
-               break;
-
-       case WID_BEACON_INTERVAL:
-               *pu16WID_Value = hif_drv->cfg_values.beacon_interval;
-               break;
-
-       case WID_DTIM_PERIOD:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.dtim_period;
-               break;
-
-       case WID_SITE_SURVEY:
-               *pu16WID_Value = (u16)hif_drv->cfg_values.site_survey_enabled;
-               break;
-
-       case WID_SITE_SURVEY_SCAN_TIME:
-               *pu16WID_Value = hif_drv->cfg_values.site_survey_scan_time;
-               break;
-
-       case WID_ACTIVE_SCAN_TIME:
-               *pu16WID_Value = hif_drv->cfg_values.active_scan_time;
-               break;
-
-       case WID_PASSIVE_SCAN_TIME:
-               *pu16WID_Value = hif_drv->cfg_values.passive_scan_time;
-               break;
-
-       case WID_CURRENT_TX_RATE:
-               *pu16WID_Value = hif_drv->cfg_values.curr_tx_rate;
-               break;
-
-       default:
-               break;
-       }
-
-       up(&hif_drv->sem_cfg_values);
-
-       return result;
-}
-
 static void GetPeriodicRSSI(unsigned long arg)
 {
        struct host_if_drv *hif_drv = (struct host_if_drv *)arg;
@@ -4090,7 +3820,7 @@ static void GetPeriodicRSSI(unsigned long arg)
        mod_timer(&periodic_rssi, jiffies + msecs_to_jiffies(5000));
 }
 
-s32 host_int_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
+s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 {
        s32 result = 0;
        struct host_if_drv *hif_drv;
@@ -4119,7 +3849,7 @@ s32 host_int_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
                goto _fail_timer_2;
        }
 
-       g_obtainingIP = false;
+       wilc_optaining_ip = false;
 
        PRINT_D(HOSTINF_DBG, "Global handle pointer value=%p\n", hif_drv);
        if (clients_count == 0) {
@@ -4198,7 +3928,7 @@ _fail_:
        return result;
 }
 
-s32 host_int_deinit(struct host_if_drv *hif_drv)
+s32 wilc_deinit(struct host_if_drv *hif_drv)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4225,7 +3955,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
 
        del_timer_sync(&hif_drv->remain_on_ch_timer);
 
-       host_int_set_wfi_drv_handler(NULL);
+       wilc_set_wfi_drv_handler(NULL);
        down(&hif_sema_driver);
 
        if (hif_drv->usr_scan_req.scan_result) {
@@ -4270,7 +4000,7 @@ s32 host_int_deinit(struct host_if_drv *hif_drv)
        return result;
 }
 
-void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
+void wilc_network_info_received(u8 *pu8Buffer, u32 u32Length)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4299,7 +4029,7 @@ void NetworkInfoReceived(u8 *pu8Buffer, u32 u32Length)
                PRINT_ER("Error in sending network info message queue message parameters: Error(%d)\n", result);
 }
 
-void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
+void wilc_gnrl_async_info_received(u8 *pu8Buffer, u32 u32Length)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4340,7 +4070,7 @@ void GnrlAsyncInfoReceived(u8 *pu8Buffer, u32 u32Length)
        up(&hif_sema_deinit);
 }
 
-void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
+void wilc_scan_complete_received(u8 *pu8Buffer, u32 u32Length)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4369,7 +4099,7 @@ void host_int_ScanCompleteReceived(u8 *pu8Buffer, u32 u32Length)
        return;
 }
 
-s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
+s32 wilc_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
                               u32 u32duration, u16 chan,
                               wilc_remain_on_chan_expired RemainOnChanExpired,
                               wilc_remain_on_chan_ready RemainOnChanReady,
@@ -4401,7 +4131,7 @@ s32 host_int_remain_on_channel(struct host_if_drv *hif_drv, u32 u32SessionID,
        return result;
 }
 
-s32 host_int_ListenStateExpired(struct host_if_drv *hif_drv, u32 u32SessionID)
+s32 wilc_listen_state_expired(struct host_if_drv *hif_drv, u32 u32SessionID)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4425,7 +4155,7 @@ s32 host_int_ListenStateExpired(struct host_if_drv *hif_drv, u32 u32SessionID)
        return result;
 }
 
-s32 host_int_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool bReg)
+s32 wilc_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool bReg)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -4464,7 +4194,7 @@ s32 host_int_frame_register(struct host_if_drv *hif_drv, u16 u16FrameType, bool
        return result;
 }
 
-s32 host_int_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
+s32 wilc_add_beacon(struct host_if_drv *hif_drv, u32 u32Interval,
                        u32 u32DTIMPeriod, u32 u32HeadLen, u8 *pu8Head,
                        u32 u32TailLen, u8 *pu8Tail)
 {
@@ -4518,7 +4248,7 @@ ERRORHANDLER:
        return result;
 }
 
-int host_int_del_beacon(struct host_if_drv *hif_drv)
+int wilc_del_beacon(struct host_if_drv *hif_drv)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -4539,8 +4269,8 @@ int host_int_del_beacon(struct host_if_drv *hif_drv)
        return result;
 }
 
-int host_int_add_station(struct host_if_drv *hif_drv,
-                        struct add_sta_param *sta_param)
+int wilc_add_station(struct host_if_drv *hif_drv,
+                    struct add_sta_param *sta_param)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -4573,7 +4303,7 @@ int host_int_add_station(struct host_if_drv *hif_drv,
        return result;
 }
 
-int host_int_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr)
+int wilc_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr)
 {
        int result = 0;
        struct host_if_msg msg;
@@ -4602,7 +4332,7 @@ int host_int_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr)
        return result;
 }
 
-s32 host_int_del_allstation(struct host_if_drv *hif_drv,
+s32 wilc_del_allstation(struct host_if_drv *hif_drv,
                            u8 pu8MacAddr[][ETH_ALEN])
 {
        s32 result = 0;
@@ -4653,7 +4383,7 @@ s32 host_int_del_allstation(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_edit_station(struct host_if_drv *hif_drv,
+s32 wilc_edit_station(struct host_if_drv *hif_drv,
                          struct add_sta_param *pstrStaParams)
 {
        s32 result = 0;
@@ -4691,7 +4421,7 @@ s32 host_int_edit_station(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
+s32 wilc_set_power_mgmt(struct host_if_drv *hif_drv,
                            bool bIsEnabled,
                            u32 u32Timeout)
 {
@@ -4722,7 +4452,7 @@ s32 host_int_set_power_mgmt(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_setup_multicast_filter(struct host_if_drv *hif_drv,
+s32 wilc_setup_multicast_filter(struct host_if_drv *hif_drv,
                                    bool bIsEnabled,
                                    u32 u32count)
 {
@@ -4908,7 +4638,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
        return (void *)pNewJoinBssParam;
 }
 
-void host_int_freeJoinParams(void *pJoinParams)
+void wilc_free_join_params(void *pJoinParams)
 {
        if ((struct bss_param *)pJoinParams)
                kfree((struct bss_param *)pJoinParams);
@@ -4916,35 +4646,7 @@ void host_int_freeJoinParams(void *pJoinParams)
                PRINT_ER("Unable to FREE null pointer\n");
 }
 
-s32 host_int_delBASession(struct host_if_drv *hif_drv, char *pBSSID, char TID)
-{
-       s32 result = 0;
-       struct host_if_msg msg;
-       struct ba_session_info *pBASessionInfo = &msg.body.session_info;
-
-       if (!hif_drv) {
-               PRINT_ER("driver is null\n");
-               return -EFAULT;
-       }
-
-       memset(&msg, 0, sizeof(struct host_if_msg));
-
-       msg.id = HOST_IF_MSG_DEL_BA_SESSION;
-
-       memcpy(pBASessionInfo->bssid, pBSSID, ETH_ALEN);
-       pBASessionInfo->tid = TID;
-       msg.drv = hif_drv;
-
-       result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
-       if (result)
-               PRINT_ER("wilc_mq_send fail\n");
-
-       down(&hif_sema_wait_response);
-
-       return result;
-}
-
-s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
+s32 wilc_del_all_rx_ba_session(struct host_if_drv *hif_drv,
                                  char *pBSSID,
                                  char TID)
 {
@@ -4974,7 +4676,7 @@ s32 host_int_del_All_Rx_BASession(struct host_if_drv *hif_drv,
        return result;
 }
 
-s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
+s32 wilc_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
 {
        s32 result = 0;
        struct host_if_msg msg;
@@ -5001,7 +4703,7 @@ s32 host_int_setup_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
        return result;
 }
 
-s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
+static s32 host_int_get_ipaddress(struct host_if_drv *hif_drv, u8 *u16ipadd, u8 idx)
 {
        s32 result = 0;
        struct host_if_msg msg;