dev->bDeviceSubClass, dev->bDeviceProtocoll,
dev->idVendor, dev->idProduct, dev->bcdDevice);
-#if 0
+#if 1
memset(buf, 0, 64);
- usb_control_msg(dev, 0x80, GET_DESCRIPTOR, (STRING<<8)|2, 0, 0x20, buf, 8, 0);
+ usb_control_msg(dev, 0x80, GET_DESCRIPTOR, (STRING<<8)|2, 0, 0x1a, buf, 8, 0);
hexdump(buf, sizeof(buf));
printf("String Descriptor [1]: ");
u8 i;
/* check bit 7 of bmRequestType */
if (bmRequestType & 0x80) {
/* schleife die die tds generiert */
- while (runloop || (restlength < 1)) {
+ while (runloop && (restlength > 0)) {
+ printf("restlength: %d\t irp->epsize: %d\n", restlength, irp->epsize);
td = usb_create_transfer_descriptor(irp);
td->actlen = irp->epsize;
/* stop loop if all bytes are send */
#include "host.h"
#include "../usbspec/usb11spec.h"
+/* activate control_quirk (from MIKE) */
+//#define _USE_C_Q
+
/* macro for accessing u32 variables that need to be in little endian byte order;
*
* whenever you read or write from an u32 field that the ohci host controller
(((dword) & 0x0000FF00) << 8) | \
(((dword) & 0x000000FF) << 24) )
-static struct endpoint_descriptor *allocate_endpoint();
static struct general_td *allocate_general_td();
-static void control_quirk();
static void dbg_op_state();
static void configure_ports(u8 from_init);
static void setup_port(u32 reg, u8 from_init);
static struct ohci_hcca hcca_oh0;
+#ifdef _USE_C_Q
static struct endpoint_descriptor *allocate_endpoint()
{
struct endpoint_descriptor *ep;
ep->headp = ep->tailp = ep->nexted = LE(0);
return ep;
}
+#endif
static struct general_td *allocate_general_td()
{
return td;
}
+#ifdef _USE_C_Q
static void control_quirk()
{
static struct endpoint_descriptor *ed = 0; /* empty ED */
printf("nohead!\n");
}
}
+#endif
static void dbg_op_state()
dest->flags |= LE(OHCI_TD_DIRECTION_PID_IN);
if(src->maxp > src->actlen) {
dest->flags |= LE(OHCI_TD_BUFFER_ROUNDING);
- printf("round buffer!");
+ printf("round buffer!\n");
}
/*
* let the endpoint do the togglestuff!
* there can be also inregular PID_IN pakets (@Status Stage)
*/
dest->flags |= LE(OHCI_TD_TOGGLE_CARRY);
-#if 0
- /* should be done by HC!
- * first pid_in start with DATA0 */
- */
- dummyconfig.headp = LE( src->togl ?
- LE(dummyconfig.headp) | OHCI_ENDPOINT_TOGGLE_CARRY :
- LE(dummyconfig.headp) & ~OHCI_ENDPOINT_TOGGLE_CARRY);
-#endif
break;
}
dest->flags |= LE(OHCI_TD_SET_DELAY_INTERRUPT(7));
if(edhead == 0)
return;
- control_quirk(); //required? YES! :O ... erm... or no? :/ ... in fact I have no idea
+#ifdef _USE_C_Q
+ required? YES! :O ... erm... or no? :/ ... in fact I have no idea
+ control_quirk();
+#endif
+
write32(OHCI0_HC_CTRL_HEAD_ED, virt_to_phys(edhead));
/* sync it all */