diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-10-09 06:13:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:06 -0400 |
commit | d9fe60dea7779d412b34679f1177c5ca1940ea8d (patch) | |
tree | a51e16b013f7c1d16ded502cb32c03872bcbfcaa /drivers/net/wireless/iwlwifi | |
parent | 40333e4fb476014cdd939d27e20eb54573172b32 (diff) |
802.11: clean up/fix HT support
This patch cleans up a number of things:
* the unusable definition of the HT capabilities/HT information
information elements
* variable names that are hard to understand
* mac80211: move ieee80211_handle_ht to ht.c and remove the unused
enable_ht parameter
* mac80211: fix bug with MCS rate 32 in ieee80211_handle_ht
* mac80211: fix bug with casting the result of ieee80211_bss_get_ie
to an information element _contents_ rather than the
whole element, add size checking (another out-of-bounds
access bug fixed!)
* mac80211: remove some unused return values in favour of BUG_ON
checking
* a few minor other things
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 71 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 6 |
7 files changed, 67 insertions, 66 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index b497d40dc396..cd1bff590491 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -1134,10 +1134,10 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, | |||
1134 | s8 is_green = lq_sta->is_green; | 1134 | s8 is_green = lq_sta->is_green; |
1135 | 1135 | ||
1136 | if (!(conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) || | 1136 | if (!(conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) || |
1137 | !sta->ht_info.ht_supported) | 1137 | !sta->ht_cap.ht_supported) |
1138 | return -1; | 1138 | return -1; |
1139 | 1139 | ||
1140 | if (((sta->ht_info.cap & IEEE80211_HT_CAP_SM_PS) >> 2) | 1140 | if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) |
1141 | == WLAN_HT_CAP_SM_PS_STATIC) | 1141 | == WLAN_HT_CAP_SM_PS_STATIC) |
1142 | return -1; | 1142 | return -1; |
1143 | 1143 | ||
@@ -1202,7 +1202,7 @@ static int rs_switch_to_siso(struct iwl_priv *priv, | |||
1202 | s32 rate; | 1202 | s32 rate; |
1203 | 1203 | ||
1204 | if (!(conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) || | 1204 | if (!(conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) || |
1205 | !sta->ht_info.ht_supported) | 1205 | !sta->ht_cap.ht_supported) |
1206 | return -1; | 1206 | return -1; |
1207 | 1207 | ||
1208 | IWL_DEBUG_RATE("LQ: try to switch to SISO\n"); | 1208 | IWL_DEBUG_RATE("LQ: try to switch to SISO\n"); |
@@ -2238,19 +2238,19 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband, | |||
2238 | * active_siso_rate mask includes 9 MBits (bit 5), and CCK (bits 0-3), | 2238 | * active_siso_rate mask includes 9 MBits (bit 5), and CCK (bits 0-3), |
2239 | * supp_rates[] does not; shift to convert format, force 9 MBits off. | 2239 | * supp_rates[] does not; shift to convert format, force 9 MBits off. |
2240 | */ | 2240 | */ |
2241 | lq_sta->active_siso_rate = conf->ht_conf.supp_mcs_set[0] << 1; | 2241 | lq_sta->active_siso_rate = conf->ht_cap.mcs.rx_mask[0] << 1; |
2242 | lq_sta->active_siso_rate |= conf->ht_conf.supp_mcs_set[0] & 0x1; | 2242 | lq_sta->active_siso_rate |= conf->ht_cap.mcs.rx_mask[0] & 0x1; |
2243 | lq_sta->active_siso_rate &= ~((u16)0x2); | 2243 | lq_sta->active_siso_rate &= ~((u16)0x2); |
2244 | lq_sta->active_siso_rate <<= IWL_FIRST_OFDM_RATE; | 2244 | lq_sta->active_siso_rate <<= IWL_FIRST_OFDM_RATE; |
2245 | 2245 | ||
2246 | /* Same here */ | 2246 | /* Same here */ |
2247 | lq_sta->active_mimo2_rate = conf->ht_conf.supp_mcs_set[1] << 1; | 2247 | lq_sta->active_mimo2_rate = conf->ht_cap.mcs.rx_mask[1] << 1; |
2248 | lq_sta->active_mimo2_rate |= conf->ht_conf.supp_mcs_set[1] & 0x1; | 2248 | lq_sta->active_mimo2_rate |= conf->ht_cap.mcs.rx_mask[1] & 0x1; |
2249 | lq_sta->active_mimo2_rate &= ~((u16)0x2); | 2249 | lq_sta->active_mimo2_rate &= ~((u16)0x2); |
2250 | lq_sta->active_mimo2_rate <<= IWL_FIRST_OFDM_RATE; | 2250 | lq_sta->active_mimo2_rate <<= IWL_FIRST_OFDM_RATE; |
2251 | 2251 | ||
2252 | lq_sta->active_mimo3_rate = conf->ht_conf.supp_mcs_set[2] << 1; | 2252 | lq_sta->active_mimo3_rate = conf->ht_cap.mcs.rx_mask[2] << 1; |
2253 | lq_sta->active_mimo3_rate |= conf->ht_conf.supp_mcs_set[2] & 0x1; | 2253 | lq_sta->active_mimo3_rate |= conf->ht_cap.mcs.rx_mask[2] & 0x1; |
2254 | lq_sta->active_mimo3_rate &= ~((u16)0x2); | 2254 | lq_sta->active_mimo3_rate &= ~((u16)0x2); |
2255 | lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE; | 2255 | lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE; |
2256 | 2256 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 2cac09405afe..e6695e80fb53 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -552,7 +552,7 @@ static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) | |||
552 | static void iwl4965_ht_conf(struct iwl_priv *priv, | 552 | static void iwl4965_ht_conf(struct iwl_priv *priv, |
553 | struct ieee80211_bss_conf *bss_conf) | 553 | struct ieee80211_bss_conf *bss_conf) |
554 | { | 554 | { |
555 | struct ieee80211_ht_info *ht_conf = bss_conf->ht_conf; | 555 | struct ieee80211_sta_ht_cap *ht_conf = bss_conf->ht_cap; |
556 | struct ieee80211_ht_bss_info *ht_bss_conf = bss_conf->ht_bss_conf; | 556 | struct ieee80211_ht_bss_info *ht_bss_conf = bss_conf->ht_bss_conf; |
557 | struct iwl_ht_info *iwl_conf = &priv->current_ht_config; | 557 | struct iwl_ht_info *iwl_conf = &priv->current_ht_config; |
558 | 558 | ||
@@ -573,27 +573,27 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, | |||
573 | !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU); | 573 | !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU); |
574 | 574 | ||
575 | iwl_conf->supported_chan_width = | 575 | iwl_conf->supported_chan_width = |
576 | !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH); | 576 | !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40); |
577 | iwl_conf->extension_chan_offset = | 577 | iwl_conf->extension_chan_offset = |
578 | ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_SEC_OFFSET; | 578 | ht_bss_conf->bss_cap & IEEE80211_HT_PARAM_CHA_SEC_OFFSET; |
579 | /* If no above or below channel supplied disable FAT channel */ | 579 | /* If no above or below channel supplied disable FAT channel */ |
580 | if (iwl_conf->extension_chan_offset != IEEE80211_HT_IE_CHA_SEC_ABOVE && | 580 | if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE && |
581 | iwl_conf->extension_chan_offset != IEEE80211_HT_IE_CHA_SEC_BELOW) { | 581 | iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW) { |
582 | iwl_conf->extension_chan_offset = IEEE80211_HT_IE_CHA_SEC_NONE; | 582 | iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE; |
583 | iwl_conf->supported_chan_width = 0; | 583 | iwl_conf->supported_chan_width = 0; |
584 | } | 584 | } |
585 | 585 | ||
586 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); | 586 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); |
587 | 587 | ||
588 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); | 588 | memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); |
589 | 589 | ||
590 | iwl_conf->control_channel = ht_bss_conf->primary_channel; | 590 | iwl_conf->control_channel = ht_bss_conf->primary_channel; |
591 | iwl_conf->tx_chan_width = | 591 | iwl_conf->tx_chan_width = |
592 | !!(ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_WIDTH); | 592 | !!(ht_bss_conf->bss_cap & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY); |
593 | iwl_conf->ht_protection = | 593 | iwl_conf->ht_protection = |
594 | ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_HT_PROTECTION; | 594 | ht_bss_conf->bss_op_mode & IEEE80211_HT_OP_MODE_PROTECTION; |
595 | iwl_conf->non_GF_STA_present = | 595 | iwl_conf->non_GF_STA_present = |
596 | !!(ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_NON_GF_STA_PRSNT); | 596 | !!(ht_bss_conf->bss_op_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); |
597 | 597 | ||
598 | IWL_DEBUG_MAC80211("control channel %d\n", iwl_conf->control_channel); | 598 | IWL_DEBUG_MAC80211("control channel %d\n", iwl_conf->control_channel); |
599 | IWL_DEBUG_MAC80211("leave\n"); | 599 | IWL_DEBUG_MAC80211("leave\n"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 4c312c55f90c..4678da447ff6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -382,10 +382,10 @@ void iwl_reset_qos(struct iwl_priv *priv) | |||
382 | } | 382 | } |
383 | EXPORT_SYMBOL(iwl_reset_qos); | 383 | EXPORT_SYMBOL(iwl_reset_qos); |
384 | 384 | ||
385 | #define MAX_BIT_RATE_40_MHZ 0x96 /* 150 Mbps */ | 385 | #define MAX_BIT_RATE_40_MHZ 150 /* Mbps */ |
386 | #define MAX_BIT_RATE_20_MHZ 0x48 /* 72 Mbps */ | 386 | #define MAX_BIT_RATE_20_MHZ 72 /* Mbps */ |
387 | static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, | 387 | static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, |
388 | struct ieee80211_ht_info *ht_info, | 388 | struct ieee80211_sta_ht_cap *ht_info, |
389 | enum ieee80211_band band) | 389 | enum ieee80211_band band) |
390 | { | 390 | { |
391 | u16 max_bit_rate = 0; | 391 | u16 max_bit_rate = 0; |
@@ -393,45 +393,46 @@ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, | |||
393 | u8 tx_chains_num = priv->hw_params.tx_chains_num; | 393 | u8 tx_chains_num = priv->hw_params.tx_chains_num; |
394 | 394 | ||
395 | ht_info->cap = 0; | 395 | ht_info->cap = 0; |
396 | memset(ht_info->supp_mcs_set, 0, 16); | 396 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); |
397 | 397 | ||
398 | ht_info->ht_supported = 1; | 398 | ht_info->ht_supported = true; |
399 | 399 | ||
400 | ht_info->cap |= (u16)IEEE80211_HT_CAP_GRN_FLD; | 400 | ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; |
401 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_20; | 401 | ht_info->cap |= IEEE80211_HT_CAP_SGI_20; |
402 | ht_info->cap |= (u16)(IEEE80211_HT_CAP_SM_PS & | 402 | ht_info->cap |= (IEEE80211_HT_CAP_SM_PS & |
403 | (WLAN_HT_CAP_SM_PS_DISABLED << 2)); | 403 | (WLAN_HT_CAP_SM_PS_DISABLED << 2)); |
404 | 404 | ||
405 | max_bit_rate = MAX_BIT_RATE_20_MHZ; | 405 | max_bit_rate = MAX_BIT_RATE_20_MHZ; |
406 | if (priv->hw_params.fat_channel & BIT(band)) { | 406 | if (priv->hw_params.fat_channel & BIT(band)) { |
407 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH; | 407 | ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
408 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40; | 408 | ht_info->cap |= IEEE80211_HT_CAP_SGI_40; |
409 | ht_info->supp_mcs_set[4] = 0x01; | 409 | ht_info->mcs.rx_mask[4] = 0x01; |
410 | max_bit_rate = MAX_BIT_RATE_40_MHZ; | 410 | max_bit_rate = MAX_BIT_RATE_40_MHZ; |
411 | } | 411 | } |
412 | 412 | ||
413 | if (priv->cfg->mod_params->amsdu_size_8K) | 413 | if (priv->cfg->mod_params->amsdu_size_8K) |
414 | ht_info->cap |= (u16)IEEE80211_HT_CAP_MAX_AMSDU; | 414 | ht_info->cap |= IEEE80211_HT_CAP_MAX_AMSDU; |
415 | 415 | ||
416 | ht_info->ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF; | 416 | ht_info->ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF; |
417 | ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF; | 417 | ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF; |
418 | 418 | ||
419 | ht_info->supp_mcs_set[0] = 0xFF; | 419 | ht_info->mcs.rx_mask[0] = 0xFF; |
420 | if (rx_chains_num >= 2) | 420 | if (rx_chains_num >= 2) |
421 | ht_info->supp_mcs_set[1] = 0xFF; | 421 | ht_info->mcs.rx_mask[1] = 0xFF; |
422 | if (rx_chains_num >= 3) | 422 | if (rx_chains_num >= 3) |
423 | ht_info->supp_mcs_set[2] = 0xFF; | 423 | ht_info->mcs.rx_mask[2] = 0xFF; |
424 | 424 | ||
425 | /* Highest supported Rx data rate */ | 425 | /* Highest supported Rx data rate */ |
426 | max_bit_rate *= rx_chains_num; | 426 | max_bit_rate *= rx_chains_num; |
427 | ht_info->supp_mcs_set[10] = (u8)(max_bit_rate & 0x00FF); | 427 | WARN_ON(max_bit_rate & ~IEEE80211_HT_MCS_RX_HIGHEST_MASK); |
428 | ht_info->supp_mcs_set[11] = (u8)((max_bit_rate & 0xFF00) >> 8); | 428 | ht_info->mcs.rx_highest = cpu_to_le16(max_bit_rate); |
429 | 429 | ||
430 | /* Tx MCS capabilities */ | 430 | /* Tx MCS capabilities */ |
431 | ht_info->supp_mcs_set[12] = IEEE80211_HT_CAP_MCS_TX_DEFINED; | 431 | ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; |
432 | if (tx_chains_num != rx_chains_num) { | 432 | if (tx_chains_num != rx_chains_num) { |
433 | ht_info->supp_mcs_set[12] |= IEEE80211_HT_CAP_MCS_TX_RX_DIFF; | 433 | ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; |
434 | ht_info->supp_mcs_set[12] |= ((tx_chains_num - 1) << 2); | 434 | ht_info->mcs.tx_params |= ((tx_chains_num - 1) << |
435 | IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT); | ||
435 | } | 436 | } |
436 | } | 437 | } |
437 | 438 | ||
@@ -495,7 +496,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv) | |||
495 | sband->n_bitrates = IWL_RATE_COUNT - IWL_FIRST_OFDM_RATE; | 496 | sband->n_bitrates = IWL_RATE_COUNT - IWL_FIRST_OFDM_RATE; |
496 | 497 | ||
497 | if (priv->cfg->sku & IWL_SKU_N) | 498 | if (priv->cfg->sku & IWL_SKU_N) |
498 | iwlcore_init_ht_hw_capab(priv, &sband->ht_info, | 499 | iwlcore_init_ht_hw_capab(priv, &sband->ht_cap, |
499 | IEEE80211_BAND_5GHZ); | 500 | IEEE80211_BAND_5GHZ); |
500 | 501 | ||
501 | sband = &priv->bands[IEEE80211_BAND_2GHZ]; | 502 | sband = &priv->bands[IEEE80211_BAND_2GHZ]; |
@@ -505,7 +506,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv) | |||
505 | sband->n_bitrates = IWL_RATE_COUNT; | 506 | sband->n_bitrates = IWL_RATE_COUNT; |
506 | 507 | ||
507 | if (priv->cfg->sku & IWL_SKU_N) | 508 | if (priv->cfg->sku & IWL_SKU_N) |
508 | iwlcore_init_ht_hw_capab(priv, &sband->ht_info, | 509 | iwlcore_init_ht_hw_capab(priv, &sband->ht_cap, |
509 | IEEE80211_BAND_2GHZ); | 510 | IEEE80211_BAND_2GHZ); |
510 | 511 | ||
511 | priv->ieee_channels = channels; | 512 | priv->ieee_channels = channels; |
@@ -595,8 +596,8 @@ static void iwlcore_free_geos(struct iwl_priv *priv) | |||
595 | static bool is_single_rx_stream(struct iwl_priv *priv) | 596 | static bool is_single_rx_stream(struct iwl_priv *priv) |
596 | { | 597 | { |
597 | return !priv->current_ht_config.is_ht || | 598 | return !priv->current_ht_config.is_ht || |
598 | ((priv->current_ht_config.supp_mcs_set[1] == 0) && | 599 | ((priv->current_ht_config.mcs.rx_mask[1] == 0) && |
599 | (priv->current_ht_config.supp_mcs_set[2] == 0)); | 600 | (priv->current_ht_config.mcs.rx_mask[2] == 0)); |
600 | } | 601 | } |
601 | 602 | ||
602 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, | 603 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, |
@@ -609,10 +610,10 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv, | |||
609 | if (!is_channel_valid(ch_info)) | 610 | if (!is_channel_valid(ch_info)) |
610 | return 0; | 611 | return 0; |
611 | 612 | ||
612 | if (extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_ABOVE) | 613 | if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) |
613 | return !(ch_info->fat_extension_channel & | 614 | return !(ch_info->fat_extension_channel & |
614 | IEEE80211_CHAN_NO_FAT_ABOVE); | 615 | IEEE80211_CHAN_NO_FAT_ABOVE); |
615 | else if (extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_BELOW) | 616 | else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) |
616 | return !(ch_info->fat_extension_channel & | 617 | return !(ch_info->fat_extension_channel & |
617 | IEEE80211_CHAN_NO_FAT_BELOW); | 618 | IEEE80211_CHAN_NO_FAT_BELOW); |
618 | 619 | ||
@@ -620,18 +621,18 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv, | |||
620 | } | 621 | } |
621 | 622 | ||
622 | u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, | 623 | u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, |
623 | struct ieee80211_ht_info *sta_ht_inf) | 624 | struct ieee80211_sta_ht_cap *sta_ht_inf) |
624 | { | 625 | { |
625 | struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config; | 626 | struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config; |
626 | 627 | ||
627 | if ((!iwl_ht_conf->is_ht) || | 628 | if ((!iwl_ht_conf->is_ht) || |
628 | (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) || | 629 | (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) || |
629 | (iwl_ht_conf->extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_NONE)) | 630 | (iwl_ht_conf->extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_NONE)) |
630 | return 0; | 631 | return 0; |
631 | 632 | ||
632 | if (sta_ht_inf) { | 633 | if (sta_ht_inf) { |
633 | if ((!sta_ht_inf->ht_supported) || | 634 | if ((!sta_ht_inf->ht_supported) || |
634 | (!(sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH))) | 635 | (!(sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40))) |
635 | return 0; | 636 | return 0; |
636 | } | 637 | } |
637 | 638 | ||
@@ -671,13 +672,13 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info) | |||
671 | 672 | ||
672 | /* Note: control channel is opposite of extension channel */ | 673 | /* Note: control channel is opposite of extension channel */ |
673 | switch (ht_info->extension_chan_offset) { | 674 | switch (ht_info->extension_chan_offset) { |
674 | case IEEE80211_HT_IE_CHA_SEC_ABOVE: | 675 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
675 | rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK); | 676 | rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK); |
676 | break; | 677 | break; |
677 | case IEEE80211_HT_IE_CHA_SEC_BELOW: | 678 | case IEEE80211_HT_PARAM_CHA_SEC_BELOW: |
678 | rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK; | 679 | rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK; |
679 | break; | 680 | break; |
680 | case IEEE80211_HT_IE_CHA_SEC_NONE: | 681 | case IEEE80211_HT_PARAM_CHA_SEC_NONE: |
681 | default: | 682 | default: |
682 | rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK; | 683 | rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK; |
683 | break; | 684 | break; |
@@ -693,9 +694,9 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info) | |||
693 | "rxon flags 0x%X operation mode :0x%X " | 694 | "rxon flags 0x%X operation mode :0x%X " |
694 | "extension channel offset 0x%x " | 695 | "extension channel offset 0x%x " |
695 | "control chan %d\n", | 696 | "control chan %d\n", |
696 | ht_info->supp_mcs_set[0], | 697 | ht_info->mcs.rx_mask[0], |
697 | ht_info->supp_mcs_set[1], | 698 | ht_info->mcs.rx_mask[1], |
698 | ht_info->supp_mcs_set[2], | 699 | ht_info->mcs.rx_mask[2], |
699 | le32_to_cpu(rxon->flags), ht_info->ht_protection, | 700 | le32_to_cpu(rxon->flags), ht_info->ht_protection, |
700 | ht_info->extension_chan_offset, | 701 | ht_info->extension_chan_offset, |
701 | ht_info->control_channel); | 702 | ht_info->control_channel); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 288b6a800e03..1a3ad8b1ebdb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -190,7 +190,7 @@ void iwl_set_rxon_chain(struct iwl_priv *priv); | |||
190 | int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch); | 190 | int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch); |
191 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info); | 191 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info); |
192 | u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, | 192 | u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv, |
193 | struct ieee80211_ht_info *sta_ht_inf); | 193 | struct ieee80211_sta_ht_cap *sta_ht_inf); |
194 | int iwl_hw_nic_init(struct iwl_priv *priv); | 194 | int iwl_hw_nic_init(struct iwl_priv *priv); |
195 | int iwl_setup_mac(struct iwl_priv *priv); | 195 | int iwl_setup_mac(struct iwl_priv *priv); |
196 | int iwl_set_hw_params(struct iwl_priv *priv); | 196 | int iwl_set_hw_params(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 34306b6798e2..572250ee9d58 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -411,7 +411,7 @@ struct iwl_ht_info { | |||
411 | u8 max_amsdu_size; | 411 | u8 max_amsdu_size; |
412 | u8 ampdu_factor; | 412 | u8 ampdu_factor; |
413 | u8 mpdu_density; | 413 | u8 mpdu_density; |
414 | u8 supp_mcs_set[16]; | 414 | struct ieee80211_mcs_info mcs; |
415 | /* BSS related data */ | 415 | /* BSS related data */ |
416 | u8 control_channel; | 416 | u8 control_channel; |
417 | u8 extension_chan_offset; | 417 | u8 extension_chan_offset; |
@@ -585,7 +585,7 @@ struct iwl_addsta_cmd; | |||
585 | extern int iwl_send_add_sta(struct iwl_priv *priv, | 585 | extern int iwl_send_add_sta(struct iwl_priv *priv, |
586 | struct iwl_addsta_cmd *sta, u8 flags); | 586 | struct iwl_addsta_cmd *sta, u8 flags); |
587 | extern u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, | 587 | extern u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, |
588 | int is_ap, u8 flags, struct ieee80211_ht_info *ht_info); | 588 | int is_ap, u8 flags, struct ieee80211_sta_ht_cap *ht_info); |
589 | extern void iwl4965_update_chain_flags(struct iwl_priv *priv); | 589 | extern void iwl4965_update_chain_flags(struct iwl_priv *priv); |
590 | extern int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); | 590 | extern int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); |
591 | extern const u8 iwl_bcast_addr[ETH_ALEN]; | 591 | extern const u8 iwl_bcast_addr[ETH_ALEN]; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 3b0bee331a33..78d16bd7b745 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -550,7 +550,7 @@ static void iwl_ht_cap_to_ie(const struct ieee80211_supported_band *sband, | |||
550 | { | 550 | { |
551 | struct ieee80211_ht_cap *ht_cap; | 551 | struct ieee80211_ht_cap *ht_cap; |
552 | 552 | ||
553 | if (!sband || !sband->ht_info.ht_supported) | 553 | if (!sband || !sband->ht_cap.ht_supported) |
554 | return; | 554 | return; |
555 | 555 | ||
556 | if (*left < sizeof(struct ieee80211_ht_cap)) | 556 | if (*left < sizeof(struct ieee80211_ht_cap)) |
@@ -559,12 +559,12 @@ static void iwl_ht_cap_to_ie(const struct ieee80211_supported_band *sband, | |||
559 | *pos++ = sizeof(struct ieee80211_ht_cap); | 559 | *pos++ = sizeof(struct ieee80211_ht_cap); |
560 | ht_cap = (struct ieee80211_ht_cap *) pos; | 560 | ht_cap = (struct ieee80211_ht_cap *) pos; |
561 | 561 | ||
562 | ht_cap->cap_info = cpu_to_le16(sband->ht_info.cap); | 562 | ht_cap->cap_info = cpu_to_le16(sband->ht_cap.cap); |
563 | memcpy(ht_cap->supp_mcs_set, sband->ht_info.supp_mcs_set, 16); | 563 | memcpy(&ht_cap->mcs, &sband->ht_cap.mcs, 16); |
564 | ht_cap->ampdu_params_info = | 564 | ht_cap->ampdu_params_info = |
565 | (sband->ht_info.ampdu_factor & IEEE80211_HT_CAP_AMPDU_FACTOR) | | 565 | (sband->ht_cap.ampdu_factor & IEEE80211_HT_AMPDU_PARM_FACTOR) | |
566 | ((sband->ht_info.ampdu_density << 2) & | 566 | ((sband->ht_cap.ampdu_density << 2) & |
567 | IEEE80211_HT_CAP_AMPDU_DENSITY); | 567 | IEEE80211_HT_AMPDU_PARM_DENSITY); |
568 | *left -= sizeof(struct ieee80211_ht_cap); | 568 | *left -= sizeof(struct ieee80211_ht_cap); |
569 | } | 569 | } |
570 | 570 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index a28a8decc79c..b9b8554433a6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -181,7 +181,7 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
181 | EXPORT_SYMBOL(iwl_send_add_sta); | 181 | EXPORT_SYMBOL(iwl_send_add_sta); |
182 | 182 | ||
183 | static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | 183 | static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, |
184 | struct ieee80211_ht_info *sta_ht_inf) | 184 | struct ieee80211_sta_ht_cap *sta_ht_inf) |
185 | { | 185 | { |
186 | __le32 sta_flags; | 186 | __le32 sta_flags; |
187 | u8 mimo_ps_mode; | 187 | u8 mimo_ps_mode; |
@@ -229,7 +229,7 @@ static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | |||
229 | * iwl_add_station_flags - Add station to tables in driver and device | 229 | * iwl_add_station_flags - Add station to tables in driver and device |
230 | */ | 230 | */ |
231 | u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap, | 231 | u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap, |
232 | u8 flags, struct ieee80211_ht_info *ht_info) | 232 | u8 flags, struct ieee80211_sta_ht_cap *ht_info) |
233 | { | 233 | { |
234 | int i; | 234 | int i; |
235 | int sta_id = IWL_INVALID_STATION; | 235 | int sta_id = IWL_INVALID_STATION; |
@@ -894,7 +894,7 @@ int iwl_rxon_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap) | |||
894 | 894 | ||
895 | /* Add station to device's station table */ | 895 | /* Add station to device's station table */ |
896 | struct ieee80211_conf *conf = &priv->hw->conf; | 896 | struct ieee80211_conf *conf = &priv->hw->conf; |
897 | struct ieee80211_ht_info *cur_ht_config = &conf->ht_conf; | 897 | struct ieee80211_sta_ht_cap *cur_ht_config = &conf->ht_cap; |
898 | 898 | ||
899 | if ((is_ap) && | 899 | if ((is_ap) && |
900 | (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && | 900 | (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && |