diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2013-03-13 08:12:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-13 14:23:04 -0400 |
commit | d81079f170a70944d6c55f25e71e1bab269b6ef8 (patch) | |
tree | cc5821e75d4e2f0ef10155647967ecc8a6412731 /drivers/net/wireless/ath/wil6210 | |
parent | 03866e7d3f37eb5c3d96f2041bb823f9742db4ae (diff) |
wil6210: refactor connect_worker
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>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 23 |
3 files changed, 23 insertions, 25 deletions
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 761c389586d4..11b696072185 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -118,6 +118,26 @@ static void wil_cache_mbox_regs(struct wil6210_priv *wil) | |||
118 | wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx); | 118 | wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx); |
119 | } | 119 | } |
120 | 120 | ||
121 | static void wil_connect_worker(struct work_struct *work) | ||
122 | { | ||
123 | int rc; | ||
124 | struct wil6210_priv *wil = container_of(work, struct wil6210_priv, | ||
125 | connect_worker); | ||
126 | int cid = wil->pending_connect_cid; | ||
127 | |||
128 | if (cid < 0) { | ||
129 | wil_err(wil, "No connection pending\n"); | ||
130 | return; | ||
131 | } | ||
132 | |||
133 | wil_dbg_wmi(wil, "Configure for connection CID %d\n", cid); | ||
134 | |||
135 | rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE, cid, 0); | ||
136 | wil->pending_connect_cid = -1; | ||
137 | if (rc == 0) | ||
138 | wil_link_on(wil); | ||
139 | } | ||
140 | |||
121 | int wil_priv_init(struct wil6210_priv *wil) | 141 | int wil_priv_init(struct wil6210_priv *wil) |
122 | { | 142 | { |
123 | wil_dbg_misc(wil, "%s()\n", __func__); | 143 | wil_dbg_misc(wil, "%s()\n", __func__); |
@@ -130,7 +150,7 @@ int wil_priv_init(struct wil6210_priv *wil) | |||
130 | wil->pending_connect_cid = -1; | 150 | wil->pending_connect_cid = -1; |
131 | setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil); | 151 | setup_timer(&wil->connect_timer, wil_connect_timer_fn, (ulong)wil); |
132 | 152 | ||
133 | INIT_WORK(&wil->wmi_connect_worker, wmi_connect_worker); | 153 | INIT_WORK(&wil->connect_worker, wil_connect_worker); |
134 | INIT_WORK(&wil->disconnect_worker, wil_disconnect_worker); | 154 | INIT_WORK(&wil->disconnect_worker, wil_disconnect_worker); |
135 | INIT_WORK(&wil->wmi_event_worker, wmi_event_worker); | 155 | INIT_WORK(&wil->wmi_event_worker, wmi_event_worker); |
136 | 156 | ||
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index bdab0e253b2f..5f500de957fe 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -225,7 +225,7 @@ struct wil6210_priv { | |||
225 | struct workqueue_struct *wmi_wq; /* for deferred calls */ | 225 | struct workqueue_struct *wmi_wq; /* for deferred calls */ |
226 | struct work_struct wmi_event_worker; | 226 | struct work_struct wmi_event_worker; |
227 | struct workqueue_struct *wmi_wq_conn; /* for connect worker */ | 227 | struct workqueue_struct *wmi_wq_conn; /* for connect worker */ |
228 | struct work_struct wmi_connect_worker; | 228 | struct work_struct connect_worker; |
229 | struct work_struct disconnect_worker; | 229 | struct work_struct disconnect_worker; |
230 | struct timer_list connect_timer; | 230 | struct timer_list connect_timer; |
231 | int pending_connect_cid; | 231 | int pending_connect_cid; |
@@ -311,7 +311,6 @@ int wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len); | |||
311 | void wmi_recv_cmd(struct wil6210_priv *wil); | 311 | void wmi_recv_cmd(struct wil6210_priv *wil); |
312 | int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len, | 312 | int wmi_call(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len, |
313 | u16 reply_id, void *reply, u8 reply_size, int to_msec); | 313 | u16 reply_id, void *reply, u8 reply_size, int to_msec); |
314 | void wmi_connect_worker(struct work_struct *work); | ||
315 | void wmi_event_worker(struct work_struct *work); | 314 | void wmi_event_worker(struct work_struct *work); |
316 | void wmi_event_flush(struct wil6210_priv *wil); | 315 | void wmi_event_flush(struct wil6210_priv *wil); |
317 | int wmi_set_ssid(struct wil6210_priv *wil, u8 ssid_len, const void *ssid); | 316 | int wmi_set_ssid(struct wil6210_priv *wil, u8 ssid_len, const void *ssid); |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index aa642dfd3024..dd3b7b1f0856 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -443,7 +443,7 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len) | |||
443 | memcpy(wil->dst_addr[0], evt->bssid, ETH_ALEN); | 443 | memcpy(wil->dst_addr[0], evt->bssid, ETH_ALEN); |
444 | 444 | ||
445 | wil->pending_connect_cid = evt->cid; | 445 | wil->pending_connect_cid = evt->cid; |
446 | queue_work(wil->wmi_wq_conn, &wil->wmi_connect_worker); | 446 | queue_work(wil->wmi_wq_conn, &wil->connect_worker); |
447 | } | 447 | } |
448 | 448 | ||
449 | static void wmi_evt_disconnect(struct wil6210_priv *wil, int id, | 449 | static void wmi_evt_disconnect(struct wil6210_priv *wil, int id, |
@@ -1031,24 +1031,3 @@ void wmi_event_worker(struct work_struct *work) | |||
1031 | kfree(evt); | 1031 | kfree(evt); |
1032 | } | 1032 | } |
1033 | } | 1033 | } |
1034 | |||
1035 | void wmi_connect_worker(struct work_struct *work) | ||
1036 | { | ||
1037 | int rc; | ||
1038 | struct wil6210_priv *wil = container_of(work, struct wil6210_priv, | ||
1039 | wmi_connect_worker); | ||
1040 | |||
1041 | if (wil->pending_connect_cid < 0) { | ||
1042 | wil_err(wil, "No connection pending\n"); | ||
1043 | return; | ||
1044 | } | ||
1045 | |||
1046 | wil_dbg_wmi(wil, "Configure for connection CID %d\n", | ||
1047 | wil->pending_connect_cid); | ||
1048 | |||
1049 | rc = wil_vring_init_tx(wil, 0, WIL6210_TX_RING_SIZE, | ||
1050 | wil->pending_connect_cid, 0); | ||
1051 | wil->pending_connect_cid = -1; | ||
1052 | if (rc == 0) | ||
1053 | wil_link_on(wil); | ||
1054 | } | ||