1f9f848faSopenharmony_ci/*
2f9f848faSopenharmony_ci * Copyright (c) 2013-2019, Huawei Technologies Co., Ltd. All rights reserved.
3f9f848faSopenharmony_ci * Copyright (c) 2020, Huawei Device Co., Ltd. All rights reserved.
4f9f848faSopenharmony_ci *
5f9f848faSopenharmony_ci * Redistribution and use in source and binary forms, with or without modification,
6f9f848faSopenharmony_ci * are permitted provided that the following conditions are met:
7f9f848faSopenharmony_ci *
8f9f848faSopenharmony_ci * 1. Redistributions of source code must retain the above copyright notice, this list of
9f9f848faSopenharmony_ci *    conditions and the following disclaimer.
10f9f848faSopenharmony_ci *
11f9f848faSopenharmony_ci * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12f9f848faSopenharmony_ci *    of conditions and the following disclaimer in the documentation and/or other materials
13f9f848faSopenharmony_ci *    provided with the distribution.
14f9f848faSopenharmony_ci *
15f9f848faSopenharmony_ci * 3. Neither the name of the copyright holder nor the names of its contributors may be used
16f9f848faSopenharmony_ci *    to endorse or promote products derived from this software without specific prior written
17f9f848faSopenharmony_ci *    permission.
18f9f848faSopenharmony_ci *
19f9f848faSopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20f9f848faSopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21f9f848faSopenharmony_ci * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22f9f848faSopenharmony_ci * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23f9f848faSopenharmony_ci * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24f9f848faSopenharmony_ci * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25f9f848faSopenharmony_ci * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26f9f848faSopenharmony_ci * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27f9f848faSopenharmony_ci * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28f9f848faSopenharmony_ci * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29f9f848faSopenharmony_ci * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30f9f848faSopenharmony_ci */
31f9f848faSopenharmony_ci
32f9f848faSopenharmony_ci#ifndef _USB_API_H
33f9f848faSopenharmony_ci#define	_USB_API_H
34f9f848faSopenharmony_ci
35f9f848faSopenharmony_ci#include <los_config.h>
36f9f848faSopenharmony_ci#include "sys/module.h"
37f9f848faSopenharmony_ci
38f9f848faSopenharmony_ci#ifdef __cplusplus
39f9f848faSopenharmony_ci#if __cplusplus
40f9f848faSopenharmony_ciextern "C" {
41f9f848faSopenharmony_ci#endif /* __cplusplus */
42f9f848faSopenharmony_ci#endif /* __cplusplus */
43f9f848faSopenharmony_ci
44f9f848faSopenharmony_ci/* extern struct module_data bsd_##name##_##busname##_driver_mod */
45f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_HOST_EHCI
46f9f848faSopenharmony_ci/* host or device controller modules */
47f9f848faSopenharmony_ci/* usb controller modules  link xxx-controller bus */
48f9f848faSopenharmony_ciextern struct driver_module_data usbus_ehci_driver_mod;
49f9f848faSopenharmony_ci#endif
50f9f848faSopenharmony_ci
51f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_HOST_XHCI
52f9f848faSopenharmony_ciextern struct driver_module_data usbus_xhci_driver_mod;
53f9f848faSopenharmony_ci#endif
54f9f848faSopenharmony_ci
55f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_HOST_DRIVER
56f9f848faSopenharmony_ci/* root hub driver modules  link to usb bus */
57f9f848faSopenharmony_ciextern struct driver_module_data uhub_usbus_driver_mod;
58f9f848faSopenharmony_ci/* xxx class driver moudles  link to usb hub bus */
59f9f848faSopenharmony_ciextern struct driver_module_data uhub_uhub_driver_mod;
60f9f848faSopenharmony_ci#endif
61f9f848faSopenharmony_ci
62f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_4G_MODEM
63f9f848faSopenharmony_ciextern struct driver_module_data cdce_uhub_driver_mod;
64f9f848faSopenharmony_ci#endif
65f9f848faSopenharmony_ci
66f9f848faSopenharmony_ci#if defined (LOSCFG_DRIVERS_USB_SERIAL) || defined (LOSCFG_DRIVERS_USB_4G_MODEM)
67f9f848faSopenharmony_ciextern struct driver_module_data u3g_uhub_driver_mod;
68f9f848faSopenharmony_ci#endif
69f9f848faSopenharmony_ci
70f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_ETHERNET
71f9f848faSopenharmony_ciextern struct driver_module_data axe_uhub_driver_mod;
72f9f848faSopenharmony_ciextern struct driver_module_data axge_uhub_driver_mod;
73f9f848faSopenharmony_ci#endif
74f9f848faSopenharmony_ci
75f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_RNDIS_HOST
76f9f848faSopenharmony_ciextern struct driver_module_data urndis_uhub_driver_mod;
77f9f848faSopenharmony_ci#endif
78f9f848faSopenharmony_ci
79f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_MASS_STORAGE
80f9f848faSopenharmony_ciextern struct driver_module_data umass_uhub_driver_mod;
81f9f848faSopenharmony_ci#endif
82f9f848faSopenharmony_ci
83f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_WIRELESS
84f9f848faSopenharmony_ciextern struct driver_module_data usb_linux_uhub_driver_mod;
85f9f848faSopenharmony_ci#endif
86f9f848faSopenharmony_ci
87f9f848faSopenharmony_ci#if defined (LOSCFG_DRIVERS_USB_HID_CLASS) && defined (LOSCFG_DRIVERS_HDF_INPUT)
88f9f848faSopenharmony_ciextern struct driver_module_data uhid_uhub_driver_mod;
89f9f848faSopenharmony_ci#endif
90f9f848faSopenharmony_ci
91f9f848faSopenharmony_ciextern struct driver_module_data composite_hiudc3_driver_mod;
92f9f848faSopenharmony_ci
93f9f848faSopenharmony_ciextern struct driver_module_data fcdcacm_simple_driver_mod;
94f9f848faSopenharmony_ciextern struct driver_module_data fconfig_simple_driver_mod;
95f9f848faSopenharmony_ci
96f9f848faSopenharmony_ciextern int hiudc3_init(void);
97f9f848faSopenharmony_ciextern int usbd_load_driver(void);
98f9f848faSopenharmony_ciextern int usbd_start_udc(void);
99f9f848faSopenharmony_ciextern int usbd_enable_interrupt(void);
100f9f848faSopenharmony_ci
101f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_HOST_XHCI
102f9f848faSopenharmony_ciint hixhci_init(void);
103f9f848faSopenharmony_ci#endif
104f9f848faSopenharmony_ci
105f9f848faSopenharmony_ci#ifdef LOSCFG_DRIVERS_USB_HOST_EHCI
106f9f848faSopenharmony_ciint hiehci_init(void);
107f9f848faSopenharmony_ci#endif
108f9f848faSopenharmony_ci
109f9f848faSopenharmony_ci#ifdef LOSCFG_USB_DEBUG
110f9f848faSopenharmony_civoid usb_debug_module_regsiter(void);
111f9f848faSopenharmony_civoid usb_debug_module_unregsiter(void);
112f9f848faSopenharmony_ci#endif
113f9f848faSopenharmony_ci
114f9f848faSopenharmony_ciconst char* fetach_usbversion(void);
115f9f848faSopenharmony_ci
116f9f848faSopenharmony_civolatile unsigned int userial_mask_get(void);
117f9f848faSopenharmony_civoid userial_mask_set(unsigned int val);
118f9f848faSopenharmony_ci
119f9f848faSopenharmony_ci#ifdef __cplusplus
120f9f848faSopenharmony_ci#if __cplusplus
121f9f848faSopenharmony_ci}
122f9f848faSopenharmony_ci#endif
123f9f848faSopenharmony_ci#endif /* __cplusplus */
124f9f848faSopenharmony_ci
125f9f848faSopenharmony_ci#endif /* _USB_API_H */
126f9f848faSopenharmony_ci
127