USB-XHCI BulkIn TransferLength
Posted: Sat Oct 05, 2024 5:40 am
Hi,
I programmed EHCI and XHCI drivers (in 32-bit intel assembly) by the book Benjamin David Lunt - USB: The Universal Serial Bus (the 1st Ed.).
I can read/write files from/to FAT32 formatted pendrives. It is wonderful.
One of the pendrives I use for testing has BulkIn-MaxPacketSize=512 bytes. It is a 2.0 pendrive.
In case of EHCI, we can use the data-toggle in the QH(i.e. QueueHead) and not in the TD(i.e. TransferDescriptor).
This way we can transfer max. 0x5000 bytes per TD.
This is what my EHCI driver does. It can read a 45MB file in 3 seconds, and it uses much less memory for the TDs (with using just 512 bytes per TD, it would require much more memory).
In case of XHCI, the Data-TRB (i.e. Transfer Request Block) has a "TRB Transfer Length" of maximum 64kB, but it only works for me only with the BulkIn MaxPacketSize (512 bytes). I use that above mentioned 2.0 pendrive for testing XHCI too.
Using 512 bytes as TransferLength per TRB, requires inserting more than 92000 Data TRBs in the BulkIn EndPoint's Transfer Ring in case of reading a 45MB file.
The size of a TRB is 16 bytes, so the Transfer Ring is more than 1MB.
I suspect that XHCI should be faster/better than EHCI, so somehow it should be possible to use that 64kB "TRB Transfer Length".
I checked the XHCI specification, but I found nothing in connection with this.
Does anybody have an idea about this?
Regards,
Rob
I programmed EHCI and XHCI drivers (in 32-bit intel assembly) by the book Benjamin David Lunt - USB: The Universal Serial Bus (the 1st Ed.).
I can read/write files from/to FAT32 formatted pendrives. It is wonderful.
One of the pendrives I use for testing has BulkIn-MaxPacketSize=512 bytes. It is a 2.0 pendrive.
In case of EHCI, we can use the data-toggle in the QH(i.e. QueueHead) and not in the TD(i.e. TransferDescriptor).
This way we can transfer max. 0x5000 bytes per TD.
This is what my EHCI driver does. It can read a 45MB file in 3 seconds, and it uses much less memory for the TDs (with using just 512 bytes per TD, it would require much more memory).
In case of XHCI, the Data-TRB (i.e. Transfer Request Block) has a "TRB Transfer Length" of maximum 64kB, but it only works for me only with the BulkIn MaxPacketSize (512 bytes). I use that above mentioned 2.0 pendrive for testing XHCI too.
Using 512 bytes as TransferLength per TRB, requires inserting more than 92000 Data TRBs in the BulkIn EndPoint's Transfer Ring in case of reading a 45MB file.
The size of a TRB is 16 bytes, so the Transfer Ring is more than 1MB.
I suspect that XHCI should be faster/better than EHCI, so somehow it should be possible to use that 64kB "TRB Transfer Length".
I checked the XHCI specification, but I found nothing in connection with this.
Does anybody have an idea about this?
Regards,
Rob