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 {
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);
#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)
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
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 */
# 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;
}
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 */
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 */
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"
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 */
-
CARL9170_CMD_REBOOT = 0x04,
CARL9170_CMD_FLUSH_CAB = 0x05,
CARL9170_CMD_READ_TSF = 0x06,
- CARL9170_CMD_USB_WD = 0x07,
/* CAM */
CARL9170_CMD_EKEY = 0x10,
CARL9170_RSP_HEXDUMP = 0xcc,
CARL9170_RSP_RADAR = 0xcd,
CARL9170_RSP_GPIO = 0xce,
- CARL9170_RSP_USB_WD = 0xcf
};
struct carl9170_set_key_cmd {
} __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. */
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_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;
/* usb upload (fw -> app) stream */
CARL9170FW_USB_UP_STREAM,
- /* USB Watchdog */
- CARL9170FW_USB_WATCHDOG,
-
/* unusable - reserved to flag non-functional debug firmwares */
CARL9170FW_UNUSABLE,
#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;
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),