From: Arik Nemtsov <arik@wizery.com>
To: <linux-wireless@vger.kernel.org>
Cc: Luciano Coelho <luciano.coelho@nokia.com>,
Arik Nemtsov <arik@wizery.com>
Subject: [PATCH v4 14/18] wl1271: AP mode - record TX configuration settings
Date: Thu, 30 Dec 2010 01:32:09 +0200 [thread overview]
Message-ID: <1293665533-7599-15-git-send-email-arik@wizery.com> (raw)
In-Reply-To: <1293665533-7599-1-git-send-email-arik@wizery.com>
Record TX configuration settings in the "conf" member of our global
structure (struct wl1271) if conf_tx is called when the firmware is
not loaded.
Later on when the firmware is loaded, we apply the tx conf as part of
the init sequence.
Important for AP mode since conf_tx is called before add_interface
(where the firmware is initialized).
Signed-off-by: Arik Nemtsov <arik@wizery.com>
---
drivers/net/wireless/wl12xx/main.c | 72 ++++++++++++++++++++++++------------
1 files changed, 48 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index ed5e2fc..8b897e3 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2314,42 +2314,66 @@ static int wl1271_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
{
struct wl1271 *wl = hw->priv;
u8 ps_scheme;
- int ret;
+ int ret = 0;
mutex_lock(&wl->mutex);
wl1271_debug(DEBUG_MAC80211, "mac80211 conf tx %d", queue);
- if (unlikely(wl->state == WL1271_STATE_OFF)) {
- ret = -EAGAIN;
- goto out;
- }
-
- ret = wl1271_ps_elp_wakeup(wl, false);
- if (ret < 0)
- goto out;
-
- /* the txop is confed in units of 32us by the mac80211, we need us */
- ret = wl1271_acx_ac_cfg(wl, wl1271_tx_get_queue(queue),
- params->cw_min, params->cw_max,
- params->aifs, params->txop << 5);
- if (ret < 0)
- goto out_sleep;
-
if (params->uapsd)
ps_scheme = CONF_PS_SCHEME_UPSD_TRIGGER;
else
ps_scheme = CONF_PS_SCHEME_LEGACY;
- ret = wl1271_acx_tid_cfg(wl, wl1271_tx_get_queue(queue),
- CONF_CHANNEL_TYPE_EDCF,
- wl1271_tx_get_queue(queue),
- ps_scheme, CONF_ACK_POLICY_LEGACY, 0, 0);
- if (ret < 0)
- goto out_sleep;
+ if (wl->state == WL1271_STATE_OFF) {
+ /*
+ * If the state is off, the parameters will be recorded and
+ * configured on init. This happens in AP-mode.
+ */
+ struct conf_tx_ac_category *conf_ac =
+ &wl->conf.tx.ac_conf[wl1271_tx_get_queue(queue)];
+ struct conf_tx_tid *conf_tid =
+ &wl->conf.tx.tid_conf[wl1271_tx_get_queue(queue)];
+
+ conf_ac->ac = wl1271_tx_get_queue(queue);
+ conf_ac->cw_min = (u8)params->cw_min;
+ conf_ac->cw_max = params->cw_max;
+ conf_ac->aifsn = params->aifs;
+ conf_ac->tx_op_limit = params->txop << 5;
+
+ conf_tid->queue_id = wl1271_tx_get_queue(queue);
+ conf_tid->channel_type = CONF_CHANNEL_TYPE_EDCF;
+ conf_tid->tsid = wl1271_tx_get_queue(queue);
+ conf_tid->ps_scheme = ps_scheme;
+ conf_tid->ack_policy = CONF_ACK_POLICY_LEGACY;
+ conf_tid->apsd_conf[0] = 0;
+ conf_tid->apsd_conf[1] = 0;
+ } else {
+ ret = wl1271_ps_elp_wakeup(wl, false);
+ if (ret < 0)
+ goto out;
+
+ /*
+ * the txop is confed in units of 32us by the mac80211,
+ * we need us
+ */
+ ret = wl1271_acx_ac_cfg(wl, wl1271_tx_get_queue(queue),
+ params->cw_min, params->cw_max,
+ params->aifs, params->txop << 5);
+ if (ret < 0)
+ goto out_sleep;
+
+ ret = wl1271_acx_tid_cfg(wl, wl1271_tx_get_queue(queue),
+ CONF_CHANNEL_TYPE_EDCF,
+ wl1271_tx_get_queue(queue),
+ ps_scheme, CONF_ACK_POLICY_LEGACY,
+ 0, 0);
+ if (ret < 0)
+ goto out_sleep;
out_sleep:
- wl1271_ps_elp_sleep(wl);
+ wl1271_ps_elp_sleep(wl);
+ }
out:
mutex_unlock(&wl->mutex);
--
1.7.1
next prev parent reply other threads:[~2010-12-29 23:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-29 23:31 [PATCH v4 00/18] AP mode support for wl12xx Arik Nemtsov
2010-12-29 23:31 ` [PATCH v4 01/18] wl1271: Add AP related configuration to conf_drv_settings Arik Nemtsov
2010-12-29 23:31 ` [PATCH v4 02/18] wl1271: AP mode - AP specific CMD_CONFIGURE sub-commands Arik Nemtsov
2010-12-29 23:31 ` [PATCH v4 03/18] wl1271: AP mode - add AP specific event Arik Nemtsov
2010-12-29 23:31 ` [PATCH v4 04/18] wl1271: AP-mode high level commands Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 05/18] wl1271: AP mode - workaround for FW bug on station remove Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 06/18] wl1271: AP mode - init sequence Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 07/18] wl1271: AP specific RX filter configuration Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 08/18] wl1271: Add AP related definitions to HOST-FW interface Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 09/18] wl1271: Configure AP on BSS info change Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 10/18] wl1271: AP mode config in ieee80211_ops.config Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 11/18] wl1271: AP mode - change filter config Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 12/18] wl1271: AP mode - add STA add/remove ops Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 13/18] wl1271: AP mode - changes in TX path Arik Nemtsov
2010-12-29 23:32 ` Arik Nemtsov [this message]
2010-12-29 23:32 ` [PATCH v4 15/18] wl1271: AP mode - encryption support Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 16/18] wl1271: AP mode - fetch appropriate firmware for AP Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 17/18] wl1271: Read MAC address from NVS file on HW startup Arik Nemtsov
2010-12-29 23:32 ` [PATCH v4 18/18] wl1271: Enable AP-mode Arik Nemtsov
2011-01-10 16:03 ` [PATCH v4 00/18] AP mode support for wl12xx Luciano Coelho
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=1293665533-7599-15-git-send-email-arik@wizery.com \
--to=arik@wizery.com \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@nokia.com \
/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).