source: mainline/uspace/drv/pciintel/pci.h@ 713a4b9

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 713a4b9 was 713a4b9, checked in by Jiri Svoboda <jiri@…>, 15 years ago

Convert inline functions to regular functions in pciintel.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * Copyright (c) 2010 Lenka Trochtova
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup pciintel
30 * @{
31 */
32/** @file
33 */
34
35#ifndef PCI_H_
36#define PCI_H_
37
38#include <stdlib.h>
39#include <driver.h>
40#include <malloc.h>
41
42#include "pci_regs.h"
43
44#define PCI_MAX_HW_RES 8
45
46typedef struct pci_dev_data {
47 int bus;
48 int dev;
49 int fn;
50 int vendor_id;
51 int device_id;
52 hw_resource_list_t hw_resources;
53} pci_dev_data_t;
54
55extern void create_pci_match_ids(device_t *);
56
57extern uint8_t pci_conf_read_8(device_t *, int);
58extern uint16_t pci_conf_read_16(device_t *, int);
59extern uint32_t pci_conf_read_32(device_t *, int);
60extern void pci_conf_write_8(device_t *, int, uint8_t);
61extern void pci_conf_write_16(device_t *, int, uint16_t);
62extern void pci_conf_write_32(device_t *, int, uint32_t);
63
64extern void pci_add_range(device_t *, uint64_t, size_t, bool);
65extern int pci_read_bar(device_t *, int);
66extern void pci_read_interrupt(device_t *);
67extern void pci_add_interrupt(device_t *, int);
68
69extern void pci_bus_scan(device_t *, int);
70
71extern pci_dev_data_t *create_pci_dev_data(void);
72extern void init_pci_dev_data(pci_dev_data_t *, int, int, int);
73extern void delete_pci_dev_data(pci_dev_data_t *);
74extern void create_pci_dev_name(device_t *);
75
76extern bool pci_alloc_resource_list(device_t *);
77extern void pci_clean_resource_list(device_t *);
78
79extern void pci_read_bars(device_t *);
80extern size_t pci_bar_mask_to_size(uint32_t);
81
82#endif
83
84/**
85 * @}
86 */
Note: See TracBrowser for help on using the repository browser.