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 | |
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')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 57 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 2 | ||||
-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 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 19 |
13 files changed, 110 insertions, 114 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 186d75acb326..5e087c92a6d9 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -61,24 +61,24 @@ static u32 ath_get_extchanmode(struct ath_softc *sc, | |||
61 | 61 | ||
62 | switch (chan->band) { | 62 | switch (chan->band) { |
63 | case IEEE80211_BAND_2GHZ: | 63 | case IEEE80211_BAND_2GHZ: |
64 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_NONE) && | 64 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_NONE) && |
65 | (tx_chan_width == ATH9K_HT_MACMODE_20)) | 65 | (tx_chan_width == ATH9K_HT_MACMODE_20)) |
66 | chanmode = CHANNEL_G_HT20; | 66 | chanmode = CHANNEL_G_HT20; |
67 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_ABOVE) && | 67 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) && |
68 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) | 68 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) |
69 | chanmode = CHANNEL_G_HT40PLUS; | 69 | chanmode = CHANNEL_G_HT40PLUS; |
70 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_BELOW) && | 70 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) && |
71 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) | 71 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) |
72 | chanmode = CHANNEL_G_HT40MINUS; | 72 | chanmode = CHANNEL_G_HT40MINUS; |
73 | break; | 73 | break; |
74 | case IEEE80211_BAND_5GHZ: | 74 | case IEEE80211_BAND_5GHZ: |
75 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_NONE) && | 75 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_NONE) && |
76 | (tx_chan_width == ATH9K_HT_MACMODE_20)) | 76 | (tx_chan_width == ATH9K_HT_MACMODE_20)) |
77 | chanmode = CHANNEL_A_HT20; | 77 | chanmode = CHANNEL_A_HT20; |
78 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_ABOVE) && | 78 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) && |
79 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) | 79 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) |
80 | chanmode = CHANNEL_A_HT40PLUS; | 80 | chanmode = CHANNEL_A_HT40PLUS; |
81 | if ((ext_chan_offset == IEEE80211_HT_IE_CHA_SEC_BELOW) && | 81 | if ((ext_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) && |
82 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) | 82 | (tx_chan_width == ATH9K_HT_MACMODE_2040)) |
83 | chanmode = CHANNEL_A_HT40MINUS; | 83 | chanmode = CHANNEL_A_HT40MINUS; |
84 | break; | 84 | break; |
@@ -215,24 +215,24 @@ static void ath_key_delete(struct ath_softc *sc, struct ieee80211_key_conf *key) | |||
215 | ath_key_reset(sc, key->keyidx, freeslot); | 215 | ath_key_reset(sc, key->keyidx, freeslot); |
216 | } | 216 | } |
217 | 217 | ||
218 | static void setup_ht_cap(struct ieee80211_ht_info *ht_info) | 218 | static void setup_ht_cap(struct ieee80211_sta_ht_cap *ht_info) |
219 | { | 219 | { |
220 | #define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3 /* 2 ^ 16 */ | 220 | #define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3 /* 2 ^ 16 */ |
221 | #define ATH9K_HT_CAP_MPDUDENSITY_8 0x6 /* 8 usec */ | 221 | #define ATH9K_HT_CAP_MPDUDENSITY_8 0x6 /* 8 usec */ |
222 | 222 | ||
223 | ht_info->ht_supported = 1; | 223 | ht_info->ht_supported = true; |
224 | ht_info->cap = (u16)IEEE80211_HT_CAP_SUP_WIDTH | 224 | ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | |
225 | |(u16)IEEE80211_HT_CAP_SM_PS | 225 | IEEE80211_HT_CAP_SM_PS | |
226 | |(u16)IEEE80211_HT_CAP_SGI_40 | 226 | IEEE80211_HT_CAP_SGI_40 | |
227 | |(u16)IEEE80211_HT_CAP_DSSSCCK40; | 227 | IEEE80211_HT_CAP_DSSSCCK40; |
228 | 228 | ||
229 | ht_info->ampdu_factor = ATH9K_HT_CAP_MAXRXAMPDU_65536; | 229 | ht_info->ampdu_factor = ATH9K_HT_CAP_MAXRXAMPDU_65536; |
230 | ht_info->ampdu_density = ATH9K_HT_CAP_MPDUDENSITY_8; | 230 | ht_info->ampdu_density = ATH9K_HT_CAP_MPDUDENSITY_8; |
231 | /* setup supported mcs set */ | 231 | /* set up supported mcs set */ |
232 | memset(ht_info->supp_mcs_set, 0, 16); | 232 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); |
233 | ht_info->supp_mcs_set[0] = 0xff; | 233 | ht_info->mcs.rx_mask[0] = 0xff; |
234 | ht_info->supp_mcs_set[1] = 0xff; | 234 | ht_info->mcs.rx_mask[1] = 0xff; |
235 | ht_info->supp_mcs_set[12] = IEEE80211_HT_CAP_MCS_TX_DEFINED; | 235 | ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; |
236 | } | 236 | } |
237 | 237 | ||
238 | static int ath_rate2idx(struct ath_softc *sc, int rate) | 238 | static int ath_rate2idx(struct ath_softc *sc, int rate) |
@@ -328,31 +328,28 @@ static u8 parse_mpdudensity(u8 mpdudensity) | |||
328 | static void ath9k_ht_conf(struct ath_softc *sc, | 328 | static void ath9k_ht_conf(struct ath_softc *sc, |
329 | struct ieee80211_bss_conf *bss_conf) | 329 | struct ieee80211_bss_conf *bss_conf) |
330 | { | 330 | { |
331 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT BIT(14) | ||
332 | struct ath_ht_info *ht_info = &sc->sc_ht_info; | 331 | struct ath_ht_info *ht_info = &sc->sc_ht_info; |
333 | 332 | ||
334 | if (bss_conf->assoc_ht) { | 333 | if (bss_conf->assoc_ht) { |
335 | ht_info->ext_chan_offset = | 334 | ht_info->ext_chan_offset = |
336 | bss_conf->ht_bss_conf->bss_cap & | 335 | bss_conf->ht_bss_conf->bss_cap & |
337 | IEEE80211_HT_IE_CHA_SEC_OFFSET; | 336 | IEEE80211_HT_PARAM_CHA_SEC_OFFSET; |
338 | 337 | ||
339 | if (!(bss_conf->ht_conf->cap & | 338 | if (!(bss_conf->ht_cap->cap & |
340 | IEEE80211_HT_CAP_40MHZ_INTOLERANT) && | 339 | IEEE80211_HT_CAP_40MHZ_INTOLERANT) && |
341 | (bss_conf->ht_bss_conf->bss_cap & | 340 | (bss_conf->ht_bss_conf->bss_cap & |
342 | IEEE80211_HT_IE_CHA_WIDTH)) | 341 | IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) |
343 | ht_info->tx_chan_width = ATH9K_HT_MACMODE_2040; | 342 | ht_info->tx_chan_width = ATH9K_HT_MACMODE_2040; |
344 | else | 343 | else |
345 | ht_info->tx_chan_width = ATH9K_HT_MACMODE_20; | 344 | ht_info->tx_chan_width = ATH9K_HT_MACMODE_20; |
346 | 345 | ||
347 | ath9k_hw_set11nmac2040(sc->sc_ah, ht_info->tx_chan_width); | 346 | ath9k_hw_set11nmac2040(sc->sc_ah, ht_info->tx_chan_width); |
348 | ht_info->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR + | 347 | ht_info->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR + |
349 | bss_conf->ht_conf->ampdu_factor); | 348 | bss_conf->ht_cap->ampdu_factor); |
350 | ht_info->mpdudensity = | 349 | ht_info->mpdudensity = |
351 | parse_mpdudensity(bss_conf->ht_conf->ampdu_density); | 350 | parse_mpdudensity(bss_conf->ht_cap->ampdu_density); |
352 | 351 | ||
353 | } | 352 | } |
354 | |||
355 | #undef IEEE80211_HT_CAP_40MHZ_INTOLERANT | ||
356 | } | 353 | } |
357 | 354 | ||
358 | static void ath9k_bss_assoc_info(struct ath_softc *sc, | 355 | static void ath9k_bss_assoc_info(struct ath_softc *sc, |
@@ -411,7 +408,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
411 | return; | 408 | return; |
412 | } | 409 | } |
413 | 410 | ||
414 | if (hw->conf.ht_conf.ht_supported) | 411 | if (hw->conf.ht_cap.ht_supported) |
415 | sc->sc_ah->ah_channels[pos].chanmode = | 412 | sc->sc_ah->ah_channels[pos].chanmode = |
416 | ath_get_extchanmode(sc, curchan); | 413 | ath_get_extchanmode(sc, curchan); |
417 | else | 414 | else |
@@ -534,7 +531,7 @@ int _ath_rx_indicate(struct ath_softc *sc, | |||
534 | 531 | ||
535 | if (an) { | 532 | if (an) { |
536 | ath_rx_input(sc, an, | 533 | ath_rx_input(sc, an, |
537 | hw->conf.ht_conf.ht_supported, | 534 | hw->conf.ht_cap.ht_supported, |
538 | skb, status, &st); | 535 | skb, status, &st); |
539 | } | 536 | } |
540 | if (!an || (st != ATH_RX_CONSUMED)) | 537 | if (!an || (st != ATH_RX_CONSUMED)) |
@@ -943,7 +940,7 @@ static int ath_attach(u16 devid, | |||
943 | 940 | ||
944 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) | 941 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) |
945 | /* Setup HT capabilities for 2.4Ghz*/ | 942 | /* Setup HT capabilities for 2.4Ghz*/ |
946 | setup_ht_cap(&sc->sbands[IEEE80211_BAND_2GHZ].ht_info); | 943 | setup_ht_cap(&sc->sbands[IEEE80211_BAND_2GHZ].ht_cap); |
947 | 944 | ||
948 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = | 945 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = |
949 | &sc->sbands[IEEE80211_BAND_2GHZ]; | 946 | &sc->sbands[IEEE80211_BAND_2GHZ]; |
@@ -958,7 +955,7 @@ static int ath_attach(u16 devid, | |||
958 | 955 | ||
959 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) | 956 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) |
960 | /* Setup HT capabilities for 5Ghz*/ | 957 | /* Setup HT capabilities for 5Ghz*/ |
961 | setup_ht_cap(&sc->sbands[IEEE80211_BAND_5GHZ].ht_info); | 958 | setup_ht_cap(&sc->sbands[IEEE80211_BAND_5GHZ].ht_cap); |
962 | 959 | ||
963 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = | 960 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = |
964 | &sc->sbands[IEEE80211_BAND_5GHZ]; | 961 | &sc->sbands[IEEE80211_BAND_5GHZ]; |
@@ -1254,7 +1251,7 @@ static int ath9k_config(struct ieee80211_hw *hw, | |||
1254 | (curchan->band == IEEE80211_BAND_2GHZ) ? | 1251 | (curchan->band == IEEE80211_BAND_2GHZ) ? |
1255 | CHANNEL_G : CHANNEL_A; | 1252 | CHANNEL_G : CHANNEL_A; |
1256 | 1253 | ||
1257 | if (sc->sc_curaid && hw->conf.ht_conf.ht_supported) | 1254 | if (sc->sc_curaid && hw->conf.ht_cap.ht_supported) |
1258 | sc->sc_ah->ah_channels[pos].chanmode = | 1255 | sc->sc_ah->ah_channels[pos].chanmode = |
1259 | ath_get_extchanmode(sc, curchan); | 1256 | ath_get_extchanmode(sc, curchan); |
1260 | 1257 | ||
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index b1e535b8ec48..ee2dbce42b4d 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1838,7 +1838,7 @@ void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv) | |||
1838 | struct ath_softc *sc = hw->priv; | 1838 | struct ath_softc *sc = hw->priv; |
1839 | u32 capflag = 0; | 1839 | u32 capflag = 0; |
1840 | 1840 | ||
1841 | if (hw->conf.ht_conf.ht_supported) { | 1841 | if (hw->conf.ht_cap.ht_supported) { |
1842 | capflag |= ATH_RC_HT_FLAG | ATH_RC_DS_FLAG; | 1842 | capflag |= ATH_RC_HT_FLAG | ATH_RC_DS_FLAG; |
1843 | if (sc->sc_ht_info.tx_chan_width == ATH9K_HT_MACMODE_2040) | 1843 | if (sc->sc_ht_info.tx_chan_width == ATH9K_HT_MACMODE_2040) |
1844 | capflag |= ATH_RC_CW40_FLAG; | 1844 | capflag |= ATH_RC_CW40_FLAG; |
@@ -1910,7 +1910,7 @@ static void ath_tx_aggr_resp(struct ath_softc *sc, | |||
1910 | */ | 1910 | */ |
1911 | si = container_of(sta, struct sta_info, sta); | 1911 | si = container_of(sta, struct sta_info, sta); |
1912 | buffersize = IEEE80211_MIN_AMPDU_BUF << | 1912 | buffersize = IEEE80211_MIN_AMPDU_BUF << |
1913 | sband->ht_info.ampdu_factor; /* FIXME */ | 1913 | sband->ht_cap.ampdu_factor; /* FIXME */ |
1914 | state = si->ampdu_mlme.tid_state_tx[tidno]; | 1914 | state = si->ampdu_mlme.tid_state_tx[tidno]; |
1915 | 1915 | ||
1916 | if (state & HT_ADDBA_RECEIVED_MSK) { | 1916 | if (state & HT_ADDBA_RECEIVED_MSK) { |
@@ -1979,7 +1979,7 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband, | |||
1979 | 1979 | ||
1980 | /* Check if aggregation has to be enabled for this tid */ | 1980 | /* Check if aggregation has to be enabled for this tid */ |
1981 | 1981 | ||
1982 | if (hw->conf.ht_conf.ht_supported) { | 1982 | if (hw->conf.ht_cap.ht_supported) { |
1983 | if (ieee80211_is_data_qos(fc)) { | 1983 | if (ieee80211_is_data_qos(fc)) { |
1984 | qc = ieee80211_get_qos_ctl(hdr); | 1984 | qc = ieee80211_get_qos_ctl(hdr); |
1985 | tid = qc[0] & 0xf; | 1985 | tid = qc[0] & 0xf; |
@@ -2027,8 +2027,8 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband, | |||
2027 | 2027 | ||
2028 | ath_setup_rates(sc, sband, sta, ath_rc_priv); | 2028 | ath_setup_rates(sc, sband, sta, ath_rc_priv); |
2029 | if (sc->hw->conf.flags & IEEE80211_CONF_SUPPORT_HT_MODE) { | 2029 | if (sc->hw->conf.flags & IEEE80211_CONF_SUPPORT_HT_MODE) { |
2030 | for (i = 0; i < MCS_SET_SIZE; i++) { | 2030 | for (i = 0; i < 77; i++) { |
2031 | if (sc->hw->conf.ht_conf.supp_mcs_set[i/8] & (1<<(i%8))) | 2031 | if (sc->hw->conf.ht_cap.mcs.rx_mask[i/8] & (1<<(i%8))) |
2032 | ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; | 2032 | ath_rc_priv->neg_ht_rates.rs_rates[j++] = i; |
2033 | if (j == ATH_RATE_MAX) | 2033 | if (j == ATH_RATE_MAX) |
2034 | break; | 2034 | break; |
diff --git a/drivers/net/wireless/ath9k/rc.h b/drivers/net/wireless/ath9k/rc.h index b95b41508b98..6671097fad72 100644 --- a/drivers/net/wireless/ath9k/rc.h +++ b/drivers/net/wireless/ath9k/rc.h | |||
@@ -59,7 +59,6 @@ struct ath_softc; | |||
59 | #define FALSE 0 | 59 | #define FALSE 0 |
60 | 60 | ||
61 | #define ATH_RATE_MAX 30 | 61 | #define ATH_RATE_MAX 30 |
62 | #define MCS_SET_SIZE 128 | ||
63 | 62 | ||
64 | enum ieee80211_fixed_rate_mode { | 63 | enum ieee80211_fixed_rate_mode { |
65 | IEEE80211_FIXED_RATE_NONE = 0, | 64 | IEEE80211_FIXED_RATE_NONE = 0, |
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 4983402af559..010fcdfec3f6 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -1119,7 +1119,7 @@ int ath_rx_aggr_start(struct ath_softc *sc, | |||
1119 | 1119 | ||
1120 | sband = hw->wiphy->bands[hw->conf.channel->band]; | 1120 | sband = hw->wiphy->bands[hw->conf.channel->band]; |
1121 | buffersize = IEEE80211_MIN_AMPDU_BUF << | 1121 | buffersize = IEEE80211_MIN_AMPDU_BUF << |
1122 | sband->ht_info.ampdu_factor; /* FIXME */ | 1122 | sband->ht_cap.ampdu_factor; /* FIXME */ |
1123 | 1123 | ||
1124 | rxtid = &an->an_aggr.rx.tid[tid]; | 1124 | rxtid = &an->an_aggr.rx.tid[tid]; |
1125 | 1125 | ||
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 13866043dec9..3770fbe84fce 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -300,7 +300,7 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
300 | if (ieee80211_is_data(fc) && !txctl->use_minrate) { | 300 | if (ieee80211_is_data(fc) && !txctl->use_minrate) { |
301 | 301 | ||
302 | /* Enable HT only for DATA frames and not for EAPOL */ | 302 | /* Enable HT only for DATA frames and not for EAPOL */ |
303 | txctl->ht = (hw->conf.ht_conf.ht_supported && | 303 | txctl->ht = (hw->conf.ht_cap.ht_supported && |
304 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU)); | 304 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU)); |
305 | 305 | ||
306 | if (is_multicast_ether_addr(hdr->addr1)) { | 306 | if (is_multicast_ether_addr(hdr->addr1)) { |
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) && |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e23d9a52d083..3f236b546683 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -563,19 +563,18 @@ static int __init init_mac80211_hwsim(void) | |||
563 | data->band.n_channels = ARRAY_SIZE(hwsim_channels); | 563 | data->band.n_channels = ARRAY_SIZE(hwsim_channels); |
564 | data->band.bitrates = data->rates; | 564 | data->band.bitrates = data->rates; |
565 | data->band.n_bitrates = ARRAY_SIZE(hwsim_rates); | 565 | data->band.n_bitrates = ARRAY_SIZE(hwsim_rates); |
566 | data->band.ht_info.ht_supported = 1; | 566 | data->band.ht_cap.ht_supported = true; |
567 | data->band.ht_info.cap = IEEE80211_HT_CAP_SUP_WIDTH | | 567 | data->band.ht_cap.cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | |
568 | IEEE80211_HT_CAP_GRN_FLD | | 568 | IEEE80211_HT_CAP_GRN_FLD | |
569 | IEEE80211_HT_CAP_SGI_40 | | 569 | IEEE80211_HT_CAP_SGI_40 | |
570 | IEEE80211_HT_CAP_DSSSCCK40; | 570 | IEEE80211_HT_CAP_DSSSCCK40; |
571 | data->band.ht_info.ampdu_factor = 0x3; | 571 | data->band.ht_cap.ampdu_factor = 0x3; |
572 | data->band.ht_info.ampdu_density = 0x6; | 572 | data->band.ht_cap.ampdu_density = 0x6; |
573 | memset(data->band.ht_info.supp_mcs_set, 0, | 573 | memset(&data->band.ht_cap.mcs, 0, |
574 | sizeof(data->band.ht_info.supp_mcs_set)); | 574 | sizeof(data->band.ht_cap.mcs)); |
575 | data->band.ht_info.supp_mcs_set[0] = 0xff; | 575 | data->band.ht_cap.mcs.rx_mask[0] = 0xff; |
576 | data->band.ht_info.supp_mcs_set[1] = 0xff; | 576 | data->band.ht_cap.mcs.rx_mask[1] = 0xff; |
577 | data->band.ht_info.supp_mcs_set[12] = | 577 | data->band.ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; |
578 | IEEE80211_HT_CAP_MCS_TX_DEFINED; | ||
579 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &data->band; | 578 | hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &data->band; |
580 | 579 | ||
581 | err = ieee80211_register_hw(hw); | 580 | err = ieee80211_register_hw(hw); |