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.

858 lines
20 KiB

  1. /*++
  2. Copyright (c) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. USBMASS.H
  5. Abstract:
  6. Header file for USBSTOR driver
  7. Environment:
  8. kernel mode
  9. Revision History:
  10. 06-01-98 : started rewrite
  11. --*/
  12. //*****************************************************************************
  13. // I N C L U D E S
  14. //*****************************************************************************
  15. #include <scsi.h>
  16. #include "dbg.h"
  17. //*****************************************************************************
  18. // D E F I N E S
  19. //*****************************************************************************
  20. #define max(a,b) (((a) > (b)) ? (a) : (b))
  21. #define min(a,b) (((a) < (b)) ? (a) : (b))
  22. #define CLASS_URB(urb) urb->UrbControlVendorClassRequest
  23. #define FEATURE_URB(urb) urb->UrbControlFeatureRequest
  24. #define USBSTOR_MAX_TRANSFER_SIZE 0x00010000
  25. #define USBSTOR_MAX_TRANSFER_PAGES ((USBSTOR_MAX_TRANSFER_SIZE/PAGE_SIZE)+1)
  26. // Interface Descriptor values
  27. //
  28. #define USBSTOR_SUBCLASS_RBC 0x01
  29. #define USBSTOR_SUBCLASS_SFF8020i 0x02
  30. #define USBSTOR_SUBCLASS_QIC157 0x03
  31. #define USBSTOR_SUBCLASS_SFF8070i_UFI 0x04
  32. #define USBSTOR_SUBCLASS_SFF8070i 0x05
  33. #define USBSTOR_SUBCLASS_SCSI_PASSTHROUGH 0x06
  34. #define USBSTOR_PROTOCOL_BULK_ONLY 0x50
  35. #define USBSTOR_DO_TYPE_FDO '!ODF'
  36. #define USBSTOR_DO_TYPE_PDO '!ODP'
  37. #define USB_RECIPIENT_DEVICE 0
  38. #define USB_RECIPIENT_INTERFACE 1
  39. #define USB_RECIPIENT_ENDPOINT 2
  40. #define USB_RECIPIENT_OTHER 3
  41. // Bulk-Only class-specific bRequest codes
  42. //
  43. #define BULK_ONLY_MASS_STORAGE_RESET 0xFF
  44. #define BULK_ONLY_GET_MAX_LUN 0xFE
  45. // Maximum value that can be returned by BULK_ONLY_GET_MAX_LUN request
  46. //
  47. #define BULK_ONLY_MAXIMUM_LUN 0x0F
  48. #define POOL_TAG 'SAMU'
  49. #define INCREMENT_PENDING_IO_COUNT(deviceExtension) \
  50. InterlockedIncrement(&((deviceExtension)->PendingIoCount))
  51. #define DECREMENT_PENDING_IO_COUNT(deviceExtension) do { \
  52. if (InterlockedDecrement(&((deviceExtension)->PendingIoCount)) == 0) { \
  53. KeSetEvent(&((deviceExtension)->RemoveEvent), \
  54. IO_NO_INCREMENT, \
  55. 0); \
  56. } \
  57. } while (0)
  58. #define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
  59. #define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
  60. #define TEST_FLAG(Flags, Bit) ((Flags) & (Bit))
  61. // PDEVICE_EXTENSION->DeviceFlags state flags
  62. //
  63. #define DF_SRB_IN_PROGRESS 0x00000002
  64. #define DF_PERSISTENT_ERROR 0x00000004
  65. #define DF_RESET_IN_PROGRESS 0x00000008
  66. #define DF_DEVICE_DISCONNECTED 0x00000010
  67. // PDEVICE_EXTENSION->DeviceHackFlags flags
  68. // Force a Request Sense command between the completion of one command
  69. // and the start of the next command.
  70. //
  71. #define DHF_FORCE_REQUEST_SENSE 0x00000001
  72. // Reset the device when a Medium Changed AdditionalSenseCode is returned.
  73. //
  74. #define DHF_MEDIUM_CHANGE_RESET 0x00000002
  75. // Turn SCSIOP_TEST_UNIT_READY requests into SCSIOP_START_STOP_UNIT requests.
  76. //
  77. #define DHF_TUR_START_UNIT 0x00000004
  78. // Indicates that a Request Sense is being performed when the Srb has
  79. // a SenseInfoBuffer and AutoSense is not disabled.
  80. //
  81. #define AUTO_SENSE 0
  82. // Indicates that a Request Sense is being performed when the Srb has
  83. // no SenseInfoBuffer or AutoSense is disabled. In this case the Request
  84. // Sense is being performed to clear the "persistent error" condition
  85. // in the wacky CBI spec. (See also the DF_PERSISTENT_ERROR flag).
  86. //
  87. #define NON_AUTO_SENSE 1
  88. // Command Block Wrapper Signature 'USBC'
  89. //
  90. #define CBW_SIGNATURE 0x43425355
  91. #define CBW_FLAGS_DATA_IN 0x80
  92. #define CBW_FLAGS_DATA_OUT 0x00
  93. // Command Status Wrapper Signature 'USBS'
  94. //
  95. #define CSW_SIGNATURE 0x53425355
  96. #define CSW_STATUS_GOOD 0x00
  97. #define CSW_STATUS_FAILED 0x01
  98. #define CSW_STATUS_PHASE_ERROR 0x02
  99. //*****************************************************************************
  100. // T Y P E D E F S
  101. //*****************************************************************************
  102. typedef enum _DEVICE_STATE
  103. {
  104. DeviceStateCreated = 1, // After IoCreateDevice
  105. DeviceStateStarted, // After START_DEVICE
  106. DeviceStateStopPending, // After QUERY_STOP
  107. DeviceStateStopped, // After STOP_DEVICE
  108. DeviceStateRemovePending, // After QUERY_REMOVE
  109. DeviceStateSurpriseRemove, // After SURPRISE_REMOVAL
  110. DeviceStateRemoved // After REMOVE_DEVICE
  111. } DEVICE_STATE;
  112. typedef enum _DEVICE_PROTOCOL
  113. {
  114. // This value indicates that the value was not set in the registry.
  115. // This should only happen on upgrades before the value started being
  116. // set by the .INF?
  117. //
  118. DeviceProtocolUnspecified = 0,
  119. // This value indicates that the device uses the Bulk-Only specification
  120. //
  121. DeviceProtocolBulkOnly,
  122. // This value indicates that the device uses the Control/Bulk/Interrupt
  123. // specification and that command completion Interrupt transfers are
  124. // supported after every request.
  125. //
  126. DeviceProtocolCBI,
  127. // This value indicates that the device uses the Control/Bulk/Interrupt
  128. // specification and that command completion Interrupt transfers are not
  129. // supported at all, or not supported after every request. The Interrupt
  130. // endpoint will never be used by the driver for this type of device.
  131. //
  132. DeviceProtocolCB,
  133. // Anything >= this value is bogus
  134. //
  135. DeviceProtocolLast
  136. } DEVICE_PROTOCOL;
  137. #pragma pack (push, 1)
  138. // Command Block Wrapper
  139. //
  140. typedef struct _CBW
  141. {
  142. ULONG dCBWSignature;
  143. ULONG dCBWTag;
  144. ULONG dCBWDataTransferLength;
  145. UCHAR bCBWFlags;
  146. UCHAR bCBWLUN;
  147. UCHAR bCDBLength;
  148. UCHAR CBWCDB[16];
  149. } CBW, *PCBW;
  150. // Command Status Wrapper
  151. //
  152. typedef struct _CSW
  153. {
  154. ULONG dCSWSignature;
  155. ULONG dCSWTag;
  156. ULONG dCSWDataResidue;
  157. UCHAR bCSWStatus;
  158. } CSW, *PCSW;
  159. #pragma pack (pop)
  160. // Device Extension header that is common to both FDO and PDO Device Extensions
  161. //
  162. typedef struct _DEVICE_EXTENSION
  163. {
  164. // Either USBSTOR_DO_TYPE_FDO or USBSTOR_DO_TYPE_PDO
  165. //
  166. ULONG Type;
  167. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  168. // Device Extension for the FDO we attach on top of the USB enumerated PDO.
  169. //
  170. typedef struct _FDO_DEVICE_EXTENSION
  171. {
  172. // USBSTOR_DO_TYPE_FDO
  173. //
  174. ULONG Type;
  175. // Back pointer to FDO Device Object to which this Device Extension
  176. // is attached.
  177. //
  178. PDEVICE_OBJECT FdoDeviceObject;
  179. // PDO passed to USBSTOR_AddDevice
  180. //
  181. PDEVICE_OBJECT PhysicalDeviceObject;
  182. // Our FDO is attached to this device object
  183. //
  184. PDEVICE_OBJECT StackDeviceObject;
  185. // List of child PDOs that we enumerate
  186. //
  187. LIST_ENTRY ChildPDOs;
  188. // Device Descriptor retrieved from the device
  189. //
  190. PUSB_DEVICE_DESCRIPTOR DeviceDescriptor;
  191. // Configuration Descriptor retrieved from the device
  192. //
  193. PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
  194. // Interface Descriptor contained within above Configuration Descriptor
  195. //
  196. PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
  197. // Serial Number String Descriptor
  198. //
  199. PUSB_STRING_DESCRIPTOR SerialNumber;
  200. // ConfigurationHandle returned from URB_FUNCTION_SELECT_CONFIGURATION
  201. //
  202. USBD_CONFIGURATION_HANDLE ConfigurationHandle;
  203. // Interface info returned from URB_FUNCTION_SELECT_CONFIGURATION
  204. //
  205. PUSBD_INTERFACE_INFORMATION InterfaceInfo;
  206. // Pointers back into InterfaceInfo for Bulk IN, Bulk OUT, and
  207. // Interrupt IN pipes.
  208. //
  209. PUSBD_PIPE_INFORMATION BulkInPipe;
  210. PUSBD_PIPE_INFORMATION BulkOutPipe;
  211. PUSBD_PIPE_INFORMATION InterruptInPipe;
  212. // Initialized to one in AddDevice.
  213. // Incremented by one for each pending request.
  214. // Decremented by one for each pending request.
  215. // Decremented by one in REMOVE_DEVICE.
  216. //
  217. ULONG PendingIoCount;
  218. // Set when PendingIoCount is decremented to zero
  219. //
  220. KEVENT RemoveEvent;
  221. // DriverFlags read from regisry
  222. //
  223. ULONG DriverFlags;
  224. // NonRemovable read from regisry
  225. //
  226. ULONG NonRemovable;
  227. // Various DF_xxxx flags
  228. //
  229. ULONG DeviceFlags;
  230. // Various DHF_xxxx flags
  231. //
  232. ULONG DeviceHackFlags;
  233. // SpinLock which protects DeviceFlags
  234. //
  235. KSPIN_LOCK ExtensionDataSpinLock;
  236. // Current system power state
  237. //
  238. SYSTEM_POWER_STATE SystemPowerState;
  239. // Current device power state
  240. //
  241. DEVICE_POWER_STATE DevicePowerState;
  242. // Current power Irp, set by USBSTOR_FdoSetPower(), used by
  243. // USBSTOR_FdoSetPowerCompletion().
  244. //
  245. PIRP CurrentPowerIrp;
  246. // Set when the DevicePowerState >PowerDeviceD0 Irp is ready to be passed
  247. // down the stack.
  248. //
  249. KEVENT PowerDownEvent;
  250. ULONG SrbTimeout;
  251. PIRP PendingIrp;
  252. KEVENT CancelEvent;
  253. // Work Item used to issue Reset Pipe / Reset Port requests at PASSIVE_LEVEL
  254. //
  255. PIO_WORKITEM IoWorkItem;
  256. // URB used for ADSC Control Transfer and associated Bulk Transfer.
  257. // ADSC requests are serialized through StartIo so no need to protect
  258. // access to this single URB.
  259. //
  260. union
  261. {
  262. struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST ControlUrb;
  263. struct _URB_BULK_OR_INTERRUPT_TRANSFER BulkIntrUrb;
  264. } Urb;
  265. // Original Srb saved here by USBSTOR_StartIo()
  266. //
  267. PSCSI_REQUEST_BLOCK OriginalSrb;
  268. // Original CDB saved here by USBSTOR_TranslateCDB()
  269. //
  270. UCHAR OriginalCDB[16];
  271. union
  272. {
  273. // Fields used only for Control/Bulk/Interrupt devices
  274. //
  275. struct _CONTROL_BULK_INT
  276. {
  277. // Commmand completion interrupt data transferred here
  278. //
  279. USHORT InterruptData;
  280. // CDB for issuing a Request Sense when there is an error
  281. //
  282. UCHAR RequestSenseCDB[12];
  283. // Buffer for receiving Request Sense sense data when the Srb
  284. // doesn't have a sense buffer.
  285. //
  286. SENSE_DATA SenseData;
  287. } Cbi;
  288. // Fields used only for Bulk Only devices
  289. //
  290. struct _BULK_ONLY
  291. {
  292. union
  293. {
  294. // Command Block Wrapper
  295. //
  296. CBW Cbw;
  297. // Command Status Wrapper
  298. //
  299. CSW Csw;
  300. // Workaround for USB 2.0 controller Data Toggle / Babble bug
  301. //
  302. UCHAR MaxPacketSize[512];
  303. } CbwCsw;
  304. // How many times a STALL is seen trying to retrieve CSW
  305. //
  306. ULONG StallCount;
  307. // Srb used by USBSTOR_IssueRequestSense()
  308. //
  309. SCSI_REQUEST_BLOCK InternalSrb;
  310. } BulkOnly;
  311. };
  312. BOOLEAN LastSenseWasReset;
  313. BOOLEAN DeviceIsHighSpeed;
  314. } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
  315. // Device Extension for the PDO we we enumerate as a child of the FDO
  316. // attached on top of the USB enumerated PDO.
  317. //
  318. typedef struct _PDO_DEVICE_EXTENSION
  319. {
  320. // USBSTOR_DO_TYPE_PDO
  321. //
  322. ULONG Type;
  323. // Back pointer to PDO Device Object to which this Device Extension
  324. // is attached.
  325. //
  326. PDEVICE_OBJECT PdoDeviceObject;
  327. // Parent FDO that enumerated us
  328. //
  329. PDEVICE_OBJECT ParentFDO;
  330. // List of child PDOs enumerated from parent FDO
  331. //
  332. LIST_ENTRY ListEntry;
  333. // PnP Device State
  334. //
  335. DEVICE_STATE DeviceState;
  336. // Current system power state
  337. //
  338. SYSTEM_POWER_STATE SystemPowerState;
  339. // Current device power state
  340. //
  341. DEVICE_POWER_STATE DevicePowerState;
  342. // Current power Irp, set by USBSTOR_PdoSetPower(), used by
  343. // USBSTOR_PdoSetPowerCompletion().
  344. //
  345. PIRP CurrentPowerIrp;
  346. BOOLEAN Claimed;
  347. BOOLEAN IsFloppy;
  348. // LUN value which is used in bCBWLUN
  349. //
  350. UCHAR LUN;
  351. // Data returned by an Inquiry command. We are only interested in the
  352. // first 36 bytes, not the whole 96 bytes.
  353. //
  354. UCHAR InquiryDataBuffer[INQUIRYDATABUFFERSIZE];
  355. } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
  356. //*****************************************************************************
  357. //
  358. // F U N C T I O N P R O T O T Y P E S
  359. //
  360. //*****************************************************************************
  361. //
  362. // USBMASS.C
  363. //
  364. NTSTATUS
  365. DriverEntry (
  366. IN PDRIVER_OBJECT DriverObject,
  367. IN PUNICODE_STRING RegistryPath
  368. );
  369. VOID
  370. USBSTOR_Unload (
  371. IN PDRIVER_OBJECT DriverObject
  372. );
  373. NTSTATUS
  374. USBSTOR_AddDevice (
  375. IN PDRIVER_OBJECT DriverObject,
  376. IN PDEVICE_OBJECT PhysicalDeviceObject
  377. );
  378. VOID
  379. USBSTOR_QueryFdoParams (
  380. IN PDEVICE_OBJECT DeviceObject
  381. );
  382. NTSTATUS
  383. USBSTOR_Power (
  384. IN PDEVICE_OBJECT DeviceObject,
  385. IN PIRP Irp
  386. );
  387. NTSTATUS
  388. USBSTOR_FdoSetPower (
  389. IN PDEVICE_OBJECT DeviceObject,
  390. IN PIRP Irp
  391. );
  392. VOID
  393. USBSTOR_FdoSetPowerCompletion(
  394. IN PDEVICE_OBJECT DeviceObject,
  395. IN UCHAR MinorFunction,
  396. IN POWER_STATE PowerState,
  397. IN PVOID Context,
  398. IN PIO_STATUS_BLOCK IoStatus
  399. );
  400. NTSTATUS
  401. USBSTOR_FdoSetPowerD0Completion (
  402. IN PDEVICE_OBJECT DeviceObject,
  403. IN PIRP Irp,
  404. IN PVOID NotUsed
  405. );
  406. NTSTATUS
  407. USBSTOR_PdoSetPower (
  408. IN PDEVICE_OBJECT DeviceObject,
  409. IN PIRP Irp
  410. );
  411. VOID
  412. USBSTOR_PdoSetPowerCompletion(
  413. IN PDEVICE_OBJECT DeviceObject,
  414. IN UCHAR MinorFunction,
  415. IN POWER_STATE PowerState,
  416. IN PVOID Context,
  417. IN PIO_STATUS_BLOCK IoStatus
  418. );
  419. NTSTATUS
  420. USBSTOR_SystemControl (
  421. IN PDEVICE_OBJECT DeviceObject,
  422. IN PIRP Irp
  423. );
  424. NTSTATUS
  425. USBSTOR_Pnp (
  426. IN PDEVICE_OBJECT DeviceObject,
  427. IN PIRP Irp
  428. );
  429. NTSTATUS
  430. USBSTOR_FdoStartDevice (
  431. IN PDEVICE_OBJECT DeviceObject,
  432. IN PIRP Irp
  433. );
  434. NTSTATUS
  435. USBSTOR_GetDescriptors (
  436. IN PDEVICE_OBJECT DeviceObject
  437. );
  438. USBSTOR_GetStringDescriptors (
  439. IN PDEVICE_OBJECT DeviceObject
  440. );
  441. VOID
  442. USBSTOR_AdjustConfigurationDescriptor (
  443. IN PDEVICE_OBJECT DeviceObject,
  444. IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
  445. OUT PUSB_INTERFACE_DESCRIPTOR *InterfaceDesc,
  446. OUT PLONG BulkInIndex,
  447. OUT PLONG BulkOutIndex,
  448. OUT PLONG InterruptInIndex
  449. );
  450. NTSTATUS
  451. USBSTOR_GetPipes (
  452. IN PDEVICE_OBJECT DeviceObject
  453. );
  454. NTSTATUS
  455. USBSTOR_CreateChildPDO (
  456. IN PDEVICE_OBJECT FdoDeviceObject,
  457. IN UCHAR Lun
  458. );
  459. NTSTATUS
  460. USBSTOR_FdoStopDevice (
  461. IN PDEVICE_OBJECT DeviceObject,
  462. IN PIRP Irp
  463. );
  464. NTSTATUS
  465. USBSTOR_FdoRemoveDevice (
  466. IN PDEVICE_OBJECT DeviceObject,
  467. IN PIRP Irp
  468. );
  469. NTSTATUS
  470. USBSTOR_FdoQueryStopRemoveDevice (
  471. IN PDEVICE_OBJECT DeviceObject,
  472. IN PIRP Irp
  473. );
  474. NTSTATUS
  475. USBSTOR_FdoCancelStopRemoveDevice (
  476. IN PDEVICE_OBJECT DeviceObject,
  477. IN PIRP Irp
  478. );
  479. NTSTATUS
  480. USBSTOR_FdoQueryDeviceRelations (
  481. IN PDEVICE_OBJECT DeviceObject,
  482. IN PIRP Irp
  483. );
  484. NTSTATUS
  485. USBSTOR_FdoQueryCapabilities (
  486. IN PDEVICE_OBJECT DeviceObject,
  487. IN PIRP Irp
  488. );
  489. NTSTATUS
  490. USBSTOR_PdoStartDevice (
  491. IN PDEVICE_OBJECT DeviceObject,
  492. IN PIRP Irp
  493. );
  494. NTSTATUS
  495. USBSTOR_PdoRemoveDevice (
  496. IN PDEVICE_OBJECT DeviceObject,
  497. IN PIRP Irp
  498. );
  499. NTSTATUS
  500. USBSTOR_PdoQueryID (
  501. IN PDEVICE_OBJECT DeviceObject,
  502. IN PIRP Irp
  503. );
  504. PCHAR
  505. USBSTOR_PdoDeviceTypeString (
  506. IN PDEVICE_OBJECT DeviceObject
  507. );
  508. PCHAR
  509. USBSTOR_PdoGenericTypeString (
  510. IN PDEVICE_OBJECT DeviceObject
  511. );
  512. VOID
  513. CopyField (
  514. IN PUCHAR Destination,
  515. IN PUCHAR Source,
  516. IN ULONG Count,
  517. IN UCHAR Change
  518. );
  519. NTSTATUS
  520. USBSTOR_StringArrayToMultiSz(
  521. PUNICODE_STRING MultiString,
  522. PCSTR StringArray[]
  523. );
  524. NTSTATUS
  525. USBSTOR_PdoQueryDeviceId (
  526. IN PDEVICE_OBJECT DeviceObject,
  527. OUT PUNICODE_STRING UnicodeString
  528. );
  529. NTSTATUS
  530. USBSTOR_PdoQueryHardwareIds (
  531. IN PDEVICE_OBJECT DeviceObject,
  532. OUT PUNICODE_STRING UnicodeString
  533. );
  534. NTSTATUS
  535. USBSTOR_PdoQueryCompatibleIds (
  536. IN PDEVICE_OBJECT DeviceObject,
  537. OUT PUNICODE_STRING UnicodeString
  538. );
  539. NTSTATUS
  540. USBSTOR_PdoQueryDeviceText (
  541. IN PDEVICE_OBJECT DeviceObject,
  542. IN PIRP Irp
  543. );
  544. NTSTATUS
  545. USBSTOR_PdoBusQueryInstanceId (
  546. IN PDEVICE_OBJECT DeviceObject,
  547. OUT PUNICODE_STRING UnicodeString
  548. );
  549. NTSTATUS
  550. USBSTOR_PdoQueryDeviceRelations (
  551. IN PDEVICE_OBJECT DeviceObject,
  552. IN PIRP Irp
  553. );
  554. NTSTATUS
  555. USBSTOR_PdoQueryCapabilities (
  556. IN PDEVICE_OBJECT DeviceObject,
  557. IN PIRP Irp
  558. );
  559. NTSTATUS
  560. USBSTOR_SyncPassDownIrp (
  561. IN PDEVICE_OBJECT DeviceObject,
  562. IN PIRP Irp
  563. );
  564. NTSTATUS
  565. USBSTOR_SyncCompletionRoutine (
  566. IN PDEVICE_OBJECT DeviceObject,
  567. IN PIRP Irp,
  568. IN PVOID Context
  569. );
  570. NTSTATUS
  571. USBSTOR_SyncSendUsbRequest (
  572. IN PDEVICE_OBJECT DeviceObject,
  573. IN PURB Urb
  574. );
  575. NTSTATUS
  576. USBSTOR_GetDescriptor (
  577. IN PDEVICE_OBJECT DeviceObject,
  578. IN UCHAR Recipient,
  579. IN UCHAR DescriptorType,
  580. IN UCHAR Index,
  581. IN USHORT LanguageId,
  582. IN ULONG RetryCount,
  583. IN ULONG DescriptorLength,
  584. OUT PUCHAR *Descriptor
  585. );
  586. NTSTATUS
  587. USBSTOR_GetMaxLun (
  588. IN PDEVICE_OBJECT DeviceObject,
  589. OUT PUCHAR MaxLun
  590. );
  591. NTSTATUS
  592. USBSTOR_SelectConfiguration (
  593. IN PDEVICE_OBJECT DeviceObject
  594. );
  595. NTSTATUS
  596. USBSTOR_UnConfigure (
  597. IN PDEVICE_OBJECT DeviceObject
  598. );
  599. NTSTATUS
  600. USBSTOR_ResetPipe (
  601. IN PDEVICE_OBJECT DeviceObject,
  602. IN USBD_PIPE_HANDLE Pipe
  603. );
  604. NTSTATUS
  605. USBSTOR_AbortPipe (
  606. IN PDEVICE_OBJECT DeviceObject,
  607. IN USBD_PIPE_HANDLE Pipe
  608. );
  609. //
  610. // OCRW.C
  611. //
  612. NTSTATUS
  613. USBSTOR_Create (
  614. IN PDEVICE_OBJECT DeviceObject,
  615. IN PIRP Irp
  616. );
  617. NTSTATUS
  618. USBSTOR_Close (
  619. IN PDEVICE_OBJECT DeviceObject,
  620. IN PIRP Irp
  621. );
  622. NTSTATUS
  623. USBSTOR_ReadWrite (
  624. IN PDEVICE_OBJECT DeviceObject,
  625. IN PIRP Irp
  626. );
  627. //
  628. // SCSI.C
  629. //
  630. NTSTATUS
  631. USBSTOR_DeviceControl (
  632. IN PDEVICE_OBJECT DeviceObject,
  633. IN PIRP Irp
  634. );
  635. NTSTATUS
  636. USBSTOR_Scsi (
  637. IN PDEVICE_OBJECT DeviceObject,
  638. IN PIRP Irp
  639. );
  640. VOID
  641. USBSTOR_StartIo (
  642. IN PDEVICE_OBJECT DeviceObject,
  643. IN PIRP Irp
  644. );
  645. VOID
  646. USBSTOR_TimerTick (
  647. IN PDEVICE_OBJECT DeviceObject,
  648. IN PVOID NotUsed
  649. );
  650. NTSTATUS
  651. USBSTOR_GetInquiryData (
  652. IN PDEVICE_OBJECT DeviceObject
  653. );
  654. BOOLEAN
  655. USBSTOR_IsFloppyDevice (
  656. PDEVICE_OBJECT DeviceObject
  657. );