Linux wireless drivers development
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Abhijeet Kolekar <abhijeet.kolekar@intel.com>,
	Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 01/39] iwlwifi : Added bss_info_changed callback to 3945
Date: Wed,  3 Sep 2008 11:26:21 +0800	[thread overview]
Message-ID: <1220412419-15404-2-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <1220412419-15404-1-git-send-email-yi.zhu@intel.com>

From: Abhijeet Kolekar <abhijeet.kolekar@intel.com>

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   74 ++++++++++++++++++++++++--
 1 files changed, 68 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a622fc3..6d27264 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6320,11 +6320,8 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data)
 
 #define IWL_DELAY_NEXT_SCAN (HZ*2)
 
-static void iwl3945_bg_post_associate(struct work_struct *data)
+static void iwl3945_post_associate(struct iwl3945_priv *priv)
 {
-	struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv,
-					     post_associate.work);
-
 	int rc = 0;
 	struct ieee80211_conf *conf = NULL;
 	DECLARE_MAC_BUF(mac);
@@ -6342,8 +6339,6 @@ static void iwl3945_bg_post_associate(struct work_struct *data)
 	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
 		return;
 
-	mutex_lock(&priv->mutex);
-
 	if (!priv->vif || !priv->is_open) {
 		mutex_unlock(&priv->mutex);
 		return;
@@ -6419,6 +6414,15 @@ static void iwl3945_bg_post_associate(struct work_struct *data)
 
 	/* we have just associated, don't start scan too early */
 	priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN;
+}
+
+static void iwl3945_bg_post_associate(struct work_struct *data)
+{
+	struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv,
+					     post_associate.work);
+
+	mutex_lock(&priv->mutex);
+	iwl3945_post_associate(priv);
 	mutex_unlock(&priv->mutex);
 }
 
@@ -6948,6 +6952,63 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
 	IWL_DEBUG_MAC80211("leave\n");
 }
 
+#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
+
+static void iwl3945_bss_info_changed(struct ieee80211_hw *hw,
+				     struct ieee80211_vif *vif,
+				     struct ieee80211_bss_conf *bss_conf,
+				     u32 changes)
+{
+	struct iwl3945_priv *priv = hw->priv;
+
+	IWL_DEBUG_MAC80211("changes = 0x%X\n", changes);
+
+	if (changes & BSS_CHANGED_ERP_PREAMBLE) {
+		IWL_DEBUG_MAC80211("ERP_PREAMBLE %d\n",
+				   bss_conf->use_short_preamble);
+		if (bss_conf->use_short_preamble)
+			priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
+		else
+			priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
+	}
+
+	if (changes & BSS_CHANGED_ERP_CTS_PROT) {
+		IWL_DEBUG_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot);
+		if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
+			priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
+		else
+			priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
+	}
+
+	if (changes & BSS_CHANGED_ASSOC) {
+		IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc);
+		/* This should never happen as this function should
+		 * never be called from interrupt context. */
+		if (WARN_ON_ONCE(in_interrupt()))
+			return;
+		if (bss_conf->assoc) {
+			priv->assoc_id = bss_conf->aid;
+			priv->beacon_int = bss_conf->beacon_int;
+			priv->timestamp0 = bss_conf->timestamp & 0xFFFFFFFF;
+			priv->timestamp1 = (bss_conf->timestamp >> 32) &
+					     0xFFFFFFFF;
+			priv->assoc_capability = bss_conf->assoc_capability;
+			priv->next_scan_jiffies = jiffies +
+					IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
+			mutex_lock(&priv->mutex);
+			iwl3945_post_associate(priv);
+			mutex_unlock(&priv->mutex);
+		} else {
+			priv->assoc_id = 0;
+			IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc);
+		}
+	} else if (changes && iwl3945_is_associated(priv) && priv->assoc_id) {
+			IWL_DEBUG_MAC80211("Associated Changes %d\n", changes);
+			iwl3945_send_rxon_assoc(priv);
+	}
+
+}
+
 static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
 {
 	int rc = 0;
@@ -7828,6 +7889,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
 	.conf_tx = iwl3945_mac_conf_tx,
 	.get_tsf = iwl3945_mac_get_tsf,
 	.reset_tsf = iwl3945_mac_reset_tsf,
+	.bss_info_changed = iwl3945_bss_info_changed,
 	.hw_scan = iwl3945_mac_hw_scan
 };
 
