staging: wilc1000: fix return type of wilc_setup_ipaddress
[deliverable/linux.git] / drivers / staging / wilc1000 / host_interface.c
index 8c7752034032b804e267fb48f4513740e476eb63..dacadc91aca70d46bb43b7191d42738fc772e682 100644 (file)
@@ -3291,13 +3291,13 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
        return result;
 }
 
-s32 wilc_set_pmkid_info(struct wilc_vif *vif,
-                       struct host_if_pmkid_attr *pu8PmkidInfoArray)
+int wilc_set_pmkid_info(struct wilc_vif *vif,
+                       struct host_if_pmkid_attr *pmkid)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
-       u32 i;
+       int i;
 
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
@@ -3311,11 +3311,11 @@ s32 wilc_set_pmkid_info(struct wilc_vif *vif,
        msg.body.key_info.action = ADDKEY;
        msg.vif = vif;
 
-       for (i = 0; i < pu8PmkidInfoArray->numpmkid; i++) {
+       for (i = 0; i < pmkid->numpmkid; i++) {
                memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].bssid,
-                      &pu8PmkidInfoArray->pmkidlist[i].bssid, ETH_ALEN);
+                      &pmkid->pmkidlist[i].bssid, ETH_ALEN);
                memcpy(msg.body.key_info.attr.pmkid.pmkidlist[i].pmkid,
-                      &pu8PmkidInfoArray->pmkidlist[i].pmkid, PMKID_LEN);
+                      &pmkid->pmkidlist[i].pmkid, PMKID_LEN);
        }
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3325,15 +3325,15 @@ s32 wilc_set_pmkid_info(struct wilc_vif *vif,
        return result;
 }
 
-s32 wilc_get_mac_address(struct wilc_vif *vif, u8 *pu8MacAddress)
+int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
 
        memset(&msg, 0, sizeof(struct host_if_msg));
 
        msg.id = HOST_IF_MSG_GET_MAC_ADDRESS;
-       msg.body.get_mac_info.mac_addr = pu8MacAddress;
+       msg.body.get_mac_info.mac_addr = mac_addr;
        msg.vif = vif;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3346,16 +3346,16 @@ s32 wilc_get_mac_address(struct wilc_vif *vif, u8 *pu8MacAddress)
        return result;
 }
 
-s32 wilc_set_mac_address(struct wilc_vif *vif, u8 *pu8MacAddress)
+int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
 
-       PRINT_D(GENERIC_DBG, "mac addr = %x:%x:%x\n", pu8MacAddress[0], pu8MacAddress[1], pu8MacAddress[2]);
+       PRINT_D(GENERIC_DBG, "mac addr = %x:%x:%x\n", mac_addr[0], mac_addr[1], mac_addr[2]);
 
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_SET_MAC_ADDRESS;
-       memcpy(msg.body.set_mac_info.mac_addr, pu8MacAddress, ETH_ALEN);
+       memcpy(msg.body.set_mac_info.mac_addr, mac_addr, ETH_ALEN);
        msg.vif = vif;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -3365,22 +3365,22 @@ s32 wilc_set_mac_address(struct wilc_vif *vif, u8 *pu8MacAddress)
        return result;
 }
 
-s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid,
-                     size_t ssidLen, const u8 *pu8IEs, size_t IEsLen,
-                     wilc_connect_result pfConnectResult, void *pvUserArg,
-                     u8 u8security, enum AUTHTYPE tenuAuth_type,
-                     u8 u8channel, void *pJoinParams)
+int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid,
+                     size_t ssid_len, const u8 *ies, size_t ies_len,
+                     wilc_connect_result connect_result, void *user_arg,
+                     u8 security, enum AUTHTYPE auth_type,
+                     u8 channel, void *join_params)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
-       if (!hif_drv || !pfConnectResult) {
+       if (!hif_drv || !connect_result) {
                PRINT_ER("Driver is null\n");
                return -EFAULT;
        }
 
-       if (!pJoinParams) {
+       if (!join_params) {
                PRINT_ER("Unable to Join - JoinParams is NULL\n");
                return -EFAULT;
        }
@@ -3389,29 +3389,32 @@ s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid,
 
        msg.id = HOST_IF_MSG_CONNECT;
 
-       msg.body.con_info.security = u8security;
-       msg.body.con_info.auth_type = tenuAuth_type;
-       msg.body.con_info.ch = u8channel;
-       msg.body.con_info.result = pfConnectResult;
-       msg.body.con_info.arg = pvUserArg;
-       msg.body.con_info.params = pJoinParams;
+       msg.body.con_info.security = security;
+       msg.body.con_info.auth_type = auth_type;
+       msg.body.con_info.ch = channel;
+       msg.body.con_info.result = connect_result;
+       msg.body.con_info.arg = user_arg;
+       msg.body.con_info.params = join_params;
        msg.vif = vif;
 
-       if (pu8bssid) {
-               msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL);
-               memcpy(msg.body.con_info.bssid, pu8bssid, 6);
+       if (bssid) {
+               msg.body.con_info.bssid = kmemdup(bssid, 6, GFP_KERNEL);
+               if (!msg.body.con_info.bssid)
+                       return -ENOMEM;
        }
 
-       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 (ssid) {
+               msg.body.con_info.ssid_len = ssid_len;
+               msg.body.con_info.ssid = kmemdup(ssid, ssid_len, GFP_KERNEL);
+               if (!msg.body.con_info.ssid)
+                       return -ENOMEM;
        }
 
-       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);
+       if (ies) {
+               msg.body.con_info.ies_len = ies_len;
+               msg.body.con_info.ies = kmemdup(ies, ies_len, GFP_KERNEL);
+               if (!msg.body.con_info.ies)
+                       return -ENOMEM;
        }
        if (hif_drv->hif_state < HOST_IF_CONNECTING)
                hif_drv->hif_state = HOST_IF_CONNECTING;
@@ -3432,9 +3435,9 @@ s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid,
        return result;
 }
 
