linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Mohamed Abbas <mabbas@linux.intel.com>, Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 24/30] iwl4965: fix scan problem
Date: Thu, 25 Oct 2007 17:15:45 +0800	[thread overview]
Message-ID: <11933037863641-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11933037851697-git-send-email-yi.zhu@intel.com>

From: Mohamed Abbas <mabbas@linux.intel.com>

This patch fixes the following problems for 4965:
1. Fix direct scan by make sure we set one_direct_scan only when the
   mac80211 ask for direct scan.
2. Fix mac_stop and mac_remove_interface calles, we make sure we cancel any
   scan and disassoc on these call.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   32 +++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index f07643b..05faa0f 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6952,7 +6952,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
 		memcpy(scan->direct_scan[0].ssid,
 		       priv->direct_ssid, priv->direct_ssid_len);
 		direct_mask = 1;
-	} else if (!iwl_is_associated(priv)) {
+	} else if (!iwl_is_associated(priv) && priv->essid_len) {
 		scan->direct_scan[0].id = WLAN_EID_SSID;
 		scan->direct_scan[0].len = priv->essid_len;
 		memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -7103,6 +7103,10 @@ static void iwl_bg_post_associate(struct work_struct *data)
 
 	mutex_lock(&priv->mutex);
 
+	if (!priv->interface_id || !priv->is_open) {
+		mutex_unlock(&priv->mutex);
+		return;
+	}
 	iwl_scan_cancel_timeout(priv, 200);
 
 	conf = ieee80211_get_hw_conf(priv->hw);
@@ -7257,9 +7261,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
 	struct iwl_priv *priv = hw->priv;
 
 	IWL_DEBUG_MAC80211("enter\n");
+
+
+	mutex_lock(&priv->mutex);
+	/* stop mac, cancel any scan request and clear
+	 * RXON_FILTER_ASSOC_MSK BIT
+	 */
 	priv->is_open = 0;
-	/*netif_stop_queue(dev); */
-	flush_workqueue(priv->workqueue);
+	iwl_scan_cancel_timeout(priv, 100);
+	cancel_delayed_work(&priv->post_associate);
+	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+	iwl_commit_rxon(priv);
+	mutex_unlock(&priv->mutex);
+
 	IWL_DEBUG_MAC80211("leave\n");
 }
 
@@ -7604,6 +7618,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
 	IWL_DEBUG_MAC80211("enter\n");
 
 	mutex_lock(&priv->mutex);
+
+	iwl_scan_cancel_timeout(priv, 100);
+	cancel_delayed_work(&priv->post_associate);
+	priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
+	iwl_commit_rxon(priv);
+
 	if (priv->interface_id == conf->if_id) {
 		priv->interface_id = 0;
 		memset(priv->bssid, 0, ETH_ALEN);
@@ -7656,7 +7676,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 		priv->direct_ssid_len = (u8)
 		    min((u8) len, (u8) IW_ESSID_MAX_SIZE);
 		memcpy(priv->direct_ssid, ssid, priv->direct_ssid_len);
-	}
+	} else
+		priv->one_direct_scan = 0;
 
 	rc = iwl_scan_initiate(priv);
 
@@ -9146,6 +9167,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
 		iwl_rate_control_unregister(priv->hw);
 	}
 
+	/*netif_stop_queue(dev); */
+	flush_workqueue(priv->workqueue);
+
 	/* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
 	 * priv->workqueue... so we can't take down the workqueue
 	 * until now... */
-- 
1.5.2

  reply	other threads:[~2007-10-25  9:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25  9:15 [PATCH 01/30] iwlwifi: fix various spelling and typos Zhu Yi
2007-10-25  9:15 ` [PATCH 02/30] iwlwifi: rename iwl_eeprom_aqcuire_semaphore to _acquire_ Zhu Yi
2007-10-25  9:15   ` [PATCH 03/30] iwlwifi: renaming last_used and first_empty Zhu Yi
2007-10-25  9:15     ` [PATCH 04/30] iwlwifi: rs-4965 fix return values Zhu Yi
2007-10-25  9:15       ` [PATCH 05/30] iwlwifi: add TGN flag to qos parameters Zhu Yi
2007-10-25  9:15         ` [PATCH 06/30] iwlwifi: remove cck_flag from iwl_driver_hw_info Zhu Yi
2007-10-25  9:15           ` [PATCH 07/30] iwlwifi: Two comments in iwl-3945.c were longer than 80 columns Zhu Yi
2007-10-25  9:15             ` [PATCH 08/30] iwlwifi: Beautify by removing superfluous newlines and code Zhu Yi
2007-10-25  9:15               ` [PATCH 09/30] iwlwifi: remove late null-check and duplicate bug_on Zhu Yi
2007-10-25  9:15                 ` [PATCH 10/30] iwlwifi: remove cck_power_index_compensation Zhu Yi
2007-10-25  9:15                   ` [PATCH 11/30] iwlwifi: using PCI_DEVICE macro Zhu Yi
2007-10-25  9:15                     ` [PATCH 12/30] iwlwifi: fix sending probe request in iwl 4965 Zhu Yi
2007-10-25  9:15                       ` [PATCH 13/30] iwlwifi: accept up to 4K frame size on Rx side to fit A-MSDU frame Zhu Yi
2007-10-25  9:15                         ` [PATCH 14/30] iwlwifi: replace restricted_reg with prph Zhu Yi
2007-10-25  9:15                           ` [PATCH 15/30] iwlwifi: rename restricted_mem to targ_mem Zhu Yi
2007-10-25  9:15                             ` [PATCH 16/30] iwlwifi: replacing wording restricted to nic access in iwl-io Zhu Yi
2007-10-25  9:15                               ` [PATCH 17/30] iwlwifi-ht: move 4965 SCD registers to iwl-prph.h Zhu Yi
2007-10-25  9:15                                 ` [PATCH 18/30] iwlwifi: move 3945 " Zhu Yi
2007-10-25  9:15                                   ` [PATCH 19/30] iwlwifi: add 5965 " Zhu Yi
2007-10-25  9:15                                     ` [PATCH 20/30] iwlwifi: Renames struct fw_image_desc to struct fw_desc Zhu Yi
2007-10-25  9:15                                       ` [PATCH 21/30] iwl4965: exclude 60M rate from probe request Zhu Yi
2007-10-25  9:15                                         ` [PATCH 22/30] iwl4965: fix driver hang related to hardware scan Zhu Yi
2007-10-25  9:15                                           ` [PATCH 23/30] iwlwifi: Update iwlwifi version stamp to 1.1.18 Zhu Yi
2007-10-25  9:15                                             ` Zhu Yi [this message]
2007-10-25  9:15                                               ` [PATCH 25/30] iwl3945: cancel scan on rxon command Zhu Yi
2007-10-25  9:15                                                 ` [PATCH 26/30] iwl3945: fix direct scan problem Zhu Yi
2007-10-25  9:15                                                   ` [PATCH 27/30] iwlwifi: Update iwlwifi version stamp to 1.1.19 Zhu Yi
2007-10-25  9:15                                                     ` [PATCH 28/30] iwlwifi: mark more functions/variables static Zhu Yi
     [not found]                                                       ` <11933037931724-git-send-email-yi.zhu@intel.com>
2007-10-25  9:15                                                         ` [PATCH 30/30] iwlwifi: cleanup Kconfig and ifdefs to split 3945 and 4965 Zhu Yi
2007-10-25  9:32                     ` [PATCH 11/30] iwlwifi: using PCI_DEVICE macro Jeff Garzik
2007-10-25 10:44                       ` Holger Schurig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11933037863641-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mabbas@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).