Source code of Windows XP (NT5)
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.

2077 lines
47 KiB

  1. /*++
  2. Copyright (c) 1993 Microsoft Corporation
  3. :ts=4
  4. Module Name:
  5. uhcd.h
  6. Abstract:
  7. This module contains the PRIVATE definitions for the
  8. code that implements the UHC device driver for USB.
  9. Environment:
  10. Kernel & user mode
  11. Revision History:
  12. 10-27-95 : created
  13. --*/
  14. #ifndef __UHCD_H__
  15. #define __UHCD_H__
  16. //enable pageable code
  17. #ifndef PAGE_CODE
  18. #define PAGE_CODE
  19. #endif
  20. #if !defined(max)
  21. #define max(a, b) (a > b ? a : b)
  22. #endif // !defined(max)
  23. /*
  24. Registry Keys
  25. */
  26. // Disables selective suspend for the root hub ports.
  27. // this behavior is the default for the PIIX3 or PIIX4 because
  28. // of hardware bugs -- it is off (ie sel suspend enabled)
  29. // for all other UHCI controllers unless this key is set
  30. #define DISABLE_SELECTIVE_SUSPEND L"DisableSelectiveSuspend"
  31. // used to overide the default clock timing in the host controller
  32. // hardware.
  33. // Some motherboard designs use a cheap clock crystal -- if so there
  34. // is an adjustment that must be made to the SOF clock.
  35. // This system BIOS should do this but if it does not there is a
  36. // utility that can be run to determine the correct value which can
  37. // then be set with these registry keys
  38. #define CLOCKS_PER_FRAME L"timingClocksPerFrame"
  39. #define REC_CLOCKS_PER_FRAME L"recommendedClocksPerFrame"
  40. #define DEBUG_LEVEL L"debuglevel"
  41. #define DEBUG_WIN9X L"debugWin9x"
  42. /*****/
  43. #define LEGSUP_HCD_MODE 0x2000 // value to put in LEGSUP reg for normal HCD use JMD
  44. #define LEGSUP_BIOS_MODE 0x00BF // value to put in LEGSUP reg for BIOS/SMI use JMD
  45. #define LEGSUP_USBPIRQD_EN 0x2000 // bit 13
  46. //
  47. // Defines for enabling certian host controller driver features
  48. #define VIA_HC // enable support for the VIA version of the
  49. // Universal Host Controller
  50. #define ENABLE_B0_FEATURES // enable B0 optimizations
  51. #define RECLAIM_BW // enable bandwidth reclimation for bulk
  52. #include "usbdlibi.h"
  53. #include "usbdlib.h"
  54. #include "roothub.h"
  55. //
  56. // total bandwidth in bits/ms
  57. //
  58. #define UHCD_TOTAL_USB_BW 12000
  59. //
  60. // 10% reserved for bulk and control
  61. //
  62. #define UHCD_BULK_CONTROL_BW (UHCD_TOTAL_USB_BW/10)
  63. //
  64. // Number of times to try and get controller out of hung frame counter
  65. // state before giving up (approx. 4ms per shot)
  66. //
  67. #define UHCD_MAX_KICK_STARTS 3
  68. //
  69. // enable USB BIOS support
  70. //
  71. #define USB_BIOS
  72. //
  73. // enable root hub support
  74. //
  75. #define ROOT_HUB
  76. // flag to enable debug timing code
  77. #if DBG
  78. //#define DBG_TIMING
  79. #define DEBUG_LOG
  80. #endif
  81. #define FRAME_LIST_SIZE 1024
  82. // number of bit times in a USB frame based on a 12MHZ SOF clock
  83. #define UHCD_12MHZ_SOF 11936
  84. //
  85. // we keep a list of TDs for use as interrupt triggers,
  86. // frame rollover detection and error recovery
  87. // TDs 0,1 are used for frame rollover
  88. // TD 2 is used for error recovery
  89. // TD 3,4 reserved for PIIX4 hack
  90. // TDs 5+ are used as triggers
  91. //
  92. #define UHCD_FIRST_TRIGGER_TD 5
  93. #include "dbg.h"
  94. //
  95. // This is (on average) how many ms we can expect it to take for us to get an
  96. // iso request in to the schedule.
  97. //
  98. #define UHCD_ASAP_LATENCY 5
  99. //
  100. // UHCD pending status values
  101. //
  102. // Urb is the current urb being serviced for the endpoint
  103. #define UHCD_STATUS_PENDING_CURRENT \
  104. (((USBD_STATUS)0x00000001L) | USBD_STATUS_PENDING)
  105. // Urb is queued to the endpoint
  106. #define UHCD_STATUS_PENDING_QUEUED \
  107. (((USBD_STATUS)0x00000002L) | USBD_STATUS_PENDING)
  108. // Urb is being canceled in hardware
  109. #define UHCD_STATUS_PENDING_CANCELING \
  110. (((USBD_STATUS)0x00000003L) | USBD_STATUS_PENDING)
  111. // Urb in hardware needs to be canceled
  112. #define UHCD_STATUS_PENDING_XXX \
  113. (((USBD_STATUS)0x00000004L) | USBD_STATUS_PENDING)
  114. // the Urb is queued to the startio routine
  115. #define UHCD_STATUS_PENDING_STARTIO \
  116. (((USBD_STATUS)0x00000005L) | USBD_STATUS_PENDING)
  117. //
  118. // Macros used to keep track of how many pending urbs are
  119. // associated with an endpoint.
  120. //
  121. #define DECREMENT_PENDING_URB_COUNT(irp) \
  122. (((LONG)(ULONG_PTR)(IoGetCurrentIrpStackLocation(irp))->\
  123. Parameters.Others.Argument2)--)
  124. #define INCREMENT_PENDING_URB_COUNT(irp) \
  125. (((LONG)(ULONG_PTR)(IoGetCurrentIrpStackLocation(irp))->\
  126. Parameters.Others.Argument2)++)
  127. #define PENDING_URB_COUNT(irp) \
  128. (((LONG)(ULONG_PTR)(IoGetCurrentIrpStackLocation(irp))->\
  129. Parameters.Others.Argument2))
  130. #define URB_HEADER(u) ((u)->UrbHeader)
  131. #define HCD_AREA(u) ((u)->HcdUrbCommonTransfer.hca)
  132. //
  133. // number of bytes to allocate for a frame list
  134. //
  135. #define FRAME_LIST_LENGTH (FRAME_LIST_SIZE * \
  136. sizeof(HW_DESCRIPTOR_PHYSICAL_ADDRESS))
  137. //
  138. // Stepping Versions of the UHCI host controller
  139. //
  140. #define UHCD_A1_STEP 0
  141. #define UHCD_B0_STEP 1
  142. #define UHCI_HW_VERSION_UNKNOWN 0
  143. #define UHCI_HW_VERSION_PIIX3 1
  144. #define UHCI_HW_VERSION_PIIX4 2
  145. #define UHCI_HW_VERSION_82460GXPIIX6 3 // IA64 PowerOn
  146. //
  147. // values for the HCD_EXTENSION flags field
  148. //
  149. #define UHCD_TRANSFER_ACTIVE 0x01
  150. #define UHCD_TRANSFER_INITIALIZED 0x02
  151. #define UHCD_MAPPED_LOCKED_PAGES 0x04
  152. #define UHCD_TRANSFER_MAPPED 0x08
  153. #define UHCD_TRANSFER_DEFER 0x10
  154. #define UHCD_TOGGLE_READY 0x20
  155. #define LOCK_ENDPOINT_PENDING_LIST(ep, irql, sig) \
  156. KeAcquireSpinLock(&(ep)->PendingListSpin, &(irql)); \
  157. LOGENTRY(LOG_MISC, sig, ep, irql, 0);\
  158. UHCD_LockAccess(&(ep)->AccessPendingList);
  159. #define UNLOCK_ENDPOINT_PENDING_LIST(ep, irql, sig) \
  160. UHCD_UnLockAccess(&(ep)->AccessPendingList); \
  161. LOGENTRY(LOG_MISC, sig, ep, irql, 0);\
  162. KeReleaseSpinLock(&(ep)->PendingListSpin, irql);
  163. #define LOCK_ENDPOINT_ACTIVE_LIST(ep, irql) \
  164. KeAcquireSpinLock(&ep->ActiveListSpin, &irql); \
  165. UHCD_LockAccess(&(ep)->AccessActiveList);
  166. #define UNLOCK_ENDPOINT_ACTIVE_LIST(ep, irql) \
  167. UHCD_UnLockAccess(&(ep)->AccessActiveList); \
  168. KeReleaseSpinLock(&(ep)->ActiveListSpin, irql);
  169. #define LOCK_ENDPOINT_LIST(de, irql) \
  170. KeAcquireSpinLock(&(de)->EndpointListSpin, &irql);
  171. #define UNLOCK_ENDPOINT_LIST(de, irql) \
  172. KeReleaseSpinLock(&(de)->EndpointListSpin, irql);
  173. //
  174. // Maximum Polling Interval we support (ms)
  175. //
  176. //BUGBUG should be 32
  177. #define MAX_INTERVAL 32
  178. //
  179. // Definitions for Common Buffer sizes,
  180. // these are the buffers we use for TDs and
  181. // double buffering packets.
  182. //
  183. //
  184. // Needs to be big enough for all the TDs plus a queue header
  185. // and a scratch buffer
  186. //
  187. #define UHCD_LARGE_COMMON_BUFFER_SIZE \
  188. ((MAX_TDS_PER_ENDPOINT+2) * UHCD_HW_DESCRIPTOR_SIZE)
  189. //#define UHCD_LARGE_COMMON_BUFFER_SIZE 1023
  190. // size of largest packet (iso)
  191. //
  192. // Big enough for 8 TDs plus queue head plus scratch buffer
  193. //
  194. #define UHCD_MEDIUM_COMMON_BUFFER_SIZE \
  195. ((MIN_TDS_PER_ENDPOINT+2) * UHCD_HW_DESCRIPTOR_SIZE)
  196. #define UHCD_SMALL_COMMON_BUFFER_SIZE 128
  197. //
  198. // This is the number of buffers we hold in reserve -- we grow the free pool
  199. // whenever we allocate at passive to maintain the reserve pool. The idea
  200. // here is to minimize the frequency that we have to call
  201. // HalAllocateCommonBuffer from DPC level.
  202. //
  203. // buffers needed during DPC time will be typically packet buffers
  204. // (needed to double buffer packets that cross page boundries)
  205. //
  206. // BUGBUG
  207. // Currently NTKERN will fail any calls to HalAllocateCommonBuffer at DPC
  208. // level so these values are unususally large.
  209. //
  210. #define UHCD_RESERVE_LARGE_BUFFERS 16
  211. #define UHCD_RESERVE_MEDIUM_BUFFERS 32
  212. #define UHCD_RESERVE_SMALL_BUFFERS 32
  213. #define UHCD_MAX_ACTIVE_TRANSFERS 4
  214. //
  215. // The last four bits of a descriptor ptr are defined as control
  216. // flag bits.
  217. //
  218. #define UHCD_CF_TERMINATE_BIT 0
  219. #define UHCD_CF_TERMINATE (1<<UHCD_CF_TERMINATE_BIT)
  220. #define UHCD_CF_QUEUE_BIT 1
  221. #define UHCD_CF_QUEUE (1<<UHCD_CF_QUEUE_BIT)
  222. #define UHCD_CF_VERTICAL_FIRST_BIT 2
  223. #define UHCD_CF_VERTICAL_FIRST (1<<UHCD_CF_VERTICAL_FIRST_BIT)
  224. #define UHCD_CF_RESERVED_BIT 3
  225. #define UHCD_CF_RESERVED (1<<UHCD_CF_RESERVED_BIT)
  226. #define SET_T_BIT(x) (x |= UHCD_CF_TERMINATE)
  227. #define SET_Q_BIT(x) (x |= UHCD_CF_QUEUE)
  228. #define CLEAR_T_BIT(x) (x &= ~UHCD_CF_TERMINATE)
  229. #define UHCD_DESCRIPTOR_PTR_MASK 0xfffffff0
  230. #define UHCD_DESCRIPTOR_FLAGS_MASK 0x0000000f
  231. //
  232. // Macros for manipulating descriptors
  233. //
  234. #define TD_PTR(descriptor) ((PHW_TRANSFER_DESCRIPTOR) descriptor)
  235. #define QH_PTR(descriptor) ((PHW_QUEUE_HEAD) descriptor)
  236. #define LIST_END (UHCD_CF_TERMINATE)
  237. //
  238. // MACROS for USB controller registers
  239. //
  240. #define COMMAND_REG(deviceExtension) \
  241. ((PUSHORT) (deviceExtension->DeviceRegisters[0]))
  242. #define STATUS_REG(deviceExtension) \
  243. ((PUSHORT) (deviceExtension->DeviceRegisters[0] + 0x02))
  244. #define INTERRUPT_MASK_REG(deviceExtension) \
  245. ((PUSHORT) (deviceExtension->DeviceRegisters[0] + 0x04))
  246. #define FRAME_LIST_CURRENT_INDEX_REG(deviceExtension) \
  247. ((PUSHORT) (deviceExtension->DeviceRegisters[0] + 0x06))
  248. #define FRAME_LIST_BASE_REG(deviceExtension) \
  249. ((PULONG) (deviceExtension->DeviceRegisters[0] + 0x08))
  250. #define SOF_MODIFY_REG(deviceExtension) \
  251. ((PUCHAR) (deviceExtension->DeviceRegisters[0] + 0x0C))
  252. #define PORT1_REG(deviceExtension) \
  253. ((PUSHORT) (deviceExtension->DeviceRegisters[0] + 0x10))
  254. #define PORT2_REG(deviceExtension) \
  255. ((PUSHORT) (deviceExtension->DeviceRegisters[0] + 0x12))
  256. //
  257. // Interrupt Mask register bits
  258. //
  259. #define UHCD_INT_MASK_SHORT_BIT 3
  260. #define UHCD_INT_MASK_SHORT (1<<UHCD_INT_MASK_SHORT_BIT)
  261. #define UHCD_INT_MASK_IOC_BIT 2
  262. #define UHCD_INT_MASK_IOC (1<<UHCD_INT_MASK_IOC_BIT)
  263. #define UHCD_INT_MASK_RESUME_BIT 1
  264. #define UHCD_INT_MASK_RESUME (1<<UHCD_INT_MASK_RESUME_BIT)
  265. #define UHCD_INT_MASK_TIMEOUT_BIT 0
  266. #define UHCD_INT_MASK_TIMEOUT (1<<UHCD_INT_MASK_TIMEOUT_BIT)
  267. //
  268. // Port Register Bits
  269. //
  270. // BUGBUG these are for hub port control
  271. #define UHCD_PORT_ENABLE_BIT 2
  272. #define UHCD_PORT_ENABLE (1<<UHCD_PORT_ENABLE_BIT)
  273. //
  274. // Command Register Bits
  275. //
  276. #define UHCD_CMD_RUN_BIT 0
  277. #define UHCD_CMD_RUN (USHORT)(1<<UHCD_CMD_RUN_BIT)
  278. #define UHCD_CMD_RESET_BIT 1
  279. #define UHCD_CMD_RESET (USHORT)(1<<UHCD_CMD_RESET_BIT)
  280. #define UHCD_CMD_GLOBAL_RESET_BIT 2
  281. #define UHCD_CMD_GLOBAL_RESET (USHORT)(1<<UHCD_CMD_GLOBAL_RESET_BIT)
  282. #define UHCD_CMD_SUSPEND_BIT 3
  283. #define UHCD_CMD_SUSPEND (USHORT)(1<<UHCD_CMD_SUSPEND_BIT)
  284. #define UHCD_CMD_FORCE_RESUME_BIT 4
  285. #define UHCD_CMD_FORCE_RESUME (USHORT)(1<<UHCD_CMD_FORCE_RESUME_BIT)
  286. #define UHCD_CMD_SW_DEBUG_BIT 5
  287. #define UHCD_CMD_SW_DEBUG (USHORT)(1<<UHCD_CMD_SW_DEBUG_BIT)
  288. #define UHCD_CMD_SW_CONFIGURED_BIT 6
  289. #define UHCD_CMD_SW_CONFIGURED (USHORT)(1<<UHCD_CMD_SW_CONFIGURED_BIT)
  290. #define UHCD_CMD_MAXPKT_64_BIT 7
  291. #define UHCD_CMD_MAXPKT_64 (USHORT)(1<<UHCD_CMD_MAXPKT_64_BIT)
  292. //
  293. // Status Register Bits
  294. //
  295. #define UHCD_STATUS_USBINT_BIT 0
  296. #define UHCD_STATUS_USBINT (1<<UHCD_STATUS_USBINT_BIT)
  297. #define UHCD_STATUS_USBERR_BIT 1
  298. #define UHCD_STATUS_USBERR (1<<UHCD_STATUS_USBERR_BIT)
  299. #define UHCD_STATUS_RESUME_BIT 2
  300. #define UHCD_STATUS_RESUME (1<<UHCD_STATUS_RESUME_BIT)
  301. #define UHCD_STATUS_PCIERR_BIT 3
  302. #define UHCD_STATUS_PCIERR (1<<UHCD_STATUS_PCIERR_BIT)
  303. #define UHCD_STATUS_HCERR_BIT 4
  304. #define UHCD_STATUS_HCERR (1<<UHCD_STATUS_HCERR_BIT)
  305. #define UHCD_STATUS_HCHALT_BIT 5
  306. #define UHCD_STATUS_HCHALT (1<<UHCD_STATUS_HCHALT_BIT)
  307. //
  308. // opcodes for Create/Allocate/Free Descriptor functions
  309. //
  310. #define QUEUE_HEAD 0
  311. #define TRANSFER_DESCRIPTOR_LIST 1
  312. #define UHCD_INTEL_VENDOR_ID 0x8086
  313. #define UHCD_PIIX3_DEVICE_ID 0x7020
  314. #define UHCD_PIIX4_DEVICE_ID 0x7112
  315. #define UHCD_82460GXPIIX6_DEVICE_ID 0x7602 //IA64 PowerOn
  316. #define MAX_TDS_PER_ENDPOINT 64
  317. #define MIN_TDS_PER_ENDPOINT 8
  318. // computes the size of a common buffer needed for an endpoint
  319. // with n TDs.
  320. // plus one for scratch buffer and one for queue head (+2)
  321. #define TD_LIST_SIZE(n) (((n)+2)*UHCD_HW_DESCRIPTOR_SIZE)
  322. //bugbug change to UHCD to HC
  323. typedef PVOID HW_DESCRIPTOR_PTR;
  324. typedef ULONG HW_DESCRIPTOR_PHYSICAL_ADDRESS;
  325. //
  326. // bit values for StatusField
  327. //
  328. #define TD_STATUS_BITSTUFF_BIT 0
  329. #define TD_STATUS_BITSTUFF (1<<TD_STATUS_BITSTUFF_BIT)
  330. #define TD_STATUS_CRC_TIMEOUT_BIT 1
  331. #define TD_STATUS_CRC_TIMEOUT (1<<TD_STATUS_CRC_TIMEOUT_BIT)
  332. #define TD_STATUS_NAK_BIT 2
  333. #define TD_STATUS_NAK (1<<TD_STATUS_NAK_BIT)
  334. #define TD_STATUS_BABBLE_BIT 3
  335. #define TD_STATUS_BABBLE (1<<TD_STATUS_BABBLE_BIT)
  336. #define TD_STATUS_FIFO_BIT 4
  337. #define TD_STATUS_FIFO (1<<TD_STATUS_FIFO_BIT)
  338. #define TD_STATUS_STALL_BIT 5
  339. #define TD_STATUS_STALL (1<<TD_STATUS_STALL_BIT)
  340. typedef struct _UHCD_BUFFER_POOL {
  341. SINGLE_LIST_ENTRY MemoryDescriptorFreePool;
  342. //
  343. // BUGBUG is it worth padding here to make space
  344. // between the spinlock and the list?
  345. //
  346. ULONG Sig;
  347. ULONG MaximumFreeBuffers;
  348. ULONG CommonBufferLength;
  349. KSPIN_LOCK MemoryDescriptorFreePoolSpin;
  350. } UHCD_BUFFER_POOL, *PUHCD_BUFFER_POOL;
  351. //
  352. // To figure out padding for multiple architectures, we use
  353. // this macro; if we wanted to be fancy we could do bitwise rounding,
  354. // but this is obfuscated enough. Let the compiler do the math for us.
  355. //
  356. #define UHCD_SPAD(T, align) \
  357. ((align) - (sizeof(T) % (align)) + sizeof(T))
  358. //
  359. // Take advantage of the fact that the MS compiler supports
  360. // variant structs and unions so that we can get the proper padding
  361. // for our structures. Put in lots of C_ASSERT()s just to be sure
  362. // nothing goes really really bad.
  363. //
  364. //
  365. // Structure for tracking blocks of memory containing HW
  366. // descriptors or packet buffers
  367. //
  368. struct _UHCD_MEMORY_DESCRIPTOR_INTERNAL {
  369. ULONG Sig;
  370. PUCHAR VirtualAddress; // virtual address for the start of this
  371. // block
  372. HW_DESCRIPTOR_PHYSICAL_ADDRESS LogicalAddress;
  373. // Address we can give the HC.
  374. ULONG Length; // length in bytes
  375. ULONG InUse; // in use count, bummped when we alloc
  376. SINGLE_LIST_ENTRY SingleListEntry;
  377. PUHCD_BUFFER_POOL BufferPool; // buffer pool that owns this MD
  378. ULONG Pad;
  379. };
  380. struct _HW_QUEUE_HEAD_INTERNAL {
  381. HW_DESCRIPTOR_PHYSICAL_ADDRESS HW_HLink;
  382. // used by host controller hardware
  383. HW_DESCRIPTOR_PHYSICAL_ADDRESS HW_VLink;
  384. // used by host controller hardware
  385. //
  386. // These fields are for software use
  387. //
  388. ULONG Sig;
  389. HW_DESCRIPTOR_PHYSICAL_ADDRESS PhysicalAddress;
  390. // Physical address of this QH
  391. struct _HW_QUEUE_HEAD *Next;
  392. struct _HW_QUEUE_HEAD *Prev;
  393. // used for keeping track of where it is in
  394. // the schedule
  395. struct _UHCD_ENDPOINT *Endpoint;
  396. ULONG Flags;
  397. };
  398. //
  399. //
  400. // This structure aligns to 16 bytes
  401. //
  402. struct _HW_TRANSFER_DESCRIPTOR_INTERNAL {
  403. HW_DESCRIPTOR_PHYSICAL_ADDRESS HW_Link;
  404. ULONG ActualLength:11; /* 0 ..10 */
  405. ULONG Reserved_1:6; /* 11..16 */
  406. ULONG StatusField:6; /* 17..22 */
  407. ULONG Active:1; /* 23 */
  408. ULONG InterruptOnComplete:1; /* 24 */
  409. ULONG Isochronous:1; /* 25 */
  410. ULONG LowSpeedControl:1; /* 26 */
  411. ULONG ErrorCounter:2; /* 27..28 */
  412. ULONG ShortPacketDetect:1; /* 29 */
  413. ULONG ReservedMBZ:2; /* 30..31 */
  414. ULONG PID:8; /* 0..7 */
  415. ULONG Address:7; /* 8..14 */
  416. ULONG Endpoint:4; /* 15..18 */
  417. ULONG RetryToggle:1; /* 19 */
  418. ULONG Reserved_2:1; /* 20 */
  419. ULONG MaxLength:11; /* 21..31 */
  420. HW_DESCRIPTOR_PHYSICAL_ADDRESS PacketBuffer;
  421. //
  422. // These fields are for software use
  423. //
  424. ULONG Sig;
  425. HW_DESCRIPTOR_PHYSICAL_ADDRESS PhysicalAddress;
  426. ULONG Frame;
  427. //BUGBUG used to preprocess isoch Urbs
  428. PHCD_URB Urb;
  429. };
  430. typedef struct _HW_TRANSFER_DESCRIPTOR {
  431. union {
  432. //
  433. // For addressing
  434. //
  435. struct _HW_TRANSFER_DESCRIPTOR_INTERNAL;
  436. //
  437. // The compiler will pick the biggest as aligned to a multiple of 16
  438. //
  439. UCHAR _ReservedPad1[UHCD_SPAD(struct _UHCD_MEMORY_DESCRIPTOR_INTERNAL, 16)];
  440. UCHAR _ReservedPad2[UHCD_SPAD(struct _HW_TRANSFER_DESCRIPTOR_INTERNAL, 16)];
  441. UCHAR _ReservedPad3[UHCD_SPAD(struct _HW_QUEUE_HEAD_INTERNAL, 16)];
  442. };
  443. } HW_TRANSFER_DESCRIPTOR, *PHW_TRANSFER_DESCRIPTOR;
  444. //
  445. // Hardware requires that all descriptors have 16 byte HW-specific section and
  446. // have a software-use section so that the descriptor as a whole is 16-byte
  447. // aligned
  448. //
  449. C_ASSERT(((sizeof(HW_TRANSFER_DESCRIPTOR) % 16) == 0));
  450. #define UHCD_HW_DESCRIPTOR_SIZE (sizeof(HW_TRANSFER_DESCRIPTOR))
  451. //
  452. // values for Flags field in queue head
  453. //
  454. #define UHCD_QUEUE_IN_USE 0x00000001
  455. typedef struct _HW_QUEUE_HEAD {
  456. union {
  457. //
  458. // For addressing
  459. //
  460. struct _HW_QUEUE_HEAD_INTERNAL;
  461. //
  462. // The compiler will pick the biggest as aligned to a multiple of 16
  463. //
  464. UCHAR _ReservedPad1[UHCD_SPAD(struct _UHCD_MEMORY_DESCRIPTOR_INTERNAL, 16)];
  465. UCHAR _ReservedPad2[UHCD_SPAD(struct _HW_TRANSFER_DESCRIPTOR_INTERNAL, 16)];
  466. UCHAR _ReservedPad3[UHCD_SPAD(struct _HW_QUEUE_HEAD_INTERNAL, 16)];
  467. };
  468. } HW_QUEUE_HEAD, *PHW_QUEUE_HEAD;
  469. //
  470. // Hardware requires that all descriptors have 16 byte HW-specific section and
  471. // have a software-use section so that the descriptor as a whole is 16-byte
  472. // aligned
  473. //
  474. C_ASSERT(((sizeof(HW_TRANSFER_DESCRIPTOR) % 16) == 0));
  475. C_ASSERT(((sizeof(HW_QUEUE_HEAD) % 16) == 0));
  476. C_ASSERT(sizeof(HW_TRANSFER_DESCRIPTOR) == sizeof(HW_QUEUE_HEAD));
  477. //
  478. // TD list structure
  479. //
  480. typedef struct _UHCD_TD_LIST {
  481. HW_TRANSFER_DESCRIPTOR TDs[1];
  482. } UHCD_TD_LIST, *PUHCD_TD_LIST;
  483. typedef struct _UHCD_MEMORY_DESCRIPTOR {
  484. union {
  485. //
  486. // For addressing
  487. //
  488. struct _UHCD_MEMORY_DESCRIPTOR_INTERNAL;
  489. //
  490. // The compiler will pick the biggest as aligned to a multiple of 16
  491. //
  492. UCHAR _ReservedPad1[UHCD_SPAD(struct _UHCD_MEMORY_DESCRIPTOR_INTERNAL, 16)];
  493. UCHAR _ReservedPad2[UHCD_SPAD(struct _HW_TRANSFER_DESCRIPTOR_INTERNAL, 16)];
  494. UCHAR _ReservedPad3[UHCD_SPAD(struct _HW_QUEUE_HEAD_INTERNAL, 16)];
  495. };
  496. } UHCD_MEMORY_DESCRIPTOR, *PUHCD_MEMORY_DESCRIPTOR;
  497. C_ASSERT(sizeof(UHCD_MEMORY_DESCRIPTOR) == sizeof(HW_TRANSFER_DESCRIPTOR));
  498. //
  499. // A descriptor list contains a Queue head descriptor
  500. // plus one or more transfer descriptors
  501. //
  502. typedef struct _UHCD_HARDWARE_DESCRIPTOR_LIST {
  503. // includes queue head
  504. ULONG NumberOfHWDescriptors;
  505. // memory descriptor points to common buffer
  506. // containing descriptors
  507. PUHCD_MEMORY_DESCRIPTOR MemoryDescriptor;
  508. // 32 byte scratch buffer, we use this for the setup
  509. // packet
  510. HW_DESCRIPTOR_PHYSICAL_ADDRESS ScratchBufferLogicalAddress;
  511. PVOID ScratchBufferVirtualAddress;
  512. } UHCD_HRADWARE_DESCRIPTOR_LIST, *PUHCD_HARDWARE_DESCRIPTOR_LIST;
  513. //
  514. // UHCD Endpoint Structure
  515. //
  516. // We create one of these for every endpoint we open.
  517. //
  518. //
  519. // values for EndpointFlags field
  520. //
  521. // set to if the root hub code owns this ep
  522. #define EPFLAG_ROOT_HUB 0x00000001
  523. // set when client issues an abort endpoint
  524. // request -- causes all queued transfers for
  525. // the endpoint to be completed.
  526. #define EPFLAG_ABORT_PENDING_TRANSFERS 0x00000002
  527. // causes all currently active transfers for an
  528. // endpoint to be aborted.
  529. #define EPFLAG_ABORT_ACTIVE_TRANSFERS 0x00000004
  530. // endpoint is in the halted (AKA stalled) state
  531. #define EPFLAG_HOST_HALTED 0x00000008
  532. // endpoint belongs to a lowspeed device
  533. #define EPFLAG_LOWSPEED 0x00000010
  534. // endpoint has had no transfers submitted,
  535. // restored on reset
  536. #define EPFLAG_VIRGIN 0x00000020
  537. // endpoint will not enter the 'halted' state
  538. #define EPFLAG_NO_HALT 0x00000040
  539. // need attention
  540. #define EPFLAG_HAVE_WORK 0x00000080
  541. // idle state
  542. #define EPFLAG_IDLE 0x00000100
  543. // ed is in th eschedule
  544. #define EPFLAG_ED_IN_SCHEDULE 0x00000200
  545. // ed is closed
  546. #define EPFLAG_EP_CLOSED 0x00000400
  547. // inicates we need to double buffer
  548. // transfers for this endpoint
  549. #define EPFLAG_DBL_BUFFER 0x00000800
  550. #define EPFLAG_NODMA_ON 0x00001000
  551. // indicates we need to use the 'fast iso path'
  552. // for transfers to the EP
  553. #define EPFLAG_FAST_ISO 0x00002000
  554. // indicates we have initialized the ED
  555. #define EPFLAG_INIT 0x00004000
  556. typedef struct _FAST_ISO_DATA {
  557. PDEVICE_OBJECT DeviceObject;
  558. PULONG FastIsoFrameList;
  559. PUCHAR IsoTDListVa;
  560. HW_DESCRIPTOR_PHYSICAL_ADDRESS IsoTDListPhys;
  561. PUCHAR DataBufferStartVa;
  562. HW_DESCRIPTOR_PHYSICAL_ADDRESS DataBufferStartPhys;
  563. } FAST_ISO_DATA, *PFAST_ISO_DATA;
  564. #define SET_EPFLAG(ep, flag) ((ep)->EndpointFlags |= (flag))
  565. #define CLR_EPFLAG(ep, flag) ((ep)->EndpointFlags &= ~(flag))
  566. typedef struct _UHCD_ENDPOINT {
  567. ULONG Sig; // signature field
  568. UCHAR Type; // type of endpoint we are dealing with
  569. UCHAR EndpointAddress;
  570. USHORT MaxPacketSize;
  571. UCHAR Interval;
  572. UCHAR DeviceAddress;
  573. USHORT TDCount; // number of TDS in TDList
  574. PUHCD_TD_LIST TDList;
  575. PUHCD_TD_LIST SlotTDList[UHCD_MAX_ACTIVE_TRANSFERS];
  576. PUHCD_HARDWARE_DESCRIPTOR_LIST HardwareDescriptorList[UHCD_MAX_ACTIVE_TRANSFERS];
  577. // Pointer to queue head associated with this endpoint
  578. PHW_QUEUE_HEAD QueueHead;
  579. // Urbs currently being processed
  580. PHCD_URB ActiveTransfers[UHCD_MAX_ACTIVE_TRANSFERS];
  581. // List Urbs waiting to be processed
  582. LIST_ENTRY PendingTransferList;
  583. // Field for linking endpoints
  584. LIST_ENTRY ListEntry;
  585. // BUGBUG move some of this to
  586. // the urb work space
  587. SHORT LastTDPreparedIdx[UHCD_MAX_ACTIVE_TRANSFERS];
  588. SHORT CurrentTDIdx[UHCD_MAX_ACTIVE_TRANSFERS];
  589. SHORT LastTDInTransferIdx[UHCD_MAX_ACTIVE_TRANSFERS];
  590. UCHAR MaxRequests;
  591. UCHAR DataToggle;
  592. ULONG MaxTransferSize;
  593. ULONG CurrentFrame;
  594. PUCHAR NoDMABuffer;
  595. ULONG NoDMABufferLength;
  596. HW_DESCRIPTOR_PHYSICAL_ADDRESS NoDMAPhysicalAddress;
  597. #if DBG
  598. ULONG AccessPendingList; // access flag, incremented when we HOLD
  599. // the endpoint
  600. // decremented when we RELEASE the endpoint
  601. ULONG AccessActiveList;
  602. #endif
  603. ULONG FrameToClose; // Frame number when the close request was
  604. // processed
  605. ULONG EndpointFlags;
  606. KSPIN_LOCK ActiveListSpin;
  607. KSPIN_LOCK PendingListSpin;
  608. USHORT TdsScheduled[UHCD_MAX_ACTIVE_TRANSFERS];
  609. USHORT Offset;
  610. LONG IdleTime;
  611. LARGE_INTEGER LastIdleTime;
  612. FAST_ISO_DATA FastIsoData;
  613. UCHAR LastPacketDataToggle;
  614. UCHAR CurrentXferId;
  615. UCHAR NextXferId;
  616. UCHAR Pad[1];
  617. } UHCD_ENDPOINT, *PUHCD_ENDPOINT;
  618. struct _UHCD_PAGE_LIST_ENTRY_INTERNAL {
  619. LIST_ENTRY ListEntry;
  620. PHYSICAL_ADDRESS LogicalAddress;
  621. ULONG Length;
  622. ULONG Flags;
  623. };
  624. //
  625. // Take advantage of the fact that the MS compiler supports
  626. // variant structs and unions so that we can get the proper padding
  627. // for our structures. Put in lots of C_ASSERT()s just to be sure
  628. // nothing goes really really bad
  629. //
  630. //
  631. // Thist structure must be a multiple of 32 bytes
  632. // to maintain proper alignemnt of the HW descriptors
  633. // it is the first entry in the blocks of memory we allocate
  634. // Host controller HW descriptors from
  635. //
  636. typedef struct _UHCD_PAGE_LIST_ENTRY {
  637. union {
  638. struct _UHCD_PAGE_LIST_ENTRY_INTERNAL;
  639. UCHAR _ReservedPad[UHCD_SPAD(struct _UHCD_PAGE_LIST_ENTRY_INTERNAL, 32)];
  640. };
  641. } UHCD_PAGE_LIST_ENTRY, *PUHCD_PAGE_LIST_ENTRY;
  642. C_ASSERT(((sizeof(UHCD_PAGE_LIST_ENTRY) % 32) == 0));
  643. //
  644. //typedef struct _UHCD_WORKER_CONTEXT {
  645. // WORK_QUEUE_ITEM WorkQueueItem;
  646. // PIRP Irp;
  647. // PDEVICE_OBJECT DeviceObject;
  648. //} UHCD_WORKER_CONTEXT, *PUHCD_WORKER_CONTEXT;
  649. //
  650. // A structure representing the instance information associated with
  651. // a particular device
  652. //
  653. typedef struct _DEVICE_EXTENSION {
  654. UCHAR UsbdWorkArea[sizeof(USBD_EXTENSION)];
  655. //
  656. // Device object that the bus extender created for me.
  657. //
  658. PDEVICE_OBJECT PhysicalDeviceObject;
  659. //
  660. // Device object of the first guy on the stack
  661. // -- the guy we pass our Irps on to.
  662. //
  663. PDEVICE_OBJECT TopOfStackDeviceObject;
  664. //
  665. // Pointer to interrupt object.
  666. //
  667. PKINTERRUPT InterruptObject;
  668. //
  669. // Pointer to the virtual base address for the USB frame list
  670. //
  671. PVOID FrameListVirtualAddress;
  672. //
  673. // Logical address of frame list returned from
  674. // HalAllocateCommonBuffer
  675. //
  676. PHYSICAL_ADDRESS FrameListLogicalAddress;
  677. //
  678. // BUGBUG keep a copy to remove isoch descriptors
  679. // Pointer to the virtual base address for the USB frame list
  680. //
  681. PVOID FrameListCopyVirtualAddress;
  682. //
  683. // DPC Object for processing frames with completed transfers
  684. //
  685. KDPC IsrDpc;
  686. //
  687. // Base queue head that we link all control/bulk transfer
  688. // queues to.
  689. //
  690. PHW_QUEUE_HEAD PersistantQueueHead;
  691. //
  692. // Descriptor List for the PersistantQueueHead
  693. //
  694. PUHCD_HARDWARE_DESCRIPTOR_LIST PQH_DescriptorList;
  695. //
  696. // Queue of active endpoints
  697. //
  698. // BUGBUG we'll probably have a separate queue for each
  699. // transfer type eventually
  700. LIST_ENTRY EndpointList;
  701. LIST_ENTRY EndpointLookAsideList;
  702. // lists for fast iso
  703. LIST_ENTRY FastIsoEndpointList;
  704. LIST_ENTRY FastIsoTransferList;
  705. //
  706. // List of closed endpoints who's resources need to be
  707. // released.
  708. //
  709. LIST_ENTRY ClosedEndpointList;
  710. // Virtual Addresses for the interrupt queue heads in the
  711. // schedule.
  712. PHW_QUEUE_HEAD InterruptSchedule[MAX_INTERVAL];
  713. // list of common buffer pages allocated
  714. LIST_ENTRY PageList;
  715. //
  716. // Table where we keep track of the available bw on the usb
  717. // for iso and interrupt, entries are in bits/ms
  718. //
  719. ULONG BwTable[MAX_INTERVAL];
  720. //
  721. // 12 bit counter, contains the frame value from the previous
  722. // interrupt
  723. //
  724. ULONG LastFrame;
  725. //
  726. // High part of USB frame counter
  727. //
  728. ULONG FrameHighPart;
  729. LARGE_INTEGER LastIdleTime;
  730. LARGE_INTEGER LastXferIdleTime;
  731. LONG IdleTime;
  732. LONG XferIdleTime;
  733. //
  734. // TDs we are using as interrupt triggers
  735. //
  736. PUHCD_TD_LIST TriggerTDList;
  737. UHCD_BUFFER_POOL LargeBufferPool;
  738. UHCD_BUFFER_POOL MediumBufferPool;
  739. UHCD_BUFFER_POOL SmallBufferPool;
  740. //
  741. // ROOT HUB VARIABLES
  742. //
  743. //
  744. // device address assigned to root hub
  745. //
  746. ULONG RootHubDeviceAddress;
  747. //
  748. // context pointer passed to root hub
  749. //
  750. PROOTHUB RootHub;
  751. //
  752. // counter for the number of root hub timers
  753. // that are currently scheduled
  754. //
  755. ULONG RootHubTimersActive;
  756. //
  757. // Timer and Dpc for polling the root hub interrupt
  758. // endpoint
  759. //
  760. KDPC RootHubPollDpc;
  761. KTIMER RootHubPollTimer;
  762. //
  763. // non-zero if timer was initialized
  764. //
  765. ULONG RootHubPollTimerInitialized;
  766. KSPIN_LOCK EndpointListSpin;
  767. PUHCD_ENDPOINT RootHubInterruptEndpoint;
  768. // BUGBUG
  769. // isoch stuff
  770. ULONG LastFrameProcessed;
  771. //
  772. // DMA adapter object representing this instance
  773. // of the UHCI controller.
  774. //
  775. PDMA_ADAPTER AdapterObject;
  776. ULONG NumberOfMapRegisters;
  777. PHW_TRANSFER_DESCRIPTOR FrameBabbleRecoverTD;
  778. ULONG DeviceNameHandle;
  779. //
  780. // save registers for BIOS
  781. //
  782. USHORT BiosCmd;
  783. USHORT BiosIntMask;
  784. ULONG BiosFrameListBase;
  785. USHORT LegacySupportRegister;
  786. USHORT Pad;
  787. PUCHAR DeviceRegisters[1];
  788. //
  789. // saved state information for no power resume
  790. //
  791. USHORT SavedInterruptEnable;
  792. USHORT SavedCommandReg;
  793. DEVICE_POWER_STATE CurrentDevicePowerState;
  794. ULONG HcFlags;
  795. USHORT SavedFRNUM;
  796. USHORT SavedUnused;
  797. ULONG SavedFRBASEADD;
  798. ULONG Port;
  799. LONG HcDma;
  800. ULONG RegRecClocksPerFrame;
  801. PVOID Piix4EP;
  802. KSPIN_LOCK HcFlagSpin;
  803. KSPIN_LOCK HcDmaSpin;
  804. KSPIN_LOCK HcScheduleSpin;
  805. //
  806. // Busy flag set when the ISRDPC routine is
  807. // processing the endpoint list
  808. //
  809. BOOLEAN EndpointListBusy;
  810. //
  811. // Stepping Version of the Host Controller
  812. //
  813. UCHAR SteppingVersion;
  814. CHAR SavedSofModify;
  815. UCHAR ControllerType;
  816. //
  817. // statistic counters, used for debugging and interfacing with
  818. // sysmon.
  819. //
  820. HCD_STAT_COUNTERS Stats;
  821. HCD_ISO_STAT_COUNTERS IsoStats;
  822. ULONG LastFrameInterrupt;
  823. #if DBG
  824. // ptr to list of dwords containing the number of iso bytes
  825. // scheduled for a particular frame
  826. PULONG IsoList;
  827. #endif
  828. //
  829. // Status we returned last time we were asked to power up the
  830. // controller. We check this to see if we can touch the
  831. // hardware when the hub is powered up.
  832. //
  833. NTSTATUS LastPowerUpStatus;
  834. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  835. //
  836. // values for HcFlags
  837. //
  838. // Set to indicate port resources were assigned
  839. #define HCFLAG_GOT_IO 0x00000001
  840. // Set at initialization to indicate that the base register
  841. // address must be unmapped when the driver is unloaded.
  842. #define HCFLAG_UNMAP_REGISTERS 0x00000002
  843. // Set if we have a USB BIOS on this system
  844. #define HCFLAG_USBBIOS 0x00000004
  845. // Current state of BW reclimation
  846. #define HCFLAG_BWRECLIMATION_ENABLED 0x00000008
  847. // This flag indicates if the driver needs to cleanup resources
  848. // allocated in start_device.
  849. #define HCFLAG_NEED_CLEANUP 0x00000010
  850. // HC is idle
  851. #define HCFLAG_IDLE 0x00000020
  852. // set when the rollover int is disabled
  853. #define HCFLAG_ROLLOVER_IDLE 0x00000040
  854. // set when the controller is stopped
  855. #define HCFLAG_HCD_STOPPED 0x00000080
  856. // turn off idle check
  857. #define HCFLAG_DISABLE_IDLE 0x00000100
  858. // work item queued
  859. #define HCFLAG_WORK_ITEM_QUEUED 0x00000200
  860. // hcd has shut down
  861. #define HCFLAG_HCD_SHUTDOWN 0x00000400
  862. // indicates we need to restore HC from hibernate
  863. #define HCFLAG_LOST_POWER 0x00000800
  864. // set when root hub turns off the HC
  865. #define HCFLAG_RH_OFF 0x00001000
  866. #define HCFLAG_MAP_SX_TO_D3 0x00002000
  867. // set if we will be suspending in this D3
  868. #define HCFLAG_SUSPEND_NEXT_D3 0x00004000
  869. typedef struct _UHCD_RESOURCES {
  870. ULONG InterruptVector;
  871. KIRQL InterruptLevel;
  872. KAFFINITY Affinity;
  873. BOOLEAN ShareIRQ;
  874. KINTERRUPT_MODE InterruptMode;
  875. } UHCD_RESOURCES, *PUHCD_RESOURCES;
  876. // Macros used by the transfer modules
  877. #define NEXT_TD(idx, ep) ((idx+1) % ep->TDCount)
  878. #define DATA_DIRECTION_IN(u) \
  879. ((BOOLEAN)((u)->HcdUrbCommonTransfer.TransferFlags & \
  880. USBD_TRANSFER_DIRECTION_IN))
  881. #define DATA_DIRECTION_OUT(u) \
  882. ((BOOLEAN)!((u)->HcdUrbCommonTransfer.TransferFlags & \
  883. USBD_TRANSFER_DIRECTION_IN))
  884. typedef struct _UHCD_LOGICAL_ADDRESS {
  885. HW_DESCRIPTOR_PHYSICAL_ADDRESS LogicalAddress;
  886. ULONG Length;
  887. // if this block caintained a USB packet that crossed a
  888. // page boundry and needed to be double
  889. // buffered then this is the offset of that packet.
  890. ULONG PacketOffset;
  891. PUHCD_MEMORY_DESCRIPTOR PacketMemoryDescriptor; // block of memory
  892. // used to double buffer
  893. // packet
  894. } UHCD_LOGICAL_ADDRESS, *PUHCD_LOGICAL_ADDRESS;
  895. //
  896. // Private definition for urb work area
  897. // used by HCD for each transfer URB.
  898. //
  899. typedef struct _HCD_EXTENSION {
  900. ULONG CurrentPacketIdx;
  901. ULONG BytesTransferred;
  902. ULONG TransferOffset;
  903. ULONG Status;
  904. ULONG PacketsProcessed;
  905. UCHAR Slot;
  906. UCHAR Flags;
  907. UCHAR ErrorCount;
  908. UCHAR XferId;
  909. UCHAR DataToggle;
  910. UCHAR Reserved[3];
  911. //
  912. // list of logical addresses we can give
  913. // to the HC
  914. //
  915. PVOID SystemAddressForMdl;
  916. ULONG NumberOfMapRegisters;
  917. PVOID MapRegisterBase;
  918. ULONG NumberOfLogicalAddresses;
  919. UHCD_LOGICAL_ADDRESS LogicalAddressList[1];
  920. } HCD_EXTENSION, *PHCD_EXTENSION;
  921. typedef struct _UHCD_WORKITEM {
  922. WORK_QUEUE_ITEM WorkQueueItem;
  923. PDEVICE_OBJECT DeviceObject;
  924. } UHCD_WORKITEM, *PUHCD_WORKITEM;
  925. //
  926. // some USB constants
  927. //
  928. #define USB_IN_PID 0x69
  929. #define USB_OUT_PID 0xe1
  930. #define USB_SETUP_PID 0x2d
  931. #define NULL_PACKET_LENGTH 0x7ff
  932. #define UHCD_USB_TO_SYSTEM_BUFFER_LENGTH(len) \
  933. ((len+1) & NULL_PACKET_LENGTH)
  934. #define UHCD_SYSTEM_TO_USB_BUFFER_LENGTH(len) \
  935. ((len-1) & NULL_PACKET_LENGTH)
  936. //
  937. // Function Prototypes
  938. //
  939. NTSTATUS
  940. UHCD_PnPAddDevice(
  941. IN PDRIVER_OBJECT DriverObject,
  942. IN PDEVICE_OBJECT PhysicalDeviceObject
  943. );
  944. NTSTATUS
  945. UHCD_Dispatch(
  946. IN PDEVICE_OBJECT DeviceObject,
  947. IN PIRP Irp
  948. );
  949. VOID
  950. UHCD_Unload(
  951. IN PDRIVER_OBJECT DriverObject
  952. );
  953. NTSTATUS
  954. UHCD_CreateDeviceObject(
  955. IN PDRIVER_OBJECT DriverObject,
  956. IN OUT PDEVICE_OBJECT *DeviceObject,
  957. IN PUNICODE_STRING DeviceNameUnicodeString
  958. );
  959. NTSTATUS
  960. UHCD_StartDevice(
  961. IN PDEVICE_OBJECT DeviceObject,
  962. IN PUHCD_RESOURCES Resources
  963. );
  964. NTSTATUS
  965. UHCD_GetResources(
  966. IN PDEVICE_OBJECT DeviceObject,
  967. IN PCM_RESOURCE_LIST ResourceList,
  968. IN OUT PUHCD_RESOURCES Resources
  969. );
  970. VOID
  971. UHCD_CompleteIrp(
  972. IN PDEVICE_OBJECT DeviceObject,
  973. IN PIRP Irp,
  974. IN NTSTATUS ntStatus,
  975. IN ULONG Information,
  976. IN PHCD_URB Urb
  977. );
  978. VOID
  979. UHCD_StartIo(
  980. IN PDEVICE_OBJECT DeviceObject,
  981. IN PIRP Irp
  982. );
  983. NTSTATUS
  984. UHCD_URB_Dispatch(
  985. IN PDEVICE_OBJECT DeviceObject,
  986. IN PIRP Irp
  987. );
  988. VOID
  989. UHCD_OpenEndpoint_StartIo(
  990. IN PDEVICE_OBJECT DeviceObject,
  991. IN PIRP Irp
  992. );
  993. VOID
  994. UHCD_Transfer_StartIo(
  995. IN PDEVICE_OBJECT DeviceObject,
  996. IN PIRP Irp
  997. );
  998. BOOLEAN
  999. UHCD_InterruptService(
  1000. IN PKINTERRUPT Interrupt,
  1001. IN PVOID Context
  1002. );
  1003. VOID
  1004. UHCD_IsrDpc(
  1005. IN PKDPC Dpc,
  1006. IN PVOID DeferredContext,
  1007. IN PVOID SystemArgument1,
  1008. IN PVOID SystemArgument2
  1009. );
  1010. VOID
  1011. UHCD_OpenEndpoint_StartIo(
  1012. IN PDEVICE_OBJECT DeviceObject,
  1013. IN PIRP Irp
  1014. );
  1015. VOID
  1016. UHCD_CloseEndpoint_StartIo(
  1017. IN PDEVICE_OBJECT DeviceObject,
  1018. IN PIRP Irp
  1019. );
  1020. VOID
  1021. UHCD_GetDoneTransfer(
  1022. IN PVOID Context
  1023. );
  1024. NTSTATUS
  1025. UHCD_GetResourceList(
  1026. IN PDRIVER_OBJECT DriverOject,
  1027. IN PDEVICE_OBJECT DeviceObject,
  1028. IN PCM_RESOURCE_LIST *ResourceList,
  1029. IN PUNICODE_STRING RegistryPath
  1030. );
  1031. NTSTATUS
  1032. UHCD_MakeInterrupt(
  1033. IN PDEVICE_OBJECT DeviceObject
  1034. );
  1035. NTSTATUS
  1036. UHCD_StopDevice(
  1037. IN PDEVICE_OBJECT DeviceObject
  1038. );
  1039. NTSTATUS
  1040. UHCD_InitializeSchedule(
  1041. IN PDEVICE_OBJECT DeviceObject
  1042. );
  1043. NTSTATUS
  1044. UHCD_StartGlobalReset(
  1045. IN PDEVICE_OBJECT DeviceObject
  1046. );
  1047. NTSTATUS
  1048. UHCD_CompleteGlobalReset(
  1049. IN PDEVICE_OBJECT DeviceObject
  1050. );
  1051. VOID
  1052. UHCD_InsertQueueHeadInSchedule(
  1053. IN PDEVICE_OBJECT DeviceObject,
  1054. IN PUHCD_ENDPOINT Endpoint,
  1055. IN PHW_QUEUE_HEAD QueueHead,
  1056. IN ULONG Offset
  1057. );
  1058. VOID
  1059. UHCD_InitializeTransferDescriptor(
  1060. IN PDEVICE_OBJECT DeviceObject,
  1061. IN PHW_TRANSFER_DESCRIPTOR Transfer
  1062. );
  1063. VOID
  1064. UHCD_InitializeQueueHead(
  1065. IN PDEVICE_OBJECT DeviceObject,
  1066. IN PHW_QUEUE_HEAD QueueHead
  1067. );
  1068. BOOLEAN
  1069. UHCD_AllocateHardwareDescriptors(
  1070. IN PDEVICE_OBJECT DeviceObject,
  1071. IN PUHCD_HARDWARE_DESCRIPTOR_LIST *HardwareDescriptorList,
  1072. IN ULONG NumberOfTransferDescriptors
  1073. );
  1074. VOID
  1075. UHCD_FreeHardwareDescriptors(
  1076. IN PDEVICE_OBJECT DeviceObject,
  1077. IN PUHCD_HARDWARE_DESCRIPTOR_LIST HardwareDescriptorList
  1078. );
  1079. VOID
  1080. UHCD_CompleteTransferDPC(
  1081. IN PDEVICE_OBJECT DeviceObject,
  1082. IN PUHCD_ENDPOINT Endpoint,
  1083. IN LONG Slot
  1084. );
  1085. BOOLEAN
  1086. UHCD_RemoveQueueHeadFromSchedule(
  1087. IN PDEVICE_OBJECT DeviceObject,
  1088. IN PUHCD_ENDPOINT Endpoint,
  1089. IN PHW_QUEUE_HEAD QueueHead,
  1090. IN BOOLEAN RemoveFromEPList
  1091. );
  1092. ULONG
  1093. UHCD_GetCurrentFrame(
  1094. IN PDEVICE_OBJECT DeviceObject
  1095. );
  1096. VOID
  1097. UHCD_CopyInterruptScheduleToFrameList(
  1098. IN PDEVICE_OBJECT DeviceObject
  1099. );
  1100. __inline VOID
  1101. UHCD_InitializeAsyncTD(
  1102. IN PUHCD_ENDPOINT Endpoint,
  1103. IN PHW_TRANSFER_DESCRIPTOR TransferDescriptor
  1104. );
  1105. VOID
  1106. UHCD_GlobalResetDpc(
  1107. IN PKDPC Dpc,
  1108. IN PVOID DeferredContext,
  1109. IN PVOID SystemArgument1,
  1110. IN PVOID SystemArgument2
  1111. );
  1112. VOID
  1113. UHCD_PrepareStatusPacket(
  1114. IN PHW_TRANSFER_DESCRIPTOR TransferDescriptor,
  1115. IN PUHCD_ENDPOINT Endpoint,
  1116. IN PHCD_URB Urb
  1117. );
  1118. VOID
  1119. UHCD_PrepareSetupPacket(
  1120. IN PHW_TRANSFER_DESCRIPTOR TransferDescriptor,
  1121. IN PUHCD_ENDPOINT Endpoint,
  1122. IN PHCD_URB Urb
  1123. );
  1124. USBD_STATUS
  1125. UHCD_PrepareMoreAsyncTDs(
  1126. IN PDEVICE_OBJECT DeviceObject,
  1127. IN PUHCD_ENDPOINT Endpoint,
  1128. IN PHCD_URB Urb,
  1129. IN BOOLEAN Busy
  1130. );
  1131. NTSTATUS
  1132. UHCD_RootHub_OpenEndpoint(
  1133. IN PDEVICE_OBJECT DeviceObject,
  1134. IN PIRP Irp,
  1135. IN PHCD_URB Urb
  1136. );
  1137. NTSTATUS
  1138. UHCD_RootHub_CloseEndpoint(
  1139. IN PDEVICE_OBJECT DeviceObject,
  1140. IN PIRP Irp,
  1141. IN PHCD_URB Urb
  1142. );
  1143. NTSTATUS
  1144. UHCD_RootHub_ControlTransfer(
  1145. IN PDEVICE_OBJECT DeviceObject,
  1146. IN PIRP Irp,
  1147. IN PHCD_URB Urb
  1148. );
  1149. NTSTATUS
  1150. UHCD_RootHub_InterruptTransfer(
  1151. IN PDEVICE_OBJECT DeviceObject,
  1152. IN PIRP Irp,
  1153. IN PHCD_URB Urb
  1154. );
  1155. VOID
  1156. UHCD_RootHubPoll(
  1157. IN PDEVICE_OBJECT DeviceObject,
  1158. IN PUHCD_ENDPOINT Endpoint
  1159. );
  1160. VOID
  1161. UHCD_ScheduleIsochTransfer(
  1162. IN PDEVICE_OBJECT DeviceObject,
  1163. IN PUHCD_ENDPOINT Endpoint,
  1164. IN PHCD_URB Urb
  1165. );
  1166. VOID
  1167. UHCD_RootHubTimerDpc(
  1168. IN PKDPC Dpc,
  1169. IN PVOID DeferredContext,
  1170. IN PVOID SystemArgument1,
  1171. IN PVOID SystemArgument2
  1172. );
  1173. NTSTATUS
  1174. UHCD_PnPIrp_Complete(
  1175. IN PDEVICE_OBJECT DeviceObject,
  1176. IN PIRP Irp,
  1177. IN PVOID Context
  1178. );
  1179. NTSTATUS
  1180. UHCD_PowerIrp_Complete(
  1181. IN PDEVICE_OBJECT DeviceObject,
  1182. IN PIRP Irp,
  1183. IN PVOID Context
  1184. );
  1185. VOID
  1186. UHCD_RootHub_InterruptTransferCancel(
  1187. IN PDEVICE_OBJECT DeviceObject,
  1188. IN PIRP Irp
  1189. );
  1190. IO_ALLOCATION_ACTION
  1191. UHCD_StartDmaTransfer(
  1192. IN PDEVICE_OBJECT DeviceObject,
  1193. IN PIRP Irp,
  1194. IN PVOID MapRegisterBase,
  1195. IN PVOID Context
  1196. );
  1197. VOID
  1198. UHCD_InitializeDmaTransfer(
  1199. IN PDEVICE_OBJECT DeviceObject,
  1200. IN PHCD_URB Urb,
  1201. IN PUHCD_ENDPOINT Endpoint,
  1202. IN LONG Slot,
  1203. IN UCHAR XferId
  1204. );
  1205. PUHCD_MEMORY_DESCRIPTOR
  1206. UHCD_AllocateCommonBuffer(
  1207. IN PDEVICE_OBJECT DeviceObject,
  1208. IN ULONG NumberOfBytes
  1209. );
  1210. VOID
  1211. UHCD_FreeCommonBuffer(
  1212. IN PDEVICE_OBJECT DeviceObject,
  1213. IN PUHCD_MEMORY_DESCRIPTOR MemoryDescriptor
  1214. );
  1215. VOID
  1216. UHCD_InitializeCommonBufferPool(
  1217. IN PDEVICE_OBJECT DeviceObject,
  1218. IN OUT PUHCD_BUFFER_POOL BufferPool,
  1219. IN ULONG CommonBufferLength,
  1220. IN ULONG MaximumFreeBuffers
  1221. );
  1222. HW_DESCRIPTOR_PHYSICAL_ADDRESS
  1223. UHCD_GetPacketBuffer(
  1224. IN PDEVICE_OBJECT DeviceObject,
  1225. IN PUHCD_ENDPOINT Endpoint,
  1226. IN PHCD_URB Urb,
  1227. IN PHCD_EXTENSION urbWork,
  1228. IN ULONG Offset,
  1229. IN ULONG PacketSize
  1230. );
  1231. VOID
  1232. UHCD_RequestInterrupt(
  1233. IN PDEVICE_OBJECT DeviceObject,
  1234. IN LONG FrameNumber
  1235. );
  1236. VOID
  1237. UHCD_TransferCancel(
  1238. IN PDEVICE_OBJECT DeviceObject,
  1239. IN PIRP Irp
  1240. );
  1241. VOID
  1242. UHCD_BeginTransfer(
  1243. IN PDEVICE_OBJECT DeviceObject,
  1244. IN PUHCD_ENDPOINT Endpoint,
  1245. IN PHCD_URB Urb,
  1246. IN ULONG Slot
  1247. );
  1248. PHCD_URB
  1249. UHCD_RemoveQueuedUrbs(
  1250. IN PDEVICE_OBJECT DeviceObject,
  1251. IN PHCD_URB Urb,
  1252. IN PIRP Irp
  1253. );
  1254. #if DBG
  1255. VOID
  1256. UHCD_LockAccess(
  1257. IN PULONG c
  1258. );
  1259. VOID
  1260. UHCD_UnLockAccess(
  1261. IN PULONG c
  1262. );
  1263. #else
  1264. #define UHCD_UnLockAccess(c)
  1265. #define UHCD_LockAccess(c)
  1266. #endif
  1267. VOID
  1268. UHCD_StartIoCancel(
  1269. IN PDEVICE_OBJECT DeviceObject,
  1270. IN PIRP Irp
  1271. );
  1272. VOID
  1273. UHCD_EndpointWorker(
  1274. IN PDEVICE_OBJECT DeviceObject,
  1275. IN PUHCD_ENDPOINT Endpoint
  1276. );
  1277. VOID
  1278. UHCD_InsertIsochDescriptor(
  1279. IN PDEVICE_OBJECT DeviceObject,
  1280. IN PHW_TRANSFER_DESCRIPTOR TransferDescriptor,
  1281. IN ULONG FrameNumber
  1282. );
  1283. VOID
  1284. UHCD_GetSetEndpointState_StartIo(
  1285. IN PDEVICE_OBJECT DeviceObject,
  1286. IN PIRP Irp
  1287. );
  1288. #define UHCD_AllocateBandwidth(DeviceObject, Endpoint, Offset) \
  1289. UHCD_ManageBandwidth((DeviceObject), \
  1290. (Endpoint), \
  1291. (Offset),\
  1292. TRUE)
  1293. #define UHCD_FreeBandwidth(DeviceObject, Endpoint, Offset) \
  1294. UHCD_ManageBandwidth((DeviceObject), \
  1295. (Endpoint), \
  1296. (Offset),\
  1297. FALSE)
  1298. BOOLEAN
  1299. UHCD_ManageBandwidth(
  1300. IN PDEVICE_OBJECT DeviceObject,
  1301. IN PUHCD_ENDPOINT Endpoint,
  1302. IN ULONG Offset,
  1303. IN BOOLEAN AllocateFlag
  1304. );
  1305. NTSTATUS
  1306. UHCD_GetDeviceName(
  1307. IN PDEVICE_OBJECT DeviceObject,
  1308. IN OUT PUNICODE_STRING DeviceNameUnicodeString,
  1309. IN BOOLEAN DeviceLink
  1310. );
  1311. USBD_STATUS
  1312. UHCD_MapTDError(
  1313. PDEVICE_EXTENSION DeviceExtension,
  1314. ULONG Td_Status,
  1315. ULONG ActualLength
  1316. );
  1317. VOID
  1318. UHCD_RootHubPollDpc(
  1319. IN PKDPC Dpc,
  1320. IN PVOID DeferredContext,
  1321. IN PVOID SystemArgument1,
  1322. IN PVOID SystemArgument2
  1323. );
  1324. NTSTATUS
  1325. UHCD_Suspend(
  1326. IN PDEVICE_OBJECT DeviceObject,
  1327. IN BOOLEAN SuspendBus
  1328. );
  1329. NTSTATUS
  1330. UHCD_Resume(
  1331. IN PDEVICE_OBJECT DeviceObject,
  1332. IN BOOLEAN DoResumeSignaling
  1333. );
  1334. NTSTATUS
  1335. UHCD_SaveHCstate(
  1336. IN PDEVICE_OBJECT DeviceObject
  1337. );
  1338. NTSTATUS
  1339. UHCD_RestoreHCstate(
  1340. IN PDEVICE_OBJECT DeviceObject
  1341. );
  1342. NTSTATUS
  1343. UHCD_FinishInitializeEndpoint(
  1344. IN PDEVICE_OBJECT DeviceObject,
  1345. IN PUHCD_ENDPOINT Endpoint,
  1346. IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor,
  1347. IN PHCD_URB Urb
  1348. );
  1349. VOID
  1350. UHCD_CleanupDevice(
  1351. IN PDEVICE_OBJECT DeviceObject
  1352. );
  1353. VOID
  1354. UHCD_BufferPoolCheck(
  1355. IN PDEVICE_OBJECT DeviceObject
  1356. );
  1357. ULONG
  1358. UHCD_GrowBufferPool(
  1359. IN PDEVICE_OBJECT DeviceObject,
  1360. IN PUHCD_BUFFER_POOL BufferPool,
  1361. IN ULONG Length,
  1362. IN PUCHAR VirtualAddress,
  1363. IN PUCHAR EndVirtualAddress,
  1364. IN HW_DESCRIPTOR_PHYSICAL_ADDRESS HwLogicalAddress
  1365. );
  1366. VOID
  1367. UHCD_InitBandwidthTable(
  1368. IN PDEVICE_OBJECT DeviceObject
  1369. );
  1370. NTSTATUS
  1371. UHCD_StopBIOS(
  1372. IN PDEVICE_OBJECT DeviceObject
  1373. );
  1374. USHORT
  1375. UHCD_GetNumTDsPerEndoint(
  1376. IN UCHAR EndpointType
  1377. );
  1378. VOID
  1379. UHCD_BW_Reclimation(
  1380. IN PDEVICE_OBJECT DeviceObject,
  1381. IN BOOLEAN Enable
  1382. );
  1383. NTSTATUS
  1384. UHCD_SetDevicePowerState(
  1385. IN PDEVICE_OBJECT DeviceObject,
  1386. IN PIRP Irp,
  1387. IN DEVICE_POWER_STATE DeviceState
  1388. );
  1389. VOID
  1390. UHCD_ReadWriteConfig(
  1391. IN PDEVICE_OBJECT DeviceObject,
  1392. IN BOOLEAN Read,
  1393. IN PVOID Buffer,
  1394. IN ULONG Offset,
  1395. IN ULONG Length
  1396. );
  1397. NTSTATUS
  1398. UHCD_QueryCapabilities(
  1399. IN PDEVICE_OBJECT PdoDeviceObject,
  1400. IN PDEVICE_CAPABILITIES DeviceCapabilities
  1401. );
  1402. ULONG
  1403. UHCD_FreePoolSize(
  1404. IN PUHCD_BUFFER_POOL BufferPool,
  1405. IN OUT PULONG ByteCount
  1406. );
  1407. NTSTATUS
  1408. UHCD_GetClassGlobalRegistryParameters(
  1409. IN OUT PULONG ForceLowPowerState
  1410. );
  1411. NTSTATUS
  1412. DriverEntry(
  1413. IN PDRIVER_OBJECT DriverObject,
  1414. IN PUNICODE_STRING RegistryPath
  1415. );
  1416. NTSTATUS
  1417. UHCD_DeferPoRequestCompletion(
  1418. IN PDEVICE_OBJECT DeviceObject,
  1419. IN UCHAR MinorFunction,
  1420. IN POWER_STATE DeviceState,
  1421. IN PVOID Context,
  1422. IN PIO_STATUS_BLOCK IoStatus
  1423. );
  1424. NTSTATUS
  1425. UHCD_DeferIrpCompletion(
  1426. IN PDEVICE_OBJECT DeviceObject,
  1427. IN PIRP Irp,
  1428. IN PVOID Context
  1429. );
  1430. NTSTATUS
  1431. UHCD_FixPIIX4(
  1432. IN PDEVICE_OBJECT DeviceObject
  1433. );
  1434. VOID
  1435. UHCD_InitializeHardwareQueueHeadDescriptor(
  1436. IN PDEVICE_OBJECT DeviceObject,
  1437. IN PHW_QUEUE_HEAD QueueHead,
  1438. IN HW_DESCRIPTOR_PHYSICAL_ADDRESS LogicalAddress
  1439. );
  1440. VOID
  1441. UHCD_MoreCommonBuffers(
  1442. IN PDEVICE_OBJECT DeviceObject
  1443. );
  1444. VOID
  1445. UHCD_AllocateCommonBufferBlock(
  1446. IN PDEVICE_OBJECT DeviceObject,
  1447. IN ULONG CommonBufferLength,
  1448. IN ULONG NumberOfPages
  1449. );
  1450. ULONG
  1451. UHCD_CheckCommonBufferPool(
  1452. IN PDEVICE_OBJECT DeviceObject,
  1453. IN PUHCD_BUFFER_POOL BufferPool,
  1454. IN BOOLEAN Allocate
  1455. );
  1456. NTSTATUS
  1457. UHCD_StartBIOS(
  1458. IN PDEVICE_OBJECT DeviceObject
  1459. );
  1460. NTSTATUS
  1461. UHCD_RootHubPower(
  1462. IN PDEVICE_OBJECT DeviceObject,
  1463. IN PIRP Irp
  1464. );
  1465. NTSTATUS
  1466. UHCD_ProcessPowerIrp(
  1467. IN PDEVICE_OBJECT DeviceObject,
  1468. IN PIRP Irp
  1469. );
  1470. NTSTATUS
  1471. UHCD_ProcessPowerPnP(
  1472. IN PDEVICE_OBJECT DeviceObject,
  1473. IN PIRP Irp
  1474. );
  1475. NTSTATUS
  1476. UHCD_DeferredStartDevice(
  1477. IN PDEVICE_OBJECT DeviceObject,
  1478. IN PIRP Irp
  1479. );
  1480. VOID
  1481. UHCD_CheckIdle(
  1482. IN PDEVICE_OBJECT DeviceObject
  1483. );
  1484. VOID
  1485. UHCD_DisableIdleCheck(
  1486. IN PDEVICE_EXTENSION DeviceExtension
  1487. );
  1488. VOID
  1489. UHCD_WakeIdle(
  1490. IN PDEVICE_OBJECT DeviceObject
  1491. );
  1492. VOID
  1493. UHCD_GrowPoolWorker(
  1494. IN PVOID Context
  1495. );
  1496. NTSTATUS
  1497. UHCD_GetSOFRegModifyValue(
  1498. IN PDEVICE_OBJECT DeviceObject,
  1499. IN OUT PULONG SofModifyValue
  1500. );
  1501. NTSTATUS
  1502. UHCD_GetGlobalRegistryParameters(
  1503. IN OUT PULONG DisableController
  1504. );
  1505. NTSTATUS
  1506. UHCD_ExternalGetCurrentFrame(
  1507. IN PDEVICE_OBJECT DeviceObject,
  1508. IN PULONG CurrentFrame
  1509. );
  1510. UCHAR
  1511. MAX_REQUESTS(
  1512. IN PUSB_ENDPOINT_DESCRIPTOR EndpointDescriptor,
  1513. IN ULONG EpFlags
  1514. );
  1515. VOID
  1516. UHCD_FixupDataToggle(
  1517. IN PDEVICE_OBJECT DeviceObject,
  1518. IN PUHCD_ENDPOINT Endpoint,
  1519. IN PHCD_URB Urb
  1520. );
  1521. VOID
  1522. UHCD_SetControllerD0(
  1523. IN PDEVICE_OBJECT DeviceObject
  1524. );
  1525. VOID
  1526. UHCD_EndpointWakeup(
  1527. IN PDEVICE_OBJECT DeviceObject,
  1528. IN PUHCD_ENDPOINT Endpoint
  1529. );
  1530. VOID
  1531. UHCD_EndpointIdle(
  1532. IN PDEVICE_OBJECT DeviceObject,
  1533. IN PUHCD_ENDPOINT Endpoint
  1534. );
  1535. ULONG
  1536. UHCD_ExternalGetConsumedBW(
  1537. IN PDEVICE_OBJECT DeviceObject
  1538. );
  1539. VOID
  1540. UHCD_EndpointDMAWorker(
  1541. IN PDEVICE_OBJECT DeviceObject,
  1542. IN PUHCD_ENDPOINT Endpoint
  1543. );
  1544. VOID
  1545. UHCD_EndpointNoDMAWorker(
  1546. IN PDEVICE_OBJECT DeviceObject,
  1547. IN PUHCD_ENDPOINT Endpoint
  1548. );
  1549. NTSTATUS
  1550. UHCD_InitializeNoDMAEndpoint(
  1551. IN PDEVICE_OBJECT DeviceObject,
  1552. IN PUHCD_ENDPOINT Endpoint
  1553. );
  1554. VOID
  1555. UHCD_Free_NoDMA_Buffer(
  1556. IN PDEVICE_OBJECT DeviceObject,
  1557. IN PUCHAR NoDMABuffer
  1558. );
  1559. PUCHAR
  1560. UHCD_Alloc_NoDMA_Buffer(
  1561. IN PDEVICE_OBJECT DeviceObject,
  1562. IN PUHCD_ENDPOINT Endpoint,
  1563. IN ULONG Length
  1564. );
  1565. NTSTATUS
  1566. UHCD_UnInitializeNoDMAEndpoint(
  1567. IN PDEVICE_OBJECT DeviceObject,
  1568. IN PUHCD_ENDPOINT Endpoint
  1569. );
  1570. VOID
  1571. UHCD_StopNoDMATransfer(
  1572. IN PDEVICE_OBJECT DeviceObject,
  1573. IN PUHCD_ENDPOINT Endpoint
  1574. );
  1575. NTSTATUS
  1576. UHCD_InitializeFastIsoEndpoint(
  1577. IN PDEVICE_OBJECT DeviceObject,
  1578. IN PUHCD_ENDPOINT Endpoint
  1579. );
  1580. NTSTATUS
  1581. UHCD_UnInitializeFastIsoEndpoint(
  1582. IN PDEVICE_OBJECT DeviceObject,
  1583. IN PUHCD_ENDPOINT Endpoint
  1584. );
  1585. NTSTATUS
  1586. UHCD_ProcessFastIsoTransfer(
  1587. IN PDEVICE_OBJECT DeviceObject,
  1588. IN PUHCD_ENDPOINT Endpoint,
  1589. IN PIRP Irp,
  1590. IN PHCD_URB Urb
  1591. );
  1592. PUHCD_ENDPOINT
  1593. UHCD_GetLastFastIsoEndpoint(
  1594. IN PDEVICE_OBJECT DeviceObject
  1595. );
  1596. NTSTATUS
  1597. UHCD_GetClassGlobalDebugRegistryParameters(
  1598. );
  1599. PHW_TRANSFER_DESCRIPTOR
  1600. UHCD_CleanupFastIsoTD(
  1601. IN PDEVICE_OBJECT DeviceObject,
  1602. IN PUHCD_ENDPOINT Endpoint,
  1603. IN ULONG RelativeFrame,
  1604. IN BOOLEAN Count
  1605. );
  1606. VOID
  1607. UhcdKickStartController(IN PDEVICE_OBJECT PDevObj);
  1608. NTSTATUS
  1609. UHCD_SubmitFastIsoUrb(
  1610. IN PDEVICE_OBJECT DeviceObject,
  1611. IN PURB Urb
  1612. );
  1613. VOID
  1614. UHCD_ValidateIsoUrb(
  1615. IN PDEVICE_OBJECT DeviceObject,
  1616. IN PUHCD_ENDPOINT Endpoint,
  1617. IN OUT PHCD_URB Urb
  1618. );
  1619. #endif /* __UHCD_H__ */