1 /*- 2 * Copyright (c) 2020-2021 The FreeBSD Foundation 3 * Copyright (c) 2021-2022 Bjoern A. Zeeb 4 * 5 * This software was developed by Björn Zeeb under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $FreeBSD$ 30 */ 31 32 #ifndef _LINUXKPI_NET_CFG80211_H 33 #define _LINUXKPI_NET_CFG80211_H 34 35 #include <linux/types.h> 36 #include <linux/nl80211.h> 37 #include <linux/ieee80211.h> 38 #include <linux/if_ether.h> 39 #include <linux/ethtool.h> 40 #include <linux/device.h> 41 #include <linux/netdevice.h> 42 #include <linux/random.h> 43 #include <linux/skbuff.h> 44 #include <net/regulatory.h> 45 46 /* linux_80211.c */ 47 extern int linuxkpi_debug_80211; 48 #ifndef D80211_TODO 49 #define D80211_TODO 0x1 50 #endif 51 #ifndef D80211_IMPROVE 52 #define D80211_IMPROVE 0x2 53 #endif 54 #define TODO() if (linuxkpi_debug_80211 & D80211_TODO) \ 55 printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) 56 #define IMPROVE(...) if (linuxkpi_debug_80211 & D80211_IMPROVE) \ 57 printf("%s:%d: XXX LKPI80211 IMPROVE\n", __func__, __LINE__) 58 59 enum rfkill_hard_block_reasons { 60 RFKILL_HARD_BLOCK_NOT_OWNER = BIT(0), 61 }; 62 63 #define WIPHY_PARAM_FRAG_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */ 64 #define WIPHY_PARAM_RETRY_LONG __LINE__ /* TODO FIXME brcmfmac */ 65 #define WIPHY_PARAM_RETRY_SHORT __LINE__ /* TODO FIXME brcmfmac */ 66 #define WIPHY_PARAM_RTS_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */ 67 68 #define CFG80211_SIGNAL_TYPE_MBM __LINE__ /* TODO FIXME brcmfmac */ 69 70 #define UPDATE_ASSOC_IES 1 71 72 #define IEEE80211_MAX_CHAINS 4 /* net80211: IEEE80211_MAX_CHAINS copied */ 73 74 enum cfg80211_rate_info_flags { 75 RATE_INFO_FLAGS_SHORT_GI = BIT(0), 76 RATE_INFO_FLAGS_MCS = BIT(1), 77 RATE_INFO_FLAGS_VHT_MCS = BIT(2), 78 RATE_INFO_FLAGS_HE_MCS = BIT(3), 79 }; 80 81 extern const uint8_t rfc1042_header[6]; 82 83 enum ieee80211_privacy { 84 IEEE80211_PRIVACY_ANY, 85 }; 86 87 enum ieee80211_bss_type { 88 IEEE80211_BSS_TYPE_ANY, 89 }; 90 91 enum cfg80211_bss_frame_type { 92 CFG80211_BSS_FTYPE_UNKNOWN, 93 CFG80211_BSS_FTYPE_BEACON, 94 CFG80211_BSS_FTYPE_PRESP, 95 }; 96 97 enum ieee80211_channel_flags { 98 IEEE80211_CHAN_DISABLED = BIT(0), 99 IEEE80211_CHAN_INDOOR_ONLY = BIT(1), 100 IEEE80211_CHAN_IR_CONCURRENT = BIT(2), 101 IEEE80211_CHAN_RADAR = BIT(3), 102 IEEE80211_CHAN_NO_IR = BIT(4), 103 IEEE80211_CHAN_NO_HT40MINUS = BIT(5), 104 IEEE80211_CHAN_NO_HT40PLUS = BIT(6), 105 IEEE80211_CHAN_NO_80MHZ = BIT(7), 106 IEEE80211_CHAN_NO_160MHZ = BIT(8), 107 IEEE80211_CHAN_NO_OFDM = BIT(9), 108 }; 109 #define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS) 110 111 struct ieee80211_txrx_stypes { 112 uint16_t tx; 113 uint16_t rx; 114 }; 115 116 /* XXX net80211 has an ieee80211_channel as well. */ 117 struct linuxkpi_ieee80211_channel { 118 /* TODO FIXME */ 119 uint32_t hw_value; /* ic_ieee */ 120 uint32_t center_freq; /* ic_freq */ 121 enum ieee80211_channel_flags flags; /* ic_flags */ 122 enum nl80211_band band; 123 int8_t max_power; /* ic_maxpower */ 124 bool beacon_found; 125 int max_antenna_gain, max_reg_power; 126 int orig_flags; 127 int dfs_cac_ms, dfs_state; 128 }; 129 130 /* XXX net80211 calls these IEEE80211_HTCAP_* */ 131 #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 /* IEEE80211_HTCAP_LDPC */ 132 #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 /* IEEE80211_HTCAP_CHWIDTH40 */ 133 #define IEEE80211_HT_CAP_GRN_FLD 0x0010 /* IEEE80211_HTCAP_GREENFIELD */ 134 #define IEEE80211_HT_CAP_SGI_20 0x0020 /* IEEE80211_HTCAP_SHORTGI20 */ 135 #define IEEE80211_HT_CAP_SGI_40 0x0040 /* IEEE80211_HTCAP_SHORTGI40 */ 136 #define IEEE80211_HT_CAP_TX_STBC 0x0080 /* IEEE80211_HTCAP_TXSTBC */ 137 #define IEEE80211_HT_CAP_RX_STBC 0x0100 /* IEEE80211_HTCAP_RXSTBC */ 138 #define IEEE80211_HT_CAP_RX_STBC_SHIFT 8 /* IEEE80211_HTCAP_RXSTBC_S */ 139 #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 /* IEEE80211_HTCAP_MAXAMSDU */ 140 #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 /* IEEE80211_HTCAP_DSSSCCK40 */ 141 #define IEEE80211_HT_CAP_SM_PS 0x000c /* IEEE80211_HTCAP_SMPS */ 142 #define IEEE80211_HT_CAP_SM_PS_SHIFT 2 143 #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 /* IEEE80211_HTCAP_LSIGTXOPPROT */ 144 145 #define IEEE80211_HT_MCS_TX_DEFINED 0x0001 146 #define IEEE80211_HT_MCS_TX_RX_DIFF 0x0002 147 #define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2 148 #define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3FF 149 #define IEEE80211_HT_MCS_MASK_LEN 10 150 151 enum ieee80211_vht_mcs_support { 152 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_7, 153 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_8, 154 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_9, 155 }; 156 157 struct cfg80211_bitrate_mask { 158 /* TODO FIXME */ 159 /* This is so weird but nothing else works out...*/ 160 struct { 161 uint64_t legacy; /* XXX? */ 162 uint8_t ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; 163 uint16_t vht_mcs[16]; /* XXX? */ 164 uint16_t he_mcs[16]; /* XXX? */ 165 enum nl80211_txrate_gi gi; 166 } control[NUM_NL80211_BANDS]; 167 }; 168 169 struct rate_info { 170 /* TODO FIXME */ 171 int bw, flags, he_dcm, he_gi, he_ru_alloc, legacy, mcs, nss; 172 }; 173 174 struct ieee80211_rate { 175 /* TODO FIXME */ 176 uint32_t bitrate; 177 uint32_t hw_value; 178 uint32_t hw_value_short; 179 uint32_t flags; 180 }; 181 182 struct ieee80211_sta_ht_cap { 183 /* TODO FIXME */ 184 int ampdu_density, ampdu_factor; 185 bool ht_supported; 186 uint16_t cap; 187 struct mcs { 188 uint16_t rx_mask[IEEE80211_HT_MCS_MASK_LEN]; /* XXX ? > 4 (rtw88) */ 189 int rx_highest; 190 uint32_t tx_params; 191 } mcs; 192 }; 193 194 /* XXX net80211 calls these IEEE80211_VHTCAP_* */ 195 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 */ 196 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 */ 197 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 */ 198 #define IEEE80211_VHT_CAP_MAX_MPDU_MASK 0x00000003 /* IEEE80211_VHTCAP_MAX_MPDU_MASK */ 199 200 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) 201 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) 202 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ 203 204 #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ 205 206 #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 /* IEEE80211_VHTCAP_SHORT_GI_80 */ 207 #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 /* IEEE80211_VHTCAP_SHORT_GI_160 */ 208 209 #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 /* IEEE80211_VHTCAP_TXSTBC */ 210 211 #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 /* IEEE80211_VHTCAP_RXSTBC_1 */ 212 #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 /* IEEE80211_VHTCAP_RXSTBC_MASK */ 213 214 #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 /* IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE */ 215 216 #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 /* IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE */ 217 218 #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 /* IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE */ 219 220 #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 /* IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE */ 221 222 #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 /* IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT */ 223 #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT) /* IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK */ 224 225 #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 /* IEEE80211_VHTCAP_HTC_VHT */ 226 227 #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 /* IEEE80211_VHTCAP_RX_ANTENNA_PATTERN */ 228 #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 /* IEEE80211_VHTCAP_TX_ANTENNA_PATTERN */ 229 230 #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 /* IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB */ 231 232 #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16 /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT */ 233 #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \ 234 (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK */ 235 236 #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT */ 237 #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ 238 (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */ 239 240 241 struct ieee80211_sta_vht_cap { 242 /* TODO FIXME */ 243 bool vht_supported; 244 uint32_t cap; 245 struct vht_mcs vht_mcs; 246 }; 247 248 struct cfg80211_connect_resp_params { 249 /* XXX TODO */ 250 uint8_t *bssid; 251 const uint8_t *req_ie; 252 const uint8_t *resp_ie; 253 uint32_t req_ie_len; 254 uint32_t resp_ie_len; 255 int status; 256 }; 257 258 struct cfg80211_inform_bss { 259 /* XXX TODO */ 260 int boottime_ns, scan_width, signal; 261 struct linuxkpi_ieee80211_channel *chan; 262 }; 263 264 struct cfg80211_roam_info { 265 /* XXX TODO */ 266 uint8_t *bssid; 267 const uint8_t *req_ie; 268 const uint8_t *resp_ie; 269 uint32_t req_ie_len; 270 uint32_t resp_ie_len; 271 struct linuxkpi_ieee80211_channel *channel; 272 }; 273 274 struct cfg80211_bss_ies { 275 /* XXX TODO, type is best guess. Fix if more info. */ 276 uint8_t *data; 277 int len; 278 }; 279 280 struct cfg80211_bss { 281 /* XXX TODO */ 282 struct cfg80211_bss_ies *ies; 283 }; 284 285 struct cfg80211_chan_def { 286 /* XXX TODO */ 287 struct linuxkpi_ieee80211_channel *chan; 288 enum nl80211_chan_width width; 289 uint32_t center_freq1; 290 uint32_t center_freq2; 291 }; 292 293 struct cfg80211_ftm_responder_stats { 294 /* XXX TODO */ 295 int asap_num, failed_num, filled, non_asap_num, out_of_window_triggers_num, partial_num, reschedule_requests_num, success_num, total_duration_ms, unknown_triggers_num; 296 }; 297 298 struct cfg80211_pmsr_capabilities { 299 /* XXX TODO */ 300 int max_peers, randomize_mac_addr, report_ap_tsf; 301 struct { 302 int asap, bandwidths, max_bursts_exponent, max_ftms_per_burst, non_asap, non_trigger_based, preambles, request_civicloc, request_lci, supported, trigger_based; 303 } ftm; 304 }; 305 306 struct cfg80211_pmsr_ftm_request { 307 /* XXX TODO */ 308 int asap, burst_period, ftmr_retries, ftms_per_burst, non_trigger_based, num_bursts_exp, request_civicloc, request_lci, trigger_based; 309 uint8_t bss_color; 310 bool lmr_feedback; 311 }; 312 313 struct cfg80211_pmsr_request_peer { 314 /* XXX TODO */ 315 struct cfg80211_chan_def chandef; 316 struct cfg80211_pmsr_ftm_request ftm; 317 uint8_t addr[ETH_ALEN]; 318 int report_ap_tsf; 319 }; 320 321 struct cfg80211_pmsr_request { 322 /* XXX TODO */ 323 int cookie, n_peers, timeout; 324 uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 325 struct cfg80211_pmsr_request_peer peers[]; 326 }; 327 328 struct cfg80211_pmsr_ftm_result { 329 /* XXX TODO */ 330 int burst_index, busy_retry_time, failure_reason; 331 int num_ftmr_successes, rssi_avg, rssi_avg_valid, rssi_spread, rssi_spread_valid, rtt_avg, rtt_avg_valid, rtt_spread, rtt_spread_valid, rtt_variance, rtt_variance_valid; 332 uint8_t *lci; 333 uint8_t *civicloc; 334 int lci_len; 335 int civicloc_len; 336 }; 337 338 struct cfg80211_pmsr_result { 339 /* XXX TODO */ 340 int ap_tsf, ap_tsf_valid, final, host_time, status, type; 341 uint8_t addr[ETH_ALEN]; 342 struct cfg80211_pmsr_ftm_result ftm; 343 }; 344 345 struct cfg80211_sar_freq_ranges { 346 uint32_t start_freq; 347 uint32_t end_freq; 348 }; 349 350 struct cfg80211_sar_sub_specs { 351 uint32_t freq_range_index; 352 int power; 353 }; 354 355 struct cfg80211_sar_specs { 356 enum nl80211_sar_type type; 357 uint32_t num_sub_specs; 358 struct cfg80211_sar_sub_specs sub_specs[]; 359 }; 360 361 struct cfg80211_sar_capa { 362 enum nl80211_sar_type type; 363 uint32_t num_freq_ranges; 364 const struct cfg80211_sar_freq_ranges *freq_ranges; 365 }; 366 367 struct cfg80211_ssid { 368 int ssid_len; 369 uint8_t ssid[IEEE80211_MAX_SSID_LEN]; 370 }; 371 372 struct cfg80211_scan_6ghz_params { 373 /* XXX TODO */ 374 uint8_t *bssid; 375 int channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe; 376 }; 377 378 struct cfg80211_match_set { 379 uint8_t bssid[ETH_ALEN]; 380 struct cfg80211_ssid ssid; 381 int rssi_thold; 382 }; 383 384 struct cfg80211_scan_request { 385 /* XXX TODO */ 386 int duration, duration_mandatory, flags; 387 bool no_cck; 388 bool scan_6ghz; 389 struct wireless_dev *wdev; 390 struct wiphy *wiphy; 391 int ie_len; 392 uint8_t *ie; 393 uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 394 int n_ssids; 395 int n_6ghz_params; 396 int n_channels; 397 struct cfg80211_ssid *ssids; 398 struct cfg80211_scan_6ghz_params *scan_6ghz_params; 399 struct linuxkpi_ieee80211_channel *channels[0]; 400 }; 401 402 struct cfg80211_sched_scan_plan { 403 /* XXX TODO */ 404 int interval, iterations; 405 }; 406 407 struct cfg80211_sched_scan_request { 408 /* XXX TODO */ 409 int delay, flags; 410 uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 411 uint64_t reqid; 412 int n_match_sets; 413 int n_scan_plans; 414 int n_ssids; 415 int n_channels; 416 struct cfg80211_match_set *match_sets; 417 struct cfg80211_sched_scan_plan *scan_plans; 418 struct cfg80211_ssid *ssids; 419 struct linuxkpi_ieee80211_channel *channels[0]; 420 }; 421 422 struct cfg80211_scan_info { 423 uint64_t scan_start_tsf; 424 uint8_t tsf_bssid[ETH_ALEN]; 425 bool aborted; 426 }; 427 428 struct cfg80211_beacon_data { 429 /* XXX TODO */ 430 const uint8_t *head; 431 const uint8_t *tail; 432 uint32_t head_len; 433 uint32_t tail_len; 434 const uint8_t *proberesp_ies; 435 const uint8_t *assocresp_ies; 436 uint32_t proberesp_ies_len; 437 uint32_t assocresp_ies_len; 438 }; 439 440 struct cfg80211_ap_settings { 441 /* XXX TODO */ 442 int auth_type, beacon_interval, dtim_period, hidden_ssid, inactivity_timeout; 443 const uint8_t *ssid; 444 size_t ssid_len; 445 struct cfg80211_beacon_data beacon; 446 struct cfg80211_chan_def chandef; 447 }; 448 449 struct cfg80211_bss_selection { 450 /* XXX TODO */ 451 enum nl80211_bss_select_attr behaviour; 452 union { 453 enum nl80211_band band_pref; 454 struct { 455 enum nl80211_band band; 456 uint8_t delta; 457 } adjust; 458 } param; 459 }; 460 461 struct cfg80211_crypto { /* XXX made up name */ 462 /* XXX TODO */ 463 enum nl80211_wpa_versions wpa_versions; 464 uint32_t cipher_group; /* WLAN_CIPHER_SUITE_* */ 465 uint32_t *akm_suites; 466 uint32_t *ciphers_pairwise; 467 const uint8_t *sae_pwd; 468 const uint8_t *psk; 469 int n_akm_suites; 470 int n_ciphers_pairwise; 471 int sae_pwd_len; 472 }; 473 474 struct cfg80211_connect_params { 475 /* XXX TODO */ 476 struct linuxkpi_ieee80211_channel *channel; 477 uint8_t *bssid; 478 const uint8_t *ie; 479 const uint8_t *ssid; 480 uint32_t ie_len; 481 uint32_t ssid_len; 482 const void *key; 483 uint32_t key_len; 484 int auth_type, key_idx, privacy, want_1x; 485 struct cfg80211_bss_selection bss_select; 486 struct cfg80211_crypto crypto; 487 }; 488 489 enum bss_param_flags { /* Used as bitflags. XXX FIXME values? */ 490 BSS_PARAM_FLAGS_CTS_PROT = 0x01, 491 BSS_PARAM_FLAGS_SHORT_PREAMBLE = 0x02, 492 BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 0x04, 493 }; 494 495 struct cfg80211_ibss_params { 496 /* XXX TODO */ 497 int basic_rates, beacon_interval; 498 int channel_fixed, ie, ie_len, privacy; 499 int dtim_period; 500 uint8_t *ssid; 501 uint8_t *bssid; 502 int ssid_len; 503 struct cfg80211_chan_def chandef; 504 enum bss_param_flags flags; 505 }; 506 507 struct cfg80211_mgmt_tx_params { 508 /* XXX TODO */ 509 struct linuxkpi_ieee80211_channel *chan; 510 const uint8_t *buf; 511 size_t len; 512 int wait; 513 }; 514 515 struct cfg80211_pmk_conf { 516 /* XXX TODO */ 517 const uint8_t *pmk; 518 uint8_t pmk_len; 519 }; 520 521 struct cfg80211_pmksa { 522 /* XXX TODO */ 523 const uint8_t *bssid; 524 const uint8_t *pmkid; 525 }; 526 527 struct cfg80211_wowlan_nd_match { 528 /* XXX TODO */ 529 struct cfg80211_ssid ssid; 530 int n_channels; 531 uint32_t channels[0]; /* freq! = ieee80211_channel_to_frequency() */ 532 }; 533 534 struct cfg80211_wowlan_nd_info { 535 /* XXX TODO */ 536 int n_matches; 537 struct cfg80211_wowlan_nd_match *matches[0]; 538 }; 539 540 enum wiphy_wowlan_support_flags { 541 WIPHY_WOWLAN_DISCONNECT, 542 WIPHY_WOWLAN_GTK_REKEY_FAILURE, 543 WIPHY_WOWLAN_MAGIC_PKT, 544 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY, 545 WIPHY_WOWLAN_NET_DETECT, 546 }; 547 548 struct wiphy_wowlan_support { 549 /* XXX TODO */ 550 enum wiphy_wowlan_support_flags flags; 551 int max_nd_match_sets, max_pkt_offset, n_patterns, pattern_max_len, pattern_min_len; 552 }; 553 554 struct station_del_parameters { 555 /* XXX TODO */ 556 const uint8_t *mac; 557 uint32_t reason_code; /* elsewhere uint16_t? */ 558 }; 559 560 struct station_info { 561 /* TODO FIXME */ 562 int assoc_req_ies_len, connected_time; 563 int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; 564 int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; 565 int rx_duration, tx_failed, tx_retries; 566 567 int chains; 568 uint8_t chain_signal[IEEE80211_MAX_CHAINS]; 569 uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; 570 571 uint8_t *assoc_req_ies; 572 struct rate_info rxrate; 573 struct rate_info txrate; 574 struct cfg80211_ibss_params bss_param; 575 struct nl80211_sta_flag_update sta_flags; 576 }; 577 578 struct station_parameters { 579 /* XXX TODO */ 580 int sta_flags_mask, sta_flags_set; 581 }; 582 583 struct key_params { 584 /* XXX TODO */ 585 const uint8_t *key; 586 const uint8_t *seq; 587 int key_len; 588 int seq_len; 589 uint32_t cipher; /* WLAN_CIPHER_SUITE_* */ 590 }; 591 592 struct mgmt_frame_regs { 593 /* XXX TODO */ 594 int interface_stypes; 595 }; 596 597 struct vif_params { 598 /* XXX TODO */ 599 uint8_t macaddr[ETH_ALEN]; 600 }; 601 602 /* That the world needs so many different structs for this is amazing. */ 603 struct mac_address { 604 uint8_t addr[ETH_ALEN]; 605 }; 606 607 struct ieee80211_reg_rule { 608 /* TODO FIXME */ 609 uint32_t flags; 610 struct freq_range { 611 int start_freq_khz; 612 int end_freq_khz; 613 int max_bandwidth_khz; 614 } freq_range; 615 struct power_rule { 616 int max_antenna_gain; 617 int max_eirp; 618 } power_rule; 619 }; 620 621 struct linuxkpi_ieee80211_regdomain { 622 /* TODO FIXME */ 623 uint8_t alpha2[2]; 624 int dfs_region; 625 int n_reg_rules; 626 struct ieee80211_reg_rule reg_rules[]; 627 }; 628 629 /* XXX-BZ this are insensible values probably ... */ 630 #define IEEE80211_HE_MAC_CAP0_HTC_HE 0x1 631 #define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x2 632 633 #define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x1 634 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 0x2 635 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x4 636 637 #define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x1 638 #define IEEE80211_HE_MAC_CAP2_ACK_EN 0x2 639 #define IEEE80211_HE_MAC_CAP2_BSR 0x4 640 #define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x8 641 #define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10 642 #define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x20 643 644 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 0x1 645 #define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x2 646 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 0x10 647 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 0x20 648 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 0x40 649 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x70 650 #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80 651 652 #define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x1 653 #define IEEE80211_HE_MAC_CAP4_BQR 0x2 654 #define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 0x4 655 #define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU 0x8 656 #define IEEE80211_HE_MAC_CAP4_OPS 0x10 657 658 #define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS 0x1 659 #define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX 0x2 660 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 0x4 661 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 0x8 662 #define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU 0x10 663 664 #define IEEE80211_HE_MCS_NOT_SUPPORTED 0x0 665 #define IEEE80211_HE_MCS_SUPPORT_0_7 0x1 666 #define IEEE80211_HE_MCS_SUPPORT_0_9 0x2 667 #define IEEE80211_HE_MCS_SUPPORT_0_11 0x4 668 669 #define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS 0x01 670 #define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS 0x02 671 #define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START 0x04 672 #define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN 0x08 673 #define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP 0x10 674 675 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x1 676 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x2 677 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x4 678 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x8 679 680 #define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x1 681 #define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x2 682 #define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS 0x4 683 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x8 684 #define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x10 685 686 #define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS 0x1 687 #define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x2 688 #define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x4 689 #define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x8 690 #define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10 691 692 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x1 693 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x2 694 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x4 695 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x8 696 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x10 697 #define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x20 698 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x40 699 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x80 700 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x10 701 #define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU 0x20 702 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x40 703 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x80 704 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x80 705 706 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1 707 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0x2 708 #define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x4 709 #define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x8 710 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x10 711 712 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x1 713 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x2 714 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x4 715 #define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x8 716 #define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x10 717 718 #define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x1 719 #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x2 720 #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x4 721 #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB 0x8 722 #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB 0x20 723 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x40 724 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x80 725 #define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x80 726 727 #define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x1 728 #define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x2 729 #define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x4 730 #define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x6 731 #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x8 732 #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP 0x10 733 #define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x20 734 735 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x1 736 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x2 737 #define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x4 738 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 0x8 739 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x10 740 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x20 741 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 0x40 742 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x80 743 744 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x1 745 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2 746 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x4 747 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK 0x8 748 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x10 749 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS 0x0 750 #define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK 0x20 751 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB 0x4 752 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x8 753 #define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x10 754 #define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x20 755 #define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM 0x40 756 757 #define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF 0x1 758 759 #define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT) 760 761 struct ieee80211_he_cap_elem { 762 u8 mac_cap_info[6]; 763 u8 phy_cap_info[11]; 764 } __packed; 765 766 struct ieee80211_he_mcs_nss_supp { 767 /* TODO FIXME */ 768 uint32_t rx_mcs_80; 769 uint32_t tx_mcs_80; 770 uint32_t rx_mcs_160; 771 uint32_t tx_mcs_160; 772 uint32_t rx_mcs_80p80; 773 uint32_t tx_mcs_80p80; 774 }; 775 776 #define IEEE80211_STA_HE_CAP_PPE_THRES_MAX 32 777 struct ieee80211_sta_he_cap { 778 /* TODO FIXME */ 779 int has_he; 780 struct ieee80211_he_cap_elem he_cap_elem; 781 struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; 782 uint8_t ppe_thres[IEEE80211_STA_HE_CAP_PPE_THRES_MAX]; 783 }; 784 785 struct ieee80211_sta_he_6ghz_capa { 786 /* TODO FIXME */ 787 int capa; 788 }; 789 790 struct ieee80211_sband_iftype_data { 791 /* TODO FIXME */ 792 enum nl80211_iftype types_mask; 793 struct ieee80211_sta_he_cap he_cap; 794 struct ieee80211_sta_he_6ghz_capa he_6ghz_capa; 795 struct { 796 const uint8_t *data; 797 size_t len; 798 } vendor_elems; 799 }; 800 801 struct ieee80211_supported_band { 802 /* TODO FIXME */ 803 struct linuxkpi_ieee80211_channel *channels; 804 struct ieee80211_rate *bitrates; 805 struct ieee80211_sband_iftype_data *iftype_data; 806 int n_channels; 807 int n_bitrates; 808 int n_iftype_data; 809 enum nl80211_band band; 810 struct ieee80211_sta_ht_cap ht_cap; 811 struct ieee80211_sta_vht_cap vht_cap; 812 }; 813 814 struct cfg80211_pkt_pattern { 815 /* XXX TODO */ 816 uint8_t *mask; 817 uint8_t *pattern; 818 int pattern_len; 819 int pkt_offset; 820 }; 821 822 struct cfg80211_wowlan { 823 /* XXX TODO */ 824 int disconnect, gtk_rekey_failure, magic_pkt; 825 int n_patterns; 826 struct cfg80211_sched_scan_request *nd_config; 827 struct cfg80211_pkt_pattern *patterns; 828 }; 829 830 struct cfg80211_gtk_rekey_data { 831 /* XXX TODO */ 832 int kck, kek, replay_ctr; 833 }; 834 835 struct cfg80211_tid_cfg { 836 /* XXX TODO */ 837 int mask, noack, retry_long, rtscts, tids; 838 enum nl80211_tx_rate_setting txrate_type; 839 struct cfg80211_bitrate_mask txrate_mask; 840 }; 841 842 struct cfg80211_tid_config { 843 /* XXX TODO */ 844 int n_tid_conf; 845 struct cfg80211_tid_cfg tid_conf[0]; 846 }; 847 848 struct ieee80211_iface_limit { 849 /* TODO FIXME */ 850 int max, types; 851 }; 852 853 struct ieee80211_iface_combination { 854 /* TODO FIXME */ 855 const struct ieee80211_iface_limit *limits; 856 int n_limits; 857 int max_interfaces, num_different_channels; 858 int beacon_int_infra_match, beacon_int_min_gcd; 859 }; 860 861 struct iface_combination_params { 862 int num_different_channels; 863 int iftype_num[NUM_NL80211_IFTYPES]; 864 }; 865 866 struct regulatory_request { 867 /* XXX TODO */ 868 uint8_t alpha2[2]; 869 int initiator, dfs_region; 870 }; 871 872 enum wiphy_vendor_cmd_need_flags { 873 WIPHY_VENDOR_CMD_NEED_NETDEV = 0x01, 874 WIPHY_VENDOR_CMD_NEED_RUNNING = 0x02, 875 WIPHY_VENDOR_CMD_NEED_WDEV = 0x04, 876 }; 877 878 struct wiphy_vendor_command { 879 struct { 880 uint32_t vendor_id; 881 uint32_t subcmd; 882 }; 883 uint32_t flags; 884 void *policy; 885 int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int); 886 }; 887 888 struct wiphy_iftype_ext_capab { 889 /* TODO FIXME */ 890 enum nl80211_iftype iftype; 891 const uint8_t *extended_capabilities; 892 const uint8_t *extended_capabilities_mask; 893 uint8_t extended_capabilities_len; 894 895 }; 896 897 struct tid_config_support { 898 /* TODO FIXME */ 899 uint64_t vif; /* enum nl80211_tid_cfg_attr */ 900 uint64_t peer; /* enum nl80211_tid_cfg_attr */ 901 }; 902 903 enum cfg80211_regulatory { 904 REGULATORY_CUSTOM_REG = BIT(0), 905 REGULATORY_STRICT_REG = BIT(1), 906 REGULATORY_DISABLE_BEACON_HINTS = BIT(2), 907 REGULATORY_ENABLE_RELAX_NO_IR = BIT(3), 908 REGULATORY_WIPHY_SELF_MANAGED = BIT(4), 909 REGULATORY_COUNTRY_IE_IGNORE = BIT(5), 910 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(6), 911 }; 912 913 #define WIPHY_FLAG_AP_UAPSD 0x00000001 914 #define WIPHY_FLAG_HAS_CHANNEL_SWITCH 0x00000002 915 #define WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL 0x00000004 916 #define WIPHY_FLAG_HAVE_AP_SME 0x00000008 917 #define WIPHY_FLAG_IBSS_RSN 0x00000010 918 #define WIPHY_FLAG_NETNS_OK 0x00000020 919 #define WIPHY_FLAG_OFFCHAN_TX 0x00000040 920 #define WIPHY_FLAG_PS_ON_BY_DEFAULT 0x00000080 921 #define WIPHY_FLAG_SPLIT_SCAN_6GHZ 0x00000100 922 #define WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK 0x00000200 923 #define WIPHY_FLAG_SUPPORTS_FW_ROAM 0x00000400 924 #define WIPHY_FLAG_SUPPORTS_TDLS 0x00000800 925 #define WIPHY_FLAG_TDLS_EXTERNAL_SETUP 0x00001000 926 #define WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD 0x00002000 927 928 struct wiphy { 929 930 struct device *dev; 931 struct mac_address *addresses; 932 int n_addresses; 933 uint32_t flags; 934 struct ieee80211_supported_band *bands[NUM_NL80211_BANDS]; 935 uint8_t perm_addr[ETH_ALEN]; 936 937 /* XXX TODO */ 938 const struct cfg80211_pmsr_capabilities *pmsr_capa; 939 const struct cfg80211_sar_capa *sar_capa; 940 const struct wiphy_iftype_ext_capab *iftype_ext_capab; 941 const struct linuxkpi_ieee80211_regdomain *regd; 942 char fw_version[ETHTOOL_FWVERS_LEN]; 943 const struct ieee80211_iface_combination *iface_combinations; 944 const uint32_t *cipher_suites; 945 int n_iface_combinations; 946 int n_cipher_suites; 947 void(*reg_notifier)(struct wiphy *, struct regulatory_request *); 948 enum cfg80211_regulatory regulatory_flags; 949 int n_vendor_commands; 950 const struct wiphy_vendor_command *vendor_commands; 951 const struct ieee80211_txrx_stypes *mgmt_stypes; 952 uint32_t rts_threshold; 953 uint32_t frag_threshold; 954 struct tid_config_support tid_config_support; 955 956 int available_antennas_rx, available_antennas_tx; 957 int features, hw_version; 958 int interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ie_len, max_scan_ssids, max_sched_scan_ie_len, max_sched_scan_plan_interval, max_sched_scan_plan_iterations, max_sched_scan_plans, max_sched_scan_reqs, max_sched_scan_ssids; 959 int num_iftype_ext_capab; 960 int max_ap_assoc_sta, probe_resp_offload, software_iftypes; 961 int bss_select_support, max_num_pmkids, retry_long, retry_short, signal_type; 962 int max_data_retry_count; 963 int tx_queue_len, rfkill; 964 965 unsigned long ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)]; 966 struct dentry *debugfsdir; 967 struct cfg80211_wowlan_support *wowlan; 968 /* Lower layer (driver/mac80211) specific data. */ 969 /* Must stay last. */ 970 uint8_t priv[0] __aligned(CACHE_LINE_SIZE); 971 }; 972 973 struct wireless_dev { 974 /* XXX TODO, like ic? */ 975 int iftype; 976 int address; 977 struct net_device *netdev; 978 struct wiphy *wiphy; 979 }; 980 981 struct cfg80211_ops { 982 /* XXX TODO */ 983 struct wireless_dev *(*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *); 984 int (*del_virtual_intf)(struct wiphy *, struct wireless_dev *); 985 s32 (*change_virtual_intf)(struct wiphy *, struct net_device *, enum nl80211_iftype, struct vif_params *); 986 s32 (*scan)(struct wiphy *, struct cfg80211_scan_request *); 987 s32 (*set_wiphy_params)(struct wiphy *, u32); 988 s32 (*join_ibss)(struct wiphy *, struct net_device *, struct cfg80211_ibss_params *); 989 s32 (*leave_ibss)(struct wiphy *, struct net_device *); 990 s32 (*get_station)(struct wiphy *, struct net_device *, const u8 *, struct station_info *); 991 int (*dump_station)(struct wiphy *, struct net_device *, int, u8 *, struct station_info *); 992 s32 (*set_tx_power)(struct wiphy *, struct wireless_dev *, enum nl80211_tx_power_setting, s32); 993 s32 (*get_tx_power)(struct wiphy *, struct wireless_dev *, s32 *); 994 s32 (*add_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, struct key_params *); 995 s32 (*del_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *); 996 s32 (*get_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, void *, void(*)(void *, struct key_params *)); 997 s32 (*set_default_key)(struct wiphy *, struct net_device *, u8, bool, bool); 998 s32 (*set_default_mgmt_key)(struct wiphy *, struct net_device *, u8); 999 s32 (*set_power_mgmt)(struct wiphy *, struct net_device *, bool, s32); 1000 s32 (*connect)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *); 1001 s32 (*disconnect)(struct wiphy *, struct net_device *, u16); 1002 s32 (*suspend)(struct wiphy *, struct cfg80211_wowlan *); 1003 s32 (*resume)(struct wiphy *); 1004 s32 (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 1005 s32 (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 1006 s32 (*flush_pmksa)(struct wiphy *, struct net_device *); 1007 s32 (*start_ap)(struct wiphy *, struct net_device *, struct cfg80211_ap_settings *); 1008 int (*stop_ap)(struct wiphy *, struct net_device *); 1009 s32 (*change_beacon)(struct wiphy *, struct net_device *, struct cfg80211_beacon_data *); 1010 int (*del_station)(struct wiphy *, struct net_device *, struct station_del_parameters *); 1011 int (*change_station)(struct wiphy *, struct net_device *, const u8 *, struct station_parameters *); 1012 int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *); 1013 int (*sched_scan_stop)(struct wiphy *, struct net_device *, u64); 1014 void (*update_mgmt_frame_registrations)(struct wiphy *, struct wireless_dev *, struct mgmt_frame_regs *); 1015 int (*mgmt_tx)(struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *, u64 *); 1016 int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, u64); 1017 int (*get_channel)(struct wiphy *, struct wireless_dev *, struct cfg80211_chan_def *); 1018 int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16); 1019 void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *); 1020 int (*tdls_oper)(struct wiphy *, struct net_device *, const u8 *, enum nl80211_tdls_operation); 1021 int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, u32); 1022 int (*set_pmk)(struct wiphy *, struct net_device *, const struct cfg80211_pmk_conf *); 1023 int (*del_pmk)(struct wiphy *, struct net_device *, const u8 *); 1024 int (*remain_on_channel)(struct wiphy *, struct wireless_dev *, struct linuxkpi_ieee80211_channel *, unsigned int, u64 *); 1025 int (*start_p2p_device)(struct wiphy *, struct wireless_dev *); 1026 void (*stop_p2p_device)(struct wiphy *, struct wireless_dev *); 1027 }; 1028 1029 1030 /* -------------------------------------------------------------------------- */ 1031 1032 /* linux_80211.c */ 1033 1034 struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t); 1035 void linuxkpi_wiphy_free(struct wiphy *wiphy); 1036 1037 int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 1038 struct linuxkpi_ieee80211_regdomain *regd); 1039 uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); 1040 uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); 1041 struct linuxkpi_ieee80211_channel * 1042 linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t); 1043 1044 /* -------------------------------------------------------------------------- */ 1045 1046 static __inline struct wiphy * 1047 wiphy_new(const struct cfg80211_ops *ops, size_t priv_len) 1048 { 1049 1050 return (linuxkpi_wiphy_new(ops, priv_len)); 1051 } 1052 1053 static __inline void 1054 wiphy_free(struct wiphy *wiphy) 1055 { 1056 1057 linuxkpi_wiphy_free(wiphy); 1058 } 1059 1060 static __inline void * 1061 wiphy_priv(struct wiphy *wiphy) 1062 { 1063 1064 return (wiphy->priv); 1065 } 1066 1067 static __inline void 1068 set_wiphy_dev(struct wiphy *wiphy, struct device *dev) 1069 { 1070 1071 wiphy->dev = dev; 1072 } 1073 1074 static __inline struct device * 1075 wiphy_dev(struct wiphy *wiphy) 1076 { 1077 1078 return (wiphy->dev); 1079 } 1080 1081 #define wiphy_err(_wiphy, _fmt, ...) \ 1082 dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) 1083 1084 static __inline const struct linuxkpi_ieee80211_regdomain * 1085 wiphy_dereference(struct wiphy *wiphy, 1086 const struct linuxkpi_ieee80211_regdomain *regd) 1087 { 1088 TODO(); 1089 return (NULL); 1090 } 1091 1092 static __inline void 1093 wiphy_lock(struct wiphy *wiphy) 1094 { 1095 TODO(); 1096 } 1097 1098 static __inline void 1099 wiphy_unlock(struct wiphy *wiphy) 1100 { 1101 TODO(); 1102 } 1103 1104 static __inline void 1105 wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, 1106 enum rfkill_hard_block_reasons reason) 1107 { 1108 TODO(); 1109 } 1110 1111 /* -------------------------------------------------------------------------- */ 1112 1113 static __inline bool 1114 rfkill_blocked(int rfkill) /* argument type? */ 1115 { 1116 TODO(); 1117 return (false); 1118 } 1119 1120 static __inline bool 1121 rfkill_soft_blocked(int rfkill) 1122 { 1123 TODO(); 1124 return (false); 1125 } 1126 1127 static __inline int 1128 reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq, 1129 struct ieee80211_reg_rule *rule) 1130 { 1131 1132 /* ETSI has special rules. FreeBSD regdb needs to learn about them. */ 1133 TODO(); 1134 1135 return (-ENXIO); 1136 } 1137 1138 static __inline const u8 * 1139 cfg80211_find_ie_match(uint32_t f, const u8 *ies, size_t ies_len, 1140 const u8 *match, int x, int y) 1141 { 1142 TODO(); 1143 return (NULL); 1144 } 1145 1146 static __inline const u8 * 1147 cfg80211_find_ie(uint8_t eid, uint8_t *variable, uint32_t frame_size) 1148 { 1149 TODO(); 1150 return (NULL); 1151 } 1152 1153 static __inline void 1154 cfg80211_pmsr_complete(struct wireless_dev *wdev, 1155 struct cfg80211_pmsr_request *req, gfp_t gfp) 1156 { 1157 TODO(); 1158 } 1159 1160 static __inline void 1161 cfg80211_pmsr_report(struct wireless_dev *wdev, 1162 struct cfg80211_pmsr_request *req, 1163 struct cfg80211_pmsr_result *result, gfp_t gfp) 1164 { 1165 TODO(); 1166 } 1167 1168 static __inline void 1169 cfg80211_chandef_create(struct cfg80211_chan_def *chandef, 1170 struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) 1171 { 1172 1173 KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); 1174 KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); 1175 1176 memset(chandef, 0, sizeof(*chandef)); 1177 chandef->chan = chan; 1178 chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ 1179 1180 switch (chan_flag) { 1181 case NL80211_CHAN_NO_HT: 1182 chandef->width = NL80211_CHAN_WIDTH_20_NOHT; 1183 chandef->center_freq1 = chan->center_freq; 1184 break; 1185 default: 1186 printf("%s: unsupported chan_flag %#0x\n", __func__, chan_flag); 1187 /* XXX-BZ should we panic instead? */ 1188 chandef->width = NL80211_CHAN_WIDTH_20; 1189 chandef->center_freq1 = chan->center_freq; 1190 break; 1191 }; 1192 } 1193 1194 static __inline void 1195 cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, 1196 void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data) 1197 { 1198 TODO(); 1199 } 1200 1201 struct element { 1202 uint8_t id; 1203 uint8_t datalen; 1204 uint8_t data[0]; 1205 }; 1206 1207 static __inline const struct element * 1208 cfg80211_find_elem(enum ieee80211_eid eid, uint8_t *data, size_t len) 1209 { 1210 TODO(); 1211 return (NULL); 1212 } 1213 1214 static __inline uint32_t 1215 cfg80211_calculate_bitrate(struct rate_info *rate) 1216 { 1217 TODO(); 1218 return (-1); 1219 } 1220 1221 static __inline uint32_t 1222 ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band) 1223 { 1224 1225 return (linuxkpi_ieee80211_channel_to_frequency(channel, band)); 1226 } 1227 1228 static __inline uint32_t 1229 ieee80211_frequency_to_channel(uint32_t freq) 1230 { 1231 1232 return (linuxkpi_ieee80211_frequency_to_channel(freq, 0)); 1233 } 1234 1235 static __inline int 1236 regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 1237 struct linuxkpi_ieee80211_regdomain *regd) 1238 { 1239 IMPROVE(); 1240 return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 1241 } 1242 1243 static __inline int 1244 regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy, 1245 struct linuxkpi_ieee80211_regdomain *regd) 1246 { 1247 1248 IMPROVE(); 1249 return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 1250 } 1251 1252 static __inline int 1253 regulatory_set_wiphy_regd(struct wiphy *wiphy, 1254 struct linuxkpi_ieee80211_regdomain *regd) 1255 { 1256 1257 IMPROVE(); 1258 if (regd == NULL) 1259 return (EINVAL); 1260 1261 /* XXX-BZ wild guessing here based on brcmfmac. */ 1262 if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) 1263 wiphy->regd = regd; 1264 else 1265 return (EPERM); 1266 1267 /* XXX FIXME, do we have to do anything with reg_notifier? */ 1268 return (0); 1269 } 1270 1271 static __inline int 1272 regulatory_hint(struct wiphy *wiphy, const uint8_t *alpha2) 1273 { 1274 TODO(); 1275 return (-ENXIO); 1276 } 1277 1278 static __inline const char * 1279 reg_initiator_name(enum nl80211_reg_initiator initiator) 1280 { 1281 TODO(); 1282 return (NULL); 1283 } 1284 1285 static __inline struct linuxkpi_ieee80211_regdomain * 1286 rtnl_dereference(const struct linuxkpi_ieee80211_regdomain *regd) 1287 { 1288 TODO(); 1289 return (NULL); 1290 } 1291 1292 static __inline struct ieee80211_reg_rule * 1293 freq_reg_info(struct wiphy *wiphy, uint32_t center_freq) 1294 { 1295 TODO(); 1296 return (NULL); 1297 } 1298 1299 static __inline struct cfg80211_bss * 1300 cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, 1301 uint8_t *bssid, void *p, int x, uint32_t f1, uint32_t f2) 1302 { 1303 TODO(); 1304 return (NULL); 1305 } 1306 1307 static __inline void 1308 cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) 1309 { 1310 TODO(); 1311 } 1312 1313 static __inline void 1314 wiphy_apply_custom_regulatory(struct wiphy *wiphy, 1315 const struct linuxkpi_ieee80211_regdomain *regd) 1316 { 1317 TODO(); 1318 } 1319 1320 static __inline char * 1321 wiphy_name(struct wiphy *wiphy) 1322 { 1323 if (wiphy != NULL && wiphy->dev != NULL) 1324 return dev_name(wiphy->dev); 1325 else { 1326 IMPROVE("wlanNA"); 1327 return ("wlanNA"); 1328 } 1329 } 1330 1331 static __inline void 1332 wiphy_read_of_freq_limits(struct wiphy *wiphy) 1333 { 1334 #ifdef FDT 1335 TODO(); 1336 #endif 1337 } 1338 1339 static __inline uint8_t * 1340 cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, 1341 uint8_t *data, size_t len) 1342 { 1343 TODO(); 1344 return (NULL); 1345 } 1346 1347 static __inline void 1348 wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) 1349 { 1350 1351 set_bit(ef, wiphy->ext_features); 1352 } 1353 1354 static __inline void * 1355 wiphy_net(struct wiphy *wiphy) 1356 { 1357 TODO(); 1358 return (NULL); /* XXX passed to dev_net_set() */ 1359 } 1360 1361 static __inline int 1362 wiphy_register(struct wiphy *wiphy) 1363 { 1364 TODO(); 1365 return (0); 1366 } 1367 1368 static __inline void 1369 wiphy_unregister(struct wiphy *wiphy) 1370 { 1371 TODO(); 1372 } 1373 1374 static __inline void 1375 wiphy_warn(struct wiphy *wiphy, const char *fmt, ...) 1376 { 1377 TODO(); 1378 } 1379 1380 static __inline int 1381 cfg80211_check_combinations(struct wiphy *wiphy, 1382 struct iface_combination_params *params) 1383 { 1384 TODO(); 1385 return (-ENOENT); 1386 } 1387 1388 static __inline uint8_t 1389 cfg80211_classify8021d(struct sk_buff *skb, void *p) 1390 { 1391 TODO(); 1392 return (0); 1393 } 1394 1395 static __inline void 1396 cfg80211_connect_done(struct net_device *ndev, 1397 struct cfg80211_connect_resp_params *conn_params, gfp_t gfp) 1398 { 1399 TODO(); 1400 } 1401 1402 static __inline void 1403 cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) 1404 { 1405 TODO(); 1406 } 1407 1408 static __inline void 1409 cfg80211_disconnected(struct net_device *ndev, uint16_t reason, 1410 void *p, int x, bool locally_generated, gfp_t gfp) 1411 { 1412 TODO(); 1413 } 1414 1415 static __inline int 1416 cfg80211_get_p2p_attr(const u8 *ie, u32 ie_len, 1417 enum ieee80211_p2p_attr_ids attr, u8 *p, size_t p_len) 1418 { 1419 TODO(); 1420 return (-1); 1421 } 1422 1423 static __inline void 1424 cfg80211_ibss_joined(struct net_device *ndev, const uint8_t *addr, 1425 struct linuxkpi_ieee80211_channel *chan, gfp_t gfp) 1426 { 1427 TODO(); 1428 } 1429 1430 static __inline struct cfg80211_bss * 1431 cfg80211_inform_bss(struct wiphy *wiphy, 1432 struct linuxkpi_ieee80211_channel *channel, 1433 enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 1434 uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, 1435 int signal, gfp_t gfp) 1436 { 1437 TODO(); 1438 return (NULL); 1439 } 1440 1441 static __inline struct cfg80211_bss * 1442 cfg80211_inform_bss_data(struct wiphy *wiphy, 1443 struct cfg80211_inform_bss *bss_data, 1444 enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 1445 uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, gfp_t gfp) 1446 { 1447 TODO(); 1448 return (NULL); 1449 } 1450 1451 static __inline void 1452 cfg80211_mgmt_tx_status(struct wireless_dev *wdev, uint64_t cookie, 1453 const u8 *buf, size_t len, bool ack, gfp_t gfp) 1454 { 1455 TODO(); 1456 } 1457 1458 static __inline void 1459 cfg80211_michael_mic_failure(struct net_device *ndev, const uint8_t *addr, 1460 enum nl80211_key_type key_type, int _x, void *p, gfp_t gfp) 1461 { 1462 TODO(); 1463 } 1464 1465 static __inline void 1466 cfg80211_new_sta(struct net_device *ndev, const uint8_t *addr, 1467 struct station_info *sinfo, gfp_t gfp) 1468 { 1469 TODO(); 1470 } 1471 1472 static __inline void 1473 cfg80211_del_sta(struct net_device *ndev, const uint8_t *addr, gfp_t gfp) 1474 { 1475 TODO(); 1476 } 1477 1478 static __inline void 1479 cfg80211_port_authorized(struct net_device *ndev, const uint8_t *bssid, 1480 gfp_t gfp) 1481 { 1482 TODO(); 1483 } 1484 1485 static __inline void 1486 cfg80211_ready_on_channel(struct wireless_dev *wdev, uint64_t cookie, 1487 struct linuxkpi_ieee80211_channel *channel, unsigned int duration, 1488 gfp_t gfp) 1489 { 1490 TODO(); 1491 } 1492 1493 static __inline void 1494 cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, 1495 uint64_t cookie, struct linuxkpi_ieee80211_channel *channel, gfp_t gfp) 1496 { 1497 TODO(); 1498 } 1499 1500 static __inline void 1501 cfg80211_report_wowlan_wakeup(void) 1502 { 1503 TODO(); 1504 } 1505 1506 static __inline void 1507 cfg80211_roamed(struct net_device *ndev, struct cfg80211_roam_info *roam_info, 1508 gfp_t gfp) 1509 { 1510 TODO(); 1511 } 1512 1513 static __inline void 1514 cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int _x, 1515 uint8_t *p, size_t p_len, int _x2) 1516 { 1517 TODO(); 1518 } 1519 1520 static __inline void 1521 cfg80211_scan_done(struct cfg80211_scan_request *scan_request, 1522 struct cfg80211_scan_info *info) 1523 { 1524 TODO(); 1525 } 1526 1527 static __inline void 1528 cfg80211_sched_scan_results(struct wiphy *wiphy, uint64_t reqid) 1529 { 1530 TODO(); 1531 } 1532 1533 static __inline void 1534 cfg80211_sched_scan_stopped(struct wiphy *wiphy, int _x) 1535 { 1536 TODO(); 1537 } 1538 1539 static __inline void 1540 cfg80211_unregister_wdev(struct wireless_dev *wdev) 1541 { 1542 TODO(); 1543 } 1544 1545 static __inline struct sk_buff * 1546 cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, unsigned int len) 1547 { 1548 TODO(); 1549 return (NULL); 1550 } 1551 1552 static __inline int 1553 cfg80211_vendor_cmd_reply(struct sk_buff *skb) 1554 { 1555 TODO(); 1556 return (-ENXIO); 1557 } 1558 1559 static __inline struct linuxkpi_ieee80211_channel * 1560 ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) 1561 { 1562 1563 return (linuxkpi_ieee80211_get_channel(wiphy, freq)); 1564 } 1565 1566 static __inline size_t 1567 ieee80211_get_hdrlen_from_skb(struct sk_buff *skb) 1568 { 1569 1570 TODO(); 1571 return (-1); 1572 } 1573 1574 static __inline void 1575 cfg80211_bss_flush(struct wiphy *wiphy) 1576 { 1577 TODO(); 1578 } 1579 1580 static __inline bool 1581 cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel) 1582 { 1583 1584 /* Only 6Ghz. */ 1585 if (channel->band != NL80211_BAND_6GHZ) 1586 return (false); 1587 1588 TODO(); 1589 return (false); 1590 } 1591 1592 static __inline int 1593 cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len, 1594 enum nl80211_band band, enum cfg80211_bss_frame_type ftype) 1595 { 1596 1597 TODO(); 1598 return (-1); 1599 } 1600 1601 /* Used for scanning at least. */ 1602 static __inline void 1603 get_random_mask_addr(uint8_t *dst, const uint8_t *addr, const uint8_t *mask) 1604 { 1605 int i; 1606 1607 /* Get a completely random address and then overlay what we want. */ 1608 get_random_bytes(dst, ETH_ALEN); 1609 for (i = 0; i < ETH_ALEN; i++) 1610 dst[i] = (dst[i] & ~(mask[i])) | (addr[i] & mask[i]); 1611 } 1612 1613 static __inline void 1614 cfg80211_shutdown_all_interfaces(struct wiphy *wiphy) 1615 { 1616 TODO(); 1617 } 1618 1619 #ifndef LINUXKPI_NET80211 1620 #define ieee80211_channel linuxkpi_ieee80211_channel 1621 #define ieee80211_regdomain linuxkpi_ieee80211_regdomain 1622 /* net80211::IEEE80211_VHT_MCS_SUPPORT_0_n() conflicts */ 1623 #if defined(IEEE80211_VHT_MCS_SUPPORT_0_7) 1624 #undef IEEE80211_VHT_MCS_SUPPORT_0_7 1625 #endif 1626 #if defined(IEEE80211_VHT_MCS_SUPPORT_0_8) 1627 #undef IEEE80211_VHT_MCS_SUPPORT_0_8 1628 #endif 1629 #if defined(IEEE80211_VHT_MCS_SUPPORT_0_9) 1630 #undef IEEE80211_VHT_MCS_SUPPORT_0_9 1631 #endif 1632 #define IEEE80211_VHT_MCS_SUPPORT_0_7 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_7 1633 #define IEEE80211_VHT_MCS_SUPPORT_0_8 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_8 1634 #define IEEE80211_VHT_MCS_SUPPORT_0_9 LKPI_IEEE80211_VHT_MCS_SUPPORT_0_9 1635 #endif 1636 1637 #endif /* _LINUXKPI_NET_CFG80211_H */ 1638