diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2007-11-26 09:14:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:42 -0500 |
commit | 8fb8803239debda77b90f7e4a5098067187d865e (patch) | |
tree | 9866a491e79e69bbd6baae353e1897242b794f85 /drivers | |
parent | 326eeee807ca7ed4489cb21d4ebe8e52079c11c3 (diff) |
iwlwifi: 802.11n handling probe request HT IE
This patch conforms the probe request's HT IE with the
new structures used in iwlwifi HT.
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index d88363e766c4..c2366c2d23b7 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1875,8 +1875,8 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate, | |||
1875 | 1875 | ||
1876 | #ifdef CONFIG_IWL4965_HT | 1876 | #ifdef CONFIG_IWL4965_HT |
1877 | void static iwl4965_set_ht_capab(struct ieee80211_hw *hw, | 1877 | void static iwl4965_set_ht_capab(struct ieee80211_hw *hw, |
1878 | struct ieee80211_ht_capability *ht_cap, | 1878 | struct ieee80211_ht_cap *ht_cap, |
1879 | u8 use_wide_chan); | 1879 | u8 use_current_config); |
1880 | #endif | 1880 | #endif |
1881 | 1881 | ||
1882 | /** | 1882 | /** |
@@ -1889,6 +1889,9 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, | |||
1889 | int len = 0; | 1889 | int len = 0; |
1890 | u8 *pos = NULL; | 1890 | u8 *pos = NULL; |
1891 | u16 active_rates, ret_rates, cck_rates, active_rate_basic; | 1891 | u16 active_rates, ret_rates, cck_rates, active_rate_basic; |
1892 | #ifdef CONFIG_IWL4965_HT | ||
1893 | struct ieee80211_hw_mode *mode; | ||
1894 | #endif /* CONFIG_IWL4965_HT */ | ||
1892 | 1895 | ||
1893 | /* Make sure there is enough space for the probe request, | 1896 | /* Make sure there is enough space for the probe request, |
1894 | * two mandatory IEs and the data */ | 1897 | * two mandatory IEs and the data */ |
@@ -1972,17 +1975,14 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, | |||
1972 | len += 2 + *pos; | 1975 | len += 2 + *pos; |
1973 | 1976 | ||
1974 | #ifdef CONFIG_IWL4965_HT | 1977 | #ifdef CONFIG_IWL4965_HT |
1975 | if (is_direct && priv->is_ht_enabled) { | 1978 | mode = priv->hw->conf.mode; |
1976 | u8 use_wide_chan = 1; | 1979 | if (mode->ht_info.ht_supported) { |
1977 | |||
1978 | if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ) | ||
1979 | use_wide_chan = 0; | ||
1980 | pos += (*pos) + 1; | 1980 | pos += (*pos) + 1; |
1981 | *pos++ = WLAN_EID_HT_CAPABILITY; | 1981 | *pos++ = WLAN_EID_HT_CAPABILITY; |
1982 | *pos++ = sizeof(struct ieee80211_ht_capability); | 1982 | *pos++ = sizeof(struct ieee80211_ht_cap); |
1983 | iwl4965_set_ht_capab(NULL, (struct ieee80211_ht_capability *)pos, | 1983 | iwl4965_set_ht_capab(priv->hw, |
1984 | use_wide_chan); | 1984 | (struct ieee80211_ht_cap *)pos, 0); |
1985 | len += 2 + sizeof(struct ieee80211_ht_capability); | 1985 | len += 2 + sizeof(struct ieee80211_ht_cap); |
1986 | } | 1986 | } |
1987 | #endif /*CONFIG_IWL4965_HT */ | 1987 | #endif /*CONFIG_IWL4965_HT */ |
1988 | 1988 | ||
@@ -8379,31 +8379,25 @@ static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw, | |||
8379 | } | 8379 | } |
8380 | 8380 | ||
8381 | static void iwl4965_set_ht_capab(struct ieee80211_hw *hw, | 8381 | static void iwl4965_set_ht_capab(struct ieee80211_hw *hw, |
8382 | struct ieee80211_ht_capability *ht_cap, | 8382 | struct ieee80211_ht_cap *ht_cap, |
8383 | u8 use_wide_chan) | 8383 | u8 use_current_config) |
8384 | { | 8384 | { |
8385 | union ht_cap_info cap; | 8385 | struct ieee80211_conf *conf = &hw->conf; |
8386 | union ht_param_info param_info; | 8386 | struct ieee80211_hw_mode *mode = conf->mode; |
8387 | 8387 | ||
8388 | memset(&cap, 0, sizeof(union ht_cap_info)); | 8388 | if (use_current_config) { |
8389 | memset(¶m_info, 0, sizeof(union ht_param_info)); | 8389 | ht_cap->cap_info = cpu_to_le16(conf->ht_conf.cap); |
8390 | 8390 | memcpy(ht_cap->supp_mcs_set, | |
8391 | cap.maximal_amsdu_size = HT_IE_MAX_AMSDU_SIZE_4K; | 8391 | conf->ht_conf.supp_mcs_set, 16); |
8392 | cap.green_field = 1; | 8392 | } else { |
8393 | cap.short_GI20 = 1; | 8393 | ht_cap->cap_info = cpu_to_le16(mode->ht_info.cap); |
8394 | cap.short_GI40 = 1; | 8394 | memcpy(ht_cap->supp_mcs_set, |
8395 | cap.supported_chan_width_set = use_wide_chan; | 8395 | mode->ht_info.supp_mcs_set, 16); |
8396 | cap.mimo_power_save_mode = 0x3; | 8396 | } |
8397 | 8397 | ht_cap->ampdu_params_info = | |
8398 | param_info.max_rx_ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF; | 8398 | (mode->ht_info.ampdu_factor & IEEE80211_HT_CAP_AMPDU_FACTOR) | |
8399 | param_info.mpdu_density = CFG_HT_MPDU_DENSITY_DEF; | 8399 | ((mode->ht_info.ampdu_density << 2) & |
8400 | ht_cap->capabilities_info = (__le16) cpu_to_le16(cap.val); | 8400 | IEEE80211_HT_CAP_AMPDU_DENSITY); |
8401 | ht_cap->mac_ht_params_info = (u8) param_info.val; | ||
8402 | |||
8403 | ht_cap->supported_mcs_set[0] = 0xff; | ||
8404 | ht_cap->supported_mcs_set[1] = 0xff; | ||
8405 | ht_cap->supported_mcs_set[4] = | ||
8406 | (cap.supported_chan_width_set) ? 0x1: 0x0; | ||
8407 | } | 8401 | } |
8408 | 8402 | ||
8409 | static void iwl4965_mac_get_ht_capab(struct ieee80211_hw *hw, | 8403 | static void iwl4965_mac_get_ht_capab(struct ieee80211_hw *hw, |