#define NDEBUG
#include "uhci.h"
-/* declare basic init functions and structures */
-int uhci_hcd_init(void);
-void uhci_hcd_cleanup(void);
-int STDCALL usb_init(void);
-void STDCALL usb_exit(void);
-
extern struct pci_driver uhci_pci_driver;
-extern struct pci_device_id* uhci_pci_ids;
-struct pci_device_id** pci_ids = &uhci_pci_ids;
+extern struct pci_device_id uhci_pci_ids[];
+struct pci_device_id* pci_ids = &uhci_pci_ids[0];
NTSTATUS
InitLinuxWrapper(PDEVICE_OBJECT DeviceObject)
{
NTSTATUS Status = STATUS_SUCCESS;
- POHCI_DEVICE_EXTENSION DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ PUSBMP_DEVICE_EXTENSION DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
/* Create generic linux structure */
struct pci_dev *dev;
/* Initialize generic linux structure */
dev->irq = DeviceExtension->InterruptVector;
dev->dev_ext = (PVOID)DeviceExtension;
+ dev->dev.dev_ext = (PVOID)DeviceObject;
dev->slot_name = ExAllocatePoolWithTag(NonPagedPool, 128, USB_UHCI_TAG); // 128 max len for slot name
init_wrapper(dev);
strcpy(dev->dev.name, "UnivHCI PCI-USB Controller");
strcpy(dev->slot_name, "UHCD PCI Slot");
- /* Init the OHCI HCD. Probe will be called automatically, but will fail because id=NULL */
+ /* Init the HCD. Probe will be called automatically, but will fail because id=NULL */
Status = uhci_hcd_init();
if (!NT_SUCCESS(Status))
{
/* Probe device with real id now */
uhci_pci_driver.probe(dev, uhci_pci_ids);
-// DPRINT1("UHCI :SysIoBusNumA %d\n",DeviceExtension->SystemIoBusNumber);
-// DeviceExtension->SystemIoBusNumber = dev->bus->number;
-// DPRINT1("UHCI: SysIoBusNumB %d\n",DeviceExtension->SystemIoBusNumber);
-
return Status;
}
VOID STDCALL
DriverUnload(PDRIVER_OBJECT DriverObject)
{
- POHCI_DEVICE_EXTENSION DeviceExtension;
+ PUSBMP_DEVICE_EXTENSION DeviceExtension;
PDEVICE_OBJECT DeviceObject;
struct pci_dev *dev;
DeviceObject = DriverObject->DeviceObject;
- DeviceExtension = (POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ DeviceExtension = (PUSBMP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
dev = DeviceExtension->pdev;
// Exit usb device
usb_exit();
- // Remove device (ohci_pci_driver.remove)
+ // Remove device (uhci_pci_driver.remove)
uhci_pci_driver.remove(dev);
ExFreePool(dev->slot_name);