pci_private.h revision 117115
11976Sab196087/* 21976Sab196087 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 31976Sab196087 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 41976Sab196087 * Copyright (c) 2000, BSDi 51976Sab196087 * All rights reserved. 61976Sab196087 * 71976Sab196087 * Redistribution and use in source and binary forms, with or without 81976Sab196087 * modification, are permitted provided that the following conditions 91976Sab196087 * are met: 101976Sab196087 * 1. Redistributions of source code must retain the above copyright 111976Sab196087 * notice unmodified, this list of conditions, and the following 121976Sab196087 * disclaimer. 131976Sab196087 * 2. Redistributions in binary form must reproduce the above copyright 141976Sab196087 * notice, this list of conditions and the following disclaimer in the 151976Sab196087 * documentation and/or other materials provided with the distribution. 161976Sab196087 * 171976Sab196087 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 181976Sab196087 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 191976Sab196087 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 201976Sab196087 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 211976Sab196087 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 221976Sab196087 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 231976Sab196087 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 241976Sab196087 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 251976Sab196087 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 261976Sab196087 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 271976Sab196087 * 281976Sab196087 * $FreeBSD: head/sys/dev/pci/pci_private.h 117115 2003-07-01 14:08:33Z tmm $ 291976Sab196087 * 301976Sab196087 */ 311976Sab196087 321976Sab196087#ifndef _PCI_PRIVATE_H_ 331976Sab196087#define _PCI_PRIVATE_H_ 341976Sab196087 351976Sab196087/* 361976Sab196087 * Export definitions of the pci bus so that we can more easily share 371976Sab196087 * it with "subclass" busses. A more generic subclassing mechanism would 381976Sab196087 * be nice, but is not present in the tree at this time. 391976Sab196087 */ 401976Sab196087extern devclass_t pci_devclass; 411976Sab196087 421976Sab196087void pci_add_children(device_t dev, int busno, size_t dinfo_size); 431976Sab196087void pci_add_child(device_t bus, struct pci_devinfo *dinfo); 441976Sab196087int pci_print_child(device_t dev, device_t child); 451976Sab196087void pci_probe_nomatch(device_t dev, device_t child); 461976Sab196087int pci_read_ivar(device_t dev, device_t child, int which, 471976Sab196087 uintptr_t *result); 481976Sab196087int pci_write_ivar(device_t dev, device_t child, int which, 491976Sab196087 uintptr_t value); 501976Sab196087int pci_set_powerstate_method(device_t dev, device_t child, 511976Sab196087 int state); 521976Sab196087int pci_get_powerstate_method(device_t dev, device_t child); 531976Sab196087u_int32_t pci_read_config_method(device_t dev, device_t child, 541976Sab196087 int reg, int width); 551976Sab196087void pci_write_config_method(device_t dev, device_t child, 561976Sab196087 int reg, u_int32_t val, int width); 571976Sab196087int pci_enable_busmaster_method(device_t dev, device_t child); 581976Sab196087int pci_disable_busmaster_method(device_t dev, device_t child); 591976Sab196087int pci_enable_io_method(device_t dev, device_t child, int space); 601976Sab196087int pci_disable_io_method(device_t dev, device_t child, int space); 611976Sab196087struct resource *pci_alloc_resource(device_t dev, device_t child, 621976Sab196087 int type, int *rid, u_long start, u_long end, u_long count, 631976Sab196087 u_int flags); 641976Sab196087void pci_delete_resource(device_t dev, device_t child, 651976Sab196087 int type, int rid); 661976Sab196087struct resource_list *pci_get_resource_list (device_t dev, device_t child); 671976Sab196087struct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f, 681976Sab196087 size_t size); 691976Sab196087void pci_print_verbose(struct pci_devinfo *dinfo); 701976Sab196087int pci_freecfg(struct pci_devinfo *dinfo); 711976Sab196087int pci_child_location_str_method(device_t cbdev, device_t child, 721976Sab196087 char *buf, size_t buflen); 731976Sab196087int pci_child_pnpinfo_str_method(device_t cbdev, device_t child, 741976Sab196087 char *buf, size_t buflen); 751976Sab196087int pci_assign_interrupt_method(device_t dev, device_t child); 761976Sab196087#endif /* _PCI_PRIVATE_H_ */ 771976Sab196087