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
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.
18 Common Libarary for SCSI
28 // the time unit is 100ns, since the SCSI I/O defines timeout in 100ns unit.
30 #define EFI_SCSI_STALL_1_MICROSECOND 10
31 #define EFI_SCSI_STALL_1_MILLISECOND 10000
32 #define EFI_SCSI_STALL_1_SECOND 10000000
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)
39 #define EfiScsiStallSeconds(a) (a) * EFI_SCSI_STALL_1_SECOND
42 SubmitTestUnitReadyCommand (
43 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
46 OUT UINT8
*SenseDataLength
,
47 OUT UINT8
*HostAdapterStatus
,
48 OUT UINT8
*TargetStatus
54 TODO: Add function description
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
67 TODO: add return values
73 SubmitInquiryCommand (
74 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
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
88 TODO: Add function description
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
104 TODO: add return values
110 SubmitModeSense10Command (
111 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
114 IN OUT UINT8
*SenseDataLength
,
115 OUT UINT8
*HostAdapterStatus
,
116 OUT UINT8
*TargetStatus
,
118 IN OUT UINT32
*DataLength
,
119 IN UINT8 DBDField
, OPTIONAL
120 IN UINT8 PageControl
,
127 TODO: Add function description
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
145 TODO: add return values
151 SubmitRequestSenseCommand (
152 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
155 IN OUT UINT8
*SenseDataLength
,
156 OUT UINT8
*HostAdapterStatus
,
157 OUT UINT8
*TargetStatus
163 TODO: Add function description
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
176 TODO: add return values
182 // Commands for direct access command
185 SubmitReadCapacityCommand (
186 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
189 IN OUT UINT8
*SenseDataLength
,
190 OUT UINT8
*HostAdapterStatus
,
191 OUT UINT8
*TargetStatus
,
192 OUT VOID
*DataBuffer
,
193 IN OUT UINT32
*DataLength
,
200 TODO: Add function description
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
216 TODO: add return values
222 SubmitRead10Command (
223 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
226 IN OUT UINT8
*SenseDataLength
,
227 OUT UINT8
*HostAdapterStatus
,
228 OUT UINT8
*TargetStatus
,
229 OUT VOID
*DataBuffer
,
230 IN OUT UINT32
*DataLength
,
238 TODO: Add function description
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
255 TODO: add return values
261 SubmitWrite10Command (
262 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
265 IN OUT UINT8
*SenseDataLength
,
266 OUT UINT8
*HostAdapterStatus
,
267 OUT UINT8
*TargetStatus
,
268 OUT VOID
*DataBuffer
,
269 IN OUT UINT32
*DataLength
,
277 TODO: Add function description
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
294 TODO: add return values