]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
MdeModulePkg: Convert all .uni files to utf-8
[mirror_edk2.git] / MdeModulePkg / Bus / Scsi / ScsiDiskDxe / ScsiDisk.h
1 /** @file
2 Header file for SCSI Disk Driver.
3
4 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _SCSI_DISK_H_
16 #define _SCSI_DISK_H_
17
18
19 #include <Uefi.h>
20
21
22 #include <Protocol/ScsiIo.h>
23 #include <Protocol/ComponentName.h>
24 #include <Protocol/BlockIo.h>
25 #include <Protocol/BlockIo2.h>
26 #include <Protocol/DriverBinding.h>
27 #include <Protocol/ScsiPassThruExt.h>
28 #include <Protocol/ScsiPassThru.h>
29 #include <Protocol/DiskInfo.h>
30
31
32 #include <Library/DebugLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/UefiLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/MemoryAllocationLib.h>
37 #include <Library/UefiScsiLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/DevicePathLib.h>
40
41 #include <IndustryStandard/Scsi.h>
42 #include <IndustryStandard/Atapi.h>
43
44 #define IS_DEVICE_FIXED(a) (a)->FixedDevice ? 1 : 0
45
46 #define SCSI_DISK_DEV_SIGNATURE SIGNATURE_32 ('s', 'c', 'd', 'k')
47
48 typedef struct {
49 UINT32 Signature;
50
51 EFI_HANDLE Handle;
52
53 EFI_BLOCK_IO_PROTOCOL BlkIo;
54 EFI_BLOCK_IO2_PROTOCOL BlkIo2;
55 EFI_BLOCK_IO_MEDIA BlkIoMedia;
56 EFI_SCSI_IO_PROTOCOL *ScsiIo;
57 UINT8 DeviceType;
58 BOOLEAN FixedDevice;
59 UINT16 Reserved;
60
61 EFI_SCSI_SENSE_DATA *SenseData;
62 UINTN SenseDataNumber;
63 EFI_SCSI_INQUIRY_DATA InquiryData;
64
65 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
66
67 EFI_DISK_INFO_PROTOCOL DiskInfo;
68
69 //
70 // The following fields are only valid for ATAPI/SATA device
71 //
72 UINT32 Channel;
73 UINT32 Device;
74 ATAPI_IDENTIFY_DATA IdentifyData;
75
76 //
77 // The flag indicates if 16-byte command can be used
78 //
79 BOOLEAN Cdb16Byte;
80
81 //
82 // The queue for BlockIo2 requests
83 //
84 LIST_ENTRY BlkIo2Queue;
85 } SCSI_DISK_DEV;
86
87 #define SCSI_DISK_DEV_FROM_BLKIO(a) CR (a, SCSI_DISK_DEV, BlkIo, SCSI_DISK_DEV_SIGNATURE)
88 #define SCSI_DISK_DEV_FROM_BLKIO2(a) CR (a, SCSI_DISK_DEV, BlkIo2, SCSI_DISK_DEV_SIGNATURE)
89
90 #define SCSI_DISK_DEV_FROM_DISKINFO(a) CR (a, SCSI_DISK_DEV, DiskInfo, SCSI_DISK_DEV_SIGNATURE)
91
92 //
93 // Asynchronous I/O request
94 //
95 //
96 // Private data structure for a BlockIo2 request
97 //
98 typedef struct {
99 EFI_BLOCK_IO2_TOKEN *Token;
100 //
101 // The queue for Scsi Read/Write requests of a BlockIo2
102 //
103 LIST_ENTRY ScsiRWQueue;
104
105 LIST_ENTRY Link;
106 } SCSI_BLKIO2_REQUEST;
107
108 //
109 // Private data structure for a SCSI Read/Write request
110 //
111 typedef struct {
112 SCSI_DISK_DEV *ScsiDiskDevice;
113 UINT64 Timeout;
114 EFI_SCSI_SENSE_DATA *SenseData;
115 UINT8 SenseDataLength;
116 UINT8 HostAdapterStatus;
117 UINT8 TargetStatus;
118 UINT8 *InBuffer;
119 UINT8 *OutBuffer;
120 UINT32 DataLength;
121 UINT64 StartLba;
122 UINT32 SectorCount;
123 UINT8 TimesRetry;
124
125 //
126 // The BlockIo2 request this SCSI command belongs to
127 //
128 SCSI_BLKIO2_REQUEST *BlkIo2Req;
129
130 LIST_ENTRY Link;
131 } SCSI_ASYNC_RW_REQUEST;
132
133 //
134 // Global Variables
135 //
136 extern EFI_DRIVER_BINDING_PROTOCOL gScsiDiskDriverBinding;
137 extern EFI_COMPONENT_NAME_PROTOCOL gScsiDiskComponentName;
138 extern EFI_COMPONENT_NAME2_PROTOCOL gScsiDiskComponentName2;
139 //
140 // action code used in detect media process
141 //
142 #define ACTION_NO_ACTION 0x00
143 #define ACTION_READ_CAPACITY 0x01
144 #define ACTION_RETRY_COMMAND_LATER 0x02
145 #define ACTION_RETRY_WITH_BACKOFF_ALGO 0x03
146
147 #define SCSI_COMMAND_VERSION_1 0x01
148 #define SCSI_COMMAND_VERSION_2 0x02
149 #define SCSI_COMMAND_VERSION_3 0x03
150
151 //
152 // SCSI Disk Timeout Experience Value
153 //
154 #define SCSI_DISK_TIMEOUT EFI_TIMER_PERIOD_SECONDS (3)
155
156 /**
157 Test to see if this driver supports ControllerHandle.
158
159 This service is called by the EFI boot service ConnectController(). In order
160 to make drivers as small as possible, there are a few calling restrictions for
161 this service. ConnectController() must follow these calling restrictions.
162 If any other agent wishes to call Supported() it must also follow these
163 calling restrictions.
164
165 @param This Protocol instance pointer.
166 @param ControllerHandle Handle of device to test
167 @param RemainingDevicePath Optional parameter use to pick a specific child
168 device to start.
169
170 @retval EFI_SUCCESS This driver supports this device
171 @retval EFI_ALREADY_STARTED This driver is already running on this device
172 @retval other This driver does not support this device
173
174 **/
175 EFI_STATUS
176 EFIAPI
177 ScsiDiskDriverBindingSupported (
178 IN EFI_DRIVER_BINDING_PROTOCOL *This,
179 IN EFI_HANDLE Controller,
180 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
181 );
182
183 /**
184 Start this driver on ControllerHandle.
185
186 This service is called by the EFI boot service ConnectController(). In order
187 to make drivers as small as possible, there are a few calling restrictions for
188 this service. ConnectController() must follow these calling restrictions. If
189 any other agent wishes to call Start() it must also follow these calling
190 restrictions.
191
192 @param This Protocol instance pointer.
193 @param ControllerHandle Handle of device to bind driver to
194 @param RemainingDevicePath Optional parameter use to pick a specific child
195 device to start.
196
197 @retval EFI_SUCCESS This driver is added to ControllerHandle
198 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
199 @retval other This driver does not support this device
200
201 **/
202 EFI_STATUS
203 EFIAPI
204 ScsiDiskDriverBindingStart (
205 IN EFI_DRIVER_BINDING_PROTOCOL *This,
206 IN EFI_HANDLE Controller,
207 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
208 );
209
210 /**
211 Stop this driver on ControllerHandle.
212
213 This service is called by the EFI boot service DisconnectController().
214 In order to make drivers as small as possible, there are a few calling
215 restrictions for this service. DisconnectController() must follow these
216 calling restrictions. If any other agent wishes to call Stop() it must
217 also follow these calling restrictions.
218
219 @param This Protocol instance pointer.
220 @param ControllerHandle Handle of device to stop driver on
221 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
222 children is zero stop the entire bus driver.
223 @param ChildHandleBuffer List of Child Handles to Stop.
224
225 @retval EFI_SUCCESS This driver is removed ControllerHandle
226 @retval other This driver was not removed from this device
227
228 **/
229 EFI_STATUS
230 EFIAPI
231 ScsiDiskDriverBindingStop (
232 IN EFI_DRIVER_BINDING_PROTOCOL *This,
233 IN EFI_HANDLE Controller,
234 IN UINTN NumberOfChildren,
235 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
236 );
237
238 //
239 // EFI Component Name Functions
240 //
241 /**
242 Retrieves a Unicode string that is the user readable name of the driver.
243
244 This function retrieves the user readable name of a driver in the form of a
245 Unicode string. If the driver specified by This has a user readable name in
246 the language specified by Language, then a pointer to the driver name is
247 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
248 by This does not support the language specified by Language,
249 then EFI_UNSUPPORTED is returned.
250
251 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
252 EFI_COMPONENT_NAME_PROTOCOL instance.
253
254 @param Language A pointer to a Null-terminated ASCII string
255 array indicating the language. This is the
256 language of the driver name that the caller is
257 requesting, and it must match one of the
258 languages specified in SupportedLanguages. The
259 number of languages supported by a driver is up
260 to the driver writer. Language is specified
261 in RFC 4646 or ISO 639-2 language code format.
262
263 @param DriverName A pointer to the Unicode string to return.
264 This Unicode string is the name of the
265 driver specified by This in the language
266 specified by Language.
267
268 @retval EFI_SUCCESS The Unicode string for the Driver specified by
269 This and the language specified by Language was
270 returned in DriverName.
271
272 @retval EFI_INVALID_PARAMETER Language is NULL.
273
274 @retval EFI_INVALID_PARAMETER DriverName is NULL.
275
276 @retval EFI_UNSUPPORTED The driver specified by This does not support
277 the language specified by Language.
278
279 **/
280 EFI_STATUS
281 EFIAPI
282 ScsiDiskComponentNameGetDriverName (
283 IN EFI_COMPONENT_NAME_PROTOCOL *This,
284 IN CHAR8 *Language,
285 OUT CHAR16 **DriverName
286 );
287
288
289 /**
290 Retrieves a Unicode string that is the user readable name of the controller
291 that is being managed by a driver.
292
293 This function retrieves the user readable name of the controller specified by
294 ControllerHandle and ChildHandle in the form of a Unicode string. If the
295 driver specified by This has a user readable name in the language specified by
296 Language, then a pointer to the controller name is returned in ControllerName,
297 and EFI_SUCCESS is returned. If the driver specified by This is not currently
298 managing the controller specified by ControllerHandle and ChildHandle,
299 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
300 support the language specified by Language, then EFI_UNSUPPORTED is returned.
301
302 @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
303 EFI_COMPONENT_NAME_PROTOCOL instance.
304
305 @param ControllerHandle The handle of a controller that the driver
306 specified by This is managing. This handle
307 specifies the controller whose name is to be
308 returned.
309
310 @param ChildHandle The handle of the child controller to retrieve
311 the name of. This is an optional parameter that
312 may be NULL. It will be NULL for device
313 drivers. It will also be NULL for a bus drivers
314 that wish to retrieve the name of the bus
315 controller. It will not be NULL for a bus
316 driver that wishes to retrieve the name of a
317 child controller.
318
319 @param Language A pointer to a Null-terminated ASCII string
320 array indicating the language. This is the
321 language of the driver name that the caller is
322 requesting, and it must match one of the
323 languages specified in SupportedLanguages. The
324 number of languages supported by a driver is up
325 to the driver writer. Language is specified in
326 RFC 4646 or ISO 639-2 language code format.
327
328 @param ControllerName A pointer to the Unicode string to return.
329 This Unicode string is the name of the
330 controller specified by ControllerHandle and
331 ChildHandle in the language specified by
332 Language from the point of view of the driver
333 specified by This.
334
335 @retval EFI_SUCCESS The Unicode string for the user readable name in
336 the language specified by Language for the
337 driver specified by This was returned in
338 DriverName.
339
340 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
341
342 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
343 EFI_HANDLE.
344
345 @retval EFI_INVALID_PARAMETER Language is NULL.
346
347 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
348
349 @retval EFI_UNSUPPORTED The driver specified by This is not currently
350 managing the controller specified by
351 ControllerHandle and ChildHandle.
352
353 @retval EFI_UNSUPPORTED The driver specified by This does not support
354 the language specified by Language.
355
356 **/
357 EFI_STATUS
358 EFIAPI
359 ScsiDiskComponentNameGetControllerName (
360 IN EFI_COMPONENT_NAME_PROTOCOL *This,
361 IN EFI_HANDLE ControllerHandle,
362 IN EFI_HANDLE ChildHandle OPTIONAL,
363 IN CHAR8 *Language,
364 OUT CHAR16 **ControllerName
365 );
366
367 /**
368 Reset SCSI Disk.
369
370
371 @param This The pointer of EFI_BLOCK_IO_PROTOCOL
372 @param ExtendedVerification The flag about if extend verificate
373
374 @retval EFI_SUCCESS The device was reset.
375 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
376 not be reset.
377 @return EFI_STATUS is retured from EFI_SCSI_IO_PROTOCOL.ResetDevice().
378
379 **/
380 EFI_STATUS
381 EFIAPI
382 ScsiDiskReset (
383 IN EFI_BLOCK_IO_PROTOCOL *This,
384 IN BOOLEAN ExtendedVerification
385 );
386
387
388 /**
389 The function is to Read Block from SCSI Disk.
390
391 @param This The pointer of EFI_BLOCK_IO_PROTOCOL.
392 @param MediaId The Id of Media detected
393 @param Lba The logic block address
394 @param BufferSize The size of Buffer
395 @param Buffer The buffer to fill the read out data
396
397 @retval EFI_SUCCESS Successfully to read out block.
398 @retval EFI_DEVICE_ERROR Fail to detect media.
399 @retval EFI_NO_MEDIA Media is not present.
400 @retval EFI_MEDIA_CHANGED Media has changed.
401 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
402 @retval EFI_INVALID_PARAMETER Invalid parameter passed in.
403
404 **/
405 EFI_STATUS
406 EFIAPI
407 ScsiDiskReadBlocks (
408 IN EFI_BLOCK_IO_PROTOCOL *This,
409 IN UINT32 MediaId,
410 IN EFI_LBA Lba,
411 IN UINTN BufferSize,
412 OUT VOID *Buffer
413 );
414
415
416 /**
417 The function is to Write Block to SCSI Disk.
418
419 @param This The pointer of EFI_BLOCK_IO_PROTOCOL
420 @param MediaId The Id of Media detected
421 @param Lba The logic block address
422 @param BufferSize The size of Buffer
423 @param Buffer The buffer to fill the read out data
424
425 @retval EFI_SUCCESS Successfully to read out block.
426 @retval EFI_WRITE_PROTECTED The device can not be written to.
427 @retval EFI_DEVICE_ERROR Fail to detect media.
428 @retval EFI_NO_MEDIA Media is not present.
429 @retval EFI_MEDIA_CHNAGED Media has changed.
430 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
431 @retval EFI_INVALID_PARAMETER Invalid parameter passed in.
432
433 **/
434 EFI_STATUS
435 EFIAPI
436 ScsiDiskWriteBlocks (
437 IN EFI_BLOCK_IO_PROTOCOL *This,
438 IN UINT32 MediaId,
439 IN EFI_LBA Lba,
440 IN UINTN BufferSize,
441 IN VOID *Buffer
442 );
443
444
445 /**
446 Flush Block to Disk.
447
448 EFI_SUCCESS is returned directly.
449
450 @param This The pointer of EFI_BLOCK_IO_PROTOCOL
451
452 @retval EFI_SUCCESS All outstanding data was written to the device
453
454 **/
455 EFI_STATUS
456 EFIAPI
457 ScsiDiskFlushBlocks (
458 IN EFI_BLOCK_IO_PROTOCOL *This
459 );
460
461
462 /**
463 Reset SCSI Disk.
464
465 @param This The pointer of EFI_BLOCK_IO2_PROTOCOL.
466 @param ExtendedVerification The flag about if extend verificate.
467
468 @retval EFI_SUCCESS The device was reset.
469 @retval EFI_DEVICE_ERROR The device is not functioning properly and could
470 not be reset.
471 @return EFI_STATUS is returned from EFI_SCSI_IO_PROTOCOL.ResetDevice().
472
473 **/
474 EFI_STATUS
475 EFIAPI
476 ScsiDiskResetEx (
477 IN EFI_BLOCK_IO2_PROTOCOL *This,
478 IN BOOLEAN ExtendedVerification
479 );
480
481 /**
482 The function is to Read Block from SCSI Disk.
483
484 @param This The pointer of EFI_BLOCK_IO_PROTOCOL.
485 @param MediaId The Id of Media detected.
486 @param Lba The logic block address.
487 @param Token A pointer to the token associated with the transaction.
488 @param BufferSize The size of Buffer.
489 @param Buffer The buffer to fill the read out data.
490
491 @retval EFI_SUCCESS The read request was queued if Token-> Event is
492 not NULL. The data was read correctly from the
493 device if theToken-> Event is NULL.
494 @retval EFI_DEVICE_ERROR The device reported an error while attempting
495 to perform the read operation.
496 @retval EFI_NO_MEDIA There is no media in the device.
497 @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
498 @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
499 the intrinsic block size of the device.
500 @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not
501 valid, or the buffer is not on proper
502 alignment.
503 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
504 lack of resources.
505
506 **/
507 EFI_STATUS
508 EFIAPI
509 ScsiDiskReadBlocksEx (
510 IN EFI_BLOCK_IO2_PROTOCOL *This,
511 IN UINT32 MediaId,
512 IN EFI_LBA Lba,
513 IN OUT EFI_BLOCK_IO2_TOKEN *Token,
514 IN UINTN BufferSize,
515 OUT VOID *Buffer
516 );
517
518 /**
519 The function is to Write Block to SCSI Disk.
520
521 @param This The pointer of EFI_BLOCK_IO_PROTOCOL.
522 @param MediaId The Id of Media detected.
523 @param Lba The logic block address.
524 @param Token A pointer to the token associated with the transaction.
525 @param BufferSize The size of Buffer.
526 @param Buffer The buffer to fill the read out data.
527
528 @retval EFI_SUCCESS The data were written correctly to the device.
529 @retval EFI_WRITE_PROTECTED The device cannot be written to.
530 @retval EFI_NO_MEDIA There is no media in the device.
531 @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
532 @retval EFI_DEVICE_ERROR The device reported an error while attempting
533 to perform the write operation.
534 @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of
535 the intrinsic block size of the device.
536 @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not
537 valid, or the buffer is not on proper
538 alignment.
539
540 **/
541 EFI_STATUS
542 EFIAPI
543 ScsiDiskWriteBlocksEx (
544 IN EFI_BLOCK_IO2_PROTOCOL *This,
545 IN UINT32 MediaId,
546 IN EFI_LBA Lba,
547 IN OUT EFI_BLOCK_IO2_TOKEN *Token,
548 IN UINTN BufferSize,
549 IN VOID *Buffer
550 );
551
552 /**
553 Flush the Block Device.
554
555 @param This Indicates a pointer to the calling context.
556 @param Token A pointer to the token associated with the transaction.
557
558 @retval EFI_SUCCESS All outstanding data was written to the device.
559 @retval EFI_DEVICE_ERROR The device reported an error while writing back the
560 data.
561 @retval EFI_NO_MEDIA There is no media in the device.
562
563 **/
564 EFI_STATUS
565 EFIAPI
566 ScsiDiskFlushBlocksEx (
567 IN EFI_BLOCK_IO2_PROTOCOL *This,
568 IN OUT EFI_BLOCK_IO2_TOKEN *Token
569 );
570
571
572 /**
573 Provides inquiry information for the controller type.
574
575 This function is used by the IDE bus driver to get inquiry data. Data format
576 of Identify data is defined by the Interface GUID.
577
578 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
579 @param[in, out] InquiryData Pointer to a buffer for the inquiry data.
580 @param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
581
582 @retval EFI_SUCCESS The command was accepted without any errors.
583 @retval EFI_NOT_FOUND Device does not support this data class
584 @retval EFI_DEVICE_ERROR Error reading InquiryData from device
585 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
586
587 **/
588 EFI_STATUS
589 EFIAPI
590 ScsiDiskInfoInquiry (
591 IN EFI_DISK_INFO_PROTOCOL *This,
592 IN OUT VOID *InquiryData,
593 IN OUT UINT32 *InquiryDataSize
594 );
595
596
597 /**
598 Provides identify information for the controller type.
599
600 This function is used by the IDE bus driver to get identify data. Data format
601 of Identify data is defined by the Interface GUID.
602
603 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
604 instance.
605 @param[in, out] IdentifyData Pointer to a buffer for the identify data.
606 @param[in, out] IdentifyDataSize Pointer to the value for the identify data
607 size.
608
609 @retval EFI_SUCCESS The command was accepted without any errors.
610 @retval EFI_NOT_FOUND Device does not support this data class
611 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
612 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
613
614 **/
615 EFI_STATUS
616 EFIAPI
617 ScsiDiskInfoIdentify (
618 IN EFI_DISK_INFO_PROTOCOL *This,
619 IN OUT VOID *IdentifyData,
620 IN OUT UINT32 *IdentifyDataSize
621 );
622
623
624 /**
625 Provides sense data information for the controller type.
626
627 This function is used by the IDE bus driver to get sense data.
628 Data format of Sense data is defined by the Interface GUID.
629
630 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
631 @param[in, out] SenseData Pointer to the SenseData.
632 @param[in, out] SenseDataSize Size of SenseData in bytes.
633 @param[out] SenseDataNumber Pointer to the value for the sense data size.
634
635 @retval EFI_SUCCESS The command was accepted without any errors.
636 @retval EFI_NOT_FOUND Device does not support this data class.
637 @retval EFI_DEVICE_ERROR Error reading SenseData from device.
638 @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
639
640 **/
641 EFI_STATUS
642 EFIAPI
643 ScsiDiskInfoSenseData (
644 IN EFI_DISK_INFO_PROTOCOL *This,
645 IN OUT VOID *SenseData,
646 IN OUT UINT32 *SenseDataSize,
647 OUT UINT8 *SenseDataNumber
648 );
649
650 /**
651 This function is used by the IDE bus driver to get controller information.
652
653 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
654 @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
655 @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
656
657 @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
658 @retval EFI_UNSUPPORTED This is not an IDE device.
659
660 **/
661 EFI_STATUS
662 EFIAPI
663 ScsiDiskInfoWhichIde (
664 IN EFI_DISK_INFO_PROTOCOL *This,
665 OUT UINT32 *IdeChannel,
666 OUT UINT32 *IdeDevice
667 );
668
669
670 /**
671 Detect Device and read out capacity ,if error occurs, parse the sense key.
672
673 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
674 @param MustReadCapacity The flag about reading device capacity
675 @param MediaChange The pointer of flag indicates if media has changed
676
677 @retval EFI_DEVICE_ERROR Indicates that error occurs
678 @retval EFI_SUCCESS Successfully to detect media
679
680 **/
681 EFI_STATUS
682 ScsiDiskDetectMedia (
683 IN SCSI_DISK_DEV *ScsiDiskDevice,
684 IN BOOLEAN MustReadCapacity,
685 OUT BOOLEAN *MediaChange
686 );
687
688 /**
689 To test device.
690
691 When Test Unit Ready command succeeds, retrieve Sense Keys via Request Sense;
692 When Test Unit Ready command encounters any error caused by host adapter or
693 target, return error without retrieving Sense Keys.
694
695 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
696 @param NeedRetry The pointer of flag indicates try again
697 @param SenseDataArray The pointer of an array of sense data
698 @param NumberOfSenseKeys The pointer of the number of sense data array
699
700 @retval EFI_DEVICE_ERROR Indicates that error occurs
701 @retval EFI_SUCCESS Successfully to test unit
702
703 **/
704 EFI_STATUS
705 ScsiDiskTestUnitReady (
706 IN SCSI_DISK_DEV *ScsiDiskDevice,
707 OUT BOOLEAN *NeedRetry,
708 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
709 OUT UINTN *NumberOfSenseKeys
710 );
711
712
713 /**
714 Parsing Sense Keys which got from request sense command.
715
716 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
717 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
718 @param NumberOfSenseKeys The number of sense key
719 @param Action The pointer of action which indicates what is need to do next
720
721 @retval EFI_DEVICE_ERROR Indicates that error occurs
722 @retval EFI_SUCCESS Successfully to complete the parsing
723
724 **/
725 EFI_STATUS
726 DetectMediaParsingSenseKeys (
727 OUT SCSI_DISK_DEV *ScsiDiskDevice,
728 IN EFI_SCSI_SENSE_DATA *SenseData,
729 IN UINTN NumberOfSenseKeys,
730 OUT UINTN *Action
731 );
732
733
734 /**
735 Send read capacity command to device and get the device parameter.
736
737 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
738 @param NeedRetry The pointer of flag indicates if need a retry
739 @param SenseDataArray The pointer of an array of sense data
740 @param NumberOfSenseKeys The number of sense key
741
742 @retval EFI_DEVICE_ERROR Indicates that error occurs
743 @retval EFI_SUCCESS Successfully to read capacity
744
745 **/
746 EFI_STATUS
747 ScsiDiskReadCapacity (
748 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
749 OUT BOOLEAN *NeedRetry,
750 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
751 OUT UINTN *NumberOfSenseKeys
752 );
753
754 /**
755 Check the HostAdapter status and re-interpret it in EFI_STATUS.
756
757 @param HostAdapterStatus Host Adapter status
758
759 @retval EFI_SUCCESS Host adapter is OK.
760 @retval EFI_TIMEOUT Timeout.
761 @retval EFI_NOT_READY Adapter NOT ready.
762 @retval EFI_DEVICE_ERROR Adapter device error.
763
764 **/
765 EFI_STATUS
766 CheckHostAdapterStatus (
767 IN UINT8 HostAdapterStatus
768 );
769
770
771 /**
772 Check the target status and re-interpret it in EFI_STATUS.
773
774 @param TargetStatus Target status
775
776 @retval EFI_NOT_READY Device is NOT ready.
777 @retval EFI_DEVICE_ERROR
778 @retval EFI_SUCCESS
779
780 **/
781 EFI_STATUS
782 CheckTargetStatus (
783 IN UINT8 TargetStatus
784 );
785
786 /**
787 Retrieve all sense keys from the device.
788
789 When encountering error during the process, if retrieve sense keys before
790 error encountered, it returns the sense keys with return status set to EFI_SUCCESS,
791 and NeedRetry set to FALSE; otherwize, return the proper return status.
792
793 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
794 @param NeedRetry The pointer of flag indicates if need a retry
795 @param SenseDataArray The pointer of an array of sense data
796 @param NumberOfSenseKeys The number of sense key
797 @param AskResetIfError The flag indicates if need reset when error occurs
798
799 @retval EFI_DEVICE_ERROR Indicates that error occurs
800 @retval EFI_SUCCESS Successfully to request sense key
801
802 **/
803 EFI_STATUS
804 ScsiDiskRequestSenseKeys (
805 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
806 OUT BOOLEAN *NeedRetry,
807 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
808 OUT UINTN *NumberOfSenseKeys,
809 IN BOOLEAN AskResetIfError
810 );
811
812 /**
813 Send out Inquiry command to Device.
814
815 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
816 @param NeedRetry Indicates if needs try again when error happens
817
818 @retval EFI_DEVICE_ERROR Indicates that error occurs
819 @retval EFI_SUCCESS Successfully to detect media
820
821 **/
822 EFI_STATUS
823 ScsiDiskInquiryDevice (
824 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
825 OUT BOOLEAN *NeedRetry
826 );
827
828 /**
829 Parse Inquiry data.
830
831 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
832
833 **/
834 VOID
835 ParseInquiryData (
836 IN OUT SCSI_DISK_DEV *ScsiDiskDevice
837 );
838
839 /**
840 Read sector from SCSI Disk.
841
842 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
843 @param Buffer The buffer to fill in the read out data
844 @param Lba Logic block address
845 @param NumberOfBlocks The number of blocks to read
846
847 @retval EFI_DEVICE_ERROR Indicates a device error.
848 @retval EFI_SUCCESS Operation is successful.
849
850 **/
851 EFI_STATUS
852 ScsiDiskReadSectors (
853 IN SCSI_DISK_DEV *ScsiDiskDevice,
854 OUT VOID *Buffer,
855 IN EFI_LBA Lba,
856 IN UINTN NumberOfBlocks
857 );
858
859 /**
860 Write sector to SCSI Disk.
861
862 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
863 @param Buffer The buffer of data to be written into SCSI Disk
864 @param Lba Logic block address
865 @param NumberOfBlocks The number of blocks to read
866
867 @retval EFI_DEVICE_ERROR Indicates a device error.
868 @retval EFI_SUCCESS Operation is successful.
869
870 **/
871 EFI_STATUS
872 ScsiDiskWriteSectors (
873 IN SCSI_DISK_DEV *ScsiDiskDevice,
874 IN VOID *Buffer,
875 IN EFI_LBA Lba,
876 IN UINTN NumberOfBlocks
877 );
878
879 /**
880 Asynchronously read sector from SCSI Disk.
881
882 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
883 @param Buffer The buffer to fill in the read out data.
884 @param Lba Logic block address.
885 @param NumberOfBlocks The number of blocks to read.
886 @param Token A pointer to the token associated with the
887 non-blocking read request.
888
889 @retval EFI_INVALID_PARAMETER Token is NULL or Token->Event is NULL.
890 @retval EFI_DEVICE_ERROR Indicates a device error.
891 @retval EFI_SUCCESS Operation is successful.
892
893 **/
894 EFI_STATUS
895 ScsiDiskAsyncReadSectors (
896 IN SCSI_DISK_DEV *ScsiDiskDevice,
897 OUT VOID *Buffer,
898 IN EFI_LBA Lba,
899 IN UINTN NumberOfBlocks,
900 IN EFI_BLOCK_IO2_TOKEN *Token
901 );
902
903 /**
904 Asynchronously write sector to SCSI Disk.
905
906 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
907 @param Buffer The buffer of data to be written into SCSI Disk.
908 @param Lba Logic block address.
909 @param NumberOfBlocks The number of blocks to read.
910 @param Token A pointer to the token associated with the
911 non-blocking read request.
912
913 @retval EFI_INVALID_PARAMETER Token is NULL or Token->Event is NULL
914 @retval EFI_DEVICE_ERROR Indicates a device error.
915 @retval EFI_SUCCESS Operation is successful.
916
917 **/
918 EFI_STATUS
919 ScsiDiskAsyncWriteSectors (
920 IN SCSI_DISK_DEV *ScsiDiskDevice,
921 IN VOID *Buffer,
922 IN EFI_LBA Lba,
923 IN UINTN NumberOfBlocks,
924 IN EFI_BLOCK_IO2_TOKEN *Token
925 );
926
927 /**
928 Submit Read(10) command.
929
930 @param ScsiDiskDevice The pointer of ScsiDiskDevice
931 @param NeedRetry The pointer of flag indicates if needs retry if error happens
932 @param Timeout The time to complete the command
933 @param DataBuffer The buffer to fill with the read out data
934 @param DataLength The length of buffer
935 @param StartLba The start logic block address
936 @param SectorCount The number of blocks to read
937
938 @return EFI_STATUS is returned by calling ScsiRead10Command().
939 **/
940 EFI_STATUS
941 ScsiDiskRead10 (
942 IN SCSI_DISK_DEV *ScsiDiskDevice,
943 OUT BOOLEAN *NeedRetry,
944 IN UINT64 Timeout,
945 OUT UINT8 *DataBuffer,
946 IN OUT UINT32 *DataLength,
947 IN UINT32 StartLba,
948 IN UINT32 SectorCount
949 );
950
951 /**
952 Submit Write(10) Command.
953
954 @param ScsiDiskDevice The pointer of ScsiDiskDevice
955 @param NeedRetry The pointer of flag indicates if needs retry if error happens
956 @param Timeout The time to complete the command
957 @param DataBuffer The buffer to fill with the read out data
958 @param DataLength The length of buffer
959 @param StartLba The start logic block address
960 @param SectorCount The number of blocks to write
961
962 @return EFI_STATUS is returned by calling ScsiWrite10Command().
963
964 **/
965 EFI_STATUS
966 ScsiDiskWrite10 (
967 IN SCSI_DISK_DEV *ScsiDiskDevice,
968 OUT BOOLEAN *NeedRetry,
969 IN UINT64 Timeout,
970 IN UINT8 *DataBuffer,
971 IN OUT UINT32 *DataLength,
972 IN UINT32 StartLba,
973 IN UINT32 SectorCount
974 );
975
976 /**
977 Submit Read(16) command.
978
979 @param ScsiDiskDevice The pointer of ScsiDiskDevice
980 @param NeedRetry The pointer of flag indicates if needs retry if error happens
981 @param Timeout The time to complete the command
982 @param DataBuffer The buffer to fill with the read out data
983 @param DataLength The length of buffer
984 @param StartLba The start logic block address
985 @param SectorCount The number of blocks to read
986
987 @return EFI_STATUS is returned by calling ScsiRead16Command().
988 **/
989 EFI_STATUS
990 ScsiDiskRead16 (
991 IN SCSI_DISK_DEV *ScsiDiskDevice,
992 OUT BOOLEAN *NeedRetry,
993 IN UINT64 Timeout,
994 OUT UINT8 *DataBuffer,
995 IN OUT UINT32 *DataLength,
996 IN UINT64 StartLba,
997 IN UINT32 SectorCount
998 );
999
1000 /**
1001 Submit Write(16) Command.
1002
1003 @param ScsiDiskDevice The pointer of ScsiDiskDevice
1004 @param NeedRetry The pointer of flag indicates if needs retry if error happens
1005 @param Timeout The time to complete the command
1006 @param DataBuffer The buffer to fill with the read out data
1007 @param DataLength The length of buffer
1008 @param StartLba The start logic block address
1009 @param SectorCount The number of blocks to write
1010
1011 @return EFI_STATUS is returned by calling ScsiWrite16Command().
1012
1013 **/
1014 EFI_STATUS
1015 ScsiDiskWrite16 (
1016 IN SCSI_DISK_DEV *ScsiDiskDevice,
1017 OUT BOOLEAN *NeedRetry,
1018 IN UINT64 Timeout,
1019 IN UINT8 *DataBuffer,
1020 IN OUT UINT32 *DataLength,
1021 IN UINT64 StartLba,
1022 IN UINT32 SectorCount
1023 );
1024
1025 /**
1026 Submit Async Read(10) command.
1027
1028 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1029 @param Timeout The time to complete the command.
1030 @param DataBuffer The buffer to fill with the read out data.
1031 @param DataLength The length of buffer.
1032 @param StartLba The start logic block address.
1033 @param SectorCount The number of blocks to read.
1034 @param BlkIo2Req The upstream BlockIo2 request.
1035 @param Token The pointer to the token associated with the
1036 non-blocking read request.
1037
1038 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1039 lack of resources.
1040 @return others Status returned by calling
1041 ScsiRead10CommandEx().
1042
1043 **/
1044 EFI_STATUS
1045 ScsiDiskAsyncRead10 (
1046 IN SCSI_DISK_DEV *ScsiDiskDevice,
1047 IN UINT64 Timeout,
1048 OUT UINT8 *DataBuffer,
1049 IN UINT32 DataLength,
1050 IN UINT32 StartLba,
1051 IN UINT32 SectorCount,
1052 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1053 IN EFI_BLOCK_IO2_TOKEN *Token
1054 );
1055
1056 /**
1057 Submit Async Write(10) command.
1058
1059 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1060 @param Timeout The time to complete the command.
1061 @param DataBuffer The buffer contains the data to write.
1062 @param DataLength The length of buffer.
1063 @param StartLba The start logic block address.
1064 @param SectorCount The number of blocks to write.
1065 @param BlkIo2Req The upstream BlockIo2 request.
1066 @param Token The pointer to the token associated with the
1067 non-blocking read request.
1068
1069 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1070 lack of resources.
1071 @return others Status returned by calling
1072 ScsiWrite10CommandEx().
1073
1074 **/
1075 EFI_STATUS
1076 ScsiDiskAsyncWrite10 (
1077 IN SCSI_DISK_DEV *ScsiDiskDevice,
1078 IN UINT64 Timeout,
1079 IN UINT8 *DataBuffer,
1080 IN UINT32 DataLength,
1081 IN UINT32 StartLba,
1082 IN UINT32 SectorCount,
1083 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1084 IN EFI_BLOCK_IO2_TOKEN *Token
1085 );
1086
1087 /**
1088 Submit Async Read(16) command.
1089
1090 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1091 @param Timeout The time to complete the command.
1092 @param DataBuffer The buffer to fill with the read out data.
1093 @param DataLength The length of buffer.
1094 @param StartLba The start logic block address.
1095 @param SectorCount The number of blocks to read.
1096 @param BlkIo2Req The upstream BlockIo2 request.
1097 @param Token The pointer to the token associated with the
1098 non-blocking read request.
1099
1100 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1101 lack of resources.
1102 @return others Status returned by calling
1103 ScsiRead16CommandEx().
1104
1105 **/
1106 EFI_STATUS
1107 ScsiDiskAsyncRead16 (
1108 IN SCSI_DISK_DEV *ScsiDiskDevice,
1109 IN UINT64 Timeout,
1110 OUT UINT8 *DataBuffer,
1111 IN UINT32 DataLength,
1112 IN UINT64 StartLba,
1113 IN UINT32 SectorCount,
1114 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1115 IN EFI_BLOCK_IO2_TOKEN *Token
1116 );
1117
1118 /**
1119 Submit Async Write(16) command.
1120
1121 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1122 @param Timeout The time to complete the command.
1123 @param DataBuffer The buffer contains the data to write.
1124 @param DataLength The length of buffer.
1125 @param StartLba The start logic block address.
1126 @param SectorCount The number of blocks to write.
1127 @param BlkIo2Req The upstream BlockIo2 request.
1128 @param Token The pointer to the token associated with the
1129 non-blocking read request.
1130
1131 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1132 lack of resources.
1133 @return others Status returned by calling
1134 ScsiWrite16CommandEx().
1135
1136 **/
1137 EFI_STATUS
1138 ScsiDiskAsyncWrite16 (
1139 IN SCSI_DISK_DEV *ScsiDiskDevice,
1140 IN UINT64 Timeout,
1141 IN UINT8 *DataBuffer,
1142 IN UINT32 DataLength,
1143 IN UINT64 StartLba,
1144 IN UINT32 SectorCount,
1145 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1146 IN EFI_BLOCK_IO2_TOKEN *Token
1147 );
1148
1149 /**
1150 Get information from media read capacity command.
1151
1152 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
1153 @param Capacity10 The pointer of EFI_SCSI_DISK_CAPACITY_DATA
1154 @param Capacity16 The pointer of EFI_SCSI_DISK_CAPACITY_DATA16
1155 **/
1156 VOID
1157 GetMediaInfo (
1158 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
1159 IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity10,
1160 IN EFI_SCSI_DISK_CAPACITY_DATA16 *Capacity16
1161 );
1162
1163 /**
1164 Check sense key to find if media presents.
1165
1166 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1167 @param SenseCounts The number of sense key
1168
1169 @retval TRUE NOT any media
1170 @retval FALSE Media presents
1171 **/
1172 BOOLEAN
1173 ScsiDiskIsNoMedia (
1174 IN EFI_SCSI_SENSE_DATA *SenseData,
1175 IN UINTN SenseCounts
1176 );
1177
1178 /**
1179 Parse sense key.
1180
1181 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1182 @param SenseCounts The number of sense key
1183
1184 @retval TRUE Error
1185 @retval FALSE NOT error
1186
1187 **/
1188 BOOLEAN
1189 ScsiDiskIsMediaError (
1190 IN EFI_SCSI_SENSE_DATA *SenseData,
1191 IN UINTN SenseCounts
1192 );
1193
1194 /**
1195 Check sense key to find if hardware error happens.
1196
1197 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1198 @param SenseCounts The number of sense key
1199
1200 @retval TRUE Hardware error exits.
1201 @retval FALSE NO error.
1202
1203 **/
1204 BOOLEAN
1205 ScsiDiskIsHardwareError (
1206 IN EFI_SCSI_SENSE_DATA *SenseData,
1207 IN UINTN SenseCounts
1208 );
1209
1210 /**
1211 Check sense key to find if media has changed.
1212
1213 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1214 @param SenseCounts The number of sense key
1215
1216 @retval TRUE Media is changed.
1217 @retval FALSE Medit is NOT changed.
1218 **/
1219 BOOLEAN
1220 ScsiDiskIsMediaChange (
1221 IN EFI_SCSI_SENSE_DATA *SenseData,
1222 IN UINTN SenseCounts
1223 );
1224
1225 /**
1226 Check sense key to find if reset happens.
1227
1228 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1229 @param SenseCounts The number of sense key
1230
1231 @retval TRUE It is reset before.
1232 @retval FALSE It is NOT reset before.
1233
1234 **/
1235 BOOLEAN
1236 ScsiDiskIsResetBefore (
1237 IN EFI_SCSI_SENSE_DATA *SenseData,
1238 IN UINTN SenseCounts
1239 );
1240
1241 /**
1242 Check sense key to find if the drive is ready.
1243
1244 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1245 @param SenseCounts The number of sense key
1246 @param RetryLater The flag means if need a retry
1247
1248 @retval TRUE Drive is ready.
1249 @retval FALSE Drive is NOT ready.
1250
1251 **/
1252 BOOLEAN
1253 ScsiDiskIsDriveReady (
1254 IN EFI_SCSI_SENSE_DATA *SenseData,
1255 IN UINTN SenseCounts,
1256 OUT BOOLEAN *RetryLater
1257 );
1258
1259 /**
1260 Check sense key to find if it has sense key.
1261
1262 @param SenseData - The pointer of EFI_SCSI_SENSE_DATA
1263 @param SenseCounts - The number of sense key
1264
1265 @retval TRUE It has sense key.
1266 @retval FALSE It has NOT any sense key.
1267
1268 **/
1269 BOOLEAN
1270 ScsiDiskHaveSenseKey (
1271 IN EFI_SCSI_SENSE_DATA *SenseData,
1272 IN UINTN SenseCounts
1273 );
1274
1275 /**
1276 Release resource about disk device.
1277
1278 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
1279
1280 **/
1281 VOID
1282 ReleaseScsiDiskDeviceResources (
1283 IN SCSI_DISK_DEV *ScsiDiskDevice
1284 );
1285
1286 /**
1287 Determine if Block Io should be produced.
1288
1289
1290 @param ChildHandle Child Handle to retrieve Parent information.
1291
1292 @retval TRUE Should produce Block Io.
1293 @retval FALSE Should not produce Block Io.
1294
1295 **/
1296 BOOLEAN
1297 DetermineInstallBlockIo (
1298 IN EFI_HANDLE ChildHandle
1299 );
1300
1301 /**
1302 Initialize the installation of DiskInfo protocol.
1303
1304 This function prepares for the installation of DiskInfo protocol on the child handle.
1305 By default, it installs DiskInfo protocol with SCSI interface GUID. If it further
1306 detects that the physical device is an ATAPI/AHCI device, it then updates interface GUID
1307 to be IDE/AHCI interface GUID.
1308
1309 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
1310 @param ChildHandle Child handle to install DiskInfo protocol.
1311
1312 **/
1313 VOID
1314 InitializeInstallDiskInfo (
1315 IN SCSI_DISK_DEV *ScsiDiskDevice,
1316 IN EFI_HANDLE ChildHandle
1317 );
1318
1319 /**
1320 Search protocol database and check to see if the protocol
1321 specified by ProtocolGuid is present on a ControllerHandle and opened by
1322 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
1323 If the ControllerHandle is found, then the protocol specified by ProtocolGuid
1324 will be opened on it.
1325
1326
1327 @param ProtocolGuid ProtocolGuid pointer.
1328 @param ChildHandle Child Handle to retrieve Parent information.
1329
1330 **/
1331 VOID *
1332 EFIAPI
1333 GetParentProtocol (
1334 IN EFI_GUID *ProtocolGuid,
1335 IN EFI_HANDLE ChildHandle
1336 );
1337
1338 #endif