]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Include/Library/EdkScsiLib.h
1. Fixed one bug in UpdateDataCheck().
[mirror_edk2.git] / EdkModulePkg / Include / Library / EdkScsiLib.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 ScsiLib.h
15
16 Abstract:
17
18 Common Libarary for SCSI
19
20 Revision History
21
22 --*/
23
24 #ifndef _SCSI_LIB_H
25 #define _SCSI_LIB_H
26
27 //
28 // the time unit is 100ns, since the SCSI I/O defines timeout in 100ns unit.
29 //
30 #define EFI_SCSI_STALL_1_MICROSECOND 10
31 #define EFI_SCSI_STALL_1_MILLISECOND 10000
32 #define EFI_SCSI_STALL_1_SECOND 10000000
33
34 //
35 // this macro cannot be directly used by the gBS->Stall(),
36 // since the value output by this macro is in 100ns unit,
37 // not 1us unit (1us = 1000ns)
38 //
39 #define EfiScsiStallSeconds(a) (a) * EFI_SCSI_STALL_1_SECOND
40
41 EFI_STATUS
42 SubmitTestUnitReadyCommand (
43 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
44 IN UINT64 Timeout,
45 OUT VOID *SenseData,
46 OUT UINT8 *SenseDataLength,
47 OUT UINT8 *HostAdapterStatus,
48 OUT UINT8 *TargetStatus
49 )
50 /*++
51
52 Routine Description:
53
54 TODO: Add function description
55
56 Arguments:
57
58 ScsiIo - TODO: add argument description
59 Timeout - TODO: add argument description
60 SenseData - TODO: add argument description
61 SenseDataLength - TODO: add argument description
62 HostAdapterStatus - TODO: add argument description
63 TargetStatus - TODO: add argument description
64
65 Returns:
66
67 TODO: add return values
68
69 --*/
70 ;
71
72 EFI_STATUS
73 SubmitInquiryCommand (
74 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
75 IN UINT64 Timeout,
76 IN VOID *SenseData,
77 IN OUT UINT8 *SenseDataLength,
78 OUT UINT8 *HostAdapterStatus,
79 OUT UINT8 *TargetStatus,
80 IN OUT VOID *InquiryDataBuffer,
81 IN OUT UINT32 *InquiryDataLength,
82 IN BOOLEAN EnableVitalProductData
83 )
84 /*++
85
86 Routine Description:
87
88 TODO: Add function description
89
90 Arguments:
91
92 ScsiIo - TODO: add argument description
93 Timeout - TODO: add argument description
94 SenseData - TODO: add argument description
95 SenseDataLength - TODO: add argument description
96 HostAdapterStatus - TODO: add argument description
97 TargetStatus - TODO: add argument description
98 InquiryDataBuffer - TODO: add argument description
99 InquiryDataLength - TODO: add argument description
100 EnableVitalProductData - TODO: add argument description
101
102 Returns:
103
104 TODO: add return values
105
106 --*/
107 ;
108
109 EFI_STATUS
110 SubmitModeSense10Command (
111 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
112 IN UINT64 Timeout,
113 IN VOID *SenseData,
114 IN OUT UINT8 *SenseDataLength,
115 OUT UINT8 *HostAdapterStatus,
116 OUT UINT8 *TargetStatus,
117 IN VOID *DataBuffer,
118 IN OUT UINT32 *DataLength,
119 IN UINT8 DBDField, OPTIONAL
120 IN UINT8 PageControl,
121 IN UINT8 PageCode
122 )
123 /*++
124
125 Routine Description:
126
127 TODO: Add function description
128
129 Arguments:
130
131 ScsiIo - TODO: add argument description
132 Timeout - TODO: add argument description
133 SenseData - TODO: add argument description
134 SenseDataLength - TODO: add argument description
135 HostAdapterStatus - TODO: add argument description
136 TargetStatus - TODO: add argument description
137 DataBuffer - TODO: add argument description
138 DataLength - TODO: add argument description
139 DBDField - TODO: add argument description
140 PageControl - TODO: add argument description
141 PageCode - TODO: add argument description
142
143 Returns:
144
145 TODO: add return values
146
147 --*/
148 ;
149
150 EFI_STATUS
151 SubmitRequestSenseCommand (
152 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
153 IN UINT64 Timeout,
154 IN VOID *SenseData,
155 IN OUT UINT8 *SenseDataLength,
156 OUT UINT8 *HostAdapterStatus,
157 OUT UINT8 *TargetStatus
158 )
159 /*++
160
161 Routine Description:
162
163 TODO: Add function description
164
165 Arguments:
166
167 ScsiIo - TODO: add argument description
168 Timeout - TODO: add argument description
169 SenseData - TODO: add argument description
170 SenseDataLength - TODO: add argument description
171 HostAdapterStatus - TODO: add argument description
172 TargetStatus - TODO: add argument description
173
174 Returns:
175
176 TODO: add return values
177
178 --*/
179 ;
180
181 //
182 // Commands for direct access command
183 //
184 EFI_STATUS
185 SubmitReadCapacityCommand (
186 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
187 IN UINT64 Timeout,
188 IN VOID *SenseData,
189 IN OUT UINT8 *SenseDataLength,
190 OUT UINT8 *HostAdapterStatus,
191 OUT UINT8 *TargetStatus,
192 OUT VOID *DataBuffer,
193 IN OUT UINT32 *DataLength,
194 IN BOOLEAN PMI
195 )
196 /*++
197
198 Routine Description:
199
200 TODO: Add function description
201
202 Arguments:
203
204 ScsiIo - TODO: add argument description
205 Timeout - TODO: add argument description
206 SenseData - TODO: add argument description
207 SenseDataLength - TODO: add argument description
208 HostAdapterStatus - TODO: add argument description
209 TargetStatus - TODO: add argument description
210 DataBuffer - TODO: add argument description
211 DataLength - TODO: add argument description
212 PMI - TODO: add argument description
213
214 Returns:
215
216 TODO: add return values
217
218 --*/
219 ;
220
221 EFI_STATUS
222 SubmitRead10Command (
223 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
224 IN UINT64 Timeout,
225 IN VOID *SenseData,
226 IN OUT UINT8 *SenseDataLength,
227 OUT UINT8 *HostAdapterStatus,
228 OUT UINT8 *TargetStatus,
229 OUT VOID *DataBuffer,
230 IN OUT UINT32 *DataLength,
231 IN UINT32 StartLba,
232 IN UINT32 SectorSize
233 )
234 /*++
235
236 Routine Description:
237
238 TODO: Add function description
239
240 Arguments:
241
242 ScsiIo - TODO: add argument description
243 Timeout - TODO: add argument description
244 SenseData - TODO: add argument description
245 SenseDataLength - TODO: add argument description
246 HostAdapterStatus - TODO: add argument description
247 TargetStatus - TODO: add argument description
248 DataBuffer - TODO: add argument description
249 DataLength - TODO: add argument description
250 StartLba - TODO: add argument description
251 SectorSize - TODO: add argument description
252
253 Returns:
254
255 TODO: add return values
256
257 --*/
258 ;
259
260 EFI_STATUS
261 SubmitWrite10Command (
262 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
263 IN UINT64 Timeout,
264 IN VOID *SenseData,
265 IN OUT UINT8 *SenseDataLength,
266 OUT UINT8 *HostAdapterStatus,
267 OUT UINT8 *TargetStatus,
268 OUT VOID *DataBuffer,
269 IN OUT UINT32 *DataLength,
270 IN UINT32 StartLba,
271 IN UINT32 SectorSize
272 )
273 /*++
274
275 Routine Description:
276
277 TODO: Add function description
278
279 Arguments:
280
281 ScsiIo - TODO: add argument description
282 Timeout - TODO: add argument description
283 SenseData - TODO: add argument description
284 SenseDataLength - TODO: add argument description
285 HostAdapterStatus - TODO: add argument description
286 TargetStatus - TODO: add argument description
287 DataBuffer - TODO: add argument description
288 DataLength - TODO: add argument description
289 StartLba - TODO: add argument description
290 SectorSize - TODO: add argument description
291
292 Returns:
293
294 TODO: add return values
295
296 --*/
297 ;
298
299 #endif