- Create KD branch. All debugging support is removed in this branch (no symbols,...
[reactos.git] / reactos / drivers / storage / scsiport / scsiport_int.h
1 /*
2 * SCSI_PORT_TIMER_STATES
3 *
4 * DESCRIPTION
5 * An enumeration containing the states in the timer DFA
6 */
7
8 #define VERSION "0.0.3"
9
10 #ifndef PAGE_ROUND_UP
11 #define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
12 #endif
13 #ifndef ROUND_UP
14 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
15 #endif
16
17 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
18
19 typedef enum _SCSI_PORT_TIMER_STATES
20 {
21 IDETimerIdle,
22 IDETimerCmdWait,
23 IDETimerResetWaitForBusyNegate,
24 IDETimerResetWaitForDrdyAssert
25 } SCSI_PORT_TIMER_STATES;
26
27
28 typedef struct _SCSI_PORT_DEVICE_BASE
29 {
30 LIST_ENTRY List;
31
32 PVOID MappedAddress;
33 ULONG NumberOfBytes;
34 SCSI_PHYSICAL_ADDRESS IoAddress;
35 ULONG SystemIoBusNumber;
36 } SCSI_PORT_DEVICE_BASE, *PSCSI_PORT_DEVICE_BASE;
37
38
39 typedef struct _SCSI_PORT_LUN_EXTENSION
40 {
41 LIST_ENTRY List;
42
43 UCHAR PathId;
44 UCHAR TargetId;
45 UCHAR Lun;
46
47 BOOLEAN DeviceClaimed;
48 PDEVICE_OBJECT DeviceObject;
49
50 INQUIRYDATA InquiryData;
51
52 ULONG PendingIrpCount;
53 ULONG ActiveIrpCount;
54
55 PIRP NextIrp;
56 ULONG Flags;
57
58 /* More data? */
59
60 UCHAR MiniportLunExtension[1]; /* must be the last entry */
61 } SCSI_PORT_LUN_EXTENSION, *PSCSI_PORT_LUN_EXTENSION;
62
63
64 /*
65 * SCSI_PORT_DEVICE_EXTENSION
66 *
67 * DESCRIPTION
68 * First part of the port objects device extension. The second
69 * part is the miniport-specific device extension.
70 */
71
72 typedef struct _SCSI_PORT_DEVICE_EXTENSION
73 {
74 ULONG Length;
75 ULONG MiniPortExtensionSize;
76 PPORT_CONFIGURATION_INFORMATION PortConfig;
77 ULONG PortNumber;
78
79 KSPIN_LOCK Lock;
80 ULONG Flags;
81
82 PKINTERRUPT Interrupt;
83
84 SCSI_PORT_TIMER_STATES TimerState;
85 LONG TimerCount;
86
87 LIST_ENTRY DeviceBaseListHead;
88
89 ULONG LunExtensionSize;
90 LIST_ENTRY LunExtensionListHead;
91
92 ULONG SrbExtensionSize;
93
94 PIO_SCSI_CAPABILITIES PortCapabilities;
95
96 PDEVICE_OBJECT DeviceObject;
97 PCONTROLLER_OBJECT ControllerObject;
98
99 PHW_STARTIO HwStartIo;
100 PHW_INTERRUPT HwInterrupt;
101
102
103 /* DMA related stuff */
104 PADAPTER_OBJECT AdapterObject;
105 ULONG MapRegisterCount;
106
107 PHYSICAL_ADDRESS PhysicalAddress;
108 PVOID VirtualAddress;
109 RTL_BITMAP SrbExtensionAllocMap;
110 ULONG MaxSrbExtensions;
111 ULONG CurrentSrbExtensions;
112 ULONG CommonBufferLength;
113
114 LIST_ENTRY PendingIrpListHead;
115 PIRP NextIrp;
116 ULONG PendingIrpCount;
117 ULONG ActiveIrpCount;
118
119 UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
120 } SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION;
121
122 typedef struct _SCSI_PORT_SCAN_ADAPTER
123 {
124 KEVENT Event;
125 IO_STATUS_BLOCK IoStatusBlock;
126 NTSTATUS Status;
127 PSCSI_PORT_LUN_EXTENSION LunExtension;
128 ULONG Lun;
129 ULONG Bus;
130 ULONG Target;
131 SCSI_REQUEST_BLOCK Srb;
132 UCHAR DataBuffer[256];
133 BOOLEAN Active;
134 } SCSI_PORT_SCAN_ADAPTER, *PSCSI_PORT_SCAN_ADAPTER;
135
136