aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-04-15 19:01:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-16 16:00:00 -0400
commit7e8c519ecbd44cbe017f1749eb1f0f87d86d6ea2 (patch)
treed38d4391d34e817fa958d132a627bff706bf4b9b
parent3c424c281a9887733ab936477c327cdb2a7ae367 (diff)
iwlwifi: move rxon associated command to hcmd
This patch run rxon associated command from hcmd handler Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c41
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c43
4 files changed, 51 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 9fa803ad9cf7..2e747129f6b0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2884,6 +2884,46 @@ out:
2884 return ret; 2884 return ret;
2885} 2885}
2886 2886
2887static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
2888{
2889 int ret = 0;
2890 struct iwl4965_rxon_assoc_cmd rxon_assoc;
2891 const struct iwl4965_rxon_cmd *rxon1 = &priv->staging_rxon;
2892 const struct iwl4965_rxon_cmd *rxon2 = &priv->active_rxon;
2893
2894 if ((rxon1->flags == rxon2->flags) &&
2895 (rxon1->filter_flags == rxon2->filter_flags) &&
2896 (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
2897 (rxon1->ofdm_ht_single_stream_basic_rates ==
2898 rxon2->ofdm_ht_single_stream_basic_rates) &&
2899 (rxon1->ofdm_ht_dual_stream_basic_rates ==
2900 rxon2->ofdm_ht_dual_stream_basic_rates) &&
2901 (rxon1->rx_chain == rxon2->rx_chain) &&
2902 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
2903 IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n");
2904 return 0;
2905 }
2906
2907 rxon_assoc.flags = priv->staging_rxon.flags;
2908 rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
2909 rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
2910 rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
2911 rxon_assoc.reserved = 0;
2912 rxon_assoc.ofdm_ht_single_stream_basic_rates =
2913 priv->staging_rxon.ofdm_ht_single_stream_basic_rates;
2914 rxon_assoc.ofdm_ht_dual_stream_basic_rates =
2915 priv->staging_rxon.ofdm_ht_dual_stream_basic_rates;
2916 rxon_assoc.rx_chain_select_flags = priv->staging_rxon.rx_chain;
2917
2918 ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC,
2919 sizeof(rxon_assoc), &rxon_assoc, NULL);
2920 if (ret)
2921 return ret;
2922
2923 return ret;
2924}
2925
2926
2887int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel) 2927int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
2888{ 2928{
2889 int rc; 2929 int rc;
@@ -4907,6 +4947,7 @@ void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv)
4907 4947
4908 4948
4909static struct iwl_hcmd_ops iwl4965_hcmd = { 4949static struct iwl_hcmd_ops iwl4965_hcmd = {
4950 .rxon_assoc = iwl4965_send_rxon_assoc,
4910}; 4951};
4911 4952
4912static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { 4953static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 88d62462ed4a..2dfd982d7d1f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -289,3 +289,4 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags)
289 return iwl_send_cmd(priv, &cmd); 289 return iwl_send_cmd(priv, &cmd);
290} 290}
291EXPORT_SYMBOL(iwl_send_statistics_request); 291EXPORT_SYMBOL(iwl_send_statistics_request);
292
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 64bab66d05d8..e22563ad352d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -83,6 +83,7 @@ struct iwl_cmd;
83#define IWL_SKU_N 0x8 83#define IWL_SKU_N 0x8
84 84
85struct iwl_hcmd_ops { 85struct iwl_hcmd_ops {
86 int (*rxon_assoc)(struct iwl_priv *priv);
86}; 87};
87struct iwl_hcmd_utils_ops { 88struct iwl_hcmd_utils_ops {
88 int (*enqueue_hcmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd); 89 int (*enqueue_hcmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
@@ -236,4 +237,10 @@ int iwlcore_low_level_notify(struct iwl_priv *priv,
236extern int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags); 237extern int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags);
237int iwl_send_lq_cmd(struct iwl_priv *priv, 238int iwl_send_lq_cmd(struct iwl_priv *priv,
238 struct iwl_link_quality_cmd *lq, u8 flags); 239 struct iwl_link_quality_cmd *lq, u8 flags);
240
241static inline int iwl_send_rxon_assoc(struct iwl_priv *priv)
242{
243 return priv->cfg->ops->hcmd->rxon_assoc(priv);
244}
245
239#endif /* __iwl_core_h__ */ 246#endif /* __iwl_core_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 249af4156c13..745b462103bd 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -749,45 +749,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv)
749 return 0; 749 return 0;
750} 750}
751 751
752static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
753{
754 int ret = 0;
755 struct iwl4965_rxon_assoc_cmd rxon_assoc;
756 const struct iwl4965_rxon_cmd *rxon1 = &priv->staging_rxon;
757 const struct iwl4965_rxon_cmd *rxon2 = &priv->active_rxon;
758
759 if ((rxon1->flags == rxon2->flags) &&
760 (rxon1->filter_flags == rxon2->filter_flags) &&
761 (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
762 (rxon1->ofdm_ht_single_stream_basic_rates ==
763 rxon2->ofdm_ht_single_stream_basic_rates) &&
764 (rxon1->ofdm_ht_dual_stream_basic_rates ==
765 rxon2->ofdm_ht_dual_stream_basic_rates) &&
766 (rxon1->rx_chain == rxon2->rx_chain) &&
767 (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
768 IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n");
769 return 0;
770 }
771
772 rxon_assoc.flags = priv->staging_rxon.flags;
773 rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
774 rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
775 rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
776 rxon_assoc.reserved = 0;
777 rxon_assoc.ofdm_ht_single_stream_basic_rates =
778 priv->staging_rxon.ofdm_ht_single_stream_basic_rates;
779 rxon_assoc.ofdm_ht_dual_stream_basic_rates =
780 priv->staging_rxon.ofdm_ht_dual_stream_basic_rates;
781 rxon_assoc.rx_chain_select_flags = priv->staging_rxon.rx_chain;
782
783 ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC,
784 sizeof(rxon_assoc), &rxon_assoc, NULL);
785 if (ret)
786 return ret;
787
788 return ret;
789}
790
791/** 752/**
792 * iwl4965_commit_rxon - commit staging_rxon to hardware 753 * iwl4965_commit_rxon - commit staging_rxon to hardware
793 * 754 *
@@ -819,7 +780,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
819 * iwl4965_rxon_assoc_cmd which is used to reconfigure filter 780 * iwl4965_rxon_assoc_cmd which is used to reconfigure filter
820 * and other flags for the current radio configuration. */ 781 * and other flags for the current radio configuration. */
821 if (!iwl4965_full_rxon_required(priv)) { 782 if (!iwl4965_full_rxon_required(priv)) {
822 rc = iwl4965_send_rxon_assoc(priv); 783 rc = iwl_send_rxon_assoc(priv);
823 if (rc) { 784 if (rc) {
824 IWL_ERROR("Error setting RXON_ASSOC " 785 IWL_ERROR("Error setting RXON_ASSOC "
825 "configuration (%d).\n", rc); 786 "configuration (%d).\n", rc);
@@ -6756,7 +6717,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
6756 } 6717 }
6757 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) { 6718 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
6758 IWL_DEBUG_MAC80211("Associated Changes %d\n", changes); 6719 IWL_DEBUG_MAC80211("Associated Changes %d\n", changes);
6759 iwl4965_send_rxon_assoc(priv); 6720 iwl_send_rxon_assoc(priv);
6760 } 6721 }
6761 6722
6762} 6723}