netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Luciano Coelho <luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	freemangordon-uiMcrn6V0Vs@public.gmane.org,
	aaro.koskinen-X3B1VOXEql0@public.gmane.org,
	pavel-+ZI9xUNit7I@public.gmane.org,
	sre-GFxCN5SEZAc@public.gmane.org,
	joni.lapilainen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	"Johannes Berg"
	<johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>,
	"Felipe Contreras"
	<felipe.contreras-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"David Gnedt"
	<david.gnedt-rFfgOQFw6VLk7+2FdBfRIA@public.gmane.org>,
	"Pali Rohár" <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH v2 05/16] wl1251: split RX and TX data path initialisation
Date: Sun,  8 Dec 2013 10:25:03 +0100	[thread overview]
Message-ID: <1386494714-21070-6-git-send-email-pali.rohar@gmail.com> (raw)
In-Reply-To: <1386494714-21070-1-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

From: David Gnedt <david.gnedt-rFfgOQFw6VLk7+2FdBfRIA@public.gmane.org>

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-rFfgOQFw6VLk7+2FdBfRIA@public.gmane.org>
Signed-off-by: Pali Rohár <pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/net/wireless/ti/wl1251/cmd.c  |   46 +++++++++++++++++++++++----------
 drivers/net/wireless/ti/wl1251/cmd.h  |    3 ++-
 drivers/net/wireless/ti/wl1251/init.c |    9 +++++--
 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 16b6479..381b3fe 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -204,11 +204,11 @@ out:
 	return ret;
 }
 
-int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
+int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable)
 {
 	struct cmd_enabledisable_path *cmd;
 	int ret;
-	u16 cmd_rx, cmd_tx;
+	u16 cmd_rx;
 
 	wl1251_debug(DEBUG_CMD, "cmd data path");
 
@@ -220,13 +220,10 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
 
 	cmd->channel = channel;
 
-	if (enable) {
+	if (enable)
 		cmd_rx = CMD_ENABLE_RX;
-		cmd_tx = CMD_ENABLE_TX;
-	} else {
+	else
 		cmd_rx = CMD_DISABLE_RX;
-		cmd_tx = CMD_DISABLE_TX;
-	}
 
 	ret = wl1251_cmd_send(wl, cmd_rx, cmd, sizeof(*cmd));
 	if (ret < 0) {
@@ -238,17 +235,38 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
 	wl1251_debug(DEBUG_BOOT, "rx %s cmd channel %d",
 		     enable ? "start" : "stop", channel);
 
+out:
+	kfree(cmd);
+	return ret;
+}
+
+int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable)
+{
+	struct cmd_enabledisable_path *cmd;
+	int ret;
+	u16 cmd_tx;
+
+	wl1251_debug(DEBUG_CMD, "cmd data path");
+
+	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+	if (!cmd)
+		return -ENOMEM;
+
+	cmd->channel = channel;
+
+	if (enable)
+		cmd_tx = CMD_ENABLE_TX;
+	else
+		cmd_tx = CMD_DISABLE_TX;
+
 	ret = wl1251_cmd_send(wl, cmd_tx, cmd, sizeof(*cmd));
-	if (ret < 0) {
+	if (ret < 0)
 		wl1251_error("tx %s cmd for channel %d failed",
 			     enable ? "start" : "stop", channel);
-		goto out;
-	}
-
-	wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
-		     enable ? "start" : "stop", channel);
+	else
+		wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
+			     enable ? "start" : "stop", channel);
 
-out:
 	kfree(cmd);
 	return ret;
 }
diff --git a/drivers/net/wireless/ti/wl1251/cmd.h b/drivers/net/wireless/ti/wl1251/cmd.h
index 126f273..d824ff9 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);
 int wl1251_cmd_configure(struct wl1251 *wl, u16 id, void *buf, size_t len);
 int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity,
 		   void *bitmap, u16 bitmap_len, u8 bitmap_control);
-int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable);
+int wl1251_cmd_data_path_rx(struct wl1251 *wl, u8 channel, bool enable);
+int wl1251_cmd_data_path_tx(struct wl1251 *wl, u8 channel, bool enable);
 int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u8 channel,
 		    u16 beacon_interval, u8 dtim_interval);
 int 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 a6ad223..424ce01 100644
--- a/drivers/net/wireless/ti/wl1251/init.c
+++ b/drivers/net/wireless/ti/wl1251/init.c
@@ -390,8 +390,13 @@ int wl1251_hw_init(struct wl1251 *wl)
 	if (ret < 0)
 		goto out_free_data_path;
 
-	/* Enable data path */
-	ret = wl1251_cmd_data_path(wl, wl->channel, 1);
+	/* Enable rx data path */
+	ret = wl1251_cmd_data_path_rx(wl, wl->channel, 1);
+	if (ret < 0)
+		goto out_free_data_path;
+
+	/* Enable tx data path */
+	ret = wl1251_cmd_data_path_tx(wl, wl->channel, 1);
 	if (ret < 0)
 		goto out_free_data_path;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-08  9:25 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-26 20:33 [PATCH 00/16] wl1251 patches from linux-n900 tree Pali Rohár
2013-10-26 20:34 ` [PATCH 01/16] mac80211: fix TX device statistics for monitor interfaces Pali Rohár
2013-10-28  5:53   ` Kalle Valo
     [not found]     ` <87iowiszyu.fsf-5ukZ45wKbUHoml4zekdYB16hYfS7NtTn@public.gmane.org>
2013-12-08  8:45       ` [PATCH] " Pali Rohár
     [not found]         ` <1386492357-20826-1-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-16 12:38           ` Johannes Berg
2013-10-28 13:47   ` [PATCH 01/16] " Johannes Berg
2013-10-26 20:34 ` [PATCH 02/16] wl1251: fix scan behaviour while not associated Pali Rohár
2013-10-30 11:24   ` Pavel Machek
     [not found] ` <1382819655-30430-1-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-26 20:34   ` [PATCH 03/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration Pali Rohár
2013-10-28 23:39     ` Ben Hutchings
2013-10-29  7:09       ` Luca Coelho
2013-10-29 13:35         ` Kalle Valo
     [not found]       ` <1383003587.3779.49.camel-/LGg1Z1CJKQ+9kgCwbf1HqK4ta4zdZpAajtMo4Cw6ucAvxtiuMwx3w@public.gmane.org>
2013-12-08  7:55         ` Pali Rohár
2013-12-08 16:36           ` Ben Hutchings
2013-10-26 20:34   ` [PATCH 07/16] wl1251: configure hardware en-/decryption for monitor mode Pali Rohár
2013-10-30 11:35     ` Pavel Machek
2013-10-26 20:34   ` [PATCH 13/16] wl1251: enforce changed hw encryption support on monitor state change Pali Rohár
2013-10-30 11:55     ` Pavel Machek
2013-11-08 14:20   ` [PATCH 00/16] wl1251 patches from linux-n900 tree Felipe Contreras
2013-11-25 19:54     ` Pali Rohár
2013-10-26 20:34 ` [PATCH 04/16] wl1251: retry power save entry Pali Rohár
2013-10-26 20:34 ` [PATCH 05/16] wl1251: implement hardware ARP filtering Pali Rohár
2013-10-30 11:28   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 06/16] wl1251: split RX and TX data path initialisation Pali Rohár
2013-10-30 11:31   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 08/16] wl1251: implement multicast address filtering Pali Rohár
2013-10-30 11:41   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 09/16] wl1251: disable power saving in monitor mode Pali Rohár
2013-10-30 11:46   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 10/16] wl1251: fix channel switching " Pali Rohár
2013-10-30 11:47   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 11/16] wl1251: enable tx path in monitor mode if necessary for packet injection Pali Rohár
2013-10-30 11:51   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 12/16] wl1251: disable retry and ACK policy for injected packets Pali Rohár
2013-10-30 11:52   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 14/16] wl1251: add nvs file name to module firmware list Pali Rohár
2013-10-30 11:55   ` Pavel Machek
2013-10-26 20:34 ` [PATCH 15/16] wl1251: Add sysfs file tx_mgmt_frm_rate for setting rate Pali Rohár
2013-10-28 13:45   ` Johannes Berg
2013-10-26 20:34 ` [PATCH 16/16] wl1251: Add sysfs file address for setting permanent mac address Pali Rohár
2013-10-28 13:45   ` Johannes Berg
2013-10-28 13:49     ` Pali Rohár
2013-10-28 13:55       ` Johannes Berg
2013-10-28 14:00         ` Pali Rohár
2013-10-28 14:46           ` Dan Williams
2013-10-28 14:56             ` Johannes Berg
2013-10-28 15:04               ` Pali Rohár
2013-10-28 15:29                 ` Dan Williams
2013-10-28 16:21                   ` Pali Rohár
2013-10-28 15:33               ` Stephen Hemminger
2013-10-28 23:50   ` Ben Hutchings
2013-12-08  9:24 ` [PATCH v2 00/16] wl1251 patches from linux-n900 tree Pali Rohár
2013-12-08  9:24   ` [PATCH v2 01/16] wl1251: fix scan behaviour while not associated Pali Rohár
     [not found]     ` <1386494714-21070-2-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-10  9:21       ` Pavel Machek
     [not found]         ` <20131210092114.GB22756-tWAi6jLit6GreWDznjuHag@public.gmane.org>
2013-12-10 15:41           ` Kalle Valo
2013-12-10 17:08             ` Pali Rohár
2013-12-11 20:44               ` Ben Hutchings
2013-12-31  9:44           ` Pali Rohár
2013-12-08  9:25   ` [PATCH v2 03/16] wl1251: retry power save entry Pali Rohár
2013-12-10  9:24     ` Pavel Machek
     [not found]   ` <1386494714-21070-1-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-08  9:25     ` [PATCH v2 02/16] wl1251: add sysfs interface for bluetooth coexistence mode configuration Pali Rohár
     [not found]       ` <1386494714-21070-3-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-10 15:46         ` Kalle Valo
2013-12-10 16:09           ` Pali Rohár
2013-12-08  9:25     ` [PATCH v2 04/16] wl1251: implement hardware ARP filtering Pali Rohár
2013-12-10  9:29       ` Pavel Machek
2013-12-10  9:59         ` Michal Kubecek
2013-12-08  9:25     ` Pali Rohár [this message]
2013-12-10  9:31       ` [PATCH v2 05/16] wl1251: split RX and TX data path initialisation Pavel Machek
2013-12-08  9:25     ` [PATCH v2 06/16] wl1251: configure hardware en-/decryption for monitor mode Pali Rohár
2013-12-10  9:35       ` Pavel Machek
2013-12-31  9:31         ` Pali Rohár
2013-12-08  9:25     ` [PATCH v2 16/16] wl1251: fix NULL pointer dereference Pali Rohár
2013-12-10  9:42       ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 07/16] wl1251: implement multicast address filtering Pali Rohár
2013-12-10  9:39     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 08/16] wl1251: disable power saving in monitor mode Pali Rohár
     [not found]     ` <1386494714-21070-9-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-10  9:41       ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 09/16] wl1251: fix channel switching " Pali Rohár
2013-12-10  9:43     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 10/16] wl1251: enable tx path in monitor mode if necessary for packet injection Pali Rohár
2013-12-10  9:44     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 11/16] wl1251: disable retry and ACK policy for injected packets Pali Rohár
2013-12-10  9:46     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 12/16] wl1251: enforce changed hw encryption support on monitor state change Pali Rohár
2013-12-10  9:48     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 13/16] wl1251: add nvs file name to module firmware list Pali Rohár
2013-12-10  9:49     ` Pavel Machek
2013-12-08  9:25   ` [PATCH v2 14/16] wl1251: Add sysfs file tx_mgmt_frm_rate for setting rate Pali Rohár
2013-12-09 16:50     ` Dan Williams
     [not found]     ` <1386494714-21070-15-git-send-email-pali.rohar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-10 15:36       ` Kalle Valo
2013-12-08  9:25   ` [PATCH v2 15/16] wl1251: Add sysfs file address for setting permanent mac address Pali Rohár
2013-12-10 15:49     ` Kalle Valo
2013-12-10 16:10       ` Pali Rohár
2013-12-10 17:14         ` Pali Rohár
2013-12-10 17:49           ` Dan Williams
     [not found]             ` <1386697762.30202.6.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2013-12-10 17:52               ` Pali Rohár
2013-12-10 19:22                 ` Dan Williams
2013-12-10 19:31                   ` Pali Rohár
2013-12-11 21:26                     ` Ben Hutchings
2013-12-11 21:17                 ` Ben Hutchings
2013-12-11 21:28                   ` Ben Hutchings
2013-12-11 21:35                   ` Ivajlo Dimitrov
2013-12-11 22:15                     ` Ben Hutchings
2013-12-11 22:36                       ` Ivajlo Dimitrov
2013-12-12 12:45                         ` Sergei Shtylyov
     [not found]                       ` <1386800135.1516.296.camel-/LGg1Z1CJKQ+9kgCwbf1HqK4ta4zdZpAajtMo4Cw6ucAvxtiuMwx3w@public.gmane.org>
2013-12-11 22:53                         ` Dan Williams
     [not found]                           ` <1386802416.17188.69.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2013-12-12 19:55                             ` Ben Hutchings
2013-12-12 20:24                               ` Ivajlo Dimitrov
2013-12-12 10:56                   ` Pavel Machek
2013-12-31  9:47   ` [PATCH v2 00/16] wl1251 patches from linux-n900 tree Pali Rohár
2014-01-06 20:00     ` John W. Linville
2014-01-06 20:26       ` Johannes Berg
2014-01-06 22:03       ` Pavel Machek
2014-01-07 12:15       ` Pavel Machek
2014-01-16  0:21       ` Pavel Machek
     [not found]         ` <20140116002121.GA3726-tWAi6jLit6GreWDznjuHag@public.gmane.org>
2014-01-16 20:29           ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386494714-21070-6-git-send-email-pali.rohar@gmail.com \
    --to=pali.rohar-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=aaro.koskinen-X3B1VOXEql0@public.gmane.org \
    --cc=david.gnedt-rFfgOQFw6VLk7+2FdBfRIA@public.gmane.org \
    --cc=felipe.contreras-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=freemangordon-uiMcrn6V0Vs@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=joni.lapilainen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
    --cc=luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pavel-+ZI9xUNit7I@public.gmane.org \
    --cc=sre-GFxCN5SEZAc@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).