Merge ath-next from ath.git
[cascardo/linux.git] / drivers / net / wireless / ath / ath10k / core.h
index 362bbed..1379054 100644 (file)
@@ -44,8 +44,8 @@
 
 #define ATH10K_SCAN_ID 0
 #define WMI_READY_TIMEOUT (5 * HZ)
-#define ATH10K_FLUSH_TIMEOUT_HZ (5*HZ)
-#define ATH10K_CONNECTION_LOSS_HZ (3*HZ)
+#define ATH10K_FLUSH_TIMEOUT_HZ (5 * HZ)
+#define ATH10K_CONNECTION_LOSS_HZ (3 * HZ)
 #define ATH10K_NUM_CHANS 39
 
 /* Antenna noise floor */
@@ -139,7 +139,6 @@ struct ath10k_mem_chunk {
 };
 
 struct ath10k_wmi {
-       enum ath10k_fw_wmi_op_version op_version;
        enum ath10k_htc_ep_id eid;
        struct completion service_ready;
        struct completion unified_ready;
@@ -334,7 +333,7 @@ struct ath10k_sta {
 #endif
 };
 
-#define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5*HZ)
+#define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5 * HZ)
 
 enum ath10k_beacon_state {
        ATH10K_BEACON_SCHEDULED = 0,
@@ -627,6 +626,34 @@ enum ath10k_tx_pause_reason {
        ATH10K_TX_PAUSE_MAX,
 };
 
+struct ath10k_fw_file {
+       const struct firmware *firmware;
+
+       char fw_version[ETHTOOL_FWVERS_LEN];
+
+       DECLARE_BITMAP(fw_features, ATH10K_FW_FEATURE_COUNT);
+
+       enum ath10k_fw_wmi_op_version wmi_op_version;
+       enum ath10k_fw_htt_op_version htt_op_version;
+
+       const void *firmware_data;
+       size_t firmware_len;
+
+       const void *otp_data;
+       size_t otp_len;
+
+       const void *codeswap_data;
+       size_t codeswap_len;
+};
+
+struct ath10k_fw_components {
+       const struct firmware *board;
+       const void *board_data;
+       size_t board_len;
+
+       struct ath10k_fw_file fw_file;
+};
+
 struct ath10k {
        struct ath_common ath_common;
        struct ieee80211_hw *hw;
@@ -652,8 +679,6 @@ struct ath10k {
        /* protected by conf_mutex */
        bool ani_enabled;
 
-       DECLARE_BITMAP(fw_features, ATH10K_FW_FEATURE_COUNT);
-
        bool p2p;
 
        struct {
@@ -708,32 +733,24 @@ struct ath10k {
 
                struct ath10k_hw_params_fw {
                        const char *dir;
-                       const char *fw;
-                       const char *otp;
                        const char *board;
                        size_t board_size;
                        size_t board_ext_size;
                } fw;
        } hw_params;
 
-       const struct firmware *board;
-       const void *board_data;
-       size_t board_len;
-
-       const struct firmware *otp;
-       const void *otp_data;
-       size_t otp_len;
+       /* contains the firmware images used with ATH10K_FIRMWARE_MODE_NORMAL */
+       struct ath10k_fw_components normal_mode_fw;
 
-       const struct firmware *firmware;
-       const void *firmware_data;
-       size_t firmware_len;
+       /* READ-ONLY images of the running firmware, which can be either
+        * normal or UTF. Do not modify, release etc!
+        */
+       const struct ath10k_fw_components *running_fw;
 
        const struct firmware *pre_cal_file;
        const struct firmware *cal_file;
 
        struct {
-               const void *firmware_codeswap_data;
-               size_t firmware_codeswap_len;
                struct ath10k_swap_code_seg_info *firmware_swap_code_seg_info;
        } swap;
 
@@ -879,13 +896,8 @@ struct ath10k {
 
        struct {
                /* protected by conf_mutex */
-               const struct firmware *utf;
-               char utf_version[32];
-               const void *utf_firmware_data;
-               size_t utf_firmware_len;
-               DECLARE_BITMAP(orig_fw_features, ATH10K_FW_FEATURE_COUNT);
-               enum ath10k_fw_wmi_op_version orig_wmi_op_version;
-               enum ath10k_fw_wmi_op_version op_version;
+               struct ath10k_fw_components utf_mode_fw;
+
                /* protected by data_lock */
                bool utf_monitor;
        } testmode;
@@ -921,8 +933,11 @@ void ath10k_core_destroy(struct ath10k *ar);
 void ath10k_core_get_fw_features_str(struct ath10k *ar,
                                     char *buf,
                                     size_t max_len);
+int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
+                                    struct ath10k_fw_file *fw_file);
 
-int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode);
+int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
+                     const struct ath10k_fw_components *fw_components);
 int ath10k_wait_for_suspend(struct ath10k *ar, u32 suspend_opt);
 void ath10k_core_stop(struct ath10k *ar);
 int ath10k_core_register(struct ath10k *ar, u32 chip_id);