]>
Commit | Line | Data |
---|---|---|
3f1484f6 AD |
1 | /** @file\r |
2 | Header file for USB Serial Driver's Data Structures.\r | |
3 | \r | |
4 | Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.\r | |
5 | Portions Copyright 2012 Ashley DeSimone\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD\r | |
8 | License which accompanies this distribution. The full text of the license may\r | |
9 | be found at http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _FTDI_USB_SERIAL_DRIVER_H_\r | |
17 | #define _FTDI_USB_SERIAL_DRIVER_H_\r | |
18 | \r | |
19 | #include <Library/BaseMemoryLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/MemoryAllocationLib.h>\r | |
22 | #include <Library/UefiBootServicesTableLib.h>\r | |
23 | #include <Library/UefiLib.h>\r | |
24 | #include <Library/DevicePathLib.h>\r | |
25 | \r | |
26 | #include <Protocol/DevicePath.h>\r | |
27 | #include <Protocol/UsbIo.h>\r | |
28 | #include <Protocol/SerialIo.h>\r | |
29 | \r | |
30 | //\r | |
31 | // US English LangID\r | |
32 | //\r | |
33 | #define USB_US_LANG_ID 0x0409\r | |
34 | \r | |
35 | //\r | |
36 | // Supported Vendor Ids\r | |
37 | //\r | |
38 | #define VID_FTDI 0x0403\r | |
39 | \r | |
40 | //\r | |
41 | // Supported product ids\r | |
42 | //\r | |
43 | #define DID_FTDI_FT232 0x6001\r | |
44 | \r | |
45 | //\r | |
46 | // FTDI Commands\r | |
47 | //\r | |
48 | #define FTDI_COMMAND_RESET_PORT 0\r | |
49 | #define FTDI_COMMAND_MODEM_CTRL 1\r | |
50 | #define FTDI_COMMAND_SET_FLOW_CTRL 2\r | |
51 | #define FTDI_COMMAND_SET_BAUDRATE 3\r | |
52 | #define FTDI_COMMAND_SET_DATA 4\r | |
53 | #define FTDI_COMMAND_GET_MODEM_STATUS 5\r | |
54 | #define FTDI_COMMAND_SET_EVENT_CHAR 6\r | |
55 | #define FTDI_COMMAND_SET_ERROR_CHAR 7\r | |
56 | #define FTDI_COMMAND_SET_LATENCY_TIMER 9\r | |
57 | #define FTDI_COMMAND_GET_LATENCY_TIMER 10\r | |
58 | \r | |
59 | //\r | |
60 | // FTDI_PORT_IDENTIFIER\r | |
61 | // Used in the usb control transfers that issue FTDI commands as the index value.\r | |
62 | //\r | |
63 | #define FTDI_PORT_IDENTIFIER 0x1 // For FTDI USB serial adapter the port\r | |
64 | // identifier is always 1.\r | |
65 | \r | |
66 | //\r | |
67 | // RESET_PORT\r | |
68 | //\r | |
69 | #define RESET_PORT_RESET 0x0 // Purges RX and TX, clears DTR and RTS sets\r | |
70 | // flow control to none, disables event\r | |
71 | // trigger, sets the event char to 0x0d and\r | |
72 | // does nothing to baudrate or data settings\r | |
73 | #define RESET_PORT_PURGE_RX 0x1\r | |
74 | #define RESET_PORT_PURGE_TX 0x2\r | |
75 | \r | |
76 | //\r | |
77 | // SET_FLOW_CONTROL\r | |
78 | //\r | |
79 | #define NO_FLOW_CTRL 0x0\r | |
80 | #define XON_XOFF_CTRL 0x4\r | |
81 | \r | |
82 | //\r | |
83 | // SET_BAUD_RATE\r | |
84 | // To set baud rate, one must calculate an encoding of the baud rate from\r | |
85 | // UINT32 to UINT16.See EncodeBaudRateForFtdi() for details\r | |
86 | //\r | |
87 | #define FTDI_UART_FREQUENCY 3000000\r | |
88 | #define FTDI_MIN_DIVISOR 0x20\r | |
89 | #define FTDI_MAX_DIVISOR 0x3FFF8\r | |
90 | //\r | |
91 | // Special case baudrate values\r | |
92 | // 300,000 and 200,000 are special cases for calculating the encoded baudrate\r | |
93 | //\r | |
94 | #define FTDI_SPECIAL_CASE_300_MIN (3000000 * 100) / 103 // minimum adjusted\r | |
95 | // value for 300,000\r | |
96 | #define FTDI_SPECIAL_CASE_300_MAX (3000000 * 100) / 97 // maximum adjusted\r | |
97 | // value for 300,000\r | |
98 | #define FTDI_SPECIAL_CASE_200_MIN (2000000 * 100) / 103 // minimum adjusted\r | |
99 | // value for 200,000\r | |
100 | #define FTDI_SPECIAL_CASE_200_MAX (2000000 * 100) / 97 // maximum adjusted\r | |
101 | // value for 200,000\r | |
102 | //\r | |
103 | // Min and max frequency values that the FTDI chip can attain\r | |
104 | //.all generated frequencies must be between these values\r | |
105 | //\r | |
106 | #define FTDI_MIN_FREQUENCY 46601941 // (3MHz * 1600) / 103 = 46601941\r | |
107 | #define FTDI_MAX_FREQUENCY 49484536 // (3MHz * 1600) / 97 = 49484536\r | |
108 | \r | |
109 | //\r | |
110 | // SET_DATA_BITS\r | |
111 | //\r | |
112 | #define SET_DATA_BITS(n) (n)\r | |
113 | \r | |
114 | //\r | |
115 | // SET_PARITY\r | |
116 | //\r | |
117 | #define SET_PARITY_NONE 0x0\r | |
118 | #define SET_PARITY_ODD BIT8 // (0x1 << 8)\r | |
119 | #define SET_PARITY_EVEN BIT9 // (0x2 << 8)\r | |
120 | #define SET_PARITY_MARK BIT9 | BIT8 // (0x3 << 8)\r | |
121 | #define SET_PARITY_SPACE BIT10 // (0x4 << 8)\r | |
122 | \r | |
123 | //\r | |
124 | // SET_STOP_BITS\r | |
125 | //\r | |
126 | #define SET_STOP_BITS_1 0x0\r | |
127 | #define SET_STOP_BITS_15 BIT11 // (0x1 << 11)\r | |
128 | #define SET_STOP_BITS_2 BIT12 // (0x2 << 11)\r | |
129 | \r | |
130 | //\r | |
131 | // SET_MODEM_CTRL\r | |
132 | // SET_DTR_HIGH = (1 | (1 << 8)), SET_DTR_LOW = (0 | (1 << 8)\r | |
133 | // SET_RTS_HIGH = (2 | (2 << 8)), SET_RTS_LOW = (0 | (2 << 8)\r | |
134 | //\r | |
135 | #define SET_DTR_HIGH (BIT8 | BIT0)\r | |
136 | #define SET_DTR_LOW (BIT8)\r | |
137 | #define SET_RTS_HIGH (BIT9 | BIT1)\r | |
138 | #define SET_RTS_LOW (BIT9)\r | |
139 | \r | |
140 | //\r | |
141 | // MODEM_STATUS\r | |
142 | //\r | |
143 | #define CTS_MASK BIT4\r | |
144 | #define DSR_MASK BIT5\r | |
145 | #define RI_MASK BIT6\r | |
146 | #define SD_MASK BIT7\r | |
147 | #define MSR_MASK (CTS_MASK | DSR_MASK | RI_MASK | SD_MASK)\r | |
148 | \r | |
149 | //\r | |
150 | // Macro used to check for USB transfer errors\r | |
151 | //\r | |
152 | #define USB_IS_ERROR(Result, Error) (((Result) & (Error)) != 0)\r | |
153 | \r | |
154 | //\r | |
155 | // USB request timeouts\r | |
156 | //\r | |
157 | #define WDR_TIMEOUT 5000 // default urb timeout in ms\r | |
158 | #define WDR_SHORT_TIMEOUT 1000 // shorter urb timeout in ms\r | |
159 | \r | |
160 | //\r | |
161 | // FTDI timeout\r | |
162 | //\r | |
163 | #define FTDI_TIMEOUT 16\r | |
164 | \r | |
165 | //\r | |
166 | // FTDI FIFO depth\r | |
167 | //\r | |
168 | #define FTDI_MAX_RECEIVE_FIFO_DEPTH 384\r | |
169 | \r | |
170 | //\r | |
171 | // FTDI Endpoint Descriptors\r | |
172 | //\r | |
173 | #define FTDI_ENDPOINT_ADDRESS_IN 0x81 //the endpoint address for the in enpoint generated by the device\r | |
174 | #define FTDI_ENDPOINT_ADDRESS_OUT 0x02 //the endpoint address for the out endpoint generated by the device\r | |
175 | \r | |
176 | //\r | |
177 | // Max buffer size for USB transfers\r | |
178 | //\r | |
179 | #define SW_FIFO_DEPTH 1024\r | |
180 | \r | |
181 | //\r | |
182 | // struct to define a usb device as a vendor and product id pair\r | |
183 | //\r | |
184 | typedef struct {\r | |
185 | UINTN VendorId;\r | |
186 | UINTN DeviceId;\r | |
187 | } USB_DEVICE;\r | |
188 | \r | |
189 | //\r | |
190 | //struct to describe the control bits of the device\r | |
191 | //true indicates enabled\r | |
192 | //false indicates disabled\r | |
193 | // \r | |
194 | typedef struct {\r | |
195 | BOOLEAN HardwareFlowControl;\r | |
196 | BOOLEAN DtrState;\r | |
197 | BOOLEAN RtsState;\r | |
198 | BOOLEAN HardwareLoopBack;\r | |
199 | BOOLEAN SoftwareLoopBack;\r | |
200 | } CONTROL_BITS;\r | |
201 | \r | |
202 | //\r | |
203 | //struct to describe the status bits of the device \r | |
204 | //true indicates enabled\r | |
205 | //false indicated disabled\r | |
206 | //\r | |
207 | typedef struct {\r | |
208 | BOOLEAN CtsState;\r | |
209 | BOOLEAN DsrState;\r | |
210 | BOOLEAN RiState;\r | |
211 | BOOLEAN SdState;\r | |
212 | } STATUS_BITS;\r | |
213 | \r | |
214 | //\r | |
215 | // Structure to describe the last attributes of the Usb Serial device\r | |
216 | //\r | |
217 | typedef struct {\r | |
218 | UINT64 BaudRate;\r | |
219 | UINT32 ReceiveFifoDepth;\r | |
220 | UINT32 Timeout;\r | |
221 | EFI_PARITY_TYPE Parity;\r | |
222 | UINT8 DataBits;\r | |
223 | EFI_STOP_BITS_TYPE StopBits;\r | |
224 | } PREVIOUS_ATTRIBUTES;\r | |
225 | \r | |
226 | //\r | |
227 | // Structure to describe USB serial device\r | |
228 | //\r | |
229 | #define USB_SER_DEV_SIGNATURE SIGNATURE_32 ('u', 's', 'b', 's')\r | |
230 | \r | |
231 | typedef struct {\r | |
232 | UINTN Signature;\r | |
233 | EFI_HANDLE ControllerHandle;\r | |
234 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
235 | EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;\r | |
236 | UART_DEVICE_PATH UartDevicePath;\r | |
237 | UART_FLOW_CONTROL_DEVICE_PATH FlowControlDevicePath;\r | |
238 | EFI_USB_IO_PROTOCOL *UsbIo;\r | |
239 | EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;\r | |
240 | EFI_USB_ENDPOINT_DESCRIPTOR InEndpointDescriptor;\r | |
241 | EFI_USB_ENDPOINT_DESCRIPTOR OutEndpointDescriptor;\r | |
242 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
243 | UINT32 DataBufferHead;\r | |
244 | UINT32 DataBufferTail;\r | |
245 | UINT8 *DataBuffer;\r | |
246 | EFI_SERIAL_IO_PROTOCOL SerialIo;\r | |
247 | BOOLEAN Shutdown;\r | |
248 | EFI_EVENT PollingLoop;\r | |
249 | UINT32 ControlBits;\r | |
250 | PREVIOUS_ATTRIBUTES LastSettings;\r | |
251 | CONTROL_BITS ControlValues;\r | |
252 | STATUS_BITS StatusValues;\r | |
253 | UINT8 ReadBuffer[512];\r | |
254 | } USB_SER_DEV;\r | |
255 | \r | |
256 | #define USB_SER_DEV_FROM_THIS(a) \\r | |
257 | CR(a, USB_SER_DEV, SerialIo, USB_SER_DEV_SIGNATURE)\r | |
258 | \r | |
259 | //\r | |
260 | // Global Variables\r | |
261 | //\r | |
262 | extern EFI_DRIVER_BINDING_PROTOCOL gUsbSerialDriverBinding;\r | |
263 | extern EFI_COMPONENT_NAME_PROTOCOL gUsbSerialComponentName;\r | |
264 | extern EFI_COMPONENT_NAME2_PROTOCOL gUsbSerialComponentName2;\r | |
265 | \r | |
266 | //\r | |
267 | // Functions of Driver Binding Protocol\r | |
268 | //\r | |
269 | /**\r | |
270 | Check whether USB Serial driver supports this device.\r | |
271 | \r | |
272 | @param This[in] The USB Serial driver binding protocol.\r | |
273 | @param Controller[in] The controller handle to check.\r | |
274 | @param RemainingDevicePath[in] The remaining device path.\r | |
275 | \r | |
276 | @retval EFI_SUCCESS The driver supports this controller.\r | |
277 | @retval other This device isn't supported.\r | |
278 | \r | |
279 | **/\r | |
280 | EFI_STATUS\r | |
281 | EFIAPI\r | |
282 | UsbSerialDriverBindingSupported (\r | |
283 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
284 | IN EFI_HANDLE Controller,\r | |
285 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
286 | );\r | |
287 | \r | |
288 | /**\r | |
289 | Starts the Serial device with this driver.\r | |
290 | \r | |
291 | This function produces Serial IO Protocol and initializes the USB\r | |
292 | Serial device to manage this USB Serial device.\r | |
293 | \r | |
294 | @param This[in] The USB Serial driver binding instance.\r | |
295 | @param Controller[in] Handle of device to bind driver to.\r | |
296 | @param RemainingDevicePath[in] Optional parameter use to pick a specific\r | |
297 | child device to start.\r | |
298 | \r | |
299 | @retval EFI_SUCCESS The controller is controlled by the USB\r | |
300 | Serial driver.\r | |
301 | @retval EFI_UNSUPPORTED No interrupt endpoint can be found.\r | |
302 | @retval Other This controller cannot be started.\r | |
303 | \r | |
304 | **/\r | |
305 | EFI_STATUS\r | |
306 | EFIAPI\r | |
307 | UsbSerialDriverBindingStart (\r | |
308 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
309 | IN EFI_HANDLE Controller,\r | |
310 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
311 | );\r | |
312 | \r | |
313 | /**\r | |
314 | Stop the USB Serial device handled by this driver.\r | |
315 | \r | |
316 | @param This[in] The USB Serial driver binding protocol.\r | |
317 | @param Controller[in] The controller to release.\r | |
318 | @param NumberOfChildren[in] The number of handles in ChildHandleBuffer.\r | |
319 | @param ChildHandleBuffer[in] The array of child handle.\r | |
320 | \r | |
321 | @retval EFI_SUCCESS The device was stopped.\r | |
322 | @retval EFI_UNSUPPORTED Simple Text In Protocol or Simple Text In Ex\r | |
323 | Protocol is not installed on Controller.\r | |
324 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a\r | |
325 | device error.\r | |
326 | @retval Others Fail to uninstall protocols attached on the\r | |
327 | device.\r | |
328 | \r | |
329 | **/\r | |
330 | EFI_STATUS\r | |
331 | EFIAPI\r | |
332 | UsbSerialDriverBindingStop (\r | |
333 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
334 | IN EFI_HANDLE Controller,\r | |
335 | IN UINTN NumberOfChildren,\r | |
336 | IN EFI_HANDLE *ChildHandleBuffer\r | |
337 | );\r | |
338 | \r | |
339 | //\r | |
340 | // Serial IO Member Functions\r | |
341 | //\r | |
342 | \r | |
343 | /**\r | |
344 | Writes data to a serial device.\r | |
345 | \r | |
346 | @param This[in] Protocol instance pointer.\r | |
347 | @param BufferSize[in, out] On input, the size of the Buffer. On output,\r | |
348 | the amount of data actually written.\r | |
349 | @param Buffer[in] The buffer of data to write\r | |
350 | \r | |
351 | @retval EFI_SUCCESS The data was written.\r | |
352 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
353 | @retval EFI_TIMEOUT The data write was stopped due to a timeout.\r | |
354 | \r | |
355 | **/\r | |
356 | EFI_STATUS\r | |
357 | EFIAPI\r | |
358 | WriteSerialIo (\r | |
359 | IN EFI_SERIAL_IO_PROTOCOL *This,\r | |
360 | IN OUT UINTN *BufferSize,\r | |
361 | IN VOID *Buffer\r | |
362 | );\r | |
363 | \r | |
364 | /**\r | |
365 | Reads data from a serial device.\r | |
366 | \r | |
367 | @param This[in] Protocol instance pointer.\r | |
368 | @param BufferSize[in, out] On input, the size of the Buffer. On output,\r | |
369 | the amount of data returned in Buffer.\r | |
370 | @param Buffer[out] The buffer to return the data into.\r | |
371 | \r | |
372 | @retval EFI_SUCCESS The data was read.\r | |
373 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
374 | @retval EFI_TIMEOUT The data write was stopped due to a timeout.\r | |
375 | \r | |
376 | **/\r | |
377 | EFI_STATUS\r | |
378 | EFIAPI\r | |
379 | ReadSerialIo (\r | |
380 | IN EFI_SERIAL_IO_PROTOCOL *This,\r | |
381 | IN OUT UINTN *BufferSize,\r | |
382 | OUT VOID *Buffer\r | |
383 | );\r | |
384 | \r | |
385 | /**\r | |
386 | Retrieves the status of the control bits on a serial device.\r | |
387 | \r | |
388 | @param This[in] Protocol instance pointer.\r | |
389 | @param Control[out] A pointer to return the current Control signals\r | |
390 | from the serial device.\r | |
391 | \r | |
392 | @retval EFI_SUCCESS The control bits were read from the serial\r | |
393 | device.\r | |
394 | @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r | |
395 | \r | |
396 | **/\r | |
397 | EFI_STATUS\r | |
398 | EFIAPI\r | |
399 | GetControlBits (\r | |
400 | IN EFI_SERIAL_IO_PROTOCOL *This,\r | |
401 | OUT UINT32 *Control\r | |
402 | );\r | |
403 | \r | |
404 | /**\r | |
405 | Set the control bits on a serial device.\r | |
406 | \r | |
407 | @param This[in] Protocol instance pointer.\r | |
408 | @param Control[in] Set the bits of Control that are settable.\r | |
409 | \r | |
410 | @retval EFI_SUCCESS The new control bits were set on the serial device.\r | |
411 | @retval EFI_UNSUPPORTED The serial device does not support this operation.\r | |
412 | @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r | |
413 | \r | |
414 | **/\r | |
415 | EFI_STATUS\r | |
416 | EFIAPI\r | |
417 | SetControlBits (\r | |
418 | IN EFI_SERIAL_IO_PROTOCOL *This,\r | |
419 | IN UINT32 Control\r | |
420 | );\r | |
421 | \r | |
422 | /**\r | |
423 | Calls SetAttributesInternal() to set the baud rate, receive FIFO depth,\r | |
424 | transmit/receice time out, parity, data buts, and stop bits on a serial device.\r | |
425 | \r | |
426 | @param This[in] Protocol instance pointer.\r | |
427 | @param BaudRate[in] The requested baud rate. A BaudRate value of 0\r | |
428 | will use the device's default interface speed.\r | |
429 | @param ReveiveFifoDepth[in] The requested depth of the FIFO on the receive\r | |
430 | side of the serial interface. A ReceiveFifoDepth\r | |
431 | value of 0 will use the device's default FIFO\r | |
432 | depth.\r | |
433 | @param Timeout[in] The requested time out for a single character in\r | |
434 | microseconds.This timeout applies to both the\r | |
435 | transmit and receive side of the interface.A\r | |
436 | Timeout value of 0 will use the device's default\r | |
437 | time out value.\r | |
438 | @param Parity[in] The type of parity to use on this serial device.A\r | |
439 | Parity value of DefaultParity will use the\r | |
440 | device's default parity value.\r | |
441 | @param DataBits[in] The number of data bits to use on the serial\r | |
442 | device. A DataBits value of 0 will use the\r | |
443 | device's default data bit setting.\r | |
444 | @param StopBits[in] The number of stop bits to use on this serial\r | |
445 | device. A StopBits value of DefaultStopBits will\r | |
446 | use the device's default number of stop bits.\r | |
447 | \r | |
448 | @retval EFI_SUCCESS The attributes were set\r | |
449 | @retval EFI_DEVICE_ERROR The attributes were not able to be\r | |
450 | \r | |
451 | **/\r | |
452 | EFI_STATUS\r | |
453 | EFIAPI\r | |
454 | SetAttributes (\r | |
455 | IN EFI_SERIAL_IO_PROTOCOL *This,\r | |
456 | IN UINT64 BaudRate,\r | |
457 | IN UINT32 ReceiveFifoDepth,\r | |
458 | IN UINT32 Timeout,\r | |
459 | IN EFI_PARITY_TYPE Parity,\r | |
460 | IN UINT8 DataBits,\r | |
461 | IN EFI_STOP_BITS_TYPE StopBits\r | |
462 | );\r | |
463 | \r | |
464 | /**\r | |
465 | Reset the serial device.\r | |
466 | \r | |
467 | @param This Protocol instance pointer.\r | |
468 | \r | |
469 | @retval EFI_SUCCESS The device was reset.\r | |
470 | @retval EFI_DEVICE_ERROR The serial device could not be reset.\r | |
471 | \r | |
472 | **/\r | |
473 | EFI_STATUS\r | |
474 | EFIAPI\r | |
475 | SerialReset (\r | |
476 | IN EFI_SERIAL_IO_PROTOCOL *This\r | |
477 | );\r | |
478 | \r | |
479 | //\r | |
480 | // EFI Component Name Functions\r | |
481 | //\r | |
482 | \r | |
483 | /**\r | |
484 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
485 | \r | |
486 | This function retrieves the user readable name of a driver in the form of a\r | |
487 | Unicode string. If the driver specified by This has a user readable name in\r | |
488 | the language specified by Language, then a pointer to the driver name is\r | |
489 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
490 | by This does not support the language specified by Language,\r | |
491 | then EFI_UNSUPPORTED is returned.\r | |
492 | \r | |
493 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL\r | |
494 | or EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
495 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
496 | array indicating the language. This is the\r | |
497 | language of the driver name that the caller\r | |
498 | is requesting, and it must match one of the\r | |
499 | languages specified in SupportedLanguages.\r | |
500 | The number of languages supported by a\r | |
501 | driver is up to the driver writer. Language\r | |
502 | is specified in RFC 4646 or ISO 639-2\r | |
503 | language code format.\r | |
504 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
505 | This Unicode string is the name of the\r | |
506 | driver specified by This in the language\r | |
507 | specified by Language.\r | |
508 | \r | |
509 | @retval EFI_SUCCESS The Unicode string for the Driver specified\r | |
510 | by This and the language specified by\r | |
511 | Language was returned in DriverName.\r | |
512 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
513 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
514 | @retval EFI_UNSUPPORTED The driver specified by This does not\r | |
515 | support the language specified by Language.\r | |
516 | \r | |
517 | **/\r | |
518 | EFI_STATUS\r | |
519 | EFIAPI\r | |
520 | UsbSerialComponentNameGetDriverName (\r | |
521 | IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r | |
522 | IN CHAR8 *Language,\r | |
523 | OUT CHAR16 **DriverName\r | |
524 | );\r | |
525 | \r | |
526 | /**\r | |
527 | Retrieves a Unicode string that is the user readable name of the controller\r | |
528 | that is being managed by a driver.\r | |
529 | \r | |
530 | This function retrieves the user readable name of the controller specified by\r | |
531 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
532 | driver specified by This has a user readable name in the language specified by\r | |
533 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
534 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
535 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
536 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
537 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
538 | \r | |
539 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL\r | |
540 | or EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
541 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
542 | specified by This is managing. This handle\r | |
543 | specifies the controller whose name is to\r | |
544 | be returned.\r | |
545 | @param ChildHandle[in] The handle of the child controller to\r | |
546 | retrieve the name of. This is an optional\r | |
547 | parameter that may be NULL. It will be NULL\r | |
548 | for device drivers. It will also be NULL\r | |
549 | for a bus drivers that wish to retrieve the\r | |
550 | name of the bus controller. It will not be\r | |
551 | NULL for a bus driver that wishes to\r | |
552 | retrieve the name of a child controller.\r | |
553 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
554 | array indicating the language. This is the\r | |
555 | language of the driver name that the caller\r | |
556 | is requesting, and it must match one of the\r | |
557 | languages specified in SupportedLanguages.\r | |
558 | The number of languages supported by a\r | |
559 | driver is up to the driver writer. Language\r | |
560 | is specified in RFC 4646 or ISO 639-2\r | |
561 | language code format.\r | |
562 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
563 | This Unicode string is the name of the\r | |
564 | controller specified by ControllerHandle\r | |
565 | and ChildHandle in the language specified\r | |
566 | by Language from the point of view of the\r | |
567 | driver specified by This.\r | |
568 | \r | |
569 | @retval EFI_SUCCESS The Unicode string for the user readable\r | |
570 | name in the language specified by Language\r | |
571 | for the driver specified by This was\r | |
572 | returned in DriverName.\r | |
573 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
574 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a\r | |
575 | valid EFI_HANDLE.\r | |
576 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
577 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
578 | @retval EFI_UNSUPPORTED The driver specified by This is not\r | |
579 | currently managing the controller specified\r | |
580 | by ControllerHandle and ChildHandle.\r | |
581 | @retval EFI_UNSUPPORTED The driver specified by This does not\r | |
582 | support the language specified by Language.\r | |
583 | \r | |
584 | **/\r | |
585 | EFI_STATUS\r | |
586 | EFIAPI\r | |
587 | UsbSerialComponentNameGetControllerName (\r | |
588 | IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r | |
589 | IN EFI_HANDLE ControllerHandle,\r | |
590 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
591 | IN CHAR8 *Language,\r | |
592 | OUT CHAR16 **ControllerName\r | |
593 | );\r | |
594 | \r | |
595 | #endif\r |