X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=usb%2Fcore%2Fcore.h;h=b906bf2c6463b60e1831c49443e726db8b3e36e6;hb=f508d39c0a2c145a5a9e0ee8aab63b7b5bcd61c7;hp=143be33bb83b6547cc7e1653d2dcbeeefe9cd9af;hpb=7bff2456c919b94efa534efd15dec289314a682e;p=ppcskel.git diff --git a/usb/core/core.h b/usb/core/core.h index 143be33..b906bf2 100644 --- a/usb/core/core.h +++ b/usb/core/core.h @@ -9,15 +9,15 @@ * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of the FH Augsburg nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of the FH Augsburg nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -42,65 +42,100 @@ #include "../../bootmii_ppc.h" inline static void wait_ms(int ms) { - int i=0; - for(;i bit 7 is for direction 1=from dev to host */ - u8 epsize; - u8 type; /* control, interrupt, bulk or isochron */ +struct usb_irp { + struct usb_device *dev; + /* ep -> bit 7 is for direction 1=from dev to host */ + u8 endpoint; + u8 epsize; + /* control, interrupt, bulk or isochron */ + u8 type; - char * buffer; - u16 len; + u8 *buffer; + u16 len; - //list * td_list; - u16 timeout; + //list * td_list; + u16 timeout; }; /** * usb transfer descriptor */ -typedef struct usb_transfer_descriptor_t usb_transfer_descriptor; -struct usb_transfer_descriptor_t { - u8 devaddress; - u8 endpoint; - - // TODO: zusammenfassen! - u8 pid; - u8 iso; - u8 togl; - - char * buffer; - u16 actlen; - - u8 state; - usb_transfer_descriptor *next; +struct usb_transfer_descriptor { + u8 devaddress; + u8 endpoint; + u8 fullspeed; + + // TODO: zusammenfassen! + u8 pid; + u8 iso; + u8 togl; + + u8 *buffer; + u16 actlen; + + u8 state; + struct usb_transfer_descriptor *next; + u8 maxp; }; -//typedef struct usb_core_t usb_core; -struct usb_core_t { - u8 nextaddress; - void (*stdout)(char * arg); - // driver list - list * drivers; - list * devices; +struct usb_core { + u8 nextaddress; + void (*stdout)(char * arg); + // driver list + struct list *drivers; + struct list *devices; } core; void usb_init(); @@ -158,22 +193,22 @@ void usb_periodic(); u8 usb_next_address(); -usb_device * usb_add_device(); -u8 usb_remove_device(usb_device *dev); -u8 usb_register_driver(usb_driver *driver); +struct usb_device *usb_add_device(u8 lowspeed); +u8 usb_remove_device(struct usb_device *dev); +u8 usb_register_driver(struct usb_driver *driver); void usb_probe_driver(); +void lsusb(struct usb_device *dev); - -usb_irp * usb_get_irp(); -u8 usb_remove_irp(usb_irp *irp); -u16 usb_submit_irp(usb_irp *irp); +struct usb_irp *usb_get_irp(); +u8 usb_remove_irp(struct usb_irp *irp); +u16 usb_submit_irp(struct usb_irp *irp); -usb_transfer_descriptor * usb_create_transfer_descriptor(usb_irp *irp); +struct usb_transfer_descriptor *usb_create_transfer_descriptor(struct usb_irp *irp); -#define USB_IRP_WAITING 1 +#define USB_IRP_WAITING 1 #define USB_TRANSFER_DESCR_NONE 1