xref: /illumos-gate/usr/src/uts/sun4u/io/pci/pci_devctl.c (revision 26947304)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
52917a9c9Sschwartz  * Common Development and Distribution License (the "License").
62917a9c9Sschwartz  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*26947304SEvan Yan  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  * PCI nexus HotPlug devctl interface
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate #include <sys/types.h>
307c478bd9Sstevel@tonic-gate #include <sys/conf.h>
317c478bd9Sstevel@tonic-gate #include <sys/kmem.h>
327c478bd9Sstevel@tonic-gate #include <sys/async.h>
337c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h>
347c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
357c478bd9Sstevel@tonic-gate #include <sys/sunndi.h>
367c478bd9Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
377c478bd9Sstevel@tonic-gate #include <sys/pci/pci_obj.h>
387c478bd9Sstevel@tonic-gate #include <sys/pci_tools.h>
39d4476ccbSschwartz #include <sys/pci/pci_tools_ext.h>
407c478bd9Sstevel@tonic-gate #include <sys/open.h>
417c478bd9Sstevel@tonic-gate #include <sys/errno.h>
427c478bd9Sstevel@tonic-gate #include <sys/file.h>
437c478bd9Sstevel@tonic-gate #include <sys/policy.h>
447c478bd9Sstevel@tonic-gate #include <sys/hotplug/pci/pcihp.h>
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /*LINTLIBRARY*/
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate static int pci_open(dev_t *devp, int flags, int otyp, cred_t *credp);
497c478bd9Sstevel@tonic-gate static int pci_close(dev_t dev, int flags, int otyp, cred_t *credp);
507851eb82Sschwartz static int pci_devctl_ioctl(dev_info_t *dip, int cmd, intptr_t arg, int mode,
517851eb82Sschwartz 						cred_t *credp, int *rvalp);
527c478bd9Sstevel@tonic-gate static int pci_ioctl(dev_t dev, int cmd, intptr_t arg, int mode,
537c478bd9Sstevel@tonic-gate 						cred_t *credp, int *rvalp);
547c478bd9Sstevel@tonic-gate static int pci_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op,
557c478bd9Sstevel@tonic-gate     int flags, char *name, caddr_t valuep, int *lengthp);
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate struct cb_ops pci_cb_ops = {
587c478bd9Sstevel@tonic-gate 	pci_open,			/* open */
597c478bd9Sstevel@tonic-gate 	pci_close,			/* close */
607c478bd9Sstevel@tonic-gate 	nodev,				/* strategy */
617c478bd9Sstevel@tonic-gate 	nodev,				/* print */
627c478bd9Sstevel@tonic-gate 	nodev,				/* dump */
637c478bd9Sstevel@tonic-gate 	nodev,				/* read */
647c478bd9Sstevel@tonic-gate 	nodev,				/* write */
657c478bd9Sstevel@tonic-gate 	pci_ioctl,			/* ioctl */
667c478bd9Sstevel@tonic-gate 	nodev,				/* devmap */
677c478bd9Sstevel@tonic-gate 	nodev,				/* mmap */
687c478bd9Sstevel@tonic-gate 	nodev,				/* segmap */
697c478bd9Sstevel@tonic-gate 	nochpoll,			/* poll */
707c478bd9Sstevel@tonic-gate 	pci_prop_op,			/* cb_prop_op */
717c478bd9Sstevel@tonic-gate 	NULL,				/* streamtab */
727c478bd9Sstevel@tonic-gate 	D_NEW | D_MP | D_HOTPLUG,	/* Driver compatibility flag */
737c478bd9Sstevel@tonic-gate 	CB_REV,				/* rev */
747c478bd9Sstevel@tonic-gate 	nodev,				/* int (*cb_aread)() */
757c478bd9Sstevel@tonic-gate 	nodev				/* int (*cb_awrite)() */
767c478bd9Sstevel@tonic-gate };
777c478bd9Sstevel@tonic-gate 
78e389d146Sschwartz extern struct cb_ops *pcihp_ops;
79e389d146Sschwartz 
807c478bd9Sstevel@tonic-gate /* ARGSUSED3 */
817c478bd9Sstevel@tonic-gate static int
pci_open(dev_t * devp,int flags,int otyp,cred_t * credp)827c478bd9Sstevel@tonic-gate pci_open(dev_t *devp, int flags, int otyp, cred_t *credp)
837c478bd9Sstevel@tonic-gate {
847c478bd9Sstevel@tonic-gate 	pci_t *pci_p;
85e389d146Sschwartz 	int rval;
86e389d146Sschwartz 	uint_t orig_pci_soft_state;
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 	/*
897c478bd9Sstevel@tonic-gate 	 * Make sure the open is for the right file type.
907c478bd9Sstevel@tonic-gate 	 */
917c478bd9Sstevel@tonic-gate 	if (otyp != OTYP_CHR)
927c478bd9Sstevel@tonic-gate 		return (EINVAL);
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate 	/*
957c478bd9Sstevel@tonic-gate 	 * Get the soft state structure for the device.
967c478bd9Sstevel@tonic-gate 	 */
977c478bd9Sstevel@tonic-gate 	pci_p = DEV_TO_SOFTSTATE(*devp);
987c478bd9Sstevel@tonic-gate 	if (pci_p == NULL)
997c478bd9Sstevel@tonic-gate 		return (ENXIO);
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate 	/*
1027c478bd9Sstevel@tonic-gate 	 * Handle the open by tracking the device state.
1037c478bd9Sstevel@tonic-gate 	 */
1047c478bd9Sstevel@tonic-gate 	DEBUG2(DBG_OPEN, pci_p->pci_dip, "devp=%x: flags=%x\n", devp, flags);
1057c478bd9Sstevel@tonic-gate 	mutex_enter(&pci_p->pci_mutex);
106e389d146Sschwartz 	orig_pci_soft_state = pci_p->pci_soft_state;
1077c478bd9Sstevel@tonic-gate 	if (flags & FEXCL) {
1087c478bd9Sstevel@tonic-gate 		if (pci_p->pci_soft_state != PCI_SOFT_STATE_CLOSED) {
1097c478bd9Sstevel@tonic-gate 			mutex_exit(&pci_p->pci_mutex);
1107c478bd9Sstevel@tonic-gate 			DEBUG0(DBG_OPEN, pci_p->pci_dip, "busy\n");
1117c478bd9Sstevel@tonic-gate 			return (EBUSY);
1127c478bd9Sstevel@tonic-gate 		}
1137c478bd9Sstevel@tonic-gate 		pci_p->pci_soft_state = PCI_SOFT_STATE_OPEN_EXCL;
1147c478bd9Sstevel@tonic-gate 	} else {
1157c478bd9Sstevel@tonic-gate 		if (pci_p->pci_soft_state == PCI_SOFT_STATE_OPEN_EXCL) {
1167c478bd9Sstevel@tonic-gate 			mutex_exit(&pci_p->pci_mutex);
1177c478bd9Sstevel@tonic-gate 			DEBUG0(DBG_OPEN, pci_p->pci_dip, "busy\n");
1187c478bd9Sstevel@tonic-gate 			return (EBUSY);
1197c478bd9Sstevel@tonic-gate 		}
1207c478bd9Sstevel@tonic-gate 		pci_p->pci_soft_state = PCI_SOFT_STATE_OPEN;
1217c478bd9Sstevel@tonic-gate 	}
122e389d146Sschwartz 
123e389d146Sschwartz 	if (pci_p->hotplug_capable == B_TRUE) {
124e389d146Sschwartz 		if (rval = pcihp_ops->cb_open(devp, flags, otyp, credp)) {
125e389d146Sschwartz 			pci_p->pci_soft_state = orig_pci_soft_state;
126e389d146Sschwartz 			mutex_exit(&pci_p->pci_mutex);
127e389d146Sschwartz 			return (rval);
128e389d146Sschwartz 		}
129e389d146Sschwartz 	}
130e389d146Sschwartz 
1317c478bd9Sstevel@tonic-gate 	mutex_exit(&pci_p->pci_mutex);
132e389d146Sschwartz 
1337c478bd9Sstevel@tonic-gate 	return (0);
1347c478bd9Sstevel@tonic-gate }
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /* ARGSUSED */
1387c478bd9Sstevel@tonic-gate static int
pci_close(dev_t dev,int flags,int otyp,cred_t * credp)1397c478bd9Sstevel@tonic-gate pci_close(dev_t dev, int flags, int otyp, cred_t *credp)
1407c478bd9Sstevel@tonic-gate {
1417c478bd9Sstevel@tonic-gate 	pci_t *pci_p;
142e389d146Sschwartz 	int rval;
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate 	if (otyp != OTYP_CHR)
1457c478bd9Sstevel@tonic-gate 		return (EINVAL);
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate 	pci_p = DEV_TO_SOFTSTATE(dev);
1487c478bd9Sstevel@tonic-gate 	if (pci_p == NULL)
1497c478bd9Sstevel@tonic-gate 		return (ENXIO);
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate 	DEBUG2(DBG_CLOSE, pci_p->pci_dip, "dev=%x: flags=%x\n", dev, flags);
1527c478bd9Sstevel@tonic-gate 	mutex_enter(&pci_p->pci_mutex);
153e389d146Sschwartz 
154e389d146Sschwartz 	if (pci_p->hotplug_capable == B_TRUE)
155e389d146Sschwartz 		if (rval = pcihp_ops->cb_close(dev, flags, otyp, credp)) {
156e389d146Sschwartz 			mutex_exit(&pci_p->pci_mutex);
157e389d146Sschwartz 			return (rval);
158e389d146Sschwartz 		}
159e389d146Sschwartz 
1607c478bd9Sstevel@tonic-gate 	pci_p->pci_soft_state = PCI_SOFT_STATE_CLOSED;
1617c478bd9Sstevel@tonic-gate 	mutex_exit(&pci_p->pci_mutex);
1627c478bd9Sstevel@tonic-gate 	return (0);
1637c478bd9Sstevel@tonic-gate }
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate /* ARGSUSED */
1667851eb82Sschwartz static int
pci_devctl_ioctl(dev_info_t * dip,int cmd,intptr_t arg,int mode,cred_t * credp,int * rvalp)1677851eb82Sschwartz pci_devctl_ioctl(dev_info_t *dip, int cmd, intptr_t arg, int mode,
1687851eb82Sschwartz     cred_t *credp, int *rvalp)
1697851eb82Sschwartz {
1707851eb82Sschwartz 	int rv = 0;
1717851eb82Sschwartz 	struct devctl_iocdata *dcp;
1727851eb82Sschwartz 	uint_t bus_state;
1737851eb82Sschwartz 
1747851eb82Sschwartz 	/*
1757851eb82Sschwartz 	 * We can use the generic implementation for these ioctls
1767851eb82Sschwartz 	 */
1777851eb82Sschwartz 	switch (cmd) {
1787851eb82Sschwartz 	case DEVCTL_DEVICE_GETSTATE:
1797851eb82Sschwartz 	case DEVCTL_DEVICE_ONLINE:
1807851eb82Sschwartz 	case DEVCTL_DEVICE_OFFLINE:
1817851eb82Sschwartz 	case DEVCTL_BUS_GETSTATE:
1827851eb82Sschwartz 		return (ndi_devctl_ioctl(dip, cmd, arg, mode, 0));
1837851eb82Sschwartz 	}
1847851eb82Sschwartz 
1857851eb82Sschwartz 	/*
1867851eb82Sschwartz 	 * read devctl ioctl data
1877851eb82Sschwartz 	 */
1887851eb82Sschwartz 	if (ndi_dc_allochdl((void *)arg, &dcp) != NDI_SUCCESS)
1897851eb82Sschwartz 		return (EFAULT);
1907851eb82Sschwartz 
1917851eb82Sschwartz 	switch (cmd) {
1927851eb82Sschwartz 
1937851eb82Sschwartz 	case DEVCTL_DEVICE_RESET:
1947851eb82Sschwartz 		DEBUG0(DBG_IOCTL, dip, "DEVCTL_DEVICE_RESET\n");
1957851eb82Sschwartz 		rv = ENOTSUP;
1967851eb82Sschwartz 		break;
1977851eb82Sschwartz 
1987851eb82Sschwartz 
1997851eb82Sschwartz 	case DEVCTL_BUS_QUIESCE:
2007851eb82Sschwartz 		DEBUG0(DBG_IOCTL, dip, "DEVCTL_BUS_QUIESCE\n");
2017851eb82Sschwartz 		if (ndi_get_bus_state(dip, &bus_state) == NDI_SUCCESS)
2027851eb82Sschwartz 			if (bus_state == BUS_QUIESCED)
2037851eb82Sschwartz 				break;
2047851eb82Sschwartz 		(void) ndi_set_bus_state(dip, BUS_QUIESCED);
2057851eb82Sschwartz 		break;
2067851eb82Sschwartz 
2077851eb82Sschwartz 	case DEVCTL_BUS_UNQUIESCE:
2087851eb82Sschwartz 		DEBUG0(DBG_IOCTL, dip, "DEVCTL_BUS_UNQUIESCE\n");
2097851eb82Sschwartz 		if (ndi_get_bus_state(dip, &bus_state) == NDI_SUCCESS)
2107851eb82Sschwartz 			if (bus_state == BUS_ACTIVE)
2117851eb82Sschwartz 				break;
2127851eb82Sschwartz 		(void) ndi_set_bus_state(dip, BUS_ACTIVE);
2137851eb82Sschwartz 		break;
2147851eb82Sschwartz 
2157851eb82Sschwartz 	case DEVCTL_BUS_RESET:
2167851eb82Sschwartz 		DEBUG0(DBG_IOCTL, dip, "DEVCTL_BUS_RESET\n");
2177851eb82Sschwartz 		rv = ENOTSUP;
2187851eb82Sschwartz 		break;
2197851eb82Sschwartz 
2207851eb82Sschwartz 	case DEVCTL_BUS_RESETALL:
2217851eb82Sschwartz 		DEBUG0(DBG_IOCTL, dip, "DEVCTL_BUS_RESETALL\n");
2227851eb82Sschwartz 		rv = ENOTSUP;
2237851eb82Sschwartz 		break;
2247851eb82Sschwartz 
2257851eb82Sschwartz 	default:
2267851eb82Sschwartz 		rv = ENOTTY;
2277851eb82Sschwartz 	}
2287851eb82Sschwartz 
2297851eb82Sschwartz 	ndi_dc_freehdl(dcp);
2307851eb82Sschwartz 	return (rv);
2317851eb82Sschwartz }
2327851eb82Sschwartz 
2337851eb82Sschwartz 
2347c478bd9Sstevel@tonic-gate static int
pci_ioctl(dev_t dev,int cmd,intptr_t arg,int mode,cred_t * credp,int * rvalp)2357c478bd9Sstevel@tonic-gate pci_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp)
2367c478bd9Sstevel@tonic-gate {
2377c478bd9Sstevel@tonic-gate 	pci_t *pci_p;
2387c478bd9Sstevel@tonic-gate 	dev_info_t *dip;
2397851eb82Sschwartz 	minor_t minor = getminor(dev);
2407851eb82Sschwartz 	int rv = ENOTTY;
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate 	pci_p = DEV_TO_SOFTSTATE(dev);
2437c478bd9Sstevel@tonic-gate 	if (pci_p == NULL)
2447c478bd9Sstevel@tonic-gate 		return (ENXIO);
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate 	dip = pci_p->pci_dip;
2477c478bd9Sstevel@tonic-gate 	DEBUG2(DBG_IOCTL, dip, "dev=%x: cmd=%x\n", dev, cmd);
2487851eb82Sschwartz 
2497c478bd9Sstevel@tonic-gate #ifdef PCI_DMA_TEST
2507c478bd9Sstevel@tonic-gate 	if (IS_DMATEST(cmd)) {
2517c478bd9Sstevel@tonic-gate 		*rvalp = pci_dma_test(cmd, dip, pci_p, arg);
2527c478bd9Sstevel@tonic-gate 		return (0);
2537c478bd9Sstevel@tonic-gate 	}
2547c478bd9Sstevel@tonic-gate #endif
2557c478bd9Sstevel@tonic-gate 
2567851eb82Sschwartz 	switch (PCIHP_AP_MINOR_NUM_TO_PCI_DEVNUM(minor)) {
2577851eb82Sschwartz 	case PCI_TOOL_REG_MINOR_NUM:
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate 		switch (cmd) {
2607c478bd9Sstevel@tonic-gate 		case PCITOOL_DEVICE_SET_REG:
2617c478bd9Sstevel@tonic-gate 		case PCITOOL_DEVICE_GET_REG:
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate 			/* Require full privileges. */
2647c478bd9Sstevel@tonic-gate 			if (secpolicy_kmdb(credp))
2657c478bd9Sstevel@tonic-gate 				rv = EPERM;
2667c478bd9Sstevel@tonic-gate 			else
2677c478bd9Sstevel@tonic-gate 				rv = pcitool_dev_reg_ops(
2687c478bd9Sstevel@tonic-gate 				    dev, (void *)arg, cmd, mode);
2697c478bd9Sstevel@tonic-gate 			break;
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate 		case PCITOOL_NEXUS_SET_REG:
2727c478bd9Sstevel@tonic-gate 		case PCITOOL_NEXUS_GET_REG:
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate 			/* Require full privileges. */
2757c478bd9Sstevel@tonic-gate 			if (secpolicy_kmdb(credp))
2767c478bd9Sstevel@tonic-gate 				rv = EPERM;
2777c478bd9Sstevel@tonic-gate 			else
2787c478bd9Sstevel@tonic-gate 				rv = pcitool_bus_reg_ops(
2797c478bd9Sstevel@tonic-gate 				    dev, (void *)arg, cmd, mode);
2807c478bd9Sstevel@tonic-gate 			break;
2817851eb82Sschwartz 		}
2827c478bd9Sstevel@tonic-gate 
2837851eb82Sschwartz 		break;
2847851eb82Sschwartz 
2857851eb82Sschwartz 	case PCI_TOOL_INTR_MINOR_NUM:
2867851eb82Sschwartz 
2877851eb82Sschwartz 		switch (cmd) {
2887c478bd9Sstevel@tonic-gate 		case PCITOOL_DEVICE_SET_INTR:
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate 			/* Require PRIV_SYS_RES_CONFIG, same as psradm */
2917c478bd9Sstevel@tonic-gate 			if (secpolicy_ponline(credp)) {
2927c478bd9Sstevel@tonic-gate 				rv = EPERM;
2937c478bd9Sstevel@tonic-gate 				break;
2947c478bd9Sstevel@tonic-gate 			}
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate 		/*FALLTHRU*/
2977c478bd9Sstevel@tonic-gate 		/* These require no special privileges. */
2987c478bd9Sstevel@tonic-gate 		case PCITOOL_DEVICE_GET_INTR:
2992917a9c9Sschwartz 		case PCITOOL_SYSTEM_INTR_INFO:
3007c478bd9Sstevel@tonic-gate 			rv = pcitool_intr_admn(dev, (void *)arg, cmd, mode);
3017c478bd9Sstevel@tonic-gate 			break;
3027c478bd9Sstevel@tonic-gate 		}
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate 		break;
3057c478bd9Sstevel@tonic-gate 
3068d03b6dbSschwartz 	/*
3078d03b6dbSschwartz 	 * All non-PCItool ioctls go through here, including:
3088d03b6dbSschwartz 	 *   devctl ioctls with minor number PCIHP_DEVCTL_MINOR and
3098d03b6dbSschwartz 	 *   those for attachment points with where minor number is the
3108d03b6dbSschwartz 	 *   device number.
3118d03b6dbSschwartz 	 */
3128d03b6dbSschwartz 	default:
313e389d146Sschwartz 		if (pci_p->hotplug_capable == B_TRUE)
314e389d146Sschwartz 			rv = pcihp_ops->cb_ioctl(
315e389d146Sschwartz 			    dev, cmd, arg, mode, credp, rvalp);
316e389d146Sschwartz 		else
317e389d146Sschwartz 			rv = pci_devctl_ioctl(
318e389d146Sschwartz 			    dip, cmd, arg, mode, credp, rvalp);
3197c478bd9Sstevel@tonic-gate 		break;
3207c478bd9Sstevel@tonic-gate 	}
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate 	return (rv);
3237c478bd9Sstevel@tonic-gate }
3247c478bd9Sstevel@tonic-gate 
pci_prop_op(dev_t dev,dev_info_t * dip,ddi_prop_op_t prop_op,int flags,char * name,caddr_t valuep,int * lengthp)3257c478bd9Sstevel@tonic-gate static int pci_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op,
3267c478bd9Sstevel@tonic-gate     int flags, char *name, caddr_t valuep, int *lengthp)
3277c478bd9Sstevel@tonic-gate {
3287c478bd9Sstevel@tonic-gate 	if (ddi_prop_exists(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
3297c478bd9Sstevel@tonic-gate 	    "hotplug-capable"))
3307c478bd9Sstevel@tonic-gate 		return ((pcihp_get_cb_ops())->cb_prop_op(dev, dip,
3317c478bd9Sstevel@tonic-gate 		    prop_op, flags, name, valuep, lengthp));
3327c478bd9Sstevel@tonic-gate 
3337c478bd9Sstevel@tonic-gate 	return (ddi_prop_op(dev, dip, prop_op, flags, name, valuep, lengthp));
3347c478bd9Sstevel@tonic-gate }
335