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.

1842 lines
35 KiB

  1. /*++
  2. Copyright (c) 1999, 2000 Microsoft Corporation
  3. Module Name:
  4. prototyp.h
  5. Abstract:
  6. put all the prototypes in one header
  7. Environment:
  8. Kernel & user mode
  9. Revision History:
  10. 2-25-00 : created
  11. --*/
  12. #ifndef __PROTOTYP_H__
  13. #define __PROTOTYP_H__
  14. #define FRAME_COUNT_WAIT 5
  15. PUSBPORT_MINIPORT_DRIVER
  16. USBPORT_FindMiniport(
  17. PDRIVER_OBJECT DriverObject
  18. );
  19. VOID
  20. USBPORT_Unload(
  21. PDRIVER_OBJECT DriverObject
  22. );
  23. NTSTATUS
  24. USBPORT_CreateDeviceObject(
  25. PDRIVER_OBJECT DriverObject,
  26. PUSBPORT_MINIPORT_DRIVER MiniportDriver,
  27. OUT PDEVICE_OBJECT *DeviceObject,
  28. PUNICODE_STRING DeviceNameUnicodeString
  29. );
  30. NTSTATUS
  31. USBPORT_PnPAddDevice(
  32. PDRIVER_OBJECT DriverObject,
  33. PDEVICE_OBJECT PhysicalDeviceObject
  34. );
  35. NTSTATUS
  36. USBPORT_Dispatch(
  37. PDEVICE_OBJECT DeviceObject,
  38. PIRP Irp
  39. );
  40. NTSTATUS
  41. USBPORT_PdoPnPIrp(
  42. PDEVICE_OBJECT PdoDeviceObject,
  43. PIRP Irp
  44. );
  45. NTSTATUS
  46. USBPORT_FdoPnPIrp(
  47. PDEVICE_OBJECT FdoDeviceObject,
  48. PIRP Irp
  49. );
  50. VOID
  51. USBPORT_CompleteIrp(
  52. PDEVICE_OBJECT DeviceObject,
  53. PIRP Irp,
  54. NTSTATUS ntStatus,
  55. ULONG_PTR Information
  56. );
  57. NTSTATUS
  58. USBPORT_DeferredStartDevice(
  59. PDEVICE_OBJECT FdoDeviceObject,
  60. PIRP Irp
  61. );
  62. NTSTATUS
  63. USBPORT_StopDevice(
  64. PDEVICE_OBJECT FdoDeviceObject,
  65. BOOLEAN HardwarePresent
  66. );
  67. NTSTATUS
  68. USBPORT_StartDevice(
  69. PDEVICE_OBJECT FdoDeviceObject,
  70. PHC_RESOURCES HcResources
  71. );
  72. BOOLEAN
  73. USBPORT_ValidateDeviceHandle(
  74. PDEVICE_OBJECT FdoDeviceObject,
  75. PUSBD_DEVICE_HANDLE DeviceHandle,
  76. BOOLEAN ReferenceUrb
  77. );
  78. BOOLEAN
  79. USBPORT_ValidatePipeHandle(
  80. PUSBD_DEVICE_HANDLE DeviceHandle,
  81. PUSBD_PIPE_HANDLE_I PipeHandle
  82. );
  83. NTSTATUS
  84. USBPORT_SetUSBDError(
  85. PURB Urb,
  86. USBD_STATUS UsbdStatus
  87. );
  88. NTSTATUS
  89. USBPORT_PassIrp(
  90. PDEVICE_OBJECT DeviceObject,
  91. PIO_COMPLETION_ROUTINE CompletionRoutine,
  92. PVOID Context,
  93. BOOLEAN InvokeOnSuccess,
  94. BOOLEAN InvokeOnError,
  95. BOOLEAN InvokeOnCancel,
  96. PIRP Irp
  97. );
  98. NTSTATUS
  99. USBPORT_SymbolicLink(
  100. BOOLEAN CreateFlag,
  101. PDEVICE_EXTENSION DevExt,
  102. PDEVICE_OBJECT PhysicalDeviceObject,
  103. LPGUID Guid
  104. );
  105. NTSTATUS
  106. USBPORT_SetRegistryKeyValueForPdo(
  107. PDEVICE_OBJECT PhysicalDeviceObject,
  108. BOOLEAN SoftwareBranch,
  109. ULONG Type,
  110. PWCHAR KeyNameString,
  111. ULONG KeyNameStringLength,
  112. PVOID Data,
  113. ULONG DataLength
  114. );
  115. NTSTATUS
  116. USBPORT_GetRegistryKeyValueForPdo(
  117. PDEVICE_OBJECT FdoDeviceObject,
  118. PDEVICE_OBJECT PhysicalDeviceObject,
  119. BOOLEAN SoftwareBranch,
  120. PWCHAR KeyNameString,
  121. ULONG KeyNameStringLength,
  122. PVOID Data,
  123. ULONG DataLength
  124. );
  125. VOID
  126. USBPORT_CancelSplitTransfer(
  127. PDEVICE_OBJECT FdoDeviceObject,
  128. PHCD_TRANSFER_CONTEXT SplitTransfer
  129. );
  130. NTSTATUS
  131. USBPORT_CreateRootHubPdo(
  132. PDEVICE_OBJECT FdoDeviceObject,
  133. PDEVICE_OBJECT *RootHubPdo
  134. );
  135. NTSTATUS
  136. USBPORT_BusQueryBusTime(
  137. PVOID BusContext,
  138. PULONG CurrentFrame
  139. );
  140. NTSTATUS
  141. USBPORT_BusSubmitIsoOutUrb(
  142. PVOID BusContext,
  143. PURB Urb
  144. );
  145. VOID
  146. USBPORT_BusGetUSBDIVersion(
  147. PVOID BusContext,
  148. PUSBD_VERSION_INFORMATION VersionInformation,
  149. PULONG HcdCapabilities
  150. );
  151. NTSTATUS
  152. USBPORT_MakeRootHubPdoName(
  153. PDEVICE_OBJECT FdoDeviceObject,
  154. PUNICODE_STRING PdoNameUnicodeString,
  155. ULONG Index
  156. );
  157. NTSTATUS
  158. USBPORT_MakeHcdDeviceName(
  159. PUNICODE_STRING DeviceNameUnicodeString,
  160. ULONG Idx
  161. );
  162. PWCHAR
  163. USBPORT_GetIdString(
  164. PDEVICE_OBJECT FdoDeviceObject,
  165. USHORT Vid,
  166. USHORT Pid,
  167. USHORT Rev
  168. );
  169. USBD_STATUS
  170. USBPORT_AllocTransfer(
  171. PDEVICE_OBJECT FdoDeviceObject,
  172. PTRANSFER_URB Urb,
  173. PUSBD_DEVICE_HANDLE DeviceHandle,
  174. PIRP Irp,
  175. PKEVENT CompleteEvent,
  176. ULONG MillisecTimeout
  177. );
  178. VOID
  179. USBPORT_QueueTransferUrb(
  180. PTRANSFER_URB Urb
  181. );
  182. VOID
  183. USBPORT_FreeUsbAddress(
  184. PDEVICE_OBJECT FdoDeviceObject,
  185. USHORT DeviceAddress
  186. );
  187. USHORT
  188. USBPORT_AllocateUsbAddress(
  189. PDEVICE_OBJECT FdoDeviceObject
  190. );
  191. NTSTATUS
  192. USBPORT_SendCommand(
  193. PUSBD_DEVICE_HANDLE DeviceHandle,
  194. PDEVICE_OBJECT FdoDeviceObject,
  195. PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
  196. PVOID Buffer,
  197. ULONG BufferLength,
  198. PULONG BytesReturned,
  199. USBD_STATUS *UsbdStatus
  200. );
  201. USBD_STATUS
  202. USBPORT_MiniportStatus_TO_USBDStatus(
  203. USB_MINIPORT_STATUS mpStatus
  204. );
  205. #define MPSTATUS_TO_USBSTATUS(s) USBPORT_MiniportStatus_TO_USBDStatus((s))
  206. NTSTATUS
  207. USBPORT_MiniportStatus_TO_NtStatus(
  208. USB_MINIPORT_STATUS mpStatus
  209. );
  210. #define MPSTATUS_TO_NTSTATUS(s) USBPORT_MiniportStatus_TO_NtStatus((s))
  211. RHSTATUS
  212. USBPORT_MiniportStatus_TO_RHStatus(
  213. USB_MINIPORT_STATUS mpStatus
  214. );
  215. #define MPSTATUS_TO_RHSTATUS(s) USBPORT_MiniportStatus_TO_RHStatus((s))
  216. USBD_STATUS
  217. USBPORT_RHStatus_TO_USBDStatus(
  218. USB_MINIPORT_STATUS rhStatus
  219. );
  220. #define RHSTATUS_TO_USBDSTATUS(s) USBPORT_RHStatus_TO_USBDStatus((s))
  221. NTSTATUS
  222. USBPORT_FdoDeviceControlIrp(
  223. PDEVICE_OBJECT FdoDeviceObject,
  224. PIRP Irp
  225. );
  226. NTSTATUS
  227. USBPORT_PdoDeviceControlIrp(
  228. PDEVICE_OBJECT PdoDeviceObject,
  229. PIRP Irp
  230. );
  231. NTSTATUS
  232. USBPORT_FdoInternalDeviceControlIrp(
  233. PDEVICE_OBJECT FdoDeviceObject,
  234. PIRP Irp
  235. );
  236. NTSTATUS
  237. USBPORT_PdoInternalDeviceControlIrp(
  238. PDEVICE_OBJECT PdoDeviceObject,
  239. PIRP Irp
  240. );
  241. #ifdef DRM_SUPPORT
  242. NTSTATUS
  243. USBPORT_PdoSetContentId(
  244. IN PIRP irp,
  245. IN PKSP_DRMAUDIOSTREAM_CONTENTID pKsProperty,
  246. IN PKSDRMAUDIOSTREAM_CONTENTID pvData
  247. );
  248. #endif
  249. NTSTATUS
  250. USBPORT_ProcessURB(
  251. PDEVICE_OBJECT PdoDeviceObject,
  252. PDEVICE_OBJECT FdoDeviceObject,
  253. PIRP Irp,
  254. PURB Urb
  255. );
  256. VOID
  257. USBPORT_TrackPendingRequest(
  258. PDEVICE_OBJECT FdoDeviceObject,
  259. PIRP Irp,
  260. BOOLEAN AddToList
  261. );
  262. NTSTATUS
  263. USBPORT_GetConfigValue(
  264. PWSTR ValueName,
  265. ULONG ValueType,
  266. PVOID ValueData,
  267. ULONG ValueLength,
  268. PVOID Context,
  269. PVOID EntryContext
  270. );
  271. VOID
  272. USBPORT_CancelTransfer(
  273. PDEVICE_OBJECT DeviceObject,
  274. PIRP Irp
  275. );
  276. VOID
  277. USBPORT_CompleteTransfer(
  278. PTRANSFER_URB Urb,
  279. USBD_STATUS CompleteCode
  280. );
  281. BOOLEAN
  282. USBPORT_InterruptService(
  283. PKINTERRUPT Interrupt,
  284. PVOID Context
  285. );
  286. VOID
  287. USBPORT_HalFreeCommonBuffer(
  288. PDEVICE_OBJECT FdoDeviceObject,
  289. PUSBPORT_COMMON_BUFFER CommonBuffer
  290. );
  291. PUSBPORT_COMMON_BUFFER
  292. USBPORT_HalAllocateCommonBuffer(
  293. PDEVICE_OBJECT FdoDeviceObject,
  294. ULONG NumberOfBytes
  295. );
  296. USB_MINIPORT_STATUS
  297. USBPORTSVC_GetMiniportRegistryKeyValue(
  298. PDEVICE_DATA DeviceData,
  299. BOOLEAN SoftwareBranch,
  300. PWCHAR KeyNameString,
  301. ULONG KeyNameStringLength,
  302. PVOID Data,
  303. ULONG DataLength
  304. );
  305. USB_MINIPORT_STATUS
  306. USBPORTSVC_ReadWriteConfigSpace(
  307. PDEVICE_DATA DeviceData,
  308. BOOLEAN Read,
  309. PVOID Buffer,
  310. ULONG Offset,
  311. ULONG Length
  312. );
  313. NTSTATUS
  314. USBPORT_InternalOpenInterface(
  315. PURB Urb,
  316. PUSBD_DEVICE_HANDLE DeviceHandle,
  317. PDEVICE_OBJECT FdoDeviceObject,
  318. PUSBD_CONFIG_HANDLE ConfigHandle,
  319. PUSBD_INTERFACE_INFORMATION InterfaceInformation,
  320. OUT PUSBD_INTERFACE_HANDLE_I *InterfaceHandle,
  321. BOOLEAN SendSetInterfaceCommand
  322. );
  323. PUSBD_CONFIG_HANDLE
  324. USBPORT_InitializeConfigurationHandle(
  325. PUSBD_DEVICE_HANDLE DeviceHandle,
  326. PDEVICE_OBJECT FdoDeviceObject,
  327. PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
  328. );
  329. NTSTATUS
  330. USBPORT_SelectConfiguration(
  331. PDEVICE_OBJECT FdoDeviceObject,
  332. PIRP Irp,
  333. PURB Urb
  334. );
  335. VOID
  336. USBPORT_InternalCloseConfiguration(
  337. PUSBD_DEVICE_HANDLE DeviceHandle,
  338. PDEVICE_OBJECT FdoDeviceObject,
  339. ULONG Flags
  340. );
  341. PUSB_INTERFACE_DESCRIPTOR
  342. USBPORT_InternalParseConfigurationDescriptor(
  343. PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  344. UCHAR InterfaceNumber,
  345. UCHAR AlternateSetting,
  346. PBOOLEAN HasAlternateSettings
  347. );
  348. NTSTATUS
  349. USBPORT_OpenEndpoint(
  350. PUSBD_DEVICE_HANDLE DeviceHandle,
  351. PDEVICE_OBJECT FdoDeviceObject,
  352. PUSBD_PIPE_HANDLE_I PipeHandle,
  353. USBD_STATUS *UsbdStatus,
  354. BOOLEAN IsDefaultPipe
  355. );
  356. VOID
  357. USBPORT_CloseEndpoint(
  358. PUSBD_DEVICE_HANDLE DeviceHandle,
  359. PDEVICE_OBJECT DeviceObject,
  360. PHCD_ENDPOINT Endpoint
  361. );
  362. ULONG
  363. USBPORT_InternalGetInterfaceLength(
  364. PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
  365. PUCHAR End
  366. );
  367. VOID
  368. USBPORT_RootHub_EndpointWorker(
  369. PHCD_ENDPOINT Endpoint
  370. );
  371. NTSTATUS
  372. USBPORT_RootHub_CreateDevice(
  373. PDEVICE_OBJECT FdoDeviceObject,
  374. PDEVICE_OBJECT PdoDeviceObject
  375. );
  376. VOID
  377. USBPORT_RootHub_RemoveDevice(
  378. PDEVICE_OBJECT FdoDeviceObject,
  379. PDEVICE_OBJECT PdoDeviceObject
  380. );
  381. RHSTATUS
  382. USBPORT_RootHub_Endpoint0(
  383. PHCD_TRANSFER_CONTEXT Transfer
  384. );
  385. RHSTATUS
  386. USBPORT_RootHub_Endpoint1(
  387. PHCD_TRANSFER_CONTEXT Transfer
  388. );
  389. VOID
  390. USBPORT_PollEndpoint(
  391. PHCD_ENDPOINT Endpoint
  392. );
  393. RHSTATUS
  394. USBPORT_RootHub_ClassCommand(
  395. PDEVICE_OBJECT FdoDeviceObject,
  396. PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
  397. PUCHAR Buffer,
  398. PULONG BufferLength
  399. );
  400. RHSTATUS
  401. USBPORT_RootHub_StandardCommand(
  402. PDEVICE_OBJECT FdoDeviceObject,
  403. PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
  404. PUCHAR Buffer,
  405. PULONG BufferLength
  406. );
  407. NTSTATUS
  408. USBPORT_QueryCapabilities(
  409. PDEVICE_OBJECT FdoDeviceObject,
  410. PDEVICE_CAPABILITIES DeviceCapabilities
  411. );
  412. VOID
  413. USBPORT_AddDeviceHandle(
  414. PDEVICE_OBJECT FdoDeviceObject,
  415. PUSBD_DEVICE_HANDLE DeviceHandle
  416. );
  417. VOID
  418. USBPORT_AddPipeHandle(
  419. PUSBD_DEVICE_HANDLE DeviceHandle,
  420. PUSBD_PIPE_HANDLE_I PipeHandle
  421. );
  422. VOID
  423. USBPORT_FlushCancelList(
  424. PHCD_ENDPOINT Endpoint
  425. );
  426. VOID
  427. USBPORT_SetEndpointState(
  428. PHCD_ENDPOINT Endpoint,
  429. MP_ENDPOINT_STATE State
  430. );
  431. MP_ENDPOINT_STATE
  432. USBPORT_GetEndpointState(
  433. PHCD_ENDPOINT Endpoint
  434. );
  435. VOID
  436. USBPORT_IsrDpc(
  437. PKDPC Dpc,
  438. PVOID DeferredContext,
  439. PVOID SystemArgument1,
  440. PVOID SystemArgument2
  441. );
  442. VOID
  443. USBPORT_DoneTransfer(
  444. PHCD_TRANSFER_CONTEXT Transfer
  445. );
  446. VOID
  447. USBPORTSVC_CompleteIsoTransfer(
  448. PDEVICE_DATA DeviceData,
  449. PDEVICE_DATA EndpointData,
  450. PTRANSFER_PARAMETERS TransferParameters,
  451. PMINIPORT_ISO_TRANSFER IsoTransfer
  452. );
  453. VOID
  454. USBPORTSVC_RequestAsyncCallback(
  455. PDEVICE_DATA DeviceData,
  456. ULONG MilliSeconds,
  457. PVOID Context,
  458. ULONG ContextLength,
  459. PMINIPORT_CALLBACK CallbackFunction
  460. );
  461. VOID
  462. USBPORT_QueueDoneTransfer(
  463. PHCD_TRANSFER_CONTEXT Transfer,
  464. USBD_STATUS CompleteCode
  465. );
  466. VOID
  467. USBPORT_FlushDoneTransferList(
  468. PDEVICE_OBJECT FdoDeviceObject
  469. );
  470. BOOLEAN
  471. USBPORT_CoreEndpointWorker(
  472. PHCD_ENDPOINT Endpoint,
  473. ULONG Flags
  474. );
  475. NTSTATUS
  476. USBPORT_GetBusInterface(
  477. PDEVICE_OBJECT FdoDeviceObject,
  478. PDEVICE_OBJECT PdoDeviceObject,
  479. PIRP Irp
  480. );
  481. NTSTATUS
  482. USBPORT_GetBusInterfaceHub(
  483. PDEVICE_OBJECT FdoDeviceObject,
  484. PDEVICE_OBJECT PdoDeviceObject,
  485. PIRP Irp
  486. );
  487. VOID
  488. USBPORT_FlushAllEndpoints(
  489. PDEVICE_OBJECT FdoDeviceObject
  490. );
  491. VOID
  492. USBPORT_UserGetDriverVersion(
  493. PDEVICE_OBJECT FdoDeviceObject,
  494. PUSBUSER_REQUEST_HEADER Header,
  495. PUSB_DRIVER_VERSION_PARAMETERS Parameters
  496. );
  497. NTSTATUS
  498. USBPORTBUSIF_CreateUsbDevice(
  499. PVOID BusContext,
  500. PUSB_DEVICE_HANDLE *NewDeviceHandle,
  501. PUSB_DEVICE_HANDLE HubDeviceHandle,
  502. USHORT PortStatus,
  503. USHORT PortNumber
  504. );
  505. NTSTATUS
  506. USBPORTBUSIF_RemoveUsbDevice(
  507. PVOID BusContext,
  508. PUSB_DEVICE_HANDLE DeviceHandle,
  509. ULONG Flags
  510. );
  511. NTSTATUS
  512. USBPORT_InitializeDevice(
  513. PUSBD_DEVICE_HANDLE DeviceHandle,
  514. PDEVICE_OBJECT FdoDeviceObject
  515. );
  516. VOID
  517. USBPORT_BusInterfaceReference(
  518. PVOID BusContext
  519. );
  520. VOID
  521. USBPORT_BusInterfaceDereference(
  522. PVOID BusContext
  523. );
  524. NTSTATUS
  525. USBPORT_CreateDevice(
  526. PUSBD_DEVICE_HANDLE *DeviceHandle,
  527. PDEVICE_OBJECT FdoDeviceObject,
  528. PUSBD_DEVICE_HANDLE HubDeviceHandle,
  529. USHORT PortStatus,
  530. USHORT PortNumber
  531. );
  532. NTSTATUS
  533. USBPORT_DeferIrpCompletion(
  534. PDEVICE_OBJECT DeviceObject,
  535. PIRP Irp,
  536. PVOID Context
  537. );
  538. VOID
  539. USBPORTSVC_InvalidateRootHub(
  540. PDEVICE_DATA DeviceData
  541. );
  542. RHSTATUS
  543. USBPORT_RootHub_PortRequest(
  544. PDEVICE_OBJECT FdoDeviceObject,
  545. PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket,
  546. PORT_OPERATION PortOperation
  547. );
  548. VOID
  549. USBPORT_ComputeRootHubDeviceCaps(
  550. PDEVICE_OBJECT FdoDeviceObject,
  551. PDEVICE_OBJECT PdoDeviceObject
  552. );
  553. VOID
  554. USBPORT_FlushMapTransferList(
  555. PDEVICE_OBJECT FdoDeviceObject
  556. );
  557. NTSTATUS
  558. USBPORT_FdoPowerIrp(
  559. PDEVICE_OBJECT FdoDeviceObject,
  560. PIRP Irp
  561. );
  562. NTSTATUS
  563. USBPORT_PdoPowerIrp(
  564. PDEVICE_OBJECT FdoDeviceObject,
  565. PIRP Irp
  566. );
  567. VOID
  568. USBPORT_DmaEndpointWorker(
  569. PHCD_ENDPOINT Endpoint
  570. );
  571. NTSTATUS
  572. USBPORT_CreateLegacyFdoSymbolicLink(
  573. PDEVICE_OBJECT FdoDeviceObject
  574. );
  575. VOID
  576. USBPORT_DpcWorker(
  577. PDEVICE_OBJECT FdoDeviceObject
  578. );
  579. VOID
  580. USBPORT_TransferFlushDpc(
  581. PKDPC Dpc,
  582. PVOID DeferredContext,
  583. PVOID SystemArgument1,
  584. PVOID SystemArgument2
  585. );
  586. VOID
  587. USBPORT_InvalidateController(
  588. PDEVICE_OBJECT FdoDeviceObject,
  589. USB_CONTROLLER_STATE ControllerState
  590. );
  591. VOID
  592. USBPORT_FlushPendingList(
  593. PHCD_ENDPOINT Endpoint,
  594. ULONG Count
  595. );
  596. ULONG
  597. USBPORT_CalculateUsbBandwidth(
  598. PDEVICE_OBJECT FdoDeviceObject,
  599. PHCD_ENDPOINT Endpoint
  600. );
  601. VOID
  602. USBPORT_SurpriseRemoveDpc(
  603. PKDPC Dpc,
  604. PVOID DeferredContext,
  605. PVOID SystemArgument1,
  606. PVOID SystemArgument2
  607. );
  608. VOID
  609. USBPORT_HcResetDpc(
  610. PKDPC Dpc,
  611. PVOID DeferredContext,
  612. PVOID SystemArgument1,
  613. PVOID SystemArgument2
  614. );
  615. VOID
  616. USBPORTSVC_CompleteTransfer(
  617. PDEVICE_DATA DeviceData,
  618. PDEVICE_DATA EndpointData,
  619. PTRANSFER_PARAMETERS TransferParameters,
  620. USBD_STATUS UsbdStatus,
  621. ULONG BytesTransferred
  622. );
  623. VOID
  624. USBPORTSVC_InvalidateEndpoint(
  625. PDEVICE_DATA DeviceData,
  626. PENDPOINT_DATA EndpointData
  627. );
  628. NTSTATUS
  629. USBPORTBUSIF_InitializeUsbDevice(
  630. PVOID BusContext,
  631. PUSB_DEVICE_HANDLE DeviceHandle
  632. );
  633. NTSTATUS
  634. USBPORTBUSIF_GetUsbDescriptors(
  635. PVOID BusContext,
  636. PUSB_DEVICE_HANDLE DeviceHandle,
  637. PUCHAR DeviceDescriptorBuffer,
  638. PULONG DeviceDescriptorBufferLength,
  639. PUCHAR ConfigDescriptorBuffer,
  640. PULONG ConfigDescriptorBufferLength
  641. );
  642. VOID
  643. USBPORT_QueuePendingUrbToEndpoint(
  644. PHCD_ENDPOINT Endpoint,
  645. PTRANSFER_URB Urb
  646. );
  647. NTSTATUS
  648. USBPORT_GetUsbDescriptor(
  649. PUSBD_DEVICE_HANDLE DeviceHandle,
  650. PDEVICE_OBJECT FdoDeviceObject,
  651. UCHAR DescriptorType,
  652. PUCHAR DescriptorBuffer,
  653. PULONG DescriptorBufferLength
  654. );
  655. VOID
  656. USBPORT_Wait(
  657. PDEVICE_OBJECT FdoDeviceObject,
  658. ULONG Milliseconds
  659. );
  660. VOID
  661. USBPORT_Worker(
  662. PDEVICE_OBJECT FdoDeviceObject
  663. );
  664. BOOLEAN
  665. USBPORT_FindUrbInList(
  666. PTRANSFER_URB Urb,
  667. PLIST_ENTRY ListHead
  668. );
  669. VOID
  670. USBPORT_SignalWorker(
  671. PDEVICE_OBJECT FdoDeviceObject
  672. );
  673. VOID
  674. USBPORTSVC_LogEntry(
  675. PDEVICE_DATA DeviceData,
  676. ULONG Mask,
  677. ULONG Sig,
  678. ULONG_PTR Info1,
  679. ULONG_PTR Info2,
  680. ULONG_PTR Info3
  681. );
  682. VOID
  683. USBPORT_QueuePendingTransferIrp(
  684. PIRP Irp
  685. );
  686. VOID
  687. USBPORT_CancelPendingTransferIrp(
  688. PDEVICE_OBJECT FdoDeviceObject,
  689. PIRP CancelIrp
  690. );
  691. VOID
  692. USBPORT_QueuePendingUrbToEndpoint(
  693. PHCD_ENDPOINT Endpoint,
  694. PTRANSFER_URB Urb
  695. );
  696. VOID
  697. USBPORT_CancelActiveTransferIrp(
  698. PDEVICE_OBJECT FdoDeviceObject,
  699. PIRP CancelIrp
  700. );
  701. VOID
  702. USBPORT_InsertIrpInTable(
  703. PDEVICE_OBJECT FdoDeviceObject,
  704. PUSBPORT_IRP_TABLE IrpTable,
  705. PIRP Irp
  706. );
  707. PIRP
  708. USBPORT_RemoveIrpFromTable(
  709. PDEVICE_OBJECT FdoDeviceObject,
  710. PUSBPORT_IRP_TABLE IrpTable,
  711. PIRP Irp
  712. );
  713. PIRP
  714. USBPORT_RemovePendingTransferIrp(
  715. PDEVICE_OBJECT FdoDeviceObject,
  716. PIRP Irp
  717. );
  718. PIRP
  719. USBPORT_RemoveActiveTransferIrp(
  720. PDEVICE_OBJECT FdoDeviceObject,
  721. PIRP Irp
  722. );
  723. VOID
  724. USBPORT_FreeIrpTable(
  725. PDEVICE_OBJECT FdoDeviceObject,
  726. PUSBPORT_IRP_TABLE BaseIrpTable
  727. );
  728. PUCHAR
  729. USBPORTSVC_MapHwPhysicalToVirtual(
  730. HW_32BIT_PHYSICAL_ADDRESS HwPhysicalAddress,
  731. PDEVICE_DATA DeviceData,
  732. PENDPOINT_DATA EndpointData
  733. );
  734. PURB
  735. USBPORT_UrbFromIrp(
  736. PIRP Irp
  737. );
  738. VOID
  739. USBPORT_FlushAbortList(
  740. PHCD_ENDPOINT Endpoint
  741. );
  742. VOID
  743. USBPORT_AbortEndpoint(
  744. PDEVICE_OBJECT FdoDeviceObject,
  745. PHCD_ENDPOINT Endpoint,
  746. PIRP Irp
  747. );
  748. BOOLEAN
  749. USBPORT_LazyCloseEndpoint(
  750. PDEVICE_OBJECT FdoDeviceObject,
  751. PHCD_ENDPOINT Endpoint
  752. );
  753. NTSTATUS
  754. USBPORT_RemoveDevice(
  755. PUSBD_DEVICE_HANDLE DeviceHandle,
  756. PDEVICE_OBJECT FdoDeviceObject,
  757. ULONG Flags
  758. );
  759. VOID
  760. USBPORT_AbortAllTransfers(
  761. PDEVICE_OBJECT FdoDeviceObject,
  762. PUSBD_DEVICE_HANDLE DeviceHandle
  763. );
  764. NTSTATUS
  765. USBPORT_CreateWorkerThread(
  766. PDEVICE_OBJECT FdoDeviceObject
  767. );
  768. #define IEP_SIGNAL_WORKER 0x00000001
  769. #define IEP_REQUEST_INTERRUPT 0x00000002
  770. VOID
  771. USBPORT_InvalidateEndpoint(
  772. PDEVICE_OBJECT FdoDeviceObject,
  773. PHCD_ENDPOINT Endpoint,
  774. ULONG IEPflags
  775. );
  776. VOID
  777. USBPORT_TerminateWorkerThread(
  778. PDEVICE_OBJECT FdoDeviceObject
  779. );
  780. VOID
  781. USBPORT_FlushClosedEndpointList(
  782. PDEVICE_OBJECT FdoDeviceObject
  783. );
  784. PIRP
  785. USBPORT_FindActiveTransferIrp(
  786. PDEVICE_OBJECT FdoDeviceObject,
  787. PIRP Irp
  788. );
  789. NTSTATUS
  790. USBPORT_ReadWriteConfigSpace(
  791. PDEVICE_OBJECT FdoDeviceObject,
  792. BOOLEAN Read,
  793. PVOID Buffer,
  794. ULONG Offset,
  795. ULONG Length
  796. );
  797. NTSTATUS
  798. USBPORT_UsbFdoUserIoctl(
  799. PDEVICE_OBJECT FdoDeviceObject,
  800. PIRP Irp,
  801. PULONG BytesReturned
  802. );
  803. VOID
  804. USBPORT_UserSendOnePacket(
  805. PDEVICE_OBJECT FdoDeviceObject,
  806. PUSBUSER_REQUEST_HEADER Header,
  807. PPACKET_PARAMETERS PacketParameters
  808. );
  809. NTSTATUS
  810. USBPORT_CreatePortFdoSymbolicLink(
  811. PDEVICE_OBJECT FdoDeviceObject
  812. );
  813. #define USBPORT_ReadConfigSpace(fdo, buffer, offset, length) \
  814. USBPORT_ReadWriteConfigSpace((fdo), TRUE, (buffer), (offset), (length))
  815. #define USBPORT_WriteConfigSpace(fdo, buffer, offset, length) \
  816. USBPORT_ReadWriteConfigSpace((fdo), FALSE, (buffer), (offset), (length))
  817. BOOLEAN
  818. USBPORT_ValidateConfigurtionDescriptor(
  819. PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
  820. USBD_STATUS *UsbdStatus
  821. );
  822. VOID
  823. USBPORT_UserGetControllerInfo_0(
  824. PDEVICE_OBJECT FdoDeviceObject,
  825. PUSBUSER_REQUEST_HEADER Header,
  826. PUSB_CONTROLLER_INFO_0 ControllerInfo_0
  827. );
  828. VOID
  829. USBPORT_UserRawResetPort(
  830. PDEVICE_OBJECT FdoDeviceObject,
  831. PUSBUSER_REQUEST_HEADER Header,
  832. PRAW_RESET_PORT_PARAMETERS Parameters
  833. );
  834. VOID
  835. USBPORT_GetRootPortStatus(
  836. PDEVICE_OBJECT FdoDeviceObject,
  837. PUSBUSER_REQUEST_HEADER Header,
  838. PRAW_ROOTPORT_PARAMETERS Parameters
  839. );
  840. VOID
  841. USBPORT_UserSetRootPortFeature(
  842. PDEVICE_OBJECT FdoDeviceObject,
  843. PUSBUSER_REQUEST_HEADER Header,
  844. PRAW_ROOTPORT_FEATURE Parameters
  845. );
  846. VOID
  847. USBPORT_UserClearRootPortFeature(
  848. PDEVICE_OBJECT FdoDeviceObject,
  849. PUSBUSER_REQUEST_HEADER Header,
  850. PRAW_ROOTPORT_FEATURE Parameters
  851. );
  852. VOID
  853. USBPORT_StartDM_Timer(
  854. PDEVICE_OBJECT FdoDeviceObject,
  855. LONG MillisecondInterval
  856. );
  857. VOID
  858. USBPORT_IsrDpcWorker(
  859. PDEVICE_OBJECT FdoDeviceObject,
  860. BOOLEAN HcInterrupt
  861. );
  862. VOID
  863. USBPORT_InvalidateRootHub(
  864. PDEVICE_OBJECT FdoDeviceObject
  865. );
  866. VOID
  867. USBPORT_HcQueueWakeDpc(
  868. PDEVICE_OBJECT FdoDeviceObject
  869. );
  870. VOID
  871. USBPORT_HcWakeDpc(
  872. PKDPC Dpc,
  873. PVOID DeferredContext,
  874. PVOID SystemArgument1,
  875. PVOID SystemArgument2
  876. );
  877. VOID
  878. USBPORT_StopDM_Timer(
  879. PDEVICE_OBJECT FdoDeviceObject
  880. );
  881. BOOLEAN
  882. USBPORT_EndpointHasQueuedTransfers(
  883. PDEVICE_OBJECT FdoDeviceObject,
  884. PHCD_ENDPOINT Endpoint
  885. );
  886. USB_USER_ERROR_CODE
  887. USBPORT_NtStatus_TO_UsbUserStatus(
  888. NTSTATUS NtStatus
  889. );
  890. VOID
  891. USBPORT_UserGetControllerKey(
  892. PDEVICE_OBJECT FdoDeviceObject,
  893. PUSBUSER_REQUEST_HEADER Header,
  894. PUSB_UNICODE_NAME ControllerKey
  895. );
  896. VOID
  897. USBPORT_UserPassThru(
  898. PDEVICE_OBJECT FdoDeviceObject,
  899. PUSBUSER_REQUEST_HEADER Header,
  900. PUSB_PASS_THRU_PARAMETERS PassThru
  901. );
  902. VOID
  903. USBPORT_CancelPendingWakeIrp(
  904. PDEVICE_OBJECT PdoDeviceObject,
  905. PIRP CancelIrp
  906. );
  907. VOID
  908. USBPORT_TurnControllerOff(
  909. PDEVICE_OBJECT FdoDeviceObject
  910. );
  911. VOID
  912. USBPORT_TurnControllerOn(
  913. PDEVICE_OBJECT FdoDeviceObject
  914. );
  915. PHC_POWER_STATE
  916. USBPORT_GetHcPowerState(
  917. PDEVICE_OBJECT FdoDeviceObject,
  918. PHC_POWER_STATE_TABLE HcPowerStateTbl,
  919. SYSTEM_POWER_STATE SystemState
  920. );
  921. VOID
  922. USBPORT_ComputeHcPowerStates(
  923. PDEVICE_OBJECT FdoDeviceObject,
  924. PDEVICE_CAPABILITIES HcDeviceCaps,
  925. PHC_POWER_STATE_TABLE HcPowerStateTbl
  926. );
  927. NTSTATUS
  928. USBPORTBUSIF_RestoreUsbDevice(
  929. PVOID BusContext,
  930. PUSB_DEVICE_HANDLE OldDeviceHandle,
  931. PUSB_DEVICE_HANDLE NewDeviceHandle
  932. );
  933. MP_ENDPOINT_STATUS
  934. USBPORT_GetEndpointStatus(
  935. PHCD_ENDPOINT Endpoint
  936. );
  937. NTSTATUS
  938. USBPORT_CloneDevice(
  939. PDEVICE_OBJECT FdoDeviceObject,
  940. PUSBD_DEVICE_HANDLE OldDeviceHandle,
  941. PUSBD_DEVICE_HANDLE NewDeviceHandle
  942. );
  943. VOID
  944. USBPORT_SuspendController(
  945. PDEVICE_OBJECT FdoDeviceObject
  946. );
  947. VOID
  948. USBPORT_NukeAllEndpoints(
  949. PDEVICE_OBJECT FdoDeviceObject
  950. );
  951. VOID
  952. USBPORT_RemoveDeviceHandle(
  953. PDEVICE_OBJECT FdoDeviceObject,
  954. PUSBD_DEVICE_HANDLE DeviceHandle
  955. );
  956. VOID
  957. USBPORT_StopRootHubPdo(
  958. PDEVICE_OBJECT FdoDeviceObject,
  959. PDEVICE_OBJECT PdoDeviceObject
  960. );
  961. VOID
  962. USBPORT_ResumeController(
  963. PDEVICE_OBJECT FdoDeviceObject
  964. );
  965. VOID
  966. USBPORT_UserPowerInformation(
  967. PDEVICE_OBJECT FdoDeviceObject,
  968. PUSBUSER_REQUEST_HEADER Header,
  969. PUSB_POWER_INFO PowerInformation
  970. );
  971. PHCD_TRANSFER_CONTEXT
  972. USBPORT_UnlinkTransfer(
  973. PDEVICE_OBJECT FdoDeviceObject,
  974. PTRANSFER_URB Urb
  975. );
  976. VOID
  977. USBPORT_UserOpenRawDevice(
  978. PDEVICE_OBJECT FdoDeviceObject,
  979. PUSBUSER_REQUEST_HEADER Header,
  980. PUSB_OPEN_RAW_DEVICE_PARAMETERS Parameters
  981. );
  982. VOID
  983. USBPORT_UserCloseRawDevice(
  984. PDEVICE_OBJECT FdoDeviceObject,
  985. PUSBUSER_REQUEST_HEADER Header,
  986. PUSB_CLOSE_RAW_DEVICE_PARAMETERS Parameters
  987. );
  988. VOID
  989. USBPORT_UserSendRawCommand(
  990. PDEVICE_OBJECT FdoDeviceObject,
  991. PUSBUSER_REQUEST_HEADER Header,
  992. PUSB_SEND_RAW_COMMAND_PARAMETERS Parameters
  993. );
  994. VOID
  995. USBPORT_InitializeIsoTransfer(
  996. PDEVICE_OBJECT FdoDeviceObject,
  997. PTRANSFER_URB Urb,
  998. PHCD_TRANSFER_CONTEXT Transfer
  999. );
  1000. BOOLEAN
  1001. USBPORT_InTextmodeSetup(
  1002. VOID
  1003. );
  1004. NTSTATUS
  1005. USBPORT_IsCompanionController(
  1006. PDEVICE_OBJECT FdoDeviceObject,
  1007. PBOOLEAN ReturnResult
  1008. );
  1009. USB_CONTROLLER_FLAVOR
  1010. USBPORT_GetHcFlavor(
  1011. PDEVICE_OBJECT FdoDeviceObject,
  1012. USHORT PciVendorId,
  1013. USHORT PciProductId,
  1014. UCHAR PciRevision
  1015. );
  1016. VOID
  1017. USBPORT_ClosePipe(
  1018. PUSBD_DEVICE_HANDLE DeviceHandle,
  1019. PDEVICE_OBJECT FdoDeviceObject,
  1020. PUSBD_PIPE_HANDLE_I PipeHandle
  1021. );
  1022. PUSBD_INTERFACE_HANDLE_I
  1023. USBPORT_GetInterfaceHandle(
  1024. PDEVICE_OBJECT FdoDeviceObject,
  1025. PUSBD_CONFIG_HANDLE ConfigurationHandle,
  1026. UCHAR InterfaceNumber
  1027. );
  1028. USBD_STATUS
  1029. USBPORT_InitializeInterfaceInformation(
  1030. PDEVICE_OBJECT FdoDeviceObject,
  1031. PUSBD_INTERFACE_INFORMATION InterfaceInformation,
  1032. PUSBD_CONFIG_HANDLE ConfigHandle
  1033. );
  1034. NTSTATUS
  1035. USBPORT_GetBusInterfaceUSBDI(
  1036. PDEVICE_OBJECT FdoDeviceObject,
  1037. PDEVICE_OBJECT PdoDeviceObject,
  1038. PUSBD_DEVICE_HANDLE DeviceHandle,
  1039. PIRP Irp
  1040. );
  1041. PVOID
  1042. USBPORT_GetDeviceBusContext(
  1043. PDEVICE_OBJECT FdoDeviceObject,
  1044. PUSBD_DEVICE_HANDLE DeviceHandle,
  1045. PVOID HubBusContext
  1046. );
  1047. PVOID
  1048. USBPORTBUSIF_GetDeviceBusContext(
  1049. IN PVOID HubBusContext,
  1050. IN PVOID DeviceHandle
  1051. );
  1052. ULONG
  1053. USBPORT_ComputeTotalBandwidth(
  1054. PDEVICE_OBJECT FdoDeviceObject,
  1055. PVOID BusContext
  1056. );
  1057. USB_MINIPORT_STATUS
  1058. USBPORT_NtStatus_TO_MiniportStatus(
  1059. NTSTATUS NtStatus
  1060. );
  1061. BOOLEAN
  1062. USBPORT_AllocateBandwidthUSB11(
  1063. PDEVICE_OBJECT FdoDeviceObject,
  1064. PHCD_ENDPOINT Endpoint
  1065. );
  1066. BOOLEAN
  1067. USBPORT_AllocateBandwidthUSB20(
  1068. PDEVICE_OBJECT FdoDeviceObject,
  1069. PHCD_ENDPOINT Endpoint
  1070. );
  1071. VOID
  1072. USBPORT_FreeBandwidthUSB11(
  1073. PDEVICE_OBJECT FdoDeviceObject,
  1074. PHCD_ENDPOINT Endpoint
  1075. );
  1076. VOID
  1077. USBPORT_FreeBandwidthUSB20(
  1078. PDEVICE_OBJECT FdoDeviceObject,
  1079. PHCD_ENDPOINT Endpoint
  1080. );
  1081. VOID
  1082. USBPORT_UserGetBandwidthInformation(
  1083. PDEVICE_OBJECT FdoDeviceObject,
  1084. PUSBUSER_REQUEST_HEADER Header,
  1085. PUSB_BANDWIDTH_INFO BandwidthInfo
  1086. );
  1087. PTRANSACTION_TRANSLATOR
  1088. USBPORT_GetTt(
  1089. PDEVICE_OBJECT FdoDeviceObject,
  1090. PUSBD_DEVICE_HANDLE HubDeviceHandle,
  1091. PUSHORT PortNumber
  1092. );
  1093. NTSTATUS
  1094. USBPORT_InitializeTT(
  1095. PDEVICE_OBJECT FdoDeviceObject,
  1096. PUSBD_DEVICE_HANDLE HubDeviceHandle,
  1097. USHORT Port
  1098. );
  1099. VOID
  1100. USBPORTSVC_Wait(
  1101. PDEVICE_DATA DeviceData,
  1102. ULONG MillisecondsToWait
  1103. );
  1104. ULONG
  1105. USBPORT_GetDeviceCount(
  1106. PDEVICE_OBJECT FdoDeviceObject
  1107. );
  1108. VOID
  1109. USBPORT_UserGetBusStatistics0(
  1110. PDEVICE_OBJECT FdoDeviceObject,
  1111. PUSBUSER_REQUEST_HEADER Header,
  1112. PUSB_BUS_STATISTICS_0 BusStatistics0
  1113. );
  1114. ULONG
  1115. USBPORT_ComputeAllocatedBandwidth(
  1116. PDEVICE_OBJECT FdoDeviceObject,
  1117. PVOID BusContext
  1118. );
  1119. VOID
  1120. USBPORT_EndpointTimeout(
  1121. PDEVICE_OBJECT FdoDeviceObject,
  1122. PHCD_ENDPOINT Endpoint
  1123. );
  1124. VOID
  1125. USBPORT_TimeoutAllEndpoints(
  1126. PDEVICE_OBJECT FdoDeviceObject
  1127. );
  1128. NTSTATUS
  1129. USBPORT_LegacyGetUnicodeName(
  1130. PDEVICE_OBJECT FdoDeviceObject,
  1131. PIRP Irp,
  1132. PULONG BytesReturned
  1133. );
  1134. USHORT
  1135. USBPORT_GetTtDeviceAddress(
  1136. PDEVICE_OBJECT FdoDeviceObject,
  1137. PUSBD_DEVICE_HANDLE HubDeviceHandle
  1138. );
  1139. NTSTATUS
  1140. USBPORT_GetSymbolicName(
  1141. PDEVICE_OBJECT FdoDeviceObject,
  1142. PDEVICE_OBJECT DeviceObject,
  1143. PUNICODE_STRING SymbolicNameUnicodeString
  1144. );
  1145. VOID
  1146. USBPORT_UserGetRootHubName(
  1147. PDEVICE_OBJECT FdoDeviceObject,
  1148. PUSBUSER_REQUEST_HEADER Header,
  1149. PUSB_UNICODE_NAME RootHubName
  1150. );
  1151. NTSTATUS
  1152. USBPORTBUSIF_BusQueryDeviceInformation(
  1153. PVOID BusContext,
  1154. PUSB_DEVICE_HANDLE DeviceHandle,
  1155. PVOID DeviceInformationBuffer,
  1156. ULONG DeviceInformationBufferLength,
  1157. PULONG LengthOfDataCopied
  1158. );
  1159. NTSTATUS
  1160. USBPORT_IdleNotificationRequest(
  1161. PDEVICE_OBJECT PdoDeviceObject,
  1162. PIRP Irp
  1163. );
  1164. VOID
  1165. USBPORT_CompletePdoWaitWake(
  1166. PDEVICE_OBJECT FdoDeviceObject
  1167. );
  1168. VOID
  1169. USBPORT_CompletePendingIdleIrp(
  1170. PDEVICE_OBJECT PdoDeviceObject
  1171. );
  1172. VOID
  1173. USBPORT_FlushController(
  1174. PDEVICE_OBJECT FdoDeviceObject
  1175. );
  1176. VOID
  1177. USBPORT_SubmitHcWakeIrp(
  1178. PDEVICE_OBJECT FdoDeviceObject
  1179. );
  1180. BOOLEAN
  1181. USBPORT_RootHubEnabledForWake(
  1182. PDEVICE_OBJECT FdoDeviceObject
  1183. );
  1184. VOID
  1185. USBPORT_RestoreController(
  1186. PDEVICE_OBJECT FdoDeviceObject
  1187. );
  1188. VOID
  1189. USBPORT_ErrorCompleteIsoTransfer(
  1190. PDEVICE_OBJECT FdoDeviceObject,
  1191. PHCD_ENDPOINT Endpoiint,
  1192. PHCD_TRANSFER_CONTEXT Transfer
  1193. );
  1194. BOOLEAN
  1195. USBPORT_SelectiveSuspendEnabled(
  1196. PDEVICE_OBJECT FdoDeviceObject
  1197. );
  1198. PIRP
  1199. USBPORT_FindUrbInIrpTable(
  1200. PDEVICE_OBJECT FdoDeviceObject,
  1201. PUSBPORT_IRP_TABLE IrpTable,
  1202. PTRANSFER_URB Urb,
  1203. PIRP InputIrp
  1204. );
  1205. PUSBD_DEVICE_HANDLE
  1206. USBPORT_GetDeviceHandle(
  1207. PHCD_ENDPOINT Endpoint
  1208. );
  1209. //VOID
  1210. //USBPORT_CancelHcWakeIrp(
  1211. // PDEVICE_OBJECT FdoDeviceObject
  1212. // );
  1213. VOID
  1214. USBPORT_DoneSplitTransfer(
  1215. PHCD_TRANSFER_CONTEXT SplitTransfer
  1216. );
  1217. VOID
  1218. USBPORT_AssertTransferUrb(
  1219. PTRANSFER_URB Urb
  1220. );
  1221. VOID
  1222. USBPORT_SplitTransfer(
  1223. PDEVICE_OBJECT FdoDeviceObject,
  1224. PHCD_ENDPOINT Endpoint,
  1225. PHCD_TRANSFER_CONTEXT Transfer,
  1226. PLIST_ENTRY TransferList
  1227. );
  1228. VOID
  1229. USBPORTSVC_InvalidateController(
  1230. PDEVICE_DATA DeviceData,
  1231. USB_CONTROLLER_STATE ControllerState
  1232. );
  1233. VOID
  1234. USBPORTSVC_BugCheck(
  1235. PDEVICE_DATA DeviceData
  1236. );
  1237. VOID
  1238. USBPORT_DbgAcquireSpinLock(
  1239. PDEVICE_OBJECT FdoDeviceObject,
  1240. PUSBPORT_SPIN_LOCK SpinLock,
  1241. PKIRQL OldIrql
  1242. );
  1243. VOID
  1244. USBPORT_DbgReleaseSpinLock(
  1245. PDEVICE_OBJECT FdoDeviceObject,
  1246. PUSBPORT_SPIN_LOCK SpinLock,
  1247. KIRQL NewIrql
  1248. );
  1249. VOID
  1250. USBPORT_InitializeSpinLock (
  1251. PUSBPORT_SPIN_LOCK SpinLock,
  1252. LONG SigA,
  1253. LONG SigR
  1254. );
  1255. VOID
  1256. USBPORT_PowerFault(
  1257. PDEVICE_OBJECT FdoDeviceObject,
  1258. PUCHAR MessageText
  1259. );
  1260. NTSTATUS
  1261. USBPORTBUSIF_GetControllerInformation(
  1262. PVOID BusContext,
  1263. PVOID ControllerInformationBuffer,
  1264. ULONG ControllerInformationBufferLength,
  1265. PULONG LengthOfDataCopied
  1266. );
  1267. NTSTATUS
  1268. USBPORTBUSIF_ControllerSelectiveSuspend(
  1269. PVOID BusContext,
  1270. BOOLEAN Enable
  1271. );
  1272. NTSTATUS
  1273. USBPORTBUSIF_GetRootHubSymbolicName(
  1274. PVOID BusContext,
  1275. PVOID HubSymNameBuffer,
  1276. ULONG HubSymNameBufferLength,
  1277. PULONG LengthOfDataCopied
  1278. );
  1279. NTSTATUS
  1280. USBPORTBUSIF_GetExtendedHubInformation(
  1281. PVOID BusContext,
  1282. PDEVICE_OBJECT HubPhysicalDeviceObject,
  1283. PVOID HubInformationBuffer,
  1284. ULONG HubInformationBufferLength,
  1285. PULONG LengthOfDataCopied
  1286. );
  1287. VOID
  1288. USBPORT_BeginTransmitTriggerPacket(
  1289. PDEVICE_OBJECT FdoDeviceObject
  1290. );
  1291. VOID
  1292. USBPORT_EndTransmitTriggerPacket(
  1293. PDEVICE_OBJECT FdoDeviceObject
  1294. );
  1295. VOID
  1296. USBPORT_CatcTrap(
  1297. PDEVICE_OBJECT FdoDeviceObject
  1298. );
  1299. VOID
  1300. USBPORT_RebalanceEndpoint(
  1301. PDEVICE_OBJECT FdoDeviceObject,
  1302. PLIST_ENTRY EndpointList
  1303. );
  1304. NTSTATUS
  1305. USBPORT_GetDefaultBIOS_X(
  1306. PDEVICE_OBJECT FdoDeviceObject,
  1307. PULONG BiosX,
  1308. PULONG GlobalDisableSS,
  1309. PULONG GlobalDisableCCDetect,
  1310. PULONG EnIdleEndpointSupport
  1311. );
  1312. VOID
  1313. USBPORT_ApplyBIOS_X(
  1314. PDEVICE_OBJECT FdoDeviceObject,
  1315. PDEVICE_CAPABILITIES DeviceCaps,
  1316. ULONG BiosX
  1317. );
  1318. NTSTATUS
  1319. USBPORT_InitializeHsHub(
  1320. PDEVICE_OBJECT FdoDeviceObject,
  1321. PUSBD_DEVICE_HANDLE HubDeviceHandle,
  1322. ULONG TtCount
  1323. );
  1324. NTSTATUS
  1325. USBPORTBUSIF_InitailizeUsb2Hub(
  1326. PVOID BusContext,
  1327. PUSB_DEVICE_HANDLE HubDeviceHandle,
  1328. ULONG TtCount
  1329. );
  1330. VOID
  1331. USBPORTSVC_NotifyDoubleBuffer(
  1332. PDEVICE_DATA DeviceData,
  1333. PTRANSFER_PARAMETERS TransferParameters,
  1334. PVOID DbSystemAddress,
  1335. ULONG DbLength
  1336. );
  1337. VOID
  1338. USBPORT_FlushAdapterDBs(
  1339. PDEVICE_OBJECT FdoDeviceObject,
  1340. PHCD_TRANSFER_CONTEXT Transfer
  1341. );
  1342. BOOLEAN
  1343. USBPORT_IsDeviceHighSpeed(
  1344. PVOID BusContext
  1345. );
  1346. VOID
  1347. USBPORT_UpdateAllocatedBw(
  1348. PDEVICE_OBJECT FdoDeviceObject
  1349. );
  1350. VOID
  1351. USBPORT_UpdateAllocatedBwTt(
  1352. PTRANSACTION_TRANSLATOR Tt
  1353. );
  1354. VOID
  1355. USBPORT_BadRequestFlush(
  1356. PDEVICE_OBJECT FdoDeviceObject,
  1357. BOOLEAN ForceFlush
  1358. );
  1359. VOID
  1360. USBPORTBUSIF_FlushTransfers(
  1361. PVOID BusContext,
  1362. PVOID DeviceHandle
  1363. );
  1364. USBD_STATUS
  1365. USBPORT_FlushIsoTransfer(
  1366. PDEVICE_OBJECT FdoDeviceObject,
  1367. PTRANSFER_PARAMETERS TransferParameters,
  1368. PMINIPORT_ISO_TRANSFER IsoTransfer
  1369. );
  1370. USBPORT_OS_VERSION
  1371. USBPORT_DetectOSVersion(
  1372. PDEVICE_OBJECT FdoDeviceObject
  1373. );
  1374. VOID
  1375. USBPORT_DoSetPowerD0(
  1376. PDEVICE_OBJECT FdoDeviceObject
  1377. );
  1378. VOID
  1379. USBPORT_QueuePowerWorkItem(
  1380. PDEVICE_OBJECT FdoDeviceObject
  1381. );
  1382. NTSTATUS
  1383. USBPORTBUSIF_RootHubInitNotification(
  1384. PVOID BusContext,
  1385. PVOID CallBackContext,
  1386. PRH_INIT_CALLBACK CallbackRoutine
  1387. );
  1388. VOID
  1389. USBPORT_SynchronizeControllersStart(
  1390. PDEVICE_OBJECT FdoDeviceObject
  1391. );
  1392. VOID
  1393. USBPORT_SynchronizeControllersResume(
  1394. PDEVICE_OBJECT FdoDeviceObject
  1395. );
  1396. PDEVICE_OBJECT
  1397. USBPORT_FindUSB2Controller(
  1398. PDEVICE_OBJECT CcFdoDeviceObject
  1399. );
  1400. VOID
  1401. USBPORT_RegisterUSB2fdo(
  1402. PDEVICE_OBJECT FdoDeviceObject
  1403. );
  1404. VOID
  1405. USBPORT_RegisterUSB1fdo(
  1406. PDEVICE_OBJECT FdoDeviceObject
  1407. );
  1408. VOID
  1409. USBPORT_DeregisterUSB2fdo(
  1410. PDEVICE_OBJECT FdoDeviceObject
  1411. );
  1412. VOID
  1413. USBPORT_DeregisterUSB1fdo(
  1414. PDEVICE_OBJECT FdoDeviceObject
  1415. );
  1416. PDEVICE_RELATIONS
  1417. USBPORT_FindCompanionControllers(
  1418. PDEVICE_OBJECT Usb2FdoDeviceObject,
  1419. BOOLEAN ReferenceObjects,
  1420. BOOLEAN ReturnFdo
  1421. );
  1422. VOID
  1423. USBPORT_UserSetRootPortFeature(
  1424. PDEVICE_OBJECT FdoDeviceObject,
  1425. PUSBUSER_REQUEST_HEADER Header,
  1426. PRAW_ROOTPORT_FEATURE Parameters
  1427. );
  1428. VOID
  1429. USBPORT_UserClearRootPortFeature(
  1430. PDEVICE_OBJECT FdoDeviceObject,
  1431. PUSBUSER_REQUEST_HEADER Header,
  1432. PRAW_ROOTPORT_FEATURE Parameters
  1433. );
  1434. ULONG
  1435. USBPORT_SelectOrdinal(
  1436. PDEVICE_OBJECT FdoDeviceObject,
  1437. PHCD_ENDPOINT Endpoint
  1438. );
  1439. VOID
  1440. USBPORT_WriteHaction(
  1441. PDEVICE_OBJECT Usb2FdoDeviceObject,
  1442. ULONG Haction
  1443. );
  1444. USB_MINIPORT_STATUS
  1445. USBPORT_RootHub_PowerUsb2Port(
  1446. PDEVICE_OBJECT FdoDeviceObject,
  1447. USHORT Port
  1448. );
  1449. NTSTATUS
  1450. USBPORT_BusEnumLogEntry(
  1451. PVOID BusContext,
  1452. ULONG DriverTag,
  1453. ULONG EnumTag,
  1454. ULONG P1,
  1455. ULONG P2
  1456. );
  1457. BOOLEAN
  1458. USBPORT_ValidateRootPortApi(
  1459. PDEVICE_OBJECT FdoDeviceObject,
  1460. ULONG PortNumber
  1461. );
  1462. BOOLEAN
  1463. USBPORT_DCA_Enabled(
  1464. PDEVICE_OBJECT FdoDeviceObject
  1465. );
  1466. USB_MINIPORT_STATUS
  1467. USBPORT_RootHub_PowerUsbCcPort(
  1468. PDEVICE_OBJECT FdoDeviceObject,
  1469. USHORT Port
  1470. );
  1471. USB_MINIPORT_STATUS
  1472. USBPORT_RootHub_PowerAndChirpAllCcPorts(
  1473. PDEVICE_OBJECT FdoDeviceObject
  1474. );
  1475. #ifdef LOG_OCA_DATA
  1476. VOID
  1477. USBPORTBUSIF_SetDeviceHandleData(
  1478. PVOID BusContext,
  1479. PVOID DeviceHandle,
  1480. PDEVICE_OBJECT UsbDevicePdo
  1481. );
  1482. VOID
  1483. USBPORT_RecordOcaData(
  1484. PDEVICE_OBJECT FdoDeviceObject,
  1485. POCA_DATA OcaData,
  1486. PHCD_TRANSFER_CONTEXT Transfer,
  1487. PIRP Irp
  1488. );
  1489. #endif
  1490. RHSTATUS
  1491. USBPORT_RootHub_HubRequest(
  1492. PDEVICE_OBJECT FdoDeviceObject,
  1493. PORT_OPERATION PortOperation
  1494. );
  1495. NTSTATUS
  1496. USBPORT_ProcessHcWakeIrp(
  1497. PDEVICE_OBJECT FdoDeviceObject,
  1498. PIRP Irp
  1499. );
  1500. NTSTATUS
  1501. USBPORT_HcWakeIrp_Io_Completion(
  1502. PDEVICE_OBJECT DeviceObject,
  1503. PIRP Irp,
  1504. PVOID Context
  1505. );
  1506. NTSTATUS
  1507. USBPORT_HcWakeIrp_Po_Completion(
  1508. PDEVICE_OBJECT DeviceObject,
  1509. UCHAR MinorFunction,
  1510. POWER_STATE DeviceState,
  1511. PVOID Context,
  1512. PIO_STATUS_BLOCK IoStatus
  1513. );
  1514. VOID
  1515. USBPORT_DisarmHcForWake(
  1516. PDEVICE_OBJECT FdoDeviceObject
  1517. );
  1518. VOID
  1519. USBPORT_ArmHcForWake(
  1520. PDEVICE_OBJECT FdoDeviceObject
  1521. );
  1522. VOID
  1523. USBPORT_FlushCahcedRegistryKeys(
  1524. PDEVICE_OBJECT FdoDeviceObject
  1525. );
  1526. NTSTATUS
  1527. USBPORT_GetCachedRegistryKeyValueForPdo(
  1528. PDEVICE_OBJECT FdoDeviceObject,
  1529. PDEVICE_OBJECT PhysicalDeviceObject,
  1530. BOOLEAN SoftwareBranch,
  1531. PWCHAR KeyNameString,
  1532. ULONG KeyNameStringLength,
  1533. PVOID Data,
  1534. ULONG DataLength
  1535. );
  1536. VOID
  1537. USBPORT_DoRootHubCallback(
  1538. PDEVICE_OBJECT FdoDeviceObject,
  1539. PDEVICE_OBJECT Usb2Fdo
  1540. );
  1541. #endif /* __PROTOTYP_H__ */