.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * mac80211 <-> driver interface |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net> |
---|
7 | 8 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
---|
8 | 9 | * Copyright (C) 2015 - 2017 Intel Deutschland GmbH |
---|
9 | | - * Copyright (C) 2018 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 | #ifndef MAC80211_H |
---|
.. | .. |
---|
21 | 18 | #include <linux/if_ether.h> |
---|
22 | 19 | #include <linux/skbuff.h> |
---|
23 | 20 | #include <linux/ieee80211.h> |
---|
| 21 | +#include <linux/android_kabi.h> |
---|
24 | 22 | #include <net/cfg80211.h> |
---|
25 | 23 | #include <net/codel.h> |
---|
26 | 24 | #include <net/ieee80211_radiotap.h> |
---|
.. | .. |
---|
101 | 99 | * Drivers indicate that they use this model by implementing the .wake_tx_queue |
---|
102 | 100 | * driver operation. |
---|
103 | 101 | * |
---|
104 | | - * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a |
---|
105 | | - * single per-vif queue for multicast data frames. |
---|
| 102 | + * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with |
---|
| 103 | + * another per-sta for non-data/non-mgmt and bufferable management frames, and |
---|
| 104 | + * a single per-vif queue for multicast data frames. |
---|
106 | 105 | * |
---|
107 | 106 | * The driver is expected to initialize its private per-queue data for stations |
---|
108 | 107 | * and interfaces in the .add_interface and .sta_add ops. |
---|
109 | 108 | * |
---|
110 | | - * The driver can't access the queue directly. To dequeue a frame, it calls |
---|
111 | | - * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it |
---|
112 | | - * calls the .wake_tx_queue driver op. |
---|
| 109 | + * The driver can't access the queue directly. To dequeue a frame from a |
---|
| 110 | + * txq, it calls ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a |
---|
| 111 | + * queue, it calls the .wake_tx_queue driver op. |
---|
| 112 | + * |
---|
| 113 | + * Drivers can optionally delegate responsibility for scheduling queues to |
---|
| 114 | + * mac80211, to take advantage of airtime fairness accounting. In this case, to |
---|
| 115 | + * obtain the next queue to pull frames from, the driver calls |
---|
| 116 | + * ieee80211_next_txq(). The driver is then expected to return the txq using |
---|
| 117 | + * ieee80211_return_txq(). |
---|
113 | 118 | * |
---|
114 | 119 | * For AP powersave TIM handling, the driver only needs to indicate if it has |
---|
115 | 120 | * buffered packets in the driver specific data structures by calling |
---|
.. | .. |
---|
226 | 231 | |
---|
227 | 232 | bool radar_enabled; |
---|
228 | 233 | |
---|
229 | | - u8 drv_priv[0] __aligned(sizeof(void *)); |
---|
| 234 | + u8 drv_priv[] __aligned(sizeof(void *)); |
---|
230 | 235 | }; |
---|
231 | 236 | |
---|
232 | 237 | /** |
---|
.. | .. |
---|
308 | 313 | * @BSS_CHANGED_KEEP_ALIVE: keep alive options (idle period or protected |
---|
309 | 314 | * keep alive) changed. |
---|
310 | 315 | * @BSS_CHANGED_MCAST_RATE: Multicast Rate setting changed for this interface |
---|
| 316 | + * @BSS_CHANGED_FTM_RESPONDER: fine timing measurement request responder |
---|
| 317 | + * functionality changed for this BSS (AP mode). |
---|
| 318 | + * @BSS_CHANGED_TWT: TWT status changed |
---|
| 319 | + * @BSS_CHANGED_HE_OBSS_PD: OBSS Packet Detection status changed. |
---|
| 320 | + * @BSS_CHANGED_HE_BSS_COLOR: BSS Color has changed |
---|
| 321 | + * @BSS_CHANGED_FILS_DISCOVERY: FILS discovery status changed. |
---|
| 322 | + * @BSS_CHANGED_UNSOL_BCAST_PROBE_RESP: Unsolicited broadcast probe response |
---|
| 323 | + * status changed. |
---|
311 | 324 | * |
---|
312 | 325 | */ |
---|
313 | 326 | enum ieee80211_bss_change { |
---|
.. | .. |
---|
337 | 350 | BSS_CHANGED_MU_GROUPS = 1<<23, |
---|
338 | 351 | BSS_CHANGED_KEEP_ALIVE = 1<<24, |
---|
339 | 352 | BSS_CHANGED_MCAST_RATE = 1<<25, |
---|
| 353 | + BSS_CHANGED_FTM_RESPONDER = 1<<26, |
---|
| 354 | + BSS_CHANGED_TWT = 1<<27, |
---|
| 355 | + BSS_CHANGED_HE_OBSS_PD = 1<<28, |
---|
| 356 | + BSS_CHANGED_HE_BSS_COLOR = 1<<29, |
---|
| 357 | + BSS_CHANGED_FILS_DISCOVERY = 1<<30, |
---|
| 358 | + BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = 1<<31, |
---|
340 | 359 | |
---|
341 | 360 | /* when adding here, make sure to change ieee80211_reconfig */ |
---|
342 | 361 | }; |
---|
.. | .. |
---|
463 | 482 | }; |
---|
464 | 483 | |
---|
465 | 484 | /** |
---|
| 485 | + * struct ieee80211_ftm_responder_params - FTM responder parameters |
---|
| 486 | + * |
---|
| 487 | + * @lci: LCI subelement content |
---|
| 488 | + * @civicloc: CIVIC location subelement content |
---|
| 489 | + * @lci_len: LCI data length |
---|
| 490 | + * @civicloc_len: Civic data length |
---|
| 491 | + */ |
---|
| 492 | +struct ieee80211_ftm_responder_params { |
---|
| 493 | + const u8 *lci; |
---|
| 494 | + const u8 *civicloc; |
---|
| 495 | + size_t lci_len; |
---|
| 496 | + size_t civicloc_len; |
---|
| 497 | +}; |
---|
| 498 | + |
---|
| 499 | +/** |
---|
| 500 | + * struct ieee80211_fils_discovery - FILS discovery parameters from |
---|
| 501 | + * IEEE Std 802.11ai-2016, Annex C.3 MIB detail. |
---|
| 502 | + * |
---|
| 503 | + * @min_interval: Minimum packet interval in TUs (0 - 10000) |
---|
| 504 | + * @max_interval: Maximum packet interval in TUs (0 - 10000) |
---|
| 505 | + */ |
---|
| 506 | +struct ieee80211_fils_discovery { |
---|
| 507 | + u32 min_interval; |
---|
| 508 | + u32 max_interval; |
---|
| 509 | +}; |
---|
| 510 | + |
---|
| 511 | +/** |
---|
466 | 512 | * struct ieee80211_bss_conf - holds the BSS's changing parameters |
---|
467 | 513 | * |
---|
468 | 514 | * This structure keeps information about a BSS (and an association |
---|
469 | 515 | * to that BSS) that can change during the lifetime of the BSS. |
---|
470 | 516 | * |
---|
471 | | - * @bss_color: 6-bit value to mark inter-BSS frame, if BSS supports HE |
---|
472 | 517 | * @htc_trig_based_pkt_ext: default PE in 4us units, if BSS supports HE |
---|
473 | 518 | * @multi_sta_back_32bit: supports BA bitmap of 32-bits in Multi-STA BACK |
---|
474 | 519 | * @uora_exists: is the UORA element advertised by AP |
---|
.. | .. |
---|
477 | 522 | * @uora_ocw_range: UORA element's OCW Range field |
---|
478 | 523 | * @frame_time_rts_th: HE duration RTS threshold, in units of 32us |
---|
479 | 524 | * @he_support: does this BSS support HE |
---|
| 525 | + * @twt_requester: does this BSS support TWT requester (relevant for managed |
---|
| 526 | + * mode only, set if the AP advertises TWT responder role) |
---|
| 527 | + * @twt_responder: does this BSS support TWT requester (relevant for managed |
---|
| 528 | + * mode only, set if the AP advertises TWT responder role) |
---|
| 529 | + * @twt_protected: does this BSS support protected TWT frames |
---|
480 | 530 | * @assoc: association status |
---|
481 | 531 | * @ibss_joined: indicates whether this station is part of an IBSS |
---|
482 | 532 | * or not |
---|
.. | .. |
---|
543 | 593 | * @ssid: The SSID of the current vif. Valid in AP and IBSS mode. |
---|
544 | 594 | * @ssid_len: Length of SSID given in @ssid. |
---|
545 | 595 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
---|
546 | | - * @txpower: TX power in dBm |
---|
| 596 | + * @txpower: TX power in dBm. INT_MIN means not configured. |
---|
547 | 597 | * @txpower_type: TX power adjustment used to control per packet Transmit |
---|
548 | 598 | * Power Control (TPC) in lower driver for the current vif. In particular |
---|
549 | 599 | * TPC is enabled if value passed in %txpower_type is |
---|
.. | .. |
---|
561 | 611 | * @protected_keep_alive: if set, indicates that the station should send an RSN |
---|
562 | 612 | * protected frame to the AP to reset the idle timer at the AP for the |
---|
563 | 613 | * station. |
---|
| 614 | + * @ftm_responder: whether to enable or disable fine timing measurement FTM |
---|
| 615 | + * responder functionality. |
---|
| 616 | + * @ftmr_params: configurable lci/civic parameter when enabling FTM responder. |
---|
| 617 | + * @nontransmitted: this BSS is a nontransmitted BSS profile |
---|
| 618 | + * @transmitter_bssid: the address of transmitter AP |
---|
| 619 | + * @bssid_index: index inside the multiple BSSID set |
---|
| 620 | + * @bssid_indicator: 2^bssid_indicator is the maximum number of APs in set |
---|
| 621 | + * @ema_ap: AP supports enhancements of discovery and advertisement of |
---|
| 622 | + * nontransmitted BSSIDs |
---|
| 623 | + * @profile_periodicity: the least number of beacon frames need to be received |
---|
| 624 | + * in order to discover all the nontransmitted BSSIDs in the set. |
---|
| 625 | + * @he_oper: HE operation information of the AP we are connected to |
---|
| 626 | + * @he_obss_pd: OBSS Packet Detection parameters. |
---|
| 627 | + * @he_bss_color: BSS coloring settings, if BSS supports HE |
---|
| 628 | + * @fils_discovery: FILS discovery configuration |
---|
| 629 | + * @unsol_bcast_probe_resp_interval: Unsolicited broadcast probe response |
---|
| 630 | + * interval. |
---|
| 631 | + * @s1g: BSS is S1G BSS (affects Association Request format). |
---|
| 632 | + * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed |
---|
| 633 | + * to driver when rate control is offloaded to firmware. |
---|
564 | 634 | */ |
---|
565 | 635 | struct ieee80211_bss_conf { |
---|
566 | 636 | const u8 *bssid; |
---|
567 | | - u8 bss_color; |
---|
568 | 637 | u8 htc_trig_based_pkt_ext; |
---|
569 | 638 | bool multi_sta_back_32bit; |
---|
570 | 639 | bool uora_exists; |
---|
.. | .. |
---|
572 | 641 | u8 uora_ocw_range; |
---|
573 | 642 | u16 frame_time_rts_th; |
---|
574 | 643 | bool he_support; |
---|
| 644 | + bool twt_requester; |
---|
| 645 | + bool twt_responder; |
---|
| 646 | + bool twt_protected; |
---|
575 | 647 | /* association related data */ |
---|
576 | 648 | bool assoc, ibss_joined; |
---|
577 | 649 | bool ibss_creator; |
---|
.. | .. |
---|
611 | 683 | bool allow_p2p_go_ps; |
---|
612 | 684 | u16 max_idle_period; |
---|
613 | 685 | bool protected_keep_alive; |
---|
| 686 | + bool ftm_responder; |
---|
| 687 | + struct ieee80211_ftm_responder_params *ftmr_params; |
---|
| 688 | + /* Multiple BSSID data */ |
---|
| 689 | + bool nontransmitted; |
---|
| 690 | + u8 transmitter_bssid[ETH_ALEN]; |
---|
| 691 | + u8 bssid_index; |
---|
| 692 | + u8 bssid_indicator; |
---|
| 693 | + bool ema_ap; |
---|
| 694 | + u8 profile_periodicity; |
---|
| 695 | + struct { |
---|
| 696 | + u32 params; |
---|
| 697 | + u16 nss_set; |
---|
| 698 | + } he_oper; |
---|
| 699 | + struct ieee80211_he_obss_pd he_obss_pd; |
---|
| 700 | + struct cfg80211_he_bss_color he_bss_color; |
---|
| 701 | + struct ieee80211_fils_discovery fils_discovery; |
---|
| 702 | + u32 unsol_bcast_probe_resp_interval; |
---|
| 703 | + bool s1g; |
---|
| 704 | + struct cfg80211_bitrate_mask beacon_tx_rate; |
---|
| 705 | + |
---|
| 706 | + ANDROID_KABI_RESERVE(1); |
---|
614 | 707 | }; |
---|
615 | 708 | |
---|
616 | 709 | /** |
---|
.. | .. |
---|
657 | 750 | * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate |
---|
658 | 751 | * that a frame can be transmitted while the queues are stopped for |
---|
659 | 752 | * off-channel operation. |
---|
660 | | - * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, |
---|
661 | | - * used to indicate that a pending frame requires TX processing before |
---|
662 | | - * it can be sent out. |
---|
| 753 | + * @IEEE80211_TX_CTL_HW_80211_ENCAP: This frame uses hardware encapsulation |
---|
| 754 | + * (header conversion) |
---|
663 | 755 | * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, |
---|
664 | 756 | * used to indicate that a frame was already retried due to PS |
---|
665 | 757 | * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, |
---|
.. | .. |
---|
728 | 820 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), |
---|
729 | 821 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), |
---|
730 | 822 | IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13), |
---|
731 | | - IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), |
---|
| 823 | + IEEE80211_TX_CTL_HW_80211_ENCAP = BIT(14), |
---|
732 | 824 | IEEE80211_TX_INTFL_RETRIED = BIT(15), |
---|
733 | 825 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), |
---|
734 | 826 | IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), |
---|
.. | .. |
---|
749 | 841 | |
---|
750 | 842 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
---|
751 | 843 | |
---|
| 844 | +#define IEEE80211_TX_RC_S1G_MCS IEEE80211_TX_RC_VHT_MCS |
---|
| 845 | + |
---|
752 | 846 | /** |
---|
753 | 847 | * enum mac80211_tx_control_flags - flags to describe transmit control |
---|
754 | 848 | * |
---|
.. | .. |
---|
759 | 853 | * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information |
---|
760 | 854 | * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame |
---|
761 | 855 | * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path |
---|
| 856 | + * @IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP: This frame skips mesh path lookup |
---|
| 857 | + * @IEEE80211_TX_INTCFL_NEED_TXPROCESSING: completely internal to mac80211, |
---|
| 858 | + * used to indicate that a pending frame requires TX processing before |
---|
| 859 | + * it can be sent out. |
---|
| 860 | + * @IEEE80211_TX_CTRL_NO_SEQNO: Do not overwrite the sequence number that |
---|
| 861 | + * has already been assigned to this frame. |
---|
762 | 862 | * |
---|
763 | 863 | * These flags are used in tx_info->control.flags. |
---|
764 | 864 | */ |
---|
.. | .. |
---|
768 | 868 | IEEE80211_TX_CTRL_RATE_INJECT = BIT(2), |
---|
769 | 869 | IEEE80211_TX_CTRL_AMSDU = BIT(3), |
---|
770 | 870 | IEEE80211_TX_CTRL_FAST_XMIT = BIT(4), |
---|
| 871 | + IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5), |
---|
| 872 | + IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6), |
---|
| 873 | + IEEE80211_TX_CTRL_NO_SEQNO = BIT(7), |
---|
771 | 874 | }; |
---|
772 | 875 | |
---|
773 | 876 | /* |
---|
.. | .. |
---|
909 | 1012 | * @band: the band to transmit on (use for checking for races) |
---|
910 | 1013 | * @hw_queue: HW queue to put the frame on, skb_get_queue_mapping() gives the AC |
---|
911 | 1014 | * @ack_frame_id: internal frame ID for TX status, used internally |
---|
912 | | - * @control: union for control data |
---|
913 | | - * @status: union for status data |
---|
| 1015 | + * @tx_time_est: TX time estimate in units of 4us, used internally |
---|
| 1016 | + * @control: union part for control data |
---|
| 1017 | + * @control.rates: TX rates array to try |
---|
| 1018 | + * @control.rts_cts_rate_idx: rate for RTS or CTS |
---|
| 1019 | + * @control.use_rts: use RTS |
---|
| 1020 | + * @control.use_cts_prot: use RTS/CTS |
---|
| 1021 | + * @control.short_preamble: use short preamble (CCK only) |
---|
| 1022 | + * @control.skip_table: skip externally configured rate table |
---|
| 1023 | + * @control.jiffies: timestamp for expiry on powersave clients |
---|
| 1024 | + * @control.vif: virtual interface (may be NULL) |
---|
| 1025 | + * @control.hw_key: key to encrypt with (may be NULL) |
---|
| 1026 | + * @control.flags: control flags, see &enum mac80211_tx_control_flags |
---|
| 1027 | + * @control.enqueue_time: enqueue time (for iTXQs) |
---|
| 1028 | + * @driver_rates: alias to @control.rates to reserve space |
---|
| 1029 | + * @pad: padding |
---|
| 1030 | + * @rate_driver_data: driver use area if driver needs @control.rates |
---|
| 1031 | + * @status: union part for status data |
---|
| 1032 | + * @status.rates: attempted rates |
---|
| 1033 | + * @status.ack_signal: ACK signal |
---|
| 1034 | + * @status.ampdu_ack_len: AMPDU ack length |
---|
| 1035 | + * @status.ampdu_len: AMPDU length |
---|
| 1036 | + * @status.antenna: (legacy, kept only for iwlegacy) |
---|
| 1037 | + * @status.tx_time: airtime consumed for transmission; note this is only |
---|
| 1038 | + * used for WMM AC, not for airtime fairness |
---|
| 1039 | + * @status.is_valid_ack_signal: ACK signal is valid |
---|
| 1040 | + * @status.status_driver_data: driver use area |
---|
| 1041 | + * @ack: union part for pure ACK data |
---|
| 1042 | + * @ack.cookie: cookie for the ACK |
---|
914 | 1043 | * @driver_data: array of driver_data pointers |
---|
915 | 1044 | * @ampdu_ack_len: number of acked aggregated frames. |
---|
916 | 1045 | * relevant only if IEEE80211_TX_STAT_AMPDU was set. |
---|
.. | .. |
---|
921 | 1050 | struct ieee80211_tx_info { |
---|
922 | 1051 | /* common information */ |
---|
923 | 1052 | u32 flags; |
---|
924 | | - u8 band; |
---|
925 | | - |
---|
926 | | - u8 hw_queue; |
---|
927 | | - |
---|
928 | | - u16 ack_frame_id; |
---|
| 1053 | + u32 band:3, |
---|
| 1054 | + ack_frame_id:13, |
---|
| 1055 | + hw_queue:4, |
---|
| 1056 | + tx_time_est:10; |
---|
| 1057 | + /* 2 free bits */ |
---|
929 | 1058 | |
---|
930 | 1059 | union { |
---|
931 | 1060 | struct { |
---|
.. | .. |
---|
971 | 1100 | void *rate_driver_data[ |
---|
972 | 1101 | IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)]; |
---|
973 | 1102 | }; |
---|
| 1103 | + |
---|
| 1104 | + ANDROID_KABI_RESERVE(1); |
---|
| 1105 | + |
---|
974 | 1106 | void *driver_data[ |
---|
975 | 1107 | IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)]; |
---|
976 | 1108 | }; |
---|
977 | 1109 | }; |
---|
978 | 1110 | |
---|
| 1111 | +static inline u16 |
---|
| 1112 | +ieee80211_info_set_tx_time_est(struct ieee80211_tx_info *info, u16 tx_time_est) |
---|
| 1113 | +{ |
---|
| 1114 | + /* We only have 10 bits in tx_time_est, so store airtime |
---|
| 1115 | + * in increments of 4us and clamp the maximum to 2**12-1 |
---|
| 1116 | + */ |
---|
| 1117 | + info->tx_time_est = min_t(u16, tx_time_est, 4095) >> 2; |
---|
| 1118 | + return info->tx_time_est << 2; |
---|
| 1119 | +} |
---|
| 1120 | + |
---|
| 1121 | +static inline u16 |
---|
| 1122 | +ieee80211_info_get_tx_time_est(struct ieee80211_tx_info *info) |
---|
| 1123 | +{ |
---|
| 1124 | + return info->tx_time_est << 2; |
---|
| 1125 | +} |
---|
| 1126 | + |
---|
979 | 1127 | /** |
---|
980 | | - * struct ieee80211_tx_status - extended tx staus info for rate control |
---|
| 1128 | + * struct ieee80211_tx_status - extended tx status info for rate control |
---|
981 | 1129 | * |
---|
982 | 1130 | * @sta: Station that the packet was transmitted for |
---|
983 | 1131 | * @info: Basic tx status information |
---|
984 | 1132 | * @skb: Packet skb (can be NULL if not provided by the driver) |
---|
| 1133 | + * @rate: The TX rate that was used when sending the packet |
---|
| 1134 | + * @free_list: list where processed skbs are stored to be free'd by the driver |
---|
985 | 1135 | */ |
---|
986 | 1136 | struct ieee80211_tx_status { |
---|
987 | 1137 | struct ieee80211_sta *sta; |
---|
988 | 1138 | struct ieee80211_tx_info *info; |
---|
989 | 1139 | struct sk_buff *skb; |
---|
| 1140 | + struct rate_info *rate; |
---|
| 1141 | + struct list_head *free_list; |
---|
990 | 1142 | }; |
---|
991 | 1143 | |
---|
992 | 1144 | /** |
---|
.. | .. |
---|
1130 | 1282 | * @RX_FLAG_AMPDU_EOF_BIT_KNOWN: The EOF value is known |
---|
1131 | 1283 | * @RX_FLAG_RADIOTAP_HE: HE radiotap data is present |
---|
1132 | 1284 | * (&struct ieee80211_radiotap_he, mac80211 will fill in |
---|
| 1285 | + * |
---|
1133 | 1286 | * - DATA3_DATA_MCS |
---|
1134 | 1287 | * - DATA3_DATA_DCM |
---|
1135 | 1288 | * - DATA3_CODING |
---|
.. | .. |
---|
1137 | 1290 | * - DATA5_DATA_BW_RU_ALLOC |
---|
1138 | 1291 | * - DATA6_NSTS |
---|
1139 | 1292 | * - DATA3_STBC |
---|
| 1293 | + * |
---|
1140 | 1294 | * from the RX info data, so leave those zeroed when building this data) |
---|
1141 | 1295 | * @RX_FLAG_RADIOTAP_HE_MU: HE MU radiotap data is present |
---|
1142 | 1296 | * (&struct ieee80211_radiotap_he_mu) |
---|
| 1297 | + * @RX_FLAG_RADIOTAP_LSIG: L-SIG radiotap data is present |
---|
| 1298 | + * @RX_FLAG_NO_PSDU: use the frame only for radiotap reporting, with |
---|
| 1299 | + * the "0-length PSDU" field included there. The value for it is |
---|
| 1300 | + * in &struct ieee80211_rx_status. Note that if this value isn't |
---|
| 1301 | + * known the frame shouldn't be reported. |
---|
1143 | 1302 | */ |
---|
1144 | 1303 | enum mac80211_rx_flags { |
---|
1145 | 1304 | RX_FLAG_MMIC_ERROR = BIT(0), |
---|
.. | .. |
---|
1170 | 1329 | RX_FLAG_AMPDU_EOF_BIT_KNOWN = BIT(25), |
---|
1171 | 1330 | RX_FLAG_RADIOTAP_HE = BIT(26), |
---|
1172 | 1331 | RX_FLAG_RADIOTAP_HE_MU = BIT(27), |
---|
| 1332 | + RX_FLAG_RADIOTAP_LSIG = BIT(28), |
---|
| 1333 | + RX_FLAG_NO_PSDU = BIT(29), |
---|
1173 | 1334 | }; |
---|
1174 | 1335 | |
---|
1175 | 1336 | /** |
---|
.. | .. |
---|
1180 | 1341 | * @RX_ENC_FLAG_HT_GF: This frame was received in a HT-greenfield transmission, |
---|
1181 | 1342 | * if the driver fills this value it should add |
---|
1182 | 1343 | * %IEEE80211_RADIOTAP_MCS_HAVE_FMT |
---|
1183 | | - * to hw.radiotap_mcs_details to advertise that fact |
---|
| 1344 | + * to @hw.radiotap_mcs_details to advertise that fact. |
---|
1184 | 1345 | * @RX_ENC_FLAG_LDPC: LDPC was used |
---|
1185 | 1346 | * @RX_ENC_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 |
---|
1186 | 1347 | * @RX_ENC_FLAG_BF: packet was beamformed |
---|
.. | .. |
---|
1220 | 1381 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
---|
1221 | 1382 | * This field must be set for management frames, but isn't strictly needed |
---|
1222 | 1383 | * for data (other) frames - for those it only affects radiotap reporting. |
---|
| 1384 | + * @freq_offset: @freq has a positive offset of 500Khz. |
---|
1223 | 1385 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
---|
1224 | 1386 | * unspecified depending on the hardware capabilities flags |
---|
1225 | 1387 | * @IEEE80211_HW_SIGNAL_* |
---|
.. | .. |
---|
1242 | 1404 | * @ampdu_reference: A-MPDU reference number, must be a different value for |
---|
1243 | 1405 | * each A-MPDU but the same for each subframe within one A-MPDU |
---|
1244 | 1406 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC |
---|
| 1407 | + * @zero_length_psdu_type: radiotap type of the 0-length PSDU |
---|
1245 | 1408 | */ |
---|
1246 | 1409 | struct ieee80211_rx_status { |
---|
1247 | 1410 | u64 mactime; |
---|
.. | .. |
---|
1249 | 1412 | u32 device_timestamp; |
---|
1250 | 1413 | u32 ampdu_reference; |
---|
1251 | 1414 | u32 flag; |
---|
1252 | | - u16 freq; |
---|
| 1415 | + u16 freq: 13, freq_offset: 1; |
---|
1253 | 1416 | u8 enc_flags; |
---|
1254 | 1417 | u8 encoding:2, bw:3, he_ru:3; |
---|
1255 | 1418 | u8 he_gi:2, he_dcm:1; |
---|
.. | .. |
---|
1262 | 1425 | u8 chains; |
---|
1263 | 1426 | s8 chain_signal[IEEE80211_MAX_CHAINS]; |
---|
1264 | 1427 | u8 ampdu_delimiter_crc; |
---|
| 1428 | + u8 zero_length_psdu_type; |
---|
1265 | 1429 | }; |
---|
| 1430 | + |
---|
| 1431 | +static inline u32 |
---|
| 1432 | +ieee80211_rx_status_to_khz(struct ieee80211_rx_status *rx_status) |
---|
| 1433 | +{ |
---|
| 1434 | + return MHZ_TO_KHZ(rx_status->freq) + |
---|
| 1435 | + (rx_status->freq_offset ? 500 : 0); |
---|
| 1436 | +} |
---|
1266 | 1437 | |
---|
1267 | 1438 | /** |
---|
1268 | 1439 | * struct ieee80211_vendor_radiotap - vendor radiotap data information |
---|
.. | .. |
---|
1418 | 1589 | struct cfg80211_chan_def chandef; |
---|
1419 | 1590 | bool radar_enabled; |
---|
1420 | 1591 | enum ieee80211_smps_mode smps_mode; |
---|
| 1592 | + |
---|
| 1593 | + ANDROID_KABI_RESERVE(1); |
---|
1421 | 1594 | }; |
---|
1422 | 1595 | |
---|
1423 | 1596 | /** |
---|
.. | .. |
---|
1436 | 1609 | * scheduled channel switch, as indicated by the AP. |
---|
1437 | 1610 | * @chandef: the new channel to switch to |
---|
1438 | 1611 | * @count: the number of TBTT's until the channel switch event |
---|
| 1612 | + * @delay: maximum delay between the time the AP transmitted the last beacon in |
---|
| 1613 | + * current channel and the expected time of the first beacon in the new |
---|
| 1614 | + * channel, expressed in TU. |
---|
1439 | 1615 | */ |
---|
1440 | 1616 | struct ieee80211_channel_switch { |
---|
1441 | 1617 | u64 timestamp; |
---|
.. | .. |
---|
1443 | 1619 | bool block_tx; |
---|
1444 | 1620 | struct cfg80211_chan_def chandef; |
---|
1445 | 1621 | u8 count; |
---|
| 1622 | + u32 delay; |
---|
1446 | 1623 | }; |
---|
1447 | 1624 | |
---|
1448 | 1625 | /** |
---|
.. | .. |
---|
1469 | 1646 | IEEE80211_VIF_GET_NOA_UPDATE = BIT(3), |
---|
1470 | 1647 | }; |
---|
1471 | 1648 | |
---|
| 1649 | + |
---|
| 1650 | +/** |
---|
| 1651 | + * enum ieee80211_offload_flags - virtual interface offload flags |
---|
| 1652 | + * |
---|
| 1653 | + * @IEEE80211_OFFLOAD_ENCAP_ENABLED: tx encapsulation offload is enabled |
---|
| 1654 | + * The driver supports sending frames passed as 802.3 frames by mac80211. |
---|
| 1655 | + * It must also support sending 802.11 packets for the same interface. |
---|
| 1656 | + * @IEEE80211_OFFLOAD_ENCAP_4ADDR: support 4-address mode encapsulation offload |
---|
| 1657 | + */ |
---|
| 1658 | + |
---|
| 1659 | +enum ieee80211_offload_flags { |
---|
| 1660 | + IEEE80211_OFFLOAD_ENCAP_ENABLED = BIT(0), |
---|
| 1661 | + IEEE80211_OFFLOAD_ENCAP_4ADDR = BIT(1), |
---|
| 1662 | +}; |
---|
| 1663 | + |
---|
1472 | 1664 | /** |
---|
1473 | 1665 | * struct ieee80211_vif - per-interface data |
---|
1474 | 1666 | * |
---|
.. | .. |
---|
1489 | 1681 | * these need to be set (or cleared) when the interface is added |
---|
1490 | 1682 | * or, if supported by the driver, the interface type is changed |
---|
1491 | 1683 | * at runtime, mac80211 will never touch this field |
---|
| 1684 | + * @offloaad_flags: hardware offload capabilities/flags for this interface. |
---|
| 1685 | + * These are initialized by mac80211 before calling .add_interface, |
---|
| 1686 | + * .change_interface or .update_vif_offload and updated by the driver |
---|
| 1687 | + * within these ops, based on supported features or runtime change |
---|
| 1688 | + * restrictions. |
---|
1492 | 1689 | * @hw_queue: hardware queue for each AC |
---|
1493 | 1690 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only |
---|
1494 | 1691 | * @chanctx_conf: The channel context this interface is assigned to, or %NULL |
---|
.. | .. |
---|
1501 | 1698 | * monitor interface (if that is requested.) |
---|
1502 | 1699 | * @probe_req_reg: probe requests should be reported to mac80211 for this |
---|
1503 | 1700 | * interface. |
---|
| 1701 | + * @rx_mcast_action_reg: multicast Action frames should be reported to mac80211 |
---|
| 1702 | + * for this interface. |
---|
1504 | 1703 | * @drv_priv: data area for driver use, will always be aligned to |
---|
1505 | 1704 | * sizeof(void \*). |
---|
1506 | 1705 | * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) |
---|
| 1706 | + * @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped, |
---|
| 1707 | + * protected by fq->lock. |
---|
| 1708 | + * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see |
---|
| 1709 | + * &enum ieee80211_offload_flags. |
---|
1507 | 1710 | */ |
---|
1508 | 1711 | struct ieee80211_vif { |
---|
1509 | 1712 | enum nl80211_iftype type; |
---|
.. | .. |
---|
1521 | 1724 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; |
---|
1522 | 1725 | |
---|
1523 | 1726 | u32 driver_flags; |
---|
| 1727 | + u32 offload_flags; |
---|
1524 | 1728 | |
---|
1525 | 1729 | #ifdef CONFIG_MAC80211_DEBUGFS |
---|
1526 | 1730 | struct dentry *debugfs_dir; |
---|
1527 | 1731 | #endif |
---|
1528 | 1732 | |
---|
1529 | | - unsigned int probe_req_reg; |
---|
| 1733 | + bool probe_req_reg; |
---|
| 1734 | + bool rx_mcast_action_reg; |
---|
| 1735 | + |
---|
| 1736 | + bool txqs_stopped[IEEE80211_NUM_ACS]; |
---|
| 1737 | + |
---|
| 1738 | + ANDROID_KABI_RESERVE(1); |
---|
1530 | 1739 | |
---|
1531 | 1740 | /* must be last */ |
---|
1532 | | - u8 drv_priv[0] __aligned(sizeof(void *)); |
---|
| 1741 | + u8 drv_priv[] __aligned(sizeof(void *)); |
---|
1533 | 1742 | }; |
---|
1534 | 1743 | |
---|
1535 | 1744 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) |
---|
.. | .. |
---|
1599 | 1808 | * %IEEE80211_KEY_FLAG_SW_MGMT_TX flag to encrypt such frames in SW. |
---|
1600 | 1809 | * @IEEE80211_KEY_FLAG_GENERATE_IV_MGMT: This flag should be set by the |
---|
1601 | 1810 | * driver for a CCMP/GCMP key to indicate that is requires IV generation |
---|
1602 | | - * only for managment frames (MFP). |
---|
| 1811 | + * only for management frames (MFP). |
---|
1603 | 1812 | * @IEEE80211_KEY_FLAG_RESERVE_TAILROOM: This flag should be set by the |
---|
1604 | 1813 | * driver for a key to indicate that sufficient tailroom must always |
---|
1605 | 1814 | * be reserved for ICV or MIC, even when HW encryption is enabled. |
---|
1606 | 1815 | * @IEEE80211_KEY_FLAG_PUT_MIC_SPACE: This flag should be set by the driver for |
---|
1607 | 1816 | * a TKIP key if it only requires MIC space. Do not set together with |
---|
1608 | 1817 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC on the same key. |
---|
| 1818 | + * @IEEE80211_KEY_FLAG_NO_AUTO_TX: Key needs explicit Tx activation. |
---|
| 1819 | + * @IEEE80211_KEY_FLAG_GENERATE_MMIE: This flag should be set by the driver |
---|
| 1820 | + * for a AES_CMAC key to indicate that it requires sequence number |
---|
| 1821 | + * generation only |
---|
1609 | 1822 | */ |
---|
1610 | 1823 | enum ieee80211_key_flags { |
---|
1611 | 1824 | IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), |
---|
.. | .. |
---|
1617 | 1830 | IEEE80211_KEY_FLAG_RX_MGMT = BIT(6), |
---|
1618 | 1831 | IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7), |
---|
1619 | 1832 | IEEE80211_KEY_FLAG_PUT_MIC_SPACE = BIT(8), |
---|
| 1833 | + IEEE80211_KEY_FLAG_NO_AUTO_TX = BIT(9), |
---|
| 1834 | + IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(10), |
---|
1620 | 1835 | }; |
---|
1621 | 1836 | |
---|
1622 | 1837 | /** |
---|
.. | .. |
---|
1651 | 1866 | s8 keyidx; |
---|
1652 | 1867 | u16 flags; |
---|
1653 | 1868 | u8 keylen; |
---|
1654 | | - u8 key[0]; |
---|
| 1869 | + u8 key[]; |
---|
1655 | 1870 | }; |
---|
1656 | 1871 | |
---|
1657 | 1872 | #define IEEE80211_MAX_PN_LEN 16 |
---|
.. | .. |
---|
1797 | 2012 | }; |
---|
1798 | 2013 | |
---|
1799 | 2014 | /** |
---|
| 2015 | + * struct ieee80211_sta_txpwr - station txpower configuration |
---|
| 2016 | + * |
---|
| 2017 | + * Used to configure txpower for station. |
---|
| 2018 | + * |
---|
| 2019 | + * @power: indicates the tx power, in dBm, to be used when sending data frames |
---|
| 2020 | + * to the STA. |
---|
| 2021 | + * @type: In particular if TPC %type is NL80211_TX_POWER_LIMITED then tx power |
---|
| 2022 | + * will be less than or equal to specified from userspace, whereas if TPC |
---|
| 2023 | + * %type is NL80211_TX_POWER_AUTOMATIC then it indicates default tx power. |
---|
| 2024 | + * NL80211_TX_POWER_FIXED is not a valid configuration option for |
---|
| 2025 | + * per peer TPC. |
---|
| 2026 | + */ |
---|
| 2027 | +struct ieee80211_sta_txpwr { |
---|
| 2028 | + s16 power; |
---|
| 2029 | + enum nl80211_tx_power_setting type; |
---|
| 2030 | +}; |
---|
| 2031 | + |
---|
| 2032 | +/** |
---|
1800 | 2033 | * struct ieee80211_sta - station table entry |
---|
1801 | 2034 | * |
---|
1802 | 2035 | * A station table entry represents a station we are possibly |
---|
.. | .. |
---|
1812 | 2045 | * @ht_cap: HT capabilities of this STA; restricted to our own capabilities |
---|
1813 | 2046 | * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities |
---|
1814 | 2047 | * @he_cap: HE capabilities of this STA |
---|
| 2048 | + * @he_6ghz_capa: on 6 GHz, holds the HE 6 GHz band capabilities |
---|
1815 | 2049 | * @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU |
---|
1816 | 2050 | * that this station is allowed to transmit to us. |
---|
1817 | 2051 | * Can be modified by driver. |
---|
.. | .. |
---|
1839 | 2073 | * unlimited. |
---|
1840 | 2074 | * @support_p2p_ps: indicates whether the STA supports P2P PS mechanism or not. |
---|
1841 | 2075 | * @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control. |
---|
1842 | | - * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) |
---|
| 2076 | + * @max_tid_amsdu_len: Maximum A-MSDU size in bytes for this TID |
---|
| 2077 | + * @txpwr: the station tx power configuration |
---|
| 2078 | + * @txq: per-TID data TX queues (if driver uses the TXQ abstraction); note that |
---|
| 2079 | + * the last entry (%IEEE80211_NUM_TIDS) is used for non-data frames |
---|
1843 | 2080 | */ |
---|
1844 | 2081 | struct ieee80211_sta { |
---|
1845 | 2082 | u32 supp_rates[NUM_NL80211_BANDS]; |
---|
.. | .. |
---|
1848 | 2085 | struct ieee80211_sta_ht_cap ht_cap; |
---|
1849 | 2086 | struct ieee80211_sta_vht_cap vht_cap; |
---|
1850 | 2087 | struct ieee80211_sta_he_cap he_cap; |
---|
| 2088 | + struct ieee80211_he_6ghz_capa he_6ghz_capa; |
---|
1851 | 2089 | u16 max_rx_aggregation_subframes; |
---|
1852 | 2090 | bool wme; |
---|
1853 | 2091 | u8 uapsd_queues; |
---|
.. | .. |
---|
1869 | 2107 | * |
---|
1870 | 2108 | * * If the skb is transmitted as part of a BA agreement, the |
---|
1871 | 2109 | * A-MSDU maximal size is min(max_amsdu_len, 4065) bytes. |
---|
1872 | | - * * If the skb is not part of a BA aggreement, the A-MSDU maximal |
---|
| 2110 | + * * If the skb is not part of a BA agreement, the A-MSDU maximal |
---|
1873 | 2111 | * size is min(max_amsdu_len, 7935) bytes. |
---|
1874 | 2112 | * |
---|
1875 | 2113 | * Both additional HT limits must be enforced by the low level |
---|
.. | .. |
---|
1879 | 2117 | u16 max_amsdu_len; |
---|
1880 | 2118 | bool support_p2p_ps; |
---|
1881 | 2119 | u16 max_rc_amsdu_len; |
---|
| 2120 | + u16 max_tid_amsdu_len[IEEE80211_NUM_TIDS]; |
---|
| 2121 | + struct ieee80211_sta_txpwr txpwr; |
---|
1882 | 2122 | |
---|
1883 | | - struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; |
---|
| 2123 | + struct ieee80211_txq *txq[IEEE80211_NUM_TIDS + 1]; |
---|
| 2124 | + |
---|
| 2125 | + ANDROID_KABI_RESERVE(1); |
---|
1884 | 2126 | |
---|
1885 | 2127 | /* must be last */ |
---|
1886 | | - u8 drv_priv[0] __aligned(sizeof(void *)); |
---|
| 2128 | + u8 drv_priv[] __aligned(sizeof(void *)); |
---|
1887 | 2129 | }; |
---|
1888 | 2130 | |
---|
1889 | 2131 | /** |
---|
.. | .. |
---|
1914 | 2156 | * |
---|
1915 | 2157 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
1916 | 2158 | * @sta: station table entry, %NULL for per-vif queue |
---|
1917 | | - * @tid: the TID for this queue (unused for per-vif queue) |
---|
| 2159 | + * @tid: the TID for this queue (unused for per-vif queue), |
---|
| 2160 | + * %IEEE80211_NUM_TIDS for non-data (if enabled) |
---|
1918 | 2161 | * @ac: the AC for this queue |
---|
1919 | 2162 | * @drv_priv: driver private area, sized by hw->txq_data_size |
---|
1920 | 2163 | * |
---|
.. | .. |
---|
1928 | 2171 | u8 ac; |
---|
1929 | 2172 | |
---|
1930 | 2173 | /* must be last */ |
---|
1931 | | - u8 drv_priv[0] __aligned(sizeof(void *)); |
---|
| 2174 | + u8 drv_priv[] __aligned(sizeof(void *)); |
---|
1932 | 2175 | }; |
---|
1933 | 2176 | |
---|
1934 | 2177 | /** |
---|
.. | .. |
---|
2127 | 2370 | * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't |
---|
2128 | 2371 | * support QoS NDP for AP probing - that's most likely a driver bug. |
---|
2129 | 2372 | * |
---|
| 2373 | + * @IEEE80211_HW_BUFF_MMPDU_TXQ: use the TXQ for bufferable MMPDUs, this of |
---|
| 2374 | + * course requires the driver to use TXQs to start with. |
---|
| 2375 | + * |
---|
| 2376 | + * @IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW: (Hardware) rate control supports VHT |
---|
| 2377 | + * extended NSS BW (dot11VHTExtendedNSSBWCapable). This flag will be set if |
---|
| 2378 | + * the selected rate control algorithm sets %RATE_CTRL_CAPA_VHT_EXT_NSS_BW |
---|
| 2379 | + * but if the rate control is built-in then it must be set by the driver. |
---|
| 2380 | + * See also the documentation for that flag. |
---|
| 2381 | + * |
---|
| 2382 | + * @IEEE80211_HW_STA_MMPDU_TXQ: use the extra non-TID per-station TXQ for all |
---|
| 2383 | + * MMPDUs on station interfaces. This of course requires the driver to use |
---|
| 2384 | + * TXQs to start with. |
---|
| 2385 | + * |
---|
| 2386 | + * @IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN: Driver does not report accurate A-MPDU |
---|
| 2387 | + * length in tx status information |
---|
| 2388 | + * |
---|
| 2389 | + * @IEEE80211_HW_SUPPORTS_MULTI_BSSID: Hardware supports multi BSSID |
---|
| 2390 | + * |
---|
| 2391 | + * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID |
---|
| 2392 | + * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set. |
---|
| 2393 | + * |
---|
| 2394 | + * @IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT: The card and driver is only |
---|
| 2395 | + * aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx |
---|
| 2396 | + * A-MPDU sessions active while rekeying with Extended Key ID. |
---|
| 2397 | + * |
---|
| 2398 | + * @IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD: Hardware supports tx encapsulation |
---|
| 2399 | + * offload |
---|
| 2400 | + * |
---|
2130 | 2401 | * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays |
---|
2131 | 2402 | */ |
---|
2132 | 2403 | enum ieee80211_hw_flags { |
---|
.. | .. |
---|
2172 | 2443 | IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA, |
---|
2173 | 2444 | IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP, |
---|
2174 | 2445 | IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP, |
---|
| 2446 | + IEEE80211_HW_BUFF_MMPDU_TXQ, |
---|
| 2447 | + IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW, |
---|
| 2448 | + IEEE80211_HW_STA_MMPDU_TXQ, |
---|
| 2449 | + IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN, |
---|
| 2450 | + IEEE80211_HW_SUPPORTS_MULTI_BSSID, |
---|
| 2451 | + IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, |
---|
| 2452 | + IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, |
---|
| 2453 | + IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, |
---|
2175 | 2454 | |
---|
2176 | 2455 | /* keep last, obviously */ |
---|
2177 | 2456 | NUM_IEEE80211_HW_FLAGS |
---|
.. | .. |
---|
2263 | 2542 | * @radiotap_he: HE radiotap validity flags |
---|
2264 | 2543 | * |
---|
2265 | 2544 | * @radiotap_timestamp: Information for the radiotap timestamp field; if the |
---|
2266 | | - * 'units_pos' member is set to a non-negative value it must be set to |
---|
2267 | | - * a combination of a IEEE80211_RADIOTAP_TIMESTAMP_UNIT_* and a |
---|
2268 | | - * IEEE80211_RADIOTAP_TIMESTAMP_SPOS_* value, and then the timestamp |
---|
| 2545 | + * @units_pos member is set to a non-negative value then the timestamp |
---|
2269 | 2546 | * field will be added and populated from the &struct ieee80211_rx_status |
---|
2270 | | - * device_timestamp. If the 'accuracy' member is non-negative, it's put |
---|
2271 | | - * into the accuracy radiotap field and the accuracy known flag is set. |
---|
| 2547 | + * device_timestamp. |
---|
| 2548 | + * @radiotap_timestamp.units_pos: Must be set to a combination of a |
---|
| 2549 | + * IEEE80211_RADIOTAP_TIMESTAMP_UNIT_* and a |
---|
| 2550 | + * IEEE80211_RADIOTAP_TIMESTAMP_SPOS_* value. |
---|
| 2551 | + * @radiotap_timestamp.accuracy: If non-negative, fills the accuracy in the |
---|
| 2552 | + * radiotap field and the accuracy known flag will be set. |
---|
2272 | 2553 | * |
---|
2273 | 2554 | * @netdev_features: netdev features to be set in each netdev created |
---|
2274 | 2555 | * from this HW. Note that not all features are usable with mac80211, |
---|
.. | .. |
---|
2290 | 2571 | * supported by HW. |
---|
2291 | 2572 | * @max_nan_de_entries: maximum number of NAN DE functions supported by the |
---|
2292 | 2573 | * device. |
---|
| 2574 | + * |
---|
| 2575 | + * @tx_sk_pacing_shift: Pacing shift to set on TCP sockets when frames from |
---|
| 2576 | + * them are encountered. The default should typically not be changed, |
---|
| 2577 | + * unless the driver has good reasons for needing more buffers. |
---|
| 2578 | + * |
---|
| 2579 | + * @weight_multiplier: Driver specific airtime weight multiplier used while |
---|
| 2580 | + * refilling deficit of each TXQ. |
---|
| 2581 | + * |
---|
| 2582 | + * @max_mtu: the max mtu could be set. |
---|
2293 | 2583 | */ |
---|
2294 | 2584 | struct ieee80211_hw { |
---|
2295 | 2585 | struct ieee80211_conf conf; |
---|
.. | .. |
---|
2325 | 2615 | u8 n_cipher_schemes; |
---|
2326 | 2616 | const struct ieee80211_cipher_scheme *cipher_schemes; |
---|
2327 | 2617 | u8 max_nan_de_entries; |
---|
| 2618 | + u8 tx_sk_pacing_shift; |
---|
| 2619 | + u8 weight_multiplier; |
---|
| 2620 | + u32 max_mtu; |
---|
| 2621 | + |
---|
| 2622 | + ANDROID_KABI_RESERVE(1); |
---|
2328 | 2623 | }; |
---|
2329 | 2624 | |
---|
2330 | 2625 | static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
2448 | 2743 | * @hw: the hardware |
---|
2449 | 2744 | * @skb: the skb |
---|
2450 | 2745 | * |
---|
2451 | | - * Free a transmit skb. Use this funtion when some failure |
---|
| 2746 | + * Free a transmit skb. Use this function when some failure |
---|
2452 | 2747 | * to transmit happened and thus status cannot be reported. |
---|
2453 | 2748 | */ |
---|
2454 | 2749 | void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb); |
---|
.. | .. |
---|
2506 | 2801 | * The set_default_unicast_key() call updates the default WEP key index |
---|
2507 | 2802 | * configured to the hardware for WEP encryption type. This is required |
---|
2508 | 2803 | * for devices that support offload of data packets (e.g. ARP responses). |
---|
| 2804 | + * |
---|
| 2805 | + * Mac80211 drivers should set the @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 flag |
---|
| 2806 | + * when they are able to replace in-use PTK keys according to the following |
---|
| 2807 | + * requirements: |
---|
| 2808 | + * 1) They do not hand over frames decrypted with the old key to |
---|
| 2809 | + mac80211 once the call to set_key() with command %DISABLE_KEY has been |
---|
| 2810 | + completed when also setting @IEEE80211_KEY_FLAG_GENERATE_IV for any key, |
---|
| 2811 | + 2) either drop or continue to use the old key for any outgoing frames queued |
---|
| 2812 | + at the time of the key deletion (including re-transmits), |
---|
| 2813 | + 3) never send out a frame queued prior to the set_key() %SET_KEY command |
---|
| 2814 | + encrypted with the new key and |
---|
| 2815 | + 4) never send out a frame unencrypted when it should be encrypted. |
---|
| 2816 | + Mac80211 will not queue any new frames for a deleted key to the driver. |
---|
2509 | 2817 | */ |
---|
2510 | 2818 | |
---|
2511 | 2819 | /** |
---|
.. | .. |
---|
2879 | 3187 | * @FIF_PSPOLL: pass PS Poll frames |
---|
2880 | 3188 | * |
---|
2881 | 3189 | * @FIF_PROBE_REQ: pass probe request frames |
---|
| 3190 | + * |
---|
| 3191 | + * @FIF_MCAST_ACTION: pass multicast Action frames |
---|
2882 | 3192 | */ |
---|
2883 | 3193 | enum ieee80211_filter_flags { |
---|
2884 | 3194 | FIF_ALLMULTI = 1<<1, |
---|
.. | .. |
---|
2889 | 3199 | FIF_OTHER_BSS = 1<<6, |
---|
2890 | 3200 | FIF_PSPOLL = 1<<7, |
---|
2891 | 3201 | FIF_PROBE_REQ = 1<<8, |
---|
| 3202 | + FIF_MCAST_ACTION = 1<<9, |
---|
2892 | 3203 | }; |
---|
2893 | 3204 | |
---|
2894 | 3205 | /** |
---|
.. | .. |
---|
2904 | 3215 | * |
---|
2905 | 3216 | * @IEEE80211_AMPDU_RX_START: start RX aggregation |
---|
2906 | 3217 | * @IEEE80211_AMPDU_RX_STOP: stop RX aggregation |
---|
2907 | | - * @IEEE80211_AMPDU_TX_START: start TX aggregation |
---|
| 3218 | + * @IEEE80211_AMPDU_TX_START: start TX aggregation, the driver must either |
---|
| 3219 | + * call ieee80211_start_tx_ba_cb_irqsafe() or |
---|
| 3220 | + * call ieee80211_start_tx_ba_cb_irqsafe() with status |
---|
| 3221 | + * %IEEE80211_AMPDU_TX_START_DELAY_ADDBA to delay addba after |
---|
| 3222 | + * ieee80211_start_tx_ba_cb_irqsafe is called, or just return the special |
---|
| 3223 | + * status %IEEE80211_AMPDU_TX_START_IMMEDIATE. |
---|
2908 | 3224 | * @IEEE80211_AMPDU_TX_OPERATIONAL: TX aggregation has become operational |
---|
2909 | 3225 | * @IEEE80211_AMPDU_TX_STOP_CONT: stop TX aggregation but continue transmitting |
---|
2910 | 3226 | * queued packets, now unaggregated. After all packets are transmitted the |
---|
.. | .. |
---|
2927 | 3243 | IEEE80211_AMPDU_TX_STOP_FLUSH_CONT, |
---|
2928 | 3244 | IEEE80211_AMPDU_TX_OPERATIONAL, |
---|
2929 | 3245 | }; |
---|
| 3246 | + |
---|
| 3247 | +#define IEEE80211_AMPDU_TX_START_IMMEDIATE 1 |
---|
| 3248 | +#define IEEE80211_AMPDU_TX_START_DELAY_ADDBA 2 |
---|
2930 | 3249 | |
---|
2931 | 3250 | /** |
---|
2932 | 3251 | * struct ieee80211_ampdu_params - AMPDU action parameters |
---|
.. | .. |
---|
2992 | 3311 | * |
---|
2993 | 3312 | * With the support for multi channel contexts and multi channel operations, |
---|
2994 | 3313 | * remain on channel operations might be limited/deferred/aborted by other |
---|
2995 | | - * flows/operations which have higher priority (and vise versa). |
---|
| 3314 | + * flows/operations which have higher priority (and vice versa). |
---|
2996 | 3315 | * Specifying the ROC type can be used by devices to prioritize the ROC |
---|
2997 | 3316 | * operations compared to other operations/flows. |
---|
2998 | 3317 | * |
---|
2999 | 3318 | * @IEEE80211_ROC_TYPE_NORMAL: There are no special requirements for this ROC. |
---|
3000 | 3319 | * @IEEE80211_ROC_TYPE_MGMT_TX: The remain on channel request is required |
---|
3001 | | - * for sending managment frames offchannel. |
---|
| 3320 | + * for sending management frames offchannel. |
---|
3002 | 3321 | */ |
---|
3003 | 3322 | enum ieee80211_roc_type { |
---|
3004 | 3323 | IEEE80211_ROC_TYPE_NORMAL = 0, |
---|
.. | .. |
---|
3006 | 3325 | }; |
---|
3007 | 3326 | |
---|
3008 | 3327 | /** |
---|
3009 | | - * enum ieee80211_reconfig_complete_type - reconfig type |
---|
| 3328 | + * enum ieee80211_reconfig_type - reconfig type |
---|
3010 | 3329 | * |
---|
3011 | 3330 | * This enum is used by the reconfig_complete() callback to indicate what |
---|
3012 | 3331 | * reconfiguration type was completed. |
---|
.. | .. |
---|
3164 | 3483 | * When the scan finishes, ieee80211_scan_completed() must be called; |
---|
3165 | 3484 | * note that it also must be called when the scan cannot finish due to |
---|
3166 | 3485 | * any error unless this callback returned a negative error code. |
---|
| 3486 | + * This callback is also allowed to return the special return value 1, |
---|
| 3487 | + * this indicates that hardware scan isn't desirable right now and a |
---|
| 3488 | + * software scan should be done instead. A driver wishing to use this |
---|
| 3489 | + * capability must ensure its (hardware) scan capabilities aren't |
---|
| 3490 | + * advertised as more capable than mac80211's software scan is. |
---|
3167 | 3491 | * The callback can sleep. |
---|
3168 | 3492 | * |
---|
3169 | 3493 | * @cancel_hw_scan: Ask the low-level tp cancel the active hw scan. |
---|
.. | .. |
---|
3230 | 3554 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
---|
3231 | 3555 | * in AP mode, this callback will not be called when the flag |
---|
3232 | 3556 | * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. |
---|
| 3557 | + * |
---|
| 3558 | + * @sta_set_txpwr: Configure the station tx power. This callback set the tx |
---|
| 3559 | + * power for the station. |
---|
| 3560 | + * This callback can sleep. |
---|
3233 | 3561 | * |
---|
3234 | 3562 | * @sta_state: Notifies low level driver about state transition of a |
---|
3235 | 3563 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) |
---|
.. | .. |
---|
3481 | 3809 | * decremented, and when they reach 1 the driver must call |
---|
3482 | 3810 | * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get() |
---|
3483 | 3811 | * get the csa counter decremented by mac80211, but must check if it is |
---|
3484 | | - * 1 using ieee80211_csa_is_complete() after the beacon has been |
---|
| 3812 | + * 1 using ieee80211_beacon_counter_is_complete() after the beacon has been |
---|
3485 | 3813 | * transmitted and then call ieee80211_csa_finish(). |
---|
3486 | 3814 | * If the CSA count starts as zero or 1, this function will not be called, |
---|
3487 | 3815 | * since there won't be any time to beacon before the switch anyway. |
---|
.. | .. |
---|
3492 | 3820 | * @post_channel_switch: This is an optional callback that is called |
---|
3493 | 3821 | * after a channel switch procedure is completed, allowing the |
---|
3494 | 3822 | * driver to go back to a normal configuration. |
---|
3495 | | - * |
---|
| 3823 | + * @abort_channel_switch: This is an optional callback that is called |
---|
| 3824 | + * when channel switch procedure was completed, allowing the |
---|
| 3825 | + * driver to go back to a normal configuration. |
---|
| 3826 | + * @channel_switch_rx_beacon: This is an optional callback that is called |
---|
| 3827 | + * when channel switch procedure is in progress and additional beacon with |
---|
| 3828 | + * CSA IE was received, allowing driver to track changes in count. |
---|
3496 | 3829 | * @join_ibss: Join an IBSS (on an IBSS interface); this is called after all |
---|
3497 | 3830 | * information in bss_conf is set up and the beacon can be retrieved. A |
---|
3498 | 3831 | * channel context is bound before this is called. |
---|
.. | .. |
---|
3542 | 3875 | * @del_nan_func: Remove a NAN function. The driver must call |
---|
3543 | 3876 | * ieee80211_nan_func_terminated() with |
---|
3544 | 3877 | * NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal. |
---|
| 3878 | + * @can_aggregate_in_amsdu: Called in order to determine if HW supports |
---|
| 3879 | + * aggregating two specific frames in the same A-MSDU. The relation |
---|
| 3880 | + * between the skbs should be symmetric and transitive. Note that while |
---|
| 3881 | + * skb is always a real frame, head may or may not be an A-MSDU. |
---|
| 3882 | + * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. |
---|
| 3883 | + * Statistics should be cumulative, currently no way to reset is provided. |
---|
| 3884 | + * |
---|
| 3885 | + * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep) |
---|
| 3886 | + * @abort_pmsr: abort peer measurement (this call can sleep) |
---|
| 3887 | + * @set_tid_config: Apply TID specific configurations. This callback may sleep. |
---|
| 3888 | + * @reset_tid_config: Reset TID specific configuration for the peer. |
---|
| 3889 | + * This callback may sleep. |
---|
| 3890 | + * @update_vif_offload: Update virtual interface offload flags |
---|
| 3891 | + * This callback may sleep. |
---|
| 3892 | + * @sta_set_4addr: Called to notify the driver when a station starts/stops using |
---|
| 3893 | + * 4-address mode |
---|
3545 | 3894 | */ |
---|
3546 | 3895 | struct ieee80211_ops { |
---|
3547 | 3896 | void (*tx)(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
3629 | 3978 | #endif |
---|
3630 | 3979 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
3631 | 3980 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
---|
| 3981 | + int (*sta_set_txpwr)(struct ieee80211_hw *hw, |
---|
| 3982 | + struct ieee80211_vif *vif, |
---|
| 3983 | + struct ieee80211_sta *sta); |
---|
3632 | 3984 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
3633 | 3985 | struct ieee80211_sta *sta, |
---|
3634 | 3986 | enum ieee80211_sta_state old_state, |
---|
.. | .. |
---|
3683 | 4035 | * |
---|
3684 | 4036 | * Even ``189`` would be wrong since 1 could be lost again. |
---|
3685 | 4037 | * |
---|
3686 | | - * Returns a negative error code on failure. |
---|
| 4038 | + * Returns a negative error code on failure. The driver may return |
---|
| 4039 | + * %IEEE80211_AMPDU_TX_START_IMMEDIATE for %IEEE80211_AMPDU_TX_START |
---|
| 4040 | + * if the session can start immediately. |
---|
| 4041 | + * |
---|
3687 | 4042 | * The callback can sleep. |
---|
3688 | 4043 | */ |
---|
3689 | 4044 | int (*ampdu_action)(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
3693 | 4048 | struct survey_info *survey); |
---|
3694 | 4049 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
---|
3695 | 4050 | void (*set_coverage_class)(struct ieee80211_hw *hw, s16 coverage_class); |
---|
| 4051 | +#ifdef CONFIG_NL80211_TESTMODE |
---|
3696 | 4052 | int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
3697 | 4053 | void *data, int len); |
---|
3698 | 4054 | int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, |
---|
3699 | 4055 | struct netlink_callback *cb, |
---|
3700 | 4056 | void *data, int len); |
---|
| 4057 | +#endif |
---|
3701 | 4058 | void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
3702 | 4059 | u32 queues, bool drop); |
---|
3703 | 4060 | void (*channel_switch)(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
3711 | 4068 | struct ieee80211_channel *chan, |
---|
3712 | 4069 | int duration, |
---|
3713 | 4070 | enum ieee80211_roc_type type); |
---|
3714 | | - int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
---|
| 4071 | + int (*cancel_remain_on_channel)(struct ieee80211_hw *hw, |
---|
| 4072 | + struct ieee80211_vif *vif); |
---|
3715 | 4073 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
---|
3716 | 4074 | void (*get_ringparam)(struct ieee80211_hw *hw, |
---|
3717 | 4075 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); |
---|
.. | .. |
---|
3784 | 4142 | |
---|
3785 | 4143 | int (*post_channel_switch)(struct ieee80211_hw *hw, |
---|
3786 | 4144 | struct ieee80211_vif *vif); |
---|
| 4145 | + void (*abort_channel_switch)(struct ieee80211_hw *hw, |
---|
| 4146 | + struct ieee80211_vif *vif); |
---|
| 4147 | + void (*channel_switch_rx_beacon)(struct ieee80211_hw *hw, |
---|
| 4148 | + struct ieee80211_vif *vif, |
---|
| 4149 | + struct ieee80211_channel_switch *ch_switch); |
---|
3787 | 4150 | |
---|
3788 | 4151 | int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
---|
3789 | 4152 | void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
---|
.. | .. |
---|
3822 | 4185 | void (*del_nan_func)(struct ieee80211_hw *hw, |
---|
3823 | 4186 | struct ieee80211_vif *vif, |
---|
3824 | 4187 | u8 instance_id); |
---|
| 4188 | + bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *hw, |
---|
| 4189 | + struct sk_buff *head, |
---|
| 4190 | + struct sk_buff *skb); |
---|
| 4191 | + int (*get_ftm_responder_stats)(struct ieee80211_hw *hw, |
---|
| 4192 | + struct ieee80211_vif *vif, |
---|
| 4193 | + struct cfg80211_ftm_responder_stats *ftm_stats); |
---|
| 4194 | + int (*start_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
| 4195 | + struct cfg80211_pmsr_request *request); |
---|
| 4196 | + void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
| 4197 | + struct cfg80211_pmsr_request *request); |
---|
| 4198 | + int (*set_tid_config)(struct ieee80211_hw *hw, |
---|
| 4199 | + struct ieee80211_vif *vif, |
---|
| 4200 | + struct ieee80211_sta *sta, |
---|
| 4201 | + struct cfg80211_tid_config *tid_conf); |
---|
| 4202 | + int (*reset_tid_config)(struct ieee80211_hw *hw, |
---|
| 4203 | + struct ieee80211_vif *vif, |
---|
| 4204 | + struct ieee80211_sta *sta, u8 tids); |
---|
| 4205 | + void (*update_vif_offload)(struct ieee80211_hw *hw, |
---|
| 4206 | + struct ieee80211_vif *vif); |
---|
| 4207 | + void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
---|
| 4208 | + struct ieee80211_sta *sta, bool enabled); |
---|
| 4209 | + |
---|
| 4210 | + ANDROID_KABI_RESERVE(1); |
---|
| 4211 | + ANDROID_KABI_RESERVE(2); |
---|
| 4212 | + ANDROID_KABI_RESERVE(3); |
---|
| 4213 | + ANDROID_KABI_RESERVE(4); |
---|
3825 | 4214 | }; |
---|
3826 | 4215 | |
---|
3827 | 4216 | /** |
---|
.. | .. |
---|
4058 | 4447 | void ieee80211_restart_hw(struct ieee80211_hw *hw); |
---|
4059 | 4448 | |
---|
4060 | 4449 | /** |
---|
| 4450 | + * ieee80211_rx_list - receive frame and store processed skbs in a list |
---|
| 4451 | + * |
---|
| 4452 | + * Use this function to hand received frames to mac80211. The receive |
---|
| 4453 | + * buffer in @skb must start with an IEEE 802.11 header. In case of a |
---|
| 4454 | + * paged @skb is used, the driver is recommended to put the ieee80211 |
---|
| 4455 | + * header of the frame on the linear part of the @skb to avoid memory |
---|
| 4456 | + * allocation and/or memcpy by the stack. |
---|
| 4457 | + * |
---|
| 4458 | + * This function may not be called in IRQ context. Calls to this function |
---|
| 4459 | + * for a single hardware must be synchronized against each other. Calls to |
---|
| 4460 | + * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be |
---|
| 4461 | + * mixed for a single hardware. Must not run concurrently with |
---|
| 4462 | + * ieee80211_tx_status() or ieee80211_tx_status_ni(). |
---|
| 4463 | + * |
---|
| 4464 | + * This function must be called with BHs disabled and RCU read lock |
---|
| 4465 | + * |
---|
| 4466 | + * @hw: the hardware this frame came in on |
---|
| 4467 | + * @sta: the station the frame was received from, or %NULL |
---|
| 4468 | + * @skb: the buffer to receive, owned by mac80211 after this call |
---|
| 4469 | + * @list: the destination list |
---|
| 4470 | + */ |
---|
| 4471 | +void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
---|
| 4472 | + struct sk_buff *skb, struct list_head *list); |
---|
| 4473 | + |
---|
| 4474 | +/** |
---|
4061 | 4475 | * ieee80211_rx_napi - receive frame from NAPI context |
---|
4062 | 4476 | * |
---|
4063 | 4477 | * Use this function to hand received frames to mac80211. The receive |
---|
.. | .. |
---|
4291 | 4705 | u32 thr); |
---|
4292 | 4706 | |
---|
4293 | 4707 | /** |
---|
| 4708 | + * ieee80211_tx_rate_update - transmit rate update callback |
---|
| 4709 | + * |
---|
| 4710 | + * Drivers should call this functions with a non-NULL pub sta |
---|
| 4711 | + * This function can be used in drivers that does not have provision |
---|
| 4712 | + * in updating the tx rate in data path. |
---|
| 4713 | + * |
---|
| 4714 | + * @hw: the hardware the frame was transmitted by |
---|
| 4715 | + * @pubsta: the station to update the tx rate for. |
---|
| 4716 | + * @info: tx status information |
---|
| 4717 | + */ |
---|
| 4718 | +void ieee80211_tx_rate_update(struct ieee80211_hw *hw, |
---|
| 4719 | + struct ieee80211_sta *pubsta, |
---|
| 4720 | + struct ieee80211_tx_info *info); |
---|
| 4721 | + |
---|
| 4722 | +/** |
---|
4294 | 4723 | * ieee80211_tx_status - transmit status callback |
---|
4295 | 4724 | * |
---|
4296 | 4725 | * Call this function for all transmitted frames after they have been |
---|
.. | .. |
---|
4390 | 4819 | struct sk_buff *skb); |
---|
4391 | 4820 | |
---|
4392 | 4821 | /** |
---|
| 4822 | + * ieee80211_tx_status_8023 - transmit status callback for 802.3 frame format |
---|
| 4823 | + * |
---|
| 4824 | + * Call this function for all transmitted data frames after their transmit |
---|
| 4825 | + * completion. This callback should only be called for data frames which |
---|
| 4826 | + * are using driver's (or hardware's) offload capability of encap/decap |
---|
| 4827 | + * 802.11 frames. |
---|
| 4828 | + * |
---|
| 4829 | + * This function may not be called in IRQ context. Calls to this function |
---|
| 4830 | + * for a single hardware must be synchronized against each other and all |
---|
| 4831 | + * calls in the same tx status family. |
---|
| 4832 | + * |
---|
| 4833 | + * @hw: the hardware the frame was transmitted by |
---|
| 4834 | + * @vif: the interface for which the frame was transmitted |
---|
| 4835 | + * @skb: the frame that was transmitted, owned by mac80211 after this call |
---|
| 4836 | + */ |
---|
| 4837 | +void ieee80211_tx_status_8023(struct ieee80211_hw *hw, |
---|
| 4838 | + struct ieee80211_vif *vif, |
---|
| 4839 | + struct sk_buff *skb); |
---|
| 4840 | + |
---|
| 4841 | +/** |
---|
4393 | 4842 | * ieee80211_report_low_ack - report non-responding station |
---|
4394 | 4843 | * |
---|
4395 | 4844 | * When operating in AP-mode, call this function to report a non-responding |
---|
.. | .. |
---|
4400 | 4849 | */ |
---|
4401 | 4850 | void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); |
---|
4402 | 4851 | |
---|
4403 | | -#define IEEE80211_MAX_CSA_COUNTERS_NUM 2 |
---|
| 4852 | +#define IEEE80211_MAX_CNTDWN_COUNTERS_NUM 2 |
---|
4404 | 4853 | |
---|
4405 | 4854 | /** |
---|
4406 | 4855 | * struct ieee80211_mutable_offsets - mutable beacon offsets |
---|
4407 | 4856 | * @tim_offset: position of TIM element |
---|
4408 | 4857 | * @tim_length: size of TIM element |
---|
4409 | | - * @csa_counter_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets |
---|
4410 | | - * to CSA counters. This array can contain zero values which |
---|
| 4858 | + * @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets |
---|
| 4859 | + * to countdown counters. This array can contain zero values which |
---|
4411 | 4860 | * should be ignored. |
---|
4412 | 4861 | */ |
---|
4413 | 4862 | struct ieee80211_mutable_offsets { |
---|
4414 | 4863 | u16 tim_offset; |
---|
4415 | 4864 | u16 tim_length; |
---|
4416 | 4865 | |
---|
4417 | | - u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM]; |
---|
| 4866 | + u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; |
---|
4418 | 4867 | }; |
---|
4419 | 4868 | |
---|
4420 | 4869 | /** |
---|
.. | .. |
---|
4483 | 4932 | } |
---|
4484 | 4933 | |
---|
4485 | 4934 | /** |
---|
4486 | | - * ieee80211_csa_update_counter - request mac80211 to decrement the csa counter |
---|
| 4935 | + * ieee80211_beacon_update_cntdwn - request mac80211 to decrement the beacon countdown |
---|
4487 | 4936 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
4488 | 4937 | * |
---|
4489 | | - * The csa counter should be updated after each beacon transmission. |
---|
| 4938 | + * The beacon counter should be updated after each beacon transmission. |
---|
4490 | 4939 | * This function is called implicitly when |
---|
4491 | 4940 | * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the |
---|
4492 | 4941 | * beacon frames are generated by the device, the driver should call this |
---|
4493 | | - * function after each beacon transmission to sync mac80211's csa counters. |
---|
| 4942 | + * function after each beacon transmission to sync mac80211's beacon countdown. |
---|
4494 | 4943 | * |
---|
4495 | | - * Return: new csa counter value |
---|
| 4944 | + * Return: new countdown value |
---|
4496 | 4945 | */ |
---|
4497 | | -u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif); |
---|
| 4946 | +u8 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif); |
---|
4498 | 4947 | |
---|
4499 | 4948 | /** |
---|
4500 | | - * ieee80211_csa_set_counter - request mac80211 to set csa counter |
---|
| 4949 | + * ieee80211_beacon_set_cntdwn - request mac80211 to set beacon countdown |
---|
4501 | 4950 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
4502 | 4951 | * @counter: the new value for the counter |
---|
4503 | 4952 | * |
---|
4504 | | - * The csa counter can be changed by the device, this API should be |
---|
| 4953 | + * The beacon countdown can be changed by the device, this API should be |
---|
4505 | 4954 | * used by the device driver to update csa counter in mac80211. |
---|
4506 | 4955 | * |
---|
4507 | | - * It should never be used together with ieee80211_csa_update_counter(), |
---|
| 4956 | + * It should never be used together with ieee80211_beacon_update_cntdwn(), |
---|
4508 | 4957 | * as it will cause a race condition around the counter value. |
---|
4509 | 4958 | */ |
---|
4510 | | -void ieee80211_csa_set_counter(struct ieee80211_vif *vif, u8 counter); |
---|
| 4959 | +void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter); |
---|
4511 | 4960 | |
---|
4512 | 4961 | /** |
---|
4513 | 4962 | * ieee80211_csa_finish - notify mac80211 about channel switch |
---|
.. | .. |
---|
4520 | 4969 | void ieee80211_csa_finish(struct ieee80211_vif *vif); |
---|
4521 | 4970 | |
---|
4522 | 4971 | /** |
---|
4523 | | - * ieee80211_csa_is_complete - find out if counters reached 1 |
---|
| 4972 | + * ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1 |
---|
4524 | 4973 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
4525 | 4974 | * |
---|
4526 | | - * This function returns whether the channel switch counters reached zero. |
---|
| 4975 | + * This function returns whether the countdown reached zero. |
---|
4527 | 4976 | */ |
---|
4528 | | -bool ieee80211_csa_is_complete(struct ieee80211_vif *vif); |
---|
4529 | | - |
---|
| 4977 | +bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif); |
---|
4530 | 4978 | |
---|
4531 | 4979 | /** |
---|
4532 | 4980 | * ieee80211_proberesp_get - retrieve a Probe Response template |
---|
.. | .. |
---|
4981 | 5429 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all |
---|
4982 | 5430 | * interfaces, even if they haven't been re-added to the driver yet. |
---|
4983 | 5431 | * @IEEE80211_IFACE_ITER_ACTIVE: Iterate only active interfaces (netdev is up). |
---|
| 5432 | + * @IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER: Skip any interfaces where SDATA |
---|
| 5433 | + * is not in the driver. This may fix crashes during firmware recovery |
---|
| 5434 | + * for instance. |
---|
4984 | 5435 | */ |
---|
4985 | 5436 | enum ieee80211_interface_iteration_flags { |
---|
4986 | 5437 | IEEE80211_IFACE_ITER_NORMAL = 0, |
---|
4987 | 5438 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), |
---|
4988 | 5439 | IEEE80211_IFACE_ITER_ACTIVE = BIT(1), |
---|
| 5440 | + IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2), |
---|
4989 | 5441 | }; |
---|
4990 | 5442 | |
---|
4991 | 5443 | /** |
---|
.. | .. |
---|
5283 | 5735 | void ieee80211_send_eosp_nullfunc(struct ieee80211_sta *pubsta, int tid); |
---|
5284 | 5736 | |
---|
5285 | 5737 | /** |
---|
| 5738 | + * ieee80211_sta_register_airtime - register airtime usage for a sta/tid |
---|
| 5739 | + * |
---|
| 5740 | + * Register airtime usage for a given sta on a given tid. The driver must call |
---|
| 5741 | + * this function to notify mac80211 that a station used a certain amount of |
---|
| 5742 | + * airtime. This information will be used by the TXQ scheduler to schedule |
---|
| 5743 | + * stations in a way that ensures airtime fairness. |
---|
| 5744 | + * |
---|
| 5745 | + * The reported airtime should as a minimum include all time that is spent |
---|
| 5746 | + * transmitting to the remote station, including overhead and padding, but not |
---|
| 5747 | + * including time spent waiting for a TXOP. If the time is not reported by the |
---|
| 5748 | + * hardware it can in some cases be calculated from the rate and known frame |
---|
| 5749 | + * composition. When possible, the time should include any failed transmission |
---|
| 5750 | + * attempts. |
---|
| 5751 | + * |
---|
| 5752 | + * The driver can either call this function synchronously for every packet or |
---|
| 5753 | + * aggregate, or asynchronously as airtime usage information becomes available. |
---|
| 5754 | + * TX and RX airtime can be reported together, or separately by setting one of |
---|
| 5755 | + * them to 0. |
---|
| 5756 | + * |
---|
| 5757 | + * @pubsta: the station |
---|
| 5758 | + * @tid: the TID to register airtime for |
---|
| 5759 | + * @tx_airtime: airtime used during TX (in usec) |
---|
| 5760 | + * @rx_airtime: airtime used during RX (in usec) |
---|
| 5761 | + */ |
---|
| 5762 | +void ieee80211_sta_register_airtime(struct ieee80211_sta *pubsta, u8 tid, |
---|
| 5763 | + u32 tx_airtime, u32 rx_airtime); |
---|
| 5764 | + |
---|
| 5765 | +/** |
---|
| 5766 | + * ieee80211_txq_airtime_check - check if a txq can send frame to device |
---|
| 5767 | + * |
---|
| 5768 | + * @hw: pointer obtained from ieee80211_alloc_hw() |
---|
| 5769 | + * @txq: pointer obtained from station or virtual interface |
---|
| 5770 | + * |
---|
| 5771 | + * Return true if the AQL's airtime limit has not been reached and the txq can |
---|
| 5772 | + * continue to send more packets to the device. Otherwise return false. |
---|
| 5773 | + */ |
---|
| 5774 | +bool |
---|
| 5775 | +ieee80211_txq_airtime_check(struct ieee80211_hw *hw, struct ieee80211_txq *txq); |
---|
| 5776 | + |
---|
| 5777 | +/** |
---|
5286 | 5778 | * ieee80211_iter_keys - iterate keys programmed into the device |
---|
5287 | 5779 | * @hw: pointer obtained from ieee80211_alloc_hw() |
---|
5288 | 5780 | * @vif: virtual interface to iterate, may be %NULL for all |
---|
.. | .. |
---|
5335 | 5827 | |
---|
5336 | 5828 | /** |
---|
5337 | 5829 | * ieee80211_iter_chan_contexts_atomic - iterate channel contexts |
---|
5338 | | - * @hw: pointre obtained from ieee80211_alloc_hw(). |
---|
| 5830 | + * @hw: pointer obtained from ieee80211_alloc_hw(). |
---|
5339 | 5831 | * @iter: iterator function |
---|
5340 | 5832 | * @iter_data: data passed to iterator function |
---|
5341 | 5833 | * |
---|
.. | .. |
---|
5642 | 6134 | bool bss; |
---|
5643 | 6135 | }; |
---|
5644 | 6136 | |
---|
| 6137 | +/** |
---|
| 6138 | + * enum rate_control_capabilities - rate control capabilities |
---|
| 6139 | + */ |
---|
| 6140 | +enum rate_control_capabilities { |
---|
| 6141 | + /** |
---|
| 6142 | + * @RATE_CTRL_CAPA_VHT_EXT_NSS_BW: |
---|
| 6143 | + * Support for extended NSS BW support (dot11VHTExtendedNSSCapable) |
---|
| 6144 | + * Note that this is only looked at if the minimum number of chains |
---|
| 6145 | + * that the AP uses is < the number of TX chains the hardware has, |
---|
| 6146 | + * otherwise the NSS difference doesn't bother us. |
---|
| 6147 | + */ |
---|
| 6148 | + RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0), |
---|
| 6149 | +}; |
---|
| 6150 | + |
---|
5645 | 6151 | struct rate_control_ops { |
---|
| 6152 | + unsigned long capa; |
---|
5646 | 6153 | const char *name; |
---|
5647 | | - void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); |
---|
| 6154 | + void *(*alloc)(struct ieee80211_hw *hw); |
---|
| 6155 | + void (*add_debugfs)(struct ieee80211_hw *hw, void *priv, |
---|
| 6156 | + struct dentry *debugfsdir); |
---|
5648 | 6157 | void (*free)(void *priv); |
---|
5649 | 6158 | |
---|
5650 | 6159 | void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); |
---|
.. | .. |
---|
5669 | 6178 | |
---|
5670 | 6179 | void (*add_sta_debugfs)(void *priv, void *priv_sta, |
---|
5671 | 6180 | struct dentry *dir); |
---|
5672 | | - void (*remove_sta_debugfs)(void *priv, void *priv_sta); |
---|
5673 | 6181 | |
---|
5674 | 6182 | u32 (*get_expected_throughput)(void *priv_sta); |
---|
| 6183 | + |
---|
| 6184 | + ANDROID_KABI_RESERVE(1); |
---|
| 6185 | + ANDROID_KABI_RESERVE(2); |
---|
| 6186 | + ANDROID_KABI_RESERVE(3); |
---|
| 6187 | + ANDROID_KABI_RESERVE(4); |
---|
5675 | 6188 | }; |
---|
5676 | 6189 | |
---|
5677 | 6190 | static inline int rate_supported(struct ieee80211_sta *sta, |
---|
.. | .. |
---|
5680 | 6193 | { |
---|
5681 | 6194 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); |
---|
5682 | 6195 | } |
---|
5683 | | - |
---|
5684 | | -/** |
---|
5685 | | - * rate_control_send_low - helper for drivers for management/no-ack frames |
---|
5686 | | - * |
---|
5687 | | - * Rate control algorithms that agree to use the lowest rate to |
---|
5688 | | - * send management frames and NO_ACK data with the respective hw |
---|
5689 | | - * retries should use this in the beginning of their mac80211 get_rate |
---|
5690 | | - * callback. If true is returned the rate control can simply return. |
---|
5691 | | - * If false is returned we guarantee that sta and sta and priv_sta is |
---|
5692 | | - * not null. |
---|
5693 | | - * |
---|
5694 | | - * Rate control algorithms wishing to do more intelligent selection of |
---|
5695 | | - * rate for multicast/broadcast frames may choose to not use this. |
---|
5696 | | - * |
---|
5697 | | - * @sta: &struct ieee80211_sta pointer to the target destination. Note |
---|
5698 | | - * that this may be null. |
---|
5699 | | - * @priv_sta: private rate control structure. This may be null. |
---|
5700 | | - * @txrc: rate control information we sholud populate for mac80211. |
---|
5701 | | - */ |
---|
5702 | | -bool rate_control_send_low(struct ieee80211_sta *sta, |
---|
5703 | | - void *priv_sta, |
---|
5704 | | - struct ieee80211_tx_rate_control *txrc); |
---|
5705 | | - |
---|
5706 | 6196 | |
---|
5707 | 6197 | static inline s8 |
---|
5708 | 6198 | rate_lowest_index(struct ieee80211_supported_band *sband, |
---|
.. | .. |
---|
5868 | 6358 | int band, struct ieee80211_sta **sta); |
---|
5869 | 6359 | |
---|
5870 | 6360 | /** |
---|
| 6361 | + * ieee80211_parse_tx_radiotap - Sanity-check and parse the radiotap header |
---|
| 6362 | + * of injected frames. |
---|
| 6363 | + * |
---|
| 6364 | + * To accurately parse and take into account rate and retransmission fields, |
---|
| 6365 | + * you must initialize the chandef field in the ieee80211_tx_info structure |
---|
| 6366 | + * of the skb before calling this function. |
---|
| 6367 | + * |
---|
| 6368 | + * @skb: packet injected by userspace |
---|
| 6369 | + * @dev: the &struct device of this 802.11 device |
---|
| 6370 | + */ |
---|
| 6371 | +bool ieee80211_parse_tx_radiotap(struct sk_buff *skb, |
---|
| 6372 | + struct net_device *dev); |
---|
| 6373 | + |
---|
| 6374 | +/** |
---|
5871 | 6375 | * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state |
---|
5872 | 6376 | * |
---|
5873 | 6377 | * @next_tsf: TSF timestamp of the next absent state change |
---|
.. | .. |
---|
5915 | 6419 | void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf); |
---|
5916 | 6420 | |
---|
5917 | 6421 | /** |
---|
5918 | | - * ieee80211_tdls_oper - request userspace to perform a TDLS operation |
---|
| 6422 | + * ieee80211_tdls_oper_request - request userspace to perform a TDLS operation |
---|
5919 | 6423 | * @vif: virtual interface |
---|
5920 | 6424 | * @peer: the peer's destination address |
---|
5921 | 6425 | * @oper: the requested TDLS operation |
---|
.. | .. |
---|
5969 | 6473 | * ieee80211_tx_dequeue - dequeue a packet from a software tx queue |
---|
5970 | 6474 | * |
---|
5971 | 6475 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
5972 | | - * @txq: pointer obtained from station or virtual interface |
---|
| 6476 | + * @txq: pointer obtained from station or virtual interface, or from |
---|
| 6477 | + * ieee80211_next_txq() |
---|
5973 | 6478 | * |
---|
5974 | 6479 | * Returns the skb if successful, %NULL if no frame was available. |
---|
| 6480 | + * |
---|
| 6481 | + * Note that this must be called in an rcu_read_lock() critical section, |
---|
| 6482 | + * which can only be released after the SKB was handled. Some pointers in |
---|
| 6483 | + * skb->cb, e.g. the key pointer, are protected by RCU and thus the |
---|
| 6484 | + * critical section must persist not just for the duration of this call |
---|
| 6485 | + * but for the duration of the frame handling. |
---|
| 6486 | + * However, also note that while in the wake_tx_queue() method, |
---|
| 6487 | + * rcu_read_lock() is already held. |
---|
| 6488 | + * |
---|
| 6489 | + * softirqs must also be disabled when this function is called. |
---|
| 6490 | + * In process context, use ieee80211_tx_dequeue_ni() instead. |
---|
5975 | 6491 | */ |
---|
5976 | 6492 | struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, |
---|
5977 | 6493 | struct ieee80211_txq *txq); |
---|
| 6494 | + |
---|
| 6495 | +/** |
---|
| 6496 | + * ieee80211_tx_dequeue_ni - dequeue a packet from a software tx queue |
---|
| 6497 | + * (in process context) |
---|
| 6498 | + * |
---|
| 6499 | + * Like ieee80211_tx_dequeue() but can be called in process context |
---|
| 6500 | + * (internally disables bottom halves). |
---|
| 6501 | + * |
---|
| 6502 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6503 | + * @txq: pointer obtained from station or virtual interface, or from |
---|
| 6504 | + * ieee80211_next_txq() |
---|
| 6505 | + */ |
---|
| 6506 | +static inline struct sk_buff *ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, |
---|
| 6507 | + struct ieee80211_txq *txq) |
---|
| 6508 | +{ |
---|
| 6509 | + struct sk_buff *skb; |
---|
| 6510 | + |
---|
| 6511 | + local_bh_disable(); |
---|
| 6512 | + skb = ieee80211_tx_dequeue(hw, txq); |
---|
| 6513 | + local_bh_enable(); |
---|
| 6514 | + |
---|
| 6515 | + return skb; |
---|
| 6516 | +} |
---|
| 6517 | + |
---|
| 6518 | +/** |
---|
| 6519 | + * ieee80211_next_txq - get next tx queue to pull packets from |
---|
| 6520 | + * |
---|
| 6521 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6522 | + * @ac: AC number to return packets from. |
---|
| 6523 | + * |
---|
| 6524 | + * Returns the next txq if successful, %NULL if no queue is eligible. If a txq |
---|
| 6525 | + * is returned, it should be returned with ieee80211_return_txq() after the |
---|
| 6526 | + * driver has finished scheduling it. |
---|
| 6527 | + */ |
---|
| 6528 | +struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac); |
---|
| 6529 | + |
---|
| 6530 | +/** |
---|
| 6531 | + * ieee80211_txq_schedule_start - start new scheduling round for TXQs |
---|
| 6532 | + * |
---|
| 6533 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6534 | + * @ac: AC number to acquire locks for |
---|
| 6535 | + * |
---|
| 6536 | + * Should be called before ieee80211_next_txq() or ieee80211_return_txq(). |
---|
| 6537 | + * The driver must not call multiple TXQ scheduling rounds concurrently. |
---|
| 6538 | + */ |
---|
| 6539 | +void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac); |
---|
| 6540 | + |
---|
| 6541 | +/* (deprecated) */ |
---|
| 6542 | +static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac) |
---|
| 6543 | +{ |
---|
| 6544 | +} |
---|
| 6545 | + |
---|
| 6546 | +void __ieee80211_schedule_txq(struct ieee80211_hw *hw, |
---|
| 6547 | + struct ieee80211_txq *txq, bool force); |
---|
| 6548 | + |
---|
| 6549 | +/** |
---|
| 6550 | + * ieee80211_schedule_txq - schedule a TXQ for transmission |
---|
| 6551 | + * |
---|
| 6552 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6553 | + * @txq: pointer obtained from station or virtual interface |
---|
| 6554 | + * |
---|
| 6555 | + * Schedules a TXQ for transmission if it is not already scheduled, |
---|
| 6556 | + * even if mac80211 does not have any packets buffered. |
---|
| 6557 | + * |
---|
| 6558 | + * The driver may call this function if it has buffered packets for |
---|
| 6559 | + * this TXQ internally. |
---|
| 6560 | + */ |
---|
| 6561 | +static inline void |
---|
| 6562 | +ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq) |
---|
| 6563 | +{ |
---|
| 6564 | + __ieee80211_schedule_txq(hw, txq, true); |
---|
| 6565 | +} |
---|
| 6566 | + |
---|
| 6567 | +/** |
---|
| 6568 | + * ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq() |
---|
| 6569 | + * |
---|
| 6570 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6571 | + * @txq: pointer obtained from station or virtual interface |
---|
| 6572 | + * @force: schedule txq even if mac80211 does not have any buffered packets. |
---|
| 6573 | + * |
---|
| 6574 | + * The driver may set force=true if it has buffered packets for this TXQ |
---|
| 6575 | + * internally. |
---|
| 6576 | + */ |
---|
| 6577 | +static inline void |
---|
| 6578 | +ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, |
---|
| 6579 | + bool force) |
---|
| 6580 | +{ |
---|
| 6581 | + __ieee80211_schedule_txq(hw, txq, force); |
---|
| 6582 | +} |
---|
| 6583 | + |
---|
| 6584 | +/** |
---|
| 6585 | + * ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit |
---|
| 6586 | + * |
---|
| 6587 | + * This function is used to check whether given txq is allowed to transmit by |
---|
| 6588 | + * the airtime scheduler, and can be used by drivers to access the airtime |
---|
| 6589 | + * fairness accounting without going using the scheduling order enfored by |
---|
| 6590 | + * next_txq(). |
---|
| 6591 | + * |
---|
| 6592 | + * Returns %true if the airtime scheduler thinks the TXQ should be allowed to |
---|
| 6593 | + * transmit, and %false if it should be throttled. This function can also have |
---|
| 6594 | + * the side effect of rotating the TXQ in the scheduler rotation, which will |
---|
| 6595 | + * eventually bring the deficit to positive and allow the station to transmit |
---|
| 6596 | + * again. |
---|
| 6597 | + * |
---|
| 6598 | + * The API ieee80211_txq_may_transmit() also ensures that TXQ list will be |
---|
| 6599 | + * aligned against driver's own round-robin scheduler list. i.e it rotates |
---|
| 6600 | + * the TXQ list till it makes the requested node becomes the first entry |
---|
| 6601 | + * in TXQ list. Thus both the TXQ list and driver's list are in sync. If this |
---|
| 6602 | + * function returns %true, the driver is expected to schedule packets |
---|
| 6603 | + * for transmission, and then return the TXQ through ieee80211_return_txq(). |
---|
| 6604 | + * |
---|
| 6605 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6606 | + * @txq: pointer obtained from station or virtual interface |
---|
| 6607 | + */ |
---|
| 6608 | +bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw, |
---|
| 6609 | + struct ieee80211_txq *txq); |
---|
5978 | 6610 | |
---|
5979 | 6611 | /** |
---|
5980 | 6612 | * ieee80211_txq_get_depth - get pending frame/byte count of given txq |
---|
.. | .. |
---|
6022 | 6654 | struct cfg80211_nan_match_params *match, |
---|
6023 | 6655 | gfp_t gfp); |
---|
6024 | 6656 | |
---|
| 6657 | +/** |
---|
| 6658 | + * ieee80211_calc_rx_airtime - calculate estimated transmission airtime for RX. |
---|
| 6659 | + * |
---|
| 6660 | + * This function calculates the estimated airtime usage of a frame based on the |
---|
| 6661 | + * rate information in the RX status struct and the frame length. |
---|
| 6662 | + * |
---|
| 6663 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6664 | + * @status: &struct ieee80211_rx_status containing the transmission rate |
---|
| 6665 | + * information. |
---|
| 6666 | + * @len: frame length in bytes |
---|
| 6667 | + */ |
---|
| 6668 | +u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, |
---|
| 6669 | + struct ieee80211_rx_status *status, |
---|
| 6670 | + int len); |
---|
| 6671 | + |
---|
| 6672 | +/** |
---|
| 6673 | + * ieee80211_calc_tx_airtime - calculate estimated transmission airtime for TX. |
---|
| 6674 | + * |
---|
| 6675 | + * This function calculates the estimated airtime usage of a frame based on the |
---|
| 6676 | + * rate information in the TX info struct and the frame length. |
---|
| 6677 | + * |
---|
| 6678 | + * @hw: pointer as obtained from ieee80211_alloc_hw() |
---|
| 6679 | + * @info: &struct ieee80211_tx_info of the frame. |
---|
| 6680 | + * @len: frame length in bytes |
---|
| 6681 | + */ |
---|
| 6682 | +u32 ieee80211_calc_tx_airtime(struct ieee80211_hw *hw, |
---|
| 6683 | + struct ieee80211_tx_info *info, |
---|
| 6684 | + int len); |
---|
| 6685 | +/** |
---|
| 6686 | + * ieee80211_set_hw_80211_encap - enable hardware encapsulation offloading. |
---|
| 6687 | + * |
---|
| 6688 | + * This function is used to notify mac80211 that a vif can be passed raw 802.3 |
---|
| 6689 | + * frames. The driver needs to then handle the 802.11 encapsulation inside the |
---|
| 6690 | + * hardware or firmware. |
---|
| 6691 | + * |
---|
| 6692 | + * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
| 6693 | + * @enable: indicate if the feature should be turned on or off |
---|
| 6694 | + */ |
---|
| 6695 | +bool ieee80211_set_hw_80211_encap(struct ieee80211_vif *vif, bool enable); |
---|
| 6696 | + |
---|
| 6697 | +/** |
---|
| 6698 | + * ieee80211_get_fils_discovery_tmpl - Get FILS discovery template. |
---|
| 6699 | + * @hw: pointer obtained from ieee80211_alloc_hw(). |
---|
| 6700 | + * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
| 6701 | + * |
---|
| 6702 | + * The driver is responsible for freeing the returned skb. |
---|
| 6703 | + * |
---|
| 6704 | + * Return: FILS discovery template. %NULL on error. |
---|
| 6705 | + */ |
---|
| 6706 | +struct sk_buff *ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw, |
---|
| 6707 | + struct ieee80211_vif *vif); |
---|
| 6708 | + |
---|
| 6709 | +/** |
---|
| 6710 | + * ieee80211_get_unsol_bcast_probe_resp_tmpl - Get unsolicited broadcast |
---|
| 6711 | + * probe response template. |
---|
| 6712 | + * @hw: pointer obtained from ieee80211_alloc_hw(). |
---|
| 6713 | + * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
---|
| 6714 | + * |
---|
| 6715 | + * The driver is responsible for freeing the returned skb. |
---|
| 6716 | + * |
---|
| 6717 | + * Return: Unsolicited broadcast probe response template. %NULL on error. |
---|
| 6718 | + */ |
---|
| 6719 | +struct sk_buff * |
---|
| 6720 | +ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, |
---|
| 6721 | + struct ieee80211_vif *vif); |
---|
6025 | 6722 | #endif /* MAC80211_H */ |
---|