Pārlūkot izejas kodu

Maybe fix for packets exact multiple of max sizes

Issue where multiple transfer structures were allocated, where  the transfer size is exact multiple of max size 16K, it allocated one extra before
main
Kurt Eckhardt pirms 5 gadiem
vecāks
revīzija
b5246c4a73
1 mainītis faili ar 15 papildinājumiem un 13 dzēšanām
  1. +15
    -13
      ehci.cpp

+ 15
- 13
ehci.cpp Parādīt failu

@@ -745,21 +745,23 @@ bool USBHost::queue_Data_Transfer(Pipe_t *pipe, void *buffer, uint32_t len, USBD
transfer = allocate_Transfer();
if (!transfer) return false;
data = transfer;
for (count=(len >> 14); count; count--) {
next = allocate_Transfer();
if (!next) {
// free already-allocated qTDs
while (1) {
next = (Transfer_t *)transfer->qtd.next;
free_Transfer(transfer);
if (transfer == data) break;
transfer = next;
if (len) {
for (count=((len-1) >> 14); count; count--) {
next = allocate_Transfer();
if (!next) {
// free already-allocated qTDs
while (1) {
next = (Transfer_t *)transfer->qtd.next;
free_Transfer(transfer);
if (transfer == data) break;
transfer = next;
}
return false;
}
return false;
data->qtd.next = (uint32_t)next;
data = next;
}
data->qtd.next = (uint32_t)next;
data = next;
}
}
// last qTD needs info for followup
data->qtd.next = 1;
data->pipe = pipe;

Notiek ielāde…
Atcelt
Saglabāt