1 /* 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000, BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice unmodified, this list of conditions, and the following 12 * disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 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 * $FreeBSD$ 29 * 30 */ 31 32 #ifndef _PCI_PRIVATE_H_ 33 #define _PCI_PRIVATE_H_ 34 35 /* 36 * Export definitions of the pci bus so that we can more easily share 37 * it with "subclass" busses. A more generic subclassing mechanism would 38 * be nice, but is not present in the tree at this time. 39 */ 40 extern devclass_t pci_devclass; 41 42 void pci_add_children(device_t dev, int busno, size_t dinfo_size); 43 void pci_add_child(device_t bus, struct pci_devinfo *dinfo); 44 int pci_print_child(device_t dev, device_t child); 45 void pci_probe_nomatch(device_t dev, device_t child); 46 int pci_read_ivar(device_t dev, device_t child, int which, 47 uintptr_t *result); 48 int pci_write_ivar(device_t dev, device_t child, int which, 49 uintptr_t value); 50 int pci_set_powerstate_method(device_t dev, device_t child, 51 int state); 52 int pci_get_powerstate_method(device_t dev, device_t child); 53 u_int32_t pci_read_config_method(device_t dev, device_t child, 54 int reg, int width); 55 void pci_write_config_method(device_t dev, device_t child, 56 int reg, u_int32_t val, int width); 57 void pci_enable_busmaster_method(device_t dev, device_t child); 58 void pci_disable_busmaster_method(device_t dev, device_t child); 59 void pci_enable_io_method(device_t dev, device_t child, int space); 60 void pci_disable_io_method(device_t dev, device_t child, int space); 61 struct resource *pci_alloc_resource(device_t dev, device_t child, 62 int type, int *rid, u_long start, u_long end, u_long count, 63 u_int flags); 64 void pci_delete_resource(device_t dev, device_t child, 65 int type, int rid); 66 struct resource_list *pci_get_resource_list (device_t dev, device_t child); 67 struct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f, 68 size_t size); 69 void pci_print_verbose(struct pci_devinfo *dinfo); 70 int pci_freecfg(struct pci_devinfo *dinfo); 71 int pci_child_location_str_method(device_t cbdev, device_t child, 72 char *buf, size_t buflen); 73 int pci_child_pnpinfo_str_method(device_t cbdev, device_t child, 74 char *buf, size_t buflen); 75 #endif /* _PCI_PRIVATE_H_ */ 76