]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/ScsiIo/ScsiIo.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / ScsiIo / ScsiIo.h
CommitLineData
3eb9473e 1/*++\r
f57387d5
HT
2 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
3 This program and the accompanying materials \r
3eb9473e 4 are licensed and made available under the terms and conditions of the BSD License \r
5 which accompanies this distribution. The full text of the license may be found at \r
6 http://opensource.org/licenses/bsd-license.php \r
7\r
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
10\r
11Module Name:\r
12\r
13 ScsiIo.h\r
14 \r
15Abstract: \r
16 EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.\r
17\r
18Revision History\r
19\r
20--*/\r
21\r
22#ifndef __EFI_SCSI_IO_PROTOCOL_H__\r
23#define __EFI_SCSI_IO_PROTOCOL_H__\r
24\r
25#define EFI_SCSI_IO_PROTOCOL_GUID \\r
26 { \\r
27 0x932f47e6, 0x2362, 0x4002, {0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \\r
28 }\r
29\r
30//\r
31// Forward reference for pure ANSI compatability\r
32//\r
33typedef struct _EFI_SCSI_IO_PROTOCOL EFI_SCSI_IO_PROTOCOL;\r
34\r
35//\r
36// SCSI Data Direction definition\r
37//\r
38#define EFI_SCSI_IO_DATA_DIRECTION_READ 0\r
39#define EFI_SCSI_IO_DATA_DIRECTION_WRITE 1\r
40#define EFI_SCSI_IO_DATA_DIRECTION_BIDIRECTIONAL 2\r
41\r
42//\r
43// SCSI Host Adapter Status definition\r
44//\r
45#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OK 0x00\r
46#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 // timeout when processing the command\r
47#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT 0x0b // timeout when waiting for the command processing\r
48#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d // a message reject was received when processing command\r
49#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_RESET 0x0e // a bus reset was detected\r
50#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f\r
51#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 // the adapter failed in issuing request sense command\r
52#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 // selection timeout\r
53#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 // data overrun or data underrun\r
54#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_FREE 0x13 // Unexepected bus free\r
55#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 // Target bus phase sequence failure\r
56#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OTHER 0x7f\r
57\r
58\r
59//\r
60// SCSI Target Status definition\r
61//\r
62#define EFI_SCSI_IO_STATUS_TARGET_GOOD 0x00\r
63#define EFI_SCSI_IO_STATUS_TARGET_CHECK_CONDITION 0x02 // check condition\r
64#define EFI_SCSI_IO_STATUS_TARGET_CONDITION_MET 0x04 // condition met\r
65#define EFI_SCSI_IO_STATUS_TARGET_BUSY 0x08 // busy\r
66#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE 0x10 // intermediate\r
67#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 // intermediate-condition met\r
68#define EFI_SCSI_IO_STATUS_TARGET_RESERVATION_CONFLICT 0x18 // reservation conflict\r
69#define EFI_SCSI_IO_STATUS_TARGET_COMMOND_TERMINATED 0x22 // command terminated\r
70#define EFI_SCSI_IO_STATUS_TARGET_QUEUE_FULL 0x28 // queue full\r
71\r
72typedef struct {\r
73 UINT64 Timeout;\r
74 VOID *InDataBuffer;\r
75 VOID *OutDataBuffer;\r
76 VOID *SenseData;\r
77 VOID *Cdb;\r
78 UINT32 InTransferLength;\r
79 UINT32 OutTransferLength;\r
80 UINT8 CdbLength;\r
81 UINT8 DataDirection;\r
82 UINT8 HostAdapterStatus;\r
83 UINT8 TargetStatus;\r
84 UINT8 SenseDataLength;\r
85} EFI_SCSI_IO_SCSI_REQUEST_PACKET;\r
86\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE) (\r
90 IN EFI_SCSI_IO_PROTOCOL *This,\r
91 OUT UINT8 *DeviceType\r
92 )\r
93/*++\r
94\r
95 Routine Description:\r
96 Retrieves the device type information of the SCSI Controller.\r
97\r
98 Arguments:\r
99 This - Protocol instance pointer.\r
100 DeviceType - A pointer to the device type information\r
101 retrieved from the SCSI Controller.\r
102\r
103 Returns:\r
104 EFI_SUCCESS - Retrieves the device type information successfully.\r
105 EFI_INVALID_PARAMETER - The DeviceType is NULL.\r
106\r
107--*/\r
108;\r
109\r
110typedef\r
111EFI_STATUS\r
112(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION) (\r
113 IN EFI_SCSI_IO_PROTOCOL *This,\r
114 IN OUT UINT8 **Target,\r
115 OUT UINT64 *Lun\r
116 )\r
117/*++\r
118\r
119 Routine Description:\r
120 Retrieves the device location in the SCSI channel.\r
121\r
122 Arguments:\r
123 This - Protocol instance pointer.\r
124 Target - A pointer to the Target Array which represents ID of a SCSI device\r
125 on the SCSI channel.\r
126 Lun - A pointer to the LUN of the SCSI device on\r
127 the SCSI channel.\r
128\r
129 Returns:\r
130 EFI_SUCCESS - Retrieves the device location successfully.\r
131 EFI_INVALID_PARAMETER - The Target or Lun is NULL.\r
132 \r
133--*/\r
134;\r
135\r
136typedef\r
137EFI_STATUS\r
138(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_BUS) (\r
139 IN EFI_SCSI_IO_PROTOCOL *This\r
140 )\r
141/*++\r
142\r
143 Routine Description:\r
144 Resets the SCSI Bus that the SCSI Controller is attached to.\r
145\r
146 Arguments:\r
147 This - This Protocol instance pointer.\r
148\r
149 Returns:\r
150 EFI_SUCCESS - The SCSI bus is reset successfully.\r
151 EFI_DEVICE_ERROR - Errors encountered when resetting the SCSI bus.\r
152 EFI_UNSUPPORTED - The bus reset operation is not supported by the\r
153 SCSI Host Controller.\r
154 EFI_TIMEOUT - A timeout occurred while attempting to reset\r
155 the SCSI bus.\r
156\r
157--*/\r
158;\r
159\r
160typedef\r
161EFI_STATUS\r
162(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_DEVICE) (\r
163 IN EFI_SCSI_IO_PROTOCOL *This\r
164 )\r
165/*++\r
166\r
167 Routine Description:\r
168 Resets the SCSI Controller that the device handle specifies.\r
169\r
170 Arguments:\r
171 This - Protocol instance pointer.\r
172\r
173 Returns:\r
174 EFI_SUCCESS - Reset the SCSI controller successfully.\r
175 EFI_DEVICE_ERROR - Errors are encountered when resetting the\r
176 SCSI Controller.\r
177 EFI_UNSUPPORTED - The SCSI bus does not support a device\r
178 reset operation.\r
179 EFI_TIMEOUT - A timeout occurred while attempting to\r
180 reset the SCSI Controller.\r
181\r
182--*/\r
183;\r
184\r
185typedef\r
186EFI_STATUS\r
187(EFIAPI *EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND) (\r
188 IN EFI_SCSI_IO_PROTOCOL *This,\r
189 IN OUT EFI_SCSI_IO_SCSI_REQUEST_PACKET *Packet,\r
190 IN EFI_EVENT Event OPTIONAL\r
191 )\r
192/*++\r
193\r
194 Routine Description:\r
195 Sends a SCSI Request Packet to the SCSI Controller for execution.\r
196\r
197 Arguments:\r
198 This - Protocol instance pointer.\r
199 Packet - The SCSI request packet to send to the SCSI\r
200 Controller specified by the device handle.\r
201 Event - If the SCSI bus where the SCSI device is attached\r
202 does not support non-blocking I/O, then Event is\r
203 ignored, and blocking I/O is performed.\r
204 If Event is NULL, then blocking I/O is performed.\r
205 If Event is not NULL and non-blocking I/O is\r
206 supported, then non-blocking I/O is performed,\r
207 and Event will be signaled when the SCSI Request\r
208 Packet completes.\r
209\r
210 Returns:\r
211 EFI_SUCCESS - The SCSI Request Packet was sent by the host\r
212 successfully, and TransferLength bytes were\r
213 transferred to/from DataBuffer.See\r
214 HostAdapterStatus, TargetStatus,\r
215 SenseDataLength, and SenseData in that order\r
216 for additional status information.\r
217 EFI_BAD_BUFFER_SIZE - The SCSI Request Packet was executed,\r
218 but the entire DataBuffer could not be transferred.\r
219 The actual number of bytes transferred is returned\r
220 in TransferLength. See HostAdapterStatus,\r
221 TargetStatus, SenseDataLength, and SenseData in\r
222 that order for additional status information.\r
223 EFI_NOT_READY - The SCSI Request Packet could not be sent because\r
224 there are too many SCSI Command Packets already\r
225 queued.The caller may retry again later.\r
226 EFI_DEVICE_ERROR - A device error occurred while attempting to send\r
227 the SCSI Request Packet. See HostAdapterStatus,\r
228 TargetStatus, SenseDataLength, and SenseData in\r
229 that order for additional status information.\r
230 EFI_INVALID_PARAMETER - The contents of CommandPacket are invalid.\r
231 The SCSI Request Packet was not sent, so no\r
232 additional status information is available.\r
233 EFI_UNSUPPORTED - The command described by the SCSI Request Packet\r
234 is not supported by the SCSI initiator(i.e., SCSI\r
235 Host Controller). The SCSI Request Packet was not\r
236 sent, so no additional status information is\r
237 available.\r
238 EFI_TIMEOUT - A timeout occurred while waiting for the SCSI\r
239 Request Packet to execute. See HostAdapterStatus,\r
240 TargetStatus, SenseDataLength, and SenseData in\r
241 that order for additional status information.\r
242--*/\r
243;\r
244\r
245struct _EFI_SCSI_IO_PROTOCOL {\r
246 EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE GetDeviceType;\r
247 EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION GetDeviceLocation;\r
248 EFI_SCSI_IO_PROTOCOL_RESET_BUS ResetBus;\r
249 EFI_SCSI_IO_PROTOCOL_RESET_DEVICE ResetDevice;\r
250 EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND ExecuteScsiCommand; \r
251 UINT32 IoAlign;\r
252};\r
253\r
254extern EFI_GUID gEfiScsiIoProtocolGuid;\r
255\r
256#endif\r