]>
Commit | Line | Data |
---|---|---|
19b2cb5c HW |
1 | /** @file\r |
2 | Implement the EFI_DISK_INFO_PROTOCOL interface on EMMC devices.\r | |
3 | \r | |
4 | Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #include "EmmcDxe.h"\r | |
16 | \r | |
17 | /**\r | |
18 | Provides inquiry information for the controller type.\r | |
19 | \r | |
20 | This function is used by the driver entity to get inquiry data. Data format of\r | |
21 | Identify data is defined by the Interface GUID.\r | |
22 | \r | |
23 | @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.\r | |
24 | @param[in,out] InquiryData Pointer to a buffer for the inquiry data.\r | |
25 | @param[in,out] InquiryDataSize Pointer to the value for the inquiry data size.\r | |
26 | \r | |
27 | @retval EFI_SUCCESS The command was accepted without any errors.\r | |
28 | @retval EFI_NOT_FOUND Device does not support this data class.\r | |
29 | @retval EFI_DEVICE_ERROR Error reading InquiryData from device.\r | |
30 | @retval EFI_BUFFER_TOO_SMALL InquiryDataSize not big enough.\r | |
31 | \r | |
32 | **/\r | |
33 | EFI_STATUS\r | |
34 | EFIAPI\r | |
35 | EmmcDiskInfoInquiry (\r | |
36 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
37 | IN OUT VOID *InquiryData,\r | |
38 | IN OUT UINT32 *InquiryDataSize\r | |
39 | )\r | |
40 | {\r | |
41 | EFI_STATUS Status;\r | |
42 | EMMC_PARTITION *Partition;\r | |
43 | EMMC_DEVICE *Device;\r | |
44 | \r | |
45 | Partition = EMMC_PARTITION_DATA_FROM_DISKINFO (This);\r | |
46 | Device = Partition->Device;\r | |
47 | \r | |
48 | if (*InquiryDataSize >= sizeof (Device->Cid)) {\r | |
49 | Status = EFI_SUCCESS;\r | |
50 | CopyMem (InquiryData, &Device->Cid, sizeof (Device->Cid));\r | |
51 | } else {\r | |
52 | Status = EFI_BUFFER_TOO_SMALL;\r | |
53 | }\r | |
54 | \r | |
55 | *InquiryDataSize = sizeof (Device->Cid);\r | |
56 | \r | |
57 | return Status;\r | |
58 | }\r | |
59 | \r | |
60 | /**\r | |
61 | Provides identify information for the controller type.\r | |
62 | \r | |
63 | This function is used by the driver entity to get identify data. Data format\r | |
64 | of Identify data is defined by the Interface GUID.\r | |
65 | \r | |
66 | @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL\r | |
67 | instance.\r | |
68 | @param[in,out] IdentifyData Pointer to a buffer for the identify data.\r | |
69 | @param[in,out] IdentifyDataSize Pointer to the value for the identify data\r | |
70 | size.\r | |
71 | \r | |
72 | @retval EFI_SUCCESS The command was accepted without any errors.\r | |
73 | @retval EFI_NOT_FOUND Device does not support this data class.\r | |
74 | @retval EFI_DEVICE_ERROR Error reading IdentifyData from device.\r | |
75 | @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough.\r | |
76 | \r | |
77 | **/\r | |
78 | EFI_STATUS\r | |
79 | EFIAPI\r | |
80 | EmmcDiskInfoIdentify (\r | |
81 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
82 | IN OUT VOID *IdentifyData,\r | |
83 | IN OUT UINT32 *IdentifyDataSize\r | |
84 | )\r | |
85 | {\r | |
86 | return EFI_NOT_FOUND;\r | |
87 | }\r | |
88 | \r | |
89 | /**\r | |
90 | Provides sense data information for the controller type.\r | |
91 | \r | |
92 | This function is used by the driver entity to get sense data. Data format of\r | |
93 | Sense data is defined by the Interface GUID.\r | |
94 | \r | |
95 | @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.\r | |
96 | @param[in,out] SenseData Pointer to the SenseData.\r | |
97 | @param[in,out] SenseDataSize Size of SenseData in bytes.\r | |
98 | @param[out] SenseDataNumber Pointer to the value for the sense data size.\r | |
99 | \r | |
100 | @retval EFI_SUCCESS The command was accepted without any errors.\r | |
101 | @retval EFI_NOT_FOUND Device does not support this data class.\r | |
102 | @retval EFI_DEVICE_ERROR Error reading SenseData from device.\r | |
103 | @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough.\r | |
104 | \r | |
105 | **/\r | |
106 | EFI_STATUS\r | |
107 | EFIAPI\r | |
108 | EmmcDiskInfoSenseData (\r | |
109 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
110 | IN OUT VOID *SenseData,\r | |
111 | IN OUT UINT32 *SenseDataSize,\r | |
112 | OUT UINT8 *SenseDataNumber\r | |
113 | )\r | |
114 | {\r | |
115 | return EFI_NOT_FOUND;\r | |
116 | }\r | |
117 | \r | |
118 | /**\r | |
119 | Provides IDE channel and device information for the interface.\r | |
120 | \r | |
121 | This function is used by the driver entity to get controller information.\r | |
122 | \r | |
123 | @param[in] This Pointer to the EFI_DISK_INFO_PROTOCOL instance.\r | |
124 | @param[out] IdeChannel Pointer to the Ide Channel number. Primary or secondary.\r | |
125 | @param[out] IdeDevice Pointer to the Ide Device number. Master or slave.\r | |
126 | \r | |
127 | @retval EFI_SUCCESS IdeChannel and IdeDevice are valid.\r | |
128 | @retval EFI_UNSUPPORTED This is not an IDE device.\r | |
129 | \r | |
130 | **/\r | |
131 | EFI_STATUS\r | |
132 | EFIAPI\r | |
133 | EmmcDiskInfoWhichIde (\r | |
134 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
135 | OUT UINT32 *IdeChannel,\r | |
136 | OUT UINT32 *IdeDevice\r | |
137 | )\r | |
138 | {\r | |
139 | return EFI_UNSUPPORTED;\r | |
140 | }\r |