From: John Hodge Date: Sun, 20 May 2012 03:55:54 +0000 (+0800) Subject: Modules/UHCI - Removed redundant packet splitting in bulk transfers X-Git-Tag: rel0.15~611^2~85 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b061cf94f62f46aada2ce6f13bc1cfbee261fae9;p=tpg%2Facess2.git Modules/UHCI - Removed redundant packet splitting in bulk transfers --- diff --git a/KernelLand/Modules/USB/UHCI/uhci.c b/KernelLand/Modules/USB/UHCI/uhci.c index 6e63079a..be27c39b 100644 --- a/KernelLand/Modules/USB/UHCI/uhci.c +++ b/KernelLand/Modules/USB/UHCI/uhci.c @@ -578,18 +578,11 @@ void *UHCI_BulkOUT(void *Ptr, int Dest, int bToggle, tUSBHostCb Cb, void *CbData ENTER("pPtr xDest ibToggle pCb pCbData pData iLength", Ptr, Dest, bToggle, Cb, CbData, Buf, Length); - while( Length > MAX_PACKET_SIZE ) - { - LOG("MaxPacket (rem = %i)", Length); - td = UHCI_int_CreateTD(Cont, Dest, PID_OUT, bToggle, NULL, NULL, src, MAX_PACKET_SIZE); - UHCI_int_AppendTD(Cont, qh, td); - - bToggle = !bToggle; - Length -= MAX_PACKET_SIZE; - src += MAX_PACKET_SIZE; + if( Length > MAX_PACKET_SIZE ) { + Log_Error("UHCI", "Passed an oversized packet by the USB code (%i > %i)", Length, MAX_PACKET_SIZE); + LEAVE('n'); } - - LOG("Final"); + td = UHCI_int_CreateTD(Cont, Dest, PID_OUT, bToggle, Cb, CbData, src, Length); UHCI_int_AppendTD(Cont, qh, td); @@ -604,18 +597,11 @@ void *UHCI_BulkIN(void *Ptr, int Dest, int bToggle, tUSBHostCb Cb, void *CbData, char *dst = Buf; ENTER("pPtr xDest ibToggle pCb pCbData pData iLength", Ptr, Dest, bToggle, Cb, CbData, Buf, Length); - while( Length > MAX_PACKET_SIZE ) - { - LOG("MaxPacket (rem = %i)", Length); - td = UHCI_int_CreateTD(Cont, Dest, PID_IN, bToggle, NULL, NULL, dst, MAX_PACKET_SIZE); - UHCI_int_AppendTD(Cont, qh, td); - - bToggle = !bToggle; - Length -= MAX_PACKET_SIZE; - dst += MAX_PACKET_SIZE; + if( Length > MAX_PACKET_SIZE ) { + Log_Error("UHCI", "Passed an oversized packet by the USB code (%i > %i)", Length, MAX_PACKET_SIZE); + LEAVE('n'); } - LOG("Final"); td = UHCI_int_CreateTD(Cont, Dest, PID_IN, bToggle, Cb, CbData, dst, Length); UHCI_int_AppendTD(Cont, qh, td);