10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 51725Segillett * Common Development and Distribution License (the "License"). 61725Segillett * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 221725Segillett * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_PCI_INTR_LIB_H 270Sstevel@tonic-gate #define _SYS_PCI_INTR_LIB_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate extern int pci_msi_get_cap(dev_info_t *rdip, int type, int *flagsp); 360Sstevel@tonic-gate extern int pci_msi_configure(dev_info_t *rdip, int type, int count, 370Sstevel@tonic-gate int inum, uint64_t addr, uint64_t data); 380Sstevel@tonic-gate extern int pci_msi_unconfigure(dev_info_t *rdip, int type, int inum); 390Sstevel@tonic-gate extern int pci_is_msi_enabled(dev_info_t *rdip, int type); 40*2755Segillett extern int pci_msi_enable_mode(dev_info_t *rdip, int type); 41*2755Segillett extern int pci_msi_disable_mode(dev_info_t *rdip, int type, uint_t flags); 420Sstevel@tonic-gate extern int pci_msi_set_mask(dev_info_t *rdip, int type, int inum); 430Sstevel@tonic-gate extern int pci_msi_clr_mask(dev_info_t *rdip, int type, int inum); 440Sstevel@tonic-gate extern int pci_msi_get_pending(dev_info_t *rdip, int type, int inum, 450Sstevel@tonic-gate int *pendingp); 460Sstevel@tonic-gate extern int pci_msi_get_nintrs(dev_info_t *rdip, int type, int *nintrs); 470Sstevel@tonic-gate extern int pci_msi_set_nintrs(dev_info_t *rdip, int type, int navail); 480Sstevel@tonic-gate extern int pci_msi_get_supported_type(dev_info_t *rdip, int *typesp); 490Sstevel@tonic-gate 500Sstevel@tonic-gate extern ddi_intr_msix_t *pci_msix_init(dev_info_t *rdip); 510Sstevel@tonic-gate extern void pci_msix_fini(ddi_intr_msix_t *msix_p); 521725Segillett extern int pci_msix_dup(dev_info_t *rdip, int org_inum, int dup_inum); 530Sstevel@tonic-gate 540Sstevel@tonic-gate extern int pci_intx_get_cap(dev_info_t *dip, int *flagsp); 550Sstevel@tonic-gate extern int pci_intx_set_mask(dev_info_t *dip); 560Sstevel@tonic-gate extern int pci_intx_clr_mask(dev_info_t *dip); 570Sstevel@tonic-gate extern int pci_intx_get_pending(dev_info_t *dip, int *pendingp); 580Sstevel@tonic-gate extern int pci_devclass_to_ipl(int class); 590Sstevel@tonic-gate extern ddi_intrspec_t pci_intx_get_ispec(dev_info_t *dip, dev_info_t *rdip, 600Sstevel@tonic-gate int inum); 610Sstevel@tonic-gate 620Sstevel@tonic-gate #ifdef __cplusplus 630Sstevel@tonic-gate } 640Sstevel@tonic-gate #endif 650Sstevel@tonic-gate 660Sstevel@tonic-gate #endif /* _SYS_PCI_INTR_LIB_H */ 67