none
How to make URB for 8KBytes-Read? RRS feed

  • Question

  • I make the urb using the following code. But When the 8KBytes packet is received by high speed,
    OnUsbInterrupt is not called!!! If the size is reduced, it works.
    Is there read size limitation for the read-urb?

    UsbBuildInterruptOrBulkTransferRequest(    urb, sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER),
                                                                         pdx->UsbPipeHandle[ORDINAL_NUMBER_OF_DIRECTION_IN_PIPE],//hep1
                                                                         &pdx->pdata, NULL, 8*1024,                                                //interrupt success
                                                                         USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK,
                                                                         NULL);

    IoSetCompletionRoutine(Irp, (PIO_COMPLETION_ROUTINE) OnUsbInterrupt, pdx, TRUE, TRUE, TRUE);

    stack = IoGetNextIrpStackLocation(Irp);
    stack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
    stack->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB;
    stack->Parameters.Others.Argument1 = urb;

    Irp->Cancel = FALSE;    
    return IoCallDriver(pdx->NextStackDevice, Irp);

    Wednesday, April 18, 2012 1:43 AM

Answers

  • ssibseya wrote:
    >
    >I make the urb using the following code. But When the 8KBytes packet is received by high speed,
    >OnUsbInterrupt is not called!!! If the size is reduced, it works.
    >Is there read size limitation for the read-urb?
     
    Yes, but the limit is many megabytes.  Are you sure your device is
    delivering at least 8,192 bytes?  An interrupt transfer will wait until
    either (a) the entire amount is transferred or (b) there is a packet
    shorter than the maximum packet for the endpoint.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Thursday, April 19, 2012 6:55 AM

All replies

  • Irp->Cancel = FALSE;  is not necessary. that urb should work. is your firmware sending a ZLP packet at the end of the transfer?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, April 18, 2012 1:50 AM
  • ssibseya wrote:
    >
    >I make the urb using the following code. But When the 8KBytes packet is received by high speed,
    >OnUsbInterrupt is not called!!! If the size is reduced, it works.
    >Is there read size limitation for the read-urb?
     
    Yes, but the limit is many megabytes.  Are you sure your device is
    delivering at least 8,192 bytes?  An interrupt transfer will wait until
    either (a) the entire amount is transferred or (b) there is a packet
    shorter than the maximum packet for the endpoint.
    --
    Tim Roberts, timr@probo.com
    Providenza & Boekelheide, Inc.
     

    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.
    Thursday, April 19, 2012 6:55 AM