aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-22 12:01:56 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-07 18:49:05 -0400
commita77029ee3fc03a37238b73892e55b789273991aa (patch)
tree0a2047affc7e246962b38e2dab21d7e1fb8a0da9
parent7314c2b377afaf367f2966bd9ea67bf83350e29b (diff)
iwlwifi: introduce post_scan hook
The different drivers need to do different things after a scan, so create a post_scan hook to allow them to do this. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c12
9 files changed, 47 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index cfdff5487e3c..87943a8da797 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2713,6 +2713,7 @@ static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = {
2713 .build_addsta_hcmd = iwl3945_build_addsta_hcmd, 2713 .build_addsta_hcmd = iwl3945_build_addsta_hcmd,
2714 .tx_cmd_protection = iwlcore_tx_cmd_protection, 2714 .tx_cmd_protection = iwlcore_tx_cmd_protection,
2715 .request_scan = iwl3945_request_scan, 2715 .request_scan = iwl3945_request_scan,
2716 .post_scan = iwl3945_post_scan,
2716}; 2717};
2717 2718
2718static const struct iwl_ops iwl3945_ops = { 2719static const struct iwl_ops iwl3945_ops = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 98509c5e708d..7ad4aff5a550 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -296,6 +296,7 @@ extern int iwl3945_rs_next_rate(struct iwl_priv *priv, int rate);
296 296
297/* scanning */ 297/* scanning */
298int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif); 298int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif);
299void iwl3945_post_scan(struct iwl_priv *priv);
299 300
300/* Requires full declaration of iwl_priv before including */ 301/* Requires full declaration of iwl_priv before including */
301#include "iwl-io.h" 302#include "iwl-io.h"
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 09db9407aa54..e161f5d7044d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2221,6 +2221,18 @@ static struct iwl_hcmd_ops iwl4965_hcmd = {
2221 .send_bt_config = iwl_send_bt_config, 2221 .send_bt_config = iwl_send_bt_config,
2222}; 2222};
2223 2223
2224static void iwl4965_post_scan(struct iwl_priv *priv)
2225{
2226 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
2227
2228 /*
2229 * Since setting the RXON may have been deferred while
2230 * performing the scan, fire one off if needed
2231 */
2232 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
2233 iwlcore_commit_rxon(priv, ctx);
2234}
2235
2224static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { 2236static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
2225 .get_hcmd_size = iwl4965_get_hcmd_size, 2237 .get_hcmd_size = iwl4965_get_hcmd_size,
2226 .build_addsta_hcmd = iwl4965_build_addsta_hcmd, 2238 .build_addsta_hcmd = iwl4965_build_addsta_hcmd,
@@ -2229,6 +2241,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
2229 .tx_cmd_protection = iwlcore_tx_cmd_protection, 2241 .tx_cmd_protection = iwlcore_tx_cmd_protection,
2230 .calc_rssi = iwl4965_calc_rssi, 2242 .calc_rssi = iwl4965_calc_rssi,
2231 .request_scan = iwlagn_request_scan, 2243 .request_scan = iwlagn_request_scan,
2244 .post_scan = iwl4965_post_scan,
2232}; 2245};
2233 2246
2234static struct iwl_lib_ops iwl4965_lib = { 2247static struct iwl_lib_ops iwl4965_lib = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index 901452ee623a..634177d827d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -384,4 +384,5 @@ struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = {
384 .tx_cmd_protection = iwlagn_tx_cmd_protection, 384 .tx_cmd_protection = iwlagn_tx_cmd_protection,
385 .calc_rssi = iwlagn_calc_rssi, 385 .calc_rssi = iwlagn_calc_rssi,
386 .request_scan = iwlagn_request_scan, 386 .request_scan = iwlagn_request_scan,
387 .post_scan = iwlagn_post_scan,
387}; 388};
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index f5445d575fec..3fa2c5c3706a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1565,6 +1565,22 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1565 return ret; 1565 return ret;
1566} 1566}
1567 1567
1568void iwlagn_post_scan(struct iwl_priv *priv)
1569{
1570 struct iwl_rxon_context *ctx;
1571
1572 /*
1573 * Since setting the RXON may have been deferred while
1574 * performing the scan, fire one off if needed
1575 */
1576 for_each_context(priv, ctx)
1577 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
1578 iwlagn_commit_rxon(priv, ctx);
1579
1580 if (priv->cfg->ops->hcmd->set_pan_params)
1581 priv->cfg->ops->hcmd->set_pan_params(priv);
1582}
1583
1568int iwlagn_manage_ibss_station(struct iwl_priv *priv, 1584int iwlagn_manage_ibss_station(struct iwl_priv *priv,
1569 struct ieee80211_vif *vif, bool add) 1585 struct ieee80211_vif *vif, bool add)
1570{ 1586{
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 2a1c83bda919..960fe2e5e579 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -227,6 +227,7 @@ void iwl_reply_statistics(struct iwl_priv *priv,
227 227
228/* scan */ 228/* scan */
229int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif); 229int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif);
230void iwlagn_post_scan(struct iwl_priv *priv);
230 231
231/* station mgmt */ 232/* station mgmt */
232int iwlagn_manage_ibss_station(struct iwl_priv *priv, 233int iwlagn_manage_ibss_station(struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index d6d5bb0f0eb0..09908f604e28 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -112,6 +112,7 @@ struct iwl_hcmd_utils_ops {
112 int (*calc_rssi)(struct iwl_priv *priv, 112 int (*calc_rssi)(struct iwl_priv *priv,
113 struct iwl_rx_phy_res *rx_resp); 113 struct iwl_rx_phy_res *rx_resp);
114 int (*request_scan)(struct iwl_priv *priv, struct ieee80211_vif *vif); 114 int (*request_scan)(struct iwl_priv *priv, struct ieee80211_vif *vif);
115 void (*post_scan)(struct iwl_priv *priv);
115}; 116};
116 117
117struct iwl_apm_ops { 118struct iwl_apm_ops {
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index eaae49ee0c60..a7e8c7f969f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -559,7 +559,6 @@ static void iwl_bg_scan_completed(struct work_struct *work)
559 struct iwl_priv *priv = 559 struct iwl_priv *priv =
560 container_of(work, struct iwl_priv, scan_completed); 560 container_of(work, struct iwl_priv, scan_completed);
561 bool aborted; 561 bool aborted;
562 struct iwl_rxon_context *ctx;
563 562
564 IWL_DEBUG_SCAN(priv, "Completed %sscan.\n", 563 IWL_DEBUG_SCAN(priv, "Completed %sscan.\n",
565 priv->is_internal_short_scan ? "internal short " : ""); 564 priv->is_internal_short_scan ? "internal short " : "");
@@ -609,15 +608,7 @@ out_settings:
609 * performing the scan, fire one off */ 608 * performing the scan, fire one off */
610 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); 609 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
611 610
612 /* 611 priv->cfg->ops->utils->post_scan(priv);
613 * Since setting the RXON may have been deferred while
614 * performing the scan, fire one off if needed
615 */
616 for_each_context(priv, ctx)
617 iwlcore_commit_rxon(priv, ctx);
618
619 if (priv->cfg->ops->hcmd->set_pan_params)
620 priv->cfg->ops->hcmd->set_pan_params(priv);
621 612
622 out: 613 out:
623 mutex_unlock(&priv->mutex); 614 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 43db5f38e3e6..db148d05af1a 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2983,6 +2983,18 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
2983 return ret; 2983 return ret;
2984} 2984}
2985 2985
2986void iwl3945_post_scan(struct iwl_priv *priv)
2987{
2988 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
2989
2990 /*
2991 * Since setting the RXON may have been deferred while
2992 * performing the scan, fire one off if needed
2993 */
2994 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
2995 iwlcore_commit_rxon(priv, ctx);
2996}
2997
2986static void iwl3945_bg_restart(struct work_struct *data) 2998static void iwl3945_bg_restart(struct work_struct *data)
2987{ 2999{
2988 struct iwl_priv *priv = container_of(data, struct iwl_priv, restart); 3000 struct iwl_priv *priv = container_of(data, struct iwl_priv, restart);