From: Christian Lamparter Date: Sat, 14 Aug 2010 00:47:49 +0000 (+0200) Subject: carl9170 firmware: remove usb transport watchdog X-Git-Tag: 1.8.5~4 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=95e0b3d5f76e191546422c4dbb7afd2ad679ff8d;p=carl9170fw.git carl9170 firmware: remove usb transport watchdog 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 --- diff --git a/carlfw/include/carl9170.h b/carlfw/include/carl9170.h index c85a4f3..220f2a1 100644 --- a/carlfw/include/carl9170.h +++ b/carlfw/include/carl9170.h @@ -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 { diff --git a/carlfw/include/cmd.h b/carlfw/include/cmd.h index c213704..8f94383 100644 --- a/carlfw/include/cmd.h +++ b/carlfw/include/cmd.h @@ -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); diff --git a/carlfw/include/config.h b/carlfw/include/config.h index b947f59..ac74cbc 100644 --- a/carlfw/include/config.h +++ b/carlfw/include/config.h @@ -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 diff --git a/carlfw/include/usb.h b/carlfw/include/usb.h index 5908839..f435760 100644 --- a/carlfw/include/usb.h +++ b/carlfw/include/usb.h @@ -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 */ diff --git a/carlfw/src/cmd.c b/carlfw/src/cmd.c index a9bdb63..e04e8da 100644 --- a/carlfw/src/cmd.c +++ b/carlfw/src/cmd.c @@ -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; } diff --git a/carlfw/src/fw.c b/carlfw/src/fw.c index fe59db5..6cd62ae 100644 --- a/carlfw/src/fw.c +++ b/carlfw/src/fw.c @@ -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 */ diff --git a/carlfw/src/timer.c b/carlfw/src/timer.c index 354eaf9..7cbd196 100644 --- a/carlfw/src/timer.c +++ b/carlfw/src/timer.c @@ -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 */ diff --git a/carlfw/usb/Kconfig b/carlfw/usb/Kconfig index 3d4709c..c1dad33 100644 --- a/carlfw/usb/Kconfig +++ b/carlfw/usb/Kconfig @@ -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" diff --git a/carlfw/usb/main.c b/carlfw/usb/main.c index 00c9326..a1cd2c9 100644 --- a/carlfw/usb/main.c +++ b/carlfw/usb/main.c @@ -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 */ - diff --git a/include/shared/fwcmd.h b/include/shared/fwcmd.h index fb5ab3f..af2fbbe 100644 --- a/include/shared/fwcmd.h +++ b/include/shared/fwcmd.h @@ -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; diff --git a/include/shared/fwdesc.h b/include/shared/fwdesc.h index 03b9ef2..86b998b 100644 --- a/include/shared/fwdesc.h +++ b/include/shared/fwdesc.h @@ -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; diff --git a/tools/src/fwinfo.c b/tools/src/fwinfo.c index 5ef3334..d446359 100644 --- a/tools/src/fwinfo.c +++ b/tools/src/fwinfo.c @@ -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),