public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Johannes Berg <johannes.berg@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 06/27] iwlwifi: contextify command sending
Date: Fri, 27 Aug 2010 09:59:34 -0700	[thread overview]
Message-ID: <1282928395-32762-7-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1282928395-32762-1-git-send-email-wey-yi.w.guy@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

Some commands will have different command IDs
for different contexts, so we need to store
those IDs in the context structure and use
them instead of hardcoding the commands.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn.c      |   15 ++++++++++-----
 drivers/net/wireless/iwlwifi/iwl-core.c     |    2 +-
 drivers/net/wireless/iwlwifi/iwl-dev.h      |    2 ++
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    4 ++++
 5 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index 3e50699..2d4cdb0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -77,7 +77,7 @@ int iwlagn_send_rxon_assoc(struct iwl_priv *priv,
 		 ctx->staging.ofdm_ht_triple_stream_basic_rates;
 	rxon_assoc.acquisition_data = ctx->staging.acquisition_data;
 
-	ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC,
+	ret = iwl_send_cmd_pdu_async(priv, ctx->rxon_assoc_cmd,
 				     sizeof(rxon_assoc), &rxon_assoc, NULL);
 	if (ret)
 		return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 23db6c3..d3714f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -152,7 +152,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 		IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n");
 		active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
 
-		ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
+		ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
 				       sizeof(struct iwl_rxon_cmd),
 				       active_rxon);
 
@@ -187,7 +187,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 	 * stations is needed after it (the RXON command) completes
 	 */
 	if (!new_assoc) {
-		ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
+		ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
 			      sizeof(struct iwl_rxon_cmd), &ctx->staging);
 		if (ret) {
 			IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
@@ -209,7 +209,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
 		/* Apply the new configuration
 		 * RXON assoc doesn't clear the station table in uCode,
 		 */
-		ret = iwl_send_cmd_pdu(priv, REPLY_RXON,
+		ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
 			      sizeof(struct iwl_rxon_cmd), &ctx->staging);
 		if (ret) {
 			IWL_ERR(priv, "Error setting new RXON (%d)\n", ret);
@@ -3244,7 +3244,7 @@ void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif)
 
 	ret = iwl_send_rxon_timing(priv, vif);
 	if (ret)
-		IWL_WARN(priv, "REPLY_RXON_TIMING failed - "
+		IWL_WARN(priv, "RXON timing - "
 			    "Attempting to continue.\n");
 
 	ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
@@ -3481,7 +3481,7 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
 		/* RXON Timing */
 		ret = iwl_send_rxon_timing(priv, vif);
 		if (ret)
-			IWL_WARN(priv, "REPLY_RXON_TIMING failed - "
+			IWL_WARN(priv, "RXON timing failed - "
 					"Attempting to continue.\n");
 
 		/* AP has all antennas */
@@ -4200,6 +4200,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	for (i = 0; i < NUM_IWL_RXON_CTX; i++)
 		priv->contexts[i].ctxid = i;
 
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
+	BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1);
+
 	SET_IEEE80211_DEV(hw, &pdev->dev);
 
 	IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index f7bfe59..a145d17 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -545,7 +545,7 @@ int iwl_send_rxon_timing(struct iwl_priv *priv, struct ieee80211_vif *vif)
 			le32_to_cpu(ctx->timing.beacon_init_val),
 			le16_to_cpu(ctx->timing.atim_window));
 
-	return iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING,
+	return iwl_send_cmd_pdu(priv, ctx->rxon_timing_cmd,
 				sizeof(ctx->timing), &ctx->timing);
 }
 EXPORT_SYMBOL(iwl_send_rxon_timing);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index da54bd5..6a7e9ff 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1126,6 +1126,8 @@ struct iwl_rxon_context {
 	struct iwl_rxon_time_cmd timing;
 
 	u8 bcast_sta_id;
+
+	u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
 };
 
 struct iwl_priv {
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 630b8d6..4321d97 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4013,6 +4013,10 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
 	for (i = 0; i < NUM_IWL_RXON_CTX; i++)
 		priv->contexts[i].ctxid = i;
 
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
+	priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
+
 	/*
 	 * Disabling hardware scan means that mac80211 will perform scans
 	 * "the hard way", rather than using device's scan.
-- 
1.7.0.4


  parent reply	other threads:[~2010-08-27 16:56 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 16:59 [PATCH 00/27] iwlwifi update for 2.6.37 Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 01/27] iwlwifi: initial contextification Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 02/27] iwlwifi: prepare for PAN queue/fifo assignment Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 03/27] iwlwifi: define PAN queues/FIFOs Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 04/27] iwlwifi: contextify broadcast station Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 05/27] iwlwifi: contextify-stations-completely Wey-Yi Guy
2010-08-27 16:59 ` Wey-Yi Guy [this message]
2010-08-27 16:59 ` [PATCH 07/27] iwlwifi: move QoS into context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 08/27] iwlwifi: add context into tx descriptor Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 09/27] iwlwifi: move virtual interface pointer into context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 10/27] iwlwifi: clamp scanning dwell time to all contexts Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 11/27] iwlwifi: move AP sta ID to context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 12/27] iwlwifi: make hw crypto context aware Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 13/27] iwlwifi: store default station flags in context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 14/27] iwlwifi: add context pointer to station Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 15/27] iwlwifi: move HT configuration data into context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 16/27] iwlwifi: introduce beacon context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 17/27] iwlwifi: add PAN API Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 18/27] iwlagn: detect PAN capability Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 19/27] iwlagn: remove iw_mode check for beacon Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 20/27] iwlagn: queue frames according to context Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 21/27] iwlagn: send RXON timing before associating Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 22/27] iwlagn: send beacon before committing associated RXON Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 23/27] iwlwifi: send PAN parameters Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 24/27] iwlwifi: pass context to iwl_send_rxon_timing Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 25/27] iwlagn: always send RXON timing Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 26/27] iwlwifi: follow main beacon interval Wey-Yi Guy
2010-08-27 16:59 ` [PATCH 27/27] iwlwifi: allow using multiple contexts Wey-Yi Guy
2010-08-27 17:41 ` [PATCH 00/27] iwlwifi update for 2.6.37 Maxim Levitsky
2010-08-27 17:44   ` Guy, Wey-Yi
2010-08-30 11:36 ` [ipw3945-devel] " Rafał Miłecki

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=1282928395-32762-7-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=johannes.berg@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