wifi: cfg80211: do some rework towards MLO link APIs
[carl9170fw.git] / include / linux / ieee80211.h
index 6d4db426ae12e997245f8782c915f0fc1db2e6b0..690441b17f477753ebf59e0c689271e7d170cddc 100644 (file)
@@ -69,6 +69,7 @@
 #define IEEE80211_STYPE_ACTION         0x00D0
 
 /* control */
+#define IEEE80211_STYPE_TRIGGER                0x0020
 #define IEEE80211_STYPE_CTL_EXT                0x0060
 #define IEEE80211_STYPE_BACK_REQ       0x0080
 #define IEEE80211_STYPE_BACK           0x0090
@@ -283,6 +284,17 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
 
 #define IEEE80211_HT_CTL_LEN           4
 
+/* trigger type within common_info of trigger frame */
+#define IEEE80211_TRIGGER_TYPE_MASK            0xf
+#define IEEE80211_TRIGGER_TYPE_BASIC           0x0
+#define IEEE80211_TRIGGER_TYPE_BFRP            0x1
+#define IEEE80211_TRIGGER_TYPE_MU_BAR          0x2
+#define IEEE80211_TRIGGER_TYPE_MU_RTS          0x3
+#define IEEE80211_TRIGGER_TYPE_BSRP            0x4
+#define IEEE80211_TRIGGER_TYPE_GCR_MU_BAR      0x5
+#define IEEE80211_TRIGGER_TYPE_BQRP            0x6
+#define IEEE80211_TRIGGER_TYPE_NFRP            0x7
+
 struct ieee80211_hdr {
        __le16 frame_control;
        __le16 duration_id;
@@ -312,6 +324,15 @@ struct ieee80211_qos_hdr {
        __le16 qos_ctrl;
 } __packed __aligned(2);
 
+struct ieee80211_trigger {
+       __le16 frame_control;
+       __le16 duration;
+       u8 ra[6];
+       u8 ta[6];
+       __le64 common_info;
+       u8 variable[];
+} __packed __aligned(2);
+
 /**
  * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
  * @fc: frame control bytes in little-endian byteorder
@@ -733,6 +754,16 @@ static inline unsigned int ieee80211_hdrlen(__le16 fc)
         return hdrlen;
 }
 
+/**
+ * ieee80211_is_trigger - check if frame is trigger frame
+ * @fc: frame control field in little-endian byteorder
+ */
+static inline bool ieee80211_is_trigger(__le16 fc)
+{
+       return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
+              cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_TRIGGER);
+}
+
 /**
  * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame
  * @fc: frame control bytes in little-endian byteorder
@@ -1025,6 +1056,8 @@ struct ieee80211_tpc_report_ie {
 #define IEEE80211_ADDBA_EXT_FRAG_LEVEL_MASK    GENMASK(2, 1)
 #define IEEE80211_ADDBA_EXT_FRAG_LEVEL_SHIFT   1
 #define IEEE80211_ADDBA_EXT_NO_FRAG            BIT(0)
+#define IEEE80211_ADDBA_EXT_BUF_SIZE_MASK      GENMASK(7, 5)
+#define IEEE80211_ADDBA_EXT_BUF_SIZE_SHIFT     10
 
 struct ieee80211_addba_ext_ie {
        u8 data;
@@ -1716,10 +1749,12 @@ struct ieee80211_ht_operation {
  * A-MPDU buffer sizes
  * According to HT size varies from 8 to 64 frames
  * HE adds the ability to have up to 256 frames.
+ * EHT adds the ability to have up to 1K frames.
  */
 #define IEEE80211_MIN_AMPDU_BUF                0x8
 #define IEEE80211_MAX_AMPDU_BUF_HT     0x40
-#define IEEE80211_MAX_AMPDU_BUF                0x100
+#define IEEE80211_MAX_AMPDU_BUF_HE     0x100
+#define IEEE80211_MAX_AMPDU_BUF_EHT    0x400
 
 
 /* Spatial Multiplexing Power Save Modes (for capability) */
@@ -2435,6 +2470,7 @@ ieee80211_he_mcs_nss_size(const struct ieee80211_he_cap_elem *he_cap)
 #define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK              0x78
 #define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_POS               (3)
 #define IEEE80211_PPE_THRES_INFO_PPET_SIZE                     (3)
+#define IEEE80211_HE_PPE_THRES_INFO_HEADER_SIZE                        (7)
 
 /*
  * Calculate 802.11ax HE capabilities IE PPE field size
@@ -4269,4 +4305,7 @@ enum ieee80211_range_params_max_total_ltf {
        IEEE80211_RANGE_PARAMS_MAX_TOTAL_LTF_UNSPECIFIED,
 };
 
+/* multi-link device */
+#define IEEE80211_MLD_MAX_NUM_LINKS    15
+
 #endif /* __LINUX_IEEE80211_H */