pci_machdep.h revision 1.1
11.1Snonaka/* $NetBSD: pci_machdep.h,v 1.1 2000/02/29 15:21:30 nonaka Exp $ */ 21.1Snonaka 31.1Snonaka/* 41.1Snonaka * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 51.1Snonaka * Copyright (c) 1994 Charles M. Hannum. All rights reserved. 61.1Snonaka * 71.1Snonaka * Redistribution and use in source and binary forms, with or without 81.1Snonaka * modification, are permitted provided that the following conditions 91.1Snonaka * are met: 101.1Snonaka * 1. Redistributions of source code must retain the above copyright 111.1Snonaka * notice, this list of conditions and the following disclaimer. 121.1Snonaka * 2. Redistributions in binary form must reproduce the above copyright 131.1Snonaka * notice, this list of conditions and the following disclaimer in the 141.1Snonaka * documentation and/or other materials provided with the distribution. 151.1Snonaka * 3. All advertising materials mentioning features or use of this software 161.1Snonaka * must display the following acknowledgement: 171.1Snonaka * This product includes software developed by Charles M. Hannum. 181.1Snonaka * 4. The name of the author may not be used to endorse or promote products 191.1Snonaka * derived from this software without specific prior written permission. 201.1Snonaka * 211.1Snonaka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 221.1Snonaka * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 231.1Snonaka * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 241.1Snonaka * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 251.1Snonaka * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 261.1Snonaka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 271.1Snonaka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 281.1Snonaka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 291.1Snonaka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 301.1Snonaka * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 311.1Snonaka */ 321.1Snonaka 331.1Snonaka/* 341.1Snonaka * Machine-specific definitions for PCI autoconfiguration. 351.1Snonaka */ 361.1Snonaka 371.1Snonaka/* 381.1Snonaka * be-specific PCI structure and type definitions. 391.1Snonaka * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE. 401.1Snonaka * 411.1Snonaka * Configuration tag; created from a {bus,device,function} triplet by 421.1Snonaka * pci_make_tag(), and passed to pci_conf_read() and pci_conf_write(). 431.1Snonaka * We could instead always pass the {bus,device,function} triplet to 441.1Snonaka * the read and write routines, but this would cause extra overhead. 451.1Snonaka */ 461.1Snonaka 471.1Snonaka/* 481.1Snonaka * Types provided to machine-independent PCI code 491.1Snonaka */ 501.1Snonakatypedef void *pci_chipset_tag_t; 511.1Snonakatypedef int pcitag_t; 521.1Snonakatypedef int pci_intr_handle_t; 531.1Snonaka 541.1Snonakaextern struct prep_bus_dma_tag pci_bus_dma_tag; 551.1Snonaka 561.1Snonaka/* 571.1Snonaka * Functions provided to machine-independent PCI code. 581.1Snonaka */ 591.1Snonakavoid pci_attach_hook __P((struct device *, struct device *, 601.1Snonaka struct pcibus_attach_args *)); 611.1Snonakaint pci_bus_maxdevs __P((pci_chipset_tag_t, int)); 621.1Snonakapcitag_t pci_make_tag __P((pci_chipset_tag_t, int, int, int)); 631.1Snonakavoid pci_decompose_tag __P((pci_chipset_tag_t, pcitag_t, 641.1Snonaka int *, int *, int *)); 651.1Snonakapcireg_t pci_conf_read __P((pci_chipset_tag_t, pcitag_t, int)); 661.1Snonakavoid pci_conf_write __P((pci_chipset_tag_t, pcitag_t, int, 671.1Snonaka pcireg_t)); 681.1Snonakaint pci_intr_map __P((pci_chipset_tag_t, pcitag_t, int, int, 691.1Snonaka pci_intr_handle_t *)); 701.1Snonakaconst char *pci_intr_string __P((pci_chipset_tag_t, pci_intr_handle_t)); 711.1Snonakavoid *pci_intr_establish __P((pci_chipset_tag_t, pci_intr_handle_t, 721.1Snonaka int, int (*)(void *), void *)); 731.1Snonakavoid pci_intr_disestablish __P((pci_chipset_tag_t, void *)); 74