]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - include/net/mac80211.h
mac80211: Fix PTK rekey freezes and clear text leak
[mirror_ubuntu-jammy-kernel.git] / include / net / mac80211.h
index 5790f55c241df838384145428cc7305cb83904f7..8c26d2d36cbec16fde3df1480a844b21f019307d 100644 (file)
  * Drivers indicate that they use this model by implementing the .wake_tx_queue
  * driver operation.
  *
- * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a
- * single per-vif queue for multicast data frames.
+ * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with
+ * another per-sta for non-data/non-mgmt and bufferable management frames, and
+ * a single per-vif queue for multicast data frames.
  *
  * The driver is expected to initialize its private per-queue data for stations
  * and interfaces in the .add_interface and .sta_add ops.
@@ -1140,6 +1141,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
  *     from the RX info data, so leave those zeroed when building this data)
  * @RX_FLAG_RADIOTAP_HE_MU: HE MU radiotap data is present
  *     (&struct ieee80211_radiotap_he_mu)
+ * @RX_FLAG_RADIOTAP_LSIG: L-SIG radiotap data is present
  */
 enum mac80211_rx_flags {
        RX_FLAG_MMIC_ERROR              = BIT(0),
@@ -1170,6 +1172,7 @@ enum mac80211_rx_flags {
        RX_FLAG_AMPDU_EOF_BIT_KNOWN     = BIT(25),
        RX_FLAG_RADIOTAP_HE             = BIT(26),
        RX_FLAG_RADIOTAP_HE_MU          = BIT(27),
+       RX_FLAG_RADIOTAP_LSIG           = BIT(28),
 };
 
 /**
@@ -1504,6 +1507,8 @@ enum ieee80211_vif_flags {
  * @drv_priv: data area for driver use, will always be aligned to
  *     sizeof(void \*).
  * @txq: the multicast data TX queue (if driver uses the TXQ abstraction)
+ * @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped,
+ *     protected by fq->lock.
  */
 struct ieee80211_vif {
        enum nl80211_iftype type;
@@ -1528,6 +1533,8 @@ struct ieee80211_vif {
 
        unsigned int probe_req_reg;
 
+       bool txqs_stopped[IEEE80211_NUM_ACS];
+
        /* must be last */
        u8 drv_priv[0] __aligned(sizeof(void *));
 };
@@ -1839,7 +1846,8 @@ struct ieee80211_sta_rates {
  *     unlimited.
  * @support_p2p_ps: indicates whether the STA supports P2P PS mechanism or not.
  * @max_rc_amsdu_len: Maximum A-MSDU size in bytes recommended by rate control.
- * @txq: per-TID data TX queues (if driver uses the TXQ abstraction)
+ * @txq: per-TID data TX queues (if driver uses the TXQ abstraction); note that
+ *     the last entry (%IEEE80211_NUM_TIDS) is used for non-data frames
  */
 struct ieee80211_sta {
        u32 supp_rates[NUM_NL80211_BANDS];
@@ -1880,7 +1888,7 @@ struct ieee80211_sta {
        bool support_p2p_ps;
        u16 max_rc_amsdu_len;
 
-       struct ieee80211_txq *txq[IEEE80211_NUM_TIDS];
+       struct ieee80211_txq *txq[IEEE80211_NUM_TIDS + 1];
 
        /* must be last */
        u8 drv_priv[0] __aligned(sizeof(void *));
@@ -1914,7 +1922,8 @@ struct ieee80211_tx_control {
  *
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
  * @sta: station table entry, %NULL for per-vif queue
- * @tid: the TID for this queue (unused for per-vif queue)
+ * @tid: the TID for this queue (unused for per-vif queue),
+ *     %IEEE80211_NUM_TIDS for non-data (if enabled)
  * @ac: the AC for this queue
  * @drv_priv: driver private area, sized by hw->txq_data_size
  *
@@ -2127,6 +2136,15 @@ struct ieee80211_txq {
  * @IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP: The driver (or firmware) doesn't
  *     support QoS NDP for AP probing - that's most likely a driver bug.
  *
+ * @IEEE80211_HW_BUFF_MMPDU_TXQ: use the TXQ for bufferable MMPDUs, this of
+ *     course requires the driver to use TXQs to start with.
+ *
+ * @IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW: (Hardware) rate control supports VHT
+ *     extended NSS BW (dot11VHTExtendedNSSBWCapable). This flag will be set if
+ *     the selected rate control algorithm sets %RATE_CTRL_CAPA_VHT_EXT_NSS_BW
+ *     but if the rate control is built-in then it must be set by the driver.
+ *     See also the documentation for that flag.
+ *
  * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
  */
 enum ieee80211_hw_flags {
@@ -2172,6 +2190,8 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
        IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP,
        IEEE80211_HW_DOESNT_SUPPORT_QOS_NDP,
+       IEEE80211_HW_BUFF_MMPDU_TXQ,
+       IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW,
 
        /* keep last, obviously */
        NUM_IEEE80211_HW_FLAGS
@@ -2290,6 +2310,10 @@ enum ieee80211_hw_flags {
  *     supported by HW.
  * @max_nan_de_entries: maximum number of NAN DE functions supported by the
  *     device.
+ *
+ * @tx_sk_pacing_shift: Pacing shift to set on TCP sockets when frames from
+ *     them are encountered. The default should typically not be changed,
+ *     unless the driver has good reasons for needing more buffers.
  */
 struct ieee80211_hw {
        struct ieee80211_conf conf;
@@ -2325,6 +2349,7 @@ struct ieee80211_hw {
        u8 n_cipher_schemes;
        const struct ieee80211_cipher_scheme *cipher_schemes;
        u8 max_nan_de_entries;
+       u8 tx_sk_pacing_shift;
 };
 
 static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
@@ -2506,6 +2531,19 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  * The set_default_unicast_key() call updates the default WEP key index
  * configured to the hardware for WEP encryption type. This is required
  * for devices that support offload of data packets (e.g. ARP responses).
+ *
+ * Mac80211 drivers should set the @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 flag
+ * when they are able to replace in-use PTK keys according to to following
+ * requirements:
+ * 1) They do not hand over frames decrypted with the old key to
+      mac80211 once the call to set_key() with command %DISABLE_KEY has been
+      completed when also setting @IEEE80211_KEY_FLAG_GENERATE_IV for any key,
+   2) either drop or continue to use the old key for any outgoing frames queued
+      at the time of the key deletion (including re-transmits),
+   3) never send out a frame queued prior to the set_key() %SET_KEY command
+      encrypted with the new key and
+   4) never send out a frame unencrypted when it should be encrypted.
+   Mac80211 will not queue any new frames for a deleted key to the driver.
  */
 
 /**
@@ -5644,7 +5682,22 @@ struct ieee80211_tx_rate_control {
        bool bss;
 };
 
+/**
+ * enum rate_control_capabilities - rate control capabilities
+ */
+enum rate_control_capabilities {
+       /**
+        * @RATE_CTRL_CAPA_VHT_EXT_NSS_BW:
+        * Support for extended NSS BW support (dot11VHTExtendedNSSCapable)
+        * Note that this is only looked at if the minimum number of chains
+        * that the AP uses is < the number of TX chains the hardware has,
+        * otherwise the NSS difference doesn't bother us.
+        */
+       RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0),
+};
+
 struct rate_control_ops {
+       unsigned long capa;
        const char *name;
        void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
        void (*free)(void *priv);