Rev 3520 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3520 | Rev 3522 | ||
---|---|---|---|
Line 518... | Line 518... | ||
518 | push 20 |
518 | push 20 |
519 | pop esi |
519 | pop esi |
520 | call delay_ms |
520 | call delay_ms |
521 | pop esi |
521 | pop esi |
522 | @@: |
522 | @@: |
523 | DEBUGF 1,'K : EHCI %x: command = %x, status = %x\n',esi,[edi+EhciCommandReg],[edi+EhciStatusReg] |
- | |
524 | ; 9. Return pointer to usb_controller. |
523 | ; 9. Return pointer to usb_controller. |
525 | xchg eax, esi |
524 | xchg eax, esi |
526 | ret |
525 | ret |
527 | ; On error, pop the pointer saved at step 1 and return zero. |
526 | ; On error, pop the pointer saved at step 1 and return zero. |
528 | ; Note that the main code branch restores the stack at step 7 and never fails |
527 | ; Note that the main code branch restores the stack at step 7 and never fails |
Line 737... | Line 736... | ||
737 | ; 2. Get the mask of events which should be processed. |
736 | ; 2. Get the mask of events which should be processed. |
738 | mov esi, [.controller] |
737 | mov esi, [.controller] |
739 | mov edi, [esi+ehci_controller.MMIOBase2-sizeof.ehci_controller] |
738 | mov edi, [esi+ehci_controller.MMIOBase2-sizeof.ehci_controller] |
740 | spin_lock_irqsave [esi+usb_controller.WaitSpinlock] |
739 | spin_lock_irqsave [esi+usb_controller.WaitSpinlock] |
741 | mov eax, [edi+EhciStatusReg] |
740 | mov eax, [edi+EhciStatusReg] |
742 | mov ecx, eax |
- | |
743 | ; DEBUGF 1,'K : [%d] EHCI status %x\n',[timer_ticks],eax |
741 | ; DEBUGF 1,'K : [%d] EHCI status %x\n',[timer_ticks],eax |
744 | ; 3. Check whether that interrupt has been generated by our controller. |
742 | ; 3. Check whether that interrupt has been generated by our controller. |
745 | ; (One IRQ can be shared by several devices.) |
743 | ; (One IRQ can be shared by several devices.) |
746 | and eax, [edi+EhciInterruptReg] |
744 | and eax, [edi+EhciInterruptReg] |
747 | jz .noint |
745 | jz .noint |
748 | ; 4. Clear the events we know of. |
746 | ; 4. Clear the events we know of. |
749 | ; Note that this should be done before processing of events: |
747 | ; Note that this should be done before processing of events: |
750 | ; new events could arise while we are processing those, this way we won't lose |
748 | ; new events could arise while we are processing those, this way we won't lose |
751 | ; them (the controller would generate another interrupt after completion |
749 | ; them (the controller would generate another interrupt after completion |
752 | ; of this one). |
750 | ; of this one). |
753 | DEBUGF 1,'K : EHCI %x interrupt: status = %x, enable = %x\n',esi,ecx,[edi+EhciInterruptReg] |
- | |
754 | ; DEBUGF 1,'K : EHCI interrupt: status = %x\n',eax |
751 | ; DEBUGF 1,'K : EHCI interrupt: status = %x\n',eax |
755 | mov [edi+EhciStatusReg], eax |
752 | mov [edi+EhciStatusReg], eax |
756 | ; 5. Sanity check. |
753 | ; 5. Sanity check. |
757 | test al, 10h |
754 | test al, 10h |
758 | jz @f |
755 | jz @f |