[tmp] byte order changes in usb_control_msg() (usb.c). somehow it need
authorBernhard Urban <lewurm@gmx.net>
Thu, 17 Sep 2009 17:25:18 +0000 (19:25 +0200)
committerBernhard Urban <lewurm@gmx.net>
Thu, 17 Sep 2009 17:25:18 +0000 (19:25 +0200)
fewer packets (more realistic?). further investigation will be done
soon.

usb/core/core.c
usb/core/usb.c
usb/host/ohci.c

index 1f7baf40dab1632a3907cdd6117caae3070c6e93..47e236c1d59a295433e183d69e8b36381528f8be 100644 (file)
@@ -100,8 +100,6 @@ usb_device *usb_add_device()
        dev->epTogl[2] = 0;
 
        char buf[64];
        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
 
        /* 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
        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 */
 
        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 */
 
index 9e973c3de2ca27cd7a5e4ae2374e07dc6a9aeb69..072dff74137b35d61f41be8babe458e72b704f85 100644 (file)
@@ -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;
 
        irp->epsize = dev->bMaxPacketSize0;
        irp->type = USB_CTRL;
 
+#if 1
        buf[0]=(char)requesttype;
        buf[1]=(char)request;            
        buf[2]=(char)(value >> 8);
        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);
        // 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;
 
        irp->buffer = buf;
        irp->len = length;
index de069cec8748e1385a31f988ca842500c19754fa..777eaac7638b919232dd3c50d4b625247a8c4833 100644 (file)
@@ -150,6 +150,7 @@ static void dbg_op_state()
 /**
  * Enqueue a transfer descriptor.
  */
 /**
  * Enqueue a transfer descriptor.
  */
+u8 first = 0;
 u8 hcdi_enqueue(usb_transfer_descriptor *td) {
        control_quirk();
 
 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));
                        "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 */
 
        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 */