wil6210: refactor connect_worker
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Wed, 13 Mar 2013 12:12:43 +0000 (14:12 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 13 Mar 2013 18:23:04 +0000 (14:23 -0400)
Move wmi_connect_worker() to the main.c and change names for consistency.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/wil6210/main.c
drivers/net/wireless/ath/wil6210/wil6210.h
drivers/net/wireless/ath/wil6210/wmi.c

index 761c389586d4cef581b1239d58f3e313e9f9e49a..11b69607218563497bc4254b80a7915cc15ea9a4 100644 (file)
@@ -118,6 +118,26 @@ static void wil_cache_mbox_regs(struct wil6210_priv *wil)
        wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx);
 }
 
+static void wil_connect_worker(struct work_struct *work)
+{
+       int rc;
+       struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
+                                               connect_worker);
+       int cid = wil->pending_connect_cid;
+
+       if (cid < 0) {
+               wil_err(wil, "No connection pending\n");
+               return;
+       }
+
+       wil_dbg_wmi(wil, "Configure for connection CID %d\n", cid);
+
+       rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE, cid, 0);
+       wil->pending_connect_cid = -1;
+       if (rc == 0)
+               wil_link_on(wil);
+}
+
 int wil_priv_init(struct wil6210_priv *wil)
 {
        wil_dbg_misc(wil, "%s()\n", __func__);
@@ -130,7 +150,7 @@ int wil_priv_init(struct wil6210_priv *wil)
        wil->pending_connect_cid = -1;
        setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil);
 
-       INIT_WORK(&wil->wmi_connect_worker, wmi_connect_worker);
+       INIT_WORK(&wil->connect_worker, wil_connect_worker);
        INIT_WORK(&wil->disconnect_worker, wil_disconnect_worker);
        INIT_WORK(&wil->wmi_event_worker, wmi_event_worker);
 
index bdab0e253b2fb1838ad892ed6f25b4f65b8039af..5f500de957fe17df83d8965e68da8d7185b2e50c 100644 (file)
@@ -225,7 +225,7 @@ struct wil6210_priv {
        struct workqueue_struct *wmi_wq; /* for deferred calls */
        struct work_struct wmi_event_worker;
        struct workqueue_struct *wmi_wq_conn; /* for connect worker */
-       struct work_struct wmi_connect_worker;
+       struct work_struct connect_worker;
        struct work_struct disconnect_worker;
        struct timer_list connect_timer;
        int pending_connect_cid;
@@ -311,7 +311,6 @@ int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len);
 void wmi_recv_cmd(struct wil6210_priv *wil);
 int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len,
             u16 reply_id, void *reply, u8 reply_size, int to_msec);
-void wmi_connect_worker(struct work_struct *work);
 void wmi_event_worker(struct work_struct *work);
 void wmi_event_flush(struct wil6210_priv *wil);
 int wmi_set_ssid(struct wil6210_priv *wil, u8 ssid_len, const void *ssid);
index aa642dfd30247910348cf171ceee0130b2d8cb0a..dd3b7b1f0856c915150b059892c288c7b015d939 100644 (file)
@@ -443,7 +443,7 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
        memcpy(wil->dst_addr[0], evt->bssid, ETH_ALEN);
 
        wil->pending_connect_cid = evt->cid;
-       queue_work(wil->wmi_wq_conn, &wil->wmi_connect_worker);
+       queue_work(wil->wmi_wq_conn, &wil->connect_worker);
 }
 
 static void wmi_evt_disconnect(struct wil6210_priv *wil, int id,
@@ -1031,24 +1031,3 @@ void wmi_event_worker(struct work_struct *work)
                kfree(evt);
        }
 }
-
-void wmi_connect_worker(struct work_struct *work)
-{
-       int rc;
-       struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
-                                               wmi_connect_worker);
-
-       if (wil->pending_connect_cid < 0) {
-               wil_err(wil, "No connection pending\n");
-               return;
-       }
-
-       wil_dbg_wmi(wil, "Configure for connection CID %d\n",
-                   wil->pending_connect_cid);
-
-       rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE,
-                              wil->pending_connect_cid, 0);
-       wil->pending_connect_cid = -1;
-       if (rc == 0)
-               wil_link_on(wil);
-}