Only check the explicitly enabled interrupts in EHCI. Otherwise we might steal

a shared interrupt from someone else.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25822 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-06-06 11:23:38 +00:00
parent d39288b8d6
commit 856c49e614
3 changed files with 6 additions and 4 deletions

View File

@ -103,6 +103,7 @@ EHCI::EHCI(pci_info *info, Stack *stack)
fRegisterArea(-1),
fPCIInfo(info),
fStack(stack),
fEnabledInterrupts(0),
fPeriodicFrameListArea(-1),
fPeriodicFrameList(NULL),
fInterruptEntries(NULL),
@ -243,8 +244,9 @@ EHCI::EHCI(pci_info *info, Stack *stack)
// install the interrupt handler and enable interrupts
install_io_interrupt_handler(fPCIInfo->u.h0.interrupt_line,
InterruptHandler, (void *)this, 0);
WriteOpReg(EHCI_USBINTR, EHCI_USBINTR_HOSTSYSERR
| EHCI_USBINTR_USBERRINT | EHCI_USBINTR_USBINT | EHCI_USBINTR_INTONAA);
fEnabledInterrupts = EHCI_USBINTR_HOSTSYSERR | EHCI_USBINTR_USBERRINT
| EHCI_USBINTR_USBINT | EHCI_USBINTR_INTONAA;
WriteOpReg(EHCI_USBINTR, fEnabledInterrupts);
// allocate the periodic frame list
fPeriodicFrameListArea = fStack->AllocateArea((void **)&fPeriodicFrameList,
@ -787,7 +789,7 @@ EHCI::Interrupt()
// check if any interrupt was generated
uint32 status = ReadOpReg(EHCI_USBSTS);
if ((status & EHCI_USBSTS_INTMASK) == 0) {
if ((status & fEnabledInterrupts) == 0) {
release_spinlock(&lock);
return B_UNHANDLED_INTERRUPT;
}

View File

@ -134,6 +134,7 @@ static pci_module_info *sPCIModule;
area_id fRegisterArea;
pci_info *fPCIInfo;
Stack *fStack;
uint32 fEnabledInterrupts;
// Periodic transfer framelist and interrupt entries
area_id fPeriodicFrameListArea;

View File

@ -56,7 +56,6 @@
#define EHCI_USBSTS_PORTCHANGE (1 << 2) // Port Change Detected
#define EHCI_USBSTS_USBERRINT (1 << 1) // USB Error Interrupt
#define EHCI_USBSTS_USBINT (1 << 0) // USB Interrupt
#define EHCI_USBSTS_INTMASK 0x37 // All except frame list rollover
// USB Interrupt Enable Register (EHCI Spec 2.3.3)