mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
Now UHCI HCD driver supports recognizing Memory type of resource. Should help James Tabor's problem (VIA chipset, getting only memory resource as unrecognized, and thus driver failing loading).
svn path=/trunk/; revision=15496
This commit is contained in:
parent
a76329673c
commit
fcb49212d9
2 changed files with 21 additions and 5 deletions
|
@ -2491,7 +2491,7 @@ static int uhci_hcd_get_frame_number(struct usb_hcd *hcd)
|
||||||
|
|
||||||
static const char hcd_name[] = "uhci-hcd";
|
static const char hcd_name[] = "uhci-hcd";
|
||||||
|
|
||||||
static const struct hc_driver uhci_driver = {
|
static struct hc_driver uhci_driver = {
|
||||||
.description = hcd_name,
|
.description = hcd_name,
|
||||||
|
|
||||||
/* Generic hardware linkage */
|
/* Generic hardware linkage */
|
||||||
|
|
|
@ -6,9 +6,14 @@
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include "../linux/linux_wrapper.h"
|
|
||||||
|
// config and include core/hcd.h, for hc_device struct
|
||||||
|
#include "../usb_wrapper.h"
|
||||||
|
#include "../core/hcd.h"
|
||||||
|
|
||||||
#include "../host/ohci_main.h"
|
#include "../host/ohci_main.h"
|
||||||
|
|
||||||
|
|
||||||
// declare basic init funcs
|
// declare basic init funcs
|
||||||
void init_wrapper(struct pci_dev *probe_dev);
|
void init_wrapper(struct pci_dev *probe_dev);
|
||||||
int uhci_hcd_init(void);
|
int uhci_hcd_init(void);
|
||||||
|
@ -16,15 +21,13 @@ void uhci_hcd_cleanup(void);
|
||||||
int STDCALL usb_init(void);
|
int STDCALL usb_init(void);
|
||||||
void STDCALL usb_exit(void);
|
void STDCALL usb_exit(void);
|
||||||
extern struct pci_driver uhci_pci_driver;
|
extern struct pci_driver uhci_pci_driver;
|
||||||
extern const struct pci_device_id uhci_pci_ids[];
|
extern struct pci_device_id uhci_pci_ids[];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This should be removed, but for testing purposes it's here
|
// This should be removed, but for testing purposes it's here
|
||||||
struct pci_dev *dev;
|
struct pci_dev *dev;
|
||||||
//struct pci_device_id *dev_id;
|
//struct pci_device_id *dev_id;
|
||||||
|
|
||||||
|
|
||||||
#define USB_UHCI_TAG TAG('u','s','b','u')
|
#define USB_UHCI_TAG TAG('u','s','b','u')
|
||||||
|
|
||||||
NTSTATUS STDCALL AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo)
|
NTSTATUS STDCALL AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo)
|
||||||
|
@ -230,9 +233,22 @@ OHCD_PnPStartDevice(IN PDEVICE_OBJECT DeviceObject,
|
||||||
DeviceExtension->BaseAddrLength = Descriptor->u.Port.Length;
|
DeviceExtension->BaseAddrLength = Descriptor->u.Port.Length;
|
||||||
DeviceExtension->Flags = Descriptor->Flags;
|
DeviceExtension->Flags = Descriptor->Flags;
|
||||||
|
|
||||||
|
((struct hc_driver *)uhci_pci_ids->driver_data)->flags &= ~HCD_MEMORY;
|
||||||
|
|
||||||
DPRINT1("I/O resource: start=0x%x, length=0x%x\n",
|
DPRINT1("I/O resource: start=0x%x, length=0x%x\n",
|
||||||
DeviceExtension->BaseAddress.u.LowPart, DeviceExtension->BaseAddrLength);
|
DeviceExtension->BaseAddress.u.LowPart, DeviceExtension->BaseAddrLength);
|
||||||
}
|
}
|
||||||
|
else if (Descriptor->Type == CmResourceTypeMemory)
|
||||||
|
{
|
||||||
|
DeviceExtension->BaseAddress = Descriptor->u.Memory.Start;
|
||||||
|
DeviceExtension->BaseAddrLength = Descriptor->u.Memory.Length;
|
||||||
|
DeviceExtension->Flags = Descriptor->Flags;
|
||||||
|
|
||||||
|
((struct hc_driver *)uhci_pci_ids->driver_data)->flags |= HCD_MEMORY;
|
||||||
|
|
||||||
|
DPRINT1("Memory resource: start=0x%x, length=0x%x\n",
|
||||||
|
DeviceExtension->BaseAddress.u.LowPart, DeviceExtension->BaseAddrLength);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
DPRINT1("Get resource type: %d, Generic start=0x%x Generic length=0x%x\n",
|
DPRINT1("Get resource type: %d, Generic start=0x%x Generic length=0x%x\n",
|
||||||
Descriptor->Type, Descriptor->u.Generic.Start.u.LowPart, Descriptor->u.Generic.Length);
|
Descriptor->Type, Descriptor->u.Generic.Start.u.LowPart, Descriptor->u.Generic.Length);
|
||||||
|
|
Loading…
Reference in a new issue