aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Rindjunsky <ron.rindjunsky@intel.com>2008-05-15 01:53:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:52 -0400
commit39130df32adf8272373c03c8c2499cd2a1b4c5cf (patch)
treed0d93259ac7884c3a1e0695e2449ef7a7f05efc0
parentedcdf8b21ac920e06b4180246123fe43b022e020 (diff)
iwlwifi: filling Tx MCS set
This patch fills the needed data about HW capabilities in matters of possible HT Tx MCS. Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index d3cbad2bf877..a2f4f288375a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -317,24 +317,33 @@ void iwl_reset_qos(struct iwl_priv *priv)
317EXPORT_SYMBOL(iwl_reset_qos); 317EXPORT_SYMBOL(iwl_reset_qos);
318 318
319#ifdef CONFIG_IWL4965_HT 319#ifdef CONFIG_IWL4965_HT
320#define MAX_BIT_RATE_40_MHZ 0x96; /* 150 Mbps */
321#define MAX_BIT_RATE_20_MHZ 0x48; /* 72 Mbps */
320static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, 322static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,
321 struct ieee80211_ht_info *ht_info, 323 struct ieee80211_ht_info *ht_info,
322 enum ieee80211_band band) 324 enum ieee80211_band band)
323{ 325{
326 u16 max_bit_rate = 0;
327 u8 rx_chains_num = priv->hw_params.rx_chains_num;
328 u8 tx_chains_num = priv->hw_params.tx_chains_num;
329
324 ht_info->cap = 0; 330 ht_info->cap = 0;
325 memset(ht_info->supp_mcs_set, 0, 16); 331 memset(ht_info->supp_mcs_set, 0, 16);
326 332
327 ht_info->ht_supported = 1; 333 ht_info->ht_supported = 1;
328 334
335 ht_info->cap |= (u16)IEEE80211_HT_CAP_GRN_FLD;
336 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20;
337 ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS &
338 (IWL_MIMO_PS_NONE << 2));
339
340 max_bit_rate = MAX_BIT_RATE_20_MHZ;
329 if (priv->hw_params.fat_channel & BIT(band)) { 341 if (priv->hw_params.fat_channel & BIT(band)) {
330 ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH; 342 ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH;
331 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40; 343 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40;
332 ht_info->supp_mcs_set[4] = 0x01; 344 ht_info->supp_mcs_set[4] = 0x01;
345 max_bit_rate = MAX_BIT_RATE_40_MHZ;
333 } 346 }
334 ht_info->cap |= (u16)IEEE80211_HT_CAP_GRN_FLD;
335 ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20;
336 ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS &
337 (IWL_MIMO_PS_NONE << 2));
338 347
339 if (priv->cfg->mod_params->amsdu_size_8K) 348 if (priv->cfg->mod_params->amsdu_size_8K)
340 ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU; 349 ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU;
@@ -343,10 +352,22 @@ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,
343 ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF; 352 ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF;
344 353
345 ht_info->supp_mcs_set[0] = 0xFF; 354 ht_info->supp_mcs_set[0] = 0xFF;
346 if (priv->hw_params.tx_chains_num >= 2) 355 if (rx_chains_num >= 2)
347 ht_info->supp_mcs_set[1] = 0xFF; 356 ht_info->supp_mcs_set[1] = 0xFF;
348 if (priv->hw_params.tx_chains_num >= 3) 357 if (rx_chains_num >= 3)
349 ht_info->supp_mcs_set[2] = 0xFF; 358 ht_info->supp_mcs_set[2] = 0xFF;
359
360 /* Highest supported Rx data rate */
361 max_bit_rate *= rx_chains_num;
362 ht_info->supp_mcs_set[10] = (u8)(max_bit_rate & 0x00FF);
363 ht_info->supp_mcs_set[11] = (u8)((max_bit_rate & 0xFF00) >> 8);
364
365 /* Tx MCS capabilities */
366 ht_info->supp_mcs_set[12] = IEEE80211_HT_CAP_MCS_TX_DEFINED;
367 if (tx_chains_num != rx_chains_num) {
368 ht_info->supp_mcs_set[12] |= IEEE80211_HT_CAP_MCS_TX_RX_DIFF;
369 ht_info->supp_mcs_set[12] |= ((tx_chains_num - 1) << 2);
370 }
350} 371}
351#else 372#else
352static inline void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, 373static inline void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,