Lines Matching +full:switching +full:- +full:freq
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 || in hostapd_eid_ht_capabilities()
30 hapd->conf->disable_11n || is_6ghz_op_class(hapd->iconf->op_class)) in hostapd_eid_ht_capabilities()
38 cap->ht_capabilities_info = host_to_le16(hapd->iconf->ht_capab); in hostapd_eid_ht_capabilities()
39 cap->a_mpdu_params = hapd->iface->current_mode->a_mpdu_params; in hostapd_eid_ht_capabilities()
40 os_memcpy(cap->supported_mcs_set, hapd->iface->current_mode->mcs_set, in hostapd_eid_ht_capabilities()
49 if (hapd->iconf->obss_interval) { in hostapd_eid_ht_capabilities()
57 scan_params->width_trigger_scan_interval = in hostapd_eid_ht_capabilities()
58 host_to_le16(hapd->iconf->obss_interval); in hostapd_eid_ht_capabilities()
61 * (IEEE Std 802.11-2012, 8.4.2.61 and MIB defval) */ in hostapd_eid_ht_capabilities()
62 scan_params->scan_passive_dwell = in hostapd_eid_ht_capabilities()
64 scan_params->scan_active_dwell = in hostapd_eid_ht_capabilities()
66 scan_params->scan_passive_total_per_channel = in hostapd_eid_ht_capabilities()
68 scan_params->scan_active_total_per_channel = in hostapd_eid_ht_capabilities()
70 scan_params->channel_transition_delay_factor = in hostapd_eid_ht_capabilities()
72 scan_params->scan_activity_threshold = in hostapd_eid_ht_capabilities()
87 if (!hapd->iconf->ieee80211n || hapd->conf->disable_11n || in hostapd_eid_ht_operation()
88 is_6ghz_op_class(hapd->iconf->op_class)) in hostapd_eid_ht_operation()
97 oper->primary_chan = hapd->iconf->channel; in hostapd_eid_ht_operation()
98 oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode); in hostapd_eid_ht_operation()
99 if (hapd->iconf->secondary_channel == 1) in hostapd_eid_ht_operation()
100 oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE | in hostapd_eid_ht_operation()
102 if (hapd->iconf->secondary_channel == -1) in hostapd_eid_ht_operation()
103 oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW | in hostapd_eid_ht_operation()
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) in hostapd_ht_operation_update()
132 __func__, iface->ht_op_mode); in hostapd_ht_operation_update()
134 if (!(iface->ht_op_mode & HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT) in hostapd_ht_operation_update()
135 && iface->num_sta_ht_no_gf) { in hostapd_ht_operation_update()
136 iface->ht_op_mode |= HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT; in hostapd_ht_operation_update()
138 } else if ((iface->ht_op_mode & in hostapd_ht_operation_update()
140 iface->num_sta_ht_no_gf == 0) { in hostapd_ht_operation_update()
141 iface->ht_op_mode &= ~HT_OPER_OP_MODE_NON_GF_HT_STAS_PRESENT; in hostapd_ht_operation_update()
145 if (!(iface->ht_op_mode & HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT) && in hostapd_ht_operation_update()
146 (iface->num_sta_no_ht || iface->olbc_ht)) { in hostapd_ht_operation_update()
147 iface->ht_op_mode |= HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT; in hostapd_ht_operation_update()
149 } else if ((iface->ht_op_mode & in hostapd_ht_operation_update()
151 (iface->num_sta_no_ht == 0 && !iface->olbc_ht)) { in hostapd_ht_operation_update()
152 iface->ht_op_mode &= ~HT_OPER_OP_MODE_OBSS_NON_HT_STAS_PRESENT; in hostapd_ht_operation_update()
156 if (iface->num_sta_no_ht) in hostapd_ht_operation_update()
158 else if (iface->conf->secondary_channel && iface->num_sta_ht_20mhz) in hostapd_ht_operation_update()
160 else if (iface->olbc_ht) in hostapd_ht_operation_update()
165 cur_op_mode = iface->ht_op_mode & HT_OPER_OP_MODE_HT_PROT_MASK; in hostapd_ht_operation_update()
167 iface->ht_op_mode &= ~HT_OPER_OP_MODE_HT_PROT_MASK; in hostapd_ht_operation_update()
168 iface->ht_op_mode |= new_op_mode; in hostapd_ht_operation_update()
173 __func__, iface->ht_op_mode, op_mode_changes); in hostapd_ht_operation_update()
185 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) in is_40_allowed()
188 pri_freq = hostapd_hw_get_freq(iface->bss[0], iface->conf->channel); in is_40_allowed()
190 if (iface->conf->secondary_channel > 0) in is_40_allowed()
193 sec_freq = pri_freq - 20; in is_40_allowed()
195 affected_start = (pri_freq + sec_freq) / 2 - 25; in is_40_allowed()
202 wpa_printf(MSG_ERROR, "Neighboring BSS: freq=%d", pri); in is_40_allowed()
210 struct hostapd_iface *iface = hapd->iface; in hostapd_2040_coex_action()
221 MACSTR, MAC2STR(mgmt->sa)); in hostapd_2040_coex_action()
223 hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, in hostapd_2040_coex_action()
224 HOSTAPD_LEVEL_DEBUG, "hostapd_public_action - action=%d", in hostapd_2040_coex_action()
225 mgmt->u.action.u.public_action.action); in hostapd_2040_coex_action()
227 if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET)) { in hostapd_2040_coex_action()
241 if (bc_ie->element_id != WLAN_EID_20_40_BSS_COEXISTENCE || in hostapd_2040_coex_action()
242 bc_ie->length < 1) { in hostapd_2040_coex_action()
244 bc_ie->element_id, bc_ie->length); in hostapd_2040_coex_action()
247 if (len < IEEE80211_HDRLEN + 2 + 2 + bc_ie->length) { in hostapd_2040_coex_action()
252 data += 2 + bc_ie->length; in hostapd_2040_coex_action()
256 bc_ie->coex_param, in hostapd_2040_coex_action()
257 (bc_ie->coex_param & BIT(0)) ? "[InfoReq]" : "", in hostapd_2040_coex_action()
258 (bc_ie->coex_param & BIT(1)) ? "[40MHzIntolerant]" : "", in hostapd_2040_coex_action()
259 (bc_ie->coex_param & BIT(2)) ? "[20MHzBSSWidthReq]" : "", in hostapd_2040_coex_action()
260 (bc_ie->coex_param & BIT(3)) ? "[OBSSScanExemptionReq]" : "", in hostapd_2040_coex_action()
261 (bc_ie->coex_param & BIT(4)) ? in hostapd_2040_coex_action()
263 (bc_ie->coex_param & (BIT(5) | BIT(6) | BIT(7))) ? in hostapd_2040_coex_action()
266 if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_20MHZ_WIDTH_REQ) { in hostapd_2040_coex_action()
267 /* Intra-BSS communication prohibiting 20/40 MHz BSS operation in hostapd_2040_coex_action()
269 sta = ap_get_sta(hapd, mgmt->sa); in hostapd_2040_coex_action()
270 if (!sta || !(sta->flags & WLAN_STA_ASSOC)) { in hostapd_2040_coex_action()
272 "Ignore intra-BSS 20/40 BSS Coexistence Management frame from not-associated STA"); in hostapd_2040_coex_action()
276 hostapd_logger(hapd, mgmt->sa, in hostapd_2040_coex_action()
283 if (bc_ie->coex_param & WLAN_20_40_BSS_COEX_40MHZ_INTOL) { in hostapd_2040_coex_action()
284 /* Inter-BSS communication prohibiting 20/40 MHz BSS operation in hostapd_2040_coex_action()
286 hostapd_logger(hapd, mgmt->sa, in hostapd_2040_coex_action()
294 while (start + len - data >= 3 && in hostapd_2040_coex_action()
298 if (ielen > start + len - data - 2) { in hostapd_2040_coex_action()
306 ic_report->op_class); in hostapd_2040_coex_action()
310 for (i = 0; i < ielen - 1; i++) { in hostapd_2040_coex_action()
311 u8 chan = ic_report->variable[i]; in hostapd_2040_coex_action()
313 if (chan == iface->conf->channel) in hostapd_2040_coex_action()
317 hostapd_logger(hapd, mgmt->sa, in hostapd_2040_coex_action()
328 is_ht40_allowed, iface->num_sta_ht40_intolerant); in hostapd_2040_coex_action()
331 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) { in hostapd_2040_coex_action()
332 if (iface->conf->secondary_channel) { in hostapd_2040_coex_action()
333 hostapd_logger(hapd, mgmt->sa, in hostapd_2040_coex_action()
336 "Switching to 20 MHz operation"); in hostapd_2040_coex_action()
337 iface->conf->secondary_channel = 0; in hostapd_2040_coex_action()
340 if (!iface->num_sta_ht40_intolerant && in hostapd_2040_coex_action()
341 iface->conf->obss_interval) { in hostapd_2040_coex_action()
344 iface->conf->obss_interval; in hostapd_2040_coex_action()
345 eloop_cancel_timeout(ap_ht2040_timeout, hapd->iface, in hostapd_2040_coex_action()
348 hapd->iface, NULL); in hostapd_2040_coex_action()
361 * Disable HT caps for STAs associated to no-HT BSSes, or for stations in copy_sta_ht_capab()
365 if (!ht_capab || !(sta->flags & WLAN_STA_WMM) || in copy_sta_ht_capab()
366 !hapd->iconf->ieee80211n || hapd->conf->disable_11n) { in copy_sta_ht_capab()
367 sta->flags &= ~WLAN_STA_HT; in copy_sta_ht_capab()
368 os_free(sta->ht_capabilities); in copy_sta_ht_capab()
369 sta->ht_capabilities = NULL; in copy_sta_ht_capab()
373 if (sta->ht_capabilities == NULL) { in copy_sta_ht_capab()
374 sta->ht_capabilities = in copy_sta_ht_capab()
376 if (sta->ht_capabilities == NULL) in copy_sta_ht_capab()
380 sta->flags |= WLAN_STA_HT; in copy_sta_ht_capab()
381 os_memcpy(sta->ht_capabilities, ht_capab, in copy_sta_ht_capab()
390 if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) in ht40_intolerant_add()
394 " in Association Request", MAC2STR(sta->addr)); in ht40_intolerant_add()
396 if (sta->ht40_intolerant_set) in ht40_intolerant_add()
399 sta->ht40_intolerant_set = 1; in ht40_intolerant_add()
400 iface->num_sta_ht40_intolerant++; in ht40_intolerant_add()
403 if (iface->conf->secondary_channel && in ht40_intolerant_add()
404 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) { in ht40_intolerant_add()
405 iface->conf->secondary_channel = 0; in ht40_intolerant_add()
413 if (!sta->ht40_intolerant_set) in ht40_intolerant_remove()
416 sta->ht40_intolerant_set = 0; in ht40_intolerant_remove()
417 iface->num_sta_ht40_intolerant--; in ht40_intolerant_remove()
419 if (iface->num_sta_ht40_intolerant == 0 && in ht40_intolerant_remove()
420 (iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET) && in ht40_intolerant_remove()
421 (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX)) { in ht40_intolerant_remove()
423 iface->conf->obss_interval; in ht40_intolerant_remove()
425 "HT: Start 20->40 MHz transition timer (%d seconds)", in ht40_intolerant_remove()
438 ht_capab = le_to_host16(sta->ht_capabilities->ht_capabilities_info); in update_sta_ht()
440 "0x%04x", MAC2STR(sta->addr), ht_capab); in update_sta_ht()
442 if (!sta->no_ht_gf_set) { in update_sta_ht()
443 sta->no_ht_gf_set = 1; in update_sta_ht()
444 hapd->iface->num_sta_ht_no_gf++; in update_sta_ht()
446 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no greenfield, num " in update_sta_ht()
447 "of non-gf stations %d", in update_sta_ht()
448 __func__, MAC2STR(sta->addr), in update_sta_ht()
449 hapd->iface->num_sta_ht_no_gf); in update_sta_ht()
452 if (!sta->ht_20mhz_set) { in update_sta_ht()
453 sta->ht_20mhz_set = 1; in update_sta_ht()
454 hapd->iface->num_sta_ht_20mhz++; in update_sta_ht()
456 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - 20 MHz HT, num of " in update_sta_ht()
458 __func__, MAC2STR(sta->addr), in update_sta_ht()
459 hapd->iface->num_sta_ht_20mhz); in update_sta_ht()
463 ht40_intolerant_add(hapd->iface, sta); in update_sta_ht()
469 if (!sta->no_ht_set) { in update_sta_no_ht()
470 sta->no_ht_set = 1; in update_sta_no_ht()
471 hapd->iface->num_sta_no_ht++; in update_sta_no_ht()
473 if (hapd->iconf->ieee80211n) { in update_sta_no_ht()
474 wpa_printf(MSG_DEBUG, "%s STA " MACSTR " - no HT, num of " in update_sta_no_ht()
475 "non-HT stations %d", in update_sta_no_ht()
476 __func__, MAC2STR(sta->addr), in update_sta_no_ht()
477 hapd->iface->num_sta_no_ht); in update_sta_no_ht()
484 if ((sta->flags & WLAN_STA_HT) && sta->ht_capabilities) in update_ht_state()
489 return hostapd_ht_operation_update(hapd->iface); in update_ht_state()
502 cap = le_to_host16(neg_ht_cap->ht_capabilities_info); in hostapd_get_ht_capab()
506 * non-symmetric features like STBC and SMPS. Just because in hostapd_get_ht_capab()
509 cap &= (hapd->iconf->ht_capab | HT_CAP_INFO_RX_STBC_MASK | in hostapd_get_ht_capab()
517 if (!(hapd->iconf->ht_capab & HT_CAP_INFO_RX_STBC_MASK)) in hostapd_get_ht_capab()
519 if (!(hapd->iconf->ht_capab & HT_CAP_INFO_TX_STBC)) in hostapd_get_ht_capab()
522 neg_ht_cap->ht_capabilities_info = host_to_le16(cap); in hostapd_get_ht_capab()
530 wpa_printf(MSG_INFO, "Switching to 40 MHz operation"); in ap_ht2040_timeout()
532 iface->conf->secondary_channel = iface->secondary_ch; in ap_ht2040_timeout()