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