aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
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 /drivers/net/wireless/iwlwifi/iwl-agn.c
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c26
1 files changed, 22 insertions, 4 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);