summaryrefslogtreecommitdiff
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2018-12-02 18:03:17 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-05 09:49:45 +0100
commit153068b9d1ddd9c9e73f331114e8d574f4f8726f (patch)
tree2c2e72a031bfd77c5f38c1c79a188bd5af2e4f2a /drivers/staging/wilc1000
parentb7afe350320bde88f6d0b712205feb71b2437a31 (diff)
staging: wilc1000: refactor wilc_get_mac_address() to avoid deferred handling
Avoid handling of WID_MAC_ADDR wid command in deferred approach. Instead of posting the wid to workqueue now handle directly from the caller context. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.c43
-rw-r--r--drivers/staging/wilc1000/host_interface.h4
2 files changed, 8 insertions, 39 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 71395d8a93b1..dc02561fc640 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -103,7 +103,6 @@ union message_body {
struct rcvd_net_info net_info;
struct rcvd_async_info async_info;
struct set_multicast multicast_info;
- struct get_mac_addr get_mac_info;
struct remain_ch remain_on_ch;
char *data;
};
@@ -208,28 +207,6 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx)
return wilc->vif[index];
}
-static void handle_get_mac_address(struct work_struct *work)
-{
- struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
- struct wilc_vif *vif = msg->vif;
- struct get_mac_addr *get_mac_addr = &msg->body.get_mac_info;
- int ret;
- struct wid wid;
-
- wid.id = WID_MAC_ADDR;
- wid.type = WID_STR;
- wid.val = get_mac_addr->mac_addr;
- wid.size = ETH_ALEN;
-
- ret = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1,
- wilc_get_vif_idx(vif));
-
- if (ret)
- netdev_err(vif->ndev, "Failed to get mac address\n");
- complete(&msg->work_comp);
- /* free 'msg' data later, in caller */
-}
-
static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
{
int result = 0;
@@ -1934,21 +1911,17 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid)
int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr)
{
int result;
- struct host_if_msg *msg;
-
- msg = wilc_alloc_work(vif, handle_get_mac_address, true);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
+ struct wid wid;
- msg->body.get_mac_info.mac_addr = mac_addr;
+ wid.id = WID_MAC_ADDR;
+ wid.type = WID_STR;
+ wid.size = ETH_ALEN;
+ wid.val = mac_addr;
- result = wilc_enqueue_work(msg);
+ result = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1,
+ wilc_get_vif_idx(vif));
if (result)
- netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
- else
- wait_for_completion(&msg->work_comp);
-
- kfree(msg);
+ netdev_err(vif->ndev, "Failed to get mac address\n");
return result;
}
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index d2f29ea80745..953f0ea89111 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -194,10 +194,6 @@ struct user_conn_req {
void *arg;
};
-struct get_mac_addr {
- u8 *mac_addr;
-};
-
struct remain_ch {
u16 ch;
u32 duration;