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 }; 813 814 struct ieee80211_ops { 815 /* TODO FIXME */ 816 int (*start)(struct ieee80211_hw *); 817 void (*stop)(struct ieee80211_hw *); 818 819 int (*config)(struct ieee80211_hw *, u32); 820 void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type); 821 822 int (*add_interface)(struct ieee80211_hw *, struct ieee80211_vif *); 823 void (*remove_interface)(struct ieee80211_hw *, struct ieee80211_vif *); 824 int (*change_interface)(struct ieee80211_hw *, struct ieee80211_vif *, enum nl80211_iftype, bool); 825 826 void (*sw_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, const u8 *); 827 void (*sw_scan_complete)(struct ieee80211_hw *, struct ieee80211_vif *); 828 int (*sched_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_sched_scan_request *, struct ieee80211_scan_ies *); 829 int (*sched_scan_stop)(struct ieee80211_hw *, struct ieee80211_vif *); 830 int (*hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_scan_request *); 831 void (*cancel_hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *); 832 833 int (*conf_tx)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u16, const struct ieee80211_tx_queue_params *); 834 void (*tx)(struct ieee80211_hw *, struct ieee80211_tx_control *, struct sk_buff *); 835 int (*tx_last_beacon)(struct ieee80211_hw *); 836 void (*wake_tx_queue)(struct ieee80211_hw *, struct ieee80211_txq *); 837 838 void (*mgd_prepare_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); 839 void (*mgd_complete_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *); 840 void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *); 841 842 void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool); 843 844 int (*set_frag_threshold)(struct ieee80211_hw *, u32); 845 846 void (*sync_rx_queues)(struct ieee80211_hw *); 847 848 void (*allow_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); 849 void (*release_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); 850 851 int (*sta_add)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 852 int (*sta_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 853 int (*sta_set_txpwr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 854 void (*sta_statistics)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct station_info *); 855 void (*sta_pre_rcu_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 856 int (*sta_state)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, enum ieee80211_sta_state, enum ieee80211_sta_state); 857 void (*sta_notify)(struct ieee80211_hw *, struct ieee80211_vif *, enum sta_notify_cmd, struct ieee80211_sta *); 858 void (*sta_rc_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u32); 859 void (*sta_rate_tbl_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 860 void (*sta_set_4addr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool); 861 void (*sta_set_decap_offload)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool); 862 863 u64 (*prepare_multicast)(struct ieee80211_hw *, struct netdev_hw_addr_list *); 864 865 int (*ampdu_action)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *); 866 867 bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *, struct sk_buff *, struct sk_buff *); 868 869 int (*pre_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 870 int (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); 871 void (*channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 872 void (*channel_switch_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *); 873 void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *); 874 void (*channel_switch_rx_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *); 875 int (*tdls_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *, struct sk_buff *, u32); 876 void (*tdls_cancel_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *); 877 void (*tdls_recv_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_tdls_ch_sw_params *); 878 879 int (*add_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *); 880 void (*remove_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *); 881 void (*change_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, u32); 882 int (*assign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *); 883 void (*unassign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *); 884 int (*switch_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif_chanctx_switch *, int, enum ieee80211_chanctx_switch_mode); 885 886 int (*get_antenna)(struct ieee80211_hw *, u32 *, u32 *); 887 int (*set_antenna)(struct ieee80211_hw *, u32, u32); 888 889 int (*remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel *, int, enum ieee80211_roc_type); 890 int (*cancel_remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *); 891 892 void (*configure_filter)(struct ieee80211_hw *, unsigned int, unsigned int *, u64); 893 void (*config_iface_filter)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int, unsigned int); 894 895 void (*bss_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64); 896 int (*set_rts_threshold)(struct ieee80211_hw *, u32); 897 void (*event_callback)(struct ieee80211_hw *, struct ieee80211_vif *, const struct ieee80211_event *); 898 int (*get_survey)(struct ieee80211_hw *, int, struct survey_info *); 899 int (*get_ftm_responder_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_ftm_responder_stats *); 900 901 uint64_t (*get_tsf)(struct ieee80211_hw *, struct ieee80211_vif *); 902 void (*set_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, uint64_t); 903 void (*offset_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, s64); 904 905 int (*set_bitrate_mask)(struct ieee80211_hw *, struct ieee80211_vif *, const struct cfg80211_bitrate_mask *); 906 void (*set_coverage_class)(struct ieee80211_hw *, s16); 907 int (*set_tim)(struct ieee80211_hw *, struct ieee80211_sta *, bool); 908 909 int (*set_key)(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *); 910 void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int); 911 void (*update_tkip_key)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32, u16 *); 912 913 int (*start_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); 914 void (*abort_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *); 915 916 int (*start_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf); 917 void (*stop_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf); 918 int (*join_ibss)(struct ieee80211_hw *, struct ieee80211_vif *); 919 void (*leave_ibss)(struct ieee80211_hw *, struct ieee80211_vif *); 920 921 int (*set_sar_specs)(struct ieee80211_hw *, const struct cfg80211_sar_specs *); 922 923 int (*set_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct cfg80211_tid_config *); 924 int (*reset_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8); 925 926 int (*get_et_sset_count)(struct ieee80211_hw *, struct ieee80211_vif *, int); 927 void (*get_et_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct ethtool_stats *, u64 *); 928 void (*get_et_strings)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u8 *); 929 930 void (*update_vif_offload)(struct ieee80211_hw *, struct ieee80211_vif *); 931 932 int (*get_txpower)(struct ieee80211_hw *, struct ieee80211_vif *, int *); 933 int (*get_stats)(struct ieee80211_hw *, struct ieee80211_low_level_stats *); 934 935 int (*set_radar_background)(struct ieee80211_hw *, struct cfg80211_chan_def *); 936 937 void (*add_twt_setup)(struct ieee80211_hw *, struct ieee80211_sta *, struct ieee80211_twt_setup *); 938 void (*twt_teardown_request)(struct ieee80211_hw *, struct ieee80211_sta *, u8); 939 }; 940 941 942 /* -------------------------------------------------------------------------- */ 943 944 /* linux_80211.c */ 945 extern const struct cfg80211_ops linuxkpi_mac80211cfgops; 946 947 struct ieee80211_hw *linuxkpi_ieee80211_alloc_hw(size_t, 948 const struct ieee80211_ops *); 949 void linuxkpi_ieee80211_iffree(struct ieee80211_hw *); 950 void linuxkpi_set_ieee80211_dev(struct ieee80211_hw *, char *); 951 int linuxkpi_ieee80211_ifattach(struct ieee80211_hw *); 952 void linuxkpi_ieee80211_ifdetach(struct ieee80211_hw *); 953 struct ieee80211_hw * linuxkpi_wiphy_to_ieee80211_hw(struct wiphy *); 954 void linuxkpi_ieee80211_iterate_interfaces( 955 struct ieee80211_hw *hw, enum ieee80211_iface_iter flags, 956 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 957 void *); 958 void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *, 959 struct ieee80211_vif *, 960 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 961 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 962 void *); 963 void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *, 964 void(*iterfunc)(struct ieee80211_hw *, 965 struct ieee80211_chanctx_conf *, void *), 966 void *); 967 void linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *, 968 void (*iterfunc)(void *, struct ieee80211_sta *), void *); 969 void linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *, 970 struct cfg80211_scan_info *); 971 void linuxkpi_ieee80211_rx(struct ieee80211_hw *, struct sk_buff *, 972 struct ieee80211_sta *, struct napi_struct *); 973 uint8_t linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *, bool); 974 struct ieee80211_sta *linuxkpi_ieee80211_find_sta(struct ieee80211_vif *, 975 const u8 *); 976 struct ieee80211_sta *linuxkpi_ieee80211_find_sta_by_ifaddr( 977 struct ieee80211_hw *, const uint8_t *, const uint8_t *); 978 struct sk_buff *linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *, 979 struct ieee80211_txq *); 980 bool linuxkpi_ieee80211_is_ie_id_in_ie_buf(const u8, const u8 *, size_t); 981 bool linuxkpi_ieee80211_ie_advance(size_t *, const u8 *, size_t); 982 void linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *, struct sk_buff *, 983 int); 984 void linuxkpi_ieee80211_queue_delayed_work(struct ieee80211_hw *, 985 struct delayed_work *, int); 986 void linuxkpi_ieee80211_queue_work(struct ieee80211_hw *, struct work_struct *); 987 struct sk_buff *linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *, 988 struct ieee80211_vif *); 989 struct sk_buff *linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *, 990 struct ieee80211_vif *, bool); 991 void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, unsigned long *, 992 unsigned long *); 993 struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *); 994 void linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *); 995 void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *); 996 struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *, 997 uint8_t *, uint8_t *, size_t, size_t); 998 void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *); 999 1000 /* -------------------------------------------------------------------------- */ 1001 1002 static __inline void 1003 _ieee80211_hw_set(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag) 1004 { 1005 1006 set_bit(flag, hw->flags); 1007 } 1008 1009 static __inline bool 1010 __ieee80211_hw_check(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag) 1011 { 1012 1013 return (test_bit(flag, hw->flags)); 1014 } 1015 1016 /* They pass in shortened flag names; how confusingly inconsistent. */ 1017 #define ieee80211_hw_set(_hw, _flag) \ 1018 _ieee80211_hw_set(_hw, IEEE80211_HW_ ## _flag) 1019 #define ieee80211_hw_check(_hw, _flag) \ 1020 __ieee80211_hw_check(_hw, IEEE80211_HW_ ## _flag) 1021 1022 /* XXX-BZ add CTASSERTS that size of struct is <= sizeof skb->cb. */ 1023 CTASSERT(sizeof(struct ieee80211_tx_info) <= sizeof(((struct sk_buff *)0)->cb)); 1024 #define IEEE80211_SKB_CB(_skb) \ 1025 ((struct ieee80211_tx_info *)((_skb)->cb)) 1026 1027 CTASSERT(sizeof(struct ieee80211_rx_status) <= sizeof(((struct sk_buff *)0)->cb)); 1028 #define IEEE80211_SKB_RXCB(_skb) \ 1029 ((struct ieee80211_rx_status *)((_skb)->cb)) 1030 1031 static __inline void 1032 ieee80211_free_hw(struct ieee80211_hw *hw) 1033 { 1034 1035 linuxkpi_ieee80211_iffree(hw); 1036 1037 if (hw->wiphy != NULL) 1038 wiphy_free(hw->wiphy); 1039 /* Note that *hw is not valid any longer after this. */ 1040 1041 IMPROVE(); 1042 } 1043 1044 static __inline struct ieee80211_hw * 1045 ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) 1046 { 1047 1048 return (linuxkpi_ieee80211_alloc_hw(priv_len, ops)); 1049 } 1050 1051 static __inline void 1052 SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev) 1053 { 1054 1055 set_wiphy_dev(hw->wiphy, dev); 1056 linuxkpi_set_ieee80211_dev(hw, dev_name(dev)); 1057 1058 IMPROVE(); 1059 } 1060 1061 static __inline int 1062 ieee80211_register_hw(struct ieee80211_hw *hw) 1063 { 1064 int error; 1065 1066 error = wiphy_register(hw->wiphy); 1067 if (error != 0) 1068 return (error); 1069 1070 /* 1071 * At this point the driver has set all the options, flags, bands, 1072 * ciphers, hw address(es), ... basically mac80211/cfg80211 hw/wiphy 1073 * setup is done. 1074 * We need to replicate a lot of information from here into net80211. 1075 */ 1076 error = linuxkpi_ieee80211_ifattach(hw); 1077 1078 IMPROVE(); 1079 1080 return (error); 1081 } 1082 1083 static __inline void 1084 ieee80211_unregister_hw(struct ieee80211_hw *hw) 1085 { 1086 1087 wiphy_unregister(hw->wiphy); 1088 linuxkpi_ieee80211_ifdetach(hw); 1089 1090 IMPROVE(); 1091 } 1092 1093 static __inline struct ieee80211_hw * 1094 wiphy_to_ieee80211_hw(struct wiphy *wiphy) 1095 { 1096 1097 return (linuxkpi_wiphy_to_ieee80211_hw(wiphy)); 1098 } 1099 1100 /* -------------------------------------------------------------------------- */ 1101 1102 static __inline bool 1103 ieee80211_is_action(__le16 fc) 1104 { 1105 __le16 v; 1106 1107 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1108 v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); 1109 1110 return (fc == v); 1111 } 1112 1113 static __inline bool 1114 ieee80211_is_probe_resp(__le16 fc) 1115 { 1116 __le16 v; 1117 1118 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1119 v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); 1120 1121 return (fc == v); 1122 } 1123 1124 static __inline bool 1125 ieee80211_is_auth(__le16 fc) 1126 { 1127 __le16 v; 1128 1129 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1130 v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); 1131 1132 return (fc == v); 1133 } 1134 1135 static __inline bool 1136 ieee80211_is_assoc_req(__le16 fc) 1137 { 1138 __le16 v; 1139 1140 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1141 v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); 1142 1143 return (fc == v); 1144 } 1145 1146 static __inline bool 1147 ieee80211_is_assoc_resp(__le16 fc) 1148 { 1149 __le16 v; 1150 1151 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1152 v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); 1153 1154 return (fc == v); 1155 } 1156 1157 static __inline bool 1158 ieee80211_is_reassoc_req(__le16 fc) 1159 { 1160 __le16 v; 1161 1162 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1163 v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); 1164 1165 return (fc == v); 1166 } 1167 1168 static __inline bool 1169 ieee80211_is_reassoc_resp(__le16 fc) 1170 { 1171 __le16 v; 1172 1173 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1174 v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); 1175 1176 return (fc == v); 1177 } 1178 1179 static __inline bool 1180 ieee80211_is_disassoc(__le16 fc) 1181 { 1182 __le16 v; 1183 1184 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1185 v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); 1186 1187 return (fc == v); 1188 } 1189 1190 static __inline bool 1191 ieee80211_is_data_present(__le16 fc) 1192 { 1193 __le16 v; 1194 1195 /* If it is a data frame and NODATA is not present. */ 1196 fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); 1197 v = htole16(IEEE80211_FC0_TYPE_DATA); 1198 1199 return (fc == v); 1200 } 1201 1202 static __inline bool 1203 ieee80211_is_deauth(__le16 fc) 1204 { 1205 __le16 v; 1206 1207 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1208 v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); 1209 1210 return (fc == v); 1211 } 1212 1213 static __inline bool 1214 ieee80211_is_beacon(__le16 fc) 1215 { 1216 __le16 v; 1217 1218 /* 1219 * For as much as I get it this comes in LE and unlike FreeBSD 1220 * where we get the entire frame header and u8[], here we get the 1221 * 9.2.4.1 Frame Control field only. Mask and compare. 1222 */ 1223 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1224 v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); 1225 1226 return (fc == v); 1227 } 1228 1229 1230 static __inline bool 1231 ieee80211_is_probe_req(__le16 fc) 1232 { 1233 __le16 v; 1234 1235 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1236 v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); 1237 1238 return (fc == v); 1239 } 1240 1241 static __inline bool 1242 ieee80211_has_protected(__le16 fc) 1243 { 1244 1245 return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); 1246 } 1247 1248 static __inline bool 1249 ieee80211_is_back_req(__le16 fc) 1250 { 1251 __le16 v; 1252 1253 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1254 v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); 1255 1256 return (fc == v); 1257 } 1258 1259 static __inline bool 1260 ieee80211_is_bufferable_mmpdu(__le16 fc) 1261 { 1262 1263 /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ 1264 /* XXX we do not care about IBSS yet. */ 1265 1266 if (!ieee80211_is_mgmt(fc)) 1267 return (false); 1268 if (ieee80211_is_action(fc)) /* XXX FTM? */ 1269 return (true); 1270 if (ieee80211_is_disassoc(fc)) 1271 return (true); 1272 if (ieee80211_is_deauth(fc)) 1273 return (true); 1274 1275 return (false); 1276 } 1277 1278 static __inline bool 1279 ieee80211_is_nullfunc(__le16 fc) 1280 { 1281 __le16 v; 1282 1283 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1284 v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); 1285 1286 return (fc == v); 1287 } 1288 1289 static __inline bool 1290 ieee80211_is_qos_nullfunc(__le16 fc) 1291 { 1292 __le16 v; 1293 1294 fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); 1295 v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); 1296 1297 return (fc == v); 1298 } 1299 1300 static __inline bool 1301 ieee80211_is_any_nullfunc(__le16 fc) 1302 { 1303 1304 return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); 1305 } 1306 1307 static __inline bool 1308 ieee80211_vif_is_mesh(struct ieee80211_vif *vif) 1309 { 1310 TODO(); 1311 return (false); 1312 } 1313 1314 static __inline bool 1315 ieee80211_is_frag(struct ieee80211_hdr *hdr) 1316 { 1317 TODO(); 1318 return (false); 1319 } 1320 1321 static __inline bool 1322 ieee80211_is_first_frag(__le16 fc) 1323 { 1324 TODO(); 1325 return (false); 1326 } 1327 1328 static __inline bool 1329 ieee80211_is_pspoll(__le16 fc) 1330 { 1331 TODO(); 1332 return (false); 1333 } 1334 1335 static __inline bool 1336 ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) 1337 { 1338 TODO(); 1339 return (false); 1340 } 1341 1342 static __inline bool 1343 ieee80211_has_pm(__le16 fc) 1344 { 1345 TODO(); 1346 return (false); 1347 } 1348 1349 static __inline bool 1350 ieee80211_has_a4(__le16 fc) 1351 { 1352 __le16 v; 1353 1354 fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); 1355 v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); 1356 1357 return (fc == v); 1358 } 1359 1360 static __inline bool 1361 ieee80211_has_order(__le16 fc) 1362 { 1363 1364 return (fc & htole16(IEEE80211_FC1_ORDER << 8)); 1365 } 1366 1367 static __inline bool 1368 ieee80211_has_retry(__le16 fc) 1369 { 1370 1371 return (fc & htole16(IEEE80211_FC1_RETRY << 8)); 1372 } 1373 1374 1375 static __inline bool 1376 ieee80211_has_fromds(__le16 fc) 1377 { 1378 1379 return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); 1380 } 1381 1382 static __inline bool 1383 ieee80211_has_tods(__le16 fc) 1384 { 1385 1386 return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); 1387 } 1388 1389 static __inline uint8_t * 1390 ieee80211_get_SA(struct ieee80211_hdr *hdr) 1391 { 1392 1393 if (ieee80211_has_a4(hdr->frame_control)) 1394 return (hdr->addr4); 1395 if (ieee80211_has_fromds(hdr->frame_control)) 1396 return (hdr->addr3); 1397 return (hdr->addr2); 1398 } 1399 1400 static __inline uint8_t * 1401 ieee80211_get_DA(struct ieee80211_hdr *hdr) 1402 { 1403 1404 if (ieee80211_has_tods(hdr->frame_control)) 1405 return (hdr->addr3); 1406 return (hdr->addr1); 1407 } 1408 1409 static __inline bool 1410 ieee80211_has_morefrags(__le16 fc) 1411 { 1412 1413 fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); 1414 return (fc != 0); 1415 } 1416 1417 static __inline u8 * 1418 ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) 1419 { 1420 if (ieee80211_has_a4(hdr->frame_control)) 1421 return (u8 *)hdr + 30; 1422 else 1423 return (u8 *)hdr + 24; 1424 } 1425 1426 /* -------------------------------------------------------------------------- */ 1427 /* Receive functions (air/driver to mac80211/net80211). */ 1428 1429 1430 static __inline void 1431 ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1432 struct sk_buff *skb, struct napi_struct *napi) 1433 { 1434 1435 linuxkpi_ieee80211_rx(hw, skb, sta, napi); 1436 } 1437 1438 static __inline void 1439 ieee80211_rx_ni(struct ieee80211_hw *hw, struct sk_buff *skb) 1440 { 1441 1442 linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); 1443 } 1444 1445 static __inline void 1446 ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) 1447 { 1448 1449 linuxkpi_ieee80211_rx(hw, skb, NULL, NULL); 1450 } 1451 1452 /* -------------------------------------------------------------------------- */ 1453 1454 static __inline uint8_t 1455 ieee80211_get_tid(struct ieee80211_hdr *hdr) 1456 { 1457 1458 return (linuxkpi_ieee80211_get_tid(hdr, false)); 1459 } 1460 1461 static __inline struct sk_buff * 1462 ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1463 uint16_t *tim_offset, uint16_t *tim_len, uint32_t link_id) 1464 { 1465 1466 if (tim_offset != NULL) 1467 *tim_offset = 0; 1468 if (tim_len != NULL) 1469 *tim_len = 0; 1470 TODO(); 1471 return (NULL); 1472 } 1473 1474 static __inline void 1475 ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, 1476 enum ieee80211_iface_iter flags, 1477 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1478 void *arg) 1479 { 1480 1481 flags |= IEEE80211_IFACE_ITER__ATOMIC; 1482 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1483 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1484 } 1485 1486 static __inline void 1487 ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, 1488 enum ieee80211_iface_iter flags, 1489 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1490 void *arg) 1491 { 1492 1493 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1494 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1495 } 1496 1497 static __inline void 1498 ieee80211_iterate_active_interfaces_mtx(struct ieee80211_hw *hw, 1499 enum ieee80211_iface_iter flags, 1500 void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1501 void *arg) 1502 { 1503 flags |= IEEE80211_IFACE_ITER__ACTIVE; 1504 flags |= IEEE80211_IFACE_ITER__MTX; 1505 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1506 } 1507 1508 static __inline void 1509 ieee80211_iterate_interfaces(struct ieee80211_hw *hw, 1510 enum ieee80211_iface_iter flags, 1511 void (*iterfunc)(void *, uint8_t *, struct ieee80211_vif *), 1512 void *arg) 1513 { 1514 1515 linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); 1516 } 1517 1518 static __inline void 1519 ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1520 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 1521 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 1522 void *arg) 1523 { 1524 1525 linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); 1526 } 1527 1528 static __inline void 1529 ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1530 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, 1531 struct ieee80211_sta *, struct ieee80211_key_conf *, void *), 1532 void *arg) 1533 { 1534 1535 IMPROVE(); /* "rcu" */ 1536 linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); 1537 } 1538 1539 static __inline void 1540 ieee80211_iter_chan_contexts_atomic(struct ieee80211_hw *hw, 1541 void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *), 1542 void *arg) 1543 { 1544 1545 linuxkpi_ieee80211_iterate_chan_contexts(hw, iterfunc, arg); 1546 } 1547 1548 static __inline void 1549 ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, 1550 void (*iterfunc)(void *, struct ieee80211_sta *), void *arg) 1551 { 1552 1553 linuxkpi_ieee80211_iterate_stations_atomic(hw, iterfunc, arg); 1554 } 1555 1556 static __inline struct wireless_dev * 1557 ieee80211_vif_to_wdev(struct ieee80211_vif *vif) 1558 { 1559 1560 return (linuxkpi_ieee80211_vif_to_wdev(vif)); 1561 } 1562 1563 static __inline struct sk_buff * 1564 ieee80211_beacon_get_template(struct ieee80211_hw *hw, 1565 struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs, 1566 uint32_t link_id) 1567 { 1568 TODO(); 1569 return (NULL); 1570 } 1571 1572 static __inline void 1573 ieee80211_beacon_loss(struct ieee80211_vif *vif) 1574 { 1575 linuxkpi_ieee80211_beacon_loss(vif); 1576 } 1577 1578 static __inline void 1579 ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t) 1580 { 1581 TODO(); 1582 } 1583 1584 static __inline bool 1585 ieee80211_csa_is_complete(struct ieee80211_vif *vif) 1586 { 1587 TODO(); 1588 return (false); 1589 } 1590 1591 static __inline void 1592 ieee80211_csa_set_counter(struct ieee80211_vif *vif, uint8_t counter) 1593 { 1594 TODO(); 1595 } 1596 1597 static __inline int 1598 ieee80211_csa_update_counter(struct ieee80211_vif *vif) 1599 { 1600 TODO(); 1601 return (-1); 1602 } 1603 1604 static __inline void 1605 ieee80211_csa_finish(struct ieee80211_vif *vif) 1606 { 1607 TODO(); 1608 } 1609 1610 static __inline enum nl80211_iftype 1611 ieee80211_vif_type_p2p(struct ieee80211_vif *vif) 1612 { 1613 1614 /* If we are not p2p enabled, just return the type. */ 1615 if (!vif->p2p) 1616 return (vif->type); 1617 1618 /* If we are p2p, depending on side, return type. */ 1619 switch (vif->type) { 1620 case NL80211_IFTYPE_AP: 1621 return (NL80211_IFTYPE_P2P_GO); 1622 case NL80211_IFTYPE_STATION: 1623 return (NL80211_IFTYPE_P2P_CLIENT); 1624 default: 1625 fallthrough; 1626 } 1627 return (vif->type); 1628 } 1629 1630 static __inline unsigned long 1631 ieee80211_tu_to_usec(unsigned long tu) 1632 { 1633 1634 return (tu * IEEE80211_DUR_TU); 1635 } 1636 1637 1638 static __inline bool 1639 ieee80211_action_contains_tpc(struct sk_buff *skb) 1640 { 1641 struct ieee80211_mgmt *mgmt; 1642 1643 mgmt = (struct ieee80211_mgmt *)skb->data; 1644 1645 /* Check that this is a mgmt/action frame? */ 1646 if (!ieee80211_is_action(mgmt->frame_control)) 1647 return (false); 1648 1649 /* 1650 * This is a bit convoluted but according to docs both actions 1651 * are checked for this. Kind-of makes sense for the only consumer 1652 * (iwlwifi) I am aware off given the txpower fields are at the 1653 * same location so firmware can update the value. 1654 */ 1655 /* 80211-2020 9.6.2 Spectrum Management Action frames */ 1656 /* 80211-2020 9.6.2.5 TPC Report frame format */ 1657 /* 80211-2020 9.6.6 Radio Measurement action details */ 1658 /* 80211-2020 9.6.6.4 Link Measurement Report frame format */ 1659 /* Check that it is Spectrum Management or Radio Measurement? */ 1660 if (mgmt->u.action.category != IEEE80211_ACTION_CAT_SM && 1661 mgmt->u.action.category != IEEE80211_ACTION_CAT_RADIO_MEASUREMENT) 1662 return (false); 1663 1664 /* Check that it is TPC Report or Link Measurement Report? */ 1665 KASSERT(IEEE80211_ACTION_SM_TPCREP == IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP, 1666 ("%s: SM_TPCREP %d != RADIO_MEASUREMENT_LMREP %d\n", __func__, 1667 IEEE80211_ACTION_SM_TPCREP, IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP)); 1668 if (mgmt->u.action.u.tpc_report.spec_mgmt != IEEE80211_ACTION_SM_TPCREP) 1669 return (false); 1670 1671 /* 80211-2020 9.4.2.16 TPC Report element */ 1672 /* Check that the ELEMID and length are correct? */ 1673 if (mgmt->u.action.u.tpc_report.tpc_elem_id != IEEE80211_ELEMID_TPCREP || 1674 mgmt->u.action.u.tpc_report.tpc_elem_length != 4) 1675 return (false); 1676 1677 /* All the right fields in the right place. */ 1678 return (true); 1679 } 1680 1681 static __inline void 1682 ieee80211_connection_loss(struct ieee80211_vif *vif) 1683 { 1684 1685 linuxkpi_ieee80211_connection_loss(vif); 1686 } 1687 1688 static __inline struct ieee80211_sta * 1689 ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer) 1690 { 1691 1692 return (linuxkpi_ieee80211_find_sta(vif, peer)); 1693 } 1694 1695 static __inline struct ieee80211_sta * 1696 ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, const uint8_t *addr, 1697 const uint8_t *ourvifaddr) 1698 { 1699 1700 return (linuxkpi_ieee80211_find_sta_by_ifaddr(hw, addr, ourvifaddr)); 1701 } 1702 1703 1704 static __inline void 1705 ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, 1706 struct sk_buff *skb_frag, u8 *key) 1707 { 1708 TODO(); 1709 } 1710 1711 static __inline void 1712 ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf, 1713 const u8 *addr, uint32_t iv32, u16 *p1k) 1714 { 1715 TODO(); 1716 } 1717 1718 static __inline size_t 1719 ieee80211_ie_split(const u8 *ies, size_t ies_len, 1720 const u8 *ie_ids, size_t ie_ids_len, size_t start) 1721 { 1722 size_t x; 1723 1724 x = start; 1725 1726 /* XXX FIXME, we need to deal with "Element ID Extension" */ 1727 while (x < ies_len) { 1728 1729 /* Is this IE[s] one of the ie_ids? */ 1730 if (!linuxkpi_ieee80211_is_ie_id_in_ie_buf(ies[x], 1731 ie_ids, ie_ids_len)) 1732 break; 1733 1734 if (!linuxkpi_ieee80211_ie_advance(&x, ies, ies_len)) 1735 break; 1736 } 1737 1738 return (x); 1739 } 1740 1741 static __inline void 1742 ieee80211_request_smps(struct ieee80211_vif *vif, enum ieee80211_smps_mode smps) 1743 { 1744 static const char *smps_mode_name[] = { 1745 "SMPS_OFF", 1746 "SMPS_STATIC", 1747 "SMPS_DYNAMIC", 1748 "SMPS_AUTOMATIC", 1749 "SMPS_NUM_MODES" 1750 }; 1751 1752 if (linuxkpi_debug_80211 & D80211_TODO) 1753 printf("%s:%d: XXX LKPI80211 TODO smps %d %s\n", 1754 __func__, __LINE__, smps, smps_mode_name[smps]); 1755 } 1756 1757 static __inline void 1758 ieee80211_tdls_oper_request(struct ieee80211_vif *vif, uint8_t *addr, 1759 enum nl80211_tdls_operation oper, enum ieee80211_reason_code code, 1760 gfp_t gfp) 1761 { 1762 TODO(); 1763 } 1764 1765 static __inline void 1766 ieee80211_stop_queues(struct ieee80211_hw *hw) 1767 { 1768 TODO(); 1769 } 1770 1771 static __inline void 1772 ieee80211_wake_queues(struct ieee80211_hw *hw) 1773 { 1774 TODO(); 1775 } 1776 1777 static __inline void 1778 wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool state) 1779 { 1780 TODO(); 1781 } 1782 1783 static __inline void 1784 ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb) 1785 { 1786 IMPROVE(); 1787 1788 /* 1789 * This is called on transmit failure. 1790 * Use a not-so-random random high status error so we can distinguish 1791 * it from normal low values flying around in net80211 ("ETX"). 1792 */ 1793 linuxkpi_ieee80211_free_txskb(hw, skb, 0x455458); 1794 } 1795 1796 static __inline void 1797 ieee80211_restart_hw(struct ieee80211_hw *hw) 1798 { 1799 TODO(); 1800 } 1801 1802 static __inline void 1803 ieee80211_ready_on_channel(struct ieee80211_hw *hw) 1804 { 1805 TODO(); 1806 /* XXX-BZ We need to see that. */ 1807 } 1808 1809 static __inline void 1810 ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw) 1811 { 1812 TODO(); 1813 } 1814 1815 static __inline void 1816 ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, 1817 enum nl80211_cqm_rssi_threshold_event crte, int sig, gfp_t gfp) 1818 { 1819 TODO(); 1820 } 1821 1822 static __inline void 1823 ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *sta, uint8_t tid, 1824 uint32_t ssn, uint64_t bitmap, uint16_t received_mpdu) 1825 { 1826 TODO(); 1827 } 1828 1829 static __inline bool 1830 ieee80211_sn_less(uint16_t sn1, uint16_t sn2) 1831 { 1832 TODO(); 1833 return (false); 1834 } 1835 1836 static __inline uint16_t 1837 ieee80211_sn_inc(uint16_t sn) 1838 { 1839 TODO(); 1840 return (sn + 1); 1841 } 1842 1843 static __inline uint16_t 1844 ieee80211_sn_add(uint16_t sn, uint16_t a) 1845 { 1846 TODO(); 1847 return (sn + a); 1848 } 1849 1850 static __inline void 1851 ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, uint32_t x, uint8_t *addr) 1852 { 1853 TODO(); 1854 } 1855 1856 static __inline void 1857 ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2) 1858 { 1859 TODO(); 1860 } 1861 1862 static __inline void 1863 ieee80211_reserve_tid(struct ieee80211_sta *sta, uint8_t tid) 1864 { 1865 TODO(); 1866 } 1867 1868 static __inline void 1869 ieee80211_unreserve_tid(struct ieee80211_sta *sta, uint8_t tid) 1870 { 1871 TODO(); 1872 } 1873 1874 static __inline void 1875 ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, uint8_t *addr, 1876 uint8_t tid) 1877 { 1878 TODO(); 1879 } 1880 1881 static __inline void 1882 ieee80211_send_eosp_nullfunc(struct ieee80211_sta *sta, uint8_t tid) 1883 { 1884 TODO(); 1885 } 1886 1887 static __inline uint16_t 1888 ieee80211_sn_sub(uint16_t sa, uint16_t sb) 1889 { 1890 1891 return ((sa - sb) & 1892 (IEEE80211_SEQ_SEQ_MASK >> IEEE80211_SEQ_SEQ_SHIFT)); 1893 } 1894 1895 static __inline void 1896 ieee80211_sta_block_awake(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 1897 bool disable) 1898 { 1899 TODO(); 1900 } 1901 1902 static __inline void 1903 ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool sleeping) 1904 { 1905 TODO(); 1906 } 1907 1908 static __inline void 1909 ieee80211_sta_pspoll(struct ieee80211_sta *sta) 1910 { 1911 TODO(); 1912 } 1913 1914 static __inline void 1915 ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, int ntids) 1916 { 1917 TODO(); 1918 } 1919 1920 static __inline void 1921 ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf, 1922 uint64_t pn) 1923 { 1924 TODO(); 1925 } 1926 1927 static __inline struct sk_buff * 1928 ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 1929 { 1930 1931 return (linuxkpi_ieee80211_tx_dequeue(hw, txq)); 1932 } 1933 1934 static __inline void 1935 ieee80211_update_mu_groups(struct ieee80211_vif *vif, uint8_t *ms, uint8_t *up) 1936 { 1937 TODO(); 1938 } 1939 1940 static __inline void 1941 ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) 1942 { 1943 TODO(); 1944 } 1945 1946 static __inline void 1947 ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) 1948 { 1949 1950 linuxkpi_ieee80211_tx_status(hw, skb); 1951 } 1952 1953 static __inline void 1954 ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, 1955 struct ieee80211_key_seq *seq) 1956 { 1957 TODO(); 1958 } 1959 1960 static __inline void 1961 ieee80211_sched_scan_results(struct ieee80211_hw *hw) 1962 { 1963 TODO(); 1964 } 1965 1966 static __inline void 1967 ieee80211_sta_eosp(struct ieee80211_sta *sta) 1968 { 1969 TODO(); 1970 } 1971 1972 static __inline int 1973 ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x) 1974 { 1975 TODO("rtw8x"); 1976 return (-EINVAL); 1977 } 1978 1979 static __inline int 1980 ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid) 1981 { 1982 TODO("rtw89"); 1983 return (-EINVAL); 1984 } 1985 1986 static __inline void 1987 ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr, 1988 uint8_t tid) 1989 { 1990 TODO("iwlwifi"); 1991 } 1992 1993 static __inline void 1994 ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr, 1995 uint8_t tid) 1996 { 1997 TODO("iwlwifi/rtw8x/..."); 1998 } 1999 2000 static __inline void 2001 ieee80211_sched_scan_stopped(struct ieee80211_hw *hw) 2002 { 2003 TODO(); 2004 } 2005 2006 static __inline void 2007 ieee80211_scan_completed(struct ieee80211_hw *hw, 2008 struct cfg80211_scan_info *info) 2009 { 2010 2011 linuxkpi_ieee80211_scan_completed(hw, info); 2012 } 2013 2014 static __inline struct sk_buff * 2015 ieee80211_beacon_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2016 uint32_t link_id) 2017 { 2018 TODO(); 2019 return (NULL); 2020 } 2021 2022 static __inline struct sk_buff * 2023 ieee80211_pspoll_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 2024 { 2025 2026 /* Only STA needs this. Otherwise return NULL and panic bad drivers. */ 2027 if (vif->type != NL80211_IFTYPE_STATION) 2028 return (NULL); 2029 2030 return (linuxkpi_ieee80211_pspoll_get(hw, vif)); 2031 } 2032 2033 static __inline struct sk_buff * 2034 ieee80211_proberesp_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif) 2035 { 2036 TODO(); 2037 return (NULL); 2038 } 2039 2040 static __inline struct sk_buff * 2041 ieee80211_nullfunc_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2042 bool qos) 2043 { 2044 2045 /* Only STA needs this. Otherwise return NULL and panic bad drivers. */ 2046 if (vif->type != NL80211_IFTYPE_STATION) 2047 return (NULL); 2048 2049 return (linuxkpi_ieee80211_nullfunc_get(hw, vif, qos)); 2050 } 2051 2052 static __inline struct sk_buff * 2053 ieee80211_probereq_get(struct ieee80211_hw *hw, uint8_t *addr, 2054 uint8_t *ssid, size_t ssid_len, size_t tailroom) 2055 { 2056 2057 return (linuxkpi_ieee80211_probereq_get(hw, addr, ssid, ssid_len, 2058 tailroom)); 2059 } 2060 2061 static __inline void 2062 ieee80211_queue_delayed_work(struct ieee80211_hw *hw, struct delayed_work *w, 2063 int delay) 2064 { 2065 2066 linuxkpi_ieee80211_queue_delayed_work(hw, w, delay); 2067 } 2068 2069 static __inline void 2070 ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w) 2071 { 2072 2073 linuxkpi_ieee80211_queue_work(hw, w); 2074 } 2075 2076 static __inline void 2077 ieee80211_stop_queue(struct ieee80211_hw *hw, uint16_t q) 2078 { 2079 TODO(); 2080 } 2081 2082 static __inline void 2083 ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q) 2084 { 2085 TODO(); 2086 } 2087 2088 static __inline void 2089 ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb) 2090 { 2091 IMPROVE(); 2092 ieee80211_tx_status(hw, skb); 2093 } 2094 2095 static __inline void 2096 ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb) 2097 { 2098 IMPROVE(); 2099 ieee80211_tx_status(hw, skb); 2100 } 2101 2102 static __inline void 2103 ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) 2104 { 2105 int i; 2106 2107 /* 2108 * Apparently clearing flags and some other fields is not right. 2109 * Given the function is called "status" we work on that part of 2110 * the union. 2111 */ 2112 for (i = 0; i < nitems(info->status.rates); i++) 2113 info->status.rates[i].count = 0; 2114 /* 2115 * Unclear if ack_signal should be included or not but we clear the 2116 * "valid" bool so this field is no longer valid. 2117 */ 2118 memset(&info->status.ack_signal, 0, sizeof(*info) - 2119 offsetof(struct ieee80211_tx_info, status.ack_signal)); 2120 } 2121 2122 static __inline void 2123 ieee80211_txq_get_depth(struct ieee80211_txq *txq, unsigned long *frame_cnt, 2124 unsigned long *byte_cnt) 2125 { 2126 2127 if (frame_cnt == NULL && byte_cnt == NULL) 2128 return; 2129 2130 linuxkpi_ieee80211_txq_get_depth(txq, frame_cnt, byte_cnt); 2131 } 2132 2133 static __inline int 2134 rate_lowest_index(struct ieee80211_supported_band *band, 2135 struct ieee80211_sta *sta) 2136 { 2137 IMPROVE(); 2138 return (0); 2139 } 2140 2141 2142 static __inline void 2143 SET_IEEE80211_PERM_ADDR (struct ieee80211_hw *hw, uint8_t *addr) 2144 { 2145 2146 ether_addr_copy(hw->wiphy->perm_addr, addr); 2147 } 2148 2149 static __inline uint8_t * 2150 ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) 2151 { 2152 TODO(); 2153 return (NULL); 2154 } 2155 2156 static __inline void 2157 ieee80211_report_low_ack(struct ieee80211_sta *sta, int x) 2158 { 2159 TODO(); 2160 } 2161 2162 static __inline void 2163 ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, 2164 uint8_t tid) 2165 { 2166 TODO(); 2167 } 2168 2169 static __inline void 2170 ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, 2171 uint8_t tid) 2172 { 2173 TODO(); 2174 } 2175 2176 static __inline struct sk_buff * 2177 ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2178 { 2179 TODO(); 2180 return (NULL); 2181 } 2182 2183 static __inline void 2184 ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2185 struct ieee80211_tx_info *info) 2186 { 2187 TODO(); 2188 } 2189 2190 static __inline bool 2191 ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2192 { 2193 TODO(); 2194 return (false); 2195 } 2196 2197 static __inline void 2198 ieee80211_radar_detected(struct ieee80211_hw *hw) 2199 { 2200 TODO(); 2201 } 2202 2203 static __inline void 2204 ieee80211_sta_register_airtime(struct ieee80211_sta *sta, 2205 uint8_t tid, uint32_t duration, int x) 2206 { 2207 TODO(); 2208 } 2209 2210 2211 static __inline void 2212 ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac) 2213 { 2214 TODO(); 2215 } 2216 2217 static __inline void 2218 ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac) 2219 { 2220 /* DO_NADA; */ 2221 } 2222 2223 static __inline struct ieee80211_txq * 2224 ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac) 2225 { 2226 2227 TODO(); 2228 return (NULL); 2229 } 2230 2231 static __inline void 2232 ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 2233 { 2234 TODO(); 2235 } 2236 2237 static __inline void 2238 ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, 2239 bool withoutpkts) 2240 { 2241 TODO(); 2242 } 2243 2244 2245 static __inline void 2246 ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter) 2247 { 2248 TODO(); 2249 } 2250 2251 static __inline int 2252 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif) 2253 { 2254 TODO(); 2255 return (-1); 2256 } 2257 2258 static __inline int 2259 ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth, 2260 int x, bool t, int nss) 2261 { 2262 TODO(); 2263 return (-1); 2264 } 2265 2266 static __inline bool 2267 ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif) 2268 { 2269 TODO(); 2270 return (true); 2271 } 2272 2273 static __inline void 2274 ieee80211_disconnect(struct ieee80211_vif *vif, bool _x) 2275 { 2276 TODO(); 2277 } 2278 2279 static __inline void 2280 ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool _x) 2281 { 2282 TODO(); 2283 } 2284 2285 static __inline const struct ieee80211_sta_he_cap * 2286 ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band, 2287 enum nl80211_iftype type) 2288 { 2289 TODO(); 2290 return (NULL); 2291 } 2292 2293 static __inline void 2294 ieee80211_key_mic_failure(struct ieee80211_key_conf *key) 2295 { 2296 TODO(); 2297 } 2298 2299 static __inline void 2300 ieee80211_key_replay(struct ieee80211_key_conf *key) 2301 { 2302 TODO(); 2303 } 2304 2305 static __inline uint32_t 2306 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, 2307 struct ieee80211_rx_status *rxstat, int len) 2308 { 2309 TODO(); 2310 return (0); 2311 } 2312 2313 static __inline void 2314 ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, 2315 struct sk_buff *skb, struct ieee80211_tx_rate *txrate, int nrates) 2316 { 2317 TODO(); 2318 } 2319 2320 static __inline void 2321 ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2322 struct sk_buff *skb, struct list_head *list) 2323 { 2324 TODO(); 2325 } 2326 2327 static __inline void 2328 ieee80211_tx_status_ext(struct ieee80211_hw *hw, 2329 struct ieee80211_tx_status *txstat) 2330 { 2331 TODO(); 2332 } 2333 2334 static __inline const struct element * 2335 ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) 2336 { 2337 TODO(); 2338 return (NULL); 2339 } 2340 2341 static __inline void 2342 ieee80211_color_change_finish(struct ieee80211_vif *vif) 2343 { 2344 TODO(); 2345 } 2346 2347 static __inline struct sk_buff * 2348 ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, 2349 struct ieee80211_vif *vif) 2350 { 2351 TODO(); 2352 return (NULL); 2353 } 2354 2355 static __inline struct sk_buff * 2356 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, 2357 struct ieee80211_vif *vif) 2358 { 2359 TODO(); 2360 return (NULL); 2361 } 2362 2363 static __inline void 2364 linuxkpi_ieee80211_send_bar(struct ieee80211_vif *vif, uint8_t *ra, uint16_t tid, 2365 uint16_t ssn) 2366 { 2367 TODO(); 2368 } 2369 2370 static __inline void 2371 ieee80211_resume_disconnect(struct ieee80211_vif *vif) 2372 { 2373 TODO(); 2374 return; 2375 } 2376 2377 static __inline int 2378 ieee80211_data_to_8023(struct sk_buff *skb, const uint8_t *addr, 2379 enum nl80211_iftype iftype) 2380 { 2381 TODO(); 2382 return (-1); 2383 } 2384 2385 static __inline void 2386 ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key, 2387 uint32_t iv32, uint16_t *p1k) 2388 { 2389 TODO(); 2390 return; 2391 } 2392 2393 static __inline struct ieee80211_key_conf * 2394 ieee80211_gtk_rekey_add(struct ieee80211_vif *vif, 2395 struct ieee80211_key_conf *key) 2396 { 2397 TODO(); 2398 return (NULL); 2399 } 2400 2401 static __inline void 2402 ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const uint8_t *bssid, 2403 const uint8_t *replay_ctr, gfp_t gfp) 2404 { 2405 TODO(); 2406 return; 2407 } 2408 2409 static __inline void 2410 ieee80211_remove_key(struct ieee80211_key_conf *key) 2411 { 2412 TODO(); 2413 return; 2414 } 2415 2416 static __inline void 2417 ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, 2418 struct ieee80211_key_seq *seq) 2419 { 2420 TODO(); 2421 return; 2422 } 2423 2424 static __inline void 2425 ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, 2426 struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp) 2427 { 2428 TODO(); 2429 return; 2430 } 2431 2432 #define ieee80211_send_bar(_v, _r, _t, _s) \ 2433 linuxkpi_ieee80211_send_bar(_v, _r, _t, _s) 2434 2435 #endif /* _LINUXKPI_NET_MAC80211_H */ 2436