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

mwl8k: get rid of mwl8k_bss_info_changed() workqueue use

Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ee03a932
...@@ -2663,58 +2663,62 @@ out: ...@@ -2663,58 +2663,62 @@ out:
return rc; return rc;
} }
struct mwl8k_bss_info_changed_worker { static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
struct mwl8k_work_struct header; struct ieee80211_vif *vif,
struct ieee80211_vif *vif; struct ieee80211_bss_conf *info,
struct ieee80211_bss_conf *info; u32 changed)
u32 changed;
};
static int mwl8k_bss_info_changed_wt(struct work_struct *wt)
{ {
struct mwl8k_bss_info_changed_worker *worker =
(struct mwl8k_bss_info_changed_worker *)wt;
struct ieee80211_hw *hw = worker->header.hw;
struct ieee80211_vif *vif = worker->vif;
struct ieee80211_bss_conf *info = worker->info;
u32 changed;
int rc;
struct mwl8k_priv *priv = hw->priv; struct mwl8k_priv *priv = hw->priv;
struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
int rc;
if (changed & BSS_CHANGED_BSSID)
memcpy(mwl8k_vif->bssid, info->bssid, ETH_ALEN);
if ((changed & BSS_CHANGED_ASSOC) == 0)
return;
changed = worker->changed;
priv->capture_beacon = false; priv->capture_beacon = false;
rc = mwl8k_fw_lock(hw);
if (!rc)
return;
if (info->assoc) { if (info->assoc) {
memcpy(&mwl8k_vif->bss_info, info, memcpy(&mwl8k_vif->bss_info, info,
sizeof(struct ieee80211_bss_conf)); sizeof(struct ieee80211_bss_conf));
/* Install rates */ /* Install rates */
if (mwl8k_update_rateset(hw, vif)) rc = mwl8k_update_rateset(hw, vif);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* Turn on rate adaptation */ /* Turn on rate adaptation */
if (mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE, rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE,
MWL8K_UCAST_RATE, NULL)) MWL8K_UCAST_RATE, NULL);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* Set radio preamble */ /* Set radio preamble */
if (mwl8k_set_radio_preamble(hw, info->use_short_preamble)) rc = mwl8k_set_radio_preamble(hw, info->use_short_preamble);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* Set slot time */ /* Set slot time */
if (mwl8k_cmd_set_slot(hw, info->use_short_slot)) rc = mwl8k_cmd_set_slot(hw, info->use_short_slot);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* Update peer rate info */ /* Update peer rate info */
if (mwl8k_cmd_update_sta_db(hw, vif, rc = mwl8k_cmd_update_sta_db(hw, vif,
MWL8K_STA_DB_MODIFY_ENTRY)) MWL8K_STA_DB_MODIFY_ENTRY);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* Set AID */ /* Set AID */
if (mwl8k_cmd_set_aid(hw, vif)) rc = mwl8k_cmd_set_aid(hw, vif);
goto mwl8k_bss_info_changed_exit; if (rc)
goto out;
/* /*
* Finalize the join. Tell rx handler to process * Finalize the join. Tell rx handler to process
...@@ -2723,43 +2727,14 @@ static int mwl8k_bss_info_changed_wt(struct work_struct *wt) ...@@ -2723,43 +2727,14 @@ static int mwl8k_bss_info_changed_wt(struct work_struct *wt)
memcpy(priv->capture_bssid, mwl8k_vif->bssid, ETH_ALEN); memcpy(priv->capture_bssid, mwl8k_vif->bssid, ETH_ALEN);
priv->capture_beacon = true; priv->capture_beacon = true;
} else { } else {
mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY); rc = mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY);
memset(&mwl8k_vif->bss_info, 0, memset(&mwl8k_vif->bss_info, 0,
sizeof(struct ieee80211_bss_conf)); sizeof(struct ieee80211_bss_conf));
memset(mwl8k_vif->bssid, 0, ETH_ALEN); memset(mwl8k_vif->bssid, 0, ETH_ALEN);
} }
mwl8k_bss_info_changed_exit: out:
rc = 0; mwl8k_fw_unlock(hw);
return rc;
}
static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
u32 changed)
{
struct mwl8k_bss_info_changed_worker *worker;
struct mwl8k_vif *mv_vif = MWL8K_VIF(vif);
int rc;
if (changed & BSS_CHANGED_BSSID)
memcpy(mv_vif->bssid, info->bssid, ETH_ALEN);
if ((changed & BSS_CHANGED_ASSOC) == 0)
return;
worker = kzalloc(sizeof(*worker), GFP_KERNEL);
if (worker == NULL)
return;
worker->vif = vif;
worker->info = info;
worker->changed = changed;
rc = mwl8k_queue_work(hw, &worker->header, mwl8k_bss_info_changed_wt);
kfree(worker);
if (rc == -ETIMEDOUT)
printk(KERN_ERR "%s() timed out\n", __func__);
} }
static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw, static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
......
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