ReactOS  0.4.14-dev-604-gcfdd483
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 //
47 // Configuration information structure. Contains the information necessary
48 // to initialize the adapter. NOTE: This structure's must be a multiple of
49 // quadwords.
50 //
51 
53  ULONG Length; // Length of port configuation information strucuture.
54  ULONG SystemIoBusNumber; // IO bus number (0 for machines that have only 1 IO bus
55  INTERFACE_TYPE AdapterInterfaceType; // EISA, MCA or ISA
56  ULONG BusInterruptLevel; // Interrupt request level for device
57  // Bus interrupt vector used with hardware buses which use as vector as
58  // well as level, such as internal buses.
60  KINTERRUPT_MODE InterruptMode; // Interrupt mode (level-sensitive or edge-triggered)
61 
62  ULONG MaximumTransferLength; // Max bytes that can be transferred in a single SRB
63  ULONG NumberOfPhysicalBreaks; // Number of contiguous blocks of physical memory
64  ULONG DmaChannel; // DMA channel for devices using system DMA
68  ULONG AlignmentMask; // Alignment masked for the adapter for data transfers.
69  ULONG NumberOfAccessRanges; // Number of allocated access range elements.
70  ACCESS_RANGE (*AccessRanges)[]; // Pointer to array of access range elements.
72  UCHAR NumberOfBuses; // Number of SCSI buses attached to the adapter.
73  CCHAR InitiatorBusId[8]; // SCSI bus ID for adapter
74  BOOLEAN ScatterGather; // Indicates that the adapter does scatter/gather
75  BOOLEAN Master; // Indicates that the adapter is a bus master
76  BOOLEAN CachesData; // Host caches data or state.
77  BOOLEAN AdapterScansDown; // Host adapter scans down for bios devices.
78  BOOLEAN AtdiskPrimaryClaimed; // Primary at disk address (0x1F0) claimed.
79  BOOLEAN AtdiskSecondaryClaimed; // Secondary at disk address (0x170) claimed.
80  BOOLEAN Dma32BitAddresses; // The master uses 32-bit DMA addresses.
81  BOOLEAN DemandMode; // Use Demand Mode DMA rather than Single Request.
82  BOOLEAN MapBuffers; // Data buffers must be mapped into virtual address space.
83  BOOLEAN NeedPhysicalAddresses; // We need to tranlate virtual to physical addresses.
84  BOOLEAN TaggedQueuing; // Supports tagged queuing
85  BOOLEAN AutoRequestSense; // Supports auto request sense.
86  BOOLEAN MultipleRequestPerLu; // Supports multiple requests per logical unit.
87  BOOLEAN ReceiveEvent; // Support receive event function.
88  BOOLEAN RealModeInitialized; // Indicates the real-mode driver has initialized the card.
89 
90  BOOLEAN BufferAccessScsiPortControlled; // Indicate that the miniport will not touch
91  // the data buffers directly.
92  UCHAR MaximumNumberOfTargets; // Indicator for wide scsi.
93  UCHAR ReservedUchars[2]; // Ensure quadword alignment.
94  ULONG SlotNumber; // Adapter slot number
95  ULONG BusInterruptLevel2; // Interrupt information for a second IRQ.
98  ULONG DmaChannel2; // DMA information for a second channel.
102 
104 
106  // Fields added to allow for the miniport
107  // to update these sizes based on requirements
108  // for large transfers ( > 64K);
113 
115  // Used to determine whether the system and/or the miniport support
116  // 64-bit physical addresses. See SCSI_DMA64_* flags below.
118  // Indicates that the miniport can accept a SRB_FUNCTION_RESET_DEVICE
119  // to clear all requests to a particular LUN.
121  // Indicates that the miniport can support more than 8 logical units per
122  // target (maximum LUN number is one less than this field).
124  // Supports WMI?
127 
133 
134 //
135 // Version control for ConfigInfo structure.
136 //
137 
138 #define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION)
139 
140 //
141 // Flags for controlling 64-bit DMA use (PORT_CONFIGURATION_INFORMATION field
142 // Dma64BitAddresses)
143 //
144 
145 //
146 // Set by scsiport on entering HwFindAdapter if the system can support 64-bit
147 // physical addresses. The miniport can use this information before calling
148 // ScsiPortGetUncachedExtension to modify the DeviceExtensionSize,
149 // SpecificLuExtensionSize & SrbExtensionSize fields to account for the extra
150 // size of the scatter gather list.
151 //
152 
153 #define SCSI_DMA64_SYSTEM_SUPPORTED 0x80
154 
155 //
156 // Set by the miniport before calling ScsiPortGetUncachedExtension to indicate
157 // that scsiport should provide it with 64-bit physical addresses. If the
158 // system does not support 64-bit PA's then this bit will be ignored.
159 //
160 
161 #define SCSI_DMA64_MINIPORT_SUPPORTED 0x01
162 
163 
164 //
165 // Command type (and parameter) definition(s) for AdapterControl requests.
166 //
167 
177 
178 //
179 // Adapter control status values
180 //
181 
186 
187 //
188 // Parameters for Adapter Control Functions:
189 //
190 
191 //
192 // ScsiQuerySupportedControlTypes:
193 //
194 
195 #ifdef _MSC_VER
196 #pragma warning(disable:4200)
197 #endif
199 
200  //
201  // Specifies the number of entries in the adapter control type list.
202  //
203 
205 
206  //
207  // The miniport will set TRUE for each control type it supports.
208  // The number of entries in this array is defined by MaxAdapterControlType
209  // - the miniport must not attempt to set any AC types beyond the maximum
210  // value specified.
211  //
212 
214 
216 #ifdef _MSC_VER
217 #pragma warning(disable:4200)
218 #endif
219 
220 //
221 // Uninitialized flag value.
222 //
223 
224 #define SP_UNINITIALIZED_VALUE ((ULONG) ~0)
225 #define SP_UNTAGGED ((UCHAR) ~0)
226 
227 //
228 // Set asynchronous events.
229 //
230 
231 #define SRBEV_BUS_RESET 0x0001
232 #define SRBEV_SCSI_ASYNC_NOTIFICATION 0x0002
233 
234 // begin_ntminitape
235 
236 //
237 // SCSI I/O Request Block
238 //
239 
240 typedef struct _SCSI_REQUEST_BLOCK {
241  USHORT Length; // offset 0
242  UCHAR Function; // offset 2
243  UCHAR SrbStatus; // offset 3
244  UCHAR ScsiStatus; // offset 4
245  UCHAR PathId; // offset 5
246  UCHAR TargetId; // offset 6
247  UCHAR Lun; // offset 7
248  UCHAR QueueTag; // offset 8
249  UCHAR QueueAction; // offset 9
250  UCHAR CdbLength; // offset a
252  ULONG SrbFlags; // offset c
253  ULONG DataTransferLength; // offset 10
254  ULONG TimeOutValue; // offset 14
255  PVOID DataBuffer; // offset 18
256  PVOID SenseInfoBuffer; // offset 1c
257  struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20
258  PVOID OriginalRequest; // offset 24
259  PVOID SrbExtension; // offset 28
260  union {
261  ULONG InternalStatus; // offset 2c
262  ULONG QueueSortKey; // offset 2c
263  };
264 
265 #if defined(_WIN64)
266  // Force PVOID alignment of Cdb
267  ULONG Reserved;
268 
269 #endif
270 
271  UCHAR Cdb[16]; // offset 30
273 
274 #define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK)
275 
276 //
277 // SCSI I/O Request Block for WMI Requests
278 //
279 
280 typedef struct _SCSI_WMI_REQUEST_BLOCK {
282  UCHAR Function; // SRB_FUNCTION_WMI
285  UCHAR PathId; // If SRB_WMI_FLAGS_ADAPTER_REQUEST is set in
286  UCHAR TargetId; // WMIFlags then PathId, TargetId and Lun are
287  UCHAR Lun; // reserved fields.
302 
303 //
304 // SRB Functions
305 //
306 
307 #define SRB_FUNCTION_EXECUTE_SCSI 0x00
308 #define SRB_FUNCTION_CLAIM_DEVICE 0x01
309 #define SRB_FUNCTION_IO_CONTROL 0x02
310 #define SRB_FUNCTION_RECEIVE_EVENT 0x03
311 #define SRB_FUNCTION_RELEASE_QUEUE 0x04
312 #define SRB_FUNCTION_ATTACH_DEVICE 0x05
313 #define SRB_FUNCTION_RELEASE_DEVICE 0x06
314 #define SRB_FUNCTION_SHUTDOWN 0x07
315 #define SRB_FUNCTION_FLUSH 0x08
316 #define SRB_FUNCTION_ABORT_COMMAND 0x10
317 #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
318 #define SRB_FUNCTION_RESET_BUS 0x12
319 #define SRB_FUNCTION_RESET_DEVICE 0x13
320 #define SRB_FUNCTION_TERMINATE_IO 0x14
321 #define SRB_FUNCTION_FLUSH_QUEUE 0x15
322 #define SRB_FUNCTION_REMOVE_DEVICE 0x16
323 #define SRB_FUNCTION_WMI 0x17
324 #define SRB_FUNCTION_LOCK_QUEUE 0x18
325 #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
326 #define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20
327 
328 //
329 // SRB Status
330 //
331 
332 #define SRB_STATUS_PENDING 0x00
333 #define SRB_STATUS_SUCCESS 0x01
334 #define SRB_STATUS_ABORTED 0x02
335 #define SRB_STATUS_ABORT_FAILED 0x03
336 #define SRB_STATUS_ERROR 0x04
337 #define SRB_STATUS_BUSY 0x05
338 #define SRB_STATUS_INVALID_REQUEST 0x06
339 #define SRB_STATUS_INVALID_PATH_ID 0x07
340 #define SRB_STATUS_NO_DEVICE 0x08
341 #define SRB_STATUS_TIMEOUT 0x09
342 #define SRB_STATUS_SELECTION_TIMEOUT 0x0A
343 #define SRB_STATUS_COMMAND_TIMEOUT 0x0B
344 #define SRB_STATUS_MESSAGE_REJECTED 0x0D
345 #define SRB_STATUS_BUS_RESET 0x0E
346 #define SRB_STATUS_PARITY_ERROR 0x0F
347 #define SRB_STATUS_REQUEST_SENSE_FAILED 0x10
348 #define SRB_STATUS_NO_HBA 0x11
349 #define SRB_STATUS_DATA_OVERRUN 0x12
350 #define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13
351 #define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14
352 #define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15
353 #define SRB_STATUS_REQUEST_FLUSHED 0x16
354 #define SRB_STATUS_INVALID_LUN 0x20
355 #define SRB_STATUS_INVALID_TARGET_ID 0x21
356 #define SRB_STATUS_BAD_FUNCTION 0x22
357 #define SRB_STATUS_ERROR_RECOVERY 0x23
358 #define SRB_STATUS_NOT_POWERED 0x24
359 
360 //
361 // This value is used by the port driver to indicate that a non-scsi-related
362 // error occured. Miniports must never return this status.
363 //
364 
365 #define SRB_STATUS_INTERNAL_ERROR 0x30
366 
367 //
368 // Srb status values 0x38 through 0x3f are reserved for internal port driver
369 // use.
370 //
371 
372 
373 
374 //
375 // SRB Status Masks
376 //
377 
378 #define SRB_STATUS_QUEUE_FROZEN 0x40
379 #define SRB_STATUS_AUTOSENSE_VALID 0x80
380 
381 #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
382 
383 //
384 // SRB Flag Bits
385 //
386 
387 #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
388 #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
389 #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
390 #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
391 #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
392 #define SRB_FLAGS_DATA_IN 0x00000040
393 #define SRB_FLAGS_DATA_OUT 0x00000080
394 #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
395 #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
396 #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
397 #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
398 #define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400
399 #define SRB_FLAGS_IS_ACTIVE 0x00010000
400 #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
401 #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
402 #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
403 
404 #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
405 #define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000
406 #define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000
407 #define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000
408 
409 #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
410 #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
411 //
412 // Queue Action
413 //
414 
415 #define SRB_SIMPLE_TAG_REQUEST 0x20
416 #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
417 #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
418 
419 #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
420 
421 // end_ntminitape
422 
423 //
424 // SCSI Adapter Dependent Routines
425 //
426 
427 typedef
428 BOOLEAN
430  IN PVOID DeviceExtension
431  );
432 
433 typedef
434 BOOLEAN
436  IN PVOID DeviceExtension,
438  );
439 
440 typedef
441 BOOLEAN
443  IN PVOID DeviceExtension
444  );
445 
446 typedef
447 VOID
449  IN PVOID DeviceExtension
450  );
451 
452 typedef
453 VOID
455  IN PVOID DeviceExtension
456  );
457 
458 typedef
459 ULONG
461  IN PVOID DeviceExtension,
463  IN PVOID BusInformation,
464  IN PCHAR ArgumentString,
466  OUT PBOOLEAN Again
467  );
468 
469 typedef
470 BOOLEAN
472  IN PVOID DeviceExtension,
473  IN ULONG PathId
474  );
475 
476 typedef
477 BOOLEAN
479  IN PVOID DeviceExtension,
480  IN PVOID Context,
482  );
483 
484 typedef
487  IN PVOID DeviceExtension,
488  IN SCSI_ADAPTER_CONTROL_TYPE ControlType,
490  );
491 
492 //
493 // Port driver error codes
494 //
495 
496 #define SP_BUS_PARITY_ERROR 0x0001
497 #define SP_UNEXPECTED_DISCONNECT 0x0002
498 #define SP_INVALID_RESELECTION 0x0003
499 #define SP_BUS_TIME_OUT 0x0004
500 #define SP_PROTOCOL_ERROR 0x0005
501 #define SP_INTERNAL_ADAPTER_ERROR 0x0006
502 #define SP_REQUEST_TIMEOUT 0x0007
503 #define SP_IRQ_NOT_RESPONDING 0x0008
504 #define SP_BAD_FW_WARNING 0x0009
505 #define SP_BAD_FW_ERROR 0x000a
506 #define SP_LOST_WMI_MINIPORT_REQUEST 0x000b
507 
508 
509 //
510 // Return values for SCSI_HW_FIND_ADAPTER.
511 //
512 
513 #define SP_RETURN_NOT_FOUND 0
514 #define SP_RETURN_FOUND 1
515 #define SP_RETURN_ERROR 2
516 #define SP_RETURN_BAD_CONFIG 3
517 
518 //
519 // Notification Event Types
520 //
521 
530  BusChangeDetected, /* New */
534 
535 //
536 // Structure passed between miniport initialization
537 // and SCSI port initialization
538 //
539 
540 typedef struct _HW_INITIALIZATION_DATA {
541 
543  // Adapter interface type:
544  //
545  // Internal
546  // Isa
547  // Eisa
548  // MicroChannel
549  // TurboChannel
550  // PCIBus
551  // VMEBus
552  // NuBus
553  // PCMCIABus
554  // CBus
555  // MPIBus
556  // MPSABus
558  // Miniport driver routines
571 
572  BOOLEAN MapBuffers; // Data buffers must be mapped into virtual address space.
573  BOOLEAN NeedPhysicalAddresses; // We need to tranlate virtual to physical addresses.
574  BOOLEAN TaggedQueuing; // Supports tagged queuing
575  BOOLEAN AutoRequestSense; // Supports auto request sense.
576  BOOLEAN MultipleRequestPerLu; // Supports multiple requests per logical unit.
577  BOOLEAN ReceiveEvent; // Support receive event function.
578  USHORT VendorIdLength; // Vendor identification length
579  PVOID VendorId; // Vendor identification
580  USHORT ReservedUshort; // Pad for alignment and future use.
581  USHORT DeviceIdLength; // Device identification length
582  PVOID DeviceId; // Device identification
583 
585 
587  // Stop adapter routine.
589 
591 
596 
597 // begin_ntminitape
598 
599 #ifndef _NTDDK_
600 #define SCSIPORT_API DECLSPEC_IMPORT
601 #else
602 #define SCSIPORT_API
603 #endif
604 
605 // end_ntminitape
606 
607 //
608 // Port driver routines called by miniport driver
609 //
610 
612 ULONG NTAPI
618  );
619 
621 VOID NTAPI
623  IN PVOID HwDeviceExtension,
624  IN PVOID MappedAddress
625  );
626 
628 ULONG NTAPI
630  IN PVOID DeviceExtension,
631  IN ULONG BusDataType,
632  IN ULONG SystemIoBusNumber,
634  IN PVOID Buffer,
635  IN ULONG Length
636  );
637 
639 ULONG NTAPI
641  IN PVOID DeviceExtension,
642  IN ULONG BusDataType,
643  IN ULONG SystemIoBusNumber,
645  IN PVOID Buffer,
646  IN ULONG Offset,
647  IN ULONG Length
648  );
649 
651 PVOID NTAPI
653  IN PVOID HwDeviceExtension,
655  IN ULONG SystemIoBusNumber,
656  IN SCSI_PHYSICAL_ADDRESS IoAddress,
658  IN BOOLEAN InIoSpace
659  );
660 
662 PVOID NTAPI
664  IN PVOID HwDeviceExtension,
665  IN UCHAR PathId,
666  IN UCHAR TargetId,
667  IN UCHAR Lun
668  );
669 
673  IN PVOID DeviceExtension,
674  IN UCHAR PathId,
675  IN UCHAR TargetId,
676  IN UCHAR Lun,
677  IN LONG QueueTag
678  );
679 
683  IN PVOID HwDeviceExtension,
686  OUT ULONG *Length
687  );
688 
690 PVOID NTAPI
692  IN PVOID HwDeviceExtension,
694  );
695 
697 PVOID NTAPI
699  IN PVOID HwDeviceExtension,
702  );
703 
705 VOID NTAPI
707  IN PVOID DeviceExtension
708  );
709 
711 VOID NTAPI
713  IN PVOID HwDeviceExtension,
715  IN PVOID LogicalAddress,
716  IN ULONG Length
717  );
718 
722  IN SCSI_NOTIFICATION_TYPE NotificationType,
723  IN PVOID HwDeviceExtension,
724  ...
725  );
726 
728 VOID NTAPI
730  IN PVOID HwDeviceExtension,
732  IN UCHAR PathId,
733  IN UCHAR TargetId,
734  IN UCHAR Lun,
736  IN ULONG UniqueId
737  );
738 
740 VOID NTAPI
742  IN PVOID HwDeviceExtension,
743  IN UCHAR PathId,
744  IN UCHAR TargetId,
745  IN UCHAR Lun,
746  IN UCHAR SrbStatus
747  );
748 
750 VOID NTAPI
754  IN ULONG Length
755  );
756 
758 UCHAR NTAPI
760  IN PUCHAR Port
761  );
762 
766  IN PUSHORT Port
767  );
768 
770 ULONG NTAPI
772  IN PULONG Port
773  );
774 
776 VOID NTAPI
778  IN PUCHAR Port,
779  IN PUCHAR Buffer,
780  IN ULONG Count
781  );
782 
784 VOID NTAPI
786  IN PUSHORT Port,
787  IN PUSHORT Buffer,
788  IN ULONG Count
789  );
790 
792 VOID NTAPI
794  IN PULONG Port,
795  IN PULONG Buffer,
796  IN ULONG Count
797  );
798 
800 UCHAR NTAPI
802  IN PUCHAR Register
803  );
804 
808  IN PUSHORT Register
809  );
810 
812 ULONG NTAPI
814  IN PULONG Register
815  );
816 
818 VOID NTAPI
820  IN PUCHAR Register,
821  IN PUCHAR Buffer,
822  IN ULONG Count
823  );
824 
826 VOID NTAPI
828  IN PUSHORT Register,
829  IN PUSHORT Buffer,
830  IN ULONG Count
831  );
832 
834 VOID NTAPI
836  IN PULONG Register,
837  IN PULONG Buffer,
838  IN ULONG Count
839  );
840 
842 VOID NTAPI
844  IN ULONG Delay
845  );
846 
848 VOID NTAPI
850  IN PUCHAR Port,
851  IN UCHAR Value
852  );
853 
855 VOID NTAPI
857  IN PUSHORT Port,
858  IN USHORT Value
859  );
860 
862 VOID NTAPI
864  IN PULONG Port,
865  IN ULONG Value
866  );
867 
869 VOID NTAPI
871  IN PUCHAR Port,
872  IN PUCHAR Buffer,
873  IN ULONG Count
874  );
875 
877 VOID NTAPI
879  IN PUSHORT Port,
880  IN PUSHORT Buffer,
881  IN ULONG Count
882  );
883 
885 VOID NTAPI
887  IN PULONG Port,
888  IN PULONG Buffer,
889  IN ULONG Count
890  );
891 
893 VOID NTAPI
895  IN PUCHAR Register,
896  IN UCHAR Value
897  );
898 
900 VOID NTAPI
902  IN PUSHORT Register,
903  IN USHORT Value
904  );
905 
907 VOID NTAPI
909  IN PULONG Register,
910  IN ULONG Value
911  );
912 
914 VOID NTAPI
916  IN PUCHAR Register,
917  IN PUCHAR Buffer,
918  IN ULONG Count
919  );
920 
922 VOID NTAPI
924  IN PUSHORT Register,
925  IN PUSHORT Buffer,
926  IN ULONG Count
927  );
928 
930 VOID NTAPI
932  IN PULONG Register,
933  IN PULONG Buffer,
934  IN ULONG Count
935  );
936 
940  ULONG UlongAddress
941  );
942 
944 ULONG NTAPI
947  );
948 
949 #define ScsiPortConvertPhysicalAddressToUlong(Address) ((Address).LowPart)
950 
954  IN PVOID HwDeviceExtension,
956  IN ULONG SystemIoBusNumber,
957  IN SCSI_PHYSICAL_ADDRESS IoAddress,
959  IN BOOLEAN InIoSpace
960  );
961 
962 // begin_ntminitape
963 
967  ULONG DebugPrintLevel,
968  PCCHAR DebugMessage,
969  ...
970  );
971 
972 // end_ntminitape
973 
974 #endif //USER_MODE
975 
976 #pragma pack(pop)
977 
978 #endif //
SCSIPORT_API UCHAR NTAPI ScsiPortReadRegisterUchar(IN PUCHAR Register)
Definition: scsiport.c:1433
struct _HW_INITIALIZATION_DATA_COMMON HW_INITIALIZATION_DATA_COMMON
struct _PORT_CONFIGURATION_INFORMATION_NT * PPORT_CONFIGURATION_INFORMATION_NT
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
signed char * PCHAR
Definition: retypes.h:7
PHW_ADAPTER_STATE HwAdapterState
Definition: srb.h:565
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUshort(IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
Definition: scsiport.c:1580
_Must_inspect_result_ _In_ PVOID Argument2
Definition: srb.h:663
CPPORT Port[4]
Definition: headless.c:34
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:1283
#define IN
Definition: typedefs.h:38
SCSIPORT_API VOID NTAPI ScsiPortWritePortUlong(IN PULONG Port, IN ULONG Value)
Definition: scsiport.c:1540
struct _ACCESS_RANGE ACCESS_RANGE
BOOLEAN BufferAccessScsiPortControlled
Definition: srb.h:90
INTERFACE_TYPE AdapterInterfaceType
Definition: srb.h:55
struct _SCSI_WMI_REQUEST_BLOCK SCSI_WMI_REQUEST_BLOCK
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
ULONG SrbFlags
Definition: srb.h:252
PVOID SrbExtension
Definition: srb.h:259
enum _INTERFACE_TYPE INTERFACE_TYPE
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1117
struct _PORT_CONFIGURATION_INFORMATION_2K * PPORT_CONFIGURATION_INFORMATION_2K
_IRQL_requires_same_ _In_opt_ PVOID Argument1
Definition: cmtypes.h:694
PVOID OriginalRequest
Definition: srb.h:258
UCHAR Cdb[16]
Definition: srb.h:271
SCSIPORT_API ULONG NTAPI ScsiPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN struct _HW_INITIALIZATION_DATA *HwInitializationData, IN PVOID HwContext)
Definition: scsiport.c:1008
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:806
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:549
_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:1117
BOOLEAN(NTAPI * PHW_RESET_BUS)(IN PVOID DeviceExtension, IN ULONG PathId)
Definition: srb.h:471
SCSIPORT_API PVOID NTAPI ScsiPortGetLogicalUnit(IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun)
Definition: scsiport.c:594
enum _SCSI_NOTIFICATION_TYPE * PSCSI_NOTIFICATION_TYPE
PVOID DataBuffer
Definition: srb.h:255
PVOID OriginalRequest
Definition: srb.h:297
_SCSI_NOTIFICATION_TYPE
Definition: srb.h:522
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR TargetId
Definition: classpnp.h:1117
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG DataTransferLength
Definition: srb.h:253
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUchar(IN PUCHAR Register, IN UCHAR Value)
Definition: scsiport.c:1591
#define ScsiPortConvertPhysicalAddressToUlong(Address)
Definition: srb.h:949
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUchar(IN PUCHAR Port, IN PUCHAR Buffer, IN ULONG Count)
Definition: scsiport.c:1501
ULONG HwInitializationDataSize
Definition: srb.h:542
#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:664
struct _HW_INITIALIZATION_DATA HW_INITIALIZATION_DATA
ULONG DeviceExtensionSize
Definition: srb.h:566
enum _DMA_WIDTH DMA_WIDTH
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUshort(IN PUSHORT Register, IN PUSHORT Buffer, IN ULONG Count)
Definition: scsiport.c:1422
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension, IN PSCSI_REQUEST_BLOCK Srb, IN PVOID VirtualAddress, OUT ULONG *Length)
Definition: scsiport.c:607
UCHAR CdbLength
Definition: srb.h:250
PHW_DMA_STARTED HwDmaStarted
Definition: srb.h:564
BOOLEAN MultipleRequestPerLu
Definition: srb.h:576
PHW_FIND_ADAPTER HwFindAdapter
Definition: srb.h:562
SCSIPORT_API VOID NTAPI ScsiPortMoveMemory(IN PVOID WriteBuffer, IN PVOID ReadBuffer, IN ULONG Length)
Definition: scsiport.c:1298
USHORT DeviceIdLength
Definition: srb.h:581
SCSIPORT_API VOID NTAPI ScsiPortWritePortUshort(IN PUSHORT Port, IN USHORT Value)
Definition: scsiport.c:1549
ACCESS_RANGE(* AccessRanges)[]
Definition: srb.h:70
ULONG SpecificLuExtensionSize
Definition: srb.h:567
struct _SCSI_REQUEST_BLOCK * NextSrb
Definition: srb.h:257
UCHAR QueueAction
Definition: srb.h:249
PHW_RESET_BUS HwResetBus
Definition: srb.h:563
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:643
ULONG TimeOutValue
Definition: srb.h:254
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUlong(IN PULONG Register, IN ULONG Value)
Definition: scsiport.c:1600
UCHAR SrbStatus
Definition: srb.h:243
PORT_CONFIGURATION_INFORMATION_NT nt4
Definition: srb.h:130
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:478
SCSIPORT_API ULONG NTAPI ScsiPortReadPortUlong(IN PULONG Port)
Definition: scsiport.c:1384
BOOLEAN AutoRequestSense
Definition: srb.h:575
BOOLEAN TaggedQueuing
Definition: srb.h:574
OUT BOOLEAN SupportedTypeList[0]
Definition: srb.h:213
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:1481
HW_INITIALIZATION_DATA_2K w2k
Definition: srb.h:594
#define SCSIPORT_API
Definition: srb.h:600
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterBufferUlong(IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1569
SCSIPORT_API SCSI_PHYSICAL_ADDRESS NTAPI ScsiPortConvertUlongToPhysicalAddress(ULONG UlongAddress)
BOOLEAN NeedPhysicalAddresses
Definition: srb.h:573
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
BOOLEAN(NTAPI * PHW_INITIALIZE)(IN PVOID DeviceExtension)
Definition: srb.h:429
long LONG
Definition: pedump.c:60
struct _HW_INITIALIZATION_DATA_COMMON * PHW_INITIALIZATION_DATA_COMMON
UCHAR WMISubFunction
Definition: srb.h:284
PHW_INTERRUPT HwInterrupt
Definition: srb.h:561
SCSIPORT_API ULONG NTAPI ScsiPortReadRegisterUlong(IN PULONG Register)
Definition: scsiport.c:1441
UCHAR ScsiStatus
Definition: srb.h:244
USHORT VendorIdLength
Definition: srb.h:578
SCSIPORT_API VOID NTAPI ScsiPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
Definition: scsiport.c:1531
ULONG DataTransferLength
Definition: srb.h:292
USHORT ReservedUshort
Definition: srb.h:580
unsigned char BOOLEAN
PHW_STARTIO HwStartIo
Definition: srb.h:560
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:588
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
SCSIPORT_API USHORT NTAPI ScsiPortReadPortUshort(IN PUSHORT Port)
Definition: scsiport.c:1392
KINTERRUPT_MODE InterruptMode2
Definition: srb.h:97
Definition: bufpool.h:45
UCHAR QueueTag
Definition: srb.h:248
UCHAR TargetId
Definition: srb.h:246
PORT_CONFIGURATION_INFORMATION_2K w2k
Definition: srb.h:131
UCHAR Reserved2[2]
Definition: srb.h:290
KINTERRUPT_MODE InterruptMode
Definition: srb.h:60
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUchar(IN PUCHAR Register, IN PUCHAR Buffer, IN ULONG Count)
Definition: scsiport.c:1400
PORT_CONFIGURATION_INFORMATION comm
Definition: srb.h:129
SCSIPORT_API VOID NTAPI ScsiPortCompleteRequest(IN PVOID HwDeviceExtension, IN UCHAR PathId, IN UCHAR TargetId, IN UCHAR Lun, IN UCHAR SrbStatus)
Definition: scsiport.c:498
struct _SCSI_WMI_REQUEST_BLOCK * PSCSI_WMI_REQUEST_BLOCK
BOOLEAN ReceiveEvent
Definition: srb.h:577
char CCHAR
Definition: typedefs.h:50
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:486
struct _ACCESS_RANGE * PACCESS_RANGE
UCHAR Function
Definition: srb.h:242
BOOLEAN(NTAPI * PHW_STARTIO)(IN PVOID DeviceExtension, IN PSCSI_REQUEST_BLOCK Srb)
Definition: srb.h:435
BOOLEAN AtdiskSecondaryClaimed
Definition: srb.h:79
_SCSI_ADAPTER_CONTROL_TYPE
Definition: srb.h:168
USHORT Length
Definition: srb.h:241
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
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:1457
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1061
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
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:872
PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS
Definition: srb.h:38
#define VOID
Definition: acefi.h:82
ULONG InternalStatus
Definition: srb.h:261
_In_ ULONG _In_ BOOLEAN _Must_inspect_result_ PVOID * VirtualAddress
Definition: ndis.h:3791
struct _HW_INITIALIZATION_DATA * PHW_INITIALIZATION_DATA
ULONG NumberOfAccessRanges
Definition: srb.h:569
#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:562
PHYSICAL_ADDRESS * PSCSI_PHYSICAL_ADDRESS
Definition: srb.h:38
UCHAR SenseInfoBufferLength
Definition: srb.h:251
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:1521
UCHAR PathId
Definition: srb.h:245
SCSIPORT_API VOID NTAPI ScsiPortFreeDeviceBase(IN PVOID HwDeviceExtension, IN PVOID MappedAddress)
Definition: scsiport.c:540
unsigned short USHORT
Definition: pedump.c:61
Definition: srb.h:531
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:568
unsigned int * PULONG
Definition: retypes.h:1
BOOLEAN(NTAPI * PHW_INTERRUPT)(IN PVOID DeviceExtension)
Definition: srb.h:442
SCSIPORT_API VOID NTAPI ScsiPortWritePortBufferUlong(IN PULONG Port, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1511
PHW_INITIALIZE HwInitialize
Definition: srb.h:559
enum _SCSI_ADAPTER_CONTROL_TYPE SCSI_ADAPTER_CONTROL_TYPE
_SCSI_ADAPTER_CONTROL_STATUS
Definition: srb.h:182
SCSIPORT_API UCHAR NTAPI ScsiPortReadPortUchar(IN PUCHAR Port)
Definition: scsiport.c:1374
PVOID SenseInfoBuffer
Definition: srb.h:256
#define BOOLEAN
Definition: pedump.c:73
#define OUT
Definition: typedefs.h:39
VOID(NTAPI * PHW_TIMER)(IN PVOID DeviceExtension)
Definition: srb.h:448
INTERFACE_TYPE AdapterInterfaceType
Definition: srb.h:557
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:998
struct tagContext Context
Definition: acpixf.h:1030
unsigned int ULONG
Definition: retypes.h:1
HW_INITIALIZATION_DATA comm
Definition: srb.h:593
SCSIPORT_API VOID __cdecl ScsiPortNotification(IN SCSI_NOTIFICATION_TYPE NotificationType, IN PVOID HwDeviceExtension,...)
Definition: scsiport.c:1869
BOOLEAN MapBuffers
Definition: srb.h:572
SCSIPORT_API VOID NTAPI ScsiPortFlushDma(IN PVOID DeviceExtension)
Definition: scsiport.c:531
SCSIPORT_API VOID NTAPI ScsiPortReadRegisterBufferUlong(IN PULONG Register, IN PULONG Buffer, IN ULONG Count)
Definition: scsiport.c:1411
struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST SCSI_SUPPORTED_CONTROL_TYPE_LIST
IN PSCSI_REQUEST_BLOCK Srb
Definition: class2.h:49
struct _PORT_CONFIGURATION_INFORMATION_COMMON PORT_CONFIGURATION_INFORMATION_COMMON
SCSIPORT_API VOID NTAPI ScsiPortWriteRegisterUshort(IN PUSHORT Register, IN USHORT Value)
Definition: scsiport.c:1609
SCSIPORT_API PVOID NTAPI ScsiPortGetUncachedExtension(IN PVOID HwDeviceExtension, IN PPORT_CONFIGURATION_INFORMATION ConfigInfo, IN ULONG NumberOfBytes)
Definition: scsiport.c:721
UCHAR Reserved5[16]
Definition: srb.h:300
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:460
SCSIPORT_API VOID NTAPI ScsiPortStallExecution(IN ULONG Delay)
Definition: scsiport.c:1473
struct _HW_INITIALIZATION_DATA_2K HW_INITIALIZATION_DATA_2K
unsigned short * PUSHORT
Definition: retypes.h:2
ULONG QueueSortKey
Definition: srb.h:262
#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:1558
VOID(NTAPI * PHW_DMA_STARTED)(IN PVOID DeviceExtension)
Definition: srb.h:454
SCSIPORT_API USHORT NTAPI ScsiPortReadRegisterUshort(IN PUSHORT Register)
Definition: scsiport.c:1449
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA * HwInitializationData
Definition: srb.h:664
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:1271
struct _PORT_CONFIGURATION_INFORMATION * PPORT_CONFIGURATION_INFORMATION
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68