Author: janderwald Date: Sun Jan 29 20:34:46 2012 New Revision: 55294
URL: http://svn.reactos.org/svn/reactos?rev=55294&view=rev Log: [USBEHCI] - Enable device as pci bus master - Fixes hanging of Vmware USB EHCI controller - Revert changes from 55293 from usb_queue - Currently crashes when usbstor wants to receive descriptors
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/hardware.cpp branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp branches/usb-bringup-trunk/drivers/usb/usbehci_new/usbehci.h
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/hardware.cpp URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/us... ============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/hardware.cpp [iso-8859-1] Sun Jan 29 20:34:46 2012 @@ -226,14 +226,42 @@ 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; }
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/us... ============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/usb_queue.cpp [iso-8859-1] Sun Jan 29 20:34:46 2012 @@ -368,8 +368,6 @@ m_Hardware->GetCommandRegister(&UsbCmd); ASSERT(UsbCmd.AsyncEnable == TRUE);
- m_Hardware->SetAsyncListRegister(QueueHead->PhysicalAddr); - }
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/usbehci.h URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/us... ============================================================================== --- branches/usb-bringup-trunk/drivers/usb/usbehci_new/usbehci.h [iso-8859-1] (original) +++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/usbehci.h [iso-8859-1] Sun Jan 29 20:34:46 2012 @@ -2,7 +2,7 @@ #define USBEHCI_H__
#include <ntddk.h> -#define NDEBUG +#define YDEBUG #include <debug.h> #include <hubbusif.h> #include <usbbusif.h>