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>
This commit is contained in:
Ron Rindjunsky 2007-11-26 16:14:38 +02:00 committed by David S. Miller
parent 326eeee807
commit 8fb8803239

View file

@ -1875,8 +1875,8 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate,
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
void static iwl4965_set_ht_capab(struct ieee80211_hw *hw, void static iwl4965_set_ht_capab(struct ieee80211_hw *hw,
struct ieee80211_ht_capability *ht_cap, struct ieee80211_ht_cap *ht_cap,
u8 use_wide_chan); u8 use_current_config);
#endif #endif
/** /**
@ -1889,6 +1889,9 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv,
int len = 0; int len = 0;
u8 *pos = NULL; u8 *pos = NULL;
u16 active_rates, ret_rates, cck_rates, active_rate_basic; u16 active_rates, ret_rates, cck_rates, active_rate_basic;
#ifdef CONFIG_IWL4965_HT
struct ieee80211_hw_mode *mode;
#endif /* CONFIG_IWL4965_HT */
/* Make sure there is enough space for the probe request, /* Make sure there is enough space for the probe request,
* two mandatory IEs and the data */ * two mandatory IEs and the data */
@ -1972,17 +1975,14 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv,
len += 2 + *pos; len += 2 + *pos;
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
if (is_direct && priv->is_ht_enabled) { mode = priv->hw->conf.mode;
u8 use_wide_chan = 1; if (mode->ht_info.ht_supported) {
if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ)
use_wide_chan = 0;
pos += (*pos) + 1; pos += (*pos) + 1;
*pos++ = WLAN_EID_HT_CAPABILITY; *pos++ = WLAN_EID_HT_CAPABILITY;
*pos++ = sizeof(struct ieee80211_ht_capability); *pos++ = sizeof(struct ieee80211_ht_cap);
iwl4965_set_ht_capab(NULL, (struct ieee80211_ht_capability *)pos, iwl4965_set_ht_capab(priv->hw,
use_wide_chan); (struct ieee80211_ht_cap *)pos, 0);
len += 2 + sizeof(struct ieee80211_ht_capability); len += 2 + sizeof(struct ieee80211_ht_cap);
} }
#endif /*CONFIG_IWL4965_HT */ #endif /*CONFIG_IWL4965_HT */
@ -8379,31 +8379,25 @@ static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw,
} }
static void iwl4965_set_ht_capab(struct ieee80211_hw *hw, static void iwl4965_set_ht_capab(struct ieee80211_hw *hw,
struct ieee80211_ht_capability *ht_cap, struct ieee80211_ht_cap *ht_cap,
u8 use_wide_chan) u8 use_current_config)
{ {
union ht_cap_info cap; struct ieee80211_conf *conf = &hw->conf;
union ht_param_info param_info; struct ieee80211_hw_mode *mode = conf->mode;
memset(&cap, 0, sizeof(union ht_cap_info)); if (use_current_config) {
memset(&param_info, 0, sizeof(union ht_param_info)); ht_cap->cap_info = cpu_to_le16(conf->ht_conf.cap);
memcpy(ht_cap->supp_mcs_set,
cap.maximal_amsdu_size = HT_IE_MAX_AMSDU_SIZE_4K; conf->ht_conf.supp_mcs_set, 16);
cap.green_field = 1; } else {
cap.short_GI20 = 1; ht_cap->cap_info = cpu_to_le16(mode->ht_info.cap);
cap.short_GI40 = 1; memcpy(ht_cap->supp_mcs_set,
cap.supported_chan_width_set = use_wide_chan; mode->ht_info.supp_mcs_set, 16);
cap.mimo_power_save_mode = 0x3; }
ht_cap->ampdu_params_info =
param_info.max_rx_ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF; (mode->ht_info.ampdu_factor & IEEE80211_HT_CAP_AMPDU_FACTOR) |
param_info.mpdu_density = CFG_HT_MPDU_DENSITY_DEF; ((mode->ht_info.ampdu_density << 2) &
ht_cap->capabilities_info = (__le16) cpu_to_le16(cap.val); IEEE80211_HT_CAP_AMPDU_DENSITY);
ht_cap->mac_ht_params_info = (u8) param_info.val;
ht_cap->supported_mcs_set[0] = 0xff;
ht_cap->supported_mcs_set[1] = 0xff;
ht_cap->supported_mcs_set[4] =
(cap.supported_chan_width_set) ? 0x1: 0x0;
} }
static void iwl4965_mac_get_ht_capab(struct ieee80211_hw *hw, static void iwl4965_mac_get_ht_capab(struct ieee80211_hw *hw,