2005-06-13 20:41:59 +00:00
|
|
|
#include <debug.h>
|
|
|
|
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <ntddk.h>
|
|
|
|
#include <usbioctl.h>
|
2005-06-13 20:41:59 +00:00
|
|
|
|
2005-09-08 20:53:17 +00:00
|
|
|
#include "../miniport/usb_wrapper.h"
|
|
|
|
#include "../usbport/hub.h"
|
2005-06-13 20:41:59 +00:00
|
|
|
|
2009-08-24 17:38:50 +00:00
|
|
|
#define USB_HUB_TAG 'hbsu'
|
2005-06-13 20:41:59 +00:00
|
|
|
|
|
|
|
typedef struct _HUB_DEVICE_EXTENSION
|
|
|
|
{
|
|
|
|
BOOLEAN IsFDO;
|
|
|
|
struct usb_device* dev;
|
|
|
|
PDEVICE_OBJECT LowerDevice;
|
2005-06-19 14:15:39 +00:00
|
|
|
|
|
|
|
PDEVICE_OBJECT Children[USB_MAXCHILDREN];
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2005-06-19 14:15:39 +00:00
|
|
|
/* Fields valid only when IsFDO == FALSE */
|
|
|
|
UNICODE_STRING DeviceId; // REG_SZ
|
|
|
|
UNICODE_STRING InstanceId; // REG_SZ
|
|
|
|
UNICODE_STRING HardwareIds; // REG_MULTI_SZ
|
|
|
|
UNICODE_STRING CompatibleIds; // REG_MULTI_SZ
|
2005-06-20 05:54:19 +00:00
|
|
|
UNICODE_STRING SymbolicLinkName;
|
2005-06-13 20:41:59 +00:00
|
|
|
} HUB_DEVICE_EXTENSION, *PHUB_DEVICE_EXTENSION;
|
|
|
|
|
|
|
|
/* createclose.c */
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
UsbhubCreate(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
UsbhubClose(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
UsbhubCleanup(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
/* fdo.c */
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
UsbhubPnpFdo(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
UsbhubDeviceControlFdo(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
/* misc.c */
|
|
|
|
NTSTATUS
|
|
|
|
ForwardIrpAndWait(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
ForwardIrpAndForget(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
UsbhubDuplicateUnicodeString(
|
|
|
|
OUT PUNICODE_STRING Destination,
|
|
|
|
IN PUNICODE_STRING Source,
|
|
|
|
IN POOL_TYPE PoolType);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
UsbhubInitMultiSzString(
|
|
|
|
OUT PUNICODE_STRING Destination,
|
|
|
|
... /* list of PCSZ */);
|
|
|
|
|
|
|
|
/* pdo.c */
|
2008-11-30 11:16:55 +00:00
|
|
|
NTSTATUS NTAPI
|
2005-06-13 20:41:59 +00:00
|
|
|
UsbhubPnpPdo(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
2006-05-15 16:38:49 +00:00
|
|
|
UsbhubInternalDeviceControlPdo(
|
2005-06-13 20:41:59 +00:00
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|