1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 23 /* 24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25 * Use is subject to license terms. 26 */ 27 28 #ifndef _PCI_PCI_COMMON_H 29 #define _PCI_PCI_COMMON_H 30 31 #pragma ident "%Z%%M% %I% %E% SMI" 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /* State structure. */ 38 typedef struct pci_state { 39 dev_info_t *pci_dip; 40 } pci_state_t; 41 42 /* 43 * Common header file with definitions shared between 44 * pci(7d) and npe(7d) 45 */ 46 47 /* 48 * PCI tool related declarations 49 */ 50 int pci_common_ioctl(dev_info_t *dip, dev_t dev, int cmd, 51 intptr_t arg, int mode, cred_t *credp, int *rvalp); 52 53 /* 54 * Interrupt related declaration 55 */ 56 int pci_common_intr_ops(dev_info_t *, dev_info_t *, ddi_intr_op_t, 57 ddi_intr_handle_impl_t *, void *); 58 void pci_common_set_parent_private_data(dev_info_t *); 59 60 /* 61 * Miscellaneous library functions 62 */ 63 int pci_common_get_reg_prop(dev_info_t *dip, pci_regspec_t *pci_rp); 64 int pci_common_name_child(dev_info_t *child, char *name, int namelen); 65 66 #ifdef __cplusplus 67 } 68 #endif 69 70 #endif /* _PCI_PCI_COMMON_H */ 71