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
USB-XHCI BulkIn TransferLength
Re: USB-XHCI BulkIn TransferLength
Thank you for the kind words.
If done in assembly, that is quite the task. Not recommended, but still worth a nod to you.
Unless I am mistaken, I think you have confused a small detail. Even though the xHCI controller is capable of these speeds, the USB 2.0 drive is not.
Just because you have a 428 Cobra Jet on nitrous oxide for an engine, if the transmission is just a small C4 out of a Pinto, you aren't going very far very fast :-)
Does this make sense, or did I completely miss the question?
Ben
- https://www.fysnet.net/osdesign_book_series.htm
Re: USB-XHCI BulkIn TransferLength
Hi Ben,
Thank you for your answer.
I know that it is a USB2.0 pendrive, but I was just hoping to take advantage of that 64kB Transfer Length somehow, even though it is a USB2.0 pendrive.
To be honest, this was the answer I was waiting for. I just needed an expert to confirm it
Regards,
Rob
Thank you for your answer.
I know that it is a USB2.0 pendrive, but I was just hoping to take advantage of that 64kB Transfer Length somehow, even though it is a USB2.0 pendrive.
To be honest, this was the answer I was waiting for. I just needed an expert to confirm it
Regards,
Rob