Changeset 21231

Show
Ignore:
Timestamp:
05/24/07 17:45:11 (18 months ago)
Author:
mmu_man
Message:

Added a keep_port_ownership driver setting for EHCI, to allow keeping devices on EHCI instead of giving them up to the 1.0 controller.
Hopefully this will get things working here until OHCI is implemented.

Location:
haiku/trunk/src/add-ons/kernel/busses/usb
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/add-ons/kernel/busses/usb/ehci.cpp

    r21059 r21231  
    1111#include <USB3.h> 
    1212#include <KernelExport.h> 
     13#include <driver_settings.h> 
    1314 
    1415#include "ehci.h" 
     
    111112                fRootHub(NULL), 
    112113                fRootHubAddress(0), 
     114                fKeepPortOwnership(false), 
    113115                fPortCount(0), 
    114116                fPortResetChange(0), 
     
    122124        TRACE(("usb_ehci: constructing new EHCI Host Controller Driver\n")); 
    123125        fInitOK = false; 
     126 
     127        void *handle = load_driver_settings("ehci"); 
     128        if (handle) { 
     129                fKeepPortOwnership = get_driver_boolean_parameter(handle, "keep_port_ownership", false, true); 
     130                unload_driver_settings(handle); 
     131        } 
    124132 
    125133        // enable busmaster and memory mapped access 
     
    678686        uint32 portStatus = ReadOpReg(portRegister) & EHCI_PORTSC_DATAMASK; 
    679687 
    680         if (portStatus & EHCI_PORTSC_DMINUS) { 
     688        if (!fKeepPortOwnership && (portStatus & EHCI_PORTSC_DMINUS)) { 
    681689                TRACE(("usb_ehci: lowspeed device connected, giving up port ownership\n")); 
    682690                // there is a lowspeed device connected. 
     
    702710        } 
    703711 
    704         if ((portStatus & EHCI_PORTSC_ENABLE) == 0) { 
     712        if (!fKeepPortOwnership && (portStatus & EHCI_PORTSC_ENABLE) == 0) { 
    705713                TRACE(("usb_ehci: fullspeed device connected, giving up port ownership\n")); 
    706714                // the port was not enabled, this means that no high speed device is 
  • haiku/trunk/src/add-ons/kernel/busses/usb/ehci.h

    r21044 r21231  
    157157 
    158158                // Port management 
     159                bool                                            fKeepPortOwnership; 
    159160                uint8                                           fPortCount; 
    160161                uint16                                          fPortResetChange;