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.

865 lines
21 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. ULONG DeviceResetCount;
  313. BOOLEAN LastSenseWasReset;
  314. BOOLEAN DeviceIsHighSpeed;
  315. } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
  316. // Device Extension for the PDO we we enumerate as a child of the FDO
  317. // attached on top of the USB enumerated PDO.
  318. //
  319. typedef struct _PDO_DEVICE_EXTENSION
  320. {
  321. // USBSTOR_DO_TYPE_PDO
  322. //
  323. ULONG Type;
  324. // Back pointer to PDO Device Object to which this Device Extension
  325. // is attached.
  326. //
  327. PDEVICE_OBJECT PdoDeviceObject;
  328. // Parent FDO that enumerated us
  329. //
  330. PDEVICE_OBJECT ParentFDO;
  331. // List of child PDOs enumerated from parent FDO
  332. //
  333. LIST_ENTRY ListEntry;
  334. // PnP Device State
  335. //
  336. DEVICE_STATE DeviceState;
  337. // Current system power state
  338. //
  339. SYSTEM_POWER_STATE SystemPowerState;
  340. // Current device power state
  341. //
  342. DEVICE_POWER_STATE DevicePowerState;
  343. // Current power Irp, set by USBSTOR_PdoSetPower(), used by
  344. // USBSTOR_PdoSetPowerCompletion().
  345. //
  346. PIRP CurrentPowerIrp;
  347. BOOLEAN Claimed;
  348. BOOLEAN IsFloppy;
  349. // LUN value which is used in bCBWLUN
  350. //
  351. UCHAR LUN;
  352. // Data returned by an Inquiry command. We are only interested in the
  353. // first 36 bytes, not the whole 96 bytes.
  354. //
  355. UCHAR InquiryDataBuffer[INQUIRYDATABUFFERSIZE];
  356. } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION;
  357. //*****************************************************************************
  358. //
  359. // F U N C T I O N P R O T O T Y P E S
  360. //
  361. //*****************************************************************************
  362. //
  363. // USBMASS.C
  364. //
  365. NTSTATUS
  366. DriverEntry (
  367. IN PDRIVER_OBJECT DriverObject,
  368. IN PUNICODE_STRING RegistryPath
  369. );
  370. VOID
  371. USBSTOR_Unload (
  372. IN PDRIVER_OBJECT DriverObject
  373. );
  374. NTSTATUS
  375. USBSTOR_AddDevice (
  376. IN PDRIVER_OBJECT DriverObject,
  377. IN PDEVICE_OBJECT PhysicalDeviceObject
  378. );
  379. VOID
  380. USBSTOR_QueryFdoParams (
  381. IN PDEVICE_OBJECT DeviceObject
  382. );
  383. VOID
  384. USBSTOR_QueryGlobalFdoParams (
  385. IN PDEVICE_OBJECT DeviceObject
  386. );
  387. NTSTATUS
  388. USBSTOR_Power (
  389. IN PDEVICE_OBJECT DeviceObject,
  390. IN PIRP Irp
  391. );
  392. NTSTATUS
  393. USBSTOR_FdoSetPower (
  394. IN PDEVICE_OBJECT DeviceObject,
  395. IN PIRP Irp
  396. );
  397. VOID
  398. USBSTOR_FdoSetPowerCompletion(
  399. IN PDEVICE_OBJECT DeviceObject,
  400. IN UCHAR MinorFunction,
  401. IN POWER_STATE PowerState,
  402. IN PVOID Context,
  403. IN PIO_STATUS_BLOCK IoStatus
  404. );
  405. NTSTATUS
  406. USBSTOR_FdoSetPowerD0Completion (
  407. IN PDEVICE_OBJECT DeviceObject,
  408. IN PIRP Irp,
  409. IN PVOID NotUsed
  410. );
  411. NTSTATUS
  412. USBSTOR_PdoSetPower (
  413. IN PDEVICE_OBJECT DeviceObject,
  414. IN PIRP Irp
  415. );
  416. VOID
  417. USBSTOR_PdoSetPowerCompletion(
  418. IN PDEVICE_OBJECT DeviceObject,
  419. IN UCHAR MinorFunction,
  420. IN POWER_STATE PowerState,
  421. IN PVOID Context,
  422. IN PIO_STATUS_BLOCK IoStatus
  423. );
  424. NTSTATUS
  425. USBSTOR_SystemControl (
  426. IN PDEVICE_OBJECT DeviceObject,
  427. IN PIRP Irp
  428. );
  429. NTSTATUS
  430. USBSTOR_Pnp (
  431. IN PDEVICE_OBJECT DeviceObject,
  432. IN PIRP Irp
  433. );
  434. NTSTATUS
  435. USBSTOR_FdoStartDevice (
  436. IN PDEVICE_OBJECT DeviceObject,
  437. IN PIRP Irp
  438. );
  439. NTSTATUS
  440. USBSTOR_GetDescriptors (
  441. IN PDEVICE_OBJECT DeviceObject
  442. );
  443. USBSTOR_GetStringDescriptors (
  444. IN PDEVICE_OBJECT DeviceObject
  445. );
  446. VOID
  447. USBSTOR_AdjustConfigurationDescriptor (
  448. IN PDEVICE_OBJECT DeviceObject,
  449. IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
  450. OUT PUSB_INTERFACE_DESCRIPTOR *InterfaceDesc,
  451. OUT PLONG BulkInIndex,
  452. OUT PLONG BulkOutIndex,
  453. OUT PLONG InterruptInIndex
  454. );
  455. NTSTATUS
  456. USBSTOR_GetPipes (
  457. IN PDEVICE_OBJECT DeviceObject
  458. );
  459. NTSTATUS
  460. USBSTOR_CreateChildPDO (
  461. IN PDEVICE_OBJECT FdoDeviceObject,
  462. IN UCHAR Lun
  463. );
  464. NTSTATUS
  465. USBSTOR_FdoStopDevice (
  466. IN PDEVICE_OBJECT DeviceObject,
  467. IN PIRP Irp
  468. );
  469. NTSTATUS
  470. USBSTOR_FdoRemoveDevice (
  471. IN PDEVICE_OBJECT DeviceObject,
  472. IN PIRP Irp
  473. );
  474. NTSTATUS
  475. USBSTOR_FdoQueryStopRemoveDevice (
  476. IN PDEVICE_OBJECT DeviceObject,
  477. IN PIRP Irp
  478. );
  479. NTSTATUS
  480. USBSTOR_FdoCancelStopRemoveDevice (
  481. IN PDEVICE_OBJECT DeviceObject,
  482. IN PIRP Irp
  483. );
  484. NTSTATUS
  485. USBSTOR_FdoQueryDeviceRelations (
  486. IN PDEVICE_OBJECT DeviceObject,
  487. IN PIRP Irp
  488. );
  489. NTSTATUS
  490. USBSTOR_FdoQueryCapabilities (
  491. IN PDEVICE_OBJECT DeviceObject,
  492. IN PIRP Irp
  493. );
  494. NTSTATUS
  495. USBSTOR_PdoStartDevice (
  496. IN PDEVICE_OBJECT DeviceObject,
  497. IN PIRP Irp
  498. );
  499. NTSTATUS
  500. USBSTOR_PdoRemoveDevice (
  501. IN PDEVICE_OBJECT DeviceObject,
  502. IN PIRP Irp
  503. );
  504. NTSTATUS
  505. USBSTOR_PdoQueryID (
  506. IN PDEVICE_OBJECT DeviceObject,
  507. IN PIRP Irp
  508. );
  509. PCHAR
  510. USBSTOR_PdoDeviceTypeString (
  511. IN PDEVICE_OBJECT DeviceObject
  512. );
  513. PCHAR
  514. USBSTOR_PdoGenericTypeString (
  515. IN PDEVICE_OBJECT DeviceObject
  516. );
  517. VOID
  518. CopyField (
  519. IN PUCHAR Destination,
  520. IN PUCHAR Source,
  521. IN ULONG Count,
  522. IN UCHAR Change
  523. );
  524. NTSTATUS
  525. USBSTOR_StringArrayToMultiSz(
  526. PUNICODE_STRING MultiString,
  527. PCSTR StringArray[]
  528. );
  529. NTSTATUS
  530. USBSTOR_PdoQueryDeviceId (
  531. IN PDEVICE_OBJECT DeviceObject,
  532. OUT PUNICODE_STRING UnicodeString
  533. );
  534. NTSTATUS
  535. USBSTOR_PdoQueryHardwareIds (
  536. IN PDEVICE_OBJECT DeviceObject,
  537. OUT PUNICODE_STRING UnicodeString
  538. );
  539. NTSTATUS
  540. USBSTOR_PdoQueryCompatibleIds (
  541. IN PDEVICE_OBJECT DeviceObject,
  542. OUT PUNICODE_STRING UnicodeString
  543. );
  544. NTSTATUS
  545. USBSTOR_PdoQueryDeviceText (
  546. IN PDEVICE_OBJECT DeviceObject,
  547. IN PIRP Irp
  548. );
  549. NTSTATUS
  550. USBSTOR_PdoBusQueryInstanceId (
  551. IN PDEVICE_OBJECT DeviceObject,
  552. OUT PUNICODE_STRING UnicodeString
  553. );
  554. NTSTATUS
  555. USBSTOR_PdoQueryDeviceRelations (
  556. IN PDEVICE_OBJECT DeviceObject,
  557. IN PIRP Irp
  558. );
  559. NTSTATUS
  560. USBSTOR_PdoQueryCapabilities (
  561. IN PDEVICE_OBJECT DeviceObject,
  562. IN PIRP Irp
  563. );
  564. NTSTATUS
  565. USBSTOR_SyncPassDownIrp (
  566. IN PDEVICE_OBJECT DeviceObject,
  567. IN PIRP Irp
  568. );
  569. NTSTATUS
  570. USBSTOR_SyncCompletionRoutine (
  571. IN PDEVICE_OBJECT DeviceObject,
  572. IN PIRP Irp,
  573. IN PVOID Context
  574. );
  575. NTSTATUS
  576. USBSTOR_SyncSendUsbRequest (
  577. IN PDEVICE_OBJECT DeviceObject,
  578. IN PURB Urb
  579. );
  580. NTSTATUS
  581. USBSTOR_GetDescriptor (
  582. IN PDEVICE_OBJECT DeviceObject,
  583. IN UCHAR Recipient,
  584. IN UCHAR DescriptorType,
  585. IN UCHAR Index,
  586. IN USHORT LanguageId,
  587. IN ULONG RetryCount,
  588. IN ULONG DescriptorLength,
  589. OUT PUCHAR *Descriptor
  590. );
  591. NTSTATUS
  592. USBSTOR_GetMaxLun (
  593. IN PDEVICE_OBJECT DeviceObject,
  594. OUT PUCHAR MaxLun
  595. );
  596. NTSTATUS
  597. USBSTOR_SelectConfiguration (
  598. IN PDEVICE_OBJECT DeviceObject
  599. );
  600. NTSTATUS
  601. USBSTOR_UnConfigure (
  602. IN PDEVICE_OBJECT DeviceObject
  603. );
  604. NTSTATUS
  605. USBSTOR_ResetPipe (
  606. IN PDEVICE_OBJECT DeviceObject,
  607. IN USBD_PIPE_HANDLE Pipe
  608. );
  609. NTSTATUS
  610. USBSTOR_AbortPipe (
  611. IN PDEVICE_OBJECT DeviceObject,
  612. IN USBD_PIPE_HANDLE Pipe
  613. );
  614. //
  615. // OCRW.C
  616. //
  617. NTSTATUS
  618. USBSTOR_Create (
  619. IN PDEVICE_OBJECT DeviceObject,
  620. IN PIRP Irp
  621. );
  622. NTSTATUS
  623. USBSTOR_Close (
  624. IN PDEVICE_OBJECT DeviceObject,
  625. IN PIRP Irp
  626. );
  627. NTSTATUS
  628. USBSTOR_ReadWrite (
  629. IN PDEVICE_OBJECT DeviceObject,
  630. IN PIRP Irp
  631. );
  632. //
  633. // SCSI.C
  634. //
  635. NTSTATUS
  636. USBSTOR_DeviceControl (
  637. IN PDEVICE_OBJECT DeviceObject,
  638. IN PIRP Irp
  639. );
  640. NTSTATUS
  641. USBSTOR_Scsi (
  642. IN PDEVICE_OBJECT DeviceObject,
  643. IN PIRP Irp
  644. );
  645. VOID
  646. USBSTOR_StartIo (
  647. IN PDEVICE_OBJECT DeviceObject,
  648. IN PIRP Irp
  649. );
  650. VOID
  651. USBSTOR_TimerTick (
  652. IN PDEVICE_OBJECT DeviceObject,
  653. IN PVOID NotUsed
  654. );
  655. NTSTATUS
  656. USBSTOR_GetInquiryData (
  657. IN PDEVICE_OBJECT DeviceObject
  658. );
  659. BOOLEAN
  660. USBSTOR_IsFloppyDevice (
  661. PDEVICE_OBJECT DeviceObject
  662. );