Lines Matching +full:chan +full:- +full:name
3 * Copyright (c) 2002-2013, Jouni Malinen <j@w1.fi>
20 int chan, int *freq) in hw_get_channel_chan() argument
30 for (i = 0; i < mode->num_channels; i++) { in hw_get_channel_chan()
31 struct hostapd_channel_data *ch = &mode->channels[i]; in hw_get_channel_chan()
32 if (ch->chan == chan) { in hw_get_channel_chan()
34 *freq = ch->freq; in hw_get_channel_chan()
44 hw_mode_get_channel(struct hostapd_hw_modes *mode, int freq, int *chan) in hw_mode_get_channel() argument
48 for (i = 0; i < mode->num_channels; i++) { in hw_mode_get_channel()
49 struct hostapd_channel_data *ch = &mode->channels[i]; in hw_mode_get_channel()
51 if (ch->freq == freq) { in hw_mode_get_channel()
52 if (chan) in hw_mode_get_channel()
53 *chan = ch->chan; in hw_mode_get_channel()
63 hw_get_channel_freq(enum hostapd_hw_mode mode, int freq, int *chan, in hw_get_channel_freq() argument
69 if (chan) in hw_get_channel_freq()
70 *chan = 0; in hw_get_channel_freq()
78 if (curr_mode->mode != mode) in hw_get_channel_freq()
81 chan_data = hw_mode_get_channel(curr_mode, freq, chan); in hw_get_channel_freq()
90 int hw_get_freq(struct hostapd_hw_modes *mode, int chan) in hw_get_freq() argument
94 hw_get_channel_chan(mode, chan, &freq); in hw_get_freq()
103 int chan; in hw_get_chan() local
105 hw_get_channel_freq(mode, freq, &chan, hw_features, num_hw_features); in hw_get_chan()
107 return chan; in hw_get_chan()
123 pri_chan = p_chan->chan; in allowed_ht40_channel_pair()
124 sec_chan = s_chan->chan; in allowed_ht40_channel_pair()
139 pri_chan, p_chan->freq, sec_chan, s_chan->freq); in allowed_ht40_channel_pair()
143 if ((s_chan->flag & HOSTAPD_CHAN_DISABLED) || in allowed_ht40_channel_pair()
144 (ht40_plus && !(p_chan->allowed_bw & HOSTAPD_CHAN_WIDTH_40P)) || in allowed_ht40_channel_pair()
145 (!ht40_plus && !(p_chan->allowed_bw & HOSTAPD_CHAN_WIDTH_40M))) { in allowed_ht40_channel_pair()
186 if (ieee802_11_parse_elems((u8 *) (bss + 1), bss->ie_len, &elems, 0) != in get_pri_sec_chan()
189 *pri_chan = oper->primary_chan; in get_pri_sec_chan()
190 if (oper->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) { in get_pri_sec_chan()
191 int sec = oper->ht_param & in get_pri_sec_chan()
196 *sec_chan = *pri_chan - 4; in get_pri_sec_chan()
212 pri_chan->freq == sec_chan->freq) in check_40mhz_5g()
220 for (i = 0; i < scan_res->num; i++) { in check_40mhz_5g()
221 struct wpa_scan_res *bss = scan_res->res[i]; in check_40mhz_5g()
222 if (bss->freq == pri_chan->freq) in check_40mhz_5g()
224 else if (bss->freq == sec_chan->freq) in check_40mhz_5g()
239 for (i = 0; i < scan_res->num; i++) { in check_40mhz_5g()
240 struct wpa_scan_res *bss = scan_res->res[i]; in check_40mhz_5g()
242 if (pri_chan->chan == bss_pri_chan && in check_40mhz_5g()
243 sec_chan->chan == bss_sec_chan) { in check_40mhz_5g()
249 for (i = 0; i < scan_res->num; i++) { in check_40mhz_5g()
250 struct wpa_scan_res *bss = scan_res->res[i]; in check_40mhz_5g()
252 if (pri_chan->chan == bss_sec_chan && in check_40mhz_5g()
253 sec_chan->chan == bss_pri_chan) { in check_40mhz_5g()
257 MAC2STR(bss->bssid)); in check_40mhz_5g()
273 if (bss->freq < start || bss->freq > end || bss->freq == pri_freq) in check_20mhz_bss()
276 if (ieee802_11_parse_elems((u8 *) (bss + 1), bss->ie_len, &elems, 0) == in check_20mhz_bss()
282 MACSTR " freq=%d", MAC2STR(bss->bssid), bss->freq); in check_20mhz_bss()
288 if (oper->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK) in check_20mhz_bss()
292 MACSTR " freq=%d", MAC2STR(bss->bssid), bss->freq); in check_20mhz_bss()
314 affected_start = (pri_freq + sec_freq) / 2 - 25; in check_40mhz_2g4()
318 for (i = 0; i < scan_res->num; i++) { in check_40mhz_2g4()
319 struct wpa_scan_res *bss = scan_res->res[i]; in check_40mhz_2g4()
320 int pri = bss->freq; in check_40mhz_2g4()
336 sec = pri - 20; in check_40mhz_2g4()
347 MAC2STR(bss->bssid), bss->freq, pri_chan, sec_chan); in check_40mhz_2g4()
354 " <%d,%d> (chan=%d%c) vs. <%d,%d>", in check_40mhz_2g4()
355 MAC2STR(bss->bssid), in check_40mhz_2g4()
357 sec > pri ? '+' : '-', in check_40mhz_2g4()
363 if (ieee802_11_parse_elems((u8 *) (bss + 1), bss->ie_len, in check_40mhz_2g4()
370 if (le_to_host16(ht_cap->ht_capabilities_info) & in check_40mhz_2g4()
374 MACSTR, pri, MAC2STR(bss->bssid)); in check_40mhz_2g4()
386 u8 first_chan = *seg0 - 6, sec_chan; in punct_update_legacy_bw_80()
399 *seg0 -= 4; in punct_update_legacy_bw_80()
408 sec_chan = pri_chan - 4; in punct_update_legacy_bw_80()
410 if (bitmap & BIT((sec_chan - first_chan) / 4)) in punct_update_legacy_bw_80()
419 *seg0 -= 8; in punct_update_legacy_bw_160()
469 if (!he_cap || !he_cap->he_supported) in hostapd_set_freq_params()
471 if (!eht_cap || !eht_cap->eht_supported) in hostapd_set_freq_params()
474 data->mode = mode; in hostapd_set_freq_params()
475 data->freq = freq; in hostapd_set_freq_params()
476 data->channel = channel; in hostapd_set_freq_params()
477 data->ht_enabled = ht_enabled; in hostapd_set_freq_params()
478 data->vht_enabled = vht_enabled; in hostapd_set_freq_params()
479 data->he_enabled = he_enabled; in hostapd_set_freq_params()
480 data->eht_enabled = eht_enabled; in hostapd_set_freq_params()
481 data->sec_channel_offset = sec_channel_offset; in hostapd_set_freq_params()
482 data->center_freq1 = freq + sec_channel_offset * 10; in hostapd_set_freq_params()
483 data->center_freq2 = 0; in hostapd_set_freq_params()
485 data->bandwidth = 80; in hostapd_set_freq_params()
488 data->bandwidth = 160; in hostapd_set_freq_params()
490 data->bandwidth = 320; in hostapd_set_freq_params()
492 data->bandwidth = 40; in hostapd_set_freq_params()
494 data->bandwidth = 20; in hostapd_set_freq_params()
498 &data->edmg); in hostapd_set_freq_params()
501 if (!data->he_enabled && !data->eht_enabled) { in hostapd_set_freq_params()
503 "Can't set 6 GHz mode - HE or EHT aren't enabled"); in hostapd_set_freq_params()
504 return -1; in hostapd_set_freq_params()
510 return -1; in hostapd_set_freq_params()
517 return -1; in hostapd_set_freq_params()
520 data->center_freq1 = data->freq; in hostapd_set_freq_params()
529 return -1; in hostapd_set_freq_params()
540 return -1; in hostapd_set_freq_params()
548 return -1; in hostapd_set_freq_params()
556 return -1; in hostapd_set_freq_params()
560 data->bandwidth = (1 << (u8) bw) * 20; in hostapd_set_freq_params()
561 data->center_freq1 = freq1; in hostapd_set_freq_params()
562 data->center_freq2 = freq2; in hostapd_set_freq_params()
564 data->ht_enabled = 0; in hostapd_set_freq_params()
565 data->vht_enabled = 0; in hostapd_set_freq_params()
570 if (data->eht_enabled) switch (oper_chwidth) { in hostapd_set_freq_params()
572 if (!(eht_cap->phy_cap[EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_IDX] & in hostapd_set_freq_params()
576 return -1; in hostapd_set_freq_params()
583 if (data->he_enabled || data->eht_enabled) switch (oper_chwidth) { in hostapd_set_freq_params()
590 !(he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & in hostapd_set_freq_params()
594 return -1; in hostapd_set_freq_params()
602 !(he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & in hostapd_set_freq_params()
606 return -1; in hostapd_set_freq_params()
612 !(he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & in hostapd_set_freq_params()
616 return -1; in hostapd_set_freq_params()
621 !(he_cap->phy_cap[HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & in hostapd_set_freq_params()
625 return -1; in hostapd_set_freq_params()
630 } else if (data->vht_enabled) switch (oper_chwidth) { in hostapd_set_freq_params()
637 return -1; in hostapd_set_freq_params()
647 return -1; in hostapd_set_freq_params()
662 if (data->eht_enabled || data->he_enabled || in hostapd_set_freq_params()
663 data->vht_enabled) switch (oper_chwidth) { in hostapd_set_freq_params()
667 5000 + center_segment0 * 5 != data->center_freq1 && in hostapd_set_freq_params()
668 2407 + center_segment0 * 5 != data->center_freq1)) { in hostapd_set_freq_params()
671 center_segment0, data->center_freq1); in hostapd_set_freq_params()
672 return -1; in hostapd_set_freq_params()
677 center_segment1 == center_segment0 - 4) { in hostapd_set_freq_params()
680 return -1; in hostapd_set_freq_params()
682 data->center_freq2 = 5000 + center_segment1 * 5; in hostapd_set_freq_params()
685 data->bandwidth = 80; in hostapd_set_freq_params()
690 return -1; in hostapd_set_freq_params()
696 return -1; in hostapd_set_freq_params()
702 return -1; in hostapd_set_freq_params()
719 data->center_freq1 = 5000 + center_segment0 * 5; in hostapd_set_freq_params()
728 center_segment0 == channel - 2 || in hostapd_set_freq_params()
729 center_segment0 == channel - 6) in hostapd_set_freq_params()
730 data->center_freq1 = 5000 + center_segment0 * 5; in hostapd_set_freq_params()
734 return -1; in hostapd_set_freq_params()
739 data->bandwidth = 160; in hostapd_set_freq_params()
743 return -1; in hostapd_set_freq_params()
749 return -1; in hostapd_set_freq_params()
759 center_segment0 == channel - 2 || in hostapd_set_freq_params()
760 center_segment0 == channel - 6 || in hostapd_set_freq_params()
761 center_segment0 == channel - 10 || in hostapd_set_freq_params()
762 center_segment0 == channel - 14) in hostapd_set_freq_params()
763 data->center_freq1 = 5000 + center_segment0 * 5; in hostapd_set_freq_params()
767 return -1; in hostapd_set_freq_params()
771 data->bandwidth = 320; in hostapd_set_freq_params()
772 if (!data->eht_enabled || !is_6ghz_freq(freq)) { in hostapd_set_freq_params()
775 return -1; in hostapd_set_freq_params()
780 return -1; in hostapd_set_freq_params()
790 center_segment0 == channel - 2 || in hostapd_set_freq_params()
791 center_segment0 == channel - 6 || in hostapd_set_freq_params()
792 center_segment0 == channel - 10 || in hostapd_set_freq_params()
793 center_segment0 == channel - 14 || in hostapd_set_freq_params()
794 center_segment0 == channel - 18 || in hostapd_set_freq_params()
795 center_segment0 == channel - 22 || in hostapd_set_freq_params()
796 center_segment0 == channel - 26 || in hostapd_set_freq_params()
797 center_segment0 == channel - 30) in hostapd_set_freq_params()
798 data->center_freq1 = 5000 + center_segment0 * 5; in hostapd_set_freq_params()
802 return -1; in hostapd_set_freq_params()
821 htcaps->ht_capabilities_info &= ~msk; in set_disable_ht40()
823 htcaps->ht_capabilities_info |= msk; in set_disable_ht40()
830 const char *name) in _ieee80211ac_cap_check() argument
842 name); in _ieee80211ac_cap_check()
851 const char *name) in ieee80211ac_cap_check_max() argument
859 name, conf_val >> shift, hw_max >> shift); in ieee80211ac_cap_check_max()
926 int chan_bw_allowed(const struct hostapd_channel_data *chan, u32 bw, in chan_bw_allowed() argument
959 return (chan->allowed_bw & bw_mask) == bw_mask; in chan_bw_allowed()
964 int chan_pri_allowed(const struct hostapd_channel_data *chan) in chan_pri_allowed() argument
966 return !(chan->flag & HOSTAPD_CHAN_DISABLED) && in chan_pri_allowed()
967 (chan->allowed_bw & HOSTAPD_CHAN_WIDTH_20); in chan_pri_allowed()
971 /* IEEE P802.11be/D3.0, Table 36-30 - Definition of the Punctured Channel
972 * Information field in the U-SIG for an EHT MU PPDU using non-OFDMA