carl9170 firmware: rename cab_flush to bcn_ctrl and fix update delay
[carl9170fw.git] / include / shared / fwcmd.h
index c1879f5815f6bfff2f330fa75e7c45422db4a192..bf163420b788c1e3a84b2ca390ab9b4ef0a52c9d 100644 (file)
@@ -51,9 +51,8 @@ enum carl9170_cmd_oids {
        CARL9170_CMD_ECHO               = 0x02,
        CARL9170_CMD_SWRST              = 0x03,
        CARL9170_CMD_REBOOT             = 0x04,
-       CARL9170_CMD_FLUSH_CAB          = 0x05,
+       CARL9170_CMD_BCN_CTRL           = 0x05,
        CARL9170_CMD_READ_TSF           = 0x06,
-       CARL9170_CMD_USB_WD             = 0x07,
 
        /* CAM */
        CARL9170_CMD_EKEY               = 0x10,
@@ -66,7 +65,19 @@ enum carl9170_cmd_oids {
        CARL9170_CMD_FREQ_START         = 0x23,
        CARL9170_CMD_PSM                = 0x24,
 
+       /* Asychronous command flag */
+       CARL9170_CMD_ASYNC_FLAG         = 0x40,
+       CARL9170_CMD_WREG_ASYNC         = (CARL9170_CMD_WREG |
+                                          CARL9170_CMD_ASYNC_FLAG),
+       CARL9170_CMD_REBOOT_ASYNC       = (CARL9170_CMD_REBOOT |
+                                          CARL9170_CMD_ASYNC_FLAG),
+       CARL9170_CMD_BCN_CTRL_ASYNC     = (CARL9170_CMD_BCN_CTRL |
+                                          CARL9170_CMD_ASYNC_FLAG),
+       CARL9170_CMD_PSM_ASYNC          = (CARL9170_CMD_PSM |
+                                          CARL9170_CMD_ASYNC_FLAG),
+
        /* responses and traps */
+       CARL9170_RSP_FLAG               = 0xc0,
        CARL9170_RSP_PRETBTT            = 0xc0,
        CARL9170_RSP_TXCOMP             = 0xc1,
        CARL9170_RSP_BEACON_CONFIG      = 0xc2,
@@ -76,7 +87,7 @@ enum carl9170_cmd_oids {
        CARL9170_RSP_HEXDUMP            = 0xcc,
        CARL9170_RSP_RADAR              = 0xcd,
        CARL9170_RSP_GPIO               = 0xce,
-       CARL9170_RSP_USB_WD             = 0xcf
+       CARL9170_RSP_BOOT               = 0xcf,
 };
 
 struct carl9170_set_key_cmd {
@@ -128,17 +139,8 @@ struct carl9170_rf_init {
 
 struct carl9170_rf_init_result {
        __le32          ret;            /* AR9170_PHY_REG_AGC_CONTROL */
-       __le32          regs[6];
-} __packed;
-#define        CARL9170_RF_INIT_RESULT_SIZE    28
-
-#define        CARL9170_USB_WATCHDOG_INACTIVE  0
-#define        CARL9170_USB_WATCHDOG_ON_DUTY   1
-
-struct carl9170_watchdog_cmd {
-       __le32          state;
 } __packed;
-#define CARL9170_WATCHDOG_CMD_SIZE     4
+#define        CARL9170_RF_INIT_RESULT_SIZE    4
 
 #define        CARL9170_PSM_SLEEP              0x1000
 #define        CARL9170_PSM_SOFTWARE           0
@@ -151,10 +153,16 @@ struct carl9170_psm {
 } __packed;
 #define CARL9170_PSM_SIZE              4
 
-struct carl9170_cab_flush_cmd {
-       __le32          vif_id;         /* currently unused */
+struct carl9170_bcn_ctrl_cmd {
+       __le32          vif_id;
+       __le32          mode;
+       __le32          bcn_addr;
+       __le32          bcn_len;
 } __packed;
-#define CARL9170_CAB_FLUSH_CMD_SIZE    4
+#define CARL9170_BCN_CTRL_CMD_SIZE     16
+
+#define CARL9170_BCN_CTRL_DRAIN        0
+#define CARL9170_BCN_CTRL_CAB_TRIGGER  1
 
 struct carl9170_cmd_head {
        union {
@@ -175,12 +183,11 @@ struct carl9170_cmd {
                struct carl9170_set_key_cmd     setkey;
                struct carl9170_disable_key_cmd disablekey;
                struct carl9170_u32_list        echo;
-               struct carl9170_watchdog_cmd    watchdog;
                struct carl9170_reg_list        rreg;
                struct carl9170_write_reg       wreg;
                struct carl9170_rf_init         rf_init;
                struct carl9170_psm             psm;
-               struct carl9170_cab_flush_cmd   cab_flush;
+               struct carl9170_bcn_ctrl_cmd    bcn_ctrl;
                u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
        } __packed;
 } __packed;
@@ -249,7 +256,6 @@ struct carl9170_rsp {
                struct carl9170_rf_init_result  rf_init_res;
                struct carl9170_u32_list        rreg_res;
                struct carl9170_u32_list        echo;
-               struct carl9170_watchdog_cmd    watchdog;
                struct carl9170_tx_status       tx_status[0];
                struct _carl9170_tx_status      _tx_status[0];
                struct carl9170_gpio            gpio;