XHCI: Make sure we have at least one TRB in CreateDescriptorChain.
Linux seems to do the same thing. Confirmed as correct by korli in #12929.
This commit is contained in:
parent
b5ded9cc1a
commit
db360a2064
@ -883,6 +883,9 @@ XHCI::CreateDescriptorChain(size_t bufferSize, int32 &trbCount)
|
||||
{
|
||||
size_t packetSize = B_PAGE_SIZE * 16;
|
||||
trbCount = (bufferSize + packetSize - 1) / packetSize;
|
||||
if (trbCount == 0)
|
||||
trbCount = 1;
|
||||
|
||||
// keep one trb for linking
|
||||
int32 tdCount = (trbCount + XHCI_MAX_TRBS_PER_TD - 2)
|
||||
/ (XHCI_MAX_TRBS_PER_TD - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user