aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2018-12-02 18:03:22 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-05 09:49:45 +0100
commit05d3bcb0f447a490f63220425fea4f9b23e19122 (patch)
tree06404087a01013b36ec1d203f1d3a73bf4bb04ae /drivers/staging/wilc1000
parentstaging: wilc1000: use correct 'struct remain_ch' variable in scan complete (diff)
downloadlinux-dev-05d3bcb0f447a490f63220425fea4f9b23e19122.tar.xz
linux-dev-05d3bcb0f447a490f63220425fea4f9b23e19122.zip
staging: wilc1000: handle remain on channel cfg ops from cfg80211 context
Refactor wilc_remain_on_channel() to handle remain_on_channel callback from cfg80211 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.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9139e0e59adc..4762925375a3 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1592,14 +1592,6 @@ static void handle_scan_timer(struct work_struct *work)
kfree(msg);
}
-static void handle_remain_on_chan_work(struct work_struct *work)
-{
- struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
-
- handle_remain_on_chan(msg->vif, &msg->body.remain_on_ch);
- kfree(msg);
-}
-
static void handle_scan_complete(struct work_struct *work)
{
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
@@ -2527,25 +2519,19 @@ int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id,
wilc_remain_on_chan_ready ready,
void *user_arg)
{
+ struct remain_ch roc;
int result;
- struct host_if_msg *msg;
-
- msg = wilc_alloc_work(vif, handle_remain_on_chan_work, false);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
- msg->body.remain_on_ch.ch = chan;
- msg->body.remain_on_ch.expired = expired;
- msg->body.remain_on_ch.ready = ready;
- msg->body.remain_on_ch.arg = user_arg;
- msg->body.remain_on_ch.duration = duration;
- msg->body.remain_on_ch.id = session_id;
-
- result = wilc_enqueue_work(msg);
- if (result) {
- netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
- kfree(msg);
- }
+ roc.ch = chan;
+ roc.expired = expired;
+ roc.ready = ready;
+ roc.arg = user_arg;
+ roc.duration = duration;
+ roc.id = session_id;
+ result = handle_remain_on_chan(vif, &roc);
+ if (result)
+ netdev_err(vif->ndev, "%s: failed to set remain on channel\n",
+ __func__);
return result;
}