mwl8k: get rid of mwl8k_configure_filter() workqueue use
authorLennert Buytenhek <buytenh@wantstofly.org>
Tue, 18 Aug 2009 02:06:20 +0000 (04:06 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:38:12 +0000 (11:38 -0400)
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c

index 29712bd95afeb38575b3b33f855db4956645c662..43e5dd19b664c691ae96c937ea45cf0071947937 100644 (file)
@@ -2747,26 +2747,23 @@ static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
        return (unsigned long)cmd;
 }
 
-struct mwl8k_configure_filter_worker {
-       struct mwl8k_work_struct header;
-       unsigned int changed_flags;
-       unsigned int total_flags;
+static void mwl8k_configure_filter(struct ieee80211_hw *hw,
+                                  unsigned int changed_flags,
+                                  unsigned int *total_flags,
+                                  u64 multicast)
+{
+       struct mwl8k_priv *priv = hw->priv;
        struct mwl8k_cmd_pkt *multicast_adr_cmd;
-};
 
-#define MWL8K_SUPPORTED_IF_FLAGS       FIF_BCN_PRBRESP_PROMISC
+       /* Clear unsupported feature flags */
+       *total_flags &= FIF_BCN_PRBRESP_PROMISC;
 
-static int mwl8k_configure_filter_wt(struct work_struct *wt)
-{
-       struct mwl8k_configure_filter_worker *worker =
-               (struct mwl8k_configure_filter_worker *)wt;
-       struct ieee80211_hw *hw = worker->header.hw;
-       struct mwl8k_priv *priv = hw->priv;
-       int rc = 0;
+       if (mwl8k_fw_lock(hw))
+               return;
 
-       if (worker->changed_flags & FIF_BCN_PRBRESP_PROMISC) {
-               if (worker->total_flags & FIF_BCN_PRBRESP_PROMISC)
-                       rc = mwl8k_cmd_set_pre_scan(hw);
+       if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
+               if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
+                       mwl8k_cmd_set_pre_scan(hw);
                else {
                        u8 *bssid;
 
@@ -2774,39 +2771,17 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
                        if (priv->vif != NULL)
                                bssid = MWL8K_VIF(priv->vif)->bssid;
 
-                       rc = mwl8k_cmd_set_post_scan(hw, bssid);
+                       mwl8k_cmd_set_post_scan(hw, bssid);
                }
        }
 
-       if (!rc && worker->multicast_adr_cmd != NULL)
-               rc = mwl8k_post_cmd(hw, worker->multicast_adr_cmd);
-       kfree(worker->multicast_adr_cmd);
-
-       return rc;
-}
-
-static void mwl8k_configure_filter(struct ieee80211_hw *hw,
-                                  unsigned int changed_flags,
-                                  unsigned int *total_flags,
-                                  u64 multicast)
-{
-       struct mwl8k_configure_filter_worker *worker;
-
-       /* Clear unsupported feature flags */
-       *total_flags &= MWL8K_SUPPORTED_IF_FLAGS;
-
-       if (!(changed_flags & MWL8K_SUPPORTED_IF_FLAGS))
-               return;
-
-       worker = kzalloc(sizeof(*worker), GFP_ATOMIC);
-       if (worker == NULL)
-               return;
-
-       worker->changed_flags = changed_flags;
-       worker->total_flags = *total_flags;
-       worker->multicast_adr_cmd = (void *)(unsigned long)multicast;
+       multicast_adr_cmd = (void *)(unsigned long)multicast;
+       if (multicast_adr_cmd != NULL) {
+               mwl8k_post_cmd(hw, multicast_adr_cmd);
+               kfree(multicast_adr_cmd);
+       }
 
-       mwl8k_queue_work(hw, &worker->header, mwl8k_configure_filter_wt);
+       mwl8k_fw_unlock(hw);
 }
 
 static int mwl8k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)