Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
3.5 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. USBDRIVR.H
  5. Abstract:
  6. This file defines kernel mode ioctls available to USB
  7. drivers.
  8. The IOCTLS are sent to the PDO enumerated for USB devices by
  9. the USB 'enumerator' -- the usb hub driver.
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. --*/
  14. #ifndef __USBDRIVR_H__
  15. #define __USBDRIVR_H__
  16. #include "usbiodef.h"
  17. #include "usb.h"
  18. #include "usbdlib.h"
  19. #include "usbbusif.h"
  20. /*
  21. Define the standard USB 'URB' IOCTL
  22. IOCTL_INTERNAL_USB_SUBMIT_URB
  23. This IOCTL is used by client drivers to submit URB (USB Request Blocks)
  24. Parameters.Others.Argument1 = pointer to URB
  25. */
  26. #define IOCTL_INTERNAL_USB_SUBMIT_URB CTL_CODE(FILE_DEVICE_USB, \
  27. USB_SUBMIT_URB, \
  28. METHOD_NEITHER, \
  29. FILE_ANY_ACCESS)
  30. /* IOCTL_INTERNAL_USB_RESET_PORT
  31. This IOCTL is used by kernel mode drivers to reset their
  32. upstream port.
  33. After a successful reset the device is re-configured to the
  34. same configuration it was in before the reset. All pipe
  35. handles, configuration handles and interface handles remain
  36. valid.
  37. */
  38. #define IOCTL_INTERNAL_USB_RESET_PORT CTL_CODE(FILE_DEVICE_USB, \
  39. USB_RESET_PORT, \
  40. METHOD_NEITHER, \
  41. FILE_ANY_ACCESS)
  42. /* IOCTL_INTERNAL_USB_CYCLE_PORT
  43. This IOCTL will simulate a plug/unplug on the drivers upstream
  44. port. The device will be removed and re-added by PnP.
  45. */
  46. #define IOCTL_INTERNAL_USB_CYCLE_PORT CTL_CODE(FILE_DEVICE_USB, \
  47. USB_CYCLE_PORT, \
  48. METHOD_NEITHER, \
  49. FILE_ANY_ACCESS)
  50. /* IOCTL_INTERNAL_USB_GET_PORT_STATUS
  51. This IOCTL returns the current status of the devices upstream
  52. port.
  53. Parameters.Others.Argument1 =
  54. pointer to port status register (ULONG)
  55. status bits are:
  56. USBD_PORT_ENABLED
  57. USBD_PORT_CONNECTED
  58. */
  59. #define USBD_PORT_ENABLED 0x00000001
  60. #define USBD_PORT_CONNECTED 0x00000002
  61. #define IOCTL_INTERNAL_USB_GET_PORT_STATUS CTL_CODE(FILE_DEVICE_USB, \
  62. USB_GET_PORT_STATUS, \
  63. METHOD_NEITHER, \
  64. FILE_ANY_ACCESS)
  65. /* IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION
  66. This ioctl registers a device to receive notification when a specific
  67. timeout has expired and it should now be suspended in order to conserve
  68. power. If all devices on a hub are suspended, then the actual hub
  69. can be suspended.
  70. */
  71. typedef
  72. VOID
  73. (*USB_IDLE_CALLBACK)(
  74. PVOID Context
  75. );
  76. typedef struct _USB_IDLE_CALLBACK_INFO {
  77. USB_IDLE_CALLBACK IdleCallback;
  78. PVOID IdleContext;
  79. } USB_IDLE_CALLBACK_INFO, *PUSB_IDLE_CALLBACK_INFO;
  80. #define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION CTL_CODE(FILE_DEVICE_USB, \
  81. USB_IDLE_NOTIFICATION, \
  82. METHOD_NEITHER, \
  83. FILE_ANY_ACCESS)
  84. #endif // __USBDRIVR_H__