aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gnedt <david.gnedt@davizone.at>2014-01-07 07:06:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-09 10:53:39 -0500
commit9281691fb2e48f0853bb986a9049e5d9c8bf1578 (patch)
tree0a7f3dde0d3904555f51e2c0353aa948de8deed5
parent204cc5c44fb695ece1eab15dd6fb92340028106d (diff)
wl1251: split RX and TX data path initialisation
Split up data path initialisation into RX and TX data path initialisation functions. This change is required for channel switching in monitor mode. Signed-off-by: David Gnedt <david.gnedt@davizone.at> Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ti/wl1251/cmd.c46
-rw-r--r--drivers/net/wireless/ti/wl1251/cmd.h3
-rw-r--r--drivers/net/wireless/ti/wl1251/init.c9
3 files changed, 41 insertions, 17 deletions
diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
index 40f8d3e52a35..223649bcaa5a 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -204,11 +204,11 @@ out:
204 return ret; 204 return ret;
205} 205}
206 206
207int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable) 207int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable)
208{ 208{
209 struct cmd_enabledisable_path *cmd; 209 struct cmd_enabledisable_path *cmd;
210 int ret; 210 int ret;
211 u16 cmd_rx, cmd_tx; 211 u16 cmd_rx;
212 212
213 wl1251_debug(DEBUG_CMD, "cmd data path"); 213 wl1251_debug(DEBUG_CMD, "cmd data path");
214 214
@@ -220,13 +220,10 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
220 220
221 cmd->channel = channel; 221 cmd->channel = channel;
222 222
223 if (enable) { 223 if (enable)
224 cmd_rx = CMD_ENABLE_RX; 224 cmd_rx = CMD_ENABLE_RX;
225 cmd_tx = CMD_ENABLE_TX; 225 else
226 } else {
227 cmd_rx = CMD_DISABLE_RX; 226 cmd_rx = CMD_DISABLE_RX;
228 cmd_tx = CMD_DISABLE_TX;
229 }
230 227
231 ret = wl1251_cmd_send(wl, cmd_rx, cmd, sizeof(*cmd)); 228 ret = wl1251_cmd_send(wl, cmd_rx, cmd, sizeof(*cmd));
232 if (ret < 0) { 229 if (ret < 0) {
@@ -238,17 +235,38 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
238 wl1251_debug(DEBUG_BOOT, "rx %s cmd channel %d", 235 wl1251_debug(DEBUG_BOOT, "rx %s cmd channel %d",
239 enable ? "start" : "stop", channel); 236 enable ? "start" : "stop", channel);
240 237
238out:
239 kfree(cmd);
240 return ret;
241}
242
243int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable)
244{
245 struct cmd_enabledisable_path *cmd;
246 int ret;
247 u16 cmd_tx;
248
249 wl1251_debug(DEBUG_CMD, "cmd data path");
250
251 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
252 if (!cmd)
253 return -ENOMEM;
254
255 cmd->channel = channel;
256
257 if (enable)
258 cmd_tx = CMD_ENABLE_TX;
259 else
260 cmd_tx = CMD_DISABLE_TX;
261
241 ret = wl1251_cmd_send(wl, cmd_tx, cmd, sizeof(*cmd)); 262 ret = wl1251_cmd_send(wl, cmd_tx, cmd, sizeof(*cmd));
242 if (ret < 0) { 263 if (ret < 0)
243 wl1251_error("tx %s cmd for channel %d failed", 264 wl1251_error("tx %s cmd for channel %d failed",
244 enable ? "start" : "stop", channel); 265 enable ? "start" : "stop", channel);
245 goto out; 266 else
246 } 267 wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
247 268 enable ? "start" : "stop", channel);
248 wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
249 enable ? "start" : "stop", channel);
250 269
251out:
252 kfree(cmd); 270 kfree(cmd);
253 return ret; 271 return ret;
254} 272}
diff --git a/drivers/net/wireless/ti/wl1251/cmd.h b/drivers/net/wireless/ti/wl1251/cmd.h
index 126f273f0b66..d824ff978311 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.h
+++ b/drivers/net/wireless/ti/wl1251/cmd.h
@@ -35,7 +35,8 @@ int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len);
35int wl1251_cmd_configure(struct wl1251 *wl, u16 id, void *buf, size_t len); 35int wl1251_cmd_configure(struct wl1251 *wl, u16 id, void *buf, size_t len);
36int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity, 36int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity,
37 void *bitmap, u16 bitmap_len, u8 bitmap_control); 37 void *bitmap, u16 bitmap_len, u8 bitmap_control);
38int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable); 38int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable);
39int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable);
39int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel, 40int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel,
40 u16 beacon_interval, u8 dtim_interval); 41 u16 beacon_interval, u8 dtim_interval);
41int wl1251_cmd_ps_mode(struct wl1251 *wl, u8 ps_mode); 42int wl1251_cmd_ps_mode(struct wl1251 *wl, u8 ps_mode);
diff --git a/drivers/net/wireless/ti/wl1251/init.c b/drivers/net/wireless/ti/wl1251/init.c
index 89b43d35473c..1641e4c8fa52 100644
--- a/drivers/net/wireless/ti/wl1251/init.c
+++ b/drivers/net/wireless/ti/wl1251/init.c
@@ -394,8 +394,13 @@ int wl1251_hw_init(struct wl1251 *wl)
394 if (ret < 0) 394 if (ret < 0)
395 goto out_free_data_path; 395 goto out_free_data_path;
396 396
397 /* Enable data path */ 397 /* Enable rx data path */
398 ret = wl1251_cmd_data_path(wl, wl->channel, 1); 398 ret = wl1251_cmd_data_path_rx(wl, wl->channel, 1);
399 if (ret < 0)
400 goto out_free_data_path;
401
402 /* Enable tx data path */
403 ret = wl1251_cmd_data_path_tx(wl, wl->channel, 1);
399 if (ret < 0) 404 if (ret < 0)
400 goto out_free_data_path; 405 goto out_free_data_path;
401 406