Commit 03cf31c4 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove 'disconnect_info' structure

Remove 'disconnect_info' struct use because its passed values are not
required in cfg_connect_result().
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 94bb6d33
...@@ -427,7 +427,7 @@ static void handle_connect_timeout(struct work_struct *work) ...@@ -427,7 +427,7 @@ static void handle_connect_timeout(struct work_struct *work)
if (hif_drv->conn_info.conn_result) { if (hif_drv->conn_info.conn_result) {
hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_CONN_RESP, hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
WILC_MAC_STATUS_DISCONNECTED, WILC_MAC_STATUS_DISCONNECTED,
NULL, hif_drv->conn_info.arg); hif_drv->conn_info.arg);
} else { } else {
netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); 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, ...@@ -689,7 +689,7 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif,
} }
del_timer(&hif_drv->connect_timer); 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); hif_drv->conn_info.arg);
if (mac_status == WILC_MAC_STATUS_CONNECTED && if (mac_status == WILC_MAC_STATUS_CONNECTED &&
...@@ -717,27 +717,19 @@ static inline void host_int_parse_assoc_resp_info(struct wilc_vif *vif, ...@@ -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) 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; 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) { if (hif_drv->usr_scan_req.scan_result) {
del_timer(&hif_drv->scan_timer); del_timer(&hif_drv->scan_timer);
handle_scan_done(vif, SCAN_EVENT_ABORTED); 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) { if (hif_drv->conn_info.conn_result) {
vif->obtaining_ip = false; vif->obtaining_ip = false;
wilc_set_power_mgmt(vif, 0, 0); wilc_set_power_mgmt(vif, 0, 0);
hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, hif_drv->conn_info.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
0, &disconn_info, 0, hif_drv->conn_info.arg);
hif_drv->conn_info.arg);
} else { } else {
netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
} }
...@@ -786,7 +778,6 @@ int wilc_disconnect(struct wilc_vif *vif) ...@@ -786,7 +778,6 @@ int wilc_disconnect(struct wilc_vif *vif)
{ {
struct wid wid; struct wid wid;
struct host_if_drv *hif_drv = vif->hif_drv; struct host_if_drv *hif_drv = vif->hif_drv;
struct disconnect_info disconn_info;
struct user_scan_req *scan_req; struct user_scan_req *scan_req;
struct wilc_conn_info *conn_info; struct wilc_conn_info *conn_info;
int result; int result;
...@@ -807,11 +798,6 @@ int wilc_disconnect(struct wilc_vif *vif) ...@@ -807,11 +798,6 @@ int wilc_disconnect(struct wilc_vif *vif)
return result; 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; scan_req = &hif_drv->usr_scan_req;
conn_info = &hif_drv->conn_info; conn_info = &hif_drv->conn_info;
...@@ -825,8 +811,8 @@ int wilc_disconnect(struct wilc_vif *vif) ...@@ -825,8 +811,8 @@ int wilc_disconnect(struct wilc_vif *vif)
if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP)
del_timer(&hif_drv->connect_timer); del_timer(&hif_drv->connect_timer);
conn_info->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, conn_info->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, 0,
0, &disconn_info, conn_info->arg); conn_info->arg);
} else { } else {
netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__); netdev_err(vif->ndev, "%s: conn_result is NULL\n", __func__);
} }
......
...@@ -35,12 +35,6 @@ enum { ...@@ -35,12 +35,6 @@ enum {
#define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256 #define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256
struct disconnect_info {
u16 reason;
u8 *ie;
size_t ie_len;
};
struct assoc_resp { struct assoc_resp {
__le16 capab_info; __le16 capab_info;
__le16 status_code; __le16 status_code;
...@@ -143,8 +137,7 @@ struct wilc_conn_info { ...@@ -143,8 +137,7 @@ struct wilc_conn_info {
u8 *resp_ies; u8 *resp_ies;
u16 resp_ies_len; u16 resp_ies_len;
u16 status; u16 status;
void (*conn_result)(enum conn_event evt, u8 status, void (*conn_result)(enum conn_event evt, u8 status, void *priv_data);
struct disconnect_info *info, void *priv_data);
void *arg; void *arg;
void *param; void *param;
}; };
......
...@@ -140,7 +140,6 @@ static void cfg_scan_result(enum scan_event scan_event, ...@@ -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, static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
struct disconnect_info *disconn_info,
void *priv_data) void *priv_data)
{ {
struct wilc_priv *priv = 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, ...@@ -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, conn_info->resp_ies_len, connect_status,
GFP_KERNEL); GFP_KERNEL);
} else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) { } else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
u16 reason = 0;
vif->obtaining_ip = false; vif->obtaining_ip = false;
priv->p2p.local_random = 0x01; priv->p2p.local_random = 0x01;
priv->p2p.recv_random = 0x00; priv->p2p.recv_random = 0x00;
...@@ -186,14 +187,13 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status, ...@@ -186,14 +187,13 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt, u8 mac_status,
if (!wfi_drv->p2p_connect) if (!wfi_drv->p2p_connect)
wlan_channel = INVALID_CHANNEL; wlan_channel = INVALID_CHANNEL;
if (wfi_drv->ifc_up && dev == wl->vif[1]->ndev) 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) else if (!wfi_drv->ifc_up && dev == wl->vif[1]->ndev)
disconn_info->reason = 1; reason = 1;
cfg80211_disconnected(dev, disconn_info->reason, cfg80211_disconnected(dev, reason, NULL, 0, false, GFP_KERNEL);
disconn_info->ie, disconn_info->ie_len,
false, GFP_KERNEL);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment