forked from len0rd/rockbox
reorganise the USB stack a bit to allow for easier integration of non-ARC controller drivers
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18703 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6219f4c862
commit
478fc5baed
12 changed files with 185 additions and 99 deletions
|
@ -35,6 +35,9 @@ struct usb_class_driver {
|
|||
/* Set this to true if the driver needs exclusive disk access (e.g. usb storage) */
|
||||
bool needs_exclusive_ata;
|
||||
|
||||
/* Let the driver request endpoints it need. Returns zero on success */
|
||||
int (*request_endpoints)(struct usb_class_driver *);
|
||||
|
||||
/* Tells the driver what its first interface number will be. The driver
|
||||
returns the number of the first available interface for the next driver
|
||||
(i.e. a driver with one interface will return interface+1)
|
||||
|
@ -42,12 +45,6 @@ struct usb_class_driver {
|
|||
Mandatory function */
|
||||
int (*set_first_interface)(int interface);
|
||||
|
||||
/* Tells the driver what its first endpoint pair number will be. The driver
|
||||
returns the number of the first available endpoint pair for the next
|
||||
driver (i.e. a driver with one endpoint pair will return endpoint +1)
|
||||
Mandatory function */
|
||||
int (*set_first_endpoint)(int endpoint);
|
||||
|
||||
/* Asks the driver to put the interface descriptor and all other
|
||||
needed descriptor for this driver at dest.
|
||||
Returns the number of bytes taken by these descriptors.
|
||||
|
@ -69,10 +66,10 @@ struct usb_class_driver {
|
|||
Optional function */
|
||||
void (*disconnect)(void);
|
||||
|
||||
/* Tells the driver that a usb transfer has been completed. Note that "in"
|
||||
/* Tells the driver that a usb transfer has been completed. Note that "dir"
|
||||
is relative to the host
|
||||
Optional function */
|
||||
void (*transfer_complete)(int ep,bool in, int status, int length);
|
||||
void (*transfer_complete)(int ep,int dir, int status, int length);
|
||||
|
||||
/* Tells the driver that a control request has come in. If the driver is
|
||||
able to handle it, it should ack the request, and return true. Otherwise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue