linux/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
   2/*
   3 * Copyright (C) 2012-2014, 2018-2020 Intel Corporation
   4 * Copyright (C) 2017 Intel Deutschland GmbH
   5 */
   6#ifndef __iwl_fw_api_mac_h__
   7#define __iwl_fw_api_mac_h__
   8
   9/*
  10 * The first MAC indices (starting from 0) are available to the driver,
  11 * AUX indices follows - 1 for non-CDB, 2 for CDB.
  12 */
  13#define MAC_INDEX_AUX           4
  14#define MAC_INDEX_MIN_DRIVER    0
  15#define NUM_MAC_INDEX_DRIVER    MAC_INDEX_AUX
  16#define NUM_MAC_INDEX           (NUM_MAC_INDEX_DRIVER + 1)
  17#define NUM_MAC_INDEX_CDB       (NUM_MAC_INDEX_DRIVER + 2)
  18
  19#define IWL_MVM_STATION_COUNT_MAX       16
  20#define IWL_MVM_INVALID_STA             0xFF
  21
  22enum iwl_ac {
  23        AC_BK,
  24        AC_BE,
  25        AC_VI,
  26        AC_VO,
  27        AC_NUM,
  28};
  29
  30/**
  31 * enum iwl_mac_protection_flags - MAC context flags
  32 * @MAC_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
  33 *      this will require CCK RTS/CTS2self.
  34 *      RTS/CTS will protect full burst time.
  35 * @MAC_PROT_FLG_HT_PROT: enable HT protection
  36 * @MAC_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
  37 * @MAC_PROT_FLG_SELF_CTS_EN: allow CTS2self
  38 */
  39enum iwl_mac_protection_flags {
  40        MAC_PROT_FLG_TGG_PROTECT        = BIT(3),
  41        MAC_PROT_FLG_HT_PROT            = BIT(23),
  42        MAC_PROT_FLG_FAT_PROT           = BIT(24),
  43        MAC_PROT_FLG_SELF_CTS_EN        = BIT(30),
  44};
  45
  46#define MAC_FLG_SHORT_SLOT              BIT(4)
  47#define MAC_FLG_SHORT_PREAMBLE          BIT(5)
  48
  49/**
  50 * enum iwl_mac_types - Supported MAC types
  51 * @FW_MAC_TYPE_FIRST: lowest supported MAC type
  52 * @FW_MAC_TYPE_AUX: Auxiliary MAC (internal)
  53 * @FW_MAC_TYPE_LISTENER: monitor MAC type (?)
  54 * @FW_MAC_TYPE_PIBSS: Pseudo-IBSS
  55 * @FW_MAC_TYPE_IBSS: IBSS
  56 * @FW_MAC_TYPE_BSS_STA: BSS (managed) station
  57 * @FW_MAC_TYPE_P2P_DEVICE: P2P Device
  58 * @FW_MAC_TYPE_P2P_STA: P2P client
  59 * @FW_MAC_TYPE_GO: P2P GO
  60 * @FW_MAC_TYPE_TEST: ?
  61 * @FW_MAC_TYPE_MAX: highest support MAC type
  62 */
  63enum iwl_mac_types {
  64        FW_MAC_TYPE_FIRST = 1,
  65        FW_MAC_TYPE_AUX = FW_MAC_TYPE_FIRST,
  66        FW_MAC_TYPE_LISTENER,
  67        FW_MAC_TYPE_PIBSS,
  68        FW_MAC_TYPE_IBSS,
  69        FW_MAC_TYPE_BSS_STA,
  70        FW_MAC_TYPE_P2P_DEVICE,
  71        FW_MAC_TYPE_P2P_STA,
  72        FW_MAC_TYPE_GO,
  73        FW_MAC_TYPE_TEST,
  74        FW_MAC_TYPE_MAX = FW_MAC_TYPE_TEST
  75}; /* MAC_CONTEXT_TYPE_API_E_VER_1 */
  76
  77/**
  78 * enum iwl_tsf_id - TSF hw timer ID
  79 * @TSF_ID_A: use TSF A
  80 * @TSF_ID_B: use TSF B
  81 * @TSF_ID_C: use TSF C
  82 * @TSF_ID_D: use TSF D
  83 * @NUM_TSF_IDS: number of TSF timers available
  84 */
  85enum iwl_tsf_id {
  86        TSF_ID_A = 0,
  87        TSF_ID_B = 1,
  88        TSF_ID_C = 2,
  89        TSF_ID_D = 3,
  90        NUM_TSF_IDS = 4,
  91}; /* TSF_ID_API_E_VER_1 */
  92
  93/**
  94 * struct iwl_mac_data_ap - configuration data for AP MAC context
  95 * @beacon_time: beacon transmit time in system time
  96 * @beacon_tsf: beacon transmit time in TSF
  97 * @bi: beacon interval in TU
  98 * @reserved1: reserved
  99 * @dtim_interval: dtim transmit time in TU
 100 * @reserved2: reserved
 101 * @mcast_qid: queue ID for multicast traffic.
 102 *      NOTE: obsolete from VER2 and on
 103 * @beacon_template: beacon template ID
 104 */
 105struct iwl_mac_data_ap {
 106        __le32 beacon_time;
 107        __le64 beacon_tsf;
 108        __le32 bi;
 109        __le32 reserved1;
 110        __le32 dtim_interval;
 111        __le32 reserved2;
 112        __le32 mcast_qid;
 113        __le32 beacon_template;
 114} __packed; /* AP_MAC_DATA_API_S_VER_2 */
 115
 116/**
 117 * struct iwl_mac_data_ibss - configuration data for IBSS MAC context
 118 * @beacon_time: beacon transmit time in system time
 119 * @beacon_tsf: beacon transmit time in TSF
 120 * @bi: beacon interval in TU
 121 * @reserved: reserved
 122 * @beacon_template: beacon template ID
 123 */
 124struct iwl_mac_data_ibss {
 125        __le32 beacon_time;
 126        __le64 beacon_tsf;
 127        __le32 bi;
 128        __le32 reserved;
 129        __le32 beacon_template;
 130} __packed; /* IBSS_MAC_DATA_API_S_VER_1 */
 131
 132/**
 133 * enum iwl_mac_data_policy - policy of the data path for this MAC
 134 * @TWT_SUPPORTED: twt is supported
 135 * @MORE_DATA_ACK_SUPPORTED: AP supports More Data Ack according to
 136 *      paragraph 9.4.1.17 in P802.11ax_D4 specification. Used for TWT
 137 *      early termination detection.
 138 * @FLEXIBLE_TWT_SUPPORTED: AP supports flexible TWT schedule
 139 * @PROTECTED_TWT_SUPPORTED: AP supports protected TWT frames (with 11w)
 140 */
 141enum iwl_mac_data_policy {
 142        TWT_SUPPORTED = BIT(0),
 143        MORE_DATA_ACK_SUPPORTED = BIT(1),
 144        FLEXIBLE_TWT_SUPPORTED = BIT(2),
 145        PROTECTED_TWT_SUPPORTED = BIT(3),
 146};
 147
 148/**
 149 * struct iwl_mac_data_sta - configuration data for station MAC context
 150 * @is_assoc: 1 for associated state, 0 otherwise
 151 * @dtim_time: DTIM arrival time in system time
 152 * @dtim_tsf: DTIM arrival time in TSF
 153 * @bi: beacon interval in TU, applicable only when associated
 154 * @reserved1: reserved
 155 * @dtim_interval: DTIM interval in TU, applicable only when associated
 156 * @data_policy: see &enum iwl_mac_data_policy
 157 * @listen_interval: in beacon intervals, applicable only when associated
 158 * @assoc_id: unique ID assigned by the AP during association
 159 * @assoc_beacon_arrive_time: TSF of first beacon after association
 160 */
 161struct iwl_mac_data_sta {
 162        __le32 is_assoc;
 163        __le32 dtim_time;
 164        __le64 dtim_tsf;
 165        __le32 bi;
 166        __le32 reserved1;
 167        __le32 dtim_interval;
 168        __le32 data_policy;
 169        __le32 listen_interval;
 170        __le32 assoc_id;
 171        __le32 assoc_beacon_arrive_time;
 172} __packed; /* STA_MAC_DATA_API_S_VER_2 */
 173
 174/**
 175 * struct iwl_mac_data_go - configuration data for P2P GO MAC context
 176 * @ap: iwl_mac_data_ap struct with most config data
 177 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
 178 *      0 indicates that there is no CT window.
 179 * @opp_ps_enabled: indicate that opportunistic PS allowed
 180 */
 181struct iwl_mac_data_go {
 182        struct iwl_mac_data_ap ap;
 183        __le32 ctwin;
 184        __le32 opp_ps_enabled;
 185} __packed; /* GO_MAC_DATA_API_S_VER_1 */
 186
 187/**
 188 * struct iwl_mac_data_p2p_sta - configuration data for P2P client MAC context
 189 * @sta: iwl_mac_data_sta struct with most config data
 190 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
 191 *      0 indicates that there is no CT window.
 192 */
 193struct iwl_mac_data_p2p_sta {
 194        struct iwl_mac_data_sta sta;
 195        __le32 ctwin;
 196} __packed; /* P2P_STA_MAC_DATA_API_S_VER_2 */
 197
 198/**
 199 * struct iwl_mac_data_pibss - Pseudo IBSS config data
 200 * @stats_interval: interval in TU between statistics notifications to host.
 201 */
 202struct iwl_mac_data_pibss {
 203        __le32 stats_interval;
 204} __packed; /* PIBSS_MAC_DATA_API_S_VER_1 */
 205
 206/*
 207 * struct iwl_mac_data_p2p_dev - configuration data for the P2P Device MAC
 208 * context.
 209 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
 210 *      other channels as well. This should be to true only in case that the
 211 *      device is discoverable and there is an active GO. Note that setting this
 212 *      field when not needed, will increase the number of interrupts and have
 213 *      effect on the platform power, as this setting opens the Rx filters on
 214 *      all macs.
 215 */
 216struct iwl_mac_data_p2p_dev {
 217        __le32 is_disc_extended;
 218} __packed; /* _P2P_DEV_MAC_DATA_API_S_VER_1 */
 219
 220/**
 221 * enum iwl_mac_filter_flags - MAC context filter flags
 222 * @MAC_FILTER_IN_PROMISC: accept all data frames
 223 * @MAC_FILTER_IN_CONTROL_AND_MGMT: pass all management and
 224 *      control frames to the host
 225 * @MAC_FILTER_ACCEPT_GRP: accept multicast frames
 226 * @MAC_FILTER_DIS_DECRYPT: don't decrypt unicast frames
 227 * @MAC_FILTER_DIS_GRP_DECRYPT: don't decrypt multicast frames
 228 * @MAC_FILTER_IN_BEACON: transfer foreign BSS's beacons to host
 229 *      (in station mode when associated)
 230 * @MAC_FILTER_OUT_BCAST: filter out all broadcast frames
 231 * @MAC_FILTER_IN_CRC32: extract FCS and append it to frames
 232 * @MAC_FILTER_IN_PROBE_REQUEST: pass probe requests to host
 233 */
 234enum iwl_mac_filter_flags {
 235        MAC_FILTER_IN_PROMISC           = BIT(0),
 236        MAC_FILTER_IN_CONTROL_AND_MGMT  = BIT(1),
 237        MAC_FILTER_ACCEPT_GRP           = BIT(2),
 238        MAC_FILTER_DIS_DECRYPT          = BIT(3),
 239        MAC_FILTER_DIS_GRP_DECRYPT      = BIT(4),
 240        MAC_FILTER_IN_BEACON            = BIT(6),
 241        MAC_FILTER_OUT_BCAST            = BIT(8),
 242        MAC_FILTER_IN_CRC32             = BIT(11),
 243        MAC_FILTER_IN_PROBE_REQUEST     = BIT(12),
 244        /**
 245         * @MAC_FILTER_IN_11AX: mark BSS as supporting 802.11ax
 246         */
 247        MAC_FILTER_IN_11AX              = BIT(14),
 248};
 249
 250/**
 251 * enum iwl_mac_qos_flags - QoS flags
 252 * @MAC_QOS_FLG_UPDATE_EDCA: ?
 253 * @MAC_QOS_FLG_TGN: HT is enabled
 254 * @MAC_QOS_FLG_TXOP_TYPE: ?
 255 *
 256 */
 257enum iwl_mac_qos_flags {
 258        MAC_QOS_FLG_UPDATE_EDCA = BIT(0),
 259        MAC_QOS_FLG_TGN         = BIT(1),
 260        MAC_QOS_FLG_TXOP_TYPE   = BIT(4),
 261};
 262
 263/**
 264 * struct iwl_ac_qos - QOS timing params for MAC_CONTEXT_CMD
 265 * @cw_min: Contention window, start value in numbers of slots.
 266 *      Should be a power-of-2, minus 1.  Device's default is 0x0f.
 267 * @cw_max: Contention window, max value in numbers of slots.
 268 *      Should be a power-of-2, minus 1.  Device's default is 0x3f.
 269 * @aifsn:  Number of slots in Arbitration Interframe Space (before
 270 *      performing random backoff timing prior to Tx).  Device default 1.
 271 * @fifos_mask: FIFOs used by this MAC for this AC
 272 * @edca_txop:  Length of Tx opportunity, in uSecs.  Device default is 0.
 273 *
 274 * One instance of this config struct for each of 4 EDCA access categories
 275 * in struct iwl_qosparam_cmd.
 276 *
 277 * Device will automatically increase contention window by (2*CW) + 1 for each
 278 * transmission retry.  Device uses cw_max as a bit mask, ANDed with new CW
 279 * value, to cap the CW value.
 280 */
 281struct iwl_ac_qos {
 282        __le16 cw_min;
 283        __le16 cw_max;
 284        u8 aifsn;
 285        u8 fifos_mask;
 286        __le16 edca_txop;
 287} __packed; /* AC_QOS_API_S_VER_2 */
 288
 289/**
 290 * struct iwl_mac_ctx_cmd - command structure to configure MAC contexts
 291 * ( MAC_CONTEXT_CMD = 0x28 )
 292 * @id_and_color: ID and color of the MAC
 293 * @action: action to perform, one of FW_CTXT_ACTION_*
 294 * @mac_type: one of &enum iwl_mac_types
 295 * @tsf_id: TSF HW timer, one of &enum iwl_tsf_id
 296 * @node_addr: MAC address
 297 * @reserved_for_node_addr: reserved
 298 * @bssid_addr: BSSID
 299 * @reserved_for_bssid_addr: reserved
 300 * @cck_rates: basic rates available for CCK
 301 * @ofdm_rates: basic rates available for OFDM
 302 * @protection_flags: combination of &enum iwl_mac_protection_flags
 303 * @cck_short_preamble: 0x20 for enabling short preamble, 0 otherwise
 304 * @short_slot: 0x10 for enabling short slots, 0 otherwise
 305 * @filter_flags: combination of &enum iwl_mac_filter_flags
 306 * @qos_flags: from &enum iwl_mac_qos_flags
 307 * @ac: one iwl_mac_qos configuration for each AC
 308 */
 309struct iwl_mac_ctx_cmd {
 310        /* COMMON_INDEX_HDR_API_S_VER_1 */
 311        __le32 id_and_color;
 312        __le32 action;
 313        /* MAC_CONTEXT_COMMON_DATA_API_S_VER_1 */
 314        __le32 mac_type;
 315        __le32 tsf_id;
 316        u8 node_addr[6];
 317        __le16 reserved_for_node_addr;
 318        u8 bssid_addr[6];
 319        __le16 reserved_for_bssid_addr;
 320        __le32 cck_rates;
 321        __le32 ofdm_rates;
 322        __le32 protection_flags;
 323        __le32 cck_short_preamble;
 324        __le32 short_slot;
 325        __le32 filter_flags;
 326        /* MAC_QOS_PARAM_API_S_VER_1 */
 327        __le32 qos_flags;
 328        struct iwl_ac_qos ac[AC_NUM+1];
 329        /* MAC_CONTEXT_COMMON_DATA_API_S */
 330        union {
 331                struct iwl_mac_data_ap ap;
 332                struct iwl_mac_data_go go;
 333                struct iwl_mac_data_sta sta;
 334                struct iwl_mac_data_p2p_sta p2p_sta;
 335                struct iwl_mac_data_p2p_dev p2p_dev;
 336                struct iwl_mac_data_pibss pibss;
 337                struct iwl_mac_data_ibss ibss;
 338        };
 339} __packed; /* MAC_CONTEXT_CMD_API_S_VER_1 */
 340
 341#define IWL_NONQOS_SEQ_GET      0x1
 342#define IWL_NONQOS_SEQ_SET      0x2
 343struct iwl_nonqos_seq_query_cmd {
 344        __le32 get_set_flag;
 345        __le32 mac_id_n_color;
 346        __le16 value;
 347        __le16 reserved;
 348} __packed; /* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */
 349
 350/**
 351 * struct iwl_missed_beacons_notif - information on missed beacons
 352 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
 353 * @mac_id: interface ID
 354 * @consec_missed_beacons_since_last_rx: number of consecutive missed
 355 *      beacons since last RX.
 356 * @consec_missed_beacons: number of consecutive missed beacons
 357 * @num_expected_beacons: number of expected beacons
 358 * @num_recvd_beacons: number of received beacons
 359 */
 360struct iwl_missed_beacons_notif {
 361        __le32 mac_id;
 362        __le32 consec_missed_beacons_since_last_rx;
 363        __le32 consec_missed_beacons;
 364        __le32 num_expected_beacons;
 365        __le32 num_recvd_beacons;
 366} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
 367
 368/**
 369 * struct iwl_he_backoff_conf - used for backoff configuration
 370 * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)
 371 * used for backoff configuration of TXF5..TXF8 trigger based.
 372 * The MU-TIMER is reloaded w/ MU_TIME each time a frame from the AC is sent via
 373 * trigger-based TX.
 374 * @cwmin: CW min
 375 * @cwmax: CW max
 376 * @aifsn: AIFSN
 377 *      AIFSN=0, means that no backoff from the specified TRIG-BASED AC is
 378 *      allowed till the MU-TIMER is 0
 379 * @mu_time: MU time in 8TU units
 380 */
 381struct iwl_he_backoff_conf {
 382        __le16 cwmin;
 383        __le16 cwmax;
 384        __le16 aifsn;
 385        __le16 mu_time;
 386} __packed; /* AC_QOS_DOT11AX_API_S */
 387
 388/**
 389 * enum iwl_he_pkt_ext_constellations - PPE constellation indices
 390 * @IWL_HE_PKT_EXT_BPSK: BPSK
 391 * @IWL_HE_PKT_EXT_QPSK:  QPSK
 392 * @IWL_HE_PKT_EXT_16QAM: 16-QAM
 393 * @IWL_HE_PKT_EXT_64QAM: 64-QAM
 394 * @IWL_HE_PKT_EXT_256QAM: 256-QAM
 395 * @IWL_HE_PKT_EXT_1024QAM: 1024-QAM
 396 * @IWL_HE_PKT_EXT_RESERVED: reserved value
 397 * @IWL_HE_PKT_EXT_NONE: not defined
 398 */
 399enum iwl_he_pkt_ext_constellations {
 400        IWL_HE_PKT_EXT_BPSK = 0,
 401        IWL_HE_PKT_EXT_QPSK,
 402        IWL_HE_PKT_EXT_16QAM,
 403        IWL_HE_PKT_EXT_64QAM,
 404        IWL_HE_PKT_EXT_256QAM,
 405        IWL_HE_PKT_EXT_1024QAM,
 406        IWL_HE_PKT_EXT_RESERVED,
 407        IWL_HE_PKT_EXT_NONE,
 408};
 409
 410#define MAX_HE_SUPP_NSS 2
 411#define MAX_HE_CHANNEL_BW_INDX  4
 412
 413/**
 414 * struct iwl_he_pkt_ext - QAM thresholds
 415 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS
 416 * The IE is organized in the following way:
 417 * Support for Nss x BW (or RU) matrix:
 418 *      (0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)
 419 * Each entry contains 2 QAM thresholds for 8us and 16us:
 420 *      0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE
 421 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:
 422 *      QAM_tx < QAM_th1            --> PPE=0us
 423 *      QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us
 424 *      QAM_th2 <= QAM_tx           --> PPE=16us
 425 * @pkt_ext_qam_th: QAM thresholds
 426 *      For each Nss/Bw define 2 QAM thrsholds (0..5)
 427 *      For rates below the low_th, no need for PPE
 428 *      For rates between low_th and high_th, need 8us PPE
 429 *      For rates equal or higher then the high_th, need 16us PPE
 430 *      Nss (0-siso, 1-mimo2) x BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz) x
 431 *              (0-low_th, 1-high_th)
 432 */
 433struct iwl_he_pkt_ext {
 434        u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_HE_CHANNEL_BW_INDX][2];
 435} __packed; /* PKT_EXT_DOT11AX_API_S */
 436
 437/**
 438 * enum iwl_he_sta_ctxt_flags - HE STA context flags
 439 * @STA_CTXT_HE_REF_BSSID_VALID: ref bssid addr valid (for receiving specific
 440 *      control frames such as TRIG, NDPA, BACK)
 441 * @STA_CTXT_HE_BSS_COLOR_DIS: BSS color disable, don't use the BSS
 442 *      color for RX filter but use MAC header
 443 * @STA_CTXT_HE_PARTIAL_BSS_COLOR: partial BSS color allocation
 444 * @STA_CTXT_HE_32BIT_BA_BITMAP: indicates the receiver supports BA bitmap
 445 *      of 32-bits
 446 * @STA_CTXT_HE_PACKET_EXT: indicates that the packet-extension info is valid
 447 *      and should be used
 448 * @STA_CTXT_HE_TRIG_RND_ALLOC: indicates that trigger based random allocation
 449 *      is enabled according to UORA element existence
 450 * @STA_CTXT_HE_CONST_TRIG_RND_ALLOC: used for AV testing
 451 * @STA_CTXT_HE_ACK_ENABLED: indicates that the AP supports receiving ACK-
 452 *      enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
 453 * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA
 454 *      parameter set, i.e. the backoff counters for trig-based ACs
 455 * @STA_CTXT_HE_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
 456 *      not allowed (as there are OBSS that might classify such transmissions as
 457 *      radar pulses).
 458 */
 459enum iwl_he_sta_ctxt_flags {
 460        STA_CTXT_HE_REF_BSSID_VALID             = BIT(4),
 461        STA_CTXT_HE_BSS_COLOR_DIS               = BIT(5),
 462        STA_CTXT_HE_PARTIAL_BSS_COLOR           = BIT(6),
 463        STA_CTXT_HE_32BIT_BA_BITMAP             = BIT(7),
 464        STA_CTXT_HE_PACKET_EXT                  = BIT(8),
 465        STA_CTXT_HE_TRIG_RND_ALLOC              = BIT(9),
 466        STA_CTXT_HE_CONST_TRIG_RND_ALLOC        = BIT(10),
 467        STA_CTXT_HE_ACK_ENABLED                 = BIT(11),
 468        STA_CTXT_HE_MU_EDCA_CW                  = BIT(12),
 469        STA_CTXT_HE_RU_2MHZ_BLOCK               = BIT(14),
 470};
 471
 472/**
 473 * enum iwl_he_htc_flags - HE HTC support flags
 474 * @IWL_HE_HTC_SUPPORT: HE-HTC support
 475 * @IWL_HE_HTC_UL_MU_RESP_SCHED: HE UL MU response schedule
 476 *      support via A-control field
 477 * @IWL_HE_HTC_BSR_SUPP: BSR support in A-control field
 478 * @IWL_HE_HTC_OMI_SUPP: A-OMI support in A-control field
 479 * @IWL_HE_HTC_BQR_SUPP: A-BQR support in A-control field
 480 */
 481enum iwl_he_htc_flags {
 482        IWL_HE_HTC_SUPPORT                      = BIT(0),
 483        IWL_HE_HTC_UL_MU_RESP_SCHED             = BIT(3),
 484        IWL_HE_HTC_BSR_SUPP                     = BIT(4),
 485        IWL_HE_HTC_OMI_SUPP                     = BIT(5),
 486        IWL_HE_HTC_BQR_SUPP                     = BIT(6),
 487};
 488
 489/*
 490 * @IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK: the STA does not provide HE MFB
 491 * @IWL_HE_HTC_LINK_ADAP_UNSOLICITED: the STA provides only unsolicited HE MFB
 492 * @IWL_HE_HTC_LINK_ADAP_BOTH: the STA is capable of providing HE MFB in
 493 *      response to HE MRQ and if the STA provides unsolicited HE MFB
 494 */
 495#define IWL_HE_HTC_LINK_ADAP_POS                (1)
 496#define IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK        (0)
 497#define IWL_HE_HTC_LINK_ADAP_UNSOLICITED        (2 << IWL_HE_HTC_LINK_ADAP_POS)
 498#define IWL_HE_HTC_LINK_ADAP_BOTH               (3 << IWL_HE_HTC_LINK_ADAP_POS)
 499
 500/**
 501 * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP
 502 * @sta_id: STA id
 503 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
 504 *      0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
 505 * @reserved1: reserved byte for future use
 506 * @reserved2: reserved byte for future use
 507 * @flags: see %iwl_11ax_sta_ctxt_flags
 508 * @ref_bssid_addr: reference BSSID used by the AP
 509 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
 510 * @htc_flags: which features are supported in HTC
 511 * @frag_flags: frag support in A-MSDU
 512 * @frag_level: frag support level
 513 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
 514 * @frag_min_size: min frag size (except last frag)
 515 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
 516 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
 517 * @htc_trig_based_pkt_ext: default PE in 4us units
 518 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
 519 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
 520 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
 521 * @reserved3: reserved byte for future use
 522 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
 523 */
 524struct iwl_he_sta_context_cmd_v1 {
 525        u8 sta_id;
 526        u8 tid_limit;
 527        u8 reserved1;
 528        u8 reserved2;
 529        __le32 flags;
 530
 531        /* The below fields are set via Multiple BSSID IE */
 532        u8 ref_bssid_addr[6];
 533        __le16 reserved0;
 534
 535        /* The below fields are set via HE-capabilities IE */
 536        __le32 htc_flags;
 537
 538        u8 frag_flags;
 539        u8 frag_level;
 540        u8 frag_max_num;
 541        u8 frag_min_size;
 542
 543        /* The below fields are set via PPE thresholds element */
 544        struct iwl_he_pkt_ext pkt_ext;
 545
 546        /* The below fields are set via HE-Operation IE */
 547        u8 bss_color;
 548        u8 htc_trig_based_pkt_ext;
 549        __le16 frame_time_rts_th;
 550
 551        /* Random access parameter set (i.e. RAPS) */
 552        u8 rand_alloc_ecwmin;
 553        u8 rand_alloc_ecwmax;
 554        __le16 reserved3;
 555
 556        /* The below fields are set via MU EDCA parameter set element */
 557        struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
 558} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */
 559
 560/**
 561 * struct iwl_he_sta_context_cmd - configure FW to work with HE AP
 562 * @sta_id: STA id
 563 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
 564 *      0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
 565 * @reserved1: reserved byte for future use
 566 * @reserved2: reserved byte for future use
 567 * @flags: see %iwl_11ax_sta_ctxt_flags
 568 * @ref_bssid_addr: reference BSSID used by the AP
 569 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
 570 * @htc_flags: which features are supported in HTC
 571 * @frag_flags: frag support in A-MSDU
 572 * @frag_level: frag support level
 573 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
 574 * @frag_min_size: min frag size (except last frag)
 575 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
 576 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
 577 * @htc_trig_based_pkt_ext: default PE in 4us units
 578 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
 579 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
 580 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
 581 * @reserved3: reserved byte for future use
 582 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
 583 * @max_bssid_indicator: indicator of the max bssid supported on the associated
 584 *      bss
 585 * @bssid_index: index of the associated VAP
 586 * @ema_ap: AP supports enhanced Multi BSSID advertisement
 587 * @profile_periodicity: number of Beacon periods that are needed to receive the
 588 *      complete VAPs info
 589 * @bssid_count: actual number of VAPs in the MultiBSS Set
 590 * @reserved4: alignment
 591 */
 592struct iwl_he_sta_context_cmd {
 593        u8 sta_id;
 594        u8 tid_limit;
 595        u8 reserved1;
 596        u8 reserved2;
 597        __le32 flags;
 598
 599        /* The below fields are set via Multiple BSSID IE */
 600        u8 ref_bssid_addr[6];
 601        __le16 reserved0;
 602
 603        /* The below fields are set via HE-capabilities IE */
 604        __le32 htc_flags;
 605
 606        u8 frag_flags;
 607        u8 frag_level;
 608        u8 frag_max_num;
 609        u8 frag_min_size;
 610
 611        /* The below fields are set via PPE thresholds element */
 612        struct iwl_he_pkt_ext pkt_ext;
 613
 614        /* The below fields are set via HE-Operation IE */
 615        u8 bss_color;
 616        u8 htc_trig_based_pkt_ext;
 617        __le16 frame_time_rts_th;
 618
 619        /* Random access parameter set (i.e. RAPS) */
 620        u8 rand_alloc_ecwmin;
 621        u8 rand_alloc_ecwmax;
 622        __le16 reserved3;
 623
 624        /* The below fields are set via MU EDCA parameter set element */
 625        struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
 626
 627        u8 max_bssid_indicator;
 628        u8 bssid_index;
 629        u8 ema_ap;
 630        u8 profile_periodicity;
 631        u8 bssid_count;
 632        u8 reserved4[3];
 633} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */
 634
 635/**
 636 * struct iwl_he_monitor_cmd - configure air sniffer for HE
 637 * @bssid: the BSSID to sniff for
 638 * @reserved1: reserved for dword alignment
 639 * @aid: the AID to track on for HE MU
 640 * @reserved2: reserved for future use
 641 */
 642struct iwl_he_monitor_cmd {
 643        u8 bssid[6];
 644        __le16 reserved1;
 645        __le16 aid;
 646        u8 reserved2[6];
 647} __packed; /* HE_AIR_SNIFFER_CONFIG_CMD_API_S_VER_1 */
 648
 649#endif /* __iwl_fw_api_mac_h__ */
 650