iwlwifi: additional parameter in REPLY_RX_PHY_CMD
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / iwlwifi / iwl-commands.h
index c579965ec55655c357b00ae0e01f66e0a29c5683..13893a0a619766d0722ba8b564811bc602965272 100644 (file)
@@ -97,6 +97,7 @@ enum {
        REPLY_ADD_STA = 0x18,
        REPLY_REMOVE_STA = 0x19,
        REPLY_REMOVE_ALL_STA = 0x1a,    /* not used */
+       REPLY_TXFIFO_FLUSH = 0x1e,
 
        /* Security */
        REPLY_WEPKEY = 0x20,
@@ -957,14 +958,14 @@ struct iwl_qosparam_cmd {
 #define IWL3945_STATION_COUNT  25
 #define IWL4965_BROADCAST_ID   31
 #define        IWL4965_STATION_COUNT   32
-#define IWL5000_BROADCAST_ID   15
-#define        IWL5000_STATION_COUNT   16
+#define IWLAGN_BROADCAST_ID    15
+#define        IWLAGN_STATION_COUNT    16
 
 #define        IWL_STATION_COUNT       32      /* MAX(3945,4965)*/
 #define        IWL_INVALID_STATION     255
 
-#define STA_FLG_TX_RATE_MSK            cpu_to_le32(1 << 2);
-#define STA_FLG_PWR_SAVE_MSK           cpu_to_le32(1 << 8);
+#define STA_FLG_TX_RATE_MSK            cpu_to_le32(1 << 2)
+#define STA_FLG_PWR_SAVE_MSK           cpu_to_le32(1 << 8)
 #define STA_FLG_RTS_MIMO_PROT_MSK      cpu_to_le32(1 << 17)
 #define STA_FLG_AGG_MPDU_8US_MSK       cpu_to_le32(1 << 18)
 #define STA_FLG_MAX_AGG_SIZE_POS       (19)
@@ -1209,6 +1210,43 @@ struct iwl_rem_sta_cmd {
        u8 reserved2[2];
 } __packed;
 
+#define IWL_TX_FIFO_BK_MSK             cpu_to_le32(BIT(0))
+#define IWL_TX_FIFO_BE_MSK             cpu_to_le32(BIT(1))
+#define IWL_TX_FIFO_VI_MSK             cpu_to_le32(BIT(2))
+#define IWL_TX_FIFO_VO_MSK             cpu_to_le32(BIT(3))
+#define IWL_AGG_TX_QUEUE_MSK           cpu_to_le32(0xffc00)
+
+#define IWL_DROP_SINGLE                0
+#define IWL_DROP_SELECTED      1
+#define IWL_DROP_ALL           2
+
+/*
+ * REPLY_TXFIFO_FLUSH = 0x1e(command and response)
+ *
+ * When using full FIFO flush this command checks the scheduler HW block WR/RD
+ * pointers to check if all the frames were transferred by DMA into the
+ * relevant TX FIFO queue. Only when the DMA is finished and the queue is
+ * empty the command can finish.
+ * This command is used to flush the TXFIFO from transmit commands, it may
+ * operate on single or multiple queues, the command queue can't be flushed by
+ * this command. The command response is returned when all the queue flush
+ * operations are done. Each TX command flushed return response with the FLUSH
+ * status set in the TX response status. When FIFO flush operation is used,
+ * the flush operation ends when both the scheduler DMA done and TXFIFO empty
+ * are set.
+ *
+ * @fifo_control: bit mask for which queues to flush
+ * @flush_control: flush controls
+ *     0: Dump single MSDU
+ *     1: Dump multiple MSDU according to PS, INVALID STA, TTL, TID disable.
+ *     2: Dump all FIFO
+ */
+struct iwl_txfifo_flush_cmd {
+       __le32 fifo_control;
+       __le16 flush_control;
+       __le16 reserved;
+} __packed;
+
 /*
  * REPLY_WEP_KEY = 0x20
  */
@@ -1363,10 +1401,10 @@ struct iwl_rx_phy_res {
        u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */
        __le32 rate_n_flags;    /* RATE_MCS_* */
        __le16 byte_count;      /* frame's byte-count */
-       __le16 reserved3;
+       __le16 frame_time;      /* frame's time on the air */
 } __packed;
 
-struct iwl4965_rx_mpdu_res_start {
+struct iwl_rx_mpdu_res_start {
        __le16 byte_count;
        __le16 reserved;
 } __packed;
@@ -1399,18 +1437,27 @@ struct iwl4965_rx_mpdu_res_start {
 
 /* REPLY_TX Tx flags field */
 
-/* 1: Use RTS/CTS protocol or CTS-to-self if spec allows it
+/*
+ * 1: Use RTS/CTS protocol or CTS-to-self if spec allows it
  * before this frame. if CTS-to-self required check
- * RXON_FLG_SELF_CTS_EN status. */
-#define TX_CMD_FLG_RTS_CTS_MSK cpu_to_le32(1 << 0)
+ * RXON_FLG_SELF_CTS_EN status.
+ * unused in 3945/4965, used in 5000 series and after
+ */
+#define TX_CMD_FLG_PROT_REQUIRE_MSK cpu_to_le32(1 << 0)
 
-/* 1: Use Request-To-Send protocol before this frame.
- * Mutually exclusive vs. TX_CMD_FLG_CTS_MSK. */
+/*
+ * 1: Use Request-To-Send protocol before this frame.
+ * Mutually exclusive vs. TX_CMD_FLG_CTS_MSK.
+ * used in 3945/4965, unused in 5000 series and after
+ */
 #define TX_CMD_FLG_RTS_MSK cpu_to_le32(1 << 1)
 
-/* 1: Transmit Clear-To-Send to self before this frame.
+/*
+ * 1: Transmit Clear-To-Send to self before this frame.
  * Driver should set this for AUTH/DEAUTH/ASSOC-REQ/REASSOC mgmnt frames.
- * Mutually exclusive vs. TX_CMD_FLG_RTS_MSK. */
+ * Mutually exclusive vs. TX_CMD_FLG_RTS_MSK.
+ * used in 3945/4965, unused in 5000 series and after
+ */
 #define TX_CMD_FLG_CTS_MSK cpu_to_le32(1 << 2)
 
 /* 1: Expect ACK from receiving station
@@ -1430,8 +1477,11 @@ struct iwl4965_rx_mpdu_res_start {
  * Set when Txing a block-ack request frame.  Also set TX_CMD_FLG_ACK_MSK. */
 #define TX_CMD_FLG_IMM_BA_RSP_MASK  cpu_to_le32(1 << 6)
 
-/* 1: Frame requires full Tx-Op protection.
- * Set this if either RTS or CTS Tx Flag gets set. */
+/*
+ * 1: Frame requires full Tx-Op protection.
+ * Set this if either RTS or CTS Tx Flag gets set.
+ * used in 3945/4965, unused in 5000 series and after
+ */
 #define TX_CMD_FLG_FULL_TXOP_PROT_MSK cpu_to_le32(1 << 7)
 
 /* Tx antenna selection field; used only for 3945, reserved (0) for 4965.
@@ -2042,8 +2092,8 @@ struct iwl_link_qual_general_params {
 } __packed;
 
 #define LINK_QUAL_AGG_TIME_LIMIT_DEF   (4000) /* 4 milliseconds */
-#define LINK_QUAL_AGG_TIME_LIMIT_MAX   (65535)
-#define LINK_QUAL_AGG_TIME_LIMIT_MIN   (0)
+#define LINK_QUAL_AGG_TIME_LIMIT_MAX   (8000)
+#define LINK_QUAL_AGG_TIME_LIMIT_MIN   (100)
 
 #define LINK_QUAL_AGG_DISABLE_START_DEF        (3)
 #define LINK_QUAL_AGG_DISABLE_START_MAX        (255)
@@ -2060,8 +2110,10 @@ struct iwl_link_qual_general_params {
  */
 struct iwl_link_qual_agg_params {
 
-       /* Maximum number of uSec in aggregation.
-        * Driver should set this to 4000 (4 milliseconds). */
+       /*
+        *Maximum number of uSec in aggregation.
+        * default set to 4000 (4 milliseconds) if not configured in .cfg
+        */
        __le16 agg_time_limit;
 
        /*
@@ -2869,6 +2921,11 @@ struct iwl_scancomplete_notification {
  *
  *****************************************************************************/
 
+enum iwl_ibss_manager {
+       IWL_NOT_IBSS_MANAGER = 0,
+       IWL_IBSS_MANAGER = 1,
+};
+
 /*
  * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
  */
@@ -2985,7 +3042,8 @@ struct iwl39_statistics_tx {
 struct statistics_dbg {
        __le32 burst_check;
        __le32 burst_count;
-       __le32 reserved[4];
+       __le32 wait_for_silence_timeout_cnt;
+       __le32 reserved[3];
 } __packed;
 
 struct iwl39_statistics_div {
@@ -3076,6 +3134,13 @@ struct statistics_rx_non_phy {
        __le32 beacon_energy_c;
 } __packed;
 
+struct statistics_rx_non_phy_bt {
+       struct statistics_rx_non_phy common;
+       /* additional stats for bt */
+       __le32 num_bt_kills;
+       __le32 reserved[2];
+} __packed;
+
 struct statistics_rx {
        struct statistics_rx_phy ofdm;
        struct statistics_rx_phy cck;
@@ -3083,6 +3148,13 @@ struct statistics_rx {
        struct statistics_rx_ht_phy ofdm_ht;
 } __packed;
 
+struct statistics_rx_bt {
+       struct statistics_rx_phy ofdm;
+       struct statistics_rx_phy cck;
+       struct statistics_rx_non_phy_bt general;
+       struct statistics_rx_ht_phy ofdm_ht;
+} __packed;
+
 /**
  * struct statistics_tx_power - current tx power
  *
@@ -3145,7 +3217,7 @@ struct statistics_div {
        __le32 reserved2;
 } __packed;
 
-struct statistics_general {
+struct statistics_general_common {
        __le32 temperature;   /* radio temperature */
        __le32 temperature_m; /* for 5000 and up, this is radio voltage */
        struct statistics_dbg dbg;
@@ -3161,6 +3233,30 @@ struct statistics_general {
         *  in order to get out of bad PHY status
         */
        __le32 num_of_sos_states;
+} __packed;
+
+struct statistics_bt_activity {
+       /* Tx statistics */
+       __le32 hi_priority_tx_req_cnt;
+       __le32 hi_priority_tx_denied_cnt;
+       __le32 lo_priority_tx_req_cnt;
+       __le32 lo_priority_tx_denied_cnt;
+       /* Rx statistics */
+       __le32 hi_priority_rx_req_cnt;
+       __le32 hi_priority_rx_denied_cnt;
+       __le32 lo_priority_rx_req_cnt;
+       __le32 lo_priority_rx_denied_cnt;
+} __packed;
+
+struct statistics_general {
+       struct statistics_general_common common;
+       __le32 reserved2;
+       __le32 reserved3;
+} __packed;
+
+struct statistics_general_bt {
+       struct statistics_general_common common;
+       struct statistics_bt_activity activity;
        __le32 reserved2;
        __le32 reserved3;
 } __packed;
@@ -3222,6 +3318,12 @@ struct iwl_notif_statistics {
        struct statistics_general general;
 } __packed;
 
+struct iwl_bt_notif_statistics {
+       __le32 flag;
+       struct statistics_rx_bt rx;
+       struct statistics_tx tx;
+       struct statistics_general_bt general;
+} __packed;
 
 /*
  * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
@@ -3440,6 +3542,41 @@ struct iwl_missed_beacon_notif {
 #define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX          (9)
 #define HD_OFDM_ENERGY_TH_IN_INDEX                  (10)
 
+/*
+ * Additional table entries in enhance SENSITIVITY_CMD
+ */
+#define HD_INA_NON_SQUARE_DET_OFDM_INDEX               (11)
+#define HD_INA_NON_SQUARE_DET_CCK_INDEX                        (12)
+#define HD_CORR_11_INSTEAD_OF_CORR_9_EN_INDEX          (13)
+#define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_INDEX         (14)
+#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_INDEX     (15)
+#define HD_OFDM_NON_SQUARE_DET_SLOPE_INDEX             (16)
+#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_INDEX         (17)
+#define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_INDEX          (18)
+#define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_INDEX      (19)
+#define HD_CCK_NON_SQUARE_DET_SLOPE_INDEX              (20)
+#define HD_CCK_NON_SQUARE_DET_INTERCEPT_INDEX          (21)
+#define HD_RESERVED                                    (22)
+
+/* number of entries for enhanced tbl */
+#define ENHANCE_HD_TABLE_SIZE  (23)
+
+/* number of additional entries for enhanced tbl */
+#define ENHANCE_HD_TABLE_ENTRIES  (ENHANCE_HD_TABLE_SIZE - HD_TABLE_SIZE)
+
+#define HD_INA_NON_SQUARE_DET_OFDM_DATA                        cpu_to_le16(0)
+#define HD_INA_NON_SQUARE_DET_CCK_DATA                 cpu_to_le16(0)
+#define HD_CORR_11_INSTEAD_OF_CORR_9_EN_DATA           cpu_to_le16(0)
+#define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_DATA          cpu_to_le16(668)
+#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_DATA      cpu_to_le16(4)
+#define HD_OFDM_NON_SQUARE_DET_SLOPE_DATA              cpu_to_le16(486)
+#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_DATA          cpu_to_le16(37)
+#define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_DATA           cpu_to_le16(853)
+#define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_DATA       cpu_to_le16(4)
+#define HD_CCK_NON_SQUARE_DET_SLOPE_DATA               cpu_to_le16(476)
+#define HD_CCK_NON_SQUARE_DET_INTERCEPT_DATA           cpu_to_le16(99)
+
+
 /* Control field in struct iwl_sensitivity_cmd */
 #define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE  cpu_to_le16(0)
 #define SENSITIVITY_CMD_CONTROL_WORK_TABLE     cpu_to_le16(1)
@@ -3456,6 +3593,14 @@ struct iwl_sensitivity_cmd {
        __le16 table[HD_TABLE_SIZE];    /* use HD_* as index */
 } __packed;
 
+/*
+ *
+ */
+struct iwl_enhance_sensitivity_cmd {
+       __le16 control;                 /* always use "1" */
+       __le16 enhance_table[ENHANCE_HD_TABLE_SIZE];    /* use HD_* as index */
+} __packed;
+
 
 /**
  * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response)
@@ -3522,10 +3667,10 @@ enum {
        IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD       = 15,
        IWL_PHY_CALIBRATE_BASE_BAND_CMD         = 16,
        IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD        = 17,
-       IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD = 18,
-       IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD  = 19,
+       IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 18,
 };
 
+#define IWL_MAX_PHY_CALIBRATE_TBL_SIZE         (253)
 
 #define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff)
 
@@ -3850,6 +3995,7 @@ struct iwl_rx_packet {
                struct iwl_sleep_notification sleep_notif;
                struct iwl_spectrum_resp spectrum;
                struct iwl_notif_statistics stats;
+               struct iwl_bt_notif_statistics stats_bt;
                struct iwl_compressed_ba_resp compressed_ba;
                struct iwl_missed_beacon_notif missed_beacon;
                struct iwl_coex_medium_notification coex_medium_notif;