]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libvbus/include/vbus_pci.h
update
[l4.git] / l4 / pkg / libvbus / include / vbus_pci.h
1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *          Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #pragma once
11
12 #include <l4/sys/compiler.h>
13 #include <l4/vbus/vbus_types.h>
14 #include <l4/sys/types.h>
15
16 __BEGIN_DECLS
17
18 /**
19  * \brief Read from the vPCI configuration space.
20  *
21  * \param  vbus         capability of the system bus
22  * \param  handle       device handle
23  * \param  bus          bus id
24  * \param  devfn        devfn
25  * \param  reg          register
26  * \retval value        Value that has been read
27  * \param  width        Width to read in bits (e.g. 8, 16, 32)
28  *
29  * \return 0 on succes, else failure
30  */
31 int L4_CV
32 l4vbus_pci_cfg_read(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
33                     l4_uint32_t bus, l4_uint32_t devfn,
34                     l4_uint32_t reg, l4_uint32_t *value, l4_uint32_t width);
35
36 /**
37  * \brief Write to the vPCI configuration space.
38  *
39  * \param  vbus         capability of the system bus
40  * \param  handle       device handle
41  * \param  bus          bus id
42  * \param  devfn        devfn
43  * \param  reg          register
44  * \param  value        Value to write
45  * \param  width        Width to write in bits (e.g. 8, 16, 32)
46  */
47 int L4_CV
48 l4vbus_pci_cfg_write(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
49                      l4_uint32_t bus, l4_uint32_t devfn,
50                      l4_uint32_t reg, l4_uint32_t value, l4_uint32_t width);
51
52 /**
53  * \brief Enable PCI interrupt.
54  *
55  * \param  vbus         capability of the system bus
56  * \param  handle       device handle
57  * \param  bus          bus id
58  * \param  devfn        devfn
59  * \param  pin          Pin
60  * \retval trigger      Trigger
61  * \retval polarity     Polarity
62  */
63 int L4_CV
64 l4vbus_pci_irq_enable(l4_cap_idx_t vbus, l4vbus_device_handle_t handle,
65                       l4_uint32_t bus, l4_uint32_t devfn,
66                       int pin, unsigned char *trigger,
67                       unsigned char *polarity);
68
69 __END_DECLS