Lines Matching +full:ieee80211 +full:- +full:freq +full:- +full:limit
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright 2007-2009 Johannes Berg <johannes@sipsolutions.net>
6 * Copyright 2013-2014 Intel Mobile Communications GmbH
8 * Copyright (C) 2018-2023 Intel Corporation
14 #include <linux/ieee80211.h>
24 #include "rdev-ops.h"
31 struct ieee80211_rate *result = &sband->bitrates[0]; in ieee80211_get_response_rate()
34 for (i = 0; i < sband->n_bitrates; i++) { in ieee80211_get_response_rate()
37 if (sband->bitrates[i].bitrate > bitrate) in ieee80211_get_response_rate()
39 result = &sband->bitrates[i]; in ieee80211_get_response_rate()
56 if (sband->band == NL80211_BAND_2GHZ) in ieee80211_mandatory_rates()
61 bitrates = sband->bitrates; in ieee80211_mandatory_rates()
62 for (i = 0; i < sband->n_bitrates; i++) in ieee80211_mandatory_rates()
112 if (WARN_ON(!chan || chan->band != NL80211_BAND_S1GHZ)) in ieee80211_s1g_channel_width()
118 if (chan->flags & IEEE80211_CHAN_1MHZ) in ieee80211_s1g_channel_width()
120 else if (chan->flags & IEEE80211_CHAN_2MHZ) in ieee80211_s1g_channel_width()
122 else if (chan->flags & IEEE80211_CHAN_4MHZ) in ieee80211_s1g_channel_width()
124 else if (chan->flags & IEEE80211_CHAN_8MHZ) in ieee80211_s1g_channel_width()
126 else if (chan->flags & IEEE80211_CHAN_16MHZ) in ieee80211_s1g_channel_width()
136 int ieee80211_freq_khz_to_channel(u32 freq) in ieee80211_freq_khz_to_channel() argument
139 freq = KHZ_TO_MHZ(freq); in ieee80211_freq_khz_to_channel()
142 if (freq == 2484) in ieee80211_freq_khz_to_channel()
144 else if (freq < 2484) in ieee80211_freq_khz_to_channel()
145 return (freq - 2407) / 5; in ieee80211_freq_khz_to_channel()
146 else if (freq >= 4910 && freq <= 4980) in ieee80211_freq_khz_to_channel()
147 return (freq - 4000) / 5; in ieee80211_freq_khz_to_channel()
148 else if (freq < 5925) in ieee80211_freq_khz_to_channel()
149 return (freq - 5000) / 5; in ieee80211_freq_khz_to_channel()
150 else if (freq == 5935) in ieee80211_freq_khz_to_channel()
152 else if (freq <= 45000) /* DMG band lower limit */ in ieee80211_freq_khz_to_channel()
154 return (freq - 5950) / 5; in ieee80211_freq_khz_to_channel()
155 else if (freq >= 58320 && freq <= 70200) in ieee80211_freq_khz_to_channel()
156 return (freq - 56160) / 2160; in ieee80211_freq_khz_to_channel()
163 u32 freq) in ieee80211_get_channel_khz() argument
170 sband = wiphy->bands[band]; in ieee80211_get_channel_khz()
175 for (i = 0; i < sband->n_channels; i++) { in ieee80211_get_channel_khz()
176 struct ieee80211_channel *chan = &sband->channels[i]; in ieee80211_get_channel_khz()
178 if (ieee80211_channel_to_khz(chan) == freq) in ieee80211_get_channel_khz()
191 switch (sband->band) { in set_mandatory_flags_band()
195 for (i = 0; i < sband->n_bitrates; i++) { in set_mandatory_flags_band()
196 if (sband->bitrates[i].bitrate == 60 || in set_mandatory_flags_band()
197 sband->bitrates[i].bitrate == 120 || in set_mandatory_flags_band()
198 sband->bitrates[i].bitrate == 240) { in set_mandatory_flags_band()
199 sband->bitrates[i].flags |= in set_mandatory_flags_band()
201 want--; in set_mandatory_flags_band()
209 for (i = 0; i < sband->n_bitrates; i++) { in set_mandatory_flags_band()
210 switch (sband->bitrates[i].bitrate) { in set_mandatory_flags_band()
215 sband->bitrates[i].flags |= in set_mandatory_flags_band()
218 want--; in set_mandatory_flags_band()
223 sband->bitrates[i].flags |= in set_mandatory_flags_band()
225 want--; in set_mandatory_flags_band()
228 sband->bitrates[i].flags |= in set_mandatory_flags_band()
237 WARN_ON(!sband->ht_cap.ht_supported); in set_mandatory_flags_band()
238 WARN_ON((sband->ht_cap.mcs.rx_mask[0] & 0x1e) != 0x1e); in set_mandatory_flags_band()
241 /* Figure 9-589bd: 3 means unsupported, so != 3 means at least in set_mandatory_flags_band()
244 WARN_ON((sband->s1g_cap.nss_mcs[0] & 0x3) == 0x3); in set_mandatory_flags_band()
258 if (wiphy->bands[band]) in ieee80211_set_bitrate_flags()
259 set_mandatory_flags_band(wiphy->bands[band]); in ieee80211_set_bitrate_flags()
265 for (i = 0; i < wiphy->n_cipher_suites; i++) in cfg80211_supported_cipher_suite()
266 if (cipher == wiphy->cipher_suites[i]) in cfg80211_supported_cipher_suite()
274 struct wiphy *wiphy = &rdev->wiphy; in cfg80211_igtk_cipher_supported()
277 for (i = 0; i < wiphy->n_cipher_suites; i++) { in cfg80211_igtk_cipher_supported()
278 switch (wiphy->cipher_suites[i]) { in cfg80211_igtk_cipher_supported()
297 else if (wiphy_ext_feature_isset(&rdev->wiphy, in cfg80211_valid_key_idx()
299 wiphy_ext_feature_isset(&rdev->wiphy, in cfg80211_valid_key_idx()
318 return -EINVAL; in cfg80211_validate_key_settings()
320 if (!pairwise && mac_addr && !(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)) in cfg80211_validate_key_settings()
321 return -EINVAL; in cfg80211_validate_key_settings()
324 return -EINVAL; in cfg80211_validate_key_settings()
326 switch (params->cipher) { in cfg80211_validate_key_settings()
330 params->mode != NL80211_KEY_RX_TX) in cfg80211_validate_key_settings()
331 return -EINVAL; in cfg80211_validate_key_settings()
337 /* IEEE802.11-2016 allows only 0 and - when supporting in cfg80211_validate_key_settings()
338 * Extended Key ID - 1 as index for pairwise keys. in cfg80211_validate_key_settings()
344 if ((params->mode == NL80211_KEY_NO_TX && !pairwise) || in cfg80211_validate_key_settings()
345 params->mode == NL80211_KEY_SET_TX) in cfg80211_validate_key_settings()
346 return -EINVAL; in cfg80211_validate_key_settings()
347 if (wiphy_ext_feature_isset(&rdev->wiphy, in cfg80211_validate_key_settings()
350 return -EINVAL; in cfg80211_validate_key_settings()
352 return -EINVAL; in cfg80211_validate_key_settings()
359 /* Disallow BIP (group-only) cipher as pairwise cipher */ in cfg80211_validate_key_settings()
361 return -EINVAL; in cfg80211_validate_key_settings()
363 return -EINVAL; in cfg80211_validate_key_settings()
368 return -EINVAL; in cfg80211_validate_key_settings()
374 switch (params->cipher) { in cfg80211_validate_key_settings()
376 if (params->key_len != WLAN_KEY_LEN_WEP40) in cfg80211_validate_key_settings()
377 return -EINVAL; in cfg80211_validate_key_settings()
380 if (params->key_len != WLAN_KEY_LEN_TKIP) in cfg80211_validate_key_settings()
381 return -EINVAL; in cfg80211_validate_key_settings()
384 if (params->key_len != WLAN_KEY_LEN_CCMP) in cfg80211_validate_key_settings()
385 return -EINVAL; in cfg80211_validate_key_settings()
388 if (params->key_len != WLAN_KEY_LEN_CCMP_256) in cfg80211_validate_key_settings()
389 return -EINVAL; in cfg80211_validate_key_settings()
392 if (params->key_len != WLAN_KEY_LEN_GCMP) in cfg80211_validate_key_settings()
393 return -EINVAL; in cfg80211_validate_key_settings()
396 if (params->key_len != WLAN_KEY_LEN_GCMP_256) in cfg80211_validate_key_settings()
397 return -EINVAL; in cfg80211_validate_key_settings()
400 if (params->key_len != WLAN_KEY_LEN_WEP104) in cfg80211_validate_key_settings()
401 return -EINVAL; in cfg80211_validate_key_settings()
404 if (params->key_len != WLAN_KEY_LEN_AES_CMAC) in cfg80211_validate_key_settings()
405 return -EINVAL; in cfg80211_validate_key_settings()
408 if (params->key_len != WLAN_KEY_LEN_BIP_CMAC_256) in cfg80211_validate_key_settings()
409 return -EINVAL; in cfg80211_validate_key_settings()
412 if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_128) in cfg80211_validate_key_settings()
413 return -EINVAL; in cfg80211_validate_key_settings()
416 if (params->key_len != WLAN_KEY_LEN_BIP_GMAC_256) in cfg80211_validate_key_settings()
417 return -EINVAL; in cfg80211_validate_key_settings()
422 * allow using it -- but the driver must check in cfg80211_validate_key_settings()
430 if (params->seq) { in cfg80211_validate_key_settings()
431 switch (params->cipher) { in cfg80211_validate_key_settings()
435 return -EINVAL; in cfg80211_validate_key_settings()
445 if (params->seq_len != 6) in cfg80211_validate_key_settings()
446 return -EINVAL; in cfg80211_validate_key_settings()
451 if (!cfg80211_supported_cipher_suite(&rdev->wiphy, params->cipher)) in cfg80211_validate_key_settings()
452 return -EINVAL; in cfg80211_validate_key_settings()
506 (const struct ieee80211_hdr *)skb->data; in ieee80211_get_hdrlen_from_skb()
509 if (unlikely(skb->len < 10)) in ieee80211_get_hdrlen_from_skb()
511 hdrlen = ieee80211_hdrlen(hdr->frame_control); in ieee80211_get_hdrlen_from_skb()
512 if (unlikely(hdrlen > skb->len)) in ieee80211_get_hdrlen_from_skb()
521 /* 802.11-2012, 8.2.4.7.3 */ in __ieee80211_get_mesh_hdrlen()
535 return __ieee80211_get_mesh_hdrlen(meshhdr->flags); in ieee80211_get_mesh_hdrlen()
572 ieee80211_get_8023_tunnel_proto(skb->data + hdrlen, in ieee80211_strip_8023_mesh_hdr()
576 return -EINVAL; in ieee80211_strip_8023_mesh_hdr()
578 payload.eth.h_proto = htons(skb->len - hdrlen); in ieee80211_strip_8023_mesh_hdr()
580 mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN; in ieee80211_strip_8023_mesh_hdr()
592 pskb_pull(skb, hdrlen - sizeof(payload.eth)); in ieee80211_strip_8023_mesh_hdr()
593 memcpy(skb->data, &payload.eth, sizeof(payload.eth)); in ieee80211_strip_8023_mesh_hdr()
603 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; in ieee80211_data_to_8023_exthdr()
611 if (unlikely(!ieee80211_is_data_present(hdr->frame_control))) in ieee80211_data_to_8023_exthdr()
612 return -1; in ieee80211_data_to_8023_exthdr()
614 hdrlen = ieee80211_hdrlen(hdr->frame_control) + data_offset; in ieee80211_data_to_8023_exthdr()
615 if (skb->len < hdrlen) in ieee80211_data_to_8023_exthdr()
616 return -1; in ieee80211_data_to_8023_exthdr()
630 switch (hdr->frame_control & in ieee80211_data_to_8023_exthdr()
636 return -1; in ieee80211_data_to_8023_exthdr()
642 return -1; in ieee80211_data_to_8023_exthdr()
650 return -1; in ieee80211_data_to_8023_exthdr()
656 return -1; in ieee80211_data_to_8023_exthdr()
663 /* remove RFC1042 or Bridge-Tunnel encapsulation */ in ieee80211_data_to_8023_exthdr()
667 tmp.h_proto = htons(skb->len - hdrlen); in ieee80211_data_to_8023_exthdr()
688 page_offset = ptr - page_address(page); in __frame_add_frag()
689 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size); in __frame_add_frag()
697 const skb_frag_t *frag = &sh->frags[0]; in __ieee80211_amsdu_copy_frag()
701 int head_size = skb->len - skb->data_len; in __ieee80211_amsdu_copy_frag()
704 frag_page = virt_to_head_page(skb->head); in __ieee80211_amsdu_copy_frag()
705 frag_ptr = skb->data; in __ieee80211_amsdu_copy_frag()
709 offset -= frag_size; in __ieee80211_amsdu_copy_frag()
717 frag_len = frag_size - offset; in __ieee80211_amsdu_copy_frag()
722 len -= cur_len; in __ieee80211_amsdu_copy_frag()
729 len -= cur_len; in __ieee80211_amsdu_copy_frag()
742 if (skb->len - offset < len) in __ieee80211_amsdu_copy()
761 frame->priority = skb->priority; in __ieee80211_amsdu_copy()
765 len -= cur_len; in __ieee80211_amsdu_copy()
796 for (offset = 0; offset < skb->len; offset += subframe_len + padding) { in ieee80211_is_valid_amsdu()
809 padding = (4 - subframe_len) & 0x3; in ieee80211_is_valid_amsdu()
810 remaining = skb->len - offset; in ieee80211_is_valid_amsdu()
833 bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb); in ieee80211_amsdu_to_8023s()
852 padding = (4 - subframe_len) & 0x3; in ieee80211_amsdu_to_8023s()
855 remaining = skb->len - offset; in ieee80211_amsdu_to_8023s()
858 /* mitigate A-MSDU aggregation injection attacks */ in ieee80211_amsdu_to_8023s()
888 frame->dev = skb->dev; in ieee80211_amsdu_to_8023s()
889 frame->priority = skb->priority; in ieee80211_amsdu_to_8023s()
892 ieee80211_get_8023_tunnel_proto(frame->data, &hdr.eth.h_proto))) in ieee80211_amsdu_to_8023s()
918 /* skb->priority values from 256->263 are magic values to in cfg80211_classify8021d()
923 if (skb->priority >= 256 && skb->priority <= 263) { in cfg80211_classify8021d()
924 ret = skb->priority - 256; in cfg80211_classify8021d()
937 switch (skb->protocol) { in cfg80211_classify8021d()
953 ret = (ntohl(mpls->entry) & MPLS_LS_TC_MASK) in cfg80211_classify8021d()
967 for (i = 0; i < qos_map->num_des; i++) { in cfg80211_classify8021d()
968 if (tmp_dscp == qos_map->dscp_exception[i].dscp) { in cfg80211_classify8021d()
969 ret = qos_map->dscp_exception[i].up; in cfg80211_classify8021d()
975 if (tmp_dscp >= qos_map->up[i].low && in cfg80211_classify8021d()
976 tmp_dscp <= qos_map->up[i].high) { in cfg80211_classify8021d()
993 * - Standard: DF in cfg80211_classify8021d()
994 * - Low Priority Data: CS1 in cfg80211_classify8021d()
995 * - Multimedia Streaming: AF31, AF32, AF33 in cfg80211_classify8021d()
996 * - Multimedia Conferencing: AF41, AF42, AF43 in cfg80211_classify8021d()
997 * - Network Control Traffic: CS7 in cfg80211_classify8021d()
998 * - Real-Time Interactive: CS4 in cfg80211_classify8021d()
1049 ies = rcu_dereference(bss->ies); in ieee80211_bss_get_elem()
1053 return cfg80211_find_elem(id, ies->data, ies->len); in ieee80211_bss_get_elem()
1059 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_upload_connect_keys()
1060 struct net_device *dev = wdev->netdev; in cfg80211_upload_connect_keys()
1063 if (!wdev->connect_keys) in cfg80211_upload_connect_keys()
1067 if (!wdev->connect_keys->params[i].cipher) in cfg80211_upload_connect_keys()
1069 if (rdev_add_key(rdev, dev, -1, i, false, NULL, in cfg80211_upload_connect_keys()
1070 &wdev->connect_keys->params[i])) { in cfg80211_upload_connect_keys()
1074 if (wdev->connect_keys->def == i && in cfg80211_upload_connect_keys()
1075 rdev_set_default_key(rdev, dev, -1, i, true, true)) { in cfg80211_upload_connect_keys()
1081 kfree_sensitive(wdev->connect_keys); in cfg80211_upload_connect_keys()
1082 wdev->connect_keys = NULL; in cfg80211_upload_connect_keys()
1090 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_process_wdev_events()
1091 while (!list_empty(&wdev->event_list)) { in cfg80211_process_wdev_events()
1092 ev = list_first_entry(&wdev->event_list, in cfg80211_process_wdev_events()
1094 list_del(&ev->list); in cfg80211_process_wdev_events()
1095 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_process_wdev_events()
1097 switch (ev->type) { in cfg80211_process_wdev_events()
1100 wdev->netdev, in cfg80211_process_wdev_events()
1101 &ev->cr, in cfg80211_process_wdev_events()
1102 ev->cr.status == WLAN_STATUS_SUCCESS); in cfg80211_process_wdev_events()
1105 __cfg80211_roamed(wdev, &ev->rm); in cfg80211_process_wdev_events()
1108 __cfg80211_disconnected(wdev->netdev, in cfg80211_process_wdev_events()
1109 ev->dc.ie, ev->dc.ie_len, in cfg80211_process_wdev_events()
1110 ev->dc.reason, in cfg80211_process_wdev_events()
1111 !ev->dc.locally_generated); in cfg80211_process_wdev_events()
1114 __cfg80211_ibss_joined(wdev->netdev, ev->ij.bssid, in cfg80211_process_wdev_events()
1115 ev->ij.channel); in cfg80211_process_wdev_events()
1118 cfg80211_leave(wiphy_to_rdev(wdev->wiphy), wdev); in cfg80211_process_wdev_events()
1121 __cfg80211_port_authorized(wdev, ev->pa.peer_addr, in cfg80211_process_wdev_events()
1122 ev->pa.td_bitmap, in cfg80211_process_wdev_events()
1123 ev->pa.td_bitmap_len); in cfg80211_process_wdev_events()
1129 spin_lock_irqsave(&wdev->event_lock, flags); in cfg80211_process_wdev_events()
1131 spin_unlock_irqrestore(&wdev->event_lock, flags); in cfg80211_process_wdev_events()
1138 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_process_rdev_events()
1140 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) in cfg80211_process_rdev_events()
1149 enum nl80211_iftype otype = dev->ieee80211_ptr->iftype; in cfg80211_change_iface()
1151 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_change_iface()
1153 /* don't support changing VLANs, you just re-create them */ in cfg80211_change_iface()
1155 return -EOPNOTSUPP; in cfg80211_change_iface()
1160 return -EOPNOTSUPP; in cfg80211_change_iface()
1162 if (!rdev->ops->change_virtual_intf || in cfg80211_change_iface()
1163 !(rdev->wiphy.interface_modes & (1 << ntype))) in cfg80211_change_iface()
1164 return -EOPNOTSUPP; in cfg80211_change_iface()
1172 return -EBUSY; in cfg80211_change_iface()
1174 dev->ieee80211_ptr->use_4addr = false; in cfg80211_change_iface()
1180 cfg80211_stop_ap(rdev, dev, -1, true); in cfg80211_change_iface()
1201 cfg80211_mlme_purge_registrations(dev->ieee80211_ptr); in cfg80211_change_iface()
1203 memset(&dev->ieee80211_ptr->u, 0, in cfg80211_change_iface()
1204 sizeof(dev->ieee80211_ptr->u)); in cfg80211_change_iface()
1205 memset(&dev->ieee80211_ptr->links, 0, in cfg80211_change_iface()
1206 sizeof(dev->ieee80211_ptr->links)); in cfg80211_change_iface()
1211 WARN_ON(!err && dev->ieee80211_ptr->iftype != ntype); in cfg80211_change_iface()
1213 if (!err && params && params->use_4addr != -1) in cfg80211_change_iface()
1214 dev->ieee80211_ptr->use_4addr = params->use_4addr; in cfg80211_change_iface()
1217 dev->priv_flags &= ~IFF_DONT_BRIDGE; in cfg80211_change_iface()
1220 if (dev->ieee80211_ptr->use_4addr) in cfg80211_change_iface()
1226 dev->priv_flags |= IFF_DONT_BRIDGE; in cfg80211_change_iface()
1251 cfg80211_update_iface_num(rdev, otype, -1); in cfg80211_change_iface()
1262 if (WARN_ON_ONCE(rate->mcs >= 32)) in cfg80211_calculate_bitrate_ht()
1265 modulation = rate->mcs & 7; in cfg80211_calculate_bitrate_ht()
1266 streams = (rate->mcs >> 3) + 1; in cfg80211_calculate_bitrate_ht()
1268 bitrate = (rate->bw == RATE_INFO_BW_40) ? 13500000 : 6500000; in cfg80211_calculate_bitrate_ht()
1279 if (rate->flags & RATE_INFO_FLAGS_SHORT_GI) in cfg80211_calculate_bitrate_ht()
1317 /* LP-SC PHY */ in cfg80211_calculate_bitrate_dmg()
1327 if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate))) in cfg80211_calculate_bitrate_dmg()
1330 return __mcs2bitrate[rate->mcs]; in cfg80211_calculate_bitrate_dmg()
1336 [6 - 6] = 26950, /* MCS 9.1 : 2695.0 mbps */ in cfg80211_calculate_bitrate_extended_sc_dmg()
1337 [7 - 6] = 50050, /* MCS 12.1 */ in cfg80211_calculate_bitrate_extended_sc_dmg()
1338 [8 - 6] = 53900, in cfg80211_calculate_bitrate_extended_sc_dmg()
1339 [9 - 6] = 57750, in cfg80211_calculate_bitrate_extended_sc_dmg()
1340 [10 - 6] = 63900, in cfg80211_calculate_bitrate_extended_sc_dmg()
1341 [11 - 6] = 75075, in cfg80211_calculate_bitrate_extended_sc_dmg()
1342 [12 - 6] = 80850, in cfg80211_calculate_bitrate_extended_sc_dmg()
1346 if (WARN_ON_ONCE(rate->mcs < 6 || rate->mcs > 12)) in cfg80211_calculate_bitrate_extended_sc_dmg()
1349 return __mcs2bitrate[rate->mcs - 6]; in cfg80211_calculate_bitrate_extended_sc_dmg()
1380 if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate))) in cfg80211_calculate_bitrate_edmg()
1383 return __mcs2bitrate[rate->mcs] * rate->n_bonded_ch; in cfg80211_calculate_bitrate_edmg()
1446 if (rate->mcs > 11) in cfg80211_calculate_bitrate_vht()
1449 switch (rate->bw) { in cfg80211_calculate_bitrate_vht()
1467 bitrate = base[idx][rate->mcs]; in cfg80211_calculate_bitrate_vht()
1468 bitrate *= rate->nss; in cfg80211_calculate_bitrate_vht()
1470 if (rate->flags & RATE_INFO_FLAGS_SHORT_GI) in cfg80211_calculate_bitrate_vht()
1477 rate->bw, rate->mcs, rate->nss); in cfg80211_calculate_bitrate_vht()
1510 if (WARN_ON_ONCE(rate->mcs > 13)) in cfg80211_calculate_bitrate_he()
1513 if (WARN_ON_ONCE(rate->he_gi > NL80211_RATE_INFO_HE_GI_3_2)) in cfg80211_calculate_bitrate_he()
1515 if (WARN_ON_ONCE(rate->he_ru_alloc > in cfg80211_calculate_bitrate_he()
1518 if (WARN_ON_ONCE(rate->nss < 1 || rate->nss > 8)) in cfg80211_calculate_bitrate_he()
1521 if (rate->bw == RATE_INFO_BW_160) in cfg80211_calculate_bitrate_he()
1522 result = rates_160M[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1523 else if (rate->bw == RATE_INFO_BW_80 || in cfg80211_calculate_bitrate_he()
1524 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1525 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_996)) in cfg80211_calculate_bitrate_he()
1526 result = rates_969[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1527 else if (rate->bw == RATE_INFO_BW_40 || in cfg80211_calculate_bitrate_he()
1528 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1529 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_484)) in cfg80211_calculate_bitrate_he()
1530 result = rates_484[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1531 else if (rate->bw == RATE_INFO_BW_20 || in cfg80211_calculate_bitrate_he()
1532 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1533 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_242)) in cfg80211_calculate_bitrate_he()
1534 result = rates_242[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1535 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1536 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_106) in cfg80211_calculate_bitrate_he()
1537 result = rates_106[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1538 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1539 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_52) in cfg80211_calculate_bitrate_he()
1540 result = rates_52[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1541 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1542 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_26) in cfg80211_calculate_bitrate_he()
1543 result = rates_26[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1546 rate->bw, rate->he_ru_alloc); in cfg80211_calculate_bitrate_he()
1553 do_div(tmp, mcs_divisors[rate->mcs]); in cfg80211_calculate_bitrate_he()
1557 result = (result * rate->nss) / 8; in cfg80211_calculate_bitrate_he()
1558 if (rate->he_dcm) in cfg80211_calculate_bitrate_he()
1594 if (WARN_ON_ONCE(rate->mcs > 15)) in cfg80211_calculate_bitrate_eht()
1596 if (WARN_ON_ONCE(rate->eht_gi > NL80211_RATE_INFO_EHT_GI_3_2)) in cfg80211_calculate_bitrate_eht()
1598 if (WARN_ON_ONCE(rate->eht_ru_alloc > in cfg80211_calculate_bitrate_eht()
1601 if (WARN_ON_ONCE(rate->nss < 1 || rate->nss > 8)) in cfg80211_calculate_bitrate_eht()
1605 if (rate->mcs == 14) { in cfg80211_calculate_bitrate_eht()
1606 if ((rate->bw != RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1607 rate->bw != RATE_INFO_BW_80 && in cfg80211_calculate_bitrate_eht()
1608 rate->bw != RATE_INFO_BW_160 && in cfg80211_calculate_bitrate_eht()
1609 rate->bw != RATE_INFO_BW_320) || in cfg80211_calculate_bitrate_eht()
1610 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1611 rate->eht_ru_alloc != NL80211_RATE_INFO_EHT_RU_ALLOC_996 && in cfg80211_calculate_bitrate_eht()
1612 rate->eht_ru_alloc != NL80211_RATE_INFO_EHT_RU_ALLOC_2x996 && in cfg80211_calculate_bitrate_eht()
1613 rate->eht_ru_alloc != NL80211_RATE_INFO_EHT_RU_ALLOC_4x996)) { in cfg80211_calculate_bitrate_eht()
1615 rate->bw, rate->eht_ru_alloc); in cfg80211_calculate_bitrate_eht()
1620 if (rate->bw == RATE_INFO_BW_320 || in cfg80211_calculate_bitrate_eht()
1621 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1622 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_4x996)) in cfg80211_calculate_bitrate_eht()
1623 result = 4 * rates_996[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1624 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1625 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484) in cfg80211_calculate_bitrate_eht()
1626 result = 3 * rates_996[rate->eht_gi] + rates_484[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1627 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1628 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_3x996) in cfg80211_calculate_bitrate_eht()
1629 result = 3 * rates_996[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1630 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1631 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484) in cfg80211_calculate_bitrate_eht()
1632 result = 2 * rates_996[rate->eht_gi] + rates_484[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1633 else if (rate->bw == RATE_INFO_BW_160 || in cfg80211_calculate_bitrate_eht()
1634 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1635 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_2x996)) in cfg80211_calculate_bitrate_eht()
1636 result = 2 * rates_996[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1637 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1638 rate->eht_ru_alloc == in cfg80211_calculate_bitrate_eht()
1640 result = rates_996[rate->eht_gi] + rates_484[rate->eht_gi] in cfg80211_calculate_bitrate_eht()
1641 + rates_242[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1642 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1643 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_996P484) in cfg80211_calculate_bitrate_eht()
1644 result = rates_996[rate->eht_gi] + rates_484[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1645 else if (rate->bw == RATE_INFO_BW_80 || in cfg80211_calculate_bitrate_eht()
1646 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1647 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_996)) in cfg80211_calculate_bitrate_eht()
1648 result = rates_996[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1649 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1650 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_484P242) in cfg80211_calculate_bitrate_eht()
1651 result = rates_484[rate->eht_gi] + rates_242[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1652 else if (rate->bw == RATE_INFO_BW_40 || in cfg80211_calculate_bitrate_eht()
1653 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1654 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_484)) in cfg80211_calculate_bitrate_eht()
1655 result = rates_484[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1656 else if (rate->bw == RATE_INFO_BW_20 || in cfg80211_calculate_bitrate_eht()
1657 (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1658 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_242)) in cfg80211_calculate_bitrate_eht()
1659 result = rates_242[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1660 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1661 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_106P26) in cfg80211_calculate_bitrate_eht()
1662 result = rates_106[rate->eht_gi] + rates_26[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1663 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1664 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_106) in cfg80211_calculate_bitrate_eht()
1665 result = rates_106[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1666 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1667 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_52P26) in cfg80211_calculate_bitrate_eht()
1668 result = rates_52[rate->eht_gi] + rates_26[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1669 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1670 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_52) in cfg80211_calculate_bitrate_eht()
1671 result = rates_52[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1672 else if (rate->bw == RATE_INFO_BW_EHT_RU && in cfg80211_calculate_bitrate_eht()
1673 rate->eht_ru_alloc == NL80211_RATE_INFO_EHT_RU_ALLOC_26) in cfg80211_calculate_bitrate_eht()
1674 result = rates_26[rate->eht_gi]; in cfg80211_calculate_bitrate_eht()
1677 rate->bw, rate->eht_ru_alloc); in cfg80211_calculate_bitrate_eht()
1684 do_div(tmp, mcs_divisors[rate->mcs]); in cfg80211_calculate_bitrate_eht()
1687 tmp *= rate->nss; in cfg80211_calculate_bitrate_eht()
1761 if (rate->mcs >= 11) in cfg80211_calculate_bitrate_s1g()
1764 switch (rate->bw) { in cfg80211_calculate_bitrate_s1g()
1790 bitrate = base[idx][rate->mcs]; in cfg80211_calculate_bitrate_s1g()
1791 bitrate *= rate->nss; in cfg80211_calculate_bitrate_s1g()
1793 if (rate->flags & RATE_INFO_FLAGS_SHORT_GI) in cfg80211_calculate_bitrate_s1g()
1799 rate->bw, rate->mcs, rate->nss); in cfg80211_calculate_bitrate_s1g()
1805 if (rate->flags & RATE_INFO_FLAGS_MCS) in cfg80211_calculate_bitrate()
1807 if (rate->flags & RATE_INFO_FLAGS_DMG) in cfg80211_calculate_bitrate()
1809 if (rate->flags & RATE_INFO_FLAGS_EXTENDED_SC_DMG) in cfg80211_calculate_bitrate()
1811 if (rate->flags & RATE_INFO_FLAGS_EDMG) in cfg80211_calculate_bitrate()
1813 if (rate->flags & RATE_INFO_FLAGS_VHT_MCS) in cfg80211_calculate_bitrate()
1815 if (rate->flags & RATE_INFO_FLAGS_HE_MCS) in cfg80211_calculate_bitrate()
1817 if (rate->flags & RATE_INFO_FLAGS_EHT_MCS) in cfg80211_calculate_bitrate()
1819 if (rate->flags & RATE_INFO_FLAGS_S1G_MCS) in cfg80211_calculate_bitrate()
1822 return rate->legacy; in cfg80211_calculate_bitrate()
1841 return -EILSEQ; in cfg80211_get_p2p_attr()
1844 return -EILSEQ; in cfg80211_get_p2p_attr()
1859 iedatalen -= 4; in cfg80211_get_p2p_attr()
1869 bufsize -= min(bufsize, copy); in cfg80211_get_p2p_attr()
1877 attr_remaining -= copy; in cfg80211_get_p2p_attr()
1881 iedatalen -= copy; in cfg80211_get_p2p_attr()
1889 return -EILSEQ; in cfg80211_get_p2p_attr()
1892 iedatalen -= 3; in cfg80211_get_p2p_attr()
1902 bufsize -= min(bufsize, copy); in cfg80211_get_p2p_attr()
1910 iedatalen -= copy; in cfg80211_get_p2p_attr()
1911 attr_remaining = attr_len - copy; in cfg80211_get_p2p_attr()
1915 len -= ies[1] + 2; in cfg80211_get_p2p_attr()
1920 return -EILSEQ; in cfg80211_get_p2p_attr()
1922 return -ENOENT; in cfg80211_get_p2p_attr()
1931 if (WARN_ON(ids[n_ids - 1] == WLAN_EID_EXTENSION)) in ieee80211_id_in_list()
2026 elem_len = skb->data + skb->len - len_pos - 1; in ieee80211_fragment_element()
2032 elem_len -= 255; in ieee80211_fragment_element()
2080 u32 freq = chandef->center_freq1; in ieee80211_chandef_to_operating_class() local
2082 if (freq >= 2412 && freq <= 2472) { in ieee80211_chandef_to_operating_class()
2083 if (chandef->width > NL80211_CHAN_WIDTH_40) in ieee80211_chandef_to_operating_class()
2087 if (chandef->width == NL80211_CHAN_WIDTH_40) { in ieee80211_chandef_to_operating_class()
2088 if (freq > chandef->chan->center_freq) in ieee80211_chandef_to_operating_class()
2091 *op_class = 84; /* HT40- */ in ieee80211_chandef_to_operating_class()
2099 if (freq == 2484) { in ieee80211_chandef_to_operating_class()
2101 if (chandef->width != NL80211_CHAN_WIDTH_20_NOHT) in ieee80211_chandef_to_operating_class()
2108 switch (chandef->width) { in ieee80211_chandef_to_operating_class()
2127 if (freq >= 5180 && freq <= 5240) { in ieee80211_chandef_to_operating_class()
2130 } else if (chandef->width == NL80211_CHAN_WIDTH_40) { in ieee80211_chandef_to_operating_class()
2131 if (freq > chandef->chan->center_freq) in ieee80211_chandef_to_operating_class()
2143 if (freq >= 5260 && freq <= 5320) { in ieee80211_chandef_to_operating_class()
2146 } else if (chandef->width == NL80211_CHAN_WIDTH_40) { in ieee80211_chandef_to_operating_class()
2147 if (freq > chandef->chan->center_freq) in ieee80211_chandef_to_operating_class()
2159 if (freq >= 5500 && freq <= 5720) { in ieee80211_chandef_to_operating_class()
2162 } else if (chandef->width == NL80211_CHAN_WIDTH_40) { in ieee80211_chandef_to_operating_class()
2163 if (freq > chandef->chan->center_freq) in ieee80211_chandef_to_operating_class()
2175 if (freq >= 5745 && freq <= 5845) { in ieee80211_chandef_to_operating_class()
2178 } else if (chandef->width == NL80211_CHAN_WIDTH_40) { in ieee80211_chandef_to_operating_class()
2179 if (freq > chandef->chan->center_freq) in ieee80211_chandef_to_operating_class()
2183 } else if (freq <= 5805) { in ieee80211_chandef_to_operating_class()
2193 if (freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6) { in ieee80211_chandef_to_operating_class()
2194 if (chandef->width >= NL80211_CHAN_WIDTH_40) in ieee80211_chandef_to_operating_class()
2208 switch (wdev->iftype) { in cfg80211_wdev_bi()
2211 WARN_ON(wdev->valid_links); in cfg80211_wdev_bi()
2212 return wdev->links[0].ap.beacon_interval; in cfg80211_wdev_bi()
2214 return wdev->u.mesh.beacon_interval; in cfg80211_wdev_bi()
2216 return wdev->u.ibss.beacon_interval; in cfg80211_wdev_bi()
2233 list_for_each_entry(wdev, &wiphy->wdev_list, list) { in cfg80211_calculate_bi_data()
2237 if (wdev->valid_links) in cfg80211_calculate_bi_data()
2268 * This is just a basic pre-condition check; if interface combinations in cfg80211_validate_beacon_int()
2276 return -EINVAL; in cfg80211_validate_beacon_int()
2302 * cfg80211 already - the only thing not would appear to be any new in cfg80211_iter_combinations()
2305 cfg80211_calculate_bi_data(wiphy, params->new_beacon_int, in cfg80211_iter_combinations()
2308 if (params->radar_detect) { in cfg80211_iter_combinations()
2312 region = regdom->dfs_region; in cfg80211_iter_combinations()
2317 num_interfaces += params->iftype_num[iftype]; in cfg80211_iter_combinations()
2318 if (params->iftype_num[iftype] > 0 && in cfg80211_iter_combinations()
2323 for (i = 0; i < wiphy->n_iface_combinations; i++) { in cfg80211_iter_combinations()
2328 c = &wiphy->iface_combinations[i]; in cfg80211_iter_combinations()
2330 if (num_interfaces > c->max_interfaces) in cfg80211_iter_combinations()
2332 if (params->num_different_channels > c->num_different_channels) in cfg80211_iter_combinations()
2335 limits = kmemdup(c->limits, sizeof(limits[0]) * c->n_limits, in cfg80211_iter_combinations()
2338 return -ENOMEM; in cfg80211_iter_combinations()
2343 for (j = 0; j < c->n_limits; j++) { in cfg80211_iter_combinations()
2347 if (limits[j].max < params->iftype_num[iftype]) in cfg80211_iter_combinations()
2349 limits[j].max -= params->iftype_num[iftype]; in cfg80211_iter_combinations()
2353 if (params->radar_detect != in cfg80211_iter_combinations()
2354 (c->radar_detect_widths & params->radar_detect)) in cfg80211_iter_combinations()
2357 if (params->radar_detect && c->radar_detect_regions && in cfg80211_iter_combinations()
2358 !(c->radar_detect_regions & BIT(region))) in cfg80211_iter_combinations()
2370 if (c->beacon_int_min_gcd && in cfg80211_iter_combinations()
2371 beacon_int_gcd < c->beacon_int_min_gcd) in cfg80211_iter_combinations()
2373 if (!c->beacon_int_min_gcd && beacon_int_different) in cfg80211_iter_combinations()
2408 return -EBUSY; in cfg80211_check_combinations()
2421 return -EINVAL; in ieee80211_get_ratemask()
2424 return -EINVAL; in ieee80211_get_ratemask()
2432 for (j = 0; j < sband->n_bitrates; j++) { in ieee80211_get_ratemask()
2433 if (sband->bitrates[j].bitrate == rate) { in ieee80211_get_ratemask()
2440 return -EINVAL; in ieee80211_get_ratemask()
2445 * didn't accept a 0-length rates array nor allowed in ieee80211_get_ratemask()
2458 if (wiphy->bands[band]) in ieee80211_get_num_supported_channels()
2459 n_channels += wiphy->bands[band]->n_channels; in ieee80211_get_num_supported_channels()
2471 wdev = dev->ieee80211_ptr; in cfg80211_get_station()
2473 return -EOPNOTSUPP; in cfg80211_get_station()
2475 rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_get_station()
2476 if (!rdev->ops->get_station) in cfg80211_get_station()
2477 return -EOPNOTSUPP; in cfg80211_get_station()
2492 kfree(f->serv_spec_info); in cfg80211_free_nan_func()
2493 kfree(f->srf_bf); in cfg80211_free_nan_func()
2494 kfree(f->srf_macs); in cfg80211_free_nan_func()
2495 for (i = 0; i < f->num_rx_filters; i++) in cfg80211_free_nan_func()
2496 kfree(f->rx_filters[i].filter); in cfg80211_free_nan_func()
2498 for (i = 0; i < f->num_tx_filters; i++) in cfg80211_free_nan_func()
2499 kfree(f->tx_filters[i].filter); in cfg80211_free_nan_func()
2501 kfree(f->rx_filters); in cfg80211_free_nan_func()
2502 kfree(f->tx_filters); in cfg80211_free_nan_func()
2512 start_freq_khz = center_freq_khz - (bw_khz / 2); in cfg80211_does_bw_fit_range()
2515 if (start_freq_khz >= freq_range->start_freq_khz && in cfg80211_does_bw_fit_range()
2516 end_freq_khz <= freq_range->end_freq_khz) in cfg80211_does_bw_fit_range()
2524 sinfo->pertid = kcalloc(IEEE80211_NUM_TIDS + 1, in cfg80211_sinfo_alloc_tid_stats()
2525 sizeof(*(sinfo->pertid)), in cfg80211_sinfo_alloc_tid_stats()
2527 if (!sinfo->pertid) in cfg80211_sinfo_alloc_tid_stats()
2528 return -ENOMEM; in cfg80211_sinfo_alloc_tid_stats()
2535 /* Ethernet-II snap header (RFC1042 for most EtherTypes) */
2540 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
2570 * Update response frame; IEEE Std 802.2-1998, 5.4.1.2.1 */ in cfg80211_send_layer2_update()
2572 eth_broadcast_addr(msg->da); in cfg80211_send_layer2_update()
2573 ether_addr_copy(msg->sa, addr); in cfg80211_send_layer2_update()
2574 msg->len = htons(6); in cfg80211_send_layer2_update()
2575 msg->dsap = 0; in cfg80211_send_layer2_update()
2576 msg->ssap = 0x01; /* NULL LSAP, CR Bit: Response */ in cfg80211_send_layer2_update()
2577 msg->control = 0xaf; /* XID response lsb.1111F101. in cfg80211_send_layer2_update()
2579 msg->xid_info[0] = 0x81; /* XID format identifier */ in cfg80211_send_layer2_update()
2580 msg->xid_info[1] = 1; /* LLC types/classes: Type 1 LLC */ in cfg80211_send_layer2_update()
2581 msg->xid_info[2] = 0; /* XID sender's receive window size (RW) */ in cfg80211_send_layer2_update()
2583 skb->dev = dev; in cfg80211_send_layer2_update()
2584 skb->protocol = eth_type_trans(skb, dev); in cfg80211_send_layer2_update()
2585 memset(skb->cb, 0, sizeof(skb->cb)); in cfg80211_send_layer2_update()
2595 u16 map = le16_to_cpu(cap->supp_mcs.rx_mcs_map); in ieee80211_get_vht_max_nss()
2614 for (i = 7; i >= 0; i--) { in ieee80211_get_vht_max_nss()
2627 if (!(cap->supp_mcs.tx_mcs_map & in ieee80211_get_vht_max_nss()
2631 ext_nss_bw = le32_get_bits(cap->vht_cap_info, in ieee80211_get_vht_max_nss()
2633 supp_width = le32_get_bits(cap->vht_cap_info, in ieee80211_get_vht_max_nss()
2649 * Cover all the special cases according to IEEE 802.11-2016 in ieee80211_get_vht_max_nss()
2650 * Table 9-250. All other cases are either factor of 1 or not in ieee80211_get_vht_max_nss()
2706 return wiphy->flags & WIPHY_FLAG_4ADDR_AP; in cfg80211_iftype_allowed()
2707 return wiphy->interface_modes & BIT(iftype); in cfg80211_iftype_allowed()
2709 if (!(wiphy->software_iftypes & BIT(iftype)) && is_vlan) in cfg80211_iftype_allowed()
2710 return wiphy->flags & WIPHY_FLAG_4ADDR_AP; in cfg80211_iftype_allowed()
2711 return wiphy->software_iftypes & BIT(iftype); in cfg80211_iftype_allowed()
2722 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); in cfg80211_remove_link()
2724 lockdep_assert_wiphy(wdev->wiphy); in cfg80211_remove_link()
2726 switch (wdev->iftype) { in cfg80211_remove_link()
2729 cfg80211_stop_ap(rdev, wdev->netdev, link_id, true); in cfg80211_remove_link()
2732 /* per-link not relevant */ in cfg80211_remove_link()
2736 wdev->valid_links &= ~BIT(link_id); in cfg80211_remove_link()
2740 eth_zero_addr(wdev->links[link_id].addr); in cfg80211_remove_link()
2751 if (wdev->iftype != NL80211_IFTYPE_AP) in cfg80211_remove_links()
2754 if (wdev->valid_links) { in cfg80211_remove_links()
2773 for (i = 0; i < wiphy->num_iftype_ext_capab; i++) { in cfg80211_get_iftype_ext_capa()
2774 if (wiphy->iftype_ext_capab[i].iftype == type) in cfg80211_get_iftype_ext_capa()
2775 return &wiphy->iftype_ext_capab[i]; in cfg80211_get_iftype_ext_capa()