-- 
1.5.3.6


  reply	other threads:[~2008-09-03  3:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03  3:26 [PATCH 00/39] iwlwifi driver 09/03 updates Zhu Yi
2008-09-03  3:26 ` Zhu Yi [this message]
2008-09-03  3:26   ` [PATCH 02/39] iwlwifi: W/A for the TSF correction in IBSS Zhu Yi
2008-09-03  3:26     ` [PATCH 03/39] iwlwifi: clean up hw scan handler Zhu Yi
2008-09-03  3:26       ` [PATCH 04/39] iwlwifi: remove obsolete 4965 forward declarations Zhu Yi
2008-09-03  3:26         ` [PATCH 05/39] iwlwifi: allow consecutive scans in unassociated state Zhu Yi
2008-09-03  3:26           ` [PATCH 06/39] iwlwifi: align set channel with mac80211 Zhu Yi
2008-09-03  3:26             ` [PATCH 07/39] iwl3945: fix unbalanced mutex Zhu Yi
2008-09-03  3:26               ` [PATCH 08/39] iwl3945: replace association and beacon hooks with bss_info_changed cb Zhu Yi
2008-09-03  3:26                 ` [PATCH 09/39] iwlwifi: fix hidden ssid discovery in passive channels Zhu Yi
2008-09-03  3:26                   ` [PATCH 10/39] iwl3945: removed bg_post_associate work Zhu Yi
2008-09-03  3:26                     ` [PATCH 11/39] iwl3945: avoid redundant iwl3945_get_active_dwell_time Zhu Yi
2008-09-03  3:26                       ` [PATCH 12/39] iwlwifi: use strict_strtoul instead of simple_strtoul Zhu Yi
2008-09-03  3:26                         ` [PATCH 13/39] iwlwifi: void full rxon on rx chain changes Zhu Yi
2008-09-03  3:26                           ` [PATCH 14/39] iwlwifi: replace readl and writel with io/read/write/32 Zhu Yi
2008-09-03  3:26                             ` [PATCH 15/39] iwlwifi: remove rfkill warning from iwl-io Zhu Yi
2008-09-03  3:26                               ` [PATCH 16/39] iwlwifi: fix apm_stop function Zhu Yi
2008-09-03  3:26                                 ` [PATCH 17/39] iwlwifi: generic init calibrations framework Zhu Yi
2008-09-03  3:26                                   ` [PATCH 18/39] iwlwifi: call apm stop on exit Zhu Yi
2008-09-03  3:26                                     ` [PATCH 19/39] iwlwifi: fix strict_strtoul error checking Zhu Yi
2008-09-03  3:26                                       ` [PATCH 20/39] iwlwifi: use station's mimo power save values Zhu Yi
2008-09-03  3:26                                         ` [PATCH 21/39] iwlwifi: fix rx_chain computation Zhu Yi
2008-09-03  3:26                                           ` [PATCH 22/39] iwlwifi: fix 64bit platform firmware loading Zhu Yi
2008-09-03  3:26                                             ` [PATCH 23/39] mac80211: change MIMO_PS to SM_PS Zhu Yi
2008-09-03  3:26                                               ` [PATCH 24/39] iwlwifi: " Zhu Yi
2008-09-03  3:26                                                 ` [PATCH 25/39] ath9k: " Zhu Yi
2008-09-03  3:26                                                   ` [PATCH 26/39] iwlwifi: remove double definition of SM PS Zhu Yi
2008-09-03  3:26                                                     ` [PATCH 27/39] iwlwifi: rename ps_mode to sm_ps Zhu Yi
2008-09-03  3:26                                                       ` [PATCH 28/39] iwlwifi: workaround interrupt handling no some platforms Zhu Yi
2008-09-03  3:26                                                         ` [PATCH 29/39] iwlwifi: cleanup PCI register handling Zhu Yi
2008-09-03  3:26                                                           ` [PATCH 30/39] iwlwifi: allow association on radar channel in power save Zhu Yi
2008-09-03  3:26                                                             ` [PATCH 31/39] iwlwifi: fix memory allocation of TX command Zhu Yi
2008-09-03  3:26                                                               ` [PATCH 32/39] iwlwifi: fix host command header according the HW spec Zhu Yi
2008-09-03  3:26                                                                 ` [PATCH 33/39] iwlwifi: use the results from disconnected antenna algorithm Zhu Yi
2008-09-03  3:26                                                                   ` [PATCH 34/39] iwlwifi: take a fresh set of supported rates at each cycle Zhu Yi
2008-09-03  3:26                                                                     ` [PATCH 35/39] iwlwifi: remove bad language from the comments Zhu Yi
2008-09-03  3:26                                                                       ` [PATCH 36/39] iwlwifi: remove uneeded declarations Zhu Yi
2008-09-03  3:26                                                                         ` [PATCH 37/39] iwlwifi: fix compile warning Zhu Yi
2008-09-03  3:26                                                                           ` [PATCH 38/39] iwl3945: enable active scanning on active channels Zhu Yi
2008-09-03  3:26                                                                             ` [PATCH 39/39] iwlwifi: enable packet injection for iwlagn Zhu Yi
2008-09-03 14:28                                                               ` [PATCH 31/39] iwlwifi: fix memory allocation of TX command Tomas Winkler
2008-09-05 21:14                 ` [PATCH 08/39] iwl3945: replace association and beacon hooks with bss_info_changed cb Johannes Berg
2008-09-05 22:50                   ` Kolekar, Abhijeet

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=1220412419-15404-2-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=abhijeet.kolekar@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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