iwlwifi: tlv: add support for IWL_UCODE_TLV_SDIO_ADMA_ADDR TLV
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / iwl-trans.h
index d8fc548..84d8477 100644 (file)
@@ -382,6 +382,8 @@ enum iwl_trans_status {
  *     are considered stuck and will trigger device restart
  * @command_names: array of command names, must be 256 entries
  *     (one for each command); for debugging only
+ * @sdio_adma_addr: the default address to set for the ADMA in SDIO mode until
+ *     we get the ALIVE from the uCode
  */
 struct iwl_trans_config {
        struct iwl_op_mode *op_mode;
@@ -396,6 +398,8 @@ struct iwl_trans_config {
        bool scd_set_active;
        unsigned int queue_watchdog_timeout;
        const char *const *command_names;
+
+       u32 sdio_adma_addr;
 };
 
 struct iwl_trans_dump_data {
@@ -534,10 +538,10 @@ struct iwl_trans_ops {
                              u32 value);
        void (*ref)(struct iwl_trans *trans);
        void (*unref)(struct iwl_trans *trans);
+       void (*suspend)(struct iwl_trans *trans);
+       void (*resume)(struct iwl_trans *trans);
 
-#ifdef CONFIG_IWLWIFI_DEBUGFS
        struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans);
-#endif
 };
 
 /**
@@ -551,6 +555,21 @@ enum iwl_trans_state {
        IWL_TRANS_FW_ALIVE      = 1,
 };
 
+/**
+ * enum iwl_d0i3_mode - d0i3 mode
+ *
+ * @IWL_D0I3_MODE_OFF - d0i3 is disabled
+ * @IWL_D0I3_MODE_ON_IDLE - enter d0i3 when device is idle
+ *     (e.g. no active references)
+ * @IWL_D0I3_MODE_ON_SUSPEND - enter d0i3 only on suspend
+ *     (in case of 'any' trigger)
+ */
+enum iwl_d0i3_mode {
+       IWL_D0I3_MODE_OFF = 0,
+       IWL_D0I3_MODE_ON_IDLE,
+       IWL_D0I3_MODE_ON_SUSPEND,
+};
+
 /**
  * struct iwl_trans - transport common data
  *
@@ -574,6 +593,9 @@ enum iwl_trans_state {
  * @rx_mpdu_cmd_hdr_size: used for tracing, amount of data before the
  *     start of the 802.11 header in the @rx_mpdu_cmd
  * @dflt_pwr_limit: default power limit fetched from the platform (ACPI)
+ * @dbg_dest_tlv: points to the destination TLV for debug
+ * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
+ * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv
  */
 struct iwl_trans {
        const struct iwl_trans_ops *ops;
@@ -605,6 +627,12 @@ struct iwl_trans {
 
        u64 dflt_pwr_limit;
 
+       const struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv;
+       const struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_MAX];
+       u8 dbg_dest_reg_num;
+
+       enum iwl_d0i3_mode d0i3_mode;
+
        /* pointer to trans specific struct */
        /*Ensure that this pointer will always be aligned to sizeof pointer */
        char trans_specific[0] __aligned(sizeof(void *));
@@ -704,7 +732,18 @@ static inline void iwl_trans_unref(struct iwl_trans *trans)
                trans->ops->unref(trans);
 }
 
-#ifdef CONFIG_IWLWIFI_DEBUGFS
+static inline void iwl_trans_suspend(struct iwl_trans *trans)
+{
+       if (trans->ops->suspend)
+               trans->ops->suspend(trans);
+}
+
+static inline void iwl_trans_resume(struct iwl_trans *trans)
+{
+       if (trans->ops->resume)
+               trans->ops->resume(trans);
+}
+
 static inline struct iwl_trans_dump_data *
 iwl_trans_dump_data(struct iwl_trans *trans)
 {
@@ -712,7 +751,6 @@ iwl_trans_dump_data(struct iwl_trans *trans)
                return NULL;
        return trans->ops->dump_data(trans);
 }
-#endif
 
 static inline int iwl_trans_send_cmd(struct iwl_trans *trans,
                                     struct iwl_host_cmd *cmd)