diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-03-06 21:25:09 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-03-06 21:25:09 +0000 |
commit | f0b4a32d6f983b1bece0b8cb2f2da1fdd23b012e (patch) | |
tree | 90f36c9f421c174d0385268ea47f0013b0c8cd8c /firmware/export | |
parent | 5f83f0e4d2aaad77bda682cfd81a7ebb111a6024 (diff) | |
download | rockbox-f0b4a32d6f983b1bece0b8cb2f2da1fdd23b012e.tar.gz rockbox-f0b4a32d6f983b1bece0b8cb2f2da1fdd23b012e.zip |
reorganise the usb stack to provide a clean separation between core and class drivers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16541 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/usb.h | 17 | ||||
-rw-r--r-- | firmware/export/usb_core.h | 23 |
2 files changed, 16 insertions, 24 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h index 67793729c6..4dae7c2e68 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h | |||
@@ -24,13 +24,13 @@ | |||
24 | 24 | ||
25 | /* Messages from usb_tick and thread states */ | 25 | /* Messages from usb_tick and thread states */ |
26 | enum { | 26 | enum { |
27 | USB_INSERTED, | 27 | USB_INSERTED, |
28 | USB_EXTRACTED, | 28 | USB_EXTRACTED, |
29 | USB_REENABLE, | 29 | USB_REENABLE, |
30 | USB_POWERED, | 30 | USB_POWERED, |
31 | USB_TRANSFER_COMPLETION, | 31 | USB_TRANSFER_COMPLETION, |
32 | USB_REQUEST_DISK, | 32 | USB_REQUEST_DISK, |
33 | USB_REQUEST_REBOOT | 33 | USB_REQUEST_REBOOT |
34 | }; | 34 | }; |
35 | 35 | ||
36 | 36 | ||
@@ -69,7 +69,8 @@ enum { | |||
69 | enum { | 69 | enum { |
70 | USB_DRIVER_MASS_STORAGE, | 70 | USB_DRIVER_MASS_STORAGE, |
71 | USB_DRIVER_SERIAL, | 71 | USB_DRIVER_SERIAL, |
72 | USB_DRIVER_CHARGING_ONLY | 72 | USB_DRIVER_CHARGING_ONLY, |
73 | USB_NUM_DRIVERS | ||
73 | }; | 74 | }; |
74 | #endif | 75 | #endif |
75 | #ifdef HAVE_USBSTACK | 76 | #ifdef HAVE_USBSTACK |
diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index bb4ce6cedd..97712bca4d 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #ifndef BOOTLOADER | 22 | #ifndef BOOTLOADER |
23 | 23 | ||
24 | //#define USB_SERIAL | 24 | #define USB_SERIAL |
25 | #define USB_STORAGE | 25 | #define USB_STORAGE |
26 | #define USB_CHARGING_ONLY | 26 | #define USB_CHARGING_ONLY |
27 | #else /* BOOTLOADER */ | 27 | #else /* BOOTLOADER */ |
@@ -32,19 +32,8 @@ | |||
32 | #include "usb.h" | 32 | #include "usb.h" |
33 | 33 | ||
34 | /* endpoints */ | 34 | /* endpoints */ |
35 | enum { | 35 | #define EP_CONTROL 0 |
36 | EP_CONTROL = 0, | 36 | #define NUM_ENDPOINTS 3 |
37 | #ifdef USB_STORAGE | ||
38 | EP_MASS_STORAGE, | ||
39 | #endif | ||
40 | #ifdef USB_SERIAL | ||
41 | EP_SERIAL, | ||
42 | #endif | ||
43 | #ifdef USB_CHARGING_ONLY | ||
44 | EP_CHARGING_ONLY, | ||
45 | #endif | ||
46 | NUM_ENDPOINTS | ||
47 | }; | ||
48 | 37 | ||
49 | extern int usb_max_pkt_size; | 38 | extern int usb_max_pkt_size; |
50 | 39 | ||
@@ -54,7 +43,9 @@ void usb_core_control_request(struct usb_ctrlrequest* req); | |||
54 | void usb_core_transfer_complete(int endpoint, bool in, int status, int length); | 43 | void usb_core_transfer_complete(int endpoint, bool in, int status, int length); |
55 | void usb_core_bus_reset(void); | 44 | void usb_core_bus_reset(void); |
56 | bool usb_core_exclusive_connection(void); | 45 | bool usb_core_exclusive_connection(void); |
57 | void usb_core_enable_protocol(int driver,bool enabled); | 46 | void usb_core_enable_driver(int driver,bool enabled); |
58 | void usb_core_handle_transfer_completion(struct usb_transfer_completion_event_data* event); | 47 | bool usb_core_driver_enabled (int driver); |
48 | void usb_core_handle_transfer_completion( | ||
49 | struct usb_transfer_completion_event_data* event); | ||
59 | #endif | 50 | #endif |
60 | 51 | ||