aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-06-22 09:33:43 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-06-24 14:54:42 -0400
commit0b5b3ff15b301338ccec77ebc051308ac614d05d (patch)
tree87248264498777bf33b08a2c592ce1e88b4bf5fb
parent81704d2db99386d718e277cd5ac92663abec8a66 (diff)
iwlagn: fill beacon TX rate properly
Use the rate that mac80211 requested to fill the uCode TX command for the beacon. Unfortunately, the uCode is (currently?) ignoring it, but now at least fill it properly. 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-agn.c26
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h7
3 files changed, 22 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 77ceb8deff7..e2f6b2ab0d4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -132,6 +132,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
132 struct iwl_host_cmd cmd = { 132 struct iwl_host_cmd cmd = {
133 .id = REPLY_TX_BEACON, 133 .id = REPLY_TX_BEACON,
134 }; 134 };
135 struct ieee80211_tx_info *info;
135 u32 frame_size; 136 u32 frame_size;
136 u32 rate_flags; 137 u32 rate_flags;
137 u32 rate; 138 u32 rate;
@@ -172,14 +173,31 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
172 frame_size); 173 frame_size);
173 174
174 /* Set up packet rate and flags */ 175 /* Set up packet rate and flags */
175 rate = iwl_rate_get_lowest_plcp(priv, priv->beacon_ctx); 176 info = IEEE80211_SKB_CB(priv->beacon_skb);
177
178 /*
179 * Let's set up the rate at least somewhat correctly;
180 * it will currently not actually be used by the uCode,
181 * it uses the broadcast station's rate instead.
182 */
183 if (info->control.rates[0].idx < 0 ||
184 info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
185 rate = 0;
186 else
187 rate = info->control.rates[0].idx;
188
176 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 189 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
177 priv->hw_params.valid_tx_ant); 190 priv->hw_params.valid_tx_ant);
178 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 191 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
179 if ((rate >= IWL_FIRST_CCK_RATE) && (rate <= IWL_LAST_CCK_RATE)) 192
193 /* In mac80211, rates for 5 GHz start at 0 */
194 if (info->band == IEEE80211_BAND_5GHZ)
195 rate += IWL_FIRST_OFDM_RATE;
196 else if (rate >= IWL_FIRST_CCK_RATE && rate <= IWL_LAST_CCK_RATE)
180 rate_flags |= RATE_MCS_CCK_MSK; 197 rate_flags |= RATE_MCS_CCK_MSK;
181 tx_beacon_cmd->tx.rate_n_flags = iwl_hw_set_rate_n_flags(rate, 198
182 rate_flags); 199 tx_beacon_cmd->tx.rate_n_flags =
200 iwl_hw_set_rate_n_flags(rate, rate_flags);
183 201
184 /* Submit command */ 202 /* Submit command */
185 cmd.len[0] = sizeof(*tx_beacon_cmd); 203 cmd.len[0] = sizeof(*tx_beacon_cmd);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index cde725326c3..f0eabbc07c9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -526,19 +526,6 @@ int iwl_full_rxon_required(struct iwl_priv *priv,
526 return 0; 526 return 0;
527} 527}
528 528
529u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv,
530 struct iwl_rxon_context *ctx)
531{
532 /*
533 * Assign the lowest rate -- should really get this from
534 * the beacon skb from mac80211.
535 */
536 if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK)
537 return IWL_RATE_1M_PLCP;
538 else
539 return IWL_RATE_6M_PLCP;
540}
541
542static void _iwl_set_rxon_ht(struct iwl_priv *priv, 529static void _iwl_set_rxon_ht(struct iwl_priv *priv,
543 struct iwl_ht_config *ht_conf, 530 struct iwl_ht_config *ht_conf,
544 struct iwl_rxon_context *ctx) 531 struct iwl_rxon_context *ctx)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index adf9f9b2efb..f881678be76 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -409,13 +409,6 @@ void iwl_setup_watchdog(struct iwl_priv *priv);
409int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force); 409int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force);
410 410
411/******************************************************************************* 411/*******************************************************************************
412 * Rate
413 ******************************************************************************/
414
415u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv,
416 struct iwl_rxon_context *ctx);
417
418/*******************************************************************************
419 * Scanning 412 * Scanning
420 ******************************************************************************/ 413 ******************************************************************************/
421void iwl_init_scan_params(struct iwl_priv *priv); 414void iwl_init_scan_params(struct iwl_priv *priv);