]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/mvm/fw-api.h
Merge remote-tracking branch 'sound-current/for-linus'
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / mvm / fw-api.h
index 4af7513adda22e3a08a59361313659ba0ff8d450..181590fbd3b340c712d3f0d1edb70b118a7c9b89 100644 (file)
@@ -67,6 +67,7 @@
 #define __fw_api_h__
 
 #include "fw-api-rs.h"
+#include "fw-api-rx.h"
 #include "fw-api-tx.h"
 #include "fw-api-sta.h"
 #include "fw-api-mac.h"
@@ -100,6 +101,7 @@ enum iwl_mvm_tx_fifo {
 enum {
        MVM_ALIVE = 0x1,
        REPLY_ERROR = 0x2,
+       ECHO_CMD = 0x3,
 
        INIT_COMPLETE_NOTIF = 0x4,
 
@@ -266,6 +268,16 @@ enum {
        REPLY_MAX = 0xff,
 };
 
+enum iwl_phy_ops_subcmd_ids {
+       CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
+       DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
+};
+
+/* command groups */
+enum {
+       PHY_OPS_GROUP = 0x4,
+};
+
 /**
  * struct iwl_cmd_response - generic response struct for most commands
  * @status: status of the command asked, changes for each one
@@ -1070,190 +1082,6 @@ struct iwl_hs20_roc_res {
        __le32 status;
 } __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
 
-#define IWL_RX_INFO_PHY_CNT 8
-#define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
-#define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
-#define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00
-#define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000
-#define IWL_RX_INFO_ENERGY_ANT_A_POS 0
-#define IWL_RX_INFO_ENERGY_ANT_B_POS 8
-#define IWL_RX_INFO_ENERGY_ANT_C_POS 16
-
-#define IWL_RX_INFO_AGC_IDX 1
-#define IWL_RX_INFO_RSSI_AB_IDX 2
-#define IWL_OFDM_AGC_A_MSK 0x0000007f
-#define IWL_OFDM_AGC_A_POS 0
-#define IWL_OFDM_AGC_B_MSK 0x00003f80
-#define IWL_OFDM_AGC_B_POS 7
-#define IWL_OFDM_AGC_CODE_MSK 0x3fe00000
-#define IWL_OFDM_AGC_CODE_POS 20
-#define IWL_OFDM_RSSI_INBAND_A_MSK 0x00ff
-#define IWL_OFDM_RSSI_A_POS 0
-#define IWL_OFDM_RSSI_ALLBAND_A_MSK 0xff00
-#define IWL_OFDM_RSSI_ALLBAND_A_POS 8
-#define IWL_OFDM_RSSI_INBAND_B_MSK 0xff0000
-#define IWL_OFDM_RSSI_B_POS 16
-#define IWL_OFDM_RSSI_ALLBAND_B_MSK 0xff000000
-#define IWL_OFDM_RSSI_ALLBAND_B_POS 24
-
-/**
- * struct iwl_rx_phy_info - phy info
- * (REPLY_RX_PHY_CMD = 0xc0)
- * @non_cfg_phy_cnt: non configurable DSP phy data byte count
- * @cfg_phy_cnt: configurable DSP phy data byte count
- * @stat_id: configurable DSP phy data set ID
- * @reserved1:
- * @system_timestamp: GP2  at on air rise
- * @timestamp: TSF at on air rise
- * @beacon_time_stamp: beacon at on-air rise
- * @phy_flags: general phy flags: band, modulation, ...
- * @channel: channel number
- * @non_cfg_phy_buf: for various implementations of non_cfg_phy
- * @rate_n_flags: RATE_MCS_*
- * @byte_count: frame's byte-count
- * @frame_time: frame's time on the air, based on byte count and frame rate
- *     calculation
- * @mac_active_msk: what MACs were active when the frame was received
- *
- * Before each Rx, the device sends this data. It contains PHY information
- * about the reception of the packet.
- */
-struct iwl_rx_phy_info {
-       u8 non_cfg_phy_cnt;
-       u8 cfg_phy_cnt;
-       u8 stat_id;
-       u8 reserved1;
-       __le32 system_timestamp;
-       __le64 timestamp;
-       __le32 beacon_time_stamp;
-       __le16 phy_flags;
-       __le16 channel;
-       __le32 non_cfg_phy[IWL_RX_INFO_PHY_CNT];
-       __le32 rate_n_flags;
-       __le32 byte_count;
-       __le16 mac_active_msk;
-       __le16 frame_time;
-} __packed;
-
-/*
- * TCP offload Rx assist info
- *
- * bits 0:3 - reserved
- * bits 4:7 - MIC CRC length
- * bits 8:12 - MAC header length
- * bit 13 - Padding indication
- * bit 14 - A-AMSDU indication
- * bit 15 - Offload enabled
- */
-enum iwl_csum_rx_assist_info {
-       CSUM_RXA_RESERVED_MASK  = 0x000f,
-       CSUM_RXA_MICSIZE_MASK   = 0x00f0,
-       CSUM_RXA_HEADERLEN_MASK = 0x1f00,
-       CSUM_RXA_PADD           = BIT(13),
-       CSUM_RXA_AMSDU          = BIT(14),
-       CSUM_RXA_ENA            = BIT(15)
-};
-
-/**
- * struct iwl_rx_mpdu_res_start - phy info
- * @assist: see CSUM_RX_ASSIST_ above
- */
-struct iwl_rx_mpdu_res_start {
-       __le16 byte_count;
-       __le16 assist;
-} __packed; /* _RX_MPDU_RES_START_API_S_VER_2 */
-
-/**
- * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags
- * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band
- * @RX_RES_PHY_FLAGS_MOD_CCK:
- * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short
- * @RX_RES_PHY_FLAGS_NARROW_BAND:
- * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received
- * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
- * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame
- * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble
- * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame
- */
-enum iwl_rx_phy_flags {
-       RX_RES_PHY_FLAGS_BAND_24        = BIT(0),
-       RX_RES_PHY_FLAGS_MOD_CCK        = BIT(1),
-       RX_RES_PHY_FLAGS_SHORT_PREAMBLE = BIT(2),
-       RX_RES_PHY_FLAGS_NARROW_BAND    = BIT(3),
-       RX_RES_PHY_FLAGS_ANTENNA        = (0x7 << 4),
-       RX_RES_PHY_FLAGS_ANTENNA_POS    = 4,
-       RX_RES_PHY_FLAGS_AGG            = BIT(7),
-       RX_RES_PHY_FLAGS_OFDM_HT        = BIT(8),
-       RX_RES_PHY_FLAGS_OFDM_GF        = BIT(9),
-       RX_RES_PHY_FLAGS_OFDM_VHT       = BIT(10),
-};
-
-/**
- * enum iwl_mvm_rx_status - written by fw for each Rx packet
- * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine
- * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow
- * @RX_MPDU_RES_STATUS_SRC_STA_FOUND:
- * @RX_MPDU_RES_STATUS_KEY_VALID:
- * @RX_MPDU_RES_STATUS_KEY_PARAM_OK:
- * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed
- * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked
- *     in the driver.
- * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine
- * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR:  valid for alg = CCM_CMAC or
- *     alg = CCM only. Checks replay attack for 11w frames. Relevant only if
- *     %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set.
- * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted
- * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP
- * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM
- * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP
- * @RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC: this frame is encrypted using CCM_CMAC
- * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted
- * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm
- * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted
- * @RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP:
- * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP:
- * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT:
- * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame
- * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw
- * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors
- * @RX_MPDU_RES_STATUS_HASH_INDEX_MSK:
- * @RX_MPDU_RES_STATUS_STA_ID_MSK:
- * @RX_MPDU_RES_STATUS_RRF_KILL:
- * @RX_MPDU_RES_STATUS_FILTERING_MSK:
- * @RX_MPDU_RES_STATUS2_FILTERING_MSK:
- */
-enum iwl_mvm_rx_status {
-       RX_MPDU_RES_STATUS_CRC_OK                       = BIT(0),
-       RX_MPDU_RES_STATUS_OVERRUN_OK                   = BIT(1),
-       RX_MPDU_RES_STATUS_SRC_STA_FOUND                = BIT(2),
-       RX_MPDU_RES_STATUS_KEY_VALID                    = BIT(3),
-       RX_MPDU_RES_STATUS_KEY_PARAM_OK                 = BIT(4),
-       RX_MPDU_RES_STATUS_ICV_OK                       = BIT(5),
-       RX_MPDU_RES_STATUS_MIC_OK                       = BIT(6),
-       RX_MPDU_RES_STATUS_TTAK_OK                      = BIT(7),
-       RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR         = BIT(7),
-       RX_MPDU_RES_STATUS_SEC_NO_ENC                   = (0 << 8),
-       RX_MPDU_RES_STATUS_SEC_WEP_ENC                  = (1 << 8),
-       RX_MPDU_RES_STATUS_SEC_CCM_ENC                  = (2 << 8),
-       RX_MPDU_RES_STATUS_SEC_TKIP_ENC                 = (3 << 8),
-       RX_MPDU_RES_STATUS_SEC_EXT_ENC                  = (4 << 8),
-       RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC             = (6 << 8),
-       RX_MPDU_RES_STATUS_SEC_ENC_ERR                  = (7 << 8),
-       RX_MPDU_RES_STATUS_SEC_ENC_MSK                  = (7 << 8),
-       RX_MPDU_RES_STATUS_DEC_DONE                     = BIT(11),
-       RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP        = BIT(12),
-       RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP               = BIT(13),
-       RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT               = BIT(14),
-       RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME             = BIT(15),
-       RX_MPDU_RES_STATUS_CSUM_DONE                    = BIT(16),
-       RX_MPDU_RES_STATUS_CSUM_OK                      = BIT(17),
-       RX_MPDU_RES_STATUS_HASH_INDEX_MSK               = (0x3F0000),
-       RX_MPDU_RES_STATUS_STA_ID_MSK                   = (0x1f000000),
-       RX_MPDU_RES_STATUS_RRF_KILL                     = BIT(29),
-       RX_MPDU_RES_STATUS_FILTERING_MSK                = (0xc00000),
-       RX_MPDU_RES_STATUS2_FILTERING_MSK               = (0xc0000000),
-};
-
 /**
  * struct iwl_radio_version_notif - information on the radio version
  * ( RADIO_VERSION_NOTIFICATION = 0x68 )
@@ -1695,6 +1523,69 @@ struct iwl_dts_measurement_cmd {
        __le32 flags;
 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
 
+/**
+* enum iwl_dts_control_measurement_mode - DTS measurement type
+* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
+*                 back (latest value. Not waiting for new value). Use automatic
+*                 SW DTS configuration.
+* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
+*                    trigger DTS reading and provide read back temperature read
+*                    when available.
+* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
+* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
+*                              without measurement trigger.
+*/
+enum iwl_dts_control_measurement_mode {
+       DTS_AUTOMATIC                   = 0,
+       DTS_REQUEST_READ                = 1,
+       DTS_OVER_WRITE                  = 2,
+       DTS_DIRECT_WITHOUT_MEASURE      = 3,
+};
+
+/**
+* enum iwl_dts_used - DTS to use or used for measurement in the DTS request
+* @DTS_USE_TOP: Top
+* @DTS_USE_CHAIN_A: chain A
+* @DTS_USE_CHAIN_B: chain B
+* @DTS_USE_CHAIN_C: chain C
+* @XTAL_TEMPERATURE - read temperature from xtal
+*/
+enum iwl_dts_used {
+       DTS_USE_TOP             = 0,
+       DTS_USE_CHAIN_A         = 1,
+       DTS_USE_CHAIN_B         = 2,
+       DTS_USE_CHAIN_C         = 3,
+       XTAL_TEMPERATURE        = 4,
+};
+
+/**
+* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
+* @DTS_BIT6_MODE: bit 6 mode
+* @DTS_BIT8_MODE: bit 8 mode
+*/
+enum iwl_dts_bit_mode {
+       DTS_BIT6_MODE   = 0,
+       DTS_BIT8_MODE   = 1,
+};
+
+/**
+ * iwl_ext_dts_measurement_cmd - request extended DTS temperature measurements
+ * @control_mode: see &enum iwl_dts_control_measurement_mode
+ * @temperature: used when over write DTS mode is selected
+ * @sensor: set temperature sensor to use. See &enum iwl_dts_used
+ * @avg_factor: average factor to DTS in request DTS read mode
+ * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
+ * @step_duration: step duration for the DTS
+ */
+struct iwl_ext_dts_measurement_cmd {
+       __le32 control_mode;
+       __le32 temperature;
+       __le32 sensor;
+       __le32 avg_factor;
+       __le32 bit_mode;
+       __le32 step_duration;
+} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
+
 /**
  * iwl_dts_measurement_notif - notification received with the measurements
  *