From: John Hodge (sonata) Date: Sat, 10 Nov 2012 05:08:50 +0000 (+0800) Subject: Modules/UHCI - Added option to disable at runtime X-Git-Tag: rel0.15~666 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=f229f77c2b2c78d17d003988214062c66741b6ec;p=tpg%2Facess2.git Modules/UHCI - Added option to disable at runtime --- diff --git a/KernelLand/Modules/USB/UHCI/uhci.c b/KernelLand/Modules/USB/UHCI/uhci.c index 0fe80dcb..5a7faa0e 100644 --- a/KernelLand/Modules/USB/UHCI/uhci.c +++ b/KernelLand/Modules/USB/UHCI/uhci.c @@ -4,7 +4,7 @@ * * Universal Host Controller Interface */ -#define DEBUG 0 +#define DEBUG 1 #define VERSION VER2(0,5) #include #include @@ -93,7 +93,14 @@ int UHCI_Initialise(char **Arguments) int ret; ENTER(""); - + + if( Arguments && *Arguments && strcmp(*Arguments, "0") == 0 ) + { + LOG("Disabled by argument"); + LEAVE('i', MODULE_ERR_NOTNEEDED); + return MODULE_ERR_NOTNEEDED; + } + // Initialise with no maximum value Semaphore_Init( &gUHCI_InterruptSempahore, 0, 0, "UHCI", "Interrupt Queue"); @@ -199,6 +206,7 @@ int UHCI_int_InitHost(tUHCI_Controller *Host) 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30, 1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 }; + // Fill all slots (but every 4th will be changed below for( int i = 0; i < 1024; i ++ ) { Uint32 addr = MM_GetPhysAddr( &Host->TDQHPage->ControlQH ); Host->FrameList[i] = addr | 2; @@ -574,7 +582,7 @@ void *UHCI_SendControl(void *Ptr, void *Endpt, tUSBHostCb Cb, void *CbData, void *InData, size_t InLength ) { - ENTER("pPtr pEndpt ibOutbound", Ptr, Endpt, bOutbound); + ENTER("pPtr pEndpt bOutbound", Ptr, Endpt, bOutbound); tUHCI_Controller *Cont = Ptr; tUHCI_QH *qh = &Cont->TDQHPage->ControlQH; @@ -644,7 +652,14 @@ void *UHCI_SendControl(void *Ptr, void *Endpt, tUSBHostCb Cb, void *CbData, // Update toggle value epi->Tgl = tgl; - + + // --- HACK!!! +// for( int i = 0; i < 1024; i ++ ) +// { +// LOG("- FrameList[%i] = %x", i, Cont->FrameList[i]); +// } + // --- /HACK + LEAVE('p', td); return td; } @@ -658,7 +673,7 @@ void *UHCI_SendBulk(void *Ptr, void *Endpt, tUSBHostCb Cb, void *CbData, int bOu int dest, tgl; size_t mps; - ENTER("pPtr pEndpt pCb pCbData bOutbound pData iLength", Ptr, Dest, Cb, CbData, bOutbound, Data, Length); + ENTER("pPtr pEndpt pCb pCbData bOutbound pData iLength", Ptr, Endpt, Cb, CbData, bOutbound, Data, Length); if( Endpt == NULL ) { Log_Error("UHCI", "_SendBulk passed a NULL endpoint handle");