X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FUSB%2FCore%2Fusb_poll.c;h=6285a11efc6183af577c8c4c2bcdc78e492abaca;hb=06f200335c3bcbd68c6df92589d8b17b73ac3679;hp=b6927fed2bb31afda01f28afcf932347cef552aa;hpb=48743e39650eb1ef988380e9d95f27fd40d3a9ce;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/USB/Core/usb_poll.c b/KernelLand/Modules/USB/Core/usb_poll.c index b6927fed..6285a11e 100644 --- a/KernelLand/Modules/USB/Core/usb_poll.c +++ b/KernelLand/Modules/USB/Core/usb_poll.c @@ -5,9 +5,10 @@ * usb_poll.c * - Endpoint polling */ -#define DEBUG 1 +#define DEBUG 0 #include #include "usb.h" +#include #define POLL_ATOM 25 // 25ms atom #define POLL_MAX 256 // Max period that can be nominated @@ -28,9 +29,14 @@ void USB_StartPollingEndpoint(tUSBInterface *Iface, int Endpoint) { tUSBEndpoint *endpt; + ENTER("pIface iEndpoint", Iface, Endpoint); + LEAVE('-'); + // Some sanity checks - if(Endpoint <= 0 || Endpoint > Iface->nEndpoints) return ; + if(Endpoint <= 0 || Endpoint > Iface->nEndpoints) + return ; endpt = &Iface->Endpoints[Endpoint-1]; + LOG("endpt(%p)->PollingPeriod = %i", endpt, endpt->PollingPeriod); if(endpt->PollingPeriod > POLL_MAX || endpt->PollingPeriod <= 0) return ; @@ -41,6 +47,7 @@ void USB_StartPollingEndpoint(tUSBInterface *Iface, int Endpoint) // Determine polling period in atoms endpt->PollingAtoms = (endpt->PollingPeriod + POLL_ATOM-1) / POLL_ATOM; if(endpt->PollingAtoms > POLL_SLOTS) endpt->PollingAtoms = POLL_SLOTS; + LOG("endpt(%p)->PollingAtoms = %i", endpt, endpt->PollingAtoms); // Add to poll queue // TODO: Locking { @@ -80,7 +87,7 @@ int USB_PollThread(void *unused) for( ep = gUSB_PollQueues[giUSB_PollPosition]; ep; prev = ep, ep = ep->Next ) { int period_in_atoms = ep->PollingAtoms; -// LOG("%i: ep = %p", giUSB_PollPosition, ep); + LOG("%i: ep = %p", giUSB_PollPosition, ep); // Check for invalid entries if(period_in_atoms < 0 || period_in_atoms > POLL_ATOM)