.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | #ifndef __NET_CFG80211_H |
---|
2 | 3 | #define __NET_CFG80211_H |
---|
3 | 4 | /* |
---|
.. | .. |
---|
6 | 7 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
---|
7 | 8 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
---|
8 | 9 | * Copyright 2015-2017 Intel Deutschland GmbH |
---|
9 | | - * Copyright (C) 2018-2019 Intel Corporation |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License version 2 as |
---|
13 | | - * published by the Free Software Foundation. |
---|
| 10 | + * Copyright (C) 2018-2020 Intel Corporation |
---|
14 | 11 | */ |
---|
15 | 12 | |
---|
16 | 13 | #include <linux/netdevice.h> |
---|
.. | .. |
---|
23 | 20 | #include <linux/if_ether.h> |
---|
24 | 21 | #include <linux/ieee80211.h> |
---|
25 | 22 | #include <linux/net.h> |
---|
| 23 | +#include <linux/android_kabi.h> |
---|
26 | 24 | #include <net/regulatory.h> |
---|
27 | | - |
---|
28 | | -/* Indicate support for including KEK length in rekey data */ |
---|
29 | | -#define CFG80211_REKEY_DATA_KEK_LEN 1 |
---|
30 | 25 | |
---|
31 | 26 | /** |
---|
32 | 27 | * DOC: Introduction |
---|
.. | .. |
---|
78 | 73 | * |
---|
79 | 74 | * @IEEE80211_CHAN_DISABLED: This channel is disabled. |
---|
80 | 75 | * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes |
---|
81 | | - * sending probe requests or beaconing. |
---|
| 76 | + * sending probe requests or beaconing. |
---|
82 | 77 | * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. |
---|
83 | 78 | * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel |
---|
84 | | - * is not permitted. |
---|
| 79 | + * is not permitted. |
---|
85 | 80 | * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel |
---|
86 | | - * is not permitted. |
---|
| 81 | + * is not permitted. |
---|
87 | 82 | * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. |
---|
88 | 83 | * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band, |
---|
89 | 84 | * this flag indicates that an 80 MHz channel cannot use this |
---|
.. | .. |
---|
101 | 96 | * on this channel. |
---|
102 | 97 | * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted |
---|
103 | 98 | * on this channel. |
---|
| 99 | + * @IEEE80211_CHAN_NO_HE: HE operation is not permitted on this channel. |
---|
| 100 | + * @IEEE80211_CHAN_1MHZ: 1 MHz bandwidth is permitted |
---|
| 101 | + * on this channel. |
---|
| 102 | + * @IEEE80211_CHAN_2MHZ: 2 MHz bandwidth is permitted |
---|
| 103 | + * on this channel. |
---|
| 104 | + * @IEEE80211_CHAN_4MHZ: 4 MHz bandwidth is permitted |
---|
| 105 | + * on this channel. |
---|
| 106 | + * @IEEE80211_CHAN_8MHZ: 8 MHz bandwidth is permitted |
---|
| 107 | + * on this channel. |
---|
| 108 | + * @IEEE80211_CHAN_16MHZ: 16 MHz bandwidth is permitted |
---|
| 109 | + * on this channel. |
---|
104 | 110 | * |
---|
105 | 111 | */ |
---|
106 | 112 | enum ieee80211_channel_flags { |
---|
.. | .. |
---|
117 | 123 | IEEE80211_CHAN_IR_CONCURRENT = 1<<10, |
---|
118 | 124 | IEEE80211_CHAN_NO_20MHZ = 1<<11, |
---|
119 | 125 | IEEE80211_CHAN_NO_10MHZ = 1<<12, |
---|
| 126 | + IEEE80211_CHAN_NO_HE = 1<<13, |
---|
| 127 | + IEEE80211_CHAN_1MHZ = 1<<14, |
---|
| 128 | + IEEE80211_CHAN_2MHZ = 1<<15, |
---|
| 129 | + IEEE80211_CHAN_4MHZ = 1<<16, |
---|
| 130 | + IEEE80211_CHAN_8MHZ = 1<<17, |
---|
| 131 | + IEEE80211_CHAN_16MHZ = 1<<18, |
---|
120 | 132 | }; |
---|
121 | 133 | |
---|
122 | 134 | #define IEEE80211_CHAN_NO_HT40 \ |
---|
.. | .. |
---|
132 | 144 | * with cfg80211. |
---|
133 | 145 | * |
---|
134 | 146 | * @center_freq: center frequency in MHz |
---|
| 147 | + * @freq_offset: offset from @center_freq, in KHz |
---|
135 | 148 | * @hw_value: hardware-specific value for the channel |
---|
136 | 149 | * @flags: channel flags from &enum ieee80211_channel_flags. |
---|
137 | 150 | * @orig_flags: channel flags at registration time, used by regulatory |
---|
.. | .. |
---|
152 | 165 | */ |
---|
153 | 166 | struct ieee80211_channel { |
---|
154 | 167 | enum nl80211_band band; |
---|
155 | | - u16 center_freq; |
---|
| 168 | + u32 center_freq; |
---|
| 169 | + u16 freq_offset; |
---|
156 | 170 | u16 hw_value; |
---|
157 | 171 | u32 flags; |
---|
158 | 172 | int max_antenna_gain; |
---|
.. | .. |
---|
253 | 267 | }; |
---|
254 | 268 | |
---|
255 | 269 | /** |
---|
| 270 | + * struct ieee80211_he_obss_pd - AP settings for spatial reuse |
---|
| 271 | + * |
---|
| 272 | + * @enable: is the feature enabled. |
---|
| 273 | + * @sr_ctrl: The SR Control field of SRP element. |
---|
| 274 | + * @non_srg_max_offset: non-SRG maximum tx power offset |
---|
| 275 | + * @min_offset: minimal tx power offset an associated station shall use |
---|
| 276 | + * @max_offset: maximum tx power offset an associated station shall use |
---|
| 277 | + * @bss_color_bitmap: bitmap that indicates the BSS color values used by |
---|
| 278 | + * members of the SRG |
---|
| 279 | + * @partial_bssid_bitmap: bitmap that indicates the partial BSSID values |
---|
| 280 | + * used by members of the SRG |
---|
| 281 | + */ |
---|
| 282 | +struct ieee80211_he_obss_pd { |
---|
| 283 | + bool enable; |
---|
| 284 | + u8 sr_ctrl; |
---|
| 285 | + u8 non_srg_max_offset; |
---|
| 286 | + u8 min_offset; |
---|
| 287 | + u8 max_offset; |
---|
| 288 | + u8 bss_color_bitmap[8]; |
---|
| 289 | + u8 partial_bssid_bitmap[8]; |
---|
| 290 | +}; |
---|
| 291 | + |
---|
| 292 | +/** |
---|
| 293 | + * struct cfg80211_he_bss_color - AP settings for BSS coloring |
---|
| 294 | + * |
---|
| 295 | + * @color: the current color. |
---|
| 296 | + * @enabled: HE BSS color is used |
---|
| 297 | + * @partial: define the AID equation. |
---|
| 298 | + */ |
---|
| 299 | +struct cfg80211_he_bss_color { |
---|
| 300 | + u8 color; |
---|
| 301 | + bool enabled; |
---|
| 302 | + bool partial; |
---|
| 303 | +}; |
---|
| 304 | + |
---|
| 305 | +/** |
---|
| 306 | + * struct ieee80211_he_bss_color - AP settings for BSS coloring |
---|
| 307 | + * |
---|
| 308 | + * @color: the current color. |
---|
| 309 | + * @disabled: is the feature disabled. |
---|
| 310 | + * @partial: define the AID equation. |
---|
| 311 | + */ |
---|
| 312 | +struct ieee80211_he_bss_color { |
---|
| 313 | + u8 color; |
---|
| 314 | + bool disabled; |
---|
| 315 | + bool partial; |
---|
| 316 | +}; |
---|
| 317 | + |
---|
| 318 | +/** |
---|
256 | 319 | * struct ieee80211_sta_ht_cap - STA's HT capabilities |
---|
257 | 320 | * |
---|
258 | 321 | * This structure describes most essential parameters needed |
---|
.. | .. |
---|
317 | 380 | * |
---|
318 | 381 | * @types_mask: interface types mask |
---|
319 | 382 | * @he_cap: holds the HE capabilities |
---|
| 383 | + * @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a |
---|
| 384 | + * 6 GHz band channel (and 0 may be valid value). |
---|
320 | 385 | */ |
---|
321 | 386 | struct ieee80211_sband_iftype_data { |
---|
322 | 387 | u16 types_mask; |
---|
323 | 388 | struct ieee80211_sta_he_cap he_cap; |
---|
| 389 | + struct ieee80211_he_6ghz_capa he_6ghz_capa; |
---|
324 | 390 | }; |
---|
325 | 391 | |
---|
326 | 392 | /** |
---|
.. | .. |
---|
378 | 444 | }; |
---|
379 | 445 | |
---|
380 | 446 | /** |
---|
| 447 | + * struct ieee80211_sta_s1g_cap - STA's S1G capabilities |
---|
| 448 | + * |
---|
| 449 | + * This structure describes most essential parameters needed |
---|
| 450 | + * to describe 802.11ah S1G capabilities for a STA. |
---|
| 451 | + * |
---|
| 452 | + * @s1g_supported: is STA an S1G STA |
---|
| 453 | + * @cap: S1G capabilities information |
---|
| 454 | + * @nss_mcs: Supported NSS MCS set |
---|
| 455 | + */ |
---|
| 456 | +struct ieee80211_sta_s1g_cap { |
---|
| 457 | + bool s1g; |
---|
| 458 | + u8 cap[10]; /* use S1G_CAPAB_ */ |
---|
| 459 | + u8 nss_mcs[5]; |
---|
| 460 | +}; |
---|
| 461 | + |
---|
| 462 | +/** |
---|
381 | 463 | * struct ieee80211_supported_band - frequency band definition |
---|
382 | 464 | * |
---|
383 | 465 | * This structure describes a frequency band a wiphy |
---|
384 | 466 | * is able to operate in. |
---|
385 | 467 | * |
---|
386 | | - * @channels: Array of channels the hardware can operate in |
---|
| 468 | + * @channels: Array of channels the hardware can operate with |
---|
387 | 469 | * in this band. |
---|
388 | 470 | * @band: the band this structure represents |
---|
389 | 471 | * @n_channels: Number of channels in @channels |
---|
.. | .. |
---|
393 | 475 | * @n_bitrates: Number of bitrates in @bitrates |
---|
394 | 476 | * @ht_cap: HT capabilities in this band |
---|
395 | 477 | * @vht_cap: VHT capabilities in this band |
---|
| 478 | + * @s1g_cap: S1G capabilities in this band |
---|
396 | 479 | * @edmg_cap: EDMG capabilities in this band |
---|
| 480 | + * @s1g_cap: S1G capabilities in this band (S1B band only, of course) |
---|
397 | 481 | * @n_iftype_data: number of iftype data entries |
---|
398 | 482 | * @iftype_data: interface type data entries. Note that the bits in |
---|
399 | 483 | * @types_mask inside this structure cannot overlap (i.e. only |
---|
.. | .. |
---|
408 | 492 | int n_bitrates; |
---|
409 | 493 | struct ieee80211_sta_ht_cap ht_cap; |
---|
410 | 494 | struct ieee80211_sta_vht_cap vht_cap; |
---|
| 495 | + struct ieee80211_sta_s1g_cap s1g_cap; |
---|
411 | 496 | struct ieee80211_edmg edmg_cap; |
---|
412 | 497 | u16 n_iftype_data; |
---|
413 | 498 | const struct ieee80211_sband_iftype_data *iftype_data; |
---|
.. | .. |
---|
441 | 526 | } |
---|
442 | 527 | |
---|
443 | 528 | /** |
---|
| 529 | + * ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype |
---|
| 530 | + * @sband: the sband to search for the iftype on |
---|
| 531 | + * @iftype: enum nl80211_iftype |
---|
| 532 | + * |
---|
| 533 | + * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found |
---|
| 534 | + */ |
---|
| 535 | +static inline const struct ieee80211_sta_he_cap * |
---|
| 536 | +ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband, |
---|
| 537 | + u8 iftype) |
---|
| 538 | +{ |
---|
| 539 | + const struct ieee80211_sband_iftype_data *data = |
---|
| 540 | + ieee80211_get_sband_iftype_data(sband, iftype); |
---|
| 541 | + |
---|
| 542 | + if (data && data->he_cap.has_he) |
---|
| 543 | + return &data->he_cap; |
---|
| 544 | + |
---|
| 545 | + return NULL; |
---|
| 546 | +} |
---|
| 547 | + |
---|
| 548 | +/** |
---|
444 | 549 | * ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA |
---|
445 | 550 | * @sband: the sband to search for the STA on |
---|
446 | 551 | * |
---|
.. | .. |
---|
449 | 554 | static inline const struct ieee80211_sta_he_cap * |
---|
450 | 555 | ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband) |
---|
451 | 556 | { |
---|
| 557 | + return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION); |
---|
| 558 | +} |
---|
| 559 | + |
---|
| 560 | +/** |
---|
| 561 | + * ieee80211_get_he_6ghz_capa - return HE 6 GHz capabilities |
---|
| 562 | + * @sband: the sband to search for the STA on |
---|
| 563 | + * @iftype: the iftype to search for |
---|
| 564 | + * |
---|
| 565 | + * Return: the 6GHz capabilities |
---|
| 566 | + */ |
---|
| 567 | +static inline __le16 |
---|
| 568 | +ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband, |
---|
| 569 | + enum nl80211_iftype iftype) |
---|
| 570 | +{ |
---|
452 | 571 | const struct ieee80211_sband_iftype_data *data = |
---|
453 | | - ieee80211_get_sband_iftype_data(sband, NL80211_IFTYPE_STATION); |
---|
| 572 | + ieee80211_get_sband_iftype_data(sband, iftype); |
---|
454 | 573 | |
---|
455 | | - if (data && data->he_cap.has_he) |
---|
456 | | - return &data->he_cap; |
---|
| 574 | + if (WARN_ON(!data || !data->he_cap.has_he)) |
---|
| 575 | + return 0; |
---|
457 | 576 | |
---|
458 | | - return NULL; |
---|
| 577 | + return data->he_6ghz_capa.capa; |
---|
459 | 578 | } |
---|
460 | 579 | |
---|
461 | 580 | /** |
---|
.. | .. |
---|
544 | 663 | * with the get_key() callback, must be in little endian, |
---|
545 | 664 | * length given by @seq_len. |
---|
546 | 665 | * @seq_len: length of @seq. |
---|
| 666 | + * @vlan_id: vlan_id for VLAN group key (if nonzero) |
---|
| 667 | + * @mode: key install mode (RX_TX, NO_TX or SET_TX) |
---|
547 | 668 | */ |
---|
548 | 669 | struct key_params { |
---|
549 | 670 | const u8 *key; |
---|
550 | 671 | const u8 *seq; |
---|
551 | 672 | int key_len; |
---|
552 | 673 | int seq_len; |
---|
| 674 | + u16 vlan_id; |
---|
553 | 675 | u32 cipher; |
---|
| 676 | + enum nl80211_key_mode mode; |
---|
554 | 677 | }; |
---|
555 | 678 | |
---|
556 | 679 | /** |
---|
.. | .. |
---|
564 | 687 | * If edmg is requested (i.e. the .channels member is non-zero), |
---|
565 | 688 | * chan will define the primary channel and all other |
---|
566 | 689 | * parameters are ignored. |
---|
| 690 | + * @freq1_offset: offset from @center_freq1, in KHz |
---|
567 | 691 | */ |
---|
568 | 692 | struct cfg80211_chan_def { |
---|
569 | 693 | struct ieee80211_channel *chan; |
---|
.. | .. |
---|
571 | 695 | u32 center_freq1; |
---|
572 | 696 | u32 center_freq2; |
---|
573 | 697 | struct ieee80211_edmg edmg; |
---|
| 698 | + u16 freq1_offset; |
---|
| 699 | +}; |
---|
| 700 | + |
---|
| 701 | +/* |
---|
| 702 | + * cfg80211_bitrate_mask - masks for bitrate control |
---|
| 703 | + */ |
---|
| 704 | +struct cfg80211_bitrate_mask { |
---|
| 705 | + struct { |
---|
| 706 | + u32 legacy; |
---|
| 707 | + u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; |
---|
| 708 | + u16 vht_mcs[NL80211_VHT_NSS_MAX]; |
---|
| 709 | + u16 he_mcs[NL80211_HE_NSS_MAX]; |
---|
| 710 | + enum nl80211_txrate_gi gi; |
---|
| 711 | + enum nl80211_he_gi he_gi; |
---|
| 712 | + enum nl80211_he_ltf he_ltf; |
---|
| 713 | + } control[NUM_NL80211_BANDS]; |
---|
| 714 | +}; |
---|
| 715 | + |
---|
| 716 | + |
---|
| 717 | +/** |
---|
| 718 | + * struct cfg80211_tid_cfg - TID specific configuration |
---|
| 719 | + * @config_override: Flag to notify driver to reset TID configuration |
---|
| 720 | + * of the peer. |
---|
| 721 | + * @tids: bitmap of TIDs to modify |
---|
| 722 | + * @mask: bitmap of attributes indicating which parameter changed, |
---|
| 723 | + * similar to &nl80211_tid_config_supp. |
---|
| 724 | + * @noack: noack configuration value for the TID |
---|
| 725 | + * @retry_long: retry count value |
---|
| 726 | + * @retry_short: retry count value |
---|
| 727 | + * @ampdu: Enable/Disable MPDU aggregation |
---|
| 728 | + * @rtscts: Enable/Disable RTS/CTS |
---|
| 729 | + * @amsdu: Enable/Disable MSDU aggregation |
---|
| 730 | + * @txrate_type: Tx bitrate mask type |
---|
| 731 | + * @txrate_mask: Tx bitrate to be applied for the TID |
---|
| 732 | + */ |
---|
| 733 | +struct cfg80211_tid_cfg { |
---|
| 734 | + bool config_override; |
---|
| 735 | + u8 tids; |
---|
| 736 | + u64 mask; |
---|
| 737 | + enum nl80211_tid_config noack; |
---|
| 738 | + u8 retry_long, retry_short; |
---|
| 739 | + enum nl80211_tid_config ampdu; |
---|
| 740 | + enum nl80211_tid_config rtscts; |
---|
| 741 | + enum nl80211_tid_config amsdu; |
---|
| 742 | + enum nl80211_tx_rate_setting txrate_type; |
---|
| 743 | + struct cfg80211_bitrate_mask txrate_mask; |
---|
| 744 | +}; |
---|
| 745 | + |
---|
| 746 | +/** |
---|
| 747 | + * struct cfg80211_tid_config - TID configuration |
---|
| 748 | + * @peer: Station's MAC address |
---|
| 749 | + * @n_tid_conf: Number of TID specific configurations to be applied |
---|
| 750 | + * @tid_conf: Configuration change info |
---|
| 751 | + */ |
---|
| 752 | +struct cfg80211_tid_config { |
---|
| 753 | + const u8 *peer; |
---|
| 754 | + u32 n_tid_conf; |
---|
| 755 | + struct cfg80211_tid_cfg tid_conf[]; |
---|
574 | 756 | }; |
---|
575 | 757 | |
---|
576 | 758 | /** |
---|
.. | .. |
---|
625 | 807 | return (chandef1->chan == chandef2->chan && |
---|
626 | 808 | chandef1->width == chandef2->width && |
---|
627 | 809 | chandef1->center_freq1 == chandef2->center_freq1 && |
---|
| 810 | + chandef1->freq1_offset == chandef2->freq1_offset && |
---|
628 | 811 | chandef1->center_freq2 == chandef2->center_freq2); |
---|
629 | 812 | } |
---|
630 | 813 | |
---|
.. | .. |
---|
745 | 928 | * @SURVEY_INFO_TIME_RX: receive time was filled in |
---|
746 | 929 | * @SURVEY_INFO_TIME_TX: transmit time was filled in |
---|
747 | 930 | * @SURVEY_INFO_TIME_SCAN: scan time was filled in |
---|
| 931 | + * @SURVEY_INFO_TIME_BSS_RX: local BSS receive time was filled in |
---|
748 | 932 | * |
---|
749 | 933 | * Used by the driver to indicate which info in &struct survey_info |
---|
750 | 934 | * it has filled in during the get_survey(). |
---|
.. | .. |
---|
758 | 942 | SURVEY_INFO_TIME_RX = BIT(5), |
---|
759 | 943 | SURVEY_INFO_TIME_TX = BIT(6), |
---|
760 | 944 | SURVEY_INFO_TIME_SCAN = BIT(7), |
---|
| 945 | + SURVEY_INFO_TIME_BSS_RX = BIT(8), |
---|
761 | 946 | }; |
---|
762 | 947 | |
---|
763 | 948 | /** |
---|
.. | .. |
---|
774 | 959 | * @time_rx: amount of time the radio spent receiving data |
---|
775 | 960 | * @time_tx: amount of time the radio spent transmitting data |
---|
776 | 961 | * @time_scan: amount of time the radio spent for scanning |
---|
| 962 | + * @time_bss_rx: amount of time the radio spent receiving data on a local BSS |
---|
777 | 963 | * |
---|
778 | 964 | * Used by dump_survey() to report back per-channel survey information. |
---|
779 | 965 | * |
---|
.. | .. |
---|
788 | 974 | u64 time_rx; |
---|
789 | 975 | u64 time_tx; |
---|
790 | 976 | u64 time_scan; |
---|
| 977 | + u64 time_bss_rx; |
---|
791 | 978 | u32 filled; |
---|
792 | 979 | s8 noise; |
---|
793 | 980 | }; |
---|
.. | .. |
---|
813 | 1000 | * protocol frames. |
---|
814 | 1001 | * @control_port_over_nl80211: TRUE if userspace expects to exchange control |
---|
815 | 1002 | * port frames over NL80211 instead of the network interface. |
---|
| 1003 | + * @control_port_no_preauth: disables pre-auth rx over the nl80211 control |
---|
| 1004 | + * port for mac80211 |
---|
816 | 1005 | * @wep_keys: static WEP keys, if not NULL points to an array of |
---|
817 | 1006 | * CFG80211_MAX_WEP_KEYS WEP keys |
---|
818 | 1007 | * @wep_tx_key: key index (0..3) of the default TX static WEP key |
---|
819 | 1008 | * @psk: PSK (for devices supporting 4-way-handshake offload) |
---|
| 1009 | + * @sae_pwd: password for SAE authentication (for devices supporting SAE |
---|
| 1010 | + * offload) |
---|
| 1011 | + * @sae_pwd_len: length of SAE password (for devices supporting SAE offload) |
---|
| 1012 | + * @sae_pwe: The mechanisms allowed for SAE PWE derivation: |
---|
| 1013 | + * |
---|
| 1014 | + * NL80211_SAE_PWE_UNSPECIFIED |
---|
| 1015 | + * Not-specified, used to indicate userspace did not specify any |
---|
| 1016 | + * preference. The driver should follow its internal policy in |
---|
| 1017 | + * such a scenario. |
---|
| 1018 | + * |
---|
| 1019 | + * NL80211_SAE_PWE_HUNT_AND_PECK |
---|
| 1020 | + * Allow hunting-and-pecking loop only |
---|
| 1021 | + * |
---|
| 1022 | + * NL80211_SAE_PWE_HASH_TO_ELEMENT |
---|
| 1023 | + * Allow hash-to-element only |
---|
| 1024 | + * |
---|
| 1025 | + * NL80211_SAE_PWE_BOTH |
---|
| 1026 | + * Allow either hunting-and-pecking loop or hash-to-element |
---|
820 | 1027 | */ |
---|
821 | 1028 | struct cfg80211_crypto_settings { |
---|
822 | 1029 | u32 wpa_versions; |
---|
.. | .. |
---|
829 | 1036 | __be16 control_port_ethertype; |
---|
830 | 1037 | bool control_port_no_encrypt; |
---|
831 | 1038 | bool control_port_over_nl80211; |
---|
| 1039 | + bool control_port_no_preauth; |
---|
832 | 1040 | struct key_params *wep_keys; |
---|
833 | 1041 | int wep_tx_key; |
---|
834 | 1042 | const u8 *psk; |
---|
| 1043 | + const u8 *sae_pwd; |
---|
| 1044 | + u8 sae_pwd_len; |
---|
| 1045 | + enum nl80211_sae_pwe_mechanism sae_pwe; |
---|
| 1046 | + |
---|
| 1047 | + ANDROID_KABI_RESERVE(1); |
---|
835 | 1048 | }; |
---|
836 | 1049 | |
---|
837 | 1050 | /** |
---|
.. | .. |
---|
852 | 1065 | * @assocresp_ies_len: length of assocresp_ies in octets |
---|
853 | 1066 | * @probe_resp_len: length of probe response template (@probe_resp) |
---|
854 | 1067 | * @probe_resp: probe response template (AP mode only) |
---|
| 1068 | + * @ftm_responder: enable FTM responder functionality; -1 for no change |
---|
| 1069 | + * (which also implies no change in LCI/civic location data) |
---|
| 1070 | + * @lci: Measurement Report element content, starting with Measurement Token |
---|
| 1071 | + * (measurement type 8) |
---|
| 1072 | + * @civicloc: Measurement Report element content, starting with Measurement |
---|
| 1073 | + * Token (measurement type 11) |
---|
| 1074 | + * @lci_len: LCI data length |
---|
| 1075 | + * @civicloc_len: Civic location data length |
---|
855 | 1076 | */ |
---|
856 | 1077 | struct cfg80211_beacon_data { |
---|
857 | 1078 | const u8 *head, *tail; |
---|
.. | .. |
---|
859 | 1080 | const u8 *proberesp_ies; |
---|
860 | 1081 | const u8 *assocresp_ies; |
---|
861 | 1082 | const u8 *probe_resp; |
---|
| 1083 | + const u8 *lci; |
---|
| 1084 | + const u8 *civicloc; |
---|
| 1085 | + s8 ftm_responder; |
---|
862 | 1086 | |
---|
863 | 1087 | size_t head_len, tail_len; |
---|
864 | 1088 | size_t beacon_ies_len; |
---|
865 | 1089 | size_t proberesp_ies_len; |
---|
866 | 1090 | size_t assocresp_ies_len; |
---|
867 | 1091 | size_t probe_resp_len; |
---|
| 1092 | + size_t lci_len; |
---|
| 1093 | + size_t civicloc_len; |
---|
| 1094 | + |
---|
| 1095 | + ANDROID_KABI_RESERVE(1); |
---|
868 | 1096 | }; |
---|
869 | 1097 | |
---|
870 | 1098 | struct mac_address { |
---|
.. | .. |
---|
887 | 1115 | struct mac_address mac_addrs[]; |
---|
888 | 1116 | }; |
---|
889 | 1117 | |
---|
890 | | -/* |
---|
891 | | - * cfg80211_bitrate_mask - masks for bitrate control |
---|
| 1118 | +/** |
---|
| 1119 | + * struct cfg80211_fils_discovery - FILS discovery parameters from |
---|
| 1120 | + * IEEE Std 802.11ai-2016, Annex C.3 MIB detail. |
---|
| 1121 | + * |
---|
| 1122 | + * @min_interval: Minimum packet interval in TUs (0 - 10000) |
---|
| 1123 | + * @max_interval: Maximum packet interval in TUs (0 - 10000) |
---|
| 1124 | + * @tmpl_len: Template length |
---|
| 1125 | + * @tmpl: Template data for FILS discovery frame including the action |
---|
| 1126 | + * frame headers. |
---|
892 | 1127 | */ |
---|
893 | | -struct cfg80211_bitrate_mask { |
---|
894 | | - struct { |
---|
895 | | - u32 legacy; |
---|
896 | | - u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; |
---|
897 | | - u16 vht_mcs[NL80211_VHT_NSS_MAX]; |
---|
898 | | - enum nl80211_txrate_gi gi; |
---|
899 | | - } control[NUM_NL80211_BANDS]; |
---|
| 1128 | +struct cfg80211_fils_discovery { |
---|
| 1129 | + u32 min_interval; |
---|
| 1130 | + u32 max_interval; |
---|
| 1131 | + size_t tmpl_len; |
---|
| 1132 | + const u8 *tmpl; |
---|
| 1133 | +}; |
---|
| 1134 | + |
---|
| 1135 | +/** |
---|
| 1136 | + * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe |
---|
| 1137 | + * response parameters in 6GHz. |
---|
| 1138 | + * |
---|
| 1139 | + * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned |
---|
| 1140 | + * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive |
---|
| 1141 | + * scanning |
---|
| 1142 | + * @tmpl_len: Template length |
---|
| 1143 | + * @tmpl: Template data for probe response |
---|
| 1144 | + */ |
---|
| 1145 | +struct cfg80211_unsol_bcast_probe_resp { |
---|
| 1146 | + u32 interval; |
---|
| 1147 | + size_t tmpl_len; |
---|
| 1148 | + const u8 *tmpl; |
---|
900 | 1149 | }; |
---|
901 | 1150 | |
---|
902 | 1151 | /** |
---|
.. | .. |
---|
937 | 1186 | * @beacon_rate: bitrate to be used for beacons |
---|
938 | 1187 | * @ht_cap: HT capabilities (or %NULL if HT isn't enabled) |
---|
939 | 1188 | * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled) |
---|
| 1189 | + * @he_cap: HE capabilities (or %NULL if HE isn't enabled) |
---|
940 | 1190 | * @ht_required: stations must support HT |
---|
941 | 1191 | * @vht_required: stations must support VHT |
---|
| 1192 | + * @twt_responder: Enable Target Wait Time |
---|
| 1193 | + * @he_required: stations must support HE |
---|
942 | 1194 | * @flags: flags, as defined in enum cfg80211_ap_settings_flags |
---|
| 1195 | + * @he_obss_pd: OBSS Packet Detection settings |
---|
| 1196 | + * @he_bss_color: BSS Color settings |
---|
| 1197 | + * @he_oper: HE operation IE (or %NULL if HE isn't enabled) |
---|
| 1198 | + * @fils_discovery: FILS discovery transmission parameters |
---|
| 1199 | + * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters |
---|
943 | 1200 | */ |
---|
944 | 1201 | struct cfg80211_ap_settings { |
---|
945 | 1202 | struct cfg80211_chan_def chandef; |
---|
.. | .. |
---|
963 | 1220 | |
---|
964 | 1221 | const struct ieee80211_ht_cap *ht_cap; |
---|
965 | 1222 | const struct ieee80211_vht_cap *vht_cap; |
---|
966 | | - bool ht_required, vht_required; |
---|
| 1223 | + const struct ieee80211_he_cap_elem *he_cap; |
---|
| 1224 | + const struct ieee80211_he_operation *he_oper; |
---|
| 1225 | + bool ht_required, vht_required, he_required; |
---|
| 1226 | + bool twt_responder; |
---|
967 | 1227 | u32 flags; |
---|
| 1228 | + struct ieee80211_he_obss_pd he_obss_pd; |
---|
| 1229 | + struct cfg80211_he_bss_color he_bss_color; |
---|
| 1230 | + struct cfg80211_fils_discovery fils_discovery; |
---|
| 1231 | + struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; |
---|
| 1232 | + |
---|
| 1233 | + ANDROID_KABI_RESERVE(1); |
---|
968 | 1234 | }; |
---|
969 | 1235 | |
---|
970 | 1236 | /** |
---|
.. | .. |
---|
994 | 1260 | bool radar_required; |
---|
995 | 1261 | bool block_tx; |
---|
996 | 1262 | u8 count; |
---|
| 1263 | + |
---|
| 1264 | + ANDROID_KABI_RESERVE(1); |
---|
997 | 1265 | }; |
---|
998 | 1266 | |
---|
999 | 1267 | #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10 |
---|
.. | .. |
---|
1035 | 1303 | STATION_PARAM_APPLY_UAPSD = BIT(0), |
---|
1036 | 1304 | STATION_PARAM_APPLY_CAPABILITY = BIT(1), |
---|
1037 | 1305 | STATION_PARAM_APPLY_PLINK_STATE = BIT(2), |
---|
| 1306 | + STATION_PARAM_APPLY_STA_TXPOWER = BIT(3), |
---|
| 1307 | +}; |
---|
| 1308 | + |
---|
| 1309 | +/** |
---|
| 1310 | + * struct sta_txpwr - station txpower configuration |
---|
| 1311 | + * |
---|
| 1312 | + * Used to configure txpower for station. |
---|
| 1313 | + * |
---|
| 1314 | + * @power: tx power (in dBm) to be used for sending data traffic. If tx power |
---|
| 1315 | + * is not provided, the default per-interface tx power setting will be |
---|
| 1316 | + * overriding. Driver should be picking up the lowest tx power, either tx |
---|
| 1317 | + * power per-interface or per-station. |
---|
| 1318 | + * @type: In particular if TPC %type is NL80211_TX_POWER_LIMITED then tx power |
---|
| 1319 | + * will be less than or equal to specified from userspace, whereas if TPC |
---|
| 1320 | + * %type is NL80211_TX_POWER_AUTOMATIC then it indicates default tx power. |
---|
| 1321 | + * NL80211_TX_POWER_FIXED is not a valid configuration option for |
---|
| 1322 | + * per peer TPC. |
---|
| 1323 | + */ |
---|
| 1324 | +struct sta_txpwr { |
---|
| 1325 | + s16 power; |
---|
| 1326 | + enum nl80211_tx_power_setting type; |
---|
1038 | 1327 | }; |
---|
1039 | 1328 | |
---|
1040 | 1329 | /** |
---|
.. | .. |
---|
1052 | 1341 | * (bitmask of BIT(%NL80211_STA_FLAG_...)) |
---|
1053 | 1342 | * @listen_interval: listen interval or -1 for no change |
---|
1054 | 1343 | * @aid: AID or zero for no change |
---|
| 1344 | + * @vlan_id: VLAN ID for station (if nonzero) |
---|
1055 | 1345 | * @peer_aid: mesh peer AID or zero for no change |
---|
1056 | 1346 | * @plink_action: plink action to take |
---|
1057 | 1347 | * @plink_state: set the peer link state for a station |
---|
.. | .. |
---|
1078 | 1368 | * @support_p2p_ps: information if station supports P2P PS mechanism |
---|
1079 | 1369 | * @he_capa: HE capabilities of station |
---|
1080 | 1370 | * @he_capa_len: the length of the HE capabilities |
---|
| 1371 | + * @airtime_weight: airtime scheduler weight for this station |
---|
| 1372 | + * @txpwr: transmit power for an associated station |
---|
| 1373 | + * @he_6ghz_capa: HE 6 GHz Band capabilities of station |
---|
1081 | 1374 | */ |
---|
1082 | 1375 | struct station_parameters { |
---|
1083 | 1376 | const u8 *supported_rates; |
---|
.. | .. |
---|
1086 | 1379 | u32 sta_modify_mask; |
---|
1087 | 1380 | int listen_interval; |
---|
1088 | 1381 | u16 aid; |
---|
| 1382 | + u16 vlan_id; |
---|
1089 | 1383 | u16 peer_aid; |
---|
1090 | 1384 | u8 supported_rates_len; |
---|
1091 | 1385 | u8 plink_action; |
---|
.. | .. |
---|
1107 | 1401 | int support_p2p_ps; |
---|
1108 | 1402 | const struct ieee80211_he_cap_elem *he_capa; |
---|
1109 | 1403 | u8 he_capa_len; |
---|
| 1404 | + u16 airtime_weight; |
---|
| 1405 | + struct sta_txpwr txpwr; |
---|
| 1406 | + const struct ieee80211_he_6ghz_capa *he_6ghz_capa; |
---|
| 1407 | + |
---|
| 1408 | + ANDROID_KABI_RESERVE(1); |
---|
1110 | 1409 | }; |
---|
1111 | 1410 | |
---|
1112 | 1411 | /** |
---|
.. | .. |
---|
1172 | 1471 | enum cfg80211_station_type statype); |
---|
1173 | 1472 | |
---|
1174 | 1473 | /** |
---|
1175 | | - * enum station_info_rate_flags - bitrate info flags |
---|
| 1474 | + * enum rate_info_flags - bitrate info flags |
---|
1176 | 1475 | * |
---|
1177 | 1476 | * Used by the driver to indicate the specific rate transmission |
---|
1178 | 1477 | * type for 802.11n transmissions. |
---|
.. | .. |
---|
1245 | 1544 | }; |
---|
1246 | 1545 | |
---|
1247 | 1546 | /** |
---|
1248 | | - * enum station_info_rate_flags - bitrate info flags |
---|
| 1547 | + * enum bss_param_flags - bitrate info flags |
---|
1249 | 1548 | * |
---|
1250 | 1549 | * Used by the driver to indicate the specific rate transmission |
---|
1251 | 1550 | * type for 802.11n transmissions. |
---|
.. | .. |
---|
1337 | 1636 | * indicate the relevant values in this struct for them |
---|
1338 | 1637 | * @connected_time: time(in secs) since a station is last connected |
---|
1339 | 1638 | * @inactive_time: time since last station activity (tx/rx) in milliseconds |
---|
| 1639 | + * @assoc_at: bootime (ns) of the last association |
---|
1340 | 1640 | * @rx_bytes: bytes (size of MPDUs) received from this station |
---|
1341 | 1641 | * @tx_bytes: bytes (size of MPDUs) transmitted to this station |
---|
1342 | 1642 | * @llid: mesh local link id |
---|
.. | .. |
---|
1377 | 1677 | * @rx_beacon: number of beacons received from this peer |
---|
1378 | 1678 | * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received |
---|
1379 | 1679 | * from this peer |
---|
| 1680 | + * @connected_to_gate: true if mesh STA has a path to mesh gate |
---|
1380 | 1681 | * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer |
---|
| 1682 | + * @tx_duration: aggregate PPDU duration(usecs) for all the frames to a peer |
---|
| 1683 | + * @airtime_weight: current airtime scheduling weight |
---|
1381 | 1684 | * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last |
---|
1382 | 1685 | * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs. |
---|
1383 | 1686 | * Note that this doesn't use the @filled bit, but is used if non-NULL. |
---|
.. | .. |
---|
1388 | 1691 | * @fcs_err_count: number of packets (MPDUs) received from this station with |
---|
1389 | 1692 | * an FCS error. This counter should be incremented only when TA of the |
---|
1390 | 1693 | * received packet with an FCS error matches the peer MAC address. |
---|
| 1694 | + * @airtime_link_metric: mesh airtime link metric. |
---|
| 1695 | + * @connected_to_as: true if mesh STA has a path to authentication server |
---|
1391 | 1696 | */ |
---|
1392 | 1697 | struct station_info { |
---|
1393 | 1698 | u64 filled; |
---|
1394 | 1699 | u32 connected_time; |
---|
1395 | 1700 | u32 inactive_time; |
---|
| 1701 | + u64 assoc_at; |
---|
1396 | 1702 | u64 rx_bytes; |
---|
1397 | 1703 | u64 tx_bytes; |
---|
1398 | 1704 | u16 llid; |
---|
.. | .. |
---|
1428 | 1734 | |
---|
1429 | 1735 | u32 expected_throughput; |
---|
1430 | 1736 | |
---|
1431 | | - u64 rx_beacon; |
---|
| 1737 | + u64 tx_duration; |
---|
1432 | 1738 | u64 rx_duration; |
---|
| 1739 | + u64 rx_beacon; |
---|
1433 | 1740 | u8 rx_beacon_signal_avg; |
---|
| 1741 | + u8 connected_to_gate; |
---|
| 1742 | + |
---|
1434 | 1743 | struct cfg80211_tid_stats *pertid; |
---|
1435 | 1744 | s8 ack_signal; |
---|
1436 | 1745 | s8 avg_ack_signal; |
---|
1437 | 1746 | |
---|
| 1747 | + u16 airtime_weight; |
---|
| 1748 | + |
---|
1438 | 1749 | u32 rx_mpdu_count; |
---|
1439 | 1750 | u32 fcs_err_count; |
---|
| 1751 | + |
---|
| 1752 | + u32 airtime_link_metric; |
---|
| 1753 | + |
---|
| 1754 | + u8 connected_to_as; |
---|
| 1755 | + |
---|
| 1756 | + ANDROID_KABI_RESERVE(1); |
---|
1440 | 1757 | }; |
---|
1441 | 1758 | |
---|
1442 | 1759 | #if IS_ENABLED(CONFIG_CFG80211) |
---|
.. | .. |
---|
1498 | 1815 | * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
---|
1499 | 1816 | * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled |
---|
1500 | 1817 | * @MPATH_INFO_FLAGS: @flags filled |
---|
| 1818 | + * @MPATH_INFO_HOP_COUNT: @hop_count filled |
---|
| 1819 | + * @MPATH_INFO_PATH_CHANGE: @path_change_count filled |
---|
1501 | 1820 | */ |
---|
1502 | 1821 | enum mpath_info_flags { |
---|
1503 | 1822 | MPATH_INFO_FRAME_QLEN = BIT(0), |
---|
.. | .. |
---|
1507 | 1826 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), |
---|
1508 | 1827 | MPATH_INFO_DISCOVERY_RETRIES = BIT(5), |
---|
1509 | 1828 | MPATH_INFO_FLAGS = BIT(6), |
---|
| 1829 | + MPATH_INFO_HOP_COUNT = BIT(7), |
---|
| 1830 | + MPATH_INFO_PATH_CHANGE = BIT(8), |
---|
1510 | 1831 | }; |
---|
1511 | 1832 | |
---|
1512 | 1833 | /** |
---|
.. | .. |
---|
1526 | 1847 | * This number should increase every time the list of mesh paths |
---|
1527 | 1848 | * changes, i.e. when a station is added or removed, so that |
---|
1528 | 1849 | * userspace can tell whether it got a consistent snapshot. |
---|
| 1850 | + * @hop_count: hops to destination |
---|
| 1851 | + * @path_change_count: total number of path changes to destination |
---|
1529 | 1852 | */ |
---|
1530 | 1853 | struct mpath_info { |
---|
1531 | 1854 | u32 filled; |
---|
.. | .. |
---|
1536 | 1859 | u32 discovery_timeout; |
---|
1537 | 1860 | u8 discovery_retries; |
---|
1538 | 1861 | u8 flags; |
---|
| 1862 | + u8 hop_count; |
---|
| 1863 | + u32 path_change_count; |
---|
1539 | 1864 | |
---|
1540 | 1865 | int generation; |
---|
1541 | 1866 | }; |
---|
.. | .. |
---|
1555 | 1880 | * (or NULL for no change) |
---|
1556 | 1881 | * @basic_rates_len: number of basic rates |
---|
1557 | 1882 | * @ap_isolate: do not forward packets between connected stations |
---|
| 1883 | + * (0 = no, 1 = yes, -1 = do not change) |
---|
1558 | 1884 | * @ht_opmode: HT Operation mode |
---|
1559 | | - * (u16 = opmode, -1 = do not change) |
---|
| 1885 | + * (u16 = opmode, -1 = do not change) |
---|
1560 | 1886 | * @p2p_ctwindow: P2P CT Window (-1 = no change) |
---|
1561 | 1887 | * @p2p_opp_ps: P2P opportunistic PS (-1 = no change) |
---|
1562 | 1888 | */ |
---|
.. | .. |
---|
1640 | 1966 | * @plink_timeout: If no tx activity is seen from a STA we've established |
---|
1641 | 1967 | * peering with for longer than this time (in seconds), then remove it |
---|
1642 | 1968 | * from the STA's list of peers. Default is 30 minutes. |
---|
| 1969 | + * @dot11MeshConnectedToMeshGate: if set to true, advertise that this STA is |
---|
| 1970 | + * connected to a mesh gate in mesh formation info. If false, the |
---|
| 1971 | + * value in mesh formation is determined by the presence of root paths |
---|
| 1972 | + * in the mesh path table |
---|
| 1973 | + * @dot11MeshNolearn: Try to avoid multi-hop path discovery (e.g. PREQ/PREP |
---|
| 1974 | + * for HWMP) if the destination is a direct neighbor. Note that this might |
---|
| 1975 | + * not be the optimal decision as a multi-hop route might be better. So |
---|
| 1976 | + * if using this setting you will likely also want to disable |
---|
| 1977 | + * dot11MeshForwarding and use another mesh routing protocol on top. |
---|
1643 | 1978 | */ |
---|
1644 | 1979 | struct mesh_config { |
---|
1645 | 1980 | u16 dot11MeshRetryTimeout; |
---|
.. | .. |
---|
1659 | 1994 | u16 dot11MeshHWMPperrMinInterval; |
---|
1660 | 1995 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
---|
1661 | 1996 | u8 dot11MeshHWMPRootMode; |
---|
| 1997 | + bool dot11MeshConnectedToMeshGate; |
---|
| 1998 | + bool dot11MeshConnectedToAuthServer; |
---|
1662 | 1999 | u16 dot11MeshHWMPRannInterval; |
---|
1663 | 2000 | bool dot11MeshGateAnnouncementProtocol; |
---|
1664 | 2001 | bool dot11MeshForwarding; |
---|
.. | .. |
---|
1670 | 2007 | enum nl80211_mesh_power_mode power_mode; |
---|
1671 | 2008 | u16 dot11MeshAwakeWindowDuration; |
---|
1672 | 2009 | u32 plink_timeout; |
---|
| 2010 | + bool dot11MeshNolearn; |
---|
| 2011 | + |
---|
| 2012 | + ANDROID_KABI_RESERVE(1); |
---|
1673 | 2013 | }; |
---|
1674 | 2014 | |
---|
1675 | 2015 | /** |
---|
.. | .. |
---|
1719 | 2059 | struct cfg80211_bitrate_mask beacon_rate; |
---|
1720 | 2060 | bool userspace_handles_dfs; |
---|
1721 | 2061 | bool control_port_over_nl80211; |
---|
| 2062 | + |
---|
| 2063 | + ANDROID_KABI_RESERVE(1); |
---|
1722 | 2064 | }; |
---|
1723 | 2065 | |
---|
1724 | 2066 | /** |
---|
.. | .. |
---|
1798 | 2140 | }; |
---|
1799 | 2141 | |
---|
1800 | 2142 | /** |
---|
| 2143 | + * struct cfg80211_scan_6ghz_params - relevant for 6 GHz only |
---|
| 2144 | + * |
---|
| 2145 | + * @short_bssid: short ssid to scan for |
---|
| 2146 | + * @bssid: bssid to scan for |
---|
| 2147 | + * @channel_idx: idx of the channel in the channel array in the scan request |
---|
| 2148 | + * which the above info relvant to |
---|
| 2149 | + * @unsolicited_probe: the AP transmits unsolicited probe response every 20 TU |
---|
| 2150 | + * @short_ssid_valid: short_ssid is valid and can be used |
---|
| 2151 | + * @psc_no_listen: when set, and the channel is a PSC channel, no need to wait |
---|
| 2152 | + * 20 TUs before starting to send probe requests. |
---|
| 2153 | + */ |
---|
| 2154 | +struct cfg80211_scan_6ghz_params { |
---|
| 2155 | + u32 short_ssid; |
---|
| 2156 | + u32 channel_idx; |
---|
| 2157 | + u8 bssid[ETH_ALEN]; |
---|
| 2158 | + bool unsolicited_probe; |
---|
| 2159 | + bool short_ssid_valid; |
---|
| 2160 | + bool psc_no_listen; |
---|
| 2161 | +}; |
---|
| 2162 | + |
---|
| 2163 | +/** |
---|
1801 | 2164 | * struct cfg80211_scan_request - scan request description |
---|
1802 | 2165 | * |
---|
1803 | 2166 | * @ssids: SSIDs to scan for (active scan only) |
---|
.. | .. |
---|
1824 | 2187 | * @mac_addr_mask: MAC address mask used with randomisation, bits that |
---|
1825 | 2188 | * are 0 in the mask should be randomised, bits that are 1 should |
---|
1826 | 2189 | * be taken from the @mac_addr |
---|
| 2190 | + * @scan_6ghz: relevant for split scan request only, |
---|
| 2191 | + * true if this is the second scan request |
---|
| 2192 | + * @n_6ghz_params: number of 6 GHz params |
---|
| 2193 | + * @scan_6ghz_params: 6 GHz params |
---|
1827 | 2194 | * @bssid: BSSID to scan for (most commonly, the wildcard BSSID) |
---|
1828 | 2195 | */ |
---|
1829 | 2196 | struct cfg80211_scan_request { |
---|
.. | .. |
---|
1851 | 2218 | struct cfg80211_scan_info info; |
---|
1852 | 2219 | bool notified; |
---|
1853 | 2220 | bool no_cck; |
---|
| 2221 | + bool scan_6ghz; |
---|
| 2222 | + u32 n_6ghz_params; |
---|
| 2223 | + struct cfg80211_scan_6ghz_params *scan_6ghz_params; |
---|
| 2224 | + |
---|
| 2225 | + ANDROID_KABI_RESERVE(1); |
---|
1854 | 2226 | |
---|
1855 | 2227 | /* keep last */ |
---|
1856 | | - struct ieee80211_channel *channels[0]; |
---|
| 2228 | + struct ieee80211_channel *channels[]; |
---|
1857 | 2229 | }; |
---|
1858 | 2230 | |
---|
1859 | 2231 | static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask) |
---|
.. | .. |
---|
1875 | 2247 | * @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match |
---|
1876 | 2248 | * or no match (RSSI only) |
---|
1877 | 2249 | * @rssi_thold: don't report scan results below this threshold (in s32 dBm) |
---|
| 2250 | + * @per_band_rssi_thold: Minimum rssi threshold for each band to be applied |
---|
| 2251 | + * for filtering out scan results received. Drivers advertize this support |
---|
| 2252 | + * of band specific rssi based filtering through the feature capability |
---|
| 2253 | + * %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band |
---|
| 2254 | + * specific rssi thresholds take precedence over rssi_thold, if specified. |
---|
| 2255 | + * If not specified for any band, it will be assigned with rssi_thold of |
---|
| 2256 | + * corresponding matchset. |
---|
1878 | 2257 | */ |
---|
1879 | 2258 | struct cfg80211_match_set { |
---|
1880 | 2259 | struct cfg80211_ssid ssid; |
---|
1881 | 2260 | u8 bssid[ETH_ALEN]; |
---|
1882 | 2261 | s32 rssi_thold; |
---|
| 2262 | + s32 per_band_rssi_thold[NUM_NL80211_BANDS]; |
---|
1883 | 2263 | }; |
---|
1884 | 2264 | |
---|
1885 | 2265 | /** |
---|
.. | .. |
---|
1919 | 2299 | * @ie_len: length of ie in octets |
---|
1920 | 2300 | * @flags: bit field of flags controlling operation |
---|
1921 | 2301 | * @match_sets: sets of parameters to be matched for a scan result |
---|
1922 | | - * entry to be considered valid and to be passed to the host |
---|
1923 | | - * (others are filtered out). |
---|
| 2302 | + * entry to be considered valid and to be passed to the host |
---|
| 2303 | + * (others are filtered out). |
---|
1924 | 2304 | * If ommited, all results are passed. |
---|
1925 | 2305 | * @n_match_sets: number of match sets |
---|
1926 | 2306 | * @report_results: indicates that results were reported for this request |
---|
.. | .. |
---|
1990 | 2370 | bool nl_owner_dead; |
---|
1991 | 2371 | struct list_head list; |
---|
1992 | 2372 | |
---|
| 2373 | + ANDROID_KABI_RESERVE(1); |
---|
| 2374 | + |
---|
1993 | 2375 | /* keep last */ |
---|
1994 | | - struct ieee80211_channel *channels[0]; |
---|
| 2376 | + struct ieee80211_channel *channels[]; |
---|
1995 | 2377 | }; |
---|
1996 | 2378 | |
---|
1997 | 2379 | /** |
---|
.. | .. |
---|
2018 | 2400 | * received by the device (not just by the host, in case it was |
---|
2019 | 2401 | * buffered on the device) and be accurate to about 10ms. |
---|
2020 | 2402 | * If the frame isn't buffered, just passing the return value of |
---|
2021 | | - * ktime_get_boot_ns() is likely appropriate. |
---|
| 2403 | + * ktime_get_boottime_ns() is likely appropriate. |
---|
2022 | 2404 | * @parent_tsf: the time at the start of reception of the first octet of the |
---|
2023 | 2405 | * timestamp field of the frame. The time is the TSF of the BSS specified |
---|
2024 | 2406 | * by %parent_bssid. |
---|
.. | .. |
---|
2078 | 2460 | * a BSS that hides the SSID in its beacon, this points to the BSS struct |
---|
2079 | 2461 | * that holds the beacon data. @beacon_ies is still valid, of course, and |
---|
2080 | 2462 | * points to the same data as hidden_beacon_bss->beacon_ies in that case. |
---|
| 2463 | + * @transmitted_bss: pointer to the transmitted BSS, if this is a |
---|
| 2464 | + * non-transmitted one (multi-BSSID support) |
---|
| 2465 | + * @nontrans_list: list of non-transmitted BSS, if this is a transmitted one |
---|
| 2466 | + * (multi-BSSID support) |
---|
2081 | 2467 | * @signal: signal strength value (type depends on the wiphy's signal_type) |
---|
2082 | 2468 | * @chains: bitmask for filled values in @chain_signal. |
---|
2083 | 2469 | * @chain_signal: per-chain signal strength of last received BSS in dBm. |
---|
.. | .. |
---|
2109 | 2495 | u8 bssid_index; |
---|
2110 | 2496 | u8 max_bssid_indicator; |
---|
2111 | 2497 | |
---|
2112 | | - u8 priv[0] __aligned(sizeof(void *)); |
---|
| 2498 | + ANDROID_KABI_RESERVE(1); |
---|
| 2499 | + |
---|
| 2500 | + u8 priv[] __aligned(sizeof(void *)); |
---|
2113 | 2501 | }; |
---|
2114 | 2502 | |
---|
2115 | 2503 | /** |
---|
2116 | | - * ieee80211_bss_get_ie - find IE with given ID |
---|
| 2504 | + * ieee80211_bss_get_elem - find element with given ID |
---|
2117 | 2505 | * @bss: the bss to search |
---|
2118 | | - * @ie: the IE ID |
---|
| 2506 | + * @id: the element ID |
---|
2119 | 2507 | * |
---|
2120 | 2508 | * Note that the return value is an RCU-protected pointer, so |
---|
2121 | 2509 | * rcu_read_lock() must be held when calling this function. |
---|
2122 | 2510 | * Return: %NULL if not found. |
---|
2123 | 2511 | */ |
---|
2124 | | -const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); |
---|
| 2512 | +const struct element *ieee80211_bss_get_elem(struct cfg80211_bss *bss, u8 id); |
---|
| 2513 | + |
---|
| 2514 | +/** |
---|
| 2515 | + * ieee80211_bss_get_ie - find IE with given ID |
---|
| 2516 | + * @bss: the bss to search |
---|
| 2517 | + * @id: the element ID |
---|
| 2518 | + * |
---|
| 2519 | + * Note that the return value is an RCU-protected pointer, so |
---|
| 2520 | + * rcu_read_lock() must be held when calling this function. |
---|
| 2521 | + * Return: %NULL if not found. |
---|
| 2522 | + */ |
---|
| 2523 | +static inline const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 id) |
---|
| 2524 | +{ |
---|
| 2525 | + return (void *)ieee80211_bss_get_elem(bss, id); |
---|
| 2526 | +} |
---|
2125 | 2527 | |
---|
2126 | 2528 | |
---|
2127 | 2529 | /** |
---|
.. | .. |
---|
2204 | 2606 | * @fils_nonces: FILS nonces (part of AAD) for protecting (Re)Association |
---|
2205 | 2607 | * Request/Response frame or %NULL if FILS is not used. This field starts |
---|
2206 | 2608 | * with 16 octets of STA Nonce followed by 16 octets of AP Nonce. |
---|
| 2609 | + * @s1g_capa: S1G capability override |
---|
| 2610 | + * @s1g_capa_mask: S1G capability override mask |
---|
2207 | 2611 | */ |
---|
2208 | 2612 | struct cfg80211_assoc_request { |
---|
2209 | 2613 | struct cfg80211_bss *bss; |
---|
.. | .. |
---|
2218 | 2622 | const u8 *fils_kek; |
---|
2219 | 2623 | size_t fils_kek_len; |
---|
2220 | 2624 | const u8 *fils_nonces; |
---|
| 2625 | + struct ieee80211_s1g_cap s1g_capa, s1g_capa_mask; |
---|
| 2626 | + |
---|
| 2627 | + ANDROID_KABI_RESERVE(1); |
---|
2221 | 2628 | }; |
---|
2222 | 2629 | |
---|
2223 | 2630 | /** |
---|
.. | .. |
---|
2295 | 2702 | * will be used in ht_capa. Un-supported values will be ignored. |
---|
2296 | 2703 | * @ht_capa_mask: The bits of ht_capa which are to be used. |
---|
2297 | 2704 | * @wep_keys: static WEP keys, if not NULL points to an array of |
---|
2298 | | - * CFG80211_MAX_WEP_KEYS WEP keys |
---|
| 2705 | + * CFG80211_MAX_WEP_KEYS WEP keys |
---|
2299 | 2706 | * @wep_tx_key: key index (0..3) of the default TX static WEP key |
---|
2300 | 2707 | */ |
---|
2301 | 2708 | struct cfg80211_ibss_params { |
---|
.. | .. |
---|
2316 | 2723 | struct ieee80211_ht_cap ht_capa_mask; |
---|
2317 | 2724 | struct key_params *wep_keys; |
---|
2318 | 2725 | int wep_tx_key; |
---|
| 2726 | + |
---|
| 2727 | + ANDROID_KABI_RESERVE(1); |
---|
2319 | 2728 | }; |
---|
2320 | 2729 | |
---|
2321 | 2730 | /** |
---|
.. | .. |
---|
2430 | 2839 | size_t fils_erp_rrk_len; |
---|
2431 | 2840 | bool want_1x; |
---|
2432 | 2841 | struct ieee80211_edmg edmg; |
---|
| 2842 | + |
---|
| 2843 | + ANDROID_KABI_RESERVE(1); |
---|
2433 | 2844 | }; |
---|
2434 | 2845 | |
---|
2435 | 2846 | /** |
---|
.. | .. |
---|
2473 | 2884 | WIPHY_PARAM_TXQ_QUANTUM = 1 << 8, |
---|
2474 | 2885 | }; |
---|
2475 | 2886 | |
---|
| 2887 | +#define IEEE80211_DEFAULT_AIRTIME_WEIGHT 256 |
---|
| 2888 | + |
---|
| 2889 | +/* The per TXQ device queue limit in airtime */ |
---|
| 2890 | +#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000 |
---|
| 2891 | +#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000 |
---|
| 2892 | + |
---|
| 2893 | +/* The per interface airtime threshold to switch to lower queue limit */ |
---|
| 2894 | +#define IEEE80211_AQL_THRESHOLD 24000 |
---|
| 2895 | + |
---|
2476 | 2896 | /** |
---|
2477 | 2897 | * struct cfg80211_pmksa - PMK Security Association |
---|
2478 | 2898 | * |
---|
.. | .. |
---|
2491 | 2911 | * @cache_id: 2-octet cache identifier advertized by a FILS AP identifying the |
---|
2492 | 2912 | * scope of PMKSA. This is valid only if @ssid_len is non-zero (may be |
---|
2493 | 2913 | * %NULL). |
---|
| 2914 | + * @pmk_lifetime: Maximum lifetime for PMKSA in seconds |
---|
| 2915 | + * (dot11RSNAConfigPMKLifetime) or 0 if not specified. |
---|
| 2916 | + * The configured PMKSA must not be used for PMKSA caching after |
---|
| 2917 | + * expiration and any keys derived from this PMK become invalid on |
---|
| 2918 | + * expiration, i.e., the current association must be dropped if the PMK |
---|
| 2919 | + * used for it expires. |
---|
| 2920 | + * @pmk_reauth_threshold: Threshold time for reauthentication (percentage of |
---|
| 2921 | + * PMK lifetime, dot11RSNAConfigPMKReauthThreshold) or 0 if not specified. |
---|
| 2922 | + * Drivers are expected to trigger a full authentication instead of using |
---|
| 2923 | + * this PMKSA for caching when reassociating to a new BSS after this |
---|
| 2924 | + * threshold to generate a new PMK before the current one expires. |
---|
2494 | 2925 | */ |
---|
2495 | 2926 | struct cfg80211_pmksa { |
---|
2496 | 2927 | const u8 *bssid; |
---|
.. | .. |
---|
2500 | 2931 | const u8 *ssid; |
---|
2501 | 2932 | size_t ssid_len; |
---|
2502 | 2933 | const u8 *cache_id; |
---|
| 2934 | + u32 pmk_lifetime; |
---|
| 2935 | + u8 pmk_reauth_threshold; |
---|
2503 | 2936 | }; |
---|
2504 | 2937 | |
---|
2505 | 2938 | /** |
---|
.. | .. |
---|
2674 | 3107 | |
---|
2675 | 3108 | /** |
---|
2676 | 3109 | * struct cfg80211_gtk_rekey_data - rekey data |
---|
2677 | | - * @kek: key encryption key |
---|
2678 | | - * @kck: key confirmation key (NL80211_KCK_LEN bytes) |
---|
| 3110 | + * @kek: key encryption key (@kek_len bytes) |
---|
| 3111 | + * @kck: key confirmation key (@kck_len bytes) |
---|
2679 | 3112 | * @replay_ctr: replay counter (NL80211_REPLAY_CTR_LEN bytes) |
---|
2680 | | - * @kek_len: Length of @kek in octets |
---|
| 3113 | + * @kek_len: length of kek |
---|
| 3114 | + * @kck_len length of kck |
---|
| 3115 | + * @akm: akm (oui, id) |
---|
2681 | 3116 | */ |
---|
2682 | 3117 | struct cfg80211_gtk_rekey_data { |
---|
2683 | 3118 | const u8 *kek, *kck, *replay_ctr; |
---|
2684 | | - size_t kek_len; |
---|
| 3119 | + u32 akm; |
---|
| 3120 | + u8 kek_len, kck_len; |
---|
2685 | 3121 | }; |
---|
2686 | 3122 | |
---|
2687 | 3123 | /** |
---|
.. | .. |
---|
2862 | 3298 | u8 num_rx_filters; |
---|
2863 | 3299 | u8 instance_id; |
---|
2864 | 3300 | u64 cookie; |
---|
| 3301 | + |
---|
| 3302 | + ANDROID_KABI_RESERVE(1); |
---|
2865 | 3303 | }; |
---|
2866 | 3304 | |
---|
2867 | 3305 | /** |
---|
.. | .. |
---|
2911 | 3349 | }; |
---|
2912 | 3350 | |
---|
2913 | 3351 | /** |
---|
| 3352 | + * struct cfg80211_ftm_responder_stats - FTM responder statistics |
---|
| 3353 | + * |
---|
| 3354 | + * @filled: bitflag of flags using the bits of &enum nl80211_ftm_stats to |
---|
| 3355 | + * indicate the relevant values in this struct for them |
---|
| 3356 | + * @success_num: number of FTM sessions in which all frames were successfully |
---|
| 3357 | + * answered |
---|
| 3358 | + * @partial_num: number of FTM sessions in which part of frames were |
---|
| 3359 | + * successfully answered |
---|
| 3360 | + * @failed_num: number of failed FTM sessions |
---|
| 3361 | + * @asap_num: number of ASAP FTM sessions |
---|
| 3362 | + * @non_asap_num: number of non-ASAP FTM sessions |
---|
| 3363 | + * @total_duration_ms: total sessions durations - gives an indication |
---|
| 3364 | + * of how much time the responder was busy |
---|
| 3365 | + * @unknown_triggers_num: number of unknown FTM triggers - triggers from |
---|
| 3366 | + * initiators that didn't finish successfully the negotiation phase with |
---|
| 3367 | + * the responder |
---|
| 3368 | + * @reschedule_requests_num: number of FTM reschedule requests - initiator asks |
---|
| 3369 | + * for a new scheduling although it already has scheduled FTM slot |
---|
| 3370 | + * @out_of_window_triggers_num: total FTM triggers out of scheduled window |
---|
| 3371 | + */ |
---|
| 3372 | +struct cfg80211_ftm_responder_stats { |
---|
| 3373 | + u32 filled; |
---|
| 3374 | + u32 success_num; |
---|
| 3375 | + u32 partial_num; |
---|
| 3376 | + u32 failed_num; |
---|
| 3377 | + u32 asap_num; |
---|
| 3378 | + u32 non_asap_num; |
---|
| 3379 | + u64 total_duration_ms; |
---|
| 3380 | + u32 unknown_triggers_num; |
---|
| 3381 | + u32 reschedule_requests_num; |
---|
| 3382 | + u32 out_of_window_triggers_num; |
---|
| 3383 | +}; |
---|
| 3384 | + |
---|
| 3385 | +/** |
---|
| 3386 | + * struct cfg80211_pmsr_ftm_result - FTM result |
---|
| 3387 | + * @failure_reason: if this measurement failed (PMSR status is |
---|
| 3388 | + * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise |
---|
| 3389 | + * reason than just "failure" |
---|
| 3390 | + * @burst_index: if reporting partial results, this is the index |
---|
| 3391 | + * in [0 .. num_bursts-1] of the burst that's being reported |
---|
| 3392 | + * @num_ftmr_attempts: number of FTM request frames transmitted |
---|
| 3393 | + * @num_ftmr_successes: number of FTM request frames acked |
---|
| 3394 | + * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY, |
---|
| 3395 | + * fill this to indicate in how many seconds a retry is deemed possible |
---|
| 3396 | + * by the responder |
---|
| 3397 | + * @num_bursts_exp: actual number of bursts exponent negotiated |
---|
| 3398 | + * @burst_duration: actual burst duration negotiated |
---|
| 3399 | + * @ftms_per_burst: actual FTMs per burst negotiated |
---|
| 3400 | + * @lci_len: length of LCI information (if present) |
---|
| 3401 | + * @civicloc_len: length of civic location information (if present) |
---|
| 3402 | + * @lci: LCI data (may be %NULL) |
---|
| 3403 | + * @civicloc: civic location data (may be %NULL) |
---|
| 3404 | + * @rssi_avg: average RSSI over FTM action frames reported |
---|
| 3405 | + * @rssi_spread: spread of the RSSI over FTM action frames reported |
---|
| 3406 | + * @tx_rate: bitrate for transmitted FTM action frame response |
---|
| 3407 | + * @rx_rate: bitrate of received FTM action frame |
---|
| 3408 | + * @rtt_avg: average of RTTs measured (must have either this or @dist_avg) |
---|
| 3409 | + * @rtt_variance: variance of RTTs measured (note that standard deviation is |
---|
| 3410 | + * the square root of the variance) |
---|
| 3411 | + * @rtt_spread: spread of the RTTs measured |
---|
| 3412 | + * @dist_avg: average of distances (mm) measured |
---|
| 3413 | + * (must have either this or @rtt_avg) |
---|
| 3414 | + * @dist_variance: variance of distances measured (see also @rtt_variance) |
---|
| 3415 | + * @dist_spread: spread of distances measured (see also @rtt_spread) |
---|
| 3416 | + * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid |
---|
| 3417 | + * @num_ftmr_successes_valid: @num_ftmr_successes is valid |
---|
| 3418 | + * @rssi_avg_valid: @rssi_avg is valid |
---|
| 3419 | + * @rssi_spread_valid: @rssi_spread is valid |
---|
| 3420 | + * @tx_rate_valid: @tx_rate is valid |
---|
| 3421 | + * @rx_rate_valid: @rx_rate is valid |
---|
| 3422 | + * @rtt_avg_valid: @rtt_avg is valid |
---|
| 3423 | + * @rtt_variance_valid: @rtt_variance is valid |
---|
| 3424 | + * @rtt_spread_valid: @rtt_spread is valid |
---|
| 3425 | + * @dist_avg_valid: @dist_avg is valid |
---|
| 3426 | + * @dist_variance_valid: @dist_variance is valid |
---|
| 3427 | + * @dist_spread_valid: @dist_spread is valid |
---|
| 3428 | + */ |
---|
| 3429 | +struct cfg80211_pmsr_ftm_result { |
---|
| 3430 | + const u8 *lci; |
---|
| 3431 | + const u8 *civicloc; |
---|
| 3432 | + unsigned int lci_len; |
---|
| 3433 | + unsigned int civicloc_len; |
---|
| 3434 | + enum nl80211_peer_measurement_ftm_failure_reasons failure_reason; |
---|
| 3435 | + u32 num_ftmr_attempts, num_ftmr_successes; |
---|
| 3436 | + s16 burst_index; |
---|
| 3437 | + u8 busy_retry_time; |
---|
| 3438 | + u8 num_bursts_exp; |
---|
| 3439 | + u8 burst_duration; |
---|
| 3440 | + u8 ftms_per_burst; |
---|
| 3441 | + s32 rssi_avg; |
---|
| 3442 | + s32 rssi_spread; |
---|
| 3443 | + struct rate_info tx_rate, rx_rate; |
---|
| 3444 | + s64 rtt_avg; |
---|
| 3445 | + s64 rtt_variance; |
---|
| 3446 | + s64 rtt_spread; |
---|
| 3447 | + s64 dist_avg; |
---|
| 3448 | + s64 dist_variance; |
---|
| 3449 | + s64 dist_spread; |
---|
| 3450 | + |
---|
| 3451 | + u16 num_ftmr_attempts_valid:1, |
---|
| 3452 | + num_ftmr_successes_valid:1, |
---|
| 3453 | + rssi_avg_valid:1, |
---|
| 3454 | + rssi_spread_valid:1, |
---|
| 3455 | + tx_rate_valid:1, |
---|
| 3456 | + rx_rate_valid:1, |
---|
| 3457 | + rtt_avg_valid:1, |
---|
| 3458 | + rtt_variance_valid:1, |
---|
| 3459 | + rtt_spread_valid:1, |
---|
| 3460 | + dist_avg_valid:1, |
---|
| 3461 | + dist_variance_valid:1, |
---|
| 3462 | + dist_spread_valid:1; |
---|
| 3463 | + |
---|
| 3464 | + ANDROID_KABI_RESERVE(1); |
---|
| 3465 | +}; |
---|
| 3466 | + |
---|
| 3467 | +/** |
---|
| 3468 | + * struct cfg80211_pmsr_result - peer measurement result |
---|
| 3469 | + * @addr: address of the peer |
---|
| 3470 | + * @host_time: host time (use ktime_get_boottime() adjust to the time when the |
---|
| 3471 | + * measurement was made) |
---|
| 3472 | + * @ap_tsf: AP's TSF at measurement time |
---|
| 3473 | + * @status: status of the measurement |
---|
| 3474 | + * @final: if reporting partial results, mark this as the last one; if not |
---|
| 3475 | + * reporting partial results always set this flag |
---|
| 3476 | + * @ap_tsf_valid: indicates the @ap_tsf value is valid |
---|
| 3477 | + * @type: type of the measurement reported, note that we only support reporting |
---|
| 3478 | + * one type at a time, but you can report multiple results separately and |
---|
| 3479 | + * they're all aggregated for userspace. |
---|
| 3480 | + */ |
---|
| 3481 | +struct cfg80211_pmsr_result { |
---|
| 3482 | + u64 host_time, ap_tsf; |
---|
| 3483 | + enum nl80211_peer_measurement_status status; |
---|
| 3484 | + |
---|
| 3485 | + u8 addr[ETH_ALEN]; |
---|
| 3486 | + |
---|
| 3487 | + u8 final:1, |
---|
| 3488 | + ap_tsf_valid:1; |
---|
| 3489 | + |
---|
| 3490 | + enum nl80211_peer_measurement_type type; |
---|
| 3491 | + |
---|
| 3492 | + union { |
---|
| 3493 | + struct cfg80211_pmsr_ftm_result ftm; |
---|
| 3494 | + }; |
---|
| 3495 | +}; |
---|
| 3496 | + |
---|
| 3497 | +/** |
---|
| 3498 | + * struct cfg80211_pmsr_ftm_request_peer - FTM request data |
---|
| 3499 | + * @requested: indicates FTM is requested |
---|
| 3500 | + * @preamble: frame preamble to use |
---|
| 3501 | + * @burst_period: burst period to use |
---|
| 3502 | + * @asap: indicates to use ASAP mode |
---|
| 3503 | + * @num_bursts_exp: number of bursts exponent |
---|
| 3504 | + * @burst_duration: burst duration |
---|
| 3505 | + * @ftms_per_burst: number of FTMs per burst |
---|
| 3506 | + * @ftmr_retries: number of retries for FTM request |
---|
| 3507 | + * @request_lci: request LCI information |
---|
| 3508 | + * @request_civicloc: request civic location information |
---|
| 3509 | + * @trigger_based: use trigger based ranging for the measurement |
---|
| 3510 | + * If neither @trigger_based nor @non_trigger_based is set, |
---|
| 3511 | + * EDCA based ranging will be used. |
---|
| 3512 | + * @non_trigger_based: use non trigger based ranging for the measurement |
---|
| 3513 | + * If neither @trigger_based nor @non_trigger_based is set, |
---|
| 3514 | + * EDCA based ranging will be used. |
---|
| 3515 | + * |
---|
| 3516 | + * See also nl80211 for the respective attribute documentation. |
---|
| 3517 | + */ |
---|
| 3518 | +struct cfg80211_pmsr_ftm_request_peer { |
---|
| 3519 | + enum nl80211_preamble preamble; |
---|
| 3520 | + u16 burst_period; |
---|
| 3521 | + u8 requested:1, |
---|
| 3522 | + asap:1, |
---|
| 3523 | + request_lci:1, |
---|
| 3524 | + request_civicloc:1, |
---|
| 3525 | + trigger_based:1, |
---|
| 3526 | + non_trigger_based:1; |
---|
| 3527 | + u8 num_bursts_exp; |
---|
| 3528 | + u8 burst_duration; |
---|
| 3529 | + u8 ftms_per_burst; |
---|
| 3530 | + u8 ftmr_retries; |
---|
| 3531 | +}; |
---|
| 3532 | + |
---|
| 3533 | +/** |
---|
| 3534 | + * struct cfg80211_pmsr_request_peer - peer data for a peer measurement request |
---|
| 3535 | + * @addr: MAC address |
---|
| 3536 | + * @chandef: channel to use |
---|
| 3537 | + * @report_ap_tsf: report the associated AP's TSF |
---|
| 3538 | + * @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer |
---|
| 3539 | + */ |
---|
| 3540 | +struct cfg80211_pmsr_request_peer { |
---|
| 3541 | + u8 addr[ETH_ALEN]; |
---|
| 3542 | + struct cfg80211_chan_def chandef; |
---|
| 3543 | + u8 report_ap_tsf:1; |
---|
| 3544 | + struct cfg80211_pmsr_ftm_request_peer ftm; |
---|
| 3545 | +}; |
---|
| 3546 | + |
---|
| 3547 | +/** |
---|
| 3548 | + * struct cfg80211_pmsr_request - peer measurement request |
---|
| 3549 | + * @cookie: cookie, set by cfg80211 |
---|
| 3550 | + * @nl_portid: netlink portid - used by cfg80211 |
---|
| 3551 | + * @drv_data: driver data for this request, if required for aborting, |
---|
| 3552 | + * not otherwise freed or anything by cfg80211 |
---|
| 3553 | + * @mac_addr: MAC address used for (randomised) request |
---|
| 3554 | + * @mac_addr_mask: MAC address mask used for randomisation, bits that |
---|
| 3555 | + * are 0 in the mask should be randomised, bits that are 1 should |
---|
| 3556 | + * be taken from the @mac_addr |
---|
| 3557 | + * @list: used by cfg80211 to hold on to the request |
---|
| 3558 | + * @timeout: timeout (in milliseconds) for the whole operation, if |
---|
| 3559 | + * zero it means there's no timeout |
---|
| 3560 | + * @n_peers: number of peers to do measurements with |
---|
| 3561 | + * @peers: per-peer measurement request data |
---|
| 3562 | + */ |
---|
| 3563 | +struct cfg80211_pmsr_request { |
---|
| 3564 | + u64 cookie; |
---|
| 3565 | + void *drv_data; |
---|
| 3566 | + u32 n_peers; |
---|
| 3567 | + u32 nl_portid; |
---|
| 3568 | + |
---|
| 3569 | + u32 timeout; |
---|
| 3570 | + |
---|
| 3571 | + u8 mac_addr[ETH_ALEN] __aligned(2); |
---|
| 3572 | + u8 mac_addr_mask[ETH_ALEN] __aligned(2); |
---|
| 3573 | + |
---|
| 3574 | + struct list_head list; |
---|
| 3575 | + |
---|
| 3576 | + struct cfg80211_pmsr_request_peer peers[]; |
---|
| 3577 | +}; |
---|
| 3578 | + |
---|
| 3579 | +/** |
---|
2914 | 3580 | * struct cfg80211_update_owe_info - OWE Information |
---|
2915 | 3581 | * |
---|
2916 | 3582 | * This structure provides information needed for the drivers to offload OWE |
---|
.. | .. |
---|
2934 | 3600 | u16 status; |
---|
2935 | 3601 | const u8 *ie; |
---|
2936 | 3602 | size_t ie_len; |
---|
| 3603 | +}; |
---|
| 3604 | + |
---|
| 3605 | +/** |
---|
| 3606 | + * struct mgmt_frame_regs - management frame registrations data |
---|
| 3607 | + * @global_stypes: bitmap of management frame subtypes registered |
---|
| 3608 | + * for the entire device |
---|
| 3609 | + * @interface_stypes: bitmap of management frame subtypes registered |
---|
| 3610 | + * for the given interface |
---|
| 3611 | + * @global_mcast_rx: mcast RX is needed globally for these subtypes |
---|
| 3612 | + * @interface_mcast_stypes: mcast RX is needed on this interface |
---|
| 3613 | + * for these subtypes |
---|
| 3614 | + */ |
---|
| 3615 | +struct mgmt_frame_regs { |
---|
| 3616 | + u32 global_stypes, interface_stypes; |
---|
| 3617 | + u32 global_mcast_stypes, interface_mcast_stypes; |
---|
2937 | 3618 | }; |
---|
2938 | 3619 | |
---|
2939 | 3620 | /** |
---|
.. | .. |
---|
2983 | 3664 | * @set_default_key: set the default key on an interface |
---|
2984 | 3665 | * |
---|
2985 | 3666 | * @set_default_mgmt_key: set the default management frame key on an interface |
---|
2986 | | - |
---|
| 3667 | + * |
---|
2987 | 3668 | * @set_default_beacon_key: set the default Beacon frame key on an interface |
---|
2988 | 3669 | * |
---|
2989 | 3670 | * @set_rekey_data: give the data necessary for GTK rekeying to the driver |
---|
.. | .. |
---|
3160 | 3841 | * The driver should not call cfg80211_sched_scan_stopped() for a requested |
---|
3161 | 3842 | * stop (when this method returns 0). |
---|
3162 | 3843 | * |
---|
3163 | | - * @mgmt_frame_register: Notify driver that a management frame type was |
---|
3164 | | - * registered. The callback is allowed to sleep. |
---|
| 3844 | + * @update_mgmt_frame_registrations: Notify the driver that management frame |
---|
| 3845 | + * registrations were updated. The callback is allowed to sleep. |
---|
3165 | 3846 | * |
---|
3166 | 3847 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. |
---|
3167 | 3848 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may |
---|
.. | .. |
---|
3274 | 3955 | * @tx_control_port: TX a control port frame (EAPoL). The noencrypt parameter |
---|
3275 | 3956 | * tells the driver that the frame should not be encrypted. |
---|
3276 | 3957 | * |
---|
| 3958 | + * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. |
---|
| 3959 | + * Statistics should be cumulative, currently no way to reset is provided. |
---|
| 3960 | + * @start_pmsr: start peer measurement (e.g. FTM) |
---|
| 3961 | + * @abort_pmsr: abort peer measurement |
---|
| 3962 | + * |
---|
3277 | 3963 | * @update_owe_info: Provide updated OWE info to driver. Driver implementing SME |
---|
3278 | 3964 | * but offloading OWE processing to the user space will get the updated |
---|
3279 | 3965 | * DH IE through this interface. |
---|
| 3966 | + * |
---|
| 3967 | + * @probe_mesh_link: Probe direct Mesh peer's link quality by sending data frame |
---|
| 3968 | + * and overrule HWMP path selection algorithm. |
---|
| 3969 | + * @set_tid_config: TID specific configuration, this can be peer or BSS specific |
---|
| 3970 | + * This callback may sleep. |
---|
| 3971 | + * @reset_tid_config: Reset TID specific configuration for the peer, for the |
---|
| 3972 | + * given TIDs. This callback may sleep. |
---|
3280 | 3973 | */ |
---|
3281 | 3974 | struct cfg80211_ops { |
---|
3282 | 3975 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
---|
.. | .. |
---|
3419 | 4112 | |
---|
3420 | 4113 | void (*rfkill_poll)(struct wiphy *wiphy); |
---|
3421 | 4114 | |
---|
| 4115 | +#ifdef CONFIG_NL80211_TESTMODE |
---|
3422 | 4116 | int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev, |
---|
3423 | 4117 | void *data, int len); |
---|
3424 | 4118 | int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb, |
---|
3425 | 4119 | struct netlink_callback *cb, |
---|
3426 | 4120 | void *data, int len); |
---|
| 4121 | +#endif |
---|
3427 | 4122 | |
---|
3428 | 4123 | int (*set_bitrate_mask)(struct wiphy *wiphy, |
---|
3429 | 4124 | struct net_device *dev, |
---|
.. | .. |
---|
3470 | 4165 | struct net_device *dev, |
---|
3471 | 4166 | u32 rate, u32 pkts, u32 intvl); |
---|
3472 | 4167 | |
---|
3473 | | - void (*mgmt_frame_register)(struct wiphy *wiphy, |
---|
3474 | | - struct wireless_dev *wdev, |
---|
3475 | | - u16 frame_type, bool reg); |
---|
| 4168 | + void (*update_mgmt_frame_registrations)(struct wiphy *wiphy, |
---|
| 4169 | + struct wireless_dev *wdev, |
---|
| 4170 | + struct mgmt_frame_regs *upd); |
---|
3476 | 4171 | |
---|
3477 | 4172 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); |
---|
3478 | 4173 | int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); |
---|
.. | .. |
---|
3584 | 4279 | struct net_device *dev, |
---|
3585 | 4280 | const u8 *buf, size_t len, |
---|
3586 | 4281 | const u8 *dest, const __be16 proto, |
---|
3587 | | - const bool noencrypt); |
---|
| 4282 | + const bool noencrypt, |
---|
| 4283 | + u64 *cookie); |
---|
| 4284 | + |
---|
| 4285 | + int (*get_ftm_responder_stats)(struct wiphy *wiphy, |
---|
| 4286 | + struct net_device *dev, |
---|
| 4287 | + struct cfg80211_ftm_responder_stats *ftm_stats); |
---|
| 4288 | + |
---|
| 4289 | + int (*start_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev, |
---|
| 4290 | + struct cfg80211_pmsr_request *request); |
---|
| 4291 | + void (*abort_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev, |
---|
| 4292 | + struct cfg80211_pmsr_request *request); |
---|
3588 | 4293 | int (*update_owe_info)(struct wiphy *wiphy, struct net_device *dev, |
---|
3589 | 4294 | struct cfg80211_update_owe_info *owe_info); |
---|
| 4295 | + int (*probe_mesh_link)(struct wiphy *wiphy, struct net_device *dev, |
---|
| 4296 | + const u8 *buf, size_t len); |
---|
| 4297 | + int (*set_tid_config)(struct wiphy *wiphy, struct net_device *dev, |
---|
| 4298 | + struct cfg80211_tid_config *tid_conf); |
---|
| 4299 | + int (*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev, |
---|
| 4300 | + const u8 *peer, u8 tids); |
---|
| 4301 | + ANDROID_KABI_RESERVE(1); |
---|
| 4302 | + ANDROID_KABI_RESERVE(2); |
---|
| 4303 | + ANDROID_KABI_RESERVE(3); |
---|
| 4304 | + ANDROID_KABI_RESERVE(4); |
---|
3590 | 4305 | }; |
---|
3591 | 4306 | |
---|
3592 | 4307 | /* |
---|
.. | .. |
---|
3597 | 4312 | /** |
---|
3598 | 4313 | * enum wiphy_flags - wiphy capability flags |
---|
3599 | 4314 | * |
---|
| 4315 | + * @WIPHY_FLAG_SPLIT_SCAN_6GHZ: if set to true, the scan request will be split |
---|
| 4316 | + * into two, first for legacy bands and second for UHB. |
---|
3600 | 4317 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this |
---|
3601 | 4318 | * wiphy at all |
---|
3602 | 4319 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled |
---|
.. | .. |
---|
3635 | 4352 | * beaconing mode (AP, IBSS, Mesh, ...). |
---|
3636 | 4353 | * @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation |
---|
3637 | 4354 | * before connection. |
---|
| 4355 | + * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys |
---|
3638 | 4356 | */ |
---|
3639 | 4357 | enum wiphy_flags { |
---|
3640 | | - /* use hole at 0 */ |
---|
| 4358 | + WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0), |
---|
3641 | 4359 | /* use hole at 1 */ |
---|
3642 | | - /* use hole at 2 */ |
---|
| 4360 | + WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(2), |
---|
3643 | 4361 | WIPHY_FLAG_NETNS_OK = BIT(3), |
---|
3644 | 4362 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), |
---|
3645 | 4363 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
---|
.. | .. |
---|
3917 | 4635 | u8 rx_nss; |
---|
3918 | 4636 | }; |
---|
3919 | 4637 | |
---|
| 4638 | +#define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)(long)(-ENODATA)) |
---|
| 4639 | + |
---|
3920 | 4640 | /** |
---|
3921 | 4641 | * struct wiphy_vendor_command - vendor command definition |
---|
3922 | 4642 | * @info: vendor command identifying information, as used in nl80211 |
---|
.. | .. |
---|
3927 | 4647 | * @dumpit: dump callback, for transferring bigger/multiple items. The |
---|
3928 | 4648 | * @storage points to cb->args[5], ie. is preserved over the multiple |
---|
3929 | 4649 | * dumpit calls. |
---|
| 4650 | + * @policy: policy pointer for attributes within %NL80211_ATTR_VENDOR_DATA. |
---|
| 4651 | + * Set this to %VENDOR_CMD_RAW_DATA if no policy can be given and the |
---|
| 4652 | + * attribute is just raw data (e.g. a firmware command). |
---|
| 4653 | + * @maxattr: highest attribute number in policy |
---|
3930 | 4654 | * It's recommended to not have the same sub command with both @doit and |
---|
3931 | 4655 | * @dumpit, so that userspace can assume certain ones are get and others |
---|
3932 | 4656 | * are used with dump requests. |
---|
.. | .. |
---|
3939 | 4663 | int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev, |
---|
3940 | 4664 | struct sk_buff *skb, const void *data, int data_len, |
---|
3941 | 4665 | unsigned long *storage); |
---|
| 4666 | + const struct nla_policy *policy; |
---|
| 4667 | + unsigned int maxattr; |
---|
| 4668 | + |
---|
| 4669 | + ANDROID_KABI_RESERVE(1); |
---|
3942 | 4670 | }; |
---|
3943 | 4671 | |
---|
3944 | 4672 | /** |
---|
.. | .. |
---|
3957 | 4685 | const u8 *extended_capabilities; |
---|
3958 | 4686 | const u8 *extended_capabilities_mask; |
---|
3959 | 4687 | u8 extended_capabilities_len; |
---|
| 4688 | +}; |
---|
| 4689 | + |
---|
| 4690 | +/** |
---|
| 4691 | + * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities |
---|
| 4692 | + * @max_peers: maximum number of peers in a single measurement |
---|
| 4693 | + * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement |
---|
| 4694 | + * @randomize_mac_addr: can randomize MAC address for measurement |
---|
| 4695 | + * @ftm.supported: FTM measurement is supported |
---|
| 4696 | + * @ftm.asap: ASAP-mode is supported |
---|
| 4697 | + * @ftm.non_asap: non-ASAP-mode is supported |
---|
| 4698 | + * @ftm.request_lci: can request LCI data |
---|
| 4699 | + * @ftm.request_civicloc: can request civic location data |
---|
| 4700 | + * @ftm.preambles: bitmap of preambles supported (&enum nl80211_preamble) |
---|
| 4701 | + * @ftm.bandwidths: bitmap of bandwidths supported (&enum nl80211_chan_width) |
---|
| 4702 | + * @ftm.max_bursts_exponent: maximum burst exponent supported |
---|
| 4703 | + * (set to -1 if not limited; note that setting this will necessarily |
---|
| 4704 | + * forbid using the value 15 to let the responder pick) |
---|
| 4705 | + * @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if |
---|
| 4706 | + * not limited) |
---|
| 4707 | + * @ftm.trigger_based: trigger based ranging measurement is supported |
---|
| 4708 | + * @ftm.non_trigger_based: non trigger based ranging measurement is supported |
---|
| 4709 | + */ |
---|
| 4710 | +struct cfg80211_pmsr_capabilities { |
---|
| 4711 | + unsigned int max_peers; |
---|
| 4712 | + u8 report_ap_tsf:1, |
---|
| 4713 | + randomize_mac_addr:1; |
---|
| 4714 | + |
---|
| 4715 | + struct { |
---|
| 4716 | + u32 preambles; |
---|
| 4717 | + u32 bandwidths; |
---|
| 4718 | + s8 max_bursts_exponent; |
---|
| 4719 | + u8 max_ftms_per_burst; |
---|
| 4720 | + u8 supported:1, |
---|
| 4721 | + asap:1, |
---|
| 4722 | + non_asap:1, |
---|
| 4723 | + request_lci:1, |
---|
| 4724 | + request_civicloc:1, |
---|
| 4725 | + trigger_based:1, |
---|
| 4726 | + non_trigger_based:1; |
---|
| 4727 | + } ftm; |
---|
3960 | 4728 | }; |
---|
3961 | 4729 | |
---|
3962 | 4730 | /** |
---|
.. | .. |
---|
3980 | 4748 | * note that if your driver uses wiphy_apply_custom_regulatory() |
---|
3981 | 4749 | * the reg_notifier's request can be passed as NULL |
---|
3982 | 4750 | * @regd: the driver's regulatory domain, if one was requested via |
---|
3983 | | - * the regulatory_hint() API. This can be used by the driver |
---|
| 4751 | + * the regulatory_hint() API. This can be used by the driver |
---|
3984 | 4752 | * on the reg_notifier() if it chooses to ignore future |
---|
3985 | 4753 | * regulatory domain changes caused by other drivers. |
---|
3986 | 4754 | * @signal_type: signal type reported in &struct cfg80211_bss. |
---|
3987 | 4755 | * @cipher_suites: supported cipher suites |
---|
3988 | 4756 | * @n_cipher_suites: number of supported cipher suites |
---|
| 4757 | + * @akm_suites: supported AKM suites. These are the default AKMs supported if |
---|
| 4758 | + * the supported AKMs not advertized for a specific interface type in |
---|
| 4759 | + * iftype_akm_suites. |
---|
| 4760 | + * @n_akm_suites: number of supported AKM suites |
---|
3989 | 4761 | * @iftype_akm_suites: array of supported akm suites info per interface type. |
---|
3990 | 4762 | * Note that the bits in @iftypes_mask inside this structure cannot |
---|
3991 | 4763 | * overlap (i.e. only one occurrence of each type is allowed across all |
---|
.. | .. |
---|
4012 | 4784 | * the same number of arbitrary MAC addresses. |
---|
4013 | 4785 | * @registered: protects ->resume and ->suspend sysfs callbacks against |
---|
4014 | 4786 | * unregister hardware |
---|
4015 | | - * @debugfsdir: debugfs directory used for this wiphy, will be renamed |
---|
4016 | | - * automatically on wiphy renames |
---|
4017 | | - * @dev: (virtual) struct device for this wiphy |
---|
4018 | | - * @registered: helps synchronize suspend/resume with wiphy unregister |
---|
| 4787 | + * @debugfsdir: debugfs directory used for this wiphy (ieee80211/<wiphyname>). |
---|
| 4788 | + * It will be renamed automatically on wiphy renames |
---|
| 4789 | + * @dev: (virtual) struct device for this wiphy. The item in |
---|
| 4790 | + * /sys/class/ieee80211/ points to this. You need use set_wiphy_dev() |
---|
| 4791 | + * (see below). |
---|
4019 | 4792 | * @wext: wireless extension handlers |
---|
4020 | 4793 | * @priv: driver private data (sized according to wiphy_new() parameter) |
---|
4021 | 4794 | * @interface_modes: bitmask of interfaces types valid for this wiphy, |
---|
.. | .. |
---|
4126 | 4899 | * and probe responses. This value should be set if the driver |
---|
4127 | 4900 | * wishes to limit the number of csa counters. Default (0) means |
---|
4128 | 4901 | * infinite. |
---|
4129 | | - * @max_adj_channel_rssi_comp: max offset of between the channel on which the |
---|
4130 | | - * frame was sent and the channel on which the frame was heard for which |
---|
4131 | | - * the reported rssi is still valid. If a driver is able to compensate the |
---|
4132 | | - * low rssi when a frame is heard on different channel, then it should set |
---|
4133 | | - * this variable to the maximal offset for which it can compensate. |
---|
4134 | | - * This value should be set in MHz. |
---|
4135 | 4902 | * @bss_select_support: bitmask indicating the BSS selection criteria supported |
---|
4136 | 4903 | * by the driver in the .connect() callback. The bit position maps to the |
---|
4137 | 4904 | * attribute indices defined in &enum nl80211_bss_select_attr. |
---|
4138 | 4905 | * |
---|
4139 | | - * @cookie_counter: unique generic cookie counter, used to identify objects. |
---|
4140 | 4906 | * @nan_supported_bands: bands supported by the device in NAN mode, a |
---|
4141 | 4907 | * bitmap of &enum nl80211_band values. For instance, for |
---|
4142 | 4908 | * NL80211_BAND_2GHZ, bit 0 would be set |
---|
.. | .. |
---|
4146 | 4912 | * @txq_memory_limit: configuration internal TX queue memory limit |
---|
4147 | 4913 | * @txq_quantum: configuration of internal TX queue scheduler quantum |
---|
4148 | 4914 | * |
---|
| 4915 | + * @tx_queue_len: allow setting transmit queue len for drivers not using |
---|
| 4916 | + * wake_tx_queue |
---|
| 4917 | + * |
---|
4149 | 4918 | * @support_mbssid: can HW support association with nontransmitted AP |
---|
4150 | 4919 | * @support_only_he_mbssid: don't parse MBSSID elements if it is not |
---|
4151 | 4920 | * HE AP, in order to avoid compatibility issues. |
---|
4152 | 4921 | * @support_mbssid must be set for this to have any effect. |
---|
| 4922 | + * |
---|
| 4923 | + * @pmsr_capa: peer measurement capabilities |
---|
| 4924 | + * |
---|
| 4925 | + * @tid_config_support: describes the per-TID config support that the |
---|
| 4926 | + * device has |
---|
| 4927 | + * @tid_config_support.vif: bitmap of attributes (configurations) |
---|
| 4928 | + * supported by the driver for each vif |
---|
| 4929 | + * @tid_config_support.peer: bitmap of attributes (configurations) |
---|
| 4930 | + * supported by the driver for each peer |
---|
| 4931 | + * @tid_config_support.max_retry: maximum supported retry count for |
---|
| 4932 | + * long/short retry configuration |
---|
| 4933 | + * |
---|
| 4934 | + * @max_data_retry_count: maximum supported per TID retry count for |
---|
| 4935 | + * configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and |
---|
| 4936 | + * %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes |
---|
4153 | 4937 | */ |
---|
4154 | 4938 | struct wiphy { |
---|
4155 | 4939 | /* assign these fields before you register the wiphy */ |
---|
4156 | 4940 | |
---|
4157 | | - /* permanent MAC address(es) */ |
---|
4158 | 4941 | u8 perm_addr[ETH_ALEN]; |
---|
4159 | 4942 | u8 addr_mask[ETH_ALEN]; |
---|
4160 | 4943 | |
---|
.. | .. |
---|
4194 | 4977 | int n_cipher_suites; |
---|
4195 | 4978 | const u32 *cipher_suites; |
---|
4196 | 4979 | |
---|
| 4980 | + int n_akm_suites; |
---|
| 4981 | + const u32 *akm_suites; |
---|
| 4982 | + |
---|
4197 | 4983 | const struct wiphy_iftype_akm_suites *iftype_akm_suites; |
---|
4198 | 4984 | unsigned int num_iftype_akm_suites; |
---|
4199 | 4985 | |
---|
.. | .. |
---|
4218 | 5004 | u32 available_antennas_tx; |
---|
4219 | 5005 | u32 available_antennas_rx; |
---|
4220 | 5006 | |
---|
4221 | | - /* |
---|
4222 | | - * Bitmap of supported protocols for probe response offloading |
---|
4223 | | - * see &enum nl80211_probe_resp_offload_support_attr. Only valid |
---|
4224 | | - * when the wiphy flag @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD is set. |
---|
4225 | | - */ |
---|
4226 | 5007 | u32 probe_resp_offload; |
---|
4227 | 5008 | |
---|
4228 | 5009 | const u8 *extended_capabilities, *extended_capabilities_mask; |
---|
.. | .. |
---|
4231 | 5012 | const struct wiphy_iftype_ext_capab *iftype_ext_capab; |
---|
4232 | 5013 | unsigned int num_iftype_ext_capab; |
---|
4233 | 5014 | |
---|
4234 | | - /* If multiple wiphys are registered and you're handed e.g. |
---|
4235 | | - * a regular netdev with assigned ieee80211_ptr, you won't |
---|
4236 | | - * know whether it points to a wiphy your driver has registered |
---|
4237 | | - * or not. Assign this to something global to your driver to |
---|
4238 | | - * help determine whether you own this wiphy or not. */ |
---|
4239 | 5015 | const void *privid; |
---|
4240 | 5016 | |
---|
4241 | 5017 | struct ieee80211_supported_band *bands[NUM_NL80211_BANDS]; |
---|
4242 | 5018 | |
---|
4243 | | - /* Lets us get back the wiphy on the callback */ |
---|
4244 | 5019 | void (*reg_notifier)(struct wiphy *wiphy, |
---|
4245 | 5020 | struct regulatory_request *request); |
---|
4246 | 5021 | |
---|
.. | .. |
---|
4248 | 5023 | |
---|
4249 | 5024 | const struct ieee80211_regdomain __rcu *regd; |
---|
4250 | 5025 | |
---|
4251 | | - /* the item in /sys/class/ieee80211/ points to this, |
---|
4252 | | - * you need use set_wiphy_dev() (see below) */ |
---|
4253 | 5026 | struct device dev; |
---|
4254 | 5027 | |
---|
4255 | | - /* protects ->resume, ->suspend sysfs callbacks against unregister hw */ |
---|
4256 | 5028 | bool registered; |
---|
4257 | 5029 | |
---|
4258 | | - /* dir in debugfs: ieee80211/<wiphyname> */ |
---|
4259 | 5030 | struct dentry *debugfsdir; |
---|
4260 | 5031 | |
---|
4261 | 5032 | const struct ieee80211_ht_cap *ht_capa_mod_mask; |
---|
.. | .. |
---|
4263 | 5034 | |
---|
4264 | 5035 | struct list_head wdev_list; |
---|
4265 | 5036 | |
---|
4266 | | - /* the network namespace this phy lives in currently */ |
---|
4267 | 5037 | possible_net_t _net; |
---|
4268 | 5038 | |
---|
4269 | 5039 | #ifdef CONFIG_CFG80211_WEXT |
---|
.. | .. |
---|
4279 | 5049 | u16 max_ap_assoc_sta; |
---|
4280 | 5050 | |
---|
4281 | 5051 | u8 max_num_csa_counters; |
---|
4282 | | - u8 max_adj_channel_rssi_comp; |
---|
4283 | 5052 | |
---|
4284 | 5053 | u32 bss_select_support; |
---|
4285 | | - |
---|
4286 | | - u64 cookie_counter; |
---|
4287 | 5054 | |
---|
4288 | 5055 | u8 nan_supported_bands; |
---|
4289 | 5056 | |
---|
.. | .. |
---|
4291 | 5058 | u32 txq_memory_limit; |
---|
4292 | 5059 | u32 txq_quantum; |
---|
4293 | 5060 | |
---|
| 5061 | + unsigned long tx_queue_len; |
---|
| 5062 | + |
---|
4294 | 5063 | u8 support_mbssid:1, |
---|
4295 | 5064 | support_only_he_mbssid:1; |
---|
4296 | 5065 | |
---|
4297 | | - char priv[0] __aligned(NETDEV_ALIGN); |
---|
| 5066 | + const struct cfg80211_pmsr_capabilities *pmsr_capa; |
---|
| 5067 | + |
---|
| 5068 | + struct { |
---|
| 5069 | + u64 peer, vif; |
---|
| 5070 | + u8 max_retry; |
---|
| 5071 | + } tid_config_support; |
---|
| 5072 | + |
---|
| 5073 | + u8 max_data_retry_count; |
---|
| 5074 | + |
---|
| 5075 | + ANDROID_KABI_RESERVE(1); |
---|
| 5076 | + |
---|
| 5077 | + char priv[] __aligned(NETDEV_ALIGN); |
---|
4298 | 5078 | }; |
---|
4299 | 5079 | |
---|
4300 | 5080 | static inline struct net *wiphy_net(struct wiphy *wiphy) |
---|
.. | .. |
---|
4463 | 5243 | * @mesh_id_len: (private) Used by the internal configuration code |
---|
4464 | 5244 | * @mesh_id_up_len: (private) Used by the internal configuration code |
---|
4465 | 5245 | * @wext: (private) Used by the internal wireless extensions compat code |
---|
| 5246 | + * @wext.ibss: (private) IBSS data part of wext handling |
---|
| 5247 | + * @wext.connect: (private) connection handling data |
---|
| 5248 | + * @wext.keys: (private) (WEP) key data |
---|
| 5249 | + * @wext.ie: (private) extra elements for association |
---|
| 5250 | + * @wext.ie_len: (private) length of extra elements |
---|
| 5251 | + * @wext.bssid: (private) selected network BSSID |
---|
| 5252 | + * @wext.ssid: (private) selected network SSID |
---|
| 5253 | + * @wext.default_key: (private) selected default key index |
---|
| 5254 | + * @wext.default_mgmt_key: (private) selected default management key index |
---|
| 5255 | + * @wext.prev_bssid: (private) previous BSSID for reassociation |
---|
| 5256 | + * @wext.prev_bssid_valid: (private) previous BSSID validity |
---|
4466 | 5257 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
---|
4467 | 5258 | * set by driver (if supported) on add_interface BEFORE registering the |
---|
4468 | 5259 | * netdev and may otherwise be used by driver read-only, will be update |
---|
4469 | 5260 | * by cfg80211 on change_interface |
---|
4470 | 5261 | * @mgmt_registrations: list of registrations for management frames |
---|
4471 | | - * @mgmt_registrations_lock: lock for the list |
---|
| 5262 | + * @mgmt_registrations_need_update: mgmt registrations were updated, |
---|
| 5263 | + * need to propagate the update to the driver |
---|
4472 | 5264 | * @mtx: mutex used to lock data in this struct, may be used by drivers |
---|
4473 | 5265 | * and some API functions require it held |
---|
4474 | 5266 | * @beacon_interval: beacon interval used on this device for transmitting |
---|
.. | .. |
---|
4496 | 5288 | * @owner_nlportid: (private) owner socket port ID |
---|
4497 | 5289 | * @nl_owner_dead: (private) owner socket went away |
---|
4498 | 5290 | * @cqm_config: (private) nl80211 RSSI monitor state |
---|
| 5291 | + * @pmsr_list: (private) peer measurement requests |
---|
| 5292 | + * @pmsr_lock: (private) peer measurements requests/results lock |
---|
| 5293 | + * @pmsr_free_wk: (private) peer measurements cleanup work |
---|
| 5294 | + * @unprot_beacon_reported: (private) timestamp of last |
---|
| 5295 | + * unprotected beacon report |
---|
4499 | 5296 | */ |
---|
4500 | 5297 | struct wireless_dev { |
---|
4501 | 5298 | struct wiphy *wiphy; |
---|
.. | .. |
---|
4508 | 5305 | u32 identifier; |
---|
4509 | 5306 | |
---|
4510 | 5307 | struct list_head mgmt_registrations; |
---|
| 5308 | + /* |
---|
| 5309 | + * ANDROID: mgmt_registrations_lock was restored to preserve ABI in |
---|
| 5310 | + * 5.10.77 due to backport of 09b1d5dc6ce1 ("cfg80211: fix management |
---|
| 5311 | + * registrations locking") but it is not used for anything so do not |
---|
| 5312 | + * touch this variable! |
---|
| 5313 | + */ |
---|
4511 | 5314 | spinlock_t mgmt_registrations_lock; |
---|
| 5315 | + u8 mgmt_registrations_need_update:1; |
---|
4512 | 5316 | |
---|
4513 | 5317 | struct mutex mtx; |
---|
4514 | 5318 | |
---|
.. | .. |
---|
4559 | 5363 | struct cfg80211_cached_keys *keys; |
---|
4560 | 5364 | const u8 *ie; |
---|
4561 | 5365 | size_t ie_len; |
---|
4562 | | - u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; |
---|
| 5366 | + u8 bssid[ETH_ALEN]; |
---|
| 5367 | + u8 prev_bssid[ETH_ALEN]; |
---|
4563 | 5368 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
---|
4564 | 5369 | s8 default_key, default_mgmt_key; |
---|
4565 | 5370 | bool prev_bssid_valid; |
---|
.. | .. |
---|
4567 | 5372 | #endif |
---|
4568 | 5373 | |
---|
4569 | 5374 | struct cfg80211_cqm_config *cqm_config; |
---|
| 5375 | + |
---|
| 5376 | + struct list_head pmsr_list; |
---|
| 5377 | + spinlock_t pmsr_lock; |
---|
| 5378 | + struct work_struct pmsr_free_wk; |
---|
| 5379 | + |
---|
| 5380 | + unsigned long unprot_beacon_reported; |
---|
| 5381 | + |
---|
| 5382 | + ANDROID_KABI_RESERVE(1); |
---|
| 5383 | + ANDROID_KABI_RESERVE(2); |
---|
4570 | 5384 | }; |
---|
4571 | 5385 | |
---|
4572 | 5386 | static inline u8 *wdev_address(struct wireless_dev *wdev) |
---|
.. | .. |
---|
4602 | 5416 | */ |
---|
4603 | 5417 | |
---|
4604 | 5418 | /** |
---|
| 5419 | + * ieee80211_channel_equal - compare two struct ieee80211_channel |
---|
| 5420 | + * |
---|
| 5421 | + * @a: 1st struct ieee80211_channel |
---|
| 5422 | + * @b: 2nd struct ieee80211_channel |
---|
| 5423 | + * Return: true if center frequency of @a == @b |
---|
| 5424 | + */ |
---|
| 5425 | +static inline bool |
---|
| 5426 | +ieee80211_channel_equal(struct ieee80211_channel *a, |
---|
| 5427 | + struct ieee80211_channel *b) |
---|
| 5428 | +{ |
---|
| 5429 | + return (a->center_freq == b->center_freq && |
---|
| 5430 | + a->freq_offset == b->freq_offset); |
---|
| 5431 | +} |
---|
| 5432 | + |
---|
| 5433 | +/** |
---|
| 5434 | + * ieee80211_channel_to_khz - convert ieee80211_channel to frequency in KHz |
---|
| 5435 | + * @chan: struct ieee80211_channel to convert |
---|
| 5436 | + * Return: The corresponding frequency (in KHz) |
---|
| 5437 | + */ |
---|
| 5438 | +static inline u32 |
---|
| 5439 | +ieee80211_channel_to_khz(const struct ieee80211_channel *chan) |
---|
| 5440 | +{ |
---|
| 5441 | + return MHZ_TO_KHZ(chan->center_freq) + chan->freq_offset; |
---|
| 5442 | +} |
---|
| 5443 | + |
---|
| 5444 | +/** |
---|
| 5445 | + * ieee80211_s1g_channel_width - get allowed channel width from @chan |
---|
| 5446 | + * |
---|
| 5447 | + * Only allowed for band NL80211_BAND_S1GHZ |
---|
| 5448 | + * @chan: channel |
---|
| 5449 | + * Return: The allowed channel width for this center_freq |
---|
| 5450 | + */ |
---|
| 5451 | +enum nl80211_chan_width |
---|
| 5452 | +ieee80211_s1g_channel_width(const struct ieee80211_channel *chan); |
---|
| 5453 | + |
---|
| 5454 | +/** |
---|
| 5455 | + * ieee80211_channel_to_freq_khz - convert channel number to frequency |
---|
| 5456 | + * @chan: channel number |
---|
| 5457 | + * @band: band, necessary due to channel number overlap |
---|
| 5458 | + * Return: The corresponding frequency (in KHz), or 0 if the conversion failed. |
---|
| 5459 | + */ |
---|
| 5460 | +u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band); |
---|
| 5461 | + |
---|
| 5462 | +/** |
---|
4605 | 5463 | * ieee80211_channel_to_frequency - convert channel number to frequency |
---|
4606 | 5464 | * @chan: channel number |
---|
4607 | 5465 | * @band: band, necessary due to channel number overlap |
---|
4608 | 5466 | * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. |
---|
4609 | 5467 | */ |
---|
4610 | | -int ieee80211_channel_to_frequency(int chan, enum nl80211_band band); |
---|
| 5468 | +static inline int |
---|
| 5469 | +ieee80211_channel_to_frequency(int chan, enum nl80211_band band) |
---|
| 5470 | +{ |
---|
| 5471 | + return KHZ_TO_MHZ(ieee80211_channel_to_freq_khz(chan, band)); |
---|
| 5472 | +} |
---|
| 5473 | + |
---|
| 5474 | +/** |
---|
| 5475 | + * ieee80211_freq_khz_to_channel - convert frequency to channel number |
---|
| 5476 | + * @freq: center frequency in KHz |
---|
| 5477 | + * Return: The corresponding channel, or 0 if the conversion failed. |
---|
| 5478 | + */ |
---|
| 5479 | +int ieee80211_freq_khz_to_channel(u32 freq); |
---|
4611 | 5480 | |
---|
4612 | 5481 | /** |
---|
4613 | 5482 | * ieee80211_frequency_to_channel - convert frequency to channel number |
---|
4614 | | - * @freq: center frequency |
---|
| 5483 | + * @freq: center frequency in MHz |
---|
4615 | 5484 | * Return: The corresponding channel, or 0 if the conversion failed. |
---|
4616 | 5485 | */ |
---|
4617 | | -int ieee80211_frequency_to_channel(int freq); |
---|
| 5486 | +static inline int |
---|
| 5487 | +ieee80211_frequency_to_channel(int freq) |
---|
| 5488 | +{ |
---|
| 5489 | + return ieee80211_freq_khz_to_channel(MHZ_TO_KHZ(freq)); |
---|
| 5490 | +} |
---|
| 5491 | + |
---|
| 5492 | +/** |
---|
| 5493 | + * ieee80211_get_channel_khz - get channel struct from wiphy for specified |
---|
| 5494 | + * frequency |
---|
| 5495 | + * @wiphy: the struct wiphy to get the channel for |
---|
| 5496 | + * @freq: the center frequency (in KHz) of the channel |
---|
| 5497 | + * Return: The channel struct from @wiphy at @freq. |
---|
| 5498 | + */ |
---|
| 5499 | +struct ieee80211_channel * |
---|
| 5500 | +ieee80211_get_channel_khz(struct wiphy *wiphy, u32 freq); |
---|
4618 | 5501 | |
---|
4619 | 5502 | /** |
---|
4620 | 5503 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
---|
4621 | 5504 | * |
---|
4622 | 5505 | * @wiphy: the struct wiphy to get the channel for |
---|
4623 | | - * @freq: the center frequency of the channel |
---|
4624 | | - * |
---|
| 5506 | + * @freq: the center frequency (in MHz) of the channel |
---|
4625 | 5507 | * Return: The channel struct from @wiphy at @freq. |
---|
4626 | 5508 | */ |
---|
4627 | | -struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, int freq); |
---|
| 5509 | +static inline struct ieee80211_channel * |
---|
| 5510 | +ieee80211_get_channel(struct wiphy *wiphy, int freq) |
---|
| 5511 | +{ |
---|
| 5512 | + return ieee80211_get_channel_khz(wiphy, MHZ_TO_KHZ(freq)); |
---|
| 5513 | +} |
---|
| 5514 | + |
---|
| 5515 | +/** |
---|
| 5516 | + * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC |
---|
| 5517 | + * @chan: control channel to check |
---|
| 5518 | + * |
---|
| 5519 | + * The Preferred Scanning Channels (PSC) are defined in |
---|
| 5520 | + * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3 |
---|
| 5521 | + */ |
---|
| 5522 | +static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan) |
---|
| 5523 | +{ |
---|
| 5524 | + if (chan->band != NL80211_BAND_6GHZ) |
---|
| 5525 | + return false; |
---|
| 5526 | + |
---|
| 5527 | + return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5; |
---|
| 5528 | +} |
---|
4628 | 5529 | |
---|
4629 | 5530 | /** |
---|
4630 | 5531 | * ieee80211_get_response_rate - get basic rate for a given rate |
---|
.. | .. |
---|
4657 | 5558 | * Radiotap parsing functions -- for controlled injection support |
---|
4658 | 5559 | * |
---|
4659 | 5560 | * Implemented in net/wireless/radiotap.c |
---|
4660 | | - * Documentation in Documentation/networking/radiotap-headers.txt |
---|
| 5561 | + * Documentation in Documentation/networking/radiotap-headers.rst |
---|
4661 | 5562 | */ |
---|
4662 | 5563 | |
---|
4663 | 5564 | struct radiotap_align_size { |
---|
.. | .. |
---|
4812 | 5713 | * |
---|
4813 | 5714 | * @skb: The input A-MSDU frame without any headers. |
---|
4814 | 5715 | * @list: The output list of 802.3 frames. It must be allocated and |
---|
4815 | | - * initialized by by the caller. |
---|
| 5716 | + * initialized by the caller. |
---|
4816 | 5717 | * @addr: The device MAC address. |
---|
4817 | 5718 | * @iftype: The device interface type. |
---|
4818 | 5719 | * @extra_headroom: The hardware extra headroom for SKBs in the @list. |
---|
.. | .. |
---|
4832 | 5733 | */ |
---|
4833 | 5734 | unsigned int cfg80211_classify8021d(struct sk_buff *skb, |
---|
4834 | 5735 | struct cfg80211_qos_map *qos_map); |
---|
| 5736 | + |
---|
| 5737 | +/** |
---|
| 5738 | + * cfg80211_find_elem_match - match information element and byte array in data |
---|
| 5739 | + * |
---|
| 5740 | + * @eid: element ID |
---|
| 5741 | + * @ies: data consisting of IEs |
---|
| 5742 | + * @len: length of data |
---|
| 5743 | + * @match: byte array to match |
---|
| 5744 | + * @match_len: number of bytes in the match array |
---|
| 5745 | + * @match_offset: offset in the IE data where the byte array should match. |
---|
| 5746 | + * Note the difference to cfg80211_find_ie_match() which considers |
---|
| 5747 | + * the offset to start from the element ID byte, but here we take |
---|
| 5748 | + * the data portion instead. |
---|
| 5749 | + * |
---|
| 5750 | + * Return: %NULL if the element ID could not be found or if |
---|
| 5751 | + * the element is invalid (claims to be longer than the given |
---|
| 5752 | + * data) or if the byte array doesn't match; otherwise return the |
---|
| 5753 | + * requested element struct. |
---|
| 5754 | + * |
---|
| 5755 | + * Note: There are no checks on the element length other than |
---|
| 5756 | + * having to fit into the given data and being large enough for the |
---|
| 5757 | + * byte array to match. |
---|
| 5758 | + */ |
---|
| 5759 | +const struct element * |
---|
| 5760 | +cfg80211_find_elem_match(u8 eid, const u8 *ies, unsigned int len, |
---|
| 5761 | + const u8 *match, unsigned int match_len, |
---|
| 5762 | + unsigned int match_offset); |
---|
4835 | 5763 | |
---|
4836 | 5764 | /** |
---|
4837 | 5765 | * cfg80211_find_ie_match - match information element and byte array in data |
---|
.. | .. |
---|
4857 | 5785 | * having to fit into the given data and being large enough for the |
---|
4858 | 5786 | * byte array to match. |
---|
4859 | 5787 | */ |
---|
4860 | | -const u8 *cfg80211_find_ie_match(u8 eid, const u8 *ies, int len, |
---|
4861 | | - const u8 *match, int match_len, |
---|
4862 | | - int match_offset); |
---|
| 5788 | +static inline const u8 * |
---|
| 5789 | +cfg80211_find_ie_match(u8 eid, const u8 *ies, unsigned int len, |
---|
| 5790 | + const u8 *match, unsigned int match_len, |
---|
| 5791 | + unsigned int match_offset) |
---|
| 5792 | +{ |
---|
| 5793 | + /* match_offset can't be smaller than 2, unless match_len is |
---|
| 5794 | + * zero, in which case match_offset must be zero as well. |
---|
| 5795 | + */ |
---|
| 5796 | + if (WARN_ON((match_len && match_offset < 2) || |
---|
| 5797 | + (!match_len && match_offset))) |
---|
| 5798 | + return NULL; |
---|
| 5799 | + |
---|
| 5800 | + return (void *)cfg80211_find_elem_match(eid, ies, len, |
---|
| 5801 | + match, match_len, |
---|
| 5802 | + match_offset ? |
---|
| 5803 | + match_offset - 2 : 0); |
---|
| 5804 | +} |
---|
| 5805 | + |
---|
| 5806 | +/** |
---|
| 5807 | + * cfg80211_find_elem - find information element in data |
---|
| 5808 | + * |
---|
| 5809 | + * @eid: element ID |
---|
| 5810 | + * @ies: data consisting of IEs |
---|
| 5811 | + * @len: length of data |
---|
| 5812 | + * |
---|
| 5813 | + * Return: %NULL if the element ID could not be found or if |
---|
| 5814 | + * the element is invalid (claims to be longer than the given |
---|
| 5815 | + * data) or if the byte array doesn't match; otherwise return the |
---|
| 5816 | + * requested element struct. |
---|
| 5817 | + * |
---|
| 5818 | + * Note: There are no checks on the element length other than |
---|
| 5819 | + * having to fit into the given data. |
---|
| 5820 | + */ |
---|
| 5821 | +static inline const struct element * |
---|
| 5822 | +cfg80211_find_elem(u8 eid, const u8 *ies, int len) |
---|
| 5823 | +{ |
---|
| 5824 | + return cfg80211_find_elem_match(eid, ies, len, NULL, 0, 0); |
---|
| 5825 | +} |
---|
4863 | 5826 | |
---|
4864 | 5827 | /** |
---|
4865 | 5828 | * cfg80211_find_ie - find information element in data |
---|
.. | .. |
---|
4879 | 5842 | static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len) |
---|
4880 | 5843 | { |
---|
4881 | 5844 | return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0); |
---|
| 5845 | +} |
---|
| 5846 | + |
---|
| 5847 | +/** |
---|
| 5848 | + * cfg80211_find_ext_elem - find information element with EID Extension in data |
---|
| 5849 | + * |
---|
| 5850 | + * @ext_eid: element ID Extension |
---|
| 5851 | + * @ies: data consisting of IEs |
---|
| 5852 | + * @len: length of data |
---|
| 5853 | + * |
---|
| 5854 | + * Return: %NULL if the etended element could not be found or if |
---|
| 5855 | + * the element is invalid (claims to be longer than the given |
---|
| 5856 | + * data) or if the byte array doesn't match; otherwise return the |
---|
| 5857 | + * requested element struct. |
---|
| 5858 | + * |
---|
| 5859 | + * Note: There are no checks on the element length other than |
---|
| 5860 | + * having to fit into the given data. |
---|
| 5861 | + */ |
---|
| 5862 | +static inline const struct element * |
---|
| 5863 | +cfg80211_find_ext_elem(u8 ext_eid, const u8 *ies, int len) |
---|
| 5864 | +{ |
---|
| 5865 | + return cfg80211_find_elem_match(WLAN_EID_EXTENSION, ies, len, |
---|
| 5866 | + &ext_eid, 1, 0); |
---|
4882 | 5867 | } |
---|
4883 | 5868 | |
---|
4884 | 5869 | /** |
---|
.. | .. |
---|
4903 | 5888 | } |
---|
4904 | 5889 | |
---|
4905 | 5890 | /** |
---|
| 5891 | + * cfg80211_find_vendor_elem - find vendor specific information element in data |
---|
| 5892 | + * |
---|
| 5893 | + * @oui: vendor OUI |
---|
| 5894 | + * @oui_type: vendor-specific OUI type (must be < 0xff), negative means any |
---|
| 5895 | + * @ies: data consisting of IEs |
---|
| 5896 | + * @len: length of data |
---|
| 5897 | + * |
---|
| 5898 | + * Return: %NULL if the vendor specific element ID could not be found or if the |
---|
| 5899 | + * element is invalid (claims to be longer than the given data); otherwise |
---|
| 5900 | + * return the element structure for the requested element. |
---|
| 5901 | + * |
---|
| 5902 | + * Note: There are no checks on the element length other than having to fit into |
---|
| 5903 | + * the given data. |
---|
| 5904 | + */ |
---|
| 5905 | +const struct element *cfg80211_find_vendor_elem(unsigned int oui, int oui_type, |
---|
| 5906 | + const u8 *ies, |
---|
| 5907 | + unsigned int len); |
---|
| 5908 | + |
---|
| 5909 | +/** |
---|
4906 | 5910 | * cfg80211_find_vendor_ie - find vendor specific information element in data |
---|
4907 | 5911 | * |
---|
4908 | 5912 | * @oui: vendor OUI |
---|
.. | .. |
---|
4918 | 5922 | * Note: There are no checks on the element length other than having to fit into |
---|
4919 | 5923 | * the given data. |
---|
4920 | 5924 | */ |
---|
4921 | | -const u8 *cfg80211_find_vendor_ie(unsigned int oui, int oui_type, |
---|
4922 | | - const u8 *ies, int len); |
---|
| 5925 | +static inline const u8 * |
---|
| 5926 | +cfg80211_find_vendor_ie(unsigned int oui, int oui_type, |
---|
| 5927 | + const u8 *ies, unsigned int len) |
---|
| 5928 | +{ |
---|
| 5929 | + return (void *)cfg80211_find_vendor_elem(oui, oui_type, ies, len); |
---|
| 5930 | +} |
---|
4923 | 5931 | |
---|
4924 | 5932 | /** |
---|
4925 | 5933 | * cfg80211_send_layer2_update - send layer 2 update frame |
---|
.. | .. |
---|
4943 | 5951 | * @wiphy: the wireless device giving the hint (used only for reporting |
---|
4944 | 5952 | * conflicts) |
---|
4945 | 5953 | * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain |
---|
4946 | | - * should be in. If @rd is set this should be NULL. Note that if you |
---|
4947 | | - * set this to NULL you should still set rd->alpha2 to some accepted |
---|
4948 | | - * alpha2. |
---|
| 5954 | + * should be in. If @rd is set this should be NULL. Note that if you |
---|
| 5955 | + * set this to NULL you should still set rd->alpha2 to some accepted |
---|
| 5956 | + * alpha2. |
---|
4949 | 5957 | * |
---|
4950 | 5958 | * Wireless drivers can use this function to hint to the wireless core |
---|
4951 | 5959 | * what it believes should be the current regulatory domain by |
---|
.. | .. |
---|
5040 | 6048 | * proper string representation. |
---|
5041 | 6049 | */ |
---|
5042 | 6050 | const char *reg_initiator_name(enum nl80211_reg_initiator initiator); |
---|
| 6051 | + |
---|
| 6052 | +/** |
---|
| 6053 | + * regulatory_pre_cac_allowed - check if pre-CAC allowed in the current regdom |
---|
| 6054 | + * @wiphy: wiphy for which pre-CAC capability is checked. |
---|
| 6055 | + * |
---|
| 6056 | + * Pre-CAC is allowed only in some regdomains (notable ETSI). |
---|
| 6057 | + */ |
---|
| 6058 | +bool regulatory_pre_cac_allowed(struct wiphy *wiphy); |
---|
5043 | 6059 | |
---|
5044 | 6060 | /** |
---|
5045 | 6061 | * DOC: Internal regulatory db functions |
---|
.. | .. |
---|
5186 | 6202 | } |
---|
5187 | 6203 | |
---|
5188 | 6204 | /** |
---|
| 6205 | + * cfg80211_is_element_inherited - returns if element ID should be inherited |
---|
| 6206 | + * @element: element to check |
---|
| 6207 | + * @non_inherit_element: non inheritance element |
---|
| 6208 | + */ |
---|
| 6209 | +bool cfg80211_is_element_inherited(const struct element *element, |
---|
| 6210 | + const struct element *non_inherit_element); |
---|
| 6211 | + |
---|
| 6212 | +/** |
---|
| 6213 | + * cfg80211_merge_profile - merges a MBSSID profile if it is split between IEs |
---|
| 6214 | + * @ie: ies |
---|
| 6215 | + * @ielen: length of IEs |
---|
| 6216 | + * @mbssid_elem: current MBSSID element |
---|
| 6217 | + * @sub_elem: current MBSSID subelement (profile) |
---|
| 6218 | + * @merged_ie: location of the merged profile |
---|
| 6219 | + * @max_copy_len: max merged profile length |
---|
| 6220 | + */ |
---|
| 6221 | +size_t cfg80211_merge_profile(const u8 *ie, size_t ielen, |
---|
| 6222 | + const struct element *mbssid_elem, |
---|
| 6223 | + const struct element *sub_elem, |
---|
| 6224 | + u8 *merged_ie, size_t max_copy_len); |
---|
| 6225 | + |
---|
| 6226 | +/** |
---|
5189 | 6227 | * enum cfg80211_bss_frame_type - frame type that the BSS data came from |
---|
5190 | 6228 | * @CFG80211_BSS_FTYPE_UNKNOWN: driver doesn't know whether the data is |
---|
5191 | 6229 | * from a beacon or probe response |
---|
.. | .. |
---|
5321 | 6359 | */ |
---|
5322 | 6360 | void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); |
---|
5323 | 6361 | |
---|
| 6362 | +/** |
---|
| 6363 | + * cfg80211_bss_iter - iterate all BSS entries |
---|
| 6364 | + * |
---|
| 6365 | + * This function iterates over the BSS entries associated with the given wiphy |
---|
| 6366 | + * and calls the callback for the iterated BSS. The iterator function is not |
---|
| 6367 | + * allowed to call functions that might modify the internal state of the BSS DB. |
---|
| 6368 | + * |
---|
| 6369 | + * @wiphy: the wiphy |
---|
| 6370 | + * @chandef: if given, the iterator function will be called only if the channel |
---|
| 6371 | + * of the currently iterated BSS is a subset of the given channel. |
---|
| 6372 | + * @iter: the iterator function to call |
---|
| 6373 | + * @iter_data: an argument to the iterator function |
---|
| 6374 | + */ |
---|
| 6375 | +void cfg80211_bss_iter(struct wiphy *wiphy, |
---|
| 6376 | + struct cfg80211_chan_def *chandef, |
---|
| 6377 | + void (*iter)(struct wiphy *wiphy, |
---|
| 6378 | + struct cfg80211_bss *bss, |
---|
| 6379 | + void *data), |
---|
| 6380 | + void *iter_data); |
---|
| 6381 | + |
---|
5324 | 6382 | static inline enum nl80211_bss_scan_width |
---|
5325 | 6383 | cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef) |
---|
5326 | 6384 | { |
---|
.. | .. |
---|
5370 | 6428 | * @dev: network device |
---|
5371 | 6429 | * @bss: the BSS that association was requested with, ownership of the pointer |
---|
5372 | 6430 | * moves to cfg80211 in this call |
---|
5373 | | - * @buf: authentication frame (header + body) |
---|
| 6431 | + * @buf: (Re)Association Response frame (header + body) |
---|
5374 | 6432 | * @len: length of the frame data |
---|
5375 | 6433 | * @uapsd_queues: bitmap of queues configured for uapsd. Same format |
---|
5376 | 6434 | * as the AC bitmap in the QoS info field |
---|
| 6435 | + * @req_ies: information elements from the (Re)Association Request frame |
---|
| 6436 | + * @req_ies_len: length of req_ies data |
---|
5377 | 6437 | * |
---|
5378 | 6438 | * After being asked to associate via cfg80211_ops::assoc() the driver must |
---|
5379 | 6439 | * call either this function or cfg80211_auth_timeout(). |
---|
.. | .. |
---|
5383 | 6443 | void cfg80211_rx_assoc_resp(struct net_device *dev, |
---|
5384 | 6444 | struct cfg80211_bss *bss, |
---|
5385 | 6445 | const u8 *buf, size_t len, |
---|
5386 | | - int uapsd_queues); |
---|
| 6446 | + int uapsd_queues, |
---|
| 6447 | + const u8 *req_ies, size_t req_ies_len); |
---|
5387 | 6448 | |
---|
5388 | 6449 | /** |
---|
5389 | 6450 | * cfg80211_assoc_timeout - notification of timed out association |
---|
.. | .. |
---|
5421 | 6482 | /** |
---|
5422 | 6483 | * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame |
---|
5423 | 6484 | * @dev: network device |
---|
5424 | | - * @buf: deauthentication frame (header + body) |
---|
| 6485 | + * @buf: received management frame (header + body) |
---|
5425 | 6486 | * @len: length of the frame data |
---|
5426 | 6487 | * |
---|
5427 | 6488 | * This function is called whenever a received deauthentication or dissassoc |
---|
5428 | 6489 | * frame has been dropped in station mode because of MFP being used but the |
---|
5429 | | - * frame was not protected. This function may sleep. |
---|
| 6490 | + * frame was not protected. This is also used to notify reception of a Beacon |
---|
| 6491 | + * frame that was dropped because it did not include a valid MME MIC while |
---|
| 6492 | + * beacon protection was enabled (BIGTK configured in station mode). |
---|
| 6493 | + * |
---|
| 6494 | + * This function may sleep. |
---|
5430 | 6495 | */ |
---|
5431 | 6496 | void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev, |
---|
5432 | 6497 | const u8 *buf, size_t len); |
---|
.. | .. |
---|
5467 | 6532 | struct ieee80211_channel *channel, gfp_t gfp); |
---|
5468 | 6533 | |
---|
5469 | 6534 | /** |
---|
5470 | | - * cfg80211_notify_new_candidate - notify cfg80211 of a new mesh peer candidate |
---|
| 6535 | + * cfg80211_notify_new_peer_candidate - notify cfg80211 of a new mesh peer |
---|
| 6536 | + * candidate |
---|
5471 | 6537 | * |
---|
5472 | 6538 | * @dev: network device |
---|
5473 | 6539 | * @macaddr: the MAC address of the new candidate |
---|
5474 | 6540 | * @ie: information elements advertised by the peer candidate |
---|
5475 | | - * @ie_len: lenght of the information elements buffer |
---|
| 6541 | + * @ie_len: length of the information elements buffer |
---|
5476 | 6542 | * @gfp: allocation flags |
---|
5477 | 6543 | * |
---|
5478 | 6544 | * This function notifies cfg80211 that the mesh peer candidate has been |
---|
.. | .. |
---|
5480 | 6546 | * cfg80211 then sends a notification to userspace. |
---|
5481 | 6547 | */ |
---|
5482 | 6548 | void cfg80211_notify_new_peer_candidate(struct net_device *dev, |
---|
5483 | | - const u8 *macaddr, const u8 *ie, u8 ie_len, gfp_t gfp); |
---|
| 6549 | + const u8 *macaddr, const u8 *ie, u8 ie_len, |
---|
| 6550 | + int sig_dbm, gfp_t gfp); |
---|
5484 | 6551 | |
---|
5485 | 6552 | /** |
---|
5486 | 6553 | * DOC: RFkill integration |
---|
.. | .. |
---|
5544 | 6611 | struct wireless_dev *wdev, |
---|
5545 | 6612 | enum nl80211_commands cmd, |
---|
5546 | 6613 | enum nl80211_attrs attr, |
---|
| 6614 | + unsigned int portid, |
---|
5547 | 6615 | int vendor_event_idx, |
---|
5548 | 6616 | int approxlen, gfp_t gfp); |
---|
5549 | 6617 | |
---|
.. | .. |
---|
5594 | 6662 | int cfg80211_vendor_cmd_reply(struct sk_buff *skb); |
---|
5595 | 6663 | |
---|
5596 | 6664 | /** |
---|
| 6665 | + * cfg80211_vendor_cmd_get_sender |
---|
| 6666 | + * @wiphy: the wiphy |
---|
| 6667 | + * |
---|
| 6668 | + * Return the current netlink port ID in a vendor command handler. |
---|
| 6669 | + * Valid to call only there. |
---|
| 6670 | + */ |
---|
| 6671 | +unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy); |
---|
| 6672 | + |
---|
| 6673 | +/** |
---|
5597 | 6674 | * cfg80211_vendor_event_alloc - allocate vendor-specific event skb |
---|
5598 | 6675 | * @wiphy: the wiphy |
---|
5599 | 6676 | * @wdev: the wireless device |
---|
.. | .. |
---|
5620 | 6697 | { |
---|
5621 | 6698 | return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR, |
---|
5622 | 6699 | NL80211_ATTR_VENDOR_DATA, |
---|
5623 | | - event_idx, approxlen, gfp); |
---|
| 6700 | + 0, event_idx, approxlen, gfp); |
---|
| 6701 | +} |
---|
| 6702 | + |
---|
| 6703 | +/** |
---|
| 6704 | + * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb |
---|
| 6705 | + * @wiphy: the wiphy |
---|
| 6706 | + * @wdev: the wireless device |
---|
| 6707 | + * @event_idx: index of the vendor event in the wiphy's vendor_events |
---|
| 6708 | + * @portid: port ID of the receiver |
---|
| 6709 | + * @approxlen: an upper bound of the length of the data that will |
---|
| 6710 | + * be put into the skb |
---|
| 6711 | + * @gfp: allocation flags |
---|
| 6712 | + * |
---|
| 6713 | + * This function allocates and pre-fills an skb for an event to send to |
---|
| 6714 | + * a specific (userland) socket. This socket would previously have been |
---|
| 6715 | + * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take |
---|
| 6716 | + * care to register a netlink notifier to see when the socket closes. |
---|
| 6717 | + * |
---|
| 6718 | + * If wdev != NULL, both the ifindex and identifier of the specified |
---|
| 6719 | + * wireless device are added to the event message before the vendor data |
---|
| 6720 | + * attribute. |
---|
| 6721 | + * |
---|
| 6722 | + * When done filling the skb, call cfg80211_vendor_event() with the |
---|
| 6723 | + * skb to send the event. |
---|
| 6724 | + * |
---|
| 6725 | + * Return: An allocated and pre-filled skb. %NULL if any errors happen. |
---|
| 6726 | + */ |
---|
| 6727 | +static inline struct sk_buff * |
---|
| 6728 | +cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy, |
---|
| 6729 | + struct wireless_dev *wdev, |
---|
| 6730 | + unsigned int portid, int approxlen, |
---|
| 6731 | + int event_idx, gfp_t gfp) |
---|
| 6732 | +{ |
---|
| 6733 | + return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR, |
---|
| 6734 | + NL80211_ATTR_VENDOR_DATA, |
---|
| 6735 | + portid, event_idx, approxlen, gfp); |
---|
5624 | 6736 | } |
---|
5625 | 6737 | |
---|
5626 | 6738 | /** |
---|
.. | .. |
---|
5720 | 6832 | cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp) |
---|
5721 | 6833 | { |
---|
5722 | 6834 | return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE, |
---|
5723 | | - NL80211_ATTR_TESTDATA, -1, |
---|
| 6835 | + NL80211_ATTR_TESTDATA, 0, -1, |
---|
5724 | 6836 | approxlen, gfp); |
---|
5725 | 6837 | } |
---|
5726 | 6838 | |
---|
.. | .. |
---|
5782 | 6894 | * case. |
---|
5783 | 6895 | * @bssid: The BSSID of the AP (may be %NULL) |
---|
5784 | 6896 | * @bss: Entry of bss to which STA got connected to, can be obtained through |
---|
5785 | | - * cfg80211_get_bss() (may be %NULL). Only one parameter among @bssid and |
---|
5786 | | - * @bss needs to be specified. |
---|
| 6897 | + * cfg80211_get_bss() (may be %NULL). But it is recommended to store the |
---|
| 6898 | + * bss from the connect_request and hold a reference to it and return |
---|
| 6899 | + * through this param to avoid a warning if the bss is expired during the |
---|
| 6900 | + * connection, esp. for those drivers implementing connect op. |
---|
| 6901 | + * Only one parameter among @bssid and @bss needs to be specified. |
---|
5787 | 6902 | * @req_ie: Association request IEs (may be %NULL) |
---|
5788 | 6903 | * @req_ie_len: Association request IEs length |
---|
5789 | 6904 | * @resp_ie: Association response IEs (may be %NULL) |
---|
.. | .. |
---|
5831 | 6946 | * |
---|
5832 | 6947 | * @dev: network device |
---|
5833 | 6948 | * @bssid: the BSSID of the AP |
---|
5834 | | - * @bss: entry of bss to which STA got connected to, can be obtained |
---|
5835 | | - * through cfg80211_get_bss (may be %NULL) |
---|
| 6949 | + * @bss: Entry of bss to which STA got connected to, can be obtained through |
---|
| 6950 | + * cfg80211_get_bss() (may be %NULL). But it is recommended to store the |
---|
| 6951 | + * bss from the connect_request and hold a reference to it and return |
---|
| 6952 | + * through this param to avoid a warning if the bss is expired during the |
---|
| 6953 | + * connection, esp. for those drivers implementing connect op. |
---|
| 6954 | + * Only one parameter among @bssid and @bss needs to be specified. |
---|
5836 | 6955 | * @req_ie: association request IEs (maybe be %NULL) |
---|
5837 | 6956 | * @req_ie_len: association request IEs length |
---|
5838 | 6957 | * @resp_ie: association response IEs (may be %NULL) |
---|
.. | .. |
---|
5979 | 7098 | * time it is accessed in __cfg80211_roamed() due to delay in scheduling |
---|
5980 | 7099 | * rdev->event_work. In case of any failures, the reference is released |
---|
5981 | 7100 | * either in cfg80211_roamed() or in __cfg80211_romed(), Otherwise, it will be |
---|
5982 | | - * released while diconneting from the current bss. |
---|
| 7101 | + * released while disconnecting from the current bss. |
---|
5983 | 7102 | */ |
---|
5984 | 7103 | void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info, |
---|
5985 | 7104 | gfp_t gfp); |
---|
.. | .. |
---|
6041 | 7160 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
---|
6042 | 7161 | struct ieee80211_channel *chan, |
---|
6043 | 7162 | gfp_t gfp); |
---|
| 7163 | + |
---|
| 7164 | +/** |
---|
| 7165 | + * cfg80211_tx_mgmt_expired - tx_mgmt duration expired |
---|
| 7166 | + * @wdev: wireless device |
---|
| 7167 | + * @cookie: the requested cookie |
---|
| 7168 | + * @chan: The current channel (from tx_mgmt request) |
---|
| 7169 | + * @gfp: allocation flags |
---|
| 7170 | + */ |
---|
| 7171 | +void cfg80211_tx_mgmt_expired(struct wireless_dev *wdev, u64 cookie, |
---|
| 7172 | + struct ieee80211_channel *chan, gfp_t gfp); |
---|
6044 | 7173 | |
---|
6045 | 7174 | /** |
---|
6046 | 7175 | * cfg80211_sinfo_alloc_tid_stats - allocate per-tid statistics. |
---|
.. | .. |
---|
6117 | 7246 | gfp_t gfp); |
---|
6118 | 7247 | |
---|
6119 | 7248 | /** |
---|
| 7249 | + * cfg80211_rx_mgmt_khz - notification of received, unprocessed management frame |
---|
| 7250 | + * @wdev: wireless device receiving the frame |
---|
| 7251 | + * @freq: Frequency on which the frame was received in KHz |
---|
| 7252 | + * @sig_dbm: signal strength in dBm, or 0 if unknown |
---|
| 7253 | + * @buf: Management frame (header + body) |
---|
| 7254 | + * @len: length of the frame data |
---|
| 7255 | + * @flags: flags, as defined in enum nl80211_rxmgmt_flags |
---|
| 7256 | + * |
---|
| 7257 | + * This function is called whenever an Action frame is received for a station |
---|
| 7258 | + * mode interface, but is not processed in kernel. |
---|
| 7259 | + * |
---|
| 7260 | + * Return: %true if a user space application has registered for this frame. |
---|
| 7261 | + * For action frames, that makes it responsible for rejecting unrecognized |
---|
| 7262 | + * action frames; %false otherwise, in which case for action frames the |
---|
| 7263 | + * driver is responsible for rejecting the frame. |
---|
| 7264 | + */ |
---|
| 7265 | +bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm, |
---|
| 7266 | + const u8 *buf, size_t len, u32 flags); |
---|
| 7267 | + |
---|
| 7268 | +/** |
---|
6120 | 7269 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
---|
6121 | 7270 | * @wdev: wireless device receiving the frame |
---|
6122 | 7271 | * @freq: Frequency on which the frame was received in MHz |
---|
.. | .. |
---|
6133 | 7282 | * action frames; %false otherwise, in which case for action frames the |
---|
6134 | 7283 | * driver is responsible for rejecting the frame. |
---|
6135 | 7284 | */ |
---|
6136 | | -bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
---|
6137 | | - const u8 *buf, size_t len, u32 flags); |
---|
| 7285 | +static inline bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, |
---|
| 7286 | + int sig_dbm, const u8 *buf, size_t len, |
---|
| 7287 | + u32 flags) |
---|
| 7288 | +{ |
---|
| 7289 | + return cfg80211_rx_mgmt_khz(wdev, MHZ_TO_KHZ(freq), sig_dbm, buf, len, |
---|
| 7290 | + flags); |
---|
| 7291 | +} |
---|
6138 | 7292 | |
---|
6139 | 7293 | /** |
---|
6140 | 7294 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
---|
.. | .. |
---|
6152 | 7306 | void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, |
---|
6153 | 7307 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
---|
6154 | 7308 | |
---|
| 7309 | +/** |
---|
| 7310 | + * cfg80211_control_port_tx_status - notification of TX status for control |
---|
| 7311 | + * port frames |
---|
| 7312 | + * @wdev: wireless device receiving the frame |
---|
| 7313 | + * @cookie: Cookie returned by cfg80211_ops::tx_control_port() |
---|
| 7314 | + * @buf: Data frame (header + body) |
---|
| 7315 | + * @len: length of the frame data |
---|
| 7316 | + * @ack: Whether frame was acknowledged |
---|
| 7317 | + * @gfp: context flags |
---|
| 7318 | + * |
---|
| 7319 | + * This function is called whenever a control port frame was requested to be |
---|
| 7320 | + * transmitted with cfg80211_ops::tx_control_port() to report the TX status of |
---|
| 7321 | + * the transmission attempt. |
---|
| 7322 | + */ |
---|
| 7323 | +void cfg80211_control_port_tx_status(struct wireless_dev *wdev, u64 cookie, |
---|
| 7324 | + const u8 *buf, size_t len, bool ack, |
---|
| 7325 | + gfp_t gfp); |
---|
6155 | 7326 | |
---|
6156 | 7327 | /** |
---|
6157 | 7328 | * cfg80211_rx_control_port - notification about a received control port frame |
---|
.. | .. |
---|
6333 | 7504 | bool is_valid_ack_signal, gfp_t gfp); |
---|
6334 | 7505 | |
---|
6335 | 7506 | /** |
---|
| 7507 | + * cfg80211_report_obss_beacon_khz - report beacon from other APs |
---|
| 7508 | + * @wiphy: The wiphy that received the beacon |
---|
| 7509 | + * @frame: the frame |
---|
| 7510 | + * @len: length of the frame |
---|
| 7511 | + * @freq: frequency the frame was received on in KHz |
---|
| 7512 | + * @sig_dbm: signal strength in dBm, or 0 if unknown |
---|
| 7513 | + * |
---|
| 7514 | + * Use this function to report to userspace when a beacon was |
---|
| 7515 | + * received. It is not useful to call this when there is no |
---|
| 7516 | + * netdev that is in AP/GO mode. |
---|
| 7517 | + */ |
---|
| 7518 | +void cfg80211_report_obss_beacon_khz(struct wiphy *wiphy, const u8 *frame, |
---|
| 7519 | + size_t len, int freq, int sig_dbm); |
---|
| 7520 | + |
---|
| 7521 | +/** |
---|
6336 | 7522 | * cfg80211_report_obss_beacon - report beacon from other APs |
---|
6337 | 7523 | * @wiphy: The wiphy that received the beacon |
---|
6338 | 7524 | * @frame: the frame |
---|
.. | .. |
---|
6344 | 7530 | * received. It is not useful to call this when there is no |
---|
6345 | 7531 | * netdev that is in AP/GO mode. |
---|
6346 | 7532 | */ |
---|
6347 | | -void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
---|
6348 | | - const u8 *frame, size_t len, |
---|
6349 | | - int freq, int sig_dbm); |
---|
| 7533 | +static inline void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
---|
| 7534 | + const u8 *frame, size_t len, |
---|
| 7535 | + int freq, int sig_dbm) |
---|
| 7536 | +{ |
---|
| 7537 | + cfg80211_report_obss_beacon_khz(wiphy, frame, len, MHZ_TO_KHZ(freq), |
---|
| 7538 | + sig_dbm); |
---|
| 7539 | +} |
---|
6350 | 7540 | |
---|
6351 | 7541 | /** |
---|
6352 | 7542 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
---|
.. | .. |
---|
6425 | 7615 | bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef, |
---|
6426 | 7616 | u8 *op_class); |
---|
6427 | 7617 | |
---|
| 7618 | +/** |
---|
| 7619 | + * ieee80211_chandef_to_khz - convert chandef to frequency in KHz |
---|
| 7620 | + * |
---|
| 7621 | + * @chandef: the chandef to convert |
---|
| 7622 | + * |
---|
| 7623 | + * Returns the center frequency of chandef (1st segment) in KHz. |
---|
| 7624 | + */ |
---|
| 7625 | +static inline u32 |
---|
| 7626 | +ieee80211_chandef_to_khz(const struct cfg80211_chan_def *chandef) |
---|
| 7627 | +{ |
---|
| 7628 | + return MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset; |
---|
| 7629 | +} |
---|
| 7630 | + |
---|
6428 | 7631 | /* |
---|
6429 | 7632 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation |
---|
6430 | 7633 | * @dev: the device on which the operation is requested |
---|
.. | .. |
---|
6469 | 7672 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
---|
6470 | 7673 | |
---|
6471 | 7674 | /** |
---|
6472 | | - * struct cfg80211_ft_event - FT Information Elements |
---|
| 7675 | + * struct cfg80211_ft_event_params - FT Information Elements |
---|
6473 | 7676 | * @ies: FT IEs |
---|
6474 | 7677 | * @ies_len: length of the FT IE in bytes |
---|
6475 | 7678 | * @target_ap: target AP's MAC address |
---|
.. | .. |
---|
6601 | 7804 | * by .crit_proto_start() has expired. |
---|
6602 | 7805 | */ |
---|
6603 | 7806 | void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); |
---|
6604 | | - |
---|
6605 | | -/** |
---|
6606 | | - * cfg80211_ap_stopped - notify userspace that AP mode stopped |
---|
6607 | | - * @netdev: network device |
---|
6608 | | - * @gfp: context flags |
---|
6609 | | - */ |
---|
6610 | | -void cfg80211_ap_stopped(struct net_device *netdev, gfp_t gfp); |
---|
6611 | 7807 | |
---|
6612 | 7808 | /** |
---|
6613 | 7809 | * ieee80211_get_num_supported_channels - get number of channels device has |
---|
.. | .. |
---|
6790 | 7986 | gfp_t gfp); |
---|
6791 | 7987 | |
---|
6792 | 7988 | /** |
---|
| 7989 | + * cfg80211_pmsr_report - report peer measurement result data |
---|
| 7990 | + * @wdev: the wireless device reporting the measurement |
---|
| 7991 | + * @req: the original measurement request |
---|
| 7992 | + * @result: the result data |
---|
| 7993 | + * @gfp: allocation flags |
---|
| 7994 | + */ |
---|
| 7995 | +void cfg80211_pmsr_report(struct wireless_dev *wdev, |
---|
| 7996 | + struct cfg80211_pmsr_request *req, |
---|
| 7997 | + struct cfg80211_pmsr_result *result, |
---|
| 7998 | + gfp_t gfp); |
---|
| 7999 | + |
---|
| 8000 | +/** |
---|
| 8001 | + * cfg80211_pmsr_complete - report peer measurement completed |
---|
| 8002 | + * @wdev: the wireless device reporting the measurement |
---|
| 8003 | + * @req: the original measurement request |
---|
| 8004 | + * @gfp: allocation flags |
---|
| 8005 | + * |
---|
| 8006 | + * Report that the entire measurement completed, after this |
---|
| 8007 | + * the request pointer will no longer be valid. |
---|
| 8008 | + */ |
---|
| 8009 | +void cfg80211_pmsr_complete(struct wireless_dev *wdev, |
---|
| 8010 | + struct cfg80211_pmsr_request *req, |
---|
| 8011 | + gfp_t gfp); |
---|
| 8012 | + |
---|
| 8013 | +/** |
---|
6793 | 8014 | * cfg80211_iftype_allowed - check whether the interface can be allowed |
---|
6794 | 8015 | * @wiphy: the wiphy |
---|
6795 | 8016 | * @iftype: interface type |
---|
.. | .. |
---|
6825 | 8046 | #define wiphy_info(wiphy, format, args...) \ |
---|
6826 | 8047 | dev_info(&(wiphy)->dev, format, ##args) |
---|
6827 | 8048 | |
---|
| 8049 | +#define wiphy_err_ratelimited(wiphy, format, args...) \ |
---|
| 8050 | + dev_err_ratelimited(&(wiphy)->dev, format, ##args) |
---|
| 8051 | +#define wiphy_warn_ratelimited(wiphy, format, args...) \ |
---|
| 8052 | + dev_warn_ratelimited(&(wiphy)->dev, format, ##args) |
---|
| 8053 | + |
---|
6828 | 8054 | #define wiphy_debug(wiphy, format, args...) \ |
---|
6829 | 8055 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) |
---|
6830 | 8056 | |
---|
.. | .. |
---|
6860 | 8086 | struct cfg80211_update_owe_info *owe_info, |
---|
6861 | 8087 | gfp_t gfp); |
---|
6862 | 8088 | |
---|
| 8089 | +/** |
---|
| 8090 | + * cfg80211_bss_flush - resets all the scan entries |
---|
| 8091 | + * @wiphy: the wiphy |
---|
| 8092 | + */ |
---|
| 8093 | +void cfg80211_bss_flush(struct wiphy *wiphy); |
---|
| 8094 | + |
---|
6863 | 8095 | #endif /* __NET_CFG80211_H */ |
---|