summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/host_interface.c
diff options
context:
space:
mode:
authorAjay Singh2018-12-02 19:02:54 +0100
committerGreg Kroah-Hartman2018-12-05 09:49:44 +0100
commit77506d42febd8fffbf460ae6e649469a6437e6fd (patch)
tree7b86580299059e6788d278e51bbbb1ae5dcedfd0 /drivers/staging/wilc1000/host_interface.c
parentstaging: wilc1000: handle mgmt_frame_register ops from cfg82011 context (diff)
downloadkernel-qcow2-linux-77506d42febd8fffbf460ae6e649469a6437e6fd.tar.gz
kernel-qcow2-linux-77506d42febd8fffbf460ae6e649469a6437e6fd.tar.xz
kernel-qcow2-linux-77506d42febd8fffbf460ae6e649469a6437e6fd.zip
staging: wilc1000: refactor wilc_set_mac_chnl_num() to avoid deferred handling
Avoid handling of WID_CURRENT_CHANNEL 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/host_interface.c')
-rw-r--r--drivers/staging/wilc1000/host_interface.c46
1 files changed, 9 insertions, 37 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4d1fa4a773ad..f6bd76cff0a6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -74,10 +74,6 @@ struct rcvd_async_info {
u32 len;
};
-struct channel_attr {
- u8 set_ch;
-};
-
struct set_multicast {
bool enabled;
u32 cnt;
@@ -112,7 +108,6 @@ union message_body {
struct rcvd_async_info async_info;
struct key_attr key_info;
struct cfg_param_attr cfg_info;
- struct channel_attr channel_info;
struct sta_inactive_t mac_info;
struct set_ip_addr ip_info;
struct drv_handler drv;
@@ -224,27 +219,6 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx)
return wilc->vif[index];
}
-static void handle_set_channel(struct work_struct *work)
-{
- struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
- struct wilc_vif *vif = msg->vif;
- struct channel_attr *hif_set_ch = &msg->body.channel_info;
- int ret;
- struct wid wid;
-
- wid.id = WID_CURRENT_CHANNEL;
- wid.type = WID_CHAR;
- wid.val = (char *)&hif_set_ch->set_ch;
- wid.size = sizeof(char);
-
- ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
- wilc_get_vif_idx(vif));
-
- if (ret)
- netdev_err(vif->ndev, "Failed to set channel\n");
- kfree(msg);
-}
-
static void handle_set_wfi_drv_handler(struct work_struct *work)
{
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
@@ -2600,20 +2574,18 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code)
int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel)
{
+ struct wid wid;
int result;
- struct host_if_msg *msg;
- msg = wilc_alloc_work(vif, handle_set_channel, false);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- msg->body.channel_info.set_ch = channel;
+ wid.id = WID_CURRENT_CHANNEL;
+ wid.type = WID_CHAR;
+ wid.size = sizeof(char);
+ wid.val = &channel;
- result = wilc_enqueue_work(msg);
- if (result) {
- netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
- kfree(msg);
- }
+ result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
+ wilc_get_vif_idx(vif));
+ if (result)
+ netdev_err(vif->ndev, "Failed to set channel\n");
return result;
}