carl9170 firmware: remove usb transport watchdog
authorChristian Lamparter <chunkeey@googlemail.com>
Sat, 14 Aug 2010 00:47:49 +0000 (02:47 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 14 Aug 2010 00:47:49 +0000 (02:47 +0200)
The idea of this watchdog was to check regulary,
whenever the driver was still responding to firmware
requests within a reasonable window. But the concept
is flawed and never received any substantial testing.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
12 files changed:
carlfw/include/carl9170.h
carlfw/include/cmd.h
carlfw/include/config.h
carlfw/include/usb.h
carlfw/src/cmd.c
carlfw/src/fw.c
carlfw/src/timer.c
carlfw/usb/Kconfig
carlfw/usb/main.c
include/shared/fwcmd.h
include/shared/fwdesc.h
tools/src/fwinfo.c

index c85a4f31c529ce737e7da8fdefe284ae5196b65e..220f2a1e07e51f41ea6494b05d230afc3a490196 100644 (file)
@@ -157,9 +157,6 @@ struct firmware_context_struct {
                uint8_t put_buffer[CARL9170_MAX_CMD_PAYLOAD_LEN];
 #endif /* CONFIG_CARL9170FW_DEBUG_USB */
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-               struct carl9170_watchdog_cmd watchdog;
-#endif /* CONFIG CARL9170FW_USB_WATCHDOG */
        } usb;
 
        struct {
index c213704fe226807a65798a97aa2c63b3b7791a20..8f943831633fb1bc71c52663e0fc2c2046da6c97 100644 (file)
@@ -40,7 +40,6 @@ static inline void __check(void)
        BUILD_BUG_ON(sizeof(struct carl9170_disable_key_cmd) != CARL9170_DISABLE_KEY_CMD_SIZE);
        BUILD_BUG_ON(sizeof(struct carl9170_rf_init) != CARL9170_RF_INIT_SIZE);
        BUILD_BUG_ON(sizeof(struct carl9170_rf_init_result) != CARL9170_RF_INIT_RESULT_SIZE);
-       BUILD_BUG_ON(sizeof(struct carl9170_watchdog_cmd) != CARL9170_WATCHDOG_CMD_SIZE);
        BUILD_BUG_ON(sizeof(struct carl9170_psm) != CARL9170_PSM_SIZE);
        BUILD_BUG_ON(sizeof(struct carl9170_tsf_rsp) != CARL9170_TSF_RSP_SIZE);
        BUILD_BUG_ON(sizeof(struct carl9170_cab_flush_cmd) != CARL9170_CAB_FLUSH_CMD_SIZE);
index b947f59b60f8fa4d3fdd2563853ec7ec9b9ed0ed..ac74cbc0e6df30f2193199e4f357be3010ad0805 100644 (file)
@@ -43,7 +43,6 @@
 #define CARL9170_TX_STATUS_NUM         (CARL9170_RSP_TX_STATUS_NUM)
 #define CARL9170_INT_RQ_CACHES         16
 #define AR9170_INT_MAGIC_HEADER_SIZE   12
-#define CARL9170_USB_WATCHDOG_TRIGGER_THRESHOLD        4
 #define CARL9170_TBTT_DELTA            (CARL9170_PRETBTT_KUS + 1)
 
 #define CARL9170_GPIO_MASK             (AR9170_GPIO_PORT_WPS_BUTTON_PRESSED)
@@ -62,7 +61,6 @@
 static inline void __config_check(void)
 {
        BUILD_BUG_ON(!CARL9170_TX_STATUS_NUM);
-       BUILD_BUG_ON(CARL9170_USB_WATCHDOG_TRIGGER_THRESHOLD < 2);
        BUILD_BUG_ON(CARL9170_INTF_NUM < 1);
 
 #ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ
index 59088399506653fa880fed20f3fc104a443abe23..f4357603029f8b093286d7615efb58330b13eb63 100644 (file)
@@ -183,8 +183,4 @@ void usb_init_fullspeed_fifo_cfg(void);
 void start(void);
 void __attribute__((noreturn)) reboot(void);
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-void usb_watchdog_timer(void);
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
-
 #endif /* __CARL9170FW_USB_H */
index a9bdb63368f01e8e84836e824273d94dd22049a6..e04e8da486b44dfac8eafe62374cb4cd595a6831 100644 (file)
@@ -123,14 +123,6 @@ void handle_cmd(struct carl9170_rsp *resp)
 # endif /* CONFIG_CARL9170FW_PSM */
 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIOS */
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-       case CARL9170_CMD_USB_WD:
-               resp->hdr.len = 4;
-               fw.usb.watchdog.state = le32_to_cpu(cmd->watchdog.state);
-               break;
-
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
-
        default:
                break;
        }
index fe59db56c6a148c701ee842164560f63b62e1c22..6cd62ae9151d71f994b7a4d87073b54972242303 100644 (file)
@@ -44,9 +44,6 @@ const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = {
                                        BIT(CARL9170FW_USB_DOWN_STREAM) |
 # endif /* CONFIG_CARL9170FW_USB_DOWN_STREAM */
 #endif /* CONFIG_CARL9170FW_USB_INIT_FIRMWARE */
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-                                       BIT(CARL9170FW_USB_WATCHDOG) |
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
 #ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
                                        BIT(CARL9170FW_COMMAND_PHY) |
 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
index 354eaf97dfc7b07780519ef17e1660feacdfb241..7cbd196dbb65ff716c9c0ae350ecd10b179b8d99 100644 (file)
@@ -78,10 +78,6 @@ static void timer0_isr(void)
        gpio_timer();
 #endif /* CONFIG_CARL9170FW_GPIO_INTERRUPT */
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-       usb_watchdog_timer();
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
-
 #ifdef CONFIG_CARL9170FW_DEBUG_LED_HEARTBEAT
        set(AR9170_GPIO_REG_PORT_DATA, get(AR9170_GPIO_REG_PORT_DATA) ^ 1);
 #endif /* CONFIG_CARL9170FW_DEBUG_LED_HEARTBEAT */
index 3d4709c518d664cce36c3624ce7481e15d49753a..c1dad332edff46ab3669acd235d7477103df284b 100644 (file)
@@ -31,15 +31,6 @@ config CARL9170FW_USB_DN_STREAM
        def_bool n
        prompt "USB Download Stream"
 
-config CARL9170FW_USB_WATCHDOG
-       def_bool n
-       prompt "Trigger Watchdog if USB transport died"
-       depends on CARL9170FW_WATCHDOG
-       ---help---
-        The idea is that the firmware constantly monitors if the
-        application answers *firmware ping* requests. If it gets
-        no response the firmware stops.
-
 config CARL9170FW_DEBUG_USB
        def_bool y
        prompt "Pass debug messages through USB transport"
index 00c9326163b0c46d19f17153c835a14f54216e62..a1cd2c9919b90fad5272e6c42c18d0c69902e91e 100644 (file)
@@ -384,25 +384,3 @@ void handle_usb(void)
                usb_trigger_in();
 }
 
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-void usb_watchdog_timer(void)
-{
-       if (fw.usb.watchdog.state == cpu_to_le32(CARL9170_USB_WATCHDOG_INACTIVE))
-               return;
-
-       fw.usb.watchdog.state++;
-
-       if (le32_to_cpu(fw.usb.watchdog.state) >= CARL9170_USB_WATCHDOG_TRIGGER_THRESHOLD) {
-               for (;;) {
-                       /*
-                        * Simply wait until the HW watchdog
-                        * timer has elapsed.
-                        */
-               }
-       }
-
-       send_cmd_to_host(sizeof(fw.usb.watchdog), CARL9170_RSP_USB_WD,
-                        0x80, (uint8_t *) &fw.usb.watchdog);
-}
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
-
index fb5ab3f62639902646cdbe6c770d6529179929ab..af2fbbe89648d54304dfb6accea9f77872183f47 100644 (file)
@@ -53,7 +53,6 @@ enum carl9170_cmd_oids {
        CARL9170_CMD_REBOOT             = 0x04,
        CARL9170_CMD_FLUSH_CAB          = 0x05,
        CARL9170_CMD_READ_TSF           = 0x06,
-       CARL9170_CMD_USB_WD             = 0x07,
 
        /* CAM */
        CARL9170_CMD_EKEY               = 0x10,
@@ -86,7 +85,6 @@ enum carl9170_cmd_oids {
        CARL9170_RSP_HEXDUMP            = 0xcc,
        CARL9170_RSP_RADAR              = 0xcd,
        CARL9170_RSP_GPIO               = 0xce,
-       CARL9170_RSP_USB_WD             = 0xcf
 };
 
 struct carl9170_set_key_cmd {
@@ -141,14 +139,6 @@ struct carl9170_rf_init_result {
 } __packed;
 #define        CARL9170_RF_INIT_RESULT_SIZE    4
 
-#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_PSM_SLEEP              0x1000
 #define        CARL9170_PSM_SOFTWARE           0
 #define        CARL9170_PSM_WAKE               0 /* internally used. */
@@ -184,7 +174,6 @@ 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;
@@ -258,7 +247,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;
index 03b9ef24c5b91cc2731da34f5daf888a212d3f36..86b998bd67d959d69a98532b3db04c3af948f5aa 100644 (file)
@@ -43,9 +43,6 @@ enum carl9170fw_feature_list {
        /* usb upload (fw -> app) stream */
        CARL9170FW_USB_UP_STREAM,
 
-       /* USB Watchdog */
-       CARL9170FW_USB_WATCHDOG,
-
        /* unusable - reserved to flag non-functional debug firmwares */
        CARL9170FW_UNUSABLE,
 
@@ -95,8 +92,8 @@ struct carl9170fw_desc_head {
 #define CARL9170FW_DESC_HEAD_SIZE                      \
        (sizeof(struct carl9170fw_desc_head))
 
-#define CARL9170FW_OTUS_DESC_MIN_VER           3
-#define CARL9170FW_OTUS_DESC_CUR_VER           3
+#define CARL9170FW_OTUS_DESC_MIN_VER           4
+#define CARL9170FW_OTUS_DESC_CUR_VER           4
 struct carl9170fw_otus_desc {
        struct carl9170fw_desc_head head;
        __le32 feature_set;
index 5ef3334bbd1d7843026f80fcff395b5e03348f09..d446359090d9e84918627232bc1a7c509e52ee63 100644 (file)
@@ -56,7 +56,6 @@ static const struct feature_list known_otus_features_v1[] = {
        CHECK_FOR_FEATURE(CARL9170FW_USB_RESP_EP2),
        CHECK_FOR_FEATURE(CARL9170FW_USB_DOWN_STREAM),
        CHECK_FOR_FEATURE(CARL9170FW_USB_UP_STREAM),
-       CHECK_FOR_FEATURE(CARL9170FW_USB_WATCHDOG),
        CHECK_FOR_FEATURE(CARL9170FW_UNUSABLE),
        CHECK_FOR_FEATURE(CARL9170FW_COMMAND_PHY),
        CHECK_FOR_FEATURE(CARL9170FW_COMMAND_CAM),