pci_private.h revision 120155
191355Simp/*
291355Simp * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
391355Simp * Copyright (c) 2000, Michael Smith <msmith@freebsd.org>
491355Simp * Copyright (c) 2000, BSDi
591355Simp * All rights reserved.
691355Simp *
791355Simp * Redistribution and use in source and binary forms, with or without
891355Simp * modification, are permitted provided that the following conditions
991355Simp * are met:
1091355Simp * 1. Redistributions of source code must retain the above copyright
1191355Simp *    notice unmodified, this list of conditions, and the following
1291355Simp *    disclaimer.
1391355Simp * 2. Redistributions in binary form must reproduce the above copyright
1491355Simp *    notice, this list of conditions and the following disclaimer in the
1591355Simp *    documentation and/or other materials provided with the distribution.
1691355Simp *
1791355Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1891355Simp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1991355Simp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2091355Simp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2191355Simp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2291355Simp * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2391355Simp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2491355Simp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2591355Simp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2691355Simp * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2791355Simp *
2891355Simp * $FreeBSD: head/sys/dev/pci/pci_private.h 120155 2003-09-17 08:32:44Z iwasaki $
2991355Simp *
3091355Simp */
3191355Simp
3291355Simp#ifndef _PCI_PRIVATE_H_
3391355Simp#define _PCI_PRIVATE_H_
3491355Simp
3591355Simp/*
3691355Simp * Export definitions of the pci bus so that we can more easily share
3791355Simp * it with "subclass" busses.  A more generic subclassing mechanism would
3891355Simp * be nice, but is not present in the tree at this time.
3991355Simp */
40102440Sjhbextern devclass_t pci_devclass;
41102440Sjhb
42102440Sjhbvoid		pci_add_children(device_t dev, int busno, size_t dinfo_size);
43102440Sjhbvoid		pci_add_child(device_t bus, struct pci_devinfo *dinfo);
4491355Simpint		pci_print_child(device_t dev, device_t child);
4591355Simpvoid		pci_probe_nomatch(device_t dev, device_t child);
4691355Simpint		pci_read_ivar(device_t dev, device_t child, int which,
4791355Simp		    uintptr_t *result);
4891355Simpint		pci_write_ivar(device_t dev, device_t child, int which,
4991355Simp		    uintptr_t value);
5091355Simpint		pci_set_powerstate_method(device_t dev, device_t child,
5191355Simp		    int state);
5291355Simpint		pci_get_powerstate_method(device_t dev, device_t child);
53119266Simpuint32_t	pci_read_config_method(device_t dev, device_t child,
5491355Simp		    int reg, int width);
5591355Simpvoid		pci_write_config_method(device_t dev, device_t child,
56119266Simp		    int reg, uint32_t val, int width);
57113544Smdoddint		pci_enable_busmaster_method(device_t dev, device_t child);
58113544Smdoddint		pci_disable_busmaster_method(device_t dev, device_t child);
59113544Smdoddint		pci_enable_io_method(device_t dev, device_t child, int space);
60113544Smdoddint		pci_disable_io_method(device_t dev, device_t child, int space);
6191355Simpstruct resource	*pci_alloc_resource(device_t dev, device_t child,
6291355Simp		    int type, int *rid, u_long start, u_long end, u_long count,
6391355Simp		    u_int flags);
6491355Simpvoid		pci_delete_resource(device_t dev, device_t child,
6591355Simp		    int type, int rid);
6691355Simpstruct resource_list *pci_get_resource_list (device_t dev, device_t child);
6792233Simpstruct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f,
6892233Simp		    size_t size);
6991355Simpvoid		pci_print_verbose(struct pci_devinfo *dinfo);
7091355Simpint		pci_freecfg(struct pci_devinfo *dinfo);
71111056Simpint		pci_child_location_str_method(device_t cbdev, device_t child,
72111056Simp		    char *buf, size_t buflen);
73111056Simpint		pci_child_pnpinfo_str_method(device_t cbdev, device_t child,
74111056Simp		    char *buf, size_t buflen);
75117115Stmmint		pci_assign_interrupt_method(device_t dev, device_t child);
76120155Siwasakiint		pci_resume(device_t dev);
7791355Simp#endif /* _PCI_PRIVATE_H_ */
78