1 /** @file
2 
3   Copyright (c) 2015-2017, Linaro. All rights reserved.
4 
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 __DW_USB_H__
16 #define __DW_USB_H__
17 
18 //
19 // Protocol GUID
20 //
21 #define DW_USB_PROTOCOL_GUID { 0x109fa264, 0x7811, 0x4862, { 0xa9, 0x73, 0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }}
22 
23 //
24 // Protocol interface structure
25 //
26 typedef struct _DW_USB_PROTOCOL  DW_USB_PROTOCOL;
27 
28 #define USB_HOST_MODE                 0
29 #define USB_DEVICE_MODE               1
30 #define USB_CABLE_NOT_ATTACHED        2
31 
32 #define LANG_LENGTH                   8
33 #define MANU_FACTURER_STRING_LENGTH   32
34 #define PRODUCT_STRING_LENGTH         32
35 #define SERIAL_STRING_LENGTH          17
36 
37 typedef
38 EFI_STATUS
39 (EFIAPI *DW_USB_GET_LANG) (
40   OUT CHAR16                           *Lang,
41   OUT UINT8                            *Length
42   );
43 
44 typedef
45 EFI_STATUS
46 (EFIAPI *DW_USB_GET_MANU_FACTURER) (
47   OUT CHAR16                           *ManuFacturer,
48   OUT UINT8                            *Length
49   );
50 
51 typedef
52 EFI_STATUS
53 (EFIAPI *DW_USB_GET_PRODUCT) (
54   OUT CHAR16                           *Product,
55   OUT UINT8                            *Length
56   );
57 
58 typedef
59 EFI_STATUS
60 (EFIAPI *DW_USB_GET_SERIAL_NO) (
61   OUT CHAR16                           *SerialNo,
62   OUT UINT8                            *Length
63   );
64 
65 typedef
66 EFI_STATUS
67 (EFIAPI *DW_USB_PHY_INIT) (
68   IN UINT8                             Mode
69   );
70 
71 struct _DW_USB_PROTOCOL {
72   DW_USB_GET_LANG                      GetLang;
73   DW_USB_GET_MANU_FACTURER             GetManuFacturer;
74   DW_USB_GET_PRODUCT                   GetProduct;
75   DW_USB_GET_SERIAL_NO                 GetSerialNo;
76   DW_USB_PHY_INIT                      PhyInit;
77 };
78 
79 extern EFI_GUID gDwUsbProtocolGuid;
80 
81 #endif
82