From: Bernhard Urban Date: Thu, 17 Sep 2009 17:25:18 +0000 (+0200) Subject: [tmp] byte order changes in usb_control_msg() (usb.c). somehow it need X-Git-Tag: firstresponse~27 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=commitdiff_plain;h=31c91f98447bb3e72a8d45fa594dee6bda266071 [tmp] byte order changes in usb_control_msg() (usb.c). somehow it need fewer packets (more realistic?). further investigation will be done soon. --- diff --git a/usb/core/core.c b/usb/core/core.c index 1f7baf4..47e236c 100644 --- a/usb/core/core.c +++ b/usb/core/core.c @@ -100,8 +100,6 @@ usb_device *usb_add_device() dev->epTogl[2] = 0; char buf[64]; - u8 devdescr_size; - u8 address = usb_next_address(); /* ask first 8 bytes of device descriptor with this special * GET Descriptor Request, when device address = 0 @@ -111,6 +109,8 @@ usb_device *usb_add_device() hexdump(buf, sizeof(buf)); #if 0 + u8 devdescr_size; + u8 address = usb_next_address(); dev->bMaxPacketSize0 = (u8) buf[7] ? (u8) buf[7] : 1; //dirty? /* setup real ep0 fifo size */ devdescr_size = (u8) buf[0]; /* save real length of device descriptor */ diff --git a/usb/core/usb.c b/usb/core/usb.c index 9e973c3..072dff7 100644 --- a/usb/core/usb.c +++ b/usb/core/usb.c @@ -142,6 +142,7 @@ u8 usb_control_msg(usb_device *dev, u8 requesttype, u8 request, u16 value, u16 i irp->epsize = dev->bMaxPacketSize0; irp->type = USB_CTRL; +#if 1 buf[0]=(char)requesttype; buf[1]=(char)request; buf[2]=(char)(value >> 8); @@ -151,6 +152,19 @@ u8 usb_control_msg(usb_device *dev, u8 requesttype, u8 request, u16 value, u16 i // lenght buf are the only where the order is inverted buf[6]=(char)(length); buf[7]=(char)(length >> 8); +#endif + //stupid hack? +#if 0 + buf[0]=(char)requesttype; + buf[1]=(char)request; + buf[2]=(char)(value); + buf[3]=(char)(value >> 8); + buf[4]=(char)(index); + buf[5]=(char)(index >> 8); + // lenght buf are the only where the order is inverted + buf[6]=(char)(length >> 8); + buf[7]=(char)(length); +#endif irp->buffer = buf; irp->len = length; diff --git a/usb/host/ohci.c b/usb/host/ohci.c index de069ce..777eaac 100644 --- a/usb/host/ohci.c +++ b/usb/host/ohci.c @@ -150,6 +150,7 @@ static void dbg_op_state() /** * Enqueue a transfer descriptor. */ +u8 first = 0; u8 hcdi_enqueue(usb_transfer_descriptor *td) { control_quirk(); @@ -158,6 +159,15 @@ u8 hcdi_enqueue(usb_transfer_descriptor *td) { "done head (vor sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); sync_before_read(&hcca_oh0, 256); printf("done head (nach sync): 0x%08X\n", ACCESS_LE(hcca_oh0.done_head)); + printf("HCCA->frame_no after %d seconds: %d\n", 0, ACCESS_LE(hcca_oh0.frame_no)); + printf("HCCA->frame_no WITHOUT conversion macro: %d\n", hcca_oh0.frame_no); + if(!first) { + first = 1; + udelay(1000000); + sync_before_read(&hcca_oh0, 256); + printf("HCCA->frame_no after %d seconds: %d\n", 1, ACCESS_LE(hcca_oh0.frame_no)); + printf("HCCA->frame_no WITHOUT conversion macro: %d\n", hcca_oh0.frame_no); + } struct general_td *tmptd = allocate_general_td(td->actlen); (void) memcpy((void*) (phys_to_virt(ACCESS_LE(tmptd->cbp))), td->buffer, td->actlen); /* throws dsi exception after some time :X */