X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fusb%2Fmain.c;h=649dc4bd9f797ce8d92671aac5b763ff816ebb14;hb=35cac8dcfa9d01fff0c929f0e2b9cc38fc919589;hp=bd8428a0e39a2940f24daec3a9f8815e22bac445;hpb=9e6041aee729b65a5a8bd386eb8a7fb13887fec9;p=carl9170fw.git diff --git a/carlfw/usb/main.c b/carlfw/usb/main.c index bd8428a..649dc4b 100644 --- a/carlfw/usb/main.c +++ b/carlfw/usb/main.c @@ -4,7 +4,7 @@ * Copyright (c) 2000-2005 ZyDAS Technology Corporation * Copyright (c) 2007-2009 Atheros Communications, Inc. * Copyright 2009 Johannes Berg - * Copyright 2009 Christian Lamparter + * Copyright 2009-2011 Christian Lamparter * * 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 @@ -384,7 +384,9 @@ static void usb_handler(uint8_t usb_interrupt_level1) fw.suspend_mode = CARL9170_HOST_SUSPENDED; - if (!(fw.usb.device_feature & USB_DEVICE_REMOTE_WAKEUP)) { +#ifdef CONFIG_CARL9170FW_WOL + if (!(fw.usb.device_feature & USB_DEVICE_REMOTE_WAKEUP) || + !fw.wlan.wol.cmd.flags) { disable_watchdog(); /* GO_TO_SUSPEND stops the CPU clock too. */ @@ -392,6 +394,12 @@ static void usb_handler(uint8_t usb_interrupt_level1) } else { wlan_prepare_wol(); } +#else /* CONFIG_CARL9170FW_WOL */ + disable_watchdog(); + + /* GO_TO_SUSPEND stops the CPU clock too. */ + orb(AR9170_USB_REG_MAIN_CTRL, AR9170_USB_MAIN_CTRL_GO_TO_SUSPEND); +#endif /* CONFIG_CARL9170FW_WOL */ } if (usb_interrupt_level2 & AR9170_USB_INTR_SRC7_USB_RESUME) { @@ -420,9 +428,4 @@ void handle_usb(void) void usb_timer(void) { -#ifdef CONFIG_CARL9170FW_WOL - if (fw.suspend_mode == CARL9170_AWAKE_HOST) { - set(AR9170_USB_REG_WAKE_UP, AR9170_USB_WAKE_UP_WAKE); - } -#endif /* CONFIG_CARL9170FW_WOL */ }