diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-07-17 01:25:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:38:11 -0400 |
commit | 3e4f542cfbf5a60f2295b2de9a31bdd14beb7b4a (patch) | |
tree | 32171674c91fadfec8cb07ec75d56c6e3ee6e61b /drivers/net/wireless/mwl8k.c | |
parent | 733d3067d3fb168fbbd008cb0ebf5ad2027030f3 (diff) |
mwl8k: get rid of mwl8k_conf_tx() workqueue use
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 3129c577388d..5ce2d362e07d 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -2814,56 +2814,27 @@ static int mwl8k_set_rts_threshold(struct ieee80211_hw *hw, u32 value) | |||
2814 | return mwl8k_rts_threshold(hw, MWL8K_CMD_SET, value); | 2814 | return mwl8k_rts_threshold(hw, MWL8K_CMD_SET, value); |
2815 | } | 2815 | } |
2816 | 2816 | ||
2817 | struct mwl8k_conf_tx_worker { | ||
2818 | struct mwl8k_work_struct header; | ||
2819 | u16 queue; | ||
2820 | const struct ieee80211_tx_queue_params *params; | ||
2821 | }; | ||
2822 | |||
2823 | static int mwl8k_conf_tx_wt(struct work_struct *wt) | ||
2824 | { | ||
2825 | struct mwl8k_conf_tx_worker *worker = | ||
2826 | (struct mwl8k_conf_tx_worker *)wt; | ||
2827 | |||
2828 | struct ieee80211_hw *hw = worker->header.hw; | ||
2829 | u16 queue = worker->queue; | ||
2830 | const struct ieee80211_tx_queue_params *params = worker->params; | ||
2831 | |||
2832 | struct mwl8k_priv *priv = hw->priv; | ||
2833 | int rc = 0; | ||
2834 | |||
2835 | if (!priv->wmm_enabled) { | ||
2836 | if (mwl8k_set_wmm(hw, 1)) { | ||
2837 | rc = -EINVAL; | ||
2838 | goto mwl8k_conf_tx_exit; | ||
2839 | } | ||
2840 | } | ||
2841 | |||
2842 | if (mwl8k_set_edca_params(hw, GET_TXQ(queue), params->cw_min, | ||
2843 | params->cw_max, params->aifs, params->txop)) | ||
2844 | rc = -EINVAL; | ||
2845 | mwl8k_conf_tx_exit: | ||
2846 | return rc; | ||
2847 | } | ||
2848 | |||
2849 | static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue, | 2817 | static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue, |
2850 | const struct ieee80211_tx_queue_params *params) | 2818 | const struct ieee80211_tx_queue_params *params) |
2851 | { | 2819 | { |
2820 | struct mwl8k_priv *priv = hw->priv; | ||
2852 | int rc; | 2821 | int rc; |
2853 | struct mwl8k_conf_tx_worker *worker; | ||
2854 | 2822 | ||
2855 | worker = kzalloc(sizeof(*worker), GFP_KERNEL); | 2823 | rc = mwl8k_fw_lock(hw); |
2856 | if (worker == NULL) | 2824 | if (!rc) { |
2857 | return -ENOMEM; | 2825 | if (!priv->wmm_enabled) |
2826 | rc = mwl8k_set_wmm(hw, 1); | ||
2858 | 2827 | ||
2859 | worker->queue = queue; | 2828 | if (!rc) |
2860 | worker->params = params; | 2829 | rc = mwl8k_set_edca_params(hw, queue, |
2861 | rc = mwl8k_queue_work(hw, &worker->header, mwl8k_conf_tx_wt); | 2830 | params->cw_min, |
2862 | kfree(worker); | 2831 | params->cw_max, |
2863 | if (rc == -ETIMEDOUT) { | 2832 | params->aifs, |
2864 | printk(KERN_ERR "%s() timed out\n", __func__); | 2833 | params->txop); |
2865 | rc = -EINVAL; | 2834 | |
2835 | mwl8k_fw_unlock(hw); | ||
2866 | } | 2836 | } |
2837 | |||
2867 | return rc; | 2838 | return rc; |
2868 | } | 2839 | } |
2869 | 2840 | ||