diff --git a/drivers/usb/usbehci_new/hardware.cpp b/drivers/usb/usbehci_new/hardware.cpp index c4007dc4d42..ee6a262475f 100644 --- a/drivers/usb/usbehci_new/hardware.cpp +++ b/drivers/usb/usbehci_new/hardware.cpp @@ -226,14 +226,42 @@ CUSBHardwareDevice::Initialize( return STATUS_SUCCESS; } - if (!(PciConfig.Command & PCI_ENABLE_BUS_MASTER)) - { - DPRINT1("PCI Configuration shows this as a non Bus Mastering device!\n"); - } - m_VendorID = PciConfig.VendorID; m_DeviceID = PciConfig.DeviceID; + + if (PciConfig.Command & PCI_ENABLE_BUS_MASTER) + { + // + // master is enabled + // + return STATUS_SUCCESS; + } + + DPRINT1("PCI Configuration shows this as a non Bus Mastering device! Enabling...\n"); + + PciConfig.Command |= PCI_ENABLE_BUS_MASTER; + BusInterface.SetBusData(BusInterface.Context, PCI_WHICHSPACE_CONFIG, &PciConfig, 0, PCI_COMMON_HDR_LENGTH); + + BytesRead = (*BusInterface.GetBusData)(BusInterface.Context, + PCI_WHICHSPACE_CONFIG, + &PciConfig, + 0, + PCI_COMMON_HDR_LENGTH); + + if (BytesRead != PCI_COMMON_HDR_LENGTH) + { + DPRINT1("Failed to get pci config information!\n"); + ASSERT(FALSE); + return STATUS_SUCCESS; + } + + if (!(PciConfig.Command & PCI_ENABLE_BUS_MASTER)) + { + PciConfig.Command |= PCI_ENABLE_BUS_MASTER; + DPRINT1("Failed to enable master\n"); + return STATUS_UNSUCCESSFUL; + } return STATUS_SUCCESS; } diff --git a/drivers/usb/usbehci_new/usb_queue.cpp b/drivers/usb/usbehci_new/usb_queue.cpp index 6b83f7d7402..a8ce84b6ce6 100644 --- a/drivers/usb/usbehci_new/usb_queue.cpp +++ b/drivers/usb/usbehci_new/usb_queue.cpp @@ -368,8 +368,6 @@ CUSBQueue::AddUSBRequest( m_Hardware->GetCommandRegister(&UsbCmd); ASSERT(UsbCmd.AsyncEnable == TRUE); - m_Hardware->SetAsyncListRegister(QueueHead->PhysicalAddr); - } diff --git a/drivers/usb/usbehci_new/usbehci.h b/drivers/usb/usbehci_new/usbehci.h index a4d18965d38..5e4f5abfaba 100644 --- a/drivers/usb/usbehci_new/usbehci.h +++ b/drivers/usb/usbehci_new/usbehci.h @@ -2,7 +2,7 @@ #define USBEHCI_H__ #include -#define NDEBUG +#define YDEBUG #include #include #include