]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
MdeModulePkg ScsiDiskDxe: Modify FlushBlocksEx() to follow UEFI spec
[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 attempting to
560 write data.
561 @retval EFI_WRITE_PROTECTED The device cannot be written to.
562 @retval EFI_NO_MEDIA There is no media in the device.
563 @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
564
565 **/
566 EFI_STATUS
567 EFIAPI
568 ScsiDiskFlushBlocksEx (
569 IN EFI_BLOCK_IO2_PROTOCOL *This,
570 IN OUT EFI_BLOCK_IO2_TOKEN *Token
571 );
572
573
574 /**
575 Provides inquiry information for the controller type.
576
577 This function is used by the IDE bus driver to get inquiry data. Data format
578 of Identify data is defined by the Interface GUID.
579
580 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
581 @param[in, out] InquiryData Pointer to a buffer for the inquiry data.
582 @param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
583
584 @retval EFI_SUCCESS The command was accepted without any errors.
585 @retval EFI_NOT_FOUND Device does not support this data class
586 @retval EFI_DEVICE_ERROR Error reading InquiryData from device
587 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
588
589 **/
590 EFI_STATUS
591 EFIAPI
592 ScsiDiskInfoInquiry (
593 IN EFI_DISK_INFO_PROTOCOL *This,
594 IN OUT VOID *InquiryData,
595 IN OUT UINT32 *InquiryDataSize
596 );
597
598
599 /**
600 Provides identify information for the controller type.
601
602 This function is used by the IDE bus driver to get identify data. Data format
603 of Identify data is defined by the Interface GUID.
604
605 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
606 instance.
607 @param[in, out] IdentifyData Pointer to a buffer for the identify data.
608 @param[in, out] IdentifyDataSize Pointer to the value for the identify data
609 size.
610
611 @retval EFI_SUCCESS The command was accepted without any errors.
612 @retval EFI_NOT_FOUND Device does not support this data class
613 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
614 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
615
616 **/
617 EFI_STATUS
618 EFIAPI
619 ScsiDiskInfoIdentify (
620 IN EFI_DISK_INFO_PROTOCOL *This,
621 IN OUT VOID *IdentifyData,
622 IN OUT UINT32 *IdentifyDataSize
623 );
624
625
626 /**
627 Provides sense data information for the controller type.
628
629 This function is used by the IDE bus driver to get sense data.
630 Data format of Sense data is defined by the Interface GUID.
631
632 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
633 @param[in, out] SenseData Pointer to the SenseData.
634 @param[in, out] SenseDataSize Size of SenseData in bytes.
635 @param[out] SenseDataNumber Pointer to the value for the sense data size.
636
637 @retval EFI_SUCCESS The command was accepted without any errors.
638 @retval EFI_NOT_FOUND Device does not support this data class.
639 @retval EFI_DEVICE_ERROR Error reading SenseData from device.
640 @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
641
642 **/
643 EFI_STATUS
644 EFIAPI
645 ScsiDiskInfoSenseData (
646 IN EFI_DISK_INFO_PROTOCOL *This,
647 IN OUT VOID *SenseData,
648 IN OUT UINT32 *SenseDataSize,
649 OUT UINT8 *SenseDataNumber
650 );
651
652 /**
653 This function is used by the IDE bus driver to get controller information.
654
655 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
656 @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
657 @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
658
659 @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
660 @retval EFI_UNSUPPORTED This is not an IDE device.
661
662 **/
663 EFI_STATUS
664 EFIAPI
665 ScsiDiskInfoWhichIde (
666 IN EFI_DISK_INFO_PROTOCOL *This,
667 OUT UINT32 *IdeChannel,
668 OUT UINT32 *IdeDevice
669 );
670
671
672 /**
673 Detect Device and read out capacity ,if error occurs, parse the sense key.
674
675 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
676 @param MustReadCapacity The flag about reading device capacity
677 @param MediaChange The pointer of flag indicates if media has changed
678
679 @retval EFI_DEVICE_ERROR Indicates that error occurs
680 @retval EFI_SUCCESS Successfully to detect media
681
682 **/
683 EFI_STATUS
684 ScsiDiskDetectMedia (
685 IN SCSI_DISK_DEV *ScsiDiskDevice,
686 IN BOOLEAN MustReadCapacity,
687 OUT BOOLEAN *MediaChange
688 );
689
690 /**
691 To test device.
692
693 When Test Unit Ready command succeeds, retrieve Sense Keys via Request Sense;
694 When Test Unit Ready command encounters any error caused by host adapter or
695 target, return error without retrieving Sense Keys.
696
697 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
698 @param NeedRetry The pointer of flag indicates try again
699 @param SenseDataArray The pointer of an array of sense data
700 @param NumberOfSenseKeys The pointer of the number of sense data array
701
702 @retval EFI_DEVICE_ERROR Indicates that error occurs
703 @retval EFI_SUCCESS Successfully to test unit
704
705 **/
706 EFI_STATUS
707 ScsiDiskTestUnitReady (
708 IN SCSI_DISK_DEV *ScsiDiskDevice,
709 OUT BOOLEAN *NeedRetry,
710 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
711 OUT UINTN *NumberOfSenseKeys
712 );
713
714
715 /**
716 Parsing Sense Keys which got from request sense command.
717
718 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
719 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
720 @param NumberOfSenseKeys The number of sense key
721 @param Action The pointer of action which indicates what is need to do next
722
723 @retval EFI_DEVICE_ERROR Indicates that error occurs
724 @retval EFI_SUCCESS Successfully to complete the parsing
725
726 **/
727 EFI_STATUS
728 DetectMediaParsingSenseKeys (
729 OUT SCSI_DISK_DEV *ScsiDiskDevice,
730 IN EFI_SCSI_SENSE_DATA *SenseData,
731 IN UINTN NumberOfSenseKeys,
732 OUT UINTN *Action
733 );
734
735
736 /**
737 Send read capacity command to device and get the device parameter.
738
739 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
740 @param NeedRetry The pointer of flag indicates if need a retry
741 @param SenseDataArray The pointer of an array of sense data
742 @param NumberOfSenseKeys The number of sense key
743
744 @retval EFI_DEVICE_ERROR Indicates that error occurs
745 @retval EFI_SUCCESS Successfully to read capacity
746
747 **/
748 EFI_STATUS
749 ScsiDiskReadCapacity (
750 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
751 OUT BOOLEAN *NeedRetry,
752 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
753 OUT UINTN *NumberOfSenseKeys
754 );
755
756 /**
757 Check the HostAdapter status and re-interpret it in EFI_STATUS.
758
759 @param HostAdapterStatus Host Adapter status
760
761 @retval EFI_SUCCESS Host adapter is OK.
762 @retval EFI_TIMEOUT Timeout.
763 @retval EFI_NOT_READY Adapter NOT ready.
764 @retval EFI_DEVICE_ERROR Adapter device error.
765
766 **/
767 EFI_STATUS
768 CheckHostAdapterStatus (
769 IN UINT8 HostAdapterStatus
770 );
771
772
773 /**
774 Check the target status and re-interpret it in EFI_STATUS.
775
776 @param TargetStatus Target status
777
778 @retval EFI_NOT_READY Device is NOT ready.
779 @retval EFI_DEVICE_ERROR
780 @retval EFI_SUCCESS
781
782 **/
783 EFI_STATUS
784 CheckTargetStatus (
785 IN UINT8 TargetStatus
786 );
787
788 /**
789 Retrieve all sense keys from the device.
790
791 When encountering error during the process, if retrieve sense keys before
792 error encountered, it returns the sense keys with return status set to EFI_SUCCESS,
793 and NeedRetry set to FALSE; otherwize, return the proper return status.
794
795 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
796 @param NeedRetry The pointer of flag indicates if need a retry
797 @param SenseDataArray The pointer of an array of sense data
798 @param NumberOfSenseKeys The number of sense key
799 @param AskResetIfError The flag indicates if need reset when error occurs
800
801 @retval EFI_DEVICE_ERROR Indicates that error occurs
802 @retval EFI_SUCCESS Successfully to request sense key
803
804 **/
805 EFI_STATUS
806 ScsiDiskRequestSenseKeys (
807 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
808 OUT BOOLEAN *NeedRetry,
809 OUT EFI_SCSI_SENSE_DATA **SenseDataArray,
810 OUT UINTN *NumberOfSenseKeys,
811 IN BOOLEAN AskResetIfError
812 );
813
814 /**
815 Send out Inquiry command to Device.
816
817 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
818 @param NeedRetry Indicates if needs try again when error happens
819
820 @retval EFI_DEVICE_ERROR Indicates that error occurs
821 @retval EFI_SUCCESS Successfully to detect media
822
823 **/
824 EFI_STATUS
825 ScsiDiskInquiryDevice (
826 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
827 OUT BOOLEAN *NeedRetry
828 );
829
830 /**
831 Parse Inquiry data.
832
833 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
834
835 **/
836 VOID
837 ParseInquiryData (
838 IN OUT SCSI_DISK_DEV *ScsiDiskDevice
839 );
840
841 /**
842 Read sector from SCSI Disk.
843
844 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
845 @param Buffer The buffer to fill in the read out data
846 @param Lba Logic block address
847 @param NumberOfBlocks The number of blocks to read
848
849 @retval EFI_DEVICE_ERROR Indicates a device error.
850 @retval EFI_SUCCESS Operation is successful.
851
852 **/
853 EFI_STATUS
854 ScsiDiskReadSectors (
855 IN SCSI_DISK_DEV *ScsiDiskDevice,
856 OUT VOID *Buffer,
857 IN EFI_LBA Lba,
858 IN UINTN NumberOfBlocks
859 );
860
861 /**
862 Write sector to SCSI Disk.
863
864 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
865 @param Buffer The buffer of data to be written into SCSI Disk
866 @param Lba Logic block address
867 @param NumberOfBlocks The number of blocks to read
868
869 @retval EFI_DEVICE_ERROR Indicates a device error.
870 @retval EFI_SUCCESS Operation is successful.
871
872 **/
873 EFI_STATUS
874 ScsiDiskWriteSectors (
875 IN SCSI_DISK_DEV *ScsiDiskDevice,
876 IN VOID *Buffer,
877 IN EFI_LBA Lba,
878 IN UINTN NumberOfBlocks
879 );
880
881 /**
882 Asynchronously read sector from SCSI Disk.
883
884 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
885 @param Buffer The buffer to fill in the read out data.
886 @param Lba Logic block address.
887 @param NumberOfBlocks The number of blocks to read.
888 @param Token A pointer to the token associated with the
889 non-blocking read request.
890
891 @retval EFI_INVALID_PARAMETER Token is NULL or Token->Event is NULL.
892 @retval EFI_DEVICE_ERROR Indicates a device error.
893 @retval EFI_SUCCESS Operation is successful.
894
895 **/
896 EFI_STATUS
897 ScsiDiskAsyncReadSectors (
898 IN SCSI_DISK_DEV *ScsiDiskDevice,
899 OUT VOID *Buffer,
900 IN EFI_LBA Lba,
901 IN UINTN NumberOfBlocks,
902 IN EFI_BLOCK_IO2_TOKEN *Token
903 );
904
905 /**
906 Asynchronously write sector to SCSI Disk.
907
908 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
909 @param Buffer The buffer of data to be written into SCSI Disk.
910 @param Lba Logic block address.
911 @param NumberOfBlocks The number of blocks to read.
912 @param Token A pointer to the token associated with the
913 non-blocking read request.
914
915 @retval EFI_INVALID_PARAMETER Token is NULL or Token->Event is NULL
916 @retval EFI_DEVICE_ERROR Indicates a device error.
917 @retval EFI_SUCCESS Operation is successful.
918
919 **/
920 EFI_STATUS
921 ScsiDiskAsyncWriteSectors (
922 IN SCSI_DISK_DEV *ScsiDiskDevice,
923 IN VOID *Buffer,
924 IN EFI_LBA Lba,
925 IN UINTN NumberOfBlocks,
926 IN EFI_BLOCK_IO2_TOKEN *Token
927 );
928
929 /**
930 Submit Read(10) command.
931
932 @param ScsiDiskDevice The pointer of ScsiDiskDevice
933 @param NeedRetry The pointer of flag indicates if needs retry if error happens
934 @param Timeout The time to complete the command
935 @param DataBuffer The buffer to fill with the read out data
936 @param DataLength The length of buffer
937 @param StartLba The start logic block address
938 @param SectorCount The number of blocks to read
939
940 @return EFI_STATUS is returned by calling ScsiRead10Command().
941 **/
942 EFI_STATUS
943 ScsiDiskRead10 (
944 IN SCSI_DISK_DEV *ScsiDiskDevice,
945 OUT BOOLEAN *NeedRetry,
946 IN UINT64 Timeout,
947 OUT UINT8 *DataBuffer,
948 IN OUT UINT32 *DataLength,
949 IN UINT32 StartLba,
950 IN UINT32 SectorCount
951 );
952
953 /**
954 Submit Write(10) Command.
955
956 @param ScsiDiskDevice The pointer of ScsiDiskDevice
957 @param NeedRetry The pointer of flag indicates if needs retry if error happens
958 @param Timeout The time to complete the command
959 @param DataBuffer The buffer to fill with the read out data
960 @param DataLength The length of buffer
961 @param StartLba The start logic block address
962 @param SectorCount The number of blocks to write
963
964 @return EFI_STATUS is returned by calling ScsiWrite10Command().
965
966 **/
967 EFI_STATUS
968 ScsiDiskWrite10 (
969 IN SCSI_DISK_DEV *ScsiDiskDevice,
970 OUT BOOLEAN *NeedRetry,
971 IN UINT64 Timeout,
972 IN UINT8 *DataBuffer,
973 IN OUT UINT32 *DataLength,
974 IN UINT32 StartLba,
975 IN UINT32 SectorCount
976 );
977
978 /**
979 Submit Read(16) command.
980
981 @param ScsiDiskDevice The pointer of ScsiDiskDevice
982 @param NeedRetry The pointer of flag indicates if needs retry if error happens
983 @param Timeout The time to complete the command
984 @param DataBuffer The buffer to fill with the read out data
985 @param DataLength The length of buffer
986 @param StartLba The start logic block address
987 @param SectorCount The number of blocks to read
988
989 @return EFI_STATUS is returned by calling ScsiRead16Command().
990 **/
991 EFI_STATUS
992 ScsiDiskRead16 (
993 IN SCSI_DISK_DEV *ScsiDiskDevice,
994 OUT BOOLEAN *NeedRetry,
995 IN UINT64 Timeout,
996 OUT UINT8 *DataBuffer,
997 IN OUT UINT32 *DataLength,
998 IN UINT64 StartLba,
999 IN UINT32 SectorCount
1000 );
1001
1002 /**
1003 Submit Write(16) Command.
1004
1005 @param ScsiDiskDevice The pointer of ScsiDiskDevice
1006 @param NeedRetry The pointer of flag indicates if needs retry if error happens
1007 @param Timeout The time to complete the command
1008 @param DataBuffer The buffer to fill with the read out data
1009 @param DataLength The length of buffer
1010 @param StartLba The start logic block address
1011 @param SectorCount The number of blocks to write
1012
1013 @return EFI_STATUS is returned by calling ScsiWrite16Command().
1014
1015 **/
1016 EFI_STATUS
1017 ScsiDiskWrite16 (
1018 IN SCSI_DISK_DEV *ScsiDiskDevice,
1019 OUT BOOLEAN *NeedRetry,
1020 IN UINT64 Timeout,
1021 IN UINT8 *DataBuffer,
1022 IN OUT UINT32 *DataLength,
1023 IN UINT64 StartLba,
1024 IN UINT32 SectorCount
1025 );
1026
1027 /**
1028 Submit Async Read(10) command.
1029
1030 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1031 @param Timeout The time to complete the command.
1032 @param DataBuffer The buffer to fill with the read out data.
1033 @param DataLength The length of buffer.
1034 @param StartLba The start logic block address.
1035 @param SectorCount The number of blocks to read.
1036 @param BlkIo2Req The upstream BlockIo2 request.
1037 @param Token The pointer to the token associated with the
1038 non-blocking read request.
1039
1040 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1041 lack of resources.
1042 @return others Status returned by calling
1043 ScsiRead10CommandEx().
1044
1045 **/
1046 EFI_STATUS
1047 ScsiDiskAsyncRead10 (
1048 IN SCSI_DISK_DEV *ScsiDiskDevice,
1049 IN UINT64 Timeout,
1050 OUT UINT8 *DataBuffer,
1051 IN UINT32 DataLength,
1052 IN UINT32 StartLba,
1053 IN UINT32 SectorCount,
1054 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1055 IN EFI_BLOCK_IO2_TOKEN *Token
1056 );
1057
1058 /**
1059 Submit Async Write(10) command.
1060
1061 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1062 @param Timeout The time to complete the command.
1063 @param DataBuffer The buffer contains the data to write.
1064 @param DataLength The length of buffer.
1065 @param StartLba The start logic block address.
1066 @param SectorCount The number of blocks to write.
1067 @param BlkIo2Req The upstream BlockIo2 request.
1068 @param Token The pointer to the token associated with the
1069 non-blocking read request.
1070
1071 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1072 lack of resources.
1073 @return others Status returned by calling
1074 ScsiWrite10CommandEx().
1075
1076 **/
1077 EFI_STATUS
1078 ScsiDiskAsyncWrite10 (
1079 IN SCSI_DISK_DEV *ScsiDiskDevice,
1080 IN UINT64 Timeout,
1081 IN UINT8 *DataBuffer,
1082 IN UINT32 DataLength,
1083 IN UINT32 StartLba,
1084 IN UINT32 SectorCount,
1085 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1086 IN EFI_BLOCK_IO2_TOKEN *Token
1087 );
1088
1089 /**
1090 Submit Async Read(16) command.
1091
1092 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1093 @param Timeout The time to complete the command.
1094 @param DataBuffer The buffer to fill with the read out data.
1095 @param DataLength The length of buffer.
1096 @param StartLba The start logic block address.
1097 @param SectorCount The number of blocks to read.
1098 @param BlkIo2Req The upstream BlockIo2 request.
1099 @param Token The pointer to the token associated with the
1100 non-blocking read request.
1101
1102 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1103 lack of resources.
1104 @return others Status returned by calling
1105 ScsiRead16CommandEx().
1106
1107 **/
1108 EFI_STATUS
1109 ScsiDiskAsyncRead16 (
1110 IN SCSI_DISK_DEV *ScsiDiskDevice,
1111 IN UINT64 Timeout,
1112 OUT UINT8 *DataBuffer,
1113 IN UINT32 DataLength,
1114 IN UINT64 StartLba,
1115 IN UINT32 SectorCount,
1116 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1117 IN EFI_BLOCK_IO2_TOKEN *Token
1118 );
1119
1120 /**
1121 Submit Async Write(16) command.
1122
1123 @param ScsiDiskDevice The pointer of ScsiDiskDevice.
1124 @param Timeout The time to complete the command.
1125 @param DataBuffer The buffer contains the data to write.
1126 @param DataLength The length of buffer.
1127 @param StartLba The start logic block address.
1128 @param SectorCount The number of blocks to write.
1129 @param BlkIo2Req The upstream BlockIo2 request.
1130 @param Token The pointer to the token associated with the
1131 non-blocking read request.
1132
1133 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
1134 lack of resources.
1135 @return others Status returned by calling
1136 ScsiWrite16CommandEx().
1137
1138 **/
1139 EFI_STATUS
1140 ScsiDiskAsyncWrite16 (
1141 IN SCSI_DISK_DEV *ScsiDiskDevice,
1142 IN UINT64 Timeout,
1143 IN UINT8 *DataBuffer,
1144 IN UINT32 DataLength,
1145 IN UINT64 StartLba,
1146 IN UINT32 SectorCount,
1147 IN OUT SCSI_BLKIO2_REQUEST *BlkIo2Req,
1148 IN EFI_BLOCK_IO2_TOKEN *Token
1149 );
1150
1151 /**
1152 Get information from media read capacity command.
1153
1154 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
1155 @param Capacity10 The pointer of EFI_SCSI_DISK_CAPACITY_DATA
1156 @param Capacity16 The pointer of EFI_SCSI_DISK_CAPACITY_DATA16
1157 **/
1158 VOID
1159 GetMediaInfo (
1160 IN OUT SCSI_DISK_DEV *ScsiDiskDevice,
1161 IN EFI_SCSI_DISK_CAPACITY_DATA *Capacity10,
1162 IN EFI_SCSI_DISK_CAPACITY_DATA16 *Capacity16
1163 );
1164
1165 /**
1166 Check sense key to find if media presents.
1167
1168 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1169 @param SenseCounts The number of sense key
1170
1171 @retval TRUE NOT any media
1172 @retval FALSE Media presents
1173 **/
1174 BOOLEAN
1175 ScsiDiskIsNoMedia (
1176 IN EFI_SCSI_SENSE_DATA *SenseData,
1177 IN UINTN SenseCounts
1178 );
1179
1180 /**
1181 Parse sense key.
1182
1183 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1184 @param SenseCounts The number of sense key
1185
1186 @retval TRUE Error
1187 @retval FALSE NOT error
1188
1189 **/
1190 BOOLEAN
1191 ScsiDiskIsMediaError (
1192 IN EFI_SCSI_SENSE_DATA *SenseData,
1193 IN UINTN SenseCounts
1194 );
1195
1196 /**
1197 Check sense key to find if hardware error happens.
1198
1199 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1200 @param SenseCounts The number of sense key
1201
1202 @retval TRUE Hardware error exits.
1203 @retval FALSE NO error.
1204
1205 **/
1206 BOOLEAN
1207 ScsiDiskIsHardwareError (
1208 IN EFI_SCSI_SENSE_DATA *SenseData,
1209 IN UINTN SenseCounts
1210 );
1211
1212 /**
1213 Check sense key to find if media has changed.
1214
1215 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1216 @param SenseCounts The number of sense key
1217
1218 @retval TRUE Media is changed.
1219 @retval FALSE Medit is NOT changed.
1220 **/
1221 BOOLEAN
1222 ScsiDiskIsMediaChange (
1223 IN EFI_SCSI_SENSE_DATA *SenseData,
1224 IN UINTN SenseCounts
1225 );
1226
1227 /**
1228 Check sense key to find if reset happens.
1229
1230 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1231 @param SenseCounts The number of sense key
1232
1233 @retval TRUE It is reset before.
1234 @retval FALSE It is NOT reset before.
1235
1236 **/
1237 BOOLEAN
1238 ScsiDiskIsResetBefore (
1239 IN EFI_SCSI_SENSE_DATA *SenseData,
1240 IN UINTN SenseCounts
1241 );
1242
1243 /**
1244 Check sense key to find if the drive is ready.
1245
1246 @param SenseData The pointer of EFI_SCSI_SENSE_DATA
1247 @param SenseCounts The number of sense key
1248 @param RetryLater The flag means if need a retry
1249
1250 @retval TRUE Drive is ready.
1251 @retval FALSE Drive is NOT ready.
1252
1253 **/
1254 BOOLEAN
1255 ScsiDiskIsDriveReady (
1256 IN EFI_SCSI_SENSE_DATA *SenseData,
1257 IN UINTN SenseCounts,
1258 OUT BOOLEAN *RetryLater
1259 );
1260
1261 /**
1262 Check sense key to find if it has sense key.
1263
1264 @param SenseData - The pointer of EFI_SCSI_SENSE_DATA
1265 @param SenseCounts - The number of sense key
1266
1267 @retval TRUE It has sense key.
1268 @retval FALSE It has NOT any sense key.
1269
1270 **/
1271 BOOLEAN
1272 ScsiDiskHaveSenseKey (
1273 IN EFI_SCSI_SENSE_DATA *SenseData,
1274 IN UINTN SenseCounts
1275 );
1276
1277 /**
1278 Release resource about disk device.
1279
1280 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV
1281
1282 **/
1283 VOID
1284 ReleaseScsiDiskDeviceResources (
1285 IN SCSI_DISK_DEV *ScsiDiskDevice
1286 );
1287
1288 /**
1289 Determine if Block Io should be produced.
1290
1291
1292 @param ChildHandle Child Handle to retrieve Parent information.
1293
1294 @retval TRUE Should produce Block Io.
1295 @retval FALSE Should not produce Block Io.
1296
1297 **/
1298 BOOLEAN
1299 DetermineInstallBlockIo (
1300 IN EFI_HANDLE ChildHandle
1301 );
1302
1303 /**
1304 Initialize the installation of DiskInfo protocol.
1305
1306 This function prepares for the installation of DiskInfo protocol on the child handle.
1307 By default, it installs DiskInfo protocol with SCSI interface GUID. If it further
1308 detects that the physical device is an ATAPI/AHCI device, it then updates interface GUID
1309 to be IDE/AHCI interface GUID.
1310
1311 @param ScsiDiskDevice The pointer of SCSI_DISK_DEV.
1312 @param ChildHandle Child handle to install DiskInfo protocol.
1313
1314 **/
1315 VOID
1316 InitializeInstallDiskInfo (
1317 IN SCSI_DISK_DEV *ScsiDiskDevice,
1318 IN EFI_HANDLE ChildHandle
1319 );
1320
1321 /**
1322 Search protocol database and check to see if the protocol
1323 specified by ProtocolGuid is present on a ControllerHandle and opened by
1324 ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
1325 If the ControllerHandle is found, then the protocol specified by ProtocolGuid
1326 will be opened on it.
1327
1328
1329 @param ProtocolGuid ProtocolGuid pointer.
1330 @param ChildHandle Child Handle to retrieve Parent information.
1331
1332 **/
1333 VOID *
1334 EFIAPI
1335 GetParentProtocol (
1336 IN EFI_GUID *ProtocolGuid,
1337 IN EFI_HANDLE ChildHandle
1338 );
1339
1340 #endif