-s32 wilc_flush_join_req(struct wilc_vif *vif)
+int wilc_flush_join_req(struct wilc_vif *vif)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -3458,9 +3461,9 @@ s32 wilc_flush_join_req(struct wilc_vif *vif)
        return result;
 }
 
-s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode)
+int wilc_disconnect(struct wilc_vif *vif, u16 reason_code)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -3625,9 +3628,9 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac,
        return result;
 }
 
-s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi)
+int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -3643,24 +3646,24 @@ s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi)
 
        down(&hif_drv->sem_get_rssi);
 
-       if (!ps8Rssi) {
+       if (!rssi_level) {
                PRINT_ER("RSS pointer value is null");
                return -EFAULT;
        }
 
-       *ps8Rssi = rssi;
+       *rssi_level = rssi;
 
        return result;
 }
 
-s32 wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics)
+int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
 
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_GET_STATISTICS;
-       msg.body.data = (char *)pstrStatistics;
+       msg.body.data = (char *)stats;
        msg.vif = vif;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -4095,9 +4098,9 @@ s32 wilc_remain_on_channel(struct wilc_vif *vif, u32 u32SessionID,
        return result;
 }
 
-s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -4111,7 +4114,7 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
        memset(&msg, 0, sizeof(struct host_if_msg));
        msg.id = HOST_IF_MSG_LISTEN_TIMER_FIRED;
        msg.vif = vif;
-       msg.body.remain_on_ch.id = u32SessionID;
+       msg.body.remain_on_ch.id = session_id;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
        if (result)
@@ -4120,9 +4123,9 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID)
        return result;
 }
 
-s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
+int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -4134,7 +4137,7 @@ s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
        memset(&msg, 0, sizeof(struct host_if_msg));
 
        msg.id = HOST_IF_MSG_REGISTER_FRAME;
-       switch (u16FrameType) {
+       switch (frame_type) {
        case ACTION:
                PRINT_D(HOSTINF_DBG, "ACTION\n");
                msg.body.reg_frame.reg_id = ACTION_FRM_IDX;
@@ -4149,8 +4152,8 @@ s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg)
                PRINT_D(HOSTINF_DBG, "Not valid frame type\n");
                break;
        }
-       msg.body.reg_frame.frame_type = u16FrameType;
-       msg.body.reg_frame.reg = bReg;
+       msg.body.reg_frame.frame_type = frame_type;
+       msg.body.reg_frame.reg = reg;
        msg.vif = vif;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
@@ -4390,14 +4393,14 @@ s32 wilc_edit_station(struct wilc_vif *vif,
        return result;
 }
 
-s32 wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
-       struct power_mgmt_param *pstrPowerMgmtParam = &msg.body.pwr_mgmt_info;
+       struct power_mgmt_param *pwr_mgmt_info = &msg.body.pwr_mgmt_info;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
-       PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", bIsEnabled);
+       PRINT_INFO(HOSTINF_DBG, "\n\n>> Setting PS to %d <<\n\n", enabled);
 
        if (!hif_drv) {
                PRINT_ER("driver is null\n");
@@ -4411,8 +4414,8 @@ s32 wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
        msg.id = HOST_IF_MSG_POWER_MGMT;
        msg.vif = vif;
 
-       pstrPowerMgmtParam->enabled = bIsEnabled;
-       pstrPowerMgmtParam->timeout = u32Timeout;
+       pwr_mgmt_info->enabled = enabled;
+       pwr_mgmt_info->timeout = timeout;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
        if (result)
@@ -4420,12 +4423,12 @@ s32 wilc_set_power_mgmt(struct wilc_vif *vif, bool bIsEnabled, u32 u32Timeout)
        return result;
 }
 
-s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
-                               u32 u32count)
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
+                               u32 count)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
-       struct set_multicast *pstrMulticastFilterParam = &msg.body.multicast_info;
+       struct set_multicast *multicast_filter_param = &msg.body.multicast_info;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
        if (!hif_drv) {
@@ -4440,8 +4443,8 @@ s32 wilc_setup_multicast_filter(struct wilc_vif *vif, bool bIsEnabled,
        msg.id = HOST_IF_MSG_SET_MULTICAST_FILTER;
        msg.vif = vif;
 
-       pstrMulticastFilterParam->enabled = bIsEnabled;
-       pstrMulticastFilterParam->cnt = u32count;
+       multicast_filter_param->enabled = enabled;
+       multicast_filter_param->cnt = count;
 
        result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
        if (result)
@@ -4606,14 +4609,6 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo)
        return (void *)pNewJoinBssParam;
 }
 
-void wilc_free_join_params(void *pJoinParams)
-{
-       if ((struct bss_param *)pJoinParams)
-               kfree((struct bss_param *)pJoinParams);
-       else
-               PRINT_ER("Unable to FREE null pointer\n");
-}
-
 s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID)
 {
        s32 result = 0;
@@ -4643,9 +4638,9 @@ s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID)
        return result;
 }
 
-s32 wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
+int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *u16ipadd, u8 idx)
 {
-       s32 result = 0;
+       int result = 0;
        struct host_if_msg msg;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
This page took 0.03061 seconds and 5 git commands to generate.