pci_machdep.h revision 1.5
11.5Scgd/* $NetBSD: pci_machdep.h,v 1.5 2000/06/01 00:04:53 cgd Exp $ */ 21.1Ssakamoto 31.1Ssakamoto/* 41.1Ssakamoto * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 51.2Smycroft * Copyright (c) 1994 Charles M. Hannum. All rights reserved. 61.1Ssakamoto * 71.1Ssakamoto * Redistribution and use in source and binary forms, with or without 81.1Ssakamoto * modification, are permitted provided that the following conditions 91.1Ssakamoto * are met: 101.1Ssakamoto * 1. Redistributions of source code must retain the above copyright 111.1Ssakamoto * notice, this list of conditions and the following disclaimer. 121.1Ssakamoto * 2. Redistributions in binary form must reproduce the above copyright 131.1Ssakamoto * notice, this list of conditions and the following disclaimer in the 141.1Ssakamoto * documentation and/or other materials provided with the distribution. 151.1Ssakamoto * 3. All advertising materials mentioning features or use of this software 161.1Ssakamoto * must display the following acknowledgement: 171.2Smycroft * This product includes software developed by Charles M. Hannum. 181.1Ssakamoto * 4. The name of the author may not be used to endorse or promote products 191.1Ssakamoto * derived from this software without specific prior written permission. 201.1Ssakamoto * 211.1Ssakamoto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 221.1Ssakamoto * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 231.1Ssakamoto * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 241.1Ssakamoto * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 251.1Ssakamoto * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 261.1Ssakamoto * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 271.1Ssakamoto * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 281.1Ssakamoto * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 291.1Ssakamoto * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 301.1Ssakamoto * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 311.1Ssakamoto */ 321.1Ssakamoto 331.1Ssakamoto/* 341.1Ssakamoto * Machine-specific definitions for PCI autoconfiguration. 351.1Ssakamoto */ 361.1Ssakamoto 371.1Ssakamoto/* 381.1Ssakamoto * be-specific PCI structure and type definitions. 391.1Ssakamoto * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. 401.1Ssakamoto * 411.1Ssakamoto * Configuration tag; created from a {bus,device,function} triplet by 421.1Ssakamoto * pci_make_tag(), and passed to pci_conf_read() and pci_conf_write(). 431.1Ssakamoto * We could instead always pass the {bus,device,function} triplet to 441.1Ssakamoto * the read and write routines, but this would cause extra overhead. 451.1Ssakamoto */ 461.1Ssakamoto 471.1Ssakamoto/* 481.1Ssakamoto * Types provided to machine-independent PCI code 491.1Ssakamoto */ 501.1Ssakamototypedef void *pci_chipset_tag_t; 511.1Ssakamototypedef int pcitag_t; 521.1Ssakamototypedef int pci_intr_handle_t; 531.1Ssakamoto 541.1Ssakamoto/* 551.1Ssakamoto * Functions provided to machine-independent PCI code. 561.1Ssakamoto */ 571.5Scgdvoid pci_attach_hook(struct device *, struct device *, 581.5Scgd struct pcibus_attach_args *); 591.5Scgdint pci_bus_maxdevs(pci_chipset_tag_t, int); 601.5Scgdpcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int); 611.5Scgdvoid pci_decompose_tag(pci_chipset_tag_t, pcitag_t, 621.5Scgd int *, int *, int *); 631.5Scgdpcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int); 641.5Scgdvoid pci_conf_write(pci_chipset_tag_t, pcitag_t, int, 651.5Scgd pcireg_t); 661.5Scgdint pci_intr_map(pci_chipset_tag_t, pcitag_t, int, int, 671.5Scgd pci_intr_handle_t *); 681.5Scgdconst char *pci_intr_string(pci_chipset_tag_t, pci_intr_handle_t); 691.5Scgdvoid *pci_intr_establish(pci_chipset_tag_t, pci_intr_handle_t, 701.5Scgd int, int (*)(void *), void *); 711.5Scgdvoid pci_intr_disestablish(pci_chipset_tag_t, void *); 72