1*0a6a1f1dSLionel Sambuc /* $NetBSD: pci.h,v 1.6 2014/09/21 14:32:37 christos Exp $ */ 27eb99bdaSLionel Sambuc 37eb99bdaSLionel Sambuc /* 47eb99bdaSLionel Sambuc * Copyright 2001 Wasabi Systems, Inc. 57eb99bdaSLionel Sambuc * All rights reserved. 67eb99bdaSLionel Sambuc * 77eb99bdaSLionel Sambuc * Written by Jason R. Thorpe for Wasabi Systems, Inc. 87eb99bdaSLionel Sambuc * 97eb99bdaSLionel Sambuc * Redistribution and use in source and binary forms, with or without 107eb99bdaSLionel Sambuc * modification, are permitted provided that the following conditions 117eb99bdaSLionel Sambuc * are met: 127eb99bdaSLionel Sambuc * 1. Redistributions of source code must retain the above copyright 137eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer. 147eb99bdaSLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright 157eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer in the 167eb99bdaSLionel Sambuc * documentation and/or other materials provided with the distribution. 177eb99bdaSLionel Sambuc * 3. All advertising materials mentioning features or use of this software 187eb99bdaSLionel Sambuc * must display the following acknowledgement: 197eb99bdaSLionel Sambuc * This product includes software developed for the NetBSD Project by 207eb99bdaSLionel Sambuc * Wasabi Systems, Inc. 217eb99bdaSLionel Sambuc * 4. The name of Wasabi Systems, Inc. may not be used to endorse 227eb99bdaSLionel Sambuc * or promote products derived from this software without specific prior 237eb99bdaSLionel Sambuc * written permission. 247eb99bdaSLionel Sambuc * 257eb99bdaSLionel Sambuc * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 267eb99bdaSLionel Sambuc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 277eb99bdaSLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 287eb99bdaSLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 297eb99bdaSLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 307eb99bdaSLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 317eb99bdaSLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 327eb99bdaSLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 337eb99bdaSLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 347eb99bdaSLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 357eb99bdaSLionel Sambuc * POSSIBILITY OF SUCH DAMAGE. 367eb99bdaSLionel Sambuc */ 377eb99bdaSLionel Sambuc 387eb99bdaSLionel Sambuc #ifndef _PCI_H_ 397eb99bdaSLionel Sambuc #define _PCI_H_ 407eb99bdaSLionel Sambuc 417eb99bdaSLionel Sambuc /* 427eb99bdaSLionel Sambuc * Interface to the PCI bus for user programs. 437eb99bdaSLionel Sambuc */ 447eb99bdaSLionel Sambuc 457eb99bdaSLionel Sambuc typedef uint32_t pcireg_t; /* XXX */ 467eb99bdaSLionel Sambuc 477eb99bdaSLionel Sambuc /* pci_bus.c */ 487eb99bdaSLionel Sambuc int pcibus_conf_read(int, u_int, u_int, u_int, u_int, pcireg_t *); 497eb99bdaSLionel Sambuc int pcibus_conf_write(int, u_int, u_int, u_int, u_int, pcireg_t); 507eb99bdaSLionel Sambuc 517eb99bdaSLionel Sambuc /* pci_device.c */ 527eb99bdaSLionel Sambuc int pcidev_conf_read(int, u_int, pcireg_t *); 537eb99bdaSLionel Sambuc int pcidev_conf_write(int, u_int, pcireg_t); 547eb99bdaSLionel Sambuc 55*0a6a1f1dSLionel Sambuc /* pci_drvname.c */ 56*0a6a1f1dSLionel Sambuc int pci_drvname(int, u_int, u_int, char *, size_t); 57*0a6a1f1dSLionel Sambuc 587eb99bdaSLionel Sambuc /* pci_subr.c */ 597eb99bdaSLionel Sambuc void pci_devinfo(pcireg_t, pcireg_t, int, char *, size_t); 607eb99bdaSLionel Sambuc void pci_conf_print(int, u_int, u_int, u_int); 617eb99bdaSLionel Sambuc 627eb99bdaSLionel Sambuc #endif /* _PCI_H_ */ 63