OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
HdaIo.h
Go to the documentation of this file.
1/*
2 * File: HdaIo.h
3 *
4 * Copyright (c) 2018 John Davis
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef EFI_HDA_IO_H
26#define EFI_HDA_IO_H
27
28#include <Uefi.h>
29#include <Protocol/DevicePath.h>
30
31//
32// HDA I/O protocol.
33//
34
35//
36// HDA I/O protocol GUID.
37//
38#define EFI_HDA_IO_PROTOCOL_GUID \
39 { 0xA090D7F9, 0xB50A, 0x4EA1, \
40 { 0xBD, 0xE9, 0x1A, 0xA5, 0xE9, 0x81, 0x2F, 0x45 } }
41
43
52
56typedef struct {
57 UINT32 Count;
58 UINT32 *Verbs;
59 UINT32 *Responses;
61
65typedef
66VOID
69 IN VOID *Context1,
70 IN VOID *Context2,
71 IN VOID *Context3
72 );
73
83typedef
84EFI_STATUS
86 IN EFI_HDA_IO_PROTOCOL *This,
87 OUT UINT8 *CodecAddress
88 );
89
101typedef
102EFI_STATUS
104 IN EFI_HDA_IO_PROTOCOL *This,
105 IN UINT8 Node,
106 IN UINT32 Verb,
107 OUT UINT32 *Response
108 );
109
120typedef
121EFI_STATUS
123 IN EFI_HDA_IO_PROTOCOL *This,
124 IN UINT8 Node,
125 IN OUT EFI_HDA_IO_VERB_LIST *Verbs
126 );
127
128typedef
129EFI_STATUS
131 IN EFI_HDA_IO_PROTOCOL *This,
133 IN UINT16 Format,
134 OUT UINT8 *StreamId
135 );
136
137typedef
138EFI_STATUS
140 IN EFI_HDA_IO_PROTOCOL *This,
142 );
143
144typedef
145EFI_STATUS
146(EFIAPI *EFI_HDA_IO_GET_STREAM)(
147 IN EFI_HDA_IO_PROTOCOL *This,
149 OUT BOOLEAN *State
150 );
151
152typedef
153EFI_STATUS
155 IN EFI_HDA_IO_PROTOCOL *This,
157 IN VOID *Buffer,
158 IN UINTN BufferLength,
159 IN UINTN BufferPosition OPTIONAL,
160 IN EFI_HDA_IO_STREAM_CALLBACK Callback OPTIONAL,
161 IN VOID *Context1 OPTIONAL,
162 IN VOID *Context2 OPTIONAL,
163 IN VOID *Context3 OPTIONAL
164 );
165
166typedef
167EFI_STATUS
168(EFIAPI *EFI_HDA_IO_STOP_STREAM)(
169 IN EFI_HDA_IO_PROTOCOL *This,
171 );
172
186
187extern EFI_GUID gEfiHdaIoProtocolGuid;
188
189//
190// HDA I/O Device Path protocol.
191//
192
196#define EFI_HDA_IO_DEVICE_PATH_GUID \
197 { 0xA9003FEB, 0xD806, 0x41DB, \
198 { 0xA4, 0x91, 0x54, 0x05, 0xFE, 0xEF, 0x46, 0xC3 } }
199
203typedef struct {
207 EFI_DEVICE_PATH_PROTOCOL Header;
208 EFI_GUID Guid;
212 UINT32 Address;
214
217 == sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof (EFI_GUID) + sizeof (UINT32),
218 "Unexpected EFI_HDA_IO_DEVICE_PATH size"
219 );
220
221extern EFI_GUID gEfiHdaIoDevicePathGuid;
222
226#define EFI_HDA_IO_DEVICE_PATH_TEMPLATE \
227 { \
228 { \
229 MESSAGING_DEVICE_PATH, \
230 MSG_VENDOR_DP, \
231 { \
232 (UINT8) (sizeof (EFI_HDA_IO_DEVICE_PATH) & 0xFFU), \
233 (UINT8) ((sizeof (EFI_HDA_IO_DEVICE_PATH) >> 8U) & 0xFFU) \
234 } \
235 }, \
236 gEfiHdaIoDevicePathGuid, \
237 0 \
238 }
239
240#endif // EFI_HDA_IO_H
EFI_GUID gEfiHdaIoProtocolGuid
VOID(EFIAPI * EFI_HDA_IO_STREAM_CALLBACK)(IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN VOID *Context1, IN VOID *Context2, IN VOID *Context3)
Definition HdaIo.h:67
EFI_GUID gEfiHdaIoDevicePathGuid
EFI_STATUS(EFIAPI * EFI_HDA_IO_STOP_STREAM)(IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type)
Definition HdaIo.h:168
EFI_STATUS(EFIAPI * EFI_HDA_IO_GET_ADDRESS)(IN EFI_HDA_IO_PROTOCOL *This, OUT UINT8 *CodecAddress)
Definition HdaIo.h:85
EFI_STATUS(EFIAPI * EFI_HDA_IO_SEND_COMMANDS)(IN EFI_HDA_IO_PROTOCOL *This, IN UINT8 Node, IN OUT EFI_HDA_IO_VERB_LIST *Verbs)
Definition HdaIo.h:122
EFI_STATUS(EFIAPI * EFI_HDA_IO_CLOSE_STREAM)(IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type)
Definition HdaIo.h:139
EFI_STATUS(EFIAPI * EFI_HDA_IO_GET_STREAM)(IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, OUT BOOLEAN *State)
Definition HdaIo.h:146
STATIC_ASSERT(sizeof(EFI_HDA_IO_DEVICE_PATH)==sizeof(EFI_DEVICE_PATH_PROTOCOL)+sizeof(EFI_GUID)+sizeof(UINT32), "Unexpected EFI_HDA_IO_DEVICE_PATH size")
EFI_STATUS(EFIAPI * EFI_HDA_IO_SETUP_STREAM)(IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN UINT16 Format, OUT UINT8 *StreamId)
Definition HdaIo.h:130
EFI_STATUS(EFIAPI * EFI_HDA_IO_SEND_COMMAND)(IN EFI_HDA_IO_PROTOCOL *This, IN UINT8 Node, IN UINT32 Verb, OUT UINT32 *Response)
Definition HdaIo.h:103
EFI_STATUS(EFIAPI * EFI_HDA_IO_START_STREAM)(IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN BufferPosition OPTIONAL, IN EFI_HDA_IO_STREAM_CALLBACK Callback OPTIONAL, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *Context3 OPTIONAL)
Definition HdaIo.h:154
EFI_HDA_IO_PROTOCOL_TYPE
Definition HdaIo.h:47
@ EfiHdaIoTypeOutput
Definition HdaIo.h:49
@ EfiHdaIoTypeMaximum
Definition HdaIo.h:50
@ EfiHdaIoTypeInput
Definition HdaIo.h:48
OC_TYPING_BUFFER_ENTRY Buffer[OC_TYPING_BUFFER_SIZE]
Definition OcTypingLib.h:42
EFI_DEVICE_PATH_PROTOCOL Header
Definition HdaIo.h:207
EFI_HDA_IO_CLOSE_STREAM CloseStream
Definition HdaIo.h:181
EFI_HDA_IO_GET_ADDRESS GetAddress
Definition HdaIo.h:177
EFI_HDA_IO_START_STREAM StartStream
Definition HdaIo.h:183
EFI_HDA_IO_SETUP_STREAM SetupStream
Definition HdaIo.h:180
EFI_HDA_IO_SEND_COMMAND SendCommand
Definition HdaIo.h:178
EFI_HDA_IO_GET_STREAM GetStream
Definition HdaIo.h:182
EFI_HDA_IO_STOP_STREAM StopStream
Definition HdaIo.h:184
EFI_HDA_IO_SEND_COMMANDS SendCommands
Definition HdaIo.h:179
UINT32 * Verbs
Definition HdaIo.h:58
UINT32 * Responses
Definition HdaIo.h:59