carl9170 firmware: initial WoWLAN support
[carl9170fw.git] / carlfw / include / usb.h
index 6501e19ce1ce57136187f6c76f0adb5eaf30aead..cea1d4da90e00ef5eec51edb6f1dad42cc59e670 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright (c) 2000-2005 ZyDAS Technology Corporation
  * Copyright (c) 2007-2009 Atheros Communications, Inc.
  * Copyright   2009    Johannes Berg <johannes@sipsolutions.net>
- * Copyright 2009, 2010 Christian Lamparter <chunkeey@googlemail.com>
+ * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,11 +50,16 @@ static inline __inline bool usb_configured(void)
                  AR9170_USB_DEVICE_ADDRESS_CONFIGURE);
 }
 
-static inline __inline void usb_remote_wakeup(void)
+static inline __inline void usb_enable_remote_wakeup(void)
 {
        orb(AR9170_USB_REG_MAIN_CTRL, AR9170_USB_MAIN_CTRL_REMOTE_WAKEUP);
 }
 
+static inline __inline void usb_disable_remote_wakeup(void)
+{
+       andb(AR9170_USB_REG_MAIN_CTRL, ~AR9170_USB_MAIN_CTRL_REMOTE_WAKEUP);
+}
+
 static inline __inline void usb_enable_global_int(void)
 {
        orb(AR9170_USB_REG_MAIN_CTRL, AR9170_USB_MAIN_CTRL_ENABLE_GLOBAL_INT);
@@ -122,12 +127,12 @@ static inline __inline void usb_data_in0Byte(void)
 
 static inline __inline void usb_stop_down_queue(void)
 {
-       andl(AR9170_USB_REG_DMA_CTL, ~AR9170_DMA_CTL_ENABLE_TO_DEVICE);
+       andl(AR9170_USB_REG_DMA_CTL, ~AR9170_USB_DMA_CTL_ENABLE_TO_DEVICE);
 }
 
 static inline __inline void usb_start_down_queue(void)
 {
-       orl(AR9170_USB_REG_DMA_CTL, AR9170_DMA_CTL_ENABLE_TO_DEVICE);
+       orl(AR9170_USB_REG_DMA_CTL, AR9170_USB_DMA_CTL_ENABLE_TO_DEVICE);
 }
 
 static inline __inline void usb_clear_input_ep_toggle(unsigned int ep)
@@ -162,7 +167,7 @@ static inline void usb_structure_check(void)
        BUILD_BUG_ON(sizeof(struct usb_interface_descriptor) != USB_DT_INTERFACE_SIZE);
 }
 
-void __attribute__((noreturn)) jump_to_bootcode(void);
+void __noreturn jump_to_bootcode(void);
 
 void send_cmd_to_host(const uint8_t len, const uint8_t type,
                      const uint8_t ext, const uint8_t *body);
@@ -180,10 +185,7 @@ void usb_print_hex_dump(const void *buf, int len);
 void usb_init_highspeed_fifo_cfg(void);
 void usb_init_fullspeed_fifo_cfg(void);
 
-void start(void);
-
-#ifdef CONFIG_CARL9170FW_USB_WATCHDOG
-void usb_watchdog_timer(void);
-#endif /* CONFIG_CARL9170FW_USB_WATCHDOG */
+void __noreturn start(void);
+void __noreturn reboot(void);
 
 #endif /* __CARL9170FW_USB_H */