source: mainline/uspace/drv/bus/usb/ohci/hc.h@ ad896eb

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since ad896eb was a35b458, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2011 Jan Vesely
3 * Copyright (c) 2018 Ondrej Hlavaty
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup drvusbohci
31 * @{
32 */
33/** @file
34 * @brief OHCI host controller driver structure
35 */
36
37#ifndef DRV_OHCI_HC_H
38#define DRV_OHCI_HC_H
39
40#include <adt/list.h>
41#include <ddi.h>
42#include <ddf/driver.h>
43#include <device/hw_res_parsed.h>
44#include <fibril.h>
45#include <fibril_synch.h>
46#include <stdbool.h>
47#include <stdint.h>
48
49#include <usb/host/hcd.h>
50#include <usb/host/endpoint.h>
51#include <usb/host/usb_transfer_batch.h>
52
53#include "ohci_regs.h"
54#include "ohci_rh.h"
55#include "ohci_bus.h"
56#include "endpoint_list.h"
57#include "hw_struct/hcca.h"
58
59/** Main OHCI driver structure */
60typedef struct hc {
61 /** Common hcd header */
62 hc_device_t base;
63
64 /** Memory mapped I/O registers area */
65 ohci_regs_t *registers;
66
67 /** Host controller communication area structure */
68 hcca_t *hcca;
69
70 /** Transfer schedules */
71 endpoint_list_t lists[4];
72
73 /** List of active endpoints */
74 list_t pending_endpoints;
75
76 /** Guards schedule and endpoint manipulation */
77 fibril_mutex_t guard;
78
79 /** USB hub emulation structure */
80 ohci_rh_t rh;
81
82 /** USB bookkeeping */
83 ohci_bus_t bus;
84} hc_t;
85
86static inline hc_t *hcd_to_hc(hc_device_t *hcd)
87{
88 assert(hcd);
89 return (hc_t *) hcd;
90}
91
92extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *);
93extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *,
94 const hw_res_list_parsed_t *, int *);
95extern errno_t hc_gain_control(hc_device_t *);
96extern errno_t hc_start(hc_device_t *);
97extern errno_t hc_setup_roothub(hc_device_t *);
98extern errno_t hc_gone(hc_device_t *);
99
100extern void hc_enqueue_endpoint(hc_t *, const endpoint_t *);
101extern void hc_dequeue_endpoint(hc_t *, const endpoint_t *);
102
103extern errno_t ohci_hc_schedule(usb_transfer_batch_t *);
104extern errno_t ohci_hc_status(bus_t *, uint32_t *);
105extern void ohci_hc_interrupt(bus_t *, uint32_t);
106
107#endif
108
109/**
110 * @}
111 */
Note: See TracBrowser for help on using the repository browser.