Ticket #7478: ohci_disable_interrupts_early.diff

File ohci_disable_interrupts_early.diff, 1.5 KB (added by mmlr, 11 years ago)
  • src/add-ons/kernel/busses/usb/ohci.cpp

     
    204204    fInterruptEndpoints[0]->next_physical_endpoint
    205205        = fDummyIsochronous->physical_address;
    206206
     207    // Disable all interrupts before handoff/reset
     208    _WriteReg(OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTERRUPTS);
     209
    207210    // Determine in what context we are running (Kindly copied from FreeBSD)
    208211    uint32 control = _ReadReg(OHCI_CONTROL);
    209212    if (control & OHCI_INTERRUPT_ROUTING) {
     
    235238    uint32 frameInterval = _ReadReg(OHCI_FRAME_INTERVAL);
    236239    uint32 intervalValue = OHCI_GET_INTERVAL_VALUE(frameInterval);
    237240
    238     // Disable interrupts right before we reset
    239241    _WriteReg(OHCI_COMMAND_STATUS, OHCI_HOST_CONTROLLER_RESET);
    240242    // Nominal time for a reset is 10 us
    241243    uint32 reset = 0;
     
    252254    }
    253255
    254256    // The controller is now in SUSPEND state, we have 2ms to go OPERATIONAL.
    255     // Interrupts are disabled.
    256257
    257258    // Set up host controller register
    258259    _WriteReg(OHCI_HCCA, (uint32)hccaPhysicalAddress);
    259260    _WriteReg(OHCI_CONTROL_HEAD_ED, (uint32)fDummyControl->physical_address);
    260261    _WriteReg(OHCI_BULK_HEAD_ED, (uint32)fDummyBulk->physical_address);
    261     // Disable all interrupts
    262     _WriteReg(OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTERRUPTS);
    263262    // Switch on desired functional features
    264263    control = _ReadReg(OHCI_CONTROL);
    265264    control &= ~(OHCI_CONTROL_BULK_SERVICE_RATIO_MASK | OHCI_ENABLE_LIST