ath10k: add support for firmware newer than 636
[cascardo/linux.git] / drivers / net / wireless / ath / ath10k / core.h
index d5b2533..ab05c4c 100644 (file)
@@ -38,6 +38,7 @@
 #define ATH10K_SCAN_ID 0
 #define WMI_READY_TIMEOUT (5 * HZ)
 #define ATH10K_FLUSH_TIMEOUT_HZ (5*HZ)
+#define ATH10K_NUM_CHANS 38
 
 /* Antenna noise floor */
 #define ATH10K_DEFAULT_NOISE_FLOOR -95
@@ -250,6 +251,31 @@ struct ath10k_debug {
 enum ath10k_state {
        ATH10K_STATE_OFF = 0,
        ATH10K_STATE_ON,
+
+       /* When doing firmware recovery the device is first powered down.
+        * mac80211 is supposed to call in to start() hook later on. It is
+        * however possible that driver unloading and firmware crash overlap.
+        * mac80211 can wait on conf_mutex in stop() while the device is
+        * stopped in ath10k_core_restart() work holding conf_mutex. The state
+        * RESTARTED means that the device is up and mac80211 has started hw
+        * reconfiguration. Once mac80211 is done with the reconfiguration we
+        * set the state to STATE_ON in restart_complete(). */
+       ATH10K_STATE_RESTARTING,
+       ATH10K_STATE_RESTARTED,
+
+       /* The device has crashed while restarting hw. This state is like ON
+        * but commands are blocked in HTC and -ECOMM response is given. This
+        * prevents completion timeouts and makes the driver more responsive to
+        * userspace commands. This is also prevents recursive recovery. */
+       ATH10K_STATE_WEDGED,
+};
+
+enum ath10k_fw_features {
+       /* wmi_mgmt_rx_hdr contains extra RSSI information */
+       ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX = 0,
+
+       /* keep last */
+       ATH10K_FW_FEATURE_COUNT,
 };
 
 struct ath10k {
@@ -268,6 +294,9 @@ struct ath10k {
        u32 hw_max_tx_power;
        u32 ht_cap_info;
        u32 vht_cap_info;
+       u32 num_rf_chains;
+
+       DECLARE_BITMAP(fw_features, ATH10K_FW_FEATURE_COUNT);
 
        struct targetdef *targetdef;
        struct hostdef *hostdef;
@@ -300,6 +329,10 @@ struct ath10k {
                } fw;
        } hw_params;
 
+       const struct firmware *board_data;
+       const struct firmware *otp;
+       const struct firmware *firmware;
+
        struct {
                struct completion started;
                struct completion completed;
@@ -351,6 +384,14 @@ struct ath10k {
 
        enum ath10k_state state;
 
+       struct work_struct restart_work;
+
+       /* cycle count is reported twice for each visited channel during scan.
+        * access protected by data_lock */
+       u32 survey_last_rx_clear_count;
+       u32 survey_last_cycle_count;
+       struct survey_info survey[ATH10K_NUM_CHANS];
+
 #ifdef CONFIG_ATH10K_DEBUGFS
        struct ath10k_debug debug;
 #endif
@@ -365,7 +406,4 @@ void ath10k_core_stop(struct ath10k *ar);
 int ath10k_core_register(struct ath10k *ar);
 void ath10k_core_unregister(struct ath10k *ar);
 
-int ath10k_core_target_suspend(struct ath10k *ar);
-int ath10k_core_target_resume(struct ath10k *ar);
-
 #endif /* _CORE_H_ */