2 This file is used to implement the EFI_DISK_INFO_PROTOCOL interface.
4 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 EFI_DISK_INFO_PROTOCOL gUsbDiskInfoProtocolTemplate
= {
12 EFI_DISK_INFO_USB_INTERFACE_GUID
,
20 Initialize the installation of DiskInfo protocol.
22 This function prepares for the installation of DiskInfo protocol on the child handle.
23 By default, it installs DiskInfo protocol with USB interface GUID.
25 @param[in] UsbMass The pointer of USB_MASS_DEVICE.
30 IN USB_MASS_DEVICE
*UsbMass
33 CopyMem (&UsbMass
->DiskInfo
, &gUsbDiskInfoProtocolTemplate
, sizeof (gUsbDiskInfoProtocolTemplate
));
37 Provides inquiry information for the controller type.
39 This function is used to get inquiry data. Data format
40 of Identify data is defined by the Interface GUID.
42 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
43 @param[in, out] InquiryData Pointer to a buffer for the inquiry data.
44 @param[in, out] InquiryDataSize Pointer to the value for the inquiry data size.
46 @retval EFI_SUCCESS The command was accepted without any errors.
47 @retval EFI_NOT_FOUND Device does not support this data class
48 @retval EFI_DEVICE_ERROR Error reading InquiryData from device
49 @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough
55 IN EFI_DISK_INFO_PROTOCOL
*This
,
56 IN OUT VOID
*InquiryData
,
57 IN OUT UINT32
*InquiryDataSize
61 USB_MASS_DEVICE
*UsbMass
;
63 UsbMass
= USB_MASS_DEVICE_FROM_DISK_INFO (This
);
65 Status
= EFI_BUFFER_TOO_SMALL
;
66 if (*InquiryDataSize
>= sizeof (UsbMass
->InquiryData
)) {
68 CopyMem (InquiryData
, &UsbMass
->InquiryData
, sizeof (UsbMass
->InquiryData
));
71 *InquiryDataSize
= sizeof (UsbMass
->InquiryData
);
76 Provides identify information for the controller type.
78 This function is used to get identify data. Data format
79 of Identify data is defined by the Interface GUID.
81 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL
83 @param[in, out] IdentifyData Pointer to a buffer for the identify data.
84 @param[in, out] IdentifyDataSize Pointer to the value for the identify data
87 @retval EFI_SUCCESS The command was accepted without any errors.
88 @retval EFI_NOT_FOUND Device does not support this data class
89 @retval EFI_DEVICE_ERROR Error reading IdentifyData from device
90 @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough
96 IN EFI_DISK_INFO_PROTOCOL
*This
,
97 IN OUT VOID
*IdentifyData
,
98 IN OUT UINT32
*IdentifyDataSize
101 return EFI_NOT_FOUND
;
105 Provides sense data information for the controller type.
107 This function is used to get sense data.
108 Data format of Sense data is defined by the Interface GUID.
110 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
111 @param[in, out] SenseData Pointer to the SenseData.
112 @param[in, out] SenseDataSize Size of SenseData in bytes.
113 @param[out] SenseDataNumber Pointer to the value for the sense data size.
115 @retval EFI_SUCCESS The command was accepted without any errors.
116 @retval EFI_NOT_FOUND Device does not support this data class.
117 @retval EFI_DEVICE_ERROR Error reading SenseData from device.
118 @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.
123 UsbDiskInfoSenseData (
124 IN EFI_DISK_INFO_PROTOCOL
*This
,
125 IN OUT VOID
*SenseData
,
126 IN OUT UINT32
*SenseDataSize
,
127 OUT UINT8
*SenseDataNumber
130 return EFI_NOT_FOUND
;
134 This function is used to get controller information.
136 @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.
137 @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.
138 @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.
140 @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.
141 @retval EFI_UNSUPPORTED This is not an IDE device.
146 UsbDiskInfoWhichIde (
147 IN EFI_DISK_INFO_PROTOCOL
*This
,
148 OUT UINT32
*IdeChannel
,
149 OUT UINT32
*IdeDevice
152 return EFI_UNSUPPORTED
;