Lines Matching +full:40 +full:- +full:bit
3 * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2007-2008, Intel Corporation
29 if (!hapd->iconf->ieee80211n || !hapd->iface->current_mode ||
30 hapd->conf->disable_11n || is_6ghz_op_class(hapd->iconf->op_class))
38 cap->ht_capabilities_info = host_to_le16(hapd->iconf->ht_capab);
39 cap->a_mpdu_params = hapd->iface->current_mode->a_mpdu_params;
40 os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set,
49 if (hapd->iconf->obss_interval) {
57 scan_params->width_trigger_scan_interval =
58 host_to_le16(hapd->iconf->obss_interval);
61 * (IEEE Std 802.11-2012, 8.4.2.61 and MIB defval) */
62 scan_params->scan_passive_dwell =
64 scan_params->scan_active_dwell =
66 scan_params->scan_passive_total_per_channel =
68 scan_params->scan_active_total_per_channel =
70 scan_params->channel_transition_delay_factor =
72 scan_params->scan_activity_threshold =
87 if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n ||
88 is_6ghz_op_class(hapd->iconf->op_class))
97 oper->primary_chan = hapd->iconf->channel;
98 oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
99 if (hapd->iconf->secondary_channel == 1)
100 oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
102 if (hapd->iconf->secondary_channel == -1)
103 oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
115 - all STAs in the BSS are 20/40 MHz HT in 20/40 MHz BSS or
116 - all STAs in the BSS are 20 MHz HT in 20 MHz BSS
117 Set to 1 (HT non-member protection) if there may be non-HT STAs
121 Set to 3 (HT mixed mode) when one or more non-HT STAs are associated
128 if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed)
132 __func__, iface->ht_op_mode);
134 if (!(iface->ht_op_mode & HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT)
135 && iface->num_sta_ht_no_gf) {
136 iface->ht_op_mode |= HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT;
138 } else if ((iface->ht_op_mode &
140 iface->num_sta_ht_no_gf == 0) {
141 iface->ht_op_mode &= ~HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT;
145 if (!(iface->ht_op_mode & HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT) &&
146 (iface->num_sta_no_ht || iface->olbc_ht)) {
147 iface->ht_op_mode |= HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT;
149 } else if ((iface->ht_op_mode &
151 (iface->num_sta_no_ht == 0 && !iface->olbc_ht)) {
152 iface->ht_op_mode &= ~HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT;
156 if (iface->num_sta_no_ht)
158 else if (iface->conf->secondary_channel && iface->num_sta_ht_20mhz)
160 else if (iface->olbc_ht)
165 cur_op_mode = iface->ht_op_mode & HT_OPER_OP_MODE_HT_PROT_MASK;
167 iface->ht_op_mode &= ~HT_OPER_OP_MODE_HT_PROT_MASK;
168 iface->ht_op_mode |= new_op_mode;
173 __func__, iface->ht_op_mode, op_mode_changes);
185 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
188 pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel);
190 if (iface->conf->secondary_channel > 0)
193 sec_freq = pri_freq - 20;
195 affected_start = (pri_freq + sec_freq) / 2 - 25;
200 wpa_printf(MSG_ERROR, "40 MHz affected channel range: [%d,%d] MHz",
210 struct hostapd_iface *iface = hapd->iface;
220 "HT: Received 20/40 BSS Coexistence Management frame from "
221 MACSTR, MAC2STR(mgmt->sa));
223 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
224 HOSTAPD_LEVEL_DEBUG, "hostapd_public_action - action=%d",
225 mgmt->u.action.u.public_action.action);
227 if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)) {
229 "Ignore 20/40 BSS Coexistence Management frame since 40 MHz capability is not enabled");
235 "Ignore too short 20/40 BSS Coexistence Management frame");
239 /* 20/40 BSS Coexistence element */
241 if (bc_ie->element_id != WLAN_EID_20_40_BSS_COEXISTENCE ||
242 bc_ie->length < 1) {
244 bc_ie->element_id, bc_ie->length);
247 if (len < IEEE80211_HDRLEN + 2 + 2 + bc_ie->length) {
249 "Truncated 20/40 BSS Coexistence element");
252 data += 2 + bc_ie->length;
255 "20/40 BSS Coexistence Information field: 0x%x (%s%s%s%s%s%s)",
256 bc_ie->coex_param,
257 (bc_ie->coex_param & BIT(0)) ? "[InfoReq]" : "",
258 (bc_ie->coex_param & BIT(1)) ? "[40MHzIntolerant]" : "",
259 (bc_ie->coex_param & BIT(2)) ? "[20MHzBSSWidthReq]" : "",
260 (bc_ie->coex_param & BIT(3)) ? "[OBSSScanExemptionReq]" : "",
261 (bc_ie->coex_param & BIT(4)) ?
263 (bc_ie->coex_param & (BIT(5) | BIT(6) | BIT(7))) ?
266 if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ) {
267 /* Intra-BSS communication prohibiting 20/40 MHz BSS operation
269 sta = ap_get_sta(hapd, mgmt->sa);
270 if (!sta || !(sta->flags & WLAN_STA_ASSOC)) {
272 "Ignore intra-BSS 20/40 BSS Coexistence Management frame from not-associated STA");
276 hostapd_logger(hapd, mgmt->sa,
279 "20 MHz BSS width request bit is set in BSS coexistence information field");
283 if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_40MHZ_INTOL) {
284 /* Inter-BSS communication prohibiting 20/40 MHz BSS operation
286 hostapd_logger(hapd, mgmt->sa,
289 "40 MHz intolerant bit is set in BSS coexistence information field");
293 /* 20/40 BSS Intolerant Channel Report element (zero or more times) */
294 while (start + len - data >= 3 &&
298 if (ielen > start + len - data - 2) {
300 "Truncated 20/40 BSS Intolerant Channel Report element");
305 "20/40 BSS Intolerant Channel Report: Operating Class %u",
306 ic_report->op_class);
310 for (i = 0; i < ielen - 1; i++) {
311 u8 chan = ic_report->variable[i];
313 if (chan == iface->conf->channel)
317 hostapd_logger(hapd, mgmt->sa,
328 is_ht40_allowed, iface->num_sta_ht40_intolerant);
331 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
332 if (iface->conf->secondary_channel) {
333 hostapd_logger(hapd, mgmt->sa,
337 iface->conf->secondary_channel = 0;
340 if (!iface->num_sta_ht40_intolerant &&
341 iface->conf->obss_interval) {
344 iface->conf->obss_interval;
345 eloop_cancel_timeout(ap_ht2040_timeout, hapd->iface,
348 hapd->iface, NULL);
350 "Reschedule HT 20/40 timeout to occur in %u seconds",
361 * Disable HT caps for STAs associated to no-HT BSSes, or for stations
365 if (!ht_capab || !(sta->flags & WLAN_STA_WMM) ||
366 !hapd->iconf->ieee80211n || hapd->conf->disable_11n) {
367 sta->flags &= ~WLAN_STA_HT;
368 os_free(sta->ht_capabilities);
369 sta->ht_capabilities = NULL;
373 if (sta->ht_capabilities == NULL) {
374 sta->ht_capabilities =
376 if (sta->ht_capabilities == NULL)
380 sta->flags |= WLAN_STA_HT;
381 os_memcpy(sta->ht_capabilities, ht_capab,
390 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
394 " in Association Request", MAC2STR(sta->addr));
396 if (sta->ht40_intolerant_set)
399 sta->ht40_intolerant_set = 1;
400 iface->num_sta_ht40_intolerant++;
403 if (iface->conf->secondary_channel &&
404 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
405 iface->conf->secondary_channel = 0;
413 if (!sta->ht40_intolerant_set)
416 sta->ht40_intolerant_set = 0;
417 iface->num_sta_ht40_intolerant--;
419 if (iface->num_sta_ht40_intolerant == 0 &&
420 (iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) &&
421 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) {
423 iface->conf->obss_interval;
425 "HT: Start 20->40 MHz transition timer (%d seconds)",
438 ht_capab = le_to_host16(sta->ht_capabilities->ht_capabilities_info);
440 "0x%04x", MAC2STR(sta->addr), ht_capab);
442 if (!sta->no_ht_gf_set) {
443 sta->no_ht_gf_set = 1;
444 hapd->iface->num_sta_ht_no_gf++;
446 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no greenfield, num "
447 "of non-gf stations %d",
448 __func__, MAC2STR(sta->addr),
449 hapd->iface->num_sta_ht_no_gf);
452 if (!sta->ht_20mhz_set) {
453 sta->ht_20mhz_set = 1;
454 hapd->iface->num_sta_ht_20mhz++;
456 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - 20 MHz HT, num of "
458 __func__, MAC2STR(sta->addr),
459 hapd->iface->num_sta_ht_20mhz);
463 ht40_intolerant_add(hapd->iface, sta);
469 if (!sta->no_ht_set) {
470 sta->no_ht_set = 1;
471 hapd->iface->num_sta_no_ht++;
473 if (hapd->iconf->ieee80211n) {
474 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no HT, num of "
475 "non-HT stations %d",
476 __func__, MAC2STR(sta->addr),
477 hapd->iface->num_sta_no_ht);
484 if ((sta->flags & WLAN_STA_HT) && sta->ht_capabilities)
489 return hostapd_ht_operation_update(hapd->iface);
502 cap = le_to_host16(neg_ht_cap->ht_capabilities_info);
506 * non-symmetric features like STBC and SMPS. Just because
509 cap &= (hapd->iconf->ht_capab | HT_CAP_INFO_RX_STBC_MASK |
517 if (!(hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK))
519 if (!(hapd->iconf->ht_capab & HT_CAP_INFO_TX_STBC))
522 neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
530 wpa_printf(MSG_INFO, "Switching to 40 MHz operation");
532 iface->conf->secondary_channel = iface->secondary_ch;