iwlwifi: move rxon associated command to hcmd
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 15 Apr 2008 23:01:43 +0000 (16:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 20:00:00 +0000 (16:00 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl4965-base.c

index 9fa803ad9cf7cbd369d0c43fa3b8401e763aaef4..2e747129f6b012ebd1b4b91e19eb131ce50a5e29 100644 (file)
@@ -2884,6 +2884,46 @@ out:
        return ret;
 }
 
+static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
+{
+       int ret = 0;
+       struct iwl4965_rxon_assoc_cmd rxon_assoc;
+       const struct iwl4965_rxon_cmd *rxon1 = &priv->staging_rxon;
+       const struct iwl4965_rxon_cmd *rxon2 = &priv->active_rxon;
+
+       if ((rxon1->flags == rxon2->flags) &&
+           (rxon1->filter_flags == rxon2->filter_flags) &&
+           (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
+           (rxon1->ofdm_ht_single_stream_basic_rates ==
+            rxon2->ofdm_ht_single_stream_basic_rates) &&
+           (rxon1->ofdm_ht_dual_stream_basic_rates ==
+            rxon2->ofdm_ht_dual_stream_basic_rates) &&
+           (rxon1->rx_chain == rxon2->rx_chain) &&
+           (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
+               IWL_DEBUG_INFO("Using current RXON_ASSOC.  Not resending.\n");
+               return 0;
+       }
+
+       rxon_assoc.flags = priv->staging_rxon.flags;
+       rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
+       rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
+       rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
+       rxon_assoc.reserved = 0;
+       rxon_assoc.ofdm_ht_single_stream_basic_rates =
+           priv->staging_rxon.ofdm_ht_single_stream_basic_rates;
+       rxon_assoc.ofdm_ht_dual_stream_basic_rates =
+           priv->staging_rxon.ofdm_ht_dual_stream_basic_rates;
+       rxon_assoc.rx_chain_select_flags = priv->staging_rxon.rx_chain;
+
+       ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC,
+                                    sizeof(rxon_assoc), &rxon_assoc, NULL);
+       if (ret)
+               return ret;
+
+       return ret;
+}
+
+
 int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
 {
        int rc;
@@ -4907,6 +4947,7 @@ void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv)
 
 
 static struct iwl_hcmd_ops iwl4965_hcmd = {
+       .rxon_assoc = iwl4965_send_rxon_assoc,
 };
 
 static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
index 88d62462ed4a412de9586902703ea0c6c141f123..2dfd982d7d1f6977c6de528ea11fbc31ab365fd3 100644 (file)
@@ -289,3 +289,4 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags)
        return iwl_send_cmd(priv, &cmd);
 }
 EXPORT_SYMBOL(iwl_send_statistics_request);
+
index 64bab66d05d83cf44f81f6dd5e70e121a47df0a1..e22563ad352d861a27bf97e49b5e3050f676731a 100644 (file)
@@ -83,6 +83,7 @@ struct iwl_cmd;
 #define IWL_SKU_N       0x8
 
 struct iwl_hcmd_ops {
+       int (*rxon_assoc)(struct iwl_priv *priv);
 };
 struct iwl_hcmd_utils_ops {
        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,
 extern int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags);
 int iwl_send_lq_cmd(struct iwl_priv *priv,
                    struct iwl_link_quality_cmd *lq, u8 flags);
+
+static inline int iwl_send_rxon_assoc(struct iwl_priv *priv)
+{
+       return priv->cfg->ops->hcmd->rxon_assoc(priv);
+}
+
 #endif /* __iwl_core_h__ */
index 249af4156c1321a3de51715dcdcfaa4e22d438b6..745b462103bd82814c968e5e4b28cd6a60168e5d 100644 (file)
@@ -749,45 +749,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv)
        return 0;
 }
 
-static int iwl4965_send_rxon_assoc(struct iwl_priv *priv)
-{
-       int ret = 0;
-       struct iwl4965_rxon_assoc_cmd rxon_assoc;
-       const struct iwl4965_rxon_cmd *rxon1 = &priv->staging_rxon;
-       const struct iwl4965_rxon_cmd *rxon2 = &priv->active_rxon;
-
-       if ((rxon1->flags == rxon2->flags) &&
-           (rxon1->filter_flags == rxon2->filter_flags) &&
-           (rxon1->cck_basic_rates == rxon2->cck_basic_rates) &&
-           (rxon1->ofdm_ht_single_stream_basic_rates ==
-            rxon2->ofdm_ht_single_stream_basic_rates) &&
-           (rxon1->ofdm_ht_dual_stream_basic_rates ==
-            rxon2->ofdm_ht_dual_stream_basic_rates) &&
-           (rxon1->rx_chain == rxon2->rx_chain) &&
-           (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) {
-               IWL_DEBUG_INFO("Using current RXON_ASSOC.  Not resending.\n");
-               return 0;
-       }
-
-       rxon_assoc.flags = priv->staging_rxon.flags;
-       rxon_assoc.filter_flags = priv->staging_rxon.filter_flags;
-       rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates;
-       rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates;
-       rxon_assoc.reserved = 0;
-       rxon_assoc.ofdm_ht_single_stream_basic_rates =
-           priv->staging_rxon.ofdm_ht_single_stream_basic_rates;
-       rxon_assoc.ofdm_ht_dual_stream_basic_rates =
-           priv->staging_rxon.ofdm_ht_dual_stream_basic_rates;
-       rxon_assoc.rx_chain_select_flags = priv->staging_rxon.rx_chain;
-
-       ret = iwl_send_cmd_pdu_async(priv, REPLY_RXON_ASSOC,
-                                    sizeof(rxon_assoc), &rxon_assoc, NULL);
-       if (ret)
-               return ret;
-
-       return ret;
-}
-
 /**
  * iwl4965_commit_rxon - commit staging_rxon to hardware
  *
@@ -819,7 +780,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
         * iwl4965_rxon_assoc_cmd which is used to reconfigure filter
         * and other flags for the current radio configuration. */
        if (!iwl4965_full_rxon_required(priv)) {
-               rc = iwl4965_send_rxon_assoc(priv);
+               rc = iwl_send_rxon_assoc(priv);
                if (rc) {
                        IWL_ERROR("Error setting RXON_ASSOC "
                                  "configuration (%d).\n", rc);
@@ -6756,7 +6717,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
                }
        } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
                        IWL_DEBUG_MAC80211("Associated Changes %d\n", changes);
-                       iwl4965_send_rxon_assoc(priv);
+                       iwl_send_rxon_assoc(priv);
        }
 
 }