X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FUSB%2FCore%2Fusb_poll.c;h=27f4728e88983550f962b94b505c9e9ecabfe88d;hb=5cab4c07bc13888dc7956194ef9595508072a4eb;hp=12e14a9a388a1a7408e14af5f6a4e809fe7a0b6c;hpb=d8bf9f747a87c3c1d23461c155ef90b7fc148a21;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/USB/Core/usb_poll.c b/KernelLand/Modules/USB/Core/usb_poll.c index 12e14a9a..27f4728e 100644 --- a/KernelLand/Modules/USB/Core/usb_poll.c +++ b/KernelLand/Modules/USB/Core/usb_poll.c @@ -32,6 +32,9 @@ void USB_int_PollCallback(void *Ptr, void *Data, size_t Length) op->Length = Length; op->Data = ep->InputData; + LOG("op %p, endpoint %p (0x%x)", op, ep, + ep->Interface->Dev->Address * 16 + ep->EndpointNum); + Workqueue_AddWork(&gUSB_AsyncQueue, op); } @@ -49,6 +52,7 @@ void USB_StartPollingEndpoint(tUSBInterface *Iface, int Endpoint) endpt = &Iface->Endpoints[Endpoint-1]; LOG("endpt(%p)->PollingPeriod = %i", endpt, endpt->PollingPeriod); if(endpt->PollingPeriod > 256 || endpt->PollingPeriod <= 0) { + LOG("Invalid polling period"); LEAVE('-'); return ; } @@ -56,11 +60,10 @@ void USB_StartPollingEndpoint(tUSBInterface *Iface, int Endpoint) // TODO: Check that this endpoint isn't already on the queue endpt->InputData = malloc(endpt->MaxPacketSize); - - Iface->Dev->Host->HostDef->InterruptIN( - Iface->Dev->Host->Ptr, - Iface->Dev->Address * 16 + endpt->EndpointNum, - endpt->PollingPeriod, + LOG("Polling 0x%x at %i ms", Iface->Dev->Address * 16 + endpt->EndpointNum, endpt->PollingPeriod); + Iface->Dev->Host->HostDef->InitInterrupt( + Iface->Dev->Host->Ptr, Iface->Dev->Address * 16 + endpt->EndpointNum, + 0, endpt->PollingPeriod, USB_int_PollCallback, endpt, endpt->InputData, endpt->MaxPacketSize ); @@ -78,10 +81,12 @@ int USB_PollThread(void *unused) // Check hosts for( tUSBHost *host = gUSB_Hosts; host; host = host->Next ) { - host->HostDef->CheckPorts(host->Ptr); + if( host->HostDef->CheckPorts ) + host->HostDef->CheckPorts(host->Ptr); } - Time_Delay(100); + // 2s delay - fuck those with UHCI only :) + Time_Delay(2000); } }