ath6kl: Fix inactivity timeout for AR6004
[cascardo/linux.git] / drivers / net / wireless / ath / ath6kl / core.h
index eb86b31..95fc9b3 100644 (file)
@@ -127,6 +127,15 @@ enum ath6kl_fw_capability {
        /* supports WMI_SET_REGDOMAIN_CMDID command */
        ATH6KL_FW_CAPABILITY_REGDOMAIN,
 
+       /* Firmware supports sched scan decoupled from host sleep */
+       ATH6KL_FW_CAPABILITY_SCHED_SCAN_V2,
+
+       /*
+        * Firmware capability for hang detection through heart beat
+        * challenge messages.
+        */
+       ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL,
+
        /* this needs to be last */
        ATH6KL_FW_CAPABILITY_MAX,
 };
@@ -140,11 +149,13 @@ struct ath6kl_fw_ie {
 };
 
 enum ath6kl_hw_flags {
-       ATH6KL_HW_FLAG_64BIT_RATES      = BIT(0),
+       ATH6KL_HW_64BIT_RATES           = BIT(0),
+       ATH6KL_HW_AP_INACTIVITY_MINS    = BIT(1),
 };
 
 #define ATH6KL_FW_API2_FILE "fw-2.bin"
 #define ATH6KL_FW_API3_FILE "fw-3.bin"
+#define ATH6KL_FW_API4_FILE "fw-4.bin"
 
 /* AR6003 1.0 definitions */
 #define AR6003_HW_1_0_VERSION                 0x300002ba
@@ -555,6 +566,7 @@ enum ath6kl_vif_state {
        HOST_SLEEP_MODE_CMD_PROCESSED,
        NETDEV_MCAST_ALL_ON,
        NETDEV_MCAST_ALL_OFF,
+       SCHED_SCANNING,
 };
 
 struct ath6kl_vif {
@@ -605,6 +617,7 @@ struct ath6kl_vif {
        struct net_device_stats net_stats;
        struct target_stats target_stats;
        struct wmi_connect_cmd profile;
+       u16 rsn_capab;
 
        struct list_head mc_filter;
 };
@@ -629,6 +642,7 @@ enum ath6kl_dev_state {
        SKIP_SCAN,
        ROAM_TBL_PEND,
        FIRST_BOOT,
+       RECOVERY_CLEANUP,
 };
 
 enum ath6kl_state {
@@ -639,7 +653,16 @@ enum ath6kl_state {
        ATH6KL_STATE_DEEPSLEEP,
        ATH6KL_STATE_CUTPOWER,
        ATH6KL_STATE_WOW,
-       ATH6KL_STATE_SCHED_SCAN,
+       ATH6KL_STATE_RECOVERY,
+};
+
+/* Fw error recovery */
+#define ATH6KL_HB_RESP_MISS_THRES      5
+
+enum ath6kl_fw_err {
+       ATH6KL_FW_ASSERT,
+       ATH6KL_FW_HB_RESP_FAILURE,
+       ATH6KL_FW_EP_FULL,
 };
 
 struct ath6kl {
@@ -699,6 +722,7 @@ struct ath6kl {
        struct ath6kl_req_key ap_mode_bkey;
        struct sk_buff_head mcastpsq;
        u32 want_ch_switch;
+       u16 last_ch;
 
        /*
         * FIXME: protects access to mcastpsq but is actually useless as
@@ -784,6 +808,17 @@ struct ath6kl {
 
        bool wiphy_registered;
 
+       struct ath6kl_fw_recovery {
+               struct work_struct recovery_work;
+               unsigned long err_reason;
+               unsigned long hb_poll;
+               struct timer_list hb_timer;
+               u32 seq_num;
+               bool hb_pending;
+               u8 hb_misscnt;
+               bool enable;
+       } fw_recovery;
+
 #ifdef CONFIG_ATH6KL_DEBUG
        struct {
                struct sk_buff_head fwlog_queue;
@@ -919,4 +954,12 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type);
 void ath6kl_core_cleanup(struct ath6kl *ar);
 void ath6kl_core_destroy(struct ath6kl *ar);
 
+/* Fw error recovery */
+void ath6kl_init_hw_restart(struct ath6kl *ar);
+void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason);
+void ath6kl_recovery_hb_event(struct ath6kl *ar, u32 cookie);
+void ath6kl_recovery_init(struct ath6kl *ar);
+void ath6kl_recovery_cleanup(struct ath6kl *ar);
+void ath6kl_recovery_suspend(struct ath6kl *ar);
+void ath6kl_recovery_resume(struct ath6kl *ar);
 #endif /* CORE_H */