aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 04:46:37 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-27 12:11:49 -0400
commit8f2d3d2ae17855e396483724f152f223e6f01bfe (patch)
treeedaf836cba8426be3d93426beccc94848ccbfb42 /drivers/net/wireless
parentdcef732c72fbe960de5069d3921bb6ce6847be58 (diff)
iwlwifi: contextify command sending
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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
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 3e5069943dde..2d4cdb027aa6 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,
77 ctx->staging.ofdm_ht_triple_stream_basic_rates; 77 ctx->staging.ofdm_ht_triple_stream_basic_rates;
78 rxon_assoc.acquisition_data = ctx->staging.acquisition_data; 78 rxon_assoc.acquisition_data = ctx->staging.acquisition_data;
79 79
80 ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC, 80 ret = iwl_send_cmd_pdu_async(priv, ctx->rxon_assoc_cmd,
81 sizeof(rxon_assoc), &rxon_assoc, NULL); 81 sizeof(rxon_assoc), &rxon_assoc, NULL);
82 if (ret) 82 if (ret)
83 return ret; 83 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 23db6c3e9aee..d3714f076a0c 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)
152 IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n"); 152 IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n");
153 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 153 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
154 154
155 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 155 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
156 sizeof(struct iwl_rxon_cmd), 156 sizeof(struct iwl_rxon_cmd),
157 active_rxon); 157 active_rxon);
158 158
@@ -187,7 +187,7 @@ int iwl_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
187 * stations is needed after it (the RXON command) completes 187 * stations is needed after it (the RXON command) completes
188 */ 188 */
189 if (!new_assoc) { 189 if (!new_assoc) {
190 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 190 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
191 sizeof(struct iwl_rxon_cmd), &ctx->staging); 191 sizeof(struct iwl_rxon_cmd), &ctx->staging);
192 if (ret) { 192 if (ret) {
193 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); 193 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)
209 /* Apply the new configuration 209 /* Apply the new configuration
210 * RXON assoc doesn't clear the station table in uCode, 210 * RXON assoc doesn't clear the station table in uCode,
211 */ 211 */
212 ret = iwl_send_cmd_pdu(priv, REPLY_RXON, 212 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd,
213 sizeof(struct iwl_rxon_cmd), &ctx->staging); 213 sizeof(struct iwl_rxon_cmd), &ctx->staging);
214 if (ret) { 214 if (ret) {
215 IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); 215 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)
3244 3244
3245 ret = iwl_send_rxon_timing(priv, vif); 3245 ret = iwl_send_rxon_timing(priv, vif);
3246 if (ret) 3246 if (ret)
3247 IWL_WARN(priv, "REPLY_RXON_TIMING failed - " 3247 IWL_WARN(priv, "RXON timing - "
3248 "Attempting to continue.\n"); 3248 "Attempting to continue.\n");
3249 3249
3250 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; 3250 ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK;
@@ -3481,7 +3481,7 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3481 /* RXON Timing */ 3481 /* RXON Timing */
3482 ret = iwl_send_rxon_timing(priv, vif); 3482 ret = iwl_send_rxon_timing(priv, vif);
3483 if (ret) 3483 if (ret)
3484 IWL_WARN(priv, "REPLY_RXON_TIMING failed - " 3484 IWL_WARN(priv, "RXON timing failed - "
3485 "Attempting to continue.\n"); 3485 "Attempting to continue.\n");
3486 3486
3487 /* AP has all antennas */ 3487 /* AP has all antennas */
@@ -4200,6 +4200,11 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4200 for (i = 0; i < NUM_IWL_RXON_CTX; i++) 4200 for (i = 0; i < NUM_IWL_RXON_CTX; i++)
4201 priv->contexts[i].ctxid = i; 4201 priv->contexts[i].ctxid = i;
4202 4202
4203 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
4204 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
4205 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
4206 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1);
4207
4203 SET_IEEE80211_DEV(hw, &pdev->dev); 4208 SET_IEEE80211_DEV(hw, &pdev->dev);
4204 4209
4205 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); 4210 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 f7bfe59c0ca8..a145d17cd943 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)
545 le32_to_cpu(ctx->timing.beacon_init_val), 545 le32_to_cpu(ctx->timing.beacon_init_val),
546 le16_to_cpu(ctx->timing.atim_window)); 546 le16_to_cpu(ctx->timing.atim_window));
547 547
548 return iwl_send_cmd_pdu(priv, REPLY_RXON_TIMING, 548 return iwl_send_cmd_pdu(priv, ctx->rxon_timing_cmd,
549 sizeof(ctx->timing), &ctx->timing); 549 sizeof(ctx->timing), &ctx->timing);
550} 550}
551EXPORT_SYMBOL(iwl_send_rxon_timing); 551EXPORT_SYMBOL(iwl_send_rxon_timing);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index da54bd53c99d..6a7e9ff4a88c 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 {
1126 struct iwl_rxon_time_cmd timing; 1126 struct iwl_rxon_time_cmd timing;
1127 1127
1128 u8 bcast_sta_id; 1128 u8 bcast_sta_id;
1129
1130 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
1129}; 1131};
1130 1132
1131struct iwl_priv { 1133struct iwl_priv {
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 630b8d641720..4321d970d58d 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
4013 for (i = 0; i < NUM_IWL_RXON_CTX; i++) 4013 for (i = 0; i < NUM_IWL_RXON_CTX; i++)
4014 priv->contexts[i].ctxid = i; 4014 priv->contexts[i].ctxid = i;
4015 4015
4016 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
4017 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
4018 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
4019
4016 /* 4020 /*
4017 * Disabling hardware scan means that mac80211 will perform scans 4021 * Disabling hardware scan means that mac80211 will perform scans
4018 * "the hard way", rather than using device's scan. 4022 * "the hard way", rather than using device's scan.