source: mainline/uspace/drv/bus/usb/ohci/main.c

Last change on this file was 9dfb034, checked in by Jiri Svoboda <jiri@…>, 5 months ago

Implement quiesce for EHCI and OHCI.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 * Copyright (c) 2025 Jiri Svoboda
3 * Copyright (c) 2011 Jan Vesely
4 * Copyright (c) 2011 Vojtech Horky
5 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * - Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * - The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/** @addtogroup drvusbohci
33 * @{
34 */
35/** @file
36 * Main routines of OHCI driver.
37 */
38
39#include <assert.h>
40#include <ddf/driver.h>
41#include <errno.h>
42#include <io/log.h>
43#include <io/logctl.h>
44#include <str_error.h>
45
46#include <usb/debug.h>
47
48#include "hc.h"
49#include "ohci_bus.h"
50
51#define NAME "ohci"
52
53static const hc_driver_t ohci_driver = {
54 .name = NAME,
55 .hc_device_size = sizeof(hc_t),
56
57 .hc_add = hc_add,
58 .irq_code_gen = hc_gen_irq_code,
59 .claim = hc_gain_control,
60 .start = hc_start,
61 .setup_root_hub = hc_setup_roothub,
62 .hc_gone = hc_gone,
63 .hc_quiesce = hc_quiesce
64};
65
66/** Initializes global driver structures (NONE).
67 *
68 * @param[in] argc Nmber of arguments in argv vector (ignored).
69 * @param[in] argv Cmdline argument vector (ignored).
70 * @return Error code.
71 *
72 * Driver debug level is set here.
73 */
74int main(int argc, char *argv[])
75{
76 log_init(NAME);
77 logctl_set_log_level(NAME, LVL_NOTE);
78 return hc_driver_main(&ohci_driver);
79}
80
81/**
82 * @}
83 */
Note: See TracBrowser for help on using the repository browser.