Merge branch 'master' of git://localhost/acess2
[tpg/acess2.git] / KernelLand / Modules / USB / EHCI / ehci.c
index db1f3e3..d202d06 100644 (file)
@@ -258,11 +258,11 @@ int EHCI_InitController(tPAddr BaseAddress, Uint8 InterruptNum)
 _error:
        cont->PhysBase = 0;
        if( cont->CapRegs )
-               MM_Deallocate( (tVAddr)cont->CapRegs );
+               MM_Deallocate( cont->CapRegs );
        if( cont->PeriodicQueue )
-               MM_Deallocate( (tVAddr)cont->PeriodicQueue );
+               MM_Deallocate( cont->PeriodicQueue );
        if( cont->TDPool )
-               MM_Deallocate( (tVAddr)cont->TDPool );
+               MM_Deallocate( cont->TDPool );
        LEAVE('i', 2);
        return 2;
 }
@@ -888,6 +888,8 @@ void EHCI_int_ReclaimQHs(tEHCI_Controller *Cont)
                        LOG("Calling %p(%p) for EndPt %x (%p+0x%x)",
                                qh->Impl.Callback, qh->Impl.CallbackData,
                                qh->Impl.Endpt->EndpointID, last->Impl.Ptr, transferred_len);
+                       //if( last->Impl.Ptr )
+                       //      Debug_HexDump("EHCI Callback Data", last->Impl.Ptr, transferred_len);
                        qh->Impl.Callback(qh->Impl.CallbackData, last->Impl.Ptr, transferred_len);
                }
                
@@ -899,6 +901,7 @@ void EHCI_int_ReclaimQHs(tEHCI_Controller *Cont)
 void EHCI_int_InterruptThread(void *ControllerPtr)
 {
        tEHCI_Controller        *Cont = ControllerPtr;
+       Threads_SetName("EHCI Interrupt Worker");
        while(Cont->OpRegs)
        {
                Uint32  events;
@@ -918,9 +921,8 @@ void EHCI_int_InterruptThread(void *ControllerPtr)
                if( events & EHCI_THREADEVENT_IOC )
                {
                        // IOC, handle completed requests
-                       Log_Warning("EHCI", "%P IOC - TODO: Call registered callbacks and reclaim",
-                               Cont->PhysBase);
                        // Search periodic lists for one that fired
+                       EHCI_int_CheckInterruptQHs(Cont);
                        // Retire QHs
                        // - Remove them from the queue and ask the controller to bell when they're removable
                        EHCI_int_RetireQHs(Cont);

UCC git Repository :: git.ucc.asn.au