* [PATCH 24/29] mwl8k: get rid of mwl8k_conf_tx() workqueue use
@ 2009-08-18 3:55 Lennert Buytenhek
0 siblings, 0 replies; only message in thread
From: Lennert Buytenhek @ 2009-08-18 3:55 UTC (permalink / raw)
To: linville, linux-wireless
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
---
drivers/net/wireless/mwl8k.c | 58 ++++++++++-------------------------------
1 files changed, 14 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index c8e65c6..d16ba1b 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2821,57 +2821,27 @@ static int mwl8k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
return mwl8k_rts_threshold(hw, MWL8K_CMD_SET, value);
}
-struct mwl8k_conf_tx_worker {
- struct mwl8k_work_struct header;
- u16 queue;
- const struct ieee80211_tx_queue_params *params;
-};
-
-static int mwl8k_conf_tx_wt(struct work_struct *wt)
-{
- struct mwl8k_conf_tx_worker *worker =
- (struct mwl8k_conf_tx_worker *)wt;
-
- struct ieee80211_hw *hw = worker->header.hw;
- u16 queue = worker->queue;
- const struct ieee80211_tx_queue_params *params = worker->params;
-
- struct mwl8k_priv *priv = hw->priv;
- int rc = 0;
-
- if (!priv->wmm_enabled) {
- if (mwl8k_set_wmm(hw, 1)) {
- rc = -EINVAL;
- goto mwl8k_conf_tx_exit;
- }
- }
-
- if (mwl8k_set_edca_params(hw, GET_TXQ(queue), params->cw_min,
- params->cw_max, params->aifs, params->txop))
- rc = -EINVAL;
-mwl8k_conf_tx_exit:
- return rc;
-}
-
static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
+ struct mwl8k_priv *priv = hw->priv;
int rc;
- struct mwl8k_conf_tx_worker *worker;
- worker = kzalloc(sizeof(*worker), GFP_KERNEL);
- if (worker == NULL)
- return -ENOMEM;
+ rc = mwl8k_fw_lock(hw);
+ if (!rc) {
+ if (!priv->wmm_enabled)
+ rc = mwl8k_set_wmm(hw, 1);
- worker->header.sleep = 1;
- worker->queue = queue;
- worker->params = params;
- rc = mwl8k_queue_work(hw, &worker->header, mwl8k_conf_tx_wt);
- kfree(worker);
- if (rc == -ETIMEDOUT) {
- printk(KERN_ERR "%s() timed out\n", __func__);
- rc = -EINVAL;
+ if (!rc)
+ rc = mwl8k_set_edca_params(hw, queue,
+ params->cw_min,
+ params->cw_max,
+ params->aifs,
+ params->txop);
+
+ mwl8k_fw_unlock(hw);
}
+
return rc;
}
--
1.5.6.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-18 3:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-18 3:55 [PATCH 24/29] mwl8k: get rid of mwl8k_conf_tx() workqueue use Lennert Buytenhek
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).