Commit ee03a932 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by John W. Linville

mwl8k: get rid of mwl8k_config() workqueue use

Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d3cea0b8
...@@ -2622,77 +2622,45 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw, ...@@ -2622,77 +2622,45 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw,
priv->vif = NULL; priv->vif = NULL;
} }
struct mwl8k_config_worker { static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
struct mwl8k_work_struct header;
u32 changed;
};
static int mwl8k_config_wt(struct work_struct *wt)
{ {
struct mwl8k_config_worker *worker =
(struct mwl8k_config_worker *)wt;
struct ieee80211_hw *hw = worker->header.hw;
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
struct mwl8k_priv *priv = hw->priv; struct mwl8k_priv *priv = hw->priv;
int rc = 0; int rc;
if (conf->flags & IEEE80211_CONF_IDLE) { if (conf->flags & IEEE80211_CONF_IDLE) {
mwl8k_cmd_802_11_radio_disable(hw); mwl8k_cmd_802_11_radio_disable(hw);
priv->current_channel = NULL; priv->current_channel = NULL;
goto mwl8k_config_exit; return 0;
} }
if (mwl8k_cmd_802_11_radio_enable(hw)) { rc = mwl8k_fw_lock(hw);
rc = -EINVAL; if (rc)
goto mwl8k_config_exit; return rc;
}
priv->current_channel = conf->channel; rc = mwl8k_cmd_802_11_radio_enable(hw);
if (rc)
goto out;
if (mwl8k_cmd_set_rf_channel(hw, conf->channel)) { rc = mwl8k_cmd_set_rf_channel(hw, conf->channel);
rc = -EINVAL; if (rc)
goto mwl8k_config_exit; goto out;
}
priv->current_channel = conf->channel;
if (conf->power_level > 18) if (conf->power_level > 18)
conf->power_level = 18; conf->power_level = 18;
if (mwl8k_cmd_802_11_rf_tx_power(hw, conf->power_level)) { rc = mwl8k_cmd_802_11_rf_tx_power(hw, conf->power_level);
rc = -EINVAL; if (rc)
goto mwl8k_config_exit; goto out;
}
if (mwl8k_cmd_mimo_config(hw, 0x7, 0x7)) if (mwl8k_cmd_mimo_config(hw, 0x7, 0x7))
rc = -EINVAL; rc = -EINVAL;
mwl8k_config_exit: out:
return rc; mwl8k_fw_unlock(hw);
}
static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
{
int rc = 0;
struct mwl8k_config_worker *worker;
worker = kzalloc(sizeof(*worker), GFP_KERNEL);
if (worker == NULL)
return -ENOMEM;
worker->changed = changed;
rc = mwl8k_queue_work(hw, &worker->header, mwl8k_config_wt);
if (rc == -ETIMEDOUT) {
printk(KERN_ERR "%s() timed out.\n", __func__);
rc = -EINVAL;
}
kfree(worker);
/* return rc;
* mac80211 will crash on anything other than -EINVAL on
* error. Looks like wireless extensions which calls mac80211
* may be the actual culprit...
*/
return rc ? -EINVAL : 0;
} }
struct mwl8k_bss_info_changed_worker { struct mwl8k_bss_info_changed_worker {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment