提交 7e8c519e 编写于 作者: T Tomas Winkler 提交者: John W. Linville

iwlwifi: move rxon associated command to hcmd

This patch run rxon associated command from hcmd handler
Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 3c424c28
...@@ -2884,6 +2884,46 @@ int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv) ...@@ -2884,6 +2884,46 @@ int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv)
return ret; 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 iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel)
{ {
int rc; int rc;
...@@ -4907,6 +4947,7 @@ void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv) ...@@ -4907,6 +4947,7 @@ void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv)
static struct iwl_hcmd_ops iwl4965_hcmd = { static struct iwl_hcmd_ops iwl4965_hcmd = {
.rxon_assoc = iwl4965_send_rxon_assoc,
}; };
static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
......
...@@ -289,3 +289,4 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags) ...@@ -289,3 +289,4 @@ int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags)
return iwl_send_cmd(priv, &cmd); return iwl_send_cmd(priv, &cmd);
} }
EXPORT_SYMBOL(iwl_send_statistics_request); EXPORT_SYMBOL(iwl_send_statistics_request);
...@@ -83,6 +83,7 @@ struct iwl_cmd; ...@@ -83,6 +83,7 @@ struct iwl_cmd;
#define IWL_SKU_N 0x8 #define IWL_SKU_N 0x8
struct iwl_hcmd_ops { struct iwl_hcmd_ops {
int (*rxon_assoc)(struct iwl_priv *priv);
}; };
struct iwl_hcmd_utils_ops { struct iwl_hcmd_utils_ops {
int (*enqueue_hcmd)(struct iwl_priv *priv, struct iwl_host_cmd *cmd); 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, ...@@ -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); extern int iwl_send_statistics_request(struct iwl_priv *priv, u8 flags);
int iwl_send_lq_cmd(struct iwl_priv *priv, int iwl_send_lq_cmd(struct iwl_priv *priv,
struct iwl_link_quality_cmd *lq, u8 flags); 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__ */ #endif /* __iwl_core_h__ */
...@@ -749,45 +749,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv) ...@@ -749,45 +749,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv)
return 0; 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 * iwl4965_commit_rxon - commit staging_rxon to hardware
* *
...@@ -819,7 +780,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv) ...@@ -819,7 +780,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
* iwl4965_rxon_assoc_cmd which is used to reconfigure filter * iwl4965_rxon_assoc_cmd which is used to reconfigure filter
* and other flags for the current radio configuration. */ * and other flags for the current radio configuration. */
if (!iwl4965_full_rxon_required(priv)) { if (!iwl4965_full_rxon_required(priv)) {
rc = iwl4965_send_rxon_assoc(priv); rc = iwl_send_rxon_assoc(priv);
if (rc) { if (rc) {
IWL_ERROR("Error setting RXON_ASSOC " IWL_ERROR("Error setting RXON_ASSOC "
"configuration (%d).\n", rc); "configuration (%d).\n", rc);
...@@ -6756,7 +6717,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, ...@@ -6756,7 +6717,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
} }
} else if (changes && iwl_is_associated(priv) && priv->assoc_id) { } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
IWL_DEBUG_MAC80211("Associated Changes %d\n", changes); IWL_DEBUG_MAC80211("Associated Changes %d\n", changes);
iwl4965_send_rxon_assoc(priv); iwl_send_rxon_assoc(priv);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册