]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wilc1000: remove 'disconnect_info' structure
authorAjay Singh <ajay.kathat@microchip.com>
Thu, 17 Jan 2019 13:21:38 +0000 (13:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 09:39:16 +0000 (10:39 +0100)
Remove 'disconnect_info' struct use because its passed values are not
required in cfg_connect_result().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.h
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

index a146b7810b2aea1f5ffb396c6202e4a6f33e2ecf..fa3af2c6bee6ce5a86d8f340b6367445312df4b1 100644 (file)
@@ -427,7 +427,7 @@ static void handle_connect_timeout(struct work_struct *work)
        if (hif_drv->conn_info.conn_result) {
                hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
                                               WILC_MAC_STATUS_DISCONNECTED,
-                                              NULL, hif_drv->conn_info.arg);
+                                              hif_drv->conn_info.arg);
 
        } else {
                netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
@@ -689,7 +689,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
        }
 
        del_timer(&hif_drv->connect_timer);
-       conn_info->conn_result(CONN_DISCONN_EVENT_CONN_RESP, mac_status, NULL,
+       conn_info->conn_result(CONN_DISCONN_EVENT_CONN_RESP, mac_status,
                               hif_drv->conn_info.arg);
 
        if (mac_status == WILC_MAC_STATUS_CONNECTED &&
@@ -717,27 +717,19 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
 
 static inline void host_int_handle_disconnect(struct wilc_vif *vif)
 {
-       struct disconnect_info disconn_info;
        struct host_if_drv *hif_drv = vif->hif_drv;
 
-       memset(&disconn_info, 0, sizeof(struct disconnect_info));
-
        if (hif_drv->usr_scan_req.scan_result) {
                del_timer(&hif_drv->scan_timer);
                handle_scan_done(vif, SCAN_EVENT_ABORTED);
        }
 
-       disconn_info.reason = 0;
-       disconn_info.ie = NULL;
-       disconn_info.ie_len = 0;
-
        if (hif_drv->conn_info.conn_result) {
                vif->obtaining_ip = false;
                wilc_set_power_mgmt(vif, 0, 0);
 
                hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
-                                              0, &disconn_info,
-                                              hif_drv->conn_info.arg);
+                                              0, hif_drv->conn_info.arg);
        } else {
                netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
        }
@@ -786,7 +778,6 @@ int wilc_disconnect(struct wilc_vif *vif)
 {
        struct wid wid;
        struct host_if_drv *hif_drv = vif->hif_drv;
-       struct disconnect_info disconn_info;
        struct user_scan_req *scan_req;
        struct wilc_conn_info *conn_info;
        int result;
@@ -807,11 +798,6 @@ int wilc_disconnect(struct wilc_vif *vif)
                return result;
        }
 
-       memset(&disconn_info, 0, sizeof(struct disconnect_info));
-
-       disconn_info.reason = 0;
-       disconn_info.ie = NULL;
-       disconn_info.ie_len = 0;
        scan_req = &hif_drv->usr_scan_req;
        conn_info = &hif_drv->conn_info;
 
@@ -825,8 +811,8 @@ int wilc_disconnect(struct wilc_vif *vif)
                if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP)
                        del_timer(&hif_drv->connect_timer);
 
-               conn_info->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
-                                      0, &disconn_info, conn_info->arg);
+               conn_info->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, 0,
+                                      conn_info->arg);
        } else {
                netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
        }
index 459a0847f7df9599374345b11f2b3befeec387e6..363db0b9fea8ca19a69f84a07a24e7662964be55 100644 (file)
@@ -35,12 +35,6 @@ enum {
 
 #define WILC_MAX_ASSOC_RESP_FRAME_SIZE   256
 
-struct disconnect_info {
-       u16 reason;
-       u8 *ie;
-       size_t ie_len;
-};
-
 struct assoc_resp {
        __le16 capab_info;
        __le16 status_code;
@@ -143,8 +137,7 @@ struct wilc_conn_info {
        u8 *resp_ies;
        u16 resp_ies_len;
        u16 status;
-       void (*conn_result)(enum conn_event evt, u8 status,
-                           struct disconnect_info *info, void *priv_data);
+       void (*conn_result)(enum conn_event evt, u8 status, void *priv_data);
        void *arg;
        void *param;
 };
index bc1d7a70d14c08046bd8f1c7ec52191fa9996593..79753ad15b7c8bd8bff2e38a6d9efc2ab3a98103 100644 (file)
@@ -140,7 +140,6 @@ static void cfg_scan_result(enum scan_event scan_event,
 }
 
 static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
-                              struct disconnect_info *disconn_info,
                               void *priv_data)
 {
        struct wilc_priv *priv = priv_data;
@@ -177,6 +176,8 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
                                        conn_info->resp_ies_len, connect_status,
                                        GFP_KERNEL);
        } else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
+               u16 reason = 0;
+
                vif->obtaining_ip = false;
                priv->p2p.local_random = 0x01;
                priv->p2p.recv_random = 0x00;
@@ -186,14 +187,13 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
 
                if (!wfi_drv->p2p_connect)
                        wlan_channel = INVALID_CHANNEL;
+
                if (wfi_drv->ifc_up && dev == wl->vif[1]->ndev)
-                       disconn_info->reason = 3;
+                       reason = 3;
                else if (!wfi_drv->ifc_up && dev == wl->vif[1]->ndev)
-                       disconn_info->reason = 1;
+                       reason = 1;
 
-               cfg80211_disconnected(dev, disconn_info->reason,
-                                     disconn_info->ie, disconn_info->ie_len,
-                                     false, GFP_KERNEL);
+               cfg80211_disconnected(dev, reason, NULL, 0, false, GFP_KERNEL);
        }
 }