summaryrefslogtreecommitdiff
path: root/firmware/export/usb.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-13 16:27:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-13 16:27:35 +0000
commit6da8b4eb4925f167588c868a64d2d057ca3bf85f (patch)
tree1441169e97f7ece3422a49e51dc512c8be0b31ae /firmware/export/usb.h
parent30414d56c9f8b4fc35ac2918c4d22e5e2ded0eb6 (diff)
downloadrockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.zip
rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.gz
rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.bz2
rockbox-6da8b4eb4925f167588c868a64d2d057ca3bf85f.tar.xz
USB retweaking: Take out the USB_REQUEST/RELEASE_DISK scheme and simply ask the USB core whether or not any drivers require exclusive access at the moment of connect. Doing anthing else just produces nasty effects on Windows because it expects some communication just for enabling the PHY and not allowing it to mount volumes if a thread doesn't ack causes annoying error message boxes. Make behavior of each USB type identical from the system perspective. Some miscellaneous changes (simplify, ata->storage naming, define only used USB_* enums values were possible).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19762 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/usb.h')
-rw-r--r--firmware/export/usb.h40
1 files changed, 25 insertions, 15 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index c8bbf28..49b70f6 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -24,20 +24,33 @@
#include "kernel.h"
#include "button.h"
+#if defined(IPOD_COLOR) || defined(IPOD_4G) \
+ || defined(IPOD_MINI) || defined(IPOD_MINI2G)
+#define USB_FIREWIRE_HANDLING
+#endif
+
/* Messages from usb_tick and thread states */
enum {
- USB_INSERTED,
- USB_EXTRACTED,
- USB_REENABLE,
- USB_POWERED,
- USB_TRANSFER_COMPLETION,
- USB_REQUEST_DISK,
- USB_RELEASE_DISK,
- USB_REQUEST_REBOOT,
- USB_QUIT,
+ USB_INSERTED, /* Event+State */
+ USB_EXTRACTED, /* Event+State */
+#ifdef HAVE_USB_POWER
+ USB_POWERED, /* State */
+#endif
+#ifdef HAVE_LCD_BITMAP
+ USB_SCREENDUMP, /* State */
+#endif
+#if (CONFIG_STORAGE & STORAGE_MMC)
+ USB_REENABLE, /* Event */
+#endif
+#ifdef HAVE_USBSTACK
+ USB_TRANSFER_COMPLETION, /* Event */
+#endif
+#ifdef USB_FIREWIRE_HANDLING
+ USB_REQUEST_REBOOT, /* Event */
+#endif
+ USB_QUIT, /* Event */
};
-
#ifdef HAVE_USB_POWER
#if CONFIG_KEYPAD == RECORDER_PAD
#define USBPOWER_BUTTON BUTTON_F1
@@ -111,13 +124,10 @@ bool usb_charging_enabled(void);
#ifdef HAVE_USBSTACK
void usb_signal_transfer_completion(struct usb_transfer_completion_event_data* event_data);
bool usb_driver_enabled(int driver);
-bool usb_exclusive_ata(void); /* ata is available for usb */
-void usb_request_exclusive_ata(void);
-void usb_release_exclusive_ata(void);
+bool usb_exclusive_storage(void); /* storage is available for usb */
#endif
-#if defined(IPOD_COLOR) || defined(IPOD_4G) \
- || defined(IPOD_MINI) || defined(IPOD_MINI2G)
+#ifdef USB_FIREWIRE_HANDLING
bool firewire_detect(void);
#endif