wl1271: Implementation for SPI busy word checking
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / wl12xx / wl1271.h
index 55818f94017bcfdef67ba52271084fca0803ad05..957da8c0d9cbb1d75947d6b71f0d6fad52caf6f4 100644 (file)
@@ -107,7 +107,13 @@ enum {
 #define WL1271_FW_NAME "wl1271-fw.bin"
 #define WL1271_NVS_NAME "wl1271-nvs.bin"
 
-#define WL1271_BUSY_WORD_LEN 8
+/*
+ * FIXME: for the wl1271, a busy word count of 1 here will result in a more
+ * optimal SPI interface. There is some SPI bug however, causing RXS time outs
+ * with this mode occasionally on boot, so lets have two for now.
+ */
+#define WL1271_BUSY_WORD_CNT 2
+#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32))
 
 #define WL1271_ELP_HW_STATE_ASLEEP 0
 #define WL1271_ELP_HW_STATE_IRQ    1
@@ -337,6 +343,11 @@ struct wl1271 {
        /* Pending TX frames */
        struct sk_buff *tx_frames[16];
 
+       /* Security sequence number counters */
+       u8 tx_security_last_seq;
+       u16 tx_security_seq_16;
+       u32 tx_security_seq_32;
+
        /* FW Rx counter */
        u32 rx_counter;
 
@@ -368,6 +379,7 @@ struct wl1271 {
        bool elp;
 
        struct completion *elp_compl;
+       struct delayed_work elp_work;
 
        /* we can be in psm, but not in elp, we have to differentiate */
        bool psm;
@@ -383,7 +395,7 @@ struct wl1271 {
 
        u32 buffer_32;
        u32 buffer_cmd;
-       u8 buffer_busyword[WL1271_BUSY_WORD_LEN];
+       u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
        struct wl1271_rx_descriptor *rx_descriptor;
 
        struct wl1271_fw_status *fw_status;