X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FUSB%2FEHCI%2Fehci.c;h=a2acca2a14b27d54755daac83d4caf1628ab1766;hb=3be7e2aa30e9c6d6b73290f4881bfea8afce01fd;hp=2dd86108f9e5b354e4d0f7e9bda6c98c66264d50;hpb=a8759b69a7dddfeff55bdfde62a9a0765ccc7eee;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/USB/EHCI/ehci.c b/KernelLand/Modules/USB/EHCI/ehci.c index 2dd86108..a2acca2a 100644 --- a/KernelLand/Modules/USB/EHCI/ehci.c +++ b/KernelLand/Modules/USB/EHCI/ehci.c @@ -94,9 +94,32 @@ int EHCI_Initialise(char **Arguments) // TODO: Detect other forms of failure than "out of slots" break ; } + } - // TODO: Register with the USB stack + for( int i = 0; Arguments[i]; i ++ ) + { + char *pos = Arguments[i], *next; + LOG("pos = '%s'", pos); + tPAddr base = strtoull(pos, &next, 16); + if( base == 0 ) + continue; + pos = next; + LOG("pos = '%s'", pos); + if( *pos++ != '-' ) + continue; + LOG("pos = '%s'", pos); + int irq = strtol(pos, &next, 16); + if( irq == 0 ) + continue ; + if( *next != 0 ) + continue; + LOG("base=%x, irq=%i", base, irq); + if( EHCI_InitController(base, irq) ) + { + continue ; + } } + return 0; } @@ -137,7 +160,8 @@ int EHCI_InitController(tPAddr BaseAddress, Uint8 InterruptNum) } // TODO: Error check if( (cont->CapRegs->CapLength & 3) ) { - Log_Warning("EHCI", "Controller at %P non-aligned op regs", BaseAddress); + Log_Warning("EHCI", "Controller at %P non-aligned op regs (%x)", + BaseAddress, cont->CapRegs->CapLength); goto _error; } cont->OpRegs = (void*)( (Uint32*)cont->CapRegs + cont->CapRegs->CapLength / 4 );