[41b96b4] | 1 | /*
|
---|
[9dfb034] | 2 | * Copyright (c) 2025 Jiri Svoboda
|
---|
[41b96b4] | 3 | * Copyright (c) 2011 Jan Vesely
|
---|
| 4 | * Copyright (c) 2011 Vojtech Horky
|
---|
[e0a5d4c] | 5 | * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek
|
---|
[41b96b4] | 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 | */
|
---|
[58563585] | 31 |
|
---|
[41b96b4] | 32 | /** @addtogroup drvusbohci
|
---|
| 33 | * @{
|
---|
| 34 | */
|
---|
| 35 | /** @file
|
---|
| 36 | * Main routines of OHCI driver.
|
---|
| 37 | */
|
---|
[0d4b110] | 38 |
|
---|
| 39 | #include <assert.h>
|
---|
[41b96b4] | 40 | #include <ddf/driver.h>
|
---|
| 41 | #include <errno.h>
|
---|
[0d4b110] | 42 | #include <io/log.h>
|
---|
[d60115a] | 43 | #include <io/logctl.h>
|
---|
[41b96b4] | 44 | #include <str_error.h>
|
---|
| 45 |
|
---|
| 46 | #include <usb/debug.h>
|
---|
| 47 |
|
---|
[da06e92] | 48 | #include "hc.h"
|
---|
[e6b9182] | 49 | #include "ohci_bus.h"
|
---|
[41b96b4] | 50 |
|
---|
[53f1c87] | 51 | #define NAME "ohci"
|
---|
[b5f813c] | 52 |
|
---|
[32fb6bce] | 53 | static const hc_driver_t ohci_driver = {
|
---|
[dc5f2fb] | 54 | .name = NAME,
|
---|
[32fb6bce] | 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,
|
---|
[129b821f] | 61 | .setup_root_hub = hc_setup_roothub,
|
---|
[32fb6bce] | 62 | .hc_gone = hc_gone,
|
---|
[9dfb034] | 63 | .hc_quiesce = hc_quiesce
|
---|
[dc5f2fb] | 64 | };
|
---|
[76fbd9a] | 65 |
|
---|
[41b96b4] | 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 | */
|
---|
| 74 | int main(int argc, char *argv[])
|
---|
| 75 | {
|
---|
[920d0fc] | 76 | log_init(NAME);
|
---|
[b2dca8de] | 77 | logctl_set_log_level(NAME, LVL_NOTE);
|
---|
[32fb6bce] | 78 | return hc_driver_main(&ohci_driver);
|
---|
[41b96b4] | 79 | }
|
---|
[58563585] | 80 |
|
---|
[41b96b4] | 81 | /**
|
---|
| 82 | * @}
|
---|
| 83 | */
|
---|