aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-07-17 01:21:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:38:09 -0400
commit3a980d0a505161b99fc936827cb28ec8eb853284 (patch)
treea187da6be849ea095761a5b35a257cc9374d7718
parentee03a93241eb954d669fb795b4e5c0eec92eef22 (diff)
mwl8k: get rid of mwl8k_bss_info_changed() workqueue use
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwl8k.c101
1 files changed, 38 insertions, 63 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 77e280a00a5d..d5a46a917cf9 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2663,58 +2663,62 @@ out:
2663 return rc; 2663 return rc;
2664} 2664}
2665 2665
2666struct mwl8k_bss_info_changed_worker { 2666static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
2667 struct mwl8k_work_struct header; 2667 struct ieee80211_vif *vif,
2668 struct ieee80211_vif *vif; 2668 struct ieee80211_bss_conf *info,
2669 struct ieee80211_bss_conf *info; 2669 u32 changed)
2670 u32 changed;
2671};
2672
2673static int mwl8k_bss_info_changed_wt(struct work_struct *wt)
2674{ 2670{
2675 struct mwl8k_bss_info_changed_worker *worker =
2676 (struct mwl8k_bss_info_changed_worker *)wt;
2677 struct ieee80211_hw *hw = worker->header.hw;
2678 struct ieee80211_vif *vif = worker->vif;
2679 struct ieee80211_bss_conf *info = worker->info;
2680 u32 changed;
2681 int rc;
2682
2683 struct mwl8k_priv *priv = hw->priv; 2671 struct mwl8k_priv *priv = hw->priv;
2684 struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); 2672 struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
2673 int rc;
2674
2675 if (changed & BSS_CHANGED_BSSID)
2676 memcpy(mwl8k_vif->bssid, info->bssid, ETH_ALEN);
2677
2678 if ((changed & BSS_CHANGED_ASSOC) == 0)
2679 return;
2685 2680
2686 changed = worker->changed;
2687 priv->capture_beacon = false; 2681 priv->capture_beacon = false;
2688 2682
2683 rc = mwl8k_fw_lock(hw);
2684 if (!rc)
2685 return;
2686
2689 if (info->assoc) { 2687 if (info->assoc) {
2690 memcpy(&mwl8k_vif->bss_info, info, 2688 memcpy(&mwl8k_vif->bss_info, info,
2691 sizeof(struct ieee80211_bss_conf)); 2689 sizeof(struct ieee80211_bss_conf));
2692 2690
2693 /* Install rates */ 2691 /* Install rates */
2694 if (mwl8k_update_rateset(hw, vif)) 2692 rc = mwl8k_update_rateset(hw, vif);
2695 goto mwl8k_bss_info_changed_exit; 2693 if (rc)
2694 goto out;
2696 2695
2697 /* Turn on rate adaptation */ 2696 /* Turn on rate adaptation */
2698 if (mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE, 2697 rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE,
2699 MWL8K_UCAST_RATE, NULL)) 2698 MWL8K_UCAST_RATE, NULL);
2700 goto mwl8k_bss_info_changed_exit; 2699 if (rc)
2700 goto out;
2701 2701
2702 /* Set radio preamble */ 2702 /* Set radio preamble */
2703 if (mwl8k_set_radio_preamble(hw, info->use_short_preamble)) 2703 rc = mwl8k_set_radio_preamble(hw, info->use_short_preamble);
2704 goto mwl8k_bss_info_changed_exit; 2704 if (rc)
2705 goto out;
2705 2706
2706 /* Set slot time */ 2707 /* Set slot time */
2707 if (mwl8k_cmd_set_slot(hw, info->use_short_slot)) 2708 rc = mwl8k_cmd_set_slot(hw, info->use_short_slot);
2708 goto mwl8k_bss_info_changed_exit; 2709 if (rc)
2710 goto out;
2709 2711
2710 /* Update peer rate info */ 2712 /* Update peer rate info */
2711 if (mwl8k_cmd_update_sta_db(hw, vif, 2713 rc = mwl8k_cmd_update_sta_db(hw, vif,
2712 MWL8K_STA_DB_MODIFY_ENTRY)) 2714 MWL8K_STA_DB_MODIFY_ENTRY);
2713 goto mwl8k_bss_info_changed_exit; 2715 if (rc)
2716 goto out;
2714 2717
2715 /* Set AID */ 2718 /* Set AID */
2716 if (mwl8k_cmd_set_aid(hw, vif)) 2719 rc = mwl8k_cmd_set_aid(hw, vif);
2717 goto mwl8k_bss_info_changed_exit; 2720 if (rc)
2721 goto out;
2718 2722
2719 /* 2723 /*
2720 * Finalize the join. Tell rx handler to process 2724 * Finalize the join. Tell rx handler to process
@@ -2723,43 +2727,14 @@ static int mwl8k_bss_info_changed_wt(struct work_struct *wt)
2723 memcpy(priv->capture_bssid, mwl8k_vif->bssid, ETH_ALEN); 2727 memcpy(priv->capture_bssid, mwl8k_vif->bssid, ETH_ALEN);
2724 priv->capture_beacon = true; 2728 priv->capture_beacon = true;
2725 } else { 2729 } else {
2726 mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY); 2730 rc = mwl8k_cmd_update_sta_db(hw, vif, MWL8K_STA_DB_DEL_ENTRY);
2727 memset(&mwl8k_vif->bss_info, 0, 2731 memset(&mwl8k_vif->bss_info, 0,
2728 sizeof(struct ieee80211_bss_conf)); 2732 sizeof(struct ieee80211_bss_conf));
2729 memset(mwl8k_vif->bssid, 0, ETH_ALEN); 2733 memset(mwl8k_vif->bssid, 0, ETH_ALEN);
2730 } 2734 }
2731 2735
2732mwl8k_bss_info_changed_exit: 2736out:
2733 rc = 0; 2737 mwl8k_fw_unlock(hw);
2734 return rc;
2735}
2736
2737static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
2738 struct ieee80211_vif *vif,
2739 struct ieee80211_bss_conf *info,
2740 u32 changed)
2741{
2742 struct mwl8k_bss_info_changed_worker *worker;
2743 struct mwl8k_vif *mv_vif = MWL8K_VIF(vif);
2744 int rc;
2745
2746 if (changed & BSS_CHANGED_BSSID)
2747 memcpy(mv_vif->bssid, info->bssid, ETH_ALEN);
2748
2749 if ((changed & BSS_CHANGED_ASSOC) == 0)
2750 return;
2751
2752 worker = kzalloc(sizeof(*worker), GFP_KERNEL);
2753 if (worker == NULL)
2754 return;
2755
2756 worker->vif = vif;
2757 worker->info = info;
2758 worker->changed = changed;
2759 rc = mwl8k_queue_work(hw, &worker->header, mwl8k_bss_info_changed_wt);
2760 kfree(worker);
2761 if (rc == -ETIMEDOUT)
2762 printk(KERN_ERR "%s() timed out\n", __func__);
2763} 2738}
2764 2739
2765static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw, 2740static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,