ReactOS  0.4.15-dev-3712-gf1ad684
srb.h
Go to the documentation of this file.
1 /*
2  Module Name:
3 
4  srb.h
5 
6  Abstract:
7 
8  This file defines the interface between SCSI mini-port drivers and the
9  SCSI port driver. It is also used by SCSI class drivers to talk to the
10  SCSI port driver.
11  w2k-related definitions are added by Alter from w2k/xp DDK
12  */
13 
14 #ifndef _NTSRB_
15 #define _NTSRB_
16 
17 #pragma pack(push, 8)
18 
19 // Define SCSI maximum configuration parameters.
20 
21 #define SCSI_MAXIMUM_LOGICAL_UNITS 8
22 #define SCSI_MAXIMUM_TARGETS_PER_BUS 128
23 #define SCSI_MAXIMUM_LUNS_PER_TARGET 255
24 #define SCSI_MAXIMUM_BUSES 8
25 #define SCSI_MINIMUM_PHYSICAL_BREAKS 16
26 #define SCSI_MAXIMUM_PHYSICAL_BREAKS 255
27 
28 // This constant is for backward compatibility.
29 // This use to be the maximum number of targets supported.
30 
31 #define SCSI_MAXIMUM_TARGETS 8
32 // begin_ntminitape
33 #define MAXIMUM_CDB_SIZE 12
34 // end_ntminitape
35 
36 #ifndef USER_MODE
37 
39 
40 typedef struct _ACCESS_RANGE {
45 
46 #ifdef __REACTOS__
47 #pragma pack(push, 4)
48 #endif
49 
50 //
51 // Configuration information structure. Contains the information necessary
52 // to initialize the adapter. NOTE: This structure's must be a multiple of
53 // quadwords.
54 //
55 
57  ULONG Length; // Length of port configuation information strucuture.
58  ULONG SystemIoBusNumber; // IO bus number (0 for machines that have only 1 IO bus
59  INTERFACE_TYPE AdapterInterfaceType; // EISA, MCA or ISA
60  ULONG BusInterruptLevel; // Interrupt request level for device
61  // Bus interrupt vector used with hardware buses which use as vector as
62  // well as level, such as internal buses.
64  KINTERRUPT_MODE InterruptMode; // Interrupt mode (level-sensitive or edge-triggered)
65 
66  ULONG MaximumTransferLength; // Max bytes that can be transferred in a single SRB
67  ULONG NumberOfPhysicalBreaks; // Number of contiguous blocks of physical memory
68  ULONG DmaChannel; // DMA channel for devices using system DMA
72  ULONG AlignmentMask; // Alignment masked for the adapter for data transfers.
73  ULONG NumberOfAccessRanges; // Number of allocated access range elements.
74  ACCESS_RANGE (*AccessRanges)[]; // Pointer to array of access range elements.
76  UCHAR NumberOfBuses; // Number of SCSI buses attached to the adapter.
77  CCHAR InitiatorBusId[8]; // SCSI bus ID for adapter
78  BOOLEAN ScatterGather; // Indicates that the adapter does scatter/gather
79  BOOLEAN Master; // Indicates that the adapter is a bus master
80  BOOLEAN CachesData; // Host caches data or state.
81  BOOLEAN AdapterScansDown; // Host adapter scans down for bios devices.
82  BOOLEAN AtdiskPrimaryClaimed; // Primary at disk address (0x1F0) claimed.
83  BOOLEAN AtdiskSecondaryClaimed; // Secondary at disk address (0x170) claimed.
84  BOOLEAN Dma32BitAddresses; // The master uses 32-bit DMA addresses.
85  BOOLEAN DemandMode; // Use Demand Mode DMA rather than Single Request.
86  BOOLEAN MapBuffers; // Data buffers must be mapped into virtual address space.
87  BOOLEAN NeedPhysicalAddresses; // We need to tranlate virtual to physical addresses.
88  BOOLEAN TaggedQueuing; // Supports tagged queuing
89  BOOLEAN AutoRequestSense; // Supports auto request sense.
90  BOOLEAN MultipleRequestPerLu; // Supports multiple requests per logical unit.
91  BOOLEAN ReceiveEvent; // Support receive event function.
92  BOOLEAN RealModeInitialized; // Indicates the real-mode driver has initialized the card.
93 
94  BOOLEAN BufferAccessScsiPortControlled; // Indicate that the miniport will not touch
95  // the data buffers directly.
96  UCHAR MaximumNumberOfTargets; // Indicator for wide scsi.
97  UCHAR ReservedUchars[2]; // Ensure quadword alignment.
98  ULONG SlotNumber; // Adapter slot number
99  ULONG BusInterruptLevel2; // Interrupt information for a second IRQ.
102  ULONG DmaChannel2; // DMA information for a second channel.
106 
108 
110  // Fields added to allow for the miniport
111  // to update these sizes based on requirements
112  // for large transfers ( > 64K);
117 
119  // Used to determine whether the system and/or the miniport support
120  // 64-bit physical addresses. See SCSI_DMA64_* flags below.
122  // Indicates that the miniport can accept a SRB_FUNCTION_RESET_DEVICE
123  // to clear all requests to a particular LUN.
125  // Indicates that the miniport can support more than 8 logical units per
126  // target (maximum LUN number is one less than this field).
128  // Supports WMI?
131 
132 #ifdef __REACTOS__
133 #pragma pack(pop)
134 #endif
135 
141 
142 //
143 // Version control for ConfigInfo structure.
144 //
145 
146 #define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION)
147 
148 //
149 // Flags for controlling 64-bit DMA use (PORT_CONFIGURATION_INFORMATION field
150 // Dma64BitAddresses)
151 //
152 
153 //
154 // Set by scsiport on entering HwFindAdapter if the system can support 64-bit
155 // physical addresses. The miniport can use this information before calling
156 // ScsiPortGetUncachedExtension to modify the DeviceExtensionSize,
157 // SpecificLuExtensionSize & SrbExtensionSize fields to account for the extra
158 // size of the scatter gather list.
159 //
160 
161 #define SCSI_DMA64_SYSTEM_SUPPORTED 0x80
162 
163 //
164 // Set by the miniport before calling ScsiPortGetUncachedExtension to indicate
165 // that scsiport should provide it with 64-bit physical addresses. If the
166 // system does not support 64-bit PA's then this bit will be ignored.
167 //
168 
169 #define SCSI_DMA64_MINIPORT_SUPPORTED 0x01
170 
171 
172 //
173 // Command type (and parameter) definition(s) for AdapterControl requests.
174 //
175 
185 
186 //
187 // Adapter control status values
188 //
189 
194 
195 //
196 // Parameters for Adapter Control Functions:
197 //
198 
199 //
200 // ScsiQuerySupportedControlTypes:
201 //
202 
203 #ifdef _MSC_VER
204 #pragma warning(disable:4200)
205 #endif
207 
208  //
209  // Specifies the number of entries in the adapter control type list.
210  //
211 
213 
214  //
215  // The miniport will set TRUE for each control type it supports.
216  // The number of entries in this array is defined by MaxAdapterControlType
217  // - the miniport must not attempt to set any AC types beyond the maximum
218  // value specified.
219  //
220 
222 
224 #ifdef _MSC_VER
225 #pragma warning(disable:4200)
226 #endif
227 
228 //
229 // Uninitialized flag value.
230 //
231 
232 #define SP_UNINITIALIZED_VALUE ((ULONG) ~0)
233 #define SP_UNTAGGED ((UCHAR) ~0)
234 
235 //
236 // Set asynchronous events.
237 //
238 
239 #define SRBEV_BUS_RESET 0x0001
240 #define SRBEV_SCSI_ASYNC_NOTIFICATION 0x0002
241 
242 // begin_ntminitape
243 
244 //
245 // SCSI I/O Request Block
246 //
247 
248 typedef struct _SCSI_REQUEST_BLOCK {
249  USHORT Length; // offset 0
250  UCHAR Function; // offset 2
251  UCHAR SrbStatus; // offset 3
252  UCHAR ScsiStatus; // offset 4
253  UCHAR PathId; // offset 5
254  UCHAR TargetId; // offset 6
255  UCHAR Lun; // offset 7
256  UCHAR QueueTag; // offset 8
257  UCHAR QueueAction; // offset 9
258  UCHAR CdbLength; // offset a
260  ULONG SrbFlags; // offset c
261  ULONG DataTransferLength; // offset 10
262  ULONG TimeOutValue; // offset 14
263  PVOID DataBuffer; // offset 18
264  PVOID SenseInfoBuffer; // offset 1c
265  struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20
266  PVOID OriginalRequest; // offset 24
267  PVOID SrbExtension; // offset 28
268  union {
269  ULONG InternalStatus; // offset 2c
270  ULONG QueueSortKey; // offset 2c
271  };
272 
273 #if defined(_WIN64)
274  // Force PVOID alignment of Cdb
275  ULONG Reserved;
276 
277 #endif
278 
279  UCHAR Cdb[16]; // offset 30
281 
282 #define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK)
283 
284 //
285 // SCSI I/O Request Block for WMI Requests
286 //
287 
288 typedef struct _SCSI_WMI_REQUEST_BLOCK {
290  UCHAR Function; // SRB_FUNCTION_WMI
293  UCHAR PathId; // If SRB_WMI_FLAGS_ADAPTER_REQUEST is set in
294  UCHAR TargetId; // WMIFlags then PathId, TargetId and Lun are
295  UCHAR Lun; // reserved fields.
310 
311 //
312 // SRB Functions
313 //
314 
315 #define SRB_FUNCTION_EXECUTE_SCSI 0x00
316 #define SRB_FUNCTION_CLAIM_DEVICE 0x01
317 #define SRB_FUNCTION_IO_CONTROL 0x02
318 #define SRB_FUNCTION_RECEIVE_EVENT 0x03
319 #define SRB_FUNCTION_RELEASE_QUEUE 0x04
320 #define SRB_FUNCTION_ATTACH_DEVICE 0x05
321 #define SRB_FUNCTION_RELEASE_DEVICE 0x06
322 #define SRB_FUNCTION_SHUTDOWN 0x07
323 #define SRB_FUNCTION_FLUSH 0x08
324 #define SRB_FUNCTION_ABORT_COMMAND 0x10
325 #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
326 #define SRB_FUNCTION_RESET_BUS 0x12
327 #define SRB_FUNCTION_RESET_DEVICE 0x13
328 #define SRB_FUNCTION_TERMINATE_IO 0x14
329 #define SRB_FUNCTION_FLUSH_QUEUE 0x15
330 #define SRB_FUNCTION_REMOVE_DEVICE 0x16
331 #define SRB_FUNCTION_WMI 0x17
332 #define SRB_FUNCTION_LOCK_QUEUE 0x18
333 #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
334 #define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20
335 
336 //
337 // SRB Status
338 //
339 
340 #define SRB_STATUS_PENDING 0x00
341 #define SRB_STATUS_SUCCESS 0x01
342 #define SRB_STATUS_ABORTED 0x02
343 #define SRB_STATUS_ABORT_FAILED 0x03
344 #define SRB_STATUS_ERROR 0x04
345 #define SRB_STATUS_BUSY 0x05
346 #define SRB_STATUS_INVALID_REQUEST 0x06
347 #define SRB_STATUS_INVALID_PATH_ID 0x07
348 #define SRB_STATUS_NO_DEVICE 0x08
349 #define SRB_STATUS_TIMEOUT 0x09
350 #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
351 #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
352 #define SRB_STATUS_MESSAGE_REJECTED 0x0D
353 #define SRB_STATUS_BUS_RESET 0x0E
354 #define SRB_STATUS_PARITY_ERROR 0x0F
355 #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
356 #define SRB_STATUS_NO_HBA 0x11
357 #define SRB_STATUS_DATA_OVERRUN 0x12
358 #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
359 #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
360 #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
361 #define SRB_STATUS_REQUEST_FLUSHED 0x16
362 #define SRB_STATUS_INVALID_LUN 0x20
363 #define SRB_STATUS_INVALID_TARGET_ID 0x21
364 #define SRB_STATUS_BAD_FUNCTION 0x22
365 #define SRB_STATUS_ERROR_RECOVERY 0x23
366 #define SRB_STATUS_NOT_POWERED 0x24
367 
368 //
369 // This value is used by the port driver to indicate that a non-scsi-related
370 // error occured. Miniports must never return this status.
371 //
372 
373 #define SRB_STATUS_INTERNAL_ERROR 0x30
374 
375 //
376 // Srb status values 0x38 through 0x3f are reserved for internal port driver
377 // use.
378 //
379 
380 
381 
382 //
383 // SRB Status Masks
384 //
385 
386 #define SRB_STATUS_QUEUE_FROZEN 0x40
387 #define SRB_STATUS_AUTOSENSE_VALID 0x80
388 
389 #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
390 
391 //
392 // SRB Flag Bits
393 //
394 
395 #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
396 #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
397 #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
398 #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
399 #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
400 #define SRB_FLAGS_DATA_IN 0x00000040
401 #define SRB_FLAGS_DATA_OUT 0x00000080
402 #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
403 #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
404 #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
405 #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
406 #define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400
407 #define SRB_FLAGS_IS_ACTIVE 0x00010000
408 #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
409 #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
410 #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
411 
412 #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
413 #define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000
414 #define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000
415 #define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000
416 
417 #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
418 #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
419 //
420 // Queue Action
421 //
422 
423 #define SRB_SIMPLE_TAG_REQUEST 0x20
424 #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
425 #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
426 
427 #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
428 
429 // end_ntminitape
430 
431 //
432 // SCSI Adapter Dependent Routines
433 //
434 
435 typedef
436 BOOLEAN
438  IN PVOID DeviceExtension
439  );
440 
441 typedef
442 BOOLEAN
444  IN PVOID DeviceExtension,
446  );
447 
448 typedef
449 BOOLEAN
451  IN PVOID DeviceExtension
452  );
453 
454 typedef
455 VOID
457  IN PVOID DeviceExtension
458  );
459 
460 typedef
461 VOID
463  IN PVOID DeviceExtension
464  );
465 
466 typedef
467 ULONG
469  IN PVOID DeviceExtension,
472  IN PCHAR ArgumentString,
474  OUT PBOOLEAN Again
475  );
476 
477 typedef
478 BOOLEAN
480  IN PVOID DeviceExtension,
481  IN ULONG PathId
482  );
483 
484 typedef
485 BOOLEAN
487  IN PVOID DeviceExtension,
488  IN PVOID Context,
490  );
491 
492 typedef
495  IN PVOID DeviceExtension,
496  IN SCSI_ADAPTER_CONTROL_TYPE ControlType,
498  );
499 
500 //
501 // Port driver error codes
502 //
503 
504 #define SP_BUS_PARITY_ERROR 0x0001
505 #define SP_UNEXPECTED_DISCONNECT 0x0002
506 #define SP_INVALID_RESELECTION 0x0003
507 #define SP_BUS_TIME_OUT 0x0004
508 #define SP_PROTOCOL_ERROR 0x0005
509 #define SP_INTERNAL_ADAPTER_ERROR 0x0006
510 #define SP_REQUEST_TIMEOUT 0x0007
511 #define SP_IRQ_NOT_RESPONDING 0x0008
512 #define SP_BAD_FW_WARNING 0x0009
513 #define SP_BAD_FW_ERROR 0x000a
514 #define SP_LOST_WMI_MINIPORT_REQUEST 0x000b
515 
516 
517 //
518 // Return values for SCSI_HW_FIND_ADAPTER.
519 //
520 
521 #define SP_RETURN_NOT_FOUND 0
522 #define SP_RETURN_FOUND 1
523 #define SP_RETURN_ERROR 2
524 #define SP_RETURN_BAD_CONFIG 3
525 
526 //
527 // Notification Event Types
528 //
529 
538  BusChangeDetected, /* New */
542 
543 //
544 // Structure passed between miniport initialization
545 // and SCSI port initialization
546 //
547 
548 typedef struct _HW_INITIALIZATION_DATA {
549 
551  // Adapter interface type:
552  //
553  // Internal
554  // Isa
555  // Eisa
556  // MicroChannel
557  // TurboChannel
558  // PCIBus
559  // VMEBus
560  // NuBus
561  // PCMCIABus
562  // CBus
563  // MPIBus
564  // MPSABus
566  // Miniport driver routines
579 
580  BOOLEAN MapBuffers; // Data buffers must be mapped into virtual address space.
581  BOOLEAN NeedPhysicalAddresses; // We need to tranlate virtual to physical addresses.
582  BOOLEAN TaggedQueuing; // Supports tagged queuing
583  BOOLEAN AutoRequestSense; // Supports auto request sense.
584  BOOLEAN MultipleRequestPerLu; // Supports multiple requests per logical unit.
585  BOOLEAN ReceiveEvent; // Support receive event function.
586  USHORT VendorIdLength; // Vendor identification length
587  PVOID VendorId; // Vendor identification
588  USHORT ReservedUshort; // Pad for alignment and future use.
589  USHORT DeviceIdLength; // Device identification length
590  PVOID DeviceId; // Device identification
591 
593 
595  // Stop adapter routine.
597 
599 
604 
605 // begin_ntminitape
606 
607 #ifndef _NTDDK_
608 #define SCSIPORT_API DECLSPEC_IMPORT
609 #else
610 #define SCSIPORT_API
611 #endif
612 
613 // end_ntminitape
614 
615 //
616 // Port driver routines called by miniport driver
617 //
618 
620 ULONG NTAPI
626  );
627 
629 VOID NTAPI
631  IN PVOID HwDeviceExtension,
632  IN PVOID MappedAddress
633  );
634 
636 ULONG NTAPI
638  IN PVOID DeviceExtension,
639  IN ULONG BusDataType,
640  IN ULONG SystemIoBusNumber,
642  IN PVOID Buffer,
643  IN ULONG Length
644  );
645 
647 ULONG NTAPI
649  IN PVOID DeviceExtension,
650  IN ULONG BusDataType,
651  IN ULONG SystemIoBusNumber,
653  IN PVOID Buffer,
654  IN ULONG Offset,
655  IN ULONG Length
656  );
657 
659 PVOID NTAPI
661  IN PVOID HwDeviceExtension,
663  IN ULONG SystemIoBusNumber,
664  IN SCSI_PHYSICAL_ADDRESS IoAddress,
666  IN BOOLEAN InIoSpace
667  );
668 
670 PVOID NTAPI
672  IN PVOID HwDeviceExtension,
673  IN UCHAR PathId,
674  IN UCHAR TargetId,
675  IN UCHAR Lun
676  );
677 
681  IN PVOID DeviceExtension,
682  IN UCHAR PathId,
683  IN UCHAR TargetId,
684  IN UCHAR Lun,
685  IN LONG QueueTag
686  );
687 
691  IN PVOID HwDeviceExtension,
694  OUT ULONG *Length
695  );
696 
698 PVOID NTAPI
700  IN PVOID HwDeviceExtension,
702  );
703 
705 PVOID NTAPI
707  IN PVOID HwDeviceExtension,
710  );
711 
713 VOID NTAPI
715  IN PVOID DeviceExtension
716  );
717 
719 VOID NTAPI
721  IN PVOID HwDeviceExtension,
723  IN PVOID LogicalAddress,
724  IN ULONG Length
725  );
726 
731  IN PVOID HwDeviceExtension,
732  ...
733  );
734 
736 VOID NTAPI
738  IN PVOID HwDeviceExtension,
740  IN UCHAR PathId,
741  IN UCHAR TargetId,
742  IN UCHAR Lun,
744  IN ULONG UniqueId
745  );
746 
748 VOID NTAPI
750  IN PVOID HwDeviceExtension,
751  IN UCHAR PathId,
752  IN UCHAR TargetId,
753  IN UCHAR Lun,
754  IN UCHAR SrbStatus
755  );
756 
758 VOID NTAPI
762  IN ULONG Length
763  );
764 
766 UCHAR NTAPI
768  IN PUCHAR Port
769  );
770 
774  IN PUSHORT Port
775  );
776 
778 ULONG NTAPI
780  IN PULONG Port
781  );
782 
784 VOID NTAPI
786  IN PUCHAR Port,
787  IN PUCHAR Buffer,
788  IN ULONG Count
789  );
790 
792 VOID NTAPI
794  IN PUSHORT Port,
795  IN PUSHORT Buffer,
796  IN ULONG Count
797  );
798 
800 VOID NTAPI
802  IN PULONG Port,
803  IN PULONG Buffer,
804  IN ULONG Count
805  );
806 
808 UCHAR NTAPI
810  IN PUCHAR Register
811  );
812 
816  IN PUSHORT Register
817  );
818 
820 ULONG NTAPI
822  IN PULONG Register
823  );
824 
826 VOID NTAPI
828  IN PUCHAR Register,
829  IN PUCHAR Buffer,
830  IN ULONG Count
831  );
832 
834 VOID NTAPI
836  IN PUSHORT Register,
837  IN PUSHORT Buffer,
838  IN ULONG Count
839  );
840 
842 VOID NTAPI
844  IN PULONG Register,
845  IN PULONG Buffer,
846  IN ULONG Count
847  );
848 
850 VOID NTAPI
852  IN ULONG Delay
853  );
854 
856 VOID NTAPI
858  IN PUCHAR Port,
859  IN UCHAR Value
860  );
861 
863 VOID NTAPI
865  IN PUSHORT Port,
866  IN USHORT Value
867  );
868 
870 VOID NTAPI
872  IN PULONG Port,
873  IN ULONG Value
874  );
875 
877 VOID NTAPI
879  IN PUCHAR Port,
880  IN PUCHAR Buffer,
881  IN ULONG Count
882  );
883 
885 VOID NTAPI
887  IN PUSHORT Port,
888  IN PUSHORT Buffer,
889  IN ULONG Count
890  );
891 
893 VOID NTAPI
895  IN PULONG Port,
896  IN PULONG Buffer,
897  IN ULONG Count
898  );
899 
901 VOID NTAPI
903  IN PUCHAR Register,
904  IN UCHAR Value
905  );
906 
908 VOID NTAPI
910  IN PUSHORT Register,
911  IN USHORT Value
912  );
913 
915 VOID NTAPI
917  IN PULONG Register,
918  IN ULONG Value
919  );
920 
922 VOID NTAPI
924  IN PUCHAR Register,
925  IN PUCHAR Buffer,
926  IN ULONG Count
927  );
928 
930 VOID NTAPI
932  IN PUSHORT Register,
933  IN PUSHORT Buffer,
934  IN ULONG Count
935  );
936 
938 VOID NTAPI
940  IN PULONG Register,
941  IN PULONG Buffer,
942  IN ULONG Count
943  );
944 
948  ULONG UlongAddress
949  );
950 
952 ULONG NTAPI
955  );
956 
957 #define ScsiPortConvertPhysicalAddressToUlong(Address) ((Address).LowPart)
958 
962  IN PVOID HwDeviceExtension,
964  IN ULONG SystemIoBusNumber,
965  IN SCSI_PHYSICAL_ADDRESS IoAddress,
967  IN BOOLEAN InIoSpace
968  );
969 
970 // begin_ntminitape
971 
975  ULONG DebugPrintLevel,
976  PCCHAR DebugMessage,
977  ...
978  );
979 
980 // end_ntminitape
981 
982 #endif //USER_MODE
983 
984 #pragma pack(pop)
985 
986 #endif //
SCSIPORT_API UCHAR NTAPI ScsiPortReadRegisterUchar(IN PUCHAR Register)
Definition: scsiport.c:1441
struct _HW_INITIALIZATION_DATA_COMMON HW_INITIALIZATION_DATA_COMMON
struct _PORT_CONFIGURATION_INFORMATION_NT * PPORT_CONFIGURATION_INFORMATION_NT
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:65
signed char * PCHAR
Definition: retypes.h:7
PHW_ADAPTER_STATE HwAdapterState
Definition: srb.h:573
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUshort(IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
Definition: scsiport.c:1588
_Must_inspect_result_ _In_ PVOID Argument2
Definition: srb.h:896
CPPORT Port[4]
Definition: headless.c:35
SCSIPORT_API VOID NTAPI ScsiPortLogError(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb OPTIONAL, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN ULONG ErrorCode, IN ULONG UniqueId)
Definition: scsiport.c:1291
#define IN
Definition: typedefs.h:39
SCSIPORT_API VOID NTAPI ScsiPortWritePortUlong(IN PULONG Port, IN ULONG Value)
Definition: scsiport.c:1548
struct _ACCESS_RANGE ACCESS_RANGE
BOOLEAN BufferAccessScsiPortControlled
Definition: srb.h:94
INTERFACE_TYPE AdapterInterfaceType
Definition: srb.h:59
struct _SCSI_WMI_REQUEST_BLOCK SCSI_WMI_REQUEST_BLOCK
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ULONG SrbFlags
Definition: srb.h:260
PVOID SrbExtension
Definition: srb.h:267
enum _INTERFACE_TYPE INTERFACE_TYPE
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1310
struct _PORT_CONFIGURATION_INFORMATION_2K * PPORT_CONFIGURATION_INFORMATION_2K
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:696
PVOID OriginalRequest
Definition: srb.h:266
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Definition: wdfio.h:863
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
UCHAR Cdb[16]
Definition: srb.h:279
SCSIPORT_API ULONG NTAPI ScsiPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN struct _HW_INITIALIZATION_DATA *HwInitializationData, IN PVOID HwContext)
Definition: scsiport.c:836
enum _SCSI_ADAPTER_CONTROL_TYPE * PSCSI_ADAPTER_CONTROL_TYPE
enum _SCSI_ADAPTER_CONTROL_STATUS SCSI_ADAPTER_CONTROL_STATUS
#define __cdecl
Definition: accygwin.h:79
enum _SCSI_NOTIFICATION_TYPE SCSI_NOTIFICATION_TYPE
SCSIPORT_API PVOID NTAPI ScsiPortGetVirtualAddress(IN PVOID HwDeviceExtension, IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
Definition: scsiport.c:814
struct _SCSI_REQUEST_BLOCK * PSCSI_REQUEST_BLOCK
SCSIPORT_API ULONG NTAPI ScsiPortGetBusData(IN PVOID DeviceExtension, IN ULONG BusDataType, IN ULONG SystemIoBusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Length)
Definition: scsiport.c:557
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:156
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR PathId
Definition: classpnp.h:1310
BOOLEAN(NTAPI * PHW_RESET_BUS)(IN PVOID DeviceExtension, IN ULONG PathId)
Definition: srb.h:479
SCSIPORT_API PVOID NTAPI ScsiPortGetLogicalUnit(IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun)
Definition: scsiport.c:602
enum _SCSI_NOTIFICATION_TYPE * PSCSI_NOTIFICATION_TYPE
PVOID DataBuffer
Definition: srb.h:263
PVOID OriginalRequest
Definition: srb.h:305
_SCSI_NOTIFICATION_TYPE
Definition: srb.h:530
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1310
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG DataTransferLength
Definition: srb.h:261
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUchar(IN PUCHAR Register, IN UCHAR Value)
Definition: scsiport.c:1599
#define ScsiPortConvertPhysicalAddressToUlong(Address)
Definition: srb.h:957
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUchar(IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
Definition: scsiport.c:1509
ULONG HwInitializationDataSize
Definition: srb.h:550
#define ReadBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:339
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:897
struct _HW_INITIALIZATION_DATA HW_INITIALIZATION_DATA
ULONG DeviceExtensionSize
Definition: srb.h:574
enum _DMA_WIDTH DMA_WIDTH
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUshort(IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
Definition: scsiport.c:1430
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PVOID VirtualAddress, OUT ULONG *Length)
Definition: scsiport.c:615
UCHAR CdbLength
Definition: srb.h:258
PHW_DMA_STARTED HwDmaStarted
Definition: srb.h:572
BOOLEAN MultipleRequestPerLu
Definition: srb.h:584
PHW_FIND_ADAPTER HwFindAdapter
Definition: srb.h:570
SCSIPORT_API VOID NTAPI ScsiPortMoveMemory(IN PVOID WriteBuffer, IN PVOID ReadBuffer, IN ULONG Length)
Definition: scsiport.c:1306
USHORT DeviceIdLength
Definition: srb.h:589
SCSIPORT_API VOID NTAPI ScsiPortWritePortUshort(IN PUSHORT Port, IN USHORT Value)
Definition: scsiport.c:1557
ACCESS_RANGE(* AccessRanges)[]
Definition: srb.h:74
ULONG SpecificLuExtensionSize
Definition: srb.h:575
struct _SCSI_REQUEST_BLOCK * NextSrb
Definition: srb.h:265
UCHAR QueueAction
Definition: srb.h:257
PHW_RESET_BUS HwResetBus
Definition: srb.h:571
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUlong(IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
Definition: stubs.c:74
SCSIPORT_API PSCSI_REQUEST_BLOCK NTAPI ScsiPortGetSrb(IN PVOID DeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN LONG QueueTag)
Definition: scsiport.c:651
ULONG TimeOutValue
Definition: srb.h:262
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUlong(IN PULONG Register, IN ULONG Value)
Definition: scsiport.c:1608
UCHAR SrbStatus
Definition: srb.h:251
PORT_CONFIGURATION_INFORMATION_NT nt4
Definition: srb.h:138
struct _PORT_CONFIGURATION_INFORMATION_NT PORT_CONFIGURATION_INFORMATION_NT
BOOLEAN(NTAPI * PHW_ADAPTER_STATE)(IN PVOID DeviceExtension, IN PVOID Context, IN BOOLEAN SaveState)
Definition: srb.h:486
SCSIPORT_API ULONG NTAPI ScsiPortReadPortUlong(IN PULONG Port)
Definition: scsiport.c:1392
BOOLEAN AutoRequestSense
Definition: srb.h:583
BOOLEAN TaggedQueuing
Definition: srb.h:582
OUT BOOLEAN SupportedTypeList[0]
Definition: srb.h:221
_In_ WDF_SPECIAL_FILE_TYPE NotificationType
Definition: wdfdevice.h:1024
SCSIPORT_API BOOLEAN NTAPI ScsiPortValidateRange(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
Definition: scsiport.c:1489
HW_INITIALIZATION_DATA_2K w2k
Definition: srb.h:602
#define SCSIPORT_API
Definition: srb.h:608
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUlong(IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1577
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress(ULONG UlongAddress)
BOOLEAN NeedPhysicalAddresses
Definition: srb.h:581
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
BOOLEAN(NTAPI * PHW_INITIALIZE)(IN PVOID DeviceExtension)
Definition: srb.h:437
long LONG
Definition: pedump.c:60
struct _HW_INITIALIZATION_DATA_COMMON * PHW_INITIALIZATION_DATA_COMMON
UCHAR WMISubFunction
Definition: srb.h:292
PHW_INTERRUPT HwInterrupt
Definition: srb.h:569
SCSIPORT_API ULONG NTAPI ScsiPortReadRegisterUlong(IN PULONG Register)
Definition: scsiport.c:1449
UCHAR ScsiStatus
Definition: srb.h:252
USHORT VendorIdLength
Definition: srb.h:586
SCSIPORT_API VOID NTAPI ScsiPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
Definition: scsiport.c:1539
ULONG DataTransferLength
Definition: srb.h:300
USHORT ReservedUshort
Definition: srb.h:588
unsigned char BOOLEAN
PHW_STARTIO HwStartIo
Definition: srb.h:568
enum _KINTERRUPT_MODE KINTERRUPT_MODE
static WCHAR Address[46]
Definition: ping.c:68
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUshort(IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
Definition: stubs.c:64
PHW_ADAPTER_CONTROL HwAdapterControl
Definition: srb.h:596
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
SCSIPORT_API USHORT NTAPI ScsiPortReadPortUshort(IN PUSHORT Port)
Definition: scsiport.c:1400
KINTERRUPT_MODE InterruptMode2
Definition: srb.h:101
Definition: bufpool.h:45
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
UCHAR QueueTag
Definition: srb.h:256
UCHAR TargetId
Definition: srb.h:254
PORT_CONFIGURATION_INFORMATION_2K w2k
Definition: srb.h:139
UCHAR Reserved2[2]
Definition: srb.h:298
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
KINTERRUPT_MODE InterruptMode
Definition: srb.h:64
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUchar(IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
Definition: scsiport.c:1408
PORT_CONFIGURATION_INFORMATION comm
Definition: srb.h:137
int Count
Definition: noreturn.cpp:7
SCSIPORT_API VOID NTAPI ScsiPortCompleteRequest(IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN UCHAR SrbStatus)
Definition: scsiport.c:506
struct _SCSI_WMI_REQUEST_BLOCK * PSCSI_WMI_REQUEST_BLOCK
BOOLEAN ReceiveEvent
Definition: srb.h:585
char CCHAR
Definition: typedefs.h:51
struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST * PSCSI_SUPPORTED_CONTROL_TYPE_LIST
SCSI_ADAPTER_CONTROL_STATUS(NTAPI * PHW_ADAPTER_CONTROL)(IN PVOID DeviceExtension, IN SCSI_ADAPTER_CONTROL_TYPE ControlType, IN PVOID Parameters)
Definition: srb.h:494
struct _ACCESS_RANGE * PACCESS_RANGE
UCHAR Function
Definition: srb.h:250
BOOLEAN(NTAPI * PHW_STARTIO)(IN PVOID DeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)
Definition: srb.h:443
BOOLEAN AtdiskSecondaryClaimed
Definition: srb.h:83
_SCSI_ADAPTER_CONTROL_TYPE
Definition: srb.h:176
USHORT Length
Definition: srb.h:249
struct _SCSI_REQUEST_BLOCK SCSI_REQUEST_BLOCK
SCSI_PHYSICAL_ADDRESS RangeStart
Definition: srb.h:41
SCSIPORT_API ULONG NTAPI ScsiPortSetBusDataByOffset(IN PVOID DeviceExtension, IN ULONG BusDataType, IN ULONG SystemIoBusNumber, IN ULONG SlotNumber, IN PVOID Buffer, IN ULONG Offset, IN ULONG Length)
Definition: scsiport.c:1465
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1098
SCSIPORT_API VOID NTAPI ScsiPortReadPortBufferUchar(IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
Definition: stubs.c:54
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _PORT_CONFIGURATION_INFORMATION PORT_CONFIGURATION_INFORMATION
BOOLEAN RangeInMemory
Definition: srb.h:43
char * PBOOLEAN
Definition: retypes.h:11
PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS
Definition: srb.h:38
#define VOID
Definition: acefi.h:82
ULONG InternalStatus
Definition: srb.h:269
struct _HW_INITIALIZATION_DATA * PHW_INITIALIZATION_DATA
ULONG NumberOfAccessRanges
Definition: srb.h:577
#define SaveState(State)
enum _DMA_SPEED DMA_SPEED
SCSIPORT_API PVOID NTAPI ScsiPortGetDeviceBase(IN PVOID HwDeviceExtension, IN INTERFACE_TYPE BusType, IN ULONG SystemIoBusNumber, IN SCSI_PHYSICAL_ADDRESS IoAddress, IN ULONG NumberOfBytes, IN BOOLEAN InIoSpace)
Definition: scsiport.c:570
PHYSICAL_ADDRESS * PSCSI_PHYSICAL_ADDRESS
Definition: srb.h:38
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
UCHAR SenseInfoBufferLength
Definition: srb.h:259
enum _SCSI_ADAPTER_CONTROL_STATUS * PSCSI_ADAPTER_CONTROL_STATUS
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUshort(IN PUSHORT Port, IN PUSHORT Buffer, IN ULONG Count)
Definition: scsiport.c:1529
UCHAR PathId
Definition: srb.h:253
SCSIPORT_API VOID NTAPI ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
Definition: scsiport.c:548
unsigned short USHORT
Definition: pedump.c:61
Definition: srb.h:539
SCSIPORT_API VOID __cdecl ScsiDebugPrint(ULONG DebugPrintLevel, PCCHAR DebugMessage,...)
ULONG RangeLength
Definition: srb.h:42
struct _HW_INITIALIZATION_DATA_2K * PHW_INITIALIZATION_DATA_2K
ULONG SrbExtensionSize
Definition: srb.h:576
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1035
unsigned int * PULONG
Definition: retypes.h:1
BOOLEAN(NTAPI * PHW_INTERRUPT)(IN PVOID DeviceExtension)
Definition: srb.h:450
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUlong(IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1519
PHW_INITIALIZE HwInitialize
Definition: srb.h:567
enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
_SCSI_ADAPTER_CONTROL_STATUS
Definition: srb.h:190
SCSIPORT_API UCHAR NTAPI ScsiPortReadPortUchar(IN PUCHAR Port)
Definition: scsiport.c:1382
PVOID SenseInfoBuffer
Definition: srb.h:264
struct tagContext Context
Definition: acpixf.h:1034
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:40
VOID(NTAPI * PHW_TIMER)(IN PVOID DeviceExtension)
Definition: srb.h:456
INTERFACE_TYPE AdapterInterfaceType
Definition: srb.h:565
unsigned int ULONG
Definition: retypes.h:1
HW_INITIALIZATION_DATA comm
Definition: srb.h:601
SCSIPORT_API VOID __cdecl ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, IN PVOID HwDeviceExtension,...)
Definition: scsiport.c:1451
BOOLEAN MapBuffers
Definition: srb.h:580
SCSIPORT_API VOID NTAPI ScsiPortFlushDma(IN PVOID DeviceExtension)
Definition: scsiport.c:539
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUlong(IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1419
struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST SCSI_SUPPORTED_CONTROL_TYPE_LIST
_In_ WDFDEVICE _In_ PPNP_BUS_INFORMATION BusInformation
Definition: wdfdevice.h:3912
struct _PORT_CONFIGURATION_INFORMATION_COMMON PORT_CONFIGURATION_INFORMATION_COMMON
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUshort(IN PUSHORT Register, IN USHORT Value)
Definition: scsiport.c:1617
SCSIPORT_API PVOID NTAPI ScsiPortGetUncachedExtension(IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN ULONG NumberOfBytes)
Definition: scsiport.c:729
UCHAR Reserved5[16]
Definition: srb.h:308
struct _PORT_CONFIGURATION_INFORMATION_2K PORT_CONFIGURATION_INFORMATION_2K
ULONG(NTAPI * PHW_FIND_ADAPTER)(IN PVOID DeviceExtension, IN PVOID HwContext, IN PVOID BusInformation, IN PCHAR ArgumentString, IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo, OUT PBOOLEAN Again)
Definition: srb.h:468
SCSIPORT_API VOID NTAPI ScsiPortStallExecution(IN ULONG Delay)
Definition: scsiport.c:1481
struct _HW_INITIALIZATION_DATA_2K HW_INITIALIZATION_DATA_2K
unsigned short * PUSHORT
Definition: retypes.h:2
ULONG QueueSortKey
Definition: srb.h:270
#define WriteBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:344
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUchar(IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
Definition: scsiport.c:1566
VOID(NTAPI * PHW_DMA_STARTED)(IN PVOID DeviceExtension)
Definition: srb.h:462
SCSIPORT_API USHORT NTAPI ScsiPortReadRegisterUshort(IN PUSHORT Register)
Definition: scsiport.c:1457
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA * HwInitializationData
Definition: srb.h:897
struct _PORT_CONFIGURATION_INFORMATION_COMMON * PPORT_CONFIGURATION_INFORMATION_COMMON
SCSIPORT_API VOID NTAPI ScsiPortIoMapTransfer(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PVOID LogicalAddress, IN ULONG Length)
Definition: scsiport.c:1279
struct _PORT_CONFIGURATION_INFORMATION * PPORT_CONFIGURATION_INFORMATION
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68