1 /*- 2 * Copyright (c) 2020-2022 The FreeBSD Foundation 3 * Copyright (c) 2020-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_MAC80211_H 33 #define _LINUXKPI_NET_MAC80211_H 34 35 #include <sys/types.h> 36 37 #include <asm/atomic64.h> 38 #include <linux/bitops.h> 39 #include <linux/etherdevice.h> 40 #include <linux/ethtool.h> 41 #include <linux/netdevice.h> 42 #include <linux/skbuff.h> 43 #include <linux/workqueue.h> 44 #include <net/cfg80211.h> 45 46 #define ARPHRD_IEEE80211_RADIOTAP __LINE__ /* XXX TODO brcmfmac */ 47 48 #define WLAN_OUI_MICROSOFT (0x0050F2) 49 #define WLAN_OUI_TYPE_MICROSOFT_WPA (1) 50 #define WLAN_OUI_TYPE_MICROSOFT_TPC (8) 51 #define WLAN_OUI_TYPE_WFA_P2P (9) 52 #define WLAN_OUI_WFA (0x506F9A) 53 54 /* hw->conf.flags */ 55 enum ieee80211_hw_conf_flags { 56 IEEE80211_CONF_IDLE = BIT(0), 57 IEEE80211_CONF_PS = BIT(1), 58 IEEE80211_CONF_MONITOR = BIT(2), 59 IEEE80211_CONF_OFFCHANNEL = BIT(3), 60 }; 61 62 /* (*ops->config()) */ 63 enum ieee80211_hw_conf_changed_flags { 64 IEEE80211_CONF_CHANGE_CHANNEL = BIT(0), 65 IEEE80211_CONF_CHANGE_IDLE = BIT(1), 66 IEEE80211_CONF_CHANGE_PS = BIT(2), 67 IEEE80211_CONF_CHANGE_MONITOR = BIT(3), 68 IEEE80211_CONF_CHANGE_POWER = BIT(4), 69 }; 70 71 #define CFG80211_TESTMODE_CMD(_x) /* XXX TODO */ 72 #define CFG80211_TESTMODE_DUMP(_x) /* XXX TODO */ 73 74 #define FCS_LEN 4 75 76 /* ops.configure_filter() */ 77 enum mcast_filter_flags { 78 FIF_ALLMULTI = BIT(0), 79 FIF_PROBE_REQ = BIT(1), 80 FIF_BCN_PRBRESP_PROMISC = BIT(2), 81 FIF_FCSFAIL = BIT(3), 82 FIF_OTHER_BSS = BIT(4), 83 FIF_PSPOLL = BIT(5), 84 FIF_CONTROL = BIT(6), 85 }; 86 87 enum ieee80211_bss_changed { 88 BSS_CHANGED_ARP_FILTER = BIT(0), 89 BSS_CHANGED_ASSOC = BIT(1), 90 BSS_CHANGED_BANDWIDTH = BIT(2), 91 BSS_CHANGED_BEACON = BIT(3), 92 BSS_CHANGED_BEACON_ENABLED = BIT(4), 93 BSS_CHANGED_BEACON_INFO = BIT(5), 94 BSS_CHANGED_BEACON_INT = BIT(6), 95 BSS_CHANGED_BSSID = BIT(7), 96 BSS_CHANGED_CQM = BIT(8), 97 BSS_CHANGED_ERP_CTS_PROT = BIT(9), 98 BSS_CHANGED_ERP_SLOT = BIT(10), 99 BSS_CHANGED_FTM_RESPONDER = BIT(11), 100 BSS_CHANGED_HT = BIT(12), 101 BSS_CHANGED_IDLE = BIT(13), 102 BSS_CHANGED_MU_GROUPS = BIT(14), 103 BSS_CHANGED_P2P_PS = BIT(15), 104 BSS_CHANGED_PS = BIT(16), 105 BSS_CHANGED_QOS = BIT(17), 106 BSS_CHANGED_TXPOWER = BIT(18), 107 BSS_CHANGED_HE_BSS_COLOR = BIT(19), 108 BSS_CHANGED_AP_PROBE_RESP = BIT(20), 109 BSS_CHANGED_BASIC_RATES = BIT(21), 110 BSS_CHANGED_ERP_PREAMBLE = BIT(22), 111 BSS_CHANGED_IBSS = BIT(23), 112 BSS_CHANGED_MCAST_RATE = BIT(24), 113 BSS_CHANGED_SSID = BIT(25), 114 BSS_CHANGED_FILS_DISCOVERY = BIT(26), 115 BSS_CHANGED_HE_OBSS_PD = BIT(27), 116 BSS_CHANGED_TWT = BIT(28), 117 BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT(30), 118 }; 119 120 /* 802.11 Figure 9-256 Suite selector format. [OUI(3), SUITE TYPE(1)] */ 121 #define WLAN_CIPHER_SUITE_OUI(_oui, _x) (((_oui) << 8) | ((_x) & 0xff)) 122 123 /* 802.11 Table 9-131 Cipher suite selectors. */ 124 /* 802.1x suite B 11 */ 125 #define WLAN_CIPHER_SUITE(_x) WLAN_CIPHER_SUITE_OUI(0x000fac, _x) 126 /* Use group 0 */ 127 #define WLAN_CIPHER_SUITE_WEP40 WLAN_CIPHER_SUITE(1) 128 #define WLAN_CIPHER_SUITE_TKIP WLAN_CIPHER_SUITE(2) 129 /* Reserved 3 */ 130 #define WLAN_CIPHER_SUITE_CCMP WLAN_CIPHER_SUITE(4) /* CCMP-128 */ 131 #define WLAN_CIPHER_SUITE_WEP104 WLAN_CIPHER_SUITE(5) 132 #define WLAN_CIPHER_SUITE_AES_CMAC WLAN_CIPHER_SUITE(6) /* BIP-CMAC-128 */ 133 /* Group addressed traffic not allowed 7 */ 134 #define WLAN_CIPHER_SUITE_GCMP WLAN_CIPHER_SUITE(8) 135 #define WLAN_CIPHER_SUITE_GCMP_256 WLAN_CIPHER_SUITE(9) 136 #define WLAN_CIPHER_SUITE_CCMP_256 WLAN_CIPHER_SUITE(10) 137 #define WLAN_CIPHER_SUITE_BIP_GMAC_128 WLAN_CIPHER_SUITE(11) 138 #define WLAN_CIPHER_SUITE_BIP_GMAC_256 WLAN_CIPHER_SUITE(12) 139 #define WLAN_CIPHER_SUITE_BIP_CMAC_256 WLAN_CIPHER_SUITE(13) 140 /* Reserved 14-255 */ 141 142 /* See ISO/IEC JTC 1 N 9880 Table 11 */ 143 #define WLAN_CIPHER_SUITE_SMS4 WLAN_CIPHER_SUITE_OUI(0x001472, 1) 144 145 146 /* 802.11 Table 9-133 AKM suite selectors. */ 147 #define WLAN_AKM_SUITE(_x) WLAN_CIPHER_SUITE_OUI(0x000fac, _x) 148 /* Reserved 0 */ 149 #define WLAN_AKM_SUITE_8021X WLAN_AKM_SUITE(1) 150 #define WLAN_AKM_SUITE_PSK WLAN_AKM_SUITE(2) 151 #define WLAN_AKM_SUITE_FT_8021X WLAN_AKM_SUITE(3) 152 #define WLAN_AKM_SUITE_FT_PSK WLAN_AKM_SUITE(4) 153 #define WLAN_AKM_SUITE_8021X_SHA256 WLAN_AKM_SUITE(5) 154 #define WLAN_AKM_SUITE_PSK_SHA256 WLAN_AKM_SUITE(6) 155 /* TDLS 7 */ 156 #define WLAN_AKM_SUITE_SAE WLAN_AKM_SUITE(8) 157 /* FToSAE 9 */ 158 /* AP peer key 10 */ 159 /* 802.1x suite B 11 */ 160 /* 802.1x suite B 384 12 */ 161 /* FTo802.1x 384 13 */ 162 /* Reserved 14-255 */ 163 /* Apparently 11ax defines more. Seen (19,20) mentioned. */ 164 165 #define TKIP_PN_TO_IV16(_x) ((uint16_t)(_x & 0xffff)) 166 #define TKIP_PN_TO_IV32(_x) ((uint32_t)((_x >> 16) & 0xffffffff)) 167 168 struct ieee80211_sta; 169 170 /* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */ 171 #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x3 172 #define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2 173 #define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT) 174 175 struct ieee80211_ampdu_params { 176 /* TODO FIXME */ 177 struct ieee80211_sta *sta; 178 uint8_t tid; 179 uint16_t ssn; 180 int action, amsdu, buf_size, timeout; 181 }; 182 183 struct ieee80211_bar { 184 /* TODO FIXME */ 185 int control, start_seq_num; 186 uint8_t *ra; 187 uint16_t frame_control; 188 }; 189 190 struct ieee80211_p2p_noa_desc { 191 uint32_t count; /* uint8_t ? */ 192 uint32_t duration; 193 uint32_t interval; 194 uint32_t start_time; 195 }; 196 197 struct ieee80211_p2p_noa_attr { 198 uint8_t index; 199 uint8_t oppps_ctwindow; 200 struct ieee80211_p2p_noa_desc desc[4]; 201 }; 202 203 struct ieee80211_mutable_offsets { 204 /* TODO FIXME */ 205 uint16_t tim_offset; 206 uint16_t cntdwn_counter_offs[2]; 207 208 int mbssid_off; 209 }; 210 211 struct mac80211_fils_discovery { 212 uint32_t max_interval; 213 }; 214 215 #define WLAN_MEMBERSHIP_LEN (8) 216 #define WLAN_USER_POSITION_LEN (16) 217 218 struct ieee80211_bss_conf { 219 /* TODO FIXME */ 220 const uint8_t *bssid; 221 uint8_t transmitter_bssid[ETH_ALEN]; 222 struct ieee80211_ftm_responder_params *ftmr_params; 223 struct ieee80211_p2p_noa_attr p2p_noa_attr; 224 struct cfg80211_chan_def chandef; 225 __be32 arp_addr_list[1]; /* XXX TODO */ 226 struct ieee80211_rate *beacon_rate; 227 struct { 228 uint8_t membership[WLAN_MEMBERSHIP_LEN]; 229 uint8_t position[WLAN_USER_POSITION_LEN]; 230 } mu_group; 231 struct cfg80211_he_bss_color he_bss_color; 232 struct ieee80211_he_obss_pd he_obss_pd; 233 size_t ssid_len; 234 uint8_t ssid[IEEE80211_NWID_LEN]; 235 uint16_t aid; 236 uint16_t ht_operation_mode; 237 int arp_addr_cnt; 238 239 uint8_t dtim_period; 240 uint8_t sync_dtim_count; 241 bool assoc; 242 bool idle; 243 bool qos; 244 bool ps; 245 bool twt_broadcast; 246 bool use_cts_prot; 247 bool use_short_preamble; 248 bool use_short_slot; 249 bool he_support; 250 bool csa_active; 251 uint32_t sync_device_ts; 252 uint64_t sync_tsf; 253 uint16_t beacon_int; 254 int16_t txpower; 255 uint32_t basic_rates; 256 int mcast_rate[NUM_NL80211_BANDS]; 257 struct cfg80211_bitrate_mask beacon_tx_rate; 258 struct mac80211_fils_discovery fils_discovery; 259 260 int ack_enabled, bssid_index, bssid_indicator, cqm_rssi_hyst, cqm_rssi_thold, ema_ap, frame_time_rts_th, ftm_responder; 261 int htc_trig_based_pkt_ext; 262 int multi_sta_back_32bit, nontransmitted; 263 int profile_periodicity; 264 int twt_requester, uora_exists, uora_ocw_range; 265 int assoc_capability, enable_beacon, hidden_ssid, ibss_joined, twt_protected; 266 int he_oper, twt_responder, unsol_bcast_probe_resp_interval; 267 int color_change_active; 268 }; 269 270 struct ieee80211_chanctx_conf { 271 /* TODO FIXME */ 272 int rx_chains_dynamic, rx_chains_static; 273 bool radar_enabled; 274 struct cfg80211_chan_def def; 275 struct cfg80211_chan_def min_def; 276 277 /* Must stay last. */ 278 uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); 279 }; 280 281 struct ieee80211_channel_switch { 282 /* TODO FIXME */ 283 int block_tx, count, delay, device_timestamp, timestamp; 284 struct cfg80211_chan_def chandef; 285 }; 286 287 struct ieee80211_cipher_scheme { 288 uint32_t cipher; 289 uint8_t iftype; /* We do not know the size of this. */ 290 uint8_t hdr_len; 291 uint8_t pn_len; 292 uint8_t pn_off; 293 uint8_t key_idx_off; 294 uint8_t key_idx_mask; 295 uint8_t key_idx_shift; 296 uint8_t mic_len; 297 }; 298 299 enum ieee80211_event_type { 300 BA_FRAME_TIMEOUT, 301 BAR_RX_EVENT, 302 MLME_EVENT, 303 RSSI_EVENT, 304 }; 305 306 enum ieee80211_rssi_event_data { 307 RSSI_EVENT_LOW, 308 RSSI_EVENT_HIGH, 309 }; 310 311 enum ieee80211_mlme_event_data { 312 ASSOC_EVENT, 313 AUTH_EVENT, 314 DEAUTH_RX_EVENT, 315 DEAUTH_TX_EVENT, 316 }; 317 318 enum ieee80211_mlme_event_status { 319 MLME_DENIED, 320 MLME_TIMEOUT, 321 }; 322 323 struct ieee80211_mlme_event { 324 enum ieee80211_mlme_event_data data; 325 enum ieee80211_mlme_event_status status; 326 int reason; 327 }; 328 329 struct ieee80211_event { 330 /* TODO FIXME */ 331 enum ieee80211_event_type type; 332 union { 333 struct { 334 int ssn; 335 struct ieee80211_sta *sta; 336 uint8_t tid; 337 } ba; 338 struct ieee80211_mlme_event mlme; 339 } u; 340 }; 341 342 struct ieee80211_ftm_responder_params { 343 /* TODO FIXME */ 344 uint8_t *lci; 345 uint8_t *civicloc; 346 int lci_len; 347 int civicloc_len; 348 }; 349 350 struct ieee80211_he_mu_edca_param_ac_rec { 351 /* TODO FIXME */ 352 int aifsn, ecw_min_max, mu_edca_timer; 353 }; 354 355 struct ieee80211_conf { 356 int dynamic_ps_timeout; 357 int power_level; 358 uint32_t listen_interval; 359 bool radar_enabled; 360 enum ieee80211_hw_conf_flags flags; 361 struct cfg80211_chan_def chandef; 362 }; 363 364 enum ieee80211_hw_flags { 365 IEEE80211_HW_AMPDU_AGGREGATION, 366 IEEE80211_HW_AP_LINK_PS, 367 IEEE80211_HW_BUFF_MMPDU_TXQ, 368 IEEE80211_HW_CHANCTX_STA_CSA, 369 IEEE80211_HW_CONNECTION_MONITOR, 370 IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP, 371 IEEE80211_HW_HAS_RATE_CONTROL, 372 IEEE80211_HW_MFP_CAPABLE, 373 IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR, 374 IEEE80211_HW_REPORTS_TX_ACK_STATUS, 375 IEEE80211_HW_RX_INCLUDES_FCS, 376 IEEE80211_HW_SIGNAL_DBM, 377 IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS, 378 IEEE80211_HW_SPECTRUM_MGMT, 379 IEEE80211_HW_STA_MMPDU_TXQ, 380 IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU, 381 IEEE80211_HW_SUPPORTS_CLONED_SKBS, 382 IEEE80211_HW_SUPPORTS_DYNAMIC_PS, 383 IEEE80211_HW_SUPPORTS_MULTI_BSSID, 384 IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, 385 IEEE80211_HW_SUPPORTS_PS, 386 IEEE80211_HW_SUPPORTS_REORDERING_BUFFER, 387 IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW, 388 IEEE80211_HW_SUPPORT_FAST_XMIT, 389 IEEE80211_HW_TDLS_WIDER_BW, 390 IEEE80211_HW_TIMING_BEACON_ONLY, 391 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW, 392 IEEE80211_HW_TX_AMSDU, 393 IEEE80211_HW_TX_FRAG_LIST, 394 IEEE80211_HW_USES_RSS, 395 IEEE80211_HW_WANT_MONITOR_VIF, 396 IEEE80211_HW_SW_CRYPTO_CONTROL, 397 IEEE80211_HW_SUPPORTS_TX_FRAG, 398 IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA, 399 IEEE80211_HW_SUPPORTS_PER_STA_GTK, 400 IEEE80211_HW_REPORTS_LOW_ACK, 401 IEEE80211_HW_QUEUE_CONTROL, 402 IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD, 403 IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, 404 IEEE80211_HW_SUPPORTS_RC_TABLE, 405 406 /* Keep last. */ 407 NUM_IEEE80211_HW_FLAGS 408 }; 409 410 struct ieee80211_hw { 411 412 struct wiphy *wiphy; 413 414 /* TODO FIXME */ 415 int max_rx_aggregation_subframes, max_tx_aggregation_subframes; 416 int extra_tx_headroom, weight_multiplier; 417 int max_rate_tries, max_rates, max_report_rates; 418 struct ieee80211_cipher_scheme *cipher_schemes; 419 int n_cipher_schemes; 420 const char *rate_control_algorithm; 421 struct { 422 uint16_t units_pos; /* radiotap "spec" is .. inconsistent. */ 423 uint16_t accuracy; 424 } radiotap_timestamp; 425 size_t sta_data_size; 426 size_t vif_data_size; 427 size_t chanctx_data_size; 428 size_t txq_data_size; 429 uint16_t radiotap_mcs_details; 430 uint16_t radiotap_vht_details; 431 uint16_t queues; 432 uint16_t offchannel_tx_hw_queue; 433 uint16_t uapsd_max_sp_len; 434 uint16_t uapsd_queues; 435 uint16_t max_tx_fragments; 436 uint16_t max_listen_interval; 437 netdev_features_t netdev_features; 438 unsigned long flags[BITS_TO_LONGS(NUM_IEEE80211_HW_FLAGS)]; 439 struct ieee80211_conf conf; 440 441 #if 0 /* leave here for documentation purposes. This does NOT work. */ 442 /* Must stay last. */ 443 uint8_t priv[0] __aligned(CACHE_LINE_SIZE); 444 #else 445 void *priv; 446 #endif 447 }; 448 449 enum ieee802111_key_flag { 450 IEEE80211_KEY_FLAG_GENERATE_IV = BIT(0), 451 IEEE80211_KEY_FLAG_GENERATE_MMIC = BIT(1), 452 IEEE80211_KEY_FLAG_PAIRWISE = BIT(2), 453 IEEE80211_KEY_FLAG_PUT_IV_SPACE = BIT(3), 454 IEEE80211_KEY_FLAG_PUT_MIC_SPACE = BIT(4), 455 IEEE80211_KEY_FLAG_SW_MGMT_TX = BIT(5), 456 IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(6), 457 IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(7), 458 }; 459 460 struct ieee80211_key_conf { 461 atomic64_t tx_pn; 462 uint32_t cipher; 463 uint8_t icv_len; /* __unused nowadays? */ 464 uint8_t iv_len; 465 uint8_t hw_key_idx; /* Set by drv. */ 466 uint8_t keyidx; 467 uint16_t flags; 468 uint8_t keylen; 469 uint8_t key[0]; 470 }; 471 472 struct ieee80211_key_seq { 473 /* TODO FIXME */ 474 union { 475 struct { 476 uint8_t seq[IEEE80211_MAX_PN_LEN]; 477 uint8_t seq_len; 478 } hw; 479 struct { 480 uint8_t pn[IEEE80211_CCMP_PN_LEN]; 481 } ccmp; 482 struct { 483 uint8_t pn[IEEE80211_CCMP_PN_LEN]; 484 } aes_cmac; 485 struct { 486 uint32_t iv32; 487 uint16_t iv16; 488 } tkip; 489 }; 490 }; 491 492 493 enum ieee80211_rx_status_flags { 494 RX_FLAG_ALLOW_SAME_PN = BIT(0), 495 RX_FLAG_AMPDU_DETAILS = BIT(1), 496 RX_FLAG_AMPDU_EOF_BIT = BIT(2), 497 RX_FLAG_AMPDU_EOF_BIT_KNOWN = BIT(3), 498 RX_FLAG_DECRYPTED = BIT(4), 499 RX_FLAG_DUP_VALIDATED = BIT(5), 500 RX_FLAG_FAILED_FCS_CRC = BIT(6), 501 RX_FLAG_ICV_STRIPPED = BIT(7), 502 RX_FLAG_MACTIME_PLCP_START = BIT(8), 503 RX_FLAG_MACTIME_START = BIT(9), 504 RX_FLAG_MIC_STRIPPED = BIT(10), 505 RX_FLAG_MMIC_ERROR = BIT(11), 506 RX_FLAG_MMIC_STRIPPED = BIT(12), 507 RX_FLAG_NO_PSDU = BIT(13), 508 RX_FLAG_PN_VALIDATED = BIT(14), 509 RX_FLAG_RADIOTAP_HE = BIT(15), 510 RX_FLAG_RADIOTAP_HE_MU = BIT(16), 511 RX_FLAG_RADIOTAP_LSIG = BIT(17), 512 RX_FLAG_RADIOTAP_VENDOR_DATA = BIT(18), 513 RX_FLAG_NO_SIGNAL_VAL = BIT(19), 514 RX_FLAG_IV_STRIPPED = BIT(20), 515 RX_FLAG_AMPDU_IS_LAST = BIT(21), 516 RX_FLAG_AMPDU_LAST_KNOWN = BIT(22), 517 RX_FLAG_AMSDU_MORE = BIT(23), 518 RX_FLAG_MACTIME_END = BIT(24), 519 RX_FLAG_ONLY_MONITOR = BIT(25), 520 RX_FLAG_SKIP_MONITOR = BIT(26), 521 RX_FLAG_8023 = BIT(27), 522 }; 523 524 enum mac80211_rx_encoding { 525 RX_ENC_LEGACY = 0, 526 RX_ENC_HT, 527 RX_ENC_VHT, 528 RX_ENC_HE 529 }; 530 531 struct ieee80211_rx_status { 532 /* TODO FIXME, this is too large. Over-reduce types to u8 where possible. */ 533 uint64_t boottime_ns; 534 uint64_t mactime; 535 uint32_t device_timestamp; 536 enum ieee80211_rx_status_flags flag; 537 uint16_t freq; 538 uint8_t encoding:2, bw:3, he_ru:3; /* enum mac80211_rx_encoding, rate_info_bw */ /* See mt76.h */ 539 uint8_t ampdu_reference; 540 uint8_t band; 541 uint8_t chains; 542 int8_t chain_signal[IEEE80211_MAX_CHAINS]; 543 int8_t signal; 544 uint8_t enc_flags; 545 uint8_t he_dcm; 546 uint8_t he_gi; 547 uint8_t zero_length_psdu_type; 548 uint8_t nss; 549 uint8_t rate_idx; 550 }; 551 552 struct ieee80211_tx_rate_status { 553 }; 554 555 struct ieee80211_tx_status { 556 struct ieee80211_sta *sta; 557 struct ieee80211_tx_info *info; 558 559 u8 n_rates; 560 struct ieee80211_tx_rate_status *rates; 561 562 struct sk_buff *skb; 563 struct list_head *free_list; 564 }; 565 566 struct ieee80211_scan_ies { 567 /* TODO FIXME */ 568 int common_ie_len; 569 int len[NUM_NL80211_BANDS]; 570 uint8_t *common_ies; 571 uint8_t *ies[NUM_NL80211_BANDS]; 572 }; 573 574 struct ieee80211_scan_request { 575 struct ieee80211_scan_ies ies; 576 struct cfg80211_scan_request req; 577 }; 578 579 struct ieee80211_txq { 580 struct ieee80211_sta *sta; 581 struct ieee80211_vif *vif; 582 int ac; 583 uint8_t tid; 584 585 /* Must stay last. */ 586 uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); 587 }; 588 589 struct ieee80211_sta_rates { 590 /* XXX TODO */ 591 /* XXX some _rcu thing */ 592 struct { 593 int idx; 594 int flags; 595 } rate[1]; /* XXX what is the real number? */ 596 }; 597 598 struct ieee80211_sta_txpwr { 599 /* XXX TODO */ 600 enum nl80211_tx_power_setting type; 601 short power; 602 }; 603 604 struct ieee80211_link_sta { 605 uint32_t supp_rates[NUM_NL80211_BANDS]; 606 struct ieee80211_sta_ht_cap ht_cap; 607 struct ieee80211_sta_vht_cap vht_cap; 608 struct ieee80211_sta_he_cap he_cap; 609 struct ieee80211_sta_he_6ghz_capa he_6ghz_capa; 610 uint8_t rx_nss; 611 enum ieee80211_sta_rx_bw bandwidth; 612 struct ieee80211_sta_txpwr txpwr; 613 }; 614 615 #define IEEE80211_NUM_TIDS 16 /* net80211::WME_NUM_TID */ 616 struct ieee80211_sta { 617 /* TODO FIXME */ 618 int max_amsdu_len, max_amsdu_subframes, max_rc_amsdu_len, max_sp; 619 int mfp, smps_mode, tdls, tdls_initiator, uapsd_queues, wme; 620 struct ieee80211_txq *txq[IEEE80211_NUM_TIDS + 1]; /* iwlwifi: 8 and adds +1 to tid_data, net80211::IEEE80211_TID_SIZE */ 621 struct ieee80211_sta_rates *rates; /* some rcu thing? */ 622 uint32_t max_tid_amsdu_len[IEEE80211_NUM_TIDS]; 623 uint8_t addr[ETH_ALEN]; 624 uint16_t aid; 625 626 struct ieee80211_link_sta deflink; 627 628 /* Must stay last. */ 629 uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); 630 }; 631 632 struct ieee80211_tdls_ch_sw_params { 633 /* TODO FIXME */ 634 int action_code, ch_sw_tm_ie, status, switch_time, switch_timeout, timestamp; 635 struct ieee80211_sta *sta; 636 struct cfg80211_chan_def *chandef; 637 struct sk_buff *tmpl_skb; 638 }; 639 640 struct ieee80211_tx_control { 641 /* TODO FIXME */ 642 struct ieee80211_sta *sta; 643 }; 644 645 struct ieee80211_tx_queue_params { 646 /* These types are based on iwlwifi FW structs. */ 647 uint16_t cw_min; 648 uint16_t cw_max; 649 uint16_t txop; 650 uint8_t aifs; 651 652 /* TODO FIXME */ 653 int acm, mu_edca, uapsd; 654 struct ieee80211_he_mu_edca_param_ac_rec mu_edca_param_rec; 655 }; 656 657 struct ieee80211_tx_rate { 658 uint8_t idx; 659 uint16_t count:5, 660 flags:11; 661 }; 662 663 enum ieee80211_vif_driver_flags { 664 IEEE80211_VIF_BEACON_FILTER = BIT(0), 665 IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1), 666 IEEE80211_VIF_SUPPORTS_UAPSD = BIT(2), 667 }; 668 669 #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 670 671 struct ieee80211_vif_cfg { 672 uint16_t aid; 673 bool assoc; 674 int arp_addr_cnt; 675 uint32_t arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; /* big endian */ 676 }; 677 678 struct ieee80211_vif { 679 /* TODO FIXME */ 680 enum nl80211_iftype type; 681 int csa_active, mu_mimo_owner; 682 int cab_queue; 683 int color_change_active, offload_flags; 684 enum ieee80211_vif_driver_flags driver_flags; 685 bool p2p; 686 bool probe_req_reg; 687 uint8_t addr[ETH_ALEN]; 688 struct ieee80211_vif_cfg cfg; 689 struct ieee80211_chanctx_conf *chanctx_conf; 690 struct ieee80211_txq *txq; 691 struct ieee80211_bss_conf bss_conf; 692 uint8_t hw_queue[IEEE80211_NUM_ACS]; 693 694 /* Must stay last. */ 695 uint8_t drv_priv[0] __aligned(CACHE_LINE_SIZE); 696 }; 697 698 struct ieee80211_vif_chanctx_switch { 699 struct ieee80211_chanctx_conf *old_ctx, *new_ctx; 700 struct ieee80211_vif *vif; 701 }; 702 703 struct ieee80211_prep_tx_info { 704 u16 duration; 705 bool success; 706 }; 707 708 /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */ 709 /* Also warning: some sizes change by pointer size! This is 64bit only. */ 710 struct ieee80211_tx_info { 711 enum ieee80211_tx_info_flags flags; 712 /* TODO FIXME */ 713 u8 band; 714 u8 hw_queue; 715 bool tx_time_est; 716 union { 717 struct { 718 struct ieee80211_tx_rate rates[4]; 719 bool use_rts; 720 struct ieee80211_vif *vif; 721 struct ieee80211_key_conf *hw_key; 722 enum ieee80211_tx_control_flags flags; 723 } control; 724 struct { 725 struct ieee80211_tx_rate rates[4]; 726 uint32_t ack_signal; 727 uint8_t ampdu_ack_len; 728 uint8_t ampdu_len; 729 uint8_t antenna; 730 uint16_t tx_time; 731 bool is_valid_ack_signal; 732 void *status_driver_data[16 / sizeof(void *)]; /* XXX TODO */ 733 } status; 734 #define IEEE80211_TX_INFO_DRIVER_DATA_SIZE (5 * sizeof(void *)) /* XXX TODO 5? */ 735 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)]; 736 }; 737 }; 738 739 /* net80211 conflict */ 740 struct linuxkpi_ieee80211_tim_ie { 741 uint8_t dtim_count; 742 uint8_t dtim_period; 743 uint8_t bitmap_ctrl; 744 uint8_t *virtual_map; 745 }; 746 #define ieee80211_tim_ie linuxkpi_ieee80211_tim_ie 747 748 struct survey_info { /* net80211::struct ieee80211_channel_survey */ 749 /* TODO FIXME */ 750 uint32_t filled; 751 #define SURVEY_INFO_TIME 0x0001 752 #define SURVEY_INFO_TIME_RX 0x0002 753 #define SURVEY_INFO_TIME_SCAN 0x0004 754 #define SURVEY_INFO_TIME_TX 0x0008 755 #define SURVEY_INFO_TIME_BSS_RX 0x0010 756 #define SURVEY_INFO_TIME_BUSY 0x0020 757 #define SURVEY_INFO_IN_USE 0x0040 758 #define SURVEY_INFO_NOISE_DBM 0x0080 759 uint32_t noise; 760 uint64_t time; 761 uint64_t time_bss_rx; 762 uint64_t time_busy; 763 uint64_t time_rx; 764 uint64_t time_scan; 765 uint64_t time_tx; 766 struct ieee80211_channel *channel; 767 }; 768 769 enum ieee80211_iface_iter { 770 IEEE80211_IFACE_ITER_NORMAL = BIT(0), 771 IEEE80211_IFACE_ITER_RESUME_ALL = BIT(1), 772 IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2), /* seems to be an iter flag */ 773 774 /* Internal flags only. */ 775 /* ieee80211_iterate_active_interfaces*(). */ 776 IEEE80211_IFACE_ITER__ATOMIC = BIT(6), 777 IEEE80211_IFACE_ITER__ACTIVE = BIT(7), 778 IEEE80211_IFACE_ITER__MTX = BIT(8), 779 }; 780 781 enum set_key_cmd { 782 SET_KEY, 783 DISABLE_KEY, 784 }; 785 786 /* 802.11-2020, 9.4.2.55.2 HT Capability Information field. */ 787 enum rx_enc_flags { 788 RX_ENC_FLAG_SHORTPRE = BIT(0), 789 RX_ENC_FLAG_SHORT_GI = BIT(2), 790 RX_ENC_FLAG_HT_GF = BIT(3), 791 RX_ENC_FLAG_STBC_MASK = BIT(4) | BIT(5), 792 #define RX_ENC_FLAG_STBC_SHIFT 4 793 RX_ENC_FLAG_LDPC = BIT(6), 794 RX_ENC_FLAG_BF = BIT(7), 795 }; 796 797 enum sta_notify_cmd { 798 STA_NOTIFY_AWAKE, 799 STA_NOTIFY_SLEEP, 800 }; 801 802 struct ieee80211_low_level_stats { 803 /* Can we make them uint64_t? */ 804 uint32_t dot11ACKFailureCount; 805 uint32_t dot11FCSErrorCount; 806 uint32_t dot11RTSFailureCount; 807 uint32_t dot11RTSSuccessCount; 808 }; 809 810 enum ieee80211_offload_flags { 811 IEEE80211_OFFLOAD_ENCAP_4ADDR, 812 IEEE80211_OFFLOAD_ENCAP_ENABLED, 813 IEEE80211_OFFLOAD_DECAP_ENABLED, 814 }; 815 816 struct ieee80211_ops { 817 /* TODO FIXME */ 818 int (*start)(struct ieee80211_hw *); 819 void (*stop)(struct ieee80211_hw *); 820 821 int (*config)(struct ieee80211_hw *, u32); 822 void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type); 823 824 int (*add_interface)(struct ieee80211_hw *, struct ieee80211_vif *); 825 void (*remove_interface)(struct ieee80211_hw *, struct ieee80211_vif *); 826 int (*change_interface)(struct ieee80211_hw *, struct ieee80211_vif *, enum nl80211_iftype, bool); 827 828 void (*sw_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, const u8 *); 829 void (*sw_scan_complete)(struct ieee80211_hw *, struct ieee80211_vif *); 830 int (*sched_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_sched_scan_request *, struct ieee80211_scan_ies *); 831 int (*sched_scan_stop)(struct ieee80211_hw *, struct ieee80211_vif *); 832 int (*hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_scan_request *); 833 void (*cancel_hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *); 834 835 int (*conf_tx)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u16, const struct ieee80211_tx_queue_params *); 836 void (*tx)(struct ieee80211_hw *, struct ieee80211_tx_control *, struct sk_buff *); 837 int (*tx_last_beacon)(struct ieee80211_hw *); 838 void (*wake_tx_queue)(struct ieee80211_hw *, struct ieee80211_txq *); 839 840 void (*mgd_prepare_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); 841 void (*mgd_complete_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); 842 void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *); 843 844 void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool); 845 846 int (*set_frag_threshold)(struct ieee80211_hw *, u32); 847 848 void (*sync_rx_queues)(struct ieee80211_hw *); 849 850 void (*allow_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); 851 void (*release_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); 852 853 int (*sta_add)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 854 int (*sta_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 855 int (*sta_set_txpwr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 856 void (*sta_statistics)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct station_info *); 857 void (*sta_pre_rcu_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 858 int (*sta_state)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, enum ieee80211_sta_state, enum ieee80211_sta_state); 859 void (*sta_notify)(struct ieee80211_hw *, struct ieee80211_vif *, enum sta_notify_cmd, struct ieee80211_sta *); 860 void (*sta_rc_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u32); 861 void (*sta_rate_tbl_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 862 void (*sta_set_4addr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool); 863 void (*sta_set_decap_offload)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool); 864 865 u64 (*prepare_multicast)(struct ieee80211_hw *, struct netdev_hw_addr_list *); 866 867 int (*ampdu_action)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *); 868 869 bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *, struct sk_buff *, struct sk_buff *); 870 871 int (*pre_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 872 int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); 873 void (*channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 874 void (*channel_switch_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *); 875 void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); 876 void (*channel_switch_rx_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 877 int (*tdls_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *, struct sk_buff *, u32); 878 void (*tdls_cancel_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 879 void (*tdls_recv_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_tdls_ch_sw_params *); 880 881 int (*add_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *); 882 void (*remove_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *); 883 void (*change_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, u32); 884 int (*assign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *); 885 void (*unassign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *); 886 int (*switch_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif_chanctx_switch *, int, enum ieee80211_chanctx_switch_mode); 887 888 int (*get_antenna)(struct ieee80211_hw *, u32 *, u32 *); 889 int (*set_antenna)(struct ieee80211_hw *, u32, u32); 890 891 int (*remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel *, int, enum ieee80211_roc_type); 892 int (*cancel_remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *); 893 894 void (*configure_filter)(struct ieee80211_hw *, unsigned int, unsigned int *, u64); 895 void (*config_iface_filter)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int, unsigned int); 896 897 void (*bss_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64); 898 int (*set_rts_threshold)(struct ieee80211_hw *, u32); 899 void (*event_callback)(struct ieee80211_hw *, struct ieee80211_vif *, const struct ieee80211_event *); 900 int (*get_survey)(struct ieee80211_hw *, int, struct survey_info *); 901 int (*get_ftm_responder_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_ftm_responder_stats *); 902 903 uint64_t (*get_tsf)(struct ieee80211_hw *, struct ieee80211_vif *); 904 void (*set_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, uint64_t); 905 void (*offset_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, s64); 906 907 int (*set_bitrate_mask)(struct ieee80211_hw *, struct ieee80211_vif *, const struct cfg80211_bitrate_mask *); 908 void (*set_coverage_class)(struct ieee80211_hw *, s16); 909 int (*set_tim)(struct ieee80211_hw *, struct ieee80211_sta *, bool); 910 911 int (*set_key)(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *); 912 void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int); 913 void (*update_tkip_key)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32, u16 *); 914 915 int (*start_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); 916 void (*abort_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); 917 918 int (*start_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf); 919 void (*stop_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf); 920 int (*join_ibss)(struct ieee80211_hw *, struct ieee80211_vif *); 921 void (*leave_ibss)(struct ieee80211_hw *, struct ieee80211_vif *); 922 923 int (*set_sar_specs)(struct ieee80211_hw *, const struct cfg80211_sar_specs *); 924 925 int (*set_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct cfg80211_tid_config *); 926 int (*reset_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8); 927 928 int (*get_et_sset_count)(struct ieee80211_hw *, struct ieee80211_vif *, int); 929 void (*get_et_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct ethtool_stats *, u64 *); 930 void (*get_et_strings)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u8 *); 931 932 void (*update_vif_offload)(struct ieee80211_hw *, struct ieee80211_vif *); 933 934 int (*get_txpower)(struct ieee80211_hw *, struct ieee80211_vif *, int *); 935 int (*get_stats)(struct ieee80211_hw *, struct ieee80211_low_level_stats *); 936 937 int (*set_radar_background)(struct ieee80211_hw *, struct cfg80211_chan_def *); 938 939 void (*add_twt_setup)(struct ieee80211_hw *, struct ieee80211_sta *, struct ieee80211_twt_setup *); 940 void (*twt_teardown_request)(struct ieee80211_hw *, struct ieee80211_sta *, u8); 941 }; 942 943 944 /* -------------------------------------------------------------------------- */ 945 946 /* linux_80211.c */ 947 extern const struct cfg80211_ops linuxkpi_mac80211cfgops; 948 949 struct ieee80211_hw *linuxkpi_ieee80211_alloc_hw(size_t, 950 const struct ieee80211_ops *); 951 void linuxkpi_ieee80211_iffree(struct ieee80211_hw *); 952 void linuxkpi_set_ieee80211_dev(struct ieee80211_hw *, char *); 953 int linuxkpi_ieee80211_ifattach(struct ieee80211_hw *); 954 void linuxkpi_ieee80211_ifdetach(struct ieee80211_hw *); 955 struct ieee80211_hw * linuxkpi_wiphy_to_ieee80211_hw(struct wiphy *); 956 void linuxkpi_ieee80211_iterate_interfaces( 957 struct ieee80211_hw *hw, enum ieee80211_iface_iter flags, 958 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 959 void *); 960 void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *, 961 struct ieee80211_vif *, 962 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 963 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 964 void *); 965 void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *, 966 void(*iterfunc)(struct ieee80211_hw *, 967 struct ieee80211_chanctx_conf *, void *), 968 void *); 969 void linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *, 970 void (*iterfunc)(void *, struct ieee80211_sta *), void *); 971 void linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *, 972 struct cfg80211_scan_info *); 973 void linuxkpi_ieee80211_rx(struct ieee80211_hw *, struct sk_buff *, 974 struct ieee80211_sta *, struct napi_struct *); 975 uint8_t linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *, bool); 976 struct ieee80211_sta *linuxkpi_ieee80211_find_sta(struct ieee80211_vif *, 977 const u8 *); 978 struct ieee80211_sta *linuxkpi_ieee80211_find_sta_by_ifaddr( 979 struct ieee80211_hw *, const uint8_t *, const uint8_t *); 980 struct sk_buff *linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *, 981 struct ieee80211_txq *); 982 bool linuxkpi_ieee80211_is_ie_id_in_ie_buf(const u8, const u8 *, size_t); 983 bool linuxkpi_ieee80211_ie_advance(size_t *, const u8 *, size_t); 984 void linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *, struct sk_buff *, 985 int); 986 void linuxkpi_ieee80211_queue_delayed_work(struct ieee80211_hw *, 987 struct delayed_work *, int); 988 void linuxkpi_ieee80211_queue_work(struct ieee80211_hw *, struct work_struct *); 989 struct sk_buff *linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *, 990 struct ieee80211_vif *); 991 struct sk_buff *linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *, 992 struct ieee80211_vif *, bool); 993 void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, unsigned long *, 994 unsigned long *); 995 struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *); 996 void linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *); 997 void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *); 998 struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *, 999 uint8_t *, uint8_t *, size_t, size_t); 1000 void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *); 1001 1002 /* -------------------------------------------------------------------------- */ 1003 1004 static __inline void 1005 _ieee80211_hw_set(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag) 1006 { 1007 1008 set_bit(flag, hw->flags); 1009 } 1010 1011 static __inline bool 1012 __ieee80211_hw_check(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag) 1013 { 1014 1015 return (test_bit(flag, hw->flags)); 1016 } 1017 1018 /* They pass in shortened flag names; how confusingly inconsistent. */ 1019 #define ieee80211_hw_set(_hw, _flag) \ 1020 _ieee80211_hw_set(_hw, IEEE80211_HW_ ## _flag) 1021 #define ieee80211_hw_check(_hw, _flag) \ 1022 __ieee80211_hw_check(_hw, IEEE80211_HW_ ## _flag) 1023 1024 /* XXX-BZ add CTASSERTS that size of struct is <= sizeof skb->cb. */ 1025 CTASSERT(sizeof(struct ieee80211_tx_info) <= sizeof(((struct sk_buff *)0)->cb)); 1026 #define IEEE80211_SKB_CB(_skb) \ 1027 ((struct ieee80211_tx_info *)((_skb)->cb)) 1028 1029 CTASSERT(sizeof(struct ieee80211_rx_status) <= sizeof(((struct sk_buff *)0)->cb)); 1030 #define IEEE80211_SKB_RXCB(_skb) \ 1031 ((struct ieee80211_rx_status *)((_skb)->cb)) 1032 1033 static __inline void 1034 ieee80211_free_hw(struct ieee80211_hw *hw) 1035 { 1036 1037 linuxkpi_ieee80211_iffree(hw); 1038 1039 if (hw->wiphy != NULL) 1040 wiphy_free(hw->wiphy); 1041 /* Note that *hw is not valid any longer after this. */ 1042 1043 IMPROVE(); 1044 } 1045 1046 static __inline struct ieee80211_hw * 1047 ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) 1048 { 1049 1050 return (linuxkpi_ieee80211_alloc_hw(priv_len, ops)); 1051 } 1052 1053 static __inline void 1054 SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev) 1055 { 1056 1057 set_wiphy_dev(hw->wiphy, dev); 1058 linuxkpi_set_ieee80211_dev(hw, dev_name(dev)); 1059 1060 IMPROVE(); 1061 } 1062 1063 static __inline int 1064 ieee80211_register_hw(struct ieee80211_hw *hw) 1065 { 1066 int error; 1067 1068 error = wiphy_register(hw->wiphy); 1069 if (error != 0) 1070 return (error); 1071 1072 /* 1073 * At this point the driver has set all the options, flags, bands, 1074 * ciphers, hw address(es), ... basically mac80211/cfg80211 hw/wiphy 1075 * setup is done. 1076 * We need to replicate a lot of information from here into net80211. 1077 */ 1078 error = linuxkpi_ieee80211_ifattach(hw); 1079 1080 IMPROVE(); 1081 1082 return (error); 1083 } 1084 1085 static __inline void 1086 ieee80211_unregister_hw(struct ieee80211_hw *hw) 1087 { 1088 1089 wiphy_unregister(hw->wiphy); 1090 linuxkpi_ieee80211_ifdetach(hw); 1091 1092 IMPROVE(); 1093 } 1094 1095 static __inline struct ieee80211_hw * 1096 wiphy_to_ieee80211_hw(struct wiphy *wiphy) 1097 { 1098 1099 return (linuxkpi_wiphy_to_ieee80211_hw(wiphy)); 1100 } 1101 1102 /* -------------------------------------------------------------------------- */ 1103 1104 static __inline bool 1105 ieee80211_is_action(__le16 fc) 1106 { 1107 __le16 v; 1108 1109 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1110 v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); 1111 1112 return (fc == v); 1113 } 1114 1115 static __inline bool 1116 ieee80211_is_probe_resp(__le16 fc) 1117 { 1118 __le16 v; 1119 1120 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1121 v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); 1122 1123 return (fc == v); 1124 } 1125 1126 static __inline bool 1127 ieee80211_is_auth(__le16 fc) 1128 { 1129 __le16 v; 1130 1131 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1132 v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); 1133 1134 return (fc == v); 1135 } 1136 1137 static __inline bool 1138 ieee80211_is_assoc_req(__le16 fc) 1139 { 1140 __le16 v; 1141 1142 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1143 v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); 1144 1145 return (fc == v); 1146 } 1147 1148 static __inline bool 1149 ieee80211_is_assoc_resp(__le16 fc) 1150 { 1151 __le16 v; 1152 1153 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1154 v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); 1155 1156 return (fc == v); 1157 } 1158 1159 static __inline bool 1160 ieee80211_is_reassoc_req(__le16 fc) 1161 { 1162 __le16 v; 1163 1164 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1165 v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); 1166 1167 return (fc == v); 1168 } 1169 1170 static __inline bool 1171 ieee80211_is_reassoc_resp(__le16 fc) 1172 { 1173 __le16 v; 1174 1175 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1176 v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); 1177 1178 return (fc == v); 1179 } 1180 1181 static __inline bool 1182 ieee80211_is_disassoc(__le16 fc) 1183 { 1184 __le16 v; 1185 1186 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1187 v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); 1188 1189 return (fc == v); 1190 } 1191 1192 static __inline bool 1193 ieee80211_is_data_present(__le16 fc) 1194 { 1195 __le16 v; 1196 1197 /* If it is a data frame and NODATA is not present. */ 1198 fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); 1199 v = htole16(IEEE80211_FC0_TYPE_DATA); 1200 1201 return (fc == v); 1202 } 1203 1204 static __inline bool 1205 ieee80211_is_deauth(__le16 fc) 1206 { 1207 __le16 v; 1208 1209 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1210 v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); 1211 1212 return (fc == v); 1213 } 1214 1215 static __inline bool 1216 ieee80211_is_beacon(__le16 fc) 1217 { 1218 __le16 v; 1219 1220 /* 1221 * For as much as I get it this comes in LE and unlike FreeBSD 1222 * where we get the entire frame header and u8[], here we get the 1223 * 9.2.4.1 Frame Control field only. Mask and compare. 1224 */ 1225 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1226 v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); 1227 1228 return (fc == v); 1229 } 1230 1231 1232 static __inline bool 1233 ieee80211_is_probe_req(__le16 fc) 1234 { 1235 __le16 v; 1236 1237 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1238 v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); 1239 1240 return (fc == v); 1241 } 1242 1243 static __inline bool 1244 ieee80211_has_protected(__le16 fc) 1245 { 1246 1247 return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); 1248 } 1249 1250 static __inline bool 1251 ieee80211_is_back_req(__le16 fc) 1252 { 1253 __le16 v; 1254 1255 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1256 v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); 1257 1258 return (fc == v); 1259 } 1260 1261 static __inline bool 1262 ieee80211_is_bufferable_mmpdu(__le16 fc) 1263 { 1264 1265 /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ 1266 /* XXX we do not care about IBSS yet. */ 1267 1268 if (!ieee80211_is_mgmt(fc)) 1269 return (false); 1270 if (ieee80211_is_action(fc)) /* XXX FTM? */ 1271 return (true); 1272 if (ieee80211_is_disassoc(fc)) 1273 return (true); 1274 if (ieee80211_is_deauth(fc)) 1275 return (true); 1276 1277 return (false); 1278 } 1279 1280 static __inline bool 1281 ieee80211_is_nullfunc(__le16 fc) 1282 { 1283 __le16 v; 1284 1285 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1286 v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); 1287 1288 return (fc == v); 1289 } 1290 1291 static __inline bool 1292 ieee80211_is_qos_nullfunc(__le16 fc) 1293 { 1294 __le16 v; 1295 1296 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1297 v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); 1298 1299 return (fc == v); 1300 } 1301 1302 static __inline bool 1303 ieee80211_is_any_nullfunc(__le16 fc) 1304 { 1305 1306 return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); 1307 } 1308 1309 static __inline bool 1310 ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 1311 { 1312 TODO(); 1313 return (false); 1314 } 1315 1316 static __inline bool 1317 ieee80211_is_frag(struct ieee80211_hdr *hdr) 1318 { 1319 TODO(); 1320 return (false); 1321 } 1322 1323 static __inline bool 1324 ieee80211_is_first_frag(__le16 fc) 1325 { 1326 TODO(); 1327 return (false); 1328 } 1329 1330 static __inline bool 1331 ieee80211_is_pspoll(__le16 fc) 1332 { 1333 TODO(); 1334 return (false); 1335 } 1336 1337 static __inline bool 1338 ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) 1339 { 1340 TODO(); 1341 return (false); 1342 } 1343 1344 static __inline bool 1345 ieee80211_has_pm(__le16 fc) 1346 { 1347 TODO(); 1348 return (false); 1349 } 1350 1351 static __inline bool 1352 ieee80211_has_a4(__le16 fc) 1353 { 1354 __le16 v; 1355 1356 fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); 1357 v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); 1358 1359 return (fc == v); 1360 } 1361 1362 static __inline bool 1363 ieee80211_has_order(__le16 fc) 1364 { 1365 1366 return (fc & htole16(IEEE80211_FC1_ORDER << 8)); 1367 } 1368 1369 static __inline bool 1370 ieee80211_has_retry(__le16 fc) 1371 { 1372 1373 return (fc & htole16(IEEE80211_FC1_RETRY << 8)); 1374 } 1375 1376 1377 static __inline bool 1378 ieee80211_has_fromds(__le16 fc) 1379 { 1380 1381 return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); 1382 } 1383 1384 static __inline bool 1385 ieee80211_has_tods(__le16 fc) 1386 { 1387 1388 return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); 1389 } 1390 1391 static __inline uint8_t * 1392 ieee80211_get_SA(struct ieee80211_hdr *hdr) 1393 { 1394 1395 if (ieee80211_has_a4(hdr->frame_control)) 1396 return (hdr->addr4); 1397 if (ieee80211_has_fromds(hdr->frame_control)) 1398 return (hdr->addr3); 1399 return (hdr->addr2); 1400 } 1401 1402 static __inline uint8_t * 1403 ieee80211_get_DA(struct ieee80211_hdr *hdr) 1404 { 1405 1406 if (ieee80211_has_tods(hdr->frame_control)) 1407 return (hdr->addr3); 1408 return (hdr->addr1); 1409 } 1410 1411 static __inline bool 1412 ieee80211_has_morefrags(__le16 fc) 1413 { 1414 1415 fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); 1416 return (fc != 0); 1417 } 1418 1419 static __inline u8 * 1420 ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) 1421 { 1422 if (ieee80211_has_a4(hdr->frame_control)) 1423 return (u8 *)hdr + 30; 1424 else 1425 return (u8 *)hdr + 24; 1426 } 1427 1428 /* -------------------------------------------------------------------------- */ 1429 /* Receive functions (air/driver to mac80211/net80211). */ 1430 1431 1432 static __inline void 1433 ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1434 struct sk_buff *skb, struct napi_struct *napi) 1435 { 1436 1437 linuxkpi_ieee80211_rx(hw, skb, sta, napi); 1438 } 1439 1440 static __inline void 1441 ieee80211_rx_ni(struct ieee80211_hw *hw, struct sk_buff *skb) 1442 { 1443 1444 linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); 1445 } 1446 1447 static __inline void 1448 ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) 1449 { 1450 1451 linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); 1452 } 1453 1454 /* -------------------------------------------------------------------------- */ 1455 1456 static __inline uint8_t 1457 ieee80211_get_tid(struct ieee80211_hdr *hdr) 1458 { 1459 1460 return (linuxkpi_ieee80211_get_tid(hdr, false)); 1461 } 1462 1463 static __inline struct sk_buff * 1464 ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1465 uint16_t *tim_offset, uint16_t *tim_len, uint32_t link_id) 1466 { 1467 1468 if (tim_offset != NULL) 1469 *tim_offset = 0; 1470 if (tim_len != NULL) 1471 *tim_len = 0; 1472 TODO(); 1473 return (NULL); 1474 } 1475 1476 static __inline void 1477 ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, 1478 enum ieee80211_iface_iter flags, 1479 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1480 void *arg) 1481 { 1482 1483 flags |= IEEE80211_IFACE_ITER__ATOMIC; 1484 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1485 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1486 } 1487 1488 static __inline void 1489 ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, 1490 enum ieee80211_iface_iter flags, 1491 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1492 void *arg) 1493 { 1494 1495 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1496 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1497 } 1498 1499 static __inline void 1500 ieee80211_iterate_active_interfaces_mtx(struct ieee80211_hw *hw, 1501 enum ieee80211_iface_iter flags, 1502 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1503 void *arg) 1504 { 1505 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1506 flags |= IEEE80211_IFACE_ITER__MTX; 1507 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1508 } 1509 1510 static __inline void 1511 ieee80211_iterate_interfaces(struct ieee80211_hw *hw, 1512 enum ieee80211_iface_iter flags, 1513 void (*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1514 void *arg) 1515 { 1516 1517 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1518 } 1519 1520 static __inline void 1521 ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1522 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 1523 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 1524 void *arg) 1525 { 1526 1527 linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); 1528 } 1529 1530 static __inline void 1531 ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1532 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 1533 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 1534 void *arg) 1535 { 1536 1537 IMPROVE(); /* "rcu" */ 1538 linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); 1539 } 1540 1541 static __inline void 1542 ieee80211_iter_chan_contexts_atomic(struct ieee80211_hw *hw, 1543 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *), 1544 void *arg) 1545 { 1546 1547 linuxkpi_ieee80211_iterate_chan_contexts(hw, iterfunc, arg); 1548 } 1549 1550 static __inline void 1551 ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, 1552 void (*iterfunc)(void *, struct ieee80211_sta *), void *arg) 1553 { 1554 1555 linuxkpi_ieee80211_iterate_stations_atomic(hw, iterfunc, arg); 1556 } 1557 1558 static __inline struct wireless_dev * 1559 ieee80211_vif_to_wdev(struct ieee80211_vif *vif) 1560 { 1561 1562 return (linuxkpi_ieee80211_vif_to_wdev(vif)); 1563 } 1564 1565 static __inline struct sk_buff * 1566 ieee80211_beacon_get_template(struct ieee80211_hw *hw, 1567 struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs, 1568 uint32_t link_id) 1569 { 1570 TODO(); 1571 return (NULL); 1572 } 1573 1574 static __inline void 1575 ieee80211_beacon_loss(struct ieee80211_vif *vif) 1576 { 1577 linuxkpi_ieee80211_beacon_loss(vif); 1578 } 1579 1580 static __inline void 1581 ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t) 1582 { 1583 TODO(); 1584 } 1585 1586 static __inline bool 1587 ieee80211_csa_is_complete(struct ieee80211_vif *vif) 1588 { 1589 TODO(); 1590 return (false); 1591 } 1592 1593 static __inline void 1594 ieee80211_csa_set_counter(struct ieee80211_vif *vif, uint8_t counter) 1595 { 1596 TODO(); 1597 } 1598 1599 static __inline int 1600 ieee80211_csa_update_counter(struct ieee80211_vif *vif) 1601 { 1602 TODO(); 1603 return (-1); 1604 } 1605 1606 static __inline void 1607 ieee80211_csa_finish(struct ieee80211_vif *vif) 1608 { 1609 TODO(); 1610 } 1611 1612 static __inline enum nl80211_iftype 1613 ieee80211_vif_type_p2p(struct ieee80211_vif *vif) 1614 { 1615 1616 /* If we are not p2p enabled, just return the type. */ 1617 if (!vif->p2p) 1618 return (vif->type); 1619 1620 /* If we are p2p, depending on side, return type. */ 1621 switch (vif->type) { 1622 case NL80211_IFTYPE_AP: 1623 return (NL80211_IFTYPE_P2P_GO); 1624 case NL80211_IFTYPE_STATION: 1625 return (NL80211_IFTYPE_P2P_CLIENT); 1626 default: 1627 fallthrough; 1628 } 1629 return (vif->type); 1630 } 1631 1632 static __inline unsigned long 1633 ieee80211_tu_to_usec(unsigned long tu) 1634 { 1635 1636 return (tu * IEEE80211_DUR_TU); 1637 } 1638 1639 1640 static __inline bool 1641 ieee80211_action_contains_tpc(struct sk_buff *skb) 1642 { 1643 struct ieee80211_mgmt *mgmt; 1644 1645 mgmt = (struct ieee80211_mgmt *)skb->data; 1646 1647 /* Check that this is a mgmt/action frame? */ 1648 if (!ieee80211_is_action(mgmt->frame_control)) 1649 return (false); 1650 1651 /* 1652 * This is a bit convoluted but according to docs both actions 1653 * are checked for this. Kind-of makes sense for the only consumer 1654 * (iwlwifi) I am aware off given the txpower fields are at the 1655 * same location so firmware can update the value. 1656 */ 1657 /* 80211-2020 9.6.2 Spectrum Management Action frames */ 1658 /* 80211-2020 9.6.2.5 TPC Report frame format */ 1659 /* 80211-2020 9.6.6 Radio Measurement action details */ 1660 /* 80211-2020 9.6.6.4 Link Measurement Report frame format */ 1661 /* Check that it is Spectrum Management or Radio Measurement? */ 1662 if (mgmt->u.action.category != IEEE80211_ACTION_CAT_SM && 1663 mgmt->u.action.category != IEEE80211_ACTION_CAT_RADIO_MEASUREMENT) 1664 return (false); 1665 1666 /* Check that it is TPC Report or Link Measurement Report? */ 1667 KASSERT(IEEE80211_ACTION_SM_TPCREP == IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP, 1668 ("%s: SM_TPCREP %d != RADIO_MEASUREMENT_LMREP %d\n", __func__, 1669 IEEE80211_ACTION_SM_TPCREP, IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP)); 1670 if (mgmt->u.action.u.tpc_report.spec_mgmt != IEEE80211_ACTION_SM_TPCREP) 1671 return (false); 1672 1673 /* 80211-2020 9.4.2.16 TPC Report element */ 1674 /* Check that the ELEMID and length are correct? */ 1675 if (mgmt->u.action.u.tpc_report.tpc_elem_id != IEEE80211_ELEMID_TPCREP || 1676 mgmt->u.action.u.tpc_report.tpc_elem_length != 4) 1677 return (false); 1678 1679 /* All the right fields in the right place. */ 1680 return (true); 1681 } 1682 1683 static __inline void 1684 ieee80211_connection_loss(struct ieee80211_vif *vif) 1685 { 1686 1687 linuxkpi_ieee80211_connection_loss(vif); 1688 } 1689 1690 static __inline struct ieee80211_sta * 1691 ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer) 1692 { 1693 1694 return (linuxkpi_ieee80211_find_sta(vif, peer)); 1695 } 1696 1697 static __inline struct ieee80211_sta * 1698 ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, const uint8_t *addr, 1699 const uint8_t *ourvifaddr) 1700 { 1701 1702 return (linuxkpi_ieee80211_find_sta_by_ifaddr(hw, addr, ourvifaddr)); 1703 } 1704 1705 1706 static __inline void 1707 ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, 1708 struct sk_buff *skb_frag, u8 *key) 1709 { 1710 TODO(); 1711 } 1712 1713 static __inline void 1714 ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf, 1715 const u8 *addr, uint32_t iv32, u16 *p1k) 1716 { 1717 TODO(); 1718 } 1719 1720 static __inline size_t 1721 ieee80211_ie_split(const u8 *ies, size_t ies_len, 1722 const u8 *ie_ids, size_t ie_ids_len, size_t start) 1723 { 1724 size_t x; 1725 1726 x = start; 1727 1728 /* XXX FIXME, we need to deal with "Element ID Extension" */ 1729 while (x < ies_len) { 1730 1731 /* Is this IE[s] one of the ie_ids? */ 1732 if (!linuxkpi_ieee80211_is_ie_id_in_ie_buf(ies[x], 1733 ie_ids, ie_ids_len)) 1734 break; 1735 1736 if (!linuxkpi_ieee80211_ie_advance(&x, ies, ies_len)) 1737 break; 1738 } 1739 1740 return (x); 1741 } 1742 1743 static __inline void 1744 ieee80211_request_smps(struct ieee80211_vif *vif, enum ieee80211_smps_mode smps) 1745 { 1746 static const char *smps_mode_name[] = { 1747 "SMPS_OFF", 1748 "SMPS_STATIC", 1749 "SMPS_DYNAMIC", 1750 "SMPS_AUTOMATIC", 1751 "SMPS_NUM_MODES" 1752 }; 1753 1754 if (linuxkpi_debug_80211 & D80211_TODO) 1755 printf("%s:%d: XXX LKPI80211 TODO smps %d %s\n", 1756 __func__, __LINE__, smps, smps_mode_name[smps]); 1757 } 1758 1759 static __inline void 1760 ieee80211_tdls_oper_request(struct ieee80211_vif *vif, uint8_t *addr, 1761 enum nl80211_tdls_operation oper, enum ieee80211_reason_code code, 1762 gfp_t gfp) 1763 { 1764 TODO(); 1765 } 1766 1767 static __inline void 1768 ieee80211_stop_queues(struct ieee80211_hw *hw) 1769 { 1770 TODO(); 1771 } 1772 1773 static __inline void 1774 ieee80211_wake_queues(struct ieee80211_hw *hw) 1775 { 1776 TODO(); 1777 } 1778 1779 static __inline void 1780 wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool state) 1781 { 1782 TODO(); 1783 } 1784 1785 static __inline void 1786 ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb) 1787 { 1788 IMPROVE(); 1789 1790 /* 1791 * This is called on transmit failure. 1792 * Use a not-so-random random high status error so we can distinguish 1793 * it from normal low values flying around in net80211 ("ETX"). 1794 */ 1795 linuxkpi_ieee80211_free_txskb(hw, skb, 0x455458); 1796 } 1797 1798 static __inline void 1799 ieee80211_restart_hw(struct ieee80211_hw *hw) 1800 { 1801 TODO(); 1802 } 1803 1804 static __inline void 1805 ieee80211_ready_on_channel(struct ieee80211_hw *hw) 1806 { 1807 TODO(); 1808 /* XXX-BZ We need to see that. */ 1809 } 1810 1811 static __inline void 1812 ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw) 1813 { 1814 TODO(); 1815 } 1816 1817 static __inline void 1818 ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, 1819 enum nl80211_cqm_rssi_threshold_event crte, int sig, gfp_t gfp) 1820 { 1821 TODO(); 1822 } 1823 1824 static __inline void 1825 ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *sta, uint8_t tid, 1826 uint32_t ssn, uint64_t bitmap, uint16_t received_mpdu) 1827 { 1828 TODO(); 1829 } 1830 1831 static __inline bool 1832 ieee80211_sn_less(uint16_t sn1, uint16_t sn2) 1833 { 1834 TODO(); 1835 return (false); 1836 } 1837 1838 static __inline uint16_t 1839 ieee80211_sn_inc(uint16_t sn) 1840 { 1841 TODO(); 1842 return (sn + 1); 1843 } 1844 1845 static __inline uint16_t 1846 ieee80211_sn_add(uint16_t sn, uint16_t a) 1847 { 1848 TODO(); 1849 return (sn + a); 1850 } 1851 1852 static __inline void 1853 ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, uint32_t x, uint8_t *addr) 1854 { 1855 TODO(); 1856 } 1857 1858 static __inline void 1859 ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2) 1860 { 1861 TODO(); 1862 } 1863 1864 static __inline void 1865 ieee80211_reserve_tid(struct ieee80211_sta *sta, uint8_t tid) 1866 { 1867 TODO(); 1868 } 1869 1870 static __inline void 1871 ieee80211_unreserve_tid(struct ieee80211_sta *sta, uint8_t tid) 1872 { 1873 TODO(); 1874 } 1875 1876 static __inline void 1877 ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, uint8_t *addr, 1878 uint8_t tid) 1879 { 1880 TODO(); 1881 } 1882 1883 static __inline void 1884 ieee80211_send_eosp_nullfunc(struct ieee80211_sta *sta, uint8_t tid) 1885 { 1886 TODO(); 1887 } 1888 1889 static __inline uint16_t 1890 ieee80211_sn_sub(uint16_t sa, uint16_t sb) 1891 { 1892 1893 return ((sa - sb) & 1894 (IEEE80211_SEQ_SEQ_MASK >> IEEE80211_SEQ_SEQ_SHIFT)); 1895 } 1896 1897 static __inline void 1898 ieee80211_sta_block_awake(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1899 bool disable) 1900 { 1901 TODO(); 1902 } 1903 1904 static __inline void 1905 ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool sleeping) 1906 { 1907 TODO(); 1908 } 1909 1910 static __inline void 1911 ieee80211_sta_pspoll(struct ieee80211_sta *sta) 1912 { 1913 TODO(); 1914 } 1915 1916 static __inline void 1917 ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, int ntids) 1918 { 1919 TODO(); 1920 } 1921 1922 static __inline void 1923 ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf, 1924 uint64_t pn) 1925 { 1926 TODO(); 1927 } 1928 1929 static __inline struct sk_buff * 1930 ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 1931 { 1932 1933 return (linuxkpi_ieee80211_tx_dequeue(hw, txq)); 1934 } 1935 1936 static __inline void 1937 ieee80211_update_mu_groups(struct ieee80211_vif *vif, uint8_t *ms, uint8_t *up) 1938 { 1939 TODO(); 1940 } 1941 1942 static __inline void 1943 ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) 1944 { 1945 TODO(); 1946 } 1947 1948 static __inline void 1949 ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) 1950 { 1951 1952 linuxkpi_ieee80211_tx_status(hw, skb); 1953 } 1954 1955 static __inline void 1956 ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, 1957 struct ieee80211_key_seq *seq) 1958 { 1959 TODO(); 1960 } 1961 1962 static __inline void 1963 ieee80211_sched_scan_results(struct ieee80211_hw *hw) 1964 { 1965 TODO(); 1966 } 1967 1968 static __inline void 1969 ieee80211_sta_eosp(struct ieee80211_sta *sta) 1970 { 1971 TODO(); 1972 } 1973 1974 static __inline int 1975 ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x) 1976 { 1977 TODO("rtw8x"); 1978 return (-EINVAL); 1979 } 1980 1981 static __inline int 1982 ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid) 1983 { 1984 TODO("rtw89"); 1985 return (-EINVAL); 1986 } 1987 1988 static __inline void 1989 ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr, 1990 uint8_t tid) 1991 { 1992 TODO("iwlwifi"); 1993 } 1994 1995 static __inline void 1996 ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr, 1997 uint8_t tid) 1998 { 1999 TODO("iwlwifi/rtw8x/..."); 2000 } 2001 2002 static __inline void 2003 ieee80211_sched_scan_stopped(struct ieee80211_hw *hw) 2004 { 2005 TODO(); 2006 } 2007 2008 static __inline void 2009 ieee80211_scan_completed(struct ieee80211_hw *hw, 2010 struct cfg80211_scan_info *info) 2011 { 2012 2013 linuxkpi_ieee80211_scan_completed(hw, info); 2014 } 2015 2016 static __inline struct sk_buff * 2017 ieee80211_beacon_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2018 uint32_t link_id) 2019 { 2020 TODO(); 2021 return (NULL); 2022 } 2023 2024 static __inline struct sk_buff * 2025 ieee80211_pspoll_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 2026 { 2027 2028 /* Only STA needs this. Otherwise return NULL and panic bad drivers. */ 2029 if (vif->type != NL80211_IFTYPE_STATION) 2030 return (NULL); 2031 2032 return (linuxkpi_ieee80211_pspoll_get(hw, vif)); 2033 } 2034 2035 static __inline struct sk_buff * 2036 ieee80211_proberesp_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 2037 { 2038 TODO(); 2039 return (NULL); 2040 } 2041 2042 static __inline struct sk_buff * 2043 ieee80211_nullfunc_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2044 bool qos) 2045 { 2046 2047 /* Only STA needs this. Otherwise return NULL and panic bad drivers. */ 2048 if (vif->type != NL80211_IFTYPE_STATION) 2049 return (NULL); 2050 2051 return (linuxkpi_ieee80211_nullfunc_get(hw, vif, qos)); 2052 } 2053 2054 static __inline struct sk_buff * 2055 ieee80211_probereq_get(struct ieee80211_hw *hw, uint8_t *addr, 2056 uint8_t *ssid, size_t ssid_len, size_t tailroom) 2057 { 2058 2059 return (linuxkpi_ieee80211_probereq_get(hw, addr, ssid, ssid_len, 2060 tailroom)); 2061 } 2062 2063 static __inline void 2064 ieee80211_queue_delayed_work(struct ieee80211_hw *hw, struct delayed_work *w, 2065 int delay) 2066 { 2067 2068 linuxkpi_ieee80211_queue_delayed_work(hw, w, delay); 2069 } 2070 2071 static __inline void 2072 ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) 2073 { 2074 2075 linuxkpi_ieee80211_queue_work(hw, w); 2076 } 2077 2078 static __inline void 2079 ieee80211_stop_queue(struct ieee80211_hw *hw, uint16_t q) 2080 { 2081 TODO(); 2082 } 2083 2084 static __inline void 2085 ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q) 2086 { 2087 TODO(); 2088 } 2089 2090 static __inline void 2091 ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) 2092 { 2093 IMPROVE(); 2094 ieee80211_tx_status(hw, skb); 2095 } 2096 2097 static __inline void 2098 ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb) 2099 { 2100 IMPROVE(); 2101 ieee80211_tx_status(hw, skb); 2102 } 2103 2104 static __inline void 2105 ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) 2106 { 2107 int i; 2108 2109 /* 2110 * Apparently clearing flags and some other fields is not right. 2111 * Given the function is called "status" we work on that part of 2112 * the union. 2113 */ 2114 for (i = 0; i < nitems(info->status.rates); i++) 2115 info->status.rates[i].count = 0; 2116 /* 2117 * Unclear if ack_signal should be included or not but we clear the 2118 * "valid" bool so this field is no longer valid. 2119 */ 2120 memset(&info->status.ack_signal, 0, sizeof(*info) - 2121 offsetof(struct ieee80211_tx_info, status.ack_signal)); 2122 } 2123 2124 static __inline void 2125 ieee80211_txq_get_depth(struct ieee80211_txq *txq, unsigned long *frame_cnt, 2126 unsigned long *byte_cnt) 2127 { 2128 2129 if (frame_cnt == NULL && byte_cnt == NULL) 2130 return; 2131 2132 linuxkpi_ieee80211_txq_get_depth(txq, frame_cnt, byte_cnt); 2133 } 2134 2135 static __inline int 2136 rate_lowest_index(struct ieee80211_supported_band *band, 2137 struct ieee80211_sta *sta) 2138 { 2139 IMPROVE(); 2140 return (0); 2141 } 2142 2143 2144 static __inline void 2145 SET_IEEE80211_PERM_ADDR (struct ieee80211_hw *hw, uint8_t *addr) 2146 { 2147 2148 ether_addr_copy(hw->wiphy->perm_addr, addr); 2149 } 2150 2151 static __inline uint8_t * 2152 ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) 2153 { 2154 TODO(); 2155 return (NULL); 2156 } 2157 2158 static __inline void 2159 ieee80211_report_low_ack(struct ieee80211_sta *sta, int x) 2160 { 2161 TODO(); 2162 } 2163 2164 static __inline void 2165 ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, 2166 uint8_t tid) 2167 { 2168 TODO(); 2169 } 2170 2171 static __inline void 2172 ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, 2173 uint8_t tid) 2174 { 2175 TODO(); 2176 } 2177 2178 static __inline struct sk_buff * 2179 ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2180 { 2181 TODO(); 2182 return (NULL); 2183 } 2184 2185 static __inline void 2186 ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2187 struct ieee80211_tx_info *info) 2188 { 2189 TODO(); 2190 } 2191 2192 static __inline bool 2193 ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2194 { 2195 TODO(); 2196 return (false); 2197 } 2198 2199 static __inline void 2200 ieee80211_radar_detected(struct ieee80211_hw *hw) 2201 { 2202 TODO(); 2203 } 2204 2205 static __inline void 2206 ieee80211_sta_register_airtime(struct ieee80211_sta *sta, 2207 uint8_t tid, uint32_t duration, int x) 2208 { 2209 TODO(); 2210 } 2211 2212 2213 static __inline void 2214 ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) 2215 { 2216 TODO(); 2217 } 2218 2219 static __inline void 2220 ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac) 2221 { 2222 /* DO_NADA; */ 2223 } 2224 2225 static __inline struct ieee80211_txq * 2226 ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) 2227 { 2228 2229 TODO(); 2230 return (NULL); 2231 } 2232 2233 static __inline void 2234 ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2235 { 2236 TODO(); 2237 } 2238 2239 static __inline void 2240 ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, 2241 bool withoutpkts) 2242 { 2243 TODO(); 2244 } 2245 2246 2247 static __inline void 2248 ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter) 2249 { 2250 TODO(); 2251 } 2252 2253 static __inline int 2254 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif) 2255 { 2256 TODO(); 2257 return (-1); 2258 } 2259 2260 static __inline int 2261 ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth, 2262 int x, bool t, int nss) 2263 { 2264 TODO(); 2265 return (-1); 2266 } 2267 2268 static __inline bool 2269 ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif) 2270 { 2271 TODO(); 2272 return (true); 2273 } 2274 2275 static __inline void 2276 ieee80211_disconnect(struct ieee80211_vif *vif, bool _x) 2277 { 2278 TODO(); 2279 } 2280 2281 static __inline void 2282 ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool _x) 2283 { 2284 TODO(); 2285 } 2286 2287 static __inline const struct ieee80211_sta_he_cap * 2288 ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band, 2289 enum nl80211_iftype type) 2290 { 2291 TODO(); 2292 return (NULL); 2293 } 2294 2295 static __inline void 2296 ieee80211_key_mic_failure(struct ieee80211_key_conf *key) 2297 { 2298 TODO(); 2299 } 2300 2301 static __inline void 2302 ieee80211_key_replay(struct ieee80211_key_conf *key) 2303 { 2304 TODO(); 2305 } 2306 2307 static __inline uint32_t 2308 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, 2309 struct ieee80211_rx_status *rxstat, int len) 2310 { 2311 TODO(); 2312 return (0); 2313 } 2314 2315 static __inline void 2316 ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, 2317 struct sk_buff *skb, struct ieee80211_tx_rate *txrate, int nrates) 2318 { 2319 TODO(); 2320 } 2321 2322 static __inline void 2323 ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2324 struct sk_buff *skb, struct list_head *list) 2325 { 2326 TODO(); 2327 } 2328 2329 static __inline void 2330 ieee80211_tx_status_ext(struct ieee80211_hw *hw, 2331 struct ieee80211_tx_status *txstat) 2332 { 2333 TODO(); 2334 } 2335 2336 static __inline const struct element * 2337 ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) 2338 { 2339 TODO(); 2340 return (NULL); 2341 } 2342 2343 static __inline void 2344 ieee80211_color_change_finish(struct ieee80211_vif *vif) 2345 { 2346 TODO(); 2347 } 2348 2349 static __inline struct sk_buff * 2350 ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, 2351 struct ieee80211_vif *vif) 2352 { 2353 TODO(); 2354 return (NULL); 2355 } 2356 2357 static __inline struct sk_buff * 2358 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, 2359 struct ieee80211_vif *vif) 2360 { 2361 TODO(); 2362 return (NULL); 2363 } 2364 2365 static __inline void 2366 linuxkpi_ieee80211_send_bar(struct ieee80211_vif *vif, uint8_t *ra, uint16_t tid, 2367 uint16_t ssn) 2368 { 2369 TODO(); 2370 } 2371 2372 static __inline void 2373 ieee80211_resume_disconnect(struct ieee80211_vif *vif) 2374 { 2375 TODO(); 2376 return; 2377 } 2378 2379 static __inline int 2380 ieee80211_data_to_8023(struct sk_buff *skb, const uint8_t *addr, 2381 enum nl80211_iftype iftype) 2382 { 2383 TODO(); 2384 return (-1); 2385 } 2386 2387 static __inline void 2388 ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key, 2389 uint32_t iv32, uint16_t *p1k) 2390 { 2391 TODO(); 2392 return; 2393 } 2394 2395 static __inline struct ieee80211_key_conf * 2396 ieee80211_gtk_rekey_add(struct ieee80211_vif *vif, 2397 struct ieee80211_key_conf *key) 2398 { 2399 TODO(); 2400 return (NULL); 2401 } 2402 2403 static __inline void 2404 ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const uint8_t *bssid, 2405 const uint8_t *replay_ctr, gfp_t gfp) 2406 { 2407 TODO(); 2408 return; 2409 } 2410 2411 static __inline void 2412 ieee80211_remove_key(struct ieee80211_key_conf *key) 2413 { 2414 TODO(); 2415 return; 2416 } 2417 2418 static __inline void 2419 ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, 2420 struct ieee80211_key_seq *seq) 2421 { 2422 TODO(); 2423 return; 2424 } 2425 2426 static __inline void 2427 ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, 2428 struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp) 2429 { 2430 TODO(); 2431 return; 2432 } 2433 2434 static __inline void 2435 ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif, 2436 uint64_t obss_color_bitmap) 2437 { 2438 TODO(); 2439 } 2440 2441 #define ieee80211_send_bar(_v, _r, _t, _s) \ 2442 linuxkpi_ieee80211_send_bar(_v, _r, _t, _s) 2443 2444 #endif /* _LINUXKPI_NET_MAC80211_H */ 2445