--- /dev/null	2014-11-12 17:44:33.000000000 +0100
+++ new/./illumos.sh	2014-11-12 17:44:33.739829419 +0100
@@ -0,0 +1,234 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2010, 2011 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
+#
+
+# Configuration variables for the runtime environment of the nightly
+# build script and other tools for construction and packaging of
+# releases.
+# This example is suitable for building an illumos workspace, which
+# will contain the resulting archives. It is based off the onnv
+# release. It sets NIGHTLY_OPTIONS to make nightly do:
+#       DEBUG build only (-D, -F)
+#       do not bringover from the parent (-n)
+#       runs 'make check' (-C)
+#       checks for new interfaces in libraries (-A)
+#       runs lint in usr/src (-l plus the LINTDIRS variable)
+#       sends mail on completion (-m and the MAILTO variable)
+#       creates packages for PIT/RE (-p)
+#       checks for changes in ELF runpaths (-r)
+#       build and use this workspace's tools in $SRC/tools (-t)
+#
+# - This file is sourced by "bldenv.sh" and "nightly.sh" and should not 
+#   be executed directly.
+# - This script is only interpreted by ksh93 and explicitly allows the
+#   use of ksh93 language extensions.
+#
+export NIGHTLY_OPTIONS='-nCAmprt'
+
+#
+# -- PLEASE READ THIS --
+#
+# The variables  GATE and CODEMGR_WS must always be customised to
+# match your workspace/gate location!!
+#
+# -- PLEASE READ THIS --
+#
+
+# This is a variable for the rest of the script - GATE doesn't matter to
+# nightly itself
+export GATE=illumos-gate
+
+# CODEMGR_WS - where is your workspace at (or what should nightly name it)
+export CODEMGR_WS=/code/illumos/deploy/illumos-gate
+
+# Maximum number of dmake jobs.  The recommended number is 2 + NCPUS,
+# where NCPUS is the number of logical CPUs on your build system.
+function maxjobs
+{
+	nameref maxjobs=$1
+	integer ncpu
+	integer -r min_mem_per_job=512 # minimum amount of memory for a job
+
+	ncpu=$(builtin getconf ; getconf 'NPROCESSORS_ONLN')
+	(( maxjobs=ncpu + 2 ))
+	
+	# Throttle number of parallel jobs launched by dmake to a value which
+	# gurantees that all jobs have enough memory. This was added to avoid
+	# excessive paging/swapping in cases of virtual machine installations
+	# which have lots of CPUs but not enough memory assigned to handle
+	# that many parallel jobs
+	if [[ $(/usr/sbin/prtconf 2>'/dev/null') == ~(E)Memory\ size:\ ([[:digit:]]+)\ Megabytes ]] ; then
+		integer max_jobs_per_memory # parallel jobs which fit into physical memory
+		integer physical_memory # physical memory installed
+
+		# The array ".sh.match" contains the contents of capturing
+		# brackets in the last regex, .sh.match[1] will contain
+		# the value matched by ([[:digit:]]+), i.e. the amount of
+		# memory installed
+		physical_memory="10#${.sh.match[1]}"
+		
+		((
+			max_jobs_per_memory=round(physical_memory/min_mem_per_job) ,
+			maxjobs=fmax(2, fmin(maxjobs, max_jobs_per_memory))
+		))
+	fi
+
+	return 0
+}
+
+maxjobs DMAKE_MAX_JOBS # "DMAKE_MAX_JOBS" passed as ksh(1) name reference
+export DMAKE_MAX_JOBS
+
+# path to onbld tool binaries
+ONBLD_BIN='/opt/onbld/bin'
+
+# PARENT_WS is used to determine the parent of this workspace. This is
+# for the options that deal with the parent workspace (such as where the
+# proto area will go).
+export PARENT_WS=''
+
+# CLONE_WS is the workspace nightly should do a bringover from.
+export CLONE_WS='ssh://anonhg@hg.illumos.org/illumos-gate'
+
+# The bringover, if any, is done as STAFFER.
+# Set STAFFER to your own login as gatekeeper or developer
+# The point is to use group "staff" and avoid referencing the parent
+# workspace as root.
+# Some scripts optionally send mail messages to MAILTO.
+#
+export STAFFER="$LOGNAME"
+export MAILTO="$STAFFER"
+
+# If you wish the mail messages to be From: an arbitrary address, export
+# MAILFROM.
+#export MAILFROM="user@example.com"
+
+# The project (see project(4)) under which to run this build.  If not
+# specified, the build is simply run in a new task in the current project.
+export BUILD_PROJECT=''
+
+# You should not need to change the next three lines
+export ATLOG="$CODEMGR_WS/log"
+export LOGFILE="$ATLOG/nightly.log"
+export MACH="$(uname -p)"
+
+#
+#  The following two macros are the closed/crypto binaries.  Once
+#  Illumos has totally freed itself, we can remove these references.
+#
+# Location of encumbered binaries.
+export ON_CLOSED_BINS="$CODEMGR_WS/closed"
+# Location of signed cryptographic binaries.
+export ON_CRYPTO_BINS="$CODEMGR_WS/on-crypto.$MACH.tar.bz2"
+
+# REF_PROTO_LIST - for comparing the list of stuff in your proto area
+# with. Generally this should be left alone, since you want to see differences
+# from your parent (the gate).
+#
+export REF_PROTO_LIST="$PARENT_WS/usr/src/proto_list_${MACH}"
+
+
+export ROOT="$CODEMGR_WS/proto/root_${MACH}"
+export SRC="$CODEMGR_WS/usr/src"
+export MULTI_PROTO="no"
+
+#
+#	build environment variables, including version info for mcs, motd,
+# motd, uname and boot messages. Mostly you shouldn't change this except
+# when the release slips (nah) or you move an environment file to a new
+# release
+#
+export VERSION="$GATE"
+
+#
+# the RELEASE and RELEASE_DATE variables are set in Makefile.master;
+# there might be special reasons to override them here, but that
+# should not be the case in general
+#
+# export RELEASE='5.11'
+# export RELEASE_DATE='October 2007'
+
+# proto area in parent for optionally depositing a copy of headers and
+# libraries corresponding to the protolibs target
+# not applicable given the NIGHTLY_OPTIONS
+#
+export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"
+export PARENT_TOOLS_ROOT="$PARENT_WS/usr/src/tools/proto/root_$MACH-nd"
+
+# Package creation variables.  You probably shouldn't change these,
+# either.
+#
+# PKGARCHIVE determines where the repository will be created.
+#
+# PKGPUBLISHER_REDIST controls the publisher setting for the repository.
+#
+export PKGARCHIVE="${CODEMGR_WS}/packages/${MACH}/nightly"
+# export PKGPUBLISHER_REDIST='on-redist'
+
+# Package manifest format version.
+export PKGFMT_OUTPUT='v1'
+
+# we want make to do as much as it can, just in case there's more than
+# one problem.
+export MAKEFLAGS='k'
+
+# Magic variable to prevent the devpro compilers/teamware from sending
+# mail back to devpro on every use.
+export UT_NO_USAGE_TRACKING='1'
+
+# Build tools - don't change these unless you know what you're doing.  These
+# variables allows you to get the compilers and onbld files locally or
+# through cachefs.  Set BUILD_TOOLS to pull everything from one location.
+# Alternately, you can set ONBLD_TOOLS to where you keep the contents of
+# SUNWonbld and SPRO_ROOT to where you keep the compilers.  SPRO_VROOT
+# exists to make it easier to test new versions of the compiler.
+export BUILD_TOOLS='/opt'
+#export ONBLD_TOOLS='/opt/onbld'
+export SPRO_ROOT=/opt
+export SPRO_VROOT=/opt/sunstudio12.1
+
+# This goes along with lint - it is a series of the form "A [y|n]" which
+# means "go to directory A and run 'make lint'" Then mail me (y) the
+# difference in the lint output. 'y' should only be used if the area you're
+# linting is actually lint clean or you'll get lots of mail.
+# You shouldn't need to change this though.
+#export LINTDIRS="$SRC y"
+
+# Set this flag to 'n' to disable the automatic validation of the dmake
+# version in use.  The default is to check it.
+#CHECK_DMAKE='y'
+
+# Set this flag to 'n' to disable the use of 'checkpaths'.  The default,
+# if the 'N' option is not specified, is to run this test.
+#CHECK_PATHS='y'
+
+# POST_NIGHTLY can be any command to be run at the end of nightly.  See
+# nightly(1) for interactions between environment variables and this command.
+#POST_NIGHTLY=
+
+# Uncomment this to disable support for SMB printing.
+# export ENABLE_SMB_PRINTING='#'
+export __GNUC=''
+export CW_NO_SHADOW=1
+export ONNV_BUILDNUM=152.0.0
--- old/usr/src/man/man1m/Makefile	2014-11-12 17:44:33.866769115 +0100
+++ new/usr/src/man/man1m/Makefile	2014-11-12 17:44:33.871811190 +0100
@@ -13,6 +13,7 @@
 # Copyright 2011, Richard Lowe
 # Copyright (c) 2012, Joyent, Inc.  All rights reserved.
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 include		$(SRC)//Makefile.master
@@ -62,7 +63,6 @@
 		catman.1m		\
 		cfgadm.1m		\
 		cfgadm_ac.1m		\
-		cfgadm_cardbus.1m	\
 		cfgadm_fp.1m		\
 		cfgadm_ib.1m		\
 		cfgadm_pci.1m		\
--- old/usr/src/man/man1m/cfgadm_cardbus.1m	2014-11-12 17:44:34.047252812 +0100
+++ /dev/null	2014-11-12 17:44:34.000000000 +0100
@@ -1,58 +0,0 @@
-'\" te
-.\" Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CFGADM_CARDBUS 1M "Jul 11, 2006"
-.SH NAME
-cfgadm_cardbus \- cardbus hardware specific commands for cfgadm
-.SH SYNOPSIS
-.LP
-.nf
-\fB/usr/sbin/cfgadm\fR [\fB-f \fR] [\fB-y \fR | \fB-n \fR] [\fB-v\fR]
-     [\fB-o\fR \fIhardware_options\fR] \fB-c\fR\fI function\fR \fIap_id\fR [\fIap_id\fR]
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/cfgadm\fR [\fB-f \fR] [\fB-y \fR | \fB-n \fR] [\fB-v\fR]
-     [\fB-o\fR \fIhardware_options\fR] \fB-x\fR\fI hardware_function\fR \fIap_id\fR
-     [\fIap_id\fR]
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/cfgadm\fR [\fB-v\fR] [\fB-s\fR \fIlisting_options\fR]
-     [\fB-o\fR \fIhardware_options\fR] [\fB-l\fR [\fIap_id\fR | \fIap_type\fR]]
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/cfgadm\fR [\fB-v\fR] [\fB-o\fR \fIharware_options\fR] \fB-t\fR \fIap_id\fR [\fIap_id\fR]
-.fi
-
-.LP
-.nf
-\fB/usr/sbin/cfgadm\fR [\fB-v\fR] [\fB-o\fR \fIhardware_function\fR] \fB-h\fR
-     [\fIap_id\fR| \fI ap_type\fR]
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The CardBus slots in Solaris are hot plug capable. This capability is supported
-by the \fBPCI\fR hardware specific library \fB/usr/lib/cfgadm/pci.so.1\fR
-through the \fBcfgadm\fR command (see \fBcfgadm\fR(1M)).
-.sp
-.LP
-The hot plug administrative models between CardBus, PCI, CompactPCI, and PCI
-Express operate the same fashion. Please refer to \fBcfgadm_pci\fR(1M) for the
-usage information.
-.SH SEE ALSO
-.sp
-.LP
-\fBcfgadm\fR(1M), \fBconfig_admin\fR(3CFGADM), \fBlibcfgadm\fR(3LIB),
-\fBattributes\fR(5)
-.sp
-.LP
-\fI\fR
--- old/usr/src/man/man4/Makefile	2014-11-12 17:44:34.097480087 +0100
+++ new/usr/src/man/man4/Makefile	2014-11-12 17:44:34.102527918 +0100
@@ -10,6 +10,7 @@
 #
 
 #
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 # Copyright 2011, Richard Lowe
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
 #
@@ -35,7 +36,6 @@
 		bart_manifest.4			\
 		bart_rules.4			\
 		bootparams.4			\
-		cardbus.4			\
 		compver.4			\
 		contents.4			\
 		contract.4			\
--- old/usr/src/man/man4/cardbus.4	2014-11-12 17:44:34.244012602 +0100
+++ /dev/null	2014-11-12 17:44:34.000000000 +0100
@@ -1,237 +0,0 @@
-'\" te
-.\"  Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CARDBUS 4 "Jul 11, 2006"
-.SH NAME
-cardbus \- configuration files for cardbus device drivers
-.SH DESCRIPTION
-.sp
-.LP
-The CardBus bus share the same configuration parameters with the PCI bus.
-CardBus devices are self-identifying, which means that these devices provide
-configuration parameters to the system that allow the system to identify the
-device and its driver. The configuration parameters are represented in the form
-of name-value pairs that can be retrieved using the \fBDDI\fR property
-interfaces. See \fBddi_prop_lookup\fR(9F) for details.
-.sp
-.LP
-The CardBus bus properties of CardBus devices are derived from PCI
-configuration space. Therefore, driver configuration files are not necessary
-for these devices.
-.sp
-.LP
-On some occasions, drivers for CardBus devices can use driver configuration
-files to provide driver private properties through the global property
-mechanism. See \fBdriver.conf\fR(4) for further details. Driver configuration
-files can also be used to augment or override properties for a specific
-instance of a driver.
-.sp
-.LP
-The CardBus nexus driver recognizes the following properties:
-.sp
-.ne 2
-.na
-\fB\fBreg\fR\fR
-.ad
-.RS 14n
-An arbitrary length array where each element of the array consists of a 5-tuple
-of 32-bit values. Each array element describes a logically contiguous mappable
-resource on the \fBPCI\fR bus.
-.sp
-The first three values in the 5-tuple describe the \fBPCI\fR address of the
-mappable resource. The first tuple contains the following information:
-.sp
-
-.sp
-.TS
-l l l
-l l l .
-Bits 0 - 7	8-bit register number	
-Bits 8 - 10	3-bit function number	
-Bits 11 - 15	5-bit device number	
-Bits 16 - 23 	8-bit bus number	
-Bits 24 - 25	2-bit address space type identifier	
-Bits 31 - 28	T{
-Register number extended bits 8:11 for extended config space. Zero for conventional configuration space.
-T}	
-.TE
-
-The address space type identifier can be interpreted as follows:
-.sp
-
-.sp
-.TS
-l l l
-l l l .
-0x0	configuration space	
-0x1	I/O space	
-0x2	32-bit memory space address	
-.TE
-
-The bus number is a unique identifying number assigned to each bus within the
-\fBPCI\fR or PCIe domain.
-.sp
-The device number is a unique identifying number assigned to each device on a
-\fBPCI\fR bus, PCIe logical bus, or CardBus bus. A device number is unique only
-within the set of device numbers for a particular bus or logical bus.
-.sp
-Each CardBus device can have one to eight logically independent functions, each
-with its own independent set of configuration registers. Each function on a
-device is assigned a function number. For a device with only one function, the
-function number must be \fB0\fR.
-.sp
-The register number fields select a particular register within the set of
-configuration registers corresponding to the selected function. When the
-address space type identifier indicates configuration space, non-zero register
-number extended bits select registers in extended configuration space.
-.sp
-The second and third values in the \fBreg\fR property 5-tuple specify the
-64-bit address of the mappable resource within the \fBPCI\fR or PCIe address
-domain. Since the CardBus is a 32-bit bus, the second 32-bit tuple is not used.
-The third 32-bit tuple corresponds to the 32-bit address.
-.sp
-The fourth and fifth 32-bit values in the 5-tuple \fBreg\fR property specify
-the size of the mappable resource. The size is a 64-bit value. Since it's a
-32-bit bus, only the fifth tuple is used.
-.sp
-The driver can refer to the elements of this array by index, and construct
-kernel mappings to these addresses using \fBddi_regs_map_setup\fR(9F). The
-index into the array is passed as the \fIrnumber\fR argument of
-\fBddi_regs_map_setup\fR(9F).
-.sp
-At a high-level interrupt context, you can use the \fBddi_get*\fR and
-\fBddi_put*\fR family of functions to access I/O and memory space. However,
-access to configuration space is not allowed when running at a high-interrupt
-level.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinterrupts\fR\fR
-.ad
-.RS 14n
-This property consists of a single-integer element array. Valid interrupt
-property values are \fB1\fR, \fB2\fR, \fB3\fR, and \fB4\fR. This value is
-derived directly from the contents of the device's configuration-interrupt-pin
-register.
-.sp
-A driver should use an index value of \fB0\fR when registering its interrupt
-handler with the DDI interrupt interfaces.
-.RE
-
-.sp
-.LP
-All CardBus devices support the \fBreg\fR property. The device number and
-function number as derived from the \fBreg\fR property are used to construct
-the address part of the device name under \fB/devices\fR.
-.sp
-.LP
-Only devices that generate interrupts support an \fBinterrupts\fR property.
-.sp
-.LP
-Occasionally it might be necessary to override or augment the configuration
-information supplied by a CardBus device. This change can be achieved by
-writing a driver configuration file that describes a prototype device node
-specification containing the additional properties required.
-.sp
-.LP
-For the system to merge the prototype node specification into an actual device
-node, certain conditions must be met.
-.RS +4
-.TP
-.ie t \(bu
-.el o
-First, the \fBname\fR property must be identical. The value of the \fBname\fR
-property needs to match the binding name of the device. The binding name is the
-name chosen by the system to bind a driver to a device and is either an alias
-associated with the driver or the hardware node name of the device.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-Second, the parent property must identify the PCI bus or PCIe logical bus.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-Third, the unit-address property must identify the card. The format of the
-unit-address property is:
-.RE
-.sp
-.LP
-\fBDD[,F]\fR
-.sp
-.LP
-where \fBDD\fR is the device number and \fBF\fR is the function number. If the
-function number is 0, only \fBDD\fR is specified.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRSample Configuration File
-.sp
-.LP
-An example configuration file called \fBACME,scsi-hba.conf\fR for a CardBus
-device driver called \fBACME,scsi-hba\fR follows:
-
-.sp
-.in +2
-.nf
-#
-# Copyright (c) 1995, ACME SCSI Host Bus Adaptor
-# ident   "@(#)ACME,scsi-hba.conf  1.1  96/02/04"
-name="ACME,scsi-hba" parent="/pci@1,0/pci@1f,4000"
-   unit-address="3" scsi-initiator-id=6;
-hba-advanced-mode="on";
-hba-dma-speed=10;
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-In this example, a property \fBscsi-initiator-id\fR specifies the \fBSCSI\fR
-bus initiator id that the adapter should use, for just one particular instance
-of adapter installed in the machine. The \fBname\fR property identifies the
-driver and the parent property to identify the particular bus the card is
-plugged into. This example uses the parent's full path name to identify the
-bus. The unit-address property identifies the card itself, with device number
-of 3 and function number of 0.
-
-.sp
-.LP
-Two global driver properties are also created: \fBhba-advanced-mode\fR (which
-has the string value \fBon\fR) and \fBhba-dma-speed\fR (which has the value
-\fB10\fR M bit/s). These properties apply to all device nodes of the
-\fBACME,scsi-hba\fR.
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE	ATTRIBUTE VALUE
-_
-Architecture	SPARC, x86
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBdriver.conf\fR(4), \fBattributes\fR(5), \fBddi_intr_add_handler\fR(9F),
-\fBddi_prop_lookup\fR(9F), \fBddi_regs_map_setup\fR(9F)
-.sp
-.LP
-\fIWriting Device Drivers\fR
-.sp
-.LP
-\fIIEEE 1275 PCI Bus Binding\fR
--- old/usr/src/man/man7d/Makefile	2014-11-12 17:44:34.297674127 +0100
+++ new/usr/src/man/man7d/Makefile	2014-11-12 17:44:34.302723828 +0100
@@ -94,8 +94,6 @@
 		nxge.7d		\
 		ohci.7d		\
 		openprom.7d	\
-		pcic.7d		\
-		pcmcia.7d	\
 		physmem.7d	\
 		pm.7d		\
 		poll.7d		\
--- /dev/null	2014-11-12 17:44:34.000000000 +0100
+++ new/usr/src/man/man7d/Makefile.orig	2014-11-12 17:44:34.449080218 +0100
@@ -0,0 +1,298 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet
+# at http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2011, Richard Lowe
+# Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
+#
+
+include		$(SRC)/Makefile.master
+
+MANSECT= 	7d
+
+_MANFILES=	aac.7d		\
+		afe.7d		\
+		audio.7d	\
+		audio1575.7d	\
+		audioens.7d	\
+		audiols.7d	\
+		audiop16x.7d	\
+		audiopci.7d	\
+		audiots.7d	\
+		av1394.7d	\
+		bge.7d		\
+		blkdev.7d	\
+		bscv.7d		\
+		chxge.7d	\
+		console.7d	\
+		cpuid.7d	\
+		dca.7d		\
+		dcam1394.7d	\
+		devinfo.7d	\
+		dmfe.7d		\
+		dtrace.7d	\
+		ehci.7d		\
+		fasttrap.7d	\
+		fbt.7d		\
+		fcip.7d		\
+		fcoe.7d		\
+		fcoei.7d	\
+		fcoet.7d	\
+		fcp.7d		\
+		fctl.7d		\
+		fd.7d		\
+		fp.7d		\
+		gld.7d		\
+		hci1394.7d	\
+		hermon.7d	\
+		hid.7d		\
+		hme.7d		\
+		hubd.7d		\
+		hwahc.7d	\
+		hwarc.7d	\
+		hxge.7d		\
+		ib.7d		\
+		ibcm.7d		\
+		ibd.7d		\
+		ibdm.7d		\
+		ibdma.7d	\
+		ibtl.7d		\
+		ieee1394.7d	\
+		igb.7d		\
+		ii.7d		\
+		ipnet.7d	\
+		iscsi.7d	\
+		iser.7d		\
+		ixgbe.7d	\
+		kmdb.7d		\
+		kstat.7d	\
+		ksyms.7d	\
+		llc1.7d		\
+		lockstat.7d	\
+		lofi.7d		\
+		log.7d		\
+		md.7d		\
+		mediator.7d	\
+		mem.7d		\
+		mpt_sas.7d	\
+		mr_sas.7d	\
+		msglog.7d	\
+		mt.7d		\
+		mxfe.7d		\
+		myri10ge.7d	\
+		null.7d		\
+		nulldriver.7d	\
+		nxge.7d		\
+		ohci.7d		\
+		openprom.7d	\
+		pcic.7d		\
+		pcmcia.7d	\
+		physmem.7d	\
+		pm.7d		\
+		poll.7d		\
+		profile.7d	\
+		ptm.7d		\
+		pts.7d		\
+		pty.7d		\
+		qlc.7d		\
+		ramdisk.7d	\
+		random.7d	\
+		rge.7d		\
+		rtls.7d		\
+		sad.7d		\
+		sata.7d		\
+		scsa1394.7d	\
+		scsa2usb.7d	\
+		sd.7d		\
+		sdp.7d		\
+		sdt.7d		\
+		ses.7d		\
+		sfe.7d		\
+		sgen.7d		\
+		srpt.7d		\
+		st.7d		\
+		sv.7d		\
+		sysmsg.7d	\
+		systrace.7d	\
+		ticlts.7d	\
+		tty.7d		\
+		ttymux.7d	\
+		tzmon.7d	\
+		ugen.7d		\
+		uhci.7d		\
+		usb_ac.7d	\
+		usb_as.7d	\
+		usb_ia.7d	\
+		usb_mid.7d	\
+		usba.7d		\
+		usbftdi.7d	\
+		usbprn.7d	\
+		usbsacm.7d	\
+		usbsksp.7d	\
+		usbsprl.7d	\
+		usbvc.7d	\
+		uwba.7d		\
+		virtualkm.7d	\
+		vni.7d		\
+		vr.7d		\
+		wscons.7d	\
+		wusb_ca.7d	\
+		wusb_df.7d	\
+		xge.7d		\
+		yge.7d		\
+		zcons.7d	\
+		zero.7d
+
+sparc_MANFILES=	audiocs.7d	\
+		bbc_beep.7d	\
+		ctsmc.7d	\
+		cvc.7d		\
+		cvcredir.7d	\
+		dad.7d		\
+		dm2s.7d		\
+		dr.7d		\
+		eri.7d		\
+		fas.7d		\
+		gpio_87317.7d	\
+		grbeep.7d	\
+		idn.7d		\
+		mc-opl.7d	\
+		n2rng.7d	\
+		ncp.7d		\
+		ntwdt.7d	\
+		oplkmdrv.7d	\
+		oplmsu.7d	\
+		oplpanel.7d	\
+		pcicmu.7d	\
+		pcipsy.7d	\
+		pcisch.7d	\
+		schpc.7d	\
+		sf.7d		\
+		smbus.7d	\
+		socal.7d	\
+		ssd.7d		\
+		su.7d		\
+		todopl.7d	\
+		tsalarm.7d	\
+		zs.7d		\
+		zsh.7d
+
+i386_MANFILES=	ahci.7d		\
+		amd8111s.7d	\
+		amr.7d		\
+		arcmsr.7d	\
+		arn.7d		\
+		asy.7d		\
+		ata.7d		\
+		atge.7d		\
+		ath.7d		\
+		atu.7d		\
+		audio810.7d	\
+		audiocmi.7d	\
+		audiocmihd.7d	\
+		audioemu10k.7d	\
+		audiohd.7d	\
+		audioixp.7d	\
+		audiosolo.7d	\
+		audiovia823x.7d \
+		audiovia97.7d	\
+		bcm_sata.7d	\
+		bfe.7d		\
+		cmdk.7d		\
+		cpqary3.7d	\
+		dnet.7d		\
+		ecpp.7d		\
+		elxl.7d		\
+		heci.7d		\
+		i915.7d		\
+		ipmi.7d		\
+		iprb.7d		\
+		ipw.7d		\
+		iwh.7d		\
+		iwi.7d		\
+		mega_sas.7d	\
+		npe.7d		\
+		ntxn.7d		\
+		nv_sata.7d	\
+		pcn.7d		\
+		radeon.7d	\
+		ral.7d		\
+		rtw.7d		\
+		rum.7d		\
+		rwd.7d		\
+		rwn.7d		\
+		sda.7d		\
+		sdhost.7d	\
+		si3124.7d	\
+ 	 	skd.7d		\
+		smbios.7d	\
+		uath.7d		\
+		ural.7d		\
+		urtw.7d		\
+		wpi.7d		\
+		zyd.7d
+
+_MANLINKS=	1394.7d		\
+	 	allkmem.7d	\
+	 	bscbus.7d	\
+	 	fdc.7d		\
+	 	firewire.7d	\
+	 	hwa1480_fw.7d	\
+	 	i2bsc.7d	\
+	 	kmem.7d		\
+	 	lo0.7d		\
+	 	ticots.7d	\
+	 	ticotsord.7d	\
+	 	urandom.7d	\
+	 	usb.7d		\
+	 	uwb.7d
+
+sparc_MANLINKS=	drmach.7d	\
+		ngdr.7d		\
+		ngdrmach.7d
+
+MANFILES =	$(_MANFILES) $($(MACH)_MANFILES)
+MANLINKS =	$(_MANLINKS) $($(MACH)_MANLINKS)
+
+bscbus.7d	:= LINKSRC = bscv.7d
+i2bsc.7d	:= LINKSRC = bscv.7d
+
+drmach.7d	:= LINKSRC = dr.7d
+ngdr.7d		:= LINKSRC = dr.7d
+ngdrmach.7d	:= LINKSRC = dr.7d
+
+fdc.7d		:= LINKSRC = fd.7d
+
+1394.7d		:= LINKSRC = ieee1394.7d
+firewire.7d	:= LINKSRC = ieee1394.7d
+
+lo0.7d		:= LINKSRC = ipnet.7d
+
+allkmem.7d	:= LINKSRC = mem.7d
+kmem.7d		:= LINKSRC = mem.7d
+
+urandom.7d	:= LINKSRC = random.7d
+
+ticots.7d	:= LINKSRC = ticlts.7d
+ticotsord.7d	:= LINKSRC = ticlts.7d
+
+usb.7d		:= LINKSRC = usba.7d
+
+uwb.7d		:= LINKSRC = uwba.7d
+
+hwa1480_fw.7d	:= LINKSRC = wusb_df.7d
+
+.KEEP_STATE:
+
+include		$(SRC)/man/Makefile.man
+
+install:	$(ROOTMANFILES) $(ROOTMANLINKS)
--- old/usr/src/man/man9f/Intro.9f	2014-11-12 17:44:34.515990003 +0100
+++ new/usr/src/man/man9f/Intro.9f	2014-11-12 17:44:34.521130023 +0100
@@ -1,867 +1,779 @@
-'\" te
 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
 .\" Copyright (c) 2005, Sun Microsystems, Inc., All Rights Reserved
 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH INTRO 9F "Feb 06, 2012"
-.SH NAME
-Intro, intro \- introduction to DDI/DKI functions
-.SH DESCRIPTION
-.sp
-.LP
+.Dd "Aug 08, 2014"
+.Dt INTRO 9F
+.Os
+.Sh NAME
+.Nm Intro ,
+.Nm intro
+.Nd introduction to DDI/DKI functions
+.Sh DESCRIPTION
 Section 9F describes the kernel functions available for use by device drivers.
-See \fBIntro\fR(9E) for an overview of device driver interfaces.
-.sp
-.LP
+See
+.Xr Intro 9E
+for an overview of device driver interfaces.
+.Lp
 In this section, the information for each driver function is organized under
 the following headings:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBNAME\fR summarizes the function's purpose.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBSYNOPSIS\fR shows the syntax of the function's entry point in the source
-code. \fB#include\fR directives are shown for required headers.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBINTERFACE\fR \fBLEVEL\fR describes any architecture dependencies.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBARGUMENTS\fR describes any arguments required to invoke the function.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBDESCRIPTION\fR describes general information about the function.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBRETURN\fR \fBVALUES\fR describes the return values and messages that can
+.Bl -bullet -offset indent
+.It
+.Sy NAME
+summarizes the function's purpose.
+.It
+.Sy SYNOPSIS
+shows the syntax of the function's entry point in the source
+code.
+.Li #include
+directives are shown for required headers.
+.It
+.Sy INTERFACE LEVEL
+describes any architecture dependencies.
+.It
+.Sy ARGUMENTS
+describes any arguments required to invoke the function.
+.It
+.Sy DESCRIPTION
+describes general information about the function.
+.It
+.Sy RETURN VALUES
+describes the return values and messages that can
 result from invoking the function.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBCONTEXT\fR indicates from which driver context (user, kernel, interrupt, or
+.It
+.Sy CONTEXT
+indicates from which driver context (user, kernel, interrupt, or
 high-level interrupt) the function can be called.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-A driver function has \fIuser context\fR if it was directly invoked because of
-a user thread. The \fBread\fR(9E) entry point of the driver, invoked by a
-\fBread\fR(2) system call, has user context.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-A driver function has \fIkernel context\fR if was invoked by some other part of
-the kernel. In a block device driver, the \fBstrategy\fR(9E) entry point may be
+.Lp
+A driver function has
+.Em user context
+if it was directly invoked because of
+a user thread. The
+.Xr read 9E
+entry point of the driver, invoked by a
+.Xr read 2
+system call, has user context.
+.Lp
+A driver function has
+.Em kernel context
+if was invoked by some other part of
+the kernel. In a block device driver, the
+.Xr strategy 9E
+entry point may be
 called by the page daemon to write pages to the device. The page daemon has no
-relation to the current user thread, so in this case \fBstrategy\fR(9E) has
-kernel context.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIInterrupt context\fR is kernel context, but also has an interrupt level
+relation to the current user thread, so in this case
+.Xr strategy 9E
+has kernel context.
+.Lp
+.Em Interrupt context
+is kernel context, but also has an interrupt level
 associated with it. Driver interrupt routines have interrupt context.
-.sp
+.Lp
 Note that a mutex acquired in user or kernel context that can also be acquired
 in interrupt context means that the user or kernel context thread holding that
 mutex is subject to all the restrictions imposed by interrupt context, for the
-duration of the ownership of that mutex. Please see the \fBmutex\fR(9F) man
-page for a more complete discussion of proper mutex handling for drivers.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIHigh-level interrupt context\fR is a more restricted form of interrupt
+duration of the ownership of that mutex. Please see the
+.Xr mutex 9F
+man page for a more complete discussion of proper mutex handling for drivers.
+.Lp
+.Em High-level interrupt context
+is a more restricted form of interrupt
 context. If a driver interrupt priority returned from
-\fBddi_intr_get_pri\fR(9F) is greater than the priority returned from
-\fBddi_intr_get_hilevel_pri\fR(9F) this indicates the interrupt handler will
+.Xr ddi_intr_get_pri 9F
+is greater than the priority returned from
+.Xr ddi_intr_get_hilevel_pri 9F
+this indicates the interrupt handler will
 run in high-level interrupt context. These interrupt routines are only allowed
-to call \fBddi_intr_trigger_softint\fR(9F), \fBmutex_enter\fR(9F), and
-\fBmutex_exit\fR(9F). Furthermore, \fBmutex_enter\fR(9F) and
-\fBmutex_exit\fR(9F) may only be called on mutexes initialized with the
-interrupt priority returned by \fBddi_intr_get_pri\fR(9F).
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBSEE ALSO\fR indicates functions that are related by usage and sources, and
+to call
+.Xr ddi_intr_trigger_softint 9F ,
+.Xr mutex_enter 9F ,
+and
+.Xr mutex_exit 9F .
+Furthermore,
+.Xr mutex_enter 9F
+and
+.Xr mutex_exit 9F
+may only be called on mutexes initialized with the
+interrupt priority returned by
+.Xr ddi_intr_get_pri 9F .
+.It
+.Sy SEE ALSO
+indicates functions that are related by usage and sources, and
 which can be referred to for further information.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fBEXAMPLES\fR shows how the function can be used in driver code.
-.RE
-.sp
-.LP
-Every driver MUST include <\fBsys/ddi.h\fR> and <\fBsys/sunddi.h\fR>, in that
-order, and as the last files the driver includes.
-.SH STREAMS KERNEL FUNCTION SUMMARY
-.sp
-.LP
+.It
+.Sy EXAMPLES
+shows how the function can be used in driver code.
+.El
+.Lp
+Every driver MUST include
+.In sys/ddi.h
+and
+.In sys/sunddi.h ,
+in that order, and as the last files the driver includes.
+.Sh STREAMS KERNEL FUNCTION SUMMARY
 The following table summarizes the STREAMS functions described in this section.
-.sp
-
-.sp
-.TS
-c c
-l l .
-Routine	Type
-_
-\fBadjmsg\fR	DDI/DKI
-\fBallocb\fR	DDI/DKI
-\fBallocb_tmpl\fR	Solaris DDI
-\fBbackq\fR	DDI/DKI
-\fBbcanput\fR	DDI/DKI
-\fBbcanputnext\fR	DDI/DKI
-\fBbufcall\fR	DDI/DKI
-\fBcanput\fR	DDI/DKI
-\fBcanputnext\fR	DDI/DKI
-\fBclrbuf\fR	DDI/DKI
-\fBcopyb\fR	DDI/DKI
-\fBcopymsg\fR	DDI/DKI
-\fBDB_BASE\fR	Solaris DDI
-\fBDB_LIM\fR	Solaris DDI
-\fBDB_REF\fR	Solaris DDI
-\fBDB_TYPE\fR	Solaris DDI
-\fBdatamsg\fR	DDI/DKI
-\fBdupb\fR	DDI/DKI
-\fBdupmsg\fR	DDI/DKI
-\fBenableok\fR	DDI/DKI
-\fBesballoc\fR	DDI/DKI
-\fBesbbcall\fR	DDI/DKI
-\fBflushband\fR	DDI/DKI
-\fBflushq\fR	DDI/DKI
-\fBfreeb\fR	DDI/DKI
-\fBfreemsg\fR	DDI/DKI
-\fBfreezestr\fR	DDI/DKI
-\fBgetq\fR	DDI/DKI
-\fBIOC_CONVER_FROM\fR	Solaris DDI
-\fBinsq\fR	DDI/DKI
-\fBlinkb\fR	DDI/DKI
-\fBMBLKHEAD\fR	Solaris DDI
-\fBMBLKIN\fR	Solaris DDI
-\fBMBLKL\fR	Solaris DDI
-\fBMBLKSIZE\fR	Solaris DDI
-\fBMBLKTAIL\fR	Solaris DDI
-\fBmcopyin\fR	Solaris DDI
-\fBmcopymsg\fR	Solaris DDI
-\fBmcopyout\fR	Solaris DDI
-\fBmerror\fR	Solaris DDI
-\fBmexchange\fR	Solaris DDI
-\fBmioc2ack\fR	Solaris DDI
-\fBmiocack\fR	Solaris DDI
-\fBmexchange\fR	Solaris DDI
-\fBmiocpullup\fR	Solaris DDI
-\fBmkiocb\fR	Solaris DDI
-\fBmsgdsize\fR	DDI/DKI
-\fBmsgpullup\fR	DDI/DKI
-\fBmsgsize\fR	Solaris DDI
-\fBmt-streams\fR	Solaris DDI
-\fBnoenable\fR	DDI/DKI
-\fBOTHERQ\fR	DDI/DKI
-\fBpullupmsg\fR	DDI/DKI
-\fBput\fR	DDI/DKI
-\fBputbq\fR	DDI/DKI
-\fBputctl\fR	DDI/DKI
-\fBputctl1\fR	DDI/DKI
-\fBputnext\fR	DDI/DKI
-\fBputnextctl\fR	DDI/DKI
-\fBputq\fR	DDI/DKI
-\fBqassociate\fR	Solaris DDI
-\fBqbufcall\fR	Solaris DDI
-\fBqenable\fR	DDI/DKI
-\fBqprocson\fR	DDI/DKI
-\fBqprocsoff\fR	DDI/DKI
-\fBqreply\fR	DDI/DKI
-\fBqsize\fR	DDI/DKI
-\fBqtimeout\fR	Solaris DDI
-\fBqunbufcall\fR	Solaris DDI
-\fBquntimeout\fR	Solaris DDI
-\fBqwait\fR	Solaris DDI
-\fBqwait_sig\fR	Solaris DDI
-\fBqwriter\fR	Solaris DDI
-\fBRD\fR	DDI/DKI
-\fBrmvb\fR	DDI/DKI
-\fBrmvq\fR	DDI/DKI
-\fBSAMESTR\fR	DDI/DKI
-\fBstrlog\fR	DDI/DKI
-\fBstrqget\fR	DDI/DKI
-\fBstrqset\fR	DDI/DKI
-\fBtestb\fR	DDI/DKI
-\fBunbufcall\fR	DDI/DKI
-\fBunfreezestr\fR	DDI/DKI
-\fBunlinkb\fR	DDI/DKI
-\fBWR\fR	DDI/DKI
-.TE
-
-.sp
-.LP
+.Bl -column usb_pipe_get_max_bulk_transfer_size
+.It Sy Routine	Sy Type
+.It Sy adjmsg	DDI/DKI
+.It Sy allocb	DDI/DKI
+.It Sy allocb_tmpl	Solaris DDI
+.It Sy backq	DDI/DKI
+.It Sy bcanput	DDI/DKI
+.It Sy bcanputnext	DDI/DKI
+.It Sy bufcall	DDI/DKI
+.It Sy canput	DDI/DKI
+.It Sy canputnext	DDI/DKI
+.It Sy clrbuf	DDI/DKI
+.It Sy copyb	DDI/DKI
+.It Sy copymsg	DDI/DKI
+.It Sy DB_BASE	Solaris DDI
+.It Sy DB_LIM	Solaris DDI
+.It Sy DB_REF	Solaris DDI
+.It Sy DB_TYPE	Solaris DDI
+.It Sy datamsg	DDI/DKI
+.It Sy dupb	DDI/DKI
+.It Sy dupmsg	DDI/DKI
+.It Sy enableok	DDI/DKI
+.It Sy esballoc	DDI/DKI
+.It Sy esbbcall	DDI/DKI
+.It Sy flushband	DDI/DKI
+.It Sy flushq	DDI/DKI
+.It Sy freeb	DDI/DKI
+.It Sy freemsg	DDI/DKI
+.It Sy freezestr	DDI/DKI
+.It Sy getq	DDI/DKI
+.It Sy IOC_CONVERT_FROM	Solaris DDI
+.It Sy insq	DDI/DKI
+.It Sy linkb	DDI/DKI
+.It Sy MBLKHEAD	Solaris DDI
+.It Sy MBLKIN	Solaris DDI
+.It Sy MBLKL	Solaris DDI
+.It Sy MBLKSIZE	Solaris DDI
+.It Sy MBLKTAIL	Solaris DDI
+.It Sy mcopyin	Solaris DDI
+.It Sy mcopymsg	Solaris DDI
+.It Sy mcopyout	Solaris DDI
+.It Sy merror	Solaris DDI
+.It Sy mexchange	Solaris DDI
+.It Sy mioc2ack	Solaris DDI
+.It Sy miocack	Solaris DDI
+.It Sy mexchange	Solaris DDI
+.It Sy miocpullup	Solaris DDI
+.It Sy mkiocb	Solaris DDI
+.It Sy msgdsize	DDI/DKI
+.It Sy msgpullup	DDI/DKI
+.It Sy msgsize	Solaris DDI
+.It Sy mt-streams	Solaris DDI
+.It Sy noenable	DDI/DKI
+.It Sy OTHERQ	DDI/DKI
+.It Sy pullupmsg	DDI/DKI
+.It Sy put	DDI/DKI
+.It Sy putbq	DDI/DKI
+.It Sy putctl	DDI/DKI
+.It Sy putctl1	DDI/DKI
+.It Sy putnext	DDI/DKI
+.It Sy putnextctl	DDI/DKI
+.It Sy putq	DDI/DKI
+.It Sy qassociate	Solaris DDI
+.It Sy qbufcall	Solaris DDI
+.It Sy qenable	DDI/DKI
+.It Sy qprocson	DDI/DKI
+.It Sy qprocsoff	DDI/DKI
+.It Sy qreply	DDI/DKI
+.It Sy qsize	DDI/DKI
+.It Sy qtimeout	Solaris DDI
+.It Sy qunbufcall	Solaris DDI
+.It Sy quntimeout	Solaris DDI
+.It Sy qwait	Solaris DDI
+.It Sy qwait_sig	Solaris DDI
+.It Sy qwriter	Solaris DDI
+.It Sy RD	DDI/DKI
+.It Sy rmvb	DDI/DKI
+.It Sy rmvq	DDI/DKI
+.It Sy SAMESTR	DDI/DKI
+.It Sy strlog	DDI/DKI
+.It Sy strqget	DDI/DKI
+.It Sy strqset	DDI/DKI
+.It Sy testb	DDI/DKI
+.It Sy unbufcall	DDI/DKI
+.It Sy unfreezestr	DDI/DKI
+.It Sy unlinkb	DDI/DKI
+.It Sy WR	DDI/DKI
+.El
+.Lp
 The following table summarizes the functions not specific to STREAMS.
-.sp
-
-.sp
-.TS
-c c
-l l .
-Routine	Type
-_
-\fBASSERT\fR	DDI/DKI
-\fBanocancel\fR	Solaris DDI
-\fBaphysio\fR	Solaris DDI
-\fBatomic_add\fR	DDI/DKI
-\fBatomic_and\fR	DDI/DKI
-\fBatomic_bits\fR	DDI/DKI
-\fBatomic_cas\fR	DDI/DKI
-\fBatomic_dec\fR	DDI/DKI
-\fBatomic_inc\fR	DDI/DKI
-\fBatomic_ops\fR	DDI/DKI
-\fBatomic_or\fR	DDI/DKI
-\fBatomic_swap\fR	DDI/DKI
-\fBbcmp\fR	DDI/DKI
-\fBbcopy\fR	DDI/DKI
-\fBbioclone\fR	Solaris DDI
-\fBbiodone\fR	DDI/DKI
-\fBbiofini\fR	Solaris DDI
-\fBbioinit\fR	Solaris DDI
-\fBbiomodified\fR	Solaris DDI
-\fBbiosize\fR	Solaris DDI
-\fBbioerror\fR	Solaris DDI
-\fBbioreset\fR	Solaris DDI
-\fBbiowait\fR	DDI/DKI
-\fBbp_copyin\fR	DDI/DKI
-\fBbp_copyout\fR	DDI/DKI
-\fBbp_mapin\fR	DDI/DKI
-\fBbp_mapout\fR	DDI/DKI
-\fBbtop\fR	DDI/DKI
-\fBbtopr\fR	DDI/DKI
-\fBbzero\fR	DDI/DKI
-\fBcmn_err\fR	DDI/DKI
-\fBcondvar\fR	Solaris DDI
-\fBcopyin\fR	DDI/DKI
-\fBcopyout\fR	DDI/DKI
-\fBcsx_AccessConfigurationRegister\fR	Solaris DDI
-\fBcsx_ConvertSize\fR	Solaris DDI
-\fBcsx_ConvertSpeed\fR	Solaris DDI
-\fBcsx_CS_DDI_Info\fR	Solaris DDI
-\fBcsx_DeregisterClient\fR	Solaris DDI
-\fBcsx_DupHandle\fR	Solaris DDI
-\fBcsx_Error2Text\fR	Solaris DDI
-\fBcsx_Event2Text\fR	Solaris DDI
-\fBcsx_FreeHandle\fR	Solaris DDI
-\fBcsx_Get8\fR	Solaris DDI
-\fBcsx_GetFirstClient\fR	Solaris DDI
-\fBcsx_GetFirstTuple\fR	Solaris DDI
-\fBcsx_GetHandleOffset\fR	Solaris DDI
-\fBcsx_GetMappedAddr\fR	Solaris DDI
-\fBcsx_GetStatus\fR	Solaris DDI
-\fBcsx_GetTupleData\fR	Solaris DDI
-\fBcsx_MakeDeviceNode\fR	Solaris DDI
-\fBcsx_MapLogSocket\fR	Solaris DDI
-\fBcsx_MapMemPage\fR	Solaris DDI
-\fBcsx_ModifyConfiguration\fR	Solaris DDI
-\fBcsx_ModifyWindow\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_BATTERY\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_BYTEORDER\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_CFTABLE_ENTRY\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_CONFIG\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_DATE\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_DEVICE\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_DEVICEGEO\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_DEVICEGEO_A\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_FORMAT\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_FUNCE\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_FUNCID\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_GEOMETRY\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_JEDEC_C\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_LINKTARGET\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_LONGLINK_A\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_LONGLINK_MFC\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_MANFID\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_ORG\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_SPCL\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_SWIL\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_VERS_1\fR	Solaris DDI
-\fBcsx_Parse_CISTPL_VERS_2\fR	Solaris DDI
-\fBcsx_ParseTuple\fR	Solaris DDI
-\fBcsx_Put8\fR	Solaris DDI
-\fBcsx_RegisterClient\fR	Solaris DDI
-\fBcsx_ReleaseConfiguration\fR	Solaris DDI
-\fBcsx_RepGet8\fR	Solaris DDI
-\fBcsx_RepPut8\fR	Solaris DDI
-\fBcsx_RequestConfiguration\fR	Solaris DDI
-\fBcsx_RequestIO\fR	Solaris DDI
-\fBcsx_RequestIRQ\fR	Solaris DDI
-\fBcsx_RequestSocketMask\fR	Solaris DDI
-\fBcsx_RequestWindow\fR	Solaris DDI
-\fBcsx_ResetFunction\fR	Solaris DDI
-\fBcsx_SetEventMask\fR	Solaris DDI
-\fBcsx_SetHandleOffset\fR	Solaris DDI
-\fBcsx_ValidateCIS\fR	Solaris DDI
-\fBcv_broadcast\fR	Solaris DDI
-\fBcv_destroy\fR	Solaris DDI
-\fBcv_init\fR	Solaris DDI
-\fBcv_signal\fR	Solaris DDI
-\fBcv_timedwait\fR	Solaris DDI
-\fBcv_wait\fR	Solaris DDI
-\fBcv_wait_sig\fR	Solaris DDI
-\fBddi_add_event_handler\fR	Solaris DDI
-\fBddi_add_intr\fR	Solaris DDI
-\fBddi_add_softintr\fR	Solaris DDI
-\fBddi_binding_name\fR	Solaris DDI
-\fBddi_btop\fR	Solaris DDI
-\fBddi_btopr\fR	Solaris DDI
-\fBddi_can_receive_sig\fR	Solaris DDI
-\fBddi_check_acc_handle\fR	Solaris DDI
-\fBddi_copyin\fR	Solaris DDI
-\fBddi_copyout\fR	Solaris DDI
-\fBddi_create_minor_node\fR	Solaris DDI
-\fBddi_cred\fR	Solaris DDI
-\fBddi_dev_is_sid\fR	Solaris DDI
-\fBddi_dev_nintrs\fR	Solaris DDI
-\fBddi_dev_nregs\fR	Solaris DDI
-\fBddi_dev_regsize\fR	Solaris DDI
-\fBddi_device_copy\fR	Solaris DDI
-\fBddi_device_zero\fR	Solaris DDI
-\fBddi_devmap_segmap\fR	Solaris DDI
-\fBddi_dma_addr_bind_handle\fR	Solaris DDI
-\fBddi_dma_alloc_handle\fR	Solaris DDI
-\fBddi_dma_buf_bind_handle\fR	Solaris DDI
-\fBddi_dma_burstsizes\fR	Solaris DDI
-\fBddi_dma_free_handle\fR	Solaris DDI
-\fBddi_dma_getwin\fR	Solaris DDI
-\fBddi_dma_mem_alloc\fR	Solaris DDI
-\fBddi_dma_mem_free\fR	Solaris DDI
-\fBddi_dma_nextcookie\fR	Solaris DDI
-\fBddi_dma_numwin\fR	Solaris DDI
-\fBddi_dma_set_sbus64\fR	Solaris DDI
-\fBddi_dma_sync\fR	Solaris DDI
-\fBddi_dma_unbind_handle\fR	Solaris DDI
-\fBddi_dmae\fR	Solaris x86 DDI
-\fBddi_dmae_1stparty\fR	Solaris x86 DDI
-\fBddi_dmae_alloc\fR	Solaris x86 DDI
-\fBddi_dmae_disable\fR	Solaris x86 DDI
-\fBddi_dmae_enable\fR	Solaris x86 DDI
-\fBddi_dmae_getattr\fR	Solaris x86 DDI
-\fBddi_dmae_getcnt\fR	Solaris x86 DDI
-\fBddi_dmae_getlim\fR	Solaris x86 DDI
-\fBddi_dmae_prog\fR	Solaris x86 DDI
-\fBddi_dmae_release\fR	Solaris x86 DDI
-\fBddi_dmae_stop\fR	Solaris x86 DDI
-\fBddi_driver_major\fR	Solaris DDI
-\fBddi_driver_name\fR	Solaris DDI
-\fBddi_enter_critical\fR	Solaris DDI
-\fBddi_exit_critical\fR	Solaris DDI
-\fBddi_ffs\fR	Solaris DDI
-\fBddi_fls\fR	Solaris DDI
-\fBddi_fm_acc_err_clear\fR	Solaris DDI
-\fBddi_fm_acc_err_get\fR	Solaris DDI
-\fBddi_fm_ereport_post\fR	Solaris DDI
-\fBddi_fm_handler_register\fR	Solaris DDI
-\fBddi_fm_init\fR	Solaris DDI
-\fBddi_fm_service_impact\fR	Solaris DDI
-\fBddi_get16\fR	Solaris DDI
-\fBddi_get32\fR	Solaris DDI
-\fBddi_get64\fR	Solaris DDI
-\fBddi_get8\fR	Solaris DDI
-\fBddi_get_cred\fR	Solaris DDI
-\fBddi_get_devstate\fR	Solaris DDI
-\fBddi_get_driver_private\fR	Solaris DDI
-\fBddi_get_eventcookie\fR	Solaris DDI
-\fBddi_get_iblock_cookie\fR	Solaris DDI
-\fBddi_get_iminor\fR	Solaris DDI
-\fBddi_get_instance\fR	Solaris DDI
-\fBddi_get_kt_did\fR	Solaris DDI
-\fBddi_get_lbolt\fR	Solaris DDI
-\fBddi_get_name\fR	Solaris DDI
-\fBddi_get_parent\fR	Solaris DDI
-\fBddi_get_pid\fR	Solaris DDI
-\fBddi_get_soft_iblock_cookie\fR	Solaris DDI
-\fBddi_get_soft_state\fR	Solaris DDI
-\fBddi_getb\fR	Solaris DDI
-\fBddi_getl\fR	Solaris DDI
-\fBddi_getll\fR	Solaris DDI
-\fBddi_getlongprop\fR	Solaris DDI
-\fBddi_getlongprop_buf\fR	Solaris DDI
-\fBddi_getprop\fR	Solaris DDI
-\fBddi_getproplen\fR	Solaris DDI
-\fBddi_getw\fR	Solaris DDI
-\fBddi_intr_add_handler\fR	Solaris DDI
-\fBddi_intr_add_softint\fR	Solaris DDI
-\fBddi_intr_alloc\fR	Solaris DDI
-\fBddi_intr_block_disable\fR	Solaris DDI
-\fBddi_intr_block_enable\fR	Solaris DDI
-\fBddi_intr_clr_mask\fR	Solaris DDI
-\fBddi_intr_dup_handler\fR	Solaris DDI
-\fBddi_intr_disable\fR	Solaris DDI
-\fBddi_intr_enable\fR	Solaris DDI
-\fBddi_intr_free\fR	Solaris DDI
-\fBddi_intr_get_cap\fR	Solaris DDI
-\fBddi_intr_get_hilevel_pri\fR	Solaris DDI
-\fBddi_intr_get_navail\fR	Solaris DDI
-\fBddi_intr_get_nintrs\fR	Solaris DDI
-\fBddi_intr_get_pending\fR	Solaris DDI
-\fBddi_intr_get_pri\fR	Solaris DDI
-\fBddi_intr_get_softint_pri\fR	Solaris DDI
-\fBddi_intr_get_supported_types\fR	Solaris DDI
-\fBddi_intr_remove_handler\fR	Solaris DDI
-\fBddi_intr_remove_softint\fR	Solaris DDI
-\fBddi_intr_set_cap\fR	Solaris DDI
-\fBddi_intr_set_mask\fR	Solaris DDI
-\fBddi_intr_set_pri\fR	Solaris DDI
-\fBddi_intr_set_softint_pri\fR	Solaris DDI
-\fBddi_intr_trigger_softint\fR	Solaris DDI
-\fBddi_io_get16\fR	Solaris DDI
-\fBddi_io_get32\fR	Solaris DDI
-\fBddi_io_get8\fR	Solaris DDI
-\fBddi_io_getb\fR	Solaris DDI
-\fBddi_io_getl\fR	Solaris DDI
-\fBddi_io_getw\fR	Solaris DDI
-\fBddi_io_put16\fR	Solaris DDI
-\fBddi_io_put32\fR	Solaris DDI
-\fBddi_io_put8\fR	Solaris DDI
-\fBddi_io_putb\fR	Solaris DDI
-\fBddi_io_putl\fR	Solaris DDI
-\fBddi_io_putw\fR	Solaris DDI
-\fBddi_io_rep_get16\fR	Solaris DDI
-\fBddi_io_rep_get32\fR	Solaris DDI
-\fBddi_io_rep_get8\fR	Solaris DDI
-\fBddi_io_rep_getb\fR	Solaris DDI
-\fBddi_io_rep_getl\fR	Solaris DDI
-\fBddi_io_rep_getw\fR	Solaris DDI
-\fBddi_io_rep_put16\fR	Solaris DDI
-\fBddi_io_rep_put32\fR	Solaris DDI
-\fBddi_io_rep_put8\fR	Solaris DDI
-\fBddi_io_rep_putb\fR	Solaris DDI
-\fBddi_io_rep_putl\fR	Solaris DDI
-\fBddi_io_rep_putw\fR	Solaris DDI
-\fBddi_iomin\fR	Solaris DDI
-\fBddi_log_sysevent\fR	Solaris DDI
-\fBddi_map_regs\fR	Solaris DDI
-\fBddi_mapdev\fR	Solaris DDI
-\fBddi_mapdev_intercept\fR	Solaris DDI
-\fBddi_mapdev_nointercept\fR	Solaris DDI
-\fBddi_mapdev_set_device_acc_attr\fR	Solaris DDI
-\fBddi_mem_get16\fR	Solaris DDI
-\fBddi_mem_get32\fR	Solaris DDI
-\fBddi_mem_get64\fR	Solaris DDI
-\fBddi_mem_get8\fR	Solaris DDI
-\fBddi_mem_getb\fR	Solaris DDI
-\fBddi_mem_getl\fR	Solaris DDI
-\fBddi_mem_getll\fR	Solaris DDI
-\fBddi_mem_getw\fR	Solaris DDI
-\fBddi_mem_put16\fR	Solaris DDI
-\fBddi_mem_put32\fR	Solaris DDI
-\fBddi_mem_put64\fR	Solaris DDI
-\fBddi_mem_put8\fR	Solaris DDI
-\fBddi_mem_putb\fR	Solaris DDI
-\fBddi_mem_putl\fR	Solaris DDI
-\fBddi_mem_putll\fR	Solaris DDI
-\fBddi_mem_putw\fR	Solaris DDI
-\fBddi_mem_rep_get16\fR	Solaris DDI
-\fBddi_mem_rep_get32\fR	Solaris DDI
-\fBddi_mem_rep_get64\fR	Solaris DDI
-\fBddi_mem_rep_get8\fR	Solaris DDI
-\fBddi_mem_rep_getb\fR	Solaris DDI
-\fBddi_mem_rep_getl\fR	Solaris DDI
-\fBddi_mem_rep_getll\fR	Solaris DDI
-\fBddi_mem_rep_getw\fR	Solaris DDI
-\fBddi_mem_rep_put16\fR	Solaris DDI
-\fBddi_mem_rep_put32\fR	Solaris DDI
-\fBddi_mem_rep_put64\fR	Solaris DDI
-\fBddi_mem_rep_put8\fR	Solaris DDI
-\fBddi_mem_rep_putb\fR	Solaris DDI
-\fBddi_mem_rep_putl\fR	Solaris DDI
-\fBddi_mem_rep_putll\fR	Solaris DDI
-\fBddi_mem_rep_putw\fR	Solaris DDI
-\fBddi_mmap_get_model\fR	Solaris DDI
-\fBddi_model_convert_from\fR	Solaris DDI
-\fBddi_modopen\fR	Solaris DDI
-\fBddi_no_info\fR	Solaris DDI
-\fBddi_node_name\fR	Solaris DDI
-\fBddi_peek16\fR	Solaris DDI
-\fBddi_peek32\fR	Solaris DDI
-\fBddi_peek64\fR	Solaris DDI
-\fBddi_peek8\fR	Solaris DDI
-\fBddi_peekc\fR	Solaris DDI
-\fBddi_peekd\fR	Solaris DDI
-\fBddi_peekl\fR	Solaris DDI
-\fBddi_peeks\fR	Solaris DDI
-\fBddi_periodic_add\fR	Solaris DDI
-\fBddi_periodic_delete\fR	Solaris DDI
-\fBddi_poke16\fR	Solaris DDI
-\fBddi_poke32\fR	Solaris DDI
-\fBddi_poke64\fR	Solaris DDI
-\fBddi_poke8\fR	Solaris DDI
-\fBddi_pokec\fR	Solaris DDI
-\fBddi_poked\fR	Solaris DDI
-\fBddi_pokel\fR	Solaris DDI
-\fBddi_pokes\fR	Solaris DDI
-\fBddi_prop_create\fR	Solaris DDI
-\fBddi_prop_exists\fR	Solaris DDI
-\fBddi_prop_free\fR	Solaris DDI
-\fBddi_prop_get_int\fR	Solaris DDI
-\fBddi_prop_lookup\fR	Solaris DDI
-\fBddi_prop_lookup_byte_array\fR	Solaris DDI
-\fBddi_prop_lookup_int_array\fR	Solaris DDI
-\fBddi_prop_lookup_string\fR	Solaris DDI
-\fBddi_prop_lookup_string_array\fR	Solaris DDI
-\fBddi_prop_modify\fR	Solaris DDI
-\fBddi_prop_op\fR	Solaris DDI
-\fBddi_prop_remove\fR	Solaris DDI
-\fBddi_prop_remove_all\fR	Solaris DDI
-\fBddi_prop_undefine\fR	Solaris DDI
-\fBddi_prop_update\fR	Solaris DDI
-\fBddi_prop_update_byte_array\fR	Solaris DDI
-\fBddi_prop_update_int\fR	Solaris DDI
-\fBddi_prop_update_int_array\fR	Solaris DDI
-\fBddi_prop_update_string\fR	Solaris DDI
-\fBddi_prop_update_string_array\fR	Solaris DDI
-\fBddi_ptob\fR	Solaris DDI
-\fBddi_put16\fR	Solaris DDI
-\fBddi_put32\fR	Solaris DDI
-\fBddi_put64\fR	Solaris DDI
-\fBddi_put8\fR	Solaris DDI
-\fBddi_putb\fR	Solaris DDI
-\fBddi_putl\fR	Solaris DDI
-\fBddi_putll\fR	Solaris DDI
-\fBddi_putw\fR	Solaris DDI
-\fBddi_regs_map_free\fR	Solaris DDI
-\fBddi_regs_map_setup\fR	Solaris DDI
-\fBddi_remove_event_handler\fR	Solaris DDI
-\fBddi_remove_intr\fR	Solaris DDI
-\fBddi_remove_minor_node\fR	Solaris DDI
-\fBddi_remove_softintr\fR	Solaris DDI
-\fBddi_removing_power\fR	Solaris DDI
-\fBddi_rep_get16\fR	Solaris DDI
-\fBddi_rep_get32\fR	Solaris DDI
-\fBddi_rep_get64\fR	Solaris DDI
-\fBddi_rep_get8\fR	Solaris DDI
-\fBddi_rep_getb\fR	Solaris DDI
-\fBddi_rep_getl\fR	Solaris DDI
-\fBddi_rep_getll\fR	Solaris DDI
-\fBddi_rep_getw\fR	Solaris DDI
-\fBddi_rep_put16\fR	Solaris DDI
-\fBddi_rep_put32\fR	Solaris DDI
-\fBddi_rep_put64\fR	Solaris DDI
-\fBddi_rep_put8\fR	Solaris DDI
-\fBddi_rep_putb\fR	Solaris DDI
-\fBddi_rep_putl\fR	Solaris DDI
-\fBddi_rep_putll\fR	Solaris DDI
-\fBddi_rep_putw\fR	Solaris DDI
-\fBddi_report_dev\fR	Solaris DDI
-\fBddi_root_node\fR	Solaris DDI
-\fBddi_segmap\fR	Solaris DDI
-\fBddi_segmap_setup\fR	Solaris DDI
-\fBddi_set_driver_private\fR	Solaris DDI
-\fBddi_slaveonly\fR	Solaris DDI
-\fBddi_soft_state\fR	Solaris DDI
-\fBddi_soft_state_fini\fR	Solaris DDI
-\fBddi_soft_state_free\fR	Solaris DDI
-\fBddi_soft_state_init\fR	Solaris DDI
-\fBddi_soft_state_zalloc\fR	Solaris DDI
-\fBddi_strlol\fR	Solaris DDI
-\fBddi_strloul\fR	Solaris DDI
-\fBddi_trigger_softintr\fR	Solaris DDI
-\fBddi_umem_alloc\fR	Solaris DDI
-\fBddi_umem_free\fR	Solaris DDI
-\fBddi_umem_iosetup\fR	Solaris DDI
-\fBddi_umem_lock\fR	Solaris DDI
-\fBddi_unmap_regs\fR	Solaris DDI
-\fBdelay\fR	DDI/DKI
-\fBdevmap_default_access\fR	Solaris DDI
-\fBdevmap_devmem_setup\fR	Solaris DDI
-\fBdevmap_do_ctxmgt\fR	Solaris DDI
-\fBdevmap_load\fR	Solaris DDI
-\fBdevmap_set_ctx_timeout\fR	Solaris DDI
-\fBdevmap_setup\fR	Solaris DDI
-\fBdevmap_umem_setup\fR	Solaris DDI
-\fBdevmap_unload\fR	Solaris DDI
-\fBdisksort\fR	Solaris DDI
-\fBdlbindack\fR	Solaris DDI
-\fBdrv_getparm\fR	DDI/DKI
-\fBdrv_hztousec\fR	DDI/DKI
-\fBdrv_priv\fR	DDI/DKI
-\fBdrv_usectohz\fR	DDI/DKI
-\fBdrv_usecwait\fR	DDI/DKI
-\fBfree_pktiopb\fR	Solaris DDI
-\fBfreerbuf\fR	DDI/DKI
-\fBget_pktiopb\fR	Solaris DDI
-\fBgeterror\fR	DDI/DKI
-\fBgethrtime\fR	DDI/DKI
-\fBgetmajor\fR	DDI/DKI
-\fBgetminor\fR	DDI/DKI
-\fBgetrbuf\fR	DDI/DKI
-\fBgld\fR	Solaris DDI
-\fBhat_getkpfnum\fR	DKI only
-\fBid32_alloc\fR	Solaris DDI
-\fBinb\fR	Solaris x86 DDI
-\fBinl\fR	Solaris x86 DDI
-\fBinw\fR	Solaris x86 DDI
-\fBkiconv\fR	Solaris DDI
-\fBkiconv_close\fR	Solaris DDI
-\fBkiconv_open\fR	Solaris DDI
-\fBkiconvstr\fR	Solaris DDI
-\fBkmem_alloc\fR	DDI/DKI
-\fBkmem_cache_create\fR	Solaris DDI
-\fBkmem_free\fR	DDI/DKI
-\fBkmem_zalloc\fR	DDI/DKI
-\fBkstat_create\fR	Solaris DDI
-\fBkstat_delete\fR	Solaris DDI
-\fBkstat_install\fR	Solaris DDI
-\fBkstat_named_init\fR	Solaris DDI
-\fBkstat_queue\fR	Solaris DDI
-\fBkstat_runq_back_to_waitq\fR	Solaris DDI
-\fBkstat_runq_enter\fR	Solaris DDI
-\fBkstat_runq_exit\fR	Solaris DDI
-\fBkstat_waitq_enter\fR	Solaris DDI
-\fBkstat_waitq_exit\fR	Solaris DDI
-\fBkstat_waitq_to_runq\fR	Solaris DDI
-\fBldi_add_event_handler\fR	Solaris DDI
-\fBldi_aread\fR	Solaris DDI
-\fBldi_devmap\fR	Solaris DDI
-\fBldi_dump\fR	Solaris DDI
-\fBldi_ev_finalize\fR	Solaris DDI
-\fBldi_ev_get_cookie\fR	Solaris DDI
-\fBldi_ev_get_type\fR	Solaris DDI
-\fBldi_ev_notify\fR	Solaris DDI
-\fBldi_ev_register_callbacks\fR	Solaris DDI
-\fBldi_ev_remove_callbacks\fR	Solaris DDI
-\fBldi_get_dev\fR	Solaris DDI
-\fBldi_get_eventcookie\fR	Solaris DDI
-\fBldi_get_size\fR	Solaris DDI
-\fBldi_ident_from_dev\fR	Solaris DDI
-\fBldi_ioctl\fR	Solaris DDI
-\fBldi_open_by_dev\fR	Solaris DDI
-\fBldi_poll\fR	Solaris DDI
-\fBldi_prop_exists\fR	Solaris DDI
-\fBldi_prop_get_int\fR	Solaris DDI
-\fBldi_prop_get_lookup_int_array\fR	Solaris DDI
-\fBldi_putmsg\fR	Solaris DDI
-\fBldi_read\fR	Solaris DDI
-\fBldi_remove_event_handler\fR	Solaris DDI
-\fBldi_strategy\fR	Solaris DDI
-\fBmakecom_g0\fR	Solaris DDI
-\fBmakecom_g0_s\fR	Solaris DDI
-\fBmakecom_g1\fR	Solaris DDI
-\fBmakecom_g5\fR	Solaris DDI
-\fBmakedevice\fR	DDI/DKI
-\fBmax\fR	DDI/DKI
-\fBmax\fR	DDI/DKI
-\fBmembar_ops\fR	Solaris DDI
-\fBmemchr\fR	Solaris DDI
-\fBminphys\fR	Solaris DDI
-\fBmod_info\fR	Solaris DDI
-\fBmod_install\fR	Solaris DDI
-\fBmod_remove\fR	Solaris DDI
-\fBmutex_destroy\fR	Solaris DDI
-\fBmutex_enter\fR	Solaris DDI
-\fBmutex_exit\fR	Solaris DDI
-\fBmutex_init\fR	Solaris DDI
-\fBmutex_owned\fR	Solaris DDI
-\fBmutex_tryenter\fR	Solaris DDI
-\fBnochpoll\fR	Solaris DDI
-\fBnodev\fR	DDI/DKI
-\fBnulldev\fR	DDI/DKI
-\fBnumtos\fR	Solaris DDI
-\fBnvlist_add_boolean\fR	Solaris DDI
-\fBnvlist_alloc\fR	Solaris DDI
-\fBnvlist_lookup_boolean\fR	Solaris DDI
-\fBnvlist_lookup_nvpair\fR	Solaris DDI
-\fBnvlist_next_nvpair\fR	Solaris DDI
-\fBnvlist_remove\fR	Solaris DDI
-\fBnvlist_value_byte\fR	Solaris DDI
-\fBoutb\fR	Solaris x86 DDI
-\fBoutl\fR	Solaris x86 DDI
-\fBoutw\fR	Solaris x86 DDI
-\fBpci_config_get16\fR	Solaris DDI
-\fBpci_config_get32\fR	Solaris DDI
-\fBpci_config_get64\fR	Solaris DDI
-\fBpci_config_get8\fR	Solaris DDI
-\fBpci_config_getb\fR	Solaris DDI
-\fBpci_config_getl\fR	Solaris DDI
-\fBpci_config_getw\fR	Solaris DDI
-\fBpci_config_put16\fR	Solaris DDI
-\fBpci_config_put32\fR	Solaris DDI
-\fBpci_config_put64\fR	Solaris DDI
-\fBpci_config_put8\fR	Solaris DDI
-\fBpci_config_putb\fR	Solaris DDI
-\fBpci_config_putl\fR	Solaris DDI
-\fBpci_config_putw\fR	Solaris DDI
-\fBpci_config_setup\fR	Solaris DDI
-\fBpci_config_teardown\fR	Solaris DDI
-\fBpci_ereport_setup\fR	Solaris DDI
-\fBpci_report_pmcap\fR	Solaris DDI
-\fBpci_save_config_regs\fR	Solaris DDI
-\fBphysio\fR	Solaris DDI
-\fBpm_busy_component\fR	Solaris DDI
-\fBpm_power_has_changed\fR	Solaris DDI
-\fBpm_raise_power\fR	Solaris DDI
-\fBpm_trans_check\fR	Solaris DDI
-\fBpollwakeup\fR	DDI/DKI
-\fBpci_config_teardown\fR	Solaris DDI
-\fBpci_config_teardown\fR	Solaris DDI
-\fBpriv_getbyname\fR	Solaris DDI
-\fBpriv_policy\fR	Solaris DDI
-\fBproc_signal\fR	Solaris DDI
-\fBproc_unref\fR	Solaris DDI
-\fBptob\fR	DDI/DKI
-\fBrepinsb\fR	Solaris x86 DDI
-\fBrepinsd\fR	Solaris x86 DDI
-\fBrepinsw\fR	Solaris x86 DDI
-\fBrepoutsb\fR	Solaris x86 DDI
-\fBrepoutsd\fR	Solaris x86 DDI
-\fBrepoutsw\fR	Solaris x86 DDI
-\fBrmalloc\fR	DDI/DKI
-\fBrmalloc_wait\fR	DDI/DKI
-\fBrmallocmap\fR	DDI/DKI
-\fBrmallocmap_wait\fR	DDI/DKI
-\fBrmfree\fR	DDI/DKI
-\fBrmfreemap\fR	DDI/DKI
-\fBrw_destroy\fR	Solaris DDI
-\fBrw_downgrade\fR	Solaris DDI
-\fBrw_enter\fR	Solaris DDI
-\fBrw_exit\fR	Solaris DDI
-\fBrw_init\fR	Solaris DDI
-\fBrw_read_locked\fR	Solaris DDI
-\fBrw_tryenter\fR	Solaris DDI
-\fBrw_tryupgrade\fR	Solaris DDI
-\fBscsi_abort\fR	Solaris DDI
-\fBscsi_alloc_consistent_buf\fR	Solaris DDI
-\fBscsi_cname\fR	Solaris DDI
-\fBscsi_destroy_pkt\fR	Solaris DDI
-\fBscsi_dmafree\fR	Solaris DDI
-\fBscsi_dmaget\fR	Solaris DDI
-\fBscsi_dname\fR	Solaris DDI
-\fBscsi_errmsg\fR	Solaris DDI
-\fBscsi_ext_sense_fields\fR	Solaris DDI
-\fBscsi_find_sense_descr\fR	Solaris DDI
-\fBscsi_free_consistent_buf\fR	Solaris DDI
-\fBscsi_get_device_type_scsi_options\fR	Solaris DDI
-\fBscsi_get_device_type_string\fR	Solaris DDI
-\fBscsi_hba_attach_setup\fR	Solaris DDI
-\fBscsi_hba_detach\fR	Solaris DDI
-\fBscsi_hba_fini\fR	Solaris DDI
-\fBscsi_hba_init\fR	Solaris DDI
-\fBscsi_hba_lookup_capstr\fR	Solaris DDI
-\fBscsi_hba_pkt_alloc\fR	Solaris DDI
-\fBscsi_hba_pkt_free\fR	Solaris DDI
-\fBscsi_hba_probe\fR	Solaris DDI
-\fBscsi_hba_tran_alloc\fR	Solaris DDI
-\fBscsi_hba_tran_free\fR	Solaris DDI
-\fBscsi_ifgetcap\fR	Solaris DDI
-\fBscsi_ifsetcap\fR	Solaris DDI
-\fBscsi_init_pkt\fR	Solaris DDI
-\fBscsi_log\fR	Solaris DDI
-\fBscsi_mname\fR	Solaris DDI
-\fBscsi_pktalloc\fR	Solaris DDI
-\fBscsi_pktfree\fR	Solaris DDI
-\fBscsi_poll\fR	Solaris DDI
-\fBscsi_probe\fR	Solaris DDI
-\fBscsi_resalloc\fR	Solaris DDI
-\fBscsi_reset\fR	Solaris DDI
-\fBscsi_reset_notify\fR	Solaris DDI
-\fBscsi_resfree\fR	Solaris DDI
-\fBscsi_rname\fR	Solaris DDI
-\fBscsi_sense_key\fR	Solaris DDI
-\fBscsi_setup_cdb\fR	Solaris DDI
-\fBscsi_slave\fR	Solaris DDI
-\fBscsi_sname\fR	Solaris DDI
-\fBscsi_sync_pkt\fR	Solaris DDI
-\fBscsi_transport\fR	Solaris DDI
-\fBscsi_unprobe\fR	Solaris DDI
-\fBscsi_unslave\fR	Solaris DDI
-\fBscsi_validate_sense\fR	Solaris DDI
-\fBscsi_vu_errmsg\fR	Solaris DDI
-\fBsema_destroy\fR	Solaris DDI
-\fBsema_init\fR	Solaris DDI
-\fBsema_p\fR	Solaris DDI
-\fBsema_p_sig\fR	Solaris DDI
-\fBsema_tryp\fR	Solaris DDI
-\fBsema_v\fR	Solaris DDI
-\fBsprintf\fR	Solaris DDI
-\fBstoi\fR	Solaris DDI
-\fBstrchr\fR	Solaris DDI
-\fBstrcmp\fR	Solaris DDI
-\fBstrcpy\fR	Solaris DDI
-\fBstrlen\fR	Solaris DDI
-\fBstrncmp\fR	Solaris DDI
-\fBstrncpy\fR	Solaris DDI
-\fBSTRUCT_DECL\fR	Solaris DDI
-\fBswab\fR	DDI/DKI
-\fBtaskq\fR	Solaris DDI
-\fBtimeout\fR	DDI/DKI
-\fBu8_strcmp\fR	Solaris DDI
-\fBu8_textprep_str\fR	Solaris DDI
-\fBu8_validate\fR	Solaris DDI
-\fBuconv_u16tou32\fR	Solaris DDI
-\fBuiomove\fR	DDI/DKI
-\fBuntimeout\fR	DDI/DKI
-\fBureadc\fR	DDI/DKI
-\fBusb_alloc_request\fR	Solaris DDI
-\fBusb_client_attach\fR	Solaris DDI
-\fBusb_clr_feature\fR	Solaris DDI
-\fBusb_create_pm_components\fR	Solaris DDI
-\fBusb_get_addr\fR	Solaris DDI
-\fBusb_get_alt_if\fR	Solaris DDI
-\fBusb_get_cfg\fR	Solaris DDI
-\fBusb_get_current_frame_number\fR	Solaris DDI
-\fBusb_get_dev_data\fR	Solaris DDI
-\fBusb_get_max_pkts_per_ioc_request\fR	Solaris DDI
-\fBusb_get_status\fR	Solaris DDI
-\fBusb_get_string_desc\fR	Solaris DDI
-\fBusb_handle_remote_wakeup\fR	Solaris DDI
-\fBusb_lookup_ep_data\fR	Solaris DDI
-\fBusb_parse_data\fR	Solaris DDI
-\fBusb_pipe_bulk_xfer\fR	Solaris DDI
-\fBusb_pipe_close\fR	Solaris DDI
-\fBusb_pipe_ctrl_xfer\fR	Solaris DDI
-\fBusb_pipe_drain_reqs\fR	Solaris DDI
-\fBusb_pipe_get_max_bulk_transfer_size\fR	Solaris DDI
-\fBusb_pipe_get_state\fR	Solaris DDI
-\fBusb_pipe_intr_xfer\fR	Solaris DDI
-\fBusb_pipe_isoc_xfer\fR	Solaris DDI
-\fBusb_pipe_open\fR	Solaris DDI
-\fBusb_pipe_reset\fR	Solaris DDI
-\fBusb_pipe_set_private\fR	Solaris DDI
-\fBusb_register_hotplug_cbs\fR	Solaris DDI
-\fBusb_reset_device\fR	Solaris DDI
-\fBuwritec\fR	DDI/DKI
-\fBva_arg\fR	Solaris DDI
-\fBva_end\fR	Solaris DDI
-\fBva_start\fR	Solaris DDI
-\fBvcmn_err\fR	DDI/DKI
-\fBvsprintf\fR	Solaris DDI
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBIntro\fR(9E), \fBmutex\fR(9F)
+.Bl -column usb_pipe_get_max_bulk_transfer_size
+.It Sy Routine	Sy Type
+.It Sy ASSERT	DDI/DKI
+.It Sy anocancel	Solaris DDI
+.It Sy aphysio	Solaris DDI
+.It Sy atomic_add	DDI/DKI
+.It Sy atomic_and	DDI/DKI
+.It Sy atomic_bits	DDI/DKI
+.It Sy atomic_cas	DDI/DKI
+.It Sy atomic_dec	DDI/DKI
+.It Sy atomic_inc	DDI/DKI
+.It Sy atomic_ops	DDI/DKI
+.It Sy atomic_or	DDI/DKI
+.It Sy atomic_swap	DDI/DKI
+.It Sy bcmp	DDI/DKI
+.It Sy bcopy	DDI/DKI
+.It Sy bioclone	Solaris DDI
+.It Sy biodone	DDI/DKI
+.It Sy biofini	Solaris DDI
+.It Sy bioinit	Solaris DDI
+.It Sy biomodified	Solaris DDI
+.It Sy biosize	Solaris DDI
+.It Sy bioerror	Solaris DDI
+.It Sy bioreset	Solaris DDI
+.It Sy biowait	DDI/DKI
+.It Sy bp_copyin	DDI/DKI
+.It Sy bp_copyout	DDI/DKI
+.It Sy bp_mapin	DDI/DKI
+.It Sy bp_mapout	DDI/DKI
+.It Sy btop	DDI/DKI
+.It Sy btopr	DDI/DKI
+.It Sy bzero	DDI/DKI
+.It Sy cmn_err	DDI/DKI
+.It Sy condvar	Solaris DDI
+.It Sy copyin	DDI/DKI
+.It Sy copyout	DDI/DKI
+.It Sy cv_broadcast	Solaris DDI
+.It Sy cv_destroy	Solaris DDI
+.It Sy cv_init	Solaris DDI
+.It Sy cv_signal	Solaris DDI
+.It Sy cv_timedwait	Solaris DDI
+.It Sy cv_wait	Solaris DDI
+.It Sy cv_wait_sig	Solaris DDI
+.It Sy ddi_add_event_handler	Solaris DDI
+.It Sy ddi_add_intr	Solaris DDI
+.It Sy ddi_add_softintr	Solaris DDI
+.It Sy ddi_binding_name	Solaris DDI
+.It Sy ddi_btop	Solaris DDI
+.It Sy ddi_btopr	Solaris DDI
+.It Sy ddi_can_receive_sig	Solaris DDI
+.It Sy ddi_check_acc_handle	Solaris DDI
+.It Sy ddi_copyin	Solaris DDI
+.It Sy ddi_copyout	Solaris DDI
+.It Sy ddi_create_minor_node	Solaris DDI
+.It Sy ddi_cred	Solaris DDI
+.It Sy ddi_dev_is_sid	Solaris DDI
+.It Sy ddi_dev_nintrs	Solaris DDI
+.It Sy ddi_dev_nregs	Solaris DDI
+.It Sy ddi_dev_regsize	Solaris DDI
+.It Sy ddi_device_copy	Solaris DDI
+.It Sy ddi_device_zero	Solaris DDI
+.It Sy ddi_devmap_segmap	Solaris DDI
+.It Sy ddi_dma_addr_bind_handle	Solaris DDI
+.It Sy ddi_dma_alloc_handle	Solaris DDI
+.It Sy ddi_dma_buf_bind_handle	Solaris DDI
+.It Sy ddi_dma_burstsizes	Solaris DDI
+.It Sy ddi_dma_free_handle	Solaris DDI
+.It Sy ddi_dma_getwin	Solaris DDI
+.It Sy ddi_dma_mem_alloc	Solaris DDI
+.It Sy ddi_dma_mem_free	Solaris DDI
+.It Sy ddi_dma_nextcookie	Solaris DDI
+.It Sy ddi_dma_numwin	Solaris DDI
+.It Sy ddi_dma_set_sbus64	Solaris DDI
+.It Sy ddi_dma_sync	Solaris DDI
+.It Sy ddi_dma_unbind_handle	Solaris DDI
+.It Sy ddi_dmae	Solaris x86 DDI
+.It Sy ddi_dmae_1stparty	Solaris x86 DDI
+.It Sy ddi_dmae_alloc	Solaris x86 DDI
+.It Sy ddi_dmae_disable	Solaris x86 DDI
+.It Sy ddi_dmae_enable	Solaris x86 DDI
+.It Sy ddi_dmae_getattr	Solaris x86 DDI
+.It Sy ddi_dmae_getcnt	Solaris x86 DDI
+.It Sy ddi_dmae_getlim	Solaris x86 DDI
+.It Sy ddi_dmae_prog	Solaris x86 DDI
+.It Sy ddi_dmae_release	Solaris x86 DDI
+.It Sy ddi_dmae_stop	Solaris x86 DDI
+.It Sy ddi_driver_major	Solaris DDI
+.It Sy ddi_driver_name	Solaris DDI
+.It Sy ddi_enter_critical	Solaris DDI
+.It Sy ddi_exit_critical	Solaris DDI
+.It Sy ddi_ffs	Solaris DDI
+.It Sy ddi_fls	Solaris DDI
+.It Sy ddi_fm_acc_err_clear	Solaris DDI
+.It Sy ddi_fm_acc_err_get	Solaris DDI
+.It Sy ddi_fm_ereport_post	Solaris DDI
+.It Sy ddi_fm_handler_register	Solaris DDI
+.It Sy ddi_fm_init	Solaris DDI
+.It Sy ddi_fm_service_impact	Solaris DDI
+.It Sy ddi_get16	Solaris DDI
+.It Sy ddi_get32	Solaris DDI
+.It Sy ddi_get64	Solaris DDI
+.It Sy ddi_get8	Solaris DDI
+.It Sy ddi_get_cred	Solaris DDI
+.It Sy ddi_get_devstate	Solaris DDI
+.It Sy ddi_get_driver_private	Solaris DDI
+.It Sy ddi_get_eventcookie	Solaris DDI
+.It Sy ddi_get_iblock_cookie	Solaris DDI
+.It Sy ddi_get_iminor	Solaris DDI
+.It Sy ddi_get_instance	Solaris DDI
+.It Sy ddi_get_kt_did	Solaris DDI
+.It Sy ddi_get_lbolt	Solaris DDI
+.It Sy ddi_get_name	Solaris DDI
+.It Sy ddi_get_parent	Solaris DDI
+.It Sy ddi_get_pid	Solaris DDI
+.It Sy ddi_get_soft_iblock_cookie	Solaris DDI
+.It Sy ddi_get_soft_state	Solaris DDI
+.It Sy ddi_getb	Solaris DDI
+.It Sy ddi_getl	Solaris DDI
+.It Sy ddi_getll	Solaris DDI
+.It Sy ddi_getlongprop	Solaris DDI
+.It Sy ddi_getlongprop_buf	Solaris DDI
+.It Sy ddi_getprop	Solaris DDI
+.It Sy ddi_getproplen	Solaris DDI
+.It Sy ddi_getw	Solaris DDI
+.It Sy ddi_intr_add_handler	Solaris DDI
+.It Sy ddi_intr_add_softint	Solaris DDI
+.It Sy ddi_intr_alloc	Solaris DDI
+.It Sy ddi_intr_block_disable	Solaris DDI
+.It Sy ddi_intr_block_enable	Solaris DDI
+.It Sy ddi_intr_clr_mask	Solaris DDI
+.It Sy ddi_intr_dup_handler	Solaris DDI
+.It Sy ddi_intr_disable	Solaris DDI
+.It Sy ddi_intr_enable	Solaris DDI
+.It Sy ddi_intr_free	Solaris DDI
+.It Sy ddi_intr_get_cap	Solaris DDI
+.It Sy ddi_intr_get_hilevel_pri	Solaris DDI
+.It Sy ddi_intr_get_navail	Solaris DDI
+.It Sy ddi_intr_get_nintrs	Solaris DDI
+.It Sy ddi_intr_get_pending	Solaris DDI
+.It Sy ddi_intr_get_pri	Solaris DDI
+.It Sy ddi_intr_get_softint_pri	Solaris DDI
+.It Sy ddi_intr_get_supported_types	Solaris DDI
+.It Sy ddi_intr_remove_handler	Solaris DDI
+.It Sy ddi_intr_remove_softint	Solaris DDI
+.It Sy ddi_intr_set_cap	Solaris DDI
+.It Sy ddi_intr_set_mask	Solaris DDI
+.It Sy ddi_intr_set_pri	Solaris DDI
+.It Sy ddi_intr_set_softint_pri	Solaris DDI
+.It Sy ddi_intr_trigger_softint	Solaris DDI
+.It Sy ddi_io_get16	Solaris DDI
+.It Sy ddi_io_get32	Solaris DDI
+.It Sy ddi_io_get8	Solaris DDI
+.It Sy ddi_io_getb	Solaris DDI
+.It Sy ddi_io_getl	Solaris DDI
+.It Sy ddi_io_getw	Solaris DDI
+.It Sy ddi_io_put16	Solaris DDI
+.It Sy ddi_io_put32	Solaris DDI
+.It Sy ddi_io_put8	Solaris DDI
+.It Sy ddi_io_putb	Solaris DDI
+.It Sy ddi_io_putl	Solaris DDI
+.It Sy ddi_io_putw	Solaris DDI
+.It Sy ddi_io_rep_get16	Solaris DDI
+.It Sy ddi_io_rep_get32	Solaris DDI
+.It Sy ddi_io_rep_get8	Solaris DDI
+.It Sy ddi_io_rep_getb	Solaris DDI
+.It Sy ddi_io_rep_getl	Solaris DDI
+.It Sy ddi_io_rep_getw	Solaris DDI
+.It Sy ddi_io_rep_put16	Solaris DDI
+.It Sy ddi_io_rep_put32	Solaris DDI
+.It Sy ddi_io_rep_put8	Solaris DDI
+.It Sy ddi_io_rep_putb	Solaris DDI
+.It Sy ddi_io_rep_putl	Solaris DDI
+.It Sy ddi_io_rep_putw	Solaris DDI
+.It Sy ddi_iomin	Solaris DDI
+.It Sy ddi_log_sysevent	Solaris DDI
+.It Sy ddi_map_regs	Solaris DDI
+.It Sy ddi_mapdev	Solaris DDI
+.It Sy ddi_mapdev_intercept	Solaris DDI
+.It Sy ddi_mapdev_nointercept	Solaris DDI
+.It Sy ddi_mapdev_set_device_acc_attr	Solaris DDI
+.It Sy ddi_mem_get16	Solaris DDI
+.It Sy ddi_mem_get32	Solaris DDI
+.It Sy ddi_mem_get64	Solaris DDI
+.It Sy ddi_mem_get8	Solaris DDI
+.It Sy ddi_mem_getb	Solaris DDI
+.It Sy ddi_mem_getl	Solaris DDI
+.It Sy ddi_mem_getll	Solaris DDI
+.It Sy ddi_mem_getw	Solaris DDI
+.It Sy ddi_mem_put16	Solaris DDI
+.It Sy ddi_mem_put32	Solaris DDI
+.It Sy ddi_mem_put64	Solaris DDI
+.It Sy ddi_mem_put8	Solaris DDI
+.It Sy ddi_mem_putb	Solaris DDI
+.It Sy ddi_mem_putl	Solaris DDI
+.It Sy ddi_mem_putll	Solaris DDI
+.It Sy ddi_mem_putw	Solaris DDI
+.It Sy ddi_mem_rep_get16	Solaris DDI
+.It Sy ddi_mem_rep_get32	Solaris DDI
+.It Sy ddi_mem_rep_get64	Solaris DDI
+.It Sy ddi_mem_rep_get8	Solaris DDI
+.It Sy ddi_mem_rep_getb	Solaris DDI
+.It Sy ddi_mem_rep_getl	Solaris DDI
+.It Sy ddi_mem_rep_getll	Solaris DDI
+.It Sy ddi_mem_rep_getw	Solaris DDI
+.It Sy ddi_mem_rep_put16	Solaris DDI
+.It Sy ddi_mem_rep_put32	Solaris DDI
+.It Sy ddi_mem_rep_put64	Solaris DDI
+.It Sy ddi_mem_rep_put8	Solaris DDI
+.It Sy ddi_mem_rep_putb	Solaris DDI
+.It Sy ddi_mem_rep_putl	Solaris DDI
+.It Sy ddi_mem_rep_putll	Solaris DDI
+.It Sy ddi_mem_rep_putw	Solaris DDI
+.It Sy ddi_mmap_get_model	Solaris DDI
+.It Sy ddi_model_convert_from	Solaris DDI
+.It Sy ddi_modopen	Solaris DDI
+.It Sy ddi_no_info	Solaris DDI
+.It Sy ddi_node_name	Solaris DDI
+.It Sy ddi_peek16	Solaris DDI
+.It Sy ddi_peek32	Solaris DDI
+.It Sy ddi_peek64	Solaris DDI
+.It Sy ddi_peek8	Solaris DDI
+.It Sy ddi_peekc	Solaris DDI
+.It Sy ddi_peekd	Solaris DDI
+.It Sy ddi_peekl	Solaris DDI
+.It Sy ddi_peeks	Solaris DDI
+.It Sy ddi_periodic_add	Solaris DDI
+.It Sy ddi_periodic_delete	Solaris DDI
+.It Sy ddi_poke16	Solaris DDI
+.It Sy ddi_poke32	Solaris DDI
+.It Sy ddi_poke64	Solaris DDI
+.It Sy ddi_poke8	Solaris DDI
+.It Sy ddi_pokec	Solaris DDI
+.It Sy ddi_poked	Solaris DDI
+.It Sy ddi_pokel	Solaris DDI
+.It Sy ddi_pokes	Solaris DDI
+.It Sy ddi_prop_create	Solaris DDI
+.It Sy ddi_prop_exists	Solaris DDI
+.It Sy ddi_prop_free	Solaris DDI
+.It Sy ddi_prop_get_int	Solaris DDI
+.It Sy ddi_prop_lookup	Solaris DDI
+.It Sy ddi_prop_lookup_byte_array	Solaris DDI
+.It Sy ddi_prop_lookup_int_array	Solaris DDI
+.It Sy ddi_prop_lookup_string	Solaris DDI
+.It Sy ddi_prop_lookup_string_array	Solaris DDI
+.It Sy ddi_prop_modify	Solaris DDI
+.It Sy ddi_prop_op	Solaris DDI
+.It Sy ddi_prop_remove	Solaris DDI
+.It Sy ddi_prop_remove_all	Solaris DDI
+.It Sy ddi_prop_undefine	Solaris DDI
+.It Sy ddi_prop_update	Solaris DDI
+.It Sy ddi_prop_update_byte_array	Solaris DDI
+.It Sy ddi_prop_update_int	Solaris DDI
+.It Sy ddi_prop_update_int_array	Solaris DDI
+.It Sy ddi_prop_update_string	Solaris DDI
+.It Sy ddi_prop_update_string_array	Solaris DDI
+.It Sy ddi_ptob	Solaris DDI
+.It Sy ddi_put16	Solaris DDI
+.It Sy ddi_put32	Solaris DDI
+.It Sy ddi_put64	Solaris DDI
+.It Sy ddi_put8	Solaris DDI
+.It Sy ddi_putb	Solaris DDI
+.It Sy ddi_putl	Solaris DDI
+.It Sy ddi_putll	Solaris DDI
+.It Sy ddi_putw	Solaris DDI
+.It Sy ddi_regs_map_free	Solaris DDI
+.It Sy ddi_regs_map_setup	Solaris DDI
+.It Sy ddi_remove_event_handler	Solaris DDI
+.It Sy ddi_remove_intr	Solaris DDI
+.It Sy ddi_remove_minor_node	Solaris DDI
+.It Sy ddi_remove_softintr	Solaris DDI
+.It Sy ddi_removing_power	Solaris DDI
+.It Sy ddi_rep_get16	Solaris DDI
+.It Sy ddi_rep_get32	Solaris DDI
+.It Sy ddi_rep_get64	Solaris DDI
+.It Sy ddi_rep_get8	Solaris DDI
+.It Sy ddi_rep_getb	Solaris DDI
+.It Sy ddi_rep_getl	Solaris DDI
+.It Sy ddi_rep_getll	Solaris DDI
+.It Sy ddi_rep_getw	Solaris DDI
+.It Sy ddi_rep_put16	Solaris DDI
+.It Sy ddi_rep_put32	Solaris DDI
+.It Sy ddi_rep_put64	Solaris DDI
+.It Sy ddi_rep_put8	Solaris DDI
+.It Sy ddi_rep_putb	Solaris DDI
+.It Sy ddi_rep_putl	Solaris DDI
+.It Sy ddi_rep_putll	Solaris DDI
+.It Sy ddi_rep_putw	Solaris DDI
+.It Sy ddi_report_dev	Solaris DDI
+.It Sy ddi_root_node	Solaris DDI
+.It Sy ddi_segmap	Solaris DDI
+.It Sy ddi_segmap_setup	Solaris DDI
+.It Sy ddi_set_driver_private	Solaris DDI
+.It Sy ddi_slaveonly	Solaris DDI
+.It Sy ddi_soft_state	Solaris DDI
+.It Sy ddi_soft_state_fini	Solaris DDI
+.It Sy ddi_soft_state_free	Solaris DDI
+.It Sy ddi_soft_state_init	Solaris DDI
+.It Sy ddi_soft_state_zalloc	Solaris DDI
+.It Sy ddi_strlol	Solaris DDI
+.It Sy ddi_strloul	Solaris DDI
+.It Sy ddi_trigger_softintr	Solaris DDI
+.It Sy ddi_umem_alloc	Solaris DDI
+.It Sy ddi_umem_free	Solaris DDI
+.It Sy ddi_umem_iosetup	Solaris DDI
+.It Sy ddi_umem_lock	Solaris DDI
+.It Sy ddi_unmap_regs	Solaris DDI
+.It Sy delay	DDI/DKI
+.It Sy devmap_default_access	Solaris DDI
+.It Sy devmap_devmem_setup	Solaris DDI
+.It Sy devmap_do_ctxmgt	Solaris DDI
+.It Sy devmap_load	Solaris DDI
+.It Sy devmap_set_ctx_timeout	Solaris DDI
+.It Sy devmap_setup	Solaris DDI
+.It Sy devmap_umem_setup	Solaris DDI
+.It Sy devmap_unload	Solaris DDI
+.It Sy disksort	Solaris DDI
+.It Sy dlbindack	Solaris DDI
+.It Sy drv_getparm	DDI/DKI
+.It Sy drv_hztousec	DDI/DKI
+.It Sy drv_priv	DDI/DKI
+.It Sy drv_usectohz	DDI/DKI
+.It Sy drv_usecwait	DDI/DKI
+.It Sy free_pktiopb	Solaris DDI
+.It Sy freerbuf	DDI/DKI
+.It Sy get_pktiopb	Solaris DDI
+.It Sy geterror	DDI/DKI
+.It Sy gethrtime	DDI/DKI
+.It Sy getmajor	DDI/DKI
+.It Sy getminor	DDI/DKI
+.It Sy getrbuf	DDI/DKI
+.It Sy gld	Solaris DDI
+.It Sy hat_getkpfnum	DKI only
+.It Sy id32_alloc	Solaris DDI
+.It Sy inb	Solaris x86 DDI
+.It Sy inl	Solaris x86 DDI
+.It Sy inw	Solaris x86 DDI
+.It Sy kiconv	Solaris DDI
+.It Sy kiconv_close	Solaris DDI
+.It Sy kiconv_open	Solaris DDI
+.It Sy kiconvstr	Solaris DDI
+.It Sy kmem_alloc	DDI/DKI
+.It Sy kmem_cache_create	Solaris DDI
+.It Sy kmem_free	DDI/DKI
+.It Sy kmem_zalloc	DDI/DKI
+.It Sy kstat_create	Solaris DDI
+.It Sy kstat_delete	Solaris DDI
+.It Sy kstat_install	Solaris DDI
+.It Sy kstat_named_init	Solaris DDI
+.It Sy kstat_queue	Solaris DDI
+.It Sy kstat_runq_back_to_waitq	Solaris DDI
+.It Sy kstat_runq_enter	Solaris DDI
+.It Sy kstat_runq_exit	Solaris DDI
+.It Sy kstat_waitq_enter	Solaris DDI
+.It Sy kstat_waitq_exit	Solaris DDI
+.It Sy kstat_waitq_to_runq	Solaris DDI
+.It Sy ldi_add_event_handler	Solaris DDI
+.It Sy ldi_aread	Solaris DDI
+.It Sy ldi_devmap	Solaris DDI
+.It Sy ldi_dump	Solaris DDI
+.It Sy ldi_ev_finalize	Solaris DDI
+.It Sy ldi_ev_get_cookie	Solaris DDI
+.It Sy ldi_ev_get_type	Solaris DDI
+.It Sy ldi_ev_notify	Solaris DDI
+.It Sy ldi_ev_register_callbacks	Solaris DDI
+.It Sy ldi_ev_remove_callbacks	Solaris DDI
+.It Sy ldi_get_dev	Solaris DDI
+.It Sy ldi_get_eventcookie	Solaris DDI
+.It Sy ldi_get_size	Solaris DDI
+.It Sy ldi_ident_from_dev	Solaris DDI
+.It Sy ldi_ioctl	Solaris DDI
+.It Sy ldi_open_by_dev	Solaris DDI
+.It Sy ldi_poll	Solaris DDI
+.It Sy ldi_prop_exists	Solaris DDI
+.It Sy ldi_prop_get_int	Solaris DDI
+.It Sy ldi_prop_get_lookup_int_array	Solaris DDI
+.It Sy ldi_putmsg	Solaris DDI
+.It Sy ldi_read	Solaris DDI
+.It Sy ldi_remove_event_handler	Solaris DDI
+.It Sy ldi_strategy	Solaris DDI
+.It Sy makecom_g0	Solaris DDI
+.It Sy makecom_g0_s	Solaris DDI
+.It Sy makecom_g1	Solaris DDI
+.It Sy makecom_g5	Solaris DDI
+.It Sy makedevice	DDI/DKI
+.It Sy max	DDI/DKI
+.It Sy membar_ops	Solaris DDI
+.It Sy memchr	Solaris DDI
+.It Sy min	DDI/DKI
+.It Sy minphys	Solaris DDI
+.It Sy mod_info	Solaris DDI
+.It Sy mod_install	Solaris DDI
+.It Sy mod_remove	Solaris DDI
+.It Sy mutex_destroy	Solaris DDI
+.It Sy mutex_enter	Solaris DDI
+.It Sy mutex_exit	Solaris DDI
+.It Sy mutex_init	Solaris DDI
+.It Sy mutex_owned	Solaris DDI
+.It Sy mutex_tryenter	Solaris DDI
+.It Sy nochpoll	Solaris DDI
+.It Sy nodev	DDI/DKI
+.It Sy nulldev	DDI/DKI
+.It Sy numtos	Solaris DDI
+.It Sy nvlist_add_boolean	Solaris DDI
+.It Sy nvlist_alloc	Solaris DDI
+.It Sy nvlist_lookup_boolean	Solaris DDI
+.It Sy nvlist_lookup_nvpair	Solaris DDI
+.It Sy nvlist_next_nvpair	Solaris DDI
+.It Sy nvlist_remove	Solaris DDI
+.It Sy nvlist_value_byte	Solaris DDI
+.It Sy outb	Solaris x86 DDI
+.It Sy outl	Solaris x86 DDI
+.It Sy outw	Solaris x86 DDI
+.It Sy pci_config_get16	Solaris DDI
+.It Sy pci_config_get32	Solaris DDI
+.It Sy pci_config_get64	Solaris DDI
+.It Sy pci_config_get8	Solaris DDI
+.It Sy pci_config_getb	Solaris DDI
+.It Sy pci_config_getl	Solaris DDI
+.It Sy pci_config_getw	Solaris DDI
+.It Sy pci_config_put16	Solaris DDI
+.It Sy pci_config_put32	Solaris DDI
+.It Sy pci_config_put64	Solaris DDI
+.It Sy pci_config_put8	Solaris DDI
+.It Sy pci_config_putb	Solaris DDI
+.It Sy pci_config_putl	Solaris DDI
+.It Sy pci_config_putw	Solaris DDI
+.It Sy pci_config_setup	Solaris DDI
+.It Sy pci_config_teardown	Solaris DDI
+.It Sy pci_ereport_setup	Solaris DDI
+.It Sy pci_report_pmcap	Solaris DDI
+.It Sy pci_save_config_regs	Solaris DDI
+.It Sy physio	Solaris DDI
+.It Sy pm_busy_component	Solaris DDI
+.It Sy pm_power_has_changed	Solaris DDI
+.It Sy pm_raise_power	Solaris DDI
+.It Sy pm_trans_check	Solaris DDI
+.It Sy pollwakeup	DDI/DKI
+.It Sy pci_config_teardown	Solaris DDI
+.It Sy pci_config_teardown	Solaris DDI
+.It Sy priv_getbyname	Solaris DDI
+.It Sy priv_policy	Solaris DDI
+.It Sy proc_signal	Solaris DDI
+.It Sy proc_unref	Solaris DDI
+.It Sy ptob	DDI/DKI
+.It Sy repinsb	Solaris x86 DDI
+.It Sy repinsd	Solaris x86 DDI
+.It Sy repinsw	Solaris x86 DDI
+.It Sy repoutsb	Solaris x86 DDI
+.It Sy repoutsd	Solaris x86 DDI
+.It Sy repoutsw	Solaris x86 DDI
+.It Sy rmalloc	DDI/DKI
+.It Sy rmalloc_wait	DDI/DKI
+.It Sy rmallocmap	DDI/DKI
+.It Sy rmallocmap_wait	DDI/DKI
+.It Sy rmfree	DDI/DKI
+.It Sy rmfreemap	DDI/DKI
+.It Sy rw_destroy	Solaris DDI
+.It Sy rw_downgrade	Solaris DDI
+.It Sy rw_enter	Solaris DDI
+.It Sy rw_exit	Solaris DDI
+.It Sy rw_init	Solaris DDI
+.It Sy rw_read_locked	Solaris DDI
+.It Sy rw_tryenter	Solaris DDI
+.It Sy rw_tryupgrade	Solaris DDI
+.It Sy scsi_abort	Solaris DDI
+.It Sy scsi_alloc_consistent_buf	Solaris DDI
+.It Sy scsi_cname	Solaris DDI
+.It Sy scsi_destroy_pkt	Solaris DDI
+.It Sy scsi_dmafree	Solaris DDI
+.It Sy scsi_dmaget	Solaris DDI
+.It Sy scsi_dname	Solaris DDI
+.It Sy scsi_errmsg	Solaris DDI
+.It Sy scsi_ext_sense_fields	Solaris DDI
+.It Sy scsi_find_sense_descr	Solaris DDI
+.It Sy scsi_free_consistent_buf	Solaris DDI
+.It Sy scsi_get_device_type_scsi_options	Solaris DDI
+.It Sy scsi_get_device_type_string	Solaris DDI
+.It Sy scsi_hba_attach_setup	Solaris DDI
+.It Sy scsi_hba_detach	Solaris DDI
+.It Sy scsi_hba_fini	Solaris DDI
+.It Sy scsi_hba_init	Solaris DDI
+.It Sy scsi_hba_lookup_capstr	Solaris DDI
+.It Sy scsi_hba_pkt_alloc	Solaris DDI
+.It Sy scsi_hba_pkt_free	Solaris DDI
+.It Sy scsi_hba_probe	Solaris DDI
+.It Sy scsi_hba_tran_alloc	Solaris DDI
+.It Sy scsi_hba_tran_free	Solaris DDI
+.It Sy scsi_ifgetcap	Solaris DDI
+.It Sy scsi_ifsetcap	Solaris DDI
+.It Sy scsi_init_pkt	Solaris DDI
+.It Sy scsi_log	Solaris DDI
+.It Sy scsi_mname	Solaris DDI
+.It Sy scsi_pktalloc	Solaris DDI
+.It Sy scsi_pktfree	Solaris DDI
+.It Sy scsi_poll	Solaris DDI
+.It Sy scsi_probe	Solaris DDI
+.It Sy scsi_resalloc	Solaris DDI
+.It Sy scsi_reset	Solaris DDI
+.It Sy scsi_reset_notify	Solaris DDI
+.It Sy scsi_resfree	Solaris DDI
+.It Sy scsi_rname	Solaris DDI
+.It Sy scsi_sense_key	Solaris DDI
+.It Sy scsi_setup_cdb	Solaris DDI
+.It Sy scsi_slave	Solaris DDI
+.It Sy scsi_sname	Solaris DDI
+.It Sy scsi_sync_pkt	Solaris DDI
+.It Sy scsi_transport	Solaris DDI
+.It Sy scsi_unprobe	Solaris DDI
+.It Sy scsi_unslave	Solaris DDI
+.It Sy scsi_validate_sense	Solaris DDI
+.It Sy scsi_vu_errmsg	Solaris DDI
+.It Sy sema_destroy	Solaris DDI
+.It Sy sema_init	Solaris DDI
+.It Sy sema_p	Solaris DDI
+.It Sy sema_p_sig	Solaris DDI
+.It Sy sema_tryp	Solaris DDI
+.It Sy sema_v	Solaris DDI
+.It Sy sprintf	Solaris DDI
+.It Sy stoi	Solaris DDI
+.It Sy strchr	Solaris DDI
+.It Sy strcmp	Solaris DDI
+.It Sy strcpy	Solaris DDI
+.It Sy strlen	Solaris DDI
+.It Sy strncmp	Solaris DDI
+.It Sy strncpy	Solaris DDI
+.It Sy STRUCT_DECL	Solaris DDI
+.It Sy swab	DDI/DKI
+.It Sy taskq	Solaris DDI
+.It Sy timeout	DDI/DKI
+.It Sy u8_strcmp	Solaris DDI
+.It Sy u8_textprep_str	Solaris DDI
+.It Sy u8_validate	Solaris DDI
+.It Sy uconv_u16tou32	Solaris DDI
+.It Sy uiomove	DDI/DKI
+.It Sy untimeout	DDI/DKI
+.It Sy ureadc	DDI/DKI
+.It Sy usb_alloc_request	Solaris DDI
+.It Sy usb_client_attach	Solaris DDI
+.It Sy usb_clr_feature	Solaris DDI
+.It Sy usb_create_pm_components	Solaris DDI
+.It Sy usb_get_addr	Solaris DDI
+.It Sy usb_get_alt_if	Solaris DDI
+.It Sy usb_get_cfg	Solaris DDI
+.It Sy usb_get_current_frame_number	Solaris DDI
+.It Sy usb_get_dev_data	Solaris DDI
+.It Sy usb_get_max_pkts_per_ioc_request	Solaris DDI
+.It Sy usb_get_status	Solaris DDI
+.It Sy usb_get_string_desc	Solaris DDI
+.It Sy usb_handle_remote_wakeup	Solaris DDI
+.It Sy usb_lookup_ep_data	Solaris DDI
+.It Sy usb_parse_data	Solaris DDI
+.It Sy usb_pipe_bulk_xfer	Solaris DDI
+.It Sy usb_pipe_close	Solaris DDI
+.It Sy usb_pipe_ctrl_xfer	Solaris DDI
+.It Sy usb_pipe_drain_reqs	Solaris DDI
+.It Sy usb_pipe_get_max_bulk_transfer_size	Solaris DDI
+.It Sy usb_pipe_get_state	Solaris DDI
+.It Sy usb_pipe_intr_xfer	Solaris DDI
+.It Sy usb_pipe_isoc_xfer	Solaris DDI
+.It Sy usb_pipe_open	Solaris DDI
+.It Sy usb_pipe_reset	Solaris DDI
+.It Sy usb_pipe_set_private	Solaris DDI
+.It Sy usb_register_hotplug_cbs	Solaris DDI
+.It Sy usb_reset_device	Solaris DDI
+.It Sy uwritec	DDI/DKI
+.It Sy va_arg	Solaris DDI
+.It Sy va_end	Solaris DDI
+.It Sy va_start	Solaris DDI
+.It Sy vcmn_err	DDI/DKI
+.It Sy vsprintf	Solaris DDI
+.El
+.Sh SEE ALSO
+.Xr Intro 9E ,
+.Xr mutex 9F
--- old/usr/src/man/man9f/Makefile	2014-11-12 17:44:34.701130096 +0100
+++ new/usr/src/man/man9f/Makefile	2014-11-12 17:44:34.706255940 +0100
@@ -66,64 +66,6 @@
 	 	copyin.9f				\
 	 	copymsg.9f				\
 	 	copyout.9f				\
-	 	csx_AccessConfigurationRegister.9f	\
-	 	csx_CS_DDI_Info.9f			\
-	 	csx_ConvertSize.9f			\
-	 	csx_ConvertSpeed.9f			\
-	 	csx_DeregisterClient.9f			\
-	 	csx_DupHandle.9f			\
-	 	csx_Error2Text.9f			\
-	 	csx_Event2Text.9f			\
-	 	csx_FreeHandle.9f			\
-	 	csx_Get8.9f				\
-	 	csx_GetFirstClient.9f			\
-	 	csx_GetFirstTuple.9f			\
-	 	csx_GetHandleOffset.9f			\
-	 	csx_GetMappedAddr.9f			\
-	 	csx_GetStatus.9f			\
-	 	csx_GetTupleData.9f			\
-	 	csx_MakeDeviceNode.9f			\
-	 	csx_MapLogSocket.9f			\
-	 	csx_MapMemPage.9f			\
-	 	csx_ModifyConfiguration.9f		\
-	 	csx_ModifyWindow.9f			\
-	 	csx_ParseTuple.9f			\
-	 	csx_Parse_CISTPL_BATTERY.9f		\
-	 	csx_Parse_CISTPL_BYTEORDER.9f		\
-	 	csx_Parse_CISTPL_CFTABLE_ENTRY.9f	\
-	 	csx_Parse_CISTPL_CONFIG.9f		\
-	 	csx_Parse_CISTPL_DATE.9f		\
-	 	csx_Parse_CISTPL_DEVICE.9f		\
-	 	csx_Parse_CISTPL_DEVICEGEO.9f		\
-	 	csx_Parse_CISTPL_DEVICEGEO_A.9f		\
-	 	csx_Parse_CISTPL_FORMAT.9f		\
-	 	csx_Parse_CISTPL_FUNCE.9f		\
-	 	csx_Parse_CISTPL_FUNCID.9f		\
-	 	csx_Parse_CISTPL_GEOMETRY.9f		\
-	 	csx_Parse_CISTPL_JEDEC_C.9f		\
-	 	csx_Parse_CISTPL_LINKTARGET.9f		\
-	 	csx_Parse_CISTPL_LONGLINK_A.9f		\
-	 	csx_Parse_CISTPL_LONGLINK_MFC.9f	\
-	 	csx_Parse_CISTPL_MANFID.9f		\
-	 	csx_Parse_CISTPL_ORG.9f			\
-	 	csx_Parse_CISTPL_SPCL.9f		\
-	 	csx_Parse_CISTPL_SWIL.9f		\
-	 	csx_Parse_CISTPL_VERS_1.9f		\
-	 	csx_Parse_CISTPL_VERS_2.9f		\
-	 	csx_Put8.9f				\
-	 	csx_RegisterClient.9f			\
-	 	csx_ReleaseConfiguration.9f		\
-	 	csx_RepGet8.9f				\
-	 	csx_RepPut8.9f				\
-	 	csx_RequestConfiguration.9f		\
-	 	csx_RequestIO.9f			\
-	 	csx_RequestIRQ.9f			\
-	 	csx_RequestSocketMask.9f		\
-	 	csx_RequestWindow.9f			\
-	 	csx_ResetFunction.9f			\
-	 	csx_SetEventMask.9f			\
-	 	csx_SetHandleOffset.9f			\
-	 	csx_ValidateCIS.9f			\
 	 	datamsg.9f				\
 	 	ddi_add_event_handler.9f		\
 	 	ddi_add_intr.9f				\
@@ -636,31 +578,6 @@
 	 	crgetsuid.9f				\
 	 	crgetuid.9f				\
 	 	crgetzoneid.9f				\
-	 	csx_Get16.9f				\
-	 	csx_Get32.9f				\
-	 	csx_Get64.9f				\
-	 	csx_GetEventMask.9f			\
-	 	csx_GetNextClient.9f			\
-	 	csx_GetNextTuple.9f			\
-	 	csx_Parse_CISTPL_DEVICE_A.9f		\
-	 	csx_Parse_CISTPL_DEVICE_OA.9f		\
-	 	csx_Parse_CISTPL_DEVICE_OC.9f		\
-	 	csx_Parse_CISTPL_JEDEC_A.9f		\
-	 	csx_Parse_CISTPL_LONGLINK_C.9f		\
-	 	csx_Put16.9f				\
-	 	csx_Put32.9f				\
-	 	csx_Put64.9f				\
-	 	csx_ReleaseIO.9f			\
-	 	csx_ReleaseIRQ.9f			\
-	 	csx_ReleaseSocketMask.9f		\
-	 	csx_ReleaseWindow.9f			\
-	 	csx_RemoveDeviceNode.9f			\
-	 	csx_RepGet16.9f				\
-	 	csx_RepGet32.9f				\
-	 	csx_RepGet64.9f				\
-	 	csx_RepPut16.9f				\
-	 	csx_RepPut32.9f				\
-	 	csx_RepPut64.9f				\
 	 	cv_broadcast.9f				\
 	 	cv_destroy.9f				\
 	 	cv_init.9f				\
@@ -1317,46 +1234,6 @@
 cv_wait.9f				:= LINKSRC = condvar.9f
 cv_wait_sig.9f				:= LINKSRC = condvar.9f
 
-csx_Get16.9f				:= LINKSRC = csx_Get8.9f
-csx_Get32.9f				:= LINKSRC = csx_Get8.9f
-csx_Get64.9f				:= LINKSRC = csx_Get8.9f
-
-csx_GetNextClient.9f			:= LINKSRC = csx_GetFirstClient.9f
-
-csx_GetNextTuple.9f			:= LINKSRC = csx_GetFirstTuple.9f
-
-csx_RemoveDeviceNode.9f			:= LINKSRC = csx_MakeDeviceNode.9f
-
-csx_Parse_CISTPL_DEVICE_A.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
-csx_Parse_CISTPL_DEVICE_OA.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
-csx_Parse_CISTPL_DEVICE_OC.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
-
-csx_Parse_CISTPL_JEDEC_A.9f		:= LINKSRC = csx_Parse_CISTPL_JEDEC_C.9f
-
-csx_Parse_CISTPL_LONGLINK_C.9f		:= LINKSRC = csx_Parse_CISTPL_LONGLINK_A.9f
-
-csx_Put16.9f				:= LINKSRC = csx_Put8.9f
-csx_Put32.9f				:= LINKSRC = csx_Put8.9f
-csx_Put64.9f				:= LINKSRC = csx_Put8.9f
-
-csx_RepGet16.9f				:= LINKSRC = csx_RepGet8.9f
-csx_RepGet32.9f				:= LINKSRC = csx_RepGet8.9f
-csx_RepGet64.9f				:= LINKSRC = csx_RepGet8.9f
-
-csx_RepPut16.9f				:= LINKSRC = csx_RepPut8.9f
-csx_RepPut32.9f				:= LINKSRC = csx_RepPut8.9f
-csx_RepPut64.9f				:= LINKSRC = csx_RepPut8.9f
-
-csx_ReleaseIO.9f			:= LINKSRC = csx_RequestIO.9f
-
-csx_ReleaseIRQ.9f			:= LINKSRC = csx_RequestIRQ.9f
-
-csx_ReleaseSocketMask.9f		:= LINKSRC = csx_RequestSocketMask.9f
-
-csx_ReleaseWindow.9f			:= LINKSRC = csx_RequestWindow.9f
-
-csx_GetEventMask.9f			:= LINKSRC = csx_SetEventMask.9f
-
 ddi_get_iblock_cookie.9f		:= LINKSRC = ddi_add_intr.9f
 ddi_remove_intr.9f			:= LINKSRC = ddi_add_intr.9f
 
--- /dev/null	2014-11-12 17:44:34.000000000 +0100
+++ new/usr/src/man/man9f/Makefile.orig	2014-11-12 17:44:34.923482751 +0100
@@ -0,0 +1,1982 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright 2011, Richard Lowe
+# Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore>
+#
+
+include		$(SRC)/Makefile.master
+
+MANSECT= 	9f
+
+MANFILES= 	ASSERT.9f				\
+	 	Intro.9f				\
+	 	OTHERQ.9f				\
+	 	RD.9f					\
+	 	SAMESTR.9f				\
+	 	STRUCT_DECL.9f				\
+	 	WR.9f					\
+	 	adjmsg.9f				\
+	 	allocb.9f				\
+	 	atomic_add.9f				\
+	 	atomic_and.9f				\
+	 	atomic_bits.9f				\
+	 	atomic_cas.9f				\
+	 	atomic_dec.9f				\
+	 	atomic_inc.9f				\
+	 	atomic_ops.9f				\
+	 	atomic_or.9f				\
+	 	atomic_swap.9f				\
+	 	backq.9f				\
+	 	bcanput.9f				\
+	 	bcmp.9f					\
+	 	bcopy.9f				\
+	 	bioclone.9f				\
+	 	biodone.9f				\
+	 	bioerror.9f				\
+	 	biofini.9f				\
+	 	bioinit.9f				\
+	 	biomodified.9f				\
+	 	bioreset.9f				\
+	 	biosize.9f				\
+	 	biowait.9f				\
+	 	bp_copyin.9f				\
+	 	bp_copyout.9f				\
+	 	bp_mapin.9f				\
+	 	bp_mapout.9f				\
+	 	btop.9f					\
+	 	btopr.9f				\
+	 	bufcall.9f				\
+	 	bzero.9f				\
+	 	canput.9f				\
+	 	clrbuf.9f				\
+	 	cmn_err.9f				\
+	 	condvar.9f				\
+	 	copyb.9f				\
+	 	copyin.9f				\
+	 	copymsg.9f				\
+	 	copyout.9f				\
+	 	csx_AccessConfigurationRegister.9f	\
+	 	csx_CS_DDI_Info.9f			\
+	 	csx_ConvertSize.9f			\
+	 	csx_ConvertSpeed.9f			\
+	 	csx_DeregisterClient.9f			\
+	 	csx_DupHandle.9f			\
+	 	csx_Error2Text.9f			\
+	 	csx_Event2Text.9f			\
+	 	csx_FreeHandle.9f			\
+	 	csx_Get8.9f				\
+	 	csx_GetFirstClient.9f			\
+	 	csx_GetFirstTuple.9f			\
+	 	csx_GetHandleOffset.9f			\
+	 	csx_GetMappedAddr.9f			\
+	 	csx_GetStatus.9f			\
+	 	csx_GetTupleData.9f			\
+	 	csx_MakeDeviceNode.9f			\
+	 	csx_MapLogSocket.9f			\
+	 	csx_MapMemPage.9f			\
+	 	csx_ModifyConfiguration.9f		\
+	 	csx_ModifyWindow.9f			\
+	 	csx_ParseTuple.9f			\
+	 	csx_Parse_CISTPL_BATTERY.9f		\
+	 	csx_Parse_CISTPL_BYTEORDER.9f		\
+	 	csx_Parse_CISTPL_CFTABLE_ENTRY.9f	\
+	 	csx_Parse_CISTPL_CONFIG.9f		\
+	 	csx_Parse_CISTPL_DATE.9f		\
+	 	csx_Parse_CISTPL_DEVICE.9f		\
+	 	csx_Parse_CISTPL_DEVICEGEO.9f		\
+	 	csx_Parse_CISTPL_DEVICEGEO_A.9f		\
+	 	csx_Parse_CISTPL_FORMAT.9f		\
+	 	csx_Parse_CISTPL_FUNCE.9f		\
+	 	csx_Parse_CISTPL_FUNCID.9f		\
+	 	csx_Parse_CISTPL_GEOMETRY.9f		\
+	 	csx_Parse_CISTPL_JEDEC_C.9f		\
+	 	csx_Parse_CISTPL_LINKTARGET.9f		\
+	 	csx_Parse_CISTPL_LONGLINK_A.9f		\
+	 	csx_Parse_CISTPL_LONGLINK_MFC.9f	\
+	 	csx_Parse_CISTPL_MANFID.9f		\
+	 	csx_Parse_CISTPL_ORG.9f			\
+	 	csx_Parse_CISTPL_SPCL.9f		\
+	 	csx_Parse_CISTPL_SWIL.9f		\
+	 	csx_Parse_CISTPL_VERS_1.9f		\
+	 	csx_Parse_CISTPL_VERS_2.9f		\
+	 	csx_Put8.9f				\
+	 	csx_RegisterClient.9f			\
+	 	csx_ReleaseConfiguration.9f		\
+	 	csx_RepGet8.9f				\
+	 	csx_RepPut8.9f				\
+	 	csx_RequestConfiguration.9f		\
+	 	csx_RequestIO.9f			\
+	 	csx_RequestIRQ.9f			\
+	 	csx_RequestSocketMask.9f		\
+	 	csx_RequestWindow.9f			\
+	 	csx_ResetFunction.9f			\
+	 	csx_SetEventMask.9f			\
+	 	csx_SetHandleOffset.9f			\
+	 	csx_ValidateCIS.9f			\
+	 	datamsg.9f				\
+	 	ddi_add_event_handler.9f		\
+	 	ddi_add_intr.9f				\
+	 	ddi_add_softintr.9f			\
+	 	ddi_binding_name.9f			\
+	 	ddi_btop.9f				\
+	 	ddi_can_receive_sig.9f			\
+	 	ddi_cb_register.9f			\
+	 	ddi_check_acc_handle.9f			\
+	 	ddi_copyin.9f				\
+	 	ddi_copyout.9f				\
+	 	ddi_create_minor_node.9f		\
+	 	ddi_cred.9f				\
+	 	ddi_dev_is_needed.9f			\
+	 	ddi_dev_is_sid.9f			\
+	 	ddi_dev_nintrs.9f			\
+	 	ddi_dev_nregs.9f			\
+	 	ddi_dev_regsize.9f			\
+	 	ddi_dev_report_fault.9f			\
+	 	ddi_device_copy.9f			\
+	 	ddi_device_zero.9f			\
+	 	ddi_devid_compare.9f			\
+	 	ddi_dma_addr_bind_handle.9f		\
+	 	ddi_dma_alloc_handle.9f			\
+	 	ddi_dma_buf_bind_handle.9f		\
+	 	ddi_dma_burstsizes.9f			\
+	 	ddi_dma_free_handle.9f			\
+	 	ddi_dma_getwin.9f			\
+	 	ddi_dma_mem_alloc.9f			\
+	 	ddi_dma_mem_free.9f			\
+	 	ddi_dma_nextcookie.9f			\
+	 	ddi_dma_numwin.9f			\
+	 	ddi_dma_set_sbus64.9f			\
+	 	ddi_dma_sync.9f				\
+	 	ddi_dma_unbind_handle.9f		\
+	 	ddi_dmae.9f				\
+	 	ddi_driver_major.9f			\
+	 	ddi_driver_name.9f			\
+	 	ddi_enter_critical.9f			\
+	 	ddi_ffs.9f				\
+	 	ddi_fm_acc_err_clear.9f			\
+	 	ddi_fm_acc_err_get.9f			\
+	 	ddi_fm_ereport_post.9f			\
+	 	ddi_fm_handler_register.9f		\
+	 	ddi_fm_init.9f				\
+	 	ddi_fm_service_impact.9f		\
+	 	ddi_get8.9f				\
+	 	ddi_get_cred.9f				\
+	 	ddi_get_devstate.9f			\
+	 	ddi_get_driver_private.9f		\
+	 	ddi_get_eventcookie.9f			\
+	 	ddi_get_instance.9f			\
+	 	ddi_get_kt_did.9f			\
+	 	ddi_get_lbolt.9f			\
+	 	ddi_get_parent.9f			\
+	 	ddi_get_pid.9f				\
+	 	ddi_get_time.9f				\
+	 	ddi_getiminor.9f			\
+	 	ddi_in_panic.9f				\
+	 	ddi_intr_add_handler.9f			\
+	 	ddi_intr_add_softint.9f			\
+	 	ddi_intr_alloc.9f			\
+	 	ddi_intr_dup_handler.9f			\
+	 	ddi_intr_enable.9f			\
+	 	ddi_intr_get_cap.9f			\
+	 	ddi_intr_get_hilevel_pri.9f		\
+	 	ddi_intr_get_nintrs.9f			\
+	 	ddi_intr_get_pending.9f			\
+	 	ddi_intr_get_pri.9f			\
+	 	ddi_intr_get_supported_types.9f		\
+	 	ddi_intr_hilevel.9f			\
+	 	ddi_intr_set_mask.9f			\
+	 	ddi_intr_set_nreq.9f			\
+	 	ddi_io_get8.9f				\
+	 	ddi_io_put8.9f				\
+	 	ddi_io_rep_get8.9f			\
+	 	ddi_io_rep_put8.9f			\
+	 	ddi_log_sysevent.9f			\
+	 	ddi_map_regs.9f				\
+	 	ddi_mem_get8.9f				\
+	 	ddi_mem_put8.9f				\
+	 	ddi_mem_rep_get8.9f			\
+	 	ddi_mem_rep_put8.9f			\
+	 	ddi_mmap_get_model.9f			\
+	 	ddi_model_convert_from.9f		\
+	 	ddi_modopen.9f				\
+	 	ddi_no_info.9f				\
+	 	ddi_node_name.9f			\
+	 	ddi_peek.9f				\
+	 	ddi_periodic_add.9f			\
+	 	ddi_periodic_delete.9f			\
+	 	ddi_poke.9f				\
+	 	ddi_prop_create.9f			\
+	 	ddi_prop_exists.9f			\
+	 	ddi_prop_get_int.9f			\
+	 	ddi_prop_lookup.9f			\
+	 	ddi_prop_op.9f				\
+	 	ddi_prop_update.9f			\
+	 	ddi_put8.9f				\
+	 	ddi_regs_map_free.9f			\
+	 	ddi_regs_map_setup.9f			\
+	 	ddi_remove_event_handler.9f		\
+	 	ddi_remove_minor_node.9f		\
+	 	ddi_removing_power.9f			\
+	 	ddi_rep_get8.9f				\
+	 	ddi_rep_put8.9f				\
+	 	ddi_report_dev.9f			\
+	 	ddi_root_node.9f			\
+	 	ddi_segmap.9f				\
+	 	ddi_slaveonly.9f			\
+	 	ddi_soft_state.9f			\
+	 	ddi_strtol.9f				\
+	 	ddi_strtoll.9f				\
+	 	ddi_strtoul.9f				\
+	 	ddi_umem_alloc.9f			\
+	 	ddi_umem_iosetup.9f			\
+	 	ddi_umem_lock.9f			\
+	 	delay.9f				\
+	 	devmap_default_access.9f		\
+	 	devmap_devmem_setup.9f			\
+	 	devmap_do_ctxmgt.9f			\
+	 	devmap_set_ctx_timeout.9f		\
+	 	devmap_setup.9f				\
+	 	devmap_unload.9f			\
+	 	disksort.9f				\
+	 	dlbindack.9f				\
+	 	drv_getparm.9f				\
+	 	drv_hztousec.9f				\
+	 	drv_priv.9f				\
+	 	drv_usectohz.9f				\
+	 	drv_usecwait.9f				\
+	 	dupb.9f					\
+	 	dupmsg.9f				\
+	 	enableok.9f				\
+	 	esballoc.9f				\
+	 	esbbcall.9f				\
+	 	flushband.9f				\
+	 	flushq.9f				\
+	 	freeb.9f				\
+	 	freemsg.9f				\
+	 	freerbuf.9f				\
+	 	freezestr.9f				\
+	 	get_pktiopb.9f				\
+	 	geterror.9f				\
+	 	gethrtime.9f				\
+	 	getmajor.9f				\
+	 	getminor.9f				\
+	 	getq.9f					\
+	 	getrbuf.9f				\
+	 	gld.9f					\
+	 	hook_alloc.9f				\
+	 	hook_free.9f				\
+	 	id32_alloc.9f				\
+	 	inb.9f					\
+	 	insq.9f					\
+	 	kiconv.9f				\
+	 	kiconv_close.9f				\
+	 	kiconv_open.9f				\
+	 	kiconvstr.9f				\
+	 	kmem_alloc.9f				\
+	 	kmem_cache_create.9f			\
+	 	kstat_create.9f				\
+	 	kstat_delete.9f				\
+	 	kstat_install.9f			\
+	 	kstat_named_init.9f			\
+	 	kstat_queue.9f				\
+	 	ldi_add_event_handler.9f		\
+	 	ldi_aread.9f				\
+	 	ldi_devmap.9f				\
+	 	ldi_dump.9f				\
+	 	ldi_ev_finalize.9f			\
+	 	ldi_ev_get_cookie.9f			\
+	 	ldi_ev_get_type.9f			\
+	 	ldi_ev_notify.9f			\
+	 	ldi_ev_register_callbacks.9f		\
+	 	ldi_ev_remove_callbacks.9f		\
+	 	ldi_get_dev.9f				\
+	 	ldi_get_eventcookie.9f			\
+	 	ldi_get_size.9f				\
+	 	ldi_ident_from_dev.9f			\
+	 	ldi_ioctl.9f				\
+	 	ldi_open_by_dev.9f			\
+	 	ldi_poll.9f				\
+	 	ldi_prop_exists.9f			\
+	 	ldi_prop_get_int.9f			\
+	 	ldi_prop_lookup_int_array.9f		\
+	 	ldi_putmsg.9f				\
+	 	ldi_read.9f				\
+	 	ldi_remove_event_handler.9f		\
+	 	ldi_strategy.9f				\
+	 	linkb.9f				\
+	 	list_create.9f				\
+	 	makecom.9f				\
+	 	makedevice.9f				\
+	 	max.9f					\
+	 	mcopyin.9f				\
+	 	mcopymsg.9f				\
+	 	mcopyout.9f				\
+	 	membar_ops.9f				\
+	 	memchr.9f				\
+	 	merror.9f				\
+	 	mexchange.9f				\
+	 	min.9f					\
+	 	mioc2ack.9f				\
+	 	miocack.9f				\
+	 	miocnak.9f				\
+	 	miocpullup.9f				\
+	 	mkiocb.9f				\
+	 	mod_install.9f				\
+	 	msgdsize.9f				\
+	 	msgpullup.9f				\
+	 	msgsize.9f				\
+	 	mt-streams.9f				\
+	 	mutex.9f				\
+	 	net_event_notify_register.9f		\
+	 	net_getifname.9f			\
+	 	net_getlifaddr.9f			\
+	 	net_getmtu.9f				\
+	 	net_getnetid.9f				\
+	 	net_getpmtuenabled.9f			\
+	 	net_hook_register.9f			\
+	 	net_hook_unregister.9f			\
+	 	net_inject.9f				\
+	 	net_inject_alloc.9f			\
+	 	net_inject_free.9f			\
+	 	net_instance_alloc.9f			\
+	 	net_instance_free.9f			\
+	 	net_instance_notify_register.9f		\
+	 	net_instance_register.9f		\
+	 	net_instance_unregister.9f		\
+	 	net_ispartialchecksum.9f		\
+	 	net_isvalidchecksum.9f			\
+	 	net_kstat_create.9f			\
+	 	net_kstat_delete.9f			\
+	 	net_lifgetnext.9f			\
+	 	net_netidtozonid.9f			\
+	 	net_phygetnext.9f			\
+	 	net_phylookup.9f			\
+	 	net_protocol_lookup.9f			\
+	 	net_protocol_notify_register.9f		\
+	 	net_protocol_release.9f			\
+	 	net_protocol_walk.9f			\
+	 	net_routeto.9f				\
+	 	net_zoneidtonetid.9f			\
+	 	netinfo.9f				\
+	 	nochpoll.9f				\
+	 	nodev.9f				\
+	 	noenable.9f				\
+	 	nulldev.9f				\
+	 	nvlist_add_boolean.9f			\
+	 	nvlist_alloc.9f				\
+	 	nvlist_lookup_boolean.9f		\
+	 	nvlist_lookup_nvpair.9f			\
+	 	nvlist_next_nvpair.9f			\
+	 	nvlist_remove.9f			\
+	 	nvpair_value_byte.9f			\
+	 	outb.9f					\
+	 	pci_config_get8.9f			\
+	 	pci_config_setup.9f			\
+	 	pci_ereport_setup.9f			\
+	 	pci_report_pmcap.9f			\
+	 	pci_save_config_regs.9f			\
+	 	physio.9f				\
+	 	pm_busy_component.9f			\
+	 	pm_power_has_changed.9f			\
+	 	pm_raise_power.9f			\
+	 	pm_trans_check.9f			\
+	 	pollwakeup.9f				\
+	 	priv_getbyname.9f			\
+	 	priv_policy.9f				\
+	 	proc_signal.9f				\
+	 	ptob.9f					\
+	 	pullupmsg.9f				\
+	 	put.9f					\
+	 	putbq.9f				\
+	 	putctl.9f				\
+	 	putctl1.9f				\
+	 	putnext.9f				\
+	 	putnextctl.9f				\
+	 	putnextctl1.9f				\
+	 	putq.9f					\
+	 	qassociate.9f				\
+	 	qbufcall.9f				\
+	 	qenable.9f				\
+	 	qprocson.9f				\
+	 	qreply.9f				\
+	 	qsize.9f				\
+	 	qtimeout.9f				\
+	 	qunbufcall.9f				\
+	 	quntimeout.9f				\
+	 	qwait.9f				\
+	 	qwriter.9f				\
+	 	rmalloc.9f				\
+	 	rmalloc_wait.9f				\
+	 	rmallocmap.9f				\
+	 	rmfree.9f				\
+	 	rmvb.9f					\
+	 	rmvq.9f					\
+	 	rwlock.9f				\
+	 	scsi_abort.9f				\
+	 	scsi_alloc_consistent_buf.9f		\
+	 	scsi_cname.9f				\
+	 	scsi_destroy_pkt.9f			\
+	 	scsi_dmaget.9f				\
+	 	scsi_errmsg.9f				\
+	 	scsi_ext_sense_fields.9f		\
+	 	scsi_find_sense_descr.9f		\
+	 	scsi_free_consistent_buf.9f		\
+	 	scsi_get_device_type_scsi_options.9f	\
+	 	scsi_get_device_type_string.9f		\
+	 	scsi_hba_attach_setup.9f		\
+	 	scsi_hba_init.9f			\
+	 	scsi_hba_lookup_capstr.9f		\
+	 	scsi_hba_pkt_alloc.9f			\
+	 	scsi_hba_pkt_comp.9f			\
+	 	scsi_hba_probe.9f			\
+	 	scsi_hba_tran_alloc.9f			\
+	 	scsi_ifgetcap.9f			\
+	 	scsi_init_pkt.9f			\
+	 	scsi_log.9f				\
+	 	scsi_pktalloc.9f			\
+	 	scsi_poll.9f				\
+	 	scsi_probe.9f				\
+	 	scsi_reset.9f				\
+	 	scsi_reset_notify.9f			\
+	 	scsi_sense_key.9f			\
+	 	scsi_setup_cdb.9f			\
+	 	scsi_slave.9f				\
+	 	scsi_sync_pkt.9f			\
+	 	scsi_transport.9f			\
+	 	scsi_unprobe.9f				\
+	 	scsi_validate_sense.9f			\
+	 	scsi_vu_errmsg.9f			\
+	 	semaphore.9f				\
+	 	stoi.9f					\
+	 	string.9f				\
+	 	strlog.9f				\
+	 	strqget.9f				\
+	 	strqset.9f				\
+	 	swab.9f					\
+	 	taskq.9f				\
+	 	testb.9f				\
+	 	timeout.9f				\
+	 	u8_strcmp.9f				\
+	 	u8_textprep_str.9f			\
+	 	u8_validate.9f				\
+	 	uconv_u16tou32.9f			\
+	 	uiomove.9f				\
+	 	unbufcall.9f				\
+	 	unlinkb.9f				\
+	 	untimeout.9f				\
+	 	ureadc.9f				\
+	 	usb_alloc_request.9f			\
+	 	usb_client_attach.9f			\
+	 	usb_clr_feature.9f			\
+	 	usb_create_pm_components.9f		\
+	 	usb_get_addr.9f				\
+	 	usb_get_alt_if.9f			\
+	 	usb_get_cfg.9f				\
+	 	usb_get_current_frame_number.9f		\
+	 	usb_get_dev_data.9f			\
+	 	usb_get_max_pkts_per_isoc_request.9f	\
+	 	usb_get_status.9f			\
+	 	usb_get_string_descr.9f			\
+	 	usb_handle_remote_wakeup.9f		\
+	 	usb_lookup_ep_data.9f			\
+	 	usb_parse_data.9f			\
+	 	usb_pipe_bulk_xfer.9f			\
+	 	usb_pipe_close.9f			\
+	 	usb_pipe_ctrl_xfer.9f			\
+	 	usb_pipe_drain_reqs.9f			\
+	 	usb_pipe_get_max_bulk_transfer_size.9f	\
+	 	usb_pipe_get_state.9f			\
+	 	usb_pipe_intr_xfer.9f			\
+	 	usb_pipe_isoc_xfer.9f			\
+	 	usb_pipe_open.9f			\
+	 	usb_pipe_reset.9f			\
+	 	usb_pipe_set_private.9f			\
+	 	usb_register_hotplug_cbs.9f		\
+	 	usb_reset_device.9f			\
+	 	uwritec.9f				\
+	 	va_arg.9f				\
+	 	vsprintf.9f
+
+MANLINKS=	SIZEOF_PTR.9f				\
+	 	SIZEOF_STRUCT.9f			\
+	 	STRUCT_BUF.9f				\
+	 	STRUCT_FADDR.9f				\
+	 	STRUCT_FGET.9f				\
+	 	STRUCT_FGETP.9f				\
+	 	STRUCT_FSET.9f				\
+	 	STRUCT_FSETP.9f				\
+	 	STRUCT_HANDLE.9f			\
+	 	STRUCT_INIT.9f				\
+	 	STRUCT_SET_HANDLE.9f			\
+	 	STRUCT_SIZE.9f				\
+	 	assert.9f				\
+	 	atomic_add_16.9f			\
+	 	atomic_add_16_nv.9f			\
+	 	atomic_add_32.9f			\
+	 	atomic_add_32_nv.9f			\
+	 	atomic_add_64.9f			\
+	 	atomic_add_64_nv.9f			\
+	 	atomic_add_8.9f				\
+	 	atomic_add_8_nv.9f			\
+	 	atomic_add_char.9f			\
+	 	atomic_add_char_nv.9f			\
+	 	atomic_add_int.9f			\
+	 	atomic_add_int_nv.9f			\
+	 	atomic_add_long.9f			\
+	 	atomic_add_long_nv.9f			\
+	 	atomic_add_ptr.9f			\
+	 	atomic_add_ptr_nv.9f			\
+	 	atomic_add_short.9f			\
+	 	atomic_add_short_nv.9f			\
+	 	atomic_and_16.9f			\
+	 	atomic_and_16_nv.9f			\
+	 	atomic_and_32.9f			\
+	 	atomic_and_32_nv.9f			\
+	 	atomic_and_64.9f			\
+	 	atomic_and_64_nv.9f			\
+	 	atomic_and_8.9f				\
+	 	atomic_and_8_nv.9f			\
+	 	atomic_and_uchar.9f			\
+	 	atomic_and_uchar_nv.9f			\
+	 	atomic_and_uint.9f			\
+	 	atomic_and_uint_nv.9f			\
+	 	atomic_and_ulong.9f			\
+	 	atomic_and_ulong_nv.9f			\
+	 	atomic_and_ushort.9f			\
+	 	atomic_and_ushort_nv.9f			\
+	 	atomic_cas_16.9f			\
+	 	atomic_cas_32.9f			\
+	 	atomic_cas_64.9f			\
+	 	atomic_cas_8.9f				\
+	 	atomic_cas_ptr.9f			\
+	 	atomic_cas_uchar.9f			\
+	 	atomic_cas_uint.9f			\
+	 	atomic_cas_ulong.9f			\
+	 	atomic_cas_ushort.9f			\
+	 	atomic_clear_long_excl.9f		\
+	 	atomic_dec_16.9f			\
+	 	atomic_dec_16_nv.9f			\
+	 	atomic_dec_32.9f			\
+	 	atomic_dec_32_nv.9f			\
+	 	atomic_dec_64.9f			\
+	 	atomic_dec_64_nv.9f			\
+	 	atomic_dec_8.9f				\
+	 	atomic_dec_8_nv.9f			\
+	 	atomic_dec_ptr.9f			\
+	 	atomic_dec_ptr_nv.9f			\
+	 	atomic_dec_uchar.9f			\
+	 	atomic_dec_uchar_nv.9f			\
+	 	atomic_dec_uint.9f			\
+	 	atomic_dec_uint_nv.9f			\
+	 	atomic_dec_ulong.9f			\
+	 	atomic_dec_ulong_nv.9f			\
+	 	atomic_dec_ushort.9f			\
+	 	atomic_dec_ushort_nv.9f			\
+	 	atomic_inc_16.9f			\
+	 	atomic_inc_16_nv.9f			\
+	 	atomic_inc_32.9f			\
+	 	atomic_inc_32_nv.9f			\
+	 	atomic_inc_64.9f			\
+	 	atomic_inc_64_nv.9f			\
+	 	atomic_inc_8.9f				\
+	 	atomic_inc_8_nv.9f			\
+	 	atomic_inc_ptr.9f			\
+	 	atomic_inc_ptr_nv.9f			\
+	 	atomic_inc_uchar.9f			\
+	 	atomic_inc_uchar_nv.9f			\
+	 	atomic_inc_uint.9f			\
+	 	atomic_inc_uint_nv.9f			\
+	 	atomic_inc_ulong.9f			\
+	 	atomic_inc_ulong_nv.9f			\
+	 	atomic_inc_ushort.9f			\
+	 	atomic_inc_ushort_nv.9f			\
+	 	atomic_or_16.9f				\
+	 	atomic_or_16_nv.9f			\
+	 	atomic_or_32.9f				\
+	 	atomic_or_32_nv.9f			\
+	 	atomic_or_64.9f				\
+	 	atomic_or_64_nv.9f			\
+	 	atomic_or_8.9f				\
+	 	atomic_or_8_nv.9f			\
+	 	atomic_or_uchar.9f			\
+	 	atomic_or_uchar_nv.9f			\
+	 	atomic_or_uint.9f			\
+	 	atomic_or_uint_nv.9f			\
+	 	atomic_or_ulong.9f			\
+	 	atomic_or_ulong_nv.9f			\
+	 	atomic_or_ushort.9f			\
+	 	atomic_or_ushort_nv.9f			\
+	 	atomic_set_long_excl.9f			\
+	 	atomic_swap_16.9f			\
+	 	atomic_swap_32.9f			\
+	 	atomic_swap_64.9f			\
+	 	atomic_swap_8.9f			\
+	 	atomic_swap_ptr.9f			\
+	 	atomic_swap_uchar.9f			\
+	 	atomic_swap_uint.9f			\
+	 	atomic_swap_ulong.9f			\
+	 	atomic_swap_ushort.9f			\
+	 	crgetgid.9f				\
+	 	crgetgroups.9f				\
+	 	crgetngroups.9f				\
+	 	crgetrgid.9f				\
+	 	crgetruid.9f				\
+	 	crgetsgid.9f				\
+	 	crgetsuid.9f				\
+	 	crgetuid.9f				\
+	 	crgetzoneid.9f				\
+	 	csx_Get16.9f				\
+	 	csx_Get32.9f				\
+	 	csx_Get64.9f				\
+	 	csx_GetEventMask.9f			\
+	 	csx_GetNextClient.9f			\
+	 	csx_GetNextTuple.9f			\
+	 	csx_Parse_CISTPL_DEVICE_A.9f		\
+	 	csx_Parse_CISTPL_DEVICE_OA.9f		\
+	 	csx_Parse_CISTPL_DEVICE_OC.9f		\
+	 	csx_Parse_CISTPL_JEDEC_A.9f		\
+	 	csx_Parse_CISTPL_LONGLINK_C.9f		\
+	 	csx_Put16.9f				\
+	 	csx_Put32.9f				\
+	 	csx_Put64.9f				\
+	 	csx_ReleaseIO.9f			\
+	 	csx_ReleaseIRQ.9f			\
+	 	csx_ReleaseSocketMask.9f		\
+	 	csx_ReleaseWindow.9f			\
+	 	csx_RemoveDeviceNode.9f			\
+	 	csx_RepGet16.9f				\
+	 	csx_RepGet32.9f				\
+	 	csx_RepGet64.9f				\
+	 	csx_RepPut16.9f				\
+	 	csx_RepPut32.9f				\
+	 	csx_RepPut64.9f				\
+	 	cv_broadcast.9f				\
+	 	cv_destroy.9f				\
+	 	cv_init.9f				\
+	 	cv_reltimedwait.9f			\
+	 	cv_reltimedwait_sig.9f			\
+	 	cv_signal.9f				\
+	 	cv_timedwait.9f				\
+	 	cv_timedwait_sig.9f			\
+	 	cv_wait.9f				\
+	 	cv_wait_sig.9f				\
+	 	ddi_btopr.9f				\
+	 	ddi_cb_unregister.9f			\
+	 	ddi_check_dma_handle.9f			\
+	 	ddi_devid_free.9f			\
+	 	ddi_devid_get.9f			\
+	 	ddi_devid_init.9f			\
+	 	ddi_devid_register.9f			\
+	 	ddi_devid_sizeof.9f			\
+	 	ddi_devid_str_decode.9f			\
+	 	ddi_devid_str_encode.9f			\
+	 	ddi_devid_str_free.9f			\
+	 	ddi_devid_unregister.9f			\
+	 	ddi_devid_valid.9f			\
+	 	ddi_devmap_segmap.9f			\
+	 	ddi_dmae_1stparty.9f			\
+	 	ddi_dmae_alloc.9f			\
+	 	ddi_dmae_disable.9f			\
+	 	ddi_dmae_enable.9f			\
+	 	ddi_dmae_getattr.9f			\
+	 	ddi_dmae_getcnt.9f			\
+	 	ddi_dmae_prog.9f			\
+	 	ddi_dmae_release.9f			\
+	 	ddi_dmae_stop.9f			\
+	 	ddi_exit_critical.9f			\
+	 	ddi_fls.9f				\
+	 	ddi_fm_capable.9f			\
+	 	ddi_fm_dma_err_clear.9f			\
+	 	ddi_fm_dma_err_get.9f			\
+	 	ddi_fm_fini.9f				\
+	 	ddi_fm_handler_unregister.9f		\
+	 	ddi_get16.9f				\
+	 	ddi_get32.9f				\
+	 	ddi_get64.9f				\
+	 	ddi_get_iblock_cookie.9f		\
+	 	ddi_get_lbolt64.9f			\
+	 	ddi_get_name.9f				\
+	 	ddi_get_soft_iblock_cookie.9f		\
+	 	ddi_get_soft_state.9f			\
+	 	ddi_getb.9f				\
+	 	ddi_getl.9f				\
+	 	ddi_getll.9f				\
+	 	ddi_getlongprop.9f			\
+	 	ddi_getlongprop_buf.9f			\
+	 	ddi_getprop.9f				\
+	 	ddi_getproplen.9f			\
+	 	ddi_getw.9f				\
+	 	ddi_intr_block_disable.9f		\
+	 	ddi_intr_block_enable.9f		\
+	 	ddi_intr_clr_mask.9f			\
+	 	ddi_intr_disable.9f			\
+	 	ddi_intr_free.9f			\
+	 	ddi_intr_get_navail.9f			\
+	 	ddi_intr_get_softint_pri.9f		\
+	 	ddi_intr_remove_handler.9f		\
+	 	ddi_intr_remove_softint.9f		\
+	 	ddi_intr_set_cap.9f			\
+	 	ddi_intr_set_pri.9f			\
+	 	ddi_intr_set_softint_pri.9f		\
+	 	ddi_intr_trigger_softint.9f		\
+	 	ddi_io_get16.9f				\
+	 	ddi_io_get32.9f				\
+	 	ddi_io_getb.9f				\
+	 	ddi_io_getl.9f				\
+	 	ddi_io_getw.9f				\
+	 	ddi_io_put16.9f				\
+	 	ddi_io_put32.9f				\
+	 	ddi_io_putb.9f				\
+	 	ddi_io_putl.9f				\
+	 	ddi_io_putw.9f				\
+	 	ddi_io_rep_get16.9f			\
+	 	ddi_io_rep_get32.9f			\
+	 	ddi_io_rep_getb.9f			\
+	 	ddi_io_rep_getl.9f			\
+	 	ddi_io_rep_getw.9f			\
+	 	ddi_io_rep_put16.9f			\
+	 	ddi_io_rep_put32.9f			\
+	 	ddi_io_rep_putb.9f			\
+	 	ddi_io_rep_putl.9f			\
+	 	ddi_io_rep_putw.9f			\
+	 	ddi_mem_get16.9f			\
+	 	ddi_mem_get32.9f			\
+	 	ddi_mem_get64.9f			\
+	 	ddi_mem_getb.9f				\
+	 	ddi_mem_getl.9f				\
+	 	ddi_mem_getll.9f			\
+	 	ddi_mem_getw.9f				\
+	 	ddi_mem_put16.9f			\
+	 	ddi_mem_put32.9f			\
+	 	ddi_mem_put64.9f			\
+	 	ddi_mem_putb.9f				\
+	 	ddi_mem_putl.9f				\
+	 	ddi_mem_putll.9f			\
+	 	ddi_mem_putw.9f				\
+	 	ddi_mem_rep_get16.9f			\
+	 	ddi_mem_rep_get32.9f			\
+	 	ddi_mem_rep_get64.9f			\
+	 	ddi_mem_rep_getb.9f			\
+	 	ddi_mem_rep_getl.9f			\
+	 	ddi_mem_rep_getll.9f			\
+	 	ddi_mem_rep_getw.9f			\
+	 	ddi_mem_rep_put16.9f			\
+	 	ddi_mem_rep_put32.9f			\
+	 	ddi_mem_rep_put64.9f			\
+	 	ddi_mem_rep_putb.9f			\
+	 	ddi_mem_rep_putl.9f			\
+	 	ddi_mem_rep_putll.9f			\
+	 	ddi_mem_rep_putw.9f			\
+	 	ddi_modclose.9f				\
+	 	ddi_modsym.9f				\
+	 	ddi_peek16.9f				\
+	 	ddi_peek32.9f				\
+	 	ddi_peek64.9f				\
+	 	ddi_peek8.9f				\
+	 	ddi_peekc.9f				\
+	 	ddi_peekd.9f				\
+	 	ddi_peekl.9f				\
+	 	ddi_peeks.9f				\
+	 	ddi_poke16.9f				\
+	 	ddi_poke32.9f				\
+	 	ddi_poke64.9f				\
+	 	ddi_poke8.9f				\
+	 	ddi_pokec.9f				\
+	 	ddi_poked.9f				\
+	 	ddi_pokel.9f				\
+	 	ddi_pokes.9f				\
+	 	ddi_prop_free.9f			\
+	 	ddi_prop_get_int64.9f			\
+	 	ddi_prop_lookup_byte_array.9f		\
+	 	ddi_prop_lookup_int64_array.9f		\
+	 	ddi_prop_lookup_int_array.9f		\
+	 	ddi_prop_lookup_string.9f		\
+	 	ddi_prop_lookup_string_array.9f		\
+	 	ddi_prop_modify.9f			\
+	 	ddi_prop_remove.9f			\
+	 	ddi_prop_remove_all.9f			\
+	 	ddi_prop_undefine.9f			\
+	 	ddi_prop_update_byte_array.9f		\
+	 	ddi_prop_update_int.9f			\
+	 	ddi_prop_update_int64.9f		\
+	 	ddi_prop_update_int64_array.9f		\
+	 	ddi_prop_update_int_array.9f		\
+	 	ddi_prop_update_string.9f		\
+	 	ddi_prop_update_string_array.9f		\
+	 	ddi_ptob.9f				\
+	 	ddi_put16.9f				\
+	 	ddi_put32.9f				\
+	 	ddi_put64.9f				\
+	 	ddi_putb.9f				\
+	 	ddi_putl.9f				\
+	 	ddi_putll.9f				\
+	 	ddi_putw.9f				\
+	 	ddi_remove_intr.9f			\
+	 	ddi_remove_softintr.9f			\
+	 	ddi_rep_get16.9f			\
+	 	ddi_rep_get32.9f			\
+	 	ddi_rep_get64.9f			\
+	 	ddi_rep_getb.9f				\
+	 	ddi_rep_getl.9f				\
+	 	ddi_rep_getll.9f			\
+	 	ddi_rep_getw.9f				\
+	 	ddi_rep_put16.9f			\
+	 	ddi_rep_put32.9f			\
+	 	ddi_rep_put64.9f			\
+	 	ddi_rep_putb.9f				\
+	 	ddi_rep_putl.9f				\
+	 	ddi_rep_putll.9f			\
+	 	ddi_rep_putw.9f				\
+	 	ddi_segmap_setup.9f			\
+	 	ddi_set_driver_private.9f		\
+	 	ddi_soft_state_fini.9f			\
+	 	ddi_soft_state_free.9f			\
+	 	ddi_soft_state_init.9f			\
+	 	ddi_soft_state_zalloc.9f		\
+	 	ddi_strdup.9f				\
+	 	ddi_strtoull.9f				\
+	 	ddi_taskq_create.9f			\
+	 	ddi_taskq_destroy.9f			\
+	 	ddi_taskq_dispatch.9f			\
+	 	ddi_taskq_resume.9f			\
+	 	ddi_taskq_suspend.9f			\
+	 	ddi_taskq_wait.9f			\
+	 	ddi_trigger_softintr.9f			\
+	 	ddi_umem_free.9f			\
+	 	ddi_umem_unlock.9f			\
+	 	ddi_unmap_regs.9f			\
+	 	desballoc.9f				\
+	 	dev_err.9f				\
+	 	devmap_load.9f				\
+	 	devmap_umem_setup.9f			\
+	 	dlerrorack.9f				\
+	 	dlokack.9f				\
+	 	dlphysaddrack.9f			\
+	 	dluderrorind.9f				\
+	 	free_pktiopb.9f				\
+	 	gld_intr.9f				\
+	 	gld_mac_alloc.9f			\
+	 	gld_mac_free.9f				\
+	 	gld_recv.9f				\
+	 	gld_register.9f				\
+	 	gld_sched.9f				\
+	 	gld_unregister.9f			\
+	 	id32_free.9f				\
+	 	id32_lookup.9f				\
+	 	inl.9f					\
+	 	intro.9f				\
+	 	inw.9f					\
+	 	kmem_cache_alloc.9f			\
+	 	kmem_cache_destroy.9f			\
+	 	kmem_cache_free.9f			\
+	 	kmem_cache_set_move.9f			\
+	 	kmem_free.9f				\
+	 	kmem_zalloc.9f				\
+	 	kstat_named_setstr.9f			\
+	 	kstat_runq_back_to_waitq.9f		\
+	 	kstat_runq_enter.9f			\
+	 	kstat_runq_exit.9f			\
+	 	kstat_waitq_enter.9f			\
+	 	kstat_waitq_exit.9f			\
+	 	kstat_waitq_to_runq.9f			\
+	 	ldi_awrite.9f				\
+	 	ldi_close.9f				\
+	 	ldi_get_devid.9f			\
+	 	ldi_get_minor_name.9f			\
+	 	ldi_get_otyp.9f				\
+	 	ldi_getmsg.9f				\
+	 	ldi_ident_from_dip.9f			\
+	 	ldi_ident_from_stream.9f		\
+	 	ldi_ident_release.9f			\
+	 	ldi_open_by_devid.9f			\
+	 	ldi_open_by_name.9f			\
+	 	ldi_prop_get_int64.9f			\
+	 	ldi_prop_lookup_byte_array.9f		\
+	 	ldi_prop_lookup_int64_array.9f		\
+	 	ldi_prop_lookup_string.9f		\
+	 	ldi_prop_lookup_string_array.9f		\
+	 	ldi_write.9f				\
+	 	list_destroy.9f				\
+	 	list_head.9f				\
+	 	list_insert_after.9f			\
+	 	list_insert_before.9f			\
+	 	list_insert_head.9f			\
+	 	list_insert_tail.9f			\
+	 	list_is_empty.9f			\
+	 	list_link_active.9f			\
+	 	list_link_init.9f			\
+	 	list_link_replace.9f			\
+	 	list_move_tail.9f			\
+	 	list_next.9f				\
+	 	list_prev.9f				\
+	 	list_remove.9f				\
+	 	list_remove_head.9f			\
+	 	list_remove_tail.9f			\
+	 	list_tail.9f				\
+	 	makecom_g0.9f				\
+	 	makecom_g0_s.9f				\
+	 	makecom_g1.9f				\
+	 	makecom_g5.9f				\
+	 	membar_consumer.9f			\
+	 	membar_enter.9f				\
+	 	membar_exit.9f				\
+	 	membar_producer.9f			\
+	 	memcmp.9f				\
+	 	memcpy.9f				\
+	 	memmove.9f				\
+	 	memset.9f				\
+	 	minphys.9f				\
+	 	mod_info.9f				\
+	 	mod_modname.9f				\
+	 	mod_remove.9f				\
+	 	mutex_destroy.9f			\
+	 	mutex_enter.9f				\
+	 	mutex_exit.9f				\
+	 	mutex_init.9f				\
+	 	mutex_owned.9f				\
+	 	mutex_tryenter.9f			\
+	 	net_event_notify_unregister.9f		\
+	 	net_instance_notify_unregister.9f	\
+	 	net_instance_protocol_unregister.9f	\
+	 	numtos.9f				\
+	 	nv_alloc_fini.9f			\
+	 	nv_alloc_init.9f			\
+	 	nvlist_add_boolean_array.9f		\
+	 	nvlist_add_boolean_value.9f		\
+	 	nvlist_add_byte.9f			\
+	 	nvlist_add_byte_array.9f		\
+	 	nvlist_add_int16.9f			\
+	 	nvlist_add_int16_array.9f		\
+	 	nvlist_add_int32.9f			\
+	 	nvlist_add_int32_array.9f		\
+	 	nvlist_add_int64.9f			\
+	 	nvlist_add_int64_array.9f		\
+	 	nvlist_add_int8.9f			\
+	 	nvlist_add_int8_array.9f		\
+	 	nvlist_add_nvlist.9f			\
+	 	nvlist_add_nvlist_array.9f		\
+	 	nvlist_add_nvpair.9f			\
+	 	nvlist_add_string.9f			\
+	 	nvlist_add_string_array.9f		\
+	 	nvlist_add_uint16.9f			\
+	 	nvlist_add_uint16_array.9f		\
+	 	nvlist_add_uint32.9f			\
+	 	nvlist_add_uint32_array.9f		\
+	 	nvlist_add_uint64.9f			\
+	 	nvlist_add_uint64_array.9f		\
+	 	nvlist_add_uint8.9f			\
+	 	nvlist_add_uint8_array.9f		\
+	 	nvlist_dup.9f				\
+	 	nvlist_exists.9f			\
+	 	nvlist_free.9f				\
+	 	nvlist_lookup_boolean_array.9f		\
+	 	nvlist_lookup_boolean_value.9f		\
+	 	nvlist_lookup_byte.9f			\
+	 	nvlist_lookup_byte_array.9f		\
+	 	nvlist_lookup_int16.9f			\
+	 	nvlist_lookup_int16_array.9f		\
+	 	nvlist_lookup_int32.9f			\
+	 	nvlist_lookup_int32_array.9f		\
+	 	nvlist_lookup_int64.9f			\
+	 	nvlist_lookup_int64_array.9f		\
+	 	nvlist_lookup_int8.9f			\
+	 	nvlist_lookup_int8_array.9f		\
+	 	nvlist_lookup_nvlist.9f			\
+	 	nvlist_lookup_nvlist_array.9f		\
+	 	nvlist_lookup_pairs.9f			\
+	 	nvlist_lookup_string.9f			\
+	 	nvlist_lookup_string_array.9f		\
+	 	nvlist_lookup_uint16.9f			\
+	 	nvlist_lookup_uint16_array.9f		\
+	 	nvlist_lookup_uint32.9f			\
+	 	nvlist_lookup_uint32_array.9f		\
+	 	nvlist_lookup_uint64.9f			\
+	 	nvlist_lookup_uint64_array.9f		\
+	 	nvlist_lookup_uint8.9f			\
+	 	nvlist_lookup_uint8_array.9f		\
+	 	nvlist_merge.9f				\
+	 	nvlist_pack.9f				\
+	 	nvlist_remove_all.9f			\
+	 	nvlist_size.9f				\
+	 	nvlist_t.9f				\
+	 	nvlist_unpack.9f			\
+	 	nvlist_xalloc.9f			\
+	 	nvlist_xdup.9f				\
+	 	nvlist_xpack.9f				\
+	 	nvlist_xunpack.9f			\
+	 	nvpair_name.9f				\
+	 	nvpair_type.9f				\
+	 	nvpair_value_boolean_array.9f		\
+	 	nvpair_value_byte_array.9f		\
+	 	nvpair_value_int16.9f			\
+	 	nvpair_value_int16_array.9f		\
+	 	nvpair_value_int32.9f			\
+	 	nvpair_value_int32_array.9f		\
+	 	nvpair_value_int64.9f			\
+	 	nvpair_value_int64_array.9f		\
+	 	nvpair_value_int8.9f			\
+	 	nvpair_value_int8_array.9f		\
+	 	nvpair_value_nvlist.9f			\
+	 	nvpair_value_nvlist_array.9f		\
+	 	nvpair_value_string.9f			\
+	 	nvpair_value_string_array.9f		\
+	 	nvpair_value_uint16.9f			\
+	 	nvpair_value_uint16_array.9f		\
+	 	nvpair_value_uint32.9f			\
+	 	nvpair_value_uint32_array.9f		\
+	 	nvpair_value_uint64.9f			\
+	 	nvpair_value_uint64_array.9f		\
+	 	nvpair_value_uint8.9f			\
+	 	nvpair_value_uint8_array.9f		\
+	 	otherq.9f				\
+	 	outl.9f					\
+	 	outw.9f					\
+	 	pci_config_get16.9f			\
+	 	pci_config_get32.9f			\
+	 	pci_config_get64.9f			\
+	 	pci_config_getb.9f			\
+	 	pci_config_getl.9f			\
+	 	pci_config_getll.9f			\
+	 	pci_config_getw.9f			\
+	 	pci_config_put16.9f			\
+	 	pci_config_put32.9f			\
+	 	pci_config_put64.9f			\
+	 	pci_config_put8.9f			\
+	 	pci_config_putb.9f			\
+	 	pci_config_putl.9f			\
+	 	pci_config_putll.9f			\
+	 	pci_config_putw.9f			\
+	 	pci_config_teardown.9f			\
+	 	pci_ereport_post.9f			\
+	 	pci_ereport_teardown.9f			\
+	 	pci_restore_config_regs.9f		\
+	 	pm_idle_component.9f			\
+	 	pm_lower_power.9f			\
+	 	priv_policy_choice.9f			\
+	 	priv_policy_only.9f			\
+	 	proc_ref.9f				\
+	 	proc_unref.9f				\
+	 	qprocsoff.9f				\
+	 	qwait_sig.9f				\
+	 	rd.9f					\
+	 	repinsb.9f				\
+	 	repinsd.9f				\
+	 	repinsw.9f				\
+	 	repoutsb.9f				\
+	 	repoutsd.9f				\
+	 	repoutsw.9f				\
+	 	rmallocmap_wait.9f			\
+	 	rmfreemap.9f				\
+	 	rw_destroy.9f				\
+	 	rw_downgrade.9f				\
+	 	rw_enter.9f				\
+	 	rw_exit.9f				\
+	 	rw_init.9f				\
+	 	rw_read_locked.9f			\
+	 	rw_tryenter.9f				\
+	 	rw_tryupgrade.9f			\
+	 	samestr.9f				\
+	 	scsi_dmafree.9f				\
+	 	scsi_dname.9f				\
+	 	scsi_hba_detach.9f			\
+	 	scsi_hba_fini.9f			\
+	 	scsi_hba_pkt_free.9f			\
+	 	scsi_hba_tran_free.9f			\
+	 	scsi_ifsetcap.9f			\
+	 	scsi_mname.9f				\
+	 	scsi_pktfree.9f				\
+	 	scsi_resalloc.9f			\
+	 	scsi_resfree.9f				\
+	 	scsi_rname.9f				\
+	 	scsi_sense_asc.9f			\
+	 	scsi_sense_ascq.9f			\
+	 	scsi_sense_cmdspecific_uint64.9f	\
+	 	scsi_sense_info_uint64.9f		\
+	 	scsi_sname.9f				\
+	 	scsi_unslave.9f				\
+	 	sema_destroy.9f				\
+	 	sema_init.9f				\
+	 	sema_p.9f				\
+	 	sema_p_sig.9f				\
+	 	sema_tryp.9f				\
+	 	sema_v.9f				\
+	 	strcasecmp.9f				\
+	 	strchr.9f				\
+	 	strcmp.9f				\
+	 	strcpy.9f				\
+	 	strdup.9f				\
+	 	strfree.9f				\
+	 	strlcat.9f				\
+	 	strlcpy.9f				\
+	 	strlen.9f				\
+	 	strncasecmp.9f				\
+	 	strncat.9f				\
+	 	strncmp.9f				\
+	 	strncpy.9f				\
+	 	strnlen.9f				\
+	 	strrchr.9f				\
+	 	strspn.9f				\
+	 	taskq_suspended.9f			\
+	 	uconv_u16tou8.9f			\
+	 	uconv_u32tou16.9f			\
+	 	uconv_u32tou8.9f			\
+	 	uconv_u8tou16.9f			\
+	 	uconv_u8tou32.9f			\
+	 	unfreezestr.9f				\
+	 	usb_alloc_bulk_req.9f			\
+	 	usb_alloc_ctrl_req.9f			\
+	 	usb_alloc_intr_req.9f			\
+	 	usb_alloc_isoc_req.9f			\
+	 	usb_client_detach.9f			\
+	 	usb_free_bulk_req.9f			\
+	 	usb_free_ctrl_req.9f			\
+	 	usb_free_descr_tree.9f			\
+	 	usb_free_dev_data.9f			\
+	 	usb_free_intr_req.9f			\
+	 	usb_free_isoc_req.9f			\
+	 	usb_get_if_number.9f			\
+	 	usb_owns_device.9f			\
+	 	usb_pipe_ctrl_xfer_wait.9f		\
+	 	usb_pipe_get_private.9f			\
+	 	usb_pipe_stop_intr_polling.9f		\
+	 	usb_pipe_stop_isoc_polling.9f		\
+	 	usb_print_descr_tree.9f			\
+	 	usb_set_alt_if.9f			\
+	 	usb_set_cfg.9f				\
+	 	usb_unregister_hotplug_cbs.9f		\
+	 	va_copy.9f				\
+	 	va_end.9f				\
+	 	va_start.9f				\
+	 	vcmn_err.9f				\
+	 	vzcmn_err.9f				\
+	 	wr.9f					\
+	 	zcmn_err.9f
+
+assert.9f				:= LINKSRC = ASSERT.9f
+
+intro.9f				:= LINKSRC = Intro.9f
+
+otherq.9f				:= LINKSRC = OTHERQ.9f
+
+rd.9f					:= LINKSRC = RD.9f
+
+samestr.9f				:= LINKSRC = SAMESTR.9f
+
+SIZEOF_PTR.9f				:= LINKSRC = STRUCT_DECL.9f
+SIZEOF_STRUCT.9f			:= LINKSRC = STRUCT_DECL.9f
+STRUCT_BUF.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_FADDR.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_FGET.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_FGETP.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_FSET.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_FSETP.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_HANDLE.9f			:= LINKSRC = STRUCT_DECL.9f
+STRUCT_INIT.9f				:= LINKSRC = STRUCT_DECL.9f
+STRUCT_SET_HANDLE.9f			:= LINKSRC = STRUCT_DECL.9f
+STRUCT_SIZE.9f				:= LINKSRC = STRUCT_DECL.9f
+
+wr.9f					:= LINKSRC = WR.9f
+
+atomic_add_16.9f			:= LINKSRC = atomic_add.9f
+atomic_add_16_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_32.9f			:= LINKSRC = atomic_add.9f
+atomic_add_32_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_64.9f			:= LINKSRC = atomic_add.9f
+atomic_add_64_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_8.9f				:= LINKSRC = atomic_add.9f
+atomic_add_8_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_char.9f			:= LINKSRC = atomic_add.9f
+atomic_add_char_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_int.9f			:= LINKSRC = atomic_add.9f
+atomic_add_int_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_long.9f			:= LINKSRC = atomic_add.9f
+atomic_add_long_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_ptr.9f			:= LINKSRC = atomic_add.9f
+atomic_add_ptr_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_add_short.9f			:= LINKSRC = atomic_add.9f
+atomic_add_short_nv.9f			:= LINKSRC = atomic_add.9f
+atomic_and_16.9f			:= LINKSRC = atomic_and.9f
+atomic_and_16_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_32.9f			:= LINKSRC = atomic_and.9f
+atomic_and_32_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_64.9f			:= LINKSRC = atomic_and.9f
+atomic_and_64_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_8.9f				:= LINKSRC = atomic_and.9f
+atomic_and_8_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_uchar.9f			:= LINKSRC = atomic_and.9f
+atomic_and_uchar_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_uint.9f			:= LINKSRC = atomic_and.9f
+atomic_and_uint_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_ulong.9f			:= LINKSRC = atomic_and.9f
+atomic_and_ulong_nv.9f			:= LINKSRC = atomic_and.9f
+atomic_and_ushort.9f			:= LINKSRC = atomic_and.9f
+atomic_and_ushort_nv.9f			:= LINKSRC = atomic_and.9f
+
+atomic_clear_long_excl.9f		:= LINKSRC = atomic_bits.9f
+atomic_set_long_excl.9f			:= LINKSRC = atomic_bits.9f
+
+atomic_cas_16.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_32.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_64.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_8.9f				:= LINKSRC = atomic_cas.9f
+atomic_cas_ptr.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_uchar.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_uint.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_ulong.9f			:= LINKSRC = atomic_cas.9f
+atomic_cas_ushort.9f			:= LINKSRC = atomic_cas.9f
+
+atomic_dec_16.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_16_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_32.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_32_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_64.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_64_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_8.9f				:= LINKSRC = atomic_dec.9f
+atomic_dec_8_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ptr.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ptr_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_uchar.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_uchar_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_uint.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_uint_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ulong.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ulong_nv.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ushort.9f			:= LINKSRC = atomic_dec.9f
+atomic_dec_ushort_nv.9f			:= LINKSRC = atomic_dec.9f
+
+atomic_inc_16.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_16_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_32.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_32_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_64.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_64_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_8.9f				:= LINKSRC = atomic_inc.9f
+atomic_inc_8_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ptr.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ptr_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_uchar.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_uchar_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_uint.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_uint_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ulong.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ulong_nv.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ushort.9f			:= LINKSRC = atomic_inc.9f
+atomic_inc_ushort_nv.9f			:= LINKSRC = atomic_inc.9f
+
+atomic_or_16.9f				:= LINKSRC = atomic_or.9f
+atomic_or_16_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_32.9f				:= LINKSRC = atomic_or.9f
+atomic_or_32_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_64.9f				:= LINKSRC = atomic_or.9f
+atomic_or_64_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_8.9f				:= LINKSRC = atomic_or.9f
+atomic_or_8_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_uchar.9f			:= LINKSRC = atomic_or.9f
+atomic_or_uchar_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_uint.9f			:= LINKSRC = atomic_or.9f
+atomic_or_uint_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_ulong.9f			:= LINKSRC = atomic_or.9f
+atomic_or_ulong_nv.9f			:= LINKSRC = atomic_or.9f
+atomic_or_ushort.9f			:= LINKSRC = atomic_or.9f
+atomic_or_ushort_nv.9f			:= LINKSRC = atomic_or.9f
+
+atomic_swap_16.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_32.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_64.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_8.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_ptr.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_uchar.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_uint.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_ulong.9f			:= LINKSRC = atomic_swap.9f
+atomic_swap_ushort.9f			:= LINKSRC = atomic_swap.9f
+
+dev_err.9f				:= LINKSRC = cmn_err.9f
+vcmn_err.9f				:= LINKSRC = cmn_err.9f
+vzcmn_err.9f				:= LINKSRC = cmn_err.9f
+zcmn_err.9f				:= LINKSRC = cmn_err.9f
+
+cv_broadcast.9f				:= LINKSRC = condvar.9f
+cv_destroy.9f				:= LINKSRC = condvar.9f
+cv_init.9f				:= LINKSRC = condvar.9f
+cv_reltimedwait.9f			:= LINKSRC = condvar.9f
+cv_reltimedwait_sig.9f			:= LINKSRC = condvar.9f
+cv_signal.9f				:= LINKSRC = condvar.9f
+cv_timedwait.9f				:= LINKSRC = condvar.9f
+cv_timedwait_sig.9f			:= LINKSRC = condvar.9f
+cv_wait.9f				:= LINKSRC = condvar.9f
+cv_wait_sig.9f				:= LINKSRC = condvar.9f
+
+csx_Get16.9f				:= LINKSRC = csx_Get8.9f
+csx_Get32.9f				:= LINKSRC = csx_Get8.9f
+csx_Get64.9f				:= LINKSRC = csx_Get8.9f
+
+csx_GetNextClient.9f			:= LINKSRC = csx_GetFirstClient.9f
+
+csx_GetNextTuple.9f			:= LINKSRC = csx_GetFirstTuple.9f
+
+csx_RemoveDeviceNode.9f			:= LINKSRC = csx_MakeDeviceNode.9f
+
+csx_Parse_CISTPL_DEVICE_A.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
+csx_Parse_CISTPL_DEVICE_OA.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
+csx_Parse_CISTPL_DEVICE_OC.9f		:= LINKSRC = csx_Parse_CISTPL_DEVICE.9f
+
+csx_Parse_CISTPL_JEDEC_A.9f		:= LINKSRC = csx_Parse_CISTPL_JEDEC_C.9f
+
+csx_Parse_CISTPL_LONGLINK_C.9f		:= LINKSRC = csx_Parse_CISTPL_LONGLINK_A.9f
+
+csx_Put16.9f				:= LINKSRC = csx_Put8.9f
+csx_Put32.9f				:= LINKSRC = csx_Put8.9f
+csx_Put64.9f				:= LINKSRC = csx_Put8.9f
+
+csx_RepGet16.9f				:= LINKSRC = csx_RepGet8.9f
+csx_RepGet32.9f				:= LINKSRC = csx_RepGet8.9f
+csx_RepGet64.9f				:= LINKSRC = csx_RepGet8.9f
+
+csx_RepPut16.9f				:= LINKSRC = csx_RepPut8.9f
+csx_RepPut32.9f				:= LINKSRC = csx_RepPut8.9f
+csx_RepPut64.9f				:= LINKSRC = csx_RepPut8.9f
+
+csx_ReleaseIO.9f			:= LINKSRC = csx_RequestIO.9f
+
+csx_ReleaseIRQ.9f			:= LINKSRC = csx_RequestIRQ.9f
+
+csx_ReleaseSocketMask.9f		:= LINKSRC = csx_RequestSocketMask.9f
+
+csx_ReleaseWindow.9f			:= LINKSRC = csx_RequestWindow.9f
+
+csx_GetEventMask.9f			:= LINKSRC = csx_SetEventMask.9f
+
+ddi_get_iblock_cookie.9f		:= LINKSRC = ddi_add_intr.9f
+ddi_remove_intr.9f			:= LINKSRC = ddi_add_intr.9f
+
+ddi_get_soft_iblock_cookie.9f		:= LINKSRC = ddi_add_softintr.9f
+ddi_remove_softintr.9f			:= LINKSRC = ddi_add_softintr.9f
+ddi_trigger_softintr.9f			:= LINKSRC = ddi_add_softintr.9f
+
+ddi_get_name.9f				:= LINKSRC = ddi_binding_name.9f
+
+ddi_btopr.9f				:= LINKSRC = ddi_btop.9f
+ddi_ptob.9f				:= LINKSRC = ddi_btop.9f
+
+ddi_cb_unregister.9f			:= LINKSRC = ddi_cb_register.9f
+
+ddi_check_dma_handle.9f			:= LINKSRC = ddi_check_acc_handle.9f
+
+crgetgid.9f				:= LINKSRC = ddi_cred.9f
+crgetgroups.9f				:= LINKSRC = ddi_cred.9f
+crgetngroups.9f				:= LINKSRC = ddi_cred.9f
+crgetrgid.9f				:= LINKSRC = ddi_cred.9f
+crgetruid.9f				:= LINKSRC = ddi_cred.9f
+crgetsgid.9f				:= LINKSRC = ddi_cred.9f
+crgetsuid.9f				:= LINKSRC = ddi_cred.9f
+crgetuid.9f				:= LINKSRC = ddi_cred.9f
+crgetzoneid.9f				:= LINKSRC = ddi_cred.9f
+
+ddi_devid_free.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_get.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_init.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_register.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_sizeof.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_str_decode.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_str_encode.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_str_free.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_unregister.9f			:= LINKSRC = ddi_devid_compare.9f
+ddi_devid_valid.9f			:= LINKSRC = ddi_devid_compare.9f
+
+ddi_dmae_1stparty.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_alloc.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_disable.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_enable.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_getattr.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_getcnt.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_prog.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_release.9f			:= LINKSRC = ddi_dmae.9f
+ddi_dmae_stop.9f			:= LINKSRC = ddi_dmae.9f
+
+ddi_exit_critical.9f			:= LINKSRC = ddi_enter_critical.9f
+
+ddi_fls.9f				:= LINKSRC = ddi_ffs.9f
+
+ddi_fm_dma_err_clear.9f			:= LINKSRC = ddi_fm_acc_err_clear.9f
+
+ddi_fm_dma_err_get.9f			:= LINKSRC = ddi_fm_acc_err_get.9f
+
+ddi_fm_handler_unregister.9f		:= LINKSRC = ddi_fm_handler_register.9f
+
+ddi_fm_capable.9f			:= LINKSRC = ddi_fm_init.9f
+ddi_fm_fini.9f				:= LINKSRC = ddi_fm_init.9f
+
+ddi_get16.9f				:= LINKSRC = ddi_get8.9f
+ddi_get32.9f				:= LINKSRC = ddi_get8.9f
+ddi_get64.9f				:= LINKSRC = ddi_get8.9f
+ddi_getb.9f				:= LINKSRC = ddi_get8.9f
+ddi_getl.9f				:= LINKSRC = ddi_get8.9f
+ddi_getll.9f				:= LINKSRC = ddi_get8.9f
+ddi_getw.9f				:= LINKSRC = ddi_get8.9f
+
+ddi_set_driver_private.9f		:= LINKSRC = ddi_get_driver_private.9f
+
+ddi_get_lbolt64.9f			:= LINKSRC = ddi_get_lbolt.9f
+
+ddi_intr_remove_handler.9f		:= LINKSRC = ddi_intr_add_handler.9f
+
+ddi_intr_get_softint_pri.9f		:= LINKSRC = ddi_intr_add_softint.9f
+ddi_intr_remove_softint.9f		:= LINKSRC = ddi_intr_add_softint.9f
+ddi_intr_set_softint_pri.9f		:= LINKSRC = ddi_intr_add_softint.9f
+ddi_intr_trigger_softint.9f		:= LINKSRC = ddi_intr_add_softint.9f
+
+ddi_intr_free.9f			:= LINKSRC = ddi_intr_alloc.9f
+
+ddi_intr_block_disable.9f		:= LINKSRC = ddi_intr_enable.9f
+ddi_intr_block_enable.9f		:= LINKSRC = ddi_intr_enable.9f
+ddi_intr_disable.9f			:= LINKSRC = ddi_intr_enable.9f
+
+ddi_intr_set_cap.9f			:= LINKSRC = ddi_intr_get_cap.9f
+
+ddi_intr_get_navail.9f			:= LINKSRC = ddi_intr_get_nintrs.9f
+
+ddi_intr_set_pri.9f			:= LINKSRC = ddi_intr_get_pri.9f
+
+ddi_intr_clr_mask.9f			:= LINKSRC = ddi_intr_set_mask.9f
+
+ddi_io_get16.9f				:= LINKSRC = ddi_io_get8.9f
+ddi_io_get32.9f				:= LINKSRC = ddi_io_get8.9f
+ddi_io_getb.9f				:= LINKSRC = ddi_io_get8.9f
+ddi_io_getl.9f				:= LINKSRC = ddi_io_get8.9f
+ddi_io_getw.9f				:= LINKSRC = ddi_io_get8.9f
+
+ddi_io_put16.9f				:= LINKSRC = ddi_io_put8.9f
+ddi_io_put32.9f				:= LINKSRC = ddi_io_put8.9f
+ddi_io_putb.9f				:= LINKSRC = ddi_io_put8.9f
+ddi_io_putl.9f				:= LINKSRC = ddi_io_put8.9f
+ddi_io_putw.9f				:= LINKSRC = ddi_io_put8.9f
+
+ddi_io_rep_get16.9f			:= LINKSRC = ddi_io_rep_get8.9f
+ddi_io_rep_get32.9f			:= LINKSRC = ddi_io_rep_get8.9f
+ddi_io_rep_getb.9f			:= LINKSRC = ddi_io_rep_get8.9f
+ddi_io_rep_getl.9f			:= LINKSRC = ddi_io_rep_get8.9f
+ddi_io_rep_getw.9f			:= LINKSRC = ddi_io_rep_get8.9f
+
+ddi_io_rep_put16.9f			:= LINKSRC = ddi_io_rep_put8.9f
+ddi_io_rep_put32.9f			:= LINKSRC = ddi_io_rep_put8.9f
+ddi_io_rep_putb.9f			:= LINKSRC = ddi_io_rep_put8.9f
+ddi_io_rep_putl.9f			:= LINKSRC = ddi_io_rep_put8.9f
+ddi_io_rep_putw.9f			:= LINKSRC = ddi_io_rep_put8.9f
+
+ddi_unmap_regs.9f			:= LINKSRC = ddi_map_regs.9f
+
+ddi_mem_get16.9f			:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_get32.9f			:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_get64.9f			:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_getb.9f				:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_getl.9f				:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_getll.9f			:= LINKSRC = ddi_mem_get8.9f
+ddi_mem_getw.9f				:= LINKSRC = ddi_mem_get8.9f
+
+ddi_mem_put16.9f			:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_put32.9f			:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_put64.9f			:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_putb.9f				:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_putl.9f				:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_putll.9f			:= LINKSRC = ddi_mem_put8.9f
+ddi_mem_putw.9f				:= LINKSRC = ddi_mem_put8.9f
+
+ddi_mem_rep_get16.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_get32.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_get64.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_getb.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_getl.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_getll.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+ddi_mem_rep_getw.9f			:= LINKSRC = ddi_mem_rep_get8.9f
+
+ddi_mem_rep_put16.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_put32.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_put64.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_putb.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_putl.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_putll.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+ddi_mem_rep_putw.9f			:= LINKSRC = ddi_mem_rep_put8.9f
+
+ddi_modclose.9f				:= LINKSRC = ddi_modopen.9f
+ddi_modsym.9f				:= LINKSRC = ddi_modopen.9f
+
+ddi_peek16.9f				:= LINKSRC = ddi_peek.9f
+ddi_peek32.9f				:= LINKSRC = ddi_peek.9f
+ddi_peek64.9f				:= LINKSRC = ddi_peek.9f
+ddi_peek8.9f				:= LINKSRC = ddi_peek.9f
+ddi_peekc.9f				:= LINKSRC = ddi_peek.9f
+ddi_peekd.9f				:= LINKSRC = ddi_peek.9f
+ddi_peekl.9f				:= LINKSRC = ddi_peek.9f
+ddi_peeks.9f				:= LINKSRC = ddi_peek.9f
+
+ddi_poke16.9f				:= LINKSRC = ddi_poke.9f
+ddi_poke32.9f				:= LINKSRC = ddi_poke.9f
+ddi_poke64.9f				:= LINKSRC = ddi_poke.9f
+ddi_poke8.9f				:= LINKSRC = ddi_poke.9f
+ddi_pokec.9f				:= LINKSRC = ddi_poke.9f
+ddi_poked.9f				:= LINKSRC = ddi_poke.9f
+ddi_pokel.9f				:= LINKSRC = ddi_poke.9f
+ddi_pokes.9f				:= LINKSRC = ddi_poke.9f
+
+ddi_prop_modify.9f			:= LINKSRC = ddi_prop_create.9f
+ddi_prop_remove.9f			:= LINKSRC = ddi_prop_create.9f
+ddi_prop_remove_all.9f			:= LINKSRC = ddi_prop_create.9f
+ddi_prop_undefine.9f			:= LINKSRC = ddi_prop_create.9f
+
+ddi_prop_get_int64.9f			:= LINKSRC = ddi_prop_get_int.9f
+
+ddi_prop_free.9f			:= LINKSRC = ddi_prop_lookup.9f
+ddi_prop_lookup_byte_array.9f		:= LINKSRC = ddi_prop_lookup.9f
+ddi_prop_lookup_int64_array.9f		:= LINKSRC = ddi_prop_lookup.9f
+ddi_prop_lookup_int_array.9f		:= LINKSRC = ddi_prop_lookup.9f
+ddi_prop_lookup_string.9f		:= LINKSRC = ddi_prop_lookup.9f
+ddi_prop_lookup_string_array.9f		:= LINKSRC = ddi_prop_lookup.9f
+
+ddi_getlongprop.9f			:= LINKSRC = ddi_prop_op.9f
+ddi_getlongprop_buf.9f			:= LINKSRC = ddi_prop_op.9f
+ddi_getprop.9f				:= LINKSRC = ddi_prop_op.9f
+ddi_getproplen.9f			:= LINKSRC = ddi_prop_op.9f
+
+ddi_prop_update_byte_array.9f		:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_int.9f			:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_int64.9f		:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_int64_array.9f		:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_int_array.9f		:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_string.9f		:= LINKSRC = ddi_prop_update.9f
+ddi_prop_update_string_array.9f		:= LINKSRC = ddi_prop_update.9f
+
+ddi_put16.9f				:= LINKSRC = ddi_put8.9f
+ddi_put32.9f				:= LINKSRC = ddi_put8.9f
+ddi_put64.9f				:= LINKSRC = ddi_put8.9f
+ddi_putb.9f				:= LINKSRC = ddi_put8.9f
+ddi_putl.9f				:= LINKSRC = ddi_put8.9f
+ddi_putll.9f				:= LINKSRC = ddi_put8.9f
+ddi_putw.9f				:= LINKSRC = ddi_put8.9f
+
+ddi_rep_get16.9f			:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_get32.9f			:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_get64.9f			:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_getb.9f				:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_getl.9f				:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_getll.9f			:= LINKSRC = ddi_rep_get8.9f
+ddi_rep_getw.9f				:= LINKSRC = ddi_rep_get8.9f
+
+ddi_rep_put16.9f			:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_put32.9f			:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_put64.9f			:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_putb.9f				:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_putl.9f				:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_putll.9f			:= LINKSRC = ddi_rep_put8.9f
+ddi_rep_putw.9f				:= LINKSRC = ddi_rep_put8.9f
+
+ddi_segmap_setup.9f			:= LINKSRC = ddi_segmap.9f
+
+ddi_get_soft_state.9f			:= LINKSRC = ddi_soft_state.9f
+ddi_soft_state_fini.9f			:= LINKSRC = ddi_soft_state.9f
+ddi_soft_state_free.9f			:= LINKSRC = ddi_soft_state.9f
+ddi_soft_state_init.9f			:= LINKSRC = ddi_soft_state.9f
+ddi_soft_state_zalloc.9f		:= LINKSRC = ddi_soft_state.9f
+
+ddi_strtoull.9f				:= LINKSRC = ddi_strtoll.9f
+
+ddi_umem_free.9f			:= LINKSRC = ddi_umem_alloc.9f
+
+ddi_umem_unlock.9f			:= LINKSRC = ddi_umem_lock.9f
+
+devmap_umem_setup.9f			:= LINKSRC = devmap_devmem_setup.9f
+
+ddi_devmap_segmap.9f			:= LINKSRC = devmap_setup.9f
+
+devmap_load.9f				:= LINKSRC = devmap_unload.9f
+
+dlerrorack.9f				:= LINKSRC = dlbindack.9f
+dlokack.9f				:= LINKSRC = dlbindack.9f
+dlphysaddrack.9f			:= LINKSRC = dlbindack.9f
+dluderrorind.9f				:= LINKSRC = dlbindack.9f
+
+desballoc.9f				:= LINKSRC = esballoc.9f
+
+unfreezestr.9f				:= LINKSRC = freezestr.9f
+
+free_pktiopb.9f				:= LINKSRC = get_pktiopb.9f
+
+gld_intr.9f				:= LINKSRC = gld.9f
+gld_mac_alloc.9f			:= LINKSRC = gld.9f
+gld_mac_free.9f				:= LINKSRC = gld.9f
+gld_recv.9f				:= LINKSRC = gld.9f
+gld_register.9f				:= LINKSRC = gld.9f
+gld_sched.9f				:= LINKSRC = gld.9f
+gld_unregister.9f			:= LINKSRC = gld.9f
+
+id32_free.9f				:= LINKSRC = id32_alloc.9f
+id32_lookup.9f				:= LINKSRC = id32_alloc.9f
+
+inl.9f					:= LINKSRC = inb.9f
+inw.9f					:= LINKSRC = inb.9f
+repinsb.9f				:= LINKSRC = inb.9f
+repinsd.9f				:= LINKSRC = inb.9f
+repinsw.9f				:= LINKSRC = inb.9f
+
+kmem_free.9f				:= LINKSRC = kmem_alloc.9f
+kmem_zalloc.9f				:= LINKSRC = kmem_alloc.9f
+
+kmem_cache_alloc.9f			:= LINKSRC = kmem_cache_create.9f
+kmem_cache_destroy.9f			:= LINKSRC = kmem_cache_create.9f
+kmem_cache_free.9f			:= LINKSRC = kmem_cache_create.9f
+kmem_cache_set_move.9f			:= LINKSRC = kmem_cache_create.9f
+
+kstat_named_setstr.9f			:= LINKSRC = kstat_named_init.9f
+
+kstat_runq_back_to_waitq.9f		:= LINKSRC = kstat_queue.9f
+kstat_runq_enter.9f			:= LINKSRC = kstat_queue.9f
+kstat_runq_exit.9f			:= LINKSRC = kstat_queue.9f
+kstat_waitq_enter.9f			:= LINKSRC = kstat_queue.9f
+kstat_waitq_exit.9f			:= LINKSRC = kstat_queue.9f
+kstat_waitq_to_runq.9f			:= LINKSRC = kstat_queue.9f
+
+ldi_awrite.9f				:= LINKSRC = ldi_aread.9f
+
+ldi_get_devid.9f			:= LINKSRC = ldi_get_dev.9f
+ldi_get_minor_name.9f			:= LINKSRC = ldi_get_dev.9f
+ldi_get_otyp.9f				:= LINKSRC = ldi_get_dev.9f
+
+ldi_ident_from_dip.9f			:= LINKSRC = ldi_ident_from_dev.9f
+ldi_ident_from_stream.9f		:= LINKSRC = ldi_ident_from_dev.9f
+ldi_ident_release.9f			:= LINKSRC = ldi_ident_from_dev.9f
+
+ldi_close.9f				:= LINKSRC = ldi_open_by_dev.9f
+ldi_open_by_devid.9f			:= LINKSRC = ldi_open_by_dev.9f
+ldi_open_by_name.9f			:= LINKSRC = ldi_open_by_dev.9f
+
+ldi_prop_get_int64.9f			:= LINKSRC = ldi_prop_get_int.9f
+
+ldi_prop_lookup_byte_array.9f		:= LINKSRC = ldi_prop_lookup_int_array.9f
+ldi_prop_lookup_int64_array.9f		:= LINKSRC = ldi_prop_lookup_int_array.9f
+ldi_prop_lookup_string.9f		:= LINKSRC = ldi_prop_lookup_int_array.9f
+ldi_prop_lookup_string_array.9f		:= LINKSRC = ldi_prop_lookup_int_array.9f
+
+ldi_getmsg.9f				:= LINKSRC = ldi_putmsg.9f
+
+ldi_write.9f				:= LINKSRC = ldi_read.9f
+
+list_destroy.9f				:= LINKSRC = list_create.9f
+list_head.9f				:= LINKSRC = list_create.9f
+list_insert_after.9f			:= LINKSRC = list_create.9f
+list_insert_before.9f			:= LINKSRC = list_create.9f
+list_insert_head.9f			:= LINKSRC = list_create.9f
+list_insert_tail.9f			:= LINKSRC = list_create.9f
+list_is_empty.9f			:= LINKSRC = list_create.9f
+list_link_active.9f			:= LINKSRC = list_create.9f
+list_link_init.9f			:= LINKSRC = list_create.9f
+list_link_replace.9f			:= LINKSRC = list_create.9f
+list_move_tail.9f			:= LINKSRC = list_create.9f
+list_next.9f				:= LINKSRC = list_create.9f
+list_prev.9f				:= LINKSRC = list_create.9f
+list_remove.9f				:= LINKSRC = list_create.9f
+list_remove_head.9f			:= LINKSRC = list_create.9f
+list_remove_tail.9f			:= LINKSRC = list_create.9f
+list_tail.9f				:= LINKSRC = list_create.9f
+
+makecom_g0.9f				:= LINKSRC = makecom.9f
+makecom_g0_s.9f				:= LINKSRC = makecom.9f
+makecom_g1.9f				:= LINKSRC = makecom.9f
+makecom_g5.9f				:= LINKSRC = makecom.9f
+
+membar_consumer.9f			:= LINKSRC = membar_ops.9f
+membar_enter.9f				:= LINKSRC = membar_ops.9f
+membar_exit.9f				:= LINKSRC = membar_ops.9f
+membar_producer.9f			:= LINKSRC = membar_ops.9f
+
+memcmp.9f				:= LINKSRC = memchr.9f
+memcpy.9f				:= LINKSRC = memchr.9f
+memmove.9f				:= LINKSRC = memchr.9f
+memset.9f				:= LINKSRC = memchr.9f
+
+mod_info.9f				:= LINKSRC = mod_install.9f
+mod_modname.9f				:= LINKSRC = mod_install.9f
+mod_remove.9f				:= LINKSRC = mod_install.9f
+
+mutex_destroy.9f			:= LINKSRC = mutex.9f
+mutex_enter.9f				:= LINKSRC = mutex.9f
+mutex_exit.9f				:= LINKSRC = mutex.9f
+mutex_init.9f				:= LINKSRC = mutex.9f
+mutex_owned.9f				:= LINKSRC = mutex.9f
+mutex_tryenter.9f			:= LINKSRC = mutex.9f
+
+net_event_notify_unregister.9f		:= LINKSRC = net_event_notify_register.9f
+
+net_instance_notify_unregister.9f	:= LINKSRC = net_instance_notify_register.9f
+
+net_instance_protocol_unregister.9f	:= LINKSRC = net_protocol_notify_register.9f
+
+nvlist_add_boolean_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_boolean_value.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_byte.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_byte_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int16.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int16_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int32.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int32_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int64.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int64_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int8.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_int8_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_nvlist.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_nvlist_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_nvpair.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_string.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_string_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint16.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint16_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint32.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint32_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint64.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint64_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint8.9f			:= LINKSRC = nvlist_add_boolean.9f
+nvlist_add_uint8_array.9f		:= LINKSRC = nvlist_add_boolean.9f
+nvlist_t.9f				:= LINKSRC = nvlist_add_boolean.9f
+
+nv_alloc_fini.9f			:= LINKSRC = nvlist_alloc.9f
+nv_alloc_init.9f			:= LINKSRC = nvlist_alloc.9f
+nvlist_dup.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_free.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_merge.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_pack.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_size.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_unpack.9f			:= LINKSRC = nvlist_alloc.9f
+nvlist_xalloc.9f			:= LINKSRC = nvlist_alloc.9f
+nvlist_xdup.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_xpack.9f				:= LINKSRC = nvlist_alloc.9f
+nvlist_xunpack.9f			:= LINKSRC = nvlist_alloc.9f
+
+nvlist_lookup_boolean_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_boolean_value.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_byte.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_byte_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int16.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int16_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int32.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int32_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int64.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int64_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int8.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_int8_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_nvlist.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_nvlist_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_pairs.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_string.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_string_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint16.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint16_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint32.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint32_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint64.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint64_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint8.9f			:= LINKSRC = nvlist_lookup_boolean.9f
+nvlist_lookup_uint8_array.9f		:= LINKSRC = nvlist_lookup_boolean.9f
+
+nvlist_exists.9f			:= LINKSRC = nvlist_lookup_nvpair.9f
+
+nvpair_name.9f				:= LINKSRC = nvlist_next_nvpair.9f
+nvpair_type.9f				:= LINKSRC = nvlist_next_nvpair.9f
+
+nvlist_remove_all.9f			:= LINKSRC = nvlist_remove.9f
+
+nvpair_value_boolean_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_byte_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int16.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int16_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int32.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int32_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int64.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int64_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int8.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_int8_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_nvlist.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_nvlist_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_string.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_string_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint16.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint16_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint32.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint32_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint64.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint64_array.9f		:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint8.9f			:= LINKSRC = nvpair_value_byte.9f
+nvpair_value_uint8_array.9f		:= LINKSRC = nvpair_value_byte.9f
+
+outl.9f					:= LINKSRC = outb.9f
+outw.9f					:= LINKSRC = outb.9f
+repoutsb.9f				:= LINKSRC = outb.9f
+repoutsd.9f				:= LINKSRC = outb.9f
+repoutsw.9f				:= LINKSRC = outb.9f
+
+pci_config_get16.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_get32.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_get64.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_getb.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_getl.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_getll.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_getw.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_put16.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_put32.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_put64.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_put8.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_putb.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_putl.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_putll.9f			:= LINKSRC = pci_config_get8.9f
+pci_config_putw.9f			:= LINKSRC = pci_config_get8.9f
+
+pci_config_teardown.9f			:= LINKSRC = pci_config_setup.9f
+
+pci_ereport_post.9f			:= LINKSRC = pci_ereport_setup.9f
+pci_ereport_teardown.9f			:= LINKSRC = pci_ereport_setup.9f
+
+pci_restore_config_regs.9f		:= LINKSRC = pci_save_config_regs.9f
+
+minphys.9f				:= LINKSRC = physio.9f
+
+pm_idle_component.9f			:= LINKSRC = pm_busy_component.9f
+
+pm_lower_power.9f			:= LINKSRC = pm_raise_power.9f
+
+priv_policy_choice.9f			:= LINKSRC = priv_policy.9f
+priv_policy_only.9f			:= LINKSRC = priv_policy.9f
+
+proc_ref.9f				:= LINKSRC = proc_signal.9f
+proc_unref.9f				:= LINKSRC = proc_signal.9f
+
+qprocsoff.9f				:= LINKSRC = qprocson.9f
+
+qwait_sig.9f				:= LINKSRC = qwait.9f
+
+rmallocmap_wait.9f			:= LINKSRC = rmallocmap.9f
+rmfreemap.9f				:= LINKSRC = rmallocmap.9f
+
+rw_destroy.9f				:= LINKSRC = rwlock.9f
+rw_downgrade.9f				:= LINKSRC = rwlock.9f
+rw_enter.9f				:= LINKSRC = rwlock.9f
+rw_exit.9f				:= LINKSRC = rwlock.9f
+rw_init.9f				:= LINKSRC = rwlock.9f
+rw_read_locked.9f			:= LINKSRC = rwlock.9f
+rw_tryenter.9f				:= LINKSRC = rwlock.9f
+rw_tryupgrade.9f			:= LINKSRC = rwlock.9f
+
+scsi_dname.9f				:= LINKSRC = scsi_cname.9f
+scsi_mname.9f				:= LINKSRC = scsi_cname.9f
+scsi_rname.9f				:= LINKSRC = scsi_cname.9f
+scsi_sname.9f				:= LINKSRC = scsi_cname.9f
+
+scsi_dmafree.9f				:= LINKSRC = scsi_dmaget.9f
+
+scsi_sense_cmdspecific_uint64.9f	:= LINKSRC = scsi_ext_sense_fields.9f
+scsi_sense_info_uint64.9f		:= LINKSRC = scsi_ext_sense_fields.9f
+
+scsi_hba_detach.9f			:= LINKSRC = scsi_hba_attach_setup.9f
+
+scsi_hba_fini.9f			:= LINKSRC = scsi_hba_init.9f
+
+scsi_hba_pkt_free.9f			:= LINKSRC = scsi_hba_pkt_alloc.9f
+
+scsi_hba_tran_free.9f			:= LINKSRC = scsi_hba_tran_alloc.9f
+
+scsi_ifsetcap.9f			:= LINKSRC = scsi_ifgetcap.9f
+
+scsi_pktfree.9f				:= LINKSRC = scsi_pktalloc.9f
+scsi_resalloc.9f			:= LINKSRC = scsi_pktalloc.9f
+scsi_resfree.9f				:= LINKSRC = scsi_pktalloc.9f
+
+scsi_sense_asc.9f			:= LINKSRC = scsi_sense_key.9f
+scsi_sense_ascq.9f			:= LINKSRC = scsi_sense_key.9f
+
+scsi_unslave.9f				:= LINKSRC = scsi_unprobe.9f
+
+sema_destroy.9f				:= LINKSRC = semaphore.9f
+sema_init.9f				:= LINKSRC = semaphore.9f
+sema_p.9f				:= LINKSRC = semaphore.9f
+sema_p_sig.9f				:= LINKSRC = semaphore.9f
+sema_tryp.9f				:= LINKSRC = semaphore.9f
+sema_v.9f				:= LINKSRC = semaphore.9f
+
+numtos.9f				:= LINKSRC = stoi.9f
+
+ddi_strdup.9f				:= LINKSRC = string.9f
+strcasecmp.9f				:= LINKSRC = string.9f
+strchr.9f				:= LINKSRC = string.9f
+strcmp.9f				:= LINKSRC = string.9f
+strcpy.9f				:= LINKSRC = string.9f
+strdup.9f				:= LINKSRC = string.9f
+strfree.9f				:= LINKSRC = string.9f
+strlcat.9f				:= LINKSRC = string.9f
+strlcpy.9f				:= LINKSRC = string.9f
+strlen.9f				:= LINKSRC = string.9f
+strncasecmp.9f				:= LINKSRC = string.9f
+strncat.9f				:= LINKSRC = string.9f
+strncmp.9f				:= LINKSRC = string.9f
+strncpy.9f				:= LINKSRC = string.9f
+strnlen.9f				:= LINKSRC = string.9f
+strrchr.9f				:= LINKSRC = string.9f
+strspn.9f				:= LINKSRC = string.9f
+
+ddi_taskq_create.9f			:= LINKSRC = taskq.9f
+ddi_taskq_destroy.9f			:= LINKSRC = taskq.9f
+ddi_taskq_dispatch.9f			:= LINKSRC = taskq.9f
+ddi_taskq_resume.9f			:= LINKSRC = taskq.9f
+ddi_taskq_suspend.9f			:= LINKSRC = taskq.9f
+ddi_taskq_wait.9f			:= LINKSRC = taskq.9f
+taskq_suspended.9f			:= LINKSRC = taskq.9f
+
+uconv_u16tou8.9f			:= LINKSRC = uconv_u16tou32.9f
+uconv_u32tou16.9f			:= LINKSRC = uconv_u16tou32.9f
+uconv_u32tou8.9f			:= LINKSRC = uconv_u16tou32.9f
+uconv_u8tou16.9f			:= LINKSRC = uconv_u16tou32.9f
+uconv_u8tou32.9f			:= LINKSRC = uconv_u16tou32.9f
+
+usb_alloc_bulk_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_alloc_ctrl_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_alloc_intr_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_alloc_isoc_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_free_bulk_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_free_ctrl_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_free_intr_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_free_isoc_req.9f			:= LINKSRC = usb_alloc_request.9f
+usb_client_detach.9f			:= LINKSRC = usb_client_attach.9f
+
+usb_get_if_number.9f			:= LINKSRC = usb_get_alt_if.9f
+usb_owns_device.9f			:= LINKSRC = usb_get_alt_if.9f
+usb_set_alt_if.9f			:= LINKSRC = usb_get_alt_if.9f
+
+usb_set_cfg.9f				:= LINKSRC = usb_get_cfg.9f
+
+usb_free_descr_tree.9f			:= LINKSRC = usb_get_dev_data.9f
+usb_free_dev_data.9f			:= LINKSRC = usb_get_dev_data.9f
+usb_print_descr_tree.9f			:= LINKSRC = usb_get_dev_data.9f
+
+usb_pipe_ctrl_xfer_wait.9f		:= LINKSRC = usb_pipe_ctrl_xfer.9f
+usb_pipe_stop_intr_polling.9f		:= LINKSRC = usb_pipe_intr_xfer.9f
+usb_pipe_stop_isoc_polling.9f		:= LINKSRC = usb_pipe_isoc_xfer.9f
+
+usb_pipe_get_private.9f			:= LINKSRC = usb_pipe_set_private.9f
+
+usb_unregister_hotplug_cbs.9f		:= LINKSRC = usb_register_hotplug_cbs.9f
+
+va_copy.9f				:= LINKSRC = va_arg.9f
+va_end.9f				:= LINKSRC = va_arg.9f
+va_start.9f				:= LINKSRC = va_arg.9f
+
+.KEEP_STATE:
+
+include		$(SRC)/man/Makefile.man
+
+install:	$(ROOTMANFILES) $(ROOTMANLINKS)
--- old/usr/src/man/man9f/csx_AccessConfigurationRegister.9f	2014-11-12 17:44:35.004966714 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,198 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_ACCESSCONFIGURATIONREGISTER 9F "Jul 19, 1996"
-.SH NAME
-csx_AccessConfigurationRegister \- read or write a PC Card Configuration
-Register
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_AccessConfigurationRegister\fR(\fBclient_handle_t\fR \fIch\fR,
-     \fBaccess_config_reg_t *\fR\fIacr\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIacr\fR\fR
-.ad
-.RS 7n
-Pointer to an \fBaccess_config_reg_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function allows a client to read or write a \fBPC\fRCard Configuration
-Register.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBaccess_config_reg_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;     /* socket number*/
-uint32_t     Action;     /* register access operation*/
-uint32_t     Offset;     /* config register offset*/
-uint32_t     Value;      /* value read or written*/
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 10n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAction\fR\fR
-.ad
-.RS 10n
-May be set to \fBCONFIG_REG_READ\fR or \fBCONFIG_REG_WRITE\fR. All other values
-in the \fBAction\fR field are reserved for future use. If the \fBAction\fR
-field is set to \fBCONFIG_REG_WRITE,\fR the \fBValue\fR field is written to the
-specified configuration register. Card Services does not read the configuration
-register after a write operation. For that reason, the \fBValue\fR field is
-only updated by a \fBCONFIG_REG_READ\fR request.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBOffset\fR\fR
-.ad
-.RS 10n
-Specifies the byte offset for the desired configuration register from the \fBPC
-\fRCard configuration register base specified in
-\fBcsx_RequestConfiguration\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBValue\fR\fR
-.ad
-.RS 10n
-Contains the value read from the \fBPC \fRCard Configuration Register for a
-read operation. For a write operation, the \fBValue\fR field contains the value
-to write to the configuration register. As noted above, on return from a write
-request, the \fBValue\fR field is the value written to the \fBPC \fRCard and
-not any changed value that may have resulted from the write request (that is,
-no read after write is performed).
-.RE
-
-.sp
-.LP
-A client must be very careful when writing to the \fBCOR \fR(Configuration
-Option Register) at offset \fB0\fR. This has the potential to change the type
-of interrupt request generated by the \fBPC \fRCard or place the card in the
-reset state. Either request may have undefined results. The client should read
-the register to determine the appropriate setting for the interrupt mode (Bit
-6) before writing to the register.
-.sp
-.LP
-If a client wants to reset a \fBPC\fRCard, the \fBcsx_ResetFunction\fR(9F)
-function should be used. Unlike \fBcsx_AccessConfigurationRegister()\fR, the
-\fBcsx_ResetFunction\fR(9F) function generates a series of event notifications
-to all clients using the \fBPC \fRCard, so they can re-establish the
-appropriate card state after the reset operation is complete.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ARGS\fR\fR
-.ad
-.RS 27n
-Specified arguments are invalid. Client specifies an \fBOffset\fR that is out
-of range or neither \fBCONFIG_REG_READ\fR or \fBCONFIG_REG_WRITE\fR is set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_MODE\fR\fR
-.ad
-.RS 27n
-Client has not called \fBcsx_RequestConfiguration\fR(9F) before calling this
-function.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRcard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ParseTuple\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_RequestConfiguration\fR(9F), \fBcsx_ResetFunction\fR(9F)
-.sp
-.LP
-\fIPCCard 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_CS_DDI_Info.9f	2014-11-12 17:44:35.056193369 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,180 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_CS_DDI_INFO 9F "Jul 19, 1996"
-.SH NAME
-csx_CS_DDI_Info \- obtain DDI information
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_CS_DDI_Info\fR(\fBcs_ddi_info_t *\fR\fIcdi\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIcdi\fR \fR
-.ad
-.RS 8n
-Pointer to a \fBcs_ddi_info_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function is a Solaris-specific extension that is used by clients that need
-to provide the \fIxx_getinfo\fR driver entry point (see \fBgetinfo\fR(9E)). It
-provides a method for clients to obtain \fBDDI \fRinformation based on their
-socket number and client driver name.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcs_ddi_info_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;        /* socket number */
-char*        driver_name;   /* unique driver name */
-dev_info_t   *dip;          /* dip */
-int32_t      instance;      /* instance */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 16n
-This field must be set to the physical socket number that the client is
-interested in getting information about.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdriver_name\fR \fR
-.ad
-.RS 16n
-This field must be set to a string containing the name of the client driver to
-get information about.
-.RE
-
-.sp
-.LP
-If \fBcsx_CS_DDI_Info()\fR is used in a client's \fIxx_getinfo\fR function,
-then the client will typically extract the \fBSocket\fR value from the
-\fB*\fR\fIarg\fR argument and it \fImust\fR set the \fBdriver_name\fR field to
-the same string used with \fBcsx_RegisterClient\fR(9F).
-.sp
-.LP
-If the \fBdriver_name\fR is found on the \fBSocket\fR, the
-\fBcsx_CS_DDI_Info()\fR function returns both the \fBdev_info\fR pointer and
-the \fBinstance\fR fields for the requested driver instance.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-Client not found on \fBSocket\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fR: Using csx_CS_DDI_Info
-.sp
-.LP
-The following example shows how a client might call the \fBcsx_CS_DDI_Info()\fR
-in the client's \fIxx_getinfo\fR function to return the dip or the instance
-number:
-
-.sp
-.in +2
-.nf
-static int
-pcepp_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
-	                                                void **result)
-{
-	   int                          error = DDI_SUCCESS;
-	   pcepp_state_t                *pps;
-	   cs_ddi_info_t                cs_ddi_info;
-
-   switch (cmd) {
-
-	   case DDI_INFO_DEVT2DEVINFO:
-          cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
-          cs_ddi_info.driver_name = pcepp_name;
-          if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
-                   return (DDI_FAILURE);
-          if (!(pps = ddi_get_soft_state(pcepp_soft_state_p,
-                        cs_ddi_info.instance))) {
-                    *result = NULL;
-          } else {
-                    *result = pps->dip;
-          }
-          break;
-
-	   case DDI_INFO_DEVT2INSTANCE:
-          cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
-          cs_ddi_info.driver_name = pcepp_name;
-          if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
-	                    return (DDI_FAILURE);
-          *result = (void *)cs_ddi_info.instance;
-          break;
-
-	   default:
-          error = DDI_FAILURE;
-          break;
-
-   }
-
-	   return (error);
-}
-.fi
-.in -2
-
-.SH SEE ALSO
-.sp
-.LP
-\fBgetinfo\fR(9E), \fBcsx_RegisterClient\fR(9F), \fBddi_get_instance\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_ConvertSize.9f	2014-11-12 17:44:35.107260270 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,141 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_CONVERTSIZE 9F "Jul 19, 1996"
-.SH NAME
-csx_ConvertSize \- convert device sizes
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ConvertSize\fR(\fBconvert_size_t *\fR\fIcs\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIcs\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBconvert_size_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBcsx_ConvertSize()\fR is a Solaris-specific extension that provides a method
-for clients to convert from one type of device size representation to another,
-that is, from \fIdevsize\fR format to \fIbytes\fR and vice versa.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBconvert_size_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t    Attributes;
-uint32_t    bytes;
-uint32_t    devsize;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 15n
-This is a bit-mapped field that identifies the type of size conversion to be
-performed. The field is defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBCONVERT_BYTES_TO_DEVSIZE\fR\fR
-.ad
-.RS 28n
-Converts \fIbytes\fR to \fIdevsize\fR format.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONVERT_DEVSIZE_TO_BYTES\fR\fR
-.ad
-.RS 28n
-Converts \fIdevsize\fR format to \fIbytes\fR.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBbytes\fR \fR
-.ad
-.RS 15n
-If \fBCONVERT_BYTES_TO_DEVSIZE\fR is set, the value in the \fBbytes\fR field is
-converted to a \fIdevsize\fR format and returned in the \fBdevsize\fR field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdevsize\fR \fR
-.ad
-.RS 15n
-If \fBCONVERT_DEVSIZE_TO_BYTES\fR is set, the value in the \fBdevsize\fR field
-is converted to a \fIbytes\fR value and returned in the \fBbytes\fR field.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SIZE\fR \fR
-.ad
-.RS 28n
-Invalid \fIbytes\fR or \fIdevsize\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ModifyWindow\fR(9F), \fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPCCard 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_ConvertSpeed.9f	2014-11-12 17:44:35.157787616 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,150 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_CONVERTSPEED 9F "Jul 19, 1996"
-.SH NAME
-csx_ConvertSpeed \- convert device speeds
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ConvertSpeed\fR(\fBconvert_speed_t *\fR\fIcs\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIcs\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBconvert_speed_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function is a Solaris-specific extension that provides a method for
-clients to convert from one type of device speed representation to another,
-that is, from \fIdevspeed\fR format to \fInS\fR and vice versa.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBconvert_speed_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Attributes;
-uint32_t     nS;
-uint32_t     devspeed;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 15n
-This is a bit-mapped field that identifies the type of speed conversion to be
-performed. The field is defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBCONVERT_NS_TO_DEVSPEED\fR\fR
-.ad
-.RS 26n
-Converts \fInS\fR to \fIdevspeed\fR format
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONVERT_DEVSPEED_TO_NS\fR\fR
-.ad
-.RS 26n
-Converts \fIdevspeed\fR format to \fInS\fR
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnS\fR \fR
-.ad
-.RS 15n
-If \fBCONVERT_NS_TO_DEVSPEED\fR is set, the value in the \fBnS\fR field is
-converted to a \fIdevspeed\fR format and returned in the \fBdevspeed\fR field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdevspeed\fR \fR
-.ad
-.RS 15n
-If \fBCONVERT_DEVSPEED_TO_NS\fR is set, the value in the \fBdevspeed\fR field
-is converted to an \fInS\fR value and returned in the \fBnS\fR field.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SPEED\fR \fR
-.ad
-.RS 28n
-Invalid \fInS\fR or \fIdevspeed\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR \fR
-.ad
-.RS 28n
-Bad \fBAttributes\fR value.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ModifyWindow\fR(9F), \fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_DeregisterClient.9f	2014-11-12 17:44:35.208534893 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,95 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_DEREGISTERCLIENT 9F "Jul 19, 1996"
-.SH NAME
-csx_DeregisterClient \- remove client from Card Services list
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_DeregisterClient\fR(\fBclient_handle_t\fR \fIch\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function removes a client from the list of registered clients maintained
-by Card Services. The Client Handle returned by \fBcsx_RegisterClient\fR(9F) is
-passed in the \fBclient_handle_t\fR argument.
-.sp
-.LP
-The client must have returned all requested resources before this function is
-called. If any resources have not been released, \fBCS_IN_USE\fR is returned.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_IN_USE\fR \fR
-.ad
-.RS 28n
-Resources not released by this client.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
-.SH WARNINGS
-.sp
-.LP
-Clients should be prepared to receive callbacks until Card Services returns
-from this request successfully.
--- old/usr/src/man/man9f/csx_DupHandle.9f	2014-11-12 17:44:35.259430174 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,198 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_DUPHANDLE 9F "Jul 19, 1996"
-.SH NAME
-csx_DupHandle \- duplicate access handle
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_DupHandle\fR(\fBacc_handle_t\fR \fIhandle1\fR, \fBacc_handle_t *\fR\fIhandle2\fR,
-     \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle1\fR \fR
-.ad
-.RS 12n
-The access handle returned from \fBcsx_RequestIO\fR(9F) or
-\fBcsx_RequestWindow\fR(9F) that is to be duplicated.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhandle2\fR \fR
-.ad
-.RS 12n
-A pointer to the newly-created duplicated data access handle.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIflags\fR \fR
-.ad
-.RS 12n
-The access attributes that will be applied to the new handle.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function duplicates the handle, \fIhandle1\fR, into a new handle,
-\fIhandle2\fR, that has the access attributes specified in the \fIflags\fR
-argument. Both the original handle and the new handle are active and can be
-used with the common access functions.
-.sp
-.LP
-Both handles must be explicitly freed when they are no longer necessary.
-.sp
-.LP
-The \fIflags\fR argument is bit-mapped. The following bits are defined:
-.sp
-.in +2
-.nf
-WIN_ACC_NEVER_SWAP       Host endian byte ordering
-WIN_ACC_BIG_ENDIAN       Big endian byte ordering
-WIN_ACC_LITTLE_ENDIAN    Little endian byte ordering
-WIN_ACC_STRICT_ORDER     Program ordering references
-WIN_ACC_UNORDERED_OK     May re-order references
-WIN_ACC_MERGING_OK       Merge stores to consecutive locations
-WIN_ACC_LOADCACHING_OK   May cache load operations
-WIN_ACC_STORECACHING_OK  May cache store operations
-.fi
-.in -2
-
-.sp
-.LP
-\fBWIN_ACC_BIG_ENDIAN\fR and \fBWIN_ACC_LITTLE_ENDIAN\fR describe the endian
-characteristics of the device as big endian or little endian, respectively.
-Even though most of the devices will have the same endian characteristics as
-their busses, there are examples of devices with an \fBI/O \fRprocessor that
-has opposite endian characteristics of the busses. When
-\fBWIN_ACC_BIG_ENDIAN\fR or \fBWIN_ACC_LITTLE_ENDIAN\fR is  set, byte swapping
-will automatically be performed by the system if the host machine and the
-device data formats have opposite endian characteristics. The implementation
-may take advantage of hardware platform byte swapping capabilities.  When
-\fBWIN_ACC_NEVER_SWAP\fR is specified, byte swapping will not be invoked in the
-data access functions. The ability to specify the order in which the \fBCPU
-\fRwill reference data is provided by the following \fIflags\fR bits. Only one
-of the following bits may be specified:
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STRICT_ORDER\fR \fR
-.ad
-.RS 28n
-The data references must be issued by a \fBCPU \fRin program order. Strict
-ordering is the default behavior.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_UNORDERED_OK\fR \fR
-.ad
-.RS 28n
-The \fBCPU \fRmay re-order the data  references. This includes all kinds of
-re-ordering (that is, a load followed by a store may be replaced by a store
-followed by a load).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_MERGING_OK\fR \fR
-.ad
-.RS 28n
-The \fBCPU \fRmay merge individual stores to consecutive locations. For
-example, the \fBCPU \fRmay turn two consecutive byte stores into one halfword
-store. It may also batch individual loads. For example, the \fBCPU \fRmay turn
-two consecutive byte loads into one halfword load. Setting this bit also
-implies re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LOADCACHING_OK\fR \fR
-.ad
-.RS 28n
-The \fBCPU \fRmay cache the data it fetches and reuse it until another store
-occurs. The default behavior is to fetch new data on every load. Setting this
-bit also implies merging and re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STORECACHING_OK\fR \fR
-.ad
-.RS 28n
-The \fBCPU \fRmay keep the data in the cache and push it to the device (perhaps
-with other data) at a later time. The  default behavior is to push the data
-right away. Setting this bit also implies load caching, merging, and
-re-ordering.
-.RE
-
-.sp
-.LP
-These values are advisory, not mandatory. For example, data can be ordered
-without being merged or cached, even though a driver requests unordered, merged
-and cached together.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_FAILURE\fR \fR
-.ad
-.RS 28n
-Error in \fIflags\fR argument or handle could not be duplicated for some
-reason.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_Get8\fR(9F), \fBcsx_GetMappedAddr\fR(9F), \fBcsx_Put8\fR(9F),
-\fBcsx_RepGet8\fR(9F), \fBcsx_RepPut8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Error2Text.9f	2014-11-12 17:44:35.310501675 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,107 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_ERROR2TEXT 9F "Jul 19, 1996"
-.SH NAME
-csx_Error2Text \- convert error return codes to text strings
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Error2Text\fR(\fBerror2text_t *\fR\fIer\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIer\fR \fR
-.ad
-.RS 7n
-Pointer to an \fBerror2text_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function is a Solaris-specific extension that provides a method for
-clients to convert Card Services error return codes to text strings.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBerror2text_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     item;                             /*the error code*/
-char         test[CS_ERROR_MAX_BUFSIZE};       /*the error code*/
-.fi
-.in -2
-
-.sp
-.LP
-A pointer to the text for the Card Services error return code in the \fBitem\fR
-field is returned in the \fBtext\fR field if the error return code is found.
-The client is not responsible for allocating a buffer to hold the text. If the
-Card Services error return code specified in the item field is not found, the
-\fBtext\fR field will be set to a string of the form:
-.sp
-.LP
-"{\fIunknown Card Services return code\fR}"
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fR: Using the csxError2Text function
-.sp
-.in +2
-.nf
-if ((ret = csx_RegisterClient(&client_handle, &
-	   client_reg)) != CS_SUCCESS)
-{
-   error2text_t error2text;
-   error2text.item = ret;
-   csx_Error2Text(&error2text);
-   cmn_err(CE_CONT, "RegisterClient failed %s (0x%x)",
-	   error2text.text, ret);
-}
-.fi
-.in -2
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_Event2Text\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Event2Text.9f	2014-11-12 17:44:35.361215613 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,119 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_EVENT2TEXT 9F "Jul 19, 1996"
-.SH NAME
-csx_Event2Text \- convert events to text strings
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Event2Text\fR(\fBevent2text_t *\fR\fIev\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIev\fR\fR
-.ad
-.RS 6n
-Pointer to an \fBevent2text_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function is a Solaris-specific extension that provides a method for
-clients to convert Card Services events to text strings.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBevent2text_t\fR are:
-.sp
-.in +2
-.nf
-event_t     event;                        /*the event code*/
-char        text[CS_EVENT_MAX_BUFSIZE]    /*the event code*/
-
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBevent\fR\fR
-.ad
-.RS 9n
-The text for the event code in the \fBevent\fR field is returned in the
-\fBtext\fR field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtext\fR\fR
-.ad
-.RS 9n
-The text string describing the name of the event.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH EXAMPLES
-.LP
-\fBExample 1 \fR: Using \fBcsx_Event2Text()\fR
-.sp
-.in +2
-.nf
-xx_event(event_t event, int priority, event_callback_args_t *eca)
-{ 	
-	  event2text_t    event2text; 	
-
-	  event2text.event = event;
-	  csx_Event2Text(&event2text);
-	  cmn_err(CE_CONT, "event %s (0x%x)", event2text.text, (int)event);
-}
-.fi
-.in -2
-
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_event_handler\fR(9E), \fBcsx_Error2Text\fR(9F)
-.sp
-.LP
-\fIPC Card  95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_FreeHandle.9f	2014-11-12 17:44:35.411847104 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,71 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_FREEHANDLE 9F "Jul 19, 1996"
-.SH NAME
-csx_FreeHandle \- free access handle
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_FreeHandle\fR(\fBacc_handle_t *\fR\fIhandle\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function frees the handle, \fIhandle\fR. If the handle was created by the
-\fBcsx_DupHandle\fR(9F) function, this function will free the storage
-associated with this handle, but will not modify any resources that the
-original handle refers to. If the handle was created by a common access setup
-function, this function will release the resources associated with this handle.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_RequestIO\fR(9F), \fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Get8.9f	2014-11-12 17:44:35.462594014 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,91 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GET8 9F "Jul 19, 1996"
-.SH NAME
-csx_Get8, csx_Get16, csx_Get32, csx_Get64 \- read data from device address
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBuint8_t\fR \fBcsx_Get8\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBuint16_t\fR \fBcsx_Get16\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBuint32_t\fR \fBcsx_Get32\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR);
-.fi
-
-.LP
-.nf
-\fBuint64_t\fR \fBcsx_Get64\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint64_t\fR \fIoffset\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 11n
-The offset in bytes from the base of the mapped resource.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-These functions generate a read of various sizes from the mapped memory or
-device register.
-.sp
-.LP
-The \fBcsx_Get8()\fR, \fBcsx_Get16()\fR, \fBcsx_Get32()\fR, and
-\fBcsx_Get64()\fR functions read 8 bits, 16 bits, 32 bits, and 64 bits of data,
-respectively, from the device address represented by the handle, \fIhandle\fR,
-at an offset in bytes represented by the offset, \fIoffset\fR.
-.sp
-.LP
-Data that consists of more than one byte will automatically be translated to
-maintain a consistent view between the host and the device based on the encoded
-information in the data access handle. The translation may involve byte
-swapping if the host and the device have incompatible endian characteristics.
-.SH RETURN VALUES
-.sp
-.LP
-These functions return the value read from the mapped address.
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user, kernel, or interrupt context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_GetMappedAddr\fR(9F), \fBcsx_Put8\fR(9F),
-\fBcsx_RepGet8\fR(9F), \fBcsx_RepPut8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_GetFirstClient.9f	2014-11-12 17:44:35.513097549 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,184 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETFIRSTCLIENT 9F "May 16, 1997"
-.SH NAME
-csx_GetFirstClient, csx_GetNextClient \- return first or next client
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_GetFirstClient\fR(\fBget_firstnext_client_t *\fR\fIfnc\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_GetNextClient\fR(\fBget_firstnext_client_t *\fR\fIfnc\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIfnc\fR \fR
-.ad
-.RS 8n
-Pointer to a \fBget_firstnext_client_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The functions \fBcsx_GetFirstClient()\fR and \fBcsx_GetNextClient()\fR return
-information about the first or subsequent \fBPC \fRcards, respectively, that
-are installed in the system.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBget_firstnext_client_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t          Socket;          /* socket number */
-uint32_t          Attributes;      /* attributes */
-client_handle_t   client_handle;   /* client handle */
-uint32_t          num_clients;     /* number of clients */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 18n
-If the \fBCS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY\fR attribute is set, return
-information only on the  \fBPC \fRcard installed in this socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 18n
-This field indicates the type of client. The field is bit-mapped; the following
-bits are defined:
-.sp
-.ne 2
-.na
-\fBCS_GET_FIRSTNEXT_CLIENT_ALL_CLIENTS\fR
-.ad
-.sp .6
-.RS 4n
-Return information on all clients.
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY\fR
-.ad
-.sp .6
-.RS 4n
-Return client information for the specified socket only.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBclient_handle\fR \fR
-.ad
-.RS 18n
-The client handle of the \fBPC \fRcard driver is returned in this field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnum_clients\fR \fR
-.ad
-.RS 18n
-The number of clients is returned in this field.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-Socket number is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_MORE_ITEMS\fR \fR
-.ad
-.RS 28n
-\fBPC \fRCard driver does not handle the \fBCS_EVENT_CLIENT_INFO\fR event.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_event_handler\fR(9E)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_GetFirstTuple.9f	2014-11-12 17:44:35.564132024 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,222 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETFIRSTTUPLE 9F "Dec 20, 1996"
-.SH NAME
-csx_GetFirstTuple, csx_GetNextTuple \- return Card Information Structure tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_GetFirstTuple\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_GetNextTuple\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The functions \fBcsx_GetFirstTuple()\fR and \fBcsx_GetNextTuple()\fR return the
-first and next tuple, respectively, of the specified type in the Card
-Information Structure (CIS) for the specified socket.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBtuple_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t    Socket;        /* socket number */
-uint32_t    Attributes;    /* Attributes */
-cisdata_t   DesiredTuple;  /* tuple to search for or flags */
-cisdata_t   TupleCode;     /* tuple type code */
-cisdata_t   TupleLink;     /* tuple data body size */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 23n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 23n
-This field is bit-mapped. The following bits are defined:
-.sp
-.ne 2
-.na
-\fBTUPLE_RETURN_LINK\fR
-.ad
-.sp .6
-.RS 4n
-Return link tuples if set. The following are link tuples and will only be
-returned by this function if the \fBTUPLE_RETURN_LINK\fR bit in the
-\fBAttributes\fR field is set:
-.sp
-.in +2
-.nf
-	CISTPL_NULL	CISTPL_LONGLINK_MFC
-	CISTPL_LONGLINK_A	CISTPL_LINKTARGET
-	CISTPL_LONGLINK_C	CISTPL_NO_LINK
-	CISTPL_LONGLINK_CB	CISTPL_END
-.fi
-.in -2
-
-.RE
-
-.sp
-.ne 2
-.na
-\fBTUPLE_RETURN_IGNORED_TUPLES\fR
-.ad
-.sp .6
-.RS 4n
-Return ignored tuples if set. Ignored tuples will be returned by this function
-if the \fBTUPLE_RETURN_IGNORED_TUPLES\fR bit in the \fBAttributes\fR field is
-set, see \fBtuple\fR(9S) for more information. The \fBCIS \fRis parsed from the
-location setup by the previous \fBcsx_GetFirstTuple()\fR or
-\fBcsx_GetNextTuple()\fR request.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBDesiredTuple\fR\fR
-.ad
-.RS 23n
-This field is the tuple value desired. If it is \fBRETURN_FIRST_TUPLE,\fR the
-very first tuple of the \fBCIS \fRis returned (if it exists). If this field is
-set to \fBRETURN_NEXT_TUPLE,\fR the very next tuple of the \fBCIS \fRis
-returned (if it exists). If the \fBDesiredTuple\fR field is any other value on
-entry, the \fBCIS \fRis searched in an attempt to locate a tuple which matches.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleCode,TupleLink\fR\fR
-.ad
-.RS 23n
-These fields are the values returned from the tuple found. If there are no
-tuples on the card, \fBCS_NO_MORE_ITEMS\fR is returned.
-.RE
-
-.sp
-.LP
-Since the \fBcsx_GetFirstTuple()\fR, \fBcsx_GetNextTuple()\fR, and
-\fBcsx_GetTupleData\fR(9F) functions all share the same \fBtuple_t\fR
-structure, some fields in the \fBtuple_t\fR structure are unused or reserved
-when calling this function and these fields must not be initialized by the
-client.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRcard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_MORE_ITEMS\fR\fR
-.ad
-.RS 27n
-Desired tuple not found.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetTupleData\fR(9F), \fBcsx_ParseTuple\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card \fR\fI95Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_GetHandleOffset.9f	2014-11-12 17:44:35.615848221 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,67 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETHANDLEOFFSET 9F "May 16, 1997"
-.SH NAME
-csx_GetHandleOffset \- return current access handle offset
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-\fBint32_t\fR \fBcsx_GetHandleOffset\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t *\fR\fIoffset\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-Access handle returned by \fBcsx_RequestIRQ\fR(9F) or \fBcsx_RequestIO\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 11n
-Pointer to a \fBuint32_t\fR in which the current access handle offset is
-returned.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns the current offset for the access handle, \fIhandle\fR,
-in \fIoffset\fR.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 15n
-Successful operation.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RequestIO\fR(9F), \fBcsx_RequestIRQ\fR(9F),
-\fBcsx_SetHandleOffset\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_GetMappedAddr.9f	2014-11-12 17:44:35.666658762 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,91 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETMAPPEDADDR 9F "Jul 19, 1996"
-.SH NAME
-csx_GetMappedAddr \- return mapped virtual address
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_GetMappedAddr\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBvoid **\fR\fIaddr\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIaddr\fR \fR
-.ad
-.RS 11n
-The virtual or \fBI/O \fRport number represented by the handle.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns the mapped virtual address or the mapped \fBI/O \fRport
-number represented by the handle, \fIhandle\fR.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-The resulting address or \fBI/O \fRport number can be directly accessed by the
-caller.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_FAILURE\fR \fR
-.ad
-.RS 28n
-The resulting address or \fBI/O \fRport number can not be directly accessed by
-the caller; the caller must make all accesses to the mapped area via the common
-access functions.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user, kernel, or interrupt context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_Get8\fR(9F), \fBcsx_Put8\fR(9F),
-\fBcsx_RepGet8\fR(9F), \fBcsx_RepPut8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_GetStatus.9f	2014-11-12 17:44:35.717400827 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,485 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETSTATUS 9F "Jul 19, 1996"
-.SH NAME
-csx_GetStatus \- return the current status of a PC Card and its socket
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_GetStatus\fR(\fBclient_handle_t\fR \fIch\fR, \fBget_status_t *\fR\fIgs\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIgs\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBget_status_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns the current status of a \fBPC \fRCard and its socket.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBget_status_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;          /* socket number*/
-uint32_t     CardState;       /* "live" card status for this client*/
-uint32_t     SocketState;     /* latched socket values */
-uint32_t     raw_CardState;   /* raw live card status */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 18n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCardState\fR \fR
-.ad
-.RS 18n
-The \fBCardState\fR field is the bit-mapped output data returned from Card
-Services. The bits identify what Card Services thinks the current state of the
-installed \fBPC \fRCard is. The bits are:
-.sp
-.ne 2
-.na
-\fBCS_STATUS_WRITE_PROTECTED\fR
-.ad
-.sp .6
-.RS 4n
-Card is write protected
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_CARD_LOCKED\fR
-.ad
-.sp .6
-.RS 4n
-Card is locked
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_EJECTION_REQUEST\fR
-.ad
-.sp .6
-.RS 4n
-Ejection request in progress
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_INSERTION_REQUEST\fR
-.ad
-.sp .6
-.RS 4n
-Insertion request in progress
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_BATTERY_DEAD\fR
-.ad
-.sp .6
-.RS 4n
-Card battery is dead
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_BATTERY_DEAD\fR
-.ad
-.sp .6
-.RS 4n
-Card battery is dead (\fBBVD1\fR)
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_BATTERY_LOW\fR
-.ad
-.sp .6
-.RS 4n
-Card battery is low (\fBBVD2\fR)
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_CARD_READY\fR
-.ad
-.sp .6
-.RS 4n
-Card is READY
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_CARD_INSERTED\fR
-.ad
-.sp .6
-.RS 4n
-Card is inserted
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_REQ_ATTN\fR
-.ad
-.sp .6
-.RS 4n
-Extended status attention request
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_RES_EVT1\fR
-.ad
-.sp .6
-.RS 4n
-Extended status reserved event status
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_RES_EVT2\fR
-.ad
-.sp .6
-.RS 4n
-Extended status reserved event status
-.RE
-
-.sp
-.ne 2
-.na
-\fB CS_STATUS_RES_EVT3\fR
-.ad
-.sp .6
-.RS 4n
-Extended status reserved event status
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_VCC_50\fR
-.ad
-.sp .6
-.RS 4n
-5.0 Volts Vcc Indicated
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_VCC_33\fR
-.ad
-.sp .6
-.RS 4n
-3.3 Volts Vcc Indicated
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_VCC_XX\fR
-.ad
-.sp .6
-.RS 4n
-X.X Volts Vcc Indicated
-.RE
-
-The state of the \fBCS_STATUS_CARD_INSERTED\fR bit indicates whether the \fBPC
-\fRCard associated with this driver instance, not just any card, is inserted in
-the socket. If an \fBI/O \fRcard is installed in the specified socket, card
-state is returned from the \fBPRR\fR (Pin Replacement Register) and the
-\fBESR\fR (Extended Status Register) (if present). If certain state bits are
-not present in the \fBPRR\fR or \fBESR\fR, a simulated state bit value is
-returned as defined below:
-.sp
-.ne 2
-.na
-\fBCS_STATUS_WRITE_PROTECTED\fR
-.ad
-.RS 29n
-Not write protected
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_BATTERY_DEAD\fR
-.ad
-.RS 29n
-Power good
-.RE
-
-.sp
-.ne 2
-.na
-\fBPCS_STATUS_BATTERY_LOW\fR
-.ad
-.RS 29n
-Power good
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_CARD_READY\fR
-.ad
-.RS 29n
-Ready
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_REQ_ATTN\fR
-.ad
-.RS 29n
-Not set
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_RES_EVT1\fR
-.ad
-.RS 29n
-Not set
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_RES_EVT2\fR
-.ad
-.RS 29n
-Not set
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_STATUS_RES_EVT3\fR
-.ad
-.RS 29n
-Not set
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSocketState\fR \fR
-.ad
-.RS 18n
-The \fBSocketState\fR field is a bit-map of the current card and socket state.
-The bits are:
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_WRITE_PROTECT_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Write Protect
-.RE
-
-.sp
-.ne 2
-.na
-\fBECS_SOCK_STATUS_CARD_LOCK_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Card Lock Change
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_EJECTION_PENDING\fR
-.ad
-.sp .6
-.RS 4n
-Ejection Request
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_INSERTION_PENDING\fR
-.ad
-.sp .6
-.RS 4n
-Insertion Request
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_BATTERY_DEAD_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Battery Dead
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_BATTERY_LOW_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Battery Low
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_CARD_READY_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Ready Change
-.RE
-
-.sp
-.ne 2
-.na
-\fBCS_SOCK_STATUS_CARD_INSERTION_CHANGE\fR
-.ad
-.sp .6
-.RS 4n
-Card is inserted
-.sp
- The state reported in the SocketState field may be different from the state
-reported in the CardState field. Clients should normally depend only on the
-state reported in the CardState field.
-.sp
-The state reported in the \fBSocketState\fR field may be different from the
-state reported in the \fBCardState\fR field. Clients should normally depend
-only on the state reported in the \fBCardState\fR field.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBraw_CardState\fR \fR
-.ad
-.RS 18n
-The \fBraw_CardState\fR field is a Solaris-specific extension that allows the
-client to determine if any card is inserted in the socket. The bit definitions
-in the \fBraw_CardState\fR field are identical to those in the \fBCardState\fR
-field with the exception that the \fBCS_STATUS_CARD_INSERTED\fR bit in the
-\fBraw_CardState\fR field is set whenever any card is inserted into the socket.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-Error getting socket state.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.sp
-.LP
-\fBCS_NO_CARD\fR will not be returned if there is no \fBPC \fRCard present in
-the socket.
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_GetTupleData.9f	2014-11-12 17:44:35.769515319 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,236 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_GETTUPLEDATA 9F "Dec 20, 1996"
-.SH NAME
-csx_GetTupleData \- return the data portion of a tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_GetTupleData\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns the data portion of a tuple, as returned by the
-\fBcsx_GetFirstTuple\fR(9F) and \fBcsx_GetNextTuple\fR(9F) functions.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBtuple_t\fR are:
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.in +2
-.nf
-uint32_t  Socket;                           /* socket number */
-uint32_t  Attributes;                       /* tuple attributes*/
-cisdata_t DesiredTuple;                     /* tuple to search for*/
-cisdata_t TupleOffset;                      /* tuple data offset*/
-cisdata_t TupleDataMax;                     /* max tuple data size*/
-cisdata_t TupleDataLen;                     /* actual tuple data length*/
-cisdata_t TupleData[CIS_MAX_TUPLE_DATA_LEN];/* tuple body data buffer*/
-cisdata_t TupleCode;                        /* tuple type code*/
-cisdata_t TupleLink;                        /* tuple link */
-.fi
-.in -2
-
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 16n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 16n
-Initialized by \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F); the
-client must not modify the value in this field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBDesiredTuple\fR\fR
-.ad
-.RS 16n
-Initialized by \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F); the
-client must not modify the value in this field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleOffset\fR\fR
-.ad
-.RS 16n
-This field allows partial tuple information to be retrieved, starting anywhere
-within the tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleDataMax\fR\fR
-.ad
-.RS 16n
-This field is the size of the tuple data buffer that Card Services uses to
-return raw tuple data from \fBcsx_GetTupleData\fR. It can be larger than the
-number of bytes in the tuple data body. Card Services ignores any value placed
-here by the client.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleDataLen\fR\fR
-.ad
-.RS 16n
-This field is the actual size of the tuple data body. It represents the number
-of tuple data body bytes returned.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleData\fR\fR
-.ad
-.RS 16n
-This field is an array of bytes containing the raw tuple data body contents.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleCode\fR\fR
-.ad
-.RS 16n
-Initialized by \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F); the
-client must not modify the value in this field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTupleLink\fR\fR
-.ad
-.RS 16n
-Initialized by \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F); the
-client must not modify the value in this field.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ARGS\fR\fR
-.ad
-.RS 27n
-Data from prior \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F) is
-corrupt.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_MORE_ITEMS\fR\fR
-.ad
-.RS 27n
-Card Services was not able to read the tuple from the \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_ParseTuple\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_MakeDeviceNode.9f	2014-11-12 17:44:35.821129336 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,242 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_MAKEDEVICENODE 9F "Jul 19, 1996"
-.SH NAME
-csx_MakeDeviceNode, csx_RemoveDeviceNode \- create and remove minor nodes on
-behalf of the client
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_MakeDeviceNode\fR(\fBclient_handle_t\fR \fIch\fR, \fBmake_device_node_t *\fR\fIdn\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_RemoveDeviceNode\fR(\fBclient_handle_t\fR \fIch\fR, \fBremove_device_node_t *\fR\fIdn\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIdn\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBmake_device_node_t\fR or \fBremove_device_node_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBcsx_MakeDeviceNode()\fR and \fBcsx_RemoveDeviceNode()\fR are
-Solaris-specific extensions to allow the client to request that device nodes in
-the filesystem are created or removed, respectively, on its behalf.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBmake_device_node_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t        Action;         /* device operation */
-uint32_t        NumDevNodes;    /* number of nodes to create */
-devnode_desc_t  *devnode_desc;  /* description of device nodes */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBremove_device_node_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t       Action;          /* device operation */
-uint32_t       NumDevNodes;     /* number of nodes to remove */
-devnode_desc_t *devnode_desc;   /* description of device nodes */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBdevnode_desc_t\fR are:
-.sp
-.in +2
-.nf
-char           *name;           /* device node path and name */
-int32_t        spec_type;       /* device special type (block or char) */
-int32_t        minor_num;       /* device node minor number */
-char           *node_type;      /* device node type */
-.fi
-.in -2
-
-.sp
-.LP
-The \fBAction\fR field is used to specify the operation that
-\fBcsx_MakeDeviceNode()\fR and \fBcsx_RemoveDeviceNode()\fR should perform.
-.sp
-.LP
-The following \fBAction\fR values are defined for \fBcsx_MakeDeviceNode()\fR:
-.sp
-.ne 2
-.na
-\fBCREATE_DEVICE_NODE\fR
-.ad
-.RS 22n
-Create \fBNumDevNodes\fR minor nodes
-.RE
-
-.sp
-.LP
-The following \fBAction\fR values are defined for \fBcsx_RemoveDeviceNode()\fR:
-.sp
-.ne 2
-.na
-\fBREMOVE_DEVICE_NODE\fR
-.ad
-.RS 27n
-Remove \fBNumDevNodes\fR minor nodes
-.RE
-
-.sp
-.ne 2
-.na
-\fBREMOVE_ALL_DEVICE_NODES\fR
-.ad
-.RS 27n
-Remove all minor nodes for this client
-.RE
-
-.sp
-.LP
-For \fBcsx_MakeDeviceNode()\fR, if the \fBAction\fR field is:
-.sp
-.ne 2
-.na
-\fB\fBCREATE_DEVICE_NODE\fR \fR
-.ad
-.RS 23n
-The \fBNumDevNodes\fR field must be set to the number of minor devices to
-create, and the client must allocate the quantity of \fBdevnode_desc_t\fR
-structures specified by \fBNumDevNodes\fR and fill out the fields in the
-\fBdevnode_desc_t\fR structure with the appropriate minor node information. The
-meanings of the fields in the \fBdevnode_desc_t\fR structure are identical to
-the parameters of the same name to the \fBddi_create_minor_node\fR(9F) \fBDDI
-\fRfunction.
-.RE
-
-.sp
-.LP
-For \fBcsx_RemoveDeviceNode()\fR, if the \fBAction\fR field is:
-.sp
-.ne 2
-.na
-\fB\fBREMOVE_DEVICE_NODE\fR \fR
-.ad
-.RS 28n
-The \fBNumDevNodes\fR field must be set to the number of minor devices to
-remove, and the client must allocate the quantity of \fBdevnode_desc_t\fR
-structures specified by \fBNumDevNodes\fR and fill out the fields in the
-\fBdevnode_desc_t\fR structure with the appropriate minor node information. The
-meanings of the fields in the \fBdevnode_desc_t\fR structure are identical to
-the parameters of the same name to the \fBddi_remove_minor_node\fR(9F) \fBDDI
-\fRfunction.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBREMOVE_ALL_DEVICE_NODES\fR \fR
-.ad
-.RS 28n
-The \fBNumDevNodes\fR field must be set to \fB0\fR and the \fBdevnode_desc_t\fR
-structure pointer must be set to \fINULL\fR. All device nodes for this client
-will be removed from the filesystem.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR \fR
-.ad
-.RS 28n
-The value of one or more arguments is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ARGS\fR \fR
-.ad
-.RS 28n
-Action is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_OUT_OF_RESOURCE\fR \fR
-.ad
-.RS 28n
-Unable to create or remove device node.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F), \fBddi_create_minor_node\fR(9F),
-\fBddi_remove_minor_node\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_MapLogSocket.9f	2014-11-12 17:44:35.872370250 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,133 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_MAPLOGSOCKET 9F "Jul 19, 1996"
-.SH NAME
-csx_MapLogSocket \- return the physical socket number associated with the
-client handle
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_MapLogSocket\fR(\fBclient_handle_t\fR \fIch\fR, \fBmap_log_socket_t *\fR\fIls\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIls\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBmap_log_socket_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns the physical socket number associated with the client
-handle.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBmap_log_socket_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     LogSocket;      /* logical socket number */
-uint32_t     PhyAdapter;     /* physical adapter number */
-uint32_t     PhySocket;      /* physical socket number */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBLogSocket\fR \fR
-.ad
-.RS 15n
-Not used by this implementation of Card Services and can be set to any
-arbitrary value.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPhyAdapter\fR \fR
-.ad
-.RS 15n
-Returns the physical adapter number, which is always \fB0\fR in the Solaris
-implementation of Card Services.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPhySocket\fR \fR
-.ad
-.RS 15n
-Returns the physical socket number associated with the client handle. The
-physical socket number is typically used as part of an error or message string
-or if the client creates minor nodes based on the physical socket number.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_MapMemPage.9f	2014-11-12 17:44:35.923033075 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,148 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_MAPMEMPAGE 9F "Jul 19, 1996"
-.SH NAME
-csx_MapMemPage \- map the memory area on a PC Card
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_MapMemPage\fR(\fBwindow_handle_t\fR \fIwh\fR, \fBmap_mem_page_t *\fR\fImp\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIwh\fR \fR
-.ad
-.RS 7n
-Window handle returned from \fBcsx_RequestWindow\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fImp\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBmap_mem_page_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function maps the memory area on a \fBPC \fRCard into a page of a window
-allocated with the \fBcsx_RequestWindow\fR(9F) function.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBmap_mem_page_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     CardOffset;       /* card offset */
-uint32_t     Page;             /* page number */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBCardOffset\fR \fR
-.ad
-.RS 15n
-The absolute offset in bytes from the beginning of the \fBPC \fRCard to map
-into system memory.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPage\fR \fR
-.ad
-.RS 15n
-Used internally by Card Services; clients must set this field to \fB0\fR before
-calling this function.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_OFFSET\fR \fR
-.ad
-.RS 28n
-Offset is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_PAGE\fR \fR
-.ad
-.RS 28n
-Page is not zero.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ModifyWindow\fR(9F), \fBcsx_ReleaseWindow\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_ModifyConfiguration.9f	2014-11-12 17:44:35.973667676 +0100
+++ /dev/null	2014-11-12 17:44:35.000000000 +0100
@@ -1,254 +0,0 @@
-'\" te
-.\"  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_MODIFYCONFIGURATION 9F "Jul 19, 1996"
-.SH NAME
-csx_ModifyConfiguration \- modify socket and PC Card Configuration Register
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ModifyConfiguration\fR(\fBclient_handle_t\fR \fIch\fR, \fBmodify_config_t *\fR\fImc\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fImc\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBmodify_config_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function allows a socket and \fBPC \fRCard configuration to be modified.
-This function can only modify a configuration requested via
-\fBcsx_RequestConfiguration\fR(9F).
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBmodify_config_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;        /* socket number */
-uint32_t     Attributes;    /* attributes to modify */
-uint32_t     Vpp1;          /* Vpp1 value */
-uint32_t     Vpp2;          /* Vpp2 value */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 15n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 15n
-This field is bit-mapped. The following bits are defined:
-.sp
-.ne 2
-.na
-\fBCONF_ENABLE_IRQ_STEERING\fR
-.ad
-.RS 28n
-Enable IRQ steering. Set to connect the \fBPC \fRCard \fBIREQ \fRline to a
-previously selected system interrupt.
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONF_IRQ_CHANGE_VALID\fR
-.ad
-.RS 28n
-IRQ change valid. Set to request the \fBIRQ \fRsteering enable to be changed.
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONF_VPP1_CHANGE_VALID\fR
-.ad
-.RS 28n
-Vpp1 change valid. These bits are set to request a change to the corresponding
-voltage level for the \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONF_VPP2_CHANGE_VALID\fR
-.ad
-.RS 28n
-Vpp2 change valid. These bits are set to request a change to the corresponding
-voltage level for the \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONF_VSOVERRIDE\fR
-.ad
-.RS 28n
-Override VS pins. For Low Voltage keyed cards, must be set if a client desires
-to apply a voltage inappropriate for this card to any pin. After card insertion
-and prior to the first \fBcsx_RequestConfiguration\fR(9F) call for this client,
-the voltage levels applied to the card will be those specified by the Card
-Interface Specification. (See \fBWARNINGS\fR.)
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBVpp1\fR, \fBVpp2\fR\fR
-.ad
-.RS 15n
-Represent voltages expressed in tenths of a volt. Values from \fB0\fR to
-\fB25.5\fR volts may be set. To be valid, the exact voltage must be available
-from the system. To be compliant with the \fIPC Card 95 Standard,
-PCMCIA/JEIDA\fR, systems must always support \fB5.0\fR volts for both \fBVcc\fR
-and \fBVpp\fR. (See \fBWARNINGS\fR.)
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid or \fBcsx_RequestConfiguration\fR(9F) not done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-Error getting/setting socket hardware parameters.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_VPP\fR \fR
-.ad
-.RS 28n
-Requested \fBVpp\fR is not available on socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ReleaseConfiguration\fR(9F),
-\fBcsx_ReleaseIO\fR(9F), \fBcsx_ReleaseIRQ\fR(9F),
-\fBcsx_RequestConfiguration\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestIRQ\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
-.SH WARNINGS
-.RS +4
-.TP
-1.
-\fBCONF_VSOVERRIDE\fR is provided for clients that have a need to override
-the information provided in the CIS. The client must exercise caution when
-setting this as it overrides any voltage level protection provided by Card
-Services.
-.RE
-.RS +4
-.TP
-2.
-Using \fBcsx_ModifyConfiguration()\fR to set \fBVpp\fR to \fB0\fR volts may
-result in the loss of a \fBPC \fRCard's state. Any client setting \fBVpp\fR to
-\fB0\fR volts is responsible for insuring that the \fBPC \fRCard's state is
-restored when power is re-applied to the card.
-.RE
-.SH NOTES
-.sp
-.LP
-Mapped \fBIO \fRaddresses can only be changed by first releasing the current
-configuration and \fBIO \fRresources with \fBcsx_ReleaseConfiguration\fR(9F)
-and \fBcsx_ReleaseIO\fR(9F), requesting new \fBIO \fRresources and a new
-configuration with \fBcsx_RequestIO\fR(9F), followed by
-\fBcsx_RequestConfiguration\fR(9F).
-.sp
-.LP
-\fBIRQ \fRpriority can only be changed by first releasing the current
-configuration and \fBIRQ \fRresources with \fBcsx_ReleaseConfiguration\fR(9F)
-and \fBcsx_ReleaseIRQ\fR(9F), requesting new \fBIRQ \fRresources and a new
-configuration with \fBcsx_RequestIRQ\fR(9F), followed by
-\fBcsx_RequestConfiguration\fR(9F).
-.sp
-.LP
-\fBVcc\fR can not be changed using \fBcsx_ModifyConfiguration()\fR. \fBVcc\fR
-may be changed by first invoking \fBcsx_ReleaseConfiguration\fR(9F), followed
-by \fBcsx_RequestConfiguration\fR(9F) with a new \fBVcc\fR value.
--- old/usr/src/man/man9f/csx_ModifyWindow.9f	2014-11-12 17:44:36.024923586 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,263 +0,0 @@
-'\" te
-.\"  Copyright (c) 2000, Sun Microsystems, Inc.
-.\"  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_MODIFYWINDOW 9F "Jul 19, 1996"
-.SH NAME
-csx_ModifyWindow \- modify window attributes
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ModifyWindow\fR(\fBwindow_handle_t\fR \fIwh\fR, \fBmodify_win_t *\fR\fImw\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIwh\fR \fR
-.ad
-.RS 7n
-Window handle returned from \fBcsx_RequestWindow\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fImw\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBmodify_win_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function modifies the attributes of a window allocated by the
-\fBcsx_RequestWindow\fR(9F) function.
-.sp
-.LP
-Only some of the window attributes or the access speed field may be modified by
-this request. The \fBcsx_MapMemPage\fR(9F) function is also used to set the
-offset into \fBPC \fRCard memory to be mapped into system memory for paged
-windows. The \fBcsx_RequestWindow\fR(9F) and \fBcsx_ReleaseWindow\fR(9F)
-functions must be used to change the window base or size.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBmodify_win_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t       Attributes;          /* window flags */
-uint32_t       AccessSpeed;         /* window access speed */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 15n
-This field is bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fBWIN_MEMORY_TYPE_CM\fR
-.ad
-.RS 26n
-Window points to Common Memory area. Set this to map the window to Common
-Memory.
-.RE
-
-.sp
-.ne 2
-.na
-\fBWIN_MEMORY_TYPE_AM\fR
-.ad
-.RS 26n
-Window points to Attribute Memory area. Set this to map the window to Attribute
-Memory.
-.RE
-
-.sp
-.ne 2
-.na
-\fBWIN_ENABLE\fR
-.ad
-.RS 26n
-Enable Window. The client must set this to enable the window.
-.RE
-
-.sp
-.ne 2
-.na
-\fBWIN_ACCESS_SPEED_VALID\fR
-.ad
-.RS 26n
-\fBAccessSpeed\fR valid. The client must set this when the \fBAccessSpeed\fR
-field has a value that the client wants set for the window.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAccessSpeed\fR\fR
-.ad
-.RS 15n
-The bit definitions for this field use the format of the extended speed byte of
-the Device \fBID \fRtuple. If the mantissa is \fB0\fR (noted as reserved in the
-\fIPC Card 95 Standard\fR), the lower bits are a binary code representing a
-speed from the list below. Numbers in the first column are codes; items in the
-second column are speeds.
-.sp
-.ne 2
-.na
-\fB0\fR
-.ad
-.RS 9n
-Reserved: do not use
-.RE
-
-.sp
-.ne 2
-.na
-\fB1\fR
-.ad
-.RS 9n
-\fB250 nsec\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB2\fR
-.ad
-.RS 9n
-\fB200 nsec\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB3\fR
-.ad
-.RS 9n
-\fB150 nsec\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB4\fR
-.ad
-.RS 9n
-\fB100 nsec\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB5 - 7\fR
-.ad
-.RS 9n
-Reserved: do not use
-.RE
-
-It is recommended that clients use the \fBcsx_ConvertSpeed\fR(9F) function to
-generate the appropriate \fBAccessSpeed\fR values rather than manually
-perturbing the \fBAccessSpeed\fR field.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Window handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_OFFSET\fR \fR
-.ad
-.RS 28n
-Error getting/setting window hardware parameters.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_WINDOW\fR \fR
-.ad
-.RS 28n
-Error getting/setting window hardware parameters.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SPEED\fR \fR
-.ad
-.RS 28n
-\fBAccessSpeed\fR is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ConvertSpeed\fR(9F), \fBcsx_MapMemPage\fR(9F),
-\fBcsx_ReleaseWindow\fR(9F), \fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_ParseTuple.9f	2014-11-12 17:44:36.076326468 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,185 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSETUPLE 9F "Dec 20, 1996"
-.SH NAME
-csx_ParseTuple \- generic tuple parser
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ParseTuple\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR, \fBcisparse_t *\fR\fIcp\fR,
-     \fBcisdata_t\fR \fIcd\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcp\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcisparse_t\fR structure that unifies all tuple parsing
-structures.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcd\fR \fR
-.ad
-.RS 7n
-Extended tuple data for some tuples.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function is the generic tuple parser entry point.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcisparse_t\fR are:
-.sp
-.in +2
-.nf
-  typedef union cisparse_t {
-     cistpl_config_t           cistpl_config;
-     cistpl_device_t           cistpl_device;
-     cistpl_vers_1_t           cistpl_vers_1;
-     cistpl_vers_2_t           cistpl_vers_2;
-     cistpl_jedec_t            cistpl_jedec;
-     cistpl_format_t           cistpl_format;
-     cistpl_geometry_t         cistpl_geometry;
-     cistpl_byteorder_t        cistpl_byteorder;
-     cistpl_date_t             cistpl_date;
-     cistpl_battery_t          cistpl_battery;
-     cistpl_org_t              cistpl_org;
-     cistpl_manfid_t           cistpl_manfid;
-     cistpl_funcid_t           cistpl_funcid;
-     cistpl_funce_t            cistpl_funce;
-     cistpl_cftable_entry_t    cistpl_cftable_entry;
-     cistpl_linktarget_t       cistpl_linktarget;
-     cistpl_longlink_ac_t      cistpl_longlink_ac;
-     cistpl_longlink_mfc_t     cistpl_longlink_mfc;
-     cistpl_spcl_t             cistpl_spcl;
-     cistpl_swil_t             cistpl_swil;
-     cistpl_bar_t              cistpl_bar;
-     cistpl_devicegeo_t        cistpl_devicegeo;
-     cistpl_longlink_cb_t      cistpl_longlink_cb;
-     cistpl_get_tuple_name_t   cistpl_get_tuple_name;
-  } cisparse_t;
-.fi
-.in -2
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_CIS\fR \fR
-.ad
-.RS 28n
-Generic parser error.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (\fBCIS\fR) on \fBPC\fR Card.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_BATTERY\fR(9F), \fBcsx_Parse_CISTPL_BYTEORDER\fR(9F),
-\fBcsx_Parse_CISTPL_CFTABLE_ENTRY\fR(9F), \fBcsx_Parse_CISTPL_CONFIG\fR(9F),
-\fBcsx_Parse_CISTPL_DATE\fR(9F), \fBcsx_Parse_CISTPL_DEVICE\fR(9F),
-\fBcsx_Parse_CISTPL_FUNCE\fR(9F), \fBcsx_Parse_CISTPL_FUNCID\fR(9F),
-\fBcsx_Parse_CISTPL_JEDEC_C\fR(9F), \fBcsx_Parse_CISTPL_MANFID\fR(9F),
-\fBcsx_Parse_CISTPL_SPCL\fR(9F), \fBcsx_Parse_CISTPL_VERS_1\fR(9F),
-\fBcsx_Parse_CISTPL_VERS_2\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_BATTERY.9f	2014-11-12 17:44:36.128025619 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,164 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_BATTERY 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_BATTERY \- parse the Battery Replacement Date tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_BATTERY\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_battery_t *\fR\fIcb\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcb\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_battery_t\fR structure which contains the parsed
-\fBCISTPL_BATTERY\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Battery Replacement Date tuple, \fBCISTPL_BATTERY,\fR
-into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_BATTERY\fR tuple is an optional tuple which shall be present only
-in \fBPC \fRCards with battery-backed storage. It indicates the date on which
-the battery was replaced, and the date on which the battery is expected to need
-replacement. Only one \fBCISTPL_BATTERY\fR tuple is allowed per \fBPC \fRCard.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_battery_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     rday;     /* date battery last replaced */
-uint32_t     xday;     /* date battery due for replacement */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBrday\fR\fR
-.ad
-.RS 8n
-This field indicates the date on which the battery was last replaced.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBxday\fR\fR
-.ad
-.RS 8n
-This field indicates the date on which the battery should be replaced.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_BYTEORDER.9f	2014-11-12 17:44:36.178743128 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,209 +0,0 @@
-'\" te
-.\"  Copyright (c) 2000, Sun Microsystems, Inc.
-.\"  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_BYTEORDER 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_BYTEORDER \- parse the Byte Order tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_BYTEORDER\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_byteorder_t *\fR\fIcbo\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 8n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR \fR
-.ad
-.RS 8n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcbo\fR \fR
-.ad
-.RS 8n
-Pointer to a \fBcistpl_byteorder_t\fR structure which contains the parsed
-\fBCISTPL_BYTEORDER\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Byte Order tuple, \fBCISTPL_BYTEORDER\fR, into a form
-usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_BYTEORDER\fR tuple shall only appear in a partition tuple set for
-a memory-like partition. It specifies two parameters: the order for multi-byte
-data, and the order in which bytes map into words for 16-bit cards.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_byteorder_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     order;     /* byte order code */
-uint32_t     map;       /* byte mapping code */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBorder\fR \fR
-.ad
-.RS 10n
-This field specifies the byte order for multi-byte numeric data.
-.sp
-.ne 2
-.na
-\fBTPLBYTEORD_LOW\fR
-.ad
-.RS 18n
-Little endian order
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLBYTEORD_VS\fR
-.ad
-.RS 18n
-Vendor specific
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBmap\fR \fR
-.ad
-.RS 10n
-This field specifies the byte mapping for 16-bit or wider cards.
-.sp
-.ne 2
-.na
-\fBTPLBYTEMAP_LOW\fR
-.ad
-.RS 19n
-Byte zero is least significant byte
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLBYTEMAP_HIGH\fR
-.ad
-.RS 19n
-Byte zero is most significant byte
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLBYTEMAP_VS\fR
-.ad
-.RS 19n
-Vendor specific mapping
-.RE
-
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_CFTABLE_ENTRY.9f	2014-11-12 17:44:36.229904271 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,874 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_CFTABLE_ENTRY 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_CFTABLE_ENTRY \- parse 16-bit Card Configuration Table Entry
-tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_CFTABLE_ENTRY\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_cftable_entry_t *\fR\fIcft\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned  by  a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcft\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_cftable_entry_t\fR structure which contains the parsed
-\fBCISTPL_CFTABLE_ENTRY\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the 16 bit Card Configuration Table Entry tuple,
-\fBCISTPL_CFTABLE_ENTRY,\fR into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_CFTABLE_ENTRY\fR tuple is used to describe each possible
-configuration of a \fBPC \fRCard and to distinguish among the permitted
-configurations. The \fBCISTPL_CONFIG\fR tuple must precede all
-\fBCISTPL_CFTABLE_ENTRY\fR tuples.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t                      flags;     /* valid descriptions */
-uint32_t                      ifc;       /* interface description */
-                                         /*	information */
-uint32_t                      pin;       /* values for PRR */
-uint32_t                      index;     /* configuration index number */
-cistpl_cftable_entry_pd_t     pd;        /* power requirements */
-                                         /* description */
-cistpl_cftable_entry_speed_t  speed;     /* device speed description */
-cistpl_cftable_entry_io_t     io;        /* device I/O map */
-cistpl_cftable_entry_irq_t    irq;       /* device IRQ utilization */
-cistpl_cftable_entry_mem_t    mem;       /* device memory space */
-cistpl_cftable_entry_misc_t   misc;      /* miscellaneous
-                                         /* device features */
-.fi
-.in -2
-
-.sp
-.LP
-The \fBflags\fR field is defined and bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_DEFAULT\fR
-.ad
-.sp .6
-.RS 4n
-This is a default configuration
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF\fR
-.ad
-.sp .6
-.RS 4n
-If configuration byte exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_PWR\fR
-.ad
-.sp .6
-.RS 4n
-Power information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_TD\fR
-.ad
-.sp .6
-.RS 4n
-Timing information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IO\fR
-.ad
-.sp .6
-.RS 4n
-I/O information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IRQ\fR
-.ad
-.sp .6
-.RS 4n
-IRQ information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MEM\fR
-.ad
-.sp .6
-.RS 4n
-MEM space information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MISC\fR
-.ad
-.sp .6
-.RS 4n
-MISC information exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_STCE_EV\fR
-.ad
-.sp .6
-.RS 4n
-STCE_EV exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_STCE_PD\fR
-.ad
-.sp .6
-.RS 4n
-STCE_PD exists
-.RE
-
-.sp
-.LP
-If the \fBCISTPL_CFTABLE_TPCE_IF\fR flag is set,  the \fBifc\fR field is
-bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_MEMORY\fR
-.ad
-.sp .6
-.RS 4n
-Memory interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_IO_MEM\fR
-.ad
-.sp .6
-.RS 4n
-IO and memory
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_CUSTOM_0\fR
-.ad
-.sp .6
-.RS 4n
-Custom interface 0
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_CUSTOM_1\fR
-.ad
-.sp .6
-.RS 4n
-Custom interface 1
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_CUSTOM_2\fR
-.ad
-.sp .6
-.RS 4n
-Custom interface 2
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_CUSTOM_3\fR
-.ad
-.sp .6
-.RS 4n
-Custom interface 3
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_MASK\fR
-.ad
-.sp .6
-.RS 4n
-Interface type mask
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_BVD\fR
-.ad
-.sp .6
-.RS 4n
-BVD active in PRR
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_WP\fR
-.ad
-.sp .6
-.RS 4n
-WP active in PRR
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_RDY\fR
-.ad
-.sp .6
-.RS 4n
-RDY active in PRR
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_IF_MWAIT\fR
-.ad
-.sp .6
-.RS 4n
-WAIT - mem cycles
-.RE
-
-.sp
-.LP
-\fBpin\fR is a value for the Pin Replacement Register.
-.sp
-.LP
-\fBindex\fR is a configuration index number.
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_pd_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t                    flags;     /* which descriptions are valid */
-cistpl_cftable_entry_pwr_t  pd_vcc;    /* VCC power description */
-cistpl_cftable_entry_pwr_t  pd_vpp1;   /* Vpp1 power description */
-cistpl_cftable_entry_pwr_t  pd_vpp2;   /* Vpp2 power description */
-.fi
-.in -2
-
-.sp
-.LP
-This \fBflags\fR field is bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_PWR_VCC\fR
-.ad
-.sp .6
-.RS 4n
-Vcc description valid
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_PWR_VPP1\fR
-.ad
-.sp .6
-.RS 4n
-Vpp1 description valid
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_PWR_VPP2\fR
-.ad
-.sp .6
-.RS 4n
-Vpp2 description valid
-.RE
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_pwr_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     nomV;        /* nominal supply voltage */
-uint32_t     nomV_flags;
-uint32_t     minV;        /* minimum supply voltage */
-uint32_t     minV_flags;
-uint32_t     maxV;        /* maximum supply voltage */
-uint32_t     maxV_flags;
-uint32_t     staticI;     /* continuous supply current */
-uint32_t     staticI_flags;
-uint32_t     avgI;        /* max current required averaged over 1 sec. */
-uint32_t     avgI_flags;
-uint32_t     peakI;       /* max current required averaged over 10mS */
-uint32_t     peakI_flags;
-uint32_t     pdownI;      /* power down supply current required */
-uint32_t     pdownI_flags;
-.fi
-.in -2
-
-.sp
-.LP
-\fBnomV\fR, \fBminV\fR, \fBmaxV\fR,  \fBstaticI\fR, \fBavgI\fR,
-\fBpeakI_flag\fR, and \fBpdownI\fR are defined and bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_NOMV\fR
-.ad
-.RS 29n
-Nominal supply voltage
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_MINV\fR
-.ad
-.RS 29n
-Minimum supply voltage
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_MAXV\fR
-.ad
-.RS 29n
-Maximum supply voltage
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_STATICI\fR
-.ad
-.RS 29n
-Continuous supply current
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_AVGI\fR
-.ad
-.RS 29n
-Maximum current required averaged       over 1 second
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_PEAKI\fR
-.ad
-.RS 29n
-Maximum current required averaged       over 10mS
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_PDOWNI\fR
-.ad
-.RS 29n
-Power down supply current required
-.RE
-
-.sp
-.LP
-\fBnomV_flags\fR, \fBminV_flags\fR, \fBmaxV_flags\fR, \fBstaticI_flags\fR,
-\fBavgI_flags\fR, \fBpeakI_flags\fR, and \fBpdownI_flags\fR are defined and
-bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_EXISTS\fR
-.ad
-.RS 30n
-This parameter exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_MUL10\fR
-.ad
-.RS 30n
-Multiply return value by 10
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_NC_SLEEP\fR
-.ad
-.RS 30n
-No connection on sleep/power down
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_ZERO\fR
-.ad
-.RS 30n
-Zero value required
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_PD_NC\fR
-.ad
-.RS 30n
-No connection ever
-.RE
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_speed_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t    flags;       /* which timing information is present */
-uint32_t    wait;        /* max WAIT time in device speed format */
-uint32_t    nS_wait;     /* max WAIT time in nS */
-uint32_t    rdybsy;      /* max RDY/BSY time in device speed format */
-uint32_t    nS_rdybsy;   /* max RDY/BSY time in nS */
-uint32_t    rsvd;        /* max RSVD time in device speed format */
-uint32_t    nS_rsvd;     /* max RSVD time in nS */
-.fi
-.in -2
-
-.sp
-.LP
-The \fBflags\fR field is bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_TD_WAIT\fR
-.ad
-.sp .6
-.RS 4n
-WAIT timing exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_TD_RDY\fR
-.ad
-.sp .6
-.RS 4n
-RDY/BSY timing exists
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_TD_RSVD\fR
-.ad
-.sp .6
-.RS 4n
-RSVD timing exists
-.RE
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_io_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     flags;        /* direct copy of TPCE_IO byte in tuple */
-uint32_t     addr_lines;   /* number of decoded I/O address lines */
-uint32_t     ranges;       /* number of I/O ranges */
-cistpl_cftable_entry_io_range_t
-              range[CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES];
-.fi
-.in -2
-
-.sp
-.LP
-The \fBflags\fR field is defined and bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IO_BUS\fR
-.ad
-.sp .6
-.RS 4n
-Bus width mask
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IO_BUS8\fR
-.ad
-.sp .6
-.RS 4n
-8-bit flag
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IO_BUS16\fR
-.ad
-.sp .6
-.RS 4n
-16-bit flag
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_IO_RANGE\fR
-.ad
-.sp .6
-.RS 4n
-IO address ranges exist
-.RE
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_io_range_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     addr;     /* I/O start address */
-uint32_t     length;   /* I/O register length */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_irq_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     flags;   /* direct copy of TPCE_IR byte in tuple */
-uint32_t     irqs;    /* bit mask for each allowed IRQ */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_mem_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     flags;     /* memory descriptor type and host addr info */
-uint32_t     windows;   /* number of memory space descriptors */
-cistpl_cftable_entry_mem_window_t
-         window[CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS];
-.fi
-.in -2
-
-.sp
-.LP
-The \fBflags\fR field is defined and bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MEM3\fR
-.ad
-.sp .6
-.RS 4n
-Space descriptors
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MEM2\fR
-.ad
-.sp .6
-.RS 4n
-\fBhost_addr\fR=\fBcard_addr\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MEM1\fR
-.ad
-.sp .6
-.RS 4n
-Card address=0 any host address
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_FS_MEM_HOST\fR
-.ad
-.sp .6
-.RS 4n
-If host address is present in MEM3
-.RE
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_mem_window_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     length;     /* length of this window */
-uint32_t     card_addr;  /* card address */
-uint32_t     host_addr;  /* host address */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBcistpl_cftable_entry_misc_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     flags;      /* miscellaneous features flags */
-.fi
-.in -2
-
-.sp
-.LP
-The \fBflags\fR field is defined and bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_MTC_MASK\fR
-.ad
-.sp .6
-.RS 4n
-Max twin cards mask
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_AUDIO\fR
-.ad
-.sp .6
-.RS 4n
-Audio on BVD2
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_READONLY\fR
-.ad
-.sp .6
-.RS 4n
-R/O storage
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_PWRDOWN\fR
-.ad
-.sp .6
-.RS 4n
-Powerdown capable
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DRQ_MASK\fR
-.ad
-.sp .6
-.RS 4n
-DMAREQ mask
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DRQ_SPK\fR
-.ad
-.sp .6
-.RS 4n
-DMAREQ on SPKR
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DRQ_IOIS\fR
-.ad
-.sp .6
-.RS 4n
-DMAREQ on IOIS16
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DRQ_INP\fR
-.ad
-.sp .6
-.RS 4n
-DMAREQ on INPACK
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DMA_8\fR
-.ad
-.sp .6
-.RS 4n
-DMA width 8 bits
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_CFTABLE_TPCE_MI_DMA_16\fR
-.ad
-.sp .6
-.RS 4n
-DMA width 16 bits
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_CONFIG\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_CONFIG.9f	2014-11-12 17:44:36.282802985 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,306 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_CONFIG 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_CONFIG \- parse Configuration tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_CONFIG\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_config_t *\fR\fIcc\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcc\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_config_t\fR structure which contains the parsed
-\fBCISTPL_CONFIG\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Configuration tuple, \fBCISTPL_CONFIG,\fR into a form
-usable by \fBPC \fRCard drivers. The \fBCISTPL_CONFIG\fR tuple is used to
-describe the general characteristics of 16-bit \fBPC \fRCards containing \fBI/O
-\fRdevices or using custom interfaces. It may also describe \fBPC \fRCards,
-including Memory Only cards, which exceed nominal power supply specifications,
-or which need descriptions of their power requirements or other information.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_config_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     present;     /* register present flags */
-uint32_t     nr;          /* number of config registers found */
-uint32_t     hr;          /* highest config register index found */
-uint32_t     regs[CISTPL_CONFIG_MAX_CONFIG_REGS];    /* reg offsets */
-uint32_t     base;        /* base offset of config registers */
-uint32_t     last;        /* last config index */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBpresent\fR\fR
-.ad
-.RS 11n
-This field indicates which configuration registers are present on the \fBPC
-\fRCard.
-.sp
-.ne 2
-.na
-\fBCONFIG_OPTION_REG_PRESENT\fR
-.ad
-.RS 30n
-Configuration Option Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_STATUS_REG_PRESENT\fR
-.ad
-.RS 30n
-Configuration Status Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_PINREPL_REG_PRESENT\fR
-.ad
-.RS 30n
-Pin Replacement Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_COPY_REG_PRESENT\fR
-.ad
-.RS 30n
-Copy Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_EXSTAT_REG_PRESENT\fR
-.ad
-.RS 30n
-Extended Status Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_IOBASE0_REG_PRESENT\fR
-.ad
-.RS 30n
-IO Base 0 Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_IOBASE1_REG_PRESENT\fR
-.ad
-.RS 30n
-IO Base 1 Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_IOBASE2_REG_PRESENT\fR
-.ad
-.RS 30n
-IO Base2 Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_IOBASE3_REG_PRESENT\fR
-.ad
-.RS 30n
-IO Base3 Register present
-.RE
-
-.sp
-.ne 2
-.na
-\fBCONFIG_IOLIMIT_REG_PRESENT\fR
-.ad
-.RS 30n
-IO Limit Register present
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnr\fR\fR
-.ad
-.RS 11n
-This field specifies the number of configuration registers that are present on
-the \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBhr\fR\fR
-.ad
-.RS 11n
-This field specifies the highest configuration register number that is present
-on the \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBregs\fR\fR
-.ad
-.RS 11n
-This array contains the offset from the start of Attribute Memory space for
-each configuration register that is present on the \fBPC \fRCard. If a
-configuration register is not present on the \fBPC \fRCard, the value in the
-corresponding entry in the \fBregs\fR array is undefined.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBbase\fR\fR
-.ad
-.RS 11n
-This field contains the offset from the start of Attribute Memory space to the
-base of the \fBPC \fRCard configuration register space.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBlast\fR\fR
-.ad
-.RS 11n
-This field contains the value of the last valid configuration index for this
-\fBPC \fRCard.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_CFTABLE_ENTRY\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
-.SH NOTES
-.sp
-.LP
-\fBPC \fRCard drivers should not attempt to use configurations beyond the
-"last" member in the \fBcistpl_config_t\fR structure.
--- old/usr/src/man/man9f/csx_Parse_CISTPL_DATE.9f	2014-11-12 17:44:36.333940801 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,163 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_DATE 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_DATE \- parse the Card Initialization Date tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DATE\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_date_t *\fR\fIcd\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcd\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_date_t\fR structure which contains the parsed
-\fBCISTPL_DATE\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Card Initialization Date tuple, \fBCISTPL_DATE,\fR
-into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_DATE\fR tuple is an optional tuple. It indicates the date and
-time at which the card was formatted. Only one \fBCISTPL_DATE\fR tuple is
-allowed per \fBPC \fRCard.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_date_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     time;
-uint32_t     day
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBtime\fR\fR
-.ad
-.RS 8n
-This field indicates the time at which the \fBPC \fRCard was initialized.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBday\fR\fR
-.ad
-.RS 8n
-This field indicates the date the \fBPC \fRCard was initialized.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_DEVICE.9f	2014-11-12 17:44:36.385055837 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,421 +0,0 @@
-'\" te
-.\"  Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_DEVICE 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_DEVICE, csx_Parse_CISTPL_DEVICE_A, csx_Parse_CISTPL_DEVICE_OC,
-csx_Parse_CISTPL_DEVICE_OA \- parse Device Information tuples
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICE\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_device_t *\fR\fIcd\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICE_A\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_device_t *\fR\fIcd\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICE_OC\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_device_t *\fR\fIcd\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICE_OA\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_device_t *\fR\fIcd\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcd\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_device_t\fR structure which contains the parsed
-\fBCISTPL_DEVICE,\fR \fBCISTPL_DEVICE_A,\fR \fBCISTPL_DEVICE_OC,\fR or
-\fBCISTPL_DEVICE_OA\fR tuple information upon return from these functions,
-respectively.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBcsx_Parse_CISTPL_DEVICE()\fR and \fBcsx_Parse_CISTPL_DEVICE_A()\fR parse the
-5 volt Device Information tuples, \fBCISTPL_DEVICE\fR and
-\fBCISTPL_DEVICE_A,\fR respectively, into a form usable by \fBPC \fRCard
-drivers.
-.sp
-.LP
-\fBcsx_Parse_CISTPL_DEVICE_OC()\fR and \fBcsx_Parse_CISTPL_DEVICE_OA()\fR parse
-the Other Condition Device Information tuples, \fBCISTPL_DEVICE_OC\fR and
-\fBCISTPL_DEVICE_OA,\fR respectively, into a form usable by \fBPC \fRCard
-drivers.
-.sp
-.LP
-The \fBCISTPL_DEVICE\fR and \fBCISTPL_DEVICE_A\fR tuples are used to describe
-the card's device information, such as device speed, device size, device type,
-and address space layout information for Common Memory or Attribute Memory
-space, respectively.
-.sp
-.LP
-The \fBCISTPL_DEVICE_OC\fR and \fBCISTPL_DEVICE_OA\fR tuples are used to
-describe the information about the card's device under a set of operating
-conditions for Common Memory or Attribute Memory space, respectively.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_device_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t               num_devices;    /* number of devices found */
-cistpl_device_node_t   devnode[CISTPL_DEVICE_MAX_DEVICES];
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBcistpl_device_node_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     flags;             /* flags specific to this device */
-uint32_t     speed;             /* device speed in device
-                                /*  speed code format */
-uint32_t     nS_speed;          /* device speed in nS */
-uint32_t     type;              /* device type */
-uint32_t     size;              /* device size */
-uint32_t     size_in_bytes;     /* device size in bytes */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBflags\fR\fR
-.ad
-.RS 9n
-This field indicates whether or not the device is writable, and describes a
-\fBVcc\fR voltage at which the \fBPC \fRCard can be operated.
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_WPS\fR
-.ad
-.RS 21n
-Write Protect Switch bit is set
-.RE
-
-Bits which are applicable only for \fBCISTPL_DEVICE_OC\fR and
-\fBCISTPL_DEVICE_OA\fR are:
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_MWAIT\fR
-.ad
-.RS 29n
-Use MWAIT
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_Vcc_MASK\fR
-.ad
-.RS 29n
-Mask for \fBVcc\fR value
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_Vcc5\fR
-.ad
-.RS 29n
-5.0 volt operation
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_Vcc33\fR
-.ad
-.RS 29n
-3.3 volt operation
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_VccXX\fR
-.ad
-.RS 29n
-X.X volt operation
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_OC_VccYY\fR
-.ad
-.RS 29n
-Y.Y volt operation
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBspeed\fR\fR
-.ad
-.RS 17n
-The device speed value described in the device speed code unit. If this field
-is set to \fBCISTPL_DEVICE_SPEED_SIZE_IGNORE,\fR then the speed information
-will be ignored.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnS_speed\fR\fR
-.ad
-.RS 17n
-The device speed value described in nanosecond units.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBsize\fR\fR
-.ad
-.RS 17n
-The device size value described in the device size code unit. If this field is
-set to \fBCISTPL_DEVICE_SPEED_SIZE_IGNORE,\fR then the size information will be
-ignored.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBsize_in_bytes\fR\fR
-.ad
-.RS 17n
-The device size value described in byte units.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtype\fR\fR
-.ad
-.RS 17n
-This is the device type code field which is defined as follows:
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_NULL\fR
-.ad
-.sp .6
-.RS 4n
-No device
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_ROM\fR
-.ad
-.sp .6
-.RS 4n
-Masked ROM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_OTPROM\fR
-.ad
-.sp .6
-.RS 4n
-One Time Programmable ROM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_EPROM\fR
-.ad
-.sp .6
-.RS 4n
-UV EPROM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_EEPROM\fR
-.ad
-.sp .6
-.RS 4n
-EEPROM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_FLASH\fR
-.ad
-.sp .6
-.RS 4n
-FLASH
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_SRAM\fR
-.ad
-.sp .6
-.RS 4n
-Static RAM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_DRAM\fR
-.ad
-.sp .6
-.RS 4n
-Dynamic RAM
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_FUNCSPEC\fR
-.ad
-.sp .6
-.RS 4n
-Function-specific memory address range
-.RE
-
-.sp
-.ne 2
-.na
-\fBCISTPL_DEVICE_DTYPE_EXTEND\fR
-.ad
-.sp .6
-.RS 4n
-Extended type follows
-.RE
-
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_JEDEC_C\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_DEVICEGEO.9f	2014-11-12 17:44:36.436944725 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,210 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_DEVICEGEO 9F "May 16, 1997"
-.SH NAME
-csx_Parse_CISTPL_DEVICEGEO \- parse the Device Geo tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICEGEO\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItp\fR,
-     \fBcistpl_devicegeo_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItp\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_devicegeo_t\fR structure which contains the parsed
-Device Geo tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Device Geo tuple, \fBCISTPL_DEVICEGEO,\fR into a form
-usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_DEVICEGEO\fR tuple describes the device geometry of common memory
-partitions.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_devicegeo_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].part;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the card interface width in bytes for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum erase block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum read block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum write block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].part\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the segment partition subdivisions for the given
-partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the hardware interleave
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetNextTuple\fR(9F),
-\fBcsx_GetTupleData\fR(9F), \fBcsx_Parse_CISTPL_DEVICEGEO_A\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_DEVICEGEO_A.9f	2014-11-12 17:44:36.488219256 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,210 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_DEVICEGEO_A 9F "May 16, 1997"
-.SH NAME
-csx_Parse_CISTPL_DEVICEGEO_A \- parse the Device Geo A tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_DEVICEGEO_A\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItp\fR,
-     \fBcistpl_devicegeo_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItp\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_devicegeo_t\fR structure which contains the parsed
-Device Geo A tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Device Geo A tuple, \fBCISTPL_DEVICEGEO_A,\fR into a
-form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_DEVICEGEO_A\fR tuple describes the device geometry of attribute
-memory partitions.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_devicegeo_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].part;
-uint32_t     info[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].bus\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the card interface width in bytes for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].ebs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum erase block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].rbs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum read block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].wbs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the minimum write block size for the given partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].part\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the segment partition subdivisions for the given
-partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBinfo[CISTPL_DEVICEGEO_MAX_PARTITIONS].hwil\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the hardware interleave for the given partition.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetNextTuple\fR(9F),
-\fBcsx_GetTupleData\fR(9F), \fBcsx_Parse_CISTPL_DEVICEGEO\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_FORMAT.9f	2014-11-12 17:44:36.539636405 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,309 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_FORMAT 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_FORMAT \- parse the Data Recording Format tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_FORMAT\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_format_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_format_t\fR structure which contains the parsed
-\fBCISTPL_FORMAT\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Data Recording Format tuple, \fBCISTPL_FORMAT,\fR into
-a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_FORMAT\fR tuple indicates the data recording format for a device
-partition.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_format_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     type;
-uint32_t     edc_length;
-uint32_t     edc_type;
-uint32_t     offset;
-uint32_t     nbytes;
-uint32_t     dev.disk.bksize;
-uint32_t     dev.disk.nblocks;
-uint32_t     dev.disk.edcloc;
-uint32_t     dev.mem.flags;
-uint32_t     dev.mem.reserved;
-caddr_t      dev.mem.address;
-uint32_t     dev.mem.edcloc;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBtype\fR\fR
-.ad
-.RS 20n
-This field indicates the type of device:
-.sp
-.ne 2
-.na
-\fBTPLFMTTYPE_DISK\fR
-.ad
-.RS 19n
-disk-like device
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFMTTYPE_MEM\fR
-.ad
-.RS 19n
-memory-like device
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFMTTYPE_VS\fR
-.ad
-.RS 19n
-vendor-specific device
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBedc_length\fR\fR
-.ad
-.RS 20n
-This field indicates the error detection code length.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBedc_type\fR\fR
-.ad
-.RS 20n
-This field indicates the error detection code type.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBoffset\fR\fR
-.ad
-.RS 20n
-This field indicates the offset of the first byte of data in this partition.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnbytes\fR\fR
-.ad
-.RS 20n
-This field indicates the number of bytes of data in this partition
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.disk.bksize\fR\fR
-.ad
-.RS 20n
-This field indicates the block size, for disk devices.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.disk.nblocks\fR\fR
-.ad
-.RS 20n
-This field indicates the number of blocks, for disk devices.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.disk.edcloc\fR\fR
-.ad
-.RS 20n
-This field indicates the location of the error detection code, for disk
-devices.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.mem.flags\fR\fR
-.ad
-.RS 20n
-This field provides flags, for memory devices.  Valid flags are:
-.sp
-.ne 2
-.na
-\fBTPLFMTFLAGS_ADDR\fR
-.ad
-.RS 20n
-address is valid
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFMTFLAGS_AUTO\fR
-.ad
-.RS 20n
-automatically map memory region
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.mem.reserved\fR\fR
-.ad
-.RS 20n
-This field is reserved.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.mem.address\fR\fR
-.ad
-.RS 20n
-This field indicates the physical address, for memory devices.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdev.mem.edcloc\fR\fR
-.ad
-.RS 20n
-This field indicates the location of the error detection code, for memory
-devices.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_FUNCE.9f	2014-11-12 17:44:36.590994728 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,1159 +0,0 @@
-'\" te
-.\"  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_FUNCE 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_FUNCE \- parse Function Extension tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_FUNCE\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_funce_t *\fR\fIcf\fR,
-     \fBuint32_t\fR \fIfid\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcf\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_funce_t\fR structure which contains the parsed
-\fBCISTPL_FUNCE\fR tuple information upon return from this function.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIfid\fR\fR
-.ad
-.RS 7n
-The function \fBID \fRcode to which this \fBCISTPL_FUNCE\fR tuple refers. See
-\fBcsx_Parse_CISTPL_FUNCID\fR(9F).
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Function Extension tuple, \fBCISTPL_FUNCE,\fR into a
-form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_FUNCE\fR tuple is used to describe information about a specific
-\fBPC\fRCard function. The information provided is determined by the Function
-Identification tuple, \fBCISTPL_FUNCID,\fR that is being extended. Each
-function has a defined set of extension tuples.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_funce_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     function;           /* type of extended data */
-uint32_t     subfunction;
-union {
-       struct serial {
-              uint32_t  ua;      /* UART in use */
-              uint32_t  uc;      /* UART capabilities */
-       } serial;
-       struct modem {
-              uint32_t  fc;      /* supported flow control methods */
-              uint32_t  cb;      /* size of DCE command buffer */
-              uint32_t  eb;      /* size of DCE to DCE buffer */
-              uint32_t  tb;      /* size of DTE to DCE buffer */
-       } modem;
-       struct data_modem {
-              uint32_t  ud;      /* highest data rate */
-              uint32_t  ms;      /* modulation standards */
-              uint32_t  em;      /* err correct proto and
-								 /* non-CCITT modulation */
-              uint32_t  dc;      /* data compression protocols */
-              uint32_t  cm;      /* command protocols */
-              uint32_t  ex;      /* escape mechanisms */
-              uint32_t  dy;      /* standardized data encryption */
-              uint32_t  ef;      /* miscellaneous end user features */
-              uint32_t  ncd;     /* number of country codes */
-              uchar_t   cd[16];  /* CCITT country code */
-       } data_modem;
-       struct fax {
-              uint32_t  uf;      /* highest data rate in DTE/UART */
-              uint32_t  fm;      /* CCITT modulation standards */
-              uint32_t  fy;      /* standardized data encryption */
-              uint32_t  fs;      /* feature selection */
-              uint32_t  ncf;     /* number of country codes */
-              uchar_t  cf[16];   /* CCITT country codes */
-       } fax;
-       struct voice {
-              uint32_t  uv;      /* highest data rate */
-              uint32_t  nsr;
-              uint32_t  sr[16];  /* voice sampling rates (*100) */
-              uint32_t  nss;
-              uint32_t  ss[16];  /* voice sample sizes (*10) */
-              uint32_t  nsc;
-              uint32_t  sc[16];  /* voice compression methods */
-       } voice;
-       struct lan {
-              uint32_t  tech;    /* network technology */
-              uint32_t  speed;   /* media bit or baud rate */
-              uint32_t  media;   /* network media supported */
-              uint32_t  con;     /* open/closed connector standard */
-              uint32_t  id_sz;   /* length of lan station id */
-              uchar_t  id[16];   /* station ID */
-        } lan;
-} data;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fBfunction\fR
-.ad
-.RS 15n
-This field identifies the type of extended information provided about a
-function by the \fBCISTPL_FUNCE\fR tuple. This field is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_SUB_SERIAL\fR
-.ad
-.RS 26n
-Serial port interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_SUB_MODEM_COMMON\fR
-.ad
-.RS 26n
-Common modem interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_SUB_MODEM_DATA\fR
-.ad
-.RS 26n
-Data modem services
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_SUB_MODEM_FAX\fR
-.ad
-.RS 26n
-Fax modem services
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_SUB_VOICE\fR
-.ad
-.RS 26n
-Voice services
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_MODEM_DATA\fR
-.ad
-.RS 26n
-Capabilities of the data modem interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_MODEM_FAX\fR
-.ad
-.RS 26n
-Capabilities of the fax modem interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_MODEM_VOICE\fR
-.ad
-.RS 26n
-Capabilities of the voice modem interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_SERIAL_DATA\fR
-.ad
-.RS 26n
-Serial port interface for data modem services
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_SERIAL_FAX\fR
-.ad
-.RS 26n
-Serial port interface for fax modem services
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CAP_SERIAL_VOICE\fR
-.ad
-.RS 26n
-Serial port interface for voice modem services
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBsubfunction\fR\fR
-.ad
-.RS 15n
-This is for identifying a sub-category of services provided by a function in
-the \fBCISTPL_FUNCE\fR tuple. The numeric value of the code is in the range of
-\fB1\fR to \fB15\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBua\fR\fR
-.ad
-.RS 15n
-This is the serial port \fBUART \fRidentification and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_UA_8250\fR
-.ad
-.RS 18n
-Intel 8250
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UA_16450\fR
-.ad
-.RS 18n
-NS 16450
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UA_16550\fR
-.ad
-.RS 18n
-NS 16550
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBuc\fR\fR
-.ad
-.RS 15n
-This identifies the serial port \fBUART \fRcapabilities and is defined as
-follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_PARITY_SPACE\fR
-.ad
-.RS 25n
-Space parity supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_PARITY_MARK\fR
-.ad
-.RS 25n
-Mark parity supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_PARITY_ODD\fR
-.ad
-.RS 25n
-Odd parity supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_PARITY_EVEN\fR
-.ad
-.RS 25n
-Even parity supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_CS5\fR
-.ad
-.RS 25n
-5 bit characters supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_CS6\fR
-.ad
-.RS 25n
-6 bit characters supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_CS7\fR
-.ad
-.RS 25n
-7 bit characters supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_CS8\fR
-.ad
-.RS 25n
-8 bit characters supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_STOP_1\fR
-.ad
-.RS 25n
-1 stop bit supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_STOP_15\fR
-.ad
-.RS 25n
-1.5 stop bits supported
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_UC_STOP_2\fR
-.ad
-.RS 25n
-2 stop bits supported
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfc\fR\fR
-.ad
-.RS 15n
-This identifies the modem flow control methods and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_FC_TX_XONOFF\fR
-.ad
-.RS 22n
-Transmit XON/XOFF
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FC_RX_XONOFF\fR
-.ad
-.RS 22n
-Receiver XON/XOFF
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FC_TX_HW\fR
-.ad
-.RS 22n
-Transmit hardware flow control (CTS)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FC_RX_HW\fR
-.ad
-.RS 22n
-Receiver hardware flow control (RTS)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FC_TRANS\fR
-.ad
-.RS 22n
-Transparent flow control
-.RE
-
-.sp
-.ne 2
-.na
-\fBms\fR
-.ad
-.RS 6n
-This identifies the modem modulation standards and is defined as follows:
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_BELL103\fR
-.ad
-.RS 20n
-300bps
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V21\fR
-.ad
-.RS 20n
-300bps (V.21)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V23\fR
-.ad
-.RS 20n
-600/1200bps (V.23)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V22AB\fR
-.ad
-.RS 20n
-1200bps (V.22A V.22B)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_BELL212\fR
-.ad
-.RS 20n
-2400bps (US Bell 212
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V22BIS\fR
-.ad
-.RS 20n
-2400bps (V.22bis)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V26\fR
-.ad
-.RS 20n
-2400bps leased line (V.26)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V26BIS\fR
-.ad
-.RS 20n
-2400bps (V.26bis)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V27BIS\fR
-.ad
-.RS 20n
-4800/2400bps leased line (V.27bis)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V29\fR
-.ad
-.RS 20n
-9600/7200/4800 leased line (V.29)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V32\fR
-.ad
-.RS 20n
-Up to 9600bps (V.32)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_V32BIS\fR
-.ad
-.RS 20n
-Up to 14400bps (V.32bis)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_MS_VFAST\fR
-.ad
-.RS 20n
-Up to 28800 V.FAST
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBem\fR\fR
-.ad
-.RS 15n
-This identifies modem error correction/detection protocols and is defined as
-follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_EM_MNP\fR
-.ad
-.RS 16n
-MNP levels 2-4
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_EM_V42\fR
-.ad
-.RS 16n
-CCITT LAPM (V.42)
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdc\fR\fR
-.ad
-.RS 15n
-This identifies modem data compression protocols and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_DC_V42BI\fR
-.ad
-.RS 18n
-CCITT compression V.42
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_DC_MNP5\fR
-.ad
-.RS 18n
-MNP compression (uses MNP 2, 3 or 4)
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBcm\fR\fR
-.ad
-.RS 15n
-This identifies modem command protocols and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_AT1\fR
-.ad
-.RS 19n
-ANSI/EIA/TIA 602 "Action" commands
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_AT2\fR
-.ad
-.RS 19n
-ANSI/EIA/TIA 602 "ACE/DCE IF Params"
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_AT3\fR
-.ad
-.RS 19n
-ANSI/EIA/TIA 602 "Ace Parameters"
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_MNP_AT\fR
-.ad
-.RS 19n
-MNP specification AT commands
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_V25BIS\fR
-.ad
-.RS 19n
-V.25bis calling commands
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_V25A\fR
-.ad
-.RS 19n
-V.25bis test procedures
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_CM_DMCL\fR
-.ad
-.RS 19n
-DMCL command mode
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBex\fR\fR
-.ad
-.RS 15n
-This identifies the modem escape mechanism and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_EX_BREAK\fR
-.ad
-.RS 18n
-BREAK support standardized
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_EX_PLUS\fR
-.ad
-.RS 18n
-+++ returns to command mode
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_EX_UD\fR
-.ad
-.RS 18n
-User defined escape character
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdy\fR\fR
-.ad
-.RS 15n
-This identifies modem standardized data encryption and is a reserved field for
-future use and must be set to \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBef\fR\fR
-.ad
-.RS 15n
-This identifies modem miscellaneous features and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_EF_CALLERID\fR
-.ad
-.RS 21n
-Caller ID is supported
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfm\fR\fR
-.ad
-.RS 15n
-This identifies fax modulation standards and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_FM_V21C2\fR
-.ad
-.RS 19n
-300bps (V.21-C2)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FM_V27TER\fR
-.ad
-.RS 19n
-4800/2400bps (V.27ter)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FM_V29\fR
-.ad
-.RS 19n
-9600/7200/4800 leased line (V.29)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FM_V17\fR
-.ad
-.RS 19n
-14.4K/12K/9600/7200bps (V.17)
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FM_V33\fR
-.ad
-.RS 19n
-4.4K/12K/9600/7200 leased line (V.33)
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfs\fR\fR
-.ad
-.RS 15n
-This identifies the fax feature selection and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_T3\fR
-.ad
-.RS 21n
-Group 2 (T.3) service class
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_T4\fR
-.ad
-.RS 21n
-Group 3 (T.4) service class
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_T6\fR
-.ad
-.RS 21n
-Group 4 (T.6) service class
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_ECM\fR
-.ad
-.RS 21n
-Error Correction Mode
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_VOICEREQ\fR
-.ad
-.RS 21n
-Voice requests allowed
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_POLLING\fR
-.ad
-.RS 21n
-Polling support
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_FTP\fR
-.ad
-.RS 21n
-File transfer support
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_FS_PASSWORD\fR
-.ad
-.RS 21n
-Password support
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtech\fR\fR
-.ad
-.RS 15n
-This identifies the \fBLAN \fRtechnology type and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_ARCNET\fR
-.ad
-.RS 28n
-Arcnet
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_ETHERNET\fR
-.ad
-.RS 28n
-Ethernet
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_TOKENRING\fR
-.ad
-.RS 28n
-Token Ring
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_LOCALTALK\fR
-.ad
-.RS 28n
-Local Talk
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_FDDI\fR
-.ad
-.RS 28n
-FDDI/CDDI
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_ATM\fR
-.ad
-.RS 28n
-ATM
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_TECH_WIRELESS\fR
-.ad
-.RS 28n
-Wireless
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBmedia\fR\fR
-.ad
-.RS 15n
-This identifies the \fBLAN \fRmedia type and is defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_INHERENT\fR
-.ad
-.RS 30n
-Generic interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_UTP\fR
-.ad
-.RS 30n
-Unshielded twisted pair
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_STP\fR
-.ad
-.RS 30n
-Shielded twisted pair
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_THIN_COAX\fR
-.ad
-.RS 30n
-Thin coax
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_THICK_COAX\fR
-.ad
-.RS 30n
-Thick coax
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_FIBER\fR
-.ad
-.RS 30n
-Fiber
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_SSR_902\fR
-.ad
-.RS 30n
-Spread spectrum radio 902-928 MHz
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_SSR_2_4\fR
-.ad
-.RS 30n
-Spread spectrum radio 2.4 GHz
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_SSR_5_4\fR
-.ad
-.RS 30n
-Spread spectrum radio 5.4 GHz
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_DIFFUSE_IR\fR
-.ad
-.RS 30n
-Diffuse infra red
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFE_LAN_MEDIA_PTP_IR\fR
-.ad
-.RS 30n
-Point to point infra red
-.RE
-
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_FUNCID\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_FUNCID.9f	2014-11-12 17:44:36.644451210 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,293 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_FUNCID 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_FUNCID \- parse Function Identification tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_FUNCID\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_funcid_t *\fR\fIcf\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcf\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_funcid_t\fR structure which contains the parsed
-\fBCISTPL_FUNCID\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Function Identification tuple, \fBCISTPL_FUNCID,\fR
-into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_FUNCID\fR tuple is used to describe information about the
-functionality provided by a \fBPC \fRCard. Information is also provided to
-enable system utilities to decide if the \fBPC \fRCard should be configured
-during system initialization. If additional function specific information is
-available, one or more function extension tuples of type \fBCISTPL_FUNCE\fR
-follow this tuple (see \fBcsx_Parse_CISTPL_FUNCE\fR(9F)).
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_funcid_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     function;     /* PC Card function code */
-uint32_t     sysinit;      /* system initialization mask */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBfunction\fR\fR
-.ad
-.RS 12n
-This is the function type for \fBCISTPL_FUNCID:\fR
-.sp
-.ne 2
-.na
-\fBTPLFUNC_MULTI\fR
-.ad
-.RS 27n
-Vendor-specific multifunction card
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_MEMORY\fR
-.ad
-.RS 27n
-Memory card
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_SERIAL\fR
-.ad
-.RS 27n
-Serial I/O port
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_PARALLEL\fR
-.ad
-.RS 27n
-Parallel printer port
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_FIXED\fR
-.ad
-.RS 27n
-Fixed disk, silicon or removable
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_VIDEO\fR
-.ad
-.RS 27n
-Video interface
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_LAN\fR
-.ad
-.RS 27n
-Local Area Network adapter
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_AIMS\fR
-.ad
-.RS 27n
-Auto Incrementing Mass Storage
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_SCSI\fR
-.ad
-.RS 27n
-SCSI bridge
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_SECURITY\fR
-.ad
-.RS 27n
-Security cards
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_VENDOR_SPECIFIC\fR
-.ad
-.RS 27n
-Vendor specific
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLFUNC_UNKNOWN\fR
-.ad
-.RS 27n
-Unknown function(s)
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBsysinit\fR\fR
-.ad
-.RS 11n
-This field is bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fBTPLINIT_POST\fR
-.ad
-.RS 16n
-POST should attempt configure
-.RE
-
-.sp
-.ne 2
-.na
-\fBTPLINIT_ROM\fR
-.ad
-.RS 16n
-Map ROM during sys init
-.RE
-
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_FUNCE\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
--- old/usr/src/man/man9f/csx_Parse_CISTPL_GEOMETRY.9f	2014-11-12 17:44:36.695963972 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,171 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_GEOMETRY 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_GEOMETRY \- parse the Geometry tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_GEOMETRY\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_geometry_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_geometry_t\fR structure which contains the parsed
-\fBCISTPL_GEOMETRY\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Geometry tuple, \fBCISTPL_GEOMETRY\fR, into a form
-usable by \fBPC\fR Card drivers.
-.sp
-.LP
-The \fBCISTPL_GEOMETRY\fR tuple indicates the geometry of a disk-like device.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_geometry_t\fR are:
-.sp
-.in +2
-.nf
-  uint32_t     spt;
-   uint32_t     tpc;
-   uint32_t     ncyl;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBspt\fR\fR
-.ad
-.RS 8n
-This field indicates the number of sectors per track.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtpc\fR\fR
-.ad
-.RS 8n
-This field indicates the number of tracks per cylinder.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBncyl\fR\fR
-.ad
-.RS 8n
-This field indicates the number of cylinders.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (\fBCIS\fR) on \fBPC\fR Card.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_JEDEC_C.9f	2014-11-12 17:44:36.746982293 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,163 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_JEDEC_C 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_JEDEC_C, csx_Parse_CISTPL_JEDEC_A \- parse JEDEC Identifier
-tuples
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_JEDEC_C\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_jedec_t *\fR\fIcj\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_Parse_CISTPL_JEDEC_A\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_jedec_t *\fR\fIcj\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcj\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_jedec_t\fR structure which contains the parsed
-\fBCISTPL_JEDEC_C\fR or \fBCISTPL_JEDEC_A\fR tuple information upon return from
-these functions, respectively.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBcsx_Parse_CISTPL_JEDEC_C()\fR and \fBcsx_Parse_CISTPL_JEDEC_A()\fR parse the
-\fBJEDEC\fR Identifier tuples, \fBCISTPL_JEDEC_C\fR and \fBCISTPL_JEDEC_A,\fR
-respectively, into a form usable by \fBPC\fR Card drivers.
-.sp
-.LP
-The \fBCISTPL_JEDEC_C\fR and \fBCISTPL_JEDEC_A\fR tuples are optional tuples
-provided for cards containing programmable devices. They describe information
-for Common Memory or Attribute Memory space, respectively.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_jedec_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t        nid;   /* # of JEDEC identifiers present */
-  jedec_ident_t   jid[CISTPL_JEDEC_MAX_IDENTIFIERS];
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBjedec_ident_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t        id;    /* manufacturer id */
-  uint32_t        info;  /* manufacturer specific info */
-.fi
-.in -2
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (\fBCIS\fR) on \fBPC\fR Card.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_Parse_CISTPL_DEVICE\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_LINKTARGET.9f	2014-11-12 17:44:36.798856613 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,162 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_LINKTARGET 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_LINKTARGET \- parse the Link Target tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_LINKTARGET\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_linktarget_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_linktarget_t\fR structure which contains the parsed
-\fBCISTPL_LINKTARGET\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Link Target tuple, \fBCISTPL_LINKTARGET,\fR into a
-form usable by \fBPC\fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_LINKTARGET\fR tuple is used to verify that tuple chains other
-than the primary chain are valid. All secondary tuple chains are required to
-contain this tuple as the first tuple of the chain.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_linktarget_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   length;
-char       tpltg_tag[CIS_MAX_TUPLE_DATA_LEN];
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBlength\fR \fR
-.ad
-.RS 14n
-This field indicates the number of bytes in \fBtpltg_tag\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtpltg_tag\fR \fR
-.ad
-.RS 14n
-This field provides the Link Target tuple information.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_LONGLINK_A.9f	2014-11-12 17:44:36.850072570 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,189 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_LONGLINK_A 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_LONGLINK_A, csx_Parse_CISTPL_LONGLINK_C \- parse the Long Link
-A and C tuples
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_LONGLINK_A\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_longlink_ac_t *\fR\fIpt\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_Parse_CISTPL_LONGLINK_C\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_longlink_ac_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_longlink_ac_t\fR structure which contains the parsed
-\fBCISTPL_LONGLINK_A\fR or \fBCISTPL_LONGLINK_C\fR tuple information upon
-return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Long Link A and C tuples, \fBCISTPL_LONGLINK_A\fR and
-\fBCISTPL_LONGLINK_A,\fR into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_LONGLINK_A\fR and \fBCISTPL_LONGLINK_C\fR tuples provide links to
-Attribute and Common Memory.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_longlink_ac_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   flags;
-uint32_t   tpll_addr;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBflags\fR \fR
-.ad
-.RS 14n
-This field indicates the type of memory:
-.sp
-.ne 2
-.na
-\fB\fBCISTPL_LONGLINK_AC_AM\fR\fR
-.ad
-.RS 25n
-long link to Attribute Memory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCISTPL_LONGLINK_AC_CM\fR\fR
-.ad
-.RS 25n
-long link to Common Memory
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtpll_addr\fR \fR
-.ad
-.RS 14n
-This field provides the offset from the beginning of the specified address
-space.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_LONGLINK_MFC.9f	2014-11-12 17:44:36.901359557 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,208 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_LONGLINK_MFC 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_LONGLINK_MFC \- parse the Multi-Function tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_LONGLINK_MFC\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_longlink_mfc_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_longlink_mfc_t\fR structure which contains the parsed
-\fBCISTPL_LONGLINK_MFC\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Multi-Function tuple, \fBCISTPL_LONGLINK_MFC,\fR into
-a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_LONGLINK_MFC\fR tuple describes the start of the
-function-specific \fBCIS \fRfor each function on a multi-function card.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_longlink_mfc_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t    nfuncs;
-uint32_t    nregs;
-uint32_t    function[CIS_MAX_FUNCTIONS].tas
-uint32_t    function[CIS_MAX_FUNCTIONS].addr
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBnfuncs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the number of functions on the \fBPC \fRcard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBnregs\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field indicates the number of configuration register sets.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfunction[CIS_MAX_FUNCTIONS].tas\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field provides the target address space for each function on the \fBPC
-\fRcard. This field can be one of:
-.sp
-.ne 2
-.na
-\fB\fBCISTPL_LONGLINK_MFC_TAS_AM\fR\fR
-.ad
-.sp .6
-.RS 4n
-CIS in attribute memory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCISTPL_LONGLINK_MFC_TAS_CM\fR\fR
-.ad
-.sp .6
-.RS 4n
-CIS in common memory
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfunction[CIS_MAX_FUNCTIONS].addr\fR \fR
-.ad
-.sp .6
-.RS 4n
-This field provides the target address offset for each function on the \fBPC
-\fRcard.
-.RE
-
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR \fR
-.ad
-.RS 28n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR \fR
-.ad
-.RS 28n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_MANFID.9f	2014-11-12 17:44:36.952612113 +0100
+++ /dev/null	2014-11-12 17:44:36.000000000 +0100
@@ -1,143 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_MANFID 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_MANFID \- parse Manufacturer Identification tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_MANFID\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_manfid_t *\fR\fIcm\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcm\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_manfid_t\fR structure which contains the parsed
-\fBCISTPL_MANFID\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Manufacturer Identification tuple,
-\fBCISTPL_MANFID,\fR into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_MANFID\fR tuple is used to describe the information about the
-manufacturer of a \fBPC \fRCard. There are two types of information, the \fBPC
-\fRCard's manufacturer and a manufacturer card number.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_manfid_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   manf;   /* PCMCIA assigned manufacturer code */
-uint32_t   card;   /* manufacturer information
-                    (part number and/or revision) */
-.fi
-.in -2
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRcard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_ORG.9f	2014-11-12 17:44:37.003936116 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,163 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_ORG 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_ORG \- parse the Data Organization tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_ORG\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_org_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_org_t\fR structure which contains the parsed
-\fBCISTPL_ORG\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Data Organization tuple, \fBCISTPL_ORG,\fR into a form
-usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_ORG\fR tuple provides a text description of the organization.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_org_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   type;
-char       desc[CIS_MAX_TUPLE_DATA_LEN];
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBtype\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field indicates type of data organization.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdesc[CIS_MAX_TUPLE_DATA_LEN]\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field provides the text description of this organization.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_SPCL.9f	2014-11-12 17:44:37.055680847 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,190 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_SPCL 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_SPCL \- parse the Special Purpose tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_SPCL\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-    \fBcistpl_spcl_t *\fR\fIcsp\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcsp\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_spcl_t\fR structure which contains the parsed
-\fBCISTPL_SPCL\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Special Purpose tuple, \fBCISTPL_SPCL,\fR into a form
-usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_SPCL\fR tuple is identified by an identification field that is
-assigned by \fBPCMCIA \fRor JEIDA. A sequence field allows a series of
-\fBCISTPL_SPCL\fR tuples to be used when the data exceeds the size that can be
-stored in a single tuple; the maximum data area of a series of
-\fBCISTPL_SPCL\fR tuples is unlimited. Another field gives the number of bytes
-in the data field in this tuple.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_date_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t    id;       /* tuple contents identification */
-uint32_t    seq;      /* data sequence number */
-uint32_t    bytes;    /* number of bytes following */
-uchar_t     data[CIS_MAX_TUPLE_DATA_LEN];
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBid\fR\fR
-.ad
-.RS 9n
-This field contains a \fBPCMCIA \fRor \fBJEIDA \fRassigned value that
-identifies this series of one or more \fBCISTPL_SPCL\fR tuples. These field
-values are assigned by contacting either \fBPCMCIA \fRor \fBJEIDA\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBseq\fR\fR
-.ad
-.RS 9n
-This field contains a data sequence number. \fBCISTPL_SPCL_SEQ_END\fR is the
-last tuple in sequence.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBbytes\fR\fR
-.ad
-.RS 9n
-This field contains the number of data bytes in the
-\fBdata[CIS_MAX_TUPLE_DATA_LEN]\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdata\fR\fR
-.ad
-.RS 9n
-The data component of this tuple.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_SWIL.9f	2014-11-12 17:44:37.106813648 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,152 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_SWIL 9F "Jan 24, 1997"
-.SH NAME
-csx_Parse_CISTPL_SWIL \- parse the Software Interleaving tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_SWIL\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_swil_t *\fR\fIpt\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIpt\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcistpl_swil_t\fR structure which contains the parsed
-\fBCISTPL_SWIL\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Software Interleaving tuple, \fBCISTPL_SWIL,\fR into a
-form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_SWIL\fR tuple provides the software interleaving of data within a
-partition on the card.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_swil_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     intrlv;
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBintrlv\fR\fR
-.ad
-.RS 10n
-This field provides the software interleaving for a partition.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_VERS_1.9f	2014-11-12 17:44:37.157326519 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,145 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_VERS_1 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_VERS_1 \- parse Level-1 Version/Product Information tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_VERS_1\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_vers_1_t *\fR\fIcv1\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcv1\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_vers_1_t\fR structure which contains the parsed
-\fBCISTPL_VERS_1\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Level-1 Version/Product Information tuple,
-\fBCISTPL_VERS_1,\fR into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_VERS_1\fR tuple is used to describe the card Level-1 version
-compliance and card manufacturer information.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_vers_1_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   major;  /* major version number */
-uint32_t   minor;  /* minor version number */
-uint32_t   ns;     /* number of information strings */
-char       pi[CISTPL_VERS_1_MAX_PROD_STRINGS]
-               [CIS_MAX_TUPLE_DATA_LEN];
-                   /* pointers to product information strings */
-.fi
-.in -2
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Parse_CISTPL_VERS_2.9f	2014-11-12 17:44:37.208438657 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,149 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PARSE_CISTPL_VERS_2 9F "Dec 20, 1996"
-.SH NAME
-csx_Parse_CISTPL_VERS_2 \- parse Level-2 Version and Information tuple
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_Parse_CISTPL_VERS_2\fR(\fBclient_handle_t\fR \fIch\fR, \fBtuple_t *\fR\fItu\fR,
-     \fBcistpl_vers_2_t *\fR\fIcv2\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fItu\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBtuple_t\fR structure (see \fBtuple\fR(9S)) returned by a call
-to \fBcsx_GetFirstTuple\fR(9F) or \fBcsx_GetNextTuple\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcv2\fR\fR
-.ad
-.RS 7n
-Pointer to a \fBcistpl_vers_2_t\fR structure which contains the parsed
-\fBCISTPL_VERS_2\fR tuple information upon return from this function.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function parses the Level-2 Version and Information tuple,
-\fBCISTPL_VERS_2,\fR into a form usable by \fBPC \fRCard drivers.
-.sp
-.LP
-The \fBCISTPL_VERS_2\fR tuple is used to describe the card Level-2 information
-which has the logical organization of the card's data.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcistpl_vers_2_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   vers;     /* version number */
-uint32_t   comply;   /* level of compliance */
-uint32_t   dindex;   /* byte address of first data byte in card */
-uint32_t   vspec8;   /* vendor specific (byte 8) */
-uint32_t   vspec9;   /* vendor specific (byte 9) */
-uint32_t   nhdr;     /* number of copies of CIS present on device */
-char       oem[CIS_MAX_TUPLE_DATA_LEN];
-                     /* Vendor of software that formatted card */
-char       info[CIS_MAX_TUPLE_DATA_LEN];
-                     /* Informational message about card */
-.fi
-.in -2
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNKNOWN_TUPLE\fR\fR
-.ad
-.RS 27n
-Parser does not know how to parse tuple.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No Card Information Structure (CIS) on \fBPC \fRCard.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ValidateCIS\fR(9F), \fBtuple\fR(9S)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_Put8.9f	2014-11-12 17:44:37.259343349 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,96 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_PUT8 9F "Jul 19, 1996"
-.SH NAME
-csx_Put8, csx_Put16, csx_Put32, csx_Put64 \- write to device register
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBvoid\fR \fBcsx_Put8\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR, \fBuint8_t\fR \fIvalue\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_Put16\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR, \fBuint16_t\fR \fIvalue\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_Put32\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR, \fBuint32_t\fR \fIvalue\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_Put64\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR, \fBuint64_t\fR \fIvalue\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 11n
-The offset in bytes from the base of the mapped resource.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIvalue\fR \fR
-.ad
-.RS 11n
-The data to be written to the device.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-These functions generate a write of various sizes to the mapped memory or
-device register.
-.sp
-.LP
-The \fBcsx_Put8()\fR, \fBcsx_Put16()\fR, \fBcsx_Put32()\fR, and
-\fBcsx_Put64()\fR functions write 8 bits, 16 bits, 32 bits, and 64 bits of
-data, respectively, to the device address represented by the handle,
-\fIhandle\fR, at an offset in bytes represented by the offset, \fIoffset\fR.
-.sp
-.LP
-Data that consists of more than one byte will automatically be translated to
-maintain a consistent view between the host and the device based on the encoded
-information in the data access handle. The translation may involve byte
-swapping if the host and the device have incompatible endian characteristics.
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user, kernel, or interrupt context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_Get8\fR(9F), \fBcsx_GetMappedAddr\fR(9F),
-\fBcsx_RepGet8\fR(9F), \fBcsx_RepPut8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RegisterClient.9f	2014-11-12 17:44:37.310164465 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,322 +0,0 @@
-'\" te
-.\"  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REGISTERCLIENT 9F "Jul 19, 1996"
-.SH NAME
-csx_RegisterClient \- register a client
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RegisterClient\fR(\fBclient_handle_t *\fR\fIch\fR, \fBclient_reg_t *\fR\fIcr\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBclient_handle_t\fR structure.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fImc\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBclient_reg_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function registers a client with Card Services and returns a unique client
-handle for the client. The client handle must be passed to
-\fBcsx_DeregisterClient\fR(9F) when the client terminates.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBclient_reg_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t                 Attributes;
-  uint32_t                 EventMask;
-  event_callback_args_t    event_callback_args;
-  uint32_t                 Version;             /* CS version to expect */
-  csfunction_t             *event_handler;
-  ddi_iblock_cookie_t      *iblk_cookie;        /* event iblk cookie */
-  ddi_idevice_cookie_t     *idev_cookie;        /* event idev cookie */
-  dev_info_t               *dip;                /* client's dip */
-  char                     driver_name[MODMAXNAMELEN];
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 23n
-This field is bit-mapped and defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBINFO_MEM_CLIENT\fR\fR
-.ad
-.sp .6
-.RS 4n
-Memory client device driver.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBINFO_MTD_CLIENT\fR\fR
-.ad
-.sp .6
-.RS 4n
-Memory Technology Driver client.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBINFO_IO_CLIENT\fR\fR
-.ad
-.sp .6
-.RS 4n
-\fBIO\fR client device driver.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBINFO_CARD_SHARE\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
-\fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBINFO_CARD_EXCL\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
-\fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
-.sp
-.ne 2
-.na
-\fB\fBINFO_MEM_CLIENT\fR\fR
-.ad
-.br
-.na
-\fB\fBINFO_MTD_CLIENT\fR\fR
-.ad
-.br
-.na
-\fB\fBINFO_IO_CLIENT\fR\fR
-.ad
-.sp .6
-.RS 4n
-These bits are mutually exclusive (that is, only one bit may be set), but one
-of the bits must be set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBINFO_CARD_SHARE\fR\fR
-.ad
-.br
-.na
-\fB\fBINFO_CARD_EXCL\fR\fR
-.ad
-.sp .6
-.RS 4n
-If either of these bits is set, the client will receive a
-\fBCS_EVENT_REGISTRATION_COMPLETE\fR event when Card Services has completed its
-internal client registration processing and after a sucessful call to
-\fBcsx_RequestSocketMask\fR(9F).
-.sp
-Also, if either of these bits is set, and if a card of the type that the client
-can control is currently inserted in the socket (and after a successful call to
-\fBcsx_RequestSocketMask\fR(9F)), the client will receive an artificial
-\fBCS_EVENT_CARD_INSERTION\fR event.
-.RE
-
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEvent\fR \fBMask\fR\fR
-.ad
-.RS 23n
-This field is bit-mapped and specifies the client's global event mask. Card
-Services performs event notification based on this field. See
-\fBcsx_event_handler\fR(9E) for valid event definitions and for additional
-information about handling events.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBevent_callback_args\fR\fR
-.ad
-.RS 23n
-The \fBevent_callback_args_t\fR structure members are:
-.sp
-.in +2
-.nf
-    void     *client_data;
-.fi
-.in -2
-
-The \fBclient_data\fR field may be used to provide data available to the event
-handler (see \fBcsx_event_handler\fR(9E)). Typically, this is the client
-driver's soft state pointer.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBVersion\fR\fR
-.ad
-.RS 23n
-This field contains the specific Card Services version number that the client
-expects to use. Typically, the client will use the \fBCS_VERSION\fR macro to
-specify to Card Services which version of Card Services the client expects.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBevent_handler\fR\fR
-.ad
-.RS 23n
-The client event callback handler entry point is passed in the
-\fBevent_handler\fR field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBiblk_cookie\fR\fR
-.ad
-.br
-.na
-\fB\fBidev_cookie\fR\fR
-.ad
-.RS 23n
-These fields must be used by the client to set up mutexes that are used in the
-client's event callback handler when handling high priority events.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdip\fR\fR
-.ad
-.RS 23n
-The client must set this field with a pointer to the client's dip.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdriver_name\fR\fR
-.ad
-.RS 23n
-The client must copy a driver-unique name into this member. This name must be
-identical across all instances of the driver.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR\fR
-.ad
-.RS 27n
-No client type or more than one client type specified.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_OUT_OF_RESOURCE\fR\fR
-.ad
-.RS 27n
-Card Services is unable to register client.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_VERSION\fR\fR
-.ad
-.RS 27n
-Card Services version is incompatible with client.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client has already registered for this socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DeregisterClient\fR(9F), \fBcsx_RequestSocketMask\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_ReleaseConfiguration.9f	2014-11-12 17:44:37.361642961 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,139 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_RELEASECONFIGURATION 9F "Jul 19, 1996"
-.SH NAME
-csx_ReleaseConfiguration \- release PC Card and socket configuration
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ReleaseConfiguration\fR(\fBclient_handle_t\fR \fIch\fR, \fBrelease_config_t *\fR\fIrc\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIrc\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBrelease_config_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function returns a \fBPC\fR Card and socket to a simple memory only
-interface and sets the card to configuration zero by writing a \fB0\fR to the
-\fBPC\fR card's \fBCOR\fR (Configuration Option Register).
-.sp
-.LP
-Card Services may remove power from the socket if no clients have indicated
-their usage of the socket by an active \fBcsx_RequestConfiguration\fR(9F) or
-\fBcsx_RequestWindow\fR(9F).
-.sp
-.LP
-Card Services is prohibited from resetting the \fBPC\fR Card and is not
-required to cycle power through zero (\fB0\fR) volts.
-.sp
-.LP
-After calling \fBcsx_ReleaseConfiguration()\fR any resources requested via the
-request functions \fBcsx_RequestIO\fR(9F), \fBcsx_RequestIRQ\fR(9F), or
-\fBcsx_RequestWindow\fR(9F) that are no longer needed should be returned to
-Card Services via the corresponding \fBcsx_ReleaseIO\fR(9F),
-\fBcsx_ReleaseIRQ\fR(9F), or \fBcsx_ReleaseWindow\fR(9F) functions.
-\fBcsx_ReleaseConfiguration()\fR must be called to release the current card and
-socket configuration before releasing any resources requested by the driver via
-the request functions named above.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBrelease_config_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;     /* socket number */
-.fi
-.in -2
-
-.sp
-.LP
-The \fBSocket\fR field is not used in Solaris, but for portability with other
-Card Services implementations, it should be set to the logical socket number.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid or \fBcsx_RequestConfiguration\fR(9F) not done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-Error getting or setting socket hardware parameters.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC\fR card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F), \fBcsx_RequestConfiguration\fR(9F),
-\fBcsx_RequestIO\fR(9F), \fBcsx_RequestIRQ\fR(9F), \fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RepGet8.9f	2014-11-12 17:44:37.412634539 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,128 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REPGET8 9F "Jul 19, 1996"
-.SH NAME
-csx_RepGet8, csx_RepGet16, csx_RepGet32, csx_RepGet64 \- read repetitively from
-the device register
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBvoid\fR \fBcsx_RepGet8\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint8_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepGet16\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint16_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepGet32\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepGet64\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint64_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 13n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhostaddr\fR \fR
-.ad
-.RS 13n
-Source host address.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 13n
-The offset in bytes from the base of the mapped resource.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIrepcount\fR \fR
-.ad
-.RS 13n
-Number of data accesses to perform.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIflags\fR \fR
-.ad
-.RS 13n
-Device address flags.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-These functions generate multiple reads of various sizes from the mapped memory
-or device register.
-.sp
-.LP
-The \fBcsx_RepGet8()\fR, \fBcsx_RepGet16()\fR, \fBcsx_RepGet32()\fR, and
-\fBcsx_RepGet64()\fR functions generate \fIrepcount\fR reads of 8 bits, 16
-bits, 32 bits, and 64 bits of data, respectively, from the device address
-represented by the handle, \fIhandle\fR, at an offset in bytes represented by
-the offset, \fIoffset\fR. The data read is stored consecutively into the buffer
-pointed to by the host address pointer, \fIhostaddr\fR.
-.sp
-.LP
-Data that consists of more than one byte will automatically be translated to
-maintain a consistent view between the host and the device based on the encoded
-information in the data access handle. The translation may involve byte
-swapping if the host and the device have incompatible endian characteristics.
-.sp
-.LP
-When the \fIflags\fR argument is set to \fBCS_DEV_AUTOINCR\fR, these functions
-increment the  device offset, \fIoffset\fR, after each datum read operation.
-However, when the \fIflags\fR argument is set to \fBCS_DEV_NO_AUTOINCR\fR, the
-same device offset will be used for every datum access. For example, this flag
-may be useful when reading from a data register.
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user, kernel, or interrupt context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_Get8\fR(9F), \fBcsx_GetMappedAddr\fR(9F),
-\fBcsx_Put8\fR(9F), \fBcsx_RepPut8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RepPut8.9f	2014-11-12 17:44:37.463628210 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,128 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REPPUT8 9F "Jul 19, 1996"
-.SH NAME
-csx_RepPut8, csx_RepPut16, csx_RepPut32, csx_RepPut64 \- write repetitively to
-the device register
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBvoid\fR \fBcsx_RepPut8\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint8_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepPut16\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint16_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepPut32\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.LP
-.nf
-\fBvoid\fR \fBcsx_RepPut64\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint64_t *\fR\fIhostaddr\fR, \fBuint32_t\fR \fIoffset\fR,
-     \fBuint32_t\fR \fIrepcount\fR, \fBuint32_t\fR \fIflags\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 13n
-The access handle returned from \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F), or \fBcsx_DupHandle\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIhostaddr\fR \fR
-.ad
-.RS 13n
-Source host address.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 13n
-The offset in bytes from the base of the mapped resource.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIrepcount\fR \fR
-.ad
-.RS 13n
-Number of data accesses to perform.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIflags\fR \fR
-.ad
-.RS 13n
-Device address flags.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-These functions generate multiple writes of various sizes to the mapped memory
-or device register.
-.sp
-.LP
-The \fBcsx_RepPut8()\fR, \fBcsx_RepPut16()\fR, \fBcsx_RepPut32()\fR, and
-\fBcsx_RepPut64()\fR functions generate \fIrepcount\fR writes of 8 bits, 16
-bits, 32 bits, and 64 bits of data, respectively, to the device address
-represented by the handle, \fIhandle\fR, at an offset in bytes represented by
-the offset, \fIoffset\fR. The data written is read consecutively from the
-buffer pointed to by the host address pointer, \fIhostaddr\fR.
-.sp
-.LP
-Data that consists of more than one byte will automatically be translated to
-maintain a consistent view between the host and the device based on the encoded
-information in the data access handle. The translation may involve byte
-swapping if the host and the device have incompatible endian characteristics.
-.sp
-.LP
-When the \fIflags\fR argument is set to \fBCS_DEV_AUTOINCR\fR, these functions
-increment the  device offset, \fIoffset\fR, after each datum write operation.
-However, when the \fIflags\fR argument is set to \fBCS_DEV_NO_AUTOINCR\fR, the
-same device offset will be used for every datum access. For example, this flag
-may be useful when writing to a data register.
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user, kernel, or interrupt context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_DupHandle\fR(9F), \fBcsx_Get8\fR(9F), \fBcsx_GetMappedAddr\fR(9F),
-\fBcsx_Put8\fR(9F), \fBcsx_RepGet8\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestWindow\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RequestConfiguration.9f	2014-11-12 17:44:37.514861897 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,450 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REQUESTCONFIGURATION 9F "Jul 19, 1996"
-.SH NAME
-csx_RequestConfiguration \- configure the PC Card and socket
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RequestConfiguration\fR(\fBclient_handle_t\fR \fIch\fR, \fBconfig_req_t *\fR\fIcr\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIcr\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBconfig_req_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function configures the \fBPC\fR Card and socket. It must be used by
-clients that require \fBI/O\fR or \fBIRQ\fR resources for their \fBPC\fR Card.
-.sp
-.LP
-\fBcsx_RequestIO\fR(9F) and \fBcsx_RequestIRQ\fR(9F) must be used before
-calling this function to specify the \fBI/O\fR and \fBIRQ\fR requirements for
-the \fBPC\fR Card and socket if necessary. \fBcsx_RequestConfiguration()\fR
-establishes the configuration in the socket adapter and \fBPC\fR Card, and it
-programs the Base and Limit registers of multi-function \fBPC\fR Cards if these
-registers exist. The values programmed into these registers depend on the
-\fBIO\fR requirements of this configuration.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBconfig_req_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t     Socket;          /* socket number */
-uint32_t     Attributes;      /* configuration attributes */
-uint32_t     Vcc;             /* Vcc value */
-uint32_t     Vpp1;            /* Vpp1 value */
-uint32_t     Vpp2;            /* Vpp2 value */
-uint32_t     IntType;         /* socket interface type - mem or IO */
-uint32_t     ConfigBase;      /* offset from start of AM space */
-uint32_t     Status;          /* value to write to STATUS register */
-uint32_t     Pin;             /* value to write to PRR */
-uint32_t     Copy;            /* value to write to COPY register */
-uint32_t     ConfigIndex;     /* value to write to COR */
-uint32_t     Present;         /* which config registers present */
-uint32_t     ExtendedStatus;  /* value to write to EXSTAT register */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.sp .6
-.RS 4n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field is bit-mapped. It indicates whether the client wishes the \fBIRQ\fR
-resources to be enabled and whether Card Services should ignore the \fBVS\fR
-bits on the socket interface. The following bits are defined:
-.sp
-.ne 2
-.na
-\fB\fBCONF_ENABLE_IRQ_STEERING\fR\fR
-.ad
-.sp .6
-.RS 4n
-Enable IRQ Steering. Set to connect the \fBPC\fR Card \fBIREQ\fR line to a
-system interrupt previously selected by a call to \fBcsx_RequestIRQ\fR(9F). If
-\fBCONF_ENABLE_IRQ_STEERING\fR is set, once \fBcsx_RequestConfiguration()\fR
-has successfully returned, the client may start receiving \fBIRQ\fR callbacks
-at the \fBIRQ\fR callback handler established in the call to
-\fBcsx_RequestIRQ\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONF_VSOVERRIDE\fR\fR
-.ad
-.sp .6
-.RS 4n
-Override VS pins. After card insertion and prior to the first successful
-\fBcsx_RequestConfiguration()\fR, the voltage levels applied to the card shall
-be those indicated by the card's physical key and/or the VS[2:1] voltage sense
-pins. For Low Voltage capable host systems (hosts which are capable of \fBVS\fR
-pin decoding), if a client desires to apply a voltage not indicated by the
-\fBVS\fR pin decoding, then \fBCONF_VSOVERRIDE\fR must be set in the
-\fBAttributes\fR field; otherwise, \fBCS_BAD_VCC\fR shall be returned.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBVcc, Vpp1, Vpp2\fR\fR
-.ad
-.sp .6
-.RS 4n
-These fields all represent voltages expressed in tenths of a volt. Values from
-zero (\fB0\fR) to \fB25.5\fR volts may be set. To be valid, the exact voltage
-must be available from the system.  \fBPC\fR Cards indicate multiple \fBVcc\fR
-voltage capability in their \fBCIS\fR via the \fBCISTPL_CFTABLE_ENTRY\fR tuple.
-After card insertion, Card Services processes the \fBCIS\fR, and when multiple
-\fBVcc\fR voltage capability is indicated, Card Services will allow the client
-to apply \fBVcc\fR voltage levels which are contrary to the \fBVS\fR pin
-decoding without requiring the client to set \fBCONF_VSOVERRIDE.\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBIntType\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field is bit-mapped. It indicates how the socket should be configured. The
-following bits are defined:
-.sp
-.ne 2
-.na
-\fB\fBSOCKET_INTERFACE_MEMORY\fR\fR
-.ad
-.sp .6
-.RS 4n
-Memory only interface.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSOCKET_INTERFACE_MEMORY_AND_IO\fR\fR
-.ad
-.sp .6
-.RS 4n
-Memory and I/O interface.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBConfigBase\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field is the offset in bytes from the beginning of attribute memory of the
-configuration registers.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPresent\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field identifies which of the configuration registers are present. If
-present, the corresponding bit is set. This field is bit-mapped as follows:
-.sp
-.ne 2
-.na
-\fB\fBCONFIG_OPTION_REG_PRESENT\fR\fR
-.ad
-.RS 30n
-Configuration Option Register (COR) present
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONFIG_STATUS_REG_PRESENT\fR\fR
-.ad
-.RS 30n
-Configuration Status Register (CCSR) present
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONFIG_PINREPL_REG_PRESENT\fR\fR
-.ad
-.RS 30n
-Pin Replacement Register (PRR) present
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONFIG_COPY_REG_PRESENT\fR\fR
-.ad
-.RS 30n
-Socket and Copy Register (SCR) present
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONFIG_ESR_REG_PRESENT\fR\fR
-.ad
-.RS 30n
-Extended Status Register (ESR) present
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBStatus, Pin, Copy, ExtendedStatus\fR\fR
-.ad
-.sp .6
-.RS 4n
-These fields represent the initial values that should be written to those
-registers if they are present, as indicated by the \fBPresent\fR field.
-.sp
-The \fBPin\fR field is also used to inform Card Services which pins in the
-\fBPC\fR Card's \fBPRR\fR (Pin Replacement Register) are valid. Only those bits
-which are set are considered valid. This affects how status is returned by the
-\fBcsx_GetStatus\fR(9F) function. If a particular signal is valid in the
-\fBPRR\fR, both the \fImask\fR (\fBSTATUS\fR) bit and the \fIchange\fR
-(\fBEVENT\fR) bit must be set in the \fBPin\fR field. The following \fBPRR\fR
-bit definitions are provided for client use:
-.sp
-.ne 2
-.na
-\fB\fBPRR_WP_STATUS\fR\fR
-.ad
-.RS 20n
-\fBWRITE PROTECT\fR mask
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_READY_STATUS\fR\fR
-.ad
-.RS 20n
-\fBREADY\fR mask
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_BVD2_STATUS\fR\fR
-.ad
-.RS 20n
-\fBBVD2\fR mask
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_BVD1_STATUS\fR\fR
-.ad
-.RS 20n
-\fBBVD1\fR mask
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_WP_EVENT\fR\fR
-.ad
-.RS 20n
-\fBWRITE PROTECT\fR changed
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_READY_EVENT\fR\fR
-.ad
-.RS 20n
-\fBREADY\fR changed
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_BVD2_EVENT\fR\fR
-.ad
-.RS 20n
-\fBBVD2\fR changed
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBPRR_BVD1_EVENT\fR\fR
-.ad
-.RS 20n
-\fBBVD1\fR changed
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBConfigIndex\fR\fR
-.ad
-.sp .6
-.RS 4n
-This field is the value written to the \fBCOR\fR (Configuration Option
-Register) for the configuration index required by the \fBPC\fR Card. Only the
-least significant six bits of the \fBConfigIndex\fR field are significant; the
-upper two (2) bits are ignored. The interrupt type in the \fBCOR\fR is always
-set to \fIlevel\fR mode by Card Services.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid or \fBcsx_RequestConfiguration()\fR not done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR\fR
-.ad
-.RS 27n
-Error in getting or setting socket hardware parameters.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_VCC\fR\fR
-.ad
-.RS 27n
-Requested \fBVcc\fR is not available on socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_VPP\fR\fR
-.ad
-.RS 27n
-Requested \fBVpp\fR is not available on socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_TYPE\fR\fR
-.ad
-.RS 27n
-\fBI/O\fR and memory interface not supported on socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_CONFIGURATION_LOCKED\fR\fR
-.ad
-.RS 27n
-\fBcsx_RequestConfiguration()\fR already done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_AccessConfigurationRegister\fR(9F), \fBcsx_GetStatus\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_ReleaseConfiguration\fR(9F),
-\fBcsx_RequestIO\fR(9F), \fBcsx_RequestIRQ\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RequestIO.9f	2014-11-12 17:44:37.566888486 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,476 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REQUESTIO 9F "Jul 19, 1996"
-.SH NAME
-csx_RequestIO, csx_ReleaseIO \- request or release I/O resources for the client
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RequestIO\fR(\fBclient_handle_t\fR \fIch\fR, \fBio_req_t *\fR\fIir\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_ReleaseIO\fR(\fBclient_handle_t\fR \fIch\fR, \fBio_req_t *\fR\fIir\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIir\fR\fR
-.ad
-.RS 6n
-Pointer to an \fBio_req_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The functions \fBcsx_RequestIO()\fR and \fBcsx_ReleaseIO()\fR request or
-release, respectively, \fBI/O\fR resources for the client.
-.sp
-.LP
-If a client requires \fBI/O\fR resources, \fBcsx_RequestIO()\fR must be called
-to request \fBI/O\fR resources from Card Services; then
-\fBcsx_RequestConfiguration\fR(9F) must be used to establish the configuration.
-\fBcsx_RequestIO()\fR can be called multiple times until a successful set of
-\fBI/O\fR resources is found. \fBcsx_RequestConfiguration\fR(9F) only uses the
-last configuration specified.
-.sp
-.LP
-\fBcsx_RequestIO()\fR fails if it has already been called without a
-corresponding \fBcsx_ReleaseIO()\fR.
-.sp
-.LP
-\fBcsx_ReleaseIO()\fR releases previously requested \fBI/O\fR resources. The
-Card Services window resource list is adjusted by this function. Depending on
-the adapter hardware, the \fBI/O\fR window might also be disabled.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBio_req_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t      Socket;            /* socket number*/
-
-uint32_t      Baseport1.base;    /* IO range base port address */
-acc_handle_t  Baseport1.handle;  /* IO range base address
-                                  /*   or port num */
-uint32_t      NumPorts1;         /* first IO range number contiguous
-                                  /*   ports */
-uint32_t      Attributes1;       /* first IO range attributes */
-
-uint32_t      Baseport2.base;    /* IO range base port address */
-acc_handle_t  Baseport2.handle;  /* IO range base address or port num */
-uint32_t      NumPorts2;         /* second IO range number contiguous
-                                  /*   ports */
-uint32_t      Attributes2;       /* second IO range attributes */
-
-uint32_t      IOAddrLines;       /* number of IO address lines decoded */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 20n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBBasePort1.base\fR\fR
-.ad
-.br
-.na
-\fB\fBBasePort1.handle\fR\fR
-.ad
-.br
-.na
-\fB\fBBasePort2.base\fR\fR
-.ad
-.br
-.na
-\fB\fBBasePort2.handle\fR\fR
-.ad
-.RS 20n
-Two \fBI/O\fR address ranges can be requested by \fBcsx_RequestIO()\fR. Each
-\fBI/O\fR address range is specified by the \fBBasePort\fR, \fBNumPorts\fR, and
-\fBAttributes\fR fields. If only a single \fBI/O\fR range is being requested,
-the \fBNumPorts2\fR field must be reset to \fB0\fR.
-.sp
-When calling \fBcsx_RequestIO()\fR, the \fBBasePort.base\fR field specifies the
-first port address requested. Upon successful return from
-\fBcsx_RequestIO()\fR, the \fBBasePort.handle\fR field contains an access
-handle, corresponding to the first byte of the allocated \fBI/O\fR window,
-which the client must use when accessing the \fBPC\fR Card's \fBI/O\fR space
-via the common access functions. A client \fImust not\fR make any assumptions
-as to the format of the returned \fBBasePort.handle\fR field value.
-.sp
-If the \fBBasePort.base\fR field is set to \fB0\fR, Card Services returns an
-\fBI/O\fR resource based on the available \fBI/O\fR resources and the number of
-contiguous ports requested. When \fBBasePort.base\fR is \fB0\fR, Card Services
-aligns the returned resource in the host system's \fBI/O\fR address space on a
-boundary that is a multiple of the number of contiguous ports requested,
-rounded up to the nearest power of two. For example, if a client requests two
-\fBI/O\fR ports, the resource returned will be a multiple of two. If a client
-requests five contiguous \fBI/O\fR ports, the resource returned will be a
-multiple of eight.
-.sp
-If multiple ranges are being requested, at least one of the \fBBasePort.base\fR
-fields must be non-zero.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBNumPorts\fR\fR
-.ad
-.RS 20n
-This field is the number of contiguous ports being requested.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 20n
-This field is bit-mapped. The following bits are defined:
-.sp
-.ne 2
-.na
-\fB\fBIO_DATA_WIDTH_8\fR\fR
-.ad
-.RS 27n
-\fBI/O\fR resource uses 8-bit data path.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBIO_DATA_WIDTH_16\fR\fR
-.ad
-.RS 27n
-\fBI/O\fR resource uses 16-bit data path.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_NEVER_SWAP\fR\fR
-.ad
-.RS 27n
-Host endian byte ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_BIG_ENDIAN\fR\fR
-.ad
-.RS 27n
-Big endian byte ordering
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LITTLE_ENDIAN\fR\fR
-.ad
-.RS 27n
-Little endian byte ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STRICT_ORDER\fR\fR
-.ad
-.RS 27n
-Program ordering references.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_UNORDERED_OK\fR\fR
-.ad
-.RS 27n
-May re-order references.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_MERGING_OK\fR\fR
-.ad
-.RS 27n
-Merge stores to consecutive locations.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LOADCACHING_OK\fR\fR
-.ad
-.RS 27n
-May cache load operations.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STORECACHING_OK\fR\fR
-.ad
-.RS 27n
-May cache store operations.
-.RE
-
-For some combinations of host system busses and adapter hardware, the width of
-an \fBI/O\fR resource can not be set via \fBRequestIO()\fR; on those systems,
-the host bus cycle access type determines the \fBI/O\fR resource data path
-width on a per-cycle basis.
-.sp
-\fBWIN_ACC_BIG_ENDIAN\fR and \fBWIN_ACC_LITTLE\fR \fBENDIAN\fR describe the
-endian characteristics of the device as big endian or little endian,
-respectively. Even though most of the devices will have the same endian
-characteristics as their busses, there are examples of devices with an
-\fBI/O\fR processor that has opposite endian characteristics of the busses.
-When \fBWIN_ACC_BIG_ENDIAN\fR or \fBWIN_ACC_LITTLE\fR \fBENDIAN\fR is set, byte
-swapping will automatically be performed by the system if the host machine and
-the device data formats have opposite endian characteristics. The
-implementation may take advantage of hardware platform byte swapping
-capabilities.
-.sp
-When \fBWIN_ACC_NEVER_SWAP\fR is specified, byte swapping will not be invoked
-in the data access functions. The ability to specify the order in which the
-\fBCPU\fR will reference data is provided by the following \fBAttributes\fR
-bits. Only one of the following bits may be specified:
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STRICT_ORDER\fR\fR
-.ad
-.sp .6
-.RS 4n
-The data references must be issued by a \fBCPU\fR in program order. Strict
-ordering is the default behavior.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_UNORDERED_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU\fR may re-order the data references. This includes all kinds of
-re-ordering (that is, a load followed by a store may be replaced by a store
-followed by a load).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_MERGING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU\fR may merge individual stores to consecutive locations. For
-example, the \fBCPU\fR may turn two consecutive byte stores into one halfword
-store. It may also batch individual loads. For example, the \fBCPU\fR may turn
-two consecutive byte loads into one halfword load. \fBIO_MERGING_OK_ACC\fR also
-implies re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LOADCACHING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU\fR may cache the data it fetches and reuse it until another store
-occurs. The default behavior is to fetch new data on every load.
-\fBWIN_ACC_LOADCACHING_OK\fR also implies merging and re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STORECACHING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU\fR may keep the data in the cache and push it to the device (perhaps
-with other data) at a later time. The default behavior is to push the data
-right away. \fBWIN_ACC_STORECACHING_OK\fR also implies load caching, merging,
-and re-ordering.
-.RE
-
-These values are advisory, not mandatory. For example, data can be ordered
-without being merged or cached, even though a driver requests unordered, merged
-and cached together. All other bits in the \fBAttributes\fR field must be set
-to \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBIOAddrLines\fR\fR
-.ad
-.RS 20n
-This field is the number of \fBI/O\fR address lines decoded by the \fBPC\fR
-Card in the specified socket.
-.RE
-
-.sp
-.LP
-On some systems, multiple calls to \fBcsx_RequestIO()\fR with different
-\fBBasePort\fR, \fBNumPorts\fR, and/or \fBIOAddrLines\fR values will have to be
-made to find an acceptable combination of parameters that can be used by Card
-Services to allocate \fBI/O\fR resources for the client. (See \fBNOTES\fR).
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR\fR
-.ad
-.RS 27n
-Invalid \fBAttributes\fR specified.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_BASE\fR\fR
-.ad
-.RS 27n
-\fBBasePort\fR value is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_CONFIGURATION_LOCKED\fR\fR
-.ad
-.RS 27n
-\fBcsx_RequestConfiguration\fR(9F) has already been done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_IN_USE\fR\fR
-.ad
-.RS 27n
-\fBcsx_RequestIO()\fR has already been done without a corresponding
-\fBcsx_ReleaseIO()\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_WINDOW\fR\fR
-.ad
-.RS 27n
-Unable to allocate \fBI/O\fR resources.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_OUT_OF_RESOURCE\fR\fR
-.ad
-.RS 27n
-Unable to allocate \fBI/O\fR resources.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_RegisterClient\fR(9F), \fBcsx_RequestConfiguration\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
-.SH NOTES
-.sp
-.LP
-It is important for clients to try to use the minimum amount of \fBI/O\fR
-resources necessary. One way to do this is for the client to parse the
-\fBCIS\fR of the \fBPC\fR Card and call \fBcsx_RequestIO()\fR first with any
-\fBIOAddrLines\fR values that are \fB0\fR or that specify a minimum number of
-address lines necessary to decode the \fBI/O\fR space on the \fBPC\fR Card.
-Also, if no convenient minimum number of address lines can be used to decode
-the \fBI/O\fR space on the \fBPC\fR Card, it is important to try to avoid
-system conflicts with well-known architectural hardware features.
--- old/usr/src/man/man9f/csx_RequestIRQ.9f	2014-11-12 17:44:37.618834174 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,261 +0,0 @@
-'\" te
-.\"  Copyright (c) 2000, Sun Microsystems, Inc.
-.\"  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REQUESTIRQ 9F "Jul 19, 1996"
-.SH NAME
-csx_RequestIRQ, csx_ReleaseIRQ \- request or release IRQ resource
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RequestIRQ\fR(\fBclient_handle_t\fR \fIch\fR, \fBirq_req_t *\fR\fIir\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_ReleaseIRQ\fR(\fBclient_handle_t\fR \fIch\fR, \fBirq_req_t *\fR\fIir\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIir\fR \fR
-.ad
-.RS 7n
-Pointer to an \fBirq_req_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The function \fBcsx_RequestIRQ()\fR requests an \fBIRQ\fR resource and
-registers the client's \fBIRQ\fR handler with Card Services.
-.sp
-.LP
-If a client requires an \fBIRQ\fR,\fBcsx_RequestIRQ()\fR must be called to
-request an \fBIRQ\fR resource as well as to register the client's \fBIRQ\fR
-handler with Card Services. The client will not receive callbacks at the
-\fBIRQ\fR callback handler until \fBcsx_RequestConfiguration\fR(9F) or
-\fBcsx_ModifyConfiguration\fR(9F) has successfully returned when either of
-these functions are called with the \fBCONF_ENABLE_IRQ_STEERING\fR bit set.
-.sp
-.LP
-The function \fBcsx_ReleaseIRQ()\fR releases a previously requested \fBIRQ\fR
-resource.
-.sp
-.LP
-The Card Services \fBIRQ\fR resource list is adjusted by
-\fBcsx_ReleaseIRQ()\fR. Depending on the adapter hardware, the host bus
-\fBIRQ\fR connection might also be disabled. Client \fBIRQ\fR handlers always
-run above lock level and so should take care to perform only Solaris operations
-that are appropriate for an above-lock-level \fBIRQ\fR handler.
-.sp
-.LP
-\fBcsx_RequestIRQ()\fR fails if it has already been called without a
-corresponding \fBcsx_ReleaseIRQ()\fR.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBirq_req_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t                Socket;          /* socket number */
-uint32_t                Attributes;      /* IRQ attribute flags */
-csfunction_t            *irq_handler;    /* IRQ handler */
-void                    *irq_handler_arg; /* IRQ handler argument */
-ddi_iblock_cookie_t     *iblk_cookie;    /* IRQ interrupt
-                                         /*   block cookie */
-ddi_idevice_cookie_t    *idev_cookie;    /* IRQ interrupt device
-                                         /*   cookie */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 20n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR \fR
-.ad
-.RS 20n
-This field is bit-mapped. It specifies details about the type of \fBIRQ\fR
-desired by the client. The following bits are defined:
-.sp
-.ne 2
-.na
-\fB\fBIRQ_TYPE_EXCLUSIVE\fR\fR
-.ad
-.RS 22n
-\fBIRQ\fR is exclusive to this socket. This bit must be set. It indicates that
-the system IRQ is dedicated to this PC Card.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBirq_handler\fR \fR
-.ad
-.RS 20n
-The client \fBIRQ\fR callback handler entry point is passed in the
-\fBirq_handler\fR field.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBirq_handler_arg\fR \fR
-.ad
-.RS 20n
-The client can use the \fBirq_handler_arg\fR field to pass client-specific data
-to the client \fBIRQ\fR callback handler.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBiblk_cookie\fR \fR
-.ad
-.br
-.na
-\fB\fBidev_cookie\fR \fR
-.ad
-.RS 20n
-These fields must be used by the client to set up mutexes that are used in the
-client's \fBIRQ\fR callback handler.
-.RE
-
-.sp
-.LP
-For a specific \fBcsx_ReleaseIRQ()\fR call, the values in the \fBirq_req_t\fR
-structure must be the same as those returned from the previous
-\fBcsx_RequestIRQ()\fR call; otherwise, \fBCS_BAD_ARGS\fR is returned and no
-changes are made to Card Services resources or the socket and adapter hardware.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ARGS\fR \fR
-.ad
-.RS 28n
-\fBIRQ\fR description does not match allocation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR \fR
-.ad
-.RS 28n
-\fBIRQ_TYPE_EXCLUSIVE\fR not set, or an unsupported or reserved bit is set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid or \fBcsx_RequestConfiguration\fR(9F) not done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_IRQ\fR \fR
-.ad
-.RS 28n
-Unable to allocate \fBIRQ\fR resources.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_IN_USE\fR \fR
-.ad
-.RS 28n
-\fBcsx_RequestIRQ()\fR already done or a previous \fBcsx_RequestIRQ()\fR has
-not been done for a corresponding \fBcsx_ReleaseIRQ()\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_CONFIGURATION_LOCKED\fR \fR
-.ad
-.RS 28n
-\fBcsx_RequestConfiguration\fR(9F) already done or
-\fBcsx_ReleaseConfiguration\fR(9F) has not been done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR \fR
-.ad
-.RS 28n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ReleaseConfiguration\fR(9F), \fBcsx_RequestConfiguration\fR(9F)
-.sp
-.LP
-\fIPC Card Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RequestSocketMask.9f	2014-11-12 17:44:37.669954603 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,181 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REQUESTSOCKETMASK 9F "Jul 19, 1996"
-.SH NAME
-csx_RequestSocketMask, csx_ReleaseSocketMask \- set or clear the client's
-client event mask
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RequestSocketMask\fR(\fBclient_handle_t\fR \fIch\fR,
-     \fBrequest_socket_mask_t *\fR\fIsm\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_ReleaseSocketMask\fR(\fBclient_handle_t\fR \fIch\fR,
-     \fBrelease_socket_mask_t *\fR\fIrm\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIsm\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBrequest_socket_mask_t\fR structure.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIrm\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBrelease_socket_mask_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The function \fBcsx_RequestSocketMask()\fR sets the client's client event mask
-and enables the client to start receiving events at its event callback handler.
-Once this function returns successfully, the client can start receiving events
-at its event callback handler. Any pending events generated from the call to
-\fBcsx_RegisterClient\fR(9F) will be delivered to the client after this call as
-well. This allows the client to set up the event handler mutexes before the
-event handler gets called.
-.sp
-.LP
-\fBcsx_RequestSocketMask()\fR must be used before calling
-\fBcsx_GetEventMask\fR(9F) or \fBcsx_SetEventMask\fR(9F) for the client event
-mask for this socket.
-.sp
-.LP
-The function \fBcsx_ReleaseSocketMask()\fR clears the client's client event
-mask.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBrequest_socket_mask_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t    Socket;       /* socket number */
-  uint32_t    EventMask;    /* event mask to set or return */
-.fi
-.in -2
-
-.sp
-.LP
-The structure members of \fBrelease_socket_mask_t\fR are:
-.sp
-.in +2
-.nf
-  uint32_t    Socket;       /* socket number */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 13n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEventMask\fR\fR
-.ad
-.RS 13n
-This field is bit-mapped. Card Services performs event notification based on
-this field. See \fBcsx_event_handler\fR(9E) for valid event definitions and for
-additional information about handling events.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_IN_USE\fR\fR
-.ad
-.RS 27n
-\fBcsx_ReleaseSocketMask()\fR has not been done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR\fR
-.ad
-.RS 27n
-\fBcsx_RequestSocketMask()\fR has not been done.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_event_handler\fR(9E), \fBcsx_GetEventMask\fR(9F),
-\fBcsx_RegisterClient\fR(9F), \fBcsx_SetEventMask\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_RequestWindow.9f	2014-11-12 17:44:37.721064320 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,460 +0,0 @@
-'\" te
-.\"  Copyright (c) 1999, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_REQUESTWINDOW 9F "Jul 19, 1996"
-.SH NAME
-csx_RequestWindow, csx_ReleaseWindow \- request or release window resources
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_RequestWindow\fR(\fBclient_handle_t\fR \fIch\fR, \fBwindow_handle_t *\fR\fIwh\fR,
-     \fBwin_req_t *\fR\fIwr\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_ReleaseWindow\fR(\fBwindow_handle_t\fR \fIwh\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIwh\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBwindow_handle_t\fR structure.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIwr\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBwin_req_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The function \fBcsx_RequestWindow()\fR requests a block of system address space
-be assigned to a \fBPC \fRCard in a socket.
-.sp
-.LP
-The function \fBcsx_ReleaseWindow()\fR releases window resources which were
-obtained by a call to \fBcsx_RequestWindow()\fR. No adapter or socket hardware
-is modified by this function.
-.sp
-.LP
-The \fBcsx_MapMemPage\fR(9F) and \fBcsx_ModifyWindow\fR(9F) functions use the
-window handle returned by \fBcsx_RequestWindow()\fR. This window handle must be
-freed by calling \fBcsx_ReleaseWindow()\fR when the client is done using this
-window.
-.sp
-.LP
-The \fBPC\fR Card Attribute or Common Memory offset for this window is set by
-\fBcsx_MapMemPage\fR(9F).
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBwin_req_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t      Socket;                  /* socket number */
-uint32_t      Attributes;              /* window flags */
-uint32_t      Base.base;               /* requested window */
-                                        /*   base address */
-acc_handle_t  Base.handle;             /* returned handle for
-                                        /*   base of window */
-uint32_t      Size;                    /* window size requested */
-                                        /*   or granted */
-uint32_t      win_params.AccessSpeed;  /* window access speed */
-uint32_t      win_params.IOAddrLines;  /* IO address lines decoded */
-uint32_t      ReqOffset;               /* required window offest */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 26n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 26n
-This field is bit-mapped and is defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBWIN_MEMORY_TYPE_IO\fR\fR
-.ad
-.sp .6
-.RS 4n
-Points to I/O space.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_MEMORY_TYPE_CM\fR\fR
-.ad
-.sp .6
-.RS 4n
-Points to common memory space.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_MEMORY_TYPE_AM\fR\fR
-.ad
-.sp .6
-.RS 4n
-These bits select which type of window is being requested. One of these bits
-must be set.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ENABLE\fR\fR
-.ad
-.sp .6
-.RS 4n
-The client must set this bit to enable the window.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_BIG_ENDIAN\fR\fR
-.ad
-.sp .6
-.RS 4n
-Describes device as big-endian.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LITTLE_ENDIAN\fR\fR
-.ad
-.sp .6
-.RS 4n
-These bits describe the endian characteristics of the device as big endian or
-little endian, respectively. Even though most of the devices will have the same
-endian characteristics as their busses, there are examples of devices with an
-\fBI/O \fRprocessor that has opposite endian characteristics of the busses.
-When either of these bits are set, byte swapping will automatically be
-performed by the system if the host machine and the device data formats have
-opposite endian characteristics. The implementation may take advantage of
-hardware platform byte swapping capabilities.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_NEVER_SWAP\fR\fR
-.ad
-.sp .6
-.RS 4n
-When this is specified, byte swapping will not be invoked in the data access
-functions.
-.RE
-
-The ability to specify the order in which the \fBCPU\fR will reference data is
-provided by the following \fBAttributes\fR bits, only one of which may be
-specified:
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STRICT_ORDER\fR\fR
-.ad
-.sp .6
-.RS 4n
-The data references must be issued by a \fBCPU \fR in program order. Strict
-ordering is the default behavior.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_UNORDERED_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU\fR may re-order the data references. This includes all kinds of
-re-ordering (that is, a load followed by a store may be replaced by a store
-followed by a load).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_MERGING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU \fRmay merge individual stores to consecutive locations. For
-example, the \fBCPU \fRmay turn two consecutive byte stores into one halfword
-store. It may also batch individual loads. For example, the \fBCPU \fRmay turn
-two consecutive byte loads into one halfword load. This bit also implies
-re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_LOADCACHING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU \fRmay cache the data it fetches and reuse it until another store
-occurs. The default behavior is to fetch new data on every load. This bit also
-implies merging and re-ordering.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBWIN_ACC_STORECACHING_OK\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBCPU \fRmay keep the data in the cache and push it to the device (perhaps
-with other data) at a later time. The default behavior is to push the data
-right away. This bit also implies load caching, merging, and re-ordering.
-.RE
-
-These values are advisory, not mandatory. For example, data can be ordered
-without being merged or cached, even though a driver requests unordered, merged
-and cached together.
-.sp
-All other bits in the \fBAttributes\fR field must be set to \fB0\fR.
-.sp
-On successful return from \fBcsx_RequestWindow()\fR, \fBWIN_OFFSET_SIZE\fR is
-set in the \fBAttributes\fR field when the client must specify card offsets to
-\fBcsx_MapMemPage\fR(9F) that are a multiple of the window size.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBBase.base\fR\fR
-.ad
-.RS 26n
-This field must be set to \fB0\fR on calling \fBcsx_RequestWindow()\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBBase.handle\fR\fR
-.ad
-.RS 26n
-On successful return from \fBcsx_RequestWindow()\fR, the \fBBase.handle\fR
-field contains an access handle corresponding to the first byte of the
-allocated memory window which the client must use when accessing the \fBPC
-\fRCard's memory space via the common access functions. A client must \fBnot\fR
-make any assumptions as to the format of the returned \fBBase.handle\fR field
-value.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSize\fR\fR
-.ad
-.RS 26n
-On calling \fBcsx_RequestWindow()\fR, the \fBSize\fR field is the size in bytes
-of the memory window requested. \fBSize\fR may be zero to indicate that Card
-Services should provide the smallest sized window available. On successful
-return from \fBcsx_RequestWindow()\fR, the \fBSize\fR field contains the actual
-size of the window allocated.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBwin_params.AccessSpeed\fR\fR
-.ad
-.RS 26n
-This field specifies the access speed of the window if the client is requesting
-a memory window. The \fBAccessSpeed\fR field bit definitions use the format of
-the extended speed byte of the Device \fBID \fRtuple. If the mantissa is
-\fB0\fR (noted as reserved in the \fBPC Card 95 Standard\fR), the lower bits
-are a binary code representing a speed from the following table:
-.RE
-
-.sp
-
-.sp
-.TS
-box;
-l | l
-l | l .
-\fBCode\fR	\fBSpeed\fR
-_
-0	(Reserved - do not use).
-_
-1	250 nsec
-_
-2	200 nsec
-_
-3	150 nsec
-_
-4	100 nse
-_
-5-7	(Reserved\(emdo not use.)
-.TE
-
-.sp
-.LP
-To request a window that supports the \fBWAIT\fR signal, \fBOR-in\fR the
-\fBWIN_USE_WAIT\fR bit to the \fBAccessSpeed\fR value before calling this
-function.
-.sp
-.LP
-It is recommended that clients use the \fBcsx_ConvertSpeed\fR(9F) function to
-generate the appropriate \fBAccessSpeed\fR values rather than manually
-perturbing the \fBAccessSpeed\fR field.
-.sp
-.ne 2
-.na
-\fB\fBwin_params.IOAddrLines\fR\fR
-.ad
-.RS 26n
-If the client is requesting an \fBI/O \fRwindow, the \fBIOAddrLines\fR field is
-the number of \fBI/O \fRaddress lines decoded by the \fBPC \fRCard in the
-specified socket. Access to the \fBI/O \fRwindow is not enabled until
-\fBcsx_RequestConfiguration\fR(9F) has been invoked successfully.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBReqOffset\fR\fR
-.ad
-.RS 26n
-This field is a Solaris-specific extension that can be used by clients to
-generate optimum window offsets passed to \fBcsx_MapMemPage\fR(9F).
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_ATTRIBUTE\fR\fR
-.ad
-.RS 27n
-\fBAttributes\fR are invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SPEED\fR\fR
-.ad
-.RS 27n
-Speed is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SIZE\fR\fR
-.ad
-.RS 27n
-Window size is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC \fRCard in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_OUT_OF_RESOURCE\fR\fR
-.ad
-.RS 27n
-Unable to allocate window.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_ConvertSpeed\fR(9F), \fBcsx_MapMemPage\fR(9F),
-\fBcsx_ModifyWindow\fR(9F), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_RequestConfiguration\fR(9F)
-.sp
-.LP
-\fIPC\fR \fICard\fR \fI95\fR \fIStandard,\fR PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_ResetFunction.9f	2014-11-12 17:44:37.773423675 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,151 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_RESETFUNCTION 9F "Jul 19, 1996"
-.SH NAME
-csx_ResetFunction \- reset a function on a PC card
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ResetFunction\fR(\fBclient_handle_t\fR \fIch\fR, \fBreset_function_t *\fR\fIrf\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIrf\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBreset_function_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-\fBcsx_ResetFunction()\fR requests that the specified function on the \fBPC\fR
-card initiate a reset operation.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBreset_function_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t     Socket;        /* socket number */
-  uint32_t     Attributes;    /* reset attributes  */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 14n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 14n
-Must be \fB0\fR.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Card Services has noted the reset request.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_IN_USE\fR\fR
-.ad
-.RS 27n
-This Card Services implementation does not permit configured cards to be reset.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR\fR
-.ad
-.RS 27n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR\fR
-.ad
-.RS 27n
-Specified socket or function number is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_event_handler\fR(9E), \fBcsx_RegisterClient\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
-.SH NOTES
-.sp
-.LP
-\fBcsx_ResetFunction()\fR has not been implemented in this release and always
-returns \fBCS_IN_USE\fR.
--- old/usr/src/man/man9f/csx_SetEventMask.9f	2014-11-12 17:44:37.824643940 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,174 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_SETEVENTMASK 9F "Jul 19, 1996"
-.SH NAME
-csx_SetEventMask, csx_GetEventMask \- set or return the client event mask for
-the client
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_SetEventMask\fR(\fBclient_handle_t\fR \fIch\fR, \fBsockevent_t *\fR\fIse\fR);
-.fi
-
-.LP
-.nf
-\fBint32_t\fR \fBcsx_GetEventMask\fR(\fBclient_handle_t\fR \fIch\fR, \fBsockevent_t *\fR\fIse\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR \fR
-.ad
-.RS 7n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIse\fR \fR
-.ad
-.RS 7n
-Pointer to a \fBsockevent_t\fR structure
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-The function \fBcsx_SetEventMask()\fR sets the client or global event mask for
-the client.
-.sp
-.LP
-The function \fBcsx_GetEventMask()\fR returns the client or global event mask
-for the client.
-.sp
-.LP
-\fBcsx_RequestSocketMask\fR(9F) must be called before calling
-\fBcsx_SetEventMask()\fR for the client event mask for this socket.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBsockevent_t\fR are:
-.sp
-.in +2
-.nf
-uint32_t   uint32_t     /* attribute flags for call */
-uint32_t   EventMask;   /* event mask to set or return */
-uint32_t   Socket;      /* socket number if necessary */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBAttributes\fR\fR
-.ad
-.RS 14n
-This is a bit-mapped field that identifies the type of event mask to be
-returned. The field is defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBCONF_EVENT_MASK_GLOBAL\fR \fR
-.ad
-.RS 27n
-Client's global event mask. If set, the client's global event mask is returned.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCONF_EVENT_MASK_CLIENT\fR \fR
-.ad
-.RS 27n
-Client's local event mask. If set, the client's local event mask is returned.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBEventMask\fR \fR
-.ad
-.RS 14n
-This field is bit-mapped. Card Services performs event notification based on
-this field. See \fBcsx_event_handler\fR(9E) for valid event definitions and for
-additional information about handling events.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR \fR
-.ad
-.RS 14n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 28n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_HANDLE\fR \fR
-.ad
-.RS 28n
-Client handle is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_BAD_SOCKET\fR \fR
-.ad
-.RS 28n
-\fBcsx_RequestSocketMask\fR(9F) not called for \fBCONF_EVENT_MASK_CLIENT.\fR
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
-.ad
-.RS 28n
-No \fBPCMCIA \fRhardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-These functions may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_event_handler\fR(9E), \fBcsx_RegisterClient\fR(9F),
-\fBcsx_ReleaseSocketMask\fR(9F), \fBcsx_RequestSocketMask\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard,\fR  PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_SetHandleOffset.9f	2014-11-12 17:44:37.875942722 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,68 +0,0 @@
-'\" te
-.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_SETHANDLEOFFSET 9F "May 16, 1997"
-.SH NAME
-csx_SetHandleOffset \- set current access handle offset
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_SetHandleOffset\fR(\fBacc_handle_t\fR \fIhandle\fR, \fBuint32_t\fR \fIoffset\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIhandle\fR \fR
-.ad
-.RS 11n
-Access handle returned by \fBcsx_RequestIRQ\fR(9F) or \fBcsx_RequestIO\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIoffset\fR \fR
-.ad
-.RS 11n
-New access handle offset.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function sets the current offset for the access handle, \fIhandle\fR, to
-\fIoffset\fR.
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR \fR
-.ad
-.RS 15n
-Successful operation.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetHandleOffset\fR(9F), \fBcsx_RequestIO\fR(9F),
-\fBcsx_RequestIRQ\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/man/man9f/csx_ValidateCIS.9f	2014-11-12 17:44:37.926654685 +0100
+++ /dev/null	2014-11-12 17:44:37.000000000 +0100
@@ -1,141 +0,0 @@
-'\" te
-.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
-.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH CSX_VALIDATECIS 9F "Jul 19, 1996"
-.SH NAME
-csx_ValidateCIS \- validate the Card Information Structure (CIS)
-.SH SYNOPSIS
-.LP
-.nf
-#include <sys/pccard.h>
-
-
-
-\fBint32_t\fR \fBcsx_ValidateCIS\fR(\fBclient_handle_t\fR \fIch\fR, \fBcisinfo_t *\fR\fIci\fR);
-.fi
-
-.SH INTERFACE LEVEL
-.sp
-.LP
-Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
-.SH PARAMETERS
-.sp
-.ne 2
-.na
-\fB\fIch\fR\fR
-.ad
-.RS 6n
-Client handle returned from \fBcsx_RegisterClient\fR(9F).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIci\fR\fR
-.ad
-.RS 6n
-Pointer to a \fBcisinfo_t\fR structure.
-.RE
-
-.SH DESCRIPTION
-.sp
-.LP
-This function validates the Card Information Structure (CIS) on the \fBPC\fR
-Card in the specified socket.
-.SH STRUCTURE MEMBERS
-.sp
-.LP
-The structure members of \fBcisinfo_t\fR are:
-.sp
-.in +2
-.nf
- uint32_t     Socket;    /* socket number to validate CIS on */
-  uint32_t     Chains;    /* number of tuple chains in CIS */
-  uint32_t     Tuples;    /* total number of tuples in CIS */
-.fi
-.in -2
-
-.sp
-.LP
-The fields are defined as follows:
-.sp
-.ne 2
-.na
-\fB\fBSocket\fR\fR
-.ad
-.RS 10n
-Not used in Solaris, but for portability with other Card Services
-implementations, it should be set to the logical socket number.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBChains\fR\fR
-.ad
-.RS 10n
-This field returns the number of valid tuple chains located in the \fBCIS\fR.
-If \fB0\fR is returned, the \fBCIS\fR is not valid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBTuples\fR\fR
-.ad
-.RS 10n
-This field is a Solaris-specific extension and it returns the total number of
-tuples on all the chains in the \fBPC\fR Card's \fBCIS\fR.
-.RE
-
-.SH RETURN VALUES
-.sp
-.ne 2
-.na
-\fB\fBCS_SUCCESS\fR\fR
-.ad
-.RS 27n
-Successful operation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CIS\fR\fR
-.ad
-.RS 27n
-No \fBCIS\fR on \fBPC\fR Card or \fBCIS\fR is invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_NO_CARD\fR\fR
-.ad
-.RS 27n
-No \fBPC\fR Card in socket.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
-.ad
-.RS 27n
-No \fBPCMCIA\fR hardware installed.
-.RE
-
-.SH CONTEXT
-.sp
-.LP
-This function may be called from user or kernel context.
-.SH SEE ALSO
-.sp
-.LP
-\fBcsx_GetFirstTuple\fR(9F), \fBcsx_GetTupleData\fR(9F),
-\fBcsx_ParseTuple\fR(9F), \fBcsx_RegisterClient\fR(9F)
-.sp
-.LP
-\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
--- old/usr/src/pkg/manifests/SUNWcs.man1m.inc	2014-11-12 17:44:37.978170892 +0100
+++ new/usr/src/pkg/manifests/SUNWcs.man1m.inc	2014-11-12 17:44:37.983215943 +0100
@@ -12,6 +12,7 @@
 #
 # Copyright 2011, Richard Lowe
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 file path=usr/share/man/man1m/6to4relay.1m
@@ -38,7 +39,6 @@
 file path=usr/share/man/man1m/captoinfo.1m
 file path=usr/share/man/man1m/cfgadm.1m
 file path=usr/share/man/man1m/cfgadm_ac.1m
-file path=usr/share/man/man1m/cfgadm_cardbus.1m
 file path=usr/share/man/man1m/cfgadm_fp.1m
 file path=usr/share/man/man1m/cfgadm_ib.1m
 file path=usr/share/man/man1m/cfgadm_pci.1m
--- old/usr/src/pkg/manifests/SUNWpcmci.mf	2014-11-12 17:44:38.127877067 +0100
+++ new/usr/src/pkg/manifests/SUNWpcmci.mf	2014-11-12 17:44:38.132927075 +0100
@@ -21,9 +21,9 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@daomre.org>
 #
 
 set name=pkg.fmri value=pkg:/SUNWpcmci@0.5.11,5.11-0.133
-set name=pkg.renamed value=true
+set name=pkg.obsolete value=true
 set name=variant.arch value=$(ARCH)
-depend fmri=pkg:/driver/pcmcia@0.5.11,5.11-0.133 type=require
--- old/usr/src/pkg/manifests/driver-pcmcia.mf	2014-11-12 17:44:38.268183829 +0100
+++ new/usr/src/pkg/manifests/driver-pcmcia.mf	2014-11-12 17:44:38.273184316 +0100
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 #
@@ -30,30 +31,6 @@
 #
 <include global_zone_only_component>
 set name=pkg.fmri value=pkg:/driver/pcmcia@$(PKGVERS)
-set name=pkg.description \
-    value="kernel modules and start-up files for PCMCIA card services"
-set name=pkg.summary value="PCMCIA Card Services"
-set name=info.classification \
-    value=org.opensolaris.category.2008:System/Hardware
+set name=pkg.obsolete value=true
 set name=variant.arch value=$(ARCH)
-dir path=kernel group=sys
-dir path=kernel/drv group=sys
-dir path=kernel/drv/$(ARCH64) group=sys
-dir path=usr/share/man
-dir path=usr/share/man/man7d
-driver name=pcic class=pcmcia \
-    alias=pciclass,060500 \
-    alias=pciclass,060700
-driver name=pcs
-file path=kernel/drv/$(ARCH64)/pcic group=sys
-file path=kernel/drv/$(ARCH64)/pcs group=sys
-$(i386_ONLY)file path=kernel/drv/pcic group=sys
-file path=kernel/drv/pcic.conf group=sys
-$(i386_ONLY)file path=kernel/drv/pcs group=sys
-file path=usr/share/man/man7d/pcic.7d
-file path=usr/share/man/man7d/pcmcia.7d
-legacy pkg=SUNWpcmci \
-    desc="kernel modules and start-up files for PCMCIA card services" \
-    name="PCMCIA Card Services, (Root)"
-license cr_Sun license=cr_Sun
-license lic_CDDL license=lic_CDDL
+
--- old/usr/src/pkg/manifests/system-header.mf	2014-11-12 17:44:38.410412385 +0100
+++ new/usr/src/pkg/manifests/system-header.mf	2014-11-12 17:44:38.415604788 +0100
@@ -828,9 +828,6 @@
 file path=usr/include/sys/cap_util.h
 file path=usr/include/sys/ccompile.h
 file path=usr/include/sys/cdio.h
-file path=usr/include/sys/cis.h
-file path=usr/include/sys/cis_handlers.h
-file path=usr/include/sys/cis_protos.h
 file path=usr/include/sys/cladm.h
 file path=usr/include/sys/class.h
 file path=usr/include/sys/clconf.h
@@ -871,11 +868,6 @@
 file path=usr/include/sys/crypto/ioctl.h
 file path=usr/include/sys/crypto/ioctladmin.h
 file path=usr/include/sys/crypto/spi.h
-file path=usr/include/sys/cs.h
-file path=usr/include/sys/cs_priv.h
-file path=usr/include/sys/cs_strings.h
-file path=usr/include/sys/cs_stubs.h
-file path=usr/include/sys/cs_types.h
 file path=usr/include/sys/csiioctl.h
 file path=usr/include/sys/ctf.h
 file path=usr/include/sys/ctf_api.h
@@ -1276,12 +1268,8 @@
 file path=usr/include/sys/pattr.h
 file path=usr/include/sys/pbio.h
 file path=usr/include/sys/pcb.h
-file path=usr/include/sys/pccard.h
 file path=usr/include/sys/pci.h
-$(i386_ONLY)file path=usr/include/sys/pcic_reg.h
-$(i386_ONLY)file path=usr/include/sys/pcic_var.h
 file path=usr/include/sys/pcie.h
-file path=usr/include/sys/pcmcia.h
 file path=usr/include/sys/pctypes.h
 file path=usr/include/sys/pfmod.h
 file path=usr/include/sys/pg.h
@@ -1445,7 +1433,6 @@
 file path=usr/include/sys/spl.h
 file path=usr/include/sys/squeue.h
 file path=usr/include/sys/squeue_impl.h
-file path=usr/include/sys/sservice.h
 file path=usr/include/sys/stack.h
 file path=usr/include/sys/stat.h
 file path=usr/include/sys/stat_impl.h
--- old/usr/src/pkg/manifests/system-kernel.man4.inc	2014-11-12 17:44:38.629735617 +0100
+++ new/usr/src/pkg/manifests/system-kernel.man4.inc	2014-11-12 17:44:38.634736203 +0100
@@ -12,9 +12,9 @@
 #
 # Copyright 2011, Richard Lowe
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
-file path=usr/share/man/man4/cardbus.4
 file path=usr/share/man/man4/dir_ufs.4
 file path=usr/share/man/man4/driver.conf.4
 file path=usr/share/man/man4/pci.4
--- old/usr/src/pkg/manifests/system-kernel.man9f.inc	2014-11-12 17:44:38.771305958 +0100
+++ new/usr/src/pkg/manifests/system-kernel.man9f.inc	2014-11-12 17:44:38.776442565 +0100
@@ -62,64 +62,6 @@
 file path=usr/share/man/man9f/copyin.9f
 file path=usr/share/man/man9f/copymsg.9f
 file path=usr/share/man/man9f/copyout.9f
-file path=usr/share/man/man9f/csx_AccessConfigurationRegister.9f
-file path=usr/share/man/man9f/csx_CS_DDI_Info.9f
-file path=usr/share/man/man9f/csx_ConvertSize.9f
-file path=usr/share/man/man9f/csx_ConvertSpeed.9f
-file path=usr/share/man/man9f/csx_DeregisterClient.9f
-file path=usr/share/man/man9f/csx_DupHandle.9f
-file path=usr/share/man/man9f/csx_Error2Text.9f
-file path=usr/share/man/man9f/csx_Event2Text.9f
-file path=usr/share/man/man9f/csx_FreeHandle.9f
-file path=usr/share/man/man9f/csx_Get8.9f
-file path=usr/share/man/man9f/csx_GetFirstClient.9f
-file path=usr/share/man/man9f/csx_GetFirstTuple.9f
-file path=usr/share/man/man9f/csx_GetHandleOffset.9f
-file path=usr/share/man/man9f/csx_GetMappedAddr.9f
-file path=usr/share/man/man9f/csx_GetStatus.9f
-file path=usr/share/man/man9f/csx_GetTupleData.9f
-file path=usr/share/man/man9f/csx_MakeDeviceNode.9f
-file path=usr/share/man/man9f/csx_MapLogSocket.9f
-file path=usr/share/man/man9f/csx_MapMemPage.9f
-file path=usr/share/man/man9f/csx_ModifyConfiguration.9f
-file path=usr/share/man/man9f/csx_ModifyWindow.9f
-file path=usr/share/man/man9f/csx_ParseTuple.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_BATTERY.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_BYTEORDER.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_CFTABLE_ENTRY.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_CONFIG.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_DATE.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICE.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICEGEO.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICEGEO_A.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_FORMAT.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_FUNCE.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_FUNCID.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_GEOMETRY.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_JEDEC_C.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_LINKTARGET.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_A.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_MFC.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_MANFID.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_ORG.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_SPCL.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_SWIL.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_VERS_1.9f
-file path=usr/share/man/man9f/csx_Parse_CISTPL_VERS_2.9f
-file path=usr/share/man/man9f/csx_Put8.9f
-file path=usr/share/man/man9f/csx_RegisterClient.9f
-file path=usr/share/man/man9f/csx_ReleaseConfiguration.9f
-file path=usr/share/man/man9f/csx_RepGet8.9f
-file path=usr/share/man/man9f/csx_RepPut8.9f
-file path=usr/share/man/man9f/csx_RequestConfiguration.9f
-file path=usr/share/man/man9f/csx_RequestIO.9f
-file path=usr/share/man/man9f/csx_RequestIRQ.9f
-file path=usr/share/man/man9f/csx_RequestSocketMask.9f
-file path=usr/share/man/man9f/csx_RequestWindow.9f
-file path=usr/share/man/man9f/csx_ResetFunction.9f
-file path=usr/share/man/man9f/csx_SetEventMask.9f
-file path=usr/share/man/man9f/csx_SetHandleOffset.9f
-file path=usr/share/man/man9f/csx_ValidateCIS.9f
 file path=usr/share/man/man9f/datamsg.9f
 file path=usr/share/man/man9f/ddi_add_event_handler.9f
 file path=usr/share/man/man9f/ddi_add_intr.9f
@@ -603,39 +545,6 @@
 link path=usr/share/man/man9f/crgetsuid.9f target=ddi_cred.9f
 link path=usr/share/man/man9f/crgetuid.9f target=ddi_cred.9f
 link path=usr/share/man/man9f/crgetzoneid.9f target=ddi_cred.9f
-link path=usr/share/man/man9f/csx_Get16.9f target=csx_Get8.9f
-link path=usr/share/man/man9f/csx_Get32.9f target=csx_Get8.9f
-link path=usr/share/man/man9f/csx_Get64.9f target=csx_Get8.9f
-link path=usr/share/man/man9f/csx_GetEventMask.9f target=csx_SetEventMask.9f
-link path=usr/share/man/man9f/csx_GetNextClient.9f \
-    target=csx_GetFirstClient.9f
-link path=usr/share/man/man9f/csx_GetNextTuple.9f target=csx_GetFirstTuple.9f
-link path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_A.9f \
-    target=csx_Parse_CISTPL_DEVICE.9f
-link path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_OA.9f \
-    target=csx_Parse_CISTPL_DEVICE.9f
-link path=usr/share/man/man9f/csx_Parse_CISTPL_DEVICE_OC.9f \
-    target=csx_Parse_CISTPL_DEVICE.9f
-link path=usr/share/man/man9f/csx_Parse_CISTPL_JEDEC_A.9f \
-    target=csx_Parse_CISTPL_JEDEC_C.9f
-link path=usr/share/man/man9f/csx_Parse_CISTPL_LONGLINK_C.9f \
-    target=csx_Parse_CISTPL_LONGLINK_A.9f
-link path=usr/share/man/man9f/csx_Put16.9f target=csx_Put8.9f
-link path=usr/share/man/man9f/csx_Put32.9f target=csx_Put8.9f
-link path=usr/share/man/man9f/csx_Put64.9f target=csx_Put8.9f
-link path=usr/share/man/man9f/csx_ReleaseIO.9f target=csx_RequestIO.9f
-link path=usr/share/man/man9f/csx_ReleaseIRQ.9f target=csx_RequestIRQ.9f
-link path=usr/share/man/man9f/csx_ReleaseSocketMask.9f \
-    target=csx_RequestSocketMask.9f
-link path=usr/share/man/man9f/csx_ReleaseWindow.9f target=csx_RequestWindow.9f
-link path=usr/share/man/man9f/csx_RemoveDeviceNode.9f \
-    target=csx_MakeDeviceNode.9f
-link path=usr/share/man/man9f/csx_RepGet16.9f target=csx_RepGet8.9f
-link path=usr/share/man/man9f/csx_RepGet32.9f target=csx_RepGet8.9f
-link path=usr/share/man/man9f/csx_RepGet64.9f target=csx_RepGet8.9f
-link path=usr/share/man/man9f/csx_RepPut16.9f target=csx_RepPut8.9f
-link path=usr/share/man/man9f/csx_RepPut32.9f target=csx_RepPut8.9f
-link path=usr/share/man/man9f/csx_RepPut64.9f target=csx_RepPut8.9f
 link path=usr/share/man/man9f/cv_broadcast.9f target=condvar.9f
 link path=usr/share/man/man9f/cv_destroy.9f target=condvar.9f
 link path=usr/share/man/man9f/cv_init.9f target=condvar.9f
--- old/usr/src/pkg/manifests/system-kernel.mf	2014-11-12 17:44:38.954173802 +0100
+++ new/usr/src/pkg/manifests/system-kernel.mf	2014-11-12 17:44:38.959249998 +0100
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 #
@@ -644,7 +645,6 @@
 file path=kernel/misc/$(ARCH64)/bignum group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/$(ARCH64)/bootdev group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/busra group=sys mode=0755
-file path=kernel/misc/$(ARCH64)/cardbus group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/cmlb group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/consconfig group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/ctf group=sys mode=0755
@@ -669,7 +669,6 @@
 $(i386_ONLY)file path=kernel/misc/$(ARCH64)/pcicfg group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/$(ARCH64)/pcie group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/pcihp group=sys mode=0755
-file path=kernel/misc/$(ARCH64)/pcmcia group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/rpcsec group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/$(ARCH64)/sata group=sys mode=0755
 file path=kernel/misc/$(ARCH64)/scsi group=sys mode=0755
@@ -682,7 +681,6 @@
 $(i386_ONLY)file path=kernel/misc/bignum group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/bootdev group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/busra group=sys mode=0755
-$(i386_ONLY)file path=kernel/misc/cardbus group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/cmlb group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/consconfig group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/ctf group=sys mode=0755
@@ -706,7 +704,6 @@
 $(i386_ONLY)file path=kernel/misc/pcicfg group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/pcie group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/pcihp group=sys mode=0755
-$(i386_ONLY)file path=kernel/misc/pcmcia group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/rpcsec group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/sata group=sys mode=0755
 $(i386_ONLY)file path=kernel/misc/scsi group=sys mode=0755
--- old/usr/src/uts/Makefile	2014-11-12 17:44:39.125927648 +0100
+++ new/usr/src/uts/Makefile	2014-11-12 17:44:39.130967069 +0100
@@ -21,6 +21,7 @@
 #
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 # include global definitions
 include ../Makefile.master
@@ -150,7 +151,6 @@
 		common/net \
 		common/netinet \
 		common/nfs \
-		common/pcmcia/sys \
 		common/rpc \
 		common/rpcsvc \
 		common/sharefs \
--- old/usr/src/uts/common/Makefile.files	2014-11-12 17:44:39.273705754 +0100
+++ new/usr/src/uts/common/Makefile.files	2014-11-12 17:44:39.278776815 +0100
@@ -133,7 +133,6 @@
 		core.o		\
 		corectl.o	\
 		cred.o		\
-		cs_stubs.o	\
 		dacf.o		\
 		dacf_clnt.o	\
 		damap.o	\
@@ -476,8 +475,6 @@
 
 BLKDEV_OBJS += blkdev.o
 
-CARDBUS_OBJS += cardbus.o cardbus_hp.o cardbus_cfg.o
-
 CONSKBD_OBJS += conskbd.o
 
 CONSMS_OBJS +=	consms.o
@@ -1594,8 +1591,6 @@
 		audit_path.o audit_start.o audit_syscalls.o audit_token.o \
 		audit_mem.o
 
-PCIC_OBJS +=	pcic.o
-
 RPCSEC_OBJS +=	secmod.o	sec_clnt.o	sec_svc.o	sec_gen.o \
 		auth_des.o	auth_kern.o	auth_none.o	auth_loopb.o\
 		authdesprt.o	authdesubr.o	authu_prot.o \
@@ -1720,12 +1715,8 @@
 
 KAIO_OBJS += aio.o
 
-PCMCIA_OBJS += pcmcia.o cs.o cis.o cis_callout.o cis_handlers.o cis_params.o
-
 BUSRA_OBJS += busra.o
 
-PCS_OBJS += pcs.o
-
 PSET_OBJS +=	pset.o
 
 OHCI_OBJS += ohci.o ohci_hub.o ohci_polled.o
--- /dev/null	2014-11-12 17:44:39.000000000 +0100
+++ new/usr/src/uts/common/Makefile.files.orig	2014-11-12 17:44:39.476396562 +0100
@@ -0,0 +1,2078 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
+# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# This Makefile defines all file modules for the directory uts/common
+# and its children. These are the source files which may be considered
+# common to all SunOS systems.
+
+i386_CORE_OBJS += \
+		atomic.o	\
+		avintr.o	\
+		pic.o
+
+sparc_CORE_OBJS +=
+
+COMMON_CORE_OBJS +=		\
+		beep.o		\
+		bitset.o	\
+		bp_map.o	\
+		brand.o		\
+		cpucaps.o	\
+		cmt.o		\
+		cmt_policy.o	\
+		cpu.o		\
+		cpu_event.o	\
+		cpu_intr.o	\
+		cpu_pm.o	\
+		cpupart.o	\
+		cap_util.o	\
+		disp.o		\
+		group.o		\
+		kstat_fr.o	\
+		iscsiboot_prop.o	\
+		lgrp.o		\
+		lgrp_topo.o	\
+		mmapobj.o	\
+		mutex.o		\
+		page_lock.o	\
+		page_retire.o	\
+		panic.o		\
+		param.o		\
+		pg.o		\
+		pghw.o		\
+		putnext.o	\
+		rctl_proc.o	\
+		rwlock.o	\
+		seg_kmem.o	\
+		softint.o	\
+		string.o	\
+		strtol.o	\
+		strtoul.o	\
+		strtoll.o	\
+		strtoull.o	\
+		thread_intr.o	\
+		vm_page.o	\
+		vm_pagelist.o	\
+		zlib_obj.o	\
+		clock_tick.o
+
+CORE_OBJS +=	$(COMMON_CORE_OBJS) $($(MACH)_CORE_OBJS)
+
+ZLIB_OBJS =	zutil.o zmod.o zmod_subr.o \
+		adler32.o crc32.o deflate.o inffast.o \
+		inflate.o inftrees.o trees.o
+
+GENUNIX_OBJS +=	\
+		access.o	\
+		acl.o		\
+		acl_common.o	\
+		adjtime.o	\
+		alarm.o		\
+		aio_subr.o	\
+		auditsys.o	\
+		audit_core.o	\
+		audit_zone.o	\
+		audit_memory.o	\
+		autoconf.o	\
+		avl.o		\
+		bdev_dsort.o	\
+		bio.o		\
+		bitmap.o	\
+		blabel.o	\
+		brandsys.o	\
+		bz2blocksort.o	\
+		bz2compress.o	\
+		bz2decompress.o	\
+		bz2randtable.o	\
+		bz2bzlib.o	\
+		bz2crctable.o	\
+		bz2huffman.o	\
+		callb.o		\
+		callout.o	\
+		chdir.o		\
+		chmod.o		\
+		chown.o		\
+		cladm.o		\
+		class.o		\
+		clock.o		\
+		clock_highres.o	\
+		clock_realtime.o\
+		close.o		\
+		compress.o	\
+		condvar.o	\
+		conf.o		\
+		console.o	\
+		contract.o	\
+		copyops.o	\
+		core.o		\
+		corectl.o	\
+		cred.o		\
+		cs_stubs.o	\
+		dacf.o		\
+		dacf_clnt.o	\
+		damap.o	\
+		cyclic.o	\
+		ddi.o		\
+		ddifm.o		\
+		ddi_hp_impl.o	\
+		ddi_hp_ndi.o	\
+		ddi_intr.o	\
+		ddi_intr_impl.o	\
+		ddi_intr_irm.o	\
+		ddi_nodeid.o	\
+		ddi_periodic.o	\
+		devcfg.o	\
+		devcache.o	\
+		device.o	\
+		devid.o		\
+		devid_cache.o	\
+		devid_scsi.o	\
+		devid_smp.o	\
+		devpolicy.o	\
+		disp_lock.o	\
+		dnlc.o		\
+		driver.o	\
+		dumpsubr.o	\
+		driver_lyr.o	\
+		dtrace_subr.o	\
+		errorq.o	\
+		etheraddr.o	\
+		evchannels.o	\
+		exacct.o	\
+		exacct_core.o	\
+		exec.o		\
+		exit.o		\
+		fbio.o		\
+		fcntl.o		\
+		fdbuffer.o	\
+		fdsync.o	\
+		fem.o		\
+		ffs.o		\
+		fio.o		\
+		flock.o		\
+		fm.o		\
+		fork.o		\
+		vpm.o		\
+		fs_reparse.o	\
+		fs_subr.o	\
+		fsflush.o	\
+		ftrace.o	\
+		getcwd.o	\
+		getdents.o	\
+		getloadavg.o	\
+		getpagesizes.o	\
+		getpid.o	\
+		gfs.o		\
+		rusagesys.o	\
+		gid.o		\
+		groups.o	\
+		grow.o		\
+		hat_refmod.o	\
+		id32.o		\
+		id_space.o	\
+		inet_ntop.o	\
+		instance.o	\
+		ioctl.o		\
+		ip_cksum.o	\
+		issetugid.o	\
+		ippconf.o	\
+		kcpc.o		\
+		kdi.o		\
+		kiconv.o	\
+		klpd.o		\
+		kmem.o		\
+		ksyms_snapshot.o	\
+		l_strplumb.o	\
+		labelsys.o	\
+		link.o		\
+		list.o		\
+		lockstat_subr.o	\
+		log_sysevent.o	\
+		logsubr.o	\
+		lookup.o	\
+		lseek.o		\
+		ltos.o		\
+		lwp.o		\
+		lwp_create.o	\
+		lwp_info.o	\
+		lwp_self.o	\
+		lwp_sobj.o	\
+		lwp_timer.o	\
+		lwpsys.o	\
+		main.o		\
+		mmapobjsys.o	\
+		memcntl.o	\
+		memstr.o	\
+		lgrpsys.o	\
+		mkdir.o		\
+		mknod.o		\
+		mount.o		\
+		move.o		\
+		msacct.o	\
+		multidata.o	\
+		nbmlock.o	\
+		ndifm.o		\
+		nice.o		\
+		netstack.o	\
+		ntptime.o	\
+		nvpair.o	\
+		nvpair_alloc_system.o	\
+		nvpair_alloc_fixed.o	\
+		fnvpair.o	\
+		octet.o		\
+		open.o		\
+		p_online.o	\
+		pathconf.o	\
+		pathname.o	\
+		pause.o		\
+		serializer.o	\
+		pci_intr_lib.o	\
+		pci_cap.o	\
+		pcifm.o		\
+		pgrp.o		\
+		pgrpsys.o	\
+		pid.o		\
+		pkp_hash.o	\
+		policy.o	\
+		poll.o		\
+		pool.o		\
+		pool_pset.o	\
+		port_subr.o	\
+		ppriv.o		\
+		printf.o	\
+		priocntl.o	\
+		priv.o		\
+		priv_const.o	\
+		proc.o		\
+		procset.o	\
+		processor_bind.o	\
+		processor_info.o	\
+		profil.o	\
+		project.o	\
+		qsort.o		\
+		rctl.o		\
+		rctlsys.o	\
+		readlink.o	\
+		refstr.o	\
+		rename.o	\
+		resolvepath.o	\
+		retire_store.o	\
+		process.o	\
+		rlimit.o	\
+		rmap.o		\
+		rw.o		\
+		rwstlock.o	\
+		sad_conf.o	\
+		sid.o		\
+		sidsys.o	\
+		sched.o		\
+		schedctl.o	\
+		sctp_crc32.o	\
+		seg_dev.o	\
+		seg_kp.o	\
+		seg_kpm.o	\
+		seg_map.o	\
+		seg_vn.o	\
+		seg_spt.o	\
+		semaphore.o	\
+		sendfile.o	\
+		session.o	\
+		share.o		\
+		shuttle.o	\
+		sig.o		\
+		sigaction.o	\
+		sigaltstack.o	\
+		signotify.o	\
+		sigpending.o	\
+		sigprocmask.o	\
+		sigqueue.o	\
+		sigsendset.o	\
+		sigsuspend.o	\
+		sigtimedwait.o	\
+		sleepq.o	\
+		sock_conf.o	\
+		space.o		\
+		sscanf.o	\
+		stat.o		\
+		statfs.o	\
+		statvfs.o	\
+		stol.o		\
+		str_conf.o	\
+		strcalls.o	\
+		stream.o	\
+		streamio.o	\
+		strext.o	\
+		strsubr.o	\
+		strsun.o	\
+		subr.o		\
+		sunddi.o	\
+		sunmdi.o	\
+		sunndi.o	\
+		sunpci.o	\
+		sunpm.o		\
+		sundlpi.o	\
+		suntpi.o	\
+		swap_subr.o	\
+		swap_vnops.o	\
+		symlink.o	\
+		sync.o		\
+		sysclass.o	\
+		sysconfig.o	\
+		sysent.o	\
+		sysfs.o		\
+		systeminfo.o	\
+		task.o		\
+		taskq.o		\
+		tasksys.o	\
+		time.o		\
+		timer.o		\
+		times.o		\
+		timers.o	\
+		thread.o	\
+		tlabel.o	\
+		tnf_res.o	\
+		turnstile.o	\
+		tty_common.o	\
+		u8_textprep.o	\
+		uadmin.o	\
+		uconv.o		\
+		ucredsys.o	\
+		uid.o		\
+		umask.o		\
+		umount.o	\
+		uname.o		\
+		unix_bb.o	\
+		unlink.o	\
+		urw.o		\
+		utime.o		\
+		utssys.o	\
+		uucopy.o	\
+		vfs.o		\
+		vfs_conf.o	\
+		vmem.o		\
+		vm_anon.o	\
+		vm_as.o		\
+		vm_meter.o	\
+		vm_pageout.o	\
+		vm_pvn.o	\
+		vm_rm.o		\
+		vm_seg.o	\
+		vm_subr.o	\
+		vm_swap.o	\
+		vm_usage.o	\
+		vnode.o		\
+		vuid_queue.o	\
+		vuid_store.o	\
+		waitq.o		\
+		watchpoint.o	\
+		yield.o		\
+		scsi_confdata.o	\
+		xattr.o		\
+		xattr_common.o	\
+		xdr_mblk.o	\
+		xdr_mem.o	\
+		xdr.o		\
+		xdr_array.o	\
+		xdr_refer.o	\
+		xhat.o		\
+		zone.o
+
+#
+#	Stubs for the stand-alone linker/loader
+#
+sparc_GENSTUBS_OBJS =	\
+	kobj_stubs.o
+
+i386_GENSTUBS_OBJS =
+
+COMMON_GENSTUBS_OBJS =
+
+GENSTUBS_OBJS += $(COMMON_GENSTUBS_OBJS) $($(MACH)_GENSTUBS_OBJS)
+
+#
+#	DTrace and DTrace Providers
+#
+DTRACE_OBJS += dtrace.o dtrace_isa.o dtrace_asm.o
+
+SDT_OBJS += sdt_subr.o
+
+PROFILE_OBJS += profile.o
+
+SYSTRACE_OBJS += systrace.o
+
+LOCKSTAT_OBJS += lockstat.o
+
+FASTTRAP_OBJS += fasttrap.o fasttrap_isa.o
+
+DCPC_OBJS += dcpc.o
+
+#
+#	Driver (pseudo-driver) Modules
+#
+IPP_OBJS +=	ippctl.o
+
+AUDIO_OBJS += audio_client.o audio_ddi.o audio_engine.o \
+	   audio_fltdata.o audio_format.o audio_ctrl.o \
+	   audio_grc3.o audio_output.o audio_input.o \
+	   audio_oss.o audio_sun.o
+
+AUDIOEMU10K_OBJS += audioemu10k.o
+
+AUDIOENS_OBJS += audioens.o
+
+AUDIOVIA823X_OBJS += audiovia823x.o
+
+AUDIOVIA97_OBJS += audiovia97.o
+
+AUDIO1575_OBJS += audio1575.o
+
+AUDIO810_OBJS += audio810.o
+
+AUDIOCMI_OBJS += audiocmi.o
+
+AUDIOCMIHD_OBJS += audiocmihd.o
+
+AUDIOHD_OBJS +=	audiohd.o
+
+AUDIOIXP_OBJS += audioixp.o
+
+AUDIOLS_OBJS += audiols.o
+
+AUDIOP16X_OBJS += audiop16x.o
+
+AUDIOPCI_OBJS += audiopci.o
+
+AUDIOSOLO_OBJS += audiosolo.o
+
+AUDIOTS_OBJS +=	audiots.o
+
+AC97_OBJS += ac97.o ac97_ad.o ac97_alc.o ac97_cmi.o
+
+BLKDEV_OBJS += blkdev.o
+
+CARDBUS_OBJS += cardbus.o cardbus_hp.o cardbus_cfg.o
+
+CONSKBD_OBJS += conskbd.o
+
+CONSMS_OBJS +=	consms.o
+
+OLDPTY_OBJS +=	tty_ptyconf.o
+
+PTC_OBJS +=	tty_pty.o
+
+PTSL_OBJS +=	tty_pts.o
+
+PTM_OBJS +=	ptm.o
+
+MII_OBJS +=	mii.o mii_cicada.o mii_natsemi.o mii_intel.o mii_qualsemi.o \
+		mii_marvell.o mii_realtek.o mii_other.o
+
+PTS_OBJS +=	pts.o
+
+PTY_OBJS +=	ptms_conf.o
+
+SAD_OBJS +=	sad.o
+
+MD4_OBJS +=	md4.o md4_mod.o
+
+MD5_OBJS +=	md5.o md5_mod.o
+
+SHA1_OBJS +=	sha1.o sha1_mod.o
+
+SHA2_OBJS +=	sha2.o sha2_mod.o
+
+IPGPC_OBJS +=   classifierddi.o classifier.o filters.o trie.o table.o \
+		ba_table.o
+
+DSCPMK_OBJS +=	dscpmk.o dscpmkddi.o
+
+DLCOSMK_OBJS +=	dlcosmk.o dlcosmkddi.o
+
+FLOWACCT_OBJS +=	flowacctddi.o flowacct.o
+
+TOKENMT_OBJS +=	tokenmt.o tokenmtddi.o
+
+TSWTCL_OBJS +=	tswtcl.o tswtclddi.o
+
+ARP_OBJS +=	arpddi.o
+
+ICMP_OBJS +=	icmpddi.o
+
+ICMP6_OBJS +=	icmp6ddi.o
+
+RTS_OBJS +=	rtsddi.o
+
+IP_ICMP_OBJS =	icmp.o icmp_opt_data.o
+IP_RTS_OBJS =	rts.o rts_opt_data.o
+IP_TCP_OBJS =	tcp.o tcp_fusion.o tcp_opt_data.o tcp_sack.o tcp_stats.o \
+		tcp_misc.o tcp_timers.o tcp_time_wait.o tcp_tpi.o tcp_output.o \
+		tcp_input.o tcp_socket.o tcp_bind.o tcp_cluster.o tcp_tunables.o
+IP_UDP_OBJS =	udp.o udp_opt_data.o udp_tunables.o udp_stats.o
+IP_SCTP_OBJS =	sctp.o sctp_opt_data.o sctp_output.o \
+		sctp_init.o sctp_input.o sctp_cookie.o \
+		sctp_conn.o sctp_error.o sctp_snmp.o \
+		sctp_tunables.o sctp_shutdown.o sctp_common.o \
+		sctp_timer.o sctp_heartbeat.o sctp_hash.o \
+		sctp_bind.o sctp_notify.o sctp_asconf.o \
+		sctp_addr.o tn_ipopt.o tnet.o ip_netinfo.o \
+		sctp_misc.o
+IP_ILB_OBJS =	ilb.o ilb_nat.o ilb_conn.o ilb_alg_hash.o ilb_alg_rr.o
+
+IP_OBJS +=	igmp.o ipmp.o ip.o ip6.o ip6_asp.o ip6_if.o ip6_ire.o \
+		ip6_rts.o ip_if.o ip_ire.o ip_listutils.o ip_mroute.o \
+		ip_multi.o ip2mac.o ip_ndp.o ip_rts.o ip_srcid.o \
+		ipddi.o ipdrop.o mi.o nd.o tunables.o optcom.o snmpcom.o \
+		ipsec_loader.o spd.o ipclassifier.o inet_common.o ip_squeue.o \
+		squeue.o ip_sadb.o ip_ftable.o proto_set.o radix.o ip_dummy.o \
+		ip_helper_stream.o ip_tunables.o \
+		ip_output.o ip_input.o ip6_input.o ip6_output.o ip_arp.o \
+		conn_opt.o ip_attr.o ip_dce.o \
+		$(IP_ICMP_OBJS) \
+		$(IP_RTS_OBJS) \
+		$(IP_TCP_OBJS) \
+		$(IP_UDP_OBJS) \
+		$(IP_SCTP_OBJS) \
+		$(IP_ILB_OBJS)
+
+IP6_OBJS +=	ip6ddi.o
+
+HOOK_OBJS +=	hook.o
+
+NETI_OBJS +=	neti_impl.o neti_mod.o neti_stack.o
+
+KEYSOCK_OBJS +=	keysockddi.o keysock.o keysock_opt_data.o
+
+IPNET_OBJS +=	ipnet.o ipnet_bpf.o
+
+SPDSOCK_OBJS += spdsockddi.o spdsock.o spdsock_opt_data.o
+
+IPSECESP_OBJS += ipsecespddi.o ipsecesp.o
+
+IPSECAH_OBJS +=	ipsecahddi.o ipsecah.o sadb.o
+
+SPPP_OBJS +=	sppp.o sppp_dlpi.o sppp_mod.o s_common.o
+
+SPPPTUN_OBJS +=	sppptun.o sppptun_mod.o
+
+SPPPASYN_OBJS += spppasyn.o spppasyn_mod.o
+
+SPPPCOMP_OBJS += spppcomp.o spppcomp_mod.o deflate.o bsd-comp.o vjcompress.o \
+		zlib.o
+
+TCP_OBJS +=	tcpddi.o
+
+TCP6_OBJS +=	tcp6ddi.o
+
+NCA_OBJS +=	ncaddi.o
+
+SDP_SOCK_MOD_OBJS += sockmod_sdp.o socksdp.o socksdpsubr.o
+
+SCTP_SOCK_MOD_OBJS += sockmod_sctp.o socksctp.o socksctpsubr.o
+
+PFP_SOCK_MOD_OBJS += sockmod_pfp.o
+
+RDS_SOCK_MOD_OBJS += sockmod_rds.o
+
+RDS_OBJS +=	rdsddi.o rdssubr.o rds_opt.o rds_ioctl.o
+
+RDSIB_OBJS +=	rdsib.o rdsib_ib.o rdsib_cm.o rdsib_ep.o rdsib_buf.o \
+		rdsib_debug.o rdsib_sc.o
+
+RDSV3_OBJS +=	af_rds.o rdsv3_ddi.o bind.o loop.o threads.o connection.o \
+		transport.o cong.o sysctl.o message.o rds_recv.o send.o \
+		stats.o info.o page.o rdma_transport.o ib_ring.o ib_rdma.o \
+		ib_recv.o ib.o ib_send.o ib_sysctl.o ib_stats.o ib_cm.o \
+		rdsv3_sc.o rdsv3_debug.o rdsv3_impl.o rdma.o rdsv3_af_thr.o
+
+ISER_OBJS +=	iser.o iser_cm.o iser_cq.o iser_ib.o iser_idm.o \
+		iser_resource.o iser_xfer.o
+
+UDP_OBJS +=	udpddi.o
+
+UDP6_OBJS +=	udp6ddi.o
+
+SY_OBJS +=	gentty.o
+
+TCO_OBJS +=	ticots.o
+
+TCOO_OBJS +=	ticotsord.o
+
+TCL_OBJS +=	ticlts.o
+
+TL_OBJS +=	tl.o
+
+DUMP_OBJS +=	dump.o
+
+BPF_OBJS +=	bpf.o bpf_filter.o bpf_mod.o bpf_dlt.o bpf_mac.o
+
+CLONE_OBJS +=	clone.o
+
+CN_OBJS +=	cons.o
+
+DLD_OBJS +=	dld_drv.o dld_proto.o dld_str.o dld_flow.o
+
+DLS_OBJS +=	dls.o dls_link.o dls_mod.o dls_stat.o dls_mgmt.o
+
+GLD_OBJS +=     gld.o gldutil.o
+
+MAC_OBJS +=     mac.o  mac_bcast.o mac_client.o mac_datapath_setup.o mac_flow.o \
+		mac_hio.o mac_mod.o mac_ndd.o mac_provider.o mac_sched.o \
+		mac_protect.o mac_soft_ring.o mac_stat.o mac_util.o
+
+MAC_6TO4_OBJS +=	mac_6to4.o
+
+MAC_ETHER_OBJS +=	mac_ether.o
+
+MAC_IPV4_OBJS +=	mac_ipv4.o
+
+MAC_IPV6_OBJS +=	mac_ipv6.o
+
+MAC_WIFI_OBJS +=	mac_wifi.o
+
+MAC_IB_OBJS +=		mac_ib.o
+
+IPTUN_OBJS +=	iptun_dev.o iptun_ctl.o iptun.o
+
+AGGR_OBJS +=	aggr_dev.o aggr_ctl.o aggr_grp.o aggr_port.o \
+		aggr_send.o aggr_recv.o aggr_lacp.o
+
+SOFTMAC_OBJS += softmac_main.o softmac_ctl.o softmac_capab.o \
+		softmac_dev.o softmac_stat.o softmac_pkt.o softmac_fp.o
+
+NET80211_OBJS += net80211.o net80211_proto.o net80211_input.o \
+		 net80211_output.o net80211_node.o net80211_crypto.o \
+		 net80211_crypto_none.o net80211_crypto_wep.o net80211_ioctl.o \
+		 net80211_crypto_tkip.o net80211_crypto_ccmp.o	\
+		 net80211_ht.o
+
+VNIC_OBJS +=	vnic_ctl.o vnic_dev.o
+
+SIMNET_OBJS +=	simnet.o
+
+IB_OBJS +=	ibnex.o ibnex_ioctl.o ibnex_hca.o
+
+IBCM_OBJS +=	ibcm_impl.o ibcm_sm.o ibcm_ti.o ibcm_utils.o ibcm_path.o \
+		ibcm_arp.o ibcm_arp_link.o
+
+IBDM_OBJS +=	ibdm.o
+
+IBDMA_OBJS +=	ibdma.o
+
+IBMF_OBJS +=	ibmf.o ibmf_impl.o ibmf_dr.o ibmf_wqe.o ibmf_ud_dest.o ibmf_mod.o \
+		ibmf_send.o ibmf_recv.o ibmf_handlers.o ibmf_trans.o \
+		ibmf_timers.o ibmf_msg.o ibmf_utils.o ibmf_rmpp.o \
+		ibmf_saa.o ibmf_saa_impl.o ibmf_saa_utils.o ibmf_saa_events.o
+
+IBTL_OBJS +=	ibtl_impl.o ibtl_util.o ibtl_mem.o ibtl_handlers.o ibtl_qp.o \
+		ibtl_cq.o ibtl_wr.o ibtl_hca.o ibtl_chan.o ibtl_cm.o \
+		ibtl_mcg.o ibtl_ibnex.o ibtl_srq.o ibtl_part.o
+
+TAVOR_OBJS +=	tavor.o tavor_agents.o tavor_cfg.o tavor_ci.o tavor_cmd.o \
+		tavor_cq.o tavor_event.o tavor_ioctl.o tavor_misc.o \
+		tavor_mr.o tavor_qp.o tavor_qpmod.o tavor_rsrc.o \
+		tavor_srq.o tavor_stats.o tavor_umap.o tavor_wr.o
+
+HERMON_OBJS +=	hermon.o hermon_agents.o hermon_cfg.o hermon_ci.o hermon_cmd.o \
+		hermon_cq.o hermon_event.o hermon_ioctl.o hermon_misc.o \
+		hermon_mr.o hermon_qp.o hermon_qpmod.o hermon_rsrc.o \
+		hermon_srq.o hermon_stats.o hermon_umap.o hermon_wr.o \
+		hermon_fcoib.o hermon_fm.o
+
+DAPLT_OBJS +=	daplt.o
+
+SOL_OFS_OBJS +=	sol_cma.o sol_ib_cma.o sol_uobj.o \
+		sol_ofs_debug_util.o sol_ofs_gen_util.o \
+		sol_kverbs.o
+
+SOL_UCMA_OBJS +=	sol_ucma.o
+
+SOL_UVERBS_OBJS +=	sol_uverbs.o sol_uverbs_comp.o sol_uverbs_event.o \
+			sol_uverbs_hca.o sol_uverbs_qp.o
+
+SOL_UMAD_OBJS += sol_umad.o
+
+KSTAT_OBJS +=	kstat.o
+
+KSYMS_OBJS +=	ksyms.o
+
+INSTANCE_OBJS += inst_sync.o
+
+IWSCN_OBJS +=	iwscons.o
+
+LOFI_OBJS +=	lofi.o LzmaDec.o
+
+FSSNAP_OBJS +=	fssnap.o
+
+FSSNAPIF_OBJS += fssnap_if.o
+
+MM_OBJS +=	mem.o
+
+PHYSMEM_OBJS +=	physmem.o
+
+OPTIONS_OBJS += options.o
+
+WINLOCK_OBJS +=	winlockio.o
+
+PM_OBJS +=	pm.o
+SRN_OBJS +=	srn.o
+
+PSEUDO_OBJS +=	pseudonex.o
+
+RAMDISK_OBJS +=	ramdisk.o
+
+LLC1_OBJS += llc1.o
+
+USBKBM_OBJS += usbkbm.o
+
+USBWCM_OBJS += usbwcm.o
+
+BOFI_OBJS += bofi.o
+
+HID_OBJS += hid.o
+
+HWA_RC_OBJS += hwarc.o
+
+USBSKEL_OBJS += usbskel.o
+
+USBVC_OBJS += usbvc.o usbvc_v4l2.o
+
+HIDPARSER_OBJS += hidparser.o
+
+USB_AC_OBJS += usb_ac.o
+
+USB_AS_OBJS += usb_as.o
+
+USB_AH_OBJS += usb_ah.o
+
+USBMS_OBJS += usbms.o
+
+USBPRN_OBJS += usbprn.o
+
+UGEN_OBJS += ugen.o
+
+USBSER_OBJS += usbser.o usbser_rseq.o
+
+USBSACM_OBJS += usbsacm.o
+
+USBSER_KEYSPAN_OBJS += usbser_keyspan.o keyspan_dsd.o keyspan_pipe.o
+
+USBS49_FW_OBJS += keyspan_49fw.o
+
+USBSPRL_OBJS += usbser_pl2303.o pl2303_dsd.o
+
+WUSB_CA_OBJS += wusb_ca.o
+
+USBFTDI_OBJS += usbser_uftdi.o uftdi_dsd.o
+
+USBECM_OBJS += usbecm.o
+
+WC_OBJS += wscons.o vcons.o
+
+VCONS_CONF_OBJS += vcons_conf.o
+
+SCSI_OBJS +=	scsi_capabilities.o scsi_confsubr.o scsi_control.o \
+		scsi_data.o scsi_fm.o scsi_hba.o scsi_reset_notify.o \
+		scsi_resource.o scsi_subr.o scsi_transport.o scsi_watch.o \
+		smp_transport.o
+
+SCSI_VHCI_OBJS +=		scsi_vhci.o mpapi_impl.o scsi_vhci_tpgs.o
+
+SCSI_VHCI_F_SYM_OBJS +=		sym.o
+
+SCSI_VHCI_F_TPGS_OBJS +=	tpgs.o
+
+SCSI_VHCI_F_ASYM_SUN_OBJS +=	asym_sun.o
+
+SCSI_VHCI_F_SYM_HDS_OBJS += 	sym_hds.o
+
+SCSI_VHCI_F_TAPE_OBJS +=	tape.o
+
+SCSI_VHCI_F_TPGS_TAPE_OBJS +=	tpgs_tape.o
+
+SGEN_OBJS +=	sgen.o
+
+SMP_OBJS +=	smp.o
+
+SATA_OBJS +=	sata.o
+
+USBA_OBJS +=	hcdi.o	usba.o	usbai.o hubdi.o parser.o genconsole.o \
+		usbai_pipe_mgmt.o usbai_req.o usbai_util.o usbai_register.o \
+		usba_devdb.o usba10_calls.o usba_ugen.o whcdi.o wa.o
+USBA_WITHOUT_WUSB_OBJS +=	hcdi.o	usba.o	usbai.o hubdi.o parser.o genconsole.o \
+		usbai_pipe_mgmt.o usbai_req.o usbai_util.o usbai_register.o \
+		usba_devdb.o usba10_calls.o usba_ugen.o
+
+USBA10_OBJS +=	usba10.o
+
+RSM_OBJS +=	rsm.o	rsmka_pathmanager.o	rsmka_util.o
+
+RSMOPS_OBJS +=	rsmops.o
+
+S1394_OBJS +=	t1394.o t1394_errmsg.o s1394.o s1394_addr.o s1394_asynch.o \
+		s1394_bus_reset.o s1394_cmp.o s1394_csr.o s1394_dev_disc.o \
+		s1394_fa.o s1394_fcp.o \
+		s1394_hotplug.o s1394_isoch.o s1394_misc.o h1394.o nx1394.o
+
+HCI1394_OBJS +=	hci1394.o hci1394_async.o hci1394_attach.o hci1394_buf.o \
+		hci1394_csr.o hci1394_detach.o hci1394_extern.o \
+		hci1394_ioctl.o hci1394_isoch.o hci1394_isr.o \
+		hci1394_ixl_comp.o hci1394_ixl_isr.o hci1394_ixl_misc.o \
+		hci1394_ixl_update.o hci1394_misc.o hci1394_ohci.o \
+		hci1394_q.o hci1394_s1394if.o hci1394_tlabel.o \
+		hci1394_tlist.o hci1394_vendor.o
+
+AV1394_OBJS +=	av1394.o av1394_as.o av1394_async.o av1394_cfgrom.o \
+		av1394_cmp.o av1394_fcp.o av1394_isoch.o av1394_isoch_chan.o \
+		av1394_isoch_recv.o av1394_isoch_xmit.o av1394_list.o \
+		av1394_queue.o
+
+DCAM1394_OBJS += dcam.o dcam_frame.o dcam_param.o dcam_reg.o \
+		dcam_ring_buff.o
+
+SCSA1394_OBJS += hba.o sbp2_driver.o sbp2_bus.o
+
+SBP2_OBJS += cfgrom.o sbp2.o
+
+PMODEM_OBJS += pmodem.o pmodem_cis.o cis.o cis_callout.o cis_handlers.o cis_params.o
+
+DSW_OBJS +=	dsw.o dsw_dev.o ii_tree.o
+
+NCALL_OBJS +=	ncall.o \
+		ncall_stub.o
+
+RDC_OBJS +=	rdc.o \
+		rdc_dev.o \
+		rdc_io.o \
+		rdc_clnt.o \
+		rdc_prot_xdr.o \
+		rdc_svc.o \
+		rdc_bitmap.o \
+		rdc_health.o \
+		rdc_subr.o \
+		rdc_diskq.o
+
+RDCSRV_OBJS +=	rdcsrv.o
+
+RDCSTUB_OBJS += rdc_stub.o
+
+SDBC_OBJS +=	sd_bcache.o \
+		sd_bio.o \
+		sd_conf.o \
+		sd_ft.o \
+		sd_hash.o \
+		sd_io.o \
+		sd_misc.o \
+		sd_pcu.o \
+		sd_tdaemon.o \
+		sd_trace.o \
+		sd_iob_impl0.o \
+		sd_iob_impl1.o \
+		sd_iob_impl2.o \
+		sd_iob_impl3.o \
+		sd_iob_impl4.o \
+		sd_iob_impl5.o \
+		sd_iob_impl6.o \
+		sd_iob_impl7.o \
+		safestore.o \
+		safestore_ram.o
+
+NSCTL_OBJS +=	nsctl.o \
+		nsc_cache.o \
+		nsc_disk.o \
+		nsc_dev.o \
+		nsc_freeze.o \
+		nsc_gen.o \
+		nsc_mem.o \
+		nsc_ncallio.o \
+		nsc_power.o \
+		nsc_resv.o \
+		nsc_rmspin.o \
+		nsc_solaris.o \
+		nsc_trap.o \
+		nsc_list.o
+UNISTAT_OBJS +=	spuni.o \
+		spcs_s_k.o
+
+NSKERN_OBJS +=	nsc_ddi.o \
+		nsc_proc.o \
+		nsc_raw.o \
+		nsc_thread.o \
+		nskernd.o
+
+SV_OBJS +=	sv.o
+
+PMCS_OBJS += pmcs_attach.o pmcs_ds.o pmcs_intr.o pmcs_nvram.o pmcs_sata.o \
+		pmcs_scsa.o pmcs_smhba.o pmcs_subr.o pmcs_fwlog.o
+
+PMCS8001FW_C_OBJS +=	pmcs_fw_hdr.o
+PMCS8001FW_OBJS +=		$(PMCS8001FW_C_OBJS) SPCBoot.o ila.o firmware.o
+
+#
+#	Build up defines and paths.
+
+ST_OBJS +=	st.o	st_conf.o
+
+EMLXS_OBJS +=	emlxs_clock.o emlxs_dfc.o emlxs_dhchap.o emlxs_diag.o \
+		emlxs_download.o emlxs_dump.o emlxs_els.o emlxs_event.o \
+		emlxs_fcf.o emlxs_fcp.o emlxs_fct.o emlxs_hba.o emlxs_ip.o \
+		emlxs_mbox.o emlxs_mem.o emlxs_msg.o emlxs_node.o \
+		emlxs_pkt.o emlxs_sli3.o emlxs_sli4.o emlxs_solaris.o \
+		emlxs_thread.o
+
+EMLXS_FW_OBJS +=	emlxs_fw.o
+
+OCE_OBJS +=	oce_buf.o oce_fm.o oce_gld.o oce_hw.o oce_intr.o oce_main.o \
+		oce_mbx.o oce_mq.o oce_queue.o oce_rx.o oce_stat.o oce_tx.o \
+		oce_utils.o
+
+FCT_OBJS += discovery.o fct.o
+
+QLT_OBJS += 2400.o 2500.o 8100.o qlt.o qlt_dma.o
+
+SRPT_OBJS += srpt_mod.o srpt_ch.o srpt_cm.o srpt_ioc.o srpt_stp.o
+
+FCOE_OBJS += fcoe.o fcoe_eth.o fcoe_fc.o
+
+FCOET_OBJS += fcoet.o fcoet_eth.o fcoet_fc.o
+
+FCOEI_OBJS += fcoei.o fcoei_eth.o fcoei_lv.o
+
+ISCSIT_SHARED_OBJS += \
+		iscsit_common.o
+
+ISCSIT_OBJS +=	$(ISCSIT_SHARED_OBJS) \
+		iscsit.o iscsit_tgt.o iscsit_sess.o iscsit_login.o \
+		iscsit_text.o iscsit_isns.o iscsit_radiusauth.o \
+		iscsit_radiuspacket.o iscsit_auth.o iscsit_authclient.o
+
+PPPT_OBJS +=	alua_ic_if.o pppt.o pppt_msg.o pppt_tgt.o
+
+STMF_OBJS += lun_map.o stmf.o
+
+STMF_SBD_OBJS += sbd.o sbd_scsi.o sbd_pgr.o sbd_zvol.o
+
+SYSMSG_OBJS +=	sysmsg.o
+
+SES_OBJS +=	ses.o ses_sen.o ses_safte.o ses_ses.o
+
+TNF_OBJS +=	tnf_buf.o	tnf_trace.o	tnf_writer.o	trace_init.o \
+		trace_funcs.o	tnf_probe.o	tnf.o
+
+LOGINDMUX_OBJS += logindmux.o
+
+DEVINFO_OBJS += devinfo.o
+
+DEVPOLL_OBJS += devpoll.o
+
+DEVPOOL_OBJS += devpool.o
+
+I8042_OBJS +=	i8042.o
+
+KB8042_OBJS +=	\
+		at_keyprocess.o	\
+		kb8042.o	\
+		kb8042_keytables.o
+
+MOUSE8042_OBJS += mouse8042.o
+
+FDC_OBJS +=	fdc.o
+
+ASY_OBJS +=	asy.o
+
+ECPP_OBJS +=	ecpp.o
+
+VUIDM3P_OBJS += vuidmice.o vuidm3p.o
+
+VUIDM4P_OBJS += vuidmice.o vuidm4p.o
+
+VUIDM5P_OBJS += vuidmice.o vuidm5p.o
+
+VUIDPS2_OBJS += vuidmice.o vuidps2.o
+
+HPCSVC_OBJS += hpcsvc.o
+
+PCIE_MISC_OBJS += pcie.o pcie_fault.o pcie_hp.o pciehpc.o pcishpc.o pcie_pwr.o pciev.o
+
+PCIHPNEXUS_OBJS += pcihp.o
+
+OPENEEPR_OBJS += openprom.o
+
+RANDOM_OBJS += random.o
+
+PSHOT_OBJS += pshot.o
+
+GEN_DRV_OBJS += gen_drv.o
+
+TCLIENT_OBJS +=	tclient.o
+
+TPHCI_OBJS += tphci.o
+
+TVHCI_OBJS += tvhci.o
+
+EMUL64_OBJS += emul64.o emul64_bsd.o
+
+FCP_OBJS += fcp.o
+
+FCIP_OBJS += fcip.o
+
+FCSM_OBJS += fcsm.o
+
+FCTL_OBJS += fctl.o
+
+FP_OBJS += fp.o
+
+QLC_OBJS += ql_api.o ql_debug.o ql_hba_fru.o ql_init.o ql_iocb.o ql_ioctl.o \
+	ql_isr.o ql_mbx.o ql_nx.o ql_xioctl.o ql_fw_table.o
+
+QLC_FW_2200_OBJS += ql_fw_2200.o
+
+QLC_FW_2300_OBJS += ql_fw_2300.o
+
+QLC_FW_2400_OBJS += ql_fw_2400.o
+
+QLC_FW_2500_OBJS += ql_fw_2500.o
+
+QLC_FW_6322_OBJS += ql_fw_6322.o
+
+QLC_FW_8100_OBJS += ql_fw_8100.o
+
+QLGE_OBJS += qlge.o qlge_dbg.o qlge_flash.o qlge_fm.o qlge_gld.o qlge_mpi.o
+
+ZCONS_OBJS += zcons.o
+
+NV_SATA_OBJS += nv_sata.o
+
+SI3124_OBJS += si3124.o
+
+AHCI_OBJS += ahci.o
+
+PCIIDE_OBJS += pci-ide.o
+
+PCEPP_OBJS += pcepp.o
+
+CPC_OBJS += cpc.o
+
+CPUID_OBJS += cpuid_drv.o
+
+SYSEVENT_OBJS += sysevent.o
+
+BL_OBJS += bl.o
+
+DRM_OBJS += drm_sunmod.o drm_kstat.o drm_agpsupport.o \
+	    drm_auth.o drm_bufs.o drm_context.o drm_dma.o \
+	    drm_drawable.o drm_drv.o drm_fops.o drm_ioctl.o drm_irq.o \
+	    drm_lock.o drm_memory.o drm_msg.o drm_pci.o drm_scatter.o \
+	    drm_cache.o drm_gem.o drm_mm.o ati_pcigart.o
+
+FM_OBJS += devfm.o devfm_machdep.o
+
+RTLS_OBJS +=	rtls.o
+
+#
+#			exec modules
+#
+AOUTEXEC_OBJS +=aout.o
+
+ELFEXEC_OBJS +=	elf.o elf_notes.o old_notes.o
+
+INTPEXEC_OBJS +=intp.o
+
+SHBINEXEC_OBJS +=shbin.o
+
+JAVAEXEC_OBJS +=java.o
+
+#
+#			file system modules
+#
+AUTOFS_OBJS +=	auto_vfsops.o auto_vnops.o auto_subr.o auto_xdr.o auto_sys.o
+
+CACHEFS_OBJS +=	cachefs_cnode.o		cachefs_cod.o \
+		cachefs_dir.o		cachefs_dlog.o	cachefs_filegrp.o \
+		cachefs_fscache.o	cachefs_ioctl.o	cachefs_log.o \
+		cachefs_module.o \
+		cachefs_noopc.o		cachefs_resource.o \
+		cachefs_strict.o \
+		cachefs_subr.o		cachefs_vfsops.o \
+		cachefs_vnops.o
+
+DCFS_OBJS +=	dc_vnops.o
+
+DEVFS_OBJS +=	devfs_subr.o	devfs_vfsops.o	devfs_vnops.o
+
+DEV_OBJS  +=	sdev_subr.o	sdev_vfsops.o	sdev_vnops.o	\
+		sdev_ptsops.o	sdev_zvolops.o	sdev_comm.o	\
+		sdev_profile.o	sdev_ncache.o	sdev_netops.o	\
+		sdev_ipnetops.o	\
+		sdev_vtops.o
+
+CTFS_OBJS +=	ctfs_all.o ctfs_cdir.o ctfs_ctl.o ctfs_event.o \
+		ctfs_latest.o ctfs_root.o ctfs_sym.o ctfs_tdir.o ctfs_tmpl.o
+
+OBJFS_OBJS +=	objfs_vfs.o	objfs_root.o	objfs_common.o \
+		objfs_odir.o	objfs_data.o
+
+FDFS_OBJS +=	fdops.o
+
+FIFO_OBJS +=	fifosubr.o	fifovnops.o
+
+PIPE_OBJS +=	pipe.o
+
+HSFS_OBJS +=	hsfs_node.o	hsfs_subr.o	hsfs_vfsops.o	hsfs_vnops.o \
+		hsfs_susp.o	hsfs_rrip.o	hsfs_susp_subr.o
+
+LOFS_OBJS +=	lofs_subr.o	lofs_vfsops.o	lofs_vnops.o
+
+NAMEFS_OBJS +=	namevfs.o	namevno.o
+
+NFS_OBJS +=	nfs_client.o	nfs_common.o	nfs_dump.o \
+		nfs_subr.o	nfs_vfsops.o	nfs_vnops.o \
+		nfs_xdr.o	nfs_sys.o	nfs_strerror.o \
+		nfs3_vfsops.o	nfs3_vnops.o	nfs3_xdr.o \
+		nfs_acl_vnops.o	nfs_acl_xdr.o	nfs4_vfsops.o \
+		nfs4_vnops.o	nfs4_xdr.o 	nfs4_idmap.o \
+		nfs4_shadow.o	nfs4_subr.o \
+		nfs4_attr.o	nfs4_rnode.o	nfs4_client.o \
+		nfs4_acache.o	nfs4_common.o	nfs4_client_state.o \
+		nfs4_callback.o	nfs4_recovery.o nfs4_client_secinfo.o \
+		nfs4_client_debug.o	nfs_stats.o \
+		nfs4_acl.o	nfs4_stub_vnops.o	nfs_cmd.o
+
+NFSSRV_OBJS +=	nfs_server.o	nfs_srv.o	nfs3_srv.o \
+		nfs_acl_srv.o	nfs_auth.o	nfs_auth_xdr.o \
+		nfs_export.o	nfs_log.o	nfs_log_xdr.o \
+		nfs4_srv.o	nfs4_state.o	nfs4_srv_attr.o \
+		nfs4_srv_ns.o	nfs4_db.o	nfs4_srv_deleg.o \
+		nfs4_deleg_ops.o nfs4_srv_readdir.o nfs4_dispatch.o
+
+SMBSRV_SHARED_OBJS += \
+		smb_inet.o \
+		smb_match.o \
+		smb_msgbuf.o \
+		smb_oem.o \
+		smb_string.o \
+		smb_utf8.o \
+		smb_door_legacy.o \
+		smb_xdr.o \
+		smb_token.o \
+		smb_token_xdr.o \
+		smb_sid.o \
+		smb_native.o \
+		smb_netbios_util.o
+
+SMBSRV_OBJS +=	$(SMBSRV_SHARED_OBJS)			\
+		smb_acl.o				\
+		smb_alloc.o				\
+		smb_close.o				\
+		smb_common_open.o			\
+		smb_common_transact.o			\
+		smb_create.o				\
+		smb_delete.o				\
+		smb_directory.o				\
+		smb_dispatch.o				\
+		smb_echo.o				\
+		smb_fem.o				\
+		smb_find.o				\
+		smb_flush.o				\
+		smb_fsinfo.o				\
+		smb_fsops.o				\
+		smb_init.o				\
+		smb_kdoor.o				\
+		smb_kshare.o				\
+                smb_kutil.o				\
+		smb_lock.o				\
+		smb_lock_byte_range.o			\
+		smb_locking_andx.o			\
+		smb_logoff_andx.o			\
+		smb_mangle_name.o			\
+		smb_mbuf_marshaling.o			\
+		smb_mbuf_util.o				\
+		smb_negotiate.o				\
+		smb_net.o				\
+		smb_node.o				\
+                smb_nt_cancel.o				\
+		smb_nt_create_andx.o			\
+                smb_nt_transact_create.o		\
+		smb_nt_transact_ioctl.o			\
+		smb_nt_transact_notify_change.o		\
+		smb_nt_transact_quota.o			\
+		smb_nt_transact_security.o		\
+                smb_odir.o				\
+		smb_ofile.o				\
+		smb_open_andx.o				\
+		smb_opipe.o				\
+		smb_oplock.o				\
+		smb_pathname.o				\
+		smb_print.o				\
+		smb_process_exit.o			\
+		smb_query_fileinfo.o			\
+		smb_read.o				\
+		smb_rename.o				\
+		smb_sd.o				\
+		smb_seek.o				\
+		smb_server.o				\
+		smb_session.o				\
+		smb_session_setup_andx.o		\
+		smb_set_fileinfo.o			\
+		smb_signing.o				\
+                smb_tree.o				\
+		smb_trans2_create_directory.o		\
+		smb_trans2_dfs.o			\
+		smb_trans2_find.o			\
+		smb_tree_connect.o			\
+		smb_unlock_byte_range.o			\
+		smb_user.o				\
+		smb_vfs.o				\
+		smb_vops.o				\
+		smb_vss.o				\
+		smb_write.o				\
+		smb_write_raw.o
+
+PCFS_OBJS +=	pc_alloc.o	pc_dir.o	pc_node.o	pc_subr.o \
+		pc_vfsops.o	pc_vnops.o
+
+PROC_OBJS +=	prcontrol.o	prioctl.o	prsubr.o	prusrio.o \
+		prvfsops.o	prvnops.o
+
+MNTFS_OBJS +=	mntvfsops.o	mntvnops.o
+
+SHAREFS_OBJS +=	sharetab.o	sharefs_vfsops.o	sharefs_vnops.o
+
+SPEC_OBJS +=	specsubr.o	specvfsops.o	specvnops.o
+
+SOCK_OBJS +=	socksubr.o	sockvfsops.o	sockparams.o	\
+		socksyscalls.o	socktpi.o	sockstr.o \
+		sockcommon_vnops.o	sockcommon_subr.o \
+		sockcommon_sops.o	sockcommon.o	\
+		sock_notsupp.o	socknotify.o \
+		nl7c.o		nl7curi.o	nl7chttp.o	nl7clogd.o \
+		nl7cnca.o	sodirect.o	sockfilter.o
+
+TMPFS_OBJS +=	tmp_dir.o	tmp_subr.o	tmp_tnode.o	tmp_vfsops.o \
+		tmp_vnops.o
+
+UDFS_OBJS +=	udf_alloc.o	udf_bmap.o	udf_dir.o	\
+		udf_inode.o	udf_subr.o	udf_vfsops.o	\
+		udf_vnops.o
+
+UFS_OBJS +=	ufs_alloc.o	ufs_bmap.o	ufs_dir.o 	ufs_xattr.o \
+		ufs_inode.o	ufs_subr.o	ufs_tables.o	ufs_vfsops.o \
+		ufs_vnops.o	quota.o		quotacalls.o	quota_ufs.o \
+		ufs_filio.o	ufs_lockfs.o	ufs_thread.o	ufs_trans.o \
+		ufs_acl.o	ufs_panic.o	ufs_directio.o	ufs_log.o \
+		ufs_extvnops.o	ufs_snap.o	lufs.o		lufs_thread.o \
+		lufs_log.o	lufs_map.o	lufs_top.o	lufs_debug.o
+VSCAN_OBJS +=	vscan_drv.o	vscan_svc.o vscan_door.o
+
+NSMB_OBJS +=	smb_conn.o	smb_dev.o	smb_iod.o	smb_pass.o \
+		smb_rq.o	smb_sign.o	smb_smb.o	smb_subrs.o \
+		smb_time.o	smb_tran.o	smb_trantcp.o	smb_usr.o \
+		subr_mchain.o
+
+SMBFS_COMMON_OBJS += smbfs_ntacl.o
+SMBFS_OBJS +=	smbfs_vfsops.o	smbfs_vnops.o	smbfs_node.o	\
+		smbfs_acl.o	smbfs_client.o	smbfs_smb.o	\
+		smbfs_subr.o	smbfs_subr2.o	\
+		smbfs_rwlock.o	smbfs_xattr.o	\
+		$(SMBFS_COMMON_OBJS)
+
+
+#
+#			LVM modules
+#
+MD_OBJS	+= md.o md_error.o md_ioctl.o md_mddb.o md_names.o \
+	md_med.o md_rename.o md_subr.o
+
+MD_COMMON_OBJS = md_convert.o md_crc.o md_revchk.o
+
+MD_DERIVED_OBJS = metamed_xdr.o meta_basic_xdr.o
+
+SOFTPART_OBJS += sp.o sp_ioctl.o
+
+STRIPE_OBJS += stripe.o stripe_ioctl.o
+
+HOTSPARES_OBJS += hotspares.o
+
+RAID_OBJS += raid.o raid_ioctl.o raid_replay.o raid_resync.o raid_hotspare.o
+
+MIRROR_OBJS += mirror.o mirror_ioctl.o mirror_resync.o
+
+NOTIFY_OBJS += md_notify.o
+
+TRANS_OBJS += mdtrans.o trans_ioctl.o trans_log.o
+
+ZFS_COMMON_OBJS +=		\
+	arc.o			\
+	blkptr.o		\
+	bplist.o		\
+	bpobj.o			\
+	bptree.o		\
+	dbuf.o			\
+	ddt.o			\
+	ddt_zap.o		\
+	dmu.o			\
+	dmu_diff.o		\
+	dmu_send.o		\
+	dmu_object.o		\
+	dmu_objset.o		\
+	dmu_traverse.o		\
+	dmu_tx.o		\
+	dnode.o			\
+	dnode_sync.o		\
+	dsl_bookmark.o		\
+	dsl_dir.o		\
+	dsl_dataset.o		\
+	dsl_deadlist.o		\
+	dsl_destroy.o		\
+	dsl_pool.o		\
+	dsl_synctask.o		\
+	dsl_userhold.o		\
+	dmu_zfetch.o		\
+	dsl_deleg.o		\
+	dsl_prop.o		\
+	dsl_scan.o		\
+	zfeature.o		\
+	gzip.o			\
+	lz4.o			\
+	lzjb.o			\
+	metaslab.o		\
+	range_tree.o		\
+	refcount.o		\
+	rrwlock.o		\
+	sa.o			\
+	sha256.o		\
+	spa.o			\
+	spa_config.o		\
+	spa_errlog.o		\
+	spa_history.o		\
+	spa_misc.o		\
+	space_map.o		\
+	space_reftree.o		\
+	txg.o			\
+	uberblock.o		\
+	unique.o		\
+	vdev.o			\
+	vdev_cache.o		\
+	vdev_file.o		\
+	vdev_label.o		\
+	vdev_mirror.o		\
+	vdev_missing.o		\
+	vdev_queue.o		\
+	vdev_raidz.o		\
+	vdev_root.o		\
+	zap.o			\
+	zap_leaf.o		\
+	zap_micro.o		\
+	zfs_byteswap.o		\
+	zfs_debug.o		\
+	zfs_fm.o		\
+	zfs_fuid.o		\
+	zfs_sa.o		\
+	zfs_znode.o		\
+	zil.o			\
+	zio.o			\
+	zio_checksum.o		\
+	zio_compress.o		\
+	zio_inject.o		\
+	zle.o			\
+	zrlock.o
+
+ZFS_SHARED_OBJS +=		\
+	zfeature_common.o	\
+	zfs_comutil.o		\
+	zfs_deleg.o		\
+	zfs_fletcher.o		\
+	zfs_namecheck.o		\
+	zfs_prop.o		\
+	zpool_prop.o		\
+	zprop_common.o
+
+ZFS_OBJS +=			\
+	$(ZFS_COMMON_OBJS)	\
+	$(ZFS_SHARED_OBJS)	\
+	vdev_disk.o		\
+	zfs_acl.o		\
+	zfs_ctldir.o		\
+	zfs_dir.o		\
+	zfs_ioctl.o		\
+	zfs_log.o		\
+	zfs_onexit.o		\
+	zfs_replay.o		\
+	zfs_rlock.o		\
+	zfs_vfsops.o		\
+	zfs_vnops.o		\
+	zvol.o
+
+ZUT_OBJS +=			\
+	zut.o
+
+#
+#			streams modules
+#
+BUFMOD_OBJS	+=	bufmod.o
+
+CONNLD_OBJS +=	connld.o
+
+DEDUMP_OBJS +=	dedump.o
+
+DRCOMPAT_OBJS +=	drcompat.o
+
+LDLINUX_OBJS +=	ldlinux.o
+
+LDTERM_OBJS +=	ldterm.o uwidth.o
+
+PCKT_OBJS +=	pckt.o
+
+PFMOD_OBJS +=	pfmod.o
+
+PTEM_OBJS +=	ptem.o
+
+REDIRMOD_OBJS += strredirm.o
+
+TIMOD_OBJS +=	timod.o
+
+TIRDWR_OBJS +=	tirdwr.o
+
+TTCOMPAT_OBJS +=ttcompat.o
+
+LOG_OBJS +=	log.o
+
+PIPEMOD_OBJS +=	pipemod.o
+
+RPCMOD_OBJS +=	rpcmod.o	clnt_cots.o	clnt_clts.o \
+		clnt_gen.o	clnt_perr.o	mt_rpcinit.o	rpc_calmsg.o \
+		rpc_prot.o	rpc_sztypes.o	rpc_subr.o	rpcb_prot.o \
+		svc.o		svc_clts.o	svc_gen.o	svc_cots.o \
+		rpcsys.o	xdr_sizeof.o	clnt_rdma.o	svc_rdma.o \
+		xdr_rdma.o	rdma_subr.o	xdrrdma_sizeof.o
+
+KLMMOD_OBJS +=	klmmod.o \
+		nlm_impl.o \
+		nlm_rpc_handle.o \
+		nlm_dispatch.o \
+		nlm_rpc_svc.o \
+		nlm_client.o \
+		nlm_service.o \
+		nlm_prot_clnt.o \
+		nlm_prot_xdr.o \
+		nlm_rpc_clnt.o \
+		nsm_addr_clnt.o \
+		nsm_addr_xdr.o \
+		sm_inter_clnt.o \
+		sm_inter_xdr.o
+
+KLMOPS_OBJS +=	klmops.o
+
+TLIMOD_OBJS +=	tlimod.o	t_kalloc.o	t_kbind.o	t_kclose.o \
+		t_kconnect.o	t_kfree.o	t_kgtstate.o	t_kopen.o \
+		t_krcvudat.o	t_ksndudat.o	t_kspoll.o	t_kunbind.o \
+		t_kutil.o
+
+RLMOD_OBJS += rlmod.o
+
+TELMOD_OBJS += telmod.o
+
+CRYPTMOD_OBJS += cryptmod.o
+
+KB_OBJS +=	kbd.o		keytables.o
+
+#
+#			ID mapping module
+#
+IDMAP_OBJS +=	idmap_mod.o	idmap_kapi.o	idmap_xdr.o	idmap_cache.o
+
+#
+#			scheduling class modules
+#
+SDC_OBJS +=		sysdc.o
+
+RT_OBJS +=		rt.o
+RT_DPTBL_OBJS +=	rt_dptbl.o
+
+TS_OBJS +=		ts.o
+TS_DPTBL_OBJS +=	ts_dptbl.o
+
+IA_OBJS +=		ia.o
+
+FSS_OBJS +=		fss.o
+
+FX_OBJS +=		fx.o
+FX_DPTBL_OBJS +=	fx_dptbl.o
+
+#
+#			Inter-Process Communication (IPC) modules
+#
+IPC_OBJS +=	ipc.o
+
+IPCMSG_OBJS +=	msg.o
+
+IPCSEM_OBJS +=	sem.o
+
+IPCSHM_OBJS +=	shm.o
+
+#
+#			bignum module
+#
+COMMON_BIGNUM_OBJS += bignum_mod.o bignumimpl.o
+
+BIGNUM_OBJS += $(COMMON_BIGNUM_OBJS) $(BIGNUM_PSR_OBJS)
+
+#
+#			kernel cryptographic framework
+#
+KCF_OBJS +=	kcf.o kcf_callprov.o kcf_cbufcall.o kcf_cipher.o kcf_crypto.o \
+		kcf_cryptoadm.o kcf_ctxops.o kcf_digest.o kcf_dual.o \
+		kcf_keys.o kcf_mac.o kcf_mech_tabs.o kcf_miscapi.o \
+		kcf_object.o kcf_policy.o kcf_prov_lib.o kcf_prov_tabs.o \
+		kcf_sched.o kcf_session.o kcf_sign.o kcf_spi.o kcf_verify.o \
+		kcf_random.o modes.o ecb.o cbc.o ctr.o ccm.o gcm.o \
+		fips_random.o
+
+CRYPTOADM_OBJS += cryptoadm.o
+
+CRYPTO_OBJS +=	crypto.o
+
+DPROV_OBJS +=	dprov.o
+
+DCA_OBJS +=	dca.o dca_3des.o dca_debug.o dca_dsa.o dca_kstat.o dca_rng.o \
+		dca_rsa.o
+
+AESPROV_OBJS +=	aes.o aes_impl.o aes_modes.o
+
+ARCFOURPROV_OBJS += arcfour.o arcfour_crypt.o
+
+BLOWFISHPROV_OBJS += blowfish.o blowfish_impl.o
+
+ECCPROV_OBJS += ecc.o ec.o ec2_163.o ec2_mont.o ecdecode.o ecl_mult.o \
+		ecp_384.o ecp_jac.o ec2_193.o ecl.o ecp_192.o ecp_521.o \
+		ecp_jm.o ec2_233.o ecl_curve.o ecp_224.o ecp_aff.o \
+		ecp_mont.o ec2_aff.o ec_naf.o ecl_gf.o ecp_256.o mp_gf2m.o \
+		mpi.o mplogic.o mpmontg.o mpprime.o oid.o \
+		secitem.o ec2_test.o ecp_test.o
+
+RSAPROV_OBJS += rsa.o rsa_impl.o pkcs1.o
+
+SWRANDPROV_OBJS += swrand.o
+
+#
+#			kernel SSL
+#
+KSSL_OBJS +=	kssl.o ksslioctl.o
+
+KSSL_SOCKFIL_MOD_OBJS += ksslfilter.o ksslapi.o ksslrec.o
+
+#
+#			misc. modules
+#
+
+C2AUDIT_OBJS +=	adr.o audit.o audit_event.o audit_io.o \
+		audit_path.o audit_start.o audit_syscalls.o audit_token.o \
+		audit_mem.o
+
+PCIC_OBJS +=	pcic.o
+
+RPCSEC_OBJS +=	secmod.o	sec_clnt.o	sec_svc.o	sec_gen.o \
+		auth_des.o	auth_kern.o	auth_none.o	auth_loopb.o\
+		authdesprt.o	authdesubr.o	authu_prot.o \
+		key_call.o	key_prot.o	svc_authu.o	svcauthdes.o
+
+RPCSEC_GSS_OBJS +=	rpcsec_gssmod.o rpcsec_gss.o rpcsec_gss_misc.o \
+		rpcsec_gss_utils.o svc_rpcsec_gss.o
+
+CONSCONFIG_OBJS += consconfig.o
+
+CONSCONFIG_DACF_OBJS  += consconfig_dacf.o consplat.o
+
+TEM_OBJS += tem.o tem_safe.o 6x10.o 7x14.o 12x22.o
+
+KBTRANS_OBJS +=				\
+		kbtrans.o		\
+		kbtrans_keytables.o	\
+		kbtrans_polled.o	\
+		kbtrans_streams.o	\
+		usb_keytables.o
+
+KGSSD_OBJS +=	gssd_clnt_stubs.o gssd_handle.o gssd_prot.o \
+		gss_display_name.o gss_release_name.o gss_import_name.o \
+		gss_release_buffer.o gss_release_oid_set.o gen_oids.o gssdmod.o
+
+KGSSD_DERIVED_OBJS = gssd_xdr.o
+
+KGSS_DUMMY_OBJS += dmech.o
+
+KSOCKET_OBJS +=	ksocket.o ksocket_mod.o
+
+CRYPTO= cksumtypes.o decrypt.o encrypt.o encrypt_length.o etypes.o \
+	nfold.o verify_checksum.o prng.o block_size.o make_checksum.o\
+	checksum_length.o hmac.o default_state.o mandatory_sumtype.o
+
+# crypto/des
+CRYPTO_DES= f_cbc.o f_cksum.o f_parity.o weak_key.o d3_cbc.o ef_crypto.o
+
+CRYPTO_DK= checksum.o derive.o dk_decrypt.o dk_encrypt.o
+
+CRYPTO_ARCFOUR= k5_arcfour.o
+
+# crypto/enc_provider
+CRYPTO_ENC= des.o des3.o arcfour_provider.o aes_provider.o
+
+# crypto/hash_provider
+CRYPTO_HASH= hash_kef_generic.o hash_kmd5.o hash_crc32.o hash_ksha1.o
+
+# crypto/keyhash_provider
+CRYPTO_KEYHASH= descbc.o k5_kmd5des.o k_hmac_md5.o
+
+# crypto/crc32
+CRYPTO_CRC32= crc32.o
+
+# crypto/old
+CRYPTO_OLD= old_decrypt.o old_encrypt.o
+
+# crypto/raw
+CRYPTO_RAW= raw_decrypt.o raw_encrypt.o
+
+K5_KRB= kfree.o copy_key.o \
+	parse.o init_ctx.o \
+	ser_adata.o ser_addr.o \
+	ser_auth.o ser_cksum.o \
+	ser_key.o ser_princ.o \
+	serialize.o unparse.o \
+	ser_actx.o
+
+K5_OS=  timeofday.o toffset.o \
+	init_os_ctx.o c_ustime.o
+
+SEAL=	seal.o unseal.o
+
+MECH=	delete_sec_context.o \
+	import_sec_context.o \
+	gssapi_krb5.o \
+	k5seal.o k5unseal.o k5sealv3.o \
+	ser_sctx.o \
+	sign.o \
+	util_crypt.o  \
+	util_validate.o  util_ordering.o  \
+	util_seqnum.o util_set.o util_seed.o \
+	wrap_size_limit.o verify.o
+
+
+
+MECH_GEN= util_token.o
+
+
+KGSS_KRB5_OBJS += krb5mech.o \
+	$(MECH) $(SEAL) $(MECH_GEN) \
+	$(CRYPTO) $(CRYPTO_DES) $(CRYPTO_DK) $(CRYPTO_ARCFOUR) \
+	$(CRYPTO_ENC) $(CRYPTO_HASH) \
+	$(CRYPTO_KEYHASH) $(CRYPTO_CRC32) \
+	$(CRYPTO_OLD) \
+	$(CRYPTO_RAW) $(K5_KRB) $(K5_OS)
+
+DES_OBJS +=	des_crypt.o des_impl.o des_ks.o des_soft.o
+
+DLBOOT_OBJS +=	bootparam_xdr.o nfs_dlinet.o scan.o
+
+KRTLD_OBJS +=	kobj_bootflags.o getoptstr.o \
+		kobj.o kobj_kdi.o kobj_lm.o kobj_subr.o
+
+MOD_OBJS +=	modctl.o modsubr.o modsysfile.o modconf.o modhash.o
+
+STRPLUMB_OBJS += strplumb.o
+
+CPR_OBJS +=	cpr_driver.o cpr_dump.o \
+		cpr_main.o cpr_misc.o cpr_mod.o cpr_stat.o \
+		cpr_uthread.o
+
+PROF_OBJS +=	prf.o
+
+SE_OBJS += se_driver.o
+
+SYSACCT_OBJS +=	acct.o
+
+ACCTCTL_OBJS +=	acctctl.o
+
+EXACCTSYS_OBJS += exacctsys.o
+
+KAIO_OBJS += aio.o
+
+PCMCIA_OBJS += pcmcia.o cs.o cis.o cis_callout.o cis_handlers.o cis_params.o
+
+BUSRA_OBJS += busra.o
+
+PCS_OBJS += pcs.o
+
+PSET_OBJS +=	pset.o
+
+OHCI_OBJS += ohci.o ohci_hub.o ohci_polled.o
+
+UHCI_OBJS += uhci.o uhciutil.o uhcitgt.o uhcihub.o uhcipolled.o
+
+EHCI_OBJS += ehci.o ehci_hub.o ehci_xfer.o ehci_intr.o ehci_util.o ehci_polled.o ehci_isoch.o ehci_isoch_util.o
+
+HUBD_OBJS += hubd.o
+
+USB_MID_OBJS += usb_mid.o
+
+USB_IA_OBJS += usb_ia.o
+
+UWBA_OBJS += uwba.o uwbai.o
+
+SCSA2USB_OBJS += scsa2usb.o usb_ms_bulkonly.o usb_ms_cbi.o
+
+HWAHC_OBJS += hwahc.o hwahc_util.o
+
+WUSB_DF_OBJS += wusb_df.o
+WUSB_FWMOD_OBJS += wusb_fwmod.o
+
+IPF_OBJS += ip_fil_solaris.o fil.o solaris.o ip_state.o ip_frag.o ip_nat.o \
+	    ip_proxy.o ip_auth.o ip_pool.o ip_htable.o ip_lookup.o \
+	    ip_log.o misc.o ip_compat.o ip_nat6.o drand48.o
+
+IPD_OBJS += ipd.o
+
+IBD_OBJS +=	ibd.o ibd_cm.o
+
+EIBNX_OBJS +=	enx_main.o enx_hdlrs.o enx_ibt.o enx_log.o enx_fip.o \
+		enx_misc.o enx_q.o enx_ctl.o
+
+EOIB_OBJS +=	eib_adm.o eib_chan.o eib_cmn.o eib_ctl.o eib_data.o \
+		eib_fip.o eib_ibt.o eib_log.o eib_mac.o eib_main.o \
+		eib_rsrc.o eib_svc.o eib_vnic.o
+
+DLPISTUB_OBJS += dlpistub.o
+
+SDP_OBJS +=	sdpddi.o
+
+TRILL_OBJS +=   trill.o
+
+CTF_OBJS += ctf_create.o ctf_decl.o ctf_error.o ctf_hash.o ctf_labels.o \
+	ctf_lookup.o ctf_open.o ctf_types.o ctf_util.o ctf_subr.o ctf_mod.o
+
+SMBIOS_OBJS += smb_error.o smb_info.o smb_open.o smb_subr.o smb_dev.o
+
+RPCIB_OBJS += rpcib.o
+
+KMDB_OBJS += kdrv.o
+
+AFE_OBJS += afe.o
+
+BGE_OBJS += bge_main2.o bge_chip2.o bge_kstats.o bge_log.o bge_ndd.o \
+		bge_atomic.o bge_mii.o bge_send.o bge_recv2.o bge_mii_5906.o
+
+DMFE_OBJS += dmfe_log.o dmfe_main.o dmfe_mii.o
+
+EFE_OBJS += efe.o
+
+ELXL_OBJS += elxl.o
+
+HME_OBJS += hme.o
+
+IXGB_OBJS += ixgb.o ixgb_atomic.o ixgb_chip.o ixgb_gld.o ixgb_kstats.o \
+		ixgb_log.o ixgb_ndd.o ixgb_rx.o ixgb_tx.o ixgb_xmii.o
+
+NGE_OBJS += nge_main.o nge_atomic.o nge_chip.o nge_ndd.o nge_kstats.o \
+		nge_log.o nge_rx.o nge_tx.o nge_xmii.o
+
+PCN_OBJS += pcn.o
+
+RGE_OBJS += rge_main.o rge_chip.o rge_ndd.o rge_kstats.o rge_log.o rge_rxtx.o
+
+URTW_OBJS += urtw.o
+
+ARN_OBJS += arn_hw.o arn_eeprom.o arn_mac.o arn_calib.o arn_ani.o arn_phy.o arn_regd.o arn_beacon.o \
+		arn_main.o arn_recv.o arn_xmit.o arn_rc.o
+
+ATH_OBJS += ath_aux.o ath_main.o ath_osdep.o ath_rate.o
+
+ATU_OBJS += atu.o
+
+IPW_OBJS += ipw2100_hw.o ipw2100.o
+
+IWI_OBJS += ipw2200_hw.o ipw2200.o
+
+IWH_OBJS += iwh.o
+
+IWK_OBJS += iwk2.o
+
+IWP_OBJS += iwp.o
+
+MWL_OBJS += mwl.o
+
+MWLFW_OBJS += mwlfw_mode.o
+
+WPI_OBJS += wpi.o
+
+RAL_OBJS += rt2560.o ral_rate.o
+
+RUM_OBJS += rum.o
+
+RWD_OBJS += rt2661.o
+
+RWN_OBJS += rt2860.o
+
+UATH_OBJS += uath.o
+
+UATHFW_OBJS += uathfw_mod.o
+
+URAL_OBJS += ural.o
+
+RTW_OBJS += rtw.o smc93cx6.o rtwphy.o rtwphyio.o
+
+ZYD_OBJS += zyd.o zyd_usb.o zyd_hw.o zyd_fw.o
+
+MXFE_OBJS += mxfe.o
+
+MPTSAS_OBJS += mptsas.o mptsas_hash.o mptsas_impl.o mptsas_init.o \
+		mptsas_raid.o mptsas_smhba.o
+
+SFE_OBJS += sfe.o sfe_util.o
+
+BFE_OBJS += bfe.o
+
+BRIDGE_OBJS += bridge.o
+
+IDM_SHARED_OBJS += base64.o
+
+IDM_OBJS +=	$(IDM_SHARED_OBJS) \
+		idm.o idm_impl.o idm_text.o idm_conn_sm.o idm_so.o
+
+VR_OBJS += vr.o
+
+ATGE_OBJS += atge_main.o atge_l1e.o atge_mii.o atge_l1.o atge_l1c.o
+
+YGE_OBJS = yge.o
+
+SKD_OBJS = skd.o
+
+#
+#	Build up defines and paths.
+#
+LINT_DEFS	+= -Dunix
+
+#
+#	This duality can be removed when the native and target compilers
+#	are the same (or at least recognize the same command line syntax!)
+#	It is a bug in the current compilation system that the assember
+#	can't process the -Y I, flag.
+#
+NATIVE_INC_PATH += $(INC_PATH) $(CCYFLAG)$(UTSBASE)/common
+AS_INC_PATH	+= $(INC_PATH) -I$(UTSBASE)/common
+INCLUDE_PATH    += $(INC_PATH) $(CCYFLAG)$(UTSBASE)/common
+
+PCIEB_OBJS += pcieb.o
+
+#	Chelsio N110 10G NIC driver module
+#
+CH_OBJS = ch.o glue.o pe.o sge.o
+
+CH_COM_OBJS =	ch_mac.o ch_subr.o cspi.o espi.o ixf1010.o mc3.o mc4.o mc5.o \
+		mv88e1xxx.o mv88x201x.o my3126.o pm3393.o tp.o ulp.o \
+		vsc7321.o vsc7326.o xpak.o
+
+#
+#	Chelsio Terminator 4 10G NIC nexus driver module
+#
+CXGBE_FW_OBJS  =	t4_fw.o t4_cfg.o
+CXGBE_COM_OBJS =	t4_hw.o common.o
+CXGBE_NEX_OBJS =	t4_nexus.o t4_sge.o t4_mac.o t4_ioctl.o shared.o \
+			t4_l2t.o adapter.o osdep.o
+
+#
+#	Chelsio Terminator 4 10G NIC driver module
+#
+CXGBE_OBJS =	cxgbe.o
+
+#
+#	PCI strings file
+#
+PCI_STRING_OBJS = pci_strings.o
+
+NET_DACF_OBJS += net_dacf.o
+
+#
+#	Xframe 10G NIC driver module
+#
+XGE_OBJS = xge.o xgell.o
+
+XGE_HAL_OBJS =  xgehal-channel.o xgehal-fifo.o xgehal-ring.o  xgehal-config.o \
+		xgehal-driver.o  xgehal-mm.o xgehal-stats.o  xgehal-device.o \
+		xge-queue.o  xgehal-mgmt.o xgehal-mgmtaux.o
+
+#
+#	e1000/igb common objs
+#
+#	Historically e1000g and igb had separate copies of all of the common
+#	code. At this time while they are now sharing the same copy of it, they
+#	are building it into their own modules which is due to the differences
+#	in the osdep and debug portions of their code.
+#
+E1000API_OBJS += e1000_80003es2lan.o e1000_82540.o e1000_82541.o e1000_82542.o \
+		e1000_82543.o e1000_82571.o e1000_api.o e1000_ich8lan.o \
+		e1000_mac.o e1000_manage.o e1000_nvm.o e1000_phy.o \
+		e1000_82575.o e1000_i210.o e1000_mbx.o e1000_vf.o
+
+#
+#	e1000g module
+#
+E1000G_OBJS +=	e1000g_debug.o e1000g_main.o e1000g_alloc.o \
+		e1000g_tx.o e1000g_rx.o e1000g_stat.o \
+		e1000g_osdep.o e1000g_workarounds.o
+		
+
+#
+#	Intel 82575 1G NIC driver module
+#
+IGB_OBJS =	igb_buf.o igb_debug.o igb_gld.o igb_log.o igb_main.o \
+		igb_rx.o igb_stat.o igb_tx.o igb_osdep.o
+
+#
+#	Intel Pro/100 NIC driver module
+#
+IPRB_OBJS =	iprb.o
+
+#
+#       Intel 10GbE PCIE NIC driver module
+#
+IXGBE_OBJS =    ixgbe_82598.o ixgbe_82599.o ixgbe_api.o		\
+                ixgbe_common.o ixgbe_phy.o			\
+                ixgbe_buf.o ixgbe_debug.o ixgbe_gld.o           \
+                ixgbe_log.o ixgbe_main.o 	                \
+                ixgbe_osdep.o ixgbe_rx.o ixgbe_stat.o           \
+                ixgbe_tx.o  ixgbe_x540.o ixgbe_mbx.o
+
+#
+#	NIU 10G/1G driver module
+#
+NXGE_OBJS =	nxge_mac.o nxge_ipp.o nxge_rxdma.o		\
+		nxge_txdma.o nxge_txc.o nxge_main.o		\
+		nxge_hw.o nxge_fzc.o nxge_virtual.o		\
+		nxge_send.o nxge_classify.o nxge_fflp.o		\
+		nxge_fflp_hash.o nxge_ndd.o nxge_kstats.o	\
+		nxge_zcp.o nxge_fm.o nxge_espc.o nxge_hv.o	\
+		nxge_hio.o nxge_hio_guest.o nxge_intr.o
+
+NXGE_NPI_OBJS =	\
+		npi.o npi_mac.o npi_ipp.o			\
+		npi_txdma.o npi_rxdma.o npi_txc.o		\
+		npi_zcp.o npi_espc.o npi_fflp.o			\
+		npi_vir.o
+
+NXGE_HCALL_OBJS =	\
+		nxge_hcall.o
+
+#
+# Virtio modules
+#
+
+# Virtio core
+VIRTIO_OBJS = virtio.o
+
+# Virtio block driver
+VIOBLK_OBJS = vioblk.o
+
+#
+#	kiconv modules
+#
+KICONV_EMEA_OBJS += kiconv_emea.o
+
+KICONV_JA_OBJS += kiconv_ja.o
+
+KICONV_KO_OBJS += kiconv_cck_common.o kiconv_ko.o
+
+KICONV_SC_OBJS += kiconv_cck_common.o kiconv_sc.o
+
+KICONV_TC_OBJS += kiconv_cck_common.o kiconv_tc.o
+
+#
+#	AAC module
+#
+AAC_OBJS = aac.o aac_ioctl.o
+
+#
+#	sdcard modules
+#
+SDA_OBJS =	sda_cmd.o sda_host.o sda_init.o sda_mem.o sda_mod.o sda_slot.o
+SDHOST_OBJS =	sdhost.o
+
+#
+#	hxge 10G driver module
+#
+HXGE_OBJS =	hxge_main.o hxge_vmac.o hxge_send.o		\
+		hxge_txdma.o hxge_rxdma.o hxge_virtual.o	\
+		hxge_fm.o hxge_fzc.o hxge_hw.o hxge_kstats.o	\
+		hxge_ndd.o hxge_pfc.o				\
+		hpi.o hpi_vmac.o hpi_rxdma.o hpi_txdma.o	\
+		hpi_vir.o hpi_pfc.o
+
+#
+#	MEGARAID_SAS module
+#
+MEGA_SAS_OBJS = megaraid_sas.o
+
+#
+#	MR_SAS module
+#
+MR_SAS_OBJS = ld_pd_map.o mr_sas.o mr_sas_tbolt.o mr_sas_list.o
+
+#
+#	CPQARY3 module
+#
+CPQARY3_OBJS =	cpqary3.o cpqary3_noe.o cpqary3_talk2ctlr.o	\
+		cpqary3_isr.o cpqary3_transport.o cpqary3_mem.o	\
+		cpqary3_scsi.o cpqary3_util.o cpqary3_ioctl.o	\
+		cpqary3_bd.o
+
+#
+#	ISCSI_INITIATOR module
+#
+ISCSI_INITIATOR_OBJS =	chap.o iscsi_io.o iscsi_thread.o	\
+			iscsi_ioctl.o iscsid.o iscsi.o		\
+			iscsi_login.o isns_client.o iscsiAuthClient.o	\
+			iscsi_lun.o iscsiAuthClientGlue.o	\
+			iscsi_net.o nvfile.o iscsi_cmd.o	\
+			iscsi_queue.o persistent.o iscsi_conn.o	\
+			iscsi_sess.o radius_auth.o iscsi_crc.o	\
+			iscsi_stats.o radius_packet.o iscsi_doorclt.o	\
+			iscsi_targetparam.o utils.o kifconf.o
+
+#
+#	ntxn 10Gb/1Gb NIC driver module
+#
+NTXN_OBJS =	unm_nic_init.o unm_gem.o unm_nic_hw.o unm_ndd.o	\
+			unm_nic_main.o unm_nic_isr.o unm_nic_ctx.o niu.o
+
+#
+#	Myricom 10Gb NIC driver module
+#
+MYRI10GE_OBJS =	myri10ge.o myri10ge_lro.o
+
+#	nulldriver module
+#
+NULLDRIVER_OBJS =	nulldriver.o
+
+TPM_OBJS =	tpm.o tpm_hcall.o
--- /dev/null	2014-11-12 17:44:39.000000000 +0100
+++ new/usr/src/uts/common/Makefile.files.rej	2014-11-12 17:44:39.559184996 +0100
@@ -0,0 +1,16 @@
+***************
+*** 24,29 ****
+  # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
+  # Copyright (c) 2013 by Delphix. All rights reserved.
+  # Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
+  #
+  
+  #
+--- 24,30 ----
+  # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
+  # Copyright (c) 2013 by Delphix. All rights reserved.
+  # Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
++ # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+  #
+  
+  #
--- old/usr/src/uts/common/Makefile.rules	2014-11-12 17:44:39.624304677 +0100
+++ new/usr/src/uts/common/Makefile.rules	2014-11-12 17:44:39.629432031 +0100
@@ -666,10 +666,6 @@
 	$(COMPILE.c) -o $@ $<
 	$(CTFCONVERT_O)
 
-$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cardbus/%.c
-	$(COMPILE.c) -o $@ $<
-	$(CTFCONVERT_O)
-
 $(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/stmf/%.c
 	$(COMPILE.c) -o $@ $<
 	$(CTFCONVERT_O)
@@ -1489,22 +1485,6 @@
 	$(COMPILE.c) -o $@ $<
 	$(CTFCONVERT_O)
 
-$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/cis/%.c
-	$(COMPILE.c) -o $@ $<
-	$(CTFCONVERT_O)
-
-$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/cs/%.c
-	$(COMPILE.c) -o $@ $<
-	$(CTFCONVERT_O)
-
-$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/nexus/%.c
-	$(COMPILE.c) -o $@ $<
-	$(CTFCONVERT_O)
-
-$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/pcs/%.c
-	$(COMPILE.c) -o $@ $<
-	$(CTFCONVERT_O)
-
 $(OBJS_DIR)/%.o:		$(UTSBASE)/common/rpc/%.c
 	$(COMPILE.c) -o $@ $<
 	$(CTFCONVERT_O)
@@ -2034,9 +2014,6 @@
 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/blkdev/%.c
 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
 
-$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cardbus/%.c
-	@($(LHEAD) $(LINT.c) $< $(LTAIL))
-
 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/lu/stmf_sbd/%.c
 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
 
@@ -2622,18 +2599,6 @@
 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/%.c
 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
 
-$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/cs/%.c
-	@($(LHEAD) $(LINT.c) $< $(LTAIL))
-
-$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/cis/%.c
-	@($(LHEAD) $(LINT.c) $< $(LTAIL))
-
-$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/nexus/%.c
-	@($(LHEAD) $(LINT.c) $< $(LTAIL))
-
-$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/pcs/%.c
-	@($(LHEAD) $(LINT.c) $< $(LTAIL))
-
 $(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/%.c
 	@($(LHEAD) $(LINT.c) $< $(LTAIL))
 
--- /dev/null	2014-11-12 17:44:39.000000000 +0100
+++ new/usr/src/uts/common/Makefile.rules.orig	2014-11-12 17:44:39.876363164 +0100
@@ -0,0 +1,2714 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2013 Garrett D'Amore <garrett@damore.org>
+# Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+#
+
+#
+# uts/common/Makefile.rules
+#
+#	This Makefile defines all the file build rules for the directory
+# uts/common and its children. These are the source files which may
+# be considered common to all SunOS systems.
+#
+#	The following two-level ordering must be maintained in this file.
+#	  Lines are sorted first in order of decreasing specificity based on
+#	  the first directory component.  That is, sun4u rules come before
+#	  sparc rules come before common rules.
+#
+#	  Lines whose initial directory components are equal are sorted
+#	  alphabetically by the remaining components.
+
+#
+#	Section 1a: C objects build rules
+#
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/aes/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/arcfour/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/blowfish/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/ecc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/modes/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/padding/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/rng/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/rsa/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/bignum/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/bignum/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/mpi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o: 		$(COMMONBASE)/acl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/avl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/ucode/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/brand/sn1/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/brand/solaris10/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/c2/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/conf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/contract/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/cpr/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ctf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/ctf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/des/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/smbios/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/des/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/crypto/api/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/crypto/core/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/crypto/io/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/crypto/spi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/pci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/devid/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/disp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/dtrace/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/exacct/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/exec/aout/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/exec/elf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/exec/intp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/exec/shbin/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/exec/java/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/autofs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/cachefs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/dcfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/devfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/ctfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/doorfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/dev/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/fd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/fifofs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/hsfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/lofs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/mntfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/namefs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/nfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/smbsrv/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/smbsrv/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/objfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/pcfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/portfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/proc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/sharefs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/smbclnt/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/smbclnt/netsmb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/smbclnt/smbfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/sockfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/specfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/swapfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/tmpfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/udfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/ufs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/vscan/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/zfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/fs/zut/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/xattr/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/zfs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:	$(UTSBASE)/common/io/scsi/adapters/pmcs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:	$(UTSBASE)/common/io/scsi/adapters/pmcs/%.bin
+	$(COMPILE.b) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/fsreparse/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+KMECHKRB5_BASE=$(UTSBASE)/common/gssapi/mechs/krb5
+
+KGSSDFLAGS=-I $(UTSBASE)/common/gssapi/include 
+
+# Note, KRB5_DEFS can be assigned various preprocessor flags,
+# typically -D defines on the make invocation.  The standard compiler
+# flags will not be overwritten.
+KGSSDFLAGS += $(KRB5_DEFS)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/gssapi/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/gssapi/mechs/dummy/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/des/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/arcfour/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/dk/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/enc_provider/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/hash_provider/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/keyhash_provider/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/raw/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/crypto/old/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/krb5/krb/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/krb5/os/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/ser_sctx.o := CPPFLAGS += -DPROVIDE_KERNEL_IMPORT=1
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/mech/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(KMECHKRB5_BASE)/profile/%.c
+	$(COMPILE.c) $(KGSSDFLAGS) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ncall/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/dsw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/nsctl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/rdc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/sdbc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/solaris/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/sv/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/avs/ns/unistat/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/idmap/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/arp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/ip/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/ipnet/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/inet/iptun/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/kssl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/sctp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/tcp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/ilb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/ipf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/ipd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/net/patricia/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/udp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/nca/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/sockmods/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/inet/dlpistub/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/1394/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/1394/adapters/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/1394/targets/av1394/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/1394/targets/dcam1394/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/1394/targets/scsa1394/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sbp2/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/aac/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/afe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/atge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/arn/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:               $(UTSBASE)/common/io/ath/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:               $(UTSBASE)/common/io/atu/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/impl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/ac97/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audioens/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audioemu10k/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audio1575/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audio810/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiocmi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiocmihd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiohd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audioixp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiols/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiopci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiop16x/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiosolo/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiots/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiovia823x/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/audio/drv/audiovia97/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/bfe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/bge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/blkdev/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/bpf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cardbus/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/stmf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/fct/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/qlt/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/srpt/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/fcoet/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/iscsit/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/iscsit/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/port/pppt/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/comstar/lu/stmf_sbd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cpqary3/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/dld/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/dls/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/dmfe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/drm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/efe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/elxl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fcoe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/hme/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pciex/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/hotplug/hpcsvc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pciex/hotplug/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/hotplug/pcihp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/rds/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/rdsv3/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/iser/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/ibd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/eoib/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/of/sol_ofs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/of/sol_ucma/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/of/sol_umad/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/of/sol_uverbs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/sdp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/mgt/ibcm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/mgt/ibdm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/mgt/ibdma/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/mgt/ibmf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/ibnex/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/ibtl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/adapters/tavor/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/adapters/hermon/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ib/clients/daplt/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/iscsi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/idm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/ipw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/iwh/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/iwi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/iwk/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/iwp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/kb8042/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/kbtrans/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ksocket/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/aggr/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/hotspares/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/md/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/mirror/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/notify/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/raid/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/softpart/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/stripe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/lvm/trans/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mac/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mac/plugins/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mega_sas/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mii/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mr_sas/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/mpt_sas/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mxfe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mwl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/mwl/mwl_fw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/net80211/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/nge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/nxge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/nxge/npi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/nxge/%.s
+	$(COMPILE.s) -o $@ $<
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pci-ide/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/pcn/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ppp/sppp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ppp/spppasyn/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ppp/sppptun/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ral/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rtls/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rsm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rtw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rum/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rwd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/rwn/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sata/adapters/ahci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sata/adapters/nv_sata/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sata/adapters/si3124/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sata/impl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/conf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/impl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/targets/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/blk2scsa/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/scsi_vhci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/scsi_vhci/fops/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/ulp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/impl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/fca/qlc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/fca/qlge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/fca/emlxs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/fca/oce/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/fibre-channel/fca/fcoei/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sdcard/adapters/sdhost/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sdcard/impl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sdcard/targets/sdcard/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/sfe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/simnet/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/softmac/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/uath/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/uath/uath_fw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/ural/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/urtw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/audio/usb_ac/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/audio/usb_as/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/audio/usb_ah/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbskel/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/video/usbvc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/hwarc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/hid/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/hidparser/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/printer/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbkbm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbms/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbinput/usbwcm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/ugen/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbser/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbser/usbsacm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbser/usbftdi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbser/usbser_keyspan/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbser/usbsprl/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/wusb_df/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/hwa1480_fw/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/wusb_ca/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/clients/usbecm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/hcd/openhci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/hcd/ehci/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/hcd/uhci/%.c
+	$(COMPILE.c) -I../../common -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/hubd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/scsa2usb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/usb_mid/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/usb_ia/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/usba/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/usba10/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/usb/hwa/hwahc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/uwb/uwba/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/vuidmice/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/vnic/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/wpi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/io/zyd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/chxge/com/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/chxge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cxgbe/common/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cxgbe/shared/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cxgbe/firmware/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cxgbe/t4nex/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/cxgbe/cxgbe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ixgb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/xge/drv/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/xge/hal/xgehal/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/e1000api/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/e1000g/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/igb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/iprb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ixgbe/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/ntxn/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/myri10ge/drv/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/ipgpc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/dlcosmk/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/flowacct/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/dscpmk/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ipp/meters/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kiconv/kiconv_emea/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kiconv/kiconv_ja/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kiconv/kiconv_ko/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kiconv/kiconv_sc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kiconv/kiconv_tc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/klm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/kmdb/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/ktli/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/scsi/adapters/iscsi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/iscsi/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:                $(UTSBASE)/common/inet/kifconf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/vr/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/yge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/skd/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/virtio/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/vioblk/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+#
+# krtld must refer to its own bzero/bcopy until the kernel is fully linked
+#
+$(OBJS_DIR)/bootrd.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/doreloc.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_boot.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_bootflags.o	:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_convrelstr.o	:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_isa.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_kdi.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_lm.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_reloc.o	:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_stubs.o	:= CPPFLAGS += -DKOBJ_OVERRIDES
+$(OBJS_DIR)/kobj_subr.o		:= CPPFLAGS += -DKOBJ_OVERRIDES
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/krtld/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/list/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/lvm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/lzma/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/md4/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/md5/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/net/dhcp/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/nvpair/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/os/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/cis/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/cs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/nexus/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/pcmcia/pcs/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/rpc/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/rpc/sec/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/rpc/sec_gss/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/sha1/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/crypto/sha2/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/syscall/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/tnf/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/tsol/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/util/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(COMMONBASE)/unicode/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/vm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/zmod/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/zlib_obj.o:		$(ZLIB_OBJS:%=$(OBJS_DIR)/%)
+	$(LD) -r -Breduce -M$(UTSBASE)/common/zmod/mapfile -o $@ \
+	    $(ZLIB_OBJS:%=$(OBJS_DIR)/%)
+	$(CTFMERGE) -t -f -L VERSION -o $@ $(ZLIB_OBJS:%=$(OBJS_DIR)/%)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/hxge/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/tpm/%.c
+	$(COMPILE.c) -o $@ $<
+	$(CTFCONVERT_O)
+
+$(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/tpm/%.s
+	$(COMPILE.s) -o $@ $<
+
+$(OBJS_DIR)/bz2%.o:		$(COMMONBASE)/bzip2/%.c
+	$(COMPILE.c) -o $@ -I$(COMMONBASE)/bzip2 $<
+	$(CTFCONVERT_O)
+
+BZ2LINT = -erroff=%all -I$(UTSBASE)/common/bzip2
+
+$(LINTS_DIR)/bz2%.ln:		$(COMMONBASE)/bzip2/%.c
+	 @($(LHEAD) $(LINT.c) -C $(LINTS_DIR)/`basename $@ .ln` $(BZ2LINT) $< $(LTAIL))
+
+#
+#	Section 1b:	Lint `objects'
+#
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/aes/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/arcfour/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/blowfish/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/ecc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/modes/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/padding/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/rng/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/rsa/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/bignum/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/bignum/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/mpi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/acl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/avl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/ucode/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/brand/sn1/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/brand/solaris10/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/c2/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/conf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/contract/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/cpr/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ctf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/ctf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/pci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/devid/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/des/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/smbios/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ncall/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/dsw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/nsctl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/rdc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/sdbc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/solaris/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/sv/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/avs/ns/unistat/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/des/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/crypto/api/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/crypto/core/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/crypto/io/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/crypto/spi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/disp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/dtrace/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/exacct/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/exec/aout/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/exec/elf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/exec/intp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/exec/shbin/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/exec/java/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/autofs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/cachefs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/ctfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/doorfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/dcfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/devfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/dev/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/fd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/fifofs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/hsfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/lofs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/mntfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/namefs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/smbsrv/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/smbsrv/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/nfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/objfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/pcfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/portfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/proc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/sharefs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/smbclnt/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/smbclnt/netsmb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/smbclnt/smbfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/sockfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/specfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/swapfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/tmpfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/udfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/ufs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/ufs_log/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/vscan/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/zfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/fs/zut/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/xattr/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/zfs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/gssapi/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/gssapi/mechs/dummy/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/des/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/dk/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/os/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/arcfour/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/enc_provider/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/hash_provider/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/keyhash_provider/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/raw/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/crypto/old/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/krb5/krb/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/krb5/os/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(KMECHKRB5_BASE)/mech/%.c
+	@($(LHEAD) $(LINT.c) $(KGSSDFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/idmap/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/sockmods/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/arp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/ip/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/ipnet/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln: 	     	$(UTSBASE)/common/inet/iptun/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/ipd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/ipf/%.c
+	@($(LHEAD) $(LINT.c) $(IPFFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/kssl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/net/patricia/%.c
+	@($(LHEAD) $(LINT.c) $(IPFFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/udp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/sctp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/tcp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/ilb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/nca/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/dlpistub/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/1394/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/1394/adapters/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/1394/targets/av1394/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/1394/targets/dcam1394/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/1394/targets/scsa1394/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sbp2/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/aac/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/afe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/atge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/arn/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/ath/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/atu/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/impl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/ac97/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audio1575/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audio810/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiocmi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiocmihd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audioens/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audioemu10k/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiohd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audioixp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiols/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiopci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiop16x/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiosolo/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiots/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiovia823x/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/audio/drv/audiovia97/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/bfe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/bpf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/bge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/blkdev/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cardbus/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/lu/stmf_sbd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/fct/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/qlt/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/srpt/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/iscsit/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/fcoet/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/iscsit/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/port/pppt/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/comstar/stmf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cpqary3/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/dld/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/dls/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/dmfe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/drm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/efe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/elxl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fcoe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/hme/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/pciex/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/hotplug/hpcsvc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/pciex/hotplug/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/hotplug/pcihp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/rds/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/rdsv3/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/iser/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/ibd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/eoib/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/of/sol_ofs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/of/sol_ucma/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/of/sol_umad/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/of/sol_uverbs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/sdp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/mgt/ibcm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/mgt/ibdm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/mgt/ibdma/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/mgt/ibmf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/ibnex/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/ibtl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/adapters/tavor/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/adapters/hermon/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ib/clients/daplt/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(COMMONBASE)/iscsi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/idm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/ipw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/iwh/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/iwi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/iwk/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/iwp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/kb8042/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/kbtrans/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ksocket/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/aggr/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/hotspares/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/md/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/mirror/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/raid/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/softpart/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/stripe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/notify/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/lvm/trans/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mac/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mac/plugins/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mega_sas/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mii/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mr_sas/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/mpt_sas/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mxfe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mwl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/mwl/mwl_fw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/net80211/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/nge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/nxge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/nxge/%.s
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/nxge/npi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/pci-ide/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/pcn/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ppp/sppp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ppp/spppasyn/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ppp/sppptun/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ral/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rtls/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rsm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rtw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rum/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rwd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/rwn/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sata/adapters/ahci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sata/adapters/nv_sata/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sata/adapters/si3124/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sata/impl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/blk2scsa/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/pmcs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/scsi_vhci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/scsi_vhci/fops/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/ulp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/impl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/fca/qlc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/fca/qlge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/fca/emlxs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/fca/oce/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/fibre-channel/fca/fcoei/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/conf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/impl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/targets/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sdcard/adapters/sdhost/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sdcard/impl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/sdcard/targets/sdcard/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/sfe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/simnet/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/softmac/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/uath/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/uath/uath_fw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/ural/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/urtw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/audio/usb_ac/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/audio/usb_as/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/audio/usb_ah/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbskel/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/video/usbvc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/hwarc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/hid/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/hidparser/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbkbm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbms/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbinput/usbwcm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/ugen/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/printer/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbser/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbser/usbsacm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbser/usbftdi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbser/usbser_keyspan/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbser/usbsprl/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/wusb_df/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/hwa1480_fw/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/wusb_ca/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/clients/usbecm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/hcd/openhci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/hcd/ehci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/hcd/uhci/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/hubd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/scsa2usb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/usb_mid/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/usb_ia/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/usba/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/usba10/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/uwb/uwba/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/usb/hwa/hwahc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/vuidmice/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/vnic/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/wpi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:              $(UTSBASE)/common/io/zyd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/chxge/com/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/chxge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cxgbe/common/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cxgbe/shared/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cxgbe/firmware/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cxgbe/t4nex/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/cxgbe/cxgbe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ixgb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/xge/drv/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/xge/hal/xgehal/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/e1000g/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/e1000api/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/igb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/iprb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ixgbe/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/ntxn/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/myri10ge/drv/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/ipgpc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/dlcosmk/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/flowacct/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/dscpmk/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ipp/meters/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kiconv/kiconv_emea/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kiconv/kiconv_ja/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kiconv/kiconv_ko/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kiconv/kiconv_sc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kiconv/kiconv_tc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/klm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/kmdb/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/krtld/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/ktli/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/list/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/lvm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/lzma/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/md4/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/md5/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/net/dhcp/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/nvpair/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/os/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/cs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/cis/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/nexus/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/pcmcia/pcs/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/sec/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/rpc/sec_gss/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/sha1/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/crypto/sha2/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/syscall/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/tnf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/tsol/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/util/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/unicode/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/vm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/scsi/adapters/iscsi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/iscsi/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/inet/kifconf/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/virtio/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/vioblk/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+ZMODLINTFLAGS = -erroff=E_CONSTANT_CONDITION
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/zmod/%.c
+	@($(LHEAD) $(LINT.c) $(ZMODLINTFLAGS) $< $(LTAIL))
+
+$(LINTS_DIR)/zlib_obj.ln:	$(ZLIB_OBJS:%.o=$(LINTS_DIR)/%.ln) \
+				$(UTSBASE)/common/zmod/zlib_lint.c
+	@($(LHEAD) $(LINT.c) -C $(LINTS_DIR)/zlib_obj \
+	    $(UTSBASE)/common/zmod/zlib_lint.c $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/hxge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/tpm/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/tpm/%.s
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/vr/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/yge/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(UTSBASE)/common/io/skd/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
+
+$(LINTS_DIR)/%.ln:		$(COMMONBASE)/fsreparse/%.c
+	@($(LHEAD) $(LINT.c) $< $(LTAIL))
--- /dev/null	2014-11-12 17:44:39.000000000 +0100
+++ new/usr/src/uts/common/Makefile.rules.rej	2014-11-12 17:44:39.975124346 +0100
@@ -0,0 +1,17 @@
+***************
+*** 22,28 ****
+  #
+  # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+  # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
+- # Copyright 2013 Garrett D'Amore <garrett@damore.org>
+  #
+  
+  #
+--- 22,28 ----
+  #
+  # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+  # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
++ # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+  #
+  
+  #
--- old/usr/src/uts/common/io/cardbus/cardbus.c	2014-11-12 17:44:40.040962238 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,2529 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- * From "@(#)pcicfg.c   1.31    99/06/18 SMI"
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * Cardbus module
- */
-
-#include <sys/conf.h>
-#include <sys/modctl.h>
-
-#include <sys/pci.h>
-
-#include <sys/ddi.h>
-#include <sys/sunndi.h>
-#include <sys/ddi_impldefs.h>
-
-#include <sys/hotplug/hpcsvc.h>
-
-#include <sys/pctypes.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-#include <sys/note.h>
-
-#include <sys/pci/pci_types.h>
-#include <sys/pci/pci_sc.h>
-
-#include <sys/pcic_reg.h>
-#include <sys/pcic_var.h>
-#include <sys/pcmcia.h>
-
-#ifdef sparc
-#include <sys/ddi_subrdefs.h>
-#elif defined(__x86) || defined(__amd64)
-#include <sys/pci_intr_lib.h>
-#include <sys/mach_intr.h>
-#endif
-
-#include "cardbus.h"
-#include "cardbus_parse.h"
-#include "cardbus_hp.h"
-#include "cardbus_cfg.h"
-
-static int cardbus_command_default = PCI_COMM_SERR_ENABLE |
-				PCI_COMM_WAIT_CYC_ENAB |
-				PCI_COMM_PARITY_DETECT |
-				PCI_COMM_ME | PCI_COMM_MAE |
-				PCI_COMM_IO;
-
-static int cardbus_next_instance = 0;
-static int cardbus_count = 0;
-int number_of_cardbus_cards = 0;
-
-static int cardbus_bus_map(dev_info_t *dip, dev_info_t *rdip,
-		ddi_map_req_t *mp, off_t offset, off_t len, caddr_t *vaddrp);
-static void pcirp2rp(const pci_regspec_t *pci_rp, struct regspec *rp);
-
-static int cardbus_ctlops(dev_info_t *, dev_info_t *,
-			ddi_ctl_enum_t, void *arg, void *);
-static void cardbus_init_child_regs(dev_info_t *child);
-static int cardbus_initchild(dev_info_t *, dev_info_t *,
-			dev_info_t *, void *);
-static int cardbus_name_child(dev_info_t *, char *, int);
-static void cardbus_removechild(dev_info_t *dip);
-
-static int cardbus_dma_allochdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_attr_t *attr, int (*waitfp)(caddr_t), caddr_t arg,
-		ddi_dma_handle_t *handlep);
-static int cardbus_dma_freehdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle);
-static int cardbus_dma_bindhdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, struct ddi_dma_req *dmareq,
-		ddi_dma_cookie_t *cp, uint_t *ccountp);
-static int cardbus_dma_unbindhdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle);
-static int cardbus_dma_flush(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, off_t off, size_t len,
-		uint_t cache_flags);
-static int cardbus_dma_win(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, uint_t win, off_t *offp,
-		size_t *lenp, ddi_dma_cookie_t *cookiep, uint_t *ccountp);
-static int cardbus_dma_map(dev_info_t *dip, dev_info_t *rdip,
-		struct ddi_dma_req *dmareqp, ddi_dma_handle_t *handlep);
-
-static int cardbus_prop_op(dev_t dev, dev_info_t *dip, dev_info_t *ch_dip,
-		ddi_prop_op_t prop_op, int mod_flags,
-		char *name, caddr_t valuep, int *lengthp);
-
-static int cardbus_get_eventcookie(dev_info_t *dip, dev_info_t *rdip,
-		char *eventname, ddi_eventcookie_t *cookiep);
-static int cardbus_add_eventcall(dev_info_t *dip, dev_info_t *rdip,
-		ddi_eventcookie_t cookie, void (*callback)(dev_info_t *dip,
-		ddi_eventcookie_t cookie, void *arg, void *bus_impldata),
-		void *arg, ddi_callback_id_t *cb_id);
-static int cardbus_remove_eventcall(dev_info_t *dip, ddi_callback_id_t cb_id);
-static int cardbus_post_event(dev_info_t *dip, dev_info_t *rdip,
-		ddi_eventcookie_t cookie, void *bus_impldata);
-
-static int cardbus_intr_ops(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_op_t intr_op,
-		ddi_intr_handle_impl_t *hdlp, void *result);
-
-static int check_token(char *token, int *len);
-static char *find_token(char **cp, int *l, char *endc);
-static int parse_token(char *token);
-static int token_to_hex(char *token, unsigned *val, int len);
-static int token_to_dec(char *token, unsigned *val, int len);
-static void cardbus_add_prop(struct cb_deviceset_props *cdsp, int type,
-		char *name, caddr_t vp, int len);
-static void cardbus_add_stringprop(struct cb_deviceset_props *cdsp,
-		char *name, char *vp, int len);
-static void cardbus_prop_free(ddi_prop_t *propp);
-static void cardbus_devprops_free(struct cb_deviceset_props *cbdp);
-static int cardbus_parse_devprop(cbus_t *cbp, char *cp);
-static void cardbus_device_props(cbus_t *cbp);
-
-static void cardbus_expand_busrange(dev_info_t *dip);
-
-static int cardbus_convert_properties(dev_info_t *dip);
-static void cardbus_revert_properties(dev_info_t *dip);
-
-/*
- * driver global data
- */
-kmutex_t cardbus_list_mutex; /* Protects the probe handle list */
-void *cardbus_state;
-int cardbus_latency_timer = 0x40;
-int cardbus_debug = 0;
-
-/*
- * Module linkage information for the kernel.
- */
-extern struct mod_ops mod_miscops;
-static struct modlmisc modlmisc = {
-	&mod_miscops,
-	"Cardbus Configurator support",
-};
-
-static struct modlinkage modlinkage = {
-	MODREV_1,
-	&modlmisc,
-	NULL
-};
-
-int
-_init(void)
-{
-	int error;
-
-	error =  ddi_soft_state_init(&cardbus_state, sizeof (cbus_t), 0);
-	if (error != 0)
-		return (error);
-
-	mutex_init(&cardbus_list_mutex, NULL, MUTEX_DRIVER, NULL);
-	if ((error = mod_install(&modlinkage)) != 0) {
-		mutex_destroy(&cardbus_list_mutex);
-	}
-
-	return (error);
-}
-
-int
-_fini(void)
-{
-	int error;
-	if ((error = mod_remove(&modlinkage)) == 0) {
-		mutex_destroy(&cardbus_list_mutex);
-		ddi_soft_state_fini(&cardbus_state);
-	}
-	return (error);
-}
-
-int
-_info(struct modinfo *modinfop)
-{
-	return (mod_info(&modlinkage, modinfop));
-}
-
-static
-struct bus_ops cardbusbus_ops = {
-	BUSO_REV,
-	cardbus_bus_map,
-	NULL,
-	NULL,
-	NULL,
-	i_ddi_map_fault,
-	cardbus_dma_map,
-	cardbus_dma_allochdl,
-	cardbus_dma_freehdl,
-	cardbus_dma_bindhdl,
-	cardbus_dma_unbindhdl,
-	cardbus_dma_flush,
-	cardbus_dma_win,
-	ddi_dma_mctl,
-	cardbus_ctlops,			/* (*bus_ctl)();		*/
-	cardbus_prop_op,
-	cardbus_get_eventcookie,	/* (*bus_get_eventcookie)();	*/
-	cardbus_add_eventcall,		/* (*bus_add_eventcall)();	*/
-	cardbus_remove_eventcall,	/* (*bus_remove_eventcall)();	*/
-	cardbus_post_event,		/* (*bus_post_event)();		*/
-	NULL,				/* (*bus_intr_ctl)();		*/
-	NULL,				/* (*bus_config)();		*/
-	NULL,				/* (*bus_unconfig)();		*/
-	NULL,				/* (*bus_fm_init)();		*/
-	NULL,				/* (*bus_fm_fini)();		*/
-	NULL,				/* (*bus_enter)();		*/
-	NULL,				/* (*bus_exit)();		*/
-	NULL,				/* (*bus_power)();		*/
-	cardbus_intr_ops		/* (*bus_intr_op)();		*/
-};
-
-#define	CB_EVENT_TAG_INSERT	0
-#define	CB_EVENT_TAG_REMOVE	1
-
-static ndi_event_definition_t cb_ndi_event_defs[] = {
-	{ CB_EVENT_TAG_INSERT, DDI_DEVI_INSERT_EVENT, EPL_INTERRUPT, 0 },
-	{ CB_EVENT_TAG_REMOVE, DDI_DEVI_REMOVE_EVENT, EPL_INTERRUPT, 0 }
-};
-
-#define	CB_N_NDI_EVENTS \
-	(sizeof (cb_ndi_event_defs) / sizeof (cb_ndi_event_defs[0]))
-
-#ifdef sparc
-struct busnum_ctrl {
-	int	rv;
-	dev_info_t *dip;
-	cardbus_bus_range_t *range;
-};
-
-static int
-cardbus_claim_pci_busnum(dev_info_t *dip, void *arg)
-{
-	cardbus_bus_range_t pci_bus_range;
-	struct busnum_ctrl *ctrl;
-	ndi_ra_request_t req;
-	char bus_type[16] = "(unknown)";
-	int len;
-	uint64_t base;
-	uint64_t retlen;
-
-	ctrl = (struct busnum_ctrl *)arg;
-
-	/* check if this is a PCI bus node */
-	len = sizeof (bus_type);
-	if (ddi_prop_op(DDI_DEV_T_ANY, dip, PROP_LEN_AND_VAL_BUF,
-	    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-	    "device_type",
-	    (caddr_t)&bus_type, &len) != DDI_SUCCESS)
-		return (0);	/* (DDI_WALK_PRUNECHILD); */
-
-	if ((strcmp(bus_type, "pci") != 0) &&
-	    (strcmp(bus_type, "pciex") != 0)) /* it is not a pci bus type */
-		return (0);	/* (DDI_WALK_PRUNECHILD); */
-
-	/* look for the bus-range property */
-	len = sizeof (struct cardbus_bus_range);
-	if (ddi_getlongprop_buf(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "bus-range", (caddr_t)&pci_bus_range, &len) == DDI_SUCCESS) {
-		cardbus_err(dip, 1, "cardbus_claim_pci_busnum: %u -> %u \n",
-		    pci_bus_range.lo, pci_bus_range.hi);
-		if ((pci_bus_range.lo >= ctrl->range->lo) &&
-		    (pci_bus_range.hi <= ctrl->range->hi)) {
-			cardbus_err(dip, 1,
-			    "cardbus_claim_pci_busnum: claim %u -> %u \n",
-			    pci_bus_range.lo, pci_bus_range.hi);
-
-			/* claim the bus range from the bus resource map */
-			bzero((caddr_t)&req, sizeof (req));
-			req.ra_addr = (uint64_t)pci_bus_range.lo;
-			req.ra_flags |= NDI_RA_ALLOC_SPECIFIED;
-			req.ra_len = (uint64_t)pci_bus_range.hi -
-			    (uint64_t)pci_bus_range.lo + 1;
-
-			if (ndi_ra_alloc(ctrl->dip, &req, &base, &retlen,
-			    NDI_RA_TYPE_PCI_BUSNUM, 0) == NDI_SUCCESS)
-				return (0);	/* (DDI_WALK_PRUNECHILD); */
-		}
-	}
-
-	/*
-	 * never Error return.
-	 */
-	ctrl->rv = DDI_SUCCESS;
-	return (DDI_WALK_TERMINATE);
-}
-
-static void
-cardbus_walk_node_child(dev_info_t *parent,
-	int (*f)(dev_info_t *, void *), void *arg)
-{
-	dev_info_t *dip;
-	int ret;
-
-	for (dip = ddi_get_child(parent); dip;
-	    dip = ddi_get_next_sibling(dip)) {
-
-		ret = (*f) (dip, arg);
-		if (ret)
-			return;
-	}
-}
-
-static void cardbus_fix_hostbridge_busrange(dev_info_t *dip)
-{
-	cardbus_bus_range_t bus_range;
-	struct busnum_ctrl ctrl;
-
-	uint64_t next_bus;
-	uint64_t blen;
-	ndi_ra_request_t req;
-	int	len;
-
-	cardbus_err(dip, 1, "cardbus_fix_hostbridge_busrange\n");
-
-	bzero((caddr_t)&req, sizeof (ndi_ra_request_t));
-	req.ra_len = 1;
-	if (ndi_ra_alloc(dip, &req,
-	    &next_bus, &blen, NDI_RA_TYPE_PCI_BUSNUM,
-	    0) != NDI_SUCCESS) {
-		(void) ndi_ra_map_destroy(dip, NDI_RA_TYPE_PCI_BUSNUM);
-
-		if (ndi_ra_map_setup(dip, NDI_RA_TYPE_PCI_BUSNUM)
-		    == NDI_FAILURE) {
-			cardbus_err(dip, 1, "cardbus_fix_hostbridge_busrange "
-			    "NDI_RA_TYPE_PCI_BUSNUM setup fail\n");
-			return;
-		}
-
-		bus_range.lo = 0;
-		(void) ddi_getlongprop_buf(DDI_DEV_T_NONE, dip,
-		    DDI_PROP_DONTPASS, "bus-range", (caddr_t)&bus_range, &len);
-		bus_range.hi = 255;
-
-		(void) ndi_ra_free(dip,
-		    (uint64_t)bus_range.lo + 1,
-		    (uint64_t)bus_range.hi - (uint64_t)bus_range.lo,
-		    NDI_RA_TYPE_PCI_BUSNUM, 0);
-
-		ctrl.rv = DDI_SUCCESS;
-		ctrl.dip = dip;
-		ctrl.range = &bus_range;
-
-		cardbus_walk_node_child(dip, cardbus_claim_pci_busnum,
-		    (void*)&ctrl);
-
-		if (ctrl.rv != DDI_SUCCESS)
-			cardbus_err(dip, 1, "cardbus_fix_hostbridge_busrange "
-			    "cardbus_walk_node_child fails\n");
-
-		(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-		    "bus-range", (int *)&bus_range, 2);
-
-	} else {
-		cardbus_err(dip, 1, "cardbus_fix_hostbridge_busrange "
-		    "already set up %x\n", (int)next_bus);
-		(void) ndi_ra_free(dip, next_bus, (uint64_t)1,
-		    NDI_RA_TYPE_PCI_BUSNUM, 0);
-	}
-}
-
-static dev_info_t *
-cardbus_find_hsbridge_dip(dev_info_t *dip)
-{
-	dev_info_t *pdip;
-
-	pdip = ddi_get_parent(dip);
-	while (pdip) {
-		if (ddi_get_parent(pdip) == ddi_root_node())
-			break;
-		pdip = ddi_get_parent(pdip);
-	}
-
-	return (pdip);
-}
-#endif /* sparc */
-
-/*
- * Attach a device to the cardbus infrastructure.
- */
-int
-cardbus_attach(dev_info_t *dip, cb_nexus_cb_t *nex_ops)
-{
-	cbus_t *cbp;
-	int cb_instance;
-	anp_t *anp = (anp_t *)ddi_get_driver_private(dip);
-	struct dev_info *devi = DEVI(dip);
-
-	mutex_enter(&cardbus_list_mutex);
-
-	/*
-	 * Make sure that it is not already initialized.
-	 */
-	if (ddi_prop_exists(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_NOTPROM | DDI_PROP_DONTPASS,
-	    "cbus-instance") == 1) {
-		cmn_err(CE_WARN,
-		    "%s%d: cardbus instance already initialized!\n",
-		    ddi_driver_name(dip), ddi_get_instance(dip));
-			mutex_exit(&cardbus_list_mutex);
-		return (DDI_FAILURE);
-	}
-
-	/*
-	 * initialize soft state structure for the bus instance.
-	 */
-	cb_instance = cardbus_next_instance++;
-
-	if (ddi_soft_state_zalloc(cardbus_state, cb_instance) != DDI_SUCCESS) {
-		cmn_err(CE_WARN, "%s%d: can't allocate cardbus soft state\n",
-		    ddi_driver_name(dip), ddi_get_instance(dip));
-		mutex_exit(&cardbus_list_mutex);
-		return (DDI_FAILURE);
-	}
-
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-	cbp->cb_instance = cb_instance;
-	cbp->cb_dip = dip;
-	mutex_init(&cbp->cb_mutex, NULL, MUTEX_DRIVER, NULL);
-
-	/*
-	 * Save the instance number of the soft state structure for
-	 * this bus as a devinfo property.
-	 */
-	if (ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP,
-	    "cbus-instance", (caddr_t)&cb_instance,
-	    sizeof (cb_instance)) != DDI_SUCCESS) {
-		cmn_err(CE_WARN,
-		    "%s%d: failed to add the property 'cbus-instance'",
-		    ddi_driver_name(dip), ddi_get_instance(dip));
-		ddi_soft_state_free(cardbus_state, cb_instance);
-		mutex_exit(&cardbus_list_mutex);
-		return (DDI_FAILURE);
-	}
-
-	cbp->cb_nex_ops = nex_ops;
-	/*
-	 * TODO - Should probably be some sort of locking on the devinfo here.
-	 */
-	cbp->orig_dopsp = devi->devi_ops;
-	cbp->orig_bopsp = devi->devi_ops->devo_bus_ops;
-	cbp->cb_dops = *devi->devi_ops;
-	devi->devi_ops = &cbp->cb_dops;
-
-	if (ndi_event_alloc_hdl(dip, *anp->an_iblock, &cbp->cb_ndi_event_hdl,
-	    NDI_SLEEP) == NDI_SUCCESS) {
-		cbp->cb_ndi_events.ndi_n_events = CB_N_NDI_EVENTS;
-		cbp->cb_ndi_events.ndi_events_version = NDI_EVENTS_REV1;
-		cbp->cb_ndi_events.ndi_event_defs = cb_ndi_event_defs;
-		if (ndi_event_bind_set(cbp->cb_ndi_event_hdl,
-		    &cbp->cb_ndi_events,
-		    NDI_SLEEP) != NDI_SUCCESS) {
-			cardbus_err(dip, 1,
-			    "cardbus_attach: ndi_event_bind_set failed\n");
-		}
-	}
-
-	/*
-	 * Check for device initialization property.
-	 */
-	cardbus_device_props(cbp);
-
-	if (cardbus_init_hotplug(cbp) != DDI_SUCCESS) {
-		ddi_soft_state_free(cardbus_state, cb_instance);
-		mutex_exit(&cardbus_list_mutex);
-		return (DDI_FAILURE);
-	}
-
-#ifdef sparc
-	/* a hack to fix the bus-range problem on pci root nodes */
-	{
-		dev_info_t *hs_dip;
-
-		hs_dip = cardbus_find_hsbridge_dip(dip);
-		cardbus_fix_hostbridge_busrange(hs_dip);
-	}
-#endif
-
-	cardbus_expand_busrange(dip);
-	cardbus_count++;
-	mutex_exit(&cardbus_list_mutex);
-	return (DDI_SUCCESS);
-}
-
-#ifdef TODO
-static int
-cardbus_detach(dev_info_t *dip)
-{
-	int cb_instance;
-	cbus_t *cbp;
-
-	mutex_enter(&cardbus_list_mutex);
-	/* get the instance number for the cardbus soft state data */
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	if (cb_instance < 0) {
-		mutex_exit(&cardbus_list_mutex);
-		return (DDI_FAILURE); /* no instance is setup for this bus */
-	}
-
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	if (cbp->cb_dsp) {
-		struct cb_deviceset_props *cbdp, *ncbdp;
-
-		cbdp = cbp->cb_dsp;
-		while (cbdp) {
-			ncbdp = cbdp->next;
-			cardbus_devprops_free(cbdp);
-			cbdp = ncbdp;
-		}
-	}
-	/*
-	 * Unregister the bus with the HPS.
-	 *
-	 * (Note: It is assumed that the HPS framework uninstalls
-	 *  event handlers for all the hot plug slots on this bus.)
-	 */
-	(void) hpc_nexus_unregister_bus(dip);
-
-	if (cbp->cb_ndi_event_hdl != NULL) {
-		(void) ndi_event_unbind_set(cbp->cb_ndi_event_hdl,
-		    &cbp->cb_ndi_events, NDI_SLEEP);
-		ndi_event_free_hdl(cbp->cb_ndi_event_hdl);
-	}
-
-	mutex_destroy(&cbp->cb_mutex);
-	if (cbp->nexus_path)
-		kmem_free(cbp->nexus_path, strlen(cbp->nexus_path) + 1);
-	if (cbp->name)
-		kmem_free(cbp->name, strlen(cbp->name) + 1);
-
-	ddi_soft_state_free(cardbus_state, cb_instance);
-
-	/* remove the 'cbus-instance' property from the devinfo node */
-	(void) ddi_prop_remove(DDI_DEV_T_ANY, dip, "cbus-instance");
-
-	ASSERT(cardbus_count != 0);
-	--cardbus_count;
-
-	mutex_exit(&cardbus_list_mutex);
-	return (DDI_SUCCESS);
-}
-#endif
-
-boolean_t
-cardbus_load_cardbus(dev_info_t *dip, uint_t socket, uint32_t pc_base)
-{
-#ifndef HOTPLUG
-	struct cardbus_config_ctrl ctrl;
-	int circular_count;
-#endif
-	int cb_instance;
-	cbus_t *cbp;
-	struct dev_info *devi = DEVI(dip);
-
-	_NOTE(ARGUNUSED(socket, pc_base))
-
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 6, "cardbus_load_cardbus\n");
-#endif
-
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	if (cbp->fatal_problem)
-		return (B_FALSE);
-
-	if (cardbus_convert_properties(dip) == DDI_FAILURE)
-		return (B_FALSE);
-
-	number_of_cardbus_cards++;
-	devi->devi_ops->devo_bus_ops = &cardbusbus_ops;
-
-#ifdef HOTPLUG
-	mutex_enter(&cbp->cb_mutex);
-	cbp->card_present = B_TRUE;
-
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_INSERTION, 0);
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_POWER_ON, 0);
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_CONFIGURE, 0);
-
-	mutex_exit(&cbp->cb_mutex);
-#else
-	if (cardbus_configure(cbp) != PCICFG_SUCCESS) {
-#if defined(CARDBUS_DEBUG)
-		cardbus_err(dip, 6, "cardbus_configure failed\n");
-#endif
-		return (B_FALSE);
-	}
-
-	ctrl.rv = NDI_SUCCESS;
-	ctrl.busno = cardbus_primary_busno(dip);
-	ctrl.op = PCICFG_OP_ONLINE;
-	ctrl.dip = NULL;
-	ctrl.flags = PCICFG_FLAGS_CONTINUE;
-
-	/*
-	 * The child of the dip is the cardbus dip. The child of the
-	 * cardbus dip is the device itself
-	 */
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 8, "cardbus_load_cardbus: calling cbus_configure\n");
-#endif
-	ndi_devi_enter(dip, &circular_count);
-	ddi_walk_devs(ddi_get_child(dip), cbus_configure, (void *)&ctrl);
-	ndi_devi_exit(dip, circular_count);
-
-	if (ctrl.rv != NDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_load_cardbus (%s%d): failed to attach (%d)\n",
-		    ctrl.dip ? ddi_driver_name(ctrl.dip) : "Unknown",
-		    ctrl.dip ? ddi_get_instance(ctrl.dip) : 0,
-		    ctrl.rv);
-
-		/*
-		 * Returning error here will cause the pcic_load_cardbus() call
-		 * to fail. This will invoke pcic_unload_cardbus() which calls
-		 * cardbus_unload_cardbus() below.
-		 */
-		return (B_FALSE);
-	}
-#endif
-
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 7, "cardbus_load_cardbus: returning TRUE\n");
-#endif
-
-	return (B_TRUE);
-}
-
-/*
- * Unload the cardbus module
- */
-void
-cardbus_unload_cardbus(dev_info_t *dip)
-{
-	int	cb_instance;
-#ifndef HOTPLUG
-	int	prim_bus = cardbus_primary_busno(dip);
-	int	rval;
-#endif
-	cbus_t *cbp;
-
-	cardbus_err(dip, 6, "cardbus_unload_cardbus\n");
-
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	if (number_of_cardbus_cards == 0)
-		return;
-
-#ifdef HOTPLUG
-	mutex_enter(&cbp->cb_mutex);
-	cbp->card_present = B_FALSE;
-
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_POWER_OFF, 0);
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_UNCONFIGURE, 0);
-	(void) hpc_slot_event_notify(cbp->slot_handle,
-	    HPC_EVENT_SLOT_REMOVAL, 0);
-
-	mutex_exit(&cbp->cb_mutex);
-#else
-
-	cardbus_err(dip, 8,
-	    "cardbus_unload_cardbus: calling cardbus_unconfigure_node\n");
-
-	rval = cardbus_unconfigure_node(dip, prim_bus, B_TRUE);
-
-	if (rval != NDI_SUCCESS) {
-		cardbus_err(dip, 4,
-		    "cardbus_unload_cardbus: "
-		    "cardbus_unconfigure_node failed\n");
-		number_of_cardbus_cards--;
-		cbp->fatal_problem = B_TRUE;
-		cmn_err(CE_WARN,
-		    "cardbus(%s%d): Failed to remove device tree: "
-		    "Slot disabled",
-		    ddi_get_name(dip), ddi_get_instance(dip));
-		return;
-	}
-
-	(void) cardbus_unconfigure(cbp);
-#endif
-
-	/*
-	 * Inform the lower drivers that the card has been removed
-	 */
-	if (cbp->cb_ndi_event_hdl != NULL) {
-		ddi_eventcookie_t cookie;
-		if (ndi_event_retrieve_cookie(cbp->cb_ndi_event_hdl, dip,
-		    DDI_DEVI_REMOVE_EVENT, &cookie, 0) == NDI_SUCCESS) {
-			(void) ndi_event_run_callbacks(cbp->cb_ndi_event_hdl,
-			    dip, cookie, NULL);
-		}
-	}
-
-	cardbus_revert_properties(dip);
-}
-
-static boolean_t
-is_32bit_pccard(dev_info_t *dip)
-{
-	int len;
-	char bus_type[16];
-
-	len = sizeof (bus_type);
-	if (ddi_prop_op(DDI_DEV_T_ANY, ddi_get_parent(dip),
-		PROP_LEN_AND_VAL_BUF,
-		DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-		"device_type",
-		(caddr_t)&bus_type, &len) != DDI_SUCCESS)
-		return (B_FALSE);
-
-	if ((strcmp(bus_type, "pci") != 0) &&
-	    (strcmp(bus_type, "pciex") != 0) &&
-	    (strcmp(bus_type, "cardbus") != 0)) /* not of pci type */
-		return (B_FALSE);
-
-	return (B_TRUE);
-}
-
-void
-cardbus_save_children(dev_info_t *dip)
-{
-	for (; dip != NULL; dip = ddi_get_next_sibling(dip)) {
-		cardbus_save_children(ddi_get_child(dip));
-
-		if (strcmp("pcs", ddi_node_name(dip)) == 0)
-			continue;
-		if (!is_32bit_pccard(dip))
-			continue;
-		cardbus_err(dip, 1, "Saving device\n");
-		(void) pci_save_config_regs(dip);
-	}
-
-}
-
-void
-cardbus_restore_children(dev_info_t *dip)
-{
-	for (; dip != NULL; dip = ddi_get_next_sibling(dip)) {
-		cardbus_restore_children(ddi_get_child(dip));
-
-		if (strcmp("pcs", ddi_node_name(dip)) == 0)
-			continue;
-		if (!is_32bit_pccard(dip))
-			continue;
-		cardbus_err(dip, 1, "restoring device\n");
-		(void) pci_restore_config_regs(dip);
-	}
-
-}
-
-static int
-cardbus_convert_properties(dev_info_t *dip)
-{
-	struct pcm_regs *pcic_avail_p, *old_avail_p;
-	pci_regspec_t *cb_avail_p, *new_avail_p;
-	pcic_ranges_t *pcic_range_p, *old_range_p;
-	cardbus_range_t *cb_range_p, *new_range_p;
-	int range_len, range_entries, i;
-	int avail_len, avail_entries;
-
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 6, "cardbus_convert_properties\n");
-#endif
-
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#address-cells", 3) != DDI_SUCCESS) {
-		cardbus_err(dip, 1, "cardbus_convert_properties: "
-		    "failed to update #address-cells property\n");
-		return (DDI_FAILURE);
-	}
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#size-cells", 2) != DDI_SUCCESS) {
-		cardbus_err(dip, 1, "cardbus_convert_properties: "
-		    "failed to update #size-cells property\n");
-		return (DDI_FAILURE);
-	}
-
-	if (ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS, "available",
-	    (caddr_t)&pcic_avail_p, &avail_len) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1, "cardbus_convert_properties: "
-		    "no available property for pcmcia\n");
-	} else {
-		avail_entries = avail_len / sizeof (struct pcm_regs);
-		cb_avail_p = kmem_alloc(sizeof (pci_regspec_t) * avail_entries,
-		    KM_SLEEP);
-
-		old_avail_p = pcic_avail_p;
-		new_avail_p = cb_avail_p;
-		for (i = 0; i < avail_entries;
-		    i++, old_avail_p++, new_avail_p++) {
-			new_avail_p->pci_phys_hi = old_avail_p->phys_hi;
-			new_avail_p->pci_phys_mid = 0;
-			new_avail_p->pci_phys_low = old_avail_p->phys_lo;
-			new_avail_p->pci_size_hi = 0;
-			new_avail_p->pci_size_low = old_avail_p->phys_len;
-		}
-
-		(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-		    "available",
-		    (int *)cb_avail_p,
-		    (sizeof (pci_regspec_t) * avail_entries)/sizeof (int));
-
-		kmem_free(pcic_avail_p, avail_len);
-		kmem_free(cb_avail_p, sizeof (pci_regspec_t) * avail_entries);
-	}
-
-	if (ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS, "ranges",
-	    (caddr_t)&pcic_range_p, &range_len) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1, "cardbus_convert_properties: "
-		    "no ranges property for pcmcia\n");
-	} else {
-		range_entries = range_len / sizeof (pcic_ranges_t);
-		cb_range_p = kmem_alloc(
-		    sizeof (cardbus_range_t) * range_entries, KM_SLEEP);
-
-		old_range_p = pcic_range_p;
-		new_range_p = cb_range_p;
-		for (i = 0; i < range_entries;
-		    i++, old_range_p++, new_range_p++) {
-			new_range_p->child_hi =
-			    old_range_p->pcic_range_caddrhi;
-			new_range_p->child_mid = 0;
-			new_range_p->child_lo =
-			    old_range_p->pcic_range_caddrlo;
-			new_range_p->parent_hi =
-			    old_range_p->pcic_range_paddrhi;
-			new_range_p->parent_mid =
-			    old_range_p->pcic_range_paddrmid;
-			new_range_p->parent_lo =
-			    old_range_p->pcic_range_paddrlo;
-			new_range_p->size_hi = 0;
-			new_range_p->size_lo = old_range_p->pcic_range_size;
-		}
-
-		(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip, "ranges",
-		    (int *)cb_range_p,
-		    (sizeof (cardbus_range_t) * range_entries)/sizeof (int));
-
-		kmem_free(pcic_range_p, range_len);
-		kmem_free(cb_range_p, sizeof (cardbus_range_t) * range_entries);
-	}
-
-	return (DDI_SUCCESS);
-}
-
-static void
-cardbus_revert_properties(dev_info_t *dip)
-{
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 6, "cardbus_revert_properties\n");
-#endif
-
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "#address-cells");
-
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "#size-cells");
-
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "available");
-}
-
-static int
-cardbus_prop_op(dev_t dev, dev_info_t *dip, dev_info_t *ch_dip,
-		ddi_prop_op_t prop_op, int mod_flags,
-		char *name, caddr_t valuep, int *lengthp)
-{
-#if defined(CARDBUS_DEBUG)
-	if ((ch_dip != dip) || (cardbus_debug >= 9))
-		cardbus_err(dip, 6,
-		    "cardbus_prop_op(%s) (dip=0x%p, op=%d, name=%s)\n",
-		    ddi_driver_name(ch_dip), (void *) dip, prop_op, name);
-#endif
-	return (impl_ddi_bus_prop_op(dev, dip, ch_dip, prop_op,
-	    mod_flags, name, valuep, lengthp));
-}
-
-static int
-cardbus_ctlops(dev_info_t *dip, dev_info_t *rdip,
-	ddi_ctl_enum_t ctlop, void *arg, void *result)
-{
-	pci_regspec_t *regs;
-	int	totreg, reglen;
-	const char	*dname = ddi_driver_name(dip);
-
-	ASSERT(number_of_cardbus_cards != 0);
-
-	cardbus_err(dip, 6,
-	    "cardbus_ctlops(%p, %p, %d, %p, %p)\n",
-	    (void *)dip, (void *)rdip, ctlop, (void *)arg, (void *)result);
-
-	switch (ctlop) {
-	case DDI_CTLOPS_UNINITCHILD:
-		cardbus_removechild((dev_info_t *)arg);
-		return (DDI_SUCCESS);
-	case DDI_CTLOPS_POWER:
-		return (DDI_SUCCESS);
-
-	default:
-		/*
-		 * Do Nothing
-		 */
-		cardbus_err(dip, 8,
-		    "cardbus_ctlops: Unsupported DDI_CTLOP %d\n", ctlop);
-		return (ddi_ctlops(dip, rdip, ctlop, arg, result));
-
-	case DDI_CTLOPS_SIDDEV:		/* see ddi_dev_is_sid(9F) */
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_SLAVEONLY:	/* see ddi_slaveonly(9F) */
-		return (DDI_FAILURE);	/* cardbus */
-
-	case DDI_CTLOPS_REGSIZE:
-	case DDI_CTLOPS_NREGS:
-		if (rdip == (dev_info_t *)NULL) {
-			*(int *)result = 0;
-			return (DDI_FAILURE);
-		}
-		break;
-
-	case DDI_CTLOPS_IOMIN:
-		/*
-		 * If we are using the streaming cache, align at
-		 * least on a cache line boundary. Otherwise use
-		 * whatever alignment is passed in.
-		 */
-
-		if (arg) {
-			int	val = *((int *)result);
-
-#ifdef  PCI_SBUF_LINE_SIZE
-			val = maxbit(val, PCI_SBUF_LINE_SIZE);
-#else
-			val = maxbit(val, 64);
-#endif
-			*((int *)result) = val;
-		}
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_INITCHILD:
-		return (cardbus_initchild(rdip, dip, (dev_info_t *)arg,
-		    result));
-
-	case DDI_CTLOPS_REPORTDEV:
-		if (rdip == (dev_info_t *)0)
-			return (DDI_FAILURE);
-
-		if (strcmp("pcs", ddi_node_name(rdip)) == 0)
-			cardbus_err(dip, 1,
-			    "cardbus_ctlops: PCCard socket %d at %s@%s\n",
-			    ddi_get_instance(rdip),
-			    dname, ddi_get_name_addr(dip));
-		else {
-			pci_regspec_t *pci_rp;
-			dev_info_t *next;
-			int	length;
-
-			if (ddi_prop_lookup_int_array(DDI_DEV_T_ANY, rdip,
-			    DDI_PROP_DONTPASS, "reg", (int **)&pci_rp,
-			    (uint_t *)&length) != DDI_PROP_SUCCESS)
-				return (DDI_FAILURE);
-
-			if (pci_rp->pci_phys_hi == 0)
-				cardbus_err(dip, 1, "%s%d at %s@%s\n",
-				    ddi_driver_name(rdip),
-				    ddi_get_instance(rdip),
-				    dname, ddi_get_name_addr(dip));
-			else {
-				uint8_t bus, device, function;
-				int32_t val32;
-				char	*ptr, buf[128];
-
-				bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi);
-				device = PCI_REG_DEV_G(pci_rp->pci_phys_hi);
-				function = PCI_REG_FUNC_G(pci_rp->pci_phys_hi);
-
-				ptr = buf;
-				(void) sprintf(ptr, "  "
-				    "Bus %3d Device %2d Function %2d",
-				    bus, device, function);
-				ptr = &ptr[strlen(ptr)];
-
-				val32 = ddi_getprop(DDI_DEV_T_ANY, rdip,
-				    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-				    "vendor-id", -1);
-				if (val32 != -1) {
-					(void) sprintf(ptr, " Vendor 0x%04x",
-					    val32);
-					ptr = &ptr[strlen(ptr)];
-				}
-				val32 = ddi_getprop(DDI_DEV_T_ANY, rdip,
-				    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-				    "device-id", -1);
-				if (val32 != -1) {
-					(void) sprintf(ptr, " Device 0x%04x",
-					    val32);
-					ptr = &ptr[strlen(ptr)];
-				}
-				val32 = ddi_getprop(DDI_DEV_T_ANY, rdip,
-				    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-				    "class-code", -1);
-				if (val32 != -1) {
-					const char	*name;
-
-					if ((name = ddi_get_name(rdip)) !=
-					    NULL)
-						(void) sprintf(ptr, " Name %s",
-						    name);
-					else
-						(void) sprintf(ptr,
-						    " Class 0x%x", val32 >> 8);
-					ptr = &ptr[strlen(ptr)];
-				}
-
-				*ptr++ = '\n';
-				ASSERT(((caddr_t)ptr - (caddr_t)buf) <
-				    sizeof (buf));
-				*ptr = '\0';
-
-				cardbus_err(dip, 1, buf);
-			}
-			ddi_prop_free(pci_rp);
-
-			for (next = ddi_get_child(rdip); next;
-			    next = ddi_get_next_sibling(next))
-				(void) cardbus_ctlops(next, next,
-				    DDI_CTLOPS_REPORTDEV, arg, result);
-		}
-		return (DDI_SUCCESS);
-	}
-	*(int *)result = 0;
-
-	if (ddi_getlongprop(DDI_DEV_T_NONE, rdip,
-	    DDI_PROP_DONTPASS | DDI_PROP_CANSLEEP, "reg",
-	    (caddr_t)&regs, &reglen) != DDI_SUCCESS)
-		return (DDI_FAILURE);
-
-	totreg = reglen / sizeof (pci_regspec_t);
-	if (ctlop == DDI_CTLOPS_NREGS) {
-		cardbus_err(dip, 6,
-		    "cardbus_ctlops, returning NREGS = %d\n", totreg);
-		*(int *)result = totreg;
-	} else if (ctlop == DDI_CTLOPS_REGSIZE) {
-		const int	rn = *(int *)arg;
-		if (rn > totreg)
-			return (DDI_FAILURE);
-		cardbus_err(dip, 6,
-		    "cardbus_ctlops, returning REGSIZE(%d) = %d\n",
-		    rn, regs[rn].pci_size_low);
-		*(off_t *)result = regs[rn].pci_size_low;
-	}
-	kmem_free(regs, reglen);
-	return (DDI_SUCCESS);
-}
-
-static void
-cardbus_init_child_regs(dev_info_t *child)
-{
-	ddi_acc_handle_t config_handle;
-	uint16_t command_preserve, command;
-#if !defined(__i386) && !defined(__amd64)
-	uint8_t bcr;
-#endif
-	uint8_t header_type;
-	uint8_t min_gnt, latency_timer;
-	uint_t n;
-
-	/*
-	 * Map the child configuration space to for initialization.
-	 *
-	 *  Set the latency-timer register to values appropriate
-	 *  for the devices on the bus (based on other devices
-	 *  MIN_GNT and MAX_LAT registers.
-	 *
-	 *  Set the fast back-to-back enable bit in the command
-	 *  register if it's supported and all devices on the bus
-	 *  have the capability.
-	 *
-	 */
-	if (pci_config_setup(child, &config_handle) != DDI_SUCCESS)
-		return;
-
-	cardbus_err(child, 6, "cardbus_init_child_regs()\n");
-
-	/*
-	 * Determine the configuration header type.
-	 */
-	header_type = pci_config_get8(config_handle, PCI_CONF_HEADER);
-
-	/*
-	 * Support for "command-preserve" property.  Note that we
-	 * add PCI_COMM_BACK2BACK_ENAB to the bits to be preserved
-	 * since the obp will set this if the device supports and
-	 * all targets on the same bus support it.  Since psycho
-	 * doesn't support PCI_COMM_BACK2BACK_ENAB, it will never
-	 * be set.  This is just here in case future revs do support
-	 * PCI_COMM_BACK2BACK_ENAB.
-	 */
-	command_preserve = ddi_prop_get_int(DDI_DEV_T_ANY, child,
-	    DDI_PROP_DONTPASS,
-	    "command-preserve", 0);
-	command = pci_config_get16(config_handle, PCI_CONF_COMM);
-	command &= (command_preserve | PCI_COMM_BACK2BACK_ENAB);
-	command |= (cardbus_command_default & ~command_preserve);
-	pci_config_put16(config_handle, PCI_CONF_COMM, command);
-	command = pci_config_get16(config_handle, PCI_CONF_COMM);
-
-#if !defined(__i386) && !defined(__amd64)
-	/*
-	 * If the device has a bus control register then program it
-	 * based on the settings in the command register.
-	 */
-	if ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_ONE) {
-		bcr = pci_config_get8(config_handle, PCI_BCNF_BCNTRL);
-		if (cardbus_command_default & PCI_COMM_PARITY_DETECT)
-			bcr |= PCI_BCNF_BCNTRL_PARITY_ENABLE;
-		if (cardbus_command_default & PCI_COMM_SERR_ENABLE)
-			bcr |= PCI_BCNF_BCNTRL_SERR_ENABLE;
-		bcr |= PCI_BCNF_BCNTRL_MAST_AB_MODE;
-		pci_config_put8(config_handle, PCI_BCNF_BCNTRL, bcr);
-	}
-#endif
-
-	/*
-	 * Initialize cache-line-size configuration register if needed.
-	 */
-	if (ddi_getprop(DDI_DEV_T_ANY, child, DDI_PROP_DONTPASS,
-	    "cache-line-size", 0) == 0) {
-
-		pci_config_put8(config_handle, PCI_CONF_CACHE_LINESZ,
-		    PCI_CACHE_LINE_SIZE);
-		n = pci_config_get8(config_handle, PCI_CONF_CACHE_LINESZ);
-		if (n != 0)
-			(void) ndi_prop_update_int(DDI_DEV_T_NONE, child,
-			    "cache-line-size", n);
-	}
-
-	/*
-	 * Initialize latency timer registers if needed.
-	 */
-	if (ddi_getprop(DDI_DEV_T_ANY, child, DDI_PROP_DONTPASS,
-	    "latency-timer", 0) == 0) {
-
-		if ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_ONE) {
-			latency_timer = cardbus_latency_timer;
-			pci_config_put8(config_handle, PCI_BCNF_LATENCY_TIMER,
-			    latency_timer);
-		} else {
-			min_gnt = pci_config_get8(config_handle,
-			    PCI_CONF_MIN_G);
-
-			/*
-			 * Cardbus os only 33Mhz
-			 */
-			if (min_gnt != 0) {
-				latency_timer = min_gnt * 8;
-			}
-		}
-		pci_config_put8(config_handle, PCI_CONF_LATENCY_TIMER,
-		    latency_timer);
-		n = pci_config_get8(config_handle, PCI_CONF_LATENCY_TIMER);
-		if (n != 0)
-			(void) ndi_prop_update_int(DDI_DEV_T_NONE, child,
-			"latency-timer", n);
-	}
-
-	pci_config_teardown(&config_handle);
-}
-
-static int
-cardbus_initchild(dev_info_t *rdip, dev_info_t *dip, dev_info_t *child,
-		void *result)
-{
-	char	name[MAXNAMELEN];
-	const char	*dname = ddi_driver_name(dip);
-	const struct cb_ops *cop;
-
-	_NOTE(ARGUNUSED(rdip, result))
-
-	cardbus_err(child, 6, "cardbus_initchild\n");
-
-	/*
-	 * Name the child
-	 */
-	if (cardbus_name_child(child, name, MAXNAMELEN) != DDI_SUCCESS)
-		return (DDI_FAILURE);
-
-	ddi_set_name_addr(child, name);
-	ddi_set_parent_data(child, NULL);
-
-	if (ndi_dev_is_persistent_node(child) == 0) {
-		/*
-		 * Try to merge the properties from this prototype
-		 * node into real h/w nodes.
-		 */
-		if (ndi_merge_node(child, cardbus_name_child) == DDI_SUCCESS) {
-			/*
-			 * Merged ok - return failure to remove the node.
-			 */
-			cardbus_removechild(child);
-			return (DDI_FAILURE);
-		}
-		/*
-		 * The child was not merged into a h/w node,
-		 * but there's not much we can do with it other
-		 * than return failure to cause the node to be removed.
-		 */
-		cmn_err(CE_WARN, "!%s@%s: %s.conf properties not merged",
-		    ddi_driver_name(child), ddi_get_name_addr(child),
-		    ddi_driver_name(child));
-		cardbus_removechild(child);
-		return (DDI_NOT_WELL_FORMED);
-	}
-	cop = DEVI(dip)->devi_ops->devo_cb_ops;
-
-	if ((cop == NULL) || (!(cop->cb_flag & D_HOTPLUG))) {
-		cmn_err(CE_WARN, "%s: driver doesn't support HOTPLUG\n", dname);
-		return (DDI_FAILURE);
-	}
-
-	cardbus_init_child_regs(child);
-
-	/*
-	 * Create ppd if needed.
-	 */
-	if (ddi_get_parent_data(child) == NULL) {
-		struct cardbus_parent_private_data *ppd;
-
-#ifdef sparc
-		ppd = (struct cardbus_parent_private_data *)
-		    kmem_zalloc(sizeof (struct cardbus_parent_private_data),
-		    KM_SLEEP);
-
-#elif defined(__x86) || defined(__amd64)
-		ppd = (struct cardbus_parent_private_data *)
-		    kmem_zalloc(sizeof (struct cardbus_parent_private_data)
-		    + sizeof (struct intrspec), KM_SLEEP);
-
-		ppd->ppd.par_intr = (struct intrspec *)(ppd + 1);
-		(ppd->ppd.par_intr)->intrspec_pri = 0;
-		(ppd->ppd.par_intr)->intrspec_vec = 0;
-		(ppd->ppd.par_intr)->intrspec_func = (uint_t (*)()) 0;
-#endif
-
-		if (ddi_getprop(DDI_DEV_T_NONE, child, DDI_PROP_DONTPASS,
-		    "interrupts", -1) != -1)
-			ppd->ppd.par_nintr = 1;
-
-		ppd->code = CB_PPD_CODE;
-
-		cardbus_err(child, 5,
-		    "cardbus_initchild: Creating empty ppd\n");
-		ppd->ppd.par_nreg = 0;
-		ppd->ppd.par_reg = NULL;
-
-		ddi_set_parent_data(child, (caddr_t)ppd);
-	}
-
-	return (DDI_SUCCESS);
-}
-
-static int
-cardbus_name_child(dev_info_t *child, char *name, int namelen)
-{
-	pci_regspec_t *pci_rp;
-	char	**unit_addr;
-	uint_t n;
-	int	bus, device, func;
-
-	/*
-	 * Pseudo nodes indicate a prototype node with per-instance
-	 * properties to be merged into the real h/w device node.
-	 * The interpretation of the unit-address is DD[,F]
-	 * where DD is the device id and F is the function.
-	 */
-	if (ndi_dev_is_persistent_node(child) == 0) {
-		if (ddi_prop_lookup_string_array(DDI_DEV_T_ANY, child,
-		    DDI_PROP_DONTPASS,
-		    "unit-address", &unit_addr, &n) != DDI_PROP_SUCCESS) {
-			cmn_err(CE_WARN, "cannot name node from %s.conf",
-			    ddi_driver_name(child));
-			return (DDI_FAILURE);
-		}
-		if (n != 1 || *unit_addr == NULL || **unit_addr == 0) {
-			cmn_err(CE_WARN, "unit-address property in %s.conf"
-			    " not well-formed", ddi_driver_name(child));
-			ddi_prop_free(unit_addr);
-			return (DDI_FAILURE);
-		}
-		(void) snprintf(name, namelen, "%s", *unit_addr);
-		ddi_prop_free(unit_addr);
-		return (DDI_SUCCESS);
-	}
-
-	/*
-	 * Get the address portion of the node name based on
-	 * the function and device number.
-	 */
-	if (ddi_prop_lookup_int_array(DDI_DEV_T_ANY, child, DDI_PROP_DONTPASS,
-	    "reg", (int **)&pci_rp, &n) != DDI_SUCCESS) {
-		return (DDI_FAILURE);
-	}
-
-	bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi);
-	device = PCI_REG_DEV_G(pci_rp->pci_phys_hi);
-	func = PCI_REG_FUNC_G(pci_rp->pci_phys_hi);
-	ddi_prop_free(pci_rp);
-
-	if (func != 0)
-		(void) snprintf(name, namelen, "%x,%x", device, func);
-	else
-		(void) snprintf(name, namelen, "%x", device);
-
-	cardbus_err(child, 8,
-	    "cardbus_name_child: system init done [%x][%x][%x]"
-	    " for %s [%s] nodeid: %x @%s\n",
-	    bus, device, func,
-	    ddi_get_name(child), ddi_get_name_addr(child),
-	    DEVI(child)->devi_nodeid, name);
-
-	return (DDI_SUCCESS);
-}
-
-static void
-cardbus_removechild(dev_info_t *dip)
-{
-	struct cardbus_parent_private_data *ppd;
-
-	ddi_set_name_addr(dip, NULL);
-	impl_rem_dev_props(dip);
-	ppd = (struct cardbus_parent_private_data *)ddi_get_parent_data(dip);
-	if (ppd && (ppd->code == CB_PPD_CODE)) {
-		if (ppd->ppd.par_reg && (ppd->ppd.par_nreg > 0))
-			kmem_free((caddr_t)ppd->ppd.par_reg,
-			    ppd->ppd.par_nreg * sizeof (struct regspec));
-#ifdef sparc
-		kmem_free(ppd, sizeof (struct cardbus_parent_private_data));
-#elif defined(__x86) || defined(__amd64)
-		kmem_free(ppd, sizeof (struct cardbus_parent_private_data) +
-		    sizeof (struct intrspec));
-#endif
-		cardbus_err(dip, 5,
-		    "cardbus_removechild: ddi_set_parent_data(NULL)\n");
-		ddi_set_parent_data(dip, NULL);
-	}
-}
-
-
-static char	cb_bnamestr[] = "binding_name";
-static char	cb_venidstr[] = "VendorID";
-static char	cb_devidstr[] = "DeviceID";
-static char	cb_nnamestr[] = "nodename";
-
-static cb_props_parse_tree_t cb_props_parse_tree[] = {
-	{ cb_bnamestr, PT_STATE_STRING_VAR },
-	{ cb_venidstr, PT_STATE_HEX_VAR },
-	{ cb_devidstr, PT_STATE_HEX_VAR } };
-
-static int
-check_token(char *token, int *len)
-{
-	int	state = PT_STATE_DEC_VAR;
-	int	sl = strlen(token), il = 1;
-	char	c;
-
-	if (token[0] == '0' && token[2] && (token[1] == 'x' || token[1] ==
-	    'X')) {
-		state = PT_STATE_HEX_VAR;
-		token += 2;
-	}
-
-	while (c = *token++) {
-		if (isdigit(c))
-			continue;
-		if (c == PARSE_COMMA) {
-			il++;
-			if (token[0] == '0' && token[2] && isx(token[1])) {
-				state = PT_STATE_HEX_VAR;
-				token += 2;
-			}
-			continue;
-		}
-		if (!isxdigit(c)) {
-			*len = sl;
-			return (PT_STATE_STRING_VAR);
-		}
-		state = PT_STATE_HEX_VAR;
-	}
-	*len = il;
-	return (state);
-}
-
-
-static char *
-find_token(char **cp, int *l, char *endc)
-{
-	char	*cpp = *cp;
-
-	while ((**cp && (isalpha(**cp) || isxdigit(**cp) ||
-	    (**cp == PARSE_UNDERSCORE) ||
-	    (**cp == PARSE_COMMA) ||
-	    (**cp == PARSE_DASH)))) {
-		(*cp)++;
-		(*l)++;
-	}
-
-	*endc = **cp;
-	**cp = NULL;
-
-	return (cpp);
-}
-
-static int
-parse_token(char *token)
-{
-	cb_props_parse_tree_t *pt = cb_props_parse_tree;
-	int	k = sizeof (cb_props_parse_tree) /
-	    sizeof (cb_props_parse_tree_t);
-
-	while (k--) {
-		if (strcmp((char *)token, pt->token) == 0)
-			return (pt->state);
-		pt++;
-	}
-
-	return (PT_STATE_UNKNOWN);
-}
-
-static int
-token_to_hex(char *token, unsigned *val, int len)
-{
-	uchar_t c;
-
-	*val = 0;
-	if (token[0] == '0' && (token[1] == 'x' || token[1] == 'X')) {
-		token += 2;
-	}
-
-	while (*token) {
-		if (!isxdigit(*token)) {
-			if (*token == PARSE_COMMA) {
-				if (!(--len))
-					return (1);
-				val++;
-				*val = 0;
-				token++;
-				if (token[0] == '0' && (token[1] == 'x' ||
-				    token[1] == 'X')) {
-					token += 2;
-				}
-				continue;
-			}
-			return (0);
-		}
-		c = toupper(*token);
-		if (c >= 'A')
-			c = c - 'A' + 10 + '0';
-		*val = ((*val * 16) + (c - '0'));
-		token++;
-	}
-
-	return (1);
-}
-
-static int
-token_to_dec(char *token, unsigned *val, int len)
-{
-	*val = 0;
-
-	while (*token) {
-		if (!isdigit(*token)) {
-			if (*token == PARSE_COMMA) {
-				if (!(--len))
-					return (1);
-				val++;
-				*val = 0;
-				token++;
-				continue;
-			}
-			return (0);
-		}
-		*val = ((*val * 10) + (*token - '0'));
-		token++;
-	}
-
-	return (1);
-}
-
-static void
-cardbus_add_prop(struct cb_deviceset_props *cdsp, int type, char *name,
-		caddr_t vp, int len)
-{
-	ddi_prop_t *propp;
-	int	pnlen = strlen(name) + 1;
-
-	propp = (ddi_prop_t *)kmem_zalloc(sizeof (ddi_prop_t), KM_SLEEP);
-	propp->prop_name = (char *)kmem_alloc(pnlen, KM_SLEEP);
-	propp->prop_val = vp;
-	bcopy(name, propp->prop_name, pnlen);
-	propp->prop_len = len;
-	propp->prop_flags = type;
-	propp->prop_next = cdsp->prop_list;
-	cdsp->prop_list = propp;
-}
-
-static void
-cardbus_add_stringprop(struct cb_deviceset_props *cdsp, char *name,
-		char *vp, int len)
-{
-	char	*nstr = kmem_zalloc(len + 1, KM_SLEEP);
-
-	bcopy(vp, nstr, len);
-	cardbus_add_prop(cdsp, DDI_PROP_TYPE_STRING, name, (caddr_t)nstr,
-	    len + 1);
-}
-
-static void
-cardbus_prop_free(ddi_prop_t *propp)
-{
-	if (propp->prop_len) {
-		switch (propp->prop_flags) {
-		case DDI_PROP_TYPE_STRING:
-			kmem_free(propp->prop_val, propp->prop_len);
-			break;
-		case DDI_PROP_TYPE_INT:
-			kmem_free(propp->prop_val,
-			    propp->prop_len * sizeof (int));
-			break;
-		}
-	}
-	kmem_free(propp->prop_name, strlen(propp->prop_name) + 1);
-	kmem_free(propp, sizeof (ddi_prop_t *));
-}
-
-static void
-cardbus_devprops_free(struct cb_deviceset_props *cbdp)
-{
-	ddi_prop_t *propp, *npropp;
-
-	propp = cbdp->prop_list;
-	while (propp) {
-		npropp = propp->prop_next;
-		cardbus_prop_free(propp);
-		propp = npropp;
-	}
-	if (cbdp->nodename)
-		kmem_free(cbdp->nodename, strlen(cbdp->nodename) + 1);
-	if (cbdp->binding_name)
-		kmem_free(cbdp->binding_name, strlen(cbdp->binding_name) +
-		    1);
-	kmem_free(cbdp, sizeof (*cbdp));
-}
-
-/*
- * Format of "cb-device-init-props" property:
- * Anything before the semi-colon is an identifying equate, anything
- * after the semi-colon is a setting equate.
- *
- * "binding_name=xXxXxX VendorID=NNNN DeviceID=NNNN; nodename=NewName
- * 					Prop=PropVal"
- *
- */
-static int
-cardbus_parse_devprop(cbus_t *cbp, char *cp)
-{
-	int	state = PT_STATE_TOKEN, qm = 0, em = 0, smc = 0, l = 0;
-	int	length;
-	char	*token = "beginning of line";
-	char	*ptoken = NULL, *quote;
-	char	eq = NULL;
-	struct cb_deviceset_props *cdsp;
-
-	cdsp = (struct cb_deviceset_props *)kmem_zalloc(sizeof (*cdsp),
-	    KM_SLEEP);
-	length = strlen(cp);
-
-	while ((*cp) && (l < length)) {
-		/*
-		 * Check for escaped characters
-		 */
-		if (*cp == PARSE_ESCAPE) {
-			char	*cpp = cp, *cppp = cp + 1;
-
-			em = 1;
-
-			if (!qm) {
-				cmn_err(CE_CONT, "cardbus_parse_devprop: "
-				    "escape not allowed outside "
-				    "of quotes at [%s]\n", token);
-				return (DDI_FAILURE);
-
-			} /* if (!qm) */
-
-			while (*cppp)
-				*cpp++ = *cppp++;
-
-			l++;
-
-			*cpp = NULL;
-		} /* PARSE_ESCAPE */
-
-		/*
-		 * Check for quoted strings
-		 */
-		if (!em && (*cp == PARSE_QUOTE)) {
-			qm ^= 1;
-			if (qm) {
-				quote = cp + 1;
-			} else {
-				*cp = NULL;
-				if (state == PT_STATE_CHECK) {
-					if (strcmp(token, cb_nnamestr) == 0) {
-						cdsp->nodename = kmem_alloc(
-						    strlen(quote) + 1,
-						    KM_SLEEP);
-						(void) strcpy(cdsp->nodename,
-						    quote);
-					} else
-						cardbus_add_stringprop(cdsp,
-						    token, quote,
-						    strlen(quote));
-				} else if (state != PT_STATE_STRING_VAR) {
-					cmn_err(CE_CONT,
-					    "cardbus_parse_devprop: "
-					    "unexpected string [%s] after "
-					    "[%s]\n", quote, token);
-					return (DDI_FAILURE);
-				} else {
-					if (strcmp(token, cb_bnamestr) == 0) {
-						cdsp->binding_name = kmem_alloc(
-						    strlen(quote) + 1,
-						    KM_SLEEP);
-						(void) strcpy(
-						    cdsp->binding_name, quote);
-					}
-				}
-				state = PT_STATE_TOKEN;
-			} /* if (qm) */
-		} /* PARSE_QUOTE */
-
-		em = 0;
-
-		if (!qm && (*cp == PARSE_SEMICOLON)) {
-			smc = 1;
-		}
-
-		/*
-		 * Check for tokens
-		 */
-		else if (!qm && (isalpha(*cp) || isxdigit(*cp))) {
-			int	tl;
-			unsigned	*intp;
-			ptoken = token;
-			token = find_token(&cp, &l, &eq);
-
-			switch (state) {
-			case PT_STATE_TOKEN:
-				if (smc) {
-					if (eq == PARSE_EQUALS)
-						state = PT_STATE_CHECK;
-					else
-						cardbus_add_prop(cdsp,
-						    DDI_PROP_TYPE_ANY,
-						    token,
-						    NULL, 0);
-				} else if (eq == PARSE_EQUALS)
-					switch (state = parse_token(token)) {
-					case PT_STATE_UNKNOWN:
-						cmn_err(CE_CONT,
-						    "cardbus_parse_devprop: "
-						    "unknown token [%s]\n",
-						    token);
-						state = PT_STATE_TOKEN;
-					} /* switch (parse_token) */
-				else
-					state = PT_STATE_TOKEN;
-				break;
-
-			case PT_STATE_CHECK:
-				switch (check_token(token, &tl)) {
-				case PT_STATE_DEC_VAR:
-					intp = (unsigned *)kmem_alloc(
-					    sizeof (int)*tl,
-					    KM_SLEEP);
-					if (token_to_dec(token, intp, tl))
-						cardbus_add_prop(cdsp,
-						    DDI_PROP_TYPE_INT, ptoken,
-						    (caddr_t)intp, tl);
-					else
-						kmem_free(intp,
-						    sizeof (int)*tl);
-					break;
-				case PT_STATE_HEX_VAR:
-					intp = (unsigned *)kmem_alloc(
-					    sizeof (int)*tl,
-					    KM_SLEEP);
-					if (token_to_hex(token, intp, tl))
-						cardbus_add_prop(cdsp,
-						    DDI_PROP_TYPE_INT,
-						    ptoken,
-						    (caddr_t)intp, tl);
-					else
-						kmem_free(intp,
-						    sizeof (int)*tl);
-					break;
-				case PT_STATE_STRING_VAR:
-					if (strcmp(ptoken, cb_nnamestr) == 0) {
-						cdsp->nodename = kmem_alloc(
-						    tl + 1, KM_SLEEP);
-						(void) strcpy(cdsp->nodename,
-						    token);
-					} else
-						cardbus_add_stringprop(cdsp,
-						    ptoken, token, tl);
-					break;
-				}
-				state = PT_STATE_TOKEN;
-				break;
-
-			case PT_STATE_HEX_VAR:
-				if (strcmp(ptoken, cb_venidstr) == 0) {
-					uint_t val;
-					if (token_to_hex(token, &val, 1))
-						cdsp->venid = val;
-				} else if (strcmp(ptoken, cb_devidstr) == 0) {
-					uint_t val;
-					if (token_to_hex(token, &val, 1))
-						cdsp->devid = val;
-				}
-				state = PT_STATE_TOKEN;
-				break;
-
-			case PT_STATE_DEC_VAR:
-				if (strcmp(ptoken, cb_venidstr) == 0) {
-					uint_t val;
-					if (token_to_dec(token, &val, 1))
-						cdsp->venid = val;
-				} else if (strcmp(ptoken, cb_devidstr) == 0) {
-					uint_t val;
-					if (token_to_dec(token, &val, 1))
-						cdsp->devid = val;
-				}
-				state = PT_STATE_TOKEN;
-				break;
-
-			case PT_STATE_STRING_VAR:
-				if (strcmp(ptoken, cb_bnamestr) == 0) {
-					cdsp->binding_name = kmem_alloc(
-					    strlen(token) + 1, KM_SLEEP);
-					(void) strcpy(cdsp->binding_name,
-					    token);
-				}
-				state = PT_STATE_TOKEN;
-				break;
-
-			default:
-				cmn_err(CE_CONT, "cardbus_parse_devprop: "
-				    "unknown state machine state = %d\n",
-				    state);
-
-				cardbus_devprops_free(cdsp);
-				return (DDI_FAILURE);
-			} /* switch (state) */
-			if (eq == PARSE_SEMICOLON)
-				smc = 1;
-		}
-		cp++;
-		l++;
-	} /* while (*cp) */
-
-	if (qm) {
-		cmn_err(CE_CONT, "cb_props_parse_line: unterminated "
-		    "string = [%s]\n", quote);
-		cardbus_devprops_free(cdsp);
-		return (DDI_FAILURE);
-	}
-
-	if (state != PT_STATE_TOKEN) {
-		cmn_err(CE_CONT, "cardbus_parse_devprop: token [%s] "
-		    "requires value\n", token);
-		cardbus_devprops_free(cdsp);
-		return (DDI_FAILURE);
-	}
-
-	if (cdsp->venid == 0 || cdsp->devid == 0) {
-		cmn_err(CE_CONT, "cardbus_parse_devprop: Entry "
-		    "requires VendorID and DeviceID\n");
-		cardbus_devprops_free(cdsp);
-		return (DDI_FAILURE);
-	}
-
-	cdsp->next = cbp->cb_dsp;
-	cbp->cb_dsp = cdsp;
-	return (DDI_SUCCESS);
-}
-
-static void
-cardbus_device_props(cbus_t *cbp)
-{
-	char	**prop_array;
-	uint_t i, n;
-
-	if (ddi_prop_lookup_string_array(DDI_DEV_T_ANY, cbp->cb_dip,
-	    DDI_PROP_DONTPASS,
-	    "cb-device-init-props", &prop_array,
-	    &n) != DDI_PROP_SUCCESS)
-		return;
-
-	for (i = 0; i < n; i++)
-		(void) cardbus_parse_devprop(cbp, prop_array[i]);
-
-	ddi_prop_free(prop_array);
-}
-
-static int
-cardbus_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
-		off_t offset, off_t len, caddr_t *vaddrp)
-{
-	register dev_info_t *pdip = (dev_info_t *)DEVI(dip)->devi_parent;
-	int	rc;
-
-	cardbus_err(dip, 9,
-	    "cardbus_bus_map(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	/* A child has asked us to set something up */
-	cardbus_err(dip, 9,
-	    "cardbus_bus_map(%s) calling %s - 0x%p, "
-	    "offset 0x%x, len 0x%x\n",
-	    ddi_driver_name(rdip),
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_map,
-	    (int)offset, (int)len);
-
-	rc = (DEVI(pdip)->devi_ops->devo_bus_ops->bus_map)
-	    (pdip, rdip, mp, offset, len, vaddrp);
-	/* rc = ddi_map(dip, mp, offset, len, vaddrp); */
-
-	if (rc != DDI_SUCCESS) {
-		cardbus_err(rdip, 8, "cardbus_bus_map failed, rc = %d\n", rc);
-		return (DDI_FAILURE);
-	} else {
-		cardbus_err(rdip, 9, "cardbus_bus_map OK\n");
-		return (DDI_SUCCESS);
-	}
-}
-
-static void
-pcirp2rp(const pci_regspec_t *pci_rp, struct regspec *rp)
-{
-	/* bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi); */
-	if (PCI_REG_ADDR_G(pci_rp->pci_phys_hi) ==
-	    PCI_REG_ADDR_G(PCI_ADDR_IO)) {
-		/* I/O */
-		rp->regspec_bustype = 1;
-	} else {
-		/* memory */
-		rp->regspec_bustype = 0;
-	}
-	rp->regspec_addr = pci_rp->pci_phys_low;
-	rp->regspec_size = pci_rp->pci_size_low;
-}
-
-static int
-cardbus_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr,
-		int (*waitfp)(caddr_t), caddr_t arg,
-		ddi_dma_handle_t *handlep)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_allochdl(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_allochdl calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_allochdl);
-
-	return (ddi_dma_allochdl(dip, rdip, attr, waitfp, arg, handlep));
-}
-
-static int
-cardbus_dma_freehdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_freehdl(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_freehdl calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_freehdl);
-
-	return (ddi_dma_freehdl(dip, rdip, handle));
-}
-
-static int
-cardbus_dma_bindhdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, struct ddi_dma_req *dmareq,
-		ddi_dma_cookie_t *cp, uint_t *ccountp)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_bindhdl(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_bindhdl calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_bindhdl);
-
-	return (DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_bindhdl(pdip,
-	    rdip, handle, dmareq, cp, ccountp));
-}
-
-static int
-cardbus_dma_unbindhdl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_unbindhdl(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_unbindhdl calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_unbindhdl);
-
-	return (DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_unbindhdl(pdip,
-	    rdip, handle));
-}
-
-static int
-cardbus_dma_flush(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, off_t off, size_t len,
-		uint_t cache_flags)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_flush(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_flush calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_flush);
-
-	return (DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_flush(pdip, rdip,
-	    handle, off, len, cache_flags));
-}
-
-static int
-cardbus_dma_win(dev_info_t *dip, dev_info_t *rdip,
-		ddi_dma_handle_t handle, uint_t win, off_t *offp,
-		size_t *lenp, ddi_dma_cookie_t *cookiep, uint_t *ccountp)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-	cardbus_err(dip, 6,
-	    "cardbus_dma_win(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 8,
-	    "cardbus_dma_win calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_win);
-
-	return (DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_win(pdip, rdip,
-	    handle, win, offp, lenp, cookiep, ccountp));
-}
-
-static int
-cardbus_dma_map(dev_info_t *dip, dev_info_t *rdip,
-		struct ddi_dma_req *dmareqp, ddi_dma_handle_t *handlep)
-{
-	dev_info_t *pdip = ddi_get_parent(dip);
-
-	cardbus_err(dip, 10,
-	    "cardbus_dma_map(dip=0x%p, rdip=0x%p)\n",
-	    (void *) dip, (void *) rdip);
-
-	if (pdip == NULL)
-		return (DDI_FAILURE);
-
-	cardbus_err(dip, 11,
-	    "cardbus_dma_map calling %s - 0x%p\n",
-	    ddi_driver_name(pdip),
-	    (void *) DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_map);
-
-	return (DEVI(pdip)->devi_ops->devo_bus_ops->bus_dma_map(pdip, rdip,
-	    dmareqp, handlep));
-}
-
-static int
-cardbus_get_eventcookie(dev_info_t *dip, dev_info_t *rdip,
-		char *eventname, ddi_eventcookie_t *cookiep)
-{
-	cbus_t *cbp;
-	int	cb_instance;
-	int	rc;
-
-	/*
-	 * get the soft state structure for the bus instance.
-	 */
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	cardbus_err(dip, 6, "cardbus_get_eventcookie %s\n", eventname);
-
-	ASSERT(number_of_cardbus_cards != 0);
-
-	if (cbp->cb_ndi_event_hdl == NULL) {
-		/*
-		 * We can't handle up (probably called at the attachment
-		 * point) so pass it on up
-		 */
-		dev_info_t *pdip = ddi_get_parent(dip);
-		cardbus_err(dip, 8,
-		    "cardbus_get_eventcookie calling %s - 0x%p\n",
-		    ddi_driver_name(pdip),
-		    (void *)
-		    DEVI(pdip)->devi_ops->devo_bus_ops->bus_get_eventcookie);
-		return (DEVI(pdip)->devi_ops->devo_bus_ops->
-		    bus_get_eventcookie(pdip, rdip, eventname, cookiep));
-	}
-
-	cardbus_err(dip, 8,
-	    "cardbus_get_eventcookie calling ndi_event_retrieve_cookie\n");
-
-	rc = ndi_event_retrieve_cookie(cbp->cb_ndi_event_hdl, rdip, eventname,
-	    cookiep, NDI_EVENT_NOPASS);
-
-	cardbus_err(dip, 7,
-	    "cardbus_get_eventcookie rc %d cookie %p\n", rc, (void *)*cookiep);
-	return (rc);
-}
-
-static int
-cardbus_add_eventcall(dev_info_t *dip, dev_info_t *rdip,
-		ddi_eventcookie_t cookie, void (*callback)(dev_info_t *dip,
-		ddi_eventcookie_t cookie, void *arg, void *bus_impldata),
-		void *arg, ddi_callback_id_t *cb_id)
-{
-	cbus_t *cbp;
-	int	cb_instance;
-	int	rc;
-
-	/*
-	 * get the soft state structure for the bus instance.
-	 */
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	cardbus_err(dip, 6, "cardbus_add_eventcall\n");
-
-	ASSERT(number_of_cardbus_cards != 0);
-
-	if (cbp->cb_ndi_event_hdl == NULL) {
-		/*
-		 * We can't handle up (probably called at the attachment
-		 * point) so pass it on up
-		 */
-		dev_info_t *pdip = ddi_get_parent(dip);
-		cardbus_err(dip, 8,
-		    "cardbus_add_eventcall calling %s - 0x%p\n",
-		    ddi_driver_name(pdip),
-		    (void *)
-		    DEVI(pdip)->devi_ops->devo_bus_ops->bus_add_eventcall);
-		return (DEVI(pdip)->devi_ops->devo_bus_ops->
-		    bus_add_eventcall(pdip, rdip, cookie, callback,
-		    arg, cb_id));
-	}
-
-	cardbus_err(dip, 8,
-	    "cardbus_add_eventcall calling ndi_event_add_callback\n");
-
-	rc = ndi_event_add_callback(cbp->cb_ndi_event_hdl, rdip, cookie,
-	    callback, arg, NDI_EVENT_NOPASS, cb_id);
-	cardbus_err(dip, 7,
-	    "cardbus_add_eventcall rc %d cookie %p\n", rc, (void *)cookie);
-	return (rc);
-}
-
-static int
-cardbus_remove_eventcall(dev_info_t *dip, ddi_callback_id_t cb_id)
-{
-	cbus_t *cbp;
-	int	cb_instance;
-
-	/*
-	 * get the soft state structure for the bus instance.
-	 */
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	cardbus_err(dip, 6, "cardbus_remove_eventcall\n");
-
-	ASSERT(number_of_cardbus_cards != 0);
-
-	if (cbp->cb_ndi_event_hdl == NULL) {
-		/*
-		 * We can't handle up (probably called at the attachment
-		 * point) so pass it on up
-		 */
-		dev_info_t *pdip = ddi_get_parent(dip);
-		cardbus_err(dip, 8,
-		    "cardbus_remove_eventcall calling %s - 0x%p\n",
-		    ddi_driver_name(pdip),
-		    (void *)
-		    DEVI(pdip)->devi_ops->devo_bus_ops->bus_remove_eventcall);
-		return (DEVI(pdip)->devi_ops->devo_bus_ops->
-		    bus_remove_eventcall(pdip, cb_id));
-	}
-
-	return (ndi_event_remove_callback(cbp->cb_ndi_event_hdl, cb_id));
-}
-
-static int
-cardbus_post_event(dev_info_t *dip, dev_info_t *rdip,
-		ddi_eventcookie_t cookie, void *bus_impldata)
-{
-	_NOTE(ARGUNUSED(rdip, cookie, bus_impldata))
-	cardbus_err(dip, 1, "cardbus_post_event()\n");
-	return (DDI_FAILURE);
-}
-
-static int cardbus_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp);
-static int cardbus_add_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp);
-static int cardbus_enable_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp);
-static int cardbus_disable_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp);
-
-static int
-cardbus_get_pil(dev_info_t *dip)
-{
-	return ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    "interrupt-priorities", 6);
-}
-
-static int
-cardbus_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
-	ddi_intr_handle_impl_t *hdlp, void *result)
-{
-	int ret = DDI_SUCCESS;
-
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 8, "cardbus_intr_ops() intr_op=%d\n", (int)intr_op);
-#endif
-
-	switch (intr_op) {
-	case DDI_INTROP_GETCAP:
-		*(int *)result = DDI_INTR_FLAG_LEVEL;
-		break;
-	case DDI_INTROP_ALLOC:
-		*(int *)result = hdlp->ih_scratch1;
-		break;
-	case DDI_INTROP_FREE:
-		break;
-	case DDI_INTROP_GETPRI:
-		*(int *)result = hdlp->ih_pri ?
-		    hdlp->ih_pri : cardbus_get_pil(dip);
-		break;
-	case DDI_INTROP_SETPRI:
-		break;
-	case DDI_INTROP_ADDISR:
-	case DDI_INTROP_REMISR:
-		if (hdlp->ih_type != DDI_INTR_TYPE_FIXED) {
-			cardbus_err(dip, 1, "Only fixed interrupts\n");
-			return (DDI_FAILURE);
-		}
-		break;
-	case DDI_INTROP_ENABLE:
-		ret = cardbus_enable_intr_impl(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_DISABLE:
-		ret = cardbus_disable_intr_impl(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_NINTRS:
-	case DDI_INTROP_NAVAIL:
-#ifdef sparc
-		*(int *)result = i_ddi_get_intx_nintrs(rdip);
-#else
-		*(int *)result = 1;
-#endif
-		break;
-	case DDI_INTROP_SUPPORTED_TYPES:
-		*(int *)result = DDI_INTR_TYPE_FIXED;
-		break;
-	default:
-		ret = DDI_ENOTSUP;
-		break;
-	}
-
-	return (ret);
-}
-
-static int
-cardbus_enable_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp)
-{
-	anp_t *anp = (anp_t *)ddi_get_driver_private(dip);
-	set_irq_handler_t sih;
-	uint_t socket = 0; /* We only support devices */
-			    /* with one socket per function */
-
-	ASSERT(anp != NULL);
-
-	cardbus_err(dip, 9,
-	    "cardbus_enable_intr_impl, intr=0x%p, arg1=0x%p, arg2=0x%p"
-	    "rdip=0x%p(%s)\n",
-	    (void *) hdlp->ih_cb_func,
-	    hdlp->ih_cb_arg1, hdlp->ih_cb_arg2,
-	    (void *) rdip, ddi_driver_name(rdip));
-
-	if (hdlp->ih_type != DDI_INTR_TYPE_FIXED) {
-		cardbus_err(dip, 1, "Only fixed interrupts\n");
-		return (DDI_FAILURE);
-	}
-
-	sih.socket = socket;
-	sih.handler_id = (unsigned)(long)rdip;
-	sih.handler = (f_tt *)hdlp->ih_cb_func;
-	sih.arg1 = hdlp->ih_cb_arg1;
-	sih.arg2 = hdlp->ih_cb_arg2;
-	sih.irq = cardbus_get_pil(dip);
-
-	if ((*anp->an_if->pcif_set_interrupt)(dip, &sih) != SUCCESS)
-		return (DDI_FAILURE);
-
-	return (DDI_SUCCESS);
-}
-
-static int
-cardbus_disable_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-		ddi_intr_handle_impl_t *hdlp)
-{
-	anp_t *anp = (anp_t *)ddi_get_driver_private(dip);
-	clear_irq_handler_t cih;
-	uint_t socket = 0; /* We only support devices with 1 socket per */
-			    /* function. */
-
-	ASSERT(anp != NULL);
-
-	cardbus_err(dip, 9,
-	    "cardbus_disable_intr_impl, intr=0x%p, arg1=0x%p, arg2=0x%p"
-	    "rdip=0x%p(%s%d)\n",
-	    (void *) hdlp->ih_cb_func,
-	    hdlp->ih_cb_arg1, hdlp->ih_cb_arg2,
-	    (void *) rdip, ddi_driver_name(rdip), ddi_get_instance(rdip));
-
-	if (hdlp->ih_type != DDI_INTR_TYPE_FIXED) {
-		cardbus_err(dip, 1, "Only fixed interrupts\n");
-		return (DDI_FAILURE);
-	}
-
-	cih.socket = socket;
-	cih.handler_id = (unsigned)(long)rdip;
-	cih.handler = (f_tt *)hdlp->ih_cb_func;
-
-	if ((*anp->an_if->pcif_clr_interrupt)(dip, &cih) != SUCCESS)
-		return (DDI_FAILURE);
-
-	return (DDI_SUCCESS);
-}
-
-#if defined(CARDBUS_DEBUG)
-static int	cardbus_do_pprintf = 0;
-#endif
-
-/*PRINTFLIKE3*/
-void
-cardbus_err(dev_info_t *dip, int level, const char *fmt, ...)
-{
-	if (cardbus_debug && (level <= cardbus_debug)) {
-		va_list adx;
-		int	instance;
-		char	buf[256];
-		const char	*name;
-		char	*nl = "";
-#if !defined(CARDBUS_DEBUG)
-		int	ce;
-		char	qmark = 0;
-
-		if (level <= 3)
-			ce = CE_WARN;
-		else
-			ce = CE_CONT;
-		if (level == 4)
-			qmark = 1;
-#endif
-
-		if (dip) {
-			instance = ddi_get_instance(dip);
-			/* name = ddi_binding_name(dip); */
-			name = ddi_driver_name(dip);
-		} else {
-			instance = 0;
-			name = "";
-		}
-
-		va_start(adx, fmt);
-		/* vcmn_err(ce, fmt, adx); */
-		/* vprintf(fmt, adx); */
-		/* prom_vprintf(fmt, adx); */
-		(void) vsprintf(buf, fmt, adx);
-		va_end(adx);
-
-		if (buf[strlen(buf) - 1] != '\n')
-			nl = "\n";
-
-#if defined(CARDBUS_DEBUG)
-		if (cardbus_do_pprintf) {
-			if (dip) {
-				if (instance >= 0)
-					prom_printf("%s(%d),0x%p: %s%s",
-					    name, instance, (void *)dip,
-					    buf, nl);
-				else
-					prom_printf("%s,0x%p: %s%s", name,
-					    (void *)dip, buf, nl);
-			} else
-				prom_printf("%s%s", buf, nl);
-		} else {
-			if (dip) {
-				if (instance >= 0)
-					cmn_err(CE_CONT, "%s(%d),0x%p: %s%s",
-					    name, instance, (void *)dip,
-					    buf, nl);
-				else
-					cmn_err(CE_CONT, "%s,0x%p: %s%s",
-					    name, (void *)dip, buf, nl);
-			} else
-				cmn_err(CE_CONT, "%s%s", buf, nl);
-		}
-#else
-		if (dip)
-			cmn_err(ce, qmark ? "?%s%d: %s%s" : "%s%d: %s%s",
-			    name, instance, buf, nl);
-		else
-			cmn_err(ce, qmark ? "?%s%s" : "%s%s", buf, nl);
-#endif
-	}
-}
-
-static void cardbus_expand_busrange(dev_info_t *dip)
-{
-	dev_info_t *pdip;
-	cardbus_bus_range_t *bus_range;
-	int len;
-
-	pdip = ddi_get_parent(dip);
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, pdip, DDI_PROP_DONTPASS, "bus-range",
-	    (caddr_t)&bus_range, &len) == DDI_PROP_SUCCESS) {
-		ndi_ra_request_t req;
-		uint64_t next_bus, blen;
-		uint32_t ret;
-		ddi_acc_handle_t handle;
-
-		if (bus_range->lo != bus_range->hi)
-			cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-			    "%u -> %u\n", bus_range->lo, bus_range->hi);
-		else {
-
-			bzero((caddr_t)&req, sizeof (ndi_ra_request_t));
-			req.ra_addr = bus_range->lo + 1;
-			req.ra_flags = NDI_RA_ALLOC_SPECIFIED;
-			req.ra_len = 12;
-
-			while ((req.ra_len > 0) &&
-			    (ret = ndi_ra_alloc(ddi_get_parent(pdip), &req,
-			    &next_bus, &blen, NDI_RA_TYPE_PCI_BUSNUM,
-			    NDI_RA_PASS)) != NDI_SUCCESS)
-				req.ra_len--;
-
-			if (ret != NDI_SUCCESS) {
-				cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-				    "fail to allocate bus number\n");
-				goto exit;
-			}
-
-			bus_range->hi = bus_range->lo + req.ra_len;
-			if (ndi_prop_update_int_array(DDI_DEV_T_NONE, pdip,
-			    "bus-range", (int *)bus_range, 2) != DDI_SUCCESS) {
-				cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-				    "fail to update bus-range property\n");
-				goto exit;
-			}
-
-			if (pci_config_setup(pdip, &handle) != DDI_SUCCESS) {
-				cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-				    "fail to pci_config_setup\n");
-				goto exit;
-			}
-
-			pci_config_put8(handle, PCI_BCNF_SECBUS, bus_range->lo);
-			pci_config_put8(handle, PCI_BCNF_SUBBUS, bus_range->hi);
-
-			cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-			    "parent dip %u -> %u\n",
-			    pci_config_get8(handle, PCI_BCNF_SECBUS),
-			    pci_config_get8(handle, PCI_BCNF_SUBBUS));
-			pci_config_teardown(&handle);
-
-			if (ndi_ra_map_setup(pdip, NDI_RA_TYPE_PCI_BUSNUM)
-			    != NDI_SUCCESS) {
-				cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-				    "fail to ndi_ra_map_setup of bus number\n");
-				goto exit;
-			}
-
-			(void) ndi_ra_free(pdip,
-			    (uint64_t)bus_range->lo + 1, req.ra_len,
-			    NDI_RA_TYPE_PCI_BUSNUM, 0);
-		}
-
-		bzero((caddr_t)&req, sizeof (ndi_ra_request_t));
-		req.ra_len = 2;
-
-		while ((req.ra_len > 0) &&
-		    (ret = ndi_ra_alloc(pdip, &req,
-		    &next_bus, &blen, NDI_RA_TYPE_PCI_BUSNUM,
-		    0)) != NDI_SUCCESS)
-			req.ra_len--;
-
-		cardbus_err(dip, 1, "cardbus_expand_busrange: "
-		    "cardbus dip base %u length %d\n",
-		    (int)next_bus, (int)req.ra_len);
-
-		if (ret != NDI_SUCCESS) {
-			cardbus_err(dip, 1, "cardbus_expand_busrange: "
-			    "fail to allocate bus number of length %d "
-			    "from parent\n",
-			    (int)req.ra_len);
-			goto exit;
-		}
-
-		if (ndi_ra_map_setup(dip, NDI_RA_TYPE_PCI_BUSNUM)
-		    != NDI_SUCCESS) {
-			cardbus_err(dip, 1, "cardbus_expand_busrange: "
-			    "fail to ndi_ra_map_setup of bus numbers\n");
-			goto exit;
-		}
-
-		(void) ndi_ra_free(dip,
-		    (uint64_t)next_bus, req.ra_len,
-		    NDI_RA_TYPE_PCI_BUSNUM, 0);
-exit:
-		kmem_free(bus_range, len);
-
-	} else
-		cardbus_err(pdip, 1, "cardbus_expand_busrange: "
-		    "parent dip doesn't have busrange prop\n");
-}
--- old/usr/src/uts/common/io/cardbus/cardbus.h	2014-11-12 17:44:40.099795591 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,136 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- */
-
-#ifndef	_SYS_CARDBUS_H
-#define	_SYS_CARDBUS_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#define	CB_BCNF_BCNTRL_ISA_INT_ENAB	0x0080
-#define	CB_BCNF_BCNTRL_MEM0_PREF	0x0100
-#define	CB_BCNF_BCNTRL_MEM1_PREF	0x0200
-#define	CB_BCNF_BCNTRL_WRITE_POST	0x0400
-
-typedef struct cb_nexus_cb {
-	void	(*enable_intr)(dev_info_t *);
-	void	(*disable_intr)(dev_info_t *);
-} cb_nexus_cb_t;
-
-typedef enum { PCIHP_SOFT_STATE_CLOSED, PCIHP_SOFT_STATE_OPEN,
-		PCIHP_SOFT_STATE_OPEN_EXCL } cbhp_soft_state_t;
-
-/*
- * Main softstate per cardbus device
- */
-typedef struct cardbus_dev {
-	int	cb_instance;
-	boolean_t fatal_problem;
-	dev_info_t *cb_dip;
-	kmutex_t cb_mutex;
-	cb_nexus_cb_t *cb_nex_ops;
-	struct dev_ops cb_dops;
-	struct dev_ops *orig_dopsp;
-	struct bus_ops *orig_bopsp;
-	struct cb_deviceset_props *cb_dsp;
-	ndi_event_hdl_t	cb_ndi_event_hdl;
-	ndi_event_set_t	cb_ndi_events;
-#ifdef HOTPLUG
-	/* Nexus specific variables */
-	ap_rstate_t	rstate;		/* state of Receptacle */
-	ap_ostate_t	ostate;		/* state of the Occupant */
-	ap_condition_t	condition;	/* condition of the occupant */
-	cbhp_soft_state_t	soft_state;
-	uint32_t	event_mask;	/* last event mask registerd */
-	boolean_t	auto_config;
-	boolean_t	disabled;
-	char	*name;
-
-	/* Slot specific variables */
-	char	ap_id[32];		/* Attachment point name */
-	char	*nexus_path;		/* Pathname of Nexus */
-	hpc_slot_ops_t	*slot_ops;	/* Ptr HPC entry points */
-	hpc_slot_info_t	slot_info;	/* Bus Specific SlotInfo */
-	hpc_slot_t	slot_handle;	/* HPS slot handle */
-	boolean_t card_present;
-	hpc_led_state_t leds[4];
-#endif
-} cbus_t;
-
-typedef struct cardbus_bus_range {
-	uint32_t lo;
-	uint32_t hi;
-} cardbus_bus_range_t;
-
-typedef struct cardbus_range {
-	uint32_t child_hi;
-	uint32_t child_mid;
-	uint32_t child_lo;
-	uint32_t parent_hi;
-	uint32_t parent_mid;
-	uint32_t parent_lo;
-	uint32_t size_hi;
-	uint32_t size_lo;
-
-} cardbus_range_t;
-
-#if defined(DEBUG)
-#define	CARDBUS_DEBUG
-#endif
-
-#ifdef CARDBUS_DEBUG
-extern void prom_printf(const char *, ...);
-#endif
-
-extern int cardbus_debug;
-
-#ifdef _KERNEL
-extern int cardbus_attach(dev_info_t *, cb_nexus_cb_t *);
-extern boolean_t cardbus_load_cardbus(dev_info_t *, uint_t, uint32_t);
-extern void cardbus_unload_cardbus(dev_info_t *);
-extern void cardbus_err(dev_info_t *dip, int level, const char *fmt, ...);
-
-/* The following only exists for hotplug support */
-extern int cardbus_open(dev_t *, int, int, cred_t *);
-extern int cardbus_close(dev_t, int, int, cred_t *);
-extern int cardbus_ioctl(dev_t, int, intptr_t, int, cred_t *,
-	    int *);
-extern boolean_t cardbus_is_cb_minor(dev_t);
-void cardbus_save_children(dev_info_t *dip);
-void cardbus_restore_children(dev_info_t *dip);
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif	/* _SYS_CARDBUS_H */
--- old/usr/src/uts/common/io/cardbus/cardbus_cfg.c	2014-11-12 17:44:40.152065300 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,4539 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- * From "@(#)pcicfg.c   1.31    99/06/18 SMI"
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * Cardbus configurator
- */
-
-#include <sys/ddi.h>
-#include <sys/sunndi.h>
-#include <sys/ndi_impldefs.h>
-
-#include <sys/pci.h>
-#include <sys/ebus.h>
-#include <sys/hotplug/hpctrl.h>
-#include <sys/hotplug/pci/pcicfg.h>
-
-#include <sys/pctypes.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-
-#include <sys/isa_defs.h>
-
-#include <sys/note.h>
-
-#include <sys/ethernet.h>
-
-#include "cardbus.h"
-#include "cardbus_parse.h"
-#include "cardbus_cfg.h"
-
-/*
- * ************************************************************************
- * *** Implementation specific local data structures/definitions.       ***
- * ************************************************************************
- */
-
-#define	PCICFG_MAX_DEVICE 32
-#define	PCICFG_MAX_FUNCTION 8
-
-static uint32_t pcicfg_max_device = PCICFG_MAX_DEVICE;
-static uint32_t pcicfg_max_function = PCICFG_MAX_FUNCTION;
-
-#define	PCICFG_NODEVICE 42
-#define	PCICFG_NOMEMORY 43
-#define	PCICFG_NOMULTI  44
-
-#define	PCICFG_HIADDR(n) ((uint32_t)(((uint64_t)(n) & 0xFFFFFFFF00000000)>> 32))
-#define	PCICFG_LOADDR(n) ((uint32_t)((uint64_t)(n) & 0x00000000FFFFFFFF))
-#define	PCICFG_LADDR(lo, hi)    (((uint64_t)(hi) << 32) | (uint32_t)(lo))
-
-#define	PCICFG_HIWORD(n) ((uint16_t)(((uint32_t)(n) & 0xFFFF0000)>> 16))
-#define	PCICFG_LOWORD(n) ((uint16_t)((uint32_t)(n) & 0x0000FFFF))
-#define	PCICFG_HIBYTE(n) ((uint8_t)(((uint16_t)(n) & 0xFF00)>> 8))
-#define	PCICFG_LOBYTE(n) ((uint8_t)((uint16_t)(n) & 0x00FF))
-
-#define	PCICFG_ROUND_UP(addr, gran) ((uintptr_t)((gran+addr-1)&(~(gran-1))))
-#define	PCICFG_ROUND_DOWN(addr, gran) ((uintptr_t)((addr) & ~(gran-1)))
-
-#define	PCICFG_MEMGRAN 0x100000
-#define	PCICFG_IOGRAN 0x1000
-#define	PCICFG_4GIG_LIMIT 0xFFFFFFFFUL
-#define	CBCFG_MEMGRAN 0x1000
-#define	CBCFG_IOGRAN 0x4
-
-#define	PCICFG_MEM_MULT 4
-#define	PCICFG_IO_MULT 4
-#define	PCICFG_RANGE_LEN 2 /* Number of range entries */
-
-/*
- * ISA node declaration structure.
- */
-struct isa_node {
-	char	*name;
-	char	*compatible[5];
-	char	*type;
-	char	*model;
-	uint16_t	reg;
-	uint16_t	span;
-};
-
-struct cardbus_name_entry {
-	uint32_t class_code;
-	char  *name;
-	int pil;
-};
-
-struct cardbus_find_ctrl {
-	uint_t		bus;
-	uint_t		device;
-	uint_t		function;
-	dev_info_t	*dip;
-};
-
-#define	PCICFG_MAKE_REG_HIGH(busnum, devnum, funcnum, register)\
-	(\
-	((ulong_t)(busnum & 0xff) << 16)    |\
-	((ulong_t)(devnum & 0x1f) << 11)    |\
-	((ulong_t)(funcnum & 0x7) <<  8)    |\
-	((ulong_t)(register & 0x3f)))
-
-typedef struct cardbus_phdl cardbus_phdl_t;
-
-struct cardbus_phdl {
-
-	dev_info_t	*dip;	/* Associated with the attach point */
-	dev_info_t	*res_dip; /* dip from which io/mem is allocated */
-	cardbus_phdl_t  *next;
-
-	uint64_t	memory_base;    /* Memory base for this attach point */
-	uint64_t	memory_last;
-	uint64_t	memory_len;
-	uint32_t	memory_gran;
-	uint32_t	io_base;	/* I/O base for this attach point */
-	uint32_t	io_last;
-	uint32_t	io_len;
-	uint32_t	io_gran;
-
-	int	error;
-	uint_t	highest_bus;    /* Highest bus seen on the probe */
-	ndi_ra_request_t mem_req;	/* allocator request for memory */
-	ndi_ra_request_t io_req;	/* allocator request for I/O */
-};
-
-typedef struct {
-	dev_info_t  *dip;	/* Associated with the attach point */
-	ddi_acc_handle_t handle;    /* open handle on parent PCI config space */
-	uint32_t    io_base;	/* I/O base for this attach point */
-	int	io_decode_reg;
-} isa_phdl_t;
-
-
-/*
- * forward declarations for routines defined in this module (called here)
- */
-static cardbus_phdl_t *cardbus_find_phdl(dev_info_t *dip);
-static cardbus_phdl_t *cardbus_create_phdl(dev_info_t *dip);
-static int cardbus_destroy_phdl(dev_info_t *dip);
-static int cardbus_program_ap(dev_info_t *);
-static void cardbus_topbridge_assign(dev_info_t *, cardbus_phdl_t *);
-static int cardbus_bridge_ranges(dev_info_t *, cardbus_phdl_t *,
-			ddi_acc_handle_t);
-static int cardbus_bridge_assign(dev_info_t *, void *);
-static int cardbus_isa_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
-			ddi_acc_handle_t handle);
-static int cardbus_add_isa_reg(dev_info_t *, void *);
-static int cardbus_allocate_chunk(dev_info_t *, uint8_t, uint8_t);
-static int cardbus_free_chunk(dev_info_t *);
-static void cardbus_setup_bridge(dev_info_t *, cardbus_phdl_t *,
-			ddi_acc_handle_t);
-static void cardbus_update_bridge(dev_info_t *, cardbus_phdl_t *,
-			ddi_acc_handle_t);
-static void cardbus_get_mem(dev_info_t *, cardbus_phdl_t *, uint32_t,
-			uint64_t *);
-static void cardbus_get_io(dev_info_t *, cardbus_phdl_t *, uint32_t,
-			uint32_t *);
-static int cardbus_sum_resources(dev_info_t *, void *);
-static int cardbus_free_bridge_resources(dev_info_t *);
-static int cardbus_free_device_resources(dev_info_t *);
-static int cardbus_free_resources(dev_info_t *);
-static int cardbus_probe_bridge(cbus_t *, dev_info_t *, uint_t,
-			uint_t, uint_t);
-static int cardbus_probe_children(cbus_t *, dev_info_t *, uint_t, uint_t,
-			uint_t, uint8_t *);
-static int cardbus_add_config_reg(dev_info_t *, uint_t, uint_t, uint_t);
-static int cardbus_add_isa_node(cbus_t *, dev_info_t *, struct isa_node *);
-static int cardbus_config_setup(dev_info_t *, ddi_acc_handle_t *);
-static void cardbus_config_teardown(ddi_acc_handle_t *);
-static void cardbus_reparent_children(dev_info_t *, dev_info_t *);
-static int cardbus_update_assigned_prop(dev_info_t *, pci_regspec_t *);
-static int cardbus_update_available_prop(dev_info_t *, uint32_t,
-			uint64_t, uint64_t);
-static int cardbus_update_ranges_prop(dev_info_t *, cardbus_range_t *);
-static int cardbus_update_reg_prop(dev_info_t *dip, uint32_t regvalue,
-			uint_t reg_offset);
-static int cardbus_set_standard_props(dev_info_t *parent, dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static int cardbus_set_isa_props(dev_info_t *parent, dev_info_t *dip,
-			char *name, char *compat[]);
-static int cardbus_set_busnode_props(dev_info_t *);
-static int cardbus_set_busnode_isaprops(dev_info_t *);
-static int cardbus_set_childnode_props(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void cardbus_set_bus_numbers(ddi_acc_handle_t config_handle,
-			uint_t primary, uint_t secondary);
-static void enable_pci_isa_bridge(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void enable_pci_pci_bridge(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void enable_cardbus_bridge(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void disable_pci_pci_bridge(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void disable_cardbus_bridge(dev_info_t *dip,
-			ddi_acc_handle_t config_handle);
-static void enable_cardbus_device(dev_info_t *, ddi_acc_handle_t);
-static void disable_cardbus_device(ddi_acc_handle_t config_handle);
-static void cardbus_force_boolprop(dev_info_t *dip, char *pname);
-static void cardbus_force_intprop(dev_info_t *dip, char *pname,
-			int *pval, int len);
-static void cardbus_force_stringprop(dev_info_t *dip, char *pname,
-			char *pval);
-static void split_addr(char *, int *, int *);
-#ifdef DEBUG
-static void cardbus_dump_common_config(ddi_acc_handle_t config_handle);
-static void cardbus_dump_device_config(ddi_acc_handle_t config_handle);
-static void cardbus_dump_bridge_config(ddi_acc_handle_t config_handle,
-			uint8_t header_type);
-static void cardbus_dump_config(ddi_acc_handle_t config_handle);
-static void cardbus_dump_reg(dev_info_t *dip, const pci_regspec_t *regspec,
-			int nelems);
-#endif
-
-static cardbus_phdl_t *cardbus_phdl_list = NULL;
-
-static struct cardbus_name_entry cardbus_class_lookup [] = {
-	{ 0x001, "display", 9 },
-	{ 0x100, "scsi", 4 },
-	{ 0x101, "ide", 4 },
-	{ 0x102, "fdc", 4 },
-	{ 0x103, "ipi", 4 },
-	{ 0x104, "raid", 4 },
-	{ 0x200, "ethernet", 6 },
-	{ 0x201, "token-ring", 6 },
-	{ 0x202, "fddi", 6 },
-	{ 0x203, "atm", 6 },
-	{ 0x300, "display", 9 },    /* VGA card */
-	{ 0x380, "display", 9 },    /* other - for the Raptor Card */
-	{ 0x400, "video", 11 },
-	{ 0x401, "sound", 11 },
-	{ 0x500, "memory", 11 },
-	{ 0x501, "flash", 11 },
-	{ 0x600, "host", 11 },
-	{ 0x601, "isa", 11 },
-	{ 0x602, "eisa", 11 },
-	{ 0x603, "mca", 11 },
-	{ 0x604, "pci", 11 },
-	{ 0x605, "pcmcia", 11 },
-	{ 0x606, "nubus", 11 },
-	{ 0x607, "cardbus", 11 },
-	{ 0x680, NULL, 8 },
-	{ 0x700, "serial", 11 },
-	{ 0x701, "parallel", 6 },
-	{ 0x800, "interrupt-controller", 3 },
-	{ 0x801, "dma-controller", 3 },
-	{ 0x802, "timer", 3 },
-	{ 0x803, "rtc", 3 },
-	{ 0x900, "keyboard", 8 },
-	{ 0x901, "pen", 8 },
-	{ 0x902, "mouse", 8 },
-	{ 0xa00, "dock", 1 },
-	{ 0xb00, "cpu", 1 },
-	{ 0xc00, "firewire", 9 },
-	{ 0xc01, "access-bus", 4 },
-	{ 0xc02, "ssa", 4 },
-	{ 0xc03, "usb", 9 },
-	{ 0xc04, "fibre-channel", 6 },
-	{ 0, 0 }
-};
-
-#ifndef _DONT_USE_1275_GENERIC_NAMES
-static char *cardbus_get_class_name(uint32_t classcode);
-#endif /* _DONT_USE_1275_GENERIC_NAMES */
-
-/*
- * Reprogram ILINE with default value only if BIOS doesn't program it
- */
-int
-cardbus_validate_iline(dev_info_t *dip, ddi_acc_handle_t handle)
-{
-	uint8_t intline = 0xff;
-
-	if (pci_config_get8(handle, PCI_CONF_IPIN)) {
-	intline = pci_config_get8(handle, PCI_CONF_ILINE);
-	if ((intline == 0) || (intline == 0xff)) {
-		intline = ddi_getprop(DDI_DEV_T_ANY, dip,
-			DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-			"interrupt-line", 0xff);
-		if (intline == (uint8_t)0xff) {
-			intline = ddi_getprop(DDI_DEV_T_ANY,
-				ddi_get_parent(dip),
-				DDI_PROP_CANSLEEP /* |DDI_PROP_DONTPASS */,
-				"interrupt-line", 0xb);
-		}
-
-		pci_config_put8(handle, PCI_CONF_ILINE, intline);
-	}
-	(void) ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		"interrupt-line", intline);
-	}
-	return (intline);
-}
-
-/*
- * This entry point is called to configure a device (and
- * all its children) on the given bus. It is called when
- * a new device is added to the PCI domain.  This routine
- * will create the device tree and program the devices
- * registers.
- */
-int
-cardbus_configure(cbus_t *cbp)
-{
-	uint_t bus;
-	int cardbus_dev, func;
-	dev_info_t *attach_point;
-
-	cardbus_err(cbp->cb_dip, 6, "cardbus_configure ()\n");
-
-	bus = cardbus_primary_busno(cbp->cb_dip);
-
-	if (ndi_devi_alloc(cbp->cb_dip, DEVI_PSEUDO_NEXNAME,
-	    (pnode_t)DEVI_SID_NODEID,
-	    &attach_point) != NDI_SUCCESS) {
-		cardbus_err(cbp->cb_dip, 1,
-		    "cardbus_configure(): Failed to alloc probe node\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * Node name marks this node as the "attachment point".
-	 */
-	if (ndi_devi_set_nodename(attach_point,
-	    "hp_attachment", 0) != NDI_SUCCESS) {
-	    cardbus_err(cbp->cb_dip, 1,
-		    "Failed to set nodename for attachment node\n");
-		(void) ndi_devi_free(attach_point);
-		return (PCICFG_FAILURE);
-	}
-
-	cardbus_err(ddi_get_parent(attach_point), 8,
-	    "Set bus type to cardbus\n");
-	(void) ddi_prop_update_string(DDI_DEV_T_NONE,
-	    ddi_get_parent(attach_point), PCM_DEVICETYPE,
-	    "cardbus");
-
-	split_addr(ddi_get_name_addr(cbp->cb_dip), &cardbus_dev, &func);
-
-	cardbus_err(attach_point, 8,
-	    "Configuring [0x%x][0x%x][0x%x]\n", bus, cardbus_dev, func);
-
-	switch (cardbus_probe_bridge(cbp, attach_point,
-	    bus, cardbus_dev, func)) {
-	case PCICFG_FAILURE:
-		cardbus_err(cbp->cb_dip, 4,
-		    "configure failed: bus [0x%x] slot [0x%x] func [0x%x]\n",
-		    bus, cardbus_dev, func);
-		goto cleanup;
-	case PCICFG_NODEVICE:
-		cardbus_err(cbp->cb_dip, 4,
-		    "no device: bus [0x%x] slot [0x%x] func [0x%x]\n",
-		    bus, cardbus_dev, func);
-		goto cleanup;
-	default:
-		cardbus_err(cbp->cb_dip, 9,
-		    "configure: bus => [%d] slot => [%d] func => [%d]\n",
-		    bus, cardbus_dev, func);
-		break;
-	}
-
-	if (cardbus_program_ap(cbp->cb_dip) == PCICFG_SUCCESS) {
-		(void) cardbus_reparent_children(attach_point, cbp->cb_dip);
-		(void) ndi_devi_free(attach_point);
-		cbp->cb_nex_ops->enable_intr(cbp->cb_dip);
-		return (PCICFG_SUCCESS);
-	}
-
-	cardbus_err(cbp->cb_dip, 1, "Failed to program devices\n");
-
-cleanup:
-	/*
-	 * Clean up a partially created "probe state" tree.
-	 * There are no resources allocated to the in the
-	 * probe state.
-	 */
-
-	cardbus_err(cbp->cb_dip, 6,
-	    "Look up device [0x%x] function [0x%x] to clean up\n",
-	    cardbus_dev, func);
-
-	cardbus_err(cbp->cb_dip, 6,
-	    "Cleaning up device [0x%x] function [0x%x]\n",
-	    cardbus_dev, func);
-
-	/*
-	 * If this was a bridge device it will have a
-	 * probe handle - if not, no harm in calling this.
-	 */
-	(void) cardbus_destroy_phdl(cbp->cb_dip);
-
-	if (ddi_get_child(attach_point)) {
-		/*
-		 * This will free up the node
-		 */
-		(void) ndi_devi_offline(ddi_get_child(attach_point),
-		    NDI_UNCONFIG|NDI_DEVI_REMOVE);
-	}
-	(void) ndi_devi_free(attach_point);
-
-	return (PCICFG_FAILURE);
-}
-
-int
-cardbus_unconfigure(cbus_t *cbp)
-{
-	ddi_acc_handle_t config_handle;
-	dev_info_t *dip = cbp->cb_dip;
-
-	cbp->cb_nex_ops->disable_intr(dip);
-	if (pci_config_setup(dip, &config_handle) == DDI_SUCCESS) {
-		disable_cardbus_bridge(dip, config_handle);
-		(void) pci_config_teardown(&config_handle);
-	} else {
-		cardbus_err(dip, 1,
-		    "cardbus_unconfigure(): Failed to setup config space\n");
-	}
-
-	(void) cardbus_free_chunk(dip);
-	cardbus_err(dip, 6,
-	    "cardbus_unconfigure: calling cardbus_free_bridge_resources\n");
-	(void) cardbus_free_bridge_resources(dip);
-
-	return (PCICFG_SUCCESS);
-}
-
-int
-cardbus_teardown_device(dev_info_t *dip)
-{
-	/*
-	 * Free up resources associated with 'dip'
-	 */
-
-	if (cardbus_free_resources(dip) != PCICFG_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_teardown_device: Failed to free resources\n");
-		return (PCICFG_FAILURE);
-	}
-
-	if (ndi_devi_offline(dip, NDI_DEVI_REMOVE) != NDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_teardown_device: "
-		    "Failed to offline and remove node\n");
-		return (PCICFG_FAILURE);
-	}
-
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Get the primary pci bus number. This should be the lowest number
- * in the bus-range property of our parent.
- */
-int
-cardbus_primary_busno(dev_info_t *dip)
-{
-	int	len, rval;
-	char	bus_type[16] = "(unknown)";
-	dev_info_t *par = ddi_get_parent(dip);
-	cardbus_bus_range_t *bus_range;
-
-	ASSERT(strcmp(ddi_driver_name(dip), "pcic") == 0);
-	len = sizeof (bus_type);
-	if ((ddi_prop_op(DDI_DEV_T_ANY, par, PROP_LEN_AND_VAL_BUF,
-	    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-	    "device_type",
-	    (caddr_t)&bus_type, &len) == DDI_SUCCESS)) {
-		ASSERT((strcmp(bus_type, "pci") == 0) ||
-		    (strcmp(bus_type, "cardbus") == 0));
-		if (ddi_getlongprop(DDI_DEV_T_ANY, par, 0, "bus-range",
-		    (caddr_t)&bus_range, &len) == DDI_PROP_SUCCESS) {
-			cardbus_err(dip, 9,
-			    "cardbus_primary_busno: bus range is %d to %d\n",
-			    bus_range->lo, bus_range->hi);
-			rval = (int)bus_range->lo;
-			kmem_free((caddr_t)bus_range, len);
-			return (rval);
-		}
-	}
-
-	cardbus_err(dip, 2,
-	    "cardbus_primary_busno: Not a pci device or no bus-range\n");
-	return (-1);
-}
-
-static cardbus_phdl_t *
-cardbus_find_phdl(dev_info_t *dip)
-{
-	cardbus_phdl_t *entry;
-
-	mutex_enter(&cardbus_list_mutex);
-	for (entry = cardbus_phdl_list; entry != NULL; entry = entry->next) {
-		if (entry->dip == dip) {
-			mutex_exit(&cardbus_list_mutex);
-			return (entry);
-		}
-	}
-	mutex_exit(&cardbus_list_mutex);
-
-	/*
-	 * Did'nt find entry - create one
-	 */
-	return (cardbus_create_phdl(dip));
-}
-
-static cardbus_phdl_t *
-cardbus_create_phdl(dev_info_t *dip)
-{
-	cardbus_phdl_t *new;
-
-	new = (cardbus_phdl_t *)kmem_zalloc(sizeof (cardbus_phdl_t), KM_SLEEP);
-
-	new->dip = dip;
-	new->io_gran = CBCFG_IOGRAN;
-	new->memory_gran = CBCFG_MEMGRAN;
-	mutex_enter(&cardbus_list_mutex);
-	new->next = cardbus_phdl_list;
-	cardbus_phdl_list = new;
-	mutex_exit(&cardbus_list_mutex);
-
-	return (new);
-}
-
-static int
-cardbus_destroy_phdl(dev_info_t *dip)
-{
-	cardbus_phdl_t *entry;
-	cardbus_phdl_t *follow = NULL;
-	ra_return_t	res;
-
-	mutex_enter(&cardbus_list_mutex);
-	for (entry = cardbus_phdl_list; entry != NULL; follow = entry,
-	    entry = entry->next) {
-		if (entry->dip == dip) {
-			if (entry == cardbus_phdl_list) {
-				cardbus_phdl_list = entry->next;
-			} else {
-				follow->next = entry->next;
-			}
-			/*
-			 * If this entry has any allocated memory
-			 * or IO space associated with it, that
-			 * must be freed up.
-			 */
-			if (entry->memory_len > 0) {
-				res.ra_addr_lo = entry->memory_base;
-				res.ra_len = entry->memory_len;
-				(void) pcmcia_free_mem(entry->res_dip, &res);
-#ifdef  _LP64
-				cardbus_err(dip, 8,
-				    "cardbus_destroy_phdl: "
-				    "MEMORY BASE = [0x%lx] length [0x%lx]\n",
-				    entry->memory_base, entry->memory_len);
-#else
-				cardbus_err(dip, 8,
-				    "cardbus_destroy_phdl: "
-				    "MEMORY BASE = [0x%llx] length [0x%llx]\n",
-				    entry->memory_base, entry->memory_len);
-#endif
-			}
-			if (entry->io_len > 0) {
-				res.ra_addr_lo = entry->io_base;
-				res.ra_len = entry->io_len;
-				(void) pcmcia_free_io(entry->res_dip, &res);
-				cardbus_err(dip, 8,
-				    "cardbus_destroy_phdl: "
-				    "IO BASE = [0x%x] length [0x%x]\n",
-				    entry->io_base, entry->io_len);
-			}
-			/*
-			 * Destroy this entry
-			 */
-			kmem_free((caddr_t)entry, sizeof (cardbus_phdl_t));
-			mutex_exit(&cardbus_list_mutex);
-			return (PCICFG_SUCCESS);
-		}
-	}
-
-	mutex_exit(&cardbus_list_mutex);
-
-	/*
-	 * Didn't find the entry
-	 */
-	return (PCICFG_FAILURE);
-}
-
-static int
-cardbus_program_ap(dev_info_t *dip)
-{
-	cardbus_phdl_t *phdl;
-	uint8_t header_type, sec_bus;
-	ddi_acc_handle_t handle;
-
-	if (pci_config_setup(dip, &handle) != DDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_program_ap: Failed to map config space!\n");
-		return (PCICFG_FAILURE);
-	}
-
-	header_type = pci_config_get8(handle, PCI_CONF_HEADER);
-	sec_bus = pci_config_get8(handle, PCI_BCNF_SECBUS);
-
-	cardbus_err(dip, 6,
-	    "cardbus_program_ap (header_type=0x%x)\n", header_type);
-	(void) pci_config_teardown(&handle);
-
-	/*
-	 * Header type two is PCI to Cardbus bridge, see page 43 of the
-	 * CL-PD6832 data sheet
-	 */
-	switch (header_type & PCI_HEADER_TYPE_M) {
-	case PCI_HEADER_CARDBUS:
-		cardbus_err(dip, 8,
-		    "cardbus_program_ap calling cardbus_allocate_chunk\n");
-		if (cardbus_allocate_chunk(dip,
-		    header_type & PCI_HEADER_TYPE_M,
-		    sec_bus) != PCICFG_SUCCESS) {
-			cardbus_err(dip, 1,
-			    "cardbus_program_ap: "
-			    "Not enough memory to hotplug\n");
-			(void) cardbus_destroy_phdl(dip);
-			return (PCICFG_FAILURE);
-		}
-
-		cardbus_err(dip, 8,
-		    "cardbus_program_ap calling cardbus_find_phdl\n");
-		phdl = cardbus_find_phdl(dip);
-		ASSERT(phdl);
-
-		if (phdl == NULL) {
-			cardbus_err(dip, 1, "cardbus_find_phdl failed\n");
-			return (PCICFG_FAILURE);
-		}
-		phdl->error = PCICFG_SUCCESS;
-		cardbus_err(dip, 8,
-		    "cardbus_program_ap calling cardbus_topbridge_assign\n");
-		cardbus_topbridge_assign(dip, phdl);
-
-		if (phdl->error != PCICFG_SUCCESS) {
-			cardbus_err(dip, 1, "Problem assigning bridge\n");
-			(void) cardbus_destroy_phdl(dip);
-			return (phdl->error);
-		}
-		break;
-
-	default:
-		return (PCICFG_FAILURE);
-	}
-
-	return (PCICFG_SUCCESS);
-}
-
-static void
-cardbus_topbridge_assign(dev_info_t *dip, cardbus_phdl_t *entry)
-{
-	ddi_acc_handle_t handle;
-	uint8_t header_type;
-
-	cardbus_err(dip, 6, "cardbus_topbridge_assign\n");
-
-	if (pci_config_setup(dip, &handle) != DDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_topbridge_bridge_assign: "
-		    "Failed to map config space!\n");
-		return;
-	}
-
-	header_type = pci_config_get8(handle,
-	    PCI_CONF_HEADER) & PCI_HEADER_TYPE_M;
-
-	/* cardbus bridge is the same as PCI-PCI bridge */
-	ASSERT((header_type == PCI_HEADER_PPB) ||
-	    (header_type == PCI_HEADER_CARDBUS));
-
-	(void) cardbus_bridge_ranges(dip, entry, handle);
-
-	(void) pci_config_teardown(&handle);
-}
-
-static int
-cardbus_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
-			ddi_acc_handle_t handle)
-{
-	cardbus_range_t range[PCICFG_RANGE_LEN];
-	int bus_range[2];
-	int count;
-	int i;
-
-	cardbus_err(dip, 8, "cardbus_bridge_ranges\n");
-
-	bzero((caddr_t)range, sizeof (cardbus_range_t) * PCICFG_RANGE_LEN);
-
-	(void) cardbus_setup_bridge(dip, entry, handle);
-
-	range[0].child_hi = range[0].parent_hi |= (PCI_REG_REL_M | PCI_ADDR_IO);
-	range[0].child_lo = range[0].parent_lo = entry->io_last;
-	range[1].child_hi = range[1].parent_hi |= (PCI_REG_REL_M |
-						PCI_ADDR_MEM32);
-	range[1].child_lo = range[1].parent_lo = entry->memory_last;
-
-	ndi_devi_enter(dip, &count);
-	ddi_walk_devs(ddi_get_child(dip), cardbus_bridge_assign, (void *)entry);
-	ndi_devi_exit(dip, count);
-
-	(void) cardbus_update_bridge(dip, entry, handle);
-
-	bus_range[0] = pci_config_get8(handle, PCI_BCNF_SECBUS);
-	bus_range[1] = pci_config_get8(handle, PCI_BCNF_SUBBUS);
-
-	cardbus_err(dip, 8,
-	    "Set up bus-range property to %u->%u\n",
-	    bus_range[0], bus_range[1]);
-
-	if ((i = ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    "bus-range",
-	    bus_range, 2)) != DDI_SUCCESS) {
-
-		if (i == DDI_PROP_NOT_FOUND) {
-			cardbus_err(dip, 8,
-			    "Create bus-range property, %u->%u\n",
-			    bus_range[0], bus_range[1]);
-			i = ddi_prop_create(DDI_DEV_T_NONE, dip,
-			    DDI_PROP_CANSLEEP,
-			    "bus-range", (caddr_t)bus_range,
-			    sizeof (bus_range));
-		}
-
-		if (i != DDI_PROP_SUCCESS) {
-			cardbus_err(dip, 1,
-			    "Failed to set bus-range property, %u->%u (%d)\n",
-			    bus_range[0], bus_range[1], i);
-			entry->error = PCICFG_FAILURE;
-			return (DDI_WALK_TERMINATE);
-		}
-	}
-
-	if (entry->io_len > 0) {
-		range[0].size_lo = entry->io_last - entry->io_base;
-		if (cardbus_update_ranges_prop(dip, &range[0])) {
-			cardbus_err(dip, 1, "Failed to update ranges (i/o)\n");
-			entry->error = PCICFG_FAILURE;
-			return (DDI_WALK_TERMINATE);
-		}
-	}
-	if (entry->memory_len > 0) {
-		range[1].size_lo = entry->memory_last - entry->memory_base;
-		if (cardbus_update_ranges_prop(dip, &range[1])) {
-			cardbus_err(dip, 1,
-			    "Failed to update ranges (memory)\n");
-			entry->error = PCICFG_FAILURE;
-			return (DDI_WALK_TERMINATE);
-		}
-	}
-
-	return (DDI_WALK_PRUNECHILD);
-}
-static int
-cardbus_bridge_assign(dev_info_t *dip, void *hdl)
-{
-	ddi_acc_handle_t handle;
-	pci_regspec_t *reg;
-	int length;
-	int rcount;
-	int i;
-	int offset;
-	uint64_t mem_answer;
-	uint32_t io_answer, request;
-	uint8_t header_type, base_class;
-	cardbus_phdl_t *entry = (cardbus_phdl_t *)hdl;
-
-	/*
-	 * Ignore the attachment point and pcs.
-	 */
-	if (strcmp(ddi_binding_name(dip), "hp_attachment") == 0 ||
-	    strcmp(ddi_binding_name(dip), "pcs") == 0) {
-		cardbus_err(dip, 8, "cardbus_bridge_assign: Ignoring\n");
-		return (DDI_WALK_CONTINUE);
-	}
-
-
-	cardbus_err(dip, 6, "cardbus_bridge_assign\n");
-
-	if (entry == NULL) {
-		cardbus_err(dip, 1, "Failed to get entry\n");
-		return (DDI_WALK_TERMINATE);
-	}
-	if (cardbus_config_setup(dip, &handle) != DDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_bridge_assign: Failed to map config space!\n");
-		entry->error = PCICFG_FAILURE;
-		return (DDI_WALK_TERMINATE);
-	}
-
-	header_type = pci_config_get8(handle, PCI_CONF_HEADER) &
-		PCI_HEADER_TYPE_M;
-	base_class = pci_config_get8(handle, PCI_CONF_BASCLASS);
-
-	/*
-	 * This function is not called for the top bridge and we are
-	 * not enumerating down a further cardbus interface yet!
-	 */
-	if (base_class == PCI_CLASS_BRIDGE) {
-		uint8_t	sub_class;
-
-		sub_class = pci_config_get8(handle, PCI_CONF_SUBCLASS);
-
-		switch (sub_class) {
-		case PCI_BRIDGE_PCI:
-			if (header_type == PCI_HEADER_PPB) {
-				i = cardbus_bridge_ranges(dip, entry, handle);
-				(void) cardbus_config_teardown(&handle);
-				return (i);
-			}
-			goto bad_device;
-
-		case PCI_BRIDGE_ISA:
-			i = cardbus_isa_bridge_ranges(dip, entry, handle);
-			(void) cardbus_config_teardown(&handle);
-			return (i);
-
-		case PCI_BRIDGE_CARDBUS:
-			/*
-			 * Fall through, there should be at least one register
-			 * set for this.
-			 */
-			break;
-
-		case PCI_BRIDGE_OTHER:
-		default:
-			break;
-		}
-	}
-
-#ifdef sparc
-	/*
-	 * If there is an interrupt pin set program
-	 * interrupt line with default values.
-	 */
-	if (pci_config_get8(handle, PCI_CONF_IPIN)) {
-	    pci_config_put8(handle, PCI_CONF_ILINE, 0xf);
-	}
-#else
-	(void) cardbus_validate_iline(dip, handle);
-#endif
-
-	/*
-	 * A single device (under a bridge).
-	 * For each "reg" property with a length, allocate memory
-	 * and program the base registers.
-	 */
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "reg", (caddr_t)&reg,
-	    &length) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1, "Failed to read reg property\n");
-		entry->error = PCICFG_FAILURE;
-		(void) cardbus_config_teardown(&handle);
-		return (DDI_WALK_TERMINATE);
-	}
-
-	rcount = length / sizeof (pci_regspec_t);
-	cardbus_err(dip, 9, "rcount = %d\n", rcount);
-
-	for (i = 0; i < rcount; i++) {
-		if ((reg[i].pci_size_low != 0) || (reg[i].pci_size_hi != 0)) {
-			offset = PCI_REG_REG_G(reg[i].pci_phys_hi);
-			switch (PCI_REG_ADDR_G(reg[i].pci_phys_hi)) {
-			case PCI_REG_ADDR_G(PCI_ADDR_MEM64):
-
-				(void) cardbus_get_mem(ddi_get_parent(dip),
-				    entry, reg[i].pci_size_low, &mem_answer);
-				ASSERT(!PCICFG_HIADDR(mem_answer));
-				pci_config_put32(handle, offset,
-				    PCICFG_LOADDR(mem_answer));
-				pci_config_put32(handle, offset + 4,
-				    PCICFG_HIADDR(mem_answer));
-				cardbus_err(dip, 8,
-				    "REGISTER (64)LO [0x%x] ----> [0x%02x]\n",
-				    pci_config_get32(handle, offset), offset);
-				cardbus_err(dip, 8,
-				    "REGISTER (64)HI [0x%x] ----> [0x%02x]\n",
-				    pci_config_get32(handle, offset+4),
-					offset+4);
-				reg[i].pci_phys_low = PCICFG_HIADDR(mem_answer);
-				reg[i].pci_phys_mid = PCICFG_LOADDR(mem_answer);
-				break;
-
-			case PCI_REG_ADDR_G(PCI_ADDR_MEM32):
-				/* allocate memory space from the allocator */
-
-				(void) cardbus_get_mem(ddi_get_parent(dip),
-				    entry, reg[i].pci_size_low, &mem_answer);
-				pci_config_put32(handle, offset, 0xffffffff);
-				request = pci_config_get32(handle, offset);
-
-				pci_config_put32(handle, offset,
-				    (uint32_t)mem_answer);
-				reg[i].pci_phys_low = (uint32_t)mem_answer;
-				reg[i].pci_phys_mid = 0;
-				if (((PCI_BASE_TYPE_M & request) ==
-					PCI_BASE_TYPE_ALL) &&
-				    ((PCI_BASE_SPACE_M & request) ==
-					PCI_BASE_SPACE_MEM)) {
-					cardbus_err(dip, 8,
-					    "REGISTER (64)LO [0x%x] ----> "
-					    "[0x%02x]\n",
-					    pci_config_get32(handle, offset),
-						offset);
-					    pci_config_put32(handle,
-						offset + 4, 0);
-					cardbus_err(dip, 8,
-					    "REGISTER (64)HI [0x%x] ----> "
-					    "[0x%02x]\n",
-					    pci_config_get32(handle, offset+4),
-						offset+4);
-				} else {
-					cardbus_err(dip, 8,
-					    "REGISTER (32)LO [0x%x] ----> "
-					    "[0x%02x]\n",
-					    pci_config_get32(handle, offset),
-					    offset);
-				}
-				break;
-
-			case PCI_REG_ADDR_G(PCI_ADDR_IO):
-				/* allocate I/O space from the allocator */
-
-				(void) cardbus_get_io(ddi_get_parent(dip),
-				    entry, reg[i].pci_size_low, &io_answer);
-				pci_config_put32(handle, offset, io_answer);
-				cardbus_err(dip, 8,
-				    "REGISTER (I/O)LO [0x%x] ----> [0x%02x]\n",
-				    pci_config_get32(handle, offset), offset);
-				reg[i].pci_phys_low = io_answer;
-				break;
-
-			default:
-				cardbus_err(dip, 1, "Unknown register type\n");
-				kmem_free(reg, length);
-				(void) cardbus_config_teardown(&handle);
-				entry->error = PCICFG_FAILURE;
-				return (DDI_WALK_TERMINATE);
-			} /* switch */
-
-			/*
-			 * Now that memory locations are assigned,
-			 * update the assigned address property.
-			 */
-			if (cardbus_update_assigned_prop(dip,
-			    &reg[i]) != PCICFG_SUCCESS) {
-				kmem_free(reg, length);
-				(void) cardbus_config_teardown(&handle);
-				entry->error = PCICFG_FAILURE;
-				return (DDI_WALK_TERMINATE);
-			}
-		}
-	}
-	kmem_free(reg, length);
-	enable_cardbus_device(dip, handle);
-#ifdef CARDBUS_DEBUG
-	if (cardbus_debug >= 9) {
-		cardbus_dump_config(handle);
-	}
-#endif
-bad_device:
-	(void) cardbus_config_teardown(&handle);
-	return (DDI_WALK_CONTINUE);
-}
-
-static int
-cardbus_isa_bridge_ranges(dev_info_t *dip, cardbus_phdl_t *entry,
-			ddi_acc_handle_t handle)
-{
-	struct ebus_pci_rangespec range;
-	int count;
-	pci_regspec_t *reg;
-	int length;
-	int rcount;
-	uint32_t io_answer = 0xffffffff;
-	isa_phdl_t isa_phdl;
-	int i;
-
-	cardbus_err(dip, 8, "cardbus_isa_bridge_ranges\n");
-
-	bzero((caddr_t)&range, sizeof (range));
-
-#ifdef sparc
-	/*
-	 * If there is an interrupt pin set program
-	 * interrupt line with default values.
-	 */
-	if (pci_config_get8(handle, PCI_CONF_IPIN)) {
-	    pci_config_put8(handle, PCI_CONF_ILINE, 0xf);
-	}
-#else
-	(void) cardbus_validate_iline(dip, handle);
-#endif
-
-	/*
-	 * For each "reg" property with a length, allocate memory.
-	 */
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "reg", (caddr_t)&reg,
-	    &length) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1, "Failed to read reg property\n");
-		entry->error = PCICFG_FAILURE;
-		return (DDI_WALK_TERMINATE);
-	}
-
-	rcount = length / sizeof (pci_regspec_t);
-
-	for (i = 0; i < rcount; i++) {
-		if ((reg[i].pci_size_low != 0) || (reg[i].pci_size_hi != 0)) {
-			switch (PCI_REG_ADDR_G(reg[i].pci_phys_hi)) {
-			case PCI_REG_ADDR_G(PCI_ADDR_IO):
-				/* allocate I/O space from the allocator */
-
-				(void) cardbus_get_io(ddi_get_parent(dip),
-				    entry, reg[i].pci_size_low, &io_answer);
-				cardbus_err(dip, 8,
-				    "ISA (I/O)LO ----> [0x%x]\n", io_answer);
-				reg[i].pci_phys_low = io_answer;
-				range.phys_hi = 0;
-				range.phys_low = io_answer;
-				range.par_phys_hi = reg[i].pci_phys_hi |
-						PCI_REG_REL_M;
-				range.par_phys_low = reg[i].pci_phys_low;
-				range.par_phys_mid = reg[i].pci_phys_mid;
-				range.rng_size = reg[i].pci_size_low;
-				i = rcount;
-				break;
-
-			default:
-				cardbus_err(dip, 1, "Unknown register type\n");
-				kmem_free(reg, length);
-				(void) cardbus_config_teardown(&handle);
-				entry->error = PCICFG_FAILURE;
-				return (DDI_WALK_TERMINATE);
-			} /* switch */
-		}
-	}
-	kmem_free(reg, length);
-
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE,
-	    dip, "ranges", (int *)&range,
-	    sizeof (range)/sizeof (int));
-	if (io_answer != 0xffffffff) {
-		isa_phdl.dip = dip;
-		isa_phdl.handle = handle;
-		isa_phdl.io_base = io_answer;
-		isa_phdl.io_decode_reg = 0x58; /* Pos decoded IO space 0 reg */
-		/* i_ndi_block_device_tree_changes(&count); */
-		ndi_devi_enter(dip, &count);
-		ddi_walk_devs(ddi_get_child(dip),
-			cardbus_add_isa_reg, (void *)&isa_phdl);
-		/* i_ndi_allow_device_tree_changes(count); */
-		ndi_devi_exit(dip, count);
-	}
-	return (DDI_WALK_PRUNECHILD);
-}
-
-/*
- * This is specific to ITE8888 chip.
- */
-static int
-cardbus_add_isa_reg(dev_info_t *dip, void *arg)
-{
-	uint32_t	io_reg = 0;
-	int		length;
-	uint32_t	reg[3], *breg;
-	isa_phdl_t	*phdl;
-	uint8_t		sz;
-
-	phdl = (isa_phdl_t *)arg;
-	cardbus_err(dip, 6,
-	    "cardbus_add_isa_reg, base 0x%x\n", phdl->io_base);
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "basereg", (caddr_t)&breg,
-	    &length) != DDI_PROP_SUCCESS) {
-		return (DDI_WALK_CONTINUE);
-	}
-
-	if ((length / sizeof (reg)) < 1) {
-		kmem_free(breg, length);
-		return (DDI_WALK_CONTINUE);
-	}
-
-	/*
-	 * Add the "reg" property.
-	 */
-	reg[0] = 0;
-	reg[1] = breg[1] + phdl->io_base;
-	reg[2] = breg[2];
-
-	/*
-	 * Generate the postive IO decode register setting.
-	 */
-	for (sz = 0; sz < 8; sz++)
-		if ((1<<sz) >= breg[2]) {
-			io_reg = breg[1]
-			    | (1uL <<31) /* Enable */
-			    | (2uL <<29) /* Medium speed */
-			    | (1uL <<28) /* Aliase enable, */
-					/* Don't care A[15:10] */
-			    | (sz<<24); /* Size code */
-			break;
-		}
-
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    "reg", (int *)reg, 3);
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "basereg");
-
-	if (io_reg) {
-		pci_config_put32(phdl->handle, phdl->io_decode_reg, io_reg);
-		cardbus_err(dip, 6,
-		    "cardbus_add_isa_reg: I/O decode reg (0x%x) set to 0x%x\n",
-		    phdl->io_decode_reg,
-		    pci_config_get32(phdl->handle, phdl->io_decode_reg));
-		phdl->io_decode_reg += sizeof (io_reg);
-	} else
-		cardbus_err(dip, 1,
-		    "cardbus_add_isa_reg: register size (0x%x) too large\n",
-		    breg[2]);
-	kmem_free(breg, length);
-	return (DDI_WALK_CONTINUE);
-}
-
-/*
- * In case we want to ensure that some space is allocated to the
- * device tree below the cardbus bridge.
- * This is only necessary if there is a device that needs to allocate
- * resource below us. This can happen if there is another cardbus/PCMCIA
- * bridge downstream.
- */
-static uint32_t cardbus_min_spare_mem = 0;
-static uint32_t cardbus_min_spare_io = 0;
-
-/*
- * The "dip" passed to this routine is assumed to be
- * the device at the attachment point. Currently it is
- * assumed to be a bridge.
- */
-static int
-cardbus_allocate_chunk(dev_info_t *dip, uint8_t type, uint8_t sec_bus)
-{
-	cardbus_phdl_t		*phdl;
-	ndi_ra_request_t	*mem_request;
-	ndi_ra_request_t	*io_request;
-	ra_return_t		res;
-	int			count;
-
-	/*
-	 * This should not find an existing entry - so
-	 * it will create a new one.
-	 */
-	phdl = cardbus_find_phdl(dip);
-	ASSERT(phdl);
-
-	mem_request = &phdl->mem_req;
-	io_request  = &phdl->io_req;
-
-	/*
-	 * Set highest_bus here.
-	 * Otherwise if we don't find another bridge
-	 * this never gets set.
-	 */
-	phdl->highest_bus = sec_bus;
-
-	/*
-	 * From this point in the tree - walk the devices,
-	 * The function passed in will read and "sum" up
-	 * the memory and I/O requirements and put them in
-	 * structure "phdl".
-	 */
-	phdl->error = PCICFG_SUCCESS;
-	ndi_devi_enter(dip, &count);
-	ddi_walk_devs(ddi_get_child(dip), cardbus_sum_resources, (void *)phdl);
-	ndi_devi_exit(dip, count);
-
-	if (phdl->error != PCICFG_SUCCESS) {
-		cmn_err(CE_WARN, "Failure summing resources\n");
-		return (phdl->error);
-	}
-
-	/*
-	 * Call into the memory allocator with the request.
-	 * Record the addresses returned in the phdl
-	 */
-#ifdef  _LP64
-	cardbus_err(dip, 8,
-	    "AP requires [0x%lx] bytes of memory space, alligned 0x%x\n",
-	    mem_request->ra_len, phdl->memory_gran);
-	cardbus_err(dip, 8,
-	    "AP requires [0x%lx] bytes of I/O space, alligned 0x%x\n",
-	    io_request->ra_len, phdl->io_gran);
-#else
-	cardbus_err(dip, 8,
-	    "AP requires [0x%llx] bytes of memory space, alligned 0x%x\n",
-	    mem_request->ra_len, phdl->memory_gran);
-	cardbus_err(dip, 8,
-	    "AP requires [0x%llx] bytes of I/O space, alligned 0x%x\n",
-	    io_request->ra_len, phdl->io_gran);
-#endif
-
-	ASSERT(type == PCI_HEADER_CARDBUS);
-
-	mem_request->ra_align_mask = phdl->memory_gran - 1;
-	io_request->ra_align_mask = phdl->io_gran - 1;
-	phdl->res_dip = (dev_info_t *)-1;
-
-	mem_request->ra_len += cardbus_min_spare_mem;
-	if (mem_request->ra_len) {
-		mem_request->ra_len = PCICFG_ROUND_UP(
-					mem_request->ra_len,
-					phdl->memory_gran);
-#ifdef _LP64
-		cardbus_err(dip, 8,
-		    "cardbus_allocate_chunk: ndi_ra_alloc 0x%lx bytes\n",
-		    mem_request->ra_len);
-#else
-		cardbus_err(dip, 8,
-		    "cardbus_allocate_chunk: ndi_ra_alloc 0x%llx bytes\n",
-		    mem_request->ra_len);
-#endif
-
-		if (pcmcia_alloc_mem(dip, mem_request, &res,
-		    &phdl->res_dip) != NDI_SUCCESS) {
-			cmn_err(CE_WARN, "Failed to allocate memory for %s\n",
-				ddi_driver_name(dip));
-			return (PCICFG_FAILURE);
-		}
-
-		phdl->memory_base = phdl->memory_last = res.ra_addr_lo;
-		phdl->memory_len = res.ra_len;
-	}
-
-	io_request->ra_len += cardbus_min_spare_io;
-	if (io_request->ra_len) {
-
-#if defined(__x86) || defined(__amd64)
-		io_request->ra_boundbase = 0x1000;
-		io_request->ra_boundlen = 0xefff;
-#else
-		io_request->ra_boundbase = 0;
-		io_request->ra_boundlen = PCICFG_4GIG_LIMIT;
-#endif
-		io_request->ra_flags |= NDI_RA_ALLOC_BOUNDED;
-		io_request->ra_len = PCICFG_ROUND_UP(io_request->ra_len,
-				phdl->io_gran);
-		io_request->ra_align_mask = max(PCICFG_IOGRAN,
-				phdl->io_gran) - 1;
-
-		if (pcmcia_alloc_io(dip, io_request, &res,
-		    &phdl->res_dip) != NDI_SUCCESS) {
-			cmn_err(CE_WARN, "Failed to allocate I/O space "
-				"for %s\n", ddi_driver_name(dip));
-			if (mem_request->ra_len) {
-				res.ra_addr_lo = phdl->memory_base;
-				res.ra_len = phdl->memory_len;
-				(void) pcmcia_free_mem(phdl->res_dip, &res);
-				phdl->memory_len = phdl->io_len = 0;
-			}
-			return (PCICFG_FAILURE);
-		}
-
-		phdl->io_base = phdl->io_last = (uint32_t)res.ra_addr_lo;
-		phdl->io_len  = (uint32_t)res.ra_len;
-	}
-
-#ifdef  _LP64
-	cardbus_err(dip, 6,
-	    "MEMORY BASE = [0x%lx] length [0x%lx]\n",
-	    phdl->memory_base, phdl->memory_len);
-#else
-	cardbus_err(dip, 6,
-	    "MEMORY BASE = [0x%llx] length [0x%llx]\n",
-	    phdl->memory_base, phdl->memory_len);
-#endif
-	cardbus_err(dip, 6,
-	    "IO BASE = [0x%x] length [0x%x]\n",
-	    phdl->io_base, phdl->io_len);
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_free_chunk(dev_info_t *dip)
-{
-	uint_t	*bus;
-	int	k;
-
-	cardbus_err(dip, 6, "cardbus_free_chunk\n");
-
-	(void) cardbus_destroy_phdl(dip);
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "bus-range", (caddr_t)&bus,
-	    &k) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_free_chunk: Failed to read bus-range property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	cardbus_err(dip, 6,
-	    "cardbus_free_chunk: Freeing bus [%d] range [%d]\n",
-	    bus[0], bus[1] - bus[0] + 1);
-
-	if (ndi_ra_free(dip,
-	    (uint64_t)bus[0], (uint64_t)(bus[1] - bus[0] + 1),
-	    NDI_RA_TYPE_PCI_BUSNUM, NDI_RA_PASS) != NDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_free_chunk: Failed to free bus numbers\n");
-
-		kmem_free(bus, k);
-		return (PCICFG_FAILURE);
-	}
-
-	kmem_free(bus, k);
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Put bridge registers into initial state
- */
-static void
-cardbus_setup_bridge(dev_info_t *dip, cardbus_phdl_t *entry,
-		ddi_acc_handle_t handle)
-{
-	uint8_t header_type = pci_config_get8(handle, PCI_CONF_HEADER);
-
-#ifdef _LP64
-	cardbus_err(NULL, 6,
-	    "cardbus_setup_bridge: "
-	    "highest bus %d, mem_last 0x%lx, io_last 0x%x\n",
-	    entry->highest_bus, entry->memory_last, entry->io_last);
-#else
-	cardbus_err(NULL, 6,
-	    "cardbus_setup_bridge: "
-	    "highest bus %d, mem_last 0x%llx, io_last 0x%x\n",
-	    entry->highest_bus, entry->memory_last, entry->io_last);
-#endif
-
-	if ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_PPB) {
-		uint32_t uval;
-
-		/*
-		 * The highest bus seen during probing is
-		 * the max-subordinate bus
-		 */
-		pci_config_put8(handle, PCI_BCNF_SUBBUS, entry->highest_bus);
-
-		uval = PCICFG_ROUND_UP(entry->memory_last, PCICFG_MEMGRAN);
-		if (uval != entry->memory_last) {
-#ifdef _LP64
-			cardbus_err(dip, 8,
-			    "Adding [0x%lx] before bridge (mem)\n",
-			    uval - entry->memory_last);
-#else
-			cardbus_err(dip, 8,
-			    "Adding [0x%llx] before bridge (mem)\n",
-			    uval - entry->memory_last);
-#endif
-			(void) cardbus_get_mem(ddi_get_parent(dip), entry,
-			    uval - entry->memory_last, NULL);
-		}
-
-		/*
-		 * Program the memory base register with the
-		 * start of the memory range
-		 */
-#ifdef _LP64
-		cardbus_err(NULL, 8,
-		    "store 0x%x(0x%lx) in pci bridge memory base register\n",
-		    PCICFG_HIWORD(PCICFG_LOADDR(uval)),
-		    entry->memory_last);
-#else
-		cardbus_err(NULL, 8,
-		    "store 0x%x(0x%llx) in pci bridge memory base register\n",
-		    PCICFG_HIWORD(PCICFG_LOADDR(uval)),
-		    entry->memory_last);
-#endif
-		pci_config_put16(handle, PCI_BCNF_MEM_BASE,
-		    PCICFG_HIWORD(PCICFG_LOADDR(uval)));
-
-		uval = PCICFG_ROUND_UP(entry->io_last, PCICFG_IOGRAN);
-		if (uval != entry->io_last) {
-			cardbus_err(dip, 8,
-			    "Adding [0x%x] before bridge (I/O)\n",
-			    uval - entry->io_last);
-			(void) cardbus_get_io(ddi_get_parent(dip), entry,
-			    uval - entry->io_last, NULL);
-		}
-		cardbus_err(NULL, 8,
-		    "store 0x%02x/0x%04x(0x%x) in "
-		    "pci bridge I/O hi/low base register\n",
-		    PCICFG_HIWORD(PCICFG_LOADDR(uval)),
-		    PCICFG_HIBYTE(PCICFG_LOWORD(PCICFG_LOADDR(uval))),
-		    entry->io_last);
-		/*
-		 * Program the I/O base register with the start of the I/O range
-		 */
-		pci_config_put8(handle, PCI_BCNF_IO_BASE_LOW,
-		    PCICFG_HIBYTE(PCICFG_LOWORD(PCICFG_LOADDR(uval))));
-
-		pci_config_put16(handle, PCI_BCNF_IO_BASE_HI,
-		    PCICFG_HIWORD(PCICFG_LOADDR(uval)));
-
-		/*
-		 * Clear status bits
-		 */
-		pci_config_put16(handle, PCI_BCNF_SEC_STATUS, 0xffff);
-
-		/*
-		 * Turn off prefetchable range
-		 */
-		pci_config_put32(handle, PCI_BCNF_PF_BASE_LOW, 0x0000ffff);
-		pci_config_put32(handle, PCI_BCNF_PF_BASE_HIGH, 0xffffffff);
-
-		pci_config_put32(handle, PCI_BCNF_PF_LIMIT_HIGH, 0x0);
-
-#ifdef sparc
-		/*
-		 * If there is an interrupt pin set program
-		 * interrupt line with default values.
-		 */
-		if (pci_config_get8(handle, PCI_CONF_IPIN)) {
-		    pci_config_put8(handle, PCI_CONF_ILINE, 0xf);
-		}
-#else
-		(void) cardbus_validate_iline(dip, handle);
-#endif
-
-
-	} else if ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_CARDBUS) {
-
-		/*
-		 * The highest bus seen during probing is
-		 * the max-subordinate bus
-		 */
-		pci_config_put8(handle, PCI_CBUS_SUB_BUS_NO,
-		    entry->highest_bus);
-
-		/*
-		 * Program the memory base register with the
-		 * start of the memory range
-		 */
-#ifdef _LP64
-		cardbus_err(NULL, 8,
-		    "store 0x%x(0x%lx) in "
-		    "cardbus memory base register 0, len 0x%lx\n",
-		    PCICFG_LOADDR(entry->memory_last), entry->memory_last,
-		    entry->memory_len);
-#else
-		cardbus_err(NULL, 8,
-		    "store 0x%x(0x%llx) in "
-		    "cardbus memory base register 0, len 0x%llx\n",
-		    PCICFG_LOADDR(entry->memory_last), entry->memory_last,
-		    entry->memory_len);
-#endif
-
-		pci_config_put32(handle, PCI_CBUS_MEM_BASE0,
-		    PCICFG_LOADDR(entry->memory_last));
-
-		/*
-		 * Program the I/O base register with the start of the I/O range
-		 */
-		cardbus_err(NULL, 8,
-		    "store 0x%x in cb IO base register 0 len 0x%x\n",
-		    PCICFG_LOADDR(entry->io_last),
-		    entry->io_len);
-
-		pci_config_put32(handle, PCI_CBUS_IO_BASE0,
-		    PCICFG_LOADDR(entry->io_last));
-
-		/*
-		 * Clear status bits
-		 */
-		pci_config_put16(handle, PCI_CBUS_SEC_STATUS, 0xffff);
-
-#ifdef sparc
-		/*
-		 * If there is an interrupt pin set program
-		 * interrupt line with default values.
-		 */
-		if (pci_config_get8(handle, PCI_CONF_IPIN)) {
-		    pci_config_put8(handle, PCI_CONF_ILINE, 0xf);
-		}
-#else
-		(void) cardbus_validate_iline(dip, handle);
-#endif
-
-
-		/*
-		 * LATER: use these registers
-		 */
-		pci_config_put32(handle, PCI_CBUS_MEM_BASE1, 0);
-		pci_config_put32(handle, PCI_CBUS_MEM_LIMIT1, 0);
-		pci_config_put32(handle, PCI_CBUS_IO_BASE1, 0);
-		pci_config_put32(handle, PCI_CBUS_IO_LIMIT1, 0);
-	} else {
-		cmn_err(CE_WARN, "header type 0x%x, probably unknown bridge\n",
-		    header_type & PCI_HEADER_TYPE_M);
-	}
-
-	cardbus_err(NULL, 7, "cardbus_setup_bridge complete\n");
-}
-
-static void
-cardbus_update_bridge(dev_info_t *dip, cardbus_phdl_t *entry,
-		ddi_acc_handle_t handle)
-{
-	uint_t length;
-	uint16_t word16 = pci_config_get16(handle, PCI_CONF_COMM);
-	const	uint8_t header_type = pci_config_get8(handle, PCI_CONF_HEADER)
-			& PCI_HEADER_TYPE_M;
-	uint32_t bridge_gran;
-	uint64_t rlval;
-
-	if (header_type == PCI_HEADER_CARDBUS)
-		bridge_gran = CBCFG_MEMGRAN;
-	else
-		bridge_gran = PCICFG_MEMGRAN;
-
-	/*
-	 * Program the memory limit register with the end of the memory range
-	 */
-#ifdef _LP64
-	cardbus_err(dip, 6,
-	    "cardbus_update_bridge: Mem base 0x%lx len 0x%lx "
-	    "last 0x%lx gran 0x%x gran end 0x%lx\n",
-	    entry->memory_base, entry->memory_len,
-	    entry->memory_last, entry->memory_gran,
-	    PCICFG_ROUND_UP(entry->memory_last, entry->memory_gran));
-#else
-	cardbus_err(dip, 6,
-	    "cardbus_update_bridge: Mem base 0x%llx len 0x%llx "
-	    "last 0x%llx gran 0x%x gran end 0x%lx\n",
-	    entry->memory_base, entry->memory_len,
-	    entry->memory_last, entry->memory_gran,
-	    PCICFG_ROUND_UP(entry->memory_last, entry->memory_gran));
-#endif
-	/*
-	 * Since this is a bridge, the rest of this range will
-	 * be responded to by the bridge.  We have to round up
-	 * so no other device claims it.
-	 */
-	length = PCICFG_ROUND_UP(entry->memory_last + cardbus_min_spare_mem,
-	    bridge_gran) - entry->memory_last;
-
-	if (length > 0) {
-		/*
-		 * This is to allow space that isn't actually being used by
-		 * anything to be allocated by devices such as a downstream
-		 * PCMCIA controller.
-		 */
-		(void) cardbus_get_mem(dip, entry, length, NULL);
-		cardbus_err(dip, 8,
-		    "Added [0x%x] at the top of the bridge (mem)\n", length);
-	}
-
-	if (entry->memory_len) {
-		if (header_type == PCI_HEADER_CARDBUS) {
-			rlval = PCICFG_ROUND_DOWN(entry->memory_last - 1,
-			    CBCFG_MEMGRAN);
-#ifdef _LP64
-			cardbus_err(dip, 8,
-			    "store 0x%x(0x%lx) in memory limit register 0\n",
-			    PCICFG_LOADDR(rlval), rlval);
-#else
-			cardbus_err(dip, 8,
-			    "store 0x%x(0x%llx) in memory limit register 0\n",
-			    PCICFG_LOADDR(rlval), rlval);
-#endif
-			pci_config_put32(handle, PCI_CBUS_MEM_LIMIT0,
-			    PCICFG_LOADDR(rlval));
-		} else {
-			rlval = PCICFG_ROUND_DOWN(entry->memory_last - 1,
-			    PCICFG_MEMGRAN);
-#ifdef _LP64
-			cardbus_err(dip, 8,
-			    "store 0x%x(0x%lx) in memory limit register\n",
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)),
-			    rlval);
-#else
-			cardbus_err(dip, 8,
-			    "store 0x%x(0x%llx) in memory limit register\n",
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)),
-			    rlval);
-#endif
-			pci_config_put16(handle, PCI_BCNF_MEM_LIMIT,
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)));
-		}
-		word16 |= PCI_COMM_MAE;
-	}
-
-	cardbus_err(dip, 6,
-	    "cardbus_update_bridge: I/O base 0x%x len 0x%x last 0x%x "
-	    "gran 0x%x gran_end 0x%lx\n",
-	    entry->io_base, entry->io_len, entry->io_last, entry->io_gran,
-	    PCICFG_ROUND_UP(entry->io_last, entry->io_gran));
-
-	if (header_type == PCI_HEADER_CARDBUS)
-		bridge_gran = CBCFG_IOGRAN;
-	else
-		bridge_gran = PCICFG_IOGRAN;
-
-	/*
-	 * Same as above for I/O space. Since this is a
-	 * bridge, the rest of this range will be responded
-	 * to by the bridge.  We have to round up so no
-	 * other device claims it.
-	 */
-	length = PCICFG_ROUND_UP(entry->io_last + cardbus_min_spare_io,
-	    bridge_gran) - entry->io_last;
-	if (length > 0) {
-		(void) cardbus_get_io(dip, entry, length, NULL);
-		cardbus_err(dip, 8,
-		    "Added [0x%x] at the top of the bridge (I/O)\n",  length);
-	}
-
-	/*
-	 * Program the I/O limit register with the end of the I/O range
-	 */
-	if (entry->io_len) {
-		if (header_type == PCI_HEADER_CARDBUS) {
-			rlval = PCICFG_ROUND_DOWN(entry->io_last - 1,
-			    CBCFG_IOGRAN);
-#ifdef _LP64
-			cardbus_err(dip, 8,
-			    "store 0x%lx in IO limit register 0\n", rlval);
-#else
-			cardbus_err(dip, 8,
-			    "store 0x%llx in IO limit register 0\n", rlval);
-#endif
-			pci_config_put32(handle, PCI_CBUS_IO_LIMIT0, rlval);
-		} else {
-			rlval = PCICFG_ROUND_DOWN(entry->io_last - 1,
-			    PCICFG_IOGRAN);
-#ifdef _LP64
-			cardbus_err(dip, 8,
-			    "store 0x%x/0x%x(0x%lx) in "
-			    "IO limit low/hi register\n",
-			    PCICFG_HIBYTE(PCICFG_LOWORD(PCICFG_LOADDR(rlval))),
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)),
-			    rlval);
-#else
-			cardbus_err(dip, 8,
-			    "store 0x%x/0x%x(0x%llx) in "
-			    "IO limit low/hi register\n",
-			    PCICFG_HIBYTE(PCICFG_LOWORD(PCICFG_LOADDR(rlval))),
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)),
-			    rlval);
-#endif
-
-			pci_config_put8(handle, PCI_BCNF_IO_LIMIT_LOW,
-			    PCICFG_HIBYTE(PCICFG_LOWORD(PCICFG_LOADDR(rlval))));
-			pci_config_put16(handle, PCI_BCNF_IO_LIMIT_HI,
-			    PCICFG_HIWORD(PCICFG_LOADDR(rlval)));
-		}
-		word16 |= PCI_COMM_IO;
-	}
-
-	pci_config_put16(handle, PCI_CONF_COMM, word16);
-}
-
-static void
-cardbus_get_mem(dev_info_t *dip, cardbus_phdl_t *entry,
-		uint32_t length, uint64_t *ans)
-{
-	uint32_t hole;
-
-#ifdef  _LP64
-	cardbus_err(NULL, 6,
-	    "cardbus_get_mem: memory_last 0x%lx, length 0x%x, "
-	    "memory_base 0x%lx, memory_len 0x%lx ans=0x%p\n",
-	    entry->memory_last, length,
-	    entry->memory_base, entry->memory_len, (void *) ans);
-#else
-	cardbus_err(NULL, 6,
-	    "cardbus_get_mem: memory_last 0x%llx, length 0x%x, "
-	    "memory_base 0x%llx, memory_len 0x%llx ans=0x%p\n",
-	    entry->memory_last, length,
-	    entry->memory_base, entry->memory_len, (void *) ans);
-#endif
-
-	if (ans) {
-		/*
-		 * Round up the request to the "size" boundary
-		 */
-		hole = PCICFG_ROUND_UP(entry->memory_last, length)
-			- entry->memory_last;
-		if (hole != 0) {
-			(void) cardbus_update_available_prop(dip,
-			    PCI_ADDR_MEM32,
-			    entry->memory_last,
-			    (uint64_t)hole);
-			entry->memory_last += hole;
-
-#ifdef  _LP64
-			cardbus_err(NULL, 6,
-			    "cardbus_get_mem: "
-			    "rounded memory_last up by 0x%x to 0x%lx, ",
-			    hole, entry->memory_last);
-#else
-			cardbus_err(NULL, 6,
-			    "cardbus_get_mem: "
-			    "rounded memory_last up by 0x%x to 0x%llx, ",
-			    hole, entry->memory_last);
-#endif
-		}
-	} else
-		(void) cardbus_update_available_prop(dip, PCI_ADDR_MEM32,
-			entry->memory_last,
-			(uint64_t)length);
-
-	/*
-	 * These routines should parcel out the memory
-	 * completely.  There should never be a case of
-	 * over running the bounds.
-	 */
-	if ((entry->memory_last + length) >
-	    (entry->memory_base + entry->memory_len))
-#ifdef  _LP64
-		cardbus_err(NULL, 1,
-		    "cardbus_get_mem: assert will fail %ld <= %ld,"
-		    "(0x%lx + 0x%x) <= (0x%lx + 0x%lx)\n",
-#else
-		cardbus_err(NULL, 1,
-		    "cardbus_get_mem: assert will fail %lld <= %lld, "
-		    "(0x%llx + 0x%x) <= (0x%llx + 0x%llx)\n",
-#endif
-		    entry->memory_last + length,
-		    entry->memory_base + entry->memory_len,
-		    entry->memory_last,
-		    length,
-		    entry->memory_base,
-		    entry->memory_len);
-
-	ASSERT((entry->memory_last + length) <=
-	(entry->memory_base + entry->memory_len));
-	/*
-	 * If ans is NULL don't return anything,
-	 * they are just asking to reserve the memory.
-	 */
-	if (ans != NULL)
-		*ans = entry->memory_last;
-
-	/*
-	 * Increment to the next location
-	 */
-	entry->memory_last += length;
-}
-
-static void
-cardbus_get_io(dev_info_t *dip, cardbus_phdl_t *entry,
-		uint32_t length, uint32_t *ans)
-{
-	uint32_t	hole;
-
-	cardbus_err(NULL, 6,
-	    "cardbus_get_io: io_last 0x%x, length 0x%x, "
-	    "io_base 0x%x, io_len 0x%x ans=0x%p\n",
-	    entry->io_last, length,
-	    entry->io_base, entry->io_len, (void *) ans);
-
-	if (ans) {
-		/*
-		 * Round up the request to the "size" boundary
-		 */
-		hole = PCICFG_ROUND_UP(entry->io_last, length) - entry->io_last;
-		if (hole != 0) {
-			(void) cardbus_update_available_prop(dip, PCI_ADDR_IO,
-			    (uint64_t)entry->io_last,
-			    (uint64_t)hole);
-			entry->io_last += hole;
-
-			cardbus_err(NULL, 6,
-			    "cardbus_get_io: "
-			    "rounded io_last up by 0x%x to 0x%x, ",
-			    hole, entry->io_last);
-		}
-	} else
-		(void) cardbus_update_available_prop(dip, PCI_ADDR_IO,
-		    (uint64_t)entry->io_last,
-		    (uint64_t)length);
-	/*
-	 * These routines should parcel out the memory
-	 * completely.  There should never be a case of
-	 * over running the bounds.
-	 */
-	ASSERT((entry->io_last + length) <=
-	    (entry->io_base + entry->io_len));
-
-	/*
-	 * If ans is NULL don't return anything,
-	 * they are just asking to reserve the memory.
-	 */
-	if (ans != NULL)
-		*ans = entry->io_last;
-
-	/*
-	 * Increment to the next location
-	 */
-	entry->io_last += length;
-}
-
-static int
-cardbus_sum_resources(dev_info_t *dip, void *hdl)
-{
-	cardbus_phdl_t *entry = (cardbus_phdl_t *)hdl;
-	pci_regspec_t *pci_rp;
-	int length;
-	int rcount;
-	int i, ret;
-	ndi_ra_request_t *mem_request;
-	ndi_ra_request_t *io_request;
-	uint8_t header_type, base_class;
-	ddi_acc_handle_t handle;
-
-	/*
-	 * Ignore the attachment point and pcs.
-	 */
-	if (strcmp(ddi_binding_name(dip), "hp_attachment") == 0 ||
-	    strcmp(ddi_binding_name(dip), "pcs") == 0) {
-		cardbus_err(dip, 8, "cardbus_sum_resources: Ignoring\n");
-		return (DDI_WALK_CONTINUE);
-	}
-
-	mem_request = &entry->mem_req;
-	io_request =  &entry->io_req;
-
-	if (cardbus_config_setup(dip, &handle) != DDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_sum_resources: Failed to map config space!\n");
-		entry->error = PCICFG_FAILURE;
-		return (DDI_WALK_TERMINATE);
-	}
-
-	ret = DDI_WALK_CONTINUE;
-	header_type = pci_config_get8(handle, PCI_CONF_HEADER);
-	base_class = pci_config_get8(handle, PCI_CONF_BASCLASS);
-
-	/*
-	 * If its a bridge - just record the highest bus seen
-	 */
-	if (base_class == PCI_CLASS_BRIDGE) {
-		uint8_t	sub_class;
-
-		sub_class = pci_config_get8(handle, PCI_CONF_SUBCLASS);
-
-		switch (sub_class) {
-		case PCI_BRIDGE_PCI:
-			if ((header_type & PCI_HEADER_TYPE_M)
-			    == PCI_HEADER_PPB) {
-
-				if (entry->highest_bus < pci_config_get8(handle,
-				    PCI_BCNF_SECBUS)) {
-					entry->highest_bus = pci_config_get8(
-					    handle, PCI_BCNF_SECBUS);
-				}
-
-				(void) cardbus_config_teardown(&handle);
-#if defined(CARDBUS_DEBUG)
-				if (mem_request->ra_len !=
-				    PCICFG_ROUND_UP(mem_request->ra_len,
-				    PCICFG_MEMGRAN)) {
-
-#ifdef _LP64
-					cardbus_err(dip, 8,
-					    "Pre-align [0x%lx] to PCI bridge "
-					    "memory gran "
-					    "[0x%lx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(mem_request->ra_len,
-						PCICFG_MEMGRAN) -
-						mem_request->ra_len,
-					    mem_request->ra_len,
-					    PCICFG_ROUND_UP(mem_request->ra_len,
-						PCICFG_MEMGRAN));
-#else
-					cardbus_err(dip, 8,
-					    "Pre-align [0x%llx] to PCI bridge "
-					    "memory gran "
-					    "[0x%llx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(mem_request->ra_len,
-						PCICFG_MEMGRAN) -
-						mem_request->ra_len,
-					    mem_request->ra_len,
-					    PCICFG_ROUND_UP(mem_request->ra_len,
-						PCICFG_MEMGRAN));
-#endif
-				}
-
-				if (io_request->ra_len !=
-				    PCICFG_ROUND_UP(io_request->ra_len,
-				    PCICFG_IOGRAN)) {
-
-#ifdef _LP64
-					cardbus_err(dip, 8,
-					    "Pre-align [0x%lx] to PCI bridge "
-					    "I/O gran "
-					    "[0x%lx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(io_request->ra_len,
-						PCICFG_IOGRAN) -
-						io_request->ra_len,
-					    io_request->ra_len,
-					    PCICFG_ROUND_UP(io_request->ra_len,
-						PCICFG_IOGRAN));
-#else
-					cardbus_err(dip, 8,
-					    "Pre-align [0x%llx] to PCI bridge "
-					    "I/O gran "
-					    "[0x%llx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(io_request->ra_len,
-						PCICFG_IOGRAN) -
-						io_request->ra_len,
-					    io_request->ra_len,
-					    PCICFG_ROUND_UP(io_request->ra_len,
-						PCICFG_IOGRAN));
-#endif
-				}
-
-#endif
-				mem_request->ra_len = PCICFG_ROUND_UP(
-							mem_request->ra_len,
-							PCICFG_MEMGRAN);
-				io_request->ra_len = PCICFG_ROUND_UP(
-							io_request->ra_len,
-							PCICFG_IOGRAN);
-				if (entry->memory_gran < PCICFG_MEMGRAN)
-					entry->memory_gran = PCICFG_MEMGRAN;
-				if (entry->io_gran < PCICFG_IOGRAN)
-					entry->io_gran = PCICFG_IOGRAN;
-				ddi_walk_devs(ddi_get_child(dip),
-				    cardbus_sum_resources,
-				    (void *)entry);
-#if defined(CARDBUS_DEBUG)
-				if (mem_request->ra_len !=
-				    PCICFG_ROUND_UP(mem_request->ra_len +
-				    cardbus_min_spare_mem, PCICFG_MEMGRAN)) {
-
-#ifdef _LP64
-					cardbus_err(dip, 8,
-					    "Post-align [0x%lx] to PCI bridge "
-					    "memory gran "
-					    "[0x%lx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(
-						mem_request->ra_len +
-						cardbus_min_spare_mem,
-						PCICFG_MEMGRAN) -
-						mem_request->ra_len,
-					    mem_request->ra_len,
-					    PCICFG_ROUND_UP(mem_request->ra_len
-						+ cardbus_min_spare_mem,
-						PCICFG_MEMGRAN));
-#else
-					cardbus_err(dip, 8,
-					    "Post-align [0x%llx] to PCI bridge "
-					    "memory gran "
-					    "[0x%llx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(
-						mem_request->ra_len +
-						cardbus_min_spare_mem,
-						PCICFG_MEMGRAN) -
-						mem_request->ra_len,
-					    mem_request->ra_len,
-					    PCICFG_ROUND_UP(mem_request->ra_len
-						+ cardbus_min_spare_mem,
-						PCICFG_MEMGRAN));
-#endif
-				}
-
-				if (io_request->ra_len !=
-				    PCICFG_ROUND_UP(io_request->ra_len +
-				    cardbus_min_spare_io,
-				    PCICFG_IOGRAN)) {
-
-#ifdef _LP64
-					cardbus_err(dip, 8,
-					    "Post-align [0x%lx] to PCI bridge "
-					    "I/O gran "
-					    "[0x%lx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(io_request->ra_len +
-						cardbus_min_spare_io,
-						PCICFG_IOGRAN) -
-						io_request->ra_len,
-					    io_request->ra_len,
-					    PCICFG_ROUND_UP(io_request->ra_len +
-						cardbus_min_spare_io,
-						PCICFG_IOGRAN));
-#else
-					cardbus_err(dip, 8,
-					    "Post-align [0x%llx] to PCI bridge "
-					    "I/O gran "
-					    "[0x%llx] -> [0x%lx]\n",
-					    PCICFG_ROUND_UP(io_request->ra_len +
-						cardbus_min_spare_io,
-						PCICFG_IOGRAN) -
-						io_request->ra_len,
-					    io_request->ra_len,
-					    PCICFG_ROUND_UP(io_request->ra_len +
-						cardbus_min_spare_io,
-						PCICFG_IOGRAN));
-#endif
-				}
-#endif
-				mem_request->ra_len = PCICFG_ROUND_UP(
-						mem_request->ra_len +
-						    cardbus_min_spare_mem,
-						PCICFG_MEMGRAN);
-				io_request->ra_len = PCICFG_ROUND_UP(
-						io_request->ra_len +
-						    cardbus_min_spare_io,
-						PCICFG_IOGRAN);
-			}
-			return (DDI_WALK_PRUNECHILD);
-
-		case PCI_BRIDGE_CARDBUS:
-			/*
-			 * Cardbus has I/O registers.
-			 */
-			break;
-
-		case PCI_BRIDGE_ISA:
-			/*
-			 * All the registers requirements for ISA
-			 * are stored in the reg structure of the bridge.
-			 * Children of ISA are not of type PCI
-			 * so must not come through here because
-			 * cardbus_config_setup() will fail.
-			 */
-			ret = DDI_WALK_PRUNECHILD;
-			break;
-
-		default:
-			/*
-			 * Treat other bridges as leaf nodes.
-			 */
-			break;
-		}
-	}
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "reg", (caddr_t)&pci_rp,
-	    &length) != DDI_PROP_SUCCESS) {
-		/*
-		 * If one node in (the subtree of nodes)
-		 * does'nt have a "reg" property fail the
-		 * allocation.
-		 */
-		entry->memory_len = 0;
-		entry->io_len = 0;
-		entry->error = PCICFG_FAILURE;
-		(void) cardbus_config_teardown(&handle);
-		return (DDI_WALK_TERMINATE);
-	}
-
-	/*
-	 * For each "reg" property with a length, add that to the
-	 * total memory (or I/O) to allocate.
-	 */
-	rcount = length / sizeof (pci_regspec_t);
-
-	for (i = 0; i < rcount; i++) {
-
-		switch (PCI_REG_ADDR_G(pci_rp[i].pci_phys_hi)) {
-
-		case PCI_REG_ADDR_G(PCI_ADDR_MEM32):
-			mem_request->ra_len =
-				pci_rp[i].pci_size_low +
-				PCICFG_ROUND_UP(mem_request->ra_len,
-					pci_rp[i].pci_size_low);
-
-			cardbus_err(dip, 8,
-			    "ADDING 32 --->0x%x for BAR@0x%x\n",
-			    pci_rp[i].pci_size_low,
-			    PCI_REG_REG_G(pci_rp[i].pci_phys_hi));
-			/*
-			 * the granualarity needs to be the larger of
-			 * the maximum amount of memory that we're going to
-			 * ask for, and the PCI-PCI bridge granularity (1M)
-			 */
-			if (pci_rp[i].pci_size_low > entry->memory_gran)
-				entry->memory_gran = pci_rp[i].pci_size_low;
-			break;
-
-		case PCI_REG_ADDR_G(PCI_ADDR_MEM64):
-			mem_request->ra_len =
-				pci_rp[i].pci_size_low +
-				PCICFG_ROUND_UP(mem_request->ra_len,
-					pci_rp[i].pci_size_low);
-			cardbus_err(dip, 8,
-			    "ADDING 64 --->0x%x for BAR@0x%x\n",
-			    pci_rp[i].pci_size_low,
-			    PCI_REG_REG_G(pci_rp[i].pci_phys_hi));
-
-			if (pci_rp[i].pci_size_low > entry->memory_gran)
-				entry->memory_gran = pci_rp[i].pci_size_low;
-			break;
-
-		case PCI_REG_ADDR_G(PCI_ADDR_IO):
-			io_request->ra_len =
-				pci_rp[i].pci_size_low +
-				PCICFG_ROUND_UP(io_request->ra_len,
-					pci_rp[i].pci_size_low);
-			cardbus_err(dip, 8,
-			    "ADDING I/O --->0x%x for BAR@0x%x\n",
-			    pci_rp[i].pci_size_low,
-			    PCI_REG_REG_G(pci_rp[i].pci_phys_hi));
-
-			if (pci_rp[i].pci_size_low > entry->io_gran)
-				entry->io_gran = pci_rp[i].pci_size_low;
-			break;
-
-		default:
-			/* Config space register - not included */
-			break;
-		}
-	}
-
-	/*
-	 * free the memory allocated by ddi_getlongprop
-	 */
-	kmem_free(pci_rp, length);
-
-	/*
-	 * continue the walk to the next sibling to sum memory
-	 */
-
-	(void) cardbus_config_teardown(&handle);
-
-#ifdef  _LP64
-	cardbus_err(dip, 8,
-	    "Memory 0x%lx bytes, I/O 0x%lx bytes, "
-	    "Memgran 0x%x, IOgran 0x%x\n",
-	    mem_request->ra_len, io_request->ra_len,
-	    entry->memory_gran, entry->io_gran);
-#else
-	cardbus_err(dip, 8,
-	    "Memory 0x%llx bytes, I/O 0x%llx bytes, "
-	    "Memgran 0x%x, IOgran 0x%x\n",
-	    mem_request->ra_len, io_request->ra_len,
-	    entry->memory_gran, entry->io_gran);
-#endif
-
-	return (ret);
-}
-
-/*
- * Free resources allocated to a bridge.
- * Note that this routine does not call ndi_ra_free() to actually
- * free memory/IO/Bus. This is done as a single chunk for the entire
- * device tree in cardbus_free_chunk().
- */
-static int
-cardbus_free_bridge_resources(dev_info_t *dip)
-{
-	cardbus_range_t	*ranges;
-	uint_t		*bus;
-	int		k;
-	int		length;
-	int		i;
-
-	cardbus_err(dip, 6, "cardbus_free_bridge_resources\n");
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "ranges", (caddr_t)&ranges,
-	    &length) == DDI_PROP_SUCCESS) {
-		for (i = 0; i < length / sizeof (cardbus_range_t); i++) {
-			if (ranges[i].size_lo != 0 || ranges[i].size_hi != 0) {
-				switch (ranges[i].parent_hi & PCI_REG_ADDR_M) {
-				case PCI_ADDR_IO:
-					cardbus_err(dip, 6,
-					    "Need to Free I/O    "
-					    "base/length = [0x%x]/[0x%x]\n",
-					    ranges[i].child_lo,
-					    ranges[i].size_lo);
-					break;
-
-				case PCI_ADDR_MEM32:
-				case PCI_ADDR_MEM64:
-					cardbus_err(dip, 6,
-					    "Need to Free Memory base/length = "
-					    "[0x%x.%x]/[0x%x]\n",
-					    ranges[i].child_mid,
-					    ranges[i].child_lo,
-					    ranges[i].size_lo);
-					break;
-
-				default:
-					cardbus_err(dip, 6,
-					    "Unknown memory space\n");
-					break;
-				}
-			}
-		}
-
-		kmem_free(ranges, length);
-		(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "ranges");
-	} else {
-		cardbus_err(dip, 8,
-		    "cardbus_free_bridge_resources: Failed"
-		    "to read ranges property\n");
-	}
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "bus-range", (caddr_t)&bus,
-	    &k) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 6, "Failed to read bus-range property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	cardbus_err(dip, 6,
-	    "Need to free bus [%d] range [%d]\n",
-	    bus[0], bus[1] - bus[0] + 1);
-	kmem_free(bus, k);
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "available");
-	(void) ndi_prop_remove(DDI_DEV_T_NONE, dip, "bus-range");
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_free_device_resources(dev_info_t *dip)
-{
-	pci_regspec_t *assigned;
-
-	int length;
-	int acount;
-	int i;
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "assigned-addresses",
-	    (caddr_t)&assigned,
-	    &length) != DDI_PROP_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "Failed to read assigned-addresses property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * For each "assigned-addresses" property entry with a length,
-	 * call the memory allocation routines to return the
-	 * resource.
-	 */
-	acount = length / sizeof (pci_regspec_t);
-	for (i = 0; i < acount; i++) {
-
-		/*
-		 * Free the resource if the size of it is not zero.
-		 */
-		if ((assigned[i].pci_size_low != 0)||
-		    (assigned[i].pci_size_hi != 0)) {
-			switch (PCI_REG_ADDR_G(assigned[i].pci_phys_hi)) {
-			case PCI_REG_ADDR_G(PCI_ADDR_MEM32):
-				cardbus_err(dip, 6,
-				    "Need to return 0x%x of 32 bit MEM space"
-				    " @ 0x%x from register 0x%x\n",
-				    assigned[i].pci_size_low,
-				    assigned[i].pci_phys_low,
-				    PCI_REG_REG_G(assigned[i].pci_phys_hi));
-
-				break;
-
-			case PCI_REG_ADDR_G(PCI_ADDR_MEM64):
-				cardbus_err(dip, 6,
-				    "Need to return 0x%x of 64 bit MEM space"
-				    " @ 0x%x.%x from register 0x%x\n",
-				    assigned[i].pci_size_low,
-				    assigned[i].pci_phys_mid,
-				    assigned[i].pci_phys_low,
-				    PCI_REG_REG_G(assigned[i].pci_phys_hi));
-
-				break;
-
-			case PCI_REG_ADDR_G(PCI_ADDR_IO):
-				cardbus_err(dip, 6,
-				    "Need to return 0x%x of IO space @ 0x%x"
-				    " from register 0x%x\n",
-				    assigned[i].pci_size_low,
-				    assigned[i].pci_phys_low,
-				    PCI_REG_REG_G(assigned[i].pci_phys_hi));
-				break;
-
-			default:
-				cardbus_err(dip, 1, "Unknown register type\n");
-				kmem_free(assigned, length);
-				return (PCICFG_FAILURE);
-			} /* switch */
-		}
-	}
-	kmem_free(assigned, length);
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_free_resources(dev_info_t *dip)
-{
-	uint32_t classcode;
-
-	classcode = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-				"class-code", -1);
-	/*
-	 * A different algorithim is used for bridges and leaf devices.
-	 */
-	if (classcode != -1) {
-		classcode = ((uint_t)classcode & 0xffff00) >> 8;
-		if (classcode == 0x604 || classcode == 0x607) {
-			if (cardbus_free_bridge_resources(dip)
-			    != PCICFG_SUCCESS) {
-				cardbus_err(dip, 1,
-				    "Failed freeing up bridge resources\n");
-				return (PCICFG_FAILURE);
-			}
-			return (PCICFG_SUCCESS);
-		}
-	}
-
-	if (cardbus_free_device_resources(dip) != PCICFG_SUCCESS) {
-		cardbus_err(dip, 1, "Failed freeing up device resources\n");
-		return (PCICFG_FAILURE);
-	}
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_probe_bridge(cbus_t *cbp, dev_info_t *attpt, uint_t bus,
-			uint_t device, uint_t func)
-{
-	/* Declairations */
-	cardbus_bus_range_t	*bus_range;
-	int			i, j;
-	uint8_t			header_type;
-	ddi_acc_handle_t	config_handle;
-	ndi_ra_request_t	req;
-	uint_t			new_bus;
-	uint64_t		blen;
-	uint64_t		next_bus;
-	int circ;
-
-	cardbus_err(cbp->cb_dip, 6,
-	    "cardbus_probe_bridge bus %d device %d func %d\n",
-	    bus, device, func);
-
-	ndi_devi_enter(cbp->cb_dip, &circ);
-	if (pci_config_setup(cbp->cb_dip, &config_handle) != DDI_SUCCESS) {
-
-		cardbus_err(cbp->cb_dip, 1,
-		    "cardbus_probe_bridge(): Failed to setup config space\n");
-
-		ndi_devi_exit(cbp->cb_dip, circ);
-		return (PCICFG_FAILURE);
-	}
-
-	header_type = pci_config_get8(config_handle, PCI_CONF_HEADER);
-
-	/*
-	 * As soon as we have access to config space, check device
-	 * is a bridge.
-	 */
-	if ((header_type & PCI_HEADER_TYPE_M) != PCI_HEADER_CARDBUS)
-		goto failed;
-
-	cardbus_err(cbp->cb_dip, 8,
-	    "---Vendor ID = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_VENID));
-	cardbus_err(cbp->cb_dip, 8,
-	    "---Device ID = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_DEVID));
-
-	/* say what type of header */
-	cardbus_err(cbp->cb_dip, 8,
-	    "--%s bridge found root bus [0x%x] device [0x%x] func [0x%x]\n",
-	    ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_PPB) ?
-		"PCI-PCI" : "Cardbus",
-	    bus, device, func);
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, cbp->cb_dip, 0, "bus-range",
-	    (caddr_t)&bus_range, &i) != DDI_PROP_SUCCESS)
-		cardbus_err(cbp->cb_dip, 1,
-		    "No bus-range property seems to have been set up\n");
-	else {
-		cardbus_err(cbp->cb_dip, 8,
-		    "allowable bus range is %u->%u\n",
-		    bus_range->lo, bus_range->hi);
-		kmem_free((caddr_t)bus_range, i);
-	}
-
-	/*
-	 * Get next bus in sequence and program device.
-	 */
-	bzero((caddr_t)&req, sizeof (ndi_ra_request_t));
-	req.ra_len = 1;
-
-	if (ndi_ra_alloc(cbp->cb_dip, &req,
-	    &next_bus, &blen, NDI_RA_TYPE_PCI_BUSNUM,
-	    NDI_RA_PASS) != NDI_SUCCESS) {
-		cmn_err(CE_WARN, "Failed to get a bus number\n");
-		goto failed;
-	}
-
-	new_bus = next_bus;
-	cardbus_err(cbp->cb_dip, 8,
-	    "NEW bus found [%u]->[%u]\n", bus, new_bus);
-
-	(void) cardbus_set_bus_numbers(config_handle, bus, new_bus);
-
-	/* Enable it all */
-	enable_cardbus_bridge(cbp->cb_dip, config_handle);
-
-	/*
-	 * Probe all children devices
-	 */
-	for (i = 0; i < pcicfg_max_device; i++)
-		for (j = 0; j < pcicfg_max_function; j++)
-			switch (cardbus_probe_children(cbp, attpt, new_bus, i,
-			    j, &header_type)) {
-
-			case PCICFG_FAILURE:
-				cardbus_err(cbp->cb_dip, 1,
-				    "Failed to configure bus "
-				    "[0x%x] device [0x%x] func [0x%x]\n",
-				    new_bus, i, j);
-				disable_cardbus_bridge(cbp->cb_dip,
-				    config_handle);
-				goto failed;
-
-			case PCICFG_NODEVICE:
-				/*
-				 * if there's no function 0
-				 * there's no point in probing other
-				 * functions
-				 */
-				if (j != 0)
-					break;
-				/* FALLTHROUGH */
-			case PCICFG_NOMULTI:
-				j = pcicfg_max_function;
-				break;
-
-			default:
-				break;
-			}
-
-	(void) pci_config_teardown(&config_handle);
-	(void) i_ndi_config_node(attpt, DS_LINKED, 0);
-	ndi_devi_exit(cbp->cb_dip, circ);
-
-	return (PCICFG_SUCCESS);
-
-failed:
-	(void) pci_config_teardown(&config_handle);
-	ndi_devi_exit(cbp->cb_dip, circ);
-
-	return (PCICFG_FAILURE);
-}
-
-static struct isa_node isa_nodes[] = {
-	{"dummy", {NULL, NULL, NULL, NULL, NULL}, "serial", "", 0x4e, 0x2}
-};
-
-static int
-cardbus_probe_children(cbus_t *cbp, dev_info_t *parent, uint_t bus,
-			uint_t device, uint_t func, uint8_t *header_type)
-{
-	dev_info_t		*new_child;
-	ddi_acc_handle_t	config_handle;
-	int			i, j;
-	ndi_ra_request_t	req;
-	uint64_t		next_bus;
-	uint64_t		blen;
-	uint32_t		request;
-	uint8_t			base_class;
-	uint_t			new_bus;
-	int			ret;
-	int			circ;
-
-	cardbus_err(parent, 6,
-	    "cardbus_probe_children bus %d device %d func %d\n",
-	    bus, device, func);
-
-	/*
-	 * This node will be put immediately below
-	 * "parent". Allocate a blank device node.  It will either
-	 * be filled in or freed up based on further probing.
-	 */
-
-	ndi_devi_enter(parent, &circ);
-
-	if (ndi_devi_alloc(parent, DEVI_PSEUDO_NEXNAME,
-	    (pnode_t)DEVI_SID_NODEID,
-	    &new_child) != NDI_SUCCESS) {
-		cardbus_err(parent, 1,
-		    "cardbus_probe_children(): Failed to alloc child node\n");
-		ndi_devi_exit(parent, circ);
-		return (PCICFG_FAILURE);
-	}
-
-	if (cardbus_add_config_reg(new_child, bus,
-	    device, func) != DDI_SUCCESS) {
-		cardbus_err(parent, 1,
-		    "cardbus_probe_children(): Failed to add candidate REG\n");
-		goto failedconfig;
-	}
-
-	if ((ret = cardbus_config_setup(new_child, &config_handle))
-	    != PCICFG_SUCCESS) {
-
-		if (ret == PCICFG_NODEVICE) {
-			(void) ndi_devi_free(new_child);
-			return (ret);
-		}
-		cardbus_err(parent, 1,
-		    "cardbus_probe_children(): Failed to setup config space\n");
-
-		goto failedconfig;
-	}
-
-	base_class = pci_config_get8(config_handle, PCI_CONF_BASCLASS);
-
-	if (func == 0) {
-		/*
-		 * Preserve the header type from function 0.
-		 * Additional functions may not preserve the PCI_HEADER_MULTI
-		 * bit.
-		 */
-		*header_type = pci_config_get8(config_handle, PCI_CONF_HEADER);
-	} else if (!(*header_type & PCI_HEADER_MULTI) ||
-		    ((*header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_PPB) ||
-		    (base_class == PCI_CLASS_BRIDGE)) {
-
-		(void) cardbus_config_teardown(&config_handle);
-		(void) ndi_devi_free(new_child);
-		return (PCICFG_NOMULTI);
-	}
-
-	/*
-	 * As soon as we have access to config space,
-	 * turn off device. It will get turned on
-	 * later (after memory is assigned).
-	 * not if it's a cardbus device. It may be OK to leave
-	 * it on - try LATER
-	 */
-	disable_cardbus_device(config_handle);
-
-	/*
-	 * Set 1275 properties common to all devices
-	 */
-	if (cardbus_set_standard_props(parent, new_child,
-	    config_handle) != PCICFG_SUCCESS) {
-		cardbus_err(parent, 1, "Failed to set standard properties\n");
-		goto failedchild;
-	}
-
-	/*
-	 * Child node properties  NOTE: Both for PCI-PCI bridge and child node
-	 */
-	if (cardbus_set_childnode_props(new_child,
-	    config_handle) != PCICFG_SUCCESS) {
-		goto failedchild;
-	}
-
-	cardbus_err(parent, 8,
-	    "---Vendor ID = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_VENID));
-	cardbus_err(parent, 8,
-	    "---Device ID = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_DEVID));
-
-	if (base_class == PCI_CLASS_BRIDGE) {
-		uint8_t	sub_class;
-
-		sub_class = pci_config_get8(config_handle, PCI_CONF_SUBCLASS);
-
-		switch (sub_class) {
-		case PCI_BRIDGE_PCI:
-			if ((*header_type & PCI_HEADER_TYPE_M)
-			    == PCI_HEADER_PPB) {
-				cardbus_bus_range_t *bus_range;
-				int k;
-
-				/* say what type of header */
-				cardbus_err(parent, 8,
-				    "-- Found PCI-PCI bridge @ "
-				    " bus [0x%x] device [0x%x] func [0x%x]\n",
-				    bus, device, func);
-
-				if (ddi_getlongprop(DDI_DEV_T_ANY,
-				    new_child, 0, "bus-range",
-				    (caddr_t)&bus_range,
-				    &k) != DDI_PROP_SUCCESS)
-					cardbus_err(new_child, 1,
-					    "No bus-range property"
-					    " seems to have been set up\n");
-				else {
-					cardbus_err(new_child, 8,
-					    "allowable bus range is %u->%u\n",
-					    bus_range->lo, bus_range->hi);
-					kmem_free((caddr_t)bus_range, k);
-				}
-
-				/*
-				 * Get next bus in sequence and program device.
-				 */
-				bzero((caddr_t)&req, sizeof (ndi_ra_request_t));
-				req.ra_len = 1;
-
-				if (ndi_ra_alloc(new_child, &req,
-				    &next_bus, &blen,
-				    NDI_RA_TYPE_PCI_BUSNUM,
-				    NDI_RA_PASS) != NDI_SUCCESS) {
-					cmn_err(CE_WARN,
-					    "Failed to get a bus number\n");
-					goto failedchild;
-				}
-
-				new_bus = next_bus;
-
-				cardbus_err(new_child, 8,
-				    "NEW bus found [%u]->[%u]\n", bus, new_bus);
-
-				/* Enable it all */
-				enable_pci_pci_bridge(new_child, config_handle);
-				(void) cardbus_set_bus_numbers(config_handle,
-				    bus, new_bus);
-
-#if defined(CARDBUS_DEBUG)
-				if (cardbus_debug >= 9) {
-					cardbus_dump_config(config_handle);
-				}
-#endif
-
-				/*
-				 * Set bus properties
-				 */
-				if (cardbus_set_busnode_props(new_child)
-				    != PCICFG_SUCCESS) {
-					cardbus_err(new_child, 1,
-					    "Failed to set busnode props\n");
-					disable_pci_pci_bridge(new_child,
-					    config_handle);
-					goto failedchild;
-				}
-
-				/*
-				 * Probe all children devices
-				 */
-				for (i = 0; i < pcicfg_max_device; i++)
-					for (j = 0; j < pcicfg_max_function;
-					    j++)
-						switch (cardbus_probe_children(
-						    cbp,
-						    new_child,
-						    new_bus, i,
-						    j, header_type)) {
-						case PCICFG_FAILURE:
-							cardbus_err(parent, 1,
-							    "Failed to "
-							    "configure "
-							    "bus [0x%x] "
-							    "device [0x%x] "
-							    "func [0x%x]\n",
-							    new_bus, i, j);
-							disable_pci_pci_bridge(
-								new_child,
-								config_handle);
-							goto failedchild;
-
-						case PCICFG_NODEVICE:
-							/*
-							 * if there's no
-							 * function 0
-							 * there's no point in
-							 * probing other
-							 * functions
-							 */
-							if (j != 0)
-								break;
-							/* FALLTHROUGH */
-						case PCICFG_NOMULTI:
-							j = pcicfg_max_function;
-							break;
-
-						default:
-							break;
-						}
-			}
-			break;
-
-		case PCI_BRIDGE_CARDBUS:
-			cardbus_err(parent, 8,
-			    "--Found Cardbus bridge @ "
-			    "bus [0x%x] device [0x%x] func [0x%x]\n",
-			    bus, device, func);
-			pci_config_put32(config_handle,
-			    PCI_CONF_BASE0, 0xffffffff);
-
-			request = pci_config_get32(config_handle,
-			    PCI_CONF_BASE0);
-
-			/*
-			 * If its a zero length, don't do
-			 * any programming.
-			 */
-			if (request != 0) {
-				if (request == (uint32_t)0xffffffff) {
-					cmn_err(CE_WARN,
-					    "cardbus_probe_children: "
-					    "can't access device");
-					goto failedchild;
-				}
-				/*
-				 * Add to the "reg" property
-				 */
-				if (cardbus_update_reg_prop(new_child,
-				    request,
-				    PCI_CONF_BASE0) != PCICFG_SUCCESS) {
-					goto failedchild;
-				}
-				cardbus_err(parent, 8,
-				    "BASE register [0x%x] asks for "
-				    "[0x%x]=[0x%x](32)\n",
-				    PCI_CONF_BASE0, request,
-				    (~(PCI_BASE_M_ADDR_M & request))+1);
-			}
-			break;
-
-		case PCI_BRIDGE_ISA:
-			cardbus_err(parent, 8,
-			    "--Found ISA bridge @ "
-			    "bus [0x%x] device [0x%x] func [0x%x]\n",
-			    bus, device, func);
-			enable_pci_isa_bridge(new_child, config_handle);
-
-#if defined(CARDBUS_DEBUG)
-			if (cardbus_debug >= 4) {
-				cardbus_dump_common_config(config_handle);
-				cardbus_err(NULL, 1,
-				    " DDMA SlvCh0 = [0x%04x]        "
-				    "DDMA SlvCh1 = [0x%04x]\n",
-				    pci_config_get16(config_handle, 0x40),
-				    pci_config_get16(config_handle, 0x42));
-				cardbus_err(NULL, 1,
-				    " DDMA SlvCh2 = [0x%04x]        "
-				    "DDMA SlvCh3 = [0x%04x]\n",
-				    pci_config_get16(config_handle, 0x44),
-				    pci_config_get16(config_handle, 0x46));
-				cardbus_err(NULL, 1,
-				    " DDMA SlvCh5 = [0x%04x]        "
-				    "DDMA SlvCh6 = [0x%04x]\n",
-				    pci_config_get16(config_handle, 0x4a),
-				    pci_config_get16(config_handle, 0x4c));
-				cardbus_err(NULL, 1,
-				    " DDMA SlvCh7 = [0x%04x]        "
-				    "Misc Cntrl  = [0x%02x]\n",
-				    pci_config_get16(config_handle, 0x4e),
-				    pci_config_get8(config_handle, 0x57));
-				cardbus_err(NULL, 1,
-				    " DMA Cntl    = [0x%02x]          "
-				    "DMA TyF Tim = [0x%02x]\n",
-				    pci_config_get8(config_handle, 0x48),
-				    pci_config_get8(config_handle, 0x49));
-				cardbus_err(NULL, 1,
-				    " TimCntrl    = [0x%02x]          "
-				    "MTOP        = [0x%02x]\n",
-				    pci_config_get8(config_handle, 0x50),
-				    pci_config_get8(config_handle, 0x51));
-				cardbus_err(NULL, 1,
-				    " MDMA Access = [0x%02x]          "
-				    "ROMCS       = [0x%02x]\n",
-				    pci_config_get8(config_handle, 0x52),
-				    pci_config_get8(config_handle, 0x53));
-				cardbus_err(NULL, 1,
-				    " Dscrd Tmr   = [0x%02x]          "
-				    "Retry Tmr   = [0x%02x]\n",
-				    pci_config_get8(config_handle, 0x55),
-				    pci_config_get8(config_handle, 0x54));
-				cardbus_err(NULL, 1,
-				    " I/O Spc 0   = [0x%08x]    "
-				    "I/O Spc 1   = [0x%08x]\n",
-				    pci_config_get32(config_handle, 0x58),
-				    pci_config_get32(config_handle, 0x5c));
-				cardbus_err(NULL, 1,
-				    " I/O Spc 2   = [0x%08x]    "
-				    "I/O Spc 3   = [0x%08x]\n",
-				    pci_config_get32(config_handle, 0x60),
-				    pci_config_get32(config_handle, 0x64));
-				cardbus_err(NULL, 1,
-				    " I/O Spc 4   = [0x%08x]    "
-				    "I/O Spc 5   = [0x%08x]\n",
-				    pci_config_get32(config_handle, 0x68),
-				    pci_config_get32(config_handle, 0x6c));
-				cardbus_err(NULL, 1,
-				    " Mem Spc 0   = [0x%08x]    "
-				    "Mem Spc 1   = [0x%08x]\n",
-				    pci_config_get32(config_handle, 0x70),
-				    pci_config_get32(config_handle, 0x74));
-				cardbus_err(NULL, 1,
-				    " Mem Spc 2   = [0x%08x]    "
-				    "Mem Spc 3   = [0x%08x]\n",
-				    pci_config_get32(config_handle, 0x78),
-				    pci_config_get32(config_handle, 0x7c));
-			}
-#endif
-			/*
-			 * Set bus properties
-			 */
-			if (cardbus_set_busnode_isaprops(new_child)
-			    != PCICFG_SUCCESS) {
-				cardbus_err(new_child, 1,
-				    "Failed to set busnode props\n");
-				disable_cardbus_device(config_handle);
-				goto failedchild;
-			}
-
-			/*
-			 * Add to the "reg" property.
-			 * Simply grab 1K of I/O space.
-			 */
-			if (cardbus_update_reg_prop(new_child,
-			    0xfffffc00 | PCI_BASE_SPACE_IO,
-			    PCI_CONF_BASE0) != PCICFG_SUCCESS) {
-				goto failedchild;
-			}
-
-			/*
-			 * Probe all potential children devices.
-			 */
-			for (i = 0;
-			    i < sizeof (isa_nodes) / sizeof (isa_nodes[0]);
-			    i++)
-				switch (cardbus_add_isa_node(cbp, new_child,
-				    &isa_nodes[i])) {
-				case PCICFG_FAILURE:
-					cardbus_err(parent, 1,
-					    "Failed to configure isa bus\n");
-					disable_cardbus_device(config_handle);
-					goto failedchild;
-
-				case PCICFG_NODEVICE:
-					continue;
-				}
-
-			break;
-
-		case PCI_BRIDGE_OTHER:
-		default:
-			cardbus_err(parent, 8,
-			    "--Found unknown bridge, subclass 0x%x @ "
-			    "bus [0x%x] device [0x%x] func [0x%x]\n",
-			    sub_class, bus, device, func);
-			goto leaf_node;
-		}
-	} else {
-		cardbus_err(parent, 8,
-		    "--Leaf device found "
-		    "bus [0x%x] device [0x%x] func [0x%x]\n",
-		    bus, device, func);
-		/*
-		 * Ethernet devices.
-		 */
-		if (strcmp(ddi_binding_name(new_child), "ethernet") == 0) {
-			extern int localetheraddr(struct ether_addr *,
-			    struct ether_addr *);
-			uchar_t mac[6];
-
-			cardbus_force_stringprop(new_child,
-			    "device_type", "network");
-
-			if (localetheraddr(NULL, (struct ether_addr *)mac)) {
-				(void) ddi_prop_create(DDI_DEV_T_NONE,
-				    new_child,
-				    DDI_PROP_CANSLEEP, "local-mac-address",
-				    (caddr_t)mac, 6);
-			}
-		}
-leaf_node:
-		if (cbp->cb_dsp) {
-			struct cb_deviceset_props *cdsp = cbp->cb_dsp;
-			uint16_t venid = pci_config_get16(config_handle,
-						PCI_CONF_VENID);
-			uint16_t devid = pci_config_get16(config_handle,
-						PCI_CONF_DEVID);
-			ddi_prop_t *propp;
-
-			for (cdsp = cbp->cb_dsp; cdsp; cdsp = cdsp->next) {
-				if (cdsp->binding_name &&
-				    strcmp(ddi_binding_name(new_child),
-				    cdsp->binding_name))
-					continue;
-				if (cdsp->venid && (cdsp->venid != venid))
-					continue;
-				if (cdsp->devid && (cdsp->devid != devid))
-					continue;
-				if (cdsp->nodename) {
-					if (ndi_devi_set_nodename(new_child,
-					    cdsp->nodename,
-					    0) != NDI_SUCCESS)
-						cardbus_err(new_child, 1,
-						    "Failed to set nodename\n");
-				}
-				for (propp = cdsp->prop_list; propp;
-				    propp = propp->prop_next) {
-					switch (propp->prop_flags) {
-					case DDI_PROP_TYPE_INT:
-						cardbus_force_intprop(
-						    new_child,
-						    propp->prop_name,
-						    (int *)propp->prop_val,
-						    propp->prop_len);
-						break;
-					case DDI_PROP_TYPE_STRING:
-						cardbus_force_stringprop(
-						    new_child,
-						    propp->prop_name,
-						    (char *)propp->prop_val);
-						break;
-					case DDI_PROP_TYPE_ANY:
-						cardbus_force_boolprop(
-						    new_child,
-						    propp->prop_name);
-						break;
-					}
-				}
-			}
-		}
-
-#if defined(CARDBUS_DEBUG)
-		if (cardbus_debug >= 9) {
-			cardbus_dump_config(config_handle);
-		}
-#endif
-
-		i = PCI_CONF_BASE0;
-
-		while (i <= PCI_CONF_BASE5) {
-			pci_config_put32(config_handle, i, 0xffffffff);
-
-			request = pci_config_get32(config_handle, i);
-
-			/*
-			 * If its a zero length, don't do
-			 * any programming.
-			 */
-			if (request != 0) {
-				if (request == (uint32_t)0xffffffff) {
-					cmn_err(CE_WARN,
-					    "cardbus_probe_children: "
-					    "can't access device");
-					goto failedchild;
-				}
-				/*
-				 * Add to the "reg" property
-				 */
-				if (cardbus_update_reg_prop(new_child,
-				    request, i) != PCICFG_SUCCESS) {
-					goto failedchild;
-				}
-			} else {
-				cardbus_err(parent, 8, "All memory found\n");
-				break;
-			}
-
-			/*
-			 * Increment by eight if it is 64 bit address space
-			 * only if memory space
-			 */
-			if (((PCI_BASE_TYPE_M & request)
-				== PCI_BASE_TYPE_ALL) &&
-			    ((PCI_BASE_SPACE_M & request)
-				== PCI_BASE_SPACE_MEM)) {
-				cardbus_err(parent, 8,
-				    "BASE register [0x%x] asks for "
-				    "[0x%x]=[0x%x] (64)\n",
-				    i, request,
-				    (~(PCI_BASE_M_ADDR_M & request))+1);
-				i += 8;
-			} else {
-				cardbus_err(parent, 8,
-				    "BASE register [0x%x] asks for "
-				    "[0x%x]=[0x%x](32)\n",
-				    i, request,
-				    (~(PCI_BASE_M_ADDR_M & request))+1);
-				i += 4;
-			}
-		}
-
-		/*
-		 * Get the ROM size and create register for it
-		 */
-		pci_config_put32(config_handle, PCI_CONF_ROM, 0xffffffff);
-
-		request = pci_config_get32(config_handle, PCI_CONF_ROM);
-		/*
-		 * If its a zero length, don't do
-		 * any programming.
-		 */
-
-		if (request != 0) {
-			cardbus_err(parent, 9,
-			    "BASE register [0x%x] asks for "
-			    "[0x%x]=[0x%x] (ROM)\n",
-			    PCI_CONF_ROM, request,
-			    (~(PCI_BASE_ROM_ADDR_M & request))+1);
-			/*
-			 * Add to the "reg" property
-			 */
-			if (cardbus_update_reg_prop(new_child,
-			    request,
-			    PCI_CONF_ROM) != PCICFG_SUCCESS) {
-				goto failedchild;
-			}
-		}
-	}
-
-	(void) cardbus_config_teardown(&config_handle);
-
-	/*
-	 * Attach the child to its parent
-	 */
-	(void) i_ndi_config_node(new_child, DS_LINKED, 0);
-	ndi_devi_exit(parent, circ);
-
-	return (PCICFG_SUCCESS);
-failedchild:
-	/*
-	 * check if it should be taken offline (if online)
-	 */
-	(void) cardbus_config_teardown(&config_handle);
-
-failedconfig:
-
-	(void) ndi_devi_free(new_child);
-	ndi_devi_exit(parent, circ);
-
-	return (PCICFG_FAILURE);
-}
-
-static int
-cardbus_add_config_reg(dev_info_t *dip,
-		uint_t bus, uint_t device, uint_t func)
-{
-	int reg[10] = { PCI_ADDR_CONFIG, 0, 0, 0, 0};
-
-	reg[0] = PCICFG_MAKE_REG_HIGH(bus, device, func, 0);
-
-	return (ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    "reg", reg, 5));
-}
-
-static int
-cardbus_add_isa_node(cbus_t *cbp, dev_info_t *parent, struct isa_node *node)
-{
-	dev_info_t		*new_child;
-	int			ret;
-	uint32_t		reg[3];
-
-	_NOTE(ARGUNUSED(cbp))
-
-	cardbus_err(parent, 6, "cardbus_add_isa_node\n");
-
-	/*
-	 * This node will be put immediately below
-	 * "parent". Allocate a blank device node.
-	 */
-	if (ndi_devi_alloc(parent, DEVI_PSEUDO_NEXNAME,
-	    (pnode_t)DEVI_SID_NODEID,
-	    &new_child) != NDI_SUCCESS) {
-		cardbus_err(parent, 1,
-		    "cardbus_add_isa_child(): Failed to alloc child node\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * Set properties common to ISA devices
-	 */
-	if (cardbus_set_isa_props(parent, new_child, node->name,
-	    node->compatible) != PCICFG_SUCCESS) {
-		cardbus_err(parent, 1, "Failed to set ISA properties\n");
-		goto failed;
-	}
-
-	cardbus_err(new_child, 8, "--Leaf ISA device\n");
-
-	/*
-	 * Add the "reg" property.
-	 */
-	reg[0] = 0;
-	reg[1] = node->reg;
-	reg[2] = node->span;
-
-	ret = ndi_prop_update_int_array(DDI_DEV_T_NONE, new_child,
-	    "basereg", (int *)reg, 3);
-	if (ret != DDI_SUCCESS)
-		goto failed;
-
-	(void) i_ndi_config_node(new_child, DS_LINKED, 0);
-
-	return (PCICFG_SUCCESS);
-
-failed:
-	(void) ndi_devi_free(new_child);
-
-	return (PCICFG_FAILURE);
-}
-
-static int
-cardbus_config_setup(dev_info_t *dip, ddi_acc_handle_t *handle)
-{
-	caddr_t		cfgaddr;
-	ddi_device_acc_attr_t	attr;
-	dev_info_t	*anode;
-	int	status;
-	int	rlen;
-	pci_regspec_t	*reg;
-	int		ret;
-#ifdef sparc
-	int16_t		val;
-#endif
-
-	cardbus_err(dip, 10,
-	    "cardbus_config_setup(dip=0x%p)\n", (void *) dip);
-
-	/*
-	 * Get the pci register spec from the node
-	 */
-	status = ddi_getlongprop(DDI_DEV_T_NONE,
-	    dip, DDI_PROP_DONTPASS, "reg",
-	    (caddr_t)&reg, &rlen);
-
-	cardbus_err(dip, 10,
-	    "cardbus_config_setup, reg = 0x%p\n", (void *) reg);
-
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		break;
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1, "reg present, but unable to get memory\n");
-		return (PCICFG_FAILURE);
-	default:
-		cardbus_err(dip, 1, "no reg property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	anode = dip;
-
-	/*
-	 * Find the attachment point node
-	 */
-	while ((anode != NULL) && (strcmp(ddi_binding_name(anode),
-	    "hp_attachment") != 0)) {
-		anode = ddi_get_parent(anode);
-	}
-
-	if (anode == NULL) {
-		cardbus_err(dip, 1, "Tree not in PROBE state\n");
-		kmem_free((caddr_t)reg, rlen);
-		return (PCICFG_FAILURE);
-	}
-
-	if ((ret = ndi_prop_update_int_array(DDI_DEV_T_NONE, anode,
-	    "reg", (int *)reg, 5)) != 0) {
-		cardbus_err(dip, 1,
-		    "Failed to update reg property, error code %d\n", ret);
-		kmem_free((caddr_t)reg, rlen);
-		return (PCICFG_FAILURE);
-	}
-
-	attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-	attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-	attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-	if (ddi_regs_map_setup(anode, 0, &cfgaddr,
-	    0, /* PCI_CONF_HDR_SIZE */
-	    0,
-	    &attr, handle) != DDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "Failed to setup registers for [0x%x][0x%x][0x%x]\n",
-		    PCI_REG_BUS_G(reg->pci_phys_hi),
-		    PCI_REG_DEV_G(reg->pci_phys_hi),
-		    PCI_REG_FUNC_G(reg->pci_phys_hi));
-		kmem_free((caddr_t)reg, rlen);
-		return (PCICFG_FAILURE);
-	}
-
-	cardbus_err(dip, 9,
-	    "PROBING =>->->->->->-> [0x%x][0x%x][0x%x] 0x%x 0x%p\n",
-	    PCI_REG_BUS_G(reg->pci_phys_hi),
-	    PCI_REG_DEV_G(reg->pci_phys_hi),
-	    PCI_REG_FUNC_G(reg->pci_phys_hi),
-	    reg->pci_phys_hi, (void *) cfgaddr);
-
-	/*
-	 * must do peek16 otherwise the system crashes when probing
-	 * a non zero function on a non-multi-function card.
-	 */
-#ifdef sparc
-	if (ddi_peek16(anode, (int16_t *)cfgaddr, &val) != DDI_SUCCESS) {
-		cardbus_err(dip, 8,
-		    "cardbus_config_setup peek failed\n");
-		ret = PCICFG_NODEVICE;
-	} else if (ddi_get16(*handle, (uint16_t *)cfgaddr) == 0xffff) {
-		cardbus_err(dip, 8,
-		    "cardbus_config_setup PCICFG_NODEVICE\n");
-		ret = PCICFG_NODEVICE;
-#elif defined(__x86) || defined(__amd64)
-	if (ddi_get16(*handle, (uint16_t *)cfgaddr) == 0xffff) {
-		cardbus_err(dip, 8,
-		    "cardbus_config_setup PCICFG_NODEVICE\n");
-		ret = PCICFG_NODEVICE;
-#endif
-	} else {
-		cardbus_err(dip, 1,
-		    "cardbus_config_setup found device at:[0x%x][0x%x][0x%x]\n",
-		    PCI_REG_BUS_G(reg->pci_phys_hi),
-		    PCI_REG_DEV_G(reg->pci_phys_hi),
-		    PCI_REG_FUNC_G(reg->pci_phys_hi));
-
-		ret = PCICFG_SUCCESS;
-	}
-
-	kmem_free((caddr_t)reg, rlen);
-	if (ret != PCICFG_SUCCESS) {
-		cardbus_config_teardown(handle);
-	}
-
-	cardbus_err(dip, 7,
-	    "cardbus_config_setup returning %d\n", ret);
-
-	return (ret);
-}
-
-static void
-cardbus_config_teardown(ddi_acc_handle_t *handle)
-{
-	(void) ddi_regs_map_free(handle);
-}
-
-static void
-cardbus_reparent_children(dev_info_t *dip, dev_info_t *parent)
-{
-	dev_info_t *child;
-	int circ;
-
-	while (child = ddi_get_child(dip)) {
-		ASSERT(i_ddi_node_state(child) <= DS_LINKED);
-		/*
-		 * Unlink node from tree before reparenting
-		 */
-		ndi_devi_enter(dip, &circ);
-		(void) i_ndi_unconfig_node(child, DS_PROTO, 0);
-		ndi_devi_exit(dip, circ);
-		DEVI(child)->devi_parent = DEVI(parent);
-		DEVI(child)->devi_bus_ctl = DEVI(parent);
-		ndi_devi_enter(parent, &circ);
-		(void) i_ndi_config_node(child, DS_LINKED, 0);
-		ndi_devi_exit(parent, circ);
-	}
-}
-
-static int
-cardbus_update_assigned_prop(dev_info_t *dip, pci_regspec_t *newone)
-{
-	int		alen;
-	pci_regspec_t	*assigned;
-	caddr_t		newreg;
-	uint_t		status;
-
-	status = ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "assigned-addresses", (caddr_t)&assigned, &alen);
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		cardbus_err(dip, 5,
-		    "cardbus_update_assigned_prop: found prop len %d\n",
-		    alen);
-		/*
-		 * Allocate memory for the existing
-		 * assigned-addresses(s) plus one and then
-		 * build it.
-		 */
-		newreg = kmem_zalloc(alen+sizeof (*newone), KM_SLEEP);
-
-		bcopy(assigned, newreg, alen);
-		bcopy(newone, newreg + alen, sizeof (*newone));
-		break;
-
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1,
-		    "no memory for assigned-addresses property\n");
-		return (PCICFG_FAILURE);
-
-	default:
-		cardbus_err(dip, 5,
-		    "cardbus_update_assigned_prop: creating prop\n");
-		alen = 0;
-		newreg = (caddr_t)newone;
-		break;
-	}
-
-	/*
-	 * Write out the new "assigned-addresses" spec
-	 */
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    "assigned-addresses", (int *)newreg,
-	    (alen + sizeof (*newone))/sizeof (int));
-
-	if (status == DDI_PROP_SUCCESS)
-		kmem_free((caddr_t)newreg, alen+sizeof (*newone));
-
-	if (alen)
-		kmem_free(assigned, alen);
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_update_available_prop(dev_info_t *dip, uint32_t hi_type,
-				uint64_t base, uint64_t size)
-{
-	int		alen, rlen;
-	pci_regspec_t	*available, *reg;
-	pci_regspec_t	addition;
-	caddr_t		newreg;
-	uint_t		status;
-
-	cardbus_err(dip, 6, "cardbus_update_available_prop\n");
-
-	status = ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "reg", (caddr_t)&reg, &rlen);
-
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		break;
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1, "reg present, but unable to get memory\n");
-		return (PCICFG_FAILURE);
-	default:
-		cardbus_err(dip, 1, "no reg property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	status = ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "available", (caddr_t)&available, &alen);
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		break;
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1, "no memory for available property\n");
-		kmem_free((caddr_t)reg, rlen);
-		return (PCICFG_FAILURE);
-	default:
-		alen = 0;
-	}
-
-	/*
-	 * Allocate memory for the existing
-	 * available(s) plus one and then
-	 * build it.
-	 */
-	newreg = kmem_zalloc(alen + sizeof (pci_regspec_t), KM_SLEEP);
-
-	/*
-	 * Build the regspec, then add it to the existing one(s)
-	 */
-	addition.pci_phys_hi = hi_type |
-	    PCICFG_MAKE_REG_HIGH(PCI_REG_BUS_G(reg->pci_phys_hi),
-	    PCI_REG_DEV_G(reg->pci_phys_hi),
-	    PCI_REG_FUNC_G(reg->pci_phys_hi), 0);
-
-	addition.pci_phys_mid = (uint32_t)((base>>32) & 0xffffffff);
-	addition.pci_phys_low = (uint32_t)(base & 0xffffffff);
-	addition.pci_size_hi = (uint32_t)((size>>32) & 0xffffffff);
-	addition.pci_size_low = (uint32_t)(size & 0xffffffff);
-
-#ifdef DEBUG
-	cardbus_dump_reg(dip, &addition, 1);
-#endif
-
-	if (alen)
-		bcopy(available, newreg, alen);
-	bcopy(&addition, newreg + alen, sizeof (pci_regspec_t));
-
-	/*
-	 * Write out the new "available" spec
-	 */
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    "available", (int *)newreg,
-	    (alen + sizeof (pci_regspec_t))/sizeof (int));
-
-	if (alen)
-		kmem_free((caddr_t)available, alen);
-	kmem_free((caddr_t)reg, rlen);
-	kmem_free((caddr_t)newreg, alen + sizeof (pci_regspec_t));
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_update_ranges_prop(dev_info_t *dip, cardbus_range_t *addition)
-{
-	int		rlen;
-	cardbus_range_t	*ranges;
-	caddr_t		newreg;
-	uint_t		status;
-#if defined(CARDBUS_DEBUG)
-	int	i, nrange;
-	const cardbus_range_t	*nr;
-#endif
-
-	cardbus_err(dip, 6, "cardbus_update_ranges_prop\n");
-
-	status = ddi_getlongprop(DDI_DEV_T_NONE,
-	    dip, DDI_PROP_DONTPASS, "ranges",
-	    (caddr_t)&ranges, &rlen);
-
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		break;
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1,
-		    "ranges present, but unable to get memory\n");
-		return (PCICFG_FAILURE);
-	default:
-		cardbus_err(dip, 8, "no ranges property - creating one\n");
-		if (ndi_prop_update_int_array(DDI_DEV_T_NONE,
-		    dip, "ranges", (int *)addition,
-		    sizeof (cardbus_range_t)/sizeof (int))
-		    != DDI_SUCCESS) {
-			cardbus_err(dip, 1, "Did'nt create ranges property\n");
-			return (PCICFG_FAILURE);
-		}
-		return (PCICFG_SUCCESS);
-	}
-
-	/*
-	 * Allocate memory for the existing reg(s) plus one and then
-	 * build it.
-	 */
-	newreg = kmem_zalloc(rlen+sizeof (cardbus_range_t), KM_SLEEP);
-
-	bcopy(ranges, newreg, rlen);
-	bcopy(addition, newreg + rlen, sizeof (cardbus_range_t));
-
-	/*
-	 * Write out the new "ranges" property
-	 */
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE,
-	    dip, "ranges", (int *)newreg,
-	    (rlen + sizeof (cardbus_range_t))/sizeof (int));
-
-#if defined(CARDBUS_DEBUG)
-	cardbus_err(dip, 8, "cardbus_update_ranges_prop ranges property:\n");
-
-	nrange = rlen / sizeof (cardbus_range_t);
-	nr = (cardbus_range_t *)newreg;
-	for (i = 0; i <= nrange; i++) {
-		/* nrange is one higher for new entry */
-		cardbus_err(dip, 9,
-		    "\trange parent addr 0x%x.0x%x.0x%x "
-		    "child addr 0x%x.0x%x.0x%x size 0x%x.0x%x\n",
-		    nr->parent_hi,
-		    nr->parent_mid, nr->parent_lo,
-		    nr->child_hi,
-		    nr->child_mid, nr->child_lo,
-		    nr->size_hi, nr->size_lo);
-		nr++;
-	}
-#endif
-
-	kmem_free((caddr_t)newreg, rlen+sizeof (cardbus_range_t));
-	kmem_free((caddr_t)ranges, rlen);
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_update_reg_prop(dev_info_t *dip, uint32_t regvalue, uint_t reg_offset)
-{
-	int	rlen;
-	pci_regspec_t	*reg;
-	caddr_t		newreg;
-	uint32_t	hiword;
-	pci_regspec_t	addition;
-	uint32_t	size;
-	uint_t		status;
-
-	status = ddi_getlongprop(DDI_DEV_T_NONE,
-	    dip, DDI_PROP_DONTPASS, "reg", (caddr_t)&reg, &rlen);
-
-	switch (status) {
-	case DDI_PROP_SUCCESS:
-		break;
-	case DDI_PROP_NO_MEMORY:
-		cardbus_err(dip, 1, "reg present, but unable to get memory\n");
-		return (PCICFG_FAILURE);
-	default:
-		cardbus_err(dip, 1, "no reg property\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * Allocate memory for the existing reg(s) plus one and then
-	 * build it.
-	 */
-	newreg = kmem_zalloc(rlen+sizeof (pci_regspec_t), KM_SLEEP);
-
-	/*
-	 * Build the regspec, then add it to the existing one(s)
-	 */
-	hiword = PCICFG_MAKE_REG_HIGH(PCI_REG_BUS_G(reg->pci_phys_hi),
-			PCI_REG_DEV_G(reg->pci_phys_hi),
-			PCI_REG_FUNC_G(reg->pci_phys_hi),
-			reg_offset);
-
-	if (reg_offset == PCI_CONF_ROM) {
-		size = (~(PCI_BASE_ROM_ADDR_M & regvalue))+1;
-		hiword |= PCI_ADDR_MEM32;
-	} else {
-		size = (~(PCI_BASE_M_ADDR_M & regvalue))+1;
-
-		if ((PCI_BASE_SPACE_M & regvalue) == PCI_BASE_SPACE_MEM) {
-			if ((PCI_BASE_TYPE_M & regvalue) == PCI_BASE_TYPE_MEM) {
-				hiword |= PCI_ADDR_MEM32;
-			} else if ((PCI_BASE_TYPE_M & regvalue)
-				    == PCI_BASE_TYPE_ALL) {
-				/*
-				 * This is a 64 bit PCI memory space.
-				 * It needs to be allocated as 32 bit
-				 * for bus map purposes.
-				 */
-				hiword |= PCI_ADDR_MEM32;
-			}
-		} else {
-			hiword |= PCI_ADDR_IO;
-		}
-	}
-
-	addition.pci_phys_hi = hiword;
-	addition.pci_phys_mid = 0;
-	addition.pci_phys_low = 0;
-	addition.pci_size_hi = 0;
-	addition.pci_size_low = size;
-
-	cardbus_err(dip, 8,
-	    "cardbus_update_reg_prop, phys_hi 0x%08x,"
-	    " phys_mid 0x%08x, phys_low 0x%08x, size_hi 0x%08x,"
-	    " size_low 0x%08x\n", hiword, 0, 0, 0, size);
-
-	bcopy(reg, newreg, rlen);
-	bcopy(&addition, newreg + rlen, sizeof (pci_regspec_t));
-
-	/*
-	 * Write out the new "reg" property
-	 */
-	(void) ndi_prop_update_int_array(DDI_DEV_T_NONE,
-	    dip, "reg", (int *)newreg,
-	    (rlen + sizeof (pci_regspec_t))/sizeof (int));
-
-	kmem_free((caddr_t)reg, rlen);
-	kmem_free((caddr_t)newreg, rlen+sizeof (pci_regspec_t));
-
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Setup the basic 1275 properties based on information found in the config
- * header of the PCI device
- */
-static int
-cardbus_set_standard_props(dev_info_t *parent, dev_info_t *dip,
-			ddi_acc_handle_t config_handle)
-{
-	int ret;
-	uint16_t val;
-	uint32_t wordval;
-	uint8_t byteval;
-
-	/* These two exists only for non-bridges */
-	if ((pci_config_get8(config_handle,
-	    PCI_CONF_HEADER) & PCI_HEADER_TYPE_M) == PCI_HEADER_ZERO) {
-		byteval = pci_config_get8(config_handle, PCI_CONF_MIN_G);
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "min-grant", byteval)) != DDI_SUCCESS) {
-			cardbus_err(dip, 1, "Failed to sent min-grant\n");
-			return (ret);
-		}
-
-		byteval = pci_config_get8(config_handle, PCI_CONF_MAX_L);
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "max-latency", byteval)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-
-	/*
-	 * These should always exist and have the value of the
-	 * corresponding register value
-	 */
-	val = pci_config_get16(config_handle, PCI_CONF_VENID);
-
-	/*
-	 * according to section 6.2.1 of revision 2 of the PCI local
-	 * bus specification - 0FFFFh is an invalid value for the vendor ID
-	 */
-	if (val == 0xffff) {
-		cardbus_err(dip, 1, "Illegal vendor-id 0x%x\n", val);
-		return (PCICFG_FAILURE);
-	}
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "vendor-id", val)) != DDI_SUCCESS) {
-		return (ret);
-	}
-
-	val = pci_config_get16(config_handle, PCI_CONF_DEVID);
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "device-id", val)) != DDI_SUCCESS) {
-		return (ret);
-	}
-	byteval = pci_config_get8(config_handle, PCI_CONF_REVID);
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "revision-id", byteval)) != DDI_SUCCESS) {
-		return (ret);
-	}
-
-	wordval = (pci_config_get16(config_handle, PCI_CONF_SUBCLASS)<< 8) |
-		(pci_config_get8(config_handle, PCI_CONF_PROGCLASS));
-
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "class-code", wordval)) != DDI_SUCCESS) {
-		return (ret);
-	}
-	val = (pci_config_get16(config_handle,
-	    PCI_CONF_STAT) & PCI_STAT_DEVSELT) >> 9;
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "devsel-speed", val)) != DDI_SUCCESS) {
-		return (ret);
-	}
-
-	/*
-	 * The next three are bits set in the status register.  The property is
-	 * present (but with no value other than its own existence) if the bit
-	 * is set, non-existent otherwise
-	 */
-	if (ddi_prop_exists(DDI_DEV_T_ANY, parent, DDI_PROP_DONTPASS,
-	    "fast-back-to-back") &&
-	    pci_config_get16(config_handle, PCI_CONF_STAT) & PCI_STAT_FBBC) {
-
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "fast-back-to-back", 0)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-	if (pci_config_get16(config_handle, PCI_CONF_STAT) & PCI_STAT_66MHZ) {
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "66mhz-capable", 0)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-	if (pci_config_get16(config_handle, PCI_CONF_STAT) & PCI_STAT_UDF) {
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "udf-supported", 0)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-
-	/*
-	 * These next three are optional and are not present
-	 * if the corresponding register is zero.  If the value
-	 * is non-zero then the property exists with the value
-	 * of the register.
-	 */
-
-	/* look in the correct place for header type 2 */
-	byteval = pci_config_get8(config_handle, PCI_CONF_HEADER);
-	if ((byteval & PCI_HEADER_TYPE_M) == PCI_HEADER_TWO) {
-		if ((val = pci_config_get16(config_handle,
-		    PCI_CBUS_SUBVENID)) != 0) {
-			if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-			    "subsystem-vendor-id", val)) != DDI_SUCCESS) {
-				return (ret);
-			}
-		}
-		if ((val = pci_config_get16(config_handle,
-		    PCI_CBUS_SUBSYSID)) != 0) {
-			if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-			    "subsystem-id", val)) != DDI_SUCCESS) {
-				return (ret);
-			}
-		}
-	} else {
-		if ((val = pci_config_get16(config_handle,
-		    PCI_CONF_SUBVENID)) != 0) {
-			if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-			    "subsystem-vendor-id", val)) != DDI_SUCCESS) {
-				return (ret);
-			}
-		}
-		if ((val = pci_config_get16(config_handle,
-		    PCI_CONF_SUBSYSID)) != 0) {
-			if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-			    "subsystem-id", val)) != DDI_SUCCESS) {
-				return (ret);
-			}
-		}
-	}
-
-	if ((val = pci_config_get8(config_handle,
-	    PCI_CONF_CACHE_LINESZ)) != 0) {
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "cache-line-size", val)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-
-	/*
-	 * If the Interrupt Pin register is non-zero then the
-	 * interrupts property exists
-	 */
-	if ((byteval = pci_config_get8(config_handle, PCI_CONF_IPIN)) != 0) {
-		/*
-		 * If interrupt pin is non-zero,
-		 * record the interrupt line used
-		 */
-		cardbus_err(dip, 8, "Adding interrupts property\n");
-		if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    "interrupts", byteval)) != DDI_SUCCESS) {
-			return (ret);
-		}
-	}
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Setup the basic properties required by the ISA node.
- */
-static int
-cardbus_set_isa_props(dev_info_t *parent, dev_info_t *dip,
-			char *name, char *compat[])
-{
-	int ret, n;
-
-	_NOTE(ARGUNUSED(parent))
-
-	cardbus_err(dip, 8, "Adding interrupts property\n");
-	if ((ret = ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "interrupts", 1)) != DDI_SUCCESS) {
-		return (ret);
-	}
-
-	/*
-	 * The node name field needs to be filled in with the name
-	 */
-	if (ndi_devi_set_nodename(dip, name, 0) != NDI_SUCCESS) {
-		cardbus_err(dip, 1, "Failed to set nodename for node\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * Create the compatible property as an array of pointers
-	 * to strings.  Start with the buffer created above.
-	 */
-	n = 0;
-	while (compat[n] != NULL)
-		n++;
-
-	if (n != 0)
-		if ((ret = ndi_prop_update_string_array(DDI_DEV_T_NONE, dip,
-		    "compatible", compat, n)) != DDI_SUCCESS)
-			return (ret);
-
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_set_busnode_props(dev_info_t *dip)
-{
-	cardbus_err(dip, 6, "cardbus_set_busnode_props\n");
-
-	cardbus_force_stringprop(dip, "device_type", "pci");
-
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#address-cells", 3) != DDI_SUCCESS) {
-		cardbus_err(dip, 4, "Failed to set #address-cells\n");
-	}
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#size-cells", 2) != DDI_SUCCESS) {
-		cardbus_err(dip, 4, "Failed to set #size-cells\n");
-	}
-	return (PCICFG_SUCCESS);
-}
-
-static int
-cardbus_set_busnode_isaprops(dev_info_t *dip)
-{
-	cardbus_err(dip, 6, "cardbus_set_busnode_props\n");
-
-	cardbus_force_stringprop(dip, "device_type", "isa");
-
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#address-cells", 2) != DDI_SUCCESS) {
-		cardbus_err(dip, 4, "Failed to set #address-cells\n");
-	}
-	if (ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-	    "#size-cells", 1) != DDI_SUCCESS) {
-		cardbus_err(dip, 4, "Failed to set #size-cells\n");
-	}
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Use cb%x,%x rather than pci%x,%x so that we can use specific cardbus
- * drivers in /etc/driver_aliases if required
- */
-static int
-cardbus_set_childnode_props(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	int		ret;
-#ifndef _DONT_USE_1275_GENERIC_NAMES
-	uint32_t	wordval;
-#endif
-	char		*name;
-	char		buffer[64];
-	uint32_t	classcode;
-	char		*compat[8];
-	int		i, n;
-	uint16_t	subsysid, subvenid, devid, venid;
-	uint8_t		header_type;
-
-	/*
-	 * NOTE: These are for both a child and PCI-PCI bridge node
-	 */
-#ifndef _DONT_USE_1275_GENERIC_NAMES
-	wordval = (pci_config_get16(config_handle, PCI_CONF_SUBCLASS)<< 8) |
-	    (pci_config_get8(config_handle, PCI_CONF_PROGCLASS));
-#endif
-
-	/* Cardbus support */
-	venid = pci_config_get16(config_handle, PCI_CONF_VENID);
-	devid = pci_config_get16(config_handle, PCI_CONF_DEVID);
-
-	header_type = pci_config_get8(config_handle, PCI_CONF_HEADER);
-	if ((header_type & PCI_HEADER_TYPE_M) == PCI_HEADER_TWO) {
-		subvenid = pci_config_get16(config_handle, PCI_CBUS_SUBVENID);
-		subsysid = pci_config_get16(config_handle, PCI_CBUS_SUBSYSID);
-	} else {
-		subvenid = pci_config_get16(config_handle, PCI_CONF_SUBVENID);
-		subsysid = pci_config_get16(config_handle, PCI_CONF_SUBSYSID);
-	}
-
-	if (subsysid != 0) {
-		(void) sprintf(buffer, "pci%x,%x", subvenid, subsysid);
-	} else {
-		(void) sprintf(buffer, "pci%x,%x", venid, devid);
-	}
-
-	cardbus_err(dip, 8, "Childname is %s\n", buffer);
-
-	/*
-	 * In some environments, trying to use "generic" 1275 names is
-	 * not the convention.  In those cases use the name as created
-	 * above.  In all the rest of the cases, check to see if there
-	 * is a generic name first.
-	 */
-#ifdef _DONT_USE_1275_GENERIC_NAMES
-	name = buffer;
-#else
-	if ((name = cardbus_get_class_name(wordval>>8)) == NULL) {
-		/*
-		 * Set name to the above fabricated name
-		 */
-		name = buffer;
-	}
-
-	cardbus_err(dip, 8, "Set nodename to %s\n", name);
-#endif
-
-	/*
-	 * The node name field needs to be filled in with the name
-	 */
-	if (ndi_devi_set_nodename(dip, name, 0) != NDI_SUCCESS) {
-		cardbus_err(dip, 1, "Failed to set nodename for node\n");
-		return (PCICFG_FAILURE);
-	}
-
-	/*
-	 * Create the compatible property as an array of pointers
-	 * to strings.  Start with the cb name.
-	 */
-	n = 0;
-
-	if (subsysid != 0) {
-		(void) sprintf(buffer, "cb%x,%x", subvenid, subsysid);
-	} else {
-		(void) sprintf(buffer, "cb%x,%x", venid, devid);
-	}
-
-	compat[n] = kmem_alloc(strlen(buffer) + 1, KM_SLEEP);
-	(void) strcpy(compat[n++], buffer);
-
-	if (subsysid != 0) {
-		/*
-		 * Add subsys numbers as pci compatible.
-		 */
-		(void) sprintf(buffer, "pci%x,%x", subvenid, subsysid);
-		compat[n] = kmem_alloc(strlen(buffer) + 1, KM_SLEEP);
-		(void) strcpy(compat[n++], buffer);
-	}
-
-	/*
-	 * Add in the VendorID/DeviceID compatible name.
-	 */
-	(void) sprintf(buffer, "pci%x,%x", venid, devid);
-
-	compat[n] = kmem_alloc(strlen(buffer) + 1, KM_SLEEP);
-	(void) strcpy(compat[n++], buffer);
-
-	classcode = (pci_config_get16(config_handle, PCI_CONF_SUBCLASS)<< 8) |
-	    (pci_config_get8(config_handle, PCI_CONF_PROGCLASS));
-
-	/*
-	 * Add in the Classcode
-	 */
-	(void) sprintf(buffer, "pciclass,%06x", classcode);
-
-	cardbus_err(dip, 8, "class code %s\n", buffer);
-
-	compat[n] = kmem_alloc(strlen(buffer) + 1, KM_SLEEP);
-	(void) strcpy(compat[n++], buffer);
-
-	if ((ret = ndi_prop_update_string_array(DDI_DEV_T_NONE, dip,
-	    "compatible", (char **)compat, n)) != DDI_SUCCESS) {
-		return (ret);
-	}
-
-	for (i = 0; i < n; i++) {
-		kmem_free(compat[i], strlen(compat[i]) + 1);
-	}
-
-	return (PCICFG_SUCCESS);
-}
-
-/*
- * Program the bus numbers into the bridge
- */
-static void
-cardbus_set_bus_numbers(ddi_acc_handle_t config_handle,
-			uint_t primary, uint_t secondary)
-{
-	cardbus_err(NULL, 8,
-	    "cardbus_set_bus_numbers [%d->%d]\n", primary, secondary);
-
-	/*
-	 * Primary bus#
-	 */
-	pci_config_put8(config_handle, PCI_BCNF_PRIBUS, primary);
-
-	/*
-	 * Secondary bus#
-	 */
-	pci_config_put8(config_handle, PCI_BCNF_SECBUS, secondary);
-
-	/*
-	 * Set the subordinate bus number to ff in order to pass through any
-	 * type 1 cycle with a bus number higher than the secondary bus#
-	 * Note that this is reduced once the probe is complete in the
-	 * cardbus_setup_bridge() function.
-	 */
-	pci_config_put8(config_handle, PCI_BCNF_SUBBUS, 0xFF);
-}
-
-static void
-enable_pci_isa_bridge(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, stat;
-
-	stat = pci_config_get16(config_handle, PCI_CONF_STAT);
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-
-	/*
-	 * Enable memory, IO, bus mastership and error detection.
-	 */
-	comm |= (PCI_COMM_ME | PCI_COMM_MAE | PCI_COMM_IO |
-	    PCI_COMM_PARITY_DETECT | PCI_COMM_SERR_ENABLE);
-	if (ddi_prop_exists(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    "fast-back-to-back"))
-		comm |= PCI_COMM_BACK2BACK_ENAB;
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-	cardbus_err(NULL, 8,
-	    "enable_pci_isa_bridge stat 0x%04x comm 0x%04x\n", stat, comm);
-
-	/*
-	 * ITE8888 Specific registers.
-	 */
-	pci_config_put8(config_handle, 0x50, 0x00); /* Timing Control */
-	pci_config_put8(config_handle, 0x52, 0x00); /* Master DMA Access */
-	pci_config_put8(config_handle, 0x53, 0x01); /* ROMCS */
-}
-
-static void
-enable_pci_pci_bridge(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, stat, bctrl;
-
-	stat = pci_config_get16(config_handle, PCI_CONF_STAT);
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-	bctrl = pci_config_get16(config_handle, PCI_CBUS_BRIDGE_CTRL);
-
-	comm &= ~(PCI_COMM_IO | PCI_COMM_MAE);
-	comm |= (PCI_COMM_ME | PCI_COMM_PARITY_DETECT | PCI_COMM_SERR_ENABLE);
-
-	/*
-	 * Enable back to back.
-	 */
-	if (stat & PCI_STAT_FBBC)
-		comm |= PCI_COMM_BACK2BACK_ENAB;
-
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-
-	/*
-	 * Reset the sub-ordinate bus.
-	 */
-	if (!(bctrl & PCI_BCNF_BCNTRL_RESET))
-		pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL,
-			bctrl | PCI_BCNF_BCNTRL_RESET);
-	else
-		bctrl &= ~PCI_BCNF_BCNTRL_RESET;
-
-	/*
-	 * Enable error reporting.
-	 */
-	bctrl |= (PCI_BCNF_BCNTRL_PARITY_ENABLE | PCI_BCNF_BCNTRL_SERR_ENABLE |
-	    PCI_BCNF_BCNTRL_MAST_AB_MODE);
-
-	/*
-	 * Enable back to back on secondary bus.
-	 */
-	if (stat & PCI_STAT_FBBC)
-		bctrl |= PCI_BCNF_BCNTRL_B2B_ENAB;
-
-	pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL, bctrl);
-	cardbus_err(dip, 8,
-	    "enable_pci_pci_bridge stat 0x%04x comm 0x%04x bctrl 0x%04x\n",
-	    stat, comm, bctrl);
-}
-
-static int	cardbus_reset_wait = 20;
-
-static void
-enable_cardbus_bridge(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, stat, bctrl;
-
-	stat = pci_config_get16(config_handle, PCI_CONF_STAT);
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-	bctrl = pci_config_get16(config_handle, PCI_CBUS_BRIDGE_CTRL);
-
-	/*
-	 * Don't mess with the command register on the cardbus bridge
-	 * itself. This should have been done when it's parent
-	 * did the setup. Some devices *require* certain things to
-	 * disabled, this can be done using the "command-preserve"
-	 * property and if we mess with it here it breaks that.
-	 *
-	 * comm |= (PCI_COMM_ME | PCI_COMM_PARITY_DETECT |
-	 *	PCI_COMM_SERR_ENABLE);
-	 */
-
-	/*
-	 * Reset the sub-ordinate bus.
-	 */
-	if (!(bctrl & PCI_BCNF_BCNTRL_RESET))
-		pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL,
-			bctrl | PCI_BCNF_BCNTRL_RESET);
-	else
-		bctrl &= ~PCI_BCNF_BCNTRL_RESET;
-
-	/*
-	 * Turn off pre-fetch.
-	 */
-	bctrl &= ~(CB_BCNF_BCNTRL_MEM0_PREF | CB_BCNF_BCNTRL_MEM1_PREF |
-	    PCI_BCNF_BCNTRL_PARITY_ENABLE | PCI_BCNF_BCNTRL_SERR_ENABLE);
-
-	/*
-	 * Enable error reporting.
-	 */
-	bctrl |= (PCI_BCNF_BCNTRL_MAST_AB_MODE | CB_BCNF_BCNTRL_WRITE_POST);
-	if (comm & PCI_COMM_PARITY_DETECT)
-		bctrl |= PCI_BCNF_BCNTRL_PARITY_ENABLE;
-	if (comm & PCI_COMM_SERR_ENABLE)
-		bctrl |= PCI_BCNF_BCNTRL_SERR_ENABLE;
-
-	pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL, bctrl);
-	pci_config_put8(config_handle, PCI_CBUS_LATENCY_TIMER,
-	    cardbus_latency_timer);
-
-	pci_config_put16(config_handle, PCI_CONF_STAT, stat);
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-
-	cardbus_err(dip, 8,
-	    "enable_cardbus_bridge() stat 0x%04x comm 0x%04x bctrl 0x%04x\n",
-	    stat, comm, bctrl);
-
-	/* after resetting the bridge, wait for everything to stablize */
-	delay(drv_usectohz(cardbus_reset_wait * 1000));
-
-}
-
-static void
-disable_pci_pci_bridge(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, bctrl;
-
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-	bctrl = pci_config_get16(config_handle, PCI_CBUS_BRIDGE_CTRL);
-
-	/*
-	 * Turn off subordinate bus access.
-	 */
-	pci_config_put8(config_handle, PCI_BCNF_SECBUS, 0);
-	pci_config_put8(config_handle, PCI_BCNF_SUBBUS, 0);
-
-	/*
-	 * Disable error reporting.
-	 */
-	bctrl &= ~(PCI_BCNF_BCNTRL_PARITY_ENABLE | PCI_BCNF_BCNTRL_SERR_ENABLE |
-	    PCI_BCNF_BCNTRL_MAST_AB_MODE);
-	comm = 0;
-
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-	pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL, bctrl);
-
-	cardbus_err(dip, 6,
-	    "disable_pci_pci_bridge() stat 0x%04x comm 0x%04x bctrl 0x%04x\n",
-	    pci_config_get16(config_handle, PCI_CONF_STAT), comm, bctrl);
-}
-
-static void
-disable_cardbus_bridge(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, bctrl;
-
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-	bctrl = pci_config_get16(config_handle, PCI_CBUS_BRIDGE_CTRL);
-
-	/*
-	 * Turn off subordinate bus access.
-	 */
-	pci_config_put8(config_handle, PCI_BCNF_SECBUS, 0);
-	pci_config_put8(config_handle, PCI_BCNF_SUBBUS, 0);
-
-	/*
-	 * Disable error reporting.
-	 */
-	bctrl &= ~(PCI_BCNF_BCNTRL_PARITY_ENABLE | PCI_BCNF_BCNTRL_SERR_ENABLE |
-	    PCI_BCNF_BCNTRL_MAST_AB_MODE);
-
-	pci_config_put32(config_handle, PCI_CBUS_MEM_LIMIT0, 0);
-	pci_config_put32(config_handle, PCI_CBUS_MEM_BASE0, 0);
-	pci_config_put32(config_handle, PCI_CBUS_IO_LIMIT0, 0);
-	pci_config_put32(config_handle, PCI_CBUS_IO_BASE0, 0);
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-	pci_config_put16(config_handle, PCI_CBUS_BRIDGE_CTRL, bctrl);
-
-	cardbus_err(dip, 6,
-	    "disable_cardbus_bridge() stat 0x%04x comm 0x%04x bctrl 0x%04x\n",
-	    pci_config_get16(config_handle, PCI_CONF_STAT), comm, bctrl);
-}
-
-static void
-enable_cardbus_device(dev_info_t *dip, ddi_acc_handle_t config_handle)
-{
-	uint16_t comm, stat;
-
-	stat = pci_config_get16(config_handle, PCI_CONF_STAT);
-	comm = pci_config_get16(config_handle, PCI_CONF_COMM);
-
-	/*
-	 * Enable memory, IO, bus mastership and error detection.
-	 */
-	comm |= (PCI_COMM_ME | PCI_COMM_MAE | PCI_COMM_IO |
-	    PCI_COMM_PARITY_DETECT | PCI_COMM_SERR_ENABLE);
-	if (ddi_prop_exists(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    "fast-back-to-back"))
-		comm |= PCI_COMM_BACK2BACK_ENAB;
-	pci_config_put16(config_handle, PCI_CONF_COMM, comm);
-	cardbus_err(NULL, 8,
-	    "enable_cardbus_device stat 0x%04x comm 0x%04x\n", stat, comm);
-}
-
-static void
-disable_cardbus_device(ddi_acc_handle_t config_handle)
-{
-	cardbus_err(NULL, 8, "disable_cardbus_device\n");
-
-	/*
-	 * Turn off everything in the command register.
-	 */
-	pci_config_put16(config_handle, PCI_CONF_COMM, 0x0);
-}
-
-#ifndef _DONT_USE_1275_GENERIC_NAMES
-static char *
-cardbus_get_class_name(uint32_t classcode)
-{
-	struct cardbus_name_entry *ptr;
-
-	for (ptr = &cardbus_class_lookup[0]; ptr->name != NULL; ptr++) {
-		if (ptr->class_code == classcode) {
-			return (ptr->name);
-		}
-	}
-	return (NULL);
-}
-#endif /* _DONT_USE_1275_GENERIC_NAMES */
-
-static void
-cardbus_force_boolprop(dev_info_t *dip, char *pname)
-{
-	int ret;
-
-	if ((ret = ndi_prop_create_boolean(DDI_DEV_T_NONE, dip,
-	    pname)) != DDI_SUCCESS) {
-		if (ret == DDI_PROP_NOT_FOUND)
-			if (ddi_prop_create(DDI_DEV_T_NONE, dip,
-			    DDI_PROP_CANSLEEP, pname,
-			    (caddr_t)NULL, 0) != DDI_SUCCESS)
-				cardbus_err(dip, 4,
-				    "Failed to set boolean property "
-				    "\"%s\"\n", pname);
-	}
-}
-
-static void
-cardbus_force_intprop(dev_info_t *dip, char *pname, int *pval, int len)
-{
-	int ret;
-
-	if ((ret = ndi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-	    pname, pval, len)) != DDI_SUCCESS) {
-		if (ret == DDI_PROP_NOT_FOUND)
-			if (ddi_prop_create(DDI_DEV_T_NONE, dip,
-			    DDI_PROP_CANSLEEP, pname,
-			    (caddr_t)pval, len*sizeof (int))
-			    != DDI_SUCCESS)
-				cardbus_err(dip, 4,
-				    "Failed to set int property \"%s\"\n",
-				    pname);
-	}
-}
-
-static void
-cardbus_force_stringprop(dev_info_t *dip, char *pname, char *pval)
-{
-	int ret;
-
-	if ((ret = ndi_prop_update_string(DDI_DEV_T_NONE, dip,
-	    pname, pval)) != DDI_SUCCESS) {
-		if (ret == DDI_PROP_NOT_FOUND)
-			if (ddi_prop_create(DDI_DEV_T_NONE, dip,
-			    DDI_PROP_CANSLEEP, pname,
-			    pval, strlen(pval) + 1) != DDI_SUCCESS)
-				cardbus_err(dip, 4,
-				    "Failed to set string property "
-				    "\"%s\" to \"%s\"\n",
-				    pname, pval);
-	}
-}
-
-static void
-split_addr(char *naddr, int *dev, int *func)
-{
-	char	c;
-	int	*ip = dev;
-
-	*dev = 0;
-	*func = 0;
-
-	while (c = *naddr++) {
-		if (c == ',') {
-			ip = func;
-			continue;
-		}
-		if (c >= '0' && c <= '9') {
-			*ip = (*ip * 16) + (c - '0');
-		} else if (c >= 'a' && c <= 'f') {
-			*ip = (*ip * 16) + 10 + (c - 'a');
-		} else
-			break;
-	}
-}
-
-#ifdef DEBUG
-static void
-cardbus_dump_common_config(ddi_acc_handle_t config_handle)
-{
-	cardbus_err(NULL, 1,
-	    " Vendor ID   = [0x%04x]        "
-	    "Device ID   = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_VENID),
-	    pci_config_get16(config_handle, PCI_CONF_DEVID));
-	cardbus_err(NULL, 1,
-	    " Command REG = [0x%04x]        "
-	    "Status  REG = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_COMM),
-	    pci_config_get16(config_handle, PCI_CONF_STAT));
-	cardbus_err(NULL, 1,
-	    " Revision ID = [0x%02x]          "
-	    "Prog Class  = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_REVID),
-	    pci_config_get8(config_handle, PCI_CONF_PROGCLASS));
-	cardbus_err(NULL, 1,
-	    " Dev Class   = [0x%02x]          "
-	    "Base Class  = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_SUBCLASS),
-	    pci_config_get8(config_handle, PCI_CONF_BASCLASS));
-	cardbus_err(NULL, 1,
-	    " Cache LnSz  = [0x%02x]          "
-	    "Latency Tmr = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_CACHE_LINESZ),
-	    pci_config_get8(config_handle, PCI_CONF_LATENCY_TIMER));
-	cardbus_err(NULL, 1,
-	    " Header Type = [0x%02x]          "
-	    "BIST        = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_HEADER),
-	    pci_config_get8(config_handle, PCI_CONF_BIST));
-}
-
-static void
-cardbus_dump_device_config(ddi_acc_handle_t config_handle)
-{
-	cardbus_dump_common_config(config_handle);
-
-	cardbus_err(NULL, 1,
-	    " BASE 0      = [0x%08x]	BASE 1      = [0x%08x]\n",
-	    pci_config_get32(config_handle, PCI_CONF_BASE0),
-	    pci_config_get32(config_handle, PCI_CONF_BASE1));
-	cardbus_err(NULL, 1,
-	    " BASE 2      = [0x%08x]	BASE 3      = [0x%08x]\n",
-	    pci_config_get32(config_handle, PCI_CONF_BASE2),
-	    pci_config_get32(config_handle, PCI_CONF_BASE3));
-	cardbus_err(NULL, 1,
-	    " BASE 4      = [0x%08x]	BASE 5      = [0x%08x]\n",
-	    pci_config_get32(config_handle, PCI_CONF_BASE4),
-	    pci_config_get32(config_handle, PCI_CONF_BASE5));
-	cardbus_err(NULL, 1,
-	    " Cardbus CIS = [0x%08x]	ROM         = [0x%08x]\n",
-	    pci_config_get32(config_handle, PCI_CONF_CIS),
-	    pci_config_get32(config_handle, PCI_CONF_ROM));
-	cardbus_err(NULL, 1,
-	    " Sub VID     = [0x%04x]	Sub SID     = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_CONF_SUBVENID),
-	    pci_config_get16(config_handle, PCI_CONF_SUBSYSID));
-	cardbus_err(NULL, 1,
-	    " I Line      = [0x%02x]	I Pin       = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_ILINE),
-	    pci_config_get8(config_handle, PCI_CONF_IPIN));
-	cardbus_err(NULL, 1,
-	    " Max Grant   = [0x%02x]	Max Latent  = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_CONF_MIN_G),
-	    pci_config_get8(config_handle, PCI_CONF_MAX_L));
-}
-
-static void
-cardbus_dump_bridge_config(ddi_acc_handle_t config_handle,
-			uint8_t header_type)
-{
-	if (header_type == PCI_HEADER_PPB) {
-		cardbus_dump_common_config(config_handle);
-		cardbus_err(NULL, 1,
-		    "........................................\n");
-	} else {
-		cardbus_dump_common_config(config_handle);
-		cardbus_err(NULL, 1,
-		    " Mem Base    = [0x%08x]	CBus Status = [0x%04x]\n",
-		    pci_config_get32(config_handle, PCI_CBUS_SOCK_REG),
-		    pci_config_get16(config_handle, PCI_CBUS_SEC_STATUS));
-	}
-
-	cardbus_err(NULL, 1,
-	    " Pri Bus	= [0x%02x]		Sec Bus	= [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_BCNF_PRIBUS),
-	    pci_config_get8(config_handle, PCI_BCNF_SECBUS));
-	cardbus_err(NULL, 1,
-	    " Sub Bus     = [0x%02x]		Sec Latency = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_BCNF_SUBBUS),
-	    pci_config_get8(config_handle, PCI_BCNF_LATENCY_TIMER));
-
-	switch (header_type) {
-	case PCI_HEADER_PPB:
-		cardbus_err(NULL, 1,
-		    " I/O Base LO = [0x%02x]	I/O Lim LO  = [0x%02x]\n",
-		    pci_config_get8(config_handle, PCI_BCNF_IO_BASE_LOW),
-		    pci_config_get8(config_handle, PCI_BCNF_IO_LIMIT_LOW));
-		cardbus_err(NULL, 1,
-		    " Sec. Status = [0x%04x]\n",
-		    pci_config_get16(config_handle, PCI_BCNF_SEC_STATUS));
-		cardbus_err(NULL, 1,
-		    " Mem Base    = [0x%04x]	Mem Limit   = [0x%04x]\n",
-		    pci_config_get16(config_handle, PCI_BCNF_MEM_BASE),
-		    pci_config_get16(config_handle, PCI_BCNF_MEM_LIMIT));
-		cardbus_err(NULL, 1,
-		    " PF Mem Base = [0x%04x]	PF Mem Lim  = [0x%04x]\n",
-		    pci_config_get16(config_handle, PCI_BCNF_PF_BASE_LOW),
-		    pci_config_get16(config_handle, PCI_BCNF_PF_LIMIT_LOW));
-		cardbus_err(NULL, 1,
-		    " PF Base HI  = [0x%08x]	PF Lim  HI  = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_BCNF_PF_BASE_HIGH),
-		    pci_config_get32(config_handle, PCI_BCNF_PF_LIMIT_HIGH));
-		cardbus_err(NULL, 1,
-		    " I/O Base HI = [0x%04x]	I/O Lim HI  = [0x%04x]\n",
-		    pci_config_get16(config_handle, PCI_BCNF_IO_BASE_HI),
-		    pci_config_get16(config_handle, PCI_BCNF_IO_LIMIT_HI));
-		cardbus_err(NULL, 1,
-		    " ROM addr    = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_BCNF_ROM));
-		break;
-	case PCI_HEADER_CARDBUS:
-		cardbus_err(NULL, 1,
-		    " Mem Base 0  = [0x%08x]	Mem Limit 0 = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_CBUS_MEM_BASE0),
-		    pci_config_get32(config_handle, PCI_CBUS_MEM_LIMIT0));
-		cardbus_err(NULL, 1,
-		    " Mem Base 1  = [0x%08x]	Mem Limit 1 = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_CBUS_MEM_BASE1),
-		    pci_config_get32(config_handle, PCI_CBUS_MEM_LIMIT1));
-		cardbus_err(NULL, 1,
-		    " IO Base 0   = [0x%08x]	IO Limit 0  = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_CBUS_IO_BASE0),
-		    pci_config_get32(config_handle, PCI_CBUS_IO_LIMIT0));
-		cardbus_err(NULL, 1,
-		    " IO Base 1   = [0x%08x]	IO Limit 1  = [0x%08x]\n",
-		    pci_config_get32(config_handle, PCI_CBUS_IO_BASE1),
-		    pci_config_get32(config_handle, PCI_CBUS_IO_LIMIT1));
-		break;
-	}
-	cardbus_err(NULL, 1,
-	    " Intr Line   = [0x%02x]		Intr Pin    = [0x%02x]\n",
-	    pci_config_get8(config_handle, PCI_BCNF_ILINE),
-	    pci_config_get8(config_handle, PCI_BCNF_IPIN));
-	cardbus_err(NULL, 1,
-	    " Bridge Ctrl = [0x%04x]\n",
-	    pci_config_get16(config_handle, PCI_BCNF_BCNTRL));
-
-	switch (header_type) {
-	case PCI_HEADER_CARDBUS:
-		cardbus_err(NULL, 1,
-		    " Sub VID     = [0x%04x]	Sub SID     = [0x%04x]\n",
-		    pci_config_get16(config_handle, PCI_CBUS_SUBVENID),
-		    pci_config_get16(config_handle, PCI_CBUS_SUBSYSID));
-		/* LATER: TI1250 only */
-		cardbus_err(NULL, 1,
-		    " Sys Control = [0x%08x]\n",
-		    pci_config_get32(config_handle, 0x80));
-	}
-}
-
-static void
-cardbus_dump_config(ddi_acc_handle_t config_handle)
-{
-	uint8_t header_type = pci_config_get8(config_handle,
-	    PCI_CONF_HEADER) & PCI_HEADER_TYPE_M;
-
-	if (header_type == PCI_HEADER_PPB || header_type == PCI_HEADER_CARDBUS)
-		cardbus_dump_bridge_config(config_handle, header_type);
-	else
-		cardbus_dump_device_config(config_handle);
-}
-
-static void
-cardbus_dump_reg(dev_info_t *dip, const pci_regspec_t *regspec, int nelems)
-{
-	/* int rlen = nelems * sizeof(pci_regspec_t); */
-
-	cardbus_err(dip, 6,
-	    "cardbus_dump_reg: \"reg\" has %d elements\n", nelems);
-
-#if defined(CARDBUS_DEBUG)
-	if (cardbus_debug >= 1) {
-		int	i;
-		uint32_t *regs = (uint32_t *)regspec;
-
-		for (i = 0; i < nelems; i++) {
-
-			cardbus_err(NULL, 6,
-			    "\t%d:%08x %08x %08x %08x %08x\n",
-			    i, regs[0], regs[1], regs[2], regs[3], regs[4]);
-		}
-	}
-#endif
-}
-
-#endif
-
-#if defined(CARDBUS_DEBUG)
-void
-cardbus_dump_children(dev_info_t *dip, int level)
-{
-	dev_info_t *next;
-
-	cardbus_err(dip, 1,
-	    "\t%d: %s: 0x%p\n", level, ddi_node_name(dip), (void *) dip);
-	for (next = ddi_get_child(dip); next;
-	    next = ddi_get_next_sibling(next))
-		cardbus_dump_children(next, level + 1);
-}
-
-void
-cardbus_dump_family_tree(dev_info_t *dip)
-{
-	cardbus_err(dip, 1, "0x%p family tree:\n", (void *) dip);
-	cardbus_dump_children(dip, 1);
-}
-#endif
--- old/usr/src/uts/common/io/cardbus/cardbus_cfg.h	2014-11-12 17:44:40.217037719 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,69 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- */
-
-#ifndef	_SYS_CARDBUS_CFG_H
-#define	_SYS_CARDBUS_CFG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/*
- * Cardbus device identifiers
- */
-#define	CBUS_ID(vend, dev)	((uint32_t)(((uint32_t)(vend) << 16) | (dev)))
-
-#define	CB_PPD_CODE	0x2441
-
-struct cardbus_parent_private_data {
-	struct ddi_parent_private_data	ppd;	/* this format for prtconf */
-	uint16_t	code;	/* == CB_PPD_CODE */
-	/* pci_regspec_t *regs; */
-};
-
-extern kmutex_t cardbus_list_mutex;
-extern int cardbus_latency_timer;
-
-extern int cardbus_configure(cbus_t *cbp);
-extern int cardbus_unconfigure(cbus_t *cbp);
-extern int cardbus_teardown_device(dev_info_t *);
-extern int cardbus_primary_busno(dev_info_t *dip);
-
-#ifdef DEBUG
-extern void cardbus_dump_children(dev_info_t *dip, int level);
-extern void cardbus_dump_family_tree(dev_info_t *dip);
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif	/* _SYS_CARDBUS_CFG_H */
--- old/usr/src/uts/common/io/cardbus/cardbus_hp.c	2014-11-12 17:44:40.268435727 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,1825 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- * From "@(#)pcicfg.c   1.31    99/06/18 SMI"
- */
-
-/*
- * Cardbus hotplug module
- */
-
-#include <sys/open.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/ddi.h>
-#include <sys/sunndi.h>
-
-#include <sys/note.h>
-
-#include <sys/pci.h>
-
-#include <sys/hotplug/hpcsvc.h>
-#include <sys/hotplug/pci/pcicfg.h>
-#include <sys/pcic_reg.h>
-
-#include "cardbus.h"
-#include "cardbus_hp.h"
-#include "cardbus_cfg.h"
-
-/*
- * ************************************************************************
- * *** Implementation specific data structures/definitions.             ***
- * ************************************************************************
- */
-
-#ifndef HPC_MAX_OCCUPANTS
-#define	HPC_MAX_OCCUPANTS 8
-typedef struct hpc_occupant_info {
-	int	i;
-	char 	*id[HPC_MAX_OCCUPANTS];
-} hpc_occupant_info_t;
-#endif
-
-#define	PCICFG_FLAGS_CONTINUE   0x1
-
-#define	PCICFG_OP_ONLINE	0x1
-#define	PCICFG_OP_OFFLINE	0x0
-
-#define	CBHP_DEVCTL_MINOR	255
-
-#define	AP_MINOR_NUM_TO_CB_INSTANCE(x)	((x) & 0xFF)
-#define	AP_MINOR_NUM(x)		(((uint_t)(3) << 8) | ((x) & 0xFF))
-#define	AP_IS_CB_MINOR(x)	(((x)>>8) == (3))
-
-extern int cardbus_debug;
-extern int number_of_cardbus_cards;
-
-static int cardbus_autocfg_enabled = 1;	/* auto config is enabled by default */
-
-/* static functions */
-static int cardbus_event_handler(caddr_t slot_arg, uint_t event_mask);
-static int cardbus_pci_control(caddr_t ops_arg, hpc_slot_t slot_hdl,
-				int request, caddr_t arg);
-static int cardbus_new_slot_state(dev_info_t *dip, hpc_slot_t hdl,
-				hpc_slot_info_t *slot_info, int slot_state);
-static int cardbus_list_occupants(dev_info_t *dip, void *hdl);
-static void create_occupant_props(dev_info_t *self, dev_t dev);
-static void delete_occupant_props(dev_info_t *dip, dev_t dev);
-static int cardbus_configure_ap(cbus_t *cbp);
-static int cardbus_unconfigure_ap(cbus_t *cbp);
-static int cbus_unconfigure(dev_info_t *devi, int prim_bus);
-void cardbus_dump_pci_config(dev_info_t *dip);
-void cardbus_dump_pci_node(dev_info_t *dip);
-
-int
-cardbus_init_hotplug(cbus_t *cbp)
-{
-	char tbuf[MAXNAMELEN];
-	hpc_slot_info_t	slot_info;
-	hpc_slot_ops_t	*slot_ops;
-	hpc_slot_t	slhandle;	/* HPS slot handle */
-
-	/*
-	 *  register the bus instance with the HPS framework.
-	 */
-	if (hpc_nexus_register_bus(cbp->cb_dip,
-	    cardbus_new_slot_state, 0) != 0) {
-		cmn_err(CE_WARN, "%s%d: failed to register the bus with HPS\n",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance);
-		return (DDI_FAILURE);
-	}
-
-	(void) sprintf(cbp->ap_id, "slot%d", cbp->cb_instance);
-	(void) ddi_pathname(cbp->cb_dip, tbuf);
-	cbp->nexus_path = kmem_alloc(strlen(tbuf) + 1, KM_SLEEP);
-	(void) strcpy(cbp->nexus_path, tbuf);
-	cardbus_err(cbp->cb_dip, 8,
-	    "cardbus_init_hotplug: nexus_path set to %s", cbp->nexus_path);
-
-	slot_ops = hpc_alloc_slot_ops(KM_SLEEP);
-	cbp->slot_ops = slot_ops;
-
-	/*
-	 * Fill in the slot information structure that
-	 * describes the slot.
-	 */
-	slot_info.version = HPC_SLOT_INFO_VERSION;
-	slot_info.slot_type = HPC_SLOT_TYPE_PCI;
-	slot_info.slot.pci.device_number = 0;
-	slot_info.slot.pci.slot_capabilities = 0;
-
-	(void) strcpy(slot_info.slot.pci.slot_logical_name, cbp->ap_id);
-
-	slot_ops->hpc_version = HPC_SLOT_OPS_VERSION;
-	slot_ops->hpc_op_connect = NULL;
-	slot_ops->hpc_op_disconnect = NULL;
-	slot_ops->hpc_op_insert = NULL;
-	slot_ops->hpc_op_remove = NULL;
-	slot_ops->hpc_op_control = cardbus_pci_control;
-
-	if (hpc_slot_register(cbp->cb_dip, cbp->nexus_path, &slot_info,
-	    &slhandle, slot_ops, (caddr_t)cbp, 0) != 0) {
-		/*
-		 * If the slot can not be registered,
-		 * then the slot_ops need to be freed.
-		 */
-		cmn_err(CE_WARN,
-		    "cbp%d Unable to Register Slot %s", cbp->cb_instance,
-		    slot_info.slot.pci.slot_logical_name);
-
-		(void) hpc_nexus_unregister_bus(cbp->cb_dip);
-		hpc_free_slot_ops(slot_ops);
-		cbp->slot_ops = NULL;
-		return (DDI_FAILURE);
-	}
-
-	ASSERT(slhandle == cbp->slot_handle);
-
-	cardbus_err(cbp->cb_dip, 8,
-	    "cardbus_init_hotplug: slot_handle 0x%p", cbp->slot_handle);
-	return (DDI_SUCCESS);
-}
-
-static int
-cardbus_event_handler(caddr_t slot_arg, uint_t event_mask)
-{
-	int ap_minor = (int)((uintptr_t)slot_arg);
-	cbus_t *cbp;
-	int cb_instance;
-	int rv = HPC_EVENT_CLAIMED;
-
-	cb_instance = AP_MINOR_NUM_TO_CB_INSTANCE(ap_minor);
-
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-	mutex_enter(&cbp->cb_mutex);
-
-	switch (event_mask) {
-
-	case HPC_EVENT_SLOT_INSERTION:
-		/*
-		 * A card is inserted in the slot. Just report this
-		 * event and return.
-		 */
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): card is inserted",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance);
-
-		break;
-
-	case HPC_EVENT_SLOT_CONFIGURE:
-		/*
-		 * Configure the occupant that is just inserted in the slot.
-		 * The receptacle may or may not be in the connected state. If
-		 * the receptacle is not connected and the auto configuration
-		 * is enabled on this slot then connect the slot. If auto
-		 * configuration is enabled then configure the card.
-		 */
-		if (!(cbp->auto_config)) {
-			/*
-			 * auto configuration is disabled.
-			 */
-			cardbus_err(cbp->cb_dip, 7,
-			    "cardbus_event_handler(%s%d): "
-			    "SLOT_CONFIGURE event occured (slot %s)",
-			    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-			    cbp->name);
-
-			break;
-		}
-
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): configure event",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance);
-
-		if (cbp->ostate != AP_OSTATE_UNCONFIGURED) {
-			cmn_err(CE_WARN, "!slot%d already configured\n",
-			    cbp->cb_instance);
-			break;
-		}
-
-		/*
-		 * Auto configuration is enabled. First, make sure the
-		 * receptacle is in the CONNECTED state.
-		 */
-		if ((rv = hpc_nexus_connect(cbp->slot_handle,
-		    NULL, 0)) == HPC_SUCCESS) {
-			cbp->rstate = AP_RSTATE_CONNECTED; /* record rstate */
-		}
-
-		if (cardbus_configure_ap(cbp) == HPC_SUCCESS)
-			create_occupant_props(cbp->cb_dip, makedevice(
-			    ddi_driver_major((cbp->cb_dip)), ap_minor));
-		else
-			rv = HPC_ERR_FAILED;
-
-		break;
-
-	case HPC_EVENT_SLOT_UNCONFIGURE:
-		/*
-		 * Unconfigure the occupant in this slot.
-		 */
-		if (!(cbp->auto_config)) {
-			/*
-			 * auto configuration is disabled.
-			 */
-			cardbus_err(cbp->cb_dip, 7,
-			    "cardbus_event_handler(%s%d): "
-			    "SLOT_UNCONFIGURE event"
-			    " occured - auto-conf disabled (slot %s)",
-			    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-			    cbp->name);
-
-			break;
-		}
-
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): SLOT_UNCONFIGURE event"
-		    " occured (slot %s)",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-		    cbp->name);
-
-		if (cardbus_unconfigure_ap(cbp) != HPC_SUCCESS)
-			rv = HPC_ERR_FAILED;
-
-		DEVI(cbp->cb_dip)->devi_ops->devo_bus_ops = cbp->orig_bopsp;
-		--number_of_cardbus_cards;
-		break;
-
-	case HPC_EVENT_SLOT_REMOVAL:
-		/*
-		 * Card is removed from the slot. The card must have been
-		 * unconfigured before this event.
-		 */
-		if (cbp->ostate != AP_OSTATE_UNCONFIGURED) {
-			cardbus_err(cbp->cb_dip, 1,
-			    "cardbus_event_handler(%s%d): "
-			    "card is removed from"
-			    " the slot %s before doing unconfigure!!",
-			    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-			    cbp->name);
-
-			break;
-		}
-
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): "
-		    "card is removed from the slot %s",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-		    cbp->name);
-
-		break;
-
-	case HPC_EVENT_SLOT_POWER_ON:
-		/*
-		 * Slot is connected to the bus. i.e the card is powered
-		 * on.
-		 */
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): "
-		    "card is powered on in the slot %s",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-		    cbp->name);
-
-		cbp->rstate = AP_RSTATE_CONNECTED; /* record rstate */
-
-		break;
-
-	case HPC_EVENT_SLOT_POWER_OFF:
-		/*
-		 * Slot is disconnected from the bus. i.e the card is powered
-		 * off.
-		 */
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_event_handler(%s%d): "
-		    "card is powered off in the slot %s",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-		    cbp->name);
-
-		cbp->rstate = AP_RSTATE_DISCONNECTED; /* record rstate */
-
-		break;
-
-	default:
-		cardbus_err(cbp->cb_dip, 4,
-		    "cardbus_event_handler(%s%d): "
-		    "unknown event %x for this slot %s",
-		    ddi_driver_name(cbp->cb_dip), cbp->cb_instance,
-		    event_mask, cbp->name);
-
-		break;
-	}
-
-	mutex_exit(&cbp->cb_mutex);
-
-	return (rv);
-}
-
-static int
-cardbus_pci_control(caddr_t ops_arg, hpc_slot_t slot_hdl, int request,
-			caddr_t arg)
-{
-	cbus_t *cbp;
-	int rval = HPC_SUCCESS;
-	hpc_led_info_t *hpc_led_info;
-
-	_NOTE(ARGUNUSED(slot_hdl))
-
-	cbp = (cbus_t *)ops_arg;
-	ASSERT(mutex_owned(&cbp->cb_mutex));
-
-	switch (request) {
-
-	case HPC_CTRL_GET_SLOT_STATE: {
-		hpc_slot_state_t	*hpc_slot_state;
-
-		hpc_slot_state = (hpc_slot_state_t *)arg;
-
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_pci_control() - "
-		    "HPC_CTRL_GET_SLOT_STATE hpc_slot_state=0x%p",
-		    (void *) hpc_slot_state);
-
-		if (cbp->card_present)
-			*hpc_slot_state = HPC_SLOT_CONNECTED;
-		else
-			*hpc_slot_state = HPC_SLOT_EMPTY;
-
-		break;
-	}
-
-	case HPC_CTRL_GET_BOARD_TYPE: {
-		hpc_board_type_t	*hpc_board_type;
-
-		hpc_board_type = (hpc_board_type_t *)arg;
-
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_pci_control() - HPC_CTRL_GET_BOARD_TYPE");
-
-		/*
-		 * The HPC driver does not know what board type
-		 * is plugged in.
-		 */
-		*hpc_board_type = HPC_BOARD_PCI_HOTPLUG;
-
-		break;
-	}
-
-	case HPC_CTRL_DEV_CONFIGURED:
-	case HPC_CTRL_DEV_UNCONFIGURED:
-		cardbus_err(cbp->cb_dip, 5,
-		    "cardbus_pci_control() - HPC_CTRL_DEV_%sCONFIGURED",
-		    request == HPC_CTRL_DEV_UNCONFIGURED ? "UN" : "");
-		break;
-
-	case HPC_CTRL_GET_LED_STATE:
-		hpc_led_info = (hpc_led_info_t *)arg;
-		cardbus_err(cbp->cb_dip, 5,
-		    "cardbus_pci_control() - HPC_CTRL_GET_LED_STATE "
-		    "led %d is %d",
-		    hpc_led_info->led, cbp->leds[hpc_led_info->led]);
-
-		hpc_led_info->state = cbp->leds[hpc_led_info->led];
-		break;
-
-	case HPC_CTRL_SET_LED_STATE:
-		hpc_led_info = (hpc_led_info_t *)arg;
-
-		cardbus_err(cbp->cb_dip, 4,
-		    "cardbus_pci_control() - HPC_CTRL_SET_LED_STATE "
-		    "led %d to %d",
-		    hpc_led_info->led, hpc_led_info->state);
-
-		cbp->leds[hpc_led_info->led] = hpc_led_info->state;
-		break;
-
-	case HPC_CTRL_ENABLE_AUTOCFG:
-		cardbus_err(cbp->cb_dip, 5,
-		    "cardbus_pci_control() - HPC_CTRL_ENABLE_AUTOCFG");
-
-		/*
-		 * Cardbus ALWAYS does auto config, from the slots point of
-		 * view this is turning on the card and making sure it's ok.
-		 * This is all done by the bridge driver before we see any
-		 * indication.
-		 */
-		break;
-
-	case HPC_CTRL_DISABLE_AUTOCFG:
-		cardbus_err(cbp->cb_dip, 5,
-		    "cardbus_pci_control() - HPC_CTRL_DISABLE_AUTOCFG");
-		break;
-
-	case HPC_CTRL_DISABLE_ENUM:
-	case HPC_CTRL_ENABLE_ENUM:
-	default:
-		rval = HPC_ERR_NOTSUPPORTED;
-		break;
-	}
-
-	return (rval);
-}
-
-/*
- * cardbus_new_slot_state()
- *
- * This function is called by the HPS when it finds a hot plug
- * slot is added or being removed from the hot plug framework.
- * It returns 0 for success and HPC_ERR_FAILED for errors.
- */
-static int
-cardbus_new_slot_state(dev_info_t *dip, hpc_slot_t hdl,
-			hpc_slot_info_t *slot_info, int slot_state)
-{
-	int cb_instance;
-	cbus_t *cbp;
-	int ap_minor;
-	int rv = 0;
-
-	cardbus_err(dip, 8,
-	    "cardbus_new_slot_state: slot_handle 0x%p", hdl);
-
-	/*
-	 * get the soft state structure for the bus instance.
-	 */
-	cb_instance = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "cbus-instance", -1);
-	ASSERT(cb_instance >= 0);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state, cb_instance);
-
-	mutex_enter(&cbp->cb_mutex);
-
-	switch (slot_state) {
-
-	case HPC_SLOT_ONLINE:
-		/*
-		 * Make sure the slot is not already ONLINE
-		 */
-		if (cbp->slot_handle != NULL) {
-			cardbus_err(dip, 4,
-			    "cardbus_new_slot_state: "
-			    "cardbus already ONLINE!!");
-			rv = HPC_ERR_FAILED;
-			break;
-		}
-
-		/*
-		 * Add the hot plug slot to the bus.
-		 */
-
-		/* create the AP minor node */
-		ap_minor = AP_MINOR_NUM(cb_instance);
-		if (ddi_create_minor_node(dip, slot_info->pci_slot_name,
-		    S_IFCHR, ap_minor,
-		    DDI_NT_PCI_ATTACHMENT_POINT,
-		    0) == DDI_FAILURE) {
-			cardbus_err(dip, 4,
-			    "cardbus_new_slot_state: "
-			    "ddi_create_minor_node failed");
-			rv = HPC_ERR_FAILED;
-			break;
-		}
-
-		/* save the slot handle */
-		cbp->slot_handle = hdl;
-
-		/* setup event handler for all hardware events on the slot */
-		if (hpc_install_event_handler(hdl, -1, cardbus_event_handler,
-		    (caddr_t)((long)ap_minor)) != 0) {
-			cardbus_err(dip, 4,
-			    "cardbus_new_slot_state: "
-			    "install event handler failed");
-			rv = HPC_ERR_FAILED;
-			break;
-		}
-		cbp->event_mask = (uint32_t)0xFFFFFFFF;
-		create_occupant_props(dip,
-		    makedevice(ddi_name_to_major(ddi_get_name(dip)),
-		    ap_minor));
-
-		/* set default auto configuration enabled flag for this slot */
-		cbp->auto_config = cardbus_autocfg_enabled;
-
-		/* copy the slot information */
-		cbp->name = (char *)kmem_alloc(strlen(slot_info->pci_slot_name)
-		    + 1, KM_SLEEP);
-		(void) strcpy(cbp->name, slot_info->pci_slot_name);
-		cardbus_err(cbp->cb_dip, 10,
-		    "cardbus_new_slot_state: cbp->name set to %s", cbp->name);
-
-		cardbus_err(dip, 4,
-		    "Cardbus slot \"%s\" ONLINE\n", slot_info->pci_slot_name);
-
-		cbp->ostate = AP_OSTATE_UNCONFIGURED;
-		cbp->rstate = AP_RSTATE_EMPTY;
-
-		break;
-
-	case HPC_SLOT_OFFLINE:
-		/*
-		 * A hot plug slot is being removed from the bus.
-		 * Make sure there is no occupant configured on the
-		 * slot before removing the AP minor node.
-		 */
-		if (cbp->ostate != AP_OSTATE_UNCONFIGURED) {
-			cmn_err(CE_WARN,
-			    "cardbus: Card is still in configured state");
-			rv = HPC_ERR_FAILED;
-			break;
-		}
-
-		/*
-		 * If the AP device is in open state then return
-		 * error.
-		 */
-		if (cbp->soft_state != PCIHP_SOFT_STATE_CLOSED) {
-			rv = HPC_ERR_FAILED;
-			break;
-		}
-
-		/* remove the minor node */
-		ddi_remove_minor_node(dip, cbp->name);
-		/* free up the memory for the name string */
-		kmem_free(cbp->name, strlen(cbp->name) + 1);
-
-		/* update the slot info data */
-		cbp->name = NULL;
-		cbp->slot_handle = NULL;
-
-		cardbus_err(dip, 6,
-		    "cardbus_new_slot_state: Cardbus slot OFFLINE");
-		break;
-
-	default:
-		cmn_err(CE_WARN,
-		    "cardbus_new_slot_state: unknown slot_state %d\n",
-		    slot_state);
-		rv = HPC_ERR_FAILED;
-	}
-
-	mutex_exit(&cbp->cb_mutex);
-
-	return (rv);
-}
-
-static int
-cardbus_list_occupants(dev_info_t *dip, void *hdl)
-{
-	hpc_occupant_info_t *occupant = (hpc_occupant_info_t *)hdl;
-	char pn[MAXPATHLEN];
-
-	/*
-	 * Ignore the attachment point and pcs.
-	 */
-	if (strcmp(ddi_binding_name(dip), "pcs") == 0) {
-		return (DDI_WALK_CONTINUE);
-	}
-
-	(void) ddi_pathname(dip, pn);
-
-	occupant->id[occupant->i] = kmem_alloc(strlen(pn) + 1, KM_SLEEP);
-	(void) strcpy(occupant->id[occupant->i], pn);
-
-	occupant->i++;
-
-	/*
-	 * continue the walk to the next sibling to look for a match
-	 * or to find other nodes if this card is a multi-function card.
-	 */
-	return (DDI_WALK_PRUNECHILD);
-}
-
-static void
-create_occupant_props(dev_info_t *self, dev_t dev)
-{
-	hpc_occupant_info_t occupant;
-	int i;
-	int circular;
-
-	occupant.i = 0;
-
-	ndi_devi_enter(self, &circular);
-	ddi_walk_devs(ddi_get_child(self), cardbus_list_occupants,
-	    (void *)&occupant);
-	ndi_devi_exit(self, circular);
-
-	if (occupant.i == 0) {
-		char *c[] = { "" };
-		cardbus_err(self, 1, "create_occupant_props: no occupant\n");
-		(void) ddi_prop_update_string_array(dev, self, "pci-occupant",
-		    c, 1);
-	} else {
-		cardbus_err(self, 1,
-		    "create_occupant_props: %d occupant\n", occupant.i);
-		(void) ddi_prop_update_string_array(dev, self, "pci-occupant",
-		    occupant.id, occupant.i);
-	}
-
-	for (i = 0; i < occupant.i; i++) {
-		kmem_free(occupant.id[i], strlen(occupant.id[i]) + 1);
-	}
-}
-
-static void
-delete_occupant_props(dev_info_t *dip, dev_t dev)
-{
-	if (ddi_prop_remove(dev, dip, "pci-occupant")
-	    != DDI_PROP_SUCCESS)
-		return; /* add error handling */
-
-}
-
-/*
- * **************************************
- * CONFIGURE the occupant in the slot.
- * **************************************
- */
-static int
-cardbus_configure_ap(cbus_t *cbp)
-{
-	dev_info_t *self = cbp->cb_dip;
-	int rv = HPC_SUCCESS;
-	hpc_slot_state_t rstate;
-	struct cardbus_config_ctrl ctrl;
-	int circular_count;
-
-	/*
-	 * check for valid request:
-	 *  1. It is a hotplug slot.
-	 *  2. The receptacle is in the CONNECTED state.
-	 */
-	if (cbp->slot_handle == NULL || cbp->disabled) {
-		return (ENXIO);
-	}
-
-	/*
-	 * If the occupant is already in (partially) configured
-	 * state then call the ndi_devi_online() on the device
-	 * subtree(s) for this attachment point.
-	 */
-
-	if (cbp->ostate == AP_OSTATE_CONFIGURED) {
-		ctrl.flags = PCICFG_FLAGS_CONTINUE;
-		ctrl.busno = cardbus_primary_busno(self);
-		ctrl.rv = NDI_SUCCESS;
-		ctrl.dip = NULL;
-		ctrl.op = PCICFG_OP_ONLINE;
-
-		ndi_devi_enter(self, &circular_count);
-		ddi_walk_devs(ddi_get_child(self),
-		    cbus_configure, (void *)&ctrl);
-		ndi_devi_exit(self, circular_count);
-
-		if (cardbus_debug) {
-			cardbus_dump_pci_config(self);
-			cardbus_dump_pci_node(self);
-		}
-
-		if (ctrl.rv != NDI_SUCCESS) {
-			/*
-			 * one or more of the devices are not
-			 * onlined.
-			 */
-			cmn_err(CE_WARN, "cardbus(%s%d): failed to attach "
-			    "one or more drivers for the card in the slot %s",
-			    ddi_driver_name(self), cbp->cb_instance,
-			    cbp->name);
-		}
-
-		/* tell HPC driver that the occupant is configured */
-		(void) hpc_nexus_control(cbp->slot_handle,
-		    HPC_CTRL_DEV_CONFIGURED, NULL);
-		return (rv);
-	}
-
-	/*
-	 * Occupant is in the UNCONFIGURED state.
-	 */
-
-	/* Check if the receptacle is in the CONNECTED state. */
-	if (hpc_nexus_control(cbp->slot_handle,
-	    HPC_CTRL_GET_SLOT_STATE, (caddr_t)&rstate) != 0) {
-		return (ENXIO);
-	}
-
-	if (rstate != HPC_SLOT_CONNECTED) {
-		/* error. either the slot is empty or connect failed */
-		return (ENXIO);
-	}
-
-	cbp->rstate = AP_RSTATE_CONNECTED; /* record rstate */
-
-	/*
-	 * Call the configurator to configure the card.
-	 */
-	if (cardbus_configure(cbp) != PCICFG_SUCCESS) {
-		return (EIO);
-	}
-
-	/* record the occupant state as CONFIGURED */
-	cbp->ostate = AP_OSTATE_CONFIGURED;
-	cbp->condition = AP_COND_OK;
-
-	/* now, online all the devices in the AP */
-	ctrl.flags = PCICFG_FLAGS_CONTINUE;
-	ctrl.busno = cardbus_primary_busno(self);
-	ctrl.rv = NDI_SUCCESS;
-	ctrl.dip = NULL;
-	ctrl.op = PCICFG_OP_ONLINE;
-
-	ndi_devi_enter(self, &circular_count);
-	ddi_walk_devs(ddi_get_child(self), cbus_configure, (void *)&ctrl);
-	ndi_devi_exit(self, circular_count);
-
-	if (cardbus_debug) {
-		cardbus_dump_pci_config(self);
-		cardbus_dump_pci_node(self);
-	}
-	if (ctrl.rv != NDI_SUCCESS) {
-		/*
-		 * one or more of the devices are not
-		 * ONLINE'd.
-		 */
-		cmn_err(CE_WARN, "cbhp (%s%d): failed to attach one or"
-		    " more drivers for the card in the slot %s",
-		    ddi_driver_name(cbp->cb_dip),
-		    cbp->cb_instance, cbp->name);
-		/* rv = EFAULT; */
-	}
-
-	/* tell HPC driver that the occupant is configured */
-	(void) hpc_nexus_control(cbp->slot_handle,
-	    HPC_CTRL_DEV_CONFIGURED, NULL);
-
-	return (rv);
-}
-
-/*
- * **************************************
- * UNCONFIGURE the occupant in the slot.
- * **************************************
- */
-static int
-cardbus_unconfigure_ap(cbus_t *cbp)
-{
-	dev_info_t *self = cbp->cb_dip;
-	int rv = HPC_SUCCESS, nrv;
-
-	/*
-	 * check for valid request:
-	 *  1. It is a hotplug slot.
-	 *  2. The occupant is in the CONFIGURED state.
-	 */
-
-	if (cbp->slot_handle == NULL || cbp->disabled) {
-		return (ENXIO);
-	}
-
-	/*
-	 * If the occupant is in the CONFIGURED state then
-	 * call the configurator to unconfigure the slot.
-	 */
-	if (cbp->ostate == AP_OSTATE_CONFIGURED) {
-		/*
-		 * Detach all the drivers for the devices in the
-		 * slot.
-		 */
-		nrv = cardbus_unconfigure_node(self,
-		    cardbus_primary_busno(self),
-		    B_TRUE);
-
-		if (nrv != NDI_SUCCESS) {
-			/*
-			 * Failed to detach one or more drivers.
-			 * Restore the status for the drivers
-			 * which are offlined during this step.
-			 */
-			cmn_err(CE_WARN,
-			    "cbhp (%s%d): Failed to offline all devices"
-			    " (slot %s)", ddi_driver_name(cbp->cb_dip),
-			    cbp->cb_instance, cbp->name);
-			rv = EBUSY;
-		} else {
-
-			if (cardbus_unconfigure(cbp) == PCICFG_SUCCESS) {
-				/*
-				 * Now that resources are freed,
-				 * clear EXT and Turn LED ON.
-				 */
-				cbp->ostate = AP_OSTATE_UNCONFIGURED;
-				cbp->condition = AP_COND_UNKNOWN;
-				/*
-				 * send the notification of state change
-				 * to the HPC driver.
-				 */
-				(void) hpc_nexus_control(cbp->slot_handle,
-				    HPC_CTRL_DEV_UNCONFIGURED, NULL);
-			} else {
-				rv = EIO;
-			}
-		}
-	}
-
-	return (rv);
-}
-
-int
-cbus_configure(dev_info_t *dip, void *hdl)
-{
-	pci_regspec_t *pci_rp;
-	int length, rc;
-	struct cardbus_config_ctrl *ctrl = (struct cardbus_config_ctrl *)hdl;
-	uint8_t bus, device, function;
-
-	/*
-	 * Ignore the attachment point and pcs.
-	 */
-	if (strcmp(ddi_binding_name(dip), "hp_attachment") == 0 ||
-	    strcmp(ddi_binding_name(dip), "pcs") == 0) {
-		cardbus_err(dip, 8, "cbus_configure: Ignoring\n");
-		return (DDI_WALK_CONTINUE);
-	}
-
-	cardbus_err(dip, 6, "cbus_configure\n");
-
-	ASSERT(ctrl->op == PCICFG_OP_ONLINE);
-
-	/*
-	 * Get the PCI device number information from the devinfo
-	 * node. Since the node may not have the address field
-	 * setup (this is done in the DDI_INITCHILD of the parent)
-	 * we look up the 'reg' property to decode that information.
-	 */
-	if (ddi_prop_lookup_int_array(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_DONTPASS, "reg", (int **)&pci_rp,
-	    (uint_t *)&length) != DDI_PROP_SUCCESS) {
-		/* Porbably not a real device, like PCS for example */
-		if (ddi_get_child(dip) == NULL)
-			return (DDI_WALK_PRUNECHILD);
-
-		cardbus_err(dip, 1, "cubs_configure: Don't configure device\n");
-		ctrl->rv = DDI_FAILURE;
-		ctrl->dip = dip;
-		return (DDI_WALK_TERMINATE);
-	}
-
-	if (pci_rp->pci_phys_hi == 0)
-		return (DDI_WALK_CONTINUE);
-
-	/* get the pci device id information */
-	bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi);
-	device = PCI_REG_DEV_G(pci_rp->pci_phys_hi);
-	function = PCI_REG_FUNC_G(pci_rp->pci_phys_hi);
-
-	/*
-	 * free the memory allocated by ddi_prop_lookup_int_array
-	 */
-	ddi_prop_free(pci_rp);
-
-	if (bus <= ctrl->busno)
-		return (DDI_WALK_CONTINUE);
-
-	cardbus_err(dip, 8,
-	    "cbus_configure on-line device at: "
-	    "[0x%x][0x%x][0x%x]\n", bus, device, function);
-
-	rc = ndi_devi_online(dip, NDI_ONLINE_ATTACH|NDI_CONFIG);
-
-	cardbus_err(dip, 7,
-	    "cbus_configure %s\n",
-	    rc == NDI_SUCCESS ? "Success": "Failure");
-
-	if (rc != NDI_SUCCESS)
-		return (DDI_WALK_PRUNECHILD);
-
-	return (DDI_WALK_CONTINUE);
-}
-
-int
-cardbus_unconfigure_node(dev_info_t *dip, int prim_bus, boolean_t top_bridge)
-{
-	dev_info_t *child, *next;
-
-	cardbus_err(dip, 6, "cardbus_unconfigure_node\n");
-
-	/*
-	 * Ignore pcs.
-	 */
-	if (strcmp(ddi_binding_name(dip), "pcs") == 0) {
-		cardbus_err(dip, 8, "cardbus_unconfigure_node: Ignoring\n");
-		return (NDI_SUCCESS);
-	}
-
-	/*
-	 * bottom up off-line
-	 */
-	for (child = ddi_get_child(dip); child; child = next) {
-		int rc;
-		next = ddi_get_next_sibling(child);
-		rc = cardbus_unconfigure_node(child, prim_bus, B_FALSE);
-		if (rc != NDI_SUCCESS)
-			return (rc);
-	}
-
-	/*
-	 * Don't unconfigure the bridge itself.
-	 */
-	if (top_bridge)
-		return (NDI_SUCCESS);
-
-	if (cbus_unconfigure(dip, prim_bus) != NDI_SUCCESS) {
-		cardbus_err(dip, 1,
-		    "cardbus_unconfigure_node: cardbus_unconfigure failed\n");
-		return (NDI_FAILURE);
-	}
-	return (NDI_SUCCESS);
-}
-
-/*
- * This will turn  resources allocated by cbus_configure()
- * and remove the device tree from the attachment point
- * and below.  The routine assumes the devices have their
- * drivers detached.
- */
-static int
-cbus_unconfigure(dev_info_t *devi, int prim_bus)
-{
-	pci_regspec_t *pci_rp;
-	uint_t bus, device, func, length;
-	int ndi_flags = NDI_UNCONFIG;
-
-	if (ddi_prop_lookup_int_array(DDI_DEV_T_ANY, devi,
-	    DDI_PROP_DONTPASS, "reg", (int **)&pci_rp,
-	    &length) != DDI_PROP_SUCCESS) {
-		/*
-		 * This cannot be one of our devices. If it's something like a
-		 * SCSI device then the attempt to offline the HBA
-		 * (which probably is one of our devices)
-		 * will also do bottom up offlining. That
-		 * will fail if this device is busy. So always
-		 * return success here
-		 * so that the walk will continue.
-		 */
-		return (NDI_SUCCESS);
-	}
-
-	if (pci_rp->pci_phys_hi == 0)
-		return (NDI_FAILURE);
-
-	bus = PCI_REG_BUS_G(pci_rp->pci_phys_hi);
-
-	if (bus <= prim_bus)
-		return (NDI_SUCCESS);
-
-	device = PCI_REG_DEV_G(pci_rp->pci_phys_hi);
-	func = PCI_REG_FUNC_G(pci_rp->pci_phys_hi);
-	ddi_prop_free(pci_rp);
-
-	cardbus_err(devi, 8,
-	    "cbus_unconfigure: "
-	    "offline bus [0x%x] device [0x%x] function [%x]\n",
-	    bus, device, func);
-	if (ndi_devi_offline(devi, ndi_flags) != NDI_SUCCESS) {
-		cardbus_err(devi, 1,
-		    "Device [0x%x] function [%x] is busy\n", device, func);
-		return (NDI_FAILURE);
-	}
-
-	cardbus_err(devi, 9,
-	    "Tearing down device [0x%x] function [0x%x]\n", device, func);
-
-	if (cardbus_teardown_device(devi) != PCICFG_SUCCESS) {
-		cardbus_err(devi, 1,
-		    "Failed to tear down "
-		    "device [0x%x] function [0x%x]\n", device, func);
-		return (NDI_FAILURE);
-	}
-
-	return (NDI_SUCCESS);
-}
-
-boolean_t
-cardbus_is_cb_minor(dev_t dev)
-{
-	return (AP_IS_CB_MINOR(getminor(dev)) ? B_TRUE : B_FALSE);
-}
-
-int
-cardbus_open(dev_t *devp, int flags, int otyp, cred_t *credp)
-{
-	cbus_t *cbp;
-	int minor;
-
-	_NOTE(ARGUNUSED(credp))
-
-	minor = getminor(*devp);
-
-	/*
-	 * Make sure the open is for the right file type.
-	 */
-	if (otyp != OTYP_CHR)
-	return (EINVAL);
-
-	/*
-	 * Get the soft state structure for the 'devctl' device.
-	 */
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state,
-	    AP_MINOR_NUM_TO_CB_INSTANCE(minor));
-	if (cbp == NULL)
-		return (ENXIO);
-
-	mutex_enter(&cbp->cb_mutex);
-
-	/*
-	 * Handle the open by tracking the device state.
-	 *
-	 * Note: Needs review w.r.t exclusive access to AP or the bus.
-	 * Currently in the pci plug-in we don't use EXCL open at all
-	 * so the code below implements EXCL access on the bus.
-	 */
-
-	/* enforce exclusive access to the bus */
-	if ((cbp->soft_state == PCIHP_SOFT_STATE_OPEN_EXCL) ||
-	    ((flags & FEXCL) &&
-	    (cbp->soft_state != PCIHP_SOFT_STATE_CLOSED))) {
-		mutex_exit(&cbp->cb_mutex);
-		return (EBUSY);
-	}
-
-	if (flags & FEXCL)
-		cbp->soft_state = PCIHP_SOFT_STATE_OPEN_EXCL;
-	else
-		cbp->soft_state = PCIHP_SOFT_STATE_OPEN;
-
-	mutex_exit(&cbp->cb_mutex);
-	return (0);
-}
-
-/*ARGSUSED*/
-int
-cardbus_close(dev_t dev, int flags, int otyp, cred_t *credp)
-{
-	cbus_t *cbp;
-	int minor;
-
-	_NOTE(ARGUNUSED(credp))
-
-	minor = getminor(dev);
-
-	if (otyp != OTYP_CHR)
-		return (EINVAL);
-
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state,
-	    AP_MINOR_NUM_TO_CB_INSTANCE(minor));
-	if (cbp == NULL)
-		return (ENXIO);
-
-	mutex_enter(&cbp->cb_mutex);
-	cbp->soft_state = PCIHP_SOFT_STATE_CLOSED;
-	mutex_exit(&cbp->cb_mutex);
-	return (0);
-}
-
-/*
- * cardbus_ioctl: devctl hotplug controls
- */
-/*ARGSUSED*/
-int
-cardbus_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
-		int *rvalp)
-{
-	cbus_t *cbp;
-	dev_info_t *self;
-	dev_info_t *child_dip = NULL;
-	struct devctl_iocdata *dcp;
-	uint_t bus_state;
-	int rv = 0;
-	int nrv = 0;
-	int ap_minor;
-	hpc_slot_state_t rstate;
-	devctl_ap_state_t ap_state;
-	struct hpc_control_data hpc_ctrldata;
-	struct hpc_led_info led_info;
-
-	_NOTE(ARGUNUSED(credp))
-
-	ap_minor = getminor(dev);
-	cbp = (cbus_t *)ddi_get_soft_state(cardbus_state,
-	    AP_MINOR_NUM_TO_CB_INSTANCE(ap_minor));
-	if (cbp == NULL)
-		return (ENXIO);
-
-	self = cbp->cb_dip;
-	/*
-	 * read devctl ioctl data
-	 */
-	if ((cmd != DEVCTL_AP_CONTROL) && ndi_dc_allochdl((void *)arg,
-	    &dcp) != NDI_SUCCESS)
-		return (EFAULT);
-
-#ifdef CARDBUS_DEBUG
-{
-	char *cmd_name;
-
-	switch (cmd) {
-	case DEVCTL_DEVICE_GETSTATE: cmd_name = "DEVCTL_DEVICE_GETSTATE"; break;
-	case DEVCTL_DEVICE_ONLINE: cmd_name = "DEVCTL_DEVICE_ONLINE"; break;
-	case DEVCTL_DEVICE_OFFLINE: cmd_name = "DEVCTL_DEVICE_OFFLINE"; break;
-	case DEVCTL_DEVICE_RESET: cmd_name = "DEVCTL_DEVICE_RESET"; break;
-	case DEVCTL_BUS_QUIESCE: cmd_name = "DEVCTL_BUS_QUIESCE"; break;
-	case DEVCTL_BUS_UNQUIESCE: cmd_name = "DEVCTL_BUS_UNQUIESCE"; break;
-	case DEVCTL_BUS_RESET: cmd_name = "DEVCTL_BUS_RESET"; break;
-	case DEVCTL_BUS_RESETALL: cmd_name = "DEVCTL_BUS_RESETALL"; break;
-	case DEVCTL_BUS_GETSTATE: cmd_name = "DEVCTL_BUS_GETSTATE"; break;
-	case DEVCTL_AP_CONNECT: cmd_name = "DEVCTL_AP_CONNECT"; break;
-	case DEVCTL_AP_DISCONNECT: cmd_name = "DEVCTL_AP_DISCONNECT"; break;
-	case DEVCTL_AP_INSERT: cmd_name = "DEVCTL_AP_INSERT"; break;
-	case DEVCTL_AP_REMOVE: cmd_name = "DEVCTL_AP_REMOVE"; break;
-	case DEVCTL_AP_CONFIGURE: cmd_name = "DEVCTL_AP_CONFIGURE"; break;
-	case DEVCTL_AP_UNCONFIGURE: cmd_name = "DEVCTL_AP_UNCONFIGURE"; break;
-	case DEVCTL_AP_GETSTATE: cmd_name = "DEVCTL_AP_GETSTATE"; break;
-	case DEVCTL_AP_CONTROL: cmd_name = "DEVCTL_AP_CONTROL"; break;
-	default: cmd_name = "Unknown"; break;
-	}
-	cardbus_err(cbp->cb_dip, 7,
-	    "cardbus_ioctl: cmd = 0x%x, \"%s\"", cmd, cmd_name);
-}
-#endif
-
-	switch (cmd) {
-	case DEVCTL_DEVICE_GETSTATE:
-	case DEVCTL_DEVICE_ONLINE:
-	case DEVCTL_DEVICE_OFFLINE:
-	case DEVCTL_BUS_GETSTATE:
-		rv = ndi_devctl_ioctl(self, cmd, arg, mode, 0);
-		ndi_dc_freehdl(dcp);
-		return (rv);
-	default:
-		break;
-	}
-
-	switch (cmd) {
-	case DEVCTL_DEVICE_RESET:
-		rv = ENOTSUP;
-		break;
-
-	case DEVCTL_BUS_QUIESCE:
-		if (ndi_get_bus_state(self, &bus_state) == NDI_SUCCESS)
-			if (bus_state == BUS_QUIESCED)
-				break;
-		(void) ndi_set_bus_state(self, BUS_QUIESCED);
-		break;
-
-	case DEVCTL_BUS_UNQUIESCE:
-		if (ndi_get_bus_state(self, &bus_state) == NDI_SUCCESS)
-			if (bus_state == BUS_ACTIVE)
-				break;
-		(void) ndi_set_bus_state(self, BUS_ACTIVE);
-		break;
-
-	case DEVCTL_BUS_RESET:
-		rv = ENOTSUP;
-		break;
-
-	case DEVCTL_BUS_RESETALL:
-		rv = ENOTSUP;
-		break;
-
-	case DEVCTL_AP_CONNECT:
-	case DEVCTL_AP_DISCONNECT:
-		/*
-		 * CONNECT(DISCONNECT) the hot plug slot to(from) the bus.
-		 */
-	case DEVCTL_AP_INSERT:
-	case DEVCTL_AP_REMOVE:
-		/*
-		 * Prepare the slot for INSERT/REMOVE operation.
-		 */
-
-		/*
-		 * check for valid request:
-		 * 	1. It is a hotplug slot.
-		 * 	2. The slot has no occupant that is in
-		 * 	the 'configured' state.
-		 *
-		 * The lower 8 bits of the minor number is the PCI
-		 * device number for the slot.
-		 */
-		if ((cbp->slot_handle == NULL) || cbp->disabled) {
-			rv = ENXIO;
-			break;
-		}
-
-		/* the slot occupant must be in the UNCONFIGURED state */
-		if (cbp->ostate != AP_OSTATE_UNCONFIGURED) {
-			rv = EINVAL;
-			break;
-		}
-
-		/*
-		 * Call the HPC driver to perform the operation on the slot.
-		 */
-		mutex_enter(&cbp->cb_mutex);
-		switch (cmd) {
-		case DEVCTL_AP_INSERT:
-			rv = hpc_nexus_insert(cbp->slot_handle, NULL, 0);
-			break;
-		case DEVCTL_AP_REMOVE:
-			rv = hpc_nexus_remove(cbp->slot_handle, NULL, 0);
-			break;
-		case DEVCTL_AP_CONNECT:
-			if ((rv = hpc_nexus_connect(cbp->slot_handle,
-			    NULL, 0)) == 0)
-				cbp->rstate = AP_RSTATE_CONNECTED;
-			break;
-		case DEVCTL_AP_DISCONNECT:
-			if ((rv = hpc_nexus_disconnect(cbp->slot_handle,
-			    NULL, 0)) == 0)
-				cbp->rstate = AP_RSTATE_DISCONNECTED;
-			break;
-		}
-		mutex_exit(&cbp->cb_mutex);
-
-		switch (rv) {
-		case HPC_ERR_INVALID:
-			rv = ENXIO;
-			break;
-		case HPC_ERR_NOTSUPPORTED:
-			rv = ENOTSUP;
-			break;
-		case HPC_ERR_FAILED:
-			rv = EIO;
-			break;
-		}
-
-		break;
-
-	case DEVCTL_AP_CONFIGURE:
-		/*
-		 * **************************************
-		 * CONFIGURE the occupant in the slot.
-		 * **************************************
-		 */
-
-		mutex_enter(&cbp->cb_mutex);
-		if ((nrv = cardbus_configure_ap(cbp)) == HPC_SUCCESS) {
-			create_occupant_props(cbp->cb_dip, dev);
-		} else
-			rv = nrv;
-		mutex_exit(&cbp->cb_mutex);
-		break;
-
-	case DEVCTL_AP_UNCONFIGURE:
-		/*
-		 * **************************************
-		 * UNCONFIGURE the occupant in the slot.
-		 * **************************************
-		 */
-
-		mutex_enter(&cbp->cb_mutex);
-		if ((nrv = cardbus_unconfigure_ap(cbp)) == HPC_SUCCESS) {
-			delete_occupant_props(cbp->cb_dip, dev);
-		} else
-			rv = nrv;
-		mutex_exit(&cbp->cb_mutex);
-		break;
-
-	case DEVCTL_AP_GETSTATE:
-	    {
-		int mutex_held;
-
-		/*
-		 * return the state of Attachment Point.
-		 *
-		 * If the occupant is in UNCONFIGURED state then
-		 * we should get the receptacle state from the
-		 * HPC driver because the receptacle state
-		 * maintained in the nexus may not be accurate.
-		 */
-
-		/*
-		 * check for valid request:
-		 * 	1. It is a hotplug slot.
-		 */
-		if (cbp->slot_handle == NULL) {
-			rv = ENXIO;
-			break;
-		}
-
-		/* try to acquire the slot mutex */
-		mutex_held = mutex_tryenter(&cbp->cb_mutex);
-
-		if (cbp->ostate == AP_OSTATE_UNCONFIGURED) {
-			if (hpc_nexus_control(cbp->slot_handle,
-			    HPC_CTRL_GET_SLOT_STATE,
-			    (caddr_t)&rstate) != 0) {
-				rv = ENXIO;
-				if (mutex_held)
-					mutex_exit(&cbp->cb_mutex);
-				break;
-			}
-			cbp->rstate = (ap_rstate_t)rstate;
-		}
-
-		ap_state.ap_rstate = cbp->rstate;
-		ap_state.ap_ostate = cbp->ostate;
-		ap_state.ap_condition = cbp->condition;
-		ap_state.ap_last_change = 0;
-		ap_state.ap_error_code = 0;
-		if (mutex_held)
-			ap_state.ap_in_transition = 0; /* AP is not busy */
-		else
-			ap_state.ap_in_transition = 1; /* AP is busy */
-
-		if (mutex_held)
-			mutex_exit(&cbp->cb_mutex);
-
-		/* copy the return-AP-state information to the user space */
-		if (ndi_dc_return_ap_state(&ap_state, dcp) != NDI_SUCCESS)
-			rv = ENXIO;
-
-		break;
-
-	    }
-
-	case DEVCTL_AP_CONTROL:
-		/*
-		 * HPC control functions:
-		 * 	HPC_CTRL_ENABLE_SLOT/HPC_CTRL_DISABLE_SLOT
-		 * 		Changes the state of the slot and preserves
-		 * 		the state across the reboot.
-		 * 	HPC_CTRL_ENABLE_AUTOCFG/HPC_CTRL_DISABLE_AUTOCFG
-		 * 		Enables or disables the auto configuration
-		 * 		of hot plugged occupant if the hardware
-		 * 		supports notification of the hot plug
-		 * 		events.
-		 * 	HPC_CTRL_GET_LED_STATE/HPC_CTRL_SET_LED_STATE
-		 * 		Controls the state of an LED.
-		 * 	HPC_CTRL_GET_SLOT_INFO
-		 * 		Get slot information data structure
-		 * 		(hpc_slot_info_t).
-		 * 	HPC_CTRL_GET_BOARD_TYPE
-		 * 		Get board type information (hpc_board_type_t).
-		 * 	HPC_CTRL_GET_CARD_INFO
-		 * 		Get card information (hpc_card_info_t).
-		 *
-		 * These control functions are used by the cfgadm plug-in
-		 * to implement "-x" and "-v" options.
-		 */
-
-		/* copy user ioctl data first */
-#ifdef _MULTI_DATAMODEL
-		if (ddi_model_convert_from(mode & FMODELS) == DDI_MODEL_ILP32) {
-			struct hpc_control32_data hpc_ctrldata32;
-
-			if (copyin((void *)arg, (void *)&hpc_ctrldata32,
-			    sizeof (struct hpc_control32_data)) != 0) {
-				rv = EFAULT;
-				break;
-			}
-			hpc_ctrldata.cmd = hpc_ctrldata32.cmd;
-			hpc_ctrldata.data =
-			    (void *)(intptr_t)hpc_ctrldata32.data;
-		}
-#else
-		if (copyin((void *)arg, (void *)&hpc_ctrldata,
-		    sizeof (struct hpc_control_data)) != 0) {
-			rv = EFAULT;
-			break;
-		}
-#endif
-
-#ifdef CARDBUS_DEBUG
-{
-		char *hpc_name;
-		switch (hpc_ctrldata.cmd) {
-		case HPC_CTRL_GET_LED_STATE:
-			hpc_name = "HPC_CTRL_GET_LED_STATE";
-			break;
-		case HPC_CTRL_SET_LED_STATE:
-			hpc_name = "HPC_CTRL_SET_LED_STATE";
-			break;
-		case HPC_CTRL_ENABLE_SLOT:
-			hpc_name = "HPC_CTRL_ENABLE_SLOT";
-			break;
-		case HPC_CTRL_DISABLE_SLOT:
-			hpc_name = "HPC_CTRL_DISABLE_SLOT";
-			break;
-		case HPC_CTRL_ENABLE_AUTOCFG:
-			hpc_name = "HPC_CTRL_ENABLE_AUTOCFG";
-			break;
-		case HPC_CTRL_DISABLE_AUTOCFG:
-			hpc_name = "HPC_CTRL_DISABLE_AUTOCFG";
-			break;
-		case HPC_CTRL_GET_BOARD_TYPE:
-			hpc_name = "HPC_CTRL_GET_BOARD_TYPE";
-			break;
-		case HPC_CTRL_GET_SLOT_INFO:
-			hpc_name = "HPC_CTRL_GET_SLOT_INFO";
-			break;
-		case HPC_CTRL_GET_CARD_INFO:
-			hpc_name = "HPC_CTRL_GET_CARD_INFO";
-			break;
-		default: hpc_name = "Unknown"; break;
-		}
-		cardbus_err(cbp->cb_dip, 7,
-		    "cardbus_ioctl: HP Control cmd 0x%x - \"%s\"",
-		    hpc_ctrldata.cmd, hpc_name);
-}
-#endif
-		/*
-		 * check for valid request:
-		 * 	1. It is a hotplug slot.
-		 */
-		if (cbp->slot_handle == NULL) {
-			rv = ENXIO;
-			break;
-		}
-
-		mutex_enter(&cbp->cb_mutex);
-		switch (hpc_ctrldata.cmd) {
-		case HPC_CTRL_GET_LED_STATE:
-			/* copy the led info from the user space */
-			if (copyin(hpc_ctrldata.data, (void *)&led_info,
-			    sizeof (hpc_led_info_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			/* get the state of LED information */
-			if (hpc_nexus_control(cbp->slot_handle,
-			    HPC_CTRL_GET_LED_STATE,
-			    (caddr_t)&led_info) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			/* copy the led info to the user space */
-			if (copyout((void *)&led_info, hpc_ctrldata.data,
-			    sizeof (hpc_led_info_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-			break;
-
-		case HPC_CTRL_SET_LED_STATE:
-			/* copy the led info from the user space */
-			if (copyin(hpc_ctrldata.data, (void *)&led_info,
-			    sizeof (hpc_led_info_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			/* set the state of an LED */
-			if (hpc_nexus_control(cbp->slot_handle,
-			    HPC_CTRL_SET_LED_STATE,
-			    (caddr_t)&led_info) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			break;
-
-		case HPC_CTRL_ENABLE_SLOT:
-			/*
-			 * Enable the slot for hotplug operations.
-			 */
-			cbp->disabled = B_FALSE;
-
-			/* tell the HPC driver also */
-			(void) hpc_nexus_control(cbp->slot_handle,
-				HPC_CTRL_ENABLE_SLOT, NULL);
-
-			break;
-
-		case HPC_CTRL_DISABLE_SLOT:
-			/*
-			 * Disable the slot for hotplug operations.
-			 */
-			cbp->disabled = B_TRUE;
-
-			/* tell the HPC driver also */
-			(void) hpc_nexus_control(cbp->slot_handle,
-				HPC_CTRL_DISABLE_SLOT, NULL);
-
-			break;
-
-		case HPC_CTRL_ENABLE_AUTOCFG:
-			/*
-			 * Enable auto configuration on this slot.
-			 */
-			cbp->auto_config = B_TRUE;
-
-			/* tell the HPC driver also */
-			(void) hpc_nexus_control(cbp->slot_handle,
-				HPC_CTRL_ENABLE_AUTOCFG, NULL);
-			break;
-
-		case HPC_CTRL_DISABLE_AUTOCFG:
-			/*
-			 * Disable auto configuration on this slot.
-			 */
-			cbp->auto_config = B_FALSE;
-
-			/* tell the HPC driver also */
-			(void) hpc_nexus_control(cbp->slot_handle,
-				HPC_CTRL_DISABLE_AUTOCFG, NULL);
-
-			break;
-
-		case HPC_CTRL_GET_BOARD_TYPE:
-		    {
-			hpc_board_type_t board_type;
-
-			/*
-			 * Get board type data structure, hpc_board_type_t.
-			 */
-			if (hpc_nexus_control(cbp->slot_handle,
-			    HPC_CTRL_GET_BOARD_TYPE,
-			    (caddr_t)&board_type) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			/* copy the board type info to the user space */
-			if (copyout((void *)&board_type, hpc_ctrldata.data,
-			    sizeof (hpc_board_type_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			break;
-		    }
-
-		case HPC_CTRL_GET_SLOT_INFO:
-		    {
-			hpc_slot_info_t slot_info;
-
-			/*
-			 * Get slot information structure, hpc_slot_info_t.
-			 */
-			slot_info.version = HPC_SLOT_INFO_VERSION;
-			slot_info.slot_type = 0;
-			slot_info.pci_slot_capabilities = 0;
-			slot_info.pci_dev_num =
-				(uint16_t)AP_MINOR_NUM_TO_CB_INSTANCE(ap_minor);
-			(void) strcpy(slot_info.pci_slot_name, cbp->name);
-
-			/* copy the slot info structure to the user space */
-			if (copyout((void *)&slot_info, hpc_ctrldata.data,
-			    sizeof (hpc_slot_info_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			break;
-		    }
-
-		case HPC_CTRL_GET_CARD_INFO:
-		    {
-			hpc_card_info_t card_info;
-			ddi_acc_handle_t handle;
-
-			/*
-			 * Get card information structure, hpc_card_info_t.
-			 */
-
-			if (cbp->card_present == B_FALSE) {
-				rv = ENXIO;
-				break;
-			}
-			/* verify that the card is configured */
-			if (cbp->ostate != AP_OSTATE_CONFIGURED) {
-				/* either the card is not present or */
-				/* it is not configured. */
-				rv = ENXIO;
-				break;
-			}
-
-			/* get the information from the PCI config header */
-			/* for the function 0. */
-			for (child_dip = ddi_get_child(cbp->cb_dip); child_dip;
-			    child_dip = ddi_get_next_sibling(child_dip))
-				if (strcmp("pcs", ddi_get_name(child_dip)))
-					break;
-
-			if (!child_dip) {
-				rv = ENXIO;
-				break;
-			}
-
-			if (pci_config_setup(child_dip, &handle)
-			    != DDI_SUCCESS) {
-				rv = EIO;
-				break;
-			}
-			card_info.prog_class = pci_config_get8(handle,
-							PCI_CONF_PROGCLASS);
-			card_info.base_class = pci_config_get8(handle,
-							PCI_CONF_BASCLASS);
-			card_info.sub_class = pci_config_get8(handle,
-							PCI_CONF_SUBCLASS);
-			card_info.header_type = pci_config_get8(handle,
-							PCI_CONF_HEADER);
-			pci_config_teardown(&handle);
-
-			/* copy the card info structure to the user space */
-			if (copyout((void *)&card_info, hpc_ctrldata.data,
-			    sizeof (hpc_card_info_t)) != 0) {
-				rv = ENXIO;
-				break;
-			}
-
-			break;
-		    }
-
-		default:
-			rv = EINVAL;
-			break;
-		}
-
-		mutex_exit(&cbp->cb_mutex);
-		break;
-
-	default:
-		rv = ENOTTY;
-	}
-
-	if (cmd != DEVCTL_AP_CONTROL)
-		ndi_dc_freehdl(dcp);
-
-	cardbus_err(cbp->cb_dip, 7,
-	    "cardbus_ioctl: rv = 0x%x", rv);
-
-	return (rv);
-}
-
-struct cardbus_pci_desc {
-	char	*name;
-	ushort_t	offset;
-	int	(*cfg_get_func)();
-	char	*fmt;
-};
-
-static struct cardbus_pci_desc generic_pci_cfg[] = {
-	    { "VendorId    =", 0, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "DeviceId    =", 2, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Command     =", 4, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Status      =", 6, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Latency     =", 0xd, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "BASE0       =", 0x10, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "BASE1       =", 0x14, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "BASE2       =", 0x18, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "BASE3       =", 0x1c, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "BASE4       =", 0x20, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "CIS Pointer =", 0x28, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "ILINE       =", 0x3c, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "IPIN        =", 0x3d, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { NULL, 0, NULL, NULL }
-};
-
-static struct cardbus_pci_desc cardbus_pci_cfg[] = {
-	    { "VendorId    =", 0, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "DeviceId    =", 2, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Command     =", 4, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Status      =", 6, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "CacheLineSz =", 0xc, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "Latency     =", 0xd, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "MemBase Addr=", 0x10, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "Pri Bus     =", 0x18, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "Sec Bus     =", 0x19, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "Sub Bus     =", 0x1a, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "CBus Latency=", 0x1b, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "Mem0 Base   =", 0x1c, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "Mem0 Limit  =", 0x20, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "Mem1 Base   =", 0x24, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "Mem1 Limit  =", 0x28, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "I/O0 Base   =", 0x2c, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "I/O0 Limit  =", 0x30, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "I/O1 Base   =", 0x34, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "I/O1 Limit  =", 0x38, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { "ILINE       =", 0x3c, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "IPIN        =", 0x3d, (int(*)())pci_config_get8, "%s 0x%02x" },
-	    { "Bridge Ctrl =", 0x3e, (int(*)())pci_config_get16, "%s 0x%04x" },
-	    { "Legacy Addr =", 0x44, (int(*)())pci_config_get32, "%s 0x%08x" },
-	    { NULL, 0, NULL, NULL }
-};
-
-static void
-cardbus_dump(struct cardbus_pci_desc *spcfg, ddi_acc_handle_t handle)
-{
-	int	i;
-	for (i = 0; spcfg[i].name; i++) {
-
-		cmn_err(CE_NOTE, spcfg[i].fmt, spcfg[i].name,
-		    spcfg[i].cfg_get_func(handle, spcfg[i].offset));
-	}
-
-}
-
-void
-cardbus_dump_pci_node(dev_info_t *dip)
-{
-	dev_info_t *next;
-	struct cardbus_pci_desc *spcfg;
-	ddi_acc_handle_t config_handle;
-	uint32_t VendorId;
-
-	cmn_err(CE_NOTE, "\nPCI leaf node of dip 0x%p:\n", (void *)dip);
-	for (next = ddi_get_child(dip); next;
-	    next = ddi_get_next_sibling(next)) {
-
-		VendorId = ddi_getprop(DDI_DEV_T_ANY, next,
-		    DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-		    "vendor-id", -1);
-		if (VendorId == -1) {
-			/* not a pci device */
-			continue;
-		}
-
-		if (pci_config_setup(next, &config_handle) != DDI_SUCCESS) {
-			cmn_err(CE_WARN, "!pcic child: non pci device\n");
-			continue;
-		}
-
-		spcfg = generic_pci_cfg;
-		cardbus_dump(spcfg, config_handle);
-		pci_config_teardown(&config_handle);
-
-	}
-
-}
-
-void
-cardbus_dump_pci_config(dev_info_t *dip)
-{
-	struct cardbus_pci_desc *spcfg;
-	ddi_acc_handle_t config_handle;
-
-	if (pci_config_setup(dip, &config_handle) != DDI_SUCCESS) {
-		cmn_err(CE_WARN,
-		    "!pci_config_setup() failed on 0x%p", (void *)dip);
-		return;
-	}
-
-	spcfg = cardbus_pci_cfg;
-	cardbus_dump(spcfg, config_handle);
-
-	pci_config_teardown(&config_handle);
-}
-
-void
-cardbus_dump_socket(dev_info_t *dip)
-{
-	ddi_acc_handle_t 	iohandle;
-	caddr_t		ioaddr;
-	ddi_device_acc_attr_t attr;
-	attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-	attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-	attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-	if (ddi_regs_map_setup(dip, 1,
-	    (caddr_t *)&ioaddr,
-	    0,
-	    4096,
-	    &attr, &iohandle) != DDI_SUCCESS) {
-		cmn_err(CE_WARN, "Failed to map address for 0x%p", (void *)dip);
-		return;
-	}
-
-	cmn_err(CE_NOTE, "////////////////////////////////////////");
-	cmn_err(CE_NOTE, "SOCKET_EVENT  = [0x%x]",
-	    ddi_get32(iohandle, (uint32_t *)(ioaddr+CB_STATUS_EVENT)));
-	cmn_err(CE_NOTE, "SOCKET_MASK   = [0x%x]",
-	    ddi_get32(iohandle, (uint32_t *)(ioaddr+CB_STATUS_MASK)));
-	cmn_err(CE_NOTE, "SOCKET_STATE  = [0x%x]",
-	    ddi_get32(iohandle, (uint32_t *)(ioaddr+CB_PRESENT_STATE)));
-	cmn_err(CE_NOTE, "////////////////////////////////////////");
-
-	ddi_regs_map_free(&iohandle);
-
-}
--- old/usr/src/uts/common/io/cardbus/cardbus_hp.h	2014-11-12 17:44:40.325023743 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,58 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- */
-
-#ifndef	_SYS_CARDBUS_HP_H
-#define	_SYS_CARDBUS_HP_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-struct  cardbus_config_ctrl {
-	int	op;	/* operation - PCICFG_OP_ONLINE/PCICFG_OP_OFFLINE */
-	int	busno;
-	int	rv;	/* return error code */
-	uint_t	flags;
-	dev_info_t	*dip;	/* first error occurred here */
-};
-
-extern void *cardbus_state;
-
-extern int cardbus_init_hotplug(cbus_t *cbp);
-extern int cardbus_unconfigure_node(dev_info_t *dip, int prim_bus,
-		boolean_t top_bridge);
-extern int cbus_configure(dev_info_t *dip, void *hdl);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif	/* _SYS_CARDBUS_HP_H */
--- old/usr/src/uts/common/io/cardbus/cardbus_parse.h	2014-11-12 17:44:40.376058574 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,93 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
- * All rights reserved.
- */
-
-#ifndef	_SYS_CARDBUS_IMPL_H
-#define	_SYS_CARDBUS_IMPL_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/*
- * Device property initialization structures and defines
- */
-struct cb_deviceset_props {
-	struct cb_deviceset_props *next;
-	char	*binding_name;
-	uint16_t	venid;
-	uint16_t	devid;
-	char	*nodename;
-	ddi_prop_t	*prop_list;
-};
-
-typedef struct {
-	char	*token;	/* token to look for */
-	int	state;	/* state machine state */
-} cb_props_parse_tree_t;
-
-#define	PARSE_QUOTE		'\''
-#define	PARSE_COMMENT		'#'
-#define	PARSE_ESCAPE		'\\'
-#define	PARSE_UNDERSCORE	'_'
-#define	PARSE_DASH		'-'
-#define	PARSE_SEMICOLON		';'
-#define	PARSE_COMMA		','
-#define	PARSE_EQUALS		'='
-
-/*
- * state defines for the valued variable state machine
- */
-#define	PT_STATE_UNKNOWN	0
-#define	PT_STATE_TOKEN		1
-#define	PT_STATE_STRING_VAR	2
-#define	PT_STATE_HEX_VAR	3
-#define	PT_STATE_DEC_VAR	4
-#define	PT_STATE_ESCAPE		5
-#define	PT_STATE_CHECK		6
-
-#undef	isalpha
-#undef	isxdigit
-#undef	ixdigit
-#undef	toupper
-
-#define	isalpha(ch)	(((ch) >= 'a' && (ch) <= 'z') || \
-			((ch) >= 'A' && (ch) <= 'Z'))
-#define	isxdigit(ch)	(isdigit(ch) || ((ch) >= 'a' && (ch) <= 'f') || \
-			((ch) >= 'A' && (ch) <= 'F'))
-#define	isx(ch)		((ch) == 'x' || (ch) == 'X')
-#define	isdigit(ch)	((ch) >= '0' && (ch) <= '9')
-#define	toupper(C)	(((C) >= 'a' && (C) <= 'z')? (C) - 'a' + 'A': (C))
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif	/* _SYS_CARDBUS_IMPL_H */
--- old/usr/src/uts/common/io/pcic.c	2014-11-12 17:44:40.428701300 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,6870 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * PCIC device/interrupt handler
- *	The "pcic" driver handles the Intel 82365SL, Cirrus Logic
- *	and Toshiba (and possibly other clones) PCMCIA adapter chip
- *	sets.  It implements a subset of Socket Services as defined
- *	in the Solaris PCMCIA design documents
- */
-
-/*
- * currently defined "properties"
- *
- * clock-frequency		bus clock frequency
- * smi				system management interrupt override
- * need-mult-irq		need status IRQ for each pair of sockets
- * disable-audio		don't route audio signal to speaker
- */
-
-
-#include <sys/types.h>
-#include <sys/inttypes.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/sunndi.h>
-#include <sys/var.h>
-#include <sys/callb.h>
-#include <sys/open.h>
-#include <sys/ddidmareq.h>
-#include <sys/dma_engine.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/pci.h>
-#include <sys/pci_impl.h>
-
-#include <sys/pctypes.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-
-#include <sys/note.h>
-
-#include <sys/pcic_reg.h>
-#include <sys/pcic_var.h>
-
-#if defined(__i386) || defined(__amd64)
-#include <sys/pci_cfgspace.h>
-#endif
-
-#if defined(__sparc)
-#include <sys/pci/pci_nexus.h>
-#endif
-
-#include <sys/hotplug/hpcsvc.h>
-#include "cardbus/cardbus.h"
-
-#define	SOFTC_SIZE	(sizeof (anp_t))
-
-static int pcic_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **);
-static int pcic_attach(dev_info_t *, ddi_attach_cmd_t);
-static int pcic_detach(dev_info_t *, ddi_detach_cmd_t);
-static int32_t pcic_quiesce(dev_info_t *);
-static uint_t pcic_intr(caddr_t, caddr_t);
-static int pcic_do_io_intr(pcicdev_t *, uint32_t);
-static int pcic_probe(dev_info_t *);
-
-static int pcic_open(dev_t *, int, int, cred_t *);
-static int pcic_close(dev_t, int, int, cred_t *);
-static int pcic_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
-
-typedef struct pcm_regs pcm_regs_t;
-
-static void pcic_init_assigned(dev_info_t *);
-static int pcic_apply_avail_ranges(dev_info_t *, pcm_regs_t *,
-	pci_regspec_t *, int);
-int pci_resource_setup_avail(dev_info_t *, pci_regspec_t *, int);
-
-/*
- * On x86 platforms the ddi_iobp_alloc(9F) and ddi_mem_alloc(9F) calls
- * are xlated into DMA ctlops. To make this nexus work on x86, we
- * need to have the default ddi_dma_mctl ctlops in the bus_ops
- * structure, just to pass the request to the parent. The correct
- * ctlops should be ddi_no_dma_mctl because so far we don't do DMA.
- */
-static
-struct bus_ops pcmciabus_ops = {
-	BUSO_REV,
-	pcmcia_bus_map,
-	NULL,
-	NULL,
-	NULL,
-	i_ddi_map_fault,
-	ddi_no_dma_map,
-	ddi_no_dma_allochdl,
-	ddi_no_dma_freehdl,
-	ddi_no_dma_bindhdl,
-	ddi_no_dma_unbindhdl,
-	ddi_no_dma_flush,
-	ddi_no_dma_win,
-	ddi_dma_mctl,
-	pcmcia_ctlops,
-	pcmcia_prop_op,
-	NULL,				/* (*bus_get_eventcookie)();	*/
-	NULL,				/* (*bus_add_eventcall)();	*/
-	NULL,				/* (*bus_remove_eventcall)();	*/
-	NULL,				/* (*bus_post_event)();		*/
-	NULL,				/* (*bus_intr_ctl)();		*/
-	NULL,				/* (*bus_config)(); 		*/
-	NULL,				/* (*bus_unconfig)(); 		*/
-	NULL,				/* (*bus_fm_init)(); 		*/
-	NULL,				/* (*bus_fm_fini)(); 		*/
-	NULL,				/* (*bus_enter)()		*/
-	NULL,				/* (*bus_exit)()		*/
-	NULL,				/* (*bus_power)()		*/
-	pcmcia_intr_ops			/* (*bus_intr_op)(); 		*/
-};
-
-static struct cb_ops pcic_cbops = {
-	pcic_open,
-	pcic_close,
-	nodev,
-	nodev,
-	nodev,
-	nodev,
-	nodev,
-	pcic_ioctl,
-	nodev,
-	nodev,
-	nodev,
-	nochpoll,
-	ddi_prop_op,
-	NULL,
-#ifdef CARDBUS
-	D_NEW | D_MP | D_HOTPLUG
-#else
-	D_NEW | D_MP
-#endif
-};
-
-static struct dev_ops pcic_devops = {
-	DEVO_REV,
-	0,
-	pcic_getinfo,
-	nulldev,
-	pcic_probe,
-	pcic_attach,
-	pcic_detach,
-	nulldev,
-	&pcic_cbops,
-	&pcmciabus_ops,
-	NULL,
-	pcic_quiesce,	/* devo_quiesce */
-};
-
-void *pcic_soft_state_p = NULL;
-static int pcic_maxinst = -1;
-
-int pcic_do_insertion = 1;
-int pcic_do_removal = 1;
-
-struct irqmap {
-	int irq;
-	int count;
-} pcic_irq_map[16];
-
-
-int pcic_debug = 0x0;
-static  void    pcic_err(dev_info_t *dip, int level, const char *fmt, ...);
-extern void cardbus_dump_pci_config(dev_info_t *dip);
-extern void cardbus_dump_socket(dev_info_t *dip);
-extern int cardbus_validate_iline(dev_info_t *dip, ddi_acc_handle_t handle);
-static void pcic_dump_debqueue(char *msg);
-
-#if defined(PCIC_DEBUG)
-static void xxdmp_all_regs(pcicdev_t *, int, uint32_t);
-
-#define	pcic_mutex_enter(a)	\
-	{ \
-		pcic_err(NULL, 10, "Set lock at %d\n", __LINE__); \
-		mutex_enter(a); \
-	};
-
-#define	pcic_mutex_exit(a)	\
-	{ \
-		pcic_err(NULL, 10, "Clear lock at %d\n", __LINE__); \
-		mutex_exit(a); \
-	};
-
-#else
-#define	pcic_mutex_enter(a)	mutex_enter(a)
-#define	pcic_mutex_exit(a)	mutex_exit(a)
-#endif
-
-#define	PCIC_VCC_3VLEVEL	1
-#define	PCIC_VCC_5VLEVEL	2
-#define	PCIC_VCC_12LEVEL	3
-
-/* bit patterns to select voltage levels */
-int pcic_vpp_levels[13] = {
-	0, 0, 0,
-	1,	/* 3.3V */
-	0,
-	1,	/* 5V */
-	0, 0, 0, 0, 0, 0,
-	2	/* 12V */
-};
-
-uint8_t pcic_cbv_levels[13] = {
-	0, 0, 0,
-	3,			/* 3.3V */
-	0,
-	2,			/* 5V */
-	0, 0, 0, 0, 0, 0,
-	1			/* 12V */
-};
-
-struct power_entry pcic_power[4] = {
-	{
-		0, VCC|VPP1|VPP2
-	},
-	{
-		33,		/* 3.3Volt */
-		VCC|VPP1|VPP2
-	},
-	{
-		5*10,		/* 5Volt */
-		VCC|VPP1|VPP2	/* currently only know about this */
-	},
-	{
-		12*10,		/* 12Volt */
-		VPP1|VPP2
-	}
-};
-
-/*
- * Base used to allocate ranges of PCI memory on x86 systems
- * Each instance gets a chunk above the base that is used to map
- * in the memory and I/O windows for that device.
- * Pages below the base are also allocated for the EXCA registers,
- * one per instance.
- */
-#define	PCIC_PCI_MEMCHUNK	0x1000000
-
-static int pcic_wait_insert_time = 5000000;	/* In micro-seconds */
-static int pcic_debounce_time = 200000; /* In micro-seconds */
-
-struct debounce {
-	pcic_socket_t *pcs;
-	clock_t expire;
-	struct debounce *next;
-};
-
-static struct debounce *pcic_deb_queue = NULL;
-static kmutex_t pcic_deb_mtx;
-static kcondvar_t pcic_deb_cv;
-static kthread_t *pcic_deb_threadid;
-
-static inthandler_t *pcic_handlers;
-
-static void pcic_setup_adapter(pcicdev_t *);
-static int pcic_change(pcicdev_t *, int);
-static int pcic_ll_reset(pcicdev_t *, int);
-static void pcic_mswait(pcicdev_t *, int, int);
-static boolean_t pcic_check_ready(pcicdev_t *, int);
-static void pcic_set_cdtimers(pcicdev_t *, int, uint32_t, int);
-static void pcic_ready_wait(pcicdev_t *, int);
-extern int pcmcia_get_intr(dev_info_t *, int);
-extern int pcmcia_return_intr(dev_info_t *, int);
-extern void pcmcia_cb_suspended(int);
-extern void pcmcia_cb_resumed(int);
-
-static int pcic_callback(dev_info_t *, int (*)(), int);
-static int pcic_inquire_adapter(dev_info_t *, inquire_adapter_t *);
-static int pcic_get_adapter(dev_info_t *, get_adapter_t *);
-static int pcic_get_page(dev_info_t *, get_page_t *);
-static int pcic_get_socket(dev_info_t *, get_socket_t *);
-static int pcic_get_status(dev_info_t *, get_ss_status_t *);
-static int pcic_get_window(dev_info_t *, get_window_t *);
-static int pcic_inquire_socket(dev_info_t *, inquire_socket_t *);
-static int pcic_inquire_window(dev_info_t *, inquire_window_t *);
-static int pcic_reset_socket(dev_info_t *, int, int);
-static int pcic_set_page(dev_info_t *, set_page_t *);
-static int pcic_set_window(dev_info_t *, set_window_t *);
-static int pcic_set_socket(dev_info_t *, set_socket_t *);
-static int pcic_set_interrupt(dev_info_t *, set_irq_handler_t *);
-static int pcic_clear_interrupt(dev_info_t *, clear_irq_handler_t *);
-static void pcic_pm_detection(void *);
-static void pcic_iomem_pci_ctl(ddi_acc_handle_t, uchar_t *, unsigned);
-static int clext_reg_read(pcicdev_t *, int, uchar_t);
-static void clext_reg_write(pcicdev_t *, int, uchar_t, uchar_t);
-static int pcic_calc_speed(pcicdev_t *, uint32_t);
-static int pcic_card_state(pcicdev_t *, pcic_socket_t *);
-static int pcic_find_pci_type(pcicdev_t *);
-static void pcic_82092_smiirq_ctl(pcicdev_t *, int, int, int);
-static void pcic_handle_cd_change(pcicdev_t *, pcic_socket_t *, uint8_t);
-static uint_t pcic_cd_softint(caddr_t, caddr_t);
-static uint8_t pcic_getb(pcicdev_t *, int, int);
-static void pcic_putb(pcicdev_t *, int, int, int8_t);
-static int pcic_set_vcc_level(pcicdev_t *, set_socket_t *);
-static uint_t pcic_softintr(caddr_t, caddr_t);
-
-static void pcic_debounce(pcic_socket_t *);
-static void pcic_do_resume(pcicdev_t *);
-static void *pcic_add_debqueue(pcic_socket_t *, int);
-static void pcic_rm_debqueue(void *);
-static void pcic_deb_thread();
-
-static boolean_t pcic_load_cardbus(pcicdev_t *pcic, const pcic_socket_t *sockp);
-static void pcic_unload_cardbus(pcicdev_t *pcic, const pcic_socket_t *sockp);
-static uint32_t pcic_getcb(pcicdev_t *pcic, int reg);
-static void pcic_putcb(pcicdev_t *pcic, int reg, uint32_t value);
-static void pcic_cb_enable_intr(dev_info_t *);
-static void pcic_cb_disable_intr(dev_info_t *);
-static void pcic_enable_io_intr(pcicdev_t *pcic, int socket, int irq);
-static void pcic_disable_io_intr(pcicdev_t *pcic, int socket);
-
-static cb_nexus_cb_t pcic_cbnexus_ops = {
-	pcic_cb_enable_intr,
-	pcic_cb_disable_intr
-};
-
-static int pcic_exca_powerctl(pcicdev_t *pcic, int socket, int powerlevel);
-static int pcic_cbus_powerctl(pcicdev_t *pcic, int socket);
-
-#if defined(__sparc)
-static int pcic_fault(enum pci_fault_ops op, void *arg);
-#endif
-
-
-/*
- * pcmcia interface operations structure
- * this is the private interface that is exported to the nexus
- */
-pcmcia_if_t pcic_if_ops = {
-	PCIF_MAGIC,
-	PCIF_VERSION,
-	pcic_callback,
-	pcic_get_adapter,
-	pcic_get_page,
-	pcic_get_socket,
-	pcic_get_status,
-	pcic_get_window,
-	pcic_inquire_adapter,
-	pcic_inquire_socket,
-	pcic_inquire_window,
-	pcic_reset_socket,
-	pcic_set_page,
-	pcic_set_window,
-	pcic_set_socket,
-	pcic_set_interrupt,
-	pcic_clear_interrupt,
-	NULL,
-};
-
-/*
- * chip type identification routines
- * this list of functions is searched until one of them succeeds
- * or all fail.  i82365SL is assumed if failed.
- */
-static int pcic_ci_cirrus(pcicdev_t *);
-static int pcic_ci_vadem(pcicdev_t *);
-static int pcic_ci_ricoh(pcicdev_t *);
-
-int (*pcic_ci_funcs[])(pcicdev_t *) = {
-	pcic_ci_cirrus,
-	pcic_ci_vadem,
-	pcic_ci_ricoh,
-	NULL
-};
-
-static struct modldrv modldrv = {
-	&mod_driverops,		/* Type of module. This one is a driver */
-	"PCIC PCMCIA adapter driver",	/* Name of the module. */
-	&pcic_devops,		/* driver ops */
-};
-
-static struct modlinkage modlinkage = {
-	MODREV_1, (void *)&modldrv, NULL
-};
-
-int
-_init()
-{
-	int stat;
-
-	/* Allocate soft state */
-	if ((stat = ddi_soft_state_init(&pcic_soft_state_p,
-	    SOFTC_SIZE, 2)) != DDI_SUCCESS)
-		return (stat);
-
-	if ((stat = mod_install(&modlinkage)) != 0)
-		ddi_soft_state_fini(&pcic_soft_state_p);
-
-	return (stat);
-}
-
-int
-_fini()
-{
-	int stat = 0;
-
-	if ((stat = mod_remove(&modlinkage)) != 0)
-		return (stat);
-
-	if (pcic_deb_threadid) {
-		mutex_enter(&pcic_deb_mtx);
-		pcic_deb_threadid = 0;
-		while (!pcic_deb_threadid)
-			cv_wait(&pcic_deb_cv, &pcic_deb_mtx);
-		pcic_deb_threadid = 0;
-		mutex_exit(&pcic_deb_mtx);
-
-		mutex_destroy(&pcic_deb_mtx);
-		cv_destroy(&pcic_deb_cv);
-	}
-
-	ddi_soft_state_fini(&pcic_soft_state_p);
-
-	return (stat);
-}
-
-int
-_info(struct modinfo *modinfop)
-{
-	return (mod_info(&modlinkage, modinfop));
-}
-
-/*
- * pcic_getinfo()
- *	provide instance/device information about driver
- */
-/*ARGSUSED*/
-static int
-pcic_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result)
-{
-	anp_t *anp;
-	int error = DDI_SUCCESS;
-	minor_t minor;
-
-	switch (cmd) {
-		case DDI_INFO_DEVT2DEVINFO:
-		minor = getminor((dev_t)arg);
-		minor &= 0x7f;
-		if (!(anp = ddi_get_soft_state(pcic_soft_state_p, minor)))
-			*result = NULL;
-		else
-			*result = anp->an_dip;
-		break;
-		case DDI_INFO_DEVT2INSTANCE:
-		minor = getminor((dev_t)arg);
-		minor &= 0x7f;
-		*result = (void *)((long)minor);
-		break;
-		default:
-		error = DDI_FAILURE;
-		break;
-	}
-	return (error);
-}
-
-static int
-pcic_probe(dev_info_t *dip)
-{
-	int value;
-	ddi_device_acc_attr_t attr;
-	ddi_acc_handle_t handle;
-	uchar_t *index, *data;
-
-	if (ddi_dev_is_sid(dip) == DDI_SUCCESS)
-		return (DDI_PROBE_DONTCARE);
-
-	/*
-	 * find a PCIC device (any vendor)
-	 * while there can be up to 4 such devices in
-	 * a system, we currently only look for 1
-	 * per probe.  There will be up to 2 chips per
-	 * instance since they share I/O space
-	 */
-	attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-	attr.devacc_attr_endian_flags = DDI_NEVERSWAP_ACC;
-	attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-	if (ddi_regs_map_setup(dip, PCIC_ISA_CONTROL_REG_NUM,
-	    (caddr_t *)&index,
-	    PCIC_ISA_CONTROL_REG_OFFSET,
-	    PCIC_ISA_CONTROL_REG_LENGTH,
-	    &attr, &handle) != DDI_SUCCESS)
-		return (DDI_PROBE_FAILURE);
-
-	data = index + 1;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "pcic_probe: entered\n");
-	if (pcic_debug)
-		cmn_err(CE_CONT, "\tindex=%p\n", (void *)index);
-#endif
-	ddi_put8(handle, index, PCIC_CHIP_REVISION);
-	ddi_put8(handle, data, 0);
-	value = ddi_get8(handle, data);
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "\tchip revision register = %x\n", value);
-#endif
-	if ((value & PCIC_REV_MASK) >= PCIC_REV_LEVEL_LOW &&
-	    (value & 0x30) == 0) {
-		/*
-		 * we probably have a PCIC chip in the system
-		 * do a little more checking.  If we find one,
-		 * reset everything in case of softboot
-		 */
-		ddi_put8(handle, index, PCIC_MAPPING_ENABLE);
-		ddi_put8(handle, data, 0);
-		value = ddi_get8(handle, data);
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_CONT, "\tzero test = %x\n", value);
-#endif
-		/* should read back as zero */
-		if (value == 0) {
-			/*
-			 * we do have one and it is off the bus
-			 */
-#if defined(PCIC_DEBUG)
-			if (pcic_debug)
-				cmn_err(CE_CONT, "pcic_probe: success\n");
-#endif
-			ddi_regs_map_free(&handle);
-			return (DDI_PROBE_SUCCESS);
-		}
-	}
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "pcic_probe: failed\n");
-#endif
-	ddi_regs_map_free(&handle);
-	return (DDI_PROBE_FAILURE);
-}
-
-/*
- * These are just defaults they can also be changed via a property in the
- * conf file.
- */
-static int pci_config_reg_num = PCIC_PCI_CONFIG_REG_NUM;
-static int pci_control_reg_num = PCIC_PCI_CONTROL_REG_NUM;
-static int pcic_do_pcmcia_sr = 1;
-static int pcic_use_cbpwrctl = PCF_CBPWRCTL;
-
-/*
- * enable insertion/removal interrupt for 32bit cards
- */
-static int
-cardbus_enable_cd_intr(dev_info_t *dip)
-{
-	ddi_acc_handle_t	iohandle;
-	caddr_t	ioaddr;
-	ddi_device_acc_attr_t attr;
-	attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-	attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-	attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-	(void) ddi_regs_map_setup(dip, 1,
-	    (caddr_t *)&ioaddr,
-	    0,
-	    4096,
-	    &attr, &iohandle);
-
-	/* CSC Interrupt: Card detect interrupt on */
-	ddi_put32(iohandle, (uint32_t *)(ioaddr+CB_STATUS_MASK),
-	    ddi_get32(iohandle,
-	    (uint32_t *)(ioaddr+CB_STATUS_MASK)) | CB_SE_CCDMASK);
-
-	ddi_put32(iohandle, (uint32_t *)(ioaddr+CB_STATUS_EVENT),
-	    ddi_get32(iohandle, (uint32_t *)(ioaddr+CB_STATUS_EVENT)));
-
-	ddi_regs_map_free(&iohandle);
-	return (1);
-}
-
-/*
- * quiesce(9E) entry point.
- *
- * This function is called when the system is single-threaded at high
- * PIL with preemption disabled. Therefore, this function must not be
- * blocked.
- *
- * This function returns DDI_SUCCESS on success, or DDI_FAILURE on failure.
- * DDI_FAILURE indicates an error condition and should almost never happen.
- */
-static int32_t
-pcic_quiesce(dev_info_t *dip)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int i;
-
-	for (i = 0; i < pcic->pc_numsockets; i++) {
-		pcic_putb(pcic, i, PCIC_MANAGEMENT_INT, 0);
-		pcic_putb(pcic, i, PCIC_CARD_DETECT, 0);
-		pcic_putb(pcic, i, PCIC_MAPPING_ENABLE, 0);
-		/* disable interrupts and put card into RESET */
-		pcic_putb(pcic, i, PCIC_INTERRUPT, 0);
-		/* poweroff socket */
-		pcic_putb(pcic, i, PCIC_POWER_CONTROL, 0);
-		pcic_putcb(pcic, CB_CONTROL, 0);
-	}
-
-	return (DDI_SUCCESS);
-}
-
-/*
- * pcic_attach()
- *	attach the PCIC (Intel 82365SL/CirrusLogic/Toshiba) driver
- *	to the system.  This is a child of "sysbus" since that is where
- *	the hardware lives, but it provides services to the "pcmcia"
- *	nexus driver.  It gives a pointer back via its private data
- *	structure which contains both the dip and socket services entry
- *	points
- */
-static int
-pcic_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
-{
-	anp_t *pcic_nexus;
-	pcicdev_t *pcic;
-	int irqlevel, value;
-	int pci_cfrn, pci_ctrn;
-	int i, j, smi, actual;
-	char *typename;
-	char bus_type[16] = "(unknown)";
-	int len = sizeof (bus_type);
-	ddi_device_acc_attr_t attr;
-	anp_t *anp = ddi_get_driver_private(dip);
-	uint_t	pri;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "pcic_attach: entered\n");
-	}
-#endif
-	switch (cmd) {
-	case DDI_ATTACH:
-		break;
-	case DDI_RESUME:
-		pcic = anp->an_private;
-		/*
-		 * for now, this is a simulated resume.
-		 * a real one may need different things.
-		 */
-		if (pcic != NULL && pcic->pc_flags & PCF_SUSPENDED) {
-			mutex_enter(&pcic->pc_lock);
-			/* should probe for new sockets showing up */
-			pcic_setup_adapter(pcic);
-			pcic->pc_flags &= ~PCF_SUSPENDED;
-			mutex_exit(&pcic->pc_lock);
-			(void) pcmcia_begin_resume(dip);
-
-			pcic_do_resume(pcic);
-#ifdef CARDBUS
-			cardbus_restore_children(ddi_get_child(dip));
-#endif
-
-			/*
-			 * for complete implementation need END_RESUME (later)
-			 */
-			return (DDI_SUCCESS);
-
-		}
-		return (DDI_SUCCESS);
-	default:
-		return (DDI_FAILURE);
-	}
-
-	/*
-	 * Allocate soft state associated with this instance.
-	 */
-	if (ddi_soft_state_zalloc(pcic_soft_state_p,
-	    ddi_get_instance(dip)) != DDI_SUCCESS) {
-		cmn_err(CE_CONT, "pcic%d: Unable to alloc state\n",
-		    ddi_get_instance(dip));
-		return (DDI_FAILURE);
-	}
-
-	pcic_nexus = ddi_get_soft_state(pcic_soft_state_p,
-	    ddi_get_instance(dip));
-
-	pcic = kmem_zalloc(sizeof (pcicdev_t), KM_SLEEP);
-
-	pcic->dip = dip;
-	pcic_nexus->an_dip = dip;
-	pcic_nexus->an_if = &pcic_if_ops;
-	pcic_nexus->an_private = pcic;
-	pcic->pc_numpower = sizeof (pcic_power)/sizeof (pcic_power[0]);
-	pcic->pc_power = pcic_power;
-
-	pci_ctrn = ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_CANSLEEP,
-	    "pci-control-reg-number", pci_control_reg_num);
-	pci_cfrn = ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_CANSLEEP,
-	    "pci-config-reg-number", pci_config_reg_num);
-
-	ddi_set_driver_private(dip, pcic_nexus);
-
-	/*
-	 * pcic->pc_irq is really the IPL level we want to run at
-	 * set the default values here and override from intr spec
-	 */
-	pcic->pc_irq = ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_CANSLEEP,
-	    "interrupt-priorities", -1);
-
-	if (pcic->pc_irq == -1) {
-		int			actual;
-		uint_t			pri;
-		ddi_intr_handle_t	hdl;
-
-		/* see if intrspec tells us different */
-		if (ddi_intr_alloc(dip, &hdl, DDI_INTR_TYPE_FIXED,
-		    0, 1, &actual, DDI_INTR_ALLOC_NORMAL) == DDI_SUCCESS) {
-			if (ddi_intr_get_pri(hdl, &pri) == DDI_SUCCESS)
-				pcic->pc_irq = pri;
-			else
-				pcic->pc_irq = LOCK_LEVEL + 1;
-			(void) ddi_intr_free(hdl);
-		}
-	}
-	pcic_nexus->an_ipl = pcic->pc_irq;
-
-	/*
-	 * Check our parent bus type. We do different things based on which
-	 * bus we're on.
-	 */
-	if (ddi_prop_op(DDI_DEV_T_ANY, ddi_get_parent(dip),
-	    PROP_LEN_AND_VAL_BUF, DDI_PROP_CANSLEEP,
-	    "device_type", (caddr_t)&bus_type[0], &len) !=
-	    DDI_PROP_SUCCESS) {
-		if (ddi_prop_op(DDI_DEV_T_ANY, ddi_get_parent(dip),
-		    PROP_LEN_AND_VAL_BUF, DDI_PROP_CANSLEEP,
-		    "bus-type", (caddr_t)&bus_type[0], &len) !=
-		    DDI_PROP_SUCCESS) {
-
-			cmn_err(CE_CONT,
-			    "pcic%d: can't find parent bus type\n",
-			    ddi_get_instance(dip));
-
-			kmem_free(pcic, sizeof (pcicdev_t));
-			ddi_soft_state_free(pcic_soft_state_p,
-			    ddi_get_instance(dip));
-			return (DDI_FAILURE);
-		}
-	} /* ddi_prop_op("device_type") */
-
-	if (strcmp(bus_type, DEVI_PCI_NEXNAME) == 0 ||
-	    strcmp(bus_type, DEVI_PCIEX_NEXNAME) == 0) {
-		pcic->pc_flags = PCF_PCIBUS;
-	} else {
-		cmn_err(CE_WARN, "!pcic%d: non-pci mode (%s) not supported, "
-		    "set BIOS to yenta mode if applicable\n",
-		    ddi_get_instance(dip), bus_type);
-		kmem_free(pcic, sizeof (pcicdev_t));
-		ddi_soft_state_free(pcic_soft_state_p,
-		    ddi_get_instance(dip));
-		return (DDI_FAILURE);
-	}
-
-	if ((pcic->bus_speed = ddi_getprop(DDI_DEV_T_ANY, ddi_get_parent(dip),
-	    DDI_PROP_CANSLEEP,
-	    "clock-frequency", 0)) == 0) {
-		if (pcic->pc_flags & PCF_PCIBUS)
-			pcic->bus_speed = PCIC_PCI_DEF_SYSCLK;
-		else
-			pcic->bus_speed = PCIC_ISA_DEF_SYSCLK;
-	} else {
-		/*
-		 * OBP can declare the speed in Hz...
-		 */
-		if (pcic->bus_speed > 1000000)
-			pcic->bus_speed /= 1000000;
-	} /* ddi_prop_op("clock-frequency") */
-
-	pcic->pc_io_type = PCIC_IO_TYPE_82365SL; /* default mode */
-
-#ifdef	PCIC_DEBUG
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic%d: parent bus type = [%s], speed = %d MHz\n",
-		    ddi_get_instance(dip),
-		    bus_type, pcic->bus_speed);
-	}
-#endif
-
-	/*
-	 * The reg properties on a PCI node are different than those
-	 *	on a non-PCI node. Handle that difference here.
-	 *	If it turns out to be a CardBus chip, we have even more
-	 *	differences.
-	 */
-	if (pcic->pc_flags & PCF_PCIBUS) {
-		int class_code;
-#if defined(__i386) || defined(__amd64)
-		pcic->pc_base = 0x1000000;
-		pcic->pc_bound = (uint32_t)~0;
-		pcic->pc_iobase = 0x1000;
-		pcic->pc_iobound = 0xefff;
-#elif defined(__sparc)
-		pcic->pc_base = 0x0;
-		pcic->pc_bound = (uint32_t)~0;
-		pcic->pc_iobase = 0x00000;
-		pcic->pc_iobound = 0xffff;
-#endif
-
-		/* usually need to get at config space so map first */
-		attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-		attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-		attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-		if (ddi_regs_map_setup(dip, pci_cfrn,
-		    (caddr_t *)&pcic->cfgaddr,
-		    PCIC_PCI_CONFIG_REG_OFFSET,
-		    PCIC_PCI_CONFIG_REG_LENGTH,
-		    &attr,
-		    &pcic->cfg_handle) !=
-		    DDI_SUCCESS) {
-			cmn_err(CE_CONT,
-			    "pcic%d: unable to map config space"
-			    "regs\n",
-			    ddi_get_instance(dip));
-
-			kmem_free(pcic, sizeof (pcicdev_t));
-			return (DDI_FAILURE);
-		} /* ddi_regs_map_setup */
-
-		class_code = ddi_getprop(DDI_DEV_T_ANY, dip,
-		    DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-		    "class-code", -1);
-#ifdef  PCIC_DEBUG
-		if (pcic_debug) {
-			cmn_err(CE_CONT, "pcic_attach class_code=%x\n",
-			    class_code);
-		}
-#endif
-
-		switch (class_code) {
-		case PCIC_PCI_CARDBUS:
-			pcic->pc_flags |= PCF_CARDBUS;
-			pcic->pc_io_type = PCIC_IO_TYPE_YENTA;
-			/*
-			 * Get access to the adapter registers on the
-			 * PCI bus.  A 4K memory page
-			 */
-#if defined(PCIC_DEBUG)
-			pcic_err(dip, 8, "Is Cardbus device\n");
-			if (pcic_debug) {
-				int nr;
-				long rs;
-				(void) ddi_dev_nregs(dip, &nr);
-				pcic_err(dip, 9, "\tdev, cfgaddr 0x%p,"
-				    "cfghndl 0x%p nregs %d",
-				    (void *)pcic->cfgaddr,
-				    (void *)pcic->cfg_handle, nr);
-
-				(void) ddi_dev_regsize(dip,
-				    PCIC_PCI_CONTROL_REG_NUM, &rs);
-
-				pcic_err(dip, 9, "\tsize of reg %d is 0x%x\n",
-				    PCIC_PCI_CONTROL_REG_NUM, (int)rs);
-			}
-#endif
-			attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-			attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-			attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-			if (ddi_regs_map_setup(dip, pci_ctrn,
-			    (caddr_t *)&pcic->ioaddr,
-			    PCIC_PCI_CONTROL_REG_OFFSET,
-			    PCIC_CB_CONTROL_REG_LENGTH,
-			    &attr, &pcic->handle) !=
-			    DDI_SUCCESS) {
-				cmn_err(CE_CONT,
-				    "pcic%d: unable to map PCI regs\n",
-				    ddi_get_instance(dip));
-				ddi_regs_map_free(&pcic->cfg_handle);
-				kmem_free(pcic, sizeof (pcicdev_t));
-				return (DDI_FAILURE);
-			} /* ddi_regs_map_setup */
-
-			/*
-			 * Find out the chip type - If we're on a PCI bus,
-			 *	the adapter has that information in the PCI
-			 *	config space.
-			 * Note that we call pcic_find_pci_type here since
-			 *	it needs a valid mapped pcic->handle to
-			 *	access some of the adapter registers in
-			 *	some cases.
-			 */
-			if (pcic_find_pci_type(pcic) != DDI_SUCCESS) {
-				ddi_regs_map_free(&pcic->handle);
-				ddi_regs_map_free(&pcic->cfg_handle);
-				kmem_free(pcic, sizeof (pcicdev_t));
-				cmn_err(CE_WARN, "pcic: %s: unsupported "
-				    "bridge\n", ddi_get_name_addr(dip));
-				return (DDI_FAILURE);
-			}
-			break;
-
-		default:
-		case PCIC_PCI_PCMCIA:
-			/*
-			 * Get access to the adapter IO registers on the
-			 * PCI bus config space.
-			 */
-			attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-			attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-			attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-			/*
-			 * We need a default mapping to the adapter's IO
-			 *	control register space. For most adapters
-			 *	that are of class PCIC_PCI_PCMCIA (or of
-			 *	a default class) the control registers
-			 *	will be using the 82365-type control/data
-			 *	format.
-			 */
-			if (ddi_regs_map_setup(dip, pci_ctrn,
-			    (caddr_t *)&pcic->ioaddr,
-			    PCIC_PCI_CONTROL_REG_OFFSET,
-			    PCIC_PCI_CONTROL_REG_LENGTH,
-			    &attr,
-			    &pcic->handle) != DDI_SUCCESS) {
-				cmn_err(CE_CONT,
-				    "pcic%d: unable to map PCI regs\n",
-				    ddi_get_instance(dip));
-				ddi_regs_map_free(&pcic->cfg_handle);
-				kmem_free(pcic, sizeof (pcicdev_t));
-				return (DDI_FAILURE);
-			} /* ddi_regs_map_setup */
-
-			/*
-			 * Find out the chip type - If we're on a PCI bus,
-			 *	the adapter has that information in the PCI
-			 *	config space.
-			 * Note that we call pcic_find_pci_type here since
-			 *	it needs a valid mapped pcic->handle to
-			 *	access some of the adapter registers in
-			 *	some cases.
-			 */
-			if (pcic_find_pci_type(pcic) != DDI_SUCCESS) {
-				ddi_regs_map_free(&pcic->handle);
-				ddi_regs_map_free(&pcic->cfg_handle);
-				kmem_free(pcic, sizeof (pcicdev_t));
-				cmn_err(CE_WARN, "pcic: %s: unsupported "
-				    "bridge\n",
-				    ddi_get_name_addr(dip));
-				return (DDI_FAILURE);
-			}
-
-			/*
-			 * Some PCI-PCMCIA(R2) adapters are Yenta-compliant
-			 *	for extended registers even though they are
-			 *	not CardBus adapters. For those adapters,
-			 *	re-map pcic->handle to be large enough to
-			 *	encompass the Yenta registers.
-			 */
-			switch (pcic->pc_type) {
-				case PCIC_TI_PCI1031:
-				ddi_regs_map_free(&pcic->handle);
-
-				if (ddi_regs_map_setup(dip,
-				    PCIC_PCI_CONTROL_REG_NUM,
-				    (caddr_t *)&pcic->ioaddr,
-				    PCIC_PCI_CONTROL_REG_OFFSET,
-				    PCIC_CB_CONTROL_REG_LENGTH,
-				    &attr,
-				    &pcic->handle) != DDI_SUCCESS) {
-					cmn_err(CE_CONT,
-					    "pcic%d: unable to map "
-					"PCI regs\n",
-					    ddi_get_instance(dip));
-					ddi_regs_map_free(&pcic->cfg_handle);
-					kmem_free(pcic, sizeof (pcicdev_t));
-					return (DDI_FAILURE);
-				} /* ddi_regs_map_setup */
-				break;
-				default:
-				break;
-			} /* switch (pcic->pc_type) */
-			break;
-		} /* switch (class_code) */
-	} else {
-		/*
-		 * We're not on a PCI bus, so assume an ISA bus type
-		 * register property. Get access to the adapter IO
-		 * registers on a non-PCI bus.
-		 */
-		attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-		attr.devacc_attr_endian_flags = DDI_NEVERSWAP_ACC;
-		attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-		pcic->mem_reg_num = PCIC_ISA_MEM_REG_NUM;
-		pcic->io_reg_num = PCIC_ISA_IO_REG_NUM;
-
-		if (ddi_regs_map_setup(dip, PCIC_ISA_CONTROL_REG_NUM,
-		    (caddr_t *)&pcic->ioaddr,
-		    PCIC_ISA_CONTROL_REG_OFFSET,
-		    PCIC_ISA_CONTROL_REG_LENGTH,
-		    &attr,
-		    &pcic->handle) != DDI_SUCCESS) {
-			cmn_err(CE_CONT,
-			    "pcic%d: unable to map ISA registers\n",
-			    ddi_get_instance(dip));
-
-			kmem_free(pcic, sizeof (pcicdev_t));
-			return (DDI_FAILURE);
-		} /* ddi_regs_map_setup */
-
-		/* ISA bus is limited to 24-bits, but not first 640K */
-		pcic->pc_base = 0xd0000;
-		pcic->pc_bound = (uint32_t)~0;
-		pcic->pc_iobase = 0x1000;
-		pcic->pc_iobound = 0xefff;
-	} /* !PCF_PCIBUS */
-
-#ifdef  PCIC_DEBUG
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "pcic_attach pc_flags=%x pc_type=%x\n",
-		    pcic->pc_flags, pcic->pc_type);
-	}
-#endif
-
-	/*
-	 * Setup various adapter registers for the PCI case. For the
-	 * non-PCI case, find out the chip type.
-	 */
-	if (pcic->pc_flags & PCF_PCIBUS) {
-		int iline;
-#if defined(__sparc)
-		iline = 0;
-#else
-		iline = cardbus_validate_iline(dip, pcic->cfg_handle);
-#endif
-
-		/* set flags and socket counts based on chip type */
-		switch (pcic->pc_type) {
-			uint32_t cfg;
-		case PCIC_INTEL_i82092:
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_82092_PCICON);
-			/* we can only support 4 Socket version */
-			if (cfg & PCIC_82092_4_SOCKETS) {
-				pcic->pc_numsockets = 4;
-				pcic->pc_type = PCIC_INTEL_i82092;
-				if (iline != 0xFF)
-					pcic->pc_intr_mode =
-					    PCIC_INTR_MODE_PCI_1;
-				else
-					pcic->pc_intr_mode = PCIC_INTR_MODE_ISA;
-			} else {
-				cmn_err(CE_CONT,
-				    "pcic%d: Intel 82092 adapter "
-				    "in unsupported configuration: 0x%x",
-				    ddi_get_instance(pcic->dip), cfg);
-				pcic->pc_numsockets = 0;
-			} /* PCIC_82092_4_SOCKETS */
-			break;
-		case PCIC_CL_PD6730:
-		case PCIC_CL_PD6729:
-			pcic->pc_intr_mode = PCIC_INTR_MODE_PCI_1;
-			cfg = ddi_getprop(DDI_DEV_T_ANY, dip,
-			    DDI_PROP_CANSLEEP,
-			    "interrupts", 0);
-			/* if not interrupt pin then must use ISA style IRQs */
-			if (cfg == 0 || iline == 0xFF)
-				pcic->pc_intr_mode = PCIC_INTR_MODE_ISA;
-			else {
-				/*
-				 * we have the option to use PCI interrupts.
-				 * this might not be optimal but in some cases
-				 * is the only thing possible (sparc case).
-				 * we now deterine what is possible.
-				 */
-				pcic->pc_intr_mode = PCIC_INTR_MODE_PCI_1;
-			}
-			pcic->pc_numsockets = 2;
-			pcic->pc_flags |= PCF_IO_REMAP;
-			break;
-		case PCIC_TI_PCI1031:
-			/* this chip doesn't do CardBus but looks like one */
-			pcic->pc_flags &= ~PCF_CARDBUS;
-			/* FALLTHROUGH */
-		default:
-			pcic->pc_flags |= PCF_IO_REMAP;
-			/* FALLTHROUGH */
-			/* indicate feature even if not supported */
-			pcic->pc_flags |= PCF_DMA | PCF_ZV;
-			/* Not sure if these apply to all these chips */
-			pcic->pc_flags |= (PCF_VPPX|PCF_33VCAP);
-			pcic->pc_flags |= pcic_use_cbpwrctl;
-
-			pcic->pc_numsockets = 1; /* one per function */
-			if (iline != 0xFF) {
-				uint8_t cfg;
-				pcic->pc_intr_mode = PCIC_INTR_MODE_PCI_1;
-
-				cfg = ddi_get8(pcic->cfg_handle,
-				    (pcic->cfgaddr + PCIC_BRIDGE_CTL_REG));
-				cfg &= (~PCIC_FUN_INT_MOD_ISA);
-				ddi_put8(pcic->cfg_handle, (pcic->cfgaddr +
-				    PCIC_BRIDGE_CTL_REG), cfg);
-			}
-			else
-				pcic->pc_intr_mode = PCIC_INTR_MODE_ISA;
-			pcic->pc_io_type = PCIC_IOTYPE_YENTA;
-			break;
-		}
-	} else {
-		/*
-		 * We're not on a PCI bus so do some more
-		 *	checking for adapter type here.
-		 * For the non-PCI bus case:
-		 * It could be any one of a number of different chips
-		 * If we can't determine anything else, it is assumed
-		 * to be an Intel 82365SL.  The Cirrus Logic PD6710
-		 * has an extension register that provides unique
-		 * identification. Toshiba chip isn't detailed as yet.
-		 */
-
-		/* Init the CL id mode */
-		pcic_putb(pcic, 0, PCIC_CHIP_INFO, 0);
-		value = pcic_getb(pcic, 0, PCIC_CHIP_INFO);
-
-		/* default to Intel i82365SL and then refine */
-		pcic->pc_type = PCIC_I82365SL;
-		pcic->pc_chipname = PCIC_TYPE_I82365SL;
-		for (value = 0; pcic_ci_funcs[value] != NULL; value++) {
-			/* go until one succeeds or none left */
-			if (pcic_ci_funcs[value](pcic))
-				break;
-		}
-
-		/* any chip specific flags get set here */
-		switch (pcic->pc_type) {
-		case PCIC_CL_PD6722:
-			pcic->pc_flags |= PCF_DMA;
-		}
-
-		for (i = 0; i < PCIC_MAX_SOCKETS; i++) {
-			/*
-			 * look for total number of sockets.
-			 * basically check each possible socket for
-			 * presence like in probe
-			 */
-
-			/* turn all windows off */
-			pcic_putb(pcic, i, PCIC_MAPPING_ENABLE, 0);
-			value = pcic_getb(pcic, i, PCIC_MAPPING_ENABLE);
-
-			/*
-			 * if a zero is read back, then this socket
-			 * might be present. It would be except for
-			 * some systems that map the secondary PCIC
-			 * chip space back to the first.
-			 */
-			if (value != 0) {
-				/* definitely not so skip */
-				/* note: this is for Compaq support */
-				continue;
-			}
-
-			/* further tests */
-			value = pcic_getb(pcic, i, PCIC_CHIP_REVISION) &
-			    PCIC_REV_MASK;
-			if (!(value >= PCIC_REV_LEVEL_LOW &&
-			    value <= PCIC_REV_LEVEL_HI))
-				break;
-
-			pcic_putb(pcic, i, PCIC_SYSMEM_0_STARTLOW, 0xaa);
-			pcic_putb(pcic, i, PCIC_SYSMEM_1_STARTLOW, 0x55);
-			value = pcic_getb(pcic, i, PCIC_SYSMEM_0_STARTLOW);
-
-			j = pcic_getb(pcic, i, PCIC_SYSMEM_1_STARTLOW);
-			if (value != 0xaa || j != 0x55)
-				break;
-
-			/*
-			 * at this point we know if we have hardware
-			 * of some type and not just the bus holding
-			 * a pattern for us. We still have to determine
-			 * the case where more than 2 sockets are
-			 * really the same due to peculiar mappings of
-			 * hardware.
-			 */
-			j = pcic->pc_numsockets++;
-			pcic->pc_sockets[j].pcs_flags = 0;
-			pcic->pc_sockets[j].pcs_io = pcic->ioaddr;
-			pcic->pc_sockets[j].pcs_socket = i;
-
-			/* put PC Card into RESET, just in case */
-			value = pcic_getb(pcic, i, PCIC_INTERRUPT);
-			pcic_putb(pcic, i, PCIC_INTERRUPT,
-			    value & ~PCIC_RESET);
-		}
-
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_CONT, "num sockets = %d\n",
-			    pcic->pc_numsockets);
-#endif
-		if (pcic->pc_numsockets == 0) {
-			ddi_regs_map_free(&pcic->handle);
-			kmem_free(pcic, sizeof (pcicdev_t));
-			return (DDI_FAILURE);
-		}
-
-		/*
-		 * need to think this through again in light of
-		 * Compaq not following the model that all the
-		 * chip vendors recommend.  IBM 755 seems to be
-		 * afflicted as well.  Basically, if the vendor
-		 * wired things wrong, socket 0 responds for socket 2
-		 * accesses, etc.
-		 */
-		if (pcic->pc_numsockets > 2) {
-			int count = pcic->pc_numsockets / 4;
-			for (i = 0; i < count; i++) {
-				/* put pattern into socket 0 */
-				pcic_putb(pcic, i,
-				    PCIC_SYSMEM_0_STARTLOW, 0x11);
-
-				/* put pattern into socket 2 */
-				pcic_putb(pcic, i + 2,
-				    PCIC_SYSMEM_0_STARTLOW, 0x33);
-
-				/* read back socket 0 */
-				value = pcic_getb(pcic, i,
-				    PCIC_SYSMEM_0_STARTLOW);
-
-				/* read back chip 1 socket 0 */
-				j = pcic_getb(pcic, i + 2,
-				    PCIC_SYSMEM_0_STARTLOW);
-				if (j == value) {
-					pcic->pc_numsockets -= 2;
-				}
-			}
-		}
-
-		smi = 0xff;	/* no more override */
-
-		if (ddi_getprop(DDI_DEV_T_NONE, dip,
-		    DDI_PROP_DONTPASS, "need-mult-irq",
-		    0xffff) != 0xffff)
-			pcic->pc_flags |= PCF_MULT_IRQ;
-
-	} /* !PCF_PCIBUS */
-
-	/*
-	 * some platforms/busses need to have resources setup
-	 * this is temporary until a real resource allocator is
-	 * implemented.
-	 */
-
-	pcic_init_assigned(dip);
-
-	typename = pcic->pc_chipname;
-
-#ifdef	PCIC_DEBUG
-	if (pcic_debug) {
-		int nregs, nintrs;
-
-		if (ddi_dev_nregs(dip, &nregs) != DDI_SUCCESS)
-			nregs = 0;
-
-		if (ddi_dev_nintrs(dip, &nintrs) != DDI_SUCCESS)
-			nintrs = 0;
-
-		cmn_err(CE_CONT,
-		    "pcic%d: %d register sets, %d interrupts\n",
-		    ddi_get_instance(dip), nregs, nintrs);
-
-		nintrs = 0;
-		while (nregs--) {
-			off_t size;
-
-			if (ddi_dev_regsize(dip, nintrs, &size) ==
-			    DDI_SUCCESS) {
-				cmn_err(CE_CONT,
-				    "\tregnum %d size %ld (0x%lx)"
-				    "bytes",
-				    nintrs, size, size);
-				if (nintrs ==
-				    (pcic->pc_io_type == PCIC_IO_TYPE_82365SL ?
-				    PCIC_ISA_CONTROL_REG_NUM :
-				    PCIC_PCI_CONTROL_REG_NUM))
-					cmn_err(CE_CONT,
-					    " mapped at: 0x%p\n",
-					    (void *)pcic->ioaddr);
-				else
-					cmn_err(CE_CONT, "\n");
-			} else {
-				cmn_err(CE_CONT,
-				    "\tddi_dev_regsize(rnumber"
-				    "= %d) returns DDI_FAILURE\n",
-				    nintrs);
-			}
-			nintrs++;
-		} /* while */
-	} /* if (pcic_debug) */
-#endif
-
-	cv_init(&pcic->pm_cv, NULL, CV_DRIVER, NULL);
-
-	if (!ddi_getprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "disable-audio", 0))
-		pcic->pc_flags |= PCF_AUDIO;
-
-	if (ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_CANSLEEP,
-	    "disable-cardbus", 0))
-		pcic->pc_flags &= ~PCF_CARDBUS;
-
-	(void) ddi_prop_update_string(DDI_DEV_T_NONE, dip, PCICPROP_CTL,
-	    typename);
-
-	/*
-	 * Init all socket SMI levels to 0 (no SMI)
-	 */
-	for (i = 0; i < PCIC_MAX_SOCKETS; i++) {
-		pcic->pc_sockets[i].pcs_smi = 0;
-		pcic->pc_sockets[i].pcs_debounce_id = 0;
-		pcic->pc_sockets[i].pcs_pcic = pcic;
-	}
-	pcic->pc_lastreg = -1; /* just to make sure we are in sync */
-
-	/*
-	 * Setup the IRQ handler(s)
-	 */
-	switch (pcic->pc_intr_mode) {
-		int xx;
-	case PCIC_INTR_MODE_ISA:
-	/*
-	 * On a non-PCI bus, we just use whatever SMI IRQ level was
-	 *	specified above, and the IO IRQ levels are allocated
-	 *	dynamically.
-	 */
-		for (xx = 15, smi = 0; xx >= 0; xx--) {
-			if (PCIC_IRQ(xx) &
-			    PCIC_AVAIL_IRQS) {
-				smi = pcmcia_get_intr(dip, xx);
-				if (smi >= 0)
-					break;
-			}
-		}
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_NOTE, "\tselected IRQ %d as SMI\n", smi);
-#endif
-		/* init to same so share is easy */
-		for (i = 0; i < pcic->pc_numsockets; i++)
-			pcic->pc_sockets[i].pcs_smi = smi;
-		/* any special handling of IRQ levels */
-		if (pcic->pc_flags & PCF_MULT_IRQ) {
-			for (i = 2; i < pcic->pc_numsockets; i++) {
-				if ((i & 1) == 0) {
-					int xx;
-					for (xx = 15, smi = 0; xx >= 0; xx--) {
-						if (PCIC_IRQ(xx) &
-						    PCIC_AVAIL_IRQS) {
-							smi =
-							    pcmcia_get_intr(dip,
-							    xx);
-							if (smi >= 0)
-								break;
-						}
-					}
-				}
-				if (smi >= 0)
-					pcic->pc_sockets[i].pcs_smi = smi;
-			}
-		}
-		pcic->pc_intr_htblp = kmem_alloc(pcic->pc_numsockets *
-		    sizeof (ddi_intr_handle_t), KM_SLEEP);
-		for (i = 0, irqlevel = -1; i < pcic->pc_numsockets; i++) {
-			struct intrspec *ispecp;
-			struct ddi_parent_private_data *pdp;
-
-			if (irqlevel == pcic->pc_sockets[i].pcs_smi)
-				continue;
-			else {
-				irqlevel = pcic->pc_sockets[i].pcs_smi;
-			}
-			/*
-			 * now convert the allocated IRQ into an intrspec
-			 * and ask our parent to add it.  Don't use
-			 * the ddi_add_intr since we don't have a
-			 * default intrspec in all cases.
-			 *
-			 * note: this sort of violates DDI but we don't
-			 *	 get hardware intrspecs for many of the devices.
-			 *	 at the same time, we know how to allocate them
-			 *	 so we do the right thing.
-			 */
-			if (ddi_intr_alloc(dip, &pcic->pc_intr_htblp[i],
-			    DDI_INTR_TYPE_FIXED, 0, 1, &actual,
-			    DDI_INTR_ALLOC_NORMAL) != DDI_SUCCESS) {
-				cmn_err(CE_WARN, "%s: ddi_intr_alloc failed",
-				    ddi_get_name(dip));
-				goto isa_exit1;
-			}
-
-			/*
-			 * See earlier note:
-			 * Since some devices don't have 'intrspec'
-			 * we make one up in rootnex.
-			 *
-			 * However, it is not properly initialized as
-			 * the data it needs is present in this driver
-			 * and there is no interface to pass that up.
-			 * Specially 'irqlevel' is very important and
-			 * it is part of pcic struct.
-			 *
-			 * Set 'intrspec' up here; otherwise adding the
-			 * interrupt will fail.
-			 */
-			pdp = ddi_get_parent_data(dip);
-			ispecp = (struct intrspec *)&pdp->par_intr[0];
-			ispecp->intrspec_vec = irqlevel;
-			ispecp->intrspec_pri = pcic->pc_irq;
-
-			/* Stay compatible w/ PCMCIA */
-			pcic->pc_pri = (ddi_iblock_cookie_t)
-			    (uintptr_t)pcic->pc_irq;
-			pcic->pc_dcookie.idev_priority =
-			    (uintptr_t)pcic->pc_pri;
-			pcic->pc_dcookie.idev_vector = (ushort_t)irqlevel;
-
-			(void) ddi_intr_set_pri(pcic->pc_intr_htblp[i],
-			    pcic->pc_irq);
-
-			if (i == 0) {
-				mutex_init(&pcic->intr_lock, NULL, MUTEX_DRIVER,
-				    DDI_INTR_PRI(pcic->pc_irq));
-				mutex_init(&pcic->pc_lock, NULL, MUTEX_DRIVER,
-				    NULL);
-			}
-
-			if (ddi_intr_add_handler(pcic->pc_intr_htblp[i],
-			    pcic_intr, (caddr_t)pcic, NULL)) {
-				cmn_err(CE_WARN,
-				    "%s: ddi_intr_add_handler failed",
-				    ddi_get_name(dip));
-				goto isa_exit2;
-			}
-
-			if (ddi_intr_enable(pcic->pc_intr_htblp[i])) {
-				cmn_err(CE_WARN, "%s: ddi_intr_enable failed",
-				    ddi_get_name(dip));
-				for (j = i; j < 0; j--)
-					(void) ddi_intr_remove_handler(
-					    pcic->pc_intr_htblp[j]);
-				goto isa_exit2;
-			}
-		}
-		break;
-	case PCIC_INTR_MODE_PCI_1:
-	case PCIC_INTR_MODE_PCI:
-		/*
-		 * If we're on a PCI bus, we route all interrupts, both SMI
-		 * and IO interrupts, through a single interrupt line.
-		 * Assign the SMI IRQ level to the IO IRQ level here.
-		 */
-		pcic->pc_pci_intr_hdlp = kmem_alloc(sizeof (ddi_intr_handle_t),
-		    KM_SLEEP);
-		if (ddi_intr_alloc(dip, pcic->pc_pci_intr_hdlp,
-		    DDI_INTR_TYPE_FIXED, 0, 1, &actual,
-		    DDI_INTR_ALLOC_NORMAL) != DDI_SUCCESS)
-			goto pci_exit1;
-
-		if (ddi_intr_get_pri(pcic->pc_pci_intr_hdlp[0],
-		    &pri) != DDI_SUCCESS) {
-			(void) ddi_intr_free(pcic->pc_pci_intr_hdlp[0]);
-			goto pci_exit1;
-		}
-
-		pcic->pc_pri = (void *)(uintptr_t)pri;
-		mutex_init(&pcic->intr_lock, NULL, MUTEX_DRIVER, pcic->pc_pri);
-		mutex_init(&pcic->pc_lock, NULL, MUTEX_DRIVER, NULL);
-
-		if (ddi_intr_add_handler(pcic->pc_pci_intr_hdlp[0],
-		    pcic_intr, (caddr_t)pcic, NULL))
-			goto pci_exit2;
-
-		if (ddi_intr_enable(pcic->pc_pci_intr_hdlp[0])) {
-			(void) ddi_intr_remove_handler(
-			    pcic->pc_pci_intr_hdlp[0]);
-			goto pci_exit2;
-		}
-
-		/* Stay compatible w/ PCMCIA */
-		pcic->pc_dcookie.idev_priority = (ushort_t)pri;
-
-		/* init to same (PCI) so share is easy */
-		for (i = 0; i < pcic->pc_numsockets; i++)
-			pcic->pc_sockets[i].pcs_smi = 0xF; /* any valid */
-		break;
-	}
-
-	/*
-	 * Setup the adapter hardware to some reasonable defaults.
-	 */
-	mutex_enter(&pcic->pc_lock);
-	/* mark the driver state as attached */
-	pcic->pc_flags |= PCF_ATTACHED;
-	pcic_setup_adapter(pcic);
-
-	for (j = 0; j < pcic->pc_numsockets; j++)
-		if (ddi_intr_add_softint(dip,
-		    &pcic->pc_sockets[j].pcs_cd_softint_hdl,
-		    PCIC_SOFTINT_PRI_VAL, pcic_cd_softint,
-		    (caddr_t)&pcic->pc_sockets[j]) != DDI_SUCCESS)
-			goto pci_exit2;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "type = %s sockets = %d\n", typename,
-		    pcic->pc_numsockets);
-#endif
-
-	pcic_nexus->an_iblock = &pcic->pc_pri;
-	pcic_nexus->an_idev = &pcic->pc_dcookie;
-
-	mutex_exit(&pcic->pc_lock);
-
-#ifdef CARDBUS
-	(void) cardbus_enable_cd_intr(dip);
-	if (pcic_debug) {
-
-		cardbus_dump_pci_config(dip);
-		cardbus_dump_socket(dip);
-	}
-
-	/*
-	 * Give the Cardbus misc module a chance to do it's per-adapter
-	 * instance setup. Note that there is no corresponding detach()
-	 * call.
-	 */
-	if (pcic->pc_flags & PCF_CARDBUS)
-		if (cardbus_attach(dip, &pcic_cbnexus_ops) != DDI_SUCCESS) {
-			cmn_err(CE_CONT,
-			    "pcic_attach: cardbus_attach failed\n");
-			goto pci_exit2;
-		}
-#endif
-
-	/*
-	 * Give the PCMCIA misc module a chance to do it's per-adapter
-	 *	instance setup.
-	 */
-	if ((i = pcmcia_attach(dip, pcic_nexus)) != DDI_SUCCESS)
-		goto pci_exit2;
-
-	if (pcic_maxinst == -1) {
-		/* This assumes that all instances run at the same IPL. */
-		mutex_init(&pcic_deb_mtx, NULL, MUTEX_DRIVER, NULL);
-		cv_init(&pcic_deb_cv, NULL, CV_DRIVER, NULL);
-		pcic_deb_threadid = thread_create((caddr_t)NULL, 0,
-		    pcic_deb_thread, (caddr_t)NULL, 0, &p0, TS_RUN,
-		    v.v_maxsyspri - 2);
-	}
-	pcic_maxinst = max(pcic_maxinst, ddi_get_instance(dip));
-	/*
-	 * Setup a debounce timeout to do an initial card detect
-	 * and enable interrupts.
-	 */
-	for (j = 0; j < pcic->pc_numsockets; j++) {
-		pcic->pc_sockets[j].pcs_debounce_id =
-		    pcic_add_debqueue(&pcic->pc_sockets[j],
-		    drv_usectohz(pcic_debounce_time));
-	}
-
-	return (i);
-
-isa_exit2:
-	mutex_destroy(&pcic->intr_lock);
-	mutex_destroy(&pcic->pc_lock);
-	for (j = i; j < 0; j--)
-		(void) ddi_intr_free(pcic->pc_intr_htblp[j]);
-isa_exit1:
-	(void) pcmcia_return_intr(dip, pcic->pc_sockets[i].pcs_smi);
-	ddi_regs_map_free(&pcic->handle);
-	if (pcic->pc_flags & PCF_PCIBUS)
-		ddi_regs_map_free(&pcic->cfg_handle);
-	kmem_free(pcic->pc_intr_htblp, pcic->pc_numsockets *
-	    sizeof (ddi_intr_handle_t));
-	kmem_free(pcic, sizeof (pcicdev_t));
-		return (DDI_FAILURE);
-
-pci_exit2:
-	mutex_destroy(&pcic->intr_lock);
-	mutex_destroy(&pcic->pc_lock);
-	(void) ddi_intr_free(pcic->pc_pci_intr_hdlp[0]);
-pci_exit1:
-	ddi_regs_map_free(&pcic->handle);
-	if (pcic->pc_flags & PCF_PCIBUS)
-		ddi_regs_map_free(&pcic->cfg_handle);
-	kmem_free(pcic->pc_pci_intr_hdlp, sizeof (ddi_intr_handle_t));
-	kmem_free(pcic, sizeof (pcicdev_t));
-	return (DDI_FAILURE);
-}
-
-/*
- * pcic_detach()
- *	request to detach from the system
- */
-static int
-pcic_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int i;
-
-	switch (cmd) {
-	case DDI_DETACH:
-		/* don't detach if the nexus still talks to us */
-		if (pcic->pc_callback != NULL)
-			return (DDI_FAILURE);
-
-		/* kill off the pm simulation */
-		if (pcic->pc_pmtimer)
-			(void) untimeout(pcic->pc_pmtimer);
-
-		/* turn everything off for all sockets and chips */
-		for (i = 0; i < pcic->pc_numsockets; i++) {
-			if (pcic->pc_sockets[i].pcs_debounce_id)
-				pcic_rm_debqueue(
-				    pcic->pc_sockets[i].pcs_debounce_id);
-			pcic->pc_sockets[i].pcs_debounce_id = 0;
-
-			pcic_putb(pcic, i, PCIC_MANAGEMENT_INT, 0);
-			pcic_putb(pcic, i, PCIC_CARD_DETECT, 0);
-			pcic_putb(pcic, i, PCIC_MAPPING_ENABLE, 0);
-			/* disable interrupts and put card into RESET */
-			pcic_putb(pcic, i, PCIC_INTERRUPT, 0);
-		}
-		(void) ddi_intr_disable(pcic->pc_pci_intr_hdlp[0]);
-		(void) ddi_intr_remove_handler(pcic->pc_pci_intr_hdlp[0]);
-		(void) ddi_intr_free(pcic->pc_pci_intr_hdlp[0]);
-		kmem_free(pcic->pc_pci_intr_hdlp, sizeof (ddi_intr_handle_t));
-		pcic->pc_flags = 0;
-		mutex_destroy(&pcic->pc_lock);
-		mutex_destroy(&pcic->intr_lock);
-		cv_destroy(&pcic->pm_cv);
-		if (pcic->pc_flags & PCF_PCIBUS)
-			ddi_regs_map_free(&pcic->cfg_handle);
-		if (pcic->handle)
-			ddi_regs_map_free(&pcic->handle);
-		kmem_free(pcic, sizeof (pcicdev_t));
-		ddi_soft_state_free(pcic_soft_state_p, ddi_get_instance(dip));
-		return (DDI_SUCCESS);
-
-	case DDI_SUSPEND:
-	case DDI_PM_SUSPEND:
-		/*
-		 * we got a suspend event (either real or imagined)
-		 * so notify the nexus proper that all existing cards
-		 * should go away.
-		 */
-		mutex_enter(&pcic->pc_lock);
-#ifdef CARDBUS
-		if (pcic->pc_flags & PCF_CARDBUS) {
-			for (i = 0; i < pcic->pc_numsockets; i++) {
-				if ((pcic->pc_sockets[i].pcs_flags &
-				    (PCS_CARD_PRESENT|PCS_CARD_ISCARDBUS)) ==
-				    (PCS_CARD_PRESENT|PCS_CARD_ISCARDBUS)) {
-
-					pcmcia_cb_suspended(
-					    pcic->pc_sockets[i].pcs_socket);
-				}
-			}
-
-			cardbus_save_children(ddi_get_child(dip));
-		}
-#endif
-		/* turn everything off for all sockets and chips */
-		for (i = 0; i < pcic->pc_numsockets; i++) {
-			if (pcic->pc_sockets[i].pcs_debounce_id)
-				pcic_rm_debqueue(
-				    pcic->pc_sockets[i].pcs_debounce_id);
-			pcic->pc_sockets[i].pcs_debounce_id = 0;
-
-			pcic_putb(pcic, i, PCIC_MANAGEMENT_INT, 0);
-			pcic_putb(pcic, i, PCIC_CARD_DETECT, 0);
-			pcic_putb(pcic, i, PCIC_MAPPING_ENABLE, 0);
-			/* disable interrupts and put card into RESET */
-			pcic_putb(pcic, i, PCIC_INTERRUPT, 0);
-			pcic_putb(pcic, i, PCIC_POWER_CONTROL, 0);
-			if (pcic->pc_flags & PCF_CBPWRCTL)
-				pcic_putcb(pcic, CB_CONTROL, 0);
-
-			if (pcic->pc_sockets[i].pcs_flags & PCS_CARD_PRESENT) {
-				pcic->pc_sockets[i].pcs_flags = PCS_STARTING;
-				/*
-				 * Because we are half way through a save
-				 * all this does is schedule a removal event
-				 * to cs for when the system comes back.
-				 * This doesn't actually matter.
-				 */
-				if (!pcic_do_pcmcia_sr && pcic_do_removal &&
-				    pcic->pc_callback) {
-					PC_CALLBACK(pcic->dip, pcic->pc_cb_arg,
-					    PCE_CARD_REMOVAL,
-					    pcic->pc_sockets[i].pcs_socket);
-				}
-			}
-		}
-
-		pcic->pc_flags |= PCF_SUSPENDED;
-		mutex_exit(&pcic->pc_lock);
-
-		/*
-		 * when true power management exists, save the adapter
-		 * state here to enable a recovery.  For the emulation
-		 * condition, the state is gone
-		 */
-		return (DDI_SUCCESS);
-
-	default:
-		return (EINVAL);
-	}
-}
-
-static uint32_t pcic_tisysctl_onbits = ((1<<27) | (1<<15) | (1<<14));
-static uint32_t pcic_tisysctl_offbits = 0;
-static uint32_t pcic_default_latency = 0x40;
-
-static void
-pcic_setup_adapter(pcicdev_t *pcic)
-{
-	int i;
-	int value, flags;
-
-#if defined(__i386) || defined(__amd64)
-	pci_regspec_t *reg;
-	uchar_t bus, dev, func;
-	uint_t classcode;
-	int length;
-#endif
-
-	if (pcic->pc_flags & PCF_PCIBUS) {
-		/*
-		 * all PCI-to-PCMCIA bus bridges need memory and I/O enabled
-		 */
-		flags = (PCIC_ENABLE_IO | PCIC_ENABLE_MEM);
-		pcic_iomem_pci_ctl(pcic->cfg_handle, pcic->cfgaddr, flags);
-	}
-	/* enable each socket */
-	for (i = 0; i < pcic->pc_numsockets; i++) {
-		pcic->pc_sockets[i].pcs_flags = 0;
-		/* find out the socket capabilities (I/O vs memory) */
-		value = pcic_getb(pcic, i,
-		    PCIC_CHIP_REVISION) & PCIC_REV_ID_MASK;
-		if (value == PCIC_REV_ID_IO || value == PCIC_REV_ID_BOTH)
-			pcic->pc_sockets[i].pcs_flags |= PCS_SOCKET_IO;
-
-		/* disable all windows just in case */
-		pcic_putb(pcic, i, PCIC_MAPPING_ENABLE, 0);
-
-		switch (pcic->pc_type) {
-			uint32_t cfg32;
-			uint16_t cfg16;
-			uint8_t cfg;
-
-		    /* enable extended registers for Vadem */
-			case PCIC_VADEM_VG469:
-			case PCIC_VADEM:
-
-			/* enable card status change interrupt for socket */
-			break;
-
-			case PCIC_I82365SL:
-			break;
-
-			case PCIC_CL_PD6710:
-			pcic_putb(pcic, 0, PCIC_MISC_CTL_2, PCIC_LED_ENABLE);
-			break;
-
-			/*
-			 * On the CL_6730, we need to set up the interrupt
-			 * signalling mode (PCI mode) and set the SMI and
-			 * IRQ interrupt lines to PCI/level-mode.
-			 */
-			case PCIC_CL_PD6730:
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_PCI_1:
-				clext_reg_write(pcic, i, PCIC_CLEXT_MISC_CTL_3,
-				    ((clext_reg_read(pcic, i,
-				    PCIC_CLEXT_MISC_CTL_3) &
-				    ~PCIC_CLEXT_INT_PCI) |
-				    PCIC_CLEXT_INT_PCI));
-				clext_reg_write(pcic, i, PCIC_CLEXT_EXT_CTL_1,
-				    (PCIC_CLEXT_IRQ_LVL_MODE |
-				    PCIC_CLEXT_SMI_LVL_MODE));
-				cfg = PCIC_CL_LP_DYN_MODE;
-				pcic_putb(pcic, i, PCIC_MISC_CTL_2, cfg);
-				break;
-			case PCIC_INTR_MODE_ISA:
-				break;
-			}
-			break;
-			/*
-			 * On the CL_6729, we set the SMI and IRQ interrupt
-			 *	lines to PCI/level-mode. as well as program the
-			 *	correct clock speed divider bit.
-			 */
-			case PCIC_CL_PD6729:
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_PCI_1:
-				clext_reg_write(pcic, i, PCIC_CLEXT_EXT_CTL_1,
-				    (PCIC_CLEXT_IRQ_LVL_MODE |
-				    PCIC_CLEXT_SMI_LVL_MODE));
-
-				break;
-			case PCIC_INTR_MODE_ISA:
-				break;
-			}
-			if (pcic->bus_speed > PCIC_PCI_25MHZ && i == 0) {
-				cfg = 0;
-				cfg |= PCIC_CL_TIMER_CLK_DIV;
-				pcic_putb(pcic, i, PCIC_MISC_CTL_2, cfg);
-			}
-			break;
-			case PCIC_INTEL_i82092:
-			cfg = PCIC_82092_EN_TIMING;
-			if (pcic->bus_speed < PCIC_SYSCLK_33MHZ)
-				cfg |= PCIC_82092_PCICLK_25MHZ;
-			ddi_put8(pcic->cfg_handle, pcic->cfgaddr +
-			    PCIC_82092_PCICON, cfg);
-			break;
-			case PCIC_TI_PCI1130:
-			case PCIC_TI_PCI1131:
-			case PCIC_TI_PCI1250:
-			case PCIC_TI_PCI1031:
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG);
-			cfg &= ~PCIC_DEVCTL_INTR_MASK;
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_ISA:
-				cfg |= PCIC_DEVCTL_INTR_ISA;
-				break;
-			}
-#ifdef PCIC_DEBUG
-			if (pcic_debug) {
-				cmn_err(CE_CONT, "pcic_setup_adapter: "
-				    "write reg 0x%x=%x \n",
-				    PCIC_DEVCTL_REG, cfg);
-			}
-#endif
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG,
-			    cfg);
-
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_CRDCTL_REG);
-			cfg &= ~(PCIC_CRDCTL_PCIINTR|PCIC_CRDCTL_PCICSC|
-			    PCIC_CRDCTL_PCIFUNC);
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_PCI_1:
-				cfg |= PCIC_CRDCTL_PCIINTR |
-				    PCIC_CRDCTL_PCICSC |
-				    PCIC_CRDCTL_PCIFUNC;
-				pcic->pc_flags |= PCF_USE_SMI;
-				break;
-			}
-#ifdef PCIC_DEBUG
-			if (pcic_debug) {
-				cmn_err(CE_CONT, "pcic_setup_adapter: "
-				    " write reg 0x%x=%x \n",
-				    PCIC_CRDCTL_REG, cfg);
-			}
-#endif
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_CRDCTL_REG,
-			    cfg);
-			break;
-			case PCIC_TI_PCI1221:
-			case PCIC_TI_PCI1225:
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG);
-			cfg |= (PCIC_DEVCTL_INTR_DFLT | PCIC_DEVCTL_3VCAPABLE);
-#ifdef PCIC_DEBUG
-			if (pcic_debug) {
-				cmn_err(CE_CONT, "pcic_setup_adapter: "
-				    " write reg 0x%x=%x \n",
-				    PCIC_DEVCTL_REG, cfg);
-			}
-#endif
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG, cfg);
-
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG);
-			if (pcic->pc_type == PCIC_TI_PCI1225) {
-				cfg |= (PCIC_DIAG_CSC | PCIC_DIAG_ASYNC);
-			} else {
-				cfg |= PCIC_DIAG_ASYNC;
-			}
-			pcic->pc_flags |= PCF_USE_SMI;
-#ifdef PCIC_DEBUG
-			if (pcic_debug) {
-				cmn_err(CE_CONT, "pcic_setup_adapter: "
-				    " write reg 0x%x=%x \n",
-				    PCIC_DIAG_REG, cfg);
-			}
-#endif
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG, cfg);
-			break;
-			case PCIC_TI_PCI1520:
-			case PCIC_TI_PCI1510:
-			case PCIC_TI_VENDOR:
-			if (pcic->pc_intr_mode == PCIC_INTR_MODE_ISA) {
-				/* functional intr routed by ExCA register */
-				cfg = ddi_get8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-				cfg |= PCIC_FUN_INT_MOD_ISA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG,
-				    cfg);
-
-				/* IRQ serialized interrupts */
-				cfg = ddi_get8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_DEVCTL_REG);
-				cfg &= ~PCIC_DEVCTL_INTR_MASK;
-				cfg |= PCIC_DEVCTL_INTR_ISA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_DEVCTL_REG,
-				    cfg);
-				break;
-			}
-
-			/* CSC interrupt routed to PCI */
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG);
-			cfg |= (PCIC_DIAG_CSC | PCIC_DIAG_ASYNC);
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG, cfg);
-
-#if defined(__i386) || defined(__amd64)
-			/*
-			 * Some TI chips have 2 cardbus slots(function0 and
-			 * function1), and others may have just 1 cardbus slot.
-			 * The interrupt routing register is shared between the
-			 * 2 functions and can only be accessed through
-			 * function0. Here we check the presence of the second
-			 * cardbus slot and do the right thing.
-			 */
-
-			if (ddi_getlongprop(DDI_DEV_T_ANY, pcic->dip,
-			    DDI_PROP_DONTPASS, "reg", (caddr_t)&reg,
-			    &length) != DDI_PROP_SUCCESS) {
-				cmn_err(CE_WARN,
-				    "pcic_setup_adapter(), failed to"
-				    " read reg property\n");
-				break;
-			}
-
-			bus = PCI_REG_BUS_G(reg->pci_phys_hi);
-			dev = PCI_REG_DEV_G(reg->pci_phys_hi);
-			func = PCI_REG_FUNC_G(reg->pci_phys_hi);
-			kmem_free((caddr_t)reg, length);
-
-			if (func != 0) {
-				break;
-			}
-
-			classcode = (*pci_getl_func)(bus, dev, 1,
-			    PCI_CONF_REVID);
-			classcode >>= 8;
-			if (classcode != 0x060700 &&
-			    classcode != 0x060500) {
-				break;
-			}
-
-			/* Parallel PCI interrupts only */
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG);
-			cfg &= ~PCIC_DEVCTL_INTR_MASK;
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DEVCTL_REG,
-			    cfg);
-
-			/* tie INTA and INTB together */
-			cfg = ddi_get8(pcic->cfg_handle,
-			    (pcic->cfgaddr + PCIC_SYSCTL_REG + 3));
-			cfg |= PCIC_SYSCTL_INTRTIE;
-			ddi_put8(pcic->cfg_handle, (pcic->cfgaddr +
-			    PCIC_SYSCTL_REG + 3), cfg);
-#endif
-
-			break;
-			case PCIC_TI_PCI1410:
-			cfg = ddi_get8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG);
-			cfg |= (PCIC_DIAG_CSC | PCIC_DIAG_ASYNC);
-			ddi_put8(pcic->cfg_handle,
-			    pcic->cfgaddr + PCIC_DIAG_REG, cfg);
-			break;
-			case PCIC_TOSHIBA_TOPIC100:
-			case PCIC_TOSHIBA_TOPIC95:
-			case PCIC_TOSHIBA_VENDOR:
-			cfg = ddi_get8(pcic->cfg_handle, pcic->cfgaddr +
-			    PCIC_TOSHIBA_SLOT_CTL_REG);
-			cfg |= (PCIC_TOSHIBA_SCR_SLOTON |
-			    PCIC_TOSHIBA_SCR_SLOTEN);
-			cfg &= (~PCIC_TOSHIBA_SCR_PRT_MASK);
-			cfg |= PCIC_TOSHIBA_SCR_PRT_3E2;
-			ddi_put8(pcic->cfg_handle, pcic->cfgaddr +
-			    PCIC_TOSHIBA_SLOT_CTL_REG, cfg);
-			cfg = ddi_get8(pcic->cfg_handle, pcic->cfgaddr +
-			    PCIC_TOSHIBA_INTR_CTL_REG);
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_ISA:
-				cfg &= ~PCIC_TOSHIBA_ICR_SRC;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr +
-				    PCIC_TOSHIBA_INTR_CTL_REG, cfg);
-
-				cfg = ddi_get8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-				cfg |= PCIC_FUN_INT_MOD_ISA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG,
-				    cfg);
-				break;
-			case PCIC_INTR_MODE_PCI_1:
-				cfg |= PCIC_TOSHIBA_ICR_SRC;
-				cfg &= (~PCIC_TOSHIBA_ICR_PIN_MASK);
-				cfg |= PCIC_TOSHIBA_ICR_PIN_INTA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr +
-				    PCIC_TOSHIBA_INTR_CTL_REG, cfg);
-				break;
-			}
-			break;
-			case PCIC_O2MICRO_VENDOR:
-			cfg32 = ddi_get32(pcic->cfg_handle,
-			    (uint32_t *)(pcic->cfgaddr +
-			    PCIC_O2MICRO_MISC_CTL));
-			switch (pcic->pc_intr_mode) {
-			case PCIC_INTR_MODE_ISA:
-				cfg32 |= (PCIC_O2MICRO_ISA_LEGACY |
-				    PCIC_O2MICRO_INT_MOD_PCI);
-				ddi_put32(pcic->cfg_handle,
-				    (uint32_t *)(pcic->cfgaddr +
-				    PCIC_O2MICRO_MISC_CTL),
-				    cfg32);
-				cfg = ddi_get8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-				cfg |= PCIC_FUN_INT_MOD_ISA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG,
-				    cfg);
-				break;
-			case PCIC_INTR_MODE_PCI_1:
-				cfg32 &= ~PCIC_O2MICRO_ISA_LEGACY;
-				cfg32 |= PCIC_O2MICRO_INT_MOD_PCI;
-				ddi_put32(pcic->cfg_handle,
-				    (uint32_t *)(pcic->cfgaddr +
-				    PCIC_O2MICRO_MISC_CTL),
-				    cfg32);
-				break;
-			}
-			break;
-			case PCIC_RICOH_VENDOR:
-			if (pcic->pc_intr_mode == PCIC_INTR_MODE_ISA) {
-				cfg16 = ddi_get16(pcic->cfg_handle,
-				    (uint16_t *)(pcic->cfgaddr +
-				    PCIC_RICOH_MISC_CTL_2));
-				cfg16 |= (PCIC_RICOH_CSC_INT_MOD |
-				    PCIC_RICOH_FUN_INT_MOD);
-				ddi_put16(pcic->cfg_handle,
-				    (uint16_t *)(pcic->cfgaddr +
-				    PCIC_RICOH_MISC_CTL_2),
-				    cfg16);
-
-				cfg16 = ddi_get16(pcic->cfg_handle,
-				    (uint16_t *)(pcic->cfgaddr +
-				    PCIC_RICOH_MISC_CTL));
-				cfg16 |= PCIC_RICOH_SIRQ_EN;
-				ddi_put16(pcic->cfg_handle,
-				    (uint16_t *)(pcic->cfgaddr +
-				    PCIC_RICOH_MISC_CTL),
-				    cfg16);
-
-				cfg = ddi_get8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-				cfg |= PCIC_FUN_INT_MOD_ISA;
-				ddi_put8(pcic->cfg_handle,
-				    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG,
-				    cfg);
-			}
-			break;
-			default:
-			break;
-		} /* switch */
-
-		/*
-		 * The default value in the EEPROM (loaded on reset) for
-		 * MFUNC0/MFUNC1 may be incorrect. Here we make sure that
-		 * MFUNC0 is connected to INTA, and MFUNC1 is connected to
-		 * INTB. This applies to all TI CardBus controllers.
-		 */
-		if ((pcic->pc_type >> 16) == PCIC_TI_VENDORID &&
-		    pcic->pc_intr_mode == PCIC_INTR_MODE_PCI_1) {
-			value = ddi_get32(pcic->cfg_handle,
-			    (uint32_t *)(pcic->cfgaddr + PCIC_MFROUTE_REG));
-			value &= ~0xff;
-			ddi_put32(pcic->cfg_handle, (uint32_t *)(pcic->cfgaddr +
-			    PCIC_MFROUTE_REG), value|PCIC_TI_MFUNC_SEL);
-		}
-
-		/* setup general card status change interrupt */
-		switch (pcic->pc_type) {
-			case PCIC_TI_PCI1225:
-			case PCIC_TI_PCI1221:
-			case PCIC_TI_PCI1031:
-			case PCIC_TI_PCI1520:
-			case PCIC_TI_PCI1410:
-				pcic_putb(pcic, i, PCIC_MANAGEMENT_INT,
-				    PCIC_CHANGE_DEFAULT);
-				break;
-			default:
-				if (pcic->pc_intr_mode ==
-				    PCIC_INTR_MODE_PCI_1) {
-					pcic_putb(pcic, i, PCIC_MANAGEMENT_INT,
-					    PCIC_CHANGE_DEFAULT);
-					break;
-				} else {
-					pcic_putb(pcic, i, PCIC_MANAGEMENT_INT,
-					    PCIC_CHANGE_DEFAULT |
-					    (pcic->pc_sockets[i].pcs_smi << 4));
-					break;
-				}
-		}
-
-		pcic->pc_flags |= PCF_INTRENAB;
-
-		/* take card out of RESET */
-		pcic_putb(pcic, i, PCIC_INTERRUPT, PCIC_RESET);
-		/* turn power off and let CS do this */
-		pcic_putb(pcic, i, PCIC_POWER_CONTROL, 0);
-
-		/* final chip specific initialization */
-		switch (pcic->pc_type) {
-			case PCIC_VADEM:
-			pcic_putb(pcic, i, PCIC_VG_CONTROL,
-			    PCIC_VC_DELAYENABLE);
-			pcic->pc_flags |= PCF_DEBOUNCE;
-			/* FALLTHROUGH */
-			case PCIC_I82365SL:
-			pcic_putb(pcic, i, PCIC_GLOBAL_CONTROL,
-			    PCIC_GC_CSC_WRITE);
-			/* clear any pending interrupts */
-			value = pcic_getb(pcic, i, PCIC_CARD_STATUS_CHANGE);
-			pcic_putb(pcic, i, PCIC_CARD_STATUS_CHANGE, value);
-			break;
-		    /* The 82092 uses PCI config space to enable interrupts */
-			case PCIC_INTEL_i82092:
-			pcic_82092_smiirq_ctl(pcic, i, PCIC_82092_CTL_SMI,
-			    PCIC_82092_INT_ENABLE);
-			break;
-			case PCIC_CL_PD6729:
-			if (pcic->bus_speed >= PCIC_PCI_DEF_SYSCLK && i == 0) {
-				value = pcic_getb(pcic, i, PCIC_MISC_CTL_2);
-				pcic_putb(pcic, i, PCIC_MISC_CTL_2,
-				    value | PCIC_CL_TIMER_CLK_DIV);
-			}
-			break;
-		} /* switch */
-
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_CONT,
-			    "socket %d value=%x, flags = %x (%s)\n",
-			    i, value, pcic->pc_sockets[i].pcs_flags,
-			    (pcic->pc_sockets[i].pcs_flags &
-			    PCS_CARD_PRESENT) ?
-			"card present" : "no card");
-#endif
-	}
-}
-
-/*
- * pcic_intr(caddr_t, caddr_t)
- *	interrupt handler for the PCIC style adapter
- *	handles all basic interrupts and also checks
- *	for status changes and notifies the nexus if
- *	necessary
- *
- *	On PCI bus adapters, also handles all card
- *	IO interrupts.
- */
-/*ARGSUSED*/
-uint32_t
-pcic_intr(caddr_t arg1, caddr_t arg2)
-{
-	pcicdev_t *pcic = (pcicdev_t *)arg1;
-	int value = 0, i, ret = DDI_INTR_UNCLAIMED;
-	uint8_t status;
-	uint_t io_ints;
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 0xf,
-	    "pcic_intr: enter pc_flags=0x%x PCF_ATTACHED=0x%x"
-	    " pc_numsockets=%d \n",
-	    pcic->pc_flags, PCF_ATTACHED, pcic->pc_numsockets);
-#endif
-
-	if (!(pcic->pc_flags & PCF_ATTACHED))
-		return (DDI_INTR_UNCLAIMED);
-
-	mutex_enter(&pcic->intr_lock);
-
-	if (pcic->pc_flags & PCF_SUSPENDED) {
-		mutex_exit(&pcic->intr_lock);
-		return (ret);
-	}
-
-	/*
-	 * need to change to only ACK and touch the slot that
-	 * actually caused the interrupt.  Currently everything
-	 * is acked
-	 *
-	 * we need to look at all known sockets to determine
-	 * what might have happened, so step through the list
-	 * of them
-	 */
-
-	/*
-	 * Set the bitmask for IO interrupts to initially include all sockets
-	 */
-	io_ints = (1 << pcic->pc_numsockets) - 1;
-
-	for (i = 0; i < pcic->pc_numsockets; i++) {
-		int card_type;
-		pcic_socket_t *sockp;
-		int value_cb = 0;
-
-		sockp = &pcic->pc_sockets[i];
-		/* get the socket's I/O addresses */
-
-		if (sockp->pcs_flags & PCS_WAITING) {
-			io_ints &= ~(1 << i);
-			continue;
-		}
-
-		if (sockp->pcs_flags & PCS_CARD_IO)
-			card_type = IF_IO;
-		else
-			card_type = IF_MEMORY;
-
-		if (pcic->pc_io_type == PCIC_IO_TYPE_YENTA)
-			value_cb = pcic_getcb(pcic, CB_STATUS_EVENT);
-
-		value = pcic_change(pcic, i);
-
-		if ((value != 0) || (value_cb != 0)) {
-			int x = pcic->pc_cb_arg;
-
-			ret = DDI_INTR_CLAIMED;
-
-#if defined(PCIC_DEBUG)
-			pcic_err(pcic->dip, 0x9,
-			    "card_type = %d, value_cb = 0x%x\n",
-			    card_type,
-			    value_cb ? value_cb :
-			    pcic_getcb(pcic, CB_STATUS_EVENT));
-			if (pcic_debug)
-				cmn_err(CE_CONT,
-				    "\tchange on socket %d (%x)\n", i,
-				    value);
-#endif
-			/* find out what happened */
-			status = pcic_getb(pcic, i, PCIC_INTERFACE_STATUS);
-
-			/* acknowledge the interrupt */
-			if (value_cb)
-				pcic_putcb(pcic, CB_STATUS_EVENT, value_cb);
-
-			if (value)
-				pcic_putb(pcic, i, PCIC_CARD_STATUS_CHANGE,
-				    value);
-
-			if (pcic->pc_callback == NULL) {
-				/* if not callback handler, nothing to do */
-				continue;
-			}
-
-			/* Card Detect */
-			if (value & PCIC_CD_DETECT ||
-			    value_cb & CB_PS_CCDMASK) {
-				uint8_t irq;
-#if defined(PCIC_DEBUG)
-				if (pcic_debug)
-					cmn_err(CE_CONT,
-					    "\tcd_detect: status=%x,"
-					    " flags=%x\n",
-					    status, sockp->pcs_flags);
-#else
-#ifdef lint
-				if (status == 0)
-					status++;
-#endif
-#endif
-				/*
-				 * Turn off all interrupts for this socket here.
-				 */
-				irq = pcic_getb(pcic, sockp->pcs_socket,
-				    PCIC_MANAGEMENT_INT);
-				irq &= ~PCIC_CHANGE_MASK;
-				pcic_putb(pcic, sockp->pcs_socket,
-				    PCIC_MANAGEMENT_INT, irq);
-
-				pcic_putcb(pcic, CB_STATUS_MASK, 0x0);
-
-				/*
-				 * Put the socket in debouncing state so that
-				 * the leaf driver won't receive interrupts.
-				 * Crucial for handling surprise-removal.
-				 */
-				sockp->pcs_flags |= PCS_DEBOUNCING;
-
-				if (!sockp->pcs_cd_softint_flg) {
-					sockp->pcs_cd_softint_flg = 1;
-					(void) ddi_intr_trigger_softint(
-					    sockp->pcs_cd_softint_hdl, NULL);
-				}
-
-				io_ints &= ~(1 << i);
-			} /* PCIC_CD_DETECT */
-
-			/* Ready/Change Detect */
-			sockp->pcs_state ^= SBM_RDYBSY;
-			if (card_type == IF_MEMORY && value & PCIC_RD_DETECT) {
-				sockp->pcs_flags |= PCS_READY;
-				PC_CALLBACK(pcic->dip, x, PCE_CARD_READY, i);
-			}
-
-			/* Battery Warn Detect */
-			if (card_type == IF_MEMORY &&
-			    value & PCIC_BW_DETECT &&
-			    !(sockp->pcs_state & SBM_BVD2)) {
-				sockp->pcs_state |= SBM_BVD2;
-				PC_CALLBACK(pcic->dip, x,
-				    PCE_CARD_BATTERY_WARN, i);
-			}
-
-			/* Battery Dead Detect */
-			if (value & PCIC_BD_DETECT) {
-				/*
-				 * need to work out event if RI not enabled
-				 * and card_type == IF_IO
-				 */
-				if (card_type == IF_MEMORY &&
-				    !(sockp->pcs_state & SBM_BVD1)) {
-					sockp->pcs_state |= SBM_BVD1;
-					PC_CALLBACK(pcic->dip, x,
-					    PCE_CARD_BATTERY_DEAD,
-					    i);
-				} else {
-					/*
-					 * information in pin replacement
-					 * register if one is available
-					 */
-					PC_CALLBACK(pcic->dip, x,
-					    PCE_CARD_STATUS_CHANGE,
-					    i);
-				} /* IF_MEMORY */
-			} /* PCIC_BD_DETECT */
-		} /* if pcic_change */
-		/*
-		 * for any controllers that we can detect whether a socket
-		 * had an interrupt for the PC Card, we should sort that out
-		 * here.
-		 */
-	} /* for pc_numsockets */
-
-	/*
-	 * If we're on a PCI bus, we may need to cycle through each IO
-	 *	interrupt handler that is registered since they all
-	 *	share the same interrupt line.
-	 */
-
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 0xf,
-	    "pcic_intr: pc_intr_mode=%d pc_type=%x io_ints=0x%x\n",
-	    pcic->pc_intr_mode, pcic->pc_type, io_ints);
-#endif
-
-	if (io_ints) {
-		if (pcic_do_io_intr(pcic, io_ints) == DDI_INTR_CLAIMED)
-			ret = DDI_INTR_CLAIMED;
-	}
-
-	mutex_exit(&pcic->intr_lock);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 0xf,
-	    "pcic_intr: ret=%d value=%d DDI_INTR_CLAIMED=%d\n",
-	    ret, value, DDI_INTR_CLAIMED);
-#endif
-
-	return (ret);
-}
-
-/*
- * pcic_change()
- *	check to see if this socket had a change in state
- *	by checking the status change register
- */
-static int
-pcic_change(pcicdev_t *pcic, int socket)
-{
-	return (pcic_getb(pcic, socket, PCIC_CARD_STATUS_CHANGE));
-}
-
-/*
- * pcic_do_io_intr - calls client interrupt handlers
- */
-static int
-pcic_do_io_intr(pcicdev_t *pcic, uint32_t sockets)
-{
-	inthandler_t *tmp;
-	int ret = DDI_INTR_UNCLAIMED;
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 0xf,
-	    "pcic_do_io_intr: pcic=%p sockets=%d irq_top=%p\n",
-	    (void *)pcic, (int)sockets, (void *)pcic->irq_top);
-#endif
-
-	if (pcic->irq_top != NULL) {
-		tmp = pcic->irq_current;
-
-		do {
-		int cur = pcic->irq_current->socket;
-		pcic_socket_t *sockp =
-		    &pcic->pc_sockets[cur];
-
-#if defined(PCIC_DEBUG)
-		pcic_err(pcic->dip, 0xf,
-		    "\t pcs_flags=0x%x PCS_CARD_PRESENT=0x%x\n",
-		    sockp->pcs_flags, PCS_CARD_PRESENT);
-		pcic_err(pcic->dip, 0xf,
-		    "\t sockets=%d cur=%d intr=%p arg1=%p "
-		    "arg2=%p\n",
-		    sockets, cur, (void *)pcic->irq_current->intr,
-		    pcic->irq_current->arg1,
-		    pcic->irq_current->arg2);
-#endif
-		if ((sockp->pcs_flags & PCS_CARD_PRESENT) &&
-		    !(sockp->pcs_flags & PCS_DEBOUNCING) &&
-		    (sockets & (1 << cur))) {
-
-			if ((*pcic->irq_current->intr)(pcic->irq_current->arg1,
-			    pcic->irq_current->arg2) == DDI_INTR_CLAIMED)
-				ret = DDI_INTR_CLAIMED;
-
-#if defined(PCIC_DEBUG)
-			pcic_err(pcic->dip, 0xf,
-			    "\t ret=%d DDI_INTR_CLAIMED=%d\n",
-			    ret, DDI_INTR_CLAIMED);
-#endif
-		}
-
-
-		if ((pcic->irq_current = pcic->irq_current->next) == NULL)
-					pcic->irq_current = pcic->irq_top;
-
-		} while (pcic->irq_current != tmp);
-
-		if ((pcic->irq_current = pcic->irq_current->next) == NULL)
-					pcic->irq_current = pcic->irq_top;
-
-	} else {
-		ret = DDI_INTR_UNCLAIMED;
-	}
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 0xf,
-	    "pcic_do_io_intr: exit ret=%d DDI_INTR_CLAIMED=%d\n",
-	    ret, DDI_INTR_CLAIMED);
-#endif
-
-	return (ret);
-
-}
-
-/*
- * pcic_inquire_adapter()
- *	SocketServices InquireAdapter function
- *	get characteristics of the physical adapter
- */
-/*ARGSUSED*/
-static int
-pcic_inquire_adapter(dev_info_t *dip, inquire_adapter_t *config)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-
-	config->NumSockets = pcic->pc_numsockets;
-	config->NumWindows = pcic->pc_numsockets * PCIC_NUMWINSOCK;
-	config->NumEDCs = 0;
-	config->AdpCaps = 0;
-	config->ActiveHigh = 0;
-	config->ActiveLow = PCIC_AVAIL_IRQS;
-	config->NumPower = pcic->pc_numpower;
-	config->power_entry = pcic->pc_power; /* until we resolve this */
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "pcic_inquire_adapter:\n");
-		cmn_err(CE_CONT, "\tNumSockets=%d\n", config->NumSockets);
-		cmn_err(CE_CONT, "\tNumWindows=%d\n", config->NumWindows);
-	}
-#endif
-	config->ResourceFlags = 0;
-	switch (pcic->pc_intr_mode) {
-	case PCIC_INTR_MODE_PCI_1:
-		config->ResourceFlags |= RES_OWN_IRQ | RES_IRQ_NEXUS |
-		    RES_IRQ_SHAREABLE;
-		break;
-	}
-	return (SUCCESS);
-}
-
-/*
- * pcic_callback()
- *	The PCMCIA nexus calls us via this function
- *	in order to set the callback function we are
- *	to call the nexus with
- */
-/*ARGSUSED*/
-static int
-pcic_callback(dev_info_t *dip, int (*handler)(), int arg)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-
-	if (handler != NULL) {
-		pcic->pc_callback = handler;
-		pcic->pc_cb_arg  = arg;
-		pcic->pc_flags |= PCF_CALLBACK;
-	} else {
-		pcic->pc_callback = NULL;
-		pcic->pc_cb_arg = 0;
-		pcic->pc_flags &= ~PCF_CALLBACK;
-	}
-	/*
-	 * we're now registered with the nexus
-	 * it is acceptable to do callbacks at this point.
-	 * don't call back from here though since it could block
-	 */
-	return (PC_SUCCESS);
-}
-
-/*
- * pcic_calc_speed (pcicdev_t *pcic, uint32_t speed)
- *	calculate the speed bits from the specified memory speed
- *	there may be more to do here
- */
-
-static int
-pcic_calc_speed(pcicdev_t *pcic, uint32_t speed)
-{
-	uint32_t wspeed = 1;	/* assume 1 wait state when unknown */
-	uint32_t bspeed = PCIC_ISA_DEF_SYSCLK;
-
-	switch (pcic->pc_type) {
-		case PCIC_I82365SL:
-		case PCIC_VADEM:
-		case PCIC_VADEM_VG469:
-		default:
-		/* Intel chip wants it in waitstates */
-		wspeed = mhztons(PCIC_ISA_DEF_SYSCLK) * 3;
-		if (speed <= wspeed)
-			wspeed = 0;
-		else if (speed <= (wspeed += mhztons(bspeed)))
-			wspeed = 1;
-		else if (speed <= (wspeed += mhztons(bspeed)))
-			wspeed = 2;
-		else
-			wspeed = 3;
-		wspeed <<= 6; /* put in right bit positions */
-		break;
-
-		case PCIC_INTEL_i82092:
-		wspeed = SYSMEM_82092_80NS;
-		if (speed > 80)
-			wspeed = SYSMEM_82092_100NS;
-		if (speed > 100)
-			wspeed = SYSMEM_82092_150NS;
-		if (speed > 150)
-			wspeed = SYSMEM_82092_200NS;
-		if (speed > 200)
-			wspeed = SYSMEM_82092_250NS;
-		if (speed > 250)
-			wspeed = SYSMEM_82092_600NS;
-		wspeed <<= 5;	/* put in right bit positions */
-		break;
-
-	} /* switch */
-
-	return (wspeed);
-}
-
-/*
- * These values are taken from the PC Card Standard Electrical Specification.
- * Generally the larger value is taken if 2 are possible.
- */
-static struct pcic_card_times {
-	uint16_t cycle;	/* Speed as found in the atribute space of he card. */
-	uint16_t setup;	/* Corresponding address setup time. */
-	uint16_t width;	/* Corresponding width, OE or WE. */
-	uint16_t hold;	/* Corresponding data or address hold time. */
-} pcic_card_times[] = {
-
-/*
- * Note: The rounded up times for 250, 200 & 150 have been increased
- * due to problems with the 3-Com ethernet cards (pcelx) on UBIIi.
- * See BugID 00663.
- */
-
-/*
- * Rounded up times           Original times from
- * that add up to the         the PCMCIA Spec.
- * cycle time.
- */
-	{600, 180, 370, 140},	/* 100, 300,  70 */
-	{400, 120, 300, 90},	/* Made this one up */
-	{250, 100, 190, 70},	/*  30, 150,  30 */
-	{200, 80, 170, 70},	/*  20, 120,  30 */
-	{150, 50, 110, 40},	/*  20,  80,  20 */
-	{100, 40, 80, 40},	/*  10,  60,  15 */
-	{0, 10, 60, 15}		/*  10,  60,  15 */
-};
-
-/*
- * pcic_set_cdtimers
- *	This is specific to several Cirrus Logic chips
- */
-static void
-pcic_set_cdtimers(pcicdev_t *pcic, int socket, uint32_t speed, int tset)
-{
-	int cmd, set, rec, offset, clk_pulse;
-	struct pcic_card_times *ctp;
-
-	if ((tset == IOMEM_CLTIMER_SET_1) || (tset == SYSMEM_CLTIMER_SET_1))
-		offset = 3;
-	else
-		offset = 0;
-
-	clk_pulse = mhztons(pcic->bus_speed);
-	for (ctp = pcic_card_times; speed < ctp->cycle; ctp++)
-		;
-
-	/*
-	 * Add (clk_pulse/2) and an extra 1 to account for rounding errors.
-	 */
-	set = ((ctp->setup + 10 + 1 + (clk_pulse/2))/clk_pulse) - 1;
-	if (set < 0)
-		set = 0;
-
-	cmd = ((ctp->width + 10 + 1 + (clk_pulse/2))/clk_pulse) - 1;
-	if (cmd < 0)
-		cmd = 0;
-
-	rec = ((ctp->hold + 10 + 1 + (clk_pulse/2))/clk_pulse) - 2;
-	if (rec < 0)
-		rec = 0;
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 8, "pcic_set_cdtimers(%d, Timer Set %d)\n"
-	    "ct=%d, cp=%d, cmd=0x%x, setup=0x%x, rec=0x%x\n",
-	    (unsigned)speed, offset == 3 ? 1 : 0,
-	    ctp->cycle, clk_pulse, cmd, set, rec);
-#endif
-
-	pcic_putb(pcic, socket, PCIC_TIME_COMMAND_0 + offset, cmd);
-	pcic_putb(pcic, socket, PCIC_TIME_SETUP_0 + offset, set);
-	pcic_putb(pcic, socket, PCIC_TIME_RECOVER_0 + offset, rec);
-}
-
-/*
- * pcic_set_window
- *	essentially the same as the Socket Services specification
- *	We use socket and not adapter since they are identifiable
- *	but the rest is the same
- *
- *	dip	pcic driver's device information
- *	window	parameters for the request
- */
-static int
-pcic_set_window(dev_info_t *dip, set_window_t *window)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int select;
-	int socket, pages, which, ret;
-	pcic_socket_t *sockp = &pcic->pc_sockets[window->socket];
-	ra_return_t res;
-	ndi_ra_request_t req;
-	uint32_t base = window->base;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "pcic_set_window: entered\n");
-		cmn_err(CE_CONT,
-		    "\twindow=%d, socket=%d, WindowSize=%d, speed=%d\n",
-		    window->window, window->socket, window->WindowSize,
-		    window->speed);
-		cmn_err(CE_CONT,
-		    "\tbase=%x, state=%x\n", (unsigned)window->base,
-		    (unsigned)window->state);
-	}
-#endif
-
-	/*
-	 * do some basic sanity checking on what we support
-	 * we don't do paged mode
-	 */
-	if (window->state & WS_PAGED) {
-		cmn_err(CE_WARN, "pcic_set_window: BAD_ATTRIBUTE\n");
-		return (BAD_ATTRIBUTE);
-	}
-
-	/*
-	 * we don't care about previous mappings.
-	 * Card Services will deal with that so don't
-	 * even check
-	 */
-
-	socket = window->socket;
-
-	if (!(window->state & WS_IO)) {
-		int win, tmp;
-		pcs_memwin_t *memp;
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_CONT, "\twindow type is memory\n");
-#endif
-		/* this is memory window mapping */
-		win = window->window % PCIC_NUMWINSOCK;
-		tmp = window->window / PCIC_NUMWINSOCK;
-
-		/* only windows 2-6 can do memory mapping */
-		if (tmp != window->socket || win < PCIC_IOWINDOWS) {
-			cmn_err(CE_CONT,
-			    "\tattempt to map to non-mem window\n");
-			return (BAD_WINDOW);
-		}
-
-		if (window->WindowSize == 0)
-			window->WindowSize = MEM_MIN;
-		else if ((window->WindowSize & (PCIC_PAGE-1)) != 0) {
-			cmn_err(CE_WARN, "pcic_set_window: BAD_SIZE\n");
-			return (BAD_SIZE);
-		}
-
-		mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-		memp = &sockp->pcs_windows[win].mem;
-		memp->pcw_speed = window->speed;
-
-		win -= PCIC_IOWINDOWS; /* put in right range */
-
-		if (window->WindowSize != memp->pcw_len)
-			which = memp->pcw_len;
-		else
-			which = 0;
-
-		if (window->state & WS_ENABLED) {
-			uint32_t wspeed;
-#if defined(PCIC_DEBUG)
-			if (pcic_debug) {
-				cmn_err(CE_CONT,
-				    "\tbase=%x, win=%d\n", (unsigned)base,
-				    win);
-				if (which)
-					cmn_err(CE_CONT,
-					    "\tneed to remap window\n");
-			}
-#endif
-
-			if (which && (memp->pcw_status & PCW_MAPPED)) {
-				ddi_regs_map_free(&memp->pcw_handle);
-				res.ra_addr_lo = memp->pcw_base;
-				res.ra_len = memp->pcw_len;
-				(void) pcmcia_free_mem(memp->res_dip, &res);
-				memp->pcw_status &= ~(PCW_MAPPED|PCW_ENABLED);
-				memp->pcw_hostmem = NULL;
-				memp->pcw_base = NULL;
-				memp->pcw_len = 0;
-			}
-
-			which = window->WindowSize >> PAGE_SHIFT;
-
-			if (!(memp->pcw_status & PCW_MAPPED)) {
-				ret = 0;
-
-				memp->pcw_base = base;
-				bzero(&req, sizeof (req));
-				req.ra_len = which << PAGE_SHIFT;
-				req.ra_addr = (uint64_t)memp->pcw_base;
-				req.ra_boundbase = pcic->pc_base;
-				req.ra_boundlen  = pcic->pc_bound;
-				req.ra_flags = (memp->pcw_base ?
-				    NDI_RA_ALLOC_SPECIFIED : 0) |
-				    NDI_RA_ALLOC_BOUNDED;
-				req.ra_align_mask =
-				    (PAGESIZE - 1) | (PCIC_PAGE - 1);
-#if defined(PCIC_DEBUG)
-					pcic_err(dip, 8,
-					    "\tlen 0x%"PRIx64
-					    "addr 0x%"PRIx64"bbase 0x%"PRIx64
-					    " blen 0x%"PRIx64" flags 0x%x"
-					    " algn 0x%"PRIx64"\n",
-					    req.ra_len, req.ra_addr,
-					    req.ra_boundbase,
-					    req.ra_boundlen, req.ra_flags,
-					    req.ra_align_mask);
-#endif
-
-				ret = pcmcia_alloc_mem(dip, &req, &res,
-				    &memp->res_dip);
-				if (ret == DDI_FAILURE) {
-					mutex_exit(&pcic->pc_lock);
-					cmn_err(CE_WARN,
-					"\tpcmcia_alloc_mem() failed\n");
-					return (BAD_SIZE);
-				}
-				memp->pcw_base = res.ra_addr_lo;
-				base = memp->pcw_base;
-
-#if defined(PCIC_DEBUG)
-				if (pcic_debug)
-					cmn_err(CE_CONT,
-					    "\tsetwindow: new base=%x\n",
-					    (unsigned)memp->pcw_base);
-#endif
-				memp->pcw_len = window->WindowSize;
-
-				which = pcmcia_map_reg(pcic->dip,
-				    window->child,
-				    &res,
-				    (uint32_t)(window->state &
-				    0xffff) |
-				    (window->socket << 16),
-				    (caddr_t *)&memp->pcw_hostmem,
-				    &memp->pcw_handle,
-				    &window->attr, NULL);
-
-				if (which != DDI_SUCCESS) {
-
-					cmn_err(CE_WARN, "\tpcmcia_map_reg() "
-					    "failed\n");
-
-					res.ra_addr_lo = memp->pcw_base;
-					res.ra_len = memp->pcw_len;
-					(void) pcmcia_free_mem(memp->res_dip,
-					    &res);
-
-					mutex_exit(&pcic->pc_lock);
-
-					return (BAD_WINDOW);
-				}
-				memp->pcw_status |= PCW_MAPPED;
-#if defined(PCIC_DEBUG)
-				if (pcic_debug)
-					cmn_err(CE_CONT,
-					    "\tmap=%x, hostmem=%p\n",
-					    which,
-					    (void *)memp->pcw_hostmem);
-#endif
-			} else {
-				base = memp->pcw_base;
-			}
-
-			/* report the handle back to caller */
-			window->handle = memp->pcw_handle;
-
-#if defined(PCIC_DEBUG)
-			if (pcic_debug) {
-				cmn_err(CE_CONT,
-				    "\twindow mapped to %x@%x len=%d\n",
-				    (unsigned)window->base,
-				    (unsigned)memp->pcw_base,
-				    memp->pcw_len);
-			}
-#endif
-
-			/* find the register set offset */
-			select = win * PCIC_MEM_1_OFFSET;
-#if defined(PCIC_DEBUG)
-			if (pcic_debug)
-				cmn_err(CE_CONT, "\tselect=%x\n", select);
-#endif
-
-			/*
-			 * at this point, the register window indicator has
-			 * been converted to be an offset from the first
-			 * set of registers that are used for programming
-			 * the window mapping and the offset used to select
-			 * the correct set of registers to access the
-			 * specified socket.  This allows basing everything
-			 * off the _0 window
-			 */
-
-			/* map the physical page base address */
-			which = (window->state & WS_16BIT) ? SYSMEM_DATA_16 : 0;
-			which |= (window->speed <= MEM_SPEED_MIN) ?
-			    SYSMEM_ZERO_WAIT : 0;
-
-			/* need to select register set */
-			select = PCIC_MEM_1_OFFSET * win;
-
-			pcic_putb(pcic, socket,
-			    PCIC_SYSMEM_0_STARTLOW + select,
-			    SYSMEM_LOW(base));
-			pcic_putb(pcic, socket,
-			    PCIC_SYSMEM_0_STARTHI + select,
-			    SYSMEM_HIGH(base) | which);
-
-			/*
-			 * Some adapters can decode window addresses greater
-			 * than 16-bits worth, so handle them here.
-			 */
-			switch (pcic->pc_type) {
-			case PCIC_INTEL_i82092:
-				pcic_putb(pcic, socket,
-				    PCIC_82092_CPAGE,
-				    SYSMEM_EXT(base));
-				break;
-			case PCIC_CL_PD6729:
-			case PCIC_CL_PD6730:
-				clext_reg_write(pcic, socket,
-				    PCIC_CLEXT_MMAP0_UA + win,
-				    SYSMEM_EXT(base));
-				break;
-			case PCIC_TI_PCI1130:
-				/*
-				 * Note that the TI chip has one upper byte
-				 * per socket so all windows get bound to a
-				 * 16MB segment.  This must be detected and
-				 * handled appropriately.  We can detect that
-				 * it is done by seeing if the pc_base has
-				 * changed and changing when the register
-				 * is first set.  This will force the bounds
-				 * to be correct.
-				 */
-				if (pcic->pc_bound == 0xffffffff) {
-					pcic_putb(pcic, socket,
-					    PCIC_TI_WINDOW_PAGE_PCI,
-					    SYSMEM_EXT(base));
-					pcic->pc_base = SYSMEM_EXT(base) << 24;
-					pcic->pc_bound = 0x1000000;
-				}
-				break;
-			case PCIC_TI_PCI1031:
-			case PCIC_TI_PCI1131:
-			case PCIC_TI_PCI1250:
-			case PCIC_TI_PCI1225:
-			case PCIC_TI_PCI1221:
-			case PCIC_SMC_34C90:
-			case PCIC_CL_PD6832:
-			case PCIC_RICOH_RL5C466:
-			case PCIC_TI_PCI1410:
-			case PCIC_ENE_1410:
-			case PCIC_TI_PCI1510:
-			case PCIC_TI_PCI1520:
-			case PCIC_O2_OZ6912:
-			case PCIC_TI_PCI1420:
-			case PCIC_ENE_1420:
-			case PCIC_TI_VENDOR:
-			case PCIC_TOSHIBA_TOPIC100:
-			case PCIC_TOSHIBA_TOPIC95:
-			case PCIC_TOSHIBA_VENDOR:
-			case PCIC_RICOH_VENDOR:
-			case PCIC_O2MICRO_VENDOR:
-				pcic_putb(pcic, socket,
-				    PCIC_YENTA_MEM_PAGE + win,
-				    SYSMEM_EXT(base));
-				break;
-			default:
-				cmn_err(CE_NOTE, "pcic_set_window: unknown "
-				    "cardbus vendor:0x%X\n",
-				    pcic->pc_type);
-				pcic_putb(pcic, socket,
-				    PCIC_YENTA_MEM_PAGE + win,
-				    SYSMEM_EXT(base));
-
-				break;
-			} /* switch */
-
-			/*
-			 * specify the length of the mapped range
-			 * we convert to pages (rounding up) so that
-			 * the hardware gets the right thing
-			 */
-			pages = (window->WindowSize+PCIC_PAGE-1)/PCIC_PAGE;
-
-			/*
-			 * Setup this window's timing.
-			 */
-			switch (pcic->pc_type) {
-			case PCIC_CL_PD6729:
-			case PCIC_CL_PD6730:
-			case PCIC_CL_PD6710:
-			case PCIC_CL_PD6722:
-				wspeed = SYSMEM_CLTIMER_SET_0;
-				pcic_set_cdtimers(pcic, socket,
-				    window->speed,
-				    wspeed);
-				break;
-
-			case PCIC_INTEL_i82092:
-			default:
-				wspeed = pcic_calc_speed(pcic, window->speed);
-				break;
-			} /* switch */
-
-#if defined(PCIC_DEBUG)
-			if (pcic_debug)
-				cmn_err(CE_CONT,
-				    "\twindow %d speed bits = %x for "
-				    "%dns\n",
-				    win, (unsigned)wspeed, window->speed);
-#endif
-
-			pcic_putb(pcic, socket, PCIC_SYSMEM_0_STOPLOW + select,
-			    SYSMEM_LOW(base +
-			    (pages * PCIC_PAGE)-1));
-
-			wspeed |= SYSMEM_HIGH(base + (pages * PCIC_PAGE)-1);
-			pcic_putb(pcic, socket, PCIC_SYSMEM_0_STOPHI + select,
-			    wspeed);
-
-			/*
-			 * now map the card's memory pages - we start with page
-			 * 0
-			 * we also default to AM -- set page might change it
-			 */
-			base = memp->pcw_base;
-			pcic_putb(pcic, socket,
-			    PCIC_CARDMEM_0_LOW + select,
-			    CARDMEM_LOW(0 - (uint32_t)base));
-
-			pcic_putb(pcic, socket,
-			    PCIC_CARDMEM_0_HI + select,
-			    CARDMEM_HIGH(0 - (uint32_t)base) |
-			    CARDMEM_REG_ACTIVE);
-
-			/*
-			 * enable the window even though redundant
-			 * and SetPage may do it again.
-			 */
-			select = pcic_getb(pcic, socket,
-			    PCIC_MAPPING_ENABLE);
-			select |= SYSMEM_WINDOW(win);
-			pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE, select);
-			memp->pcw_offset = 0;
-			memp->pcw_status |= PCW_ENABLED;
-		} else {
-			/*
-			 * not only do we unmap the memory, the
-			 * window has been turned off.
-			 */
-			if (which && memp->pcw_status & PCW_MAPPED) {
-				ddi_regs_map_free(&memp->pcw_handle);
-				res.ra_addr_lo = memp->pcw_base;
-				res.ra_len = memp->pcw_len;
-				(void) pcmcia_free_mem(memp->res_dip, &res);
-				memp->pcw_hostmem = NULL;
-				memp->pcw_status &= ~PCW_MAPPED;
-			}
-
-			/* disable current mapping */
-			select = pcic_getb(pcic, socket, PCIC_MAPPING_ENABLE);
-			select &= ~SYSMEM_WINDOW(win);
-			pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE, select);
-			memp->pcw_status &= ~PCW_ENABLED;
-		}
-		memp->pcw_len = window->WindowSize;
-		window->handle = memp->pcw_handle;
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			xxdmp_all_regs(pcic, window->socket, -1);
-#endif
-	} else {
-		/*
-		 * This is a request for an IO window
-		 */
-		int win, tmp;
-		pcs_iowin_t *winp;
-				/* I/O windows */
-#if defined(PCIC_DEBUG)
-		if (pcic_debug)
-			cmn_err(CE_CONT, "\twindow type is I/O\n");
-#endif
-
-		/* only windows 0 and 1 can do I/O */
-		win = window->window % PCIC_NUMWINSOCK;
-		tmp = window->window / PCIC_NUMWINSOCK;
-
-		if (win >= PCIC_IOWINDOWS || tmp != window->socket) {
-			cmn_err(CE_WARN,
-			    "\twindow is out of range (%d)\n",
-			    window->window);
-			return (BAD_WINDOW);
-		}
-
-		mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-		winp = &sockp->pcs_windows[win].io;
-		winp->pcw_speed = window->speed;
-		if (window->WindowSize != 1 && window->WindowSize & 1) {
-			/* we don't want an odd-size window */
-			window->WindowSize++;
-		}
-		winp->pcw_len = window->WindowSize;
-
-		if (window->state & WS_ENABLED) {
-			if (winp->pcw_status & PCW_MAPPED) {
-				ddi_regs_map_free(&winp->pcw_handle);
-				res.ra_addr_lo = winp->pcw_base;
-				res.ra_len = winp->pcw_len;
-				(void) pcmcia_free_io(winp->res_dip, &res);
-				winp->pcw_status &= ~(PCW_MAPPED|PCW_ENABLED);
-			}
-
-			/*
-			 * if the I/O address wasn't allocated, allocate
-			 *	it now. If it was allocated, it better
-			 *	be free to use.
-			 * The winp->pcw_offset value is set and used
-			 *	later on if the particular adapter
-			 *	that we're running on has the ability
-			 *	to translate IO accesses to the card
-			 *	(such as some adapters  in the Cirrus
-			 *	Logic family).
-			 */
-			winp->pcw_offset = 0;
-
-			/*
-			 * Setup the request parameters for the
-			 *	requested base and length. If
-			 *	we're on an adapter that has
-			 *	IO window offset registers, then
-			 *	we don't need a specific base
-			 *	address, just a length, and then
-			 *	we'll cause the correct IO address
-			 *	to be generated on the socket by
-			 *	setting up the IO window offset
-			 *	registers.
-			 * For adapters that support this capability, we
-			 *	always use the IO window offset registers,
-			 *	even if the passed base/length would be in
-			 *	range.
-			 */
-			base = window->base;
-			bzero(&req, sizeof (req));
-			req.ra_len = window->WindowSize;
-
-			req.ra_addr = (uint64_t)
-			    ((pcic->pc_flags & PCF_IO_REMAP) ? 0 : base);
-			req.ra_flags = (req.ra_addr) ?
-			    NDI_RA_ALLOC_SPECIFIED : 0;
-
-			req.ra_flags |= NDI_RA_ALIGN_SIZE;
-			/* need to rethink this */
-			req.ra_boundbase = pcic->pc_iobase;
-			req.ra_boundlen = pcic->pc_iobound;
-			req.ra_flags |= NDI_RA_ALLOC_BOUNDED;
-
-#if defined(PCIC_DEBUG)
-				pcic_err(dip, 8,
-				    "\tlen 0x%"PRIx64" addr 0x%"PRIx64
-				    "bbase 0x%"PRIx64
-				    "blen 0x%"PRIx64" flags 0x%x algn 0x%"
-				    PRIx64"\n",
-				    req.ra_len, (uint64_t)req.ra_addr,
-				    req.ra_boundbase,
-				    req.ra_boundlen, req.ra_flags,
-				    req.ra_align_mask);
-#endif
-
-			/*
-			 * Try to allocate the space. If we fail this,
-			 *	return the appropriate error depending
-			 *	on whether the caller specified a
-			 *	specific base address or not.
-			 */
-			if (pcmcia_alloc_io(dip, &req, &res,
-			    &winp->res_dip) == DDI_FAILURE) {
-				winp->pcw_status &= ~PCW_ENABLED;
-				mutex_exit(&pcic->pc_lock);
-				cmn_err(CE_WARN, "Failed to alloc I/O:\n"
-				    "\tlen 0x%" PRIx64 " addr 0x%" PRIx64
-				    "bbase 0x%" PRIx64
-				    "blen 0x%" PRIx64 "flags 0x%x"
-				    "algn 0x%" PRIx64 "\n",
-				    req.ra_len, req.ra_addr,
-				    req.ra_boundbase,
-				    req.ra_boundlen, req.ra_flags,
-				    req.ra_align_mask);
-
-				return (base?BAD_BASE:BAD_SIZE);
-			} /* pcmcia_alloc_io */
-
-			/*
-			 * Don't change the original base. Either we use
-			 * the offset registers below (PCF_IO_REMAP is set)
-			 * or it was allocated correctly anyway.
-			 */
-			winp->pcw_base = res.ra_addr_lo;
-
-#if defined(PCIC_DEBUG)
-				pcic_err(dip, 8,
-				    "\tsetwindow: new base=%x orig base 0x%x\n",
-				    (unsigned)winp->pcw_base, base);
-#endif
-
-			if ((which = pcmcia_map_reg(pcic->dip,
-			    window->child,
-			    &res,
-			    (uint32_t)(window->state &
-			    0xffff) |
-			    (window->socket << 16),
-			    (caddr_t *)&winp->pcw_hostmem,
-			    &winp->pcw_handle,
-			    &window->attr,
-			    base)) != DDI_SUCCESS) {
-
-				cmn_err(CE_WARN, "pcmcia_map_reg()"
-				    "failed\n");
-
-					res.ra_addr_lo = winp->pcw_base;
-					res.ra_len = winp->pcw_len;
-					(void) pcmcia_free_io(winp->res_dip,
-					    &res);
-
-					mutex_exit(&pcic->pc_lock);
-					return (BAD_WINDOW);
-			}
-
-			window->handle = winp->pcw_handle;
-			winp->pcw_status |= PCW_MAPPED;
-
-			/* find the register set offset */
-			select = win * PCIC_IO_OFFSET;
-
-#if defined(PCIC_DEBUG)
-			if (pcic_debug) {
-				cmn_err(CE_CONT,
-				    "\tenable: window=%d, select=%x, "
-				    "base=%x, handle=%p\n",
-				    win, select,
-				    (unsigned)window->base,
-				    (void *)window->handle);
-			}
-#endif
-			/*
-			 * at this point, the register window indicator has
-			 * been converted to be an offset from the first
-			 * set of registers that are used for programming
-			 * the window mapping and the offset used to select
-			 * the correct set of registers to access the
-			 * specified socket.  This allows basing everything
-			 * off the _0 window
-			 */
-
-			/* map the I/O base in */
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STARTLOW + select,
-			    LOW_BYTE((uint32_t)winp->pcw_base));
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STARTHI + select,
-			    HIGH_BYTE((uint32_t)winp->pcw_base));
-
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STOPLOW + select,
-			    LOW_BYTE((uint32_t)winp->pcw_base +
-			    window->WindowSize - 1));
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STOPHI + select,
-			    HIGH_BYTE((uint32_t)winp->pcw_base +
-			    window->WindowSize - 1));
-
-			/*
-			 * We've got the requested IO space, now see if we
-			 *	need to adjust the IO window offset registers
-			 *	so that the correct IO address is generated
-			 *	at the socket. If this window doesn't have
-			 *	this capability, then we're all done setting
-			 *	up the IO resources.
-			 */
-			if (pcic->pc_flags & PCF_IO_REMAP) {
-
-
-				/*
-				 * Note that only 16 bits are used to program
-				 * the registers but leave 32 bits on pcw_offset
-				 * so that we can generate the original base
-				 * in get_window()
-				 */
-				winp->pcw_offset = (base - winp->pcw_base);
-
-				pcic_putb(pcic, socket,
-				    PCIC_IO_OFFSET_LOW +
-				    (win * PCIC_IO_OFFSET_OFFSET),
-				    winp->pcw_offset & 0x0ff);
-				pcic_putb(pcic, socket,
-				    PCIC_IO_OFFSET_HI +
-				    (win * PCIC_IO_OFFSET_OFFSET),
-				    (winp->pcw_offset >> 8) & 0x0ff);
-
-			} /* PCF_IO_REMAP */
-
-			/* now get the other details (size, etc) right */
-
-			/*
-			 * Set the data size control bits here. Most of the
-			 *	adapters will ignore IOMEM_16BIT when
-			 *	IOMEM_IOCS16 is set, except for the Intel
-			 *	82092, which only pays attention to the
-			 *	IOMEM_16BIT bit. Sigh... Intel can't even
-			 *	make a proper clone of their own chip.
-			 * The 82092 also apparently can't set the timing
-			 *	of I/O windows.
-			 */
-			which = (window->state & WS_16BIT) ?
-			    (IOMEM_16BIT | IOMEM_IOCS16) : 0;
-
-			switch (pcic->pc_type) {
-			case PCIC_CL_PD6729:
-			case PCIC_CL_PD6730:
-			case PCIC_CL_PD6710:
-			case PCIC_CL_PD6722:
-			case PCIC_CL_PD6832:
-				/*
-				 * Select Timer Set 1 - this will take
-				 *	effect when the PCIC_IO_CONTROL
-				 *	register is written to later on;
-				 *	the call to pcic_set_cdtimers
-				 *	just sets up the timer itself.
-				 */
-				which |= IOMEM_CLTIMER_SET_1;
-				pcic_set_cdtimers(pcic, socket,
-				    window->speed,
-				    IOMEM_CLTIMER_SET_1);
-				which |= IOMEM_IOCS16;
-				break;
-			case PCIC_TI_PCI1031:
-
-				if (window->state & WS_16BIT)
-					which |= IOMEM_WAIT16;
-
-				break;
-			case PCIC_TI_PCI1130:
-
-				if (window->state & WS_16BIT)
-					which |= IOMEM_WAIT16;
-
-				break;
-			case PCIC_INTEL_i82092:
-				break;
-			default:
-				if (window->speed >
-				    mhztons(pcic->bus_speed) * 3)
-					which |= IOMEM_WAIT16;
-#ifdef notdef
-				if (window->speed <
-				    mhztons(pcic->bus_speed) * 6)
-					which |= IOMEM_ZERO_WAIT;
-#endif
-				break;
-			} /* switch (pc_type) */
-
-			/*
-			 * Setup the data width and timing
-			 */
-			select = pcic_getb(pcic, socket, PCIC_IO_CONTROL);
-			select &= ~(PCIC_IO_WIN_MASK << (win * 4));
-			select |= IOMEM_SETWIN(win, which);
-			pcic_putb(pcic, socket, PCIC_IO_CONTROL, select);
-
-			/*
-			 * Enable the IO window
-			 */
-			select = pcic_getb(pcic, socket, PCIC_MAPPING_ENABLE);
-			pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE,
-			    select | IOMEM_WINDOW(win));
-
-			winp->pcw_status |= PCW_ENABLED;
-
-#if defined(PCIC_DEBUG)
-			if (pcic_debug) {
-				cmn_err(CE_CONT,
-				    "\twhich = %x, select = %x (%x)\n",
-				    which, select,
-				    IOMEM_SETWIN(win, which));
-				xxdmp_all_regs(pcic, window->socket * 0x40, 24);
-			}
-#endif
-		} else {
-			/*
-			 * not only do we unmap the IO space, the
-			 * window has been turned off.
-			 */
-			if (winp->pcw_status & PCW_MAPPED) {
-				ddi_regs_map_free(&winp->pcw_handle);
-				res.ra_addr_lo = winp->pcw_base;
-				res.ra_len = winp->pcw_len;
-				(void) pcmcia_free_io(winp->res_dip, &res);
-				winp->pcw_status &= ~PCW_MAPPED;
-			}
-
-			/* disable current mapping */
-			select = pcic_getb(pcic, socket,
-			    PCIC_MAPPING_ENABLE);
-			pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE,
-			    select &= ~IOMEM_WINDOW(win));
-			winp->pcw_status &= ~PCW_ENABLED;
-
-			winp->pcw_base = 0;
-			winp->pcw_len = 0;
-			winp->pcw_offset = 0;
-			window->base = 0;
-			/* now make sure we don't accidentally re-enable */
-			/* find the register set offset */
-			select = win * PCIC_IO_OFFSET;
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STARTLOW + select, 0);
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STARTHI + select, 0);
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STOPLOW + select, 0);
-			pcic_putb(pcic, socket,
-			    PCIC_IO_ADDR_0_STOPHI + select, 0);
-		}
-	}
-	mutex_exit(&pcic->pc_lock);
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_card_state()
- *	compute the instantaneous Card State information
- */
-static int
-pcic_card_state(pcicdev_t *pcic, pcic_socket_t *sockp)
-{
-	int value, result;
-#if defined(PCIC_DEBUG)
-	int orig_value;
-#endif
-
-	mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-	value = pcic_getb(pcic, sockp->pcs_socket, PCIC_INTERFACE_STATUS);
-
-#if defined(PCIC_DEBUG)
-	orig_value = value;
-	if (pcic_debug >= 8)
-		cmn_err(CE_CONT, "pcic_card_state(%p) if status = %b for %d\n",
-		    (void *)sockp,
-		    value,
-		    "\020\1BVD1\2BVD2\3CD1\4CD2\5WP\6RDY\7PWR\10~GPI",
-		    sockp->pcs_socket);
-#endif
-	/*
-	 * Lie to socket services if we are not ready.
-	 * This is when we are starting up or during debounce timeouts
-	 * or if the card is a cardbus card.
-	 */
-	if (!(sockp->pcs_flags & (PCS_STARTING|PCS_CARD_ISCARDBUS)) &&
-	    !sockp->pcs_debounce_id &&
-	    (value & PCIC_ISTAT_CD_MASK) == PCIC_CD_PRESENT_OK) {
-		result = SBM_CD;
-
-		if (value & PCIC_WRITE_PROTECT || !(value & PCIC_POWER_ON))
-			result |= SBM_WP;
-		if (value & PCIC_POWER_ON) {
-			if (value & PCIC_READY)
-				result |= SBM_RDYBSY;
-			value = (~value) & (PCIC_BVD1 | PCIC_BVD2);
-			if (value & PCIC_BVD1)
-				result |= SBM_BVD1;
-			if (value & PCIC_BVD2)
-				result |= SBM_BVD2;
-		}
-	} else
-		result = 0;
-
-	mutex_exit(&pcic->pc_lock);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 8,
-	    "pcic_card_state(%p) if status = %b for %d (rval=0x%x)\n",
-	    (void *) sockp, orig_value,
-	    "\020\1BVD1\2BVD2\3CD1\4CD2\5WP\6RDY\7PWR\10~GPI",
-	    sockp->pcs_socket, result);
-#endif
-
-	return (result);
-}
-
-/*
- * pcic_set_page()
- *	SocketServices SetPage function
- *	set the page of PC Card memory that should be in the mapped
- *	window
- */
-/*ARGSUSED*/
-static int
-pcic_set_page(dev_info_t *dip, set_page_t *page)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int select;
-	int which, socket, window;
-	uint32_t base;
-	pcs_memwin_t *memp;
-
-	/* get real socket/window numbers */
-	window = page->window % PCIC_NUMWINSOCK;
-	socket = page->window / PCIC_NUMWINSOCK;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_set_page: window=%d, socket=%d, page=%d\n",
-		    window, socket, page->page);
-	}
-#endif
-	/* only windows 2-6 work on memory */
-	if (window < PCIC_IOWINDOWS)
-		return (BAD_WINDOW);
-
-	/* only one page supported (but any size) */
-	if (page->page != 0)
-		return (BAD_PAGE);
-
-	mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-	memp = &pcic->pc_sockets[socket].pcs_windows[window].mem;
-	window -= PCIC_IOWINDOWS;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "\tpcw_base=%x, pcw_hostmem=%p, pcw_len=%x\n",
-		    (uint32_t)memp->pcw_base,
-		    (void *)memp->pcw_hostmem, memp->pcw_len);
-#endif
-
-	/* window must be enabled */
-	if (!(memp->pcw_status & PCW_ENABLED))
-		return (BAD_ATTRIBUTE);
-
-	/* find the register set offset */
-	select = window * PCIC_MEM_1_OFFSET;
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "\tselect=%x\n", select);
-#endif
-
-	/*
-	 * now map the card's memory pages - we start with page 0
-	 */
-
-	which = 0;		/* assume simple case */
-	if (page->state & PS_ATTRIBUTE) {
-		which |= CARDMEM_REG_ACTIVE;
-		memp->pcw_status |= PCW_ATTRIBUTE;
-	} else {
-		memp->pcw_status &= ~PCW_ATTRIBUTE;
-	}
-
-	/*
-	 * if caller says Write Protect, enforce it.
-	 */
-	if (page->state & PS_WP) {
-		which |= CARDMEM_WRITE_PROTECT;
-		memp->pcw_status |= PCW_WP;
-	} else {
-		memp->pcw_status &= ~PCW_WP;
-	}
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "\tmemory type = %s\n",
-		    (which & CARDMEM_REG_ACTIVE) ? "attribute" : "common");
-		if (which & CARDMEM_WRITE_PROTECT)
-			cmn_err(CE_CONT, "\twrite protect\n");
-		cmn_err(CE_CONT, "\tpage offset=%x pcw_base=%x (%x)\n",
-		    (unsigned)page->offset,
-		    (unsigned)memp->pcw_base,
-		    (int)page->offset - (int)memp->pcw_base & 0xffffff);
-	}
-#endif
-	/* address computation based on 64MB range and not larger */
-	base = (uint32_t)memp->pcw_base & 0x3ffffff;
-	pcic_putb(pcic, socket, PCIC_CARDMEM_0_LOW + select,
-	    CARDMEM_LOW((int)page->offset - (int)base));
-	(void) pcic_getb(pcic, socket, PCIC_CARDMEM_0_LOW + select);
-	pcic_putb(pcic, socket, PCIC_CARDMEM_0_HI + select,
-	    CARDMEM_HIGH((int)page->offset - base) | which);
-	(void) pcic_getb(pcic, socket, PCIC_CARDMEM_0_HI + select);
-
-	/*
-	 * while not really necessary, this just makes sure
-	 * nothing turned the window off behind our backs
-	 */
-	which = pcic_getb(pcic, socket, PCIC_MAPPING_ENABLE);
-	which |= SYSMEM_WINDOW(window);
-	pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE, which);
-	(void) pcic_getb(pcic, socket, PCIC_MAPPING_ENABLE);
-
-	memp->pcw_offset = (off_t)page->offset;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "\tbase=%p, *base=%x\n",
-		    (void *)memp->pcw_hostmem,
-		    (uint32_t)*memp->pcw_hostmem);
-
-		xxdmp_all_regs(pcic, socket, -1);
-
-		cmn_err(CE_CONT, "\tbase=%p, *base=%x\n",
-		    (void *)memp->pcw_hostmem,
-		    (uint32_t)*memp->pcw_hostmem);
-	}
-#endif
-
-	if (which & PCW_ATTRIBUTE)
-		pcic_mswait(pcic, socket, 2);
-
-	mutex_exit(&pcic->pc_lock);
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_set_vcc_level()
- *
- *	set voltage based on adapter information
- *
- *	this routine implements a limited solution for support of 3.3v cards.
- *	the general solution, which would fully support the pcmcia spec
- *	as far as allowing client drivers to request which voltage levels
- *	to be set, requires more framework support and driver changes - ess
- */
-static int
-pcic_set_vcc_level(pcicdev_t *pcic, set_socket_t *socket)
-{
-	uint32_t socket_present_state;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_set_vcc_level(pcic=%p, VccLevel=%d)\n",
-		    (void *)pcic, socket->VccLevel);
-	}
-#endif
-
-	/*
-	 * check VccLevel
-	 * if this is zero, power is being turned off
-	 * if it is non-zero, power is being turned on.
-	 */
-	if (socket->VccLevel == 0) {
-		return (0);
-	}
-
-	/*
-	 * range checking for sanity's sake
-	 */
-	if (socket->VccLevel >= pcic->pc_numpower) {
-		return (BAD_VCC);
-	}
-
-	switch (pcic->pc_io_type) {
-	/*
-	 * Yenta-compliant adapters have vcc info in the extended registers
-	 * Other adapters can be added as needed, but the 'default' case
-	 * has been left as it was previously so as not to break existing
-	 * adapters.
-	 */
-	case PCIC_IO_TYPE_YENTA:
-		/*
-		 * Here we ignore the VccLevel passed in and read the
-		 * card type from the adapter socket present state register
-		 */
-		socket_present_state =
-		    ddi_get32(pcic->handle, (uint32_t *)(pcic->ioaddr +
-		    PCIC_PRESENT_STATE_REG));
-#if defined(PCIC_DEBUG)
-		if (pcic_debug) {
-			cmn_err(CE_CONT,
-			    "socket present state = 0x%x\n",
-			    socket_present_state);
-		}
-#endif
-		switch (socket_present_state & PCIC_VCC_MASK) {
-			case PCIC_VCC_3VCARD:
-				/* fall through */
-			case PCIC_VCC_3VCARD|PCIC_VCC_5VCARD:
-				socket->VccLevel = PCIC_VCC_3VLEVEL;
-				return
-				    (POWER_3VCARD_ENABLE|POWER_OUTPUT_ENABLE);
-			case PCIC_VCC_5VCARD:
-				socket->VccLevel = PCIC_VCC_5VLEVEL;
-				return
-				    (POWER_CARD_ENABLE|POWER_OUTPUT_ENABLE);
-			default:
-				/*
-				 * if no card is present, this can be the
-				 * case of a client making a SetSocket call
-				 * after card removal. In this case we return
-				 * the current power level
-				 */
-				return ((unsigned)ddi_get8(pcic->handle,
-				    pcic->ioaddr + CB_R2_OFFSET +
-				    PCIC_POWER_CONTROL));
-		}
-
-	default:
-
-		switch (socket->VccLevel) {
-		case PCIC_VCC_3VLEVEL:
-			return (BAD_VCC);
-		case PCIC_VCC_5VLEVEL:
-			/* enable Vcc */
-			return (POWER_CARD_ENABLE|POWER_OUTPUT_ENABLE);
-		default:
-			return (BAD_VCC);
-		}
-	}
-}
-
-
-/*
- * pcic_set_socket()
- *	Socket Services SetSocket call
- *	sets basic socket configuration
- */
-static int
-pcic_set_socket(dev_info_t *dip, set_socket_t *socket)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	pcic_socket_t *sockp = &pcic->pc_sockets[socket->socket];
-	int irq, interrupt, mirq;
-	int powerlevel = 0;
-	int ind, value, orig_pwrctl;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_set_socket(dip=%p, socket=%d)"
-		    " Vcc=%d Vpp1=%d Vpp2=%d\n", (void *)dip,
-		    socket->socket, socket->VccLevel, socket->Vpp1Level,
-		    socket->Vpp2Level);
-	}
-#endif
-	/*
-	 * check VccLevel, etc. before setting mutex
-	 * if this is zero, power is being turned off
-	 * if it is non-zero, power is being turned on.
-	 * the default case is to assume Vcc only.
-	 */
-
-	/* this appears to be very implementation specific */
-
-	if (socket->Vpp1Level != socket->Vpp2Level)
-		return (BAD_VPP);
-
-	if (socket->VccLevel == 0 || !(sockp->pcs_flags & PCS_CARD_PRESENT)) {
-		powerlevel = 0;
-		sockp->pcs_vcc = 0;
-		sockp->pcs_vpp1 = 0;
-		sockp->pcs_vpp2 = 0;
-	} else {
-#if defined(PCIC_DEBUG)
-		pcic_err(dip, 9, "\tVcc=%d Vpp1Level=%d, Vpp2Level=%d\n",
-		    socket->VccLevel, socket->Vpp1Level, socket->Vpp2Level);
-#endif
-		/* valid Vcc power level? */
-		if (socket->VccLevel >= pcic->pc_numpower)
-			return (BAD_VCC);
-
-		switch (pcic_power[socket->VccLevel].PowerLevel) {
-		case 33:	/* 3.3V */
-		case 60:	/* for bad CIS in Option GPRS card */
-			if (!(pcic->pc_flags & PCF_33VCAP)) {
-				cmn_err(CE_WARN,
-				    "%s%d: Bad Request for 3.3V "
-				    "(Controller incapable)\n",
-				    ddi_get_name(pcic->dip),
-				    ddi_get_instance(pcic->dip));
-				return (BAD_VCC);
-			}
-			/* FALLTHROUGH */
-		case 50:	/* 5V */
-			if ((pcic->pc_io_type == PCIC_IO_TYPE_YENTA) &&
-			    pcic_getcb(pcic, CB_PRESENT_STATE) &
-			    CB_PS_33VCARD) {
-				/*
-				 * This is actually a 3.3V card.
-				 * Solaris Card Services
-				 * doesn't understand 3.3V
-				 * so we cheat and change
-				 * the setting to the one appropriate to 3.3V.
-				 * Note that this is the entry number
-				 * in the pcic_power[] array.
-				 */
-				sockp->pcs_vcc = PCIC_VCC_3VLEVEL;
-			} else
-				sockp->pcs_vcc = socket->VccLevel;
-			break;
-		default:
-			return (BAD_VCC);
-		}
-
-		/* enable Vcc */
-		powerlevel = POWER_CARD_ENABLE;
-
-#if defined(PCIC_DEBUG)
-		if (pcic_debug) {
-			cmn_err(CE_CONT, "\tVcc=%d powerlevel=%x\n",
-			    socket->VccLevel, powerlevel);
-		}
-#endif
-		ind = 0;		/* default index to 0 power */
-		if ((int)socket->Vpp1Level >= 0 &&
-		    socket->Vpp1Level < pcic->pc_numpower) {
-			if (!(pcic_power[socket->Vpp1Level].ValidSignals
-			    & VPP1)) {
-				return (BAD_VPP);
-			}
-			ind = pcic_power[socket->Vpp1Level].PowerLevel/10;
-			powerlevel |= pcic_vpp_levels[ind];
-			sockp->pcs_vpp1 = socket->Vpp1Level;
-		}
-		if ((int)socket->Vpp2Level >= 0 &&
-		    socket->Vpp2Level < pcic->pc_numpower) {
-			if (!(pcic_power[socket->Vpp2Level].ValidSignals
-			    & VPP2)) {
-				return (BAD_VPP);
-			}
-			ind = pcic_power[socket->Vpp2Level].PowerLevel/10;
-			powerlevel |= (pcic_vpp_levels[ind] << 2);
-			sockp->pcs_vpp2 = socket->Vpp2Level;
-		}
-
-		if (pcic->pc_flags & PCF_VPPX) {
-			/*
-			 * this adapter doesn't allow separate Vpp1/Vpp2
-			 * if one is turned on, both are turned on and only
-			 * the Vpp1 bits should be set
-			 */
-			if (sockp->pcs_vpp2 != sockp->pcs_vpp1) {
-				/* must be the same if one not zero */
-				if (sockp->pcs_vpp1 != 0 &&
-				    sockp->pcs_vpp2 != 0) {
-					cmn_err(CE_WARN,
-					    "%s%d: Bad Power Request "
-					    "(Vpp1/2 not the same)\n",
-					    ddi_get_name(pcic->dip),
-					    ddi_get_instance(pcic->dip));
-					return (BAD_VPP);
-				}
-			}
-			powerlevel &= ~(3<<2);
-		}
-
-#if defined(PCIC_DEBUG)
-		if (pcic_debug) {
-			cmn_err(CE_CONT, "\tpowerlevel=%x, ind=%x\n",
-			    powerlevel, ind);
-		}
-#endif
-	}
-	mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-	/* turn socket->IREQRouting off while programming */
-	interrupt = pcic_getb(pcic, socket->socket, PCIC_INTERRUPT);
-	interrupt &= ~PCIC_INTR_MASK;
-	if (pcic->pc_flags & PCF_USE_SMI)
-		interrupt |= PCIC_INTR_ENABLE;
-	pcic_putb(pcic, socket->socket, PCIC_INTERRUPT, interrupt);
-
-	switch (pcic->pc_type) {
-		case PCIC_INTEL_i82092:
-		pcic_82092_smiirq_ctl(pcic, socket->socket, PCIC_82092_CTL_IRQ,
-		    PCIC_82092_INT_DISABLE);
-		break;
-		default:
-		break;
-	} /* switch */
-
-	/* the SCIntMask specifies events to detect */
-	mirq = pcic_getb(pcic, socket->socket, PCIC_MANAGEMENT_INT);
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT,
-		    "\tSCIntMask=%x, interrupt=%x, mirq=%x\n",
-		    socket->SCIntMask, interrupt, mirq);
-#endif
-	mirq &= ~(PCIC_BD_DETECT|PCIC_BW_DETECT|PCIC_RD_DETECT);
-	pcic_putb(pcic, socket->socket, PCIC_MANAGEMENT_INT,
-	    mirq & ~PCIC_CHANGE_MASK);
-
-	/* save the mask we want to use */
-	sockp->pcs_intmask = socket->SCIntMask;
-
-	/*
-	 * Until there is a card present it's not worth enabling
-	 * any interrupts except "Card detect". This is done
-	 * elsewhere in the driver so don't change things if
-	 * there is no card!
-	 */
-	if (sockp->pcs_flags & PCS_CARD_PRESENT) {
-
-		/* now update the hardware to reflect events desired */
-		if (sockp->pcs_intmask & SBM_BVD1 || socket->IFType == IF_IO)
-			mirq |= PCIC_BD_DETECT;
-
-		if (sockp->pcs_intmask & SBM_BVD2)
-			mirq |= PCIC_BW_DETECT;
-
-		if (sockp->pcs_intmask & SBM_RDYBSY)
-			mirq |= PCIC_RD_DETECT;
-
-		if (sockp->pcs_intmask & SBM_CD)
-			mirq |= PCIC_CD_DETECT;
-	}
-
-	if (sockp->pcs_flags & PCS_READY) {
-		/*
-		 * card just came ready.
-		 * make sure enough time elapses
-		 * before touching it.
-		 */
-		sockp->pcs_flags &= ~PCS_READY;
-		pcic_mswait(pcic, socket->socket, 10);
-	}
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "\tstatus change set to %x\n", mirq);
-	}
-#endif
-
-	switch (pcic->pc_type) {
-		case PCIC_I82365SL:
-		case PCIC_VADEM:
-		case PCIC_VADEM_VG469:
-		/*
-		 * The Intel version has different options. This is a
-		 * special case of GPI which might be used for eject
-		 */
-
-		irq = pcic_getb(pcic, socket->socket, PCIC_CARD_DETECT);
-		if (sockp->pcs_intmask & (SBM_EJECT|SBM_INSERT) &&
-		    pcic->pc_flags & PCF_GPI_EJECT) {
-			irq |= PCIC_GPI_ENABLE;
-		} else {
-			irq &= ~PCIC_GPI_ENABLE;
-		}
-		pcic_putb(pcic, socket->socket, PCIC_CARD_DETECT, irq);
-		break;
-		case PCIC_CL_PD6710:
-		case PCIC_CL_PD6722:
-		if (socket->IFType == IF_IO) {
-			pcic_putb(pcic, socket->socket, PCIC_MISC_CTL_2, 0x0);
-			value = pcic_getb(pcic, socket->socket,
-			    PCIC_MISC_CTL_1);
-			if (pcic->pc_flags & PCF_AUDIO)
-				value |= PCIC_MC_SPEAKER_ENB;
-			pcic_putb(pcic, socket->socket, PCIC_MISC_CTL_1,
-			    value);
-		} else {
-			value = pcic_getb(pcic, socket->socket,
-			    PCIC_MISC_CTL_1);
-			value &= ~PCIC_MC_SPEAKER_ENB;
-			pcic_putb(pcic, socket->socket, PCIC_MISC_CTL_1,
-			    value);
-		}
-		break;
-		case PCIC_CL_PD6729:
-		case PCIC_CL_PD6730:
-		case PCIC_CL_PD6832:
-		value = pcic_getb(pcic, socket->socket, PCIC_MISC_CTL_1);
-		if ((socket->IFType == IF_IO) && (pcic->pc_flags & PCF_AUDIO)) {
-			value |= PCIC_MC_SPEAKER_ENB;
-		} else {
-			value &= ~PCIC_MC_SPEAKER_ENB;
-		}
-
-		if (pcic_power[sockp->pcs_vcc].PowerLevel == 33)
-			value |= PCIC_MC_3VCC;
-		else
-			value &= ~PCIC_MC_3VCC;
-
-		pcic_putb(pcic, socket->socket, PCIC_MISC_CTL_1, value);
-		break;
-
-		case PCIC_O2_OZ6912:
-		value = pcic_getcb(pcic, CB_MISCCTRL);
-		if ((socket->IFType == IF_IO) && (pcic->pc_flags & PCF_AUDIO))
-			value |= (1<<25);
-		else
-			value &= ~(1<<25);
-		pcic_putcb(pcic, CB_MISCCTRL, value);
-		if (pcic_power[sockp->pcs_vcc].PowerLevel == 33)
-			powerlevel |= 0x08;
-		break;
-
-		case PCIC_TI_PCI1250:
-		case PCIC_TI_PCI1221:
-		case PCIC_TI_PCI1225:
-		case PCIC_TI_PCI1410:
-		case PCIC_ENE_1410:
-		case PCIC_TI_PCI1510:
-		case PCIC_TI_PCI1520:
-		case PCIC_TI_PCI1420:
-		case PCIC_ENE_1420:
-		value = ddi_get8(pcic->cfg_handle,
-		    pcic->cfgaddr + PCIC_CRDCTL_REG);
-		if ((socket->IFType == IF_IO) && (pcic->pc_flags & PCF_AUDIO)) {
-			value |= PCIC_CRDCTL_SPKR_ENBL;
-		} else {
-			value &= ~PCIC_CRDCTL_SPKR_ENBL;
-		}
-		ddi_put8(pcic->cfg_handle,
-		    pcic->cfgaddr + PCIC_CRDCTL_REG, value);
-		if (pcic_power[sockp->pcs_vcc].PowerLevel == 33)
-			powerlevel |= 0x08;
-		break;
-	}
-
-	/*
-	 * ctlind processing -- we can ignore this
-	 * there aren't any outputs on the chip for this and
-	 * the GUI will display what it thinks is correct
-	 */
-
-	/*
-	 * If outputs are enabled and the power is going off
-	 * turn off outputs first.
-	 */
-
-	/* power setup -- if necessary */
-	orig_pwrctl = pcic_getb(pcic, socket->socket, PCIC_POWER_CONTROL);
-	if ((orig_pwrctl & POWER_OUTPUT_ENABLE) && sockp->pcs_vcc == 0) {
-		orig_pwrctl &= ~POWER_OUTPUT_ENABLE;
-		pcic_putb(pcic, socket->socket,
-		    PCIC_POWER_CONTROL, orig_pwrctl);
-		(void) pcic_getb(pcic, socket->socket, PCIC_POWER_CONTROL);
-	}
-
-	if (pcic->pc_flags & PCF_CBPWRCTL) {
-		value = pcic_cbus_powerctl(pcic, socket->socket);
-		powerlevel = 0;
-	} else
-		value = pcic_exca_powerctl(pcic, socket->socket, powerlevel);
-
-	if (value != SUCCESS) {
-		mutex_exit(&pcic->pc_lock);
-		return (value);
-	}
-
-	/*
-	 * If outputs were disabled and the power is going on
-	 * turn on outputs afterwards.
-	 */
-	if (!(orig_pwrctl & POWER_OUTPUT_ENABLE) && sockp->pcs_vcc != 0) {
-		orig_pwrctl = pcic_getb(pcic, socket->socket,
-		    PCIC_POWER_CONTROL);
-		orig_pwrctl |= POWER_OUTPUT_ENABLE;
-		pcic_putb(pcic, socket->socket,
-		    PCIC_POWER_CONTROL, orig_pwrctl);
-		(void) pcic_getb(pcic, socket->socket, PCIC_POWER_CONTROL);
-	}
-
-	/*
-	 * Once we have done the power stuff can re-enable management
-	 * interrupts.
-	 */
-	pcic_putb(pcic, socket->socket, PCIC_MANAGEMENT_INT, mirq);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(dip, 8, "\tmanagement int set to %x pwrctl to 0x%x "
-	    "cbctl 0x%x\n",
-	    mirq, pcic_getb(pcic, socket->socket, PCIC_POWER_CONTROL),
-	    pcic_getcb(pcic, CB_CONTROL));
-#endif
-
-	/* irq processing */
-	if (socket->IFType == IF_IO) {
-		/* IRQ only for I/O */
-		irq = socket->IREQRouting & PCIC_INTR_MASK;
-		value = pcic_getb(pcic, socket->socket, PCIC_INTERRUPT);
-		value &= ~PCIC_INTR_MASK;
-
-		/* to enable I/O operation */
-		value |= PCIC_IO_CARD | PCIC_RESET;
-		sockp->pcs_flags |= PCS_CARD_IO;
-		if (irq != sockp->pcs_irq) {
-			if (sockp->pcs_irq != 0)
-				cmn_err(CE_CONT,
-				    "SetSocket: IRQ mismatch %x != %x!\n",
-				    irq, sockp->pcs_irq);
-			else
-				sockp->pcs_irq = irq;
-		}
-		irq = sockp->pcs_irq;
-
-		pcic_putb(pcic, socket->socket, PCIC_INTERRUPT, value);
-		if (socket->IREQRouting & IRQ_ENABLE) {
-			pcic_enable_io_intr(pcic, socket->socket, irq);
-			sockp->pcs_flags |= PCS_IRQ_ENABLED;
-		} else {
-			pcic_disable_io_intr(pcic, socket->socket);
-			sockp->pcs_flags &= ~PCS_IRQ_ENABLED;
-		}
-#if defined(PCIC_DEBUG)
-		if (pcic_debug) {
-			cmn_err(CE_CONT,
-			    "\tsocket type is I/O and irq %x is %s\n", irq,
-			    (socket->IREQRouting & IRQ_ENABLE) ?
-			    "enabled" : "not enabled");
-			xxdmp_all_regs(pcic, socket->socket, 20);
-		}
-#endif
-	} else {
-		/* make sure I/O mode is off */
-
-		sockp->pcs_irq = 0;
-
-		value = pcic_getb(pcic, socket->socket, PCIC_INTERRUPT);
-		value &= ~PCIC_IO_CARD;
-		pcic_putb(pcic, socket->socket, PCIC_INTERRUPT, value);
-		pcic_disable_io_intr(pcic, socket->socket);
-		sockp->pcs_flags &= ~(PCS_CARD_IO|PCS_IRQ_ENABLED);
-	}
-
-	sockp->pcs_state &= ~socket->State;
-
-	mutex_exit(&pcic->pc_lock);
-	return (SUCCESS);
-}
-
-/*
- * pcic_inquire_socket()
- *	SocketServices InquireSocket function
- *	returns basic characteristics of the socket
- */
-/*ARGSUSED*/
-static int
-pcic_inquire_socket(dev_info_t *dip, inquire_socket_t *socket)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int value;
-
-	socket->SCIntCaps = PCIC_DEFAULT_INT_CAPS;
-	socket->SCRptCaps = PCIC_DEFAULT_RPT_CAPS;
-	socket->CtlIndCaps = PCIC_DEFAULT_CTL_CAPS;
-	value = pcic->pc_sockets[socket->socket].pcs_flags;
-	socket->SocketCaps = (value & PCS_SOCKET_IO) ? IF_IO : IF_MEMORY;
-	socket->ActiveHigh = 0;
-	/* these are the usable IRQs */
-	socket->ActiveLow = 0xfff0;
-	return (SUCCESS);
-}
-
-/*
- * pcic_inquire_window()
- *	SocketServices InquireWindow function
- *	returns detailed characteristics of the window
- *	this is where windows get tied to sockets
- */
-/*ARGSUSED*/
-static int
-pcic_inquire_window(dev_info_t *dip, inquire_window_t *window)
-{
-	int type, socket;
-
-	type = window->window % PCIC_NUMWINSOCK;
-	socket = window->window / PCIC_NUMWINSOCK;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug >= 8)
-		cmn_err(CE_CONT,
-		    "pcic_inquire_window: window = %d/%d socket=%d\n",
-		    window->window, type, socket);
-#endif
-	if (type < PCIC_IOWINDOWS) {
-		window->WndCaps = WC_IO|WC_WAIT;
-		type = IF_IO;
-	} else {
-		window->WndCaps = WC_COMMON|WC_ATTRIBUTE|WC_WAIT;
-		type = IF_MEMORY;
-	}
-
-	/* initialize the socket map - one socket per window */
-	PR_ZERO(window->Sockets);
-	PR_SET(window->Sockets, socket);
-
-	if (type == IF_IO) {
-		iowin_char_t *io;
-		io = &window->iowin_char;
-		io->IOWndCaps = WC_BASE|WC_SIZE|WC_WENABLE|WC_8BIT|
-		    WC_16BIT;
-		io->FirstByte = (baseaddr_t)IOMEM_FIRST;
-		io->LastByte = (baseaddr_t)IOMEM_LAST;
-		io->MinSize = IOMEM_MIN;
-		io->MaxSize = IOMEM_MAX;
-		io->ReqGran = IOMEM_GRAN;
-		io->AddrLines = IOMEM_DECODE;
-		io->EISASlot = 0;
-	} else {
-		mem_win_char_t *mem;
-		mem = &window->mem_win_char;
-		mem->MemWndCaps = WC_BASE|WC_SIZE|WC_WENABLE|WC_8BIT|
-		    WC_16BIT|WC_WP;
-
-		mem->FirstByte = (baseaddr_t)MEM_FIRST;
-		mem->LastByte = (baseaddr_t)MEM_LAST;
-
-		mem->MinSize = MEM_MIN;
-		mem->MaxSize = MEM_MAX;
-		mem->ReqGran = PCIC_PAGE;
-		mem->ReqBase = 0;
-		mem->ReqOffset = PCIC_PAGE;
-		mem->Slowest = MEM_SPEED_MAX;
-		mem->Fastest = MEM_SPEED_MIN;
-	}
-	return (SUCCESS);
-}
-
-/*
- * pcic_get_adapter()
- *	SocketServices GetAdapter function
- *	this is nearly a no-op.
- */
-/*ARGSUSED*/
-static int
-pcic_get_adapter(dev_info_t *dip, get_adapter_t *adapt)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-
-	if (pcic->pc_flags & PCF_INTRENAB)
-		adapt->SCRouting = IRQ_ENABLE;
-	adapt->state = 0;
-	return (SUCCESS);
-}
-
-/*
- * pcic_get_page()
- *	SocketServices GetPage function
- *	returns info about the window
- */
-/*ARGSUSED*/
-static int
-pcic_get_page(dev_info_t *dip, get_page_t *page)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int socket, window;
-	pcs_memwin_t *winp;
-
-	socket = page->window / PCIC_NUMWINSOCK;
-	window = page->window % PCIC_NUMWINSOCK;
-
-	/* I/O windows are the first two */
-	if (window < PCIC_IOWINDOWS || socket >= pcic->pc_numsockets) {
-		return (BAD_WINDOW);
-	}
-
-	winp = &pcic->pc_sockets[socket].pcs_windows[window].mem;
-
-	if (page->page != 0)
-		return (BAD_PAGE);
-
-	page->state = 0;
-	if (winp->pcw_status & PCW_ENABLED)
-		page->state |= PS_ENABLED;
-	if (winp->pcw_status & PCW_ATTRIBUTE)
-		page->state |= PS_ATTRIBUTE;
-	if (winp->pcw_status & PCW_WP)
-		page->state |= PS_WP;
-
-	page->offset = (off_t)winp->pcw_offset;
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_get_socket()
- *	SocketServices GetSocket
- *	returns information about the current socket setting
- */
-/*ARGSUSED*/
-static int
-pcic_get_socket(dev_info_t *dip, get_socket_t *socket)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int socknum, irq_enabled;
-	pcic_socket_t *sockp;
-
-	socknum = socket->socket;
-	sockp = &pcic->pc_sockets[socknum];
-
-	socket->SCIntMask = sockp->pcs_intmask;
-	sockp->pcs_state = pcic_card_state(pcic, sockp);
-
-	socket->state = sockp->pcs_state;
-	if (socket->state & SBM_CD) {
-		socket->VccLevel = sockp->pcs_vcc;
-		socket->Vpp1Level = sockp->pcs_vpp1;
-		socket->Vpp2Level = sockp->pcs_vpp2;
-		irq_enabled = (sockp->pcs_flags & PCS_IRQ_ENABLED) ?
-		    IRQ_ENABLE : 0;
-		socket->IRQRouting = sockp->pcs_irq | irq_enabled;
-		socket->IFType = (sockp->pcs_flags & PCS_CARD_IO) ?
-		    IF_IO : IF_MEMORY;
-	} else {
-		socket->VccLevel = 0;
-		socket->Vpp1Level = 0;
-		socket->Vpp2Level = 0;
-		socket->IRQRouting = 0;
-		socket->IFType = IF_MEMORY;
-	}
-	socket->CtlInd = 0;	/* no indicators */
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_get_status()
- *	SocketServices GetStatus
- *	returns status information about the PC Card in
- *	the selected socket
- */
-/*ARGSUSED*/
-static int
-pcic_get_status(dev_info_t *dip, get_ss_status_t *status)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int socknum, irq_enabled;
-	pcic_socket_t *sockp;
-
-	socknum = status->socket;
-	sockp = &pcic->pc_sockets[socknum];
-
-	status->CardState = pcic_card_state(pcic, sockp);
-	status->SocketState = sockp->pcs_state;
-	status->CtlInd = 0;	/* no indicators */
-
-	if (sockp->pcs_flags & PCS_CARD_PRESENT)
-		status->SocketState |= SBM_CD;
-	if (status->CardState & SBM_CD) {
-		irq_enabled = (sockp->pcs_flags & PCS_CARD_ENABLED) ?
-		    IRQ_ENABLE : 0;
-		status->IRQRouting = sockp->pcs_irq | irq_enabled;
-		status->IFType = (sockp->pcs_flags & PCS_CARD_IO) ?
-		    IF_IO : IF_MEMORY;
-	} else {
-		status->IRQRouting = 0;
-		status->IFType = IF_MEMORY;
-	}
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug >= 8)
-		cmn_err(CE_CONT, "pcic_get_status: socket=%d, CardState=%x,"
-		    "SocketState=%x\n",
-		    socknum, status->CardState, status->SocketState);
-#endif
-	switch (pcic->pc_type) {
-	uint32_t present_state;
-	case PCIC_TI_PCI1410:
-	case PCIC_TI_PCI1520:
-	case PCIC_TI_PCI1420:
-	case PCIC_ENE_1420:
-	case PCIC_TOSHIBA_TOPIC100:
-	case PCIC_TOSHIBA_TOPIC95:
-	case PCIC_TOSHIBA_VENDOR:
-	case PCIC_O2MICRO_VENDOR:
-	case PCIC_TI_VENDOR:
-	case PCIC_RICOH_VENDOR:
-		present_state = pcic_getcb(pcic, CB_PRESENT_STATE);
-		if (present_state & PCIC_CB_CARD)
-			status->IFType = IF_CARDBUS;
-#if defined(PCIC_DEBUG)
-		if (pcic_debug >= 8)
-			cmn_err(CE_CONT,
-			    "pcic_get_status: present_state=0x%x\n",
-			    present_state);
-#endif
-		break;
-	default:
-		break;
-	}
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_get_window()
- *	SocketServices GetWindow function
- *	returns state information about the specified window
- */
-/*ARGSUSED*/
-static int
-pcic_get_window(dev_info_t *dip, get_window_t *window)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int socket, win;
-	pcic_socket_t *sockp;
-	pcs_memwin_t *winp;
-
-	socket = window->window / PCIC_NUMWINSOCK;
-	win = window->window % PCIC_NUMWINSOCK;
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT, "pcic_get_window(socket=%d, window=%d)\n",
-		    socket, win);
-	}
-#endif
-
-	if (socket > pcic->pc_numsockets)
-		return (BAD_WINDOW);
-
-	sockp = &pcic->pc_sockets[socket];
-	winp = &sockp->pcs_windows[win].mem;
-
-	window->socket = socket;
-	window->size = winp->pcw_len;
-	window->speed = winp->pcw_speed;
-	window->handle = (ddi_acc_handle_t)winp->pcw_handle;
-	window->base = (uint32_t)winp->pcw_base + winp->pcw_offset;
-
-	if (win >= PCIC_IOWINDOWS) {
-		window->state = 0;
-	} else {
-		window->state = WS_IO;
-	}
-	if (winp->pcw_status & PCW_ENABLED)
-		window->state |= WS_ENABLED;
-
-	if (winp->pcw_status & PCS_CARD_16BIT)
-		window->state |= WS_16BIT;
-#if defined(PCIC_DEBUG)
-	if (pcic_debug)
-		cmn_err(CE_CONT, "\tsize=%d, speed=%d, base=%p, state=%x\n",
-		    window->size, (unsigned)window->speed,
-		    (void *)window->handle, window->state);
-#endif
-
-	return (SUCCESS);
-}
-
-/*
- * pcic_ll_reset
- *	low level reset
- *	separated out so it can be called when already locked
- *
- *	There are two variables that control the RESET timing:
- *		pcic_prereset_time - time in mS before asserting RESET
- *		pcic_reset_time - time in mS to assert RESET
- *
- */
-int pcic_prereset_time = 1;
-int pcic_reset_time = 10;
-int pcic_postreset_time = 20;
-int pcic_vpp_is_vcc_during_reset = 0;
-
-static int
-pcic_ll_reset(pcicdev_t *pcic, int socket)
-{
-	int windowbits, iobits;
-	uint32_t pwr;
-
-	/* save windows that were on */
-	windowbits = pcic_getb(pcic, socket, PCIC_MAPPING_ENABLE);
-	if (pcic_reset_time == 0)
-		return (windowbits);
-	/* turn all windows off */
-	pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE, 0);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 6,
-	    "pcic_ll_reset(socket %d) powerlevel=%x cbctl 0x%x cbps 0x%x\n",
-	    socket, pcic_getb(pcic, socket, PCIC_POWER_CONTROL),
-	    pcic_getcb(pcic, CB_CONTROL),
-	    pcic_getcb(pcic, CB_PRESENT_STATE));
-#endif
-
-	if (pcic_vpp_is_vcc_during_reset) {
-
-	/*
-	 * Set VPP to VCC for the duration of the reset - for aironet
-	 * card.
-	 */
-		if (pcic->pc_flags & PCF_CBPWRCTL) {
-		pwr = pcic_getcb(pcic, CB_CONTROL);
-		pcic_putcb(pcic, CB_CONTROL, (pwr&~CB_C_VPPMASK)|CB_C_VPPVCC);
-		(void) pcic_getcb(pcic, CB_CONTROL);
-		} else {
-		pwr = pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-		pcic_putb(pcic, socket, PCIC_POWER_CONTROL,
-		    pwr | 1);
-		(void) pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-		}
-	}
-
-	if (pcic_prereset_time > 0) {
-		pcic_err(pcic->dip, 8, "pcic_ll_reset pre_wait %d mS\n",
-		    pcic_prereset_time);
-		pcic_mswait(pcic, socket, pcic_prereset_time);
-	}
-
-	/* turn interrupts off and start a reset */
-	pcic_err(pcic->dip, 8,
-	    "pcic_ll_reset turn interrupts off and start a reset\n");
-	iobits = pcic_getb(pcic, socket, PCIC_INTERRUPT);
-	iobits &= ~(PCIC_INTR_MASK | PCIC_RESET);
-	pcic_putb(pcic, socket, PCIC_INTERRUPT, iobits);
-	(void) pcic_getb(pcic, socket, PCIC_INTERRUPT);
-
-	switch (pcic->pc_type) {
-		case PCIC_INTEL_i82092:
-		pcic_82092_smiirq_ctl(pcic, socket, PCIC_82092_CTL_IRQ,
-		    PCIC_82092_INT_DISABLE);
-		break;
-		default:
-		break;
-	} /* switch */
-
-	pcic->pc_sockets[socket].pcs_state = 0;
-
-	if (pcic_reset_time > 0) {
-		pcic_err(pcic->dip, 8, "pcic_ll_reset reset_wait %d mS\n",
-		    pcic_reset_time);
-		pcic_mswait(pcic, socket, pcic_reset_time);
-	}
-
-	pcic_err(pcic->dip, 8, "pcic_ll_reset take it out of reset now\n");
-
-	/* take it out of RESET now */
-	pcic_putb(pcic, socket, PCIC_INTERRUPT, PCIC_RESET | iobits);
-	(void) pcic_getb(pcic, socket, PCIC_INTERRUPT);
-
-	/*
-	 * can't access the card for 20ms, but we really don't
-	 * want to sit around that long. The pcic is still usable.
-	 * memory accesses must wait for RDY to come up.
-	 */
-	if (pcic_postreset_time > 0) {
-		pcic_err(pcic->dip, 8, "pcic_ll_reset post_wait %d mS\n",
-		    pcic_postreset_time);
-		pcic_mswait(pcic, socket, pcic_postreset_time);
-	}
-
-	if (pcic_vpp_is_vcc_during_reset > 1) {
-
-	/*
-	 * Return VPP power to whatever it was before.
-	 */
-		if (pcic->pc_flags & PCF_CBPWRCTL) {
-		pcic_putcb(pcic, CB_CONTROL, pwr);
-		(void) pcic_getcb(pcic, CB_CONTROL);
-		} else {
-		pcic_putb(pcic, socket, PCIC_POWER_CONTROL, pwr);
-		(void) pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-		}
-	}
-
-	pcic_err(pcic->dip, 7, "pcic_ll_reset returning 0x%x\n", windowbits);
-
-	return (windowbits);
-}
-
-/*
- * pcic_reset_socket()
- *	SocketServices ResetSocket function
- *	puts the PC Card in the socket into the RESET state
- *	and then takes it out after the the cycle time
- *	The socket is back to initial state when done
- */
-static int
-pcic_reset_socket(dev_info_t *dip, int socket, int mode)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int value;
-	int i, mint;
-	pcic_socket_t *sockp;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug >= 8)
-		cmn_err(CE_CONT, "pcic_reset_socket(%p, %d, %d/%s)\n",
-		    (void *)dip, socket, mode,
-		    mode == RESET_MODE_FULL ? "full" : "partial");
-#endif
-
-	mutex_enter(&pcic->pc_lock); /* protect the registers */
-
-	/* Turn off management interupts. */
-	mint = pcic_getb(pcic, socket, PCIC_MANAGEMENT_INT);
-	pcic_putb(pcic, socket, PCIC_MANAGEMENT_INT, mint & ~PCIC_CHANGE_MASK);
-
-	sockp = &pcic->pc_sockets[socket];
-
-	value = pcic_ll_reset(pcic, socket);
-	if (mode == RESET_MODE_FULL) {
-		/* disable and unmap all mapped windows */
-		for (i = 0; i < PCIC_NUMWINSOCK; i++) {
-			if (i < PCIC_IOWINDOWS) {
-				if (sockp->pcs_windows[i].io.pcw_status &
-				    PCW_MAPPED) {
-					pcs_iowin_t *io;
-					io = &sockp->pcs_windows[i].io;
-					io->pcw_status &= ~PCW_ENABLED;
-				}
-			} else {
-				if (sockp->pcs_windows[i].mem.pcw_status &
-				    PCW_MAPPED) {
-					pcs_memwin_t *mem;
-					mem = &sockp->pcs_windows[i].mem;
-					mem->pcw_status &= ~PCW_ENABLED;
-				}
-			}
-		}
-	} else {
-				/* turn windows back on */
-		pcic_putb(pcic, socket, PCIC_MAPPING_ENABLE, value);
-		/* wait the rest of the time here */
-		pcic_mswait(pcic, socket, 10);
-	}
-	pcic_putb(pcic, socket, PCIC_MANAGEMENT_INT, mint);
-	mutex_exit(&pcic->pc_lock);
-	return (SUCCESS);
-}
-
-/*
- * pcic_set_interrupt()
- *	SocketServices SetInterrupt function
- */
-static int
-pcic_set_interrupt(dev_info_t *dip, set_irq_handler_t *handler)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	int value = DDI_SUCCESS;
-	inthandler_t *intr;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_set_interrupt: entered pc_intr_mode=0x%x\n",
-		    pcic->pc_intr_mode);
-		cmn_err(CE_CONT,
-		    "\t irq_top=%p handler=%p handler_id=%x\n",
-		    (void *)pcic->irq_top, (void *)handler->handler,
-		    handler->handler_id);
-	}
-#endif
-
-	/*
-	 * If we're on a PCI bus, we route all IO IRQs through a single
-	 *	PCI interrupt (typically INT A#) so we don't have to do
-	 *	much other than add the caller to general interrupt handler
-	 *	and set some state.
-	 */
-
-	intr = kmem_zalloc(sizeof (inthandler_t), KM_NOSLEEP);
-	if (intr == NULL)
-		return (NO_RESOURCE);
-
-	switch (pcic->pc_intr_mode) {
-	case PCIC_INTR_MODE_PCI_1:
-		/*
-		 * We only allow above-lock-level IO IRQ handlers
-		 *	in the PCI bus case.
-		 */
-
-		mutex_enter(&pcic->intr_lock);
-
-		if (pcic->irq_top == NULL) {
-			pcic->irq_top = intr;
-			pcic->irq_current = pcic->irq_top;
-		} else {
-			while (pcic->irq_current->next != NULL)
-			pcic->irq_current = pcic->irq_current->next;
-			pcic->irq_current->next = intr;
-			pcic->irq_current = pcic->irq_current->next;
-		}
-
-		pcic->irq_current->intr =
-		    (ddi_intr_handler_t *)handler->handler;
-		pcic->irq_current->handler_id = handler->handler_id;
-		pcic->irq_current->arg1 = handler->arg1;
-		pcic->irq_current->arg2 = handler->arg2;
-		pcic->irq_current->socket = handler->socket;
-
-		mutex_exit(&pcic->intr_lock);
-
-		handler->iblk_cookie = &pcic->pc_pri;
-		handler->idev_cookie = &pcic->pc_dcookie;
-		break;
-
-	default:
-		intr->intr = (ddi_intr_handler_t *)handler->handler;
-		intr->handler_id = handler->handler_id;
-		intr->arg1 = handler->arg1;
-		intr->arg2 = handler->arg2;
-		intr->socket = handler->socket;
-		intr->irq = handler->irq;
-
-		/*
-		 * need to revisit this to see if interrupts can be
-		 * shared someday. Note that IRQ is set in the common
-		 * code.
-		 */
-		mutex_enter(&pcic->pc_lock);
-		if (pcic->pc_handlers == NULL) {
-			pcic->pc_handlers = intr;
-			intr->next = intr->prev = intr;
-		} else {
-			insque(intr, pcic->pc_handlers);
-		}
-		mutex_exit(&pcic->pc_lock);
-
-		break;
-	}
-
-	/*
-	 * need to fill in cookies in event of multiple high priority
-	 * interrupt handlers on same IRQ
-	 */
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_set_interrupt: exit irq_top=%p value=%d\n",
-		    (void *)pcic->irq_top, value);
-	}
-#endif
-
-	if (value == DDI_SUCCESS) {
-		return (SUCCESS);
-	} else {
-		return (BAD_IRQ);
-	}
-}
-
-/*
- * pcic_clear_interrupt()
- *	SocketServices ClearInterrupt function
- *
- *	Interrupts for PCIC are complicated by the fact that we must
- *	follow several different models for interrupts.
- *	ISA: there is an interrupt per adapter and per socket and
- *		they can't be shared.
- *	PCI: some adapters have one PCI interrupt available while others
- *		have up to 4.  Solaris may or may not allow us to use more
- *		than 1 so we essentially share them all at this point.
- *	Hybrid: PCI bridge but interrupts wired to host interrupt controller.
- *		This is like ISA but we have to fudge and create an intrspec
- *		that PCI's parent understands and bypass the PCI nexus.
- *	multifunction: this requires sharing the interrupts on a per-socket
- *		basis.
- */
-static int
-pcic_clear_interrupt(dev_info_t *dip, clear_irq_handler_t *handler)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-	inthandler_t *intr, *prev, *current;
-	int i;
-
-	/*
-	 * If we're on a PCI bus, we route all IO IRQs through a single
-	 *	PCI interrupt (typically INT A#) so we don't have to do
-	 *	much other than remove the caller from the general
-	 *	interrupt handler callout list.
-	 */
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_clear_interrupt: entered pc_intr_mode=0x%x\n",
-		    pcic->pc_intr_mode);
-		cmn_err(CE_CONT,
-		    "\t irq_top=%p handler=%p handler_id=%x\n",
-		    (void *)pcic->irq_top, (void *)handler->handler,
-		    handler->handler_id);
-	}
-#endif
-
-	switch (pcic->pc_intr_mode) {
-	case PCIC_INTR_MODE_PCI_1:
-
-		mutex_enter(&pcic->intr_lock);
-		if (pcic->irq_top == NULL) {
-			mutex_exit(&pcic->intr_lock);
-			return (BAD_IRQ);
-		}
-
-		intr = NULL;
-		pcic->irq_current = pcic->irq_top;
-
-		while ((pcic->irq_current != NULL) &&
-		    (pcic->irq_current->handler_id !=
-		    handler->handler_id)) {
-			intr = pcic->irq_current;
-			pcic->irq_current = pcic->irq_current->next;
-		}
-
-		if (pcic->irq_current == NULL) {
-			mutex_exit(&pcic->intr_lock);
-			return (BAD_IRQ);
-		}
-
-		if (intr != NULL) {
-			intr->next = pcic->irq_current->next;
-		} else {
-			pcic->irq_top = pcic->irq_current->next;
-		}
-
-		current = pcic->irq_current;
-		pcic->irq_current = pcic->irq_top;
-		mutex_exit(&pcic->intr_lock);
-		kmem_free(current, sizeof (inthandler_t));
-
-		break;
-
-	default:
-
-		mutex_enter(&pcic->pc_lock);
-		intr = pcic_handlers;
-		prev = (inthandler_t *)&pcic_handlers;
-
-		while (intr != NULL) {
-			if (intr->handler_id == handler->handler_id) {
-			i = intr->irq & PCIC_INTR_MASK;
-			if (--pcic_irq_map[i].count == 0) {
-				/* multi-handler form */
-				(void) ddi_intr_disable(pcic->pc_intr_htblp[i]);
-				(void) ddi_intr_remove_handler(
-				    pcic->pc_intr_htblp[i]);
-				(void) ddi_intr_free(pcic->pc_intr_htblp[i]);
-				(void) pcmcia_return_intr(pcic->dip, i);
-#if defined(PCIC_DEBUG)
-				if (pcic_debug) {
-					cmn_err(CE_CONT,
-					    "removing interrupt %d at %s "
-					    "priority\n", i, "high");
-					cmn_err(CE_CONT,
-					    "ddi_remove_intr(%p, %x, %p)\n",
-					    (void *)dip,
-					    0,
-					    (void *)intr->iblk_cookie);
-				}
-#endif
-			}
-			prev->next = intr->next;
-			kmem_free(intr, sizeof (inthandler_t));
-			intr = prev->next;
-			} else {
-			prev = intr;
-			intr = intr->next;
-			} /* if (handler_id) */
-		} /* while */
-
-		mutex_exit(&pcic->pc_lock);
-	}
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug) {
-		cmn_err(CE_CONT,
-		    "pcic_clear_interrupt: exit irq_top=%p\n",
-		    (void *)pcic->irq_top);
-	}
-#endif
-
-
-	return (SUCCESS);
-}
-
-struct intel_regs {
-	char *name;
-	int   off;
-	char *fmt;
-} iregs[] = {
-	{"ident     ", 0},
-	{"if-status ", 1, "\020\1BVD1\2BVD2\3CD1\4CD2\5WP\6RDY\7PWR\10~GPI"},
-	{"power     ", 2, "\020\1Vpp1c0\2Vpp1c1\3Vpp2c0\4Vpp2c1\5PE\6AUTO"
-		"\7DRD\10OE"},
-	{"cardstatus", 4, "\020\1BD\2BW\3RC\4CD\5GPI\6R1\7R2\010R3"},
-	{"enable    ", 6, "\020\1MW0\2MW1\3MW2\4MW3\5MW4\6MEM16\7IO0\10IO1"},
-	{"cd-gcr    ", 0x16, "\020\1MDI16\2CRE\3GPIE\4GPIT\5CDR\6S/W"},
-	{"GCR       ", 0x1e, "\020\1PD\2LEVEL\3WCSC\4PLS14"},
-	{"int-gcr   ", 3, "\020\5INTR\6IO\7~RST\10RI"},
-	{"management", 5, "\020\1BDE\2BWE\3RE\4CDE"},
-	{"volt-sense", 0x1f, "\020\1A_VS1\2A_VS2\3B_VS1\4B_VS2"},
-	{"volt-sel  ", 0x2f, "\020\5EXTCONF\6BUSSELECT\7MIXEDV\10ISAV"},
-	{"VG ext A  ", 0x3c, "\20\3IVS\4CABLE\5CSTEP\6TEST\7RIO"},
-	{"io-ctrl   ", 7, "\020\1DS0\2IOCS0\3ZWS0\4WS0\5DS1\6IOS1\7ZWS1\10WS1"},
-	{"io0-slow  ", 8},
-	{"io0-shi   ", 9},
-	{"io0-elow  ", 0xa},
-	{"io0-ehi   ", 0xb},
-	{"io1-slow  ", 0xc},
-	{"io1-shi   ", 0xd},
-	{"io1-elow  ", 0xe},
-	{"io1-ehi   ", 0xf},
-	{"mem0-slow ", 0x10},
-	{"mem0-shi  ", 0x11, "\020\7ZW\10DS"},
-	{"mem0-elow ", 0x12},
-	{"mem0-ehi  ", 0x13, "\020\7WS0\10WS1"},
-	{"card0-low ", 0x14},
-	{"card0-hi  ", 0x15, "\020\7AM\10WP"},
-	{"mem1-slow ", 0x18},
-	{"mem1-shi  ", 0x19, "\020\7ZW\10DS"},
-	{"mem1-elow ", 0x1a},
-	{"mem1-ehi  ", 0x1b, "\020\7WS0\10WS1"},
-	{"card1-low ", 0x1c},
-	{"card1-hi  ", 0x1d, "\020\7AM\10WP"},
-	{"mem2-slow ", 0x20},
-	{"mem2-shi  ", 0x21, "\020\7ZW\10DS"},
-	{"mem2-elow ", 0x22},
-	{"mem2-ehi  ", 0x23, "\020\7WS0\10WS1"},
-	{"card2-low ", 0x24},
-	{"card2-hi  ", 0x25, "\020\7AM\10WP"},
-	{"mem3-slow ", 0x28},
-	{"mem3-shi  ", 0x29, "\020\7ZW\10DS"},
-	{"mem3-elow ", 0x2a},
-	{"mem3-ehi  ", 0x2b, "\020\7WS0\10WS1"},
-	{"card3-low ", 0x2c},
-	{"card3-hi  ", 0x2d, "\020\7AM\10WP"},
-
-	{"mem4-slow ", 0x30},
-	{"mem4-shi  ", 0x31, "\020\7ZW\10DS"},
-	{"mem4-elow ", 0x32},
-	{"mem4-ehi  ", 0x33, "\020\7WS0\10WS1"},
-	{"card4-low ", 0x34},
-	{"card4-hi  ", 0x35, "\020\7AM\10WP"},
-	{"mpage0    ", 0x40},
-	{"mpage1    ", 0x41},
-	{"mpage2    ", 0x42},
-	{"mpage3    ", 0x43},
-	{"mpage4    ", 0x44},
-	{NULL},
-};
-
-static struct intel_regs cregs[] = {
-	{"misc-ctl1 ", 0x16, "\20\2VCC3\3PMI\4PSI\5SPKR\10INPACK"},
-	{"fifo      ", 0x17, "\20\6DIOP\7DMEMP\10EMPTY"},
-	{"misc-ctl2 ", 0x1e, "\20\1XCLK\2LOW\3SUSP\4CORE5V\5TCD\10RIOUT"},
-	{"chip-info ", 0x1f, "\20\6DUAL"},
-	{"IO-offlow0", 0x36},
-	{"IO-offhi0 ", 0x37},
-	{"IO-offlow1", 0x38},
-	{"IO-offhi1 ", 0x39},
-	NULL,
-};
-
-static struct intel_regs cxregs[] = {
-	{"ext-ctl-1 ", 0x03,
-		"\20\1VCCLCK\2AUTOCLR\3LED\4INVIRQC\5INVIRQM\6PUC"},
-	{"misc-ctl3 ", 0x25, "\20\5HWSUSP"},
-	{"mem0-up   ", 0x05},
-	{"mem1-up   ", 0x06},
-	{"mem2-up   ", 0x07},
-	{"mem3-up   ", 0x08},
-	{"mem4-up   ", 0x09},
-	{NULL}
-};
-
-void
-xxdmp_cl_regs(pcicdev_t *pcic, int socket, uint32_t len)
-{
-	int i, value, j;
-	char buff[256];
-	char *fmt;
-
-	cmn_err(CE_CONT, "--------- Cirrus Logic Registers --------\n");
-	for (buff[0] = '\0', i = 0; cregs[i].name != NULL && len-- != 0; i++) {
-		int sval;
-		if (cregs[i].off == PCIC_MISC_CTL_2)
-			sval = 0;
-		else
-			sval = socket;
-		value = pcic_getb(pcic, sval, cregs[i].off);
-		if (i & 1) {
-			if (cregs[i].fmt)
-				fmt = "%s\t%s\t%b\n";
-			else
-				fmt = "%s\t%s\t%x\n";
-			cmn_err(CE_CONT, fmt, buff,
-			    cregs[i].name, value, cregs[i].fmt);
-			buff[0] = '\0';
-		} else {
-			if (cregs[i].fmt)
-				fmt = "\t%s\t%b";
-			else
-				fmt = "\t%s\t%x";
-			(void) sprintf(buff, fmt,
-			    cregs[i].name, value, cregs[i].fmt);
-			for (j = strlen(buff); j < 40; j++)
-				buff[j] = ' ';
-			buff[40] = '\0';
-		}
-	}
-	cmn_err(CE_CONT, "%s\n", buff);
-
-	i = pcic_getb(pcic, socket, PCIC_TIME_SETUP_0);
-	j = pcic_getb(pcic, socket, PCIC_TIME_SETUP_1);
-	cmn_err(CE_CONT, "\tsetup-tim0\t%x\tsetup-tim1\t%x\n", i, j);
-
-	i = pcic_getb(pcic, socket, PCIC_TIME_COMMAND_0);
-	j = pcic_getb(pcic, socket, PCIC_TIME_COMMAND_1);
-	cmn_err(CE_CONT, "\tcmd-tim0  \t%x\tcmd-tim1  \t%x\n", i, j);
-
-	i = pcic_getb(pcic, socket, PCIC_TIME_RECOVER_0);
-	j = pcic_getb(pcic, socket, PCIC_TIME_RECOVER_1);
-	cmn_err(CE_CONT, "\trcvr-tim0 \t%x\trcvr-tim1 \t%x\n", i, j);
-
-	cmn_err(CE_CONT, "--------- Extended Registers  --------\n");
-
-	for (buff[0] = '\0', i = 0; cxregs[i].name != NULL && len-- != 0; i++) {
-		value = clext_reg_read(pcic, socket, cxregs[i].off);
-		if (i & 1) {
-			if (cxregs[i].fmt)
-				fmt = "%s\t%s\t%b\n";
-			else
-				fmt = "%s\t%s\t%x\n";
-			cmn_err(CE_CONT, fmt, buff,
-			    cxregs[i].name, value, cxregs[i].fmt);
-			buff[0] = '\0';
-		} else {
-			if (cxregs[i].fmt)
-				fmt = "\t%s\t%b";
-			else
-				fmt = "\t%s\t%x";
-			(void) sprintf(buff, fmt,
-			    cxregs[i].name, value, cxregs[i].fmt);
-			for (j = strlen(buff); j < 40; j++)
-				buff[j] = ' ';
-			buff[40] = '\0';
-		}
-	}
-}
-
-#if defined(PCIC_DEBUG)
-static void
-xxdmp_all_regs(pcicdev_t *pcic, int socket, uint32_t len)
-{
-	int i, value, j;
-	char buff[256];
-	char *fmt;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug < 2)
-		return;
-#endif
-	cmn_err(CE_CONT,
-	    "----------- PCIC Registers for socket %d---------\n",
-	    socket);
-	cmn_err(CE_CONT,
-	    "\tname       value	                name       value\n");
-
-	for (buff[0] = '\0', i = 0; iregs[i].name != NULL && len-- != 0; i++) {
-		value = pcic_getb(pcic, socket, iregs[i].off);
-		if (i & 1) {
-			if (iregs[i].fmt)
-				fmt = "%s\t%s\t%b\n";
-			else
-				fmt = "%s\t%s\t%x\n";
-			cmn_err(CE_CONT, fmt, buff,
-			    iregs[i].name, value, iregs[i].fmt);
-			buff[0] = '\0';
-		} else {
-			if (iregs[i].fmt)
-				fmt = "\t%s\t%b";
-			else
-				fmt = "\t%s\t%x";
-			(void) sprintf(buff, fmt,
-			    iregs[i].name, value, iregs[i].fmt);
-			for (j = strlen(buff); j < 40; j++)
-				buff[j] = ' ';
-			buff[40] = '\0';
-		}
-	}
-	switch (pcic->pc_type) {
-	case PCIC_CL_PD6710:
-	case PCIC_CL_PD6722:
-	case PCIC_CL_PD6729:
-	case PCIC_CL_PD6832:
-		(void) xxdmp_cl_regs(pcic, socket, 0xFFFF);
-		break;
-	}
-	cmn_err(CE_CONT, "%s\n", buff);
-}
-#endif
-
-/*
- * pcic_mswait(ms)
- *	sleep ms milliseconds
- *	call drv_usecwait once for each ms
- */
-static void
-pcic_mswait(pcicdev_t *pcic, int socket, int ms)
-{
-	if (ms) {
-		pcic->pc_sockets[socket].pcs_flags |= PCS_WAITING;
-		pcic_mutex_exit(&pcic->pc_lock);
-		delay(drv_usectohz(ms*1000));
-		pcic_mutex_enter(&pcic->pc_lock);
-		pcic->pc_sockets[socket].pcs_flags &= ~PCS_WAITING;
-	}
-}
-
-/*
- * pcic_check_ready(pcic, index, off)
- *      Wait for card to come ready
- *      We only wait if the card is NOT in RESET
- *      and power is on.
- */
-static boolean_t
-pcic_check_ready(pcicdev_t *pcic, int socket)
-{
-	int ifstate, intstate;
-
-	intstate = pcic_getb(pcic, socket, PCIC_INTERRUPT);
-	ifstate = pcic_getb(pcic, socket, PCIC_INTERFACE_STATUS);
-
-	if ((intstate & PCIC_RESET) &&
-	    ((ifstate & (PCIC_READY|PCIC_POWER_ON|PCIC_ISTAT_CD_MASK)) ==
-	    (PCIC_READY|PCIC_POWER_ON|PCIC_CD_PRESENT_OK)))
-		return (B_TRUE);
-
-#ifdef  PCIC_DEBUG
-	pcic_err(NULL, 5, "pcic_check_read: Card not ready, intstate = 0x%x, "
-	    "ifstate = 0x%x\n", intstate, ifstate);
-	if (pcic_debug) {
-		pcic_debug += 4;
-		xxdmp_all_regs(pcic, socket, -1);
-		pcic_debug -= 4;
-	}
-#endif
-	return (B_FALSE);
-}
-
-/*
- * Cirrus Logic extended register read/write routines
- */
-static int
-clext_reg_read(pcicdev_t *pcic, int sn, uchar_t ext_reg)
-{
-	int val;
-
-	switch (pcic->pc_io_type) {
-	case PCIC_IO_TYPE_YENTA:
-		val = ddi_get8(pcic->handle,
-		    pcic->ioaddr + CB_CLEXT_OFFSET + ext_reg);
-		break;
-	default:
-		pcic_putb(pcic, sn, PCIC_CL_EXINDEX, ext_reg);
-		val = pcic_getb(pcic, sn, PCIC_CL_EXINDEX + 1);
-		break;
-	}
-
-	return (val);
-}
-
-static void
-clext_reg_write(pcicdev_t *pcic, int sn, uchar_t ext_reg, uchar_t value)
-{
-	switch (pcic->pc_io_type) {
-	case PCIC_IO_TYPE_YENTA:
-		ddi_put8(pcic->handle,
-		    pcic->ioaddr + CB_CLEXT_OFFSET + ext_reg, value);
-		break;
-	default:
-		pcic_putb(pcic, sn, PCIC_CL_EXINDEX, ext_reg);
-		pcic_putb(pcic, sn, PCIC_CL_EXINDEX + 1, value);
-		break;
-	}
-}
-
-/*
- * Misc PCI functions
- */
-static void
-pcic_iomem_pci_ctl(ddi_acc_handle_t handle, uchar_t *cfgaddr, unsigned flags)
-{
-	unsigned cmd;
-
-	if (flags & (PCIC_ENABLE_IO | PCIC_ENABLE_MEM)) {
-		cmd = ddi_get16(handle, (ushort_t *)(cfgaddr + 4));
-		if ((cmd & (PCI_COMM_IO|PCI_COMM_MAE)) ==
-		    (PCI_COMM_IO|PCI_COMM_MAE))
-			return;
-
-		if (flags & PCIC_ENABLE_IO)
-			cmd |= PCI_COMM_IO;
-
-		if (flags & PCIC_ENABLE_MEM)
-			cmd |= PCI_COMM_MAE;
-
-		ddi_put16(handle, (ushort_t *)(cfgaddr + 4), cmd);
-	} /* if (PCIC_ENABLE_IO | PCIC_ENABLE_MEM) */
-}
-
-/*
- * pcic_find_pci_type - Find and return PCI-PCMCIA adapter type
- */
-static int
-pcic_find_pci_type(pcicdev_t *pcic)
-{
-	uint32_t vend, device;
-
-	vend = ddi_getprop(DDI_DEV_T_ANY, pcic->dip,
-	    DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-	    "vendor-id", -1);
-	device = ddi_getprop(DDI_DEV_T_ANY, pcic->dip,
-	    DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-	    "device-id", -1);
-
-	device = PCI_ID(vend, device);
-	pcic->pc_type = device;
-	pcic->pc_chipname = "PCI:unknown";
-
-	switch (device) {
-	case PCIC_INTEL_i82092:
-		pcic->pc_chipname = PCIC_TYPE_i82092;
-		break;
-	case PCIC_CL_PD6729:
-		pcic->pc_chipname = PCIC_TYPE_PD6729;
-		/*
-		 * Some 6730's incorrectly identify themselves
-		 *	as a 6729, so we need to do some more tests
-		 *	here to see if the device that's claiming
-		 *	to be a 6729 is really a 6730.
-		 */
-		if ((clext_reg_read(pcic, 0, PCIC_CLEXT_MISC_CTL_3) &
-		    PCIC_CLEXT_MISC_CTL_3_REV_MASK) ==
-		    0) {
-			pcic->pc_chipname = PCIC_TYPE_PD6730;
-			pcic->pc_type = PCIC_CL_PD6730;
-		}
-		break;
-	case PCIC_CL_PD6730:
-		pcic->pc_chipname = PCIC_TYPE_PD6730;
-		break;
-	case PCIC_CL_PD6832:
-		pcic->pc_chipname = PCIC_TYPE_PD6832;
-		break;
-	case PCIC_SMC_34C90:
-		pcic->pc_chipname = PCIC_TYPE_34C90;
-		break;
-	case PCIC_TOSHIBA_TOPIC95:
-		pcic->pc_chipname = PCIC_TYPE_TOPIC95;
-		break;
-	case PCIC_TOSHIBA_TOPIC100:
-		pcic->pc_chipname = PCIC_TYPE_TOPIC100;
-		break;
-	case PCIC_TI_PCI1031:
-		pcic->pc_chipname = PCIC_TYPE_PCI1031;
-		break;
-	case PCIC_TI_PCI1130:
-		pcic->pc_chipname = PCIC_TYPE_PCI1130;
-		break;
-	case PCIC_TI_PCI1131:
-		pcic->pc_chipname = PCIC_TYPE_PCI1131;
-		break;
-	case PCIC_TI_PCI1250:
-		pcic->pc_chipname = PCIC_TYPE_PCI1250;
-		break;
-	case PCIC_TI_PCI1225:
-		pcic->pc_chipname = PCIC_TYPE_PCI1225;
-		break;
-	case PCIC_TI_PCI1410:
-		pcic->pc_chipname = PCIC_TYPE_PCI1410;
-		break;
-	case PCIC_TI_PCI1510:
-		pcic->pc_chipname = PCIC_TYPE_PCI1510;
-		break;
-	case PCIC_TI_PCI1520:
-		pcic->pc_chipname = PCIC_TYPE_PCI1520;
-		break;
-	case PCIC_TI_PCI1221:
-		pcic->pc_chipname = PCIC_TYPE_PCI1221;
-		break;
-	case PCIC_TI_PCI1050:
-		pcic->pc_chipname = PCIC_TYPE_PCI1050;
-		break;
-	case PCIC_ENE_1410:
-		pcic->pc_chipname = PCIC_TYPE_1410;
-		break;
-	case PCIC_O2_OZ6912:
-		pcic->pc_chipname = PCIC_TYPE_OZ6912;
-		break;
-	case PCIC_RICOH_RL5C466:
-		pcic->pc_chipname = PCIC_TYPE_RL5C466;
-		break;
-	case PCIC_TI_PCI1420:
-		pcic->pc_chipname = PCIC_TYPE_PCI1420;
-		break;
-	case PCIC_ENE_1420:
-		pcic->pc_chipname = PCIC_TYPE_1420;
-		break;
-	default:
-		switch (PCI_ID(vend, (uint32_t)0)) {
-		case PCIC_TOSHIBA_VENDOR:
-			pcic->pc_chipname = PCIC_TYPE_TOSHIBA;
-			pcic->pc_type = PCIC_TOSHIBA_VENDOR;
-			break;
-		case PCIC_TI_VENDOR:
-			pcic->pc_chipname = PCIC_TYPE_TI;
-			pcic->pc_type = PCIC_TI_VENDOR;
-			break;
-		case PCIC_O2MICRO_VENDOR:
-			pcic->pc_chipname = PCIC_TYPE_O2MICRO;
-			pcic->pc_type = PCIC_O2MICRO_VENDOR;
-			break;
-		case PCIC_RICOH_VENDOR:
-			pcic->pc_chipname = PCIC_TYPE_RICOH;
-			pcic->pc_type = PCIC_RICOH_VENDOR;
-			break;
-		default:
-			if (!(pcic->pc_flags & PCF_CARDBUS))
-				return (DDI_FAILURE);
-			pcic->pc_chipname = PCIC_TYPE_YENTA;
-			break;
-		}
-	}
-	return (DDI_SUCCESS);
-}
-
-static void
-pcic_82092_smiirq_ctl(pcicdev_t *pcic, int socket, int intr, int state)
-{
-	uchar_t ppirr = ddi_get8(pcic->cfg_handle,
-	    pcic->cfgaddr + PCIC_82092_PPIRR);
-	uchar_t val;
-
-	if (intr == PCIC_82092_CTL_SMI) {
-		val = PCIC_82092_SMI_CTL(socket,
-		    PCIC_82092_INT_DISABLE);
-		ppirr &= ~val;
-		val = PCIC_82092_SMI_CTL(socket, state);
-		ppirr |= val;
-	} else {
-		val = PCIC_82092_IRQ_CTL(socket,
-		    PCIC_82092_INT_DISABLE);
-		ppirr &= ~val;
-		val = PCIC_82092_IRQ_CTL(socket, state);
-		ppirr |= val;
-	}
-	ddi_put8(pcic->cfg_handle, pcic->cfgaddr + PCIC_82092_PPIRR,
-	    ppirr);
-}
-
-static uint_t
-pcic_cd_softint(caddr_t arg1, caddr_t arg2)
-{
-	pcic_socket_t *sockp = (pcic_socket_t *)arg1;
-	uint_t rc = DDI_INTR_UNCLAIMED;
-
-	_NOTE(ARGUNUSED(arg2))
-
-	mutex_enter(&sockp->pcs_pcic->pc_lock);
-	if (sockp->pcs_cd_softint_flg) {
-		uint8_t status;
-		sockp->pcs_cd_softint_flg = 0;
-		rc = DDI_INTR_CLAIMED;
-		status = pcic_getb(sockp->pcs_pcic, sockp->pcs_socket,
-		    PCIC_INTERFACE_STATUS);
-		pcic_handle_cd_change(sockp->pcs_pcic, sockp, status);
-	}
-	mutex_exit(&sockp->pcs_pcic->pc_lock);
-	return (rc);
-}
-
-int pcic_debounce_cnt = PCIC_REM_DEBOUNCE_CNT;
-int pcic_debounce_intr_time = PCIC_REM_DEBOUNCE_TIME;
-int pcic_debounce_cnt_ok = PCIC_DEBOUNCE_OK_CNT;
-
-#ifdef CARDBUS
-static uint32_t pcic_cbps_on = 0;
-static uint32_t pcic_cbps_off = CB_PS_NOTACARD | CB_PS_CCDMASK |
-				CB_PS_XVCARD | CB_PS_YVCARD;
-#else
-static uint32_t pcic_cbps_on = CB_PS_16BITCARD;
-static uint32_t pcic_cbps_off = CB_PS_NOTACARD | CB_PS_CCDMASK |
-				CB_PS_CBCARD |
-				CB_PS_XVCARD | CB_PS_YVCARD;
-#endif
-static void
-pcic_handle_cd_change(pcicdev_t *pcic, pcic_socket_t *sockp, uint8_t status)
-{
-	boolean_t	do_debounce = B_FALSE;
-	int		debounce_time = drv_usectohz(pcic_debounce_time);
-	uint8_t		irq;
-	timeout_id_t	debounce;
-
-	/*
-	 * Always reset debounce but may need to check original state later.
-	 */
-	debounce = sockp->pcs_debounce_id;
-	sockp->pcs_debounce_id = 0;
-
-	/*
-	 * Check to see whether a card is present or not. There are
-	 *	only two states that we are concerned with - the state
-	 *	where both CD pins are asserted, which means that the
-	 *	card is fully seated, and the state where neither CD
-	 *	pin is asserted, which means that the card is not
-	 *	present.
-	 * The CD signals are generally very noisy and cause a lot of
-	 *	contact bounce as the card is being inserted and
-	 *	removed, so we need to do some software debouncing.
-	 */
-
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 6,
-		    "pcic%d handle_cd_change: socket %d card status 0x%x"
-		    " deb 0x%p\n", ddi_get_instance(pcic->dip),
-		    sockp->pcs_socket, status, debounce);
-#endif
-	switch (status & PCIC_ISTAT_CD_MASK) {
-	case PCIC_CD_PRESENT_OK:
-		sockp->pcs_flags &= ~(PCS_CARD_REMOVED|PCS_CARD_CBREM);
-		if (!(sockp->pcs_flags & PCS_CARD_PRESENT)) {
-		uint32_t cbps;
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 8, "New card (0x%x)\n", sockp->pcs_flags);
-#endif
-		cbps = pcic_getcb(pcic, CB_PRESENT_STATE);
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 8, "CBus PS (0x%x)\n", cbps);
-#endif
-		/*
-		 * Check the CB bits are sane.
-		 */
-		if ((cbps & pcic_cbps_on) != pcic_cbps_on ||
-		    cbps & pcic_cbps_off) {
-			cmn_err(CE_WARN,
-			    "%s%d: Odd Cardbus Present State 0x%x\n",
-			    ddi_get_name(pcic->dip),
-			    ddi_get_instance(pcic->dip),
-			    cbps);
-			pcic_putcb(pcic, CB_EVENT_FORCE, CB_EF_CVTEST);
-			debounce = 0;
-			debounce_time = drv_usectohz(1000000);
-		}
-		if (debounce) {
-			sockp->pcs_flags |= PCS_CARD_PRESENT;
-			if (pcic_do_insertion) {
-
-				cbps = pcic_getcb(pcic, CB_PRESENT_STATE);
-
-				if (cbps & CB_PS_16BITCARD) {
-					pcic_err(pcic->dip,
-					    8, "16 bit card inserted\n");
-					sockp->pcs_flags |= PCS_CARD_IS16BIT;
-					/* calls pcm_adapter_callback() */
-					if (pcic->pc_callback) {
-
-						(void) ddi_prop_update_string(
-						    DDI_DEV_T_NONE,
-						    pcic->dip, PCM_DEVICETYPE,
-						    "pccard");
-						PC_CALLBACK(pcic->dip,
-						    pcic->pc_cb_arg,
-						    PCE_CARD_INSERT,
-						    sockp->pcs_socket);
-					}
-				} else if (cbps & CB_PS_CBCARD) {
-					pcic_err(pcic->dip,
-					    8, "32 bit card inserted\n");
-
-					if (pcic->pc_flags & PCF_CARDBUS) {
-						sockp->pcs_flags |=
-						    PCS_CARD_ISCARDBUS;
-#ifdef CARDBUS
-						if (!pcic_load_cardbus(pcic,
-						    sockp)) {
-							pcic_unload_cardbus(
-							    pcic, sockp);
-						}
-
-#else
-						cmn_err(CE_NOTE,
-						    "32 bit Cardbus not"
-						    " supported in"
-						    " this device driver\n");
-#endif
-					} else {
-						/*
-						 * Ignore the card
-						 */
-						cmn_err(CE_NOTE,
-						    "32 bit Cardbus not"
-						    " supported on this"
-						    " device\n");
-					}
-				} else {
-					cmn_err(CE_NOTE,
-					    "Unsupported PCMCIA card"
-					    " inserted\n");
-				}
-			}
-		} else {
-			do_debounce = B_TRUE;
-		}
-		} else {
-		/*
-		 * It is possible to come through here if the system
-		 * starts up with cards already inserted. Do nothing
-		 * and don't worry about it.
-		 */
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 5,
-		    "pcic%d: Odd card insertion indication on socket %d\n",
-		    ddi_get_instance(pcic->dip),
-		    sockp->pcs_socket);
-#endif
-		}
-		break;
-
-	default:
-		if (!(sockp->pcs_flags & PCS_CARD_PRESENT)) {
-		/*
-		 * Someone has started to insert a card so delay a while.
-		 */
-		do_debounce = B_TRUE;
-		break;
-		}
-		/*
-		 * Otherwise this is basically the same as not present
-		 * so fall through.
-		 */
-
-		/* FALLTHRU */
-	case 0:
-		if (sockp->pcs_flags & PCS_CARD_PRESENT) {
-			if (pcic->pc_flags & PCF_CBPWRCTL) {
-				pcic_putcb(pcic, CB_CONTROL, 0);
-			} else {
-				pcic_putb(pcic, sockp->pcs_socket,
-				    PCIC_POWER_CONTROL, 0);
-			(void) pcic_getb(pcic, sockp->pcs_socket,
-			    PCIC_POWER_CONTROL);
-		}
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 8, "Card removed\n");
-#endif
-		sockp->pcs_flags &= ~PCS_CARD_PRESENT;
-
-		if (sockp->pcs_flags & PCS_CARD_IS16BIT) {
-			sockp->pcs_flags &= ~PCS_CARD_IS16BIT;
-			if (pcic_do_removal && pcic->pc_callback) {
-				PC_CALLBACK(pcic->dip, pcic->pc_cb_arg,
-				    PCE_CARD_REMOVAL, sockp->pcs_socket);
-			}
-		}
-		if (sockp->pcs_flags & PCS_CARD_ISCARDBUS) {
-			sockp->pcs_flags &= ~PCS_CARD_ISCARDBUS;
-			sockp->pcs_flags |= PCS_CARD_CBREM;
-		}
-		sockp->pcs_flags |= PCS_CARD_REMOVED;
-
-		do_debounce = B_TRUE;
-		}
-		if (debounce && (sockp->pcs_flags & PCS_CARD_REMOVED)) {
-			if (sockp->pcs_flags & PCS_CARD_CBREM) {
-		/*
-		 * Ensure that we do the unloading in the
-		 * debounce handler, that way we're not doing
-		 * nasty things in an interrupt handler. e.g.
-		 * a USB device will wait for data which will
-		 * obviously never come because we've
-		 * unplugged the device, but the wait will
-		 * wait forever because no interrupts can
-		 * come in...
-		 */
-#ifdef CARDBUS
-			pcic_unload_cardbus(pcic, sockp);
-			/* pcic_dump_all(pcic); */
-#endif
-			sockp->pcs_flags &= ~PCS_CARD_CBREM;
-			}
-			sockp->pcs_flags &= ~PCS_CARD_REMOVED;
-		}
-		break;
-	} /* switch */
-
-	if (do_debounce) {
-	/*
-	 * Delay doing
-	 * anything for a while so that things can settle
-	 * down a little. Interrupts are already disabled.
-	 * Reset the state and we'll reevaluate the
-	 * whole kit 'n kaboodle when the timeout fires
-	 */
-#ifdef PCIC_DEBUG
-		pcic_err(pcic->dip, 8, "Queueing up debounce timeout for "
-		    "socket %d.%d\n",
-		    ddi_get_instance(pcic->dip),
-		    sockp->pcs_socket);
-#endif
-		sockp->pcs_debounce_id =
-		    pcic_add_debqueue(sockp, debounce_time);
-
-	/*
-	 * We bug out here without re-enabling interrupts. They will
-	 * be re-enabled when the debounce timeout swings through
-	 * here.
-	 */
-		return;
-	}
-
-	/*
-	 * Turn on Card detect interrupts. Other interrupts will be
-	 * enabled during set_socket calls.
-	 *
-	 * Note that set_socket only changes interrupt settings when there
-	 * is a card present.
-	 */
-	irq = pcic_getb(pcic, sockp->pcs_socket, PCIC_MANAGEMENT_INT);
-	irq |= PCIC_CD_DETECT;
-	pcic_putb(pcic, sockp->pcs_socket, PCIC_MANAGEMENT_INT, irq);
-	pcic_putcb(pcic, CB_STATUS_MASK, CB_SE_CCDMASK);
-
-	/* Out from debouncing state */
-	sockp->pcs_flags &= ~PCS_DEBOUNCING;
-
-	pcic_err(pcic->dip, 7, "Leaving pcic_handle_cd_change\n");
-}
-
-/*
- * pcic_getb()
- *	get an I/O byte based on the yardware decode method
- */
-static uint8_t
-pcic_getb(pcicdev_t *pcic, int socket, int reg)
-{
-	int work;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug == 0x7fff) {
-		cmn_err(CE_CONT, "pcic_getb0: pcic=%p socket=%d reg=%d\n",
-		    (void *)pcic, socket, reg);
-		cmn_err(CE_CONT, "pcic_getb1: type=%d handle=%p ioaddr=%p \n",
-		    pcic->pc_io_type, (void *)pcic->handle,
-		    (void *)pcic->ioaddr);
-	}
-#endif
-
-	switch (pcic->pc_io_type) {
-	case PCIC_IO_TYPE_YENTA:
-		return (ddi_get8(pcic->handle,
-		    pcic->ioaddr + CB_R2_OFFSET + reg));
-	default:
-		work = (socket * PCIC_SOCKET_1) | reg;
-		ddi_put8(pcic->handle, pcic->ioaddr, work);
-		return (ddi_get8(pcic->handle, pcic->ioaddr + 1));
-	}
-}
-
-static void
-pcic_putb(pcicdev_t *pcic, int socket, int reg, int8_t value)
-{
-	int work;
-
-#if defined(PCIC_DEBUG)
-	if (pcic_debug == 0x7fff) {
-		cmn_err(CE_CONT,
-		    "pcic_putb0: pcic=%p socket=%d reg=%d value=%x \n",
-		    (void *)pcic, socket, reg, value);
-		cmn_err(CE_CONT,
-		    "pcic_putb1: type=%d handle=%p ioaddr=%p \n",
-		    pcic->pc_io_type, (void *)pcic->handle,
-		    (void *)pcic->ioaddr);
-	}
-#endif
-
-
-	switch (pcic->pc_io_type) {
-	case PCIC_IO_TYPE_YENTA:
-		ddi_put8(pcic->handle, pcic->ioaddr + CB_R2_OFFSET + reg,
-		    value);
-		break;
-	default:
-		work = (socket * PCIC_SOCKET_1) | reg;
-		ddi_put8(pcic->handle, pcic->ioaddr, work);
-		ddi_put8(pcic->handle, pcic->ioaddr + 1, value);
-		break;
-	}
-}
-
-/*
- * chip identification functions
- */
-
-/*
- * chip identification: Cirrus Logic PD6710/6720/6722
- */
-static int
-pcic_ci_cirrus(pcicdev_t *pcic)
-{
-	int value1, value2;
-
-	/* Init the CL id mode */
-	value1 = pcic_getb(pcic, 0, PCIC_CHIP_INFO);
-	pcic_putb(pcic, 0, PCIC_CHIP_INFO, 0);
-	value1 = pcic_getb(pcic, 0, PCIC_CHIP_INFO);
-	value2 = pcic_getb(pcic, 0, PCIC_CHIP_INFO);
-
-	if ((value1 & PCIC_CI_ID) == PCIC_CI_ID &&
-	    (value2 & PCIC_CI_ID) == 0) {
-		/* chip is a Cirrus Logic and not Intel */
-		pcic->pc_type = PCIC_CL_PD6710;
-		if (value1 & PCIC_CI_SLOTS)
-			pcic->pc_chipname = PCIC_TYPE_PD6720;
-		else
-			pcic->pc_chipname = PCIC_TYPE_PD6710;
-		/* now fine tune things just in case a 6722 */
-		value1 = clext_reg_read(pcic, 0, PCIC_CLEXT_DMASK_0);
-		if (value1 == 0) {
-			clext_reg_write(pcic, 0, PCIC_CLEXT_SCRATCH, 0x55);
-			value1 = clext_reg_read(pcic, 0, PCIC_CLEXT_SCRATCH);
-			if (value1 == 0x55) {
-				pcic->pc_chipname = PCIC_TYPE_PD6722;
-				pcic->pc_type = PCIC_CL_PD6722;
-				clext_reg_write(pcic, 0, PCIC_CLEXT_SCRATCH, 0);
-			}
-		}
-		return (1);
-	}
-	return (0);
-}
-
-/*
- * chip identification: Vadem (VG365/465/468/469)
- */
-
-static void
-pcic_vadem_enable(pcicdev_t *pcic)
-{
-	ddi_put8(pcic->handle, pcic->ioaddr, PCIC_VADEM_P1);
-	ddi_put8(pcic->handle, pcic->ioaddr, PCIC_VADEM_P2);
-	ddi_put8(pcic->handle, pcic->ioaddr, pcic->pc_lastreg);
-}
-
-static int
-pcic_ci_vadem(pcicdev_t *pcic)
-{
-	int value;
-
-	pcic_vadem_enable(pcic);
-	value = pcic_getb(pcic, 0, PCIC_CHIP_REVISION);
-	pcic_putb(pcic, 0, PCIC_CHIP_REVISION, 0xFF);
-	if (pcic_getb(pcic, 0, PCIC_CHIP_REVISION) ==
-	    (value | PCIC_VADEM_D3) ||
-	    (pcic_getb(pcic, 0, PCIC_CHIP_REVISION) & PCIC_REV_MASK) ==
-	    PCIC_VADEM_469) {
-		int vadem, new;
-		pcic_vadem_enable(pcic);
-		vadem = pcic_getb(pcic, 0, PCIC_VG_DMA) &
-		    ~(PCIC_V_UNLOCK | PCIC_V_VADEMREV);
-		new = vadem | (PCIC_V_VADEMREV|PCIC_V_UNLOCK);
-		pcic_putb(pcic, 0, PCIC_VG_DMA, new);
-		value = pcic_getb(pcic, 0, PCIC_CHIP_REVISION);
-
-		/* want to lock but leave mouse or other on */
-		pcic_putb(pcic, 0, PCIC_VG_DMA, vadem);
-		switch (value & PCIC_REV_MASK) {
-		case PCIC_VADEM_365:
-			pcic->pc_chipname = PCIC_VG_365;
-			pcic->pc_type = PCIC_VADEM;
-			break;
-		case PCIC_VADEM_465:
-			pcic->pc_chipname = PCIC_VG_465;
-			pcic->pc_type = PCIC_VADEM;
-			pcic->pc_flags |= PCF_1SOCKET;
-			break;
-		case PCIC_VADEM_468:
-			pcic->pc_chipname = PCIC_VG_468;
-			pcic->pc_type = PCIC_VADEM;
-			break;
-		case PCIC_VADEM_469:
-			pcic->pc_chipname = PCIC_VG_469;
-			pcic->pc_type = PCIC_VADEM_VG469;
-			break;
-		}
-		return (1);
-	}
-	return (0);
-}
-
-/*
- * chip identification: Ricoh
- */
-static int
-pcic_ci_ricoh(pcicdev_t *pcic)
-{
-	int value;
-
-	value = pcic_getb(pcic, 0, PCIC_RF_CHIP_IDENT);
-	switch (value) {
-	case PCIC_RF_296:
-		pcic->pc_type = PCIC_RICOH;
-		pcic->pc_chipname = PCIC_TYPE_RF5C296;
-		return (1);
-	case PCIC_RF_396:
-		pcic->pc_type = PCIC_RICOH;
-		pcic->pc_chipname = PCIC_TYPE_RF5C396;
-		return (1);
-	}
-	return (0);
-}
-
-
-/*
- * set up available address spaces in busra
- */
-static void
-pcic_init_assigned(dev_info_t *dip)
-{
-	pcm_regs_t *pcic_avail_p;
-	pci_regspec_t *pci_avail_p, *regs;
-	int len, entries, rlen;
-	dev_info_t *pdip;
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    "available", (caddr_t)&pcic_avail_p, &len) == DDI_PROP_SUCCESS) {
-		/*
-		 * found "available" property at the cardbus/pcmcia node
-		 * need to translate address space entries from pcmcia
-		 * format to pci format
-		 */
-		entries = len / sizeof (pcm_regs_t);
-		pci_avail_p = kmem_alloc(sizeof (pci_regspec_t) * entries,
-		    KM_SLEEP);
-		if (pcic_apply_avail_ranges(dip, pcic_avail_p, pci_avail_p,
-		    entries) == DDI_SUCCESS)
-			(void) pci_resource_setup_avail(dip, pci_avail_p,
-			    entries);
-		kmem_free(pcic_avail_p, len);
-		kmem_free(pci_avail_p, entries * sizeof (pci_regspec_t));
-		return;
-	}
-
-	/*
-	 * "legacy" platforms will have "available" property in pci node
-	 */
-	for (pdip = ddi_get_parent(dip); pdip; pdip = ddi_get_parent(pdip)) {
-		if (ddi_getlongprop(DDI_DEV_T_ANY, pdip, DDI_PROP_DONTPASS,
-		    "available", (caddr_t)&pci_avail_p, &len) ==
-		    DDI_PROP_SUCCESS) {
-			/* (void) pci_resource_setup(pdip); */
-			kmem_free(pci_avail_p, len);
-			break;
-		}
-	}
-
-	if (pdip == NULL) {
-		int len;
-		char bus_type[16] = "(unknown)";
-		dev_info_t *par;
-
-		cmn_err(CE_CONT,
-		    "?pcic_init_assigned: no available property for pcmcia\n");
-
-		/*
-		 * This code is taken from pci_resource_setup() but does
-		 * not attempt to use the "available" property to populate
-		 * the ndi maps that are created.
-		 * The fact that we will actually
-		 * free some resource below (that was allocated by OBP)
-		 * should be enough to be going on with.
-		 */
-		for (par = dip; par != NULL; par = ddi_get_parent(par)) {
-			len = sizeof (bus_type);
-
-			if ((ddi_prop_op(DDI_DEV_T_ANY, par,
-			    PROP_LEN_AND_VAL_BUF,
-			    DDI_PROP_CANSLEEP | DDI_PROP_DONTPASS,
-			    "device_type",
-			    (caddr_t)&bus_type, &len) == DDI_SUCCESS) &&
-			    (strcmp(bus_type, DEVI_PCI_NEXNAME) == 0 ||
-			    strcmp(bus_type, DEVI_PCIEX_NEXNAME) == 0))
-				break;
-		}
-		if (par != NULL &&
-		    (ndi_ra_map_setup(par, NDI_RA_TYPE_MEM) != NDI_SUCCESS ||
-		    ndi_ra_map_setup(par, NDI_RA_TYPE_IO) != NDI_SUCCESS))
-			par = NULL;
-	} else {
-#ifdef CARDBUS
-		cardbus_bus_range_t *bus_range;
-		int k;
-
-		if (ddi_getlongprop(DDI_DEV_T_ANY, pdip, 0, "bus-range",
-		    (caddr_t)&bus_range, &k) == DDI_PROP_SUCCESS) {
-			if (bus_range->lo != bus_range->hi)
-				pcic_err(pdip, 9, "allowable bus range is "
-				    "%u->%u\n", bus_range->lo, bus_range->hi);
-			else {
-				pcic_err(pdip, 0,
-				    "!No spare PCI bus numbers, range is "
-				    "%u->%u, cardbus isn't usable\n",
-				    bus_range->lo, bus_range->hi);
-			}
-			kmem_free(bus_range, k);
-		} else
-			pcic_err(pdip, 0, "!No bus-range property seems to "
-			    "have been set up\n");
-#endif
-		/*
-		 * Have a valid parent with the "available" property
-		 */
-		(void) pci_resource_setup(pdip);
-	}
-
-	if ((strcmp(ddi_get_name(dip), "pcma") == 0) &&
-	    ddi_getlongprop(DDI_DEV_T_NONE, dip, DDI_PROP_DONTPASS,
-	    "assigned-addresses",
-	    (caddr_t)&regs, &rlen) == DDI_SUCCESS) {
-		ra_return_t ra;
-
-		/*
-		 * On the UltraBook IIi the ranges are assigned under
-		 * openboot. If we don't free them here the first I/O
-		 * space that can be used is up above 0x10000 which
-		 * doesn't work for this driver due to restrictions
-		 * on the PCI I/O addresses the controllers can cope with.
-		 * They are never going to be used by anything else
-		 * so free them up to the general pool. AG.
-		 */
-		pcic_err(dip, 1, "Free assigned addresses\n");
-
-		if ((PCI_REG_ADDR_G(regs[0].pci_phys_hi) ==
-		    PCI_REG_ADDR_G(PCI_ADDR_MEM32)) &&
-		    regs[0].pci_size_low == 0x1000000) {
-			ra.ra_addr_lo = regs[0].pci_phys_low;
-			ra.ra_len = regs[0].pci_size_low;
-			(void) pcmcia_free_mem(dip, &ra);
-		}
-		if ((PCI_REG_ADDR_G(regs[1].pci_phys_hi) ==
-		    PCI_REG_ADDR_G(PCI_ADDR_IO)) &&
-		    (regs[1].pci_size_low == 0x8000 ||
-		    regs[1].pci_size_low == 0x4000))   /* UB-IIi || UB-I */
-		{
-			ra.ra_addr_lo = regs[1].pci_phys_low;
-			ra.ra_len = regs[1].pci_size_low;
-			(void) pcmcia_free_io(dip, &ra);
-		}
-		kmem_free((caddr_t)regs, rlen);
-	}
-}
-
-/*
- * translate "available" from pcmcia format to pci format
- */
-static int
-pcic_apply_avail_ranges(dev_info_t *dip, pcm_regs_t *pcic_p,
-    pci_regspec_t *pci_p, int entries)
-{
-	int i, range_len, range_entries;
-	pcic_ranges_t *pcic_range_p;
-
-	if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, "ranges",
-	    (caddr_t)&pcic_range_p, &range_len) != DDI_PROP_SUCCESS) {
-		cmn_err(CE_CONT, "?pcic_apply_avail_ranges: "
-		    "no ranges property for pcmcia\n");
-		return (DDI_FAILURE);
-	}
-
-	range_entries = range_len / sizeof (pcic_ranges_t);
-
-	/* for each "available" entry to be translated */
-	for (i = 0; i < entries; i++, pcic_p++, pci_p++) {
-		int j;
-		pcic_ranges_t *range_p = pcic_range_p;
-		pci_p->pci_phys_hi = -1u; /* default invalid value */
-
-		/* for each "ranges" entry to be searched */
-		for (j = 0; j < range_entries; j++, range_p++) {
-			uint64_t range_end = range_p->pcic_range_caddrlo +
-			    range_p->pcic_range_size;
-			uint64_t avail_end = pcic_p->phys_lo + pcic_p->phys_len;
-
-			if ((range_p->pcic_range_caddrhi != pcic_p->phys_hi) ||
-			    (range_p->pcic_range_caddrlo > pcic_p->phys_lo) ||
-			    (range_end < avail_end))
-				continue;
-
-			pci_p->pci_phys_hi = range_p->pcic_range_paddrhi;
-			pci_p->pci_phys_mid = range_p->pcic_range_paddrmid;
-			pci_p->pci_phys_low = range_p->pcic_range_paddrlo
-			    + (pcic_p->phys_lo - range_p->pcic_range_caddrlo);
-			pci_p->pci_size_hi = 0;
-			pci_p->pci_size_low = pcic_p->phys_len;
-		}
-	}
-	kmem_free(pcic_range_p, range_len);
-	return (DDI_SUCCESS);
-}
-
-static int
-pcic_open(dev_t *dev, int flag, int otyp, cred_t *cred)
-{
-#ifdef CARDBUS
-	if (cardbus_is_cb_minor(*dev))
-		return (cardbus_open(dev, flag, otyp, cred));
-#endif
-	return (EINVAL);
-}
-
-static int
-pcic_close(dev_t dev, int flag, int otyp, cred_t *cred)
-{
-#ifdef CARDBUS
-	if (cardbus_is_cb_minor(dev))
-		return (cardbus_close(dev, flag, otyp, cred));
-#endif
-	return (EINVAL);
-}
-
-static int
-pcic_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cred,
-	int *rval)
-{
-#ifdef CARDBUS
-	if (cardbus_is_cb_minor(dev))
-		return (cardbus_ioctl(dev, cmd, arg, mode, cred, rval));
-#endif
-	return (EINVAL);
-}
-
-
-static boolean_t
-pcic_load_cardbus(pcicdev_t *pcic, const pcic_socket_t *sockp)
-{
-	uint32_t present_state;
-	dev_info_t *dip = pcic->dip;
-	set_socket_t s;
-	get_socket_t g;
-	boolean_t retval;
-	unsigned vccLevel;
-
-	pcic_err(dip, 8, "entering pcic_load_cardbus\n");
-
-	pcic_mutex_exit(&pcic->pc_lock);
-
-	bzero(&s, sizeof (set_socket_t));
-	s.socket = sockp->pcs_socket;
-	s.SCIntMask = SBM_CD|SBM_RDYBSY;
-	s.IFType = IF_CARDBUS;
-	s.State = (unsigned)~0;
-
-	present_state = pcic_getcb(pcic, CB_PRESENT_STATE);
-	if (present_state & PCIC_VCC_3VCARD)
-		s.VccLevel = PCIC_VCC_3VLEVEL;
-	else if (present_state & PCIC_VCC_5VCARD)
-		s.VccLevel = PCIC_VCC_5VLEVEL;
-	else {
-		cmn_err(CE_CONT,
-		    "pcic_load_cardbus: unsupported card voltage\n");
-		goto failure;
-	}
-	vccLevel = s.VccLevel;
-	s.Vpp1Level = s.Vpp2Level = 0;
-
-	if (pcic_set_socket(dip, &s) != SUCCESS)
-		goto failure;
-
-	if (pcic_reset_socket(dip, sockp->pcs_socket,
-	    RESET_MODE_CARD_ONLY) != SUCCESS)
-		goto failure;
-
-	bzero(&g, sizeof (get_socket_t));
-	g.socket = sockp->pcs_socket;
-	if (pcic_get_socket(dip, &g) != SUCCESS)
-		goto failure;
-
-	bzero(&s, sizeof (set_socket_t));
-	s.socket = sockp->pcs_socket;
-	s.SCIntMask = SBM_CD;
-	s.IREQRouting = g.IRQRouting;
-	s.IFType = g.IFType;
-	s.CtlInd = g.CtlInd;
-	s.State = (unsigned)~0;
-	s.VccLevel = vccLevel;
-	s.Vpp1Level = s.Vpp2Level = 0;
-
-	retval = pcic_set_socket(dip, &s);
-	pcmcia_cb_resumed(s.socket);
-	if (retval != SUCCESS)
-		goto failure;
-
-	retval = cardbus_load_cardbus(dip, sockp->pcs_socket, pcic->pc_base);
-	goto exit;
-
-failure:
-	retval = B_FALSE;
-
-exit:
-	pcic_mutex_enter(&pcic->pc_lock);
-	pcic_err(dip, 8, "exit pcic_load_cardbus (%s)\n",
-	    retval ? "success" : "failure");
-	return (retval);
-}
-
-static void
-pcic_unload_cardbus(pcicdev_t *pcic, const pcic_socket_t *sockp)
-{
-	dev_info_t *dip = pcic->dip;
-	set_socket_t s;
-
-	pcic_mutex_exit(&pcic->pc_lock);
-
-	cardbus_unload_cardbus(dip);
-
-	bzero(&s, sizeof (set_socket_t));
-	s.socket = sockp->pcs_socket;
-	s.SCIntMask = SBM_CD|SBM_RDYBSY;
-	s.IREQRouting = 0;
-	s.IFType = IF_MEMORY;
-	s.CtlInd = 0;
-	s.State = 0;
-	s.VccLevel = s.Vpp1Level = s.Vpp2Level = 0;
-
-	(void) pcic_set_socket(dip, &s);
-
-	pcic_mutex_enter(&pcic->pc_lock);
-}
-
-static uint32_t
-pcic_getcb(pcicdev_t *pcic, int reg)
-{
-	ASSERT(pcic->pc_io_type == PCIC_IO_TYPE_YENTA);
-
-	return (ddi_get32(pcic->handle,
-	    (uint32_t *)(pcic->ioaddr + CB_CB_OFFSET + reg)));
-}
-
-static void
-pcic_putcb(pcicdev_t *pcic, int reg, uint32_t value)
-{
-	ASSERT(pcic->pc_io_type == PCIC_IO_TYPE_YENTA);
-
-	ddi_put32(pcic->handle,
-	    (uint32_t *)(pcic->ioaddr + CB_CB_OFFSET + reg), value);
-}
-
-static void
-pcic_enable_io_intr(pcicdev_t *pcic, int socket, int irq)
-{
-	uint8_t value;
-	uint16_t brdgctl;
-
-	value = pcic_getb(pcic, socket, PCIC_INTERRUPT) & ~PCIC_INTR_MASK;
-	pcic_putb(pcic, socket, PCIC_INTERRUPT, value | irq);
-
-	switch (pcic->pc_type) {
-	case PCIC_INTEL_i82092:
-		pcic_82092_smiirq_ctl(pcic, socket, PCIC_82092_CTL_IRQ,
-		    PCIC_82092_INT_ENABLE);
-		break;
-	case PCIC_O2_OZ6912:
-		value = pcic_getb(pcic, 0, PCIC_CENTDMA);
-		value |= 0x8;
-		pcic_putb(pcic, 0, PCIC_CENTDMA, value);
-		break;
-	case PCIC_CL_PD6832:
-	case PCIC_TI_PCI1250:
-	case PCIC_TI_PCI1221:
-	case PCIC_TI_PCI1225:
-	case PCIC_TI_PCI1410:
-	case PCIC_ENE_1410:
-	case PCIC_TI_PCI1510:
-	case PCIC_TI_PCI1520:
-	case PCIC_TI_PCI1420:
-	case PCIC_ENE_1420:
-		/* route card functional interrupts to PCI interrupts */
-		brdgctl = ddi_get16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL));
-		pcic_err(NULL, 1,
-		    "pcic_enable_io_intr brdgctl(0x%x) was: 0x%x\n",
-		    PCI_CBUS_BRIDGE_CTRL, brdgctl);
-		brdgctl &= ~PCIC_BRDGCTL_INTR_MASK;
-		ddi_put16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL),
-		    brdgctl);
-		/* Flush the write */
-		(void) ddi_get16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL));
-		break;
-	default:
-		break;
-	}
-}
-
-static void
-pcic_disable_io_intr(pcicdev_t *pcic, int socket)
-{
-	uint8_t value;
-	uint16_t brdgctl;
-
-	value = pcic_getb(pcic, socket, PCIC_INTERRUPT) & ~PCIC_INTR_MASK;
-	pcic_putb(pcic, socket, PCIC_INTERRUPT, value);
-
-	switch (pcic->pc_type) {
-	case PCIC_INTEL_i82092:
-		pcic_82092_smiirq_ctl(pcic, socket, PCIC_82092_CTL_IRQ,
-		    PCIC_82092_INT_DISABLE);
-		break;
-	case PCIC_O2_OZ6912:
-		value = pcic_getb(pcic, 0, PCIC_CENTDMA);
-		value &= ~0x8;
-		pcic_putb(pcic, 0, PCIC_CENTDMA, value);
-		/* Flush the write */
-		(void) pcic_getb(pcic, 0, PCIC_CENTDMA);
-		break;
-	case PCIC_CL_PD6832:
-	case PCIC_TI_PCI1250:
-	case PCIC_TI_PCI1221:
-	case PCIC_TI_PCI1225:
-	case PCIC_TI_PCI1410:
-	case PCIC_ENE_1410:
-	case PCIC_TI_PCI1510:
-	case PCIC_TI_PCI1520:
-	case PCIC_TI_PCI1420:
-	case PCIC_ENE_1420:
-		/*
-		 * This maps I/O interrupts to ExCA which
-		 * have been turned off by the write to
-		 * PCIC_INTERRUPT above. It would appear to
-		 * be the only way to actually turn I/O Ints off
-		 * while retaining CS Ints.
-		 */
-		brdgctl = ddi_get16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL));
-		pcic_err(NULL, 1,
-		    "pcic_disable_io_intr brdgctl(0x%x) was: 0x%x\n",
-		    PCI_CBUS_BRIDGE_CTRL, brdgctl);
-		brdgctl |= PCIC_BRDGCTL_INTR_MASK;
-		ddi_put16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL),
-		    brdgctl);
-		/* Flush the write */
-		(void) ddi_get16(pcic->cfg_handle,
-		    (uint16_t *)(pcic->cfgaddr + PCI_CBUS_BRIDGE_CTRL));
-		break;
-	default:
-		break;
-	}
-}
-
-static void
-pcic_cb_enable_intr(dev_info_t *dip)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-
-	mutex_enter(&pcic->pc_lock);
-	pcic_enable_io_intr(pcic, 0, pcic->pc_sockets[0].pcs_irq);
-	mutex_exit(&pcic->pc_lock);
-}
-
-static void
-pcic_cb_disable_intr(dev_info_t *dip)
-{
-	anp_t *anp = ddi_get_driver_private(dip);
-	pcicdev_t *pcic = anp->an_private;
-
-	mutex_enter(&pcic->pc_lock);
-	pcic_disable_io_intr(pcic, 0);
-	mutex_exit(&pcic->pc_lock);
-}
-
-static int
-log_pci_cfg_err(ushort_t e, int bridge_secondary)
-{
-	int	nerr = 0;
-	if (e & PCI_STAT_PERROR) {
-		nerr++;
-		cmn_err(CE_CONT, "detected parity error.\n");
-	}
-	if (e & PCI_STAT_S_SYSERR) {
-		nerr++;
-		if (bridge_secondary)
-			cmn_err(CE_CONT, "received system error.\n");
-		else
-			cmn_err(CE_CONT, "signalled system error.\n");
-	}
-	if (e & PCI_STAT_R_MAST_AB) {
-		nerr++;
-		cmn_err(CE_CONT, "received master abort.\n");
-	}
-	if (e & PCI_STAT_R_TARG_AB)
-		cmn_err(CE_CONT, "received target abort.\n");
-	if (e & PCI_STAT_S_TARG_AB)
-		cmn_err(CE_CONT, "signalled target abort\n");
-	if (e & PCI_STAT_S_PERROR) {
-		nerr++;
-		cmn_err(CE_CONT, "signalled parity error\n");
-	}
-	return (nerr);
-}
-
-#if defined(__sparc)
-static int
-pcic_fault(enum pci_fault_ops op, void *arg)
-{
-	pcicdev_t *pcic = (pcicdev_t *)arg;
-	ushort_t pci_cfg_stat =
-	    pci_config_get16(pcic->cfg_handle, PCI_CONF_STAT);
-	ushort_t pci_cfg_sec_stat =
-	    pci_config_get16(pcic->cfg_handle, 0x16);
-	char	nm[24];
-	int	nerr = 0;
-
-	cardbus_dump_pci_config(pcic->dip);
-
-	switch (op) {
-	case FAULT_LOG:
-		(void) sprintf(nm, "%s-%d", ddi_driver_name(pcic->dip),
-		    ddi_get_instance(pcic->dip));
-
-		cmn_err(CE_WARN, "%s: PCIC fault log start:\n", nm);
-		cmn_err(CE_WARN, "%s: primary err (%x):\n", nm, pci_cfg_stat);
-		nerr += log_pci_cfg_err(pci_cfg_stat, 0);
-		cmn_err(CE_WARN, "%s: sec err (%x):\n", nm, pci_cfg_sec_stat);
-		nerr += log_pci_cfg_err(pci_cfg_sec_stat, 1);
-		cmn_err(CE_CONT, "%s: PCI fault log end.\n", nm);
-		return (nerr);
-	case FAULT_POKEFINI:
-	case FAULT_RESET:
-		pci_config_put16(pcic->cfg_handle,
-		    PCI_CONF_STAT, pci_cfg_stat);
-		pci_config_put16(pcic->cfg_handle, 0x16, pci_cfg_sec_stat);
-		break;
-	case FAULT_POKEFLT:
-		if (!(pci_cfg_stat & PCI_STAT_S_SYSERR))
-			return (1);
-		if (!(pci_cfg_sec_stat & PCI_STAT_R_MAST_AB))
-			return (1);
-		break;
-	default:
-		break;
-	}
-	return (DDI_SUCCESS);
-}
-#endif
-
-static void
-pcic_do_resume(pcicdev_t *pcic)
-{
-	int	i, interrupt;
-	uint8_t cfg;
-
-
-#if defined(PCIC_DEBUG)
-	pcic_err(NULL, 6, "pcic_do_resume(): entered\n");
-#endif
-
-	pcic_mutex_enter(&pcic->pc_lock); /* protect the registers */
-	for (i = 0; i < pcic->pc_numsockets; i++) {
-		/* Enable interrupts  on PCI if needs be */
-		interrupt = pcic_getb(pcic, i, PCIC_INTERRUPT);
-		if (pcic->pc_flags & PCF_USE_SMI)
-			interrupt |= PCIC_INTR_ENABLE;
-		pcic_putb(pcic, i, PCIC_INTERRUPT,
-		    PCIC_RESET | interrupt);
-		pcic->pc_sockets[i].pcs_debounce_id =
-		    pcic_add_debqueue(&pcic->pc_sockets[i],
-		    drv_usectohz(pcic_debounce_time));
-	}
-	pcic_mutex_exit(&pcic->pc_lock); /* protect the registers */
-	if (pcic_do_pcmcia_sr)
-		(void) pcmcia_wait_insert(pcic->dip);
-	/*
-	 * The CardBus controller may be in RESET state after the
-	 * system is resumed from sleeping. The RESET bit is in
-	 * the Bridge Control register. This is true for all(TI,
-	 * Toshiba ToPIC95/97, RICOH, and O2Micro) CardBus
-	 * controllers. Need to clear the RESET bit explicitly.
-	 */
-	cfg = ddi_get8(pcic->cfg_handle,
-	    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-	if (cfg & (1<<6)) {
-		cfg &= ~(1<<6);
-		ddi_put8(pcic->cfg_handle,
-		    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG,
-		    cfg);
-		cfg = ddi_get8(pcic->cfg_handle,
-		    pcic->cfgaddr + PCIC_BRIDGE_CTL_REG);
-		if (cfg & (1<<6)) {
-			pcic_err(pcic->dip, 1,
-			    "Failed to take pcic out of reset");
-		}
-	}
-
-}
-
-static void
-pcic_debounce(pcic_socket_t *pcs)
-{
-	uint8_t status, stschng;
-
-	pcic_mutex_enter(&pcs->pcs_pcic->pc_lock);
-	pcs->pcs_flags &= ~PCS_STARTING;
-	stschng = pcic_getb(pcs->pcs_pcic, pcs->pcs_socket,
-	    PCIC_CARD_STATUS_CHANGE);
-	status = pcic_getb(pcs->pcs_pcic, pcs->pcs_socket,
-	    PCIC_INTERFACE_STATUS);
-#ifdef PCIC_DEBUG
-	pcic_err(pcs->pcs_pcic->dip, 8,
-	    "pcic_debounce(0x%p, dip=0x%p) socket %d st 0x%x "
-	    "chg 0x%x flg 0x%x\n",
-	    (void *)pcs, (void *) pcs->pcs_pcic->dip, pcs->pcs_socket,
-	    status, stschng, pcs->pcs_flags);
-#endif
-
-	pcic_putb(pcs->pcs_pcic, pcs->pcs_socket, PCIC_CARD_STATUS_CHANGE,
-	    PCIC_CD_DETECT);
-	pcic_handle_cd_change(pcs->pcs_pcic, pcs, status);
-	pcic_mutex_exit(&pcs->pcs_pcic->pc_lock);
-}
-
-static void
-pcic_deb_thread()
-{
-	callb_cpr_t cprinfo;
-	struct debounce *debp;
-	clock_t lastt;
-
-	CALLB_CPR_INIT(&cprinfo, &pcic_deb_mtx,
-	    callb_generic_cpr, "pcic debounce thread");
-	mutex_enter(&pcic_deb_mtx);
-	while (pcic_deb_threadid) {
-		while (pcic_deb_queue) {
-#ifdef PCIC_DEBUG
-			pcic_dump_debqueue("Thread");
-#endif
-			debp = pcic_deb_queue;
-			(void) drv_getparm(LBOLT, &lastt);
-			if (lastt >= debp->expire) {
-				pcic_deb_queue = debp->next;
-				mutex_exit(&pcic_deb_mtx);
-				pcic_debounce(debp->pcs);
-				mutex_enter(&pcic_deb_mtx);
-				kmem_free(debp, sizeof (*debp));
-			} else {
-				(void) cv_timedwait(&pcic_deb_cv,
-				    &pcic_deb_mtx, debp->expire);
-			}
-		}
-		CALLB_CPR_SAFE_BEGIN(&cprinfo);
-		cv_wait(&pcic_deb_cv, &pcic_deb_mtx);
-		CALLB_CPR_SAFE_END(&cprinfo, &pcic_deb_mtx);
-	}
-	pcic_deb_threadid = (kthread_t *)1;
-	cv_signal(&pcic_deb_cv);
-	CALLB_CPR_EXIT(&cprinfo);	/* Also exits the mutex */
-	thread_exit();
-}
-
-static void *
-pcic_add_debqueue(pcic_socket_t *pcs, int clocks)
-{
-	clock_t lbolt;
-	struct debounce *dbp, **dbpp = &pcic_deb_queue;
-
-	(void) drv_getparm(LBOLT, &lbolt);
-	dbp = kmem_alloc(sizeof (struct debounce), KM_SLEEP);
-
-	dbp->expire = lbolt + clocks;
-	dbp->pcs = pcs;
-	mutex_enter(&pcic_deb_mtx);
-	while (*dbpp) {
-		if (dbp->expire > (*dbpp)->expire)
-			dbpp = &((*dbpp)->next);
-		else
-			break;
-	}
-	dbp->next = *dbpp;
-	*dbpp = dbp;
-#ifdef PCIC_DEBUG
-	pcic_dump_debqueue("Add");
-#endif
-	cv_signal(&pcic_deb_cv);
-	mutex_exit(&pcic_deb_mtx);
-	return (dbp);
-}
-
-static void
-pcic_rm_debqueue(void *id)
-{
-	struct debounce *dbp, **dbpp = &pcic_deb_queue;
-
-	dbp = (struct debounce *)id;
-	mutex_enter(&pcic_deb_mtx);
-	while (*dbpp) {
-		if (*dbpp == dbp) {
-			*dbpp = dbp->next;
-			kmem_free(dbp, sizeof (*dbp));
-#ifdef PCIC_DEBUG
-			pcic_dump_debqueue("Remove");
-#endif
-			cv_signal(&pcic_deb_cv);
-			mutex_exit(&pcic_deb_mtx);
-			return;
-		}
-		dbpp = &((*dbpp)->next);
-	}
-	pcic_err(NULL, 6, "pcic: Failed to find debounce id 0x%p\n", id);
-	mutex_exit(&pcic_deb_mtx);
-}
-
-
-static int	pcic_powerdelay = 0;
-
-static int
-pcic_exca_powerctl(pcicdev_t *pcic, int socket, int powerlevel)
-{
-	int	ind, value, orig_pwrctl;
-
-	/* power setup -- if necessary */
-	orig_pwrctl = pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 6,
-	    "pcic_exca_powerctl(socket %d) powerlevel=%x orig 0x%x\n",
-	    socket, powerlevel, orig_pwrctl);
-#endif
-	/* Preserve the PCIC_OUTPUT_ENABLE (control lines output enable) bit. */
-	powerlevel = (powerlevel & ~POWER_OUTPUT_ENABLE) |
-	    (orig_pwrctl & POWER_OUTPUT_ENABLE);
-	if (powerlevel != orig_pwrctl) {
-		if (powerlevel & ~POWER_OUTPUT_ENABLE) {
-			int	ifs;
-			/*
-			 * set power to socket
-			 * note that the powerlevel was calculated earlier
-			 */
-			pcic_putb(pcic, socket, PCIC_POWER_CONTROL, powerlevel);
-			(void) pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-
-			/*
-			 * this second write to the power control register
-			 * is needed to resolve a problem on
-			 * the IBM ThinkPad 750
-			 * where the first write doesn't latch.
-			 * The second write appears to always work and
-			 * doesn't hurt the operation of other chips
-			 * so we can just use it -- this is good since we can't
-			 * determine what chip the 750 actually uses
-			 * (I suspect an early Ricoh).
-			 */
-			pcic_putb(pcic, socket, PCIC_POWER_CONTROL, powerlevel);
-
-			value = pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-			pcic_mswait(pcic, socket, pcic_powerdelay);
-#if defined(PCIC_DEBUG)
-			pcic_err(pcic->dip, 8,
-			    "\tpowerlevel reg = %x (ifs %x)\n",
-			    value, pcic_getb(pcic, socket,
-			    PCIC_INTERFACE_STATUS));
-			pcic_err(pcic->dip, 8,
-			    "CBus regs: PS 0x%x, Control 0x%x\n",
-			    pcic_getcb(pcic, CB_PRESENT_STATE),
-			    pcic_getcb(pcic, CB_CONTROL));
-#endif
-			/*
-			 * since power was touched, make sure it says it
-			 * is on.  This lets it become stable.
-			 */
-			for (ind = 0; ind < 20; ind++) {
-				ifs = pcic_getb(pcic, socket,
-				    PCIC_INTERFACE_STATUS);
-				if (ifs & PCIC_POWER_ON)
-					break;
-				else {
-					pcic_putb(pcic, socket,
-					    PCIC_POWER_CONTROL, 0);
-					(void) pcic_getb(pcic, socket,
-					    PCIC_POWER_CONTROL);
-					pcic_mswait(pcic, socket, 40);
-					if (ind == 10) {
-						pcic_putcb(pcic, CB_EVENT_FORCE,
-						    CB_EF_CVTEST);
-						pcic_mswait(pcic, socket, 100);
-					}
-					pcic_putb(pcic, socket,
-					    PCIC_POWER_CONTROL,
-					    powerlevel & ~POWER_OUTPUT_ENABLE);
-					(void) pcic_getb(pcic, socket,
-					    PCIC_POWER_CONTROL);
-					pcic_mswait(pcic, socket,
-					    pcic_powerdelay);
-					pcic_putb(pcic, socket,
-					    PCIC_POWER_CONTROL, powerlevel);
-					(void) pcic_getb(pcic, socket,
-					    PCIC_POWER_CONTROL);
-					pcic_mswait(pcic, socket,
-					    pcic_powerdelay);
-				}
-			}
-
-			if (!(ifs & PCIC_POWER_ON)) {
-				cmn_err(CE_WARN,
-				    "pcic socket %d: Power didn't get turned"
-				    "on!\nif status 0x%x pwrc 0x%x(x%x) "
-				    "misc1 0x%x igc 0x%x ind %d\n",
-				    socket, ifs,
-				    pcic_getb(pcic, socket, PCIC_POWER_CONTROL),
-				    orig_pwrctl,
-				    pcic_getb(pcic, socket, PCIC_MISC_CTL_1),
-				    pcic_getb(pcic, socket, PCIC_INTERRUPT),
-				    ind);
-				return (BAD_VCC);
-			}
-#if defined(PCIC_DEBUG)
-			pcic_err(pcic->dip, 8,
-			    "\tind = %d, if status %x pwrc 0x%x "
-			    "misc1 0x%x igc 0x%x\n",
-			    ind, ifs,
-			    pcic_getb(pcic, socket, PCIC_POWER_CONTROL),
-			    pcic_getb(pcic, socket, PCIC_MISC_CTL_1),
-			    pcic_getb(pcic, socket, PCIC_INTERRUPT));
-#endif
-		} else {
-			/* explicitly turned off the power */
-			pcic_putb(pcic, socket, PCIC_POWER_CONTROL, powerlevel);
-			(void) pcic_getb(pcic, socket, PCIC_POWER_CONTROL);
-		}
-	}
-	return (SUCCESS);
-}
-
-static int pcic_cbdoreset_during_poweron = 1;
-static int
-pcic_cbus_powerctl(pcicdev_t *pcic, int socket)
-{
-	uint32_t cbctl = 0, orig_cbctl, cbstev, cbps;
-	int ind, iobits;
-	pcic_socket_t *sockp = &pcic->pc_sockets[socket];
-
-	pcic_putcb(pcic, CB_STATUS_EVENT, CB_SE_POWER_CYCLE);
-
-	ind = pcic_power[sockp->pcs_vpp1].PowerLevel/10;
-	cbctl |= pcic_cbv_levels[ind];
-
-	ind = pcic_power[sockp->pcs_vcc].PowerLevel/10;
-	cbctl |= (pcic_cbv_levels[ind]<<4);
-
-	orig_cbctl = pcic_getcb(pcic, CB_CONTROL);
-
-#if defined(PCIC_DEBUG)
-	pcic_err(pcic->dip, 6,
-	    "pcic_cbus_powerctl(socket %d) vcc %d vpp1 %d "
-	    "cbctl 0x%x->0x%x\n",
-	    socket, sockp->pcs_vcc, sockp->pcs_vpp1, orig_cbctl, cbctl);
-#endif
-	if (cbctl != orig_cbctl) {
-		if (pcic_cbdoreset_during_poweron &&
-		    (orig_cbctl & (CB_C_VCCMASK|CB_C_VPPMASK)) == 0) {
-			iobits = pcic_getb(pcic, socket, PCIC_INTERRUPT);
-			pcic_putb(pcic, socket, PCIC_INTERRUPT,
-			    iobits & ~PCIC_RESET);
-		}
-		pcic_putcb(pcic, CB_CONTROL, cbctl);
-
-		if ((cbctl & CB_C_VCCMASK) == (orig_cbctl & CB_C_VCCMASK)) {
-		pcic_mswait(pcic, socket, pcic_powerdelay);
-		return (SUCCESS);
-		}
-		for (ind = 0; ind < 20; ind++) {
-		cbstev = pcic_getcb(pcic, CB_STATUS_EVENT);
-
-		if (cbstev & CB_SE_POWER_CYCLE) {
-
-		/*
-		 * delay 400 ms: though the standard defines that the Vcc
-		 * set-up time is 20 ms, some PC-Card bridge requires longer
-		 * duration.
-		 * Note: We should check the status AFTER the delay to give time
-		 * for things to stabilize.
-		 */
-			pcic_mswait(pcic, socket, 400);
-
-			cbps = pcic_getcb(pcic, CB_PRESENT_STATE);
-			if (cbctl && !(cbps & CB_PS_POWER_CYCLE)) {
-			/* break; */
-			cmn_err(CE_WARN, "cbus_powerctl: power off??\n");
-			}
-			if (cbctl & CB_PS_BADVCC) {
-			cmn_err(CE_WARN, "cbus_powerctl: bad power request\n");
-			break;
-			}
-
-#if defined(PCIC_DEBUG)
-			pcic_err(pcic->dip, 8,
-			    "cbstev = 0x%x cbps = 0x%x cbctl 0x%x(0x%x)",
-			    cbstev, pcic_getcb(pcic, CB_PRESENT_STATE),
-			    cbctl, orig_cbctl);
-#endif
-			if (pcic_cbdoreset_during_poweron &&
-			    (orig_cbctl & (CB_C_VCCMASK|CB_C_VPPMASK)) == 0) {
-				pcic_putb(pcic, socket, PCIC_INTERRUPT, iobits);
-			}
-			return (SUCCESS);
-		}
-		pcic_mswait(pcic, socket, 40);
-		}
-		if (pcic_cbdoreset_during_poweron &&
-		    (orig_cbctl & (CB_C_VCCMASK|CB_C_VPPMASK)) == 0) {
-			pcic_putb(pcic, socket, PCIC_INTERRUPT, iobits);
-		}
-		cmn_err(CE_WARN,
-		    "pcic socket %d: Power didn't get turned on/off!\n"
-		    "cbstev = 0x%x cbps = 0x%x cbctl 0x%x(0x%x) "
-		    "vcc %d vpp1 %d", socket, cbstev,
-		    pcic_getcb(pcic, CB_PRESENT_STATE),
-		    cbctl, orig_cbctl, sockp->pcs_vcc, sockp->pcs_vpp1);
-		return (BAD_VCC);
-	}
-	return (SUCCESS);
-}
-
-static int	pcic_do_pprintf = 0;
-
-static void
-pcic_dump_debqueue(char *msg)
-{
-	struct debounce *debp = pcic_deb_queue;
-	clock_t lbolt;
-
-	(void) drv_getparm(LBOLT, &lbolt);
-	pcic_err(NULL, 6, debp ? "pcic debounce list (%s) lbolt 0x%x:\n" :
-	    "pcic debounce_list (%s) EMPTY lbolt 0x%x\n", msg, lbolt);
-	while (debp) {
-		pcic_err(NULL, 6, "%p: exp 0x%x next 0x%p id 0x%p\n",
-		    (void *) debp, (int)debp->expire, (void *) debp->next,
-		    debp->pcs->pcs_debounce_id);
-		debp = debp->next;
-	}
-}
-
-
-/* PRINTFLIKE3 */
-static void
-pcic_err(dev_info_t *dip, int level, const char *fmt, ...)
-{
-	if (pcic_debug && (level <= pcic_debug)) {
-		va_list adx;
-		int	instance;
-		char	buf[256];
-		const char	*name;
-#if !defined(PCIC_DEBUG)
-		int	ce;
-		char	qmark = 0;
-
-		if (level <= 3)
-			ce = CE_WARN;
-		else
-			ce = CE_CONT;
-		if (level == 4)
-			qmark = 1;
-#endif
-
-		if (dip) {
-			instance = ddi_get_instance(dip);
-			/* name = ddi_binding_name(dip); */
-			name = ddi_driver_name(dip);
-		} else {
-			instance = 0;
-			name = "";
-		}
-
-		va_start(adx, fmt);
-		(void) vsprintf(buf, fmt, adx);
-		va_end(adx);
-
-#if defined(PCIC_DEBUG)
-		if (pcic_do_pprintf) {
-			if (dip) {
-				if (instance >= 0)
-					prom_printf("%s(%d),0x%p: %s", name,
-					    instance, (void *)dip, buf);
-				else
-					prom_printf("%s,0x%p: %s",
-					    name, (void *)dip, buf);
-			} else
-				prom_printf(buf);
-		} else {
-			if (dip) {
-				if (instance >= 0)
-					cmn_err(CE_CONT, "%s(%d),0x%p: %s",
-					    name, instance, (void *) dip, buf);
-				else
-					cmn_err(CE_CONT, "%s,0x%p: %s",
-					    name, (void *) dip, buf);
-			} else
-				cmn_err(CE_CONT, buf);
-		}
-#else
-		if (dip)
-			cmn_err(ce, qmark ? "?%s%d: %s" : "%s%d: %s", name,
-			    instance, buf);
-		else
-			cmn_err(ce, qmark ? "?%s" : buf, buf);
-#endif
-	}
-}
--- old/usr/src/uts/common/io/pcic.conf	2014-11-12 17:44:40.502387206 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,38 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-
-#ident	"%Z%%M%	%I%	%E% SMI"
-
-#
-# with the pcmcia/pcic enumerator and the PCI devices
-# there is not much need for this file other than to
-# get the correct interrupt priorities
-#
-interrupt-priorities=6;
-
-#
-# force attach driver to support hotplug activity
-#
-ddi-forceattach=1;
--- old/usr/src/uts/common/pcmcia/cis/cis.c	2014-11-12 17:44:40.553559584 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,1380 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This is a collection of routines that make up the Card Information
- *	Structure (CIS) interpreter.  The algorigthms used are based
- *	on the Release 2.01 PCMCIA standard.
- *
- * Note that a bunch of comments are not indented correctly with the
- *	code that they are commenting on. This is because cstyle is
- *	inflexible concerning 4-column indenting.
- */
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/debug.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-#include <pcmcia/sys/cis_protos.h>
-#include <pcmcia/sys/cs_stubs.h>
-
-/*
- * Function declarations
- */
-void *CISParser(int function, ...);
-static int (*cis_card_services)(int, ...) = NULL;
-
-static int cis_process_longlink(cistpl_callout_t *, cistpl_t *,
-						cis_info_t *, cisparse_t *);
-static int cis_create_cis_chain(cs_socket_t *, cistpl_callout_t *,
-					cisptr_t *, cis_info_t *, cisparse_t *);
-static void cis_store_cis_addr(cistpl_t *, cisptr_t *);
-
-extern cistpl_callout_t cistpl_std_callout[];
-extern cistpl_devspeed_struct_t cistpl_devspeed_struct;
-
-#ifdef	CIS_DEBUG
-int	cis_debug = 0;
-#endif
-
-/*
- * cisp_init - initialize the CIS parser
- */
-void
-cisp_init()
-{
-#ifdef	XXX
-	csregister_t csr;
-
-	/*
-	 * Fill out the function for CISSetAddress
-	 */
-	csr.cs_magic = PCCS_MAGIC;
-	csr.cs_version = PCCS_VERSION;
-	csr.cs_event = (f_t *)CISParser;
-
-	/*
-	 * We have to call SS instead of CS to register because we
-	 *	can't do a _depends_on for CS
-	 */
-	SocketServices(CISSetAddress, &csr);
-#endif	/* XXX */
-}
-
-/*
- * cis_deinit - deinitialize the CIS parser
- */
-void
-cis_deinit()
-{
-
-	/*
-	 * Tell CS that we're gone.
-	 */
-	if (cis_card_services)
-	    CIS_CARD_SERVICES(CISUnregister);
-
-	return;
-
-}
-
-/*
- * CISParser - this is the entrypoint for all of the CIS Interpreter
- *		functions
- */
-void *
-CISParser(int function, ...)
-{
-	va_list arglist;
-	void *retcode = (void *)CS_UNSUPPORTED_FUNCTION;
-
-#if defined(CIS_DEBUG)
-	if (cis_debug > 1) {
-	    cmn_err(CE_CONT, "CISParser: called with function 0x%x\n",
-				function);
-	}
-#endif
-
-	va_start(arglist, function);
-
-	/*
-	 * ...and here's the CIS Interpreter waterfall
-	 */
-	switch (function) {
-	    case CISP_CIS_SETUP: {
-		csregister_t *csr;
-		cisregister_t cisr;
-
-		    csr = va_arg(arglist, csregister_t *);
-		    cis_card_services = csr->cs_card_services;
-
-		    cisr.cis_magic = PCCS_MAGIC;
-		    cisr.cis_version = PCCS_VERSION;
-		    cisr.cis_parser = NULL;	/* let the framework do this */
-		    cisr.cistpl_std_callout = cistpl_std_callout;
-
-			/*
-			 * Tell CS that we're here and what our
-			 *	entrypoint address is.
-			 */
-		    CIS_CARD_SERVICES(CISRegister, &cisr);
-		} /* CISP_CIS_SETUP */
-		break;
-	    case CISP_CIS_LIST_CREATE: {
-		cistpl_callout_t *cistpl_callout;
-		cs_socket_t *sp;
-
-		    cistpl_callout = va_arg(arglist, cistpl_callout_t *);
-		    sp = va_arg(arglist, cs_socket_t *);
-
-		    retcode = (void *)
-			(uintptr_t)cis_list_create(cistpl_callout, sp);
-		}
-		break;
-	    case CISP_CIS_LIST_DESTROY: {
-		cs_socket_t *sp;
-
-		    sp = va_arg(arglist, cs_socket_t *);
-
-		    retcode = (void *)(uintptr_t)cis_list_destroy(sp);
-		}
-		break;
-	    case CISP_CIS_GET_LTUPLE: {
-		cistpl_t *tp;
-		cisdata_t type;
-		int flags;
-
-		    tp = va_arg(arglist, cistpl_t *);
-		    type = va_arg(arglist, uint_t);
-		    flags = va_arg(arglist, int);
-
-		    retcode = (void *)cis_get_ltuple(tp, type, flags);
-		}
-		break;
-
-	    case CISP_CIS_PARSE_TUPLE: {
-		cistpl_callout_t *co;
-		cistpl_t *tp;
-		int flags;
-		void *arg;
-		cisdata_t subtype;
-
-		co = va_arg(arglist, cistpl_callout_t *);
-		tp = va_arg(arglist, cistpl_t *);
-		flags = va_arg(arglist, int);
-		arg = va_arg(arglist, void *);
-		subtype = va_arg(arglist, uint_t);
-
-		retcode = (void *)(uintptr_t)cis_tuple_handler(co, tp,
-		    flags, arg, subtype);
-		}
-		break;
-
-	    case CISP_CIS_CONV_DEVSPEED:
-		retcode = (void *)(uintptr_t)cis_convert_devspeed(
-				va_arg(arglist, convert_speed_t *));
-		break;
-
-	    case CISP_CIS_CONV_DEVSIZE:
-		retcode = (void *)(uintptr_t)cis_convert_devsize(
-				va_arg(arglist, convert_size_t *));
-		break;
-
-	    default:
-		break;
-	}
-
-	va_end(arglist);
-
-	return (retcode);
-}
-
-/*
- * cis_list_lcreate - read a PC card's CIS and create a local linked CIS list
- *
- *	cistpl_callout_t *cistpl_callout - pointer to callout structure
- *				array to use to find tuples.
- *	cisptr_t cisptr - pointer to a structure containing the handle and
- *				offset from where we should start reading
- *				CIS bytes as well as misc flags.
- *	cis_info_t *cis_info - pointer to a cis_info_t structure; pass
- *				the cis_info->cis member as a NULL pointer
- *				if you want to create a new list.
- *	cisparse_t *cisparse - pointer to a cisparse_t struture to put
- *				parsed longlink tuple data into.
- *      cs_socket_t *sp - pointer to a cs_socket_t structure that describes
- *				 the socket and card in this socket.
- *
- * We return the a count of the number of tuples that we saw, not including
- *	any CISTPL_END or CISTPL_NULL tuples if there were no problems
- *	processing the CIS.  If a tuple handler returns an error, we
- *	immediately return with the error code from the handler. An
- *	error return code will always have the HANDTPL_ERROR bit set
- *	to allow the caller to distinguish an error from a valid tuple
- *	count.
- *
- * The nchains and ntuples counters in  the cis_info_t structure are also
- *	updated to reflect the number of chains and number of tuples in
- *	this chain.
- *
- * XXX need to add CISTPL_END and CISTPL_NULL tuples to the list, and need
- *	to be sure that the tuple count reflects these tuples
- *
- * If we attempt to read beyond the end of the mapped in CIS address space,
- *	the BAD_CIS_ADDR error code is returned.
- *
- * This function only interprets the CISTPL_END and CISTPL_NULL tuples as
- *	well as any tuple with a link field of CISTPL_END.
- *
- * Tuples of type CISTPL_END or CISTPL_NULL are not added to the list.
- *
- * To append tuples to end of a local linked CIS list, pass a pointer to the
- *	address of the last element in the list that you want tuples appended
- *	to. This pointer should be passed in cis_info->cis.
- *
- * To process tuple chains with any long link targets, call this routine
- *	for each tuple chain you want to process using the list append method
- *	described above.  The caller is responsible for vaildating any link
- *	target tuples to be sure that they describe a valid CIS chain.
- *
- * The cis_info->flags member is updated as follows:
- *
- *		CW_VALID_CIS - if the CIS is valid
- *		CW_LONGLINK_MFC_FOUND - if a CISTPL_LONGLINK_MFC tuple
- *					was seen
- *		CW_LONGLINK_A_FOUND - if a CISTPL_LONGLINK_A tuple was
- *					seen
- *		CW_LONGLINK_C_FOUND - if a CISTPL_LONGLINK_C tuple was
- *					seen
- *
- *	If a CISTPL_LONGLINK_MFC, CISTPL_LONGLINK_A or CISTPL_LONGLINK_C
- *	tuple is seen, the *cisparse argument will return an appropriate
- *	parsed longlink structure as follows:
- *
- *		CW_LONGLINK_MFC_FOUND:
- *			*cisparse --> cistpl_longlink_mfc_t *
- *		CW_LONGLINK_A_FOUND, CW_LONGLINK_C_FOUND:
- *			*cisparse --> cistpl_longlink_ac_t *
- *
- *	These flags are set and the tuples are parsed so that the caller does
- *	not have to traverse the CIS list to find out if any of these tuples
- *	have been seen.
- *
- * For each tuple that we see, the following flags in the tuple_t->flags member
- *	are set/cleared:
- *
- *		CISTPLF_COPYOK - OK to copy tuple data
- *		CISTPLF_GLOBAL_CIS - tuple from global CIS
- *		CISTPLF_MF_CIS - tuple from MF CIS chain
- *		CISTPLF_FROM_AM - tuple read from AM space
- *		CISTPLF_FROM_CM - tuple read from CM space
- *		CISTPLF_LINK_INVALID - tuple link is invalid
- *		CISTPLF_PARAMS_INVALID - tuple body is invalid
- *		CISTPLF_AM_SPACE - this tuple is in AM space
- *		CISTPLF_CM_SPACE - this tuple is in CM space
- *		CISTPLF_LM_SPACE - this tuple is in local memory
- */
-uint32_t
-cis_list_lcreate(cistpl_callout_t *cistpl_callout, cisptr_t *cisptr,
-    cis_info_t *cis_info, cisparse_t *cisparse, cs_socket_t *sp)
-{
-	cistpl_t *cp, *tp = NULL;
-	cisdata_t tl, td, *dp;
-	int done = 0, err;
-	get_socket_t get_socket;
-
-
-	/*
-	 * If we were passed a non-NULL list base, that means that we should
-	 *	parse the CIS and add any tuples we find to the end of the list
-	 *	we were handed a pointer to.
-	 */
-	if (cis_info->cis) {
-		tp = cis_info->cis;
-	}
-
-	get_socket.socket = sp->socket_num;
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS) {
-		cmn_err(CE_CONT,
-		    "cis_list_lcreate: socket %d SS_GetSocket failed\n",
-		    sp->socket_num);
-		return (CS_BAD_SOCKET);
-	}
-
-	/*
-	 * If this is primary CIS chain, the first tuple must be one
-	 *	from the following list.
-	 * Ref. PC Card 95, Metaformat Specification, Page 7.
-	 * XXX Need to think this out a bit more to deal with 3.3V
-	 *	cards and the description of where a CISTPL_DEVICE
-	 *	can show up.
-	 */
-
-#if defined(CIS_DEBUG)
-	if (cis_debug > 1) {
-		cmn_err(CE_CONT, "cis_list_lcreate: td=0x%x cisptr=%p\n",
-		    GET_CIS_DATA(cisptr), (void *)cisptr);
-		cmn_err(CE_CONT, "\t flags=0x%x CW_CHECK_PRIMARY_CHAIN=0x%x\n",
-		    cis_info->flags,  CW_CHECK_PRIMARY_CHAIN);
-		cmn_err(CE_CONT, "\t IFType=0x%x IF_MEMORY=0x%x\n",
-		    get_socket.IFType, IF_MEMORY);
-	}
-#endif
-
-	if (cis_info->flags & CW_CHECK_PRIMARY_CHAIN) {
-	switch (td = GET_CIS_DATA(cisptr)) {
-		case CISTPL_DEVICE:
-		case CISTPL_END:
-		case CISTPL_LINKTARGET:
-		    break;
-		case CISTPL_NULL:
-		/*
-		 * Magicram memory cards without attribute memory
-		 * do not have a CIS and return CISTPL_NULL.
-		 */
-		    if (get_socket.IFType == IF_MEMORY)
-			return (0);
-		    break;
-
-		default:
-		    return (0);
-	    } /* switch */
-	} /* CW_CHECK_PRIMARY_CHAIN */
-
-	/*
-	 * Update the number of chains counter
-	 */
-	cis_info->nchains++;
-
-	/*
-	 * The main tuple processing loop.  We'll exit this loop when either
-	 *	a tuple's link field is CISTPL_END or we've seen a tuple type
-	 *	field of CISTPL_END.
-	 *
-	 * Note that we also silently throw away CISTPL_NULL tuples, and don't
-	 *	include them in the tuple count that we return.
-	 */
-	while (!done && ((td = GET_CIS_DATA(cisptr)) !=
-						(cisdata_t)CISTPL_END)) {
-
-#if defined(CIS_DEBUG)
-		if ((cis_debug > 1) && (td != 0)) {
-			cmn_err(CE_CONT, "cis_list_lcreate: td=0x%x cisptr=%p"
-			    "offset=0x%x\n",
-			    td, (void *)cisptr, cisptr->offset);
-		}
-#endif
-
-		/*
-		 * Ignore CISTPL_NULL tuples
-		 */
-		if (td != (cisdata_t)CISTPL_NULL) {
-			/*
-			 * point to tuple link field and get the link value
-			 */
-			if (!NEXT_CIS_ADDR(cisptr))
-			    return ((uint32_t)BAD_CIS_ADDR);
-			tl = GET_CIS_DATA(cisptr);
-		/*
-		 * This is an ugly PCMCIA hack - ugh! since the standard allows
-		 *	a link byte of CISTPL_END to signify that this is the
-		 *	last tuple.  The problem is that this tuple might
-		 *	actually contain useful information, but we don't know
-		 *	the size of it.
-		 * We do know that it can't be more than CIS_MAX_TUPLE_DATA_LEN
-		 *	bytes in length, however.  So, we pretend that the link
-		 *	byte is CIS_MAX_TUPLE_DATA_LEN and also set a flag so
-		 *	that when we're done processing this tuple, we will
-		 *	break out of the while loop.
-		 */
-			if (tl == (cisdata_t)CISTPL_END) {
-				tl = CIS_MAX_TUPLE_DATA_LEN;
-				done = 1;
-			}
-
-		/*
-		 * point to first byte of tuple data, allocate a new list
-		 *	element and diddle with the list base and list
-		 *	control pointers
-		 */
-			if (!NEXT_CIS_ADDR(cisptr))
-			    return ((uint32_t)BAD_CIS_ADDR);
-			cp = (cistpl_t *)CIS_MEM_ALLOC(sizeof (cistpl_t));
-			cp->next = NULL;
-			/*
-			 * if we're not the first in the list, point to our
-			 *	next
-			 */
-			if (tp)
-				tp->next = cp;
-			/*
-			 * will be NULL if we're the first element of the
-			 *	list
-			 */
-			cp->prev = tp;
-			tp = cp;
-			/*
-			 * if this is the first element, save it's address
-			 */
-			if (!cis_info->cis)
-				cis_info->cis = tp;
-			tp->type = td;
-			tp->len = tl;
-
-			/*
-			 * Save the address in CIS space that this tuple
-			 *	begins at, as well as set tuple flags.
-			 */
-			cis_store_cis_addr(tp, cisptr);
-
-			/*
-			 * If this tuple has tuple data, we might need to
-			 *	copy it.
-			 * Note that the tuple data pointer (tp->data) will
-			 *	be set to NULL for a tuple with no data.
-			 */
-#ifdef	XXX
-			if (tl) {
-#endif
-			/*
-			 * Read the data in the tuple and store it
-			 *	away locally if we're allowed to. If
-			 *	the CISTPLF_COPYOK flag is set, it means
-			 *	that it's OK to touch the data portion
-			 *	of the tuple.
-			 *
-			 * We need to make this check since some
-			 *	tuples might contain active registers
-			 *	that can alter the device state if they
-			 *	are read before the card is correctly
-			 *	initialized.  What a stupid thing to
-			 *	allow in a standard, BTW.
-			 *
-			 * We first give the tuple handler a chance
-			 *	to set any tuple flags that it wants
-			 *	to, then we (optionally) do the data
-			 *	copy, and give the tuple handler another
-			 *	shot at the tuple.
-			 *
-			 * ref. PC Card Standard Release 2.01 in the
-			 *	Card Metaformat section, section 5.2.6,
-			 *	page 5-12.
-			 */
-			if ((err = cis_tuple_handler(cistpl_callout, tp,
-						HANDTPL_SET_FLAGS, NULL, 0)) &
-								HANDTPL_ERROR)
-			    return (err);
-
-			if (tl > (unsigned)0) {
-
-				/*
-				 * if we're supposed to make a local copy of
-				 *	the tuple data, allocate space for it,
-				 *	otherwise just record the PC card
-				 *	starting address of this tuple.
-				 * The address was saved by cis_store_cis_addr.
-				 */
-				if (tp->flags & CISTPLF_COPYOK) {
-				    tp->data = (cisdata_t *)CIS_MEM_ALLOC(tl);
-				    dp = tp->data;
-				} else {
-				    tp->data = GET_CIS_ADDR(tp);
-				}
-
-				while (tl--) {
-				    if (tp->flags & CISTPLF_COPYOK)
-					*dp++ = GET_CIS_DATA(cisptr);
-				    if (!NEXT_CIS_ADDR(cisptr))
-					return ((uint32_t)BAD_CIS_ADDR);
-				}
-
-				/*
-				 * If we made a local copy of the tuple data,
-				 *	then clear the AM and CM flags; if the
-				 *	tuple data is still on the card, then
-				 *	leave the flags alone.
-				 */
-				if (tp->flags & CISTPLF_COPYOK) {
-				    tp->flags &= ~CISTPLF_SPACE_MASK;
-				    tp->flags |= CISTPLF_LM_SPACE;
-				}
-
-			/*
-			 * This is a tuple with no data in it's body, so
-			 *	we just set the data pointer to NULL.
-			 */
-			} else {
-
-			    tp->data = NULL;
-				/*
-				 * tp->flags &= ~(CISTPLF_SPACE_MASK |
-				 *		CISTPLF_FROM_MASK);
-				 */
-
-			} /* if (tl > 0) */
-
-			/*
-			 * The main idea behind this call is to give
-			 *	the handler a chance to validate the
-			 *	tuple.
-			 */
-			if ((err = cis_tuple_handler(cistpl_callout, tp,
-						HANDTPL_COPY_DONE, NULL, 0)) &
-								HANDTPL_ERROR)
-			    return (err);
-
-#ifdef	XXX
-			} else { /* if (tl) */
-			    tp->data = NULL;
-			}
-#endif
-
-			/*
-			 * Check to see if this is a longlink tuple and if
-			 *	so, do the necessary processing.
-			 */
-			if ((err = cis_process_longlink(cistpl_callout, tp,
-								cis_info,
-								cisparse)) &
-								HANDTPL_ERROR)
-			    return (err);
-
-			cis_info->ntuples++;
-		} else { /* if (td == CISTPL_NULL) */
-			/*
-			 * If we're a CISTPL_NULL we need to skip to
-			 *	the beginning of the next tuple.
-			 */
-			if (!NEXT_CIS_ADDR(cisptr))
-			    return ((uint32_t)BAD_CIS_ADDR);
-		}
-	} /* while (!done && !CISTPL_END) */
-
-#if defined(CIS_DEBUG)
-	if (cis_debug > 1) {
-	    cmn_err(CE_CONT, "cis_list_lcreate: exit nchains=%x ntuples=%x\n",
-		cis_info->nchains, cis_info->ntuples);
-	}
-#endif
-
-	return (cis_info->ntuples);
-}
-
-/*
- * cis_process_longlink - processes longlink tuples
- *
- *	This function examines the passed-in tuple type and if it is a
- *	longlink tuple, the tuple is parsed and the appropriate flags in
- *	cis_info->flags are set.
- *
- *	If there is an error parsing the tuple, HANDTPL_ERROR is returned
- *	and the CW_LONGLINK_FOUND flags in cis_info->flags are cleared.
- */
-static int
-cis_process_longlink(cistpl_callout_t *cistpl_callout, cistpl_t *tp,
-				cis_info_t *cis_info, cisparse_t *cisparse)
-{
-	/*
-	 * If this is a CISTPL_LONGLINK_A, CISTPL_LONGLINK_C
-	 *	or CISTPL_LONGLINK_MFC tuple, parse the tuple
-	 *	and set appropriate CW_LONGLINK_XXX_FOUND flags.
-	 * If this is a CISTPL_NO_LINK tuple, or if there is an
-	 *	error parsing the tuple, clear all the
-	 *	CW_LONGLINK_XXX_FOUND flags.
-	 */
-	switch (tp->type) {
-	    case CISTPL_LONGLINK_A:
-	    case CISTPL_LONGLINK_C:
-	    case CISTPL_LONGLINK_MFC:
-		cis_info->flags &= ~CW_LONGLINK_FOUND;
-		if (cis_tuple_handler(cistpl_callout, tp,
-						HANDTPL_PARSE_LTUPLE,
-						cisparse, NULL) &
-							HANDTPL_ERROR)
-		    return (HANDTPL_ERROR);
-		switch (tp->type) {
-		    case CISTPL_LONGLINK_A:
-			cis_info->flags |= CW_LONGLINK_A_FOUND;
-			break;
-		    case CISTPL_LONGLINK_C:
-			cis_info->flags |= CW_LONGLINK_C_FOUND;
-			break;
-		    case CISTPL_LONGLINK_MFC:
-			cis_info->flags |= CW_LONGLINK_MFC_FOUND;
-			break;
-		} /* switch (tp->type) */
-		break;
-	    case CISTPL_NO_LINK:
-		cis_info->flags &= ~CW_LONGLINK_FOUND;
-		break;
-	} /* switch (tp->type) */
-
-	return (HANDTPL_NOERROR);
-}
-
-/*
- * cis_list_ldestroy - function to destroy a linked tuple list
- *
- *	cistpl_t *cistplbase - pointer to a pointer to the base of a
- *				local linked CIS list to destroy; the
- *				data that this pointer points to is
- *				also destroyed
- *
- * Once this function returns, cistplbase is set to NULL.
- */
-uint32_t
-cis_list_ldestroy(cistpl_t **cistplbase)
-{
-	cistpl_t *cp, *tp;
-	int tpcnt = 0;
-
-	/*
-	 * First, check to see if we've got a
-	 *	non-NULL list pointer.
-	 */
-	if ((tp = *cistplbase) == NULL)
-	    return (0);
-
-	while (tp) {
-		/*
-		 * Free any data that may be allocated
-		 */
-	    if ((tp->flags & CISTPLF_COPYOK) &&
-			(tp->flags & CISTPLF_LM_SPACE) &&
-						(tp->data))
-		CIS_MEM_FREE((caddr_t)tp->data);
-
-	    cp = tp->next;
-
-		/*
-		 * Free this tuple
-		 */
-	    CIS_MEM_FREE((caddr_t)tp);
-
-	    tp = cp;
-
-	    tpcnt++;
-	}
-
-	/*
-	 * Now clear the pointer to the non-existant
-	 *	linked list.
-	 */
-	*cistplbase = NULL;
-
-	return (tpcnt);
-
-}
-
-/*
- * cis_get_ltuple - function to walk local linked CIS list and return
- *			a tuple based on various criteria
- *
- *	cistpl_t *tp - pointer to any valid tuple in the list
- *	cisdata_t type - type of tuple to search for
- *	int flags - type of action to perform (each is mutually exclusive)
- *		GET_FIRST_LTUPLEF, GET_LAST_LTUPLEF:
- *		    Returns the {first|last} tuple in the list.
- *		FIND_LTUPLE_FWDF, FIND_LTUPLE_BACKF:
- *		FIND_NEXT_LTUPLEF, FIND_PREV_LTUPLEF:
- *		    Returns the first tuple that matches the passed tuple type,
- *			searching the list {forward|backward}.
- *		GET_NEXT_LTUPLEF, GET_PREV_LTUPLEF:
- *		    Returns the {next|previous} tuple in the list.
- *
- *	    The following bits can be set in the flags parameter:
- *		CIS_GET_LTUPLE_IGNORE - return tuples with
- *				CISTPLF_IGNORE_TUPLE set in cistpl_t->flags
- *
- * Note on searching:
- *	When using the FIND_LTUPLE_FWDF and FIND_LTUPLE_BACKF flags,
- *	the search starts at the passed tuple.  Continually calling this
- *	function with a tuple that is the same type as the passed type will
- *	continually return the same tuple.
- *
- *	When using the FIND_NEXT_LTUPLEF and FIND_PREV_LTUPLEF flags,
- *	the search starts at the {next|previous} tuple from the passed tuple.
- *
- * returns:
- *	cistpl_t * - pointer to tuple in list
- *	NULL - if error while processing list or tuple not found
- */
-#define	GET_NEXT_LTUPLE(tp)	((tp->next)?tp->next:NULL)
-#define	GET_PREV_LTUPLE(tp)	((tp->prev)?tp->prev:NULL)
-cistpl_t *
-cis_get_ltuple(cistpl_t *tp, cisdata_t type, uint32_t flags)
-{
-	cistpl_t *ltp = NULL;
-
-	if (!tp)
-	    return (NULL);
-
-	switch (flags & CIS_GET_LTUPLE_OPMASK) {
-	    case GET_FIRST_LTUPLEF:	/* return first tuple in list */
-		do {
-			ltp = tp;
-		} while ((tp = GET_PREV_LTUPLE(tp)) != NULL);
-
-		if (!(flags & CIS_GET_LTUPLE_IGNORE))
-		    while (ltp && (ltp->flags & CISTPLF_IGNORE_TUPLE))
-			ltp = GET_NEXT_LTUPLE(ltp);
-		break;
-	    case GET_LAST_LTUPLEF:	/* return last tuple in list */
-		do {
-			ltp = tp;
-		} while ((tp = GET_NEXT_LTUPLE(tp)) != NULL);
-
-		if (!(flags & CIS_GET_LTUPLE_IGNORE))
-		    while (ltp && (ltp->flags & CISTPLF_IGNORE_TUPLE))
-			ltp = GET_PREV_LTUPLE(ltp);
-		break;
-	    case FIND_LTUPLE_FWDF:	/* find tuple, fwd search from tp */
-		do {
-			if (tp->type == type)
-			    if ((flags & CIS_GET_LTUPLE_IGNORE) ||
-					(!(tp->flags & CISTPLF_IGNORE_TUPLE)))
-				return (tp);	/* note return here */
-		} while ((tp = GET_NEXT_LTUPLE(tp)) != NULL);
-		break;
-	    case FIND_LTUPLE_BACKF:
-		/* find tuple, backward search from tp */
-		do {
-			if (tp->type == type)
-			    if ((flags & CIS_GET_LTUPLE_IGNORE) ||
-					(!(tp->flags & CISTPLF_IGNORE_TUPLE)))
-				return (tp);	/* note return here */
-		} while ((tp = GET_PREV_LTUPLE(tp)) != NULL);
-		break;
-	    case FIND_NEXT_LTUPLEF:	/* find tuple, fwd search from tp+1 */
-		while ((tp = GET_NEXT_LTUPLE(tp)) != NULL) {
-			if (tp->type == type)
-			    if ((flags & CIS_GET_LTUPLE_IGNORE) ||
-					(!(tp->flags & CISTPLF_IGNORE_TUPLE)))
-				return (tp);	/* note return here */
-		} /* while */
-		break;
-	    case FIND_PREV_LTUPLEF:
-		/* find tuple, backward search from tp-1 */
-		while ((tp = GET_PREV_LTUPLE(tp)) != NULL) {
-			if (tp->type == type)
-			    if ((flags & CIS_GET_LTUPLE_IGNORE) ||
-					(!(tp->flags & CISTPLF_IGNORE_TUPLE)))
-				return (tp);	/* note return here */
-		} /* while */
-		break;
-	    case GET_NEXT_LTUPLEF:	/* return next tuple in list */
-		ltp = tp;
-		while (((ltp = GET_NEXT_LTUPLE(ltp)) != NULL) &&
-				(!(flags & CIS_GET_LTUPLE_IGNORE)) &&
-					(ltp->flags & CISTPLF_IGNORE_TUPLE))
-			;
-		break;
-	    case GET_PREV_LTUPLEF:	/* return prev tuple in list */
-		ltp = tp;
-		while (((ltp = GET_PREV_LTUPLE(ltp)) != NULL) &&
-				(!(flags & CIS_GET_LTUPLE_IGNORE)) &&
-					(ltp->flags & CISTPLF_IGNORE_TUPLE))
-			;
-		break;
-	    default:	/* ltp is already NULL in the initialization */
-		break;
-	} /* switch */
-
-	return (ltp);
-}
-
-/*
- * cis_convert_devspeed - converts a devspeed value to nS or nS
- *				to a devspeed entry
- */
-uint32_t
-cis_convert_devspeed(convert_speed_t *cs)
-{
-	cistpl_devspeed_struct_t *cd = &cistpl_devspeed_struct;
-	unsigned exponent = 0, mantissa = 0;
-
-	/*
-	 * Convert nS to a devspeed value
-	 */
-	if (cs->Attributes & CONVERT_NS_TO_DEVSPEED) {
-	    unsigned tnS, tmanv = 0, i;
-
-	/*
-	 * There is no device speed code for 0nS
-	 */
-	    if (!cs->nS)
-		return (CS_BAD_SPEED);
-
-	/*
-	 * Handle any nS value below 10nS specially since the code
-	 *	below only works for nS values >= 10.  Now, why anyone
-	 *	would want to specify a nS value less than 10 is
-	 *	certainly questionable, but it is allowed by the spec.
-	 */
-	    if (cs->nS < 10) {
-		tmanv = cs->nS * 10;
-		mantissa = CISTPL_DEVSPEED_MAX_MAN;
-	    }
-
-	    /* find the exponent */
-	    for (i = 0; i < CISTPL_DEVSPEED_MAX_EXP; i++) {
-		if ((!(tnS = ((cs->nS)/10))) ||
-				(mantissa == CISTPL_DEVSPEED_MAX_MAN)) {
-		    /* find the mantissa */
-		    for (mantissa = 0; mantissa < CISTPL_DEVSPEED_MAX_MAN;
-								mantissa++) {
-			if (cd->mantissa[mantissa] == tmanv) {
-			    cs->devspeed = ((((mantissa<<3) |
-				(exponent & (CISTPL_DEVSPEED_MAX_EXP - 1)))));
-			    return (CS_SUCCESS);
-			}
-		    } /* for (mantissa<CISTPL_DEVSPEED_MAX_MAN) */
-		} else {
-		    exponent = i + 1;
-		    tmanv = cs->nS;
-		    cs->nS = tnS;
-		} /* if (!tnS) */
-	    } /* for (i<CISTPL_DEVSPEED_MAX_EXP) */
-	/*
-	 * Convert a devspeed value to nS
-	 */
-	} else if (cs->Attributes & CONVERT_DEVSPEED_TO_NS) {
-	    exponent = (cs->devspeed & (CISTPL_DEVSPEED_MAX_TBL - 1));
-	    if ((mantissa = (((cs->devspeed)>>3) &
-				(CISTPL_DEVSPEED_MAX_MAN - 1))) == NULL) {
-		if ((cs->nS = cd->table[exponent]) == NULL)
-		    return (CS_BAD_SPEED);
-		return (CS_SUCCESS);
-	    } else {
-		if ((cs->nS = ((cd->mantissa[mantissa] *
-					cd->exponent[exponent]) / 10)) == NULL)
-		    return (CS_BAD_SPEED);
-		return (CS_SUCCESS);
-	    }
-	} else {
-	    return (CS_BAD_ATTRIBUTE);
-	}
-
-	return (CS_BAD_SPEED);
-}
-
-/*
- * This array is for the cis_convert_devsize function.
- */
-static uint32_t cistpl_device_size[8] =
-	{ 512, 2*1024, 8*1024, 32*1024, 128*1024, 512*1024, 2*1024*1024, 0 };
-
-/*
- * cis_convert_devsize - converts a devsize value to a size in bytes value
- *				or a size in bytes value to a devsize value
- */
-uint32_t
-cis_convert_devsize(convert_size_t *cs)
-{
-	int i;
-
-	if (cs->Attributes & CONVERT_BYTES_TO_DEVSIZE) {
-	    if ((cs->bytes < cistpl_device_size[0]) ||
-				(cs->bytes > (cistpl_device_size[6] * 32)))
-	    return (CS_BAD_SIZE);
-
-	    for (i = 6; i >= 0; i--)
-		if (cs->bytes >= cistpl_device_size[i])
-		    break;
-
-	    cs->devsize = ((((cs->bytes/cistpl_device_size[i]) - 1) << 3) |
-								(i & 7));
-
-	} else if (cs->Attributes & CONVERT_DEVSIZE_TO_BYTES) {
-	    if ((cs->devsize & 7) == 7)
-		return (CS_BAD_SIZE);
-	    cs->bytes =
-		cistpl_device_size[cs->devsize & 7] * ((cs->devsize >> 3) + 1);
-	} else {
-	    return (CS_BAD_ATTRIBUTE);
-	}
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cis_list_create - reads the card's CIS and creates local CIS lists for
- *			each function on the card
- *
- * This function will read the CIS on the card, follow all CISTPL_LONGLINK_A,
- *	CISTPL_LONGLINK_C and CISTPL_LONGLINK_MFC tuples and create local CIS
- *	lists for each major CIS chain on the card.
- *
- * If there are no errors, the parameters returned are:
- *	For a non-multifunction card:
- *		sp->cis_flags - CW_VALID_CIS set
- *		sp->nfuncs - set to 0x0
- *		sp->cis[CS_GLOBAL_CIS] - contains CIS list
- *		sp->cis[CS_GLOBAL_CIS].cis_flags - CW_VALID_CIS set
- *
- *	For a multifunction card:
- *	    Global CIS values:
- *		sp->cis_flags - CW_VALID_CIS & CW_MULTI_FUNCTION_CIS set
- *		sp->nfuncs - set to number of functions specified in
- *				the CISTPL_LONGLINK_MFC tuple
- *		sp->cis[CS_GLOBAL_CIS] - contains global CIS list
- *		sp->cis[CS_GLOBAL_CIS].cis_flags - CW_VALID_CIS set
- *	    Function-specific CIS values:
- *		sp->cis[0..sp->nfuncs-1] - contains function-specific CIS lists
- *		sp->cis[0..sp->nfuncs-1].cis_flags - CW_VALID_CIS &
- *						CW_MULTI_FUNCTION_CIS set
- *
- *	returns:
- *		CS_SUCCESS - if no errors
- *		CS_NO_CIS - if no CIS on card
- *		CS_BAD_WINDOW or CS_GENERAL_FAILURE - if CIS window could
- *				not be setup
- *		CS_BAD_CIS - if error creating CIS chains
- *		CS_BAD_OFFSET - if cis_list_lcreate tried to read past the
- *				boundries of the allocated CIS window
- */
-extern cistpl_ignore_list_t cistpl_ignore_list[];
-uint32_t
-cis_list_create(cistpl_callout_t *cistpl_callout, cs_socket_t *sp)
-{
-	cisptr_t cisptr;
-	cisparse_t cisparse;
-	cis_info_t *cis_info;
-	cistpl_longlink_ac_t *cistpl_longlink_ac;
-	cistpl_longlink_mfc_t cistpl_longlink_mfc, *mfc;
-	cistpl_ignore_list_t *cil;
-	int fn, ret;
-
-	/*
-	 * Initialize the CIS structures
-	 */
-	bzero((caddr_t)&sp->cis, ((sizeof (cis_info_t)) * CS_MAX_CIS));
-
-	/*
-	 * Start reading the primary CIS chain at offset 0x0 of AM. Assume
-	 *	that there is a CISTPL_LONGLINK_C tuple that points to
-	 *	offset 0x0 of CM space.
-	 * Since this is the primary CIS chain, set CW_CHECK_PRIMARY_CHAIN
-	 *	so that we'll check for a valid first tuple.
-	 */
-	cis_info = &sp->cis[CS_GLOBAL_CIS];
-	cis_info->flags = (CW_LONGLINK_C_FOUND | CW_CHECK_PRIMARY_CHAIN);
-	cisptr.flags = (CISTPLF_AM_SPACE | CISTPLF_GLOBAL_CIS);
-	cisptr.size = sp->cis_win_size - 1;
-	cisptr.offset = 0;
-	cistpl_longlink_ac = (cistpl_longlink_ac_t *)&cisparse;
-	cistpl_longlink_ac->flags = CISTPL_LONGLINK_AC_CM;
-	cistpl_longlink_ac->tpll_addr = 0;
-
-	if ((ret = cis_create_cis_chain(sp, cistpl_callout, &cisptr,
-						cis_info, &cisparse)) !=
-								CS_SUCCESS) {
-	    return (ret);
-	} /* cis_create_cis_chain */
-
-	/*
-	 * If there are no tuples in the primary CIS chain, it means that
-	 *	this card doesn't have a CIS on it.
-	 */
-	if (cis_info->ntuples == 0)
-	    return (CS_NO_CIS);
-
-	/*
-	 * Mark this CIS list as being valid.
-	 */
-	cis_info->flags |= CW_VALID_CIS;
-
-	/*
-	 * Mark this socket as having at least one valid CIS chain.
-	 */
-	sp->cis_flags |= CW_VALID_CIS;
-	sp->nfuncs = 0;
-
-	/*
-	 * If the primary CIS chain specified that there are function-specific
-	 *	CIS chains, we need to create each of these chains. If not,
-	 *	then we're all done and we can return.
-	 */
-	if (!(cis_info->flags & CW_LONGLINK_MFC_FOUND))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Mark this socket as having a multi-function CIS.
-	 */
-	sp->cis_flags |= CW_MULTI_FUNCTION_CIS;
-
-	/*
-	 * At this point, cis_create_cis_chain has told us that the primary
-	 *	CIS chain says that there are function-specific CIS chains
-	 *	on the card that we need to follow. The cisparse variable now
-	 *	contains the parsed output of the CISTPL_LONGLINK_MFC
-	 *	tuple. We need to save that information and then process
-	 *	each function-specific CIS chain.
-	 */
-	bcopy((caddr_t)&cisparse, (caddr_t)&cistpl_longlink_mfc,
-					sizeof (cistpl_longlink_mfc_t));
-	mfc = &cistpl_longlink_mfc;
-	sp->nfuncs = mfc->nregs;
-
-	/*
-	 * Go through and create a CIS list for each function-specific
-	 *	CIS chain on the card. Set CW_CHECK_LINKTARGET since all
-	 *	function-specific CIS chains must begin with a valid
-	 *	CISTPL_LINKTARGET tuple. Also set CW_RET_ON_LINKTARGET_ERROR
-	 *	since we want to return an error if the CISTPL_LINKTARGET
-	 *	tuple is invalid or missing.
-	 */
-	for (fn = 0; fn < sp->nfuncs; fn++) {
-	    cis_info = &sp->cis[fn];
-	    cis_info->flags = (CW_CHECK_LINKTARGET |
-					CW_RET_ON_LINKTARGET_ERROR);
-		/*
-		 * If the function-specific CIS chain starts
-		 *	in AM space, then multiply address by
-		 *	2 since only even bytes are counted in
-		 *	the CIS when AM addresses are specified,
-		 *	otherwise use the
-		 *	address as specified.
-		 */
-	    if (mfc->function[fn].tas == CISTPL_LONGLINK_MFC_TAS_AM) {
-		cisptr.flags = (CISTPLF_AM_SPACE | CISTPLF_MF_CIS);
-		cisptr.offset = mfc->function[fn].addr * 2;
-	    } else {
-		cisptr.flags = (CISTPLF_CM_SPACE | CISTPLF_MF_CIS);
-		cisptr.offset = mfc->function[fn].addr;
-	    }
-
-	    if ((ret = cis_create_cis_chain(sp, cistpl_callout, &cisptr,
-						cis_info, &cisparse)) !=
-								CS_SUCCESS) {
-		cmn_err(CE_CONT,
-		    "cis_list_create: socket %d ERROR_MFC = 0x%x\n",
-		    sp->socket_num, ret);
-		return (ret);
-	    } /* cis_create_cis_chain */
-
-		/*
-		 * Mark this CIS list as being valid and as being a
-		 *	function-specific CIS list.
-		 */
-	    cis_info->flags |= (CW_VALID_CIS | CW_MULTI_FUNCTION_CIS);
-
-		/*
-		 * Check for tuples that we want to ignore
-		 *	in the global CIS.  If the tuple exists
-		 *	in the global CIS and in at least one
-		 *	of the function-specific CIS lists, then
-		 *	we flag the tuple
-		 *	in the global CIS to be ignored.
-		 */
-	    cil = &cistpl_ignore_list[0];
-	    while (cil->type != CISTPL_NULL) {
-		if (cis_get_ltuple(sp->cis[fn].cis, cil->type,
-					FIND_LTUPLE_FWDF |
-					CIS_GET_LTUPLE_IGNORE) != NULL) {
-		    cistpl_t *gtp = sp->cis[CS_GLOBAL_CIS].cis;
-		    while ((gtp = cis_get_ltuple(gtp, cil->type,
-					FIND_LTUPLE_FWDF |
-					CIS_GET_LTUPLE_IGNORE)) != NULL) {
-			gtp->flags |= CISTPLF_IGNORE_TUPLE;
-			gtp = cis_get_ltuple(gtp, NULL, GET_NEXT_LTUPLEF |
-							CIS_GET_LTUPLE_IGNORE);
-		    } /* while */
-		} /* if (cis_get_ltuple(cis[fn])) */
-		cil++;
-	    } /* while */
-	} /* for */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cis_create_cis_chain - creates a single CIS chain
- *
- * This function reads the CIS on a card and follows any CISTPL_LONGLINK_A
- *	and CISTPL_LONGLINK_C link tuples to create a single CIS chain. We
- *	keep reading the CIS and following any CISTPL_LONGLINK_A and
- *	CISTPL_LONGLINK_C tuples until we don't see anymore. If we see a
- *	CISTPL_LONGLINK_MFC tuple, we return - the caller is responsible
- *	for following CIS chains on a per-function level.
- *
- * The following parameters must be initialized by the caller:
- *
- *	sp - pointer to a cs_socket_t structure that describes the socket
- *			and card in this socket
- *	cistpl_callout - pointer to a cistpl_callout_t array of structures
- *	cisptr->flags - either CISTPLF_AM_SPACE or CISTPLF_CM_SPACE
- *	cisptr->size - size of CIS window
- *	cisptr->offset - offset in AM or CM space on card to start
- *			reading tuples from
- *	cis_info - pointer to a cis_info_t structure where this list will
- *			be anchored on
- *	cisparse - pointer to a cisparse_t structure where the last longlink
- *			parsed tuple data will be returned
- *
- * To check the CISTPL_LINKTARGET tuple at the beginning of the first
- *	CIS chain that this function encounters, set CW_CHECK_LINKTARGET
- *	in cis_info->flags before calling this function.
- *
- * This function returns:
- *
- *	CS_SUCCESS - if CIS chain was created sucessfully or there
- *			were no tuples found on the first CIS chain
- *	CS_BAD_WINDOW or CS_GENERAL_FAILURE - if CIS window could
- *			not be setup
- *	CS_BAD_CIS - if error creating CIS chain
- *	CS_BAD_OFFSET - if cis_list_lcreate tried to read past the
- *			boundries of the allocated CIS window
- *
- * Note that if the first tuple of the target CIS chain is supposed
- *	to contain a CISTPL_LINKTARGET and the target chain does not
- *	contain that tuple (or that tuple is invalid in some way) and
- *	the CW_RET_ON_LINKTARGET_ERROR flag is not set, we don't flag
- *	this as an error, we just return. This is to handle the case
- *	where the target chain is in uninitialized memory and will be
- *	initialized later.
- * To return an error if an invalid CISTPL_LINKTARGET tuple is seen,
- *	set the CW_RET_ON_LINKTARGET_ERROR flag in cis_info->flags
- *	before calling this function.
- */
-static int
-cis_create_cis_chain(cs_socket_t *sp, cistpl_callout_t *cistpl_callout,
-				cisptr_t *cisptr, cis_info_t *cis_info,
-							cisparse_t *cisparse)
-{
-	cistpl_t *tps = NULL;
-	uint32_t ret;
-
-	do {
-	    if ((ret = CIS_CARD_SERVICES(InitCISWindow, sp, &cisptr->offset,
-				&cisptr->handle, cisptr->flags)) != CS_SUCCESS)
-		return (ret);
-
-		/*
-		 * If we're pointing at a CIS chain that
-		 *	is the target of a longlink tuple,
-		 *	we need to validate the target chain
-		 *	before we try to process it. If the
-		 *	CISTPL_LINKTARGET tuple is invalid,
-		 *	and the CW_RET_ON_LINKTARGET_ERROR
-		 *	is not set, don't flag it as an error,
-		 *	just return.
-		 */
-	    if (cis_info->flags & CW_CHECK_LINKTARGET) {
-		cis_info->flags &= ~CW_CHECK_LINKTARGET;
-		if (cis_validate_longlink_acm(cisptr) != CISTPLF_NOERROR) {
-		    if (tps != NULL)
-			cis_info->cis = tps;
-		    if (cis_info->flags & CW_RET_ON_LINKTARGET_ERROR) {
-			cis_info->flags &= ~CW_RET_ON_LINKTARGET_ERROR;
-			return (CS_BAD_CIS);
-		    } else {
-			return (CS_SUCCESS);
-		    } /* CW_RET_ON_LINKTARGET_ERROR */
-		} /* cis_validate_longlink_acm */
-	    } /* CW_CHECK_LINKTARGET */
-
-	    ret = cis_list_lcreate(cistpl_callout, cisptr, cis_info, cisparse,
-		sp);
-
-#if defined(CIS_DEBUG)
-	    if (cis_debug > 1) {
-		cmn_err(CE_CONT, "cis_create_cis_chain: ret=0x%x"
-		    " BAD_CIS_ADDR=0x%x CS_BAD_SOCKET=0x%x\n",
-		    ret, BAD_CIS_ADDR, CS_BAD_SOCKET);
-	    }
-#endif
-
-
-	    if ((ret & HANDTPL_ERROR) || (ret == (uint32_t)BAD_CIS_ADDR)) {
-		if (tps != NULL)
-		    cis_info->cis = tps;
-		if (ret == (uint32_t)BAD_CIS_ADDR)
-		    return (CS_BAD_OFFSET);
-		else
-		    return (CS_BAD_CIS);
-	    }
-
-		/*
-		 * If we're creating the primary CIS chain
-		 *	and we haven't seen any tuples,
-		 *	then return CS_SUCCESS. The caller will
-		 *	have to check cis_info->ntuples to find
-		 *	out if any tuples were found.
-		 * If we're processing the target of a longlink
-		 *	tuple, then by now we have already validated
-		 *	the CISTPL_LINKTARGET tuple so that we
-		 *	know we'll have at least one tuple in
-		 *	our list.
-		 */
-	    if (cis_info->ntuples == 0)
-		return (CS_SUCCESS);
-
-		/*
-		 * If we've just created a new list, we need to
-		 *	save the pointer to the start of the list.
-		 */
-	    if (tps == NULL)
-		tps = cis_info->cis;
-
-	    switch (cis_info->flags & CW_LONGLINK_FOUND) {
-		cistpl_longlink_ac_t *cistpl_longlink_ac;
-
-		case CW_LONGLINK_A_FOUND:
-		    cistpl_longlink_ac = (cistpl_longlink_ac_t *)cisparse;
-		    cisptr->flags &= ~(CISTPLF_SPACE_MASK | CISTPLF_FROM_MASK);
-		    cisptr->flags |= CISTPLF_AM_SPACE;
-			/*
-			 * Multiply address by 2 since only
-			 *	even bytes are counted in the CIS
-			 *	when AM addresses are specified.
-			 */
-		    cisptr->offset = cistpl_longlink_ac->tpll_addr * 2;
-		    cis_info->flags |= CW_CHECK_LINKTARGET;
-
-			/*
-			 * Point to the last tuple in the list.
-			 */
-		    cis_info->cis = cis_get_ltuple(cis_info->cis, NULL,
-							GET_LAST_LTUPLEF);
-		    break;
-		case CW_LONGLINK_C_FOUND:
-		    cistpl_longlink_ac = (cistpl_longlink_ac_t *)cisparse;
-		    cisptr->flags &= ~(CISTPLF_SPACE_MASK | CISTPLF_FROM_MASK);
-		    cisptr->flags |= CISTPLF_CM_SPACE;
-		    cisptr->offset = cistpl_longlink_ac->tpll_addr;
-		    cis_info->flags |= CW_CHECK_LINKTARGET;
-
-			/*
-			 * Point to the last tuple in the list.
-			 */
-		    cis_info->cis = cis_get_ltuple(cis_info->cis, NULL,
-							GET_LAST_LTUPLEF);
-		    break;
-		case CW_LONGLINK_MFC_FOUND:
-		    break;
-		default:
-		    break;
-	    } /* switch (cis_info->flags) */
-
-	} while (cis_info->flags & (CW_LONGLINK_A_FOUND | CW_LONGLINK_C_FOUND));
-
-	/*
-	 * If we needed to save a pointer to the start of the list because
-	 *	we saw a longlink tuple, restore the list head pointer now.
-	 */
-	if (tps != NULL)
-	    cis_info->cis = tps;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cis_list_destroy - destroys the local CIS list
- */
-uint32_t
-cis_list_destroy(cs_socket_t *sp)
-{
-	int fn;
-
-	/*
-	 * Destroy any CIS list that we may have created. It's OK to pass
-	 *	a non-existant CIS list pointer to cis_list_ldestroy since
-	 *	that function will not do anything if there is nothing in
-	 *	the passed CIS list to cleanup.
-	 */
-	for (fn = 0; fn < CS_MAX_CIS; fn++)
-	    (void) cis_list_ldestroy(&sp->cis[fn].cis);
-
-	/*
-	 * Clear out any remaining state.
-	 */
-	bzero((caddr_t)&sp->cis, ((sizeof (cis_info_t)) * CS_MAX_CIS));
-	sp->cis_flags = 0;
-	sp->nfuncs = 0;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cis_store_cis_addr - saves the current CIS address and space type
- *	of the beginning of the tuple into the passed linked list element.
- *	Note that this function will decrement the CIS address by two
- *	elements prior to storing it to the linked list element to point
- *	to the tuple type byte.
- *
- * This function also sets the following flags in tp->flags if they are set
- *	in ptr->flags:
- *
- *		CISTPLF_GLOBAL_CIS - tuple in global CIS
- *		CISTPLF_MF_CIS - tuple in function-specific CIS
- */
-static void
-cis_store_cis_addr(cistpl_t *tp, cisptr_t *ptr)
-{
-
-	if (ptr->flags & CISTPLF_AM_SPACE)
-	    tp->offset = ptr->offset - 4;
-	else
-	    tp->offset = ptr->offset - 2;
-
-	tp->flags &= ~(CISTPLF_SPACE_MASK | CISTPLF_FROM_MASK |
-					CISTPLF_GLOBAL_CIS | CISTPLF_MF_CIS);
-	tp->flags |= (ptr->flags & (CISTPLF_SPACE_MASK |
-					CISTPLF_GLOBAL_CIS | CISTPLF_MF_CIS));
-
-	if (tp->flags & CISTPLF_AM_SPACE)
-	    tp->flags |= CISTPLF_FROM_AM;
-
-	if (tp->flags & CISTPLF_CM_SPACE)
-	    tp->flags |= CISTPLF_FROM_CM;
-}
--- old/usr/src/uts/common/pcmcia/cis/cis_callout.c	2014-11-12 17:44:40.608954553 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,382 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1995-1996 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This file contains an array of structures, each of which refers to
- *	a tuple that we are prepared to handle.  The last structure
- *	in this array must have a type of CISTPL_END.
- *
- * If you want the generic tuple handler to be called for a tuple, use
- *	the cis_no_tuple_handler() entry point.
- */
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/debug.h>
-#include <sys/ddi_impldefs.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-#include <pcmcia/sys/cis_protos.h>
-
-/*
- * cistpl_std_callout - callout list for standard tuples
- */
-cistpl_callout_t cistpl_std_callout[] = {
-	{	CISTPL_DEVICE,			/* device information */
-		0,
-		0,
-		cistpl_device_handler,
-		"CISTPL_DEVICE"		},
-	{	CISTPL_CHECKSUM,		/* checksum control */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_CHECKSUM"	},
-	{	CISTPL_LONGLINK_A,		/* long-link to AM */
-		0,
-		0,
-		cistpl_longlink_ac_handler,
-		"CISTPL_LONGLINK_A"	},
-	{	CISTPL_LONGLINK_C,		/* long-link to CM */
-		0,
-		0,
-		cistpl_longlink_ac_handler,
-		"CISTPL_LONGLINK_C"	},
-	{	CISTPL_LONGLINK_MFC,		/* long-link to MFC CIS */
-		0,
-		0,
-		cistpl_longlink_mfc_handler,
-		"CISTPL_LONGLINK_MFC"	},
-	{	CISTPL_LINKTARGET,		/* link-target control */
-		0,
-		0,
-		cistpl_linktarget_handler,
-		"CISTPL_LINKTARGET"	},
-	{	CISTPL_NO_LINK,			/* no-link control */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_NO_LINK"	},
-	{	CISTPL_VERS_1,			/* level 1 version info */
-		0,
-		0,
-		cistpl_vers_1_handler,
-		"CISTPL_VERS_1"		},
-	{	CISTPL_ALTSTR,			/* alternate language string */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_ALTSTR"		},
-	{	CISTPL_DEVICE_A,		/* AM device information */
-		0,
-		0,
-		cistpl_device_handler,
-		"CISTPL_DEVICE_A"	},
-	{	CISTPL_JEDEC_C,			/* JEDEC info for CM */
-		0,
-		0,
-		cistpl_jedec_handler,
-		"CISTPL_JEDEC_C"	},
-	{	CISTPL_JEDEC_A,			/* JEDEC info for AM */
-		0,
-		0,
-		cistpl_jedec_handler,
-		"CISTPL_JEDEC_A"	},
-	{	CISTPL_CONFIG,			/* configuration */
-		0,
-		0,
-		cistpl_config_handler,
-		"CISTPL_CONFIG"		},
-	{	CISTPL_CFTABLE_ENTRY,		/* configuration-table-entry */
-		0,
-		0,
-		cistpl_cftable_handler,
-		"CISTPL_CFTABLE_ENTRY"	},
-	{	CISTPL_DEVICE_OC,		/* other conditions for CM */
-		0,
-		0,
-		cistpl_device_handler,
-		"CISTPL_DEVICE_OC"	},
-	{	CISTPL_DEVICE_OA,		/* other conditions for AM */
-		0,
-		0,
-		cistpl_device_handler,
-		"CISTPL_DEVICE_OA"	},
-	{	CISTPL_VERS_2,			/* level 2 version info */
-		0,
-		0,
-		cistpl_vers_2_handler,
-		"CISTPL_VERS_2"		},
-	{	CISTPL_FORMAT,			/* format type */
-		0,
-		0,
-		cistpl_format_handler,
-		"CISTPL_FORMAT"		},
-	{	CISTPL_FORMAT_A,		/* Attribute Memory */
-		0,				/* recording format */
-		0,
-		cistpl_format_handler,
-		"CISTPL_FORMAT_A"	},
-	{	CISTPL_GEOMETRY,		/* geometry */
-		0,
-		0,
-		cistpl_geometry_handler,
-		"CISTPL_GEOMETRY"	},
-	{	CISTPL_BYTEORDER,		/* byte order */
-		0,
-		0,
-		cistpl_byteorder_handler,
-		"CISTPL_BYTEORDER"	},
-	{	CISTPL_DATE,			/* card initialization date */
-		0,
-		0,
-		cistpl_date_handler,
-		"CISTPL_DATE"		},
-	{	CISTPL_BATTERY,			/* battery replacement date */
-		0,
-		0,
-		cistpl_battery_handler,
-		"CISTPL_BATTERY"	},
-	{	CISTPL_ORG,			/* organization */
-		0,
-		0,
-		cistpl_org_handler,
-		"CISTPL_ORG"		},
-	{	CISTPL_FUNCID,			/* card function ID */
-		0,
-		0,
-		cistpl_funcid_handler,
-		"CISTPL_FUNCID"		},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_MULTI,		/* for multifunction cards */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/MULTI"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_MEMORY,		/* for memory cards */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/MEMORY"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_SERIAL,		/* for serial port cards */
-		0,
-		cistpl_funce_serial_handler,
-		"CISTPL_FUNCE/SERIAL"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_PARALLEL,		/* for parallel port cards */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/PARALLEL"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_FIXED,		/* for fixed disk cards */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/FIXED"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_VIDEO,		/* for video cards */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/VIDEO"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_LAN,		/* for LAN cards */
-		0,
-		cistpl_funce_lan_handler,
-		"CISTPL_FUNCE/LAN"	},
-
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_AIMS,		/* Auto Incrementing Mass Storage */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/AIMS"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_SCSI,		/* SCSI bridge */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/SCSI"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_VENDOR_SPECIFIC,	/* Vendor Specific */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/VENDOR_SPECIFIC"	},
-	{	CISTPL_FUNCE,			/* card function extension */
-		TPLFUNC_UNKNOWN,	/* for unknown functions */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_FUNCE/unknown"	},
-	{	CISTPL_MANFID,			/* manufacturer ID */
-		0,
-		0,
-		cistpl_manfid_handler,
-		"CISTPL_MANFID"		},
-	{	CISTPL_SPCL,			/* special-purpose tuple */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_SPCL"		},
-	{	CISTPL_LONGLINK_CB,		/* longlink to next */
-		0,				/* tuple chain */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_LONGLINK_CB"	},
-	{	CISTPL_CONFIG_CB,		/* configuration tuple */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_CONFIG_CB"	},
-	{	CISTPL_CFTABLE_ENTRY_CB,	/* configuration table */
-		0,				/* entry */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_CFTABLE_ENTRY_CB"	},
-	{	CISTPL_BAR,			/* Base Address Register */
-		0,				/* definition */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_BAR"		},
-	{	CISTPL_DEVICEGEO,		/* Common Memory */
-		0,				/* device geometry */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_DEVICEGEO"	},
-	{	CISTPL_DEVICEGEO_A,		/* Attribute Memory */
-		0,				/* device geometry */
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_DEVICEGEO_A"	},
-	{	CISTPL_SWIL,			/* software interleave */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"CISTPL_SWIL"		},
-	{	CISTPL_VEND_SPEC_80,		/* vendor-specific 0x80 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_80"	},
-	{	CISTPL_VEND_SPEC_81,		/* vendor-specific 0x81 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_81"	},
-	{	CISTPL_VEND_SPEC_82,		/* vendor-specific 0x82 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_82"	},
-	{	CISTPL_VEND_SPEC_83,		/* vendor-specific 0x83 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_83"	},
-	{	CISTPL_VEND_SPEC_84,		/* vendor-specific 0x84 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_84"	},
-	{	CISTPL_VEND_SPEC_85,		/* vendor-specific 0x85 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_85"	},
-	{	CISTPL_VEND_SPEC_86,		/* vendor-specific 0x86 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_86"	},
-	{	CISTPL_VEND_SPEC_87,		/* vendor-specific 0x87 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_87"	},
-	{	CISTPL_VEND_SPEC_88,		/* vendor-specific 0x88 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_88"	},
-	{	CISTPL_VEND_SPEC_89,		/* vendor-specific 0x89 */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_89"	},
-	{	CISTPL_VEND_SPEC_8a,		/* vendor-specific 0x8a */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8a"	},
-	{	CISTPL_VEND_SPEC_8b,		/* vendor-specific 0x8b */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8b"	},
-	{	CISTPL_VEND_SPEC_8c,		/* vendor-specific 0x8c */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8c"	},
-	{	CISTPL_VEND_SPEC_8d,		/* vendor-specific 0x8d */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8d"	},
-	{	CISTPL_VEND_SPEC_8e,		/* vendor-specific 0x8e */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8e"	},
-	{	CISTPL_VEND_SPEC_8f,		/* vendor-specific 0x8f */
-		0,
-		0,
-		cis_unknown_tuple_handler,
-		"CISTPL_VEND_SPEC_8f"	},
-	{	CISTPL_END,			/* end-of-list tuple */
-		0,
-		0,
-		cis_no_tuple_handler,
-		"unknown tuple"		},
-	};
--- old/usr/src/uts/common/pcmcia/cis/cis_handlers.c	2014-11-12 17:44:40.661240133 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,2194 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This file contains the tuple handlers that are called by the CIS
- *	parser.
- *
- * XXX - how about a better explaination??
- */
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/debug.h>
-#include <sys/ddi_impldefs.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-#include <pcmcia/sys/cis_protos.h>
-
-/*
- * Function prototypes
- */
-static void cistpl_pd_parse(cistpl_t *, cistpl_cftable_entry_pwr_t *);
-static void cis_return_name(cistpl_callout_t *, cistpl_get_tuple_name_t *);
-
-/*
- * Fetch data functions.
- */
-uint16_t
-cis_get_short(cistpl_t *tp)
-{
-	uint16_t result;
-
-	if (tp->flags & CISTPLF_AM_SPACE) {
-		result = GET_AM_BYTE(tp);
-		result |= GET_AM_BYTE(tp) << 8;
-	} else {
-		result = GET_CM_BYTE(tp);
-		result |= GET_CM_BYTE(tp) << 8;
-	}
-	return (result);
-}
-
-uint16_t
-cis_get_be_short(cistpl_t *tp)
-{
-	uint16_t result;
-
-	if (tp->flags & CISTPLF_AM_SPACE) {
-		result = GET_AM_BYTE(tp) << 8;
-		result |= GET_AM_BYTE(tp);
-	} else {
-		result = GET_CM_BYTE(tp) << 8;
-		result |= GET_CM_BYTE(tp);
-	}
-	return (result);
-}
-
-uint32_t
-cis_get_int24(cistpl_t *tp)
-{
-	uint32_t result = cis_get_short(tp);
-
-	result |= GET_BYTE(tp) << 16;
-	return (result);
-}
-
-uint32_t
-cis_get_long(cistpl_t *tp)
-{
-	uint32_t result = cis_get_short(tp);
-
-	result |= cis_get_short(tp) << 16;
-	return (result);
-}
-
-/*
- * cis_tuple_handler - call the handler for the tuple described by the
- *				tuple pointer
- *
- *	cistpl_callout_t *co - pointer to callout structure
- *				array to use to find this tuple
- *	cistpl_t *tp - pointer to a tuple structure
- *	int flags - action for the handler to perform
- * XXX - we need a description of the flags passed to the tuple handler
- *	void *arg - argument to pass on to tuple handler
- *
- * If the tuple is not recognized but is is a vendor-specific tuple, we
- *	set the CISTPLF_VENDOR_SPECIFIC flag in the tuple.
- *
- * We return CISTPLF_UNKNOWN if this is an unrecognized	tuple as well as
- *	set the CISTPLF_UNKNOWN flag in the tuple list structure.  Note
- *	that encountering an unknown tuple is not necessarily an error,
- *	so we don't set the HANDTPL_ERROR flag on the return code.  It
- *	is up to the caller to determine what an unrecognized tuple means.
- *
- * If this is a recognized tuple, the apropriate tuple handler is called and
- *	the return value from the handler is returned directly to the caller.
- *
- * The void *arg is optional, and it's meaning is dependent on the
- *	particular tuple handler called and the flags parameter.
- *
- * For the special case of HANDTPL_RETURN_NAME, we don't bother calling the
- *	tuple handler and just return the tuple name to the caller.
- */
-uint32_t
-cis_tuple_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-					void *arg, cisdata_t subtype)
-{
-	/*
-	 * Check to see if this is a vendor-specific tuple.
-	 */
-	if (CISTPL_IS_VENDOR_SPECIFIC(tp->type))
-	    tp->flags |= CISTPLF_VENDOR_SPECIFIC;
-
-	/*
-	 * Scan the callout list until we find the tuple passed to us, or we
-	 *	encounter a CISTPL_END in the callout list, which signals that
-	 *	there are no more tuples in the callout list.
-	 */
-	while (co->type != (cisdata_t)CISTPL_END) {
-	    if (co->type == tp->type &&
-		((tp->type != CISTPL_FUNCE) ||
-		    (tp->type == CISTPL_FUNCE && co->subtype == subtype))) {
-			tp->flags &= ~CISTPLF_UNKNOWN;
-			if (flags & HANDTPL_RETURN_NAME) {
-			    cis_return_name(co, (cistpl_get_tuple_name_t *)arg);
-			    return (CISTPLF_NOERROR);
-			} else {
-			    return ((*co->handler) (co, tp, flags, arg));
-			} /* HANDTPL_RETURN_NAME */
-	    } /* if */
-	    co++;
-	} /* while */
-
-	/*
-	 * If we didn't recognize the tuple and the caller wants the tuple
-	 *	name back, then return the "unknown tuple" string. At this
-	 *	point, "co" will be pointing to the last entry in the
-	 *	callout list. It's not an error to not recognize the tuple
-	 *	when the operation is HANDTPL_RETURN_NAME.
-	 */
-	if (flags & HANDTPL_RETURN_NAME) {
-	    cis_return_name(co, (cistpl_get_tuple_name_t *)arg);
-	    return (CISTPLF_NOERROR);
-	}
-
-	tp->flags |= CISTPLF_UNKNOWN;
-	return (CISTPLF_UNKNOWN);
-}
-
-/*
- * cis_no_tuple_handler - this generic tuple handler is used if no special
- *				tuple processing is required for the passed
- *				tuple
- *
- *	cistpl_callout_t *co - pointer to this tuple's entry in the
- *				tuple callout structure
- *	cistpl_t *tp - pointer to this tuple's entry in the local linked list
- *	int flags - action to perform
- *
- * This handler will set the CISTPLF_COPYOK flag if the tuple link is greater
- *	than zero, indicating that it's OK to copy the tuple data body. It
- *	will also set whatever flags are specified in the callout structure.
- *
- * We always set the CISTPLF_VALID when we're called with HANDTPL_COPY_DONE.
- *
- * We return CISTPLF_UNKNOWN if we're being called to parse the tuple.
- *
- * We return CISTPLF_NOERROR in every other case to indicate that this is a
- *	recognized tuple.
- */
-/*ARGSUSED*/
-uint32_t
-cis_no_tuple_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	if (flags & HANDTPL_SET_FLAGS) {
-		tp->flags |= co->flags;	/* XXX - is = the right thing here? */
-		if (tp->len > 0)
-			tp->flags |= CISTPLF_COPYOK;
-	}
-
-	if (flags & HANDTPL_COPY_DONE)
-		tp->flags |= CISTPLF_VALID;
-
-	if (flags & HANDTPL_PARSE_LTUPLE)
-	    return (CISTPLF_UNKNOWN);
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cis_unknown_tuple_handler - this generic tuple handler is used if we don't
- *				understand this tuple
- *
- *	cistpl_callout_t *co - pointer to this tuple's entry in the
- *				tuple callout structure
- *	cistpl_t *tp - pointer to this tuple's entry in the local linked list
- *	int flags - action to perform
- *
- * This handler will not set the CISTPLF_COPYOK flag since we don't know the
- *	contents of a vendor-specific tuple.
- *
- * We always set the CISTPLF_VALID when we're called with HANDTPL_COPY_DONE
- *	to specify that we understand this tuple's code, but not it's data
- *	body.
- *
- * We return CISTPLF_UNKNOWN if we're being called to parse the tuple or to
- *	perform any other operation.
- */
-/*ARGSUSED*/
-uint32_t
-cis_unknown_tuple_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	if (flags & HANDTPL_SET_FLAGS) {
-		tp->flags |= co->flags;	/* XXX - is = the right thing here? */
-		return (CISTPLF_NOERROR);
-	}
-
-	if (flags & HANDTPL_COPY_DONE) {
-		tp->flags |= CISTPLF_VALID;
-		return (CISTPLF_NOERROR);
-	}
-
-	return (CISTPLF_UNKNOWN);
-}
-
-/*
- * cistpl_vers_1_handler - handler for the CISTPL_VERS_1 tuple
- *
- *	void *arg - points to a cistpl_vers_1_t * where the
- *			information is stuffed into
- */
-uint32_t
-cistpl_vers_1_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_vers_1_t *cs = (cistpl_vers_1_t *)arg;
-
-
-		RESET_TP(tp);
-
-		cs->major = GET_BYTE(tp);
-		cs->minor = GET_BYTE(tp);
-		for (cs->ns = 0; GET_LEN(tp) > 0 &&
-				/* CSTYLED */
-				cs->ns < CISTPL_VERS_1_MAX_PROD_STRINGS; ) {
-			(void) strcpy(cs->pi[cs->ns++], cis_getstr(tp));
-		} /* for */
-	} /* HANDTPL_PARSE_LTUPLE */
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_config_handler - handler for the CISTPL_CONFIG tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- *
- * For the first ten config registers we set the present flags in the
- *	cistpl_config_t if the register exists.  The flags that we use
- *	for this are the same as the flags reguired for the Card Services
- *	RequestConfiguration function and they can be used by clients
- *	directly without requiring any remapping of values.
- *
- * XXX we don't handle TPCC_SBTPL subtuples yet
- */
-
-uint32_t	config_regs_present_map[] = {
-	CONFIG_OPTION_REG_PRESENT,	/* COR present */
-	CONFIG_STATUS_REG_PRESENT,	/* STAT reg present */
-	CONFIG_PINREPL_REG_PRESENT,	/* PRR present */
-	CONFIG_COPY_REG_PRESENT,	/* COPY reg present */
-	CONFIG_EXSTAT_REG_PRESENT,	/* EXSTAT reg present */
-	CONFIG_IOBASE0_REG_PRESENT,	/* IOBASE0 reg present */
-	CONFIG_IOBASE1_REG_PRESENT,	/* IOBASE1 reg present */
-	CONFIG_IOBASE2_REG_PRESENT,	/* IOBASE2 reg present */
-	CONFIG_IOBASE3_REG_PRESENT,	/* IOBASE3 reg present */
-	CONFIG_IOLIMIT_REG_PRESENT,	/* IOLIMIT reg present */
-};
-
-uint32_t
-cistpl_config_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	cisdata_t tpcc_sz;
-	int i, n, nrb, na, hr = 0;
-
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_config_t *cr = (cistpl_config_t *)arg;
-		int crn = 0;
-
-		RESET_TP(tp);
-
-		tpcc_sz = GET_BYTE(tp);		/* config regs size fields */
-		cr->last = GET_BYTE(tp);	/* last config index */
-
-		na = (tpcc_sz&3)+1;		/* config regs address bytes */
-		nrb = ((tpcc_sz>>2)&0x0f)+1;	/* number of bytes in config */
-						/*	regs presence mask */
-
-		/*
-		 * Construct the base offset address for the config registers.
-		 *	We jump through these hoops because the base address
-		 *	can be between one and four bytes in length.
-		 */
-		cr->base = 0;
-		n = na;
-		while (n--)
-			cr->base |= ((GET_BYTE(tp) & 0x0ff) <<
-							(8 * (na - (n+1))));
-
-		/*
-		 * Go through the config register presense mask bit by bit and
-		 *	figure out which config registers are present and which
-		 *	aren't.
-		 * For the first ten config registers, set the appropriate
-		 *	bits in the cr->present member so that the caller
-		 *	doesn't have to do this.
-		 */
-		cr->nr = 0;
-		cr->present = 0;
-		n = nrb;
-		while (n--) {
-			for (i = 0; i < 8; i++, crn++) {
-				if (LOOK_BYTE(tp) & (1<<i)) {
-				    if (crn < (sizeof (config_regs_present_map)/
-							sizeof (uint32_t)))
-					cr->present |=
-						config_regs_present_map[crn];
-				    cr->nr++;
-				    cr->hr = hr;
-				    cr->regs[hr] = MAKE_CONFIG_REG_ADDR(
-								cr->base, hr);
-				} /* LOOK_BYTE */
-				hr++;
-			} /* for */
-			(void) GET_BYTE(tp);
-		} /* while */
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_device_handler - handler for the CISTPL_DEVICE, CISTPL_DEVICE_A,
- *				CISTPL_DEVICE_OC and CISTPL_DEVICE_OA tuples
- *
- *	void *arg - points to a cistpl_device_t * where the
- *			information is stuffed into
- *
- * XXX - we only handle CISTPL_DEVICE_MAX_DEVICES device descriptions
- *		described in the tuple
- */
-uint32_t
-cistpl_device_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	cisdata_t dev_id;
-
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		convert_speed_t convert_speed;
-		cistpl_device_t *dt = (cistpl_device_t *)arg;
-		cistpl_device_node_t *cdn;
-
-		/*
-		 * XXX - fix this to look for more than one device definition
-		 * XXX - fix this to handle the OC fields for
-		 *	CISTPL_DEVICE_OC and CISTPL_DEVICE_OA
-		 */
-		dt->num_devices = 1;
-		cdn = &dt->devnode[0];
-
-		cdn->flags = 0;
-
-		RESET_TP(tp);
-
-		dev_id = GET_BYTE(tp);
-
-		/*
-		 * Get the device speed code.  If it's 7, then there is an
-		 *	extended speed code table in use, so parse that.
-		 *	If it's anything else, get the speed information
-		 *	directly from the device speed code.
-		 */
-		if ((dev_id & 7) == 7) {
-		    cdn->nS_speed = cistpl_devspeed(tp, 0, CISTPL_DEVSPEED_EXT);
-		} else {
-		    cdn->nS_speed = cistpl_devspeed(NULL, dev_id,
-							CISTPL_DEVSPEED_TABLE);
-		}
-
-		/*
-		 * Convert the speed in nS to a device speed code.
-		 * XXX -  should check return code from cis_convert_devspeed()
-		 */
-		convert_speed.Attributes = CONVERT_NS_TO_DEVSPEED;
-		convert_speed.nS = cdn->nS_speed;
-		(void) cis_convert_devspeed(&convert_speed);
-		cdn->speed = convert_speed.devspeed;
-
-		if (dev_id & 8)
-			cdn->flags |= CISTPL_DEVICE_WPS;
-
-		/*
-		 * Set the device type.  Note that we take the raw value
-		 *	from the tuple and pass it back to the caller.
-		 *	If the device type codes in the standard change,
-		 *	we will have to change our flags as well.
-		 */
-		cdn->type = (dev_id>>4) & 0x0f;
-
-		/*
-		 * XXX - what about the device_size byte?  Is the spec wrong?
-		 */
-		cdn->size = GET_BYTE(tp);
-		/* check for end of list */
-		if (cdn->size != 0x0ff) {
-		    convert_size_t convert_size;
-
-		    convert_size.devsize = cdn->size;
-		    convert_size.Attributes = CONVERT_DEVSIZE_TO_BYTES;
-		    (void) cis_convert_devsize(&convert_size);
-		    cdn->size_in_bytes = convert_size.bytes;
-		}
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_cftable_handler - handler for the CISTPL_CFTABLE_ENTRY tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- *
- *    Return:	CISTPLF_NOERROR - if no error parsing tuple
- *		HANDTPL_ERROR - if error parsing tuple
- */
-extern uint32_t cistpl_cftable_io_size_table[];
-extern uint32_t cistpl_cftable_shift_table[];
-
-uint32_t
-cistpl_cftable_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	cisdata_t tpce_indx, tpce_fs, tpce_td, sf, tpce_io, nr;
-	cisdata_t ior_desc, tpce_ir, tpce_msd;
-	int i, j;
-
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_cftable_entry_t *ce = (cistpl_cftable_entry_t *)arg;
-
-		RESET_TP(tp);
-
-		/*
-		 * Check to see if we have an interface description byte.  If
-		 *	we do, grab it and give it directly to the caller, and
-		 *	set a flag so the caller knows that it's there.
-		 * We also setup the appropriate values in the ce->pin member
-		 *	so that clients can feed this value directly to the
-		 *	Card Services RequestConfiguration call.
-		 */
-		if ((tpce_indx = GET_BYTE(tp)) & CISTPL_CFTABLE_TPCE_IFM) {
-			ce->ifc = GET_BYTE(tp);
-
-			ce->pin = 0;
-
-			if (ce->ifc & CISTPL_CFTABLE_TPCE_IF_BVD)
-			    ce->pin |= (PRR_BVD1_STATUS | PRR_BVD2_STATUS |
-					PRR_BVD1_EVENT | PRR_BVD2_EVENT);
-			if (ce->ifc & CISTPL_CFTABLE_TPCE_IF_WP)
-			    ce->pin |= (PRR_WP_STATUS | PRR_WP_EVENT);
-			if (ce->ifc & CISTPL_CFTABLE_TPCE_IF_RDY)
-			    ce->pin |= (PRR_READY_STATUS | PRR_READY_EVENT);
-
-			ce->flags |= CISTPL_CFTABLE_TPCE_IF;
-		}
-
-		/*
-		 * Return the configuration index to the caller, and set the
-		 *	default configuration flag if this is a default
-		 *	configuration.
-		 */
-		ce->index = tpce_indx & CISTPL_CFTABLE_TPCE_CFGENTRYM;
-		if (tpce_indx & CISTPL_CFTABLE_TPCE_DEFAULTM)
-			ce->flags |= CISTPL_CFTABLE_TPCE_DEFAULT;
-
-		/*
-		 * Feature selection flags.
-		 */
-		tpce_fs = GET_BYTE(tp);
-
-		/*
-		 * See what types of power information are available,
-		 *	and if there is any, set the global power
-		 *	information flag as well as a flag for each
-		 *	power description available.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_PWRM) {
-		    cistpl_cftable_entry_pd_t *pd = &ce->pd;
-
-		    ce->flags |= CISTPL_CFTABLE_TPCE_FS_PWR;
-
-		    switch (tpce_fs & CISTPL_CFTABLE_TPCE_FS_PWRM) {
-			case CISTPL_CFTABLE_TPCE_FS_PWR_VPP2M:
-				pd->flags |= CISTPL_CFTABLE_TPCE_FS_PWR_VPP2;
-				/* FALLTHROUGH */
-			case CISTPL_CFTABLE_TPCE_FS_PWR_VPP1M:
-				pd->flags |= CISTPL_CFTABLE_TPCE_FS_PWR_VPP1;
-				/* FALLTHROUGH */
-			case CISTPL_CFTABLE_TPCE_FS_PWR_VCCM:
-				pd->flags |= CISTPL_CFTABLE_TPCE_FS_PWR_VCC;
-		    } /* switch */
-		} /* if (CISTPL_CFTABLE_TPCE_FS_PWRM) */
-
-		/*
-		 * Set up the global memory information flag.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_MEMM)
-			ce->flags |= CISTPL_CFTABLE_TPCE_FS_MEM;
-
-		/*
-		 * Parse the various power description structures.
-		 */
-		if (ce->flags & CISTPL_CFTABLE_TPCE_FS_PWR) {
-			cistpl_cftable_entry_pd_t *pd = &ce->pd;
-			cistpl_cftable_entry_pwr_t *pwr;
-			/*
-			 * Collect any Vcc information.
-			 */
-			if (pd->flags & CISTPL_CFTABLE_TPCE_FS_PWR_VCC) {
-				pwr = &pd->pd_vcc;
-				cistpl_pd_parse(tp, pwr);
-			}
-			/*
-			 * Collect any Vpp1 information.
-			 */
-			if (pd->flags & CISTPL_CFTABLE_TPCE_FS_PWR_VPP1) {
-				pwr = &pd->pd_vpp1;
-				cistpl_pd_parse(tp, pwr);
-			}
-			/*
-			 * Collect any Vpp2 information.
-			 */
-			if (pd->flags & CISTPL_CFTABLE_TPCE_FS_PWR_VPP2) {
-				pwr = &pd->pd_vpp2;
-				cistpl_pd_parse(tp, pwr);
-			}
-		} /* if (CISTPL_CFTABLE_TPCE_FS_PWR) */
-
-		/*
-		 * Check to see if there's any timing information, and if
-		 *	so, parse the tuple data and store it in the
-		 *	caller's structure.  Set a flag in the global
-		 *	flag field indicating that there is timing information.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_TDM) {
-			convert_speed_t convert_speed;
-			cistpl_cftable_entry_speed_t *sp = &ce->speed;
-			ce->flags |= CISTPL_CFTABLE_TPCE_FS_TD;
-			tpce_td = GET_BYTE(tp);
-			/*
-			 * Parse TPCE_TD to get the various timing
-			 *	scale factors. Each scale factor has
-			 *	a value that indicates that the particular
-			 *	timing parameter doesn't exist.
-			 */
-			if ((sf = (tpce_td &
-					CISTPL_CFTABLE_TPCE_FS_TD_WAITM)) !=
-			    CISTPL_CFTABLE_TPCE_FS_TD_WAITM) {
-				sp->nS_wait = cistpl_devspeed(tp,
-						GET_TPCE_FS_TD_WAITS(sf),
-						CISTPL_DEVSPEED_EXT);
-				convert_speed.Attributes =
-							CONVERT_NS_TO_DEVSPEED;
-				convert_speed.nS = sp->nS_wait;
-				(void) cis_convert_devspeed(&convert_speed);
-				sp->wait = convert_speed.devspeed;
-				sp->flags |= CISTPL_CFTABLE_TPCE_FS_TD_WAIT;
-			}
-
-			if ((sf = (tpce_td & CISTPL_CFTABLE_TPCE_FS_TD_RDYM)) !=
-			    CISTPL_CFTABLE_TPCE_FS_TD_RDYM) {
-				sp->nS_rdybsy = cistpl_devspeed(tp,
-						GET_TPCE_FS_TD_RDYS(sf),
-						CISTPL_DEVSPEED_EXT);
-				convert_speed.Attributes =
-							CONVERT_NS_TO_DEVSPEED;
-				convert_speed.nS = sp->nS_rdybsy;
-				(void) cis_convert_devspeed(&convert_speed);
-				sp->rdybsy = convert_speed.devspeed;
-				sp->flags |= CISTPL_CFTABLE_TPCE_FS_TD_RDY;
-			}
-
-			if ((sf = (tpce_td &
-					CISTPL_CFTABLE_TPCE_FS_TD_RSVDM)) !=
-			    CISTPL_CFTABLE_TPCE_FS_TD_RSVDM) {
-				sp->nS_rsvd = cistpl_devspeed(tp,
-						GET_TPCE_FS_TD_RSVDS(sf),
-						CISTPL_DEVSPEED_EXT);
-				convert_speed.Attributes =
-							CONVERT_NS_TO_DEVSPEED;
-				convert_speed.nS = sp->nS_rsvd;
-				(void) cis_convert_devspeed(&convert_speed);
-				sp->rsvd = convert_speed.devspeed;
-				sp->flags |= CISTPL_CFTABLE_TPCE_FS_TD_RSVD;
-			}
-		} /* if (CISTPL_CFTABLE_TPCE_FS_TDM) */
-
-
-		/*
-		 * Parse any I/O address information.  If there is I/O
-		 *	inforamtion, set a flag in the global flag field
-		 *	to let the caller know.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_IOM) {
-			cistpl_cftable_entry_io_t *io = &ce->io;
-
-			ce->flags |= CISTPL_CFTABLE_TPCE_FS_IO;
-			tpce_io = GET_BYTE(tp);
-			/*
-			 * Pass any I/O flags that are in the tuple directly
-			 *	to the caller.
-			 */
-			io->flags = tpce_io;
-			io->addr_lines = tpce_io &
-						CISTPL_CFTABLE_TPCE_FS_IO_ALM;
-			/*
-			 * If there are any ranges, extract the number of
-			 *	ranges and the range descriptions.
-			 */
-			if (tpce_io & CISTPL_CFTABLE_TPCE_FS_IO_RANGEM) {
-				cistpl_cftable_entry_io_range_t *ior;
-				ior_desc = GET_BYTE(tp);
-				/*
-				 * Number of I/O ranges is the value specified
-				 *	in the tuple plus one, so there's
-				 *	always at least one I/O range if the
-				 *	CISTPL_CFTABLE_TPCE_FS_IO_RANGEM bit
-				 *	in the I/O flags register is set.
-				 */
-				nr = (ior_desc & 0x0f) + 1;
-				io->ranges = nr;
-				/*
-				 * Cycle through each I/O range.
-				 */
-				for (i = 0; i < (int)nr; i++) {
-					ior = &io->range[i];
-					ior->addr = 0;
-					ior->length = 0;
-					/*
-					 * Gather the address information.
-					 *	It's OK if there's no address
-					 *	information in which case this
-					 *	loop will never execute.
-					 */
-					for (j = 0; j <
-						cistpl_cftable_io_size_table[
-							(ior_desc>>4)&3];
-									j++)
-						ior->addr |= (GET_BYTE(tp) <<
-						cistpl_cftable_shift_table[j]);
-					/*
-					 * Gather the length information.
-					 *	It's OK if there's no length
-					 *	information in which case this
-					 *	loop will never execute.
-					 */
-					for (j = 0; j <
-						cistpl_cftable_io_size_table[
-							(ior_desc>>6)&3];
-									j++)
-						ior->length |= (GET_BYTE(tp) <<
-						cistpl_cftable_shift_table[j]);
-				} /* for (nr) */
-			} /* if (CISTPL_CFTABLE_TPCE_FS_IO_RANGEM) */
-		} /* if (CISTPL_CFTABLE_TPCE_FS_IOM) */
-
-		/*
-		 * Parse any IRQ information.  If there is IRQ inforamtion,
-		 *	set a flag in the global flag field to let the
-		 *	caller know.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_IRQM) {
-			cistpl_cftable_entry_irq_t *irq = &ce->irq;
-
-			ce->flags |= CISTPL_CFTABLE_TPCE_FS_IRQ;
-			tpce_ir = GET_BYTE(tp);
-			/*
-			 * Pass any IRQ flags that are in the tuple directly
-			 *	to the caller.
-			 */
-			irq->flags = tpce_ir;
-			/*
-			 * Check for and parse the extended IRQ bitmask
-			 *	if it exists.
-			 */
-			if (tpce_ir & CISTPL_CFTABLE_TPCE_FS_IRQ_MASKM) {
-				irq->irqs = GET_BYTE(tp) & 0x0ff;
-				irq->irqs |= (GET_BYTE(tp) << 8)&0x0ff00;
-			} else {
-				irq->irqs = (1<< (tpce_ir&0x0f));
-			}
-		} /* if (CISTPL_CFTABLE_TPCE_FS_IRQM) */
-
-		/*
-		 * Parse any memory information.
-		 *
-		 * XXX - should be a cleaner way to parse this information.
-		 */
-		if (ce->flags & CISTPL_CFTABLE_TPCE_FS_MEM) {
-			cistpl_cftable_entry_mem_t *mem = &ce->mem;
-			cistpl_cftable_entry_mem_window_t *win;
-			/*
-			 * Switch on the type of memory description
-			 *	information that is available.
-			 */
-			switch (tpce_fs & CISTPL_CFTABLE_TPCE_FS_MEMM) {
-				/*
-				 * variable length memory space description
-				 */
-			case CISTPL_CFTABLE_TPCE_FS_MEM3M:
-				mem->flags |= CISTPL_CFTABLE_TPCE_FS_MEM3;
-				/* memory space descriptor */
-				tpce_msd = GET_BYTE(tp);
-				mem->windows = ((tpce_msd &
-					(CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS -
-								1)) + 1);
-				/*
-				 * If there's host address information, let
-				 *	the caller know.
-				 */
-				if (tpce_msd & CISTPL_CFTABLE_TPCE_FS_MEM_HOSTM)
-					mem->flags |=
-						CISTPL_CFTABLE_TPCE_FS_MEM_HOST;
-				/*
-				 * Cycle through each window space description
-				 *	and collect all the interesting bits.
-				 */
-				for (i = 0; i < mem->windows; i++) {
-					win = &mem->window[i];
-					win->length = 0;
-					win->card_addr = 0;
-					win->host_addr = 0;
-					/*
-					 * Gather the length information.
-					 *	It's OK if there's no length
-					 *	information in which case this
-					 *	loop will never execute.
-					 */
-					for (j = 0; j <
-						(int)((tpce_msd>>3)&3); j++)
-						win->length |= (GET_BYTE(tp) <<
-						cistpl_cftable_shift_table[j]);
-					/*
-					 * Gather the card address information.
-					 *	It's OK if there's no card
-					 *	address information in which
-					 *	case this loop will never
-					 *	execute.
-					 */
-					for (j = 0; j <
-						(int)((tpce_msd>>5)&3); j++)
-						win->card_addr |=
-							(GET_BYTE(tp) <<
-						cistpl_cftable_shift_table[j]);
-					/*
-					 * If there's a host address
-					 *	description, grab that
-					 *	as well.
-					 */
-					if (mem->flags &
-					    CISTPL_CFTABLE_TPCE_FS_MEM_HOST) {
-						/*
-						 * Gather the host address
-						 *	information.  It's OK
-						 *	if there's no host
-						 *	address information in
-						 *	which case this loop
-						 *	will never execute.
-						 * Note that we use the card
-						 *	address size to
-						 *	determine how many
-						 *	bytes of host address
-						 *	are present.
-						 */
-						for (j = 0; j <
-							(int)((tpce_msd>>5)&3);
-									j++)
-							win->host_addr |=
-							(GET_BYTE(tp) <<
-						cistpl_cftable_shift_table[j]);
-					} else {
-						/*
-						 * No host address information,
-						 *	so the host address is
-						 *	equal to the card
-						 *	address.
-						 */
-						win->host_addr = win->card_addr;
-					}
-				} /* for (i<mem->windows) */
-				break;
-				/*
-				 * single length and card base address specified
-				 */
-			case CISTPL_CFTABLE_TPCE_FS_MEM2M:
-				mem->flags |= CISTPL_CFTABLE_TPCE_FS_MEM2;
-				win = &mem->window[0];
-				mem->windows = 1;
-				/*
-				 * Construct the size of the window.
-				 */
-				win->length = GET_BYTE(tp);
-				win->length |= (GET_BYTE(tp)<<8);
-				win->length *=
-					CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE;
-
-				/*
-				 * Construct the card base address.
-				 */
-				win->card_addr = GET_BYTE(tp);
-				win->card_addr |= (GET_BYTE(tp)<<8);
-				win->card_addr *=
-					CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE;
-
-				/*
-				 * In this mode, both the host base address
-				 *	and the card base address are equal.
-				 */
-				win->host_addr = win->card_addr;
-				break;
-				/*
-				 * single length specified
-				 */
-			case CISTPL_CFTABLE_TPCE_FS_MEM1M:
-				mem->flags |= CISTPL_CFTABLE_TPCE_FS_MEM1;
-				win = &mem->window[0];
-				mem->windows = 1;
-				win->card_addr = 0;
-				win->host_addr = 0;
-				/*
-				 * Construct the size of the window.
-				 */
-				win->length = GET_BYTE(tp);
-				win->length |= (GET_BYTE(tp)<<8);
-				win->length *=
-					CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE;
-				break;
-			} /* switch (CISTPL_CFTABLE_TPCE_FS_MEMM) */
-		} /* if (CISTPL_CFTABLE_TPCE_FS_MEM) */
-
-		/*
-		 * Check for and parse any miscellaneous information.
-		 *
-		 * We only understand how to parse the first
-		 *	CISTPL_CFTABLE_TPCE_FS_MISC_MAX extension
-		 *	bytes specified in the PC Card 95 standard;
-		 *	we throw away any other extension bytes that
-		 *	are past these bytes.
-		 * XXX Note that the assumption here is that the
-		 *	size of cistpl_cftable_entry_misc_t->flags
-		 *	is at least CISTPL_CFTABLE_TPCE_FS_MISC_MAX
-		 *	bytes in length.
-		 */
-		if (tpce_fs & CISTPL_CFTABLE_TPCE_FS_MISCM) {
-		    cistpl_cftable_entry_misc_t *misc = &ce->misc;
-		    int mb = CISTPL_CFTABLE_TPCE_FS_MISC_MAX;
-
-		    ce->flags |= CISTPL_CFTABLE_TPCE_FS_MISC;
-		    misc->flags = 0;
-
-		    do {
-			if (mb) {
-			    misc->flags = (misc->flags << 8) | LOOK_BYTE(tp);
-			    mb--;
-			}
-		    } while ((GET_BYTE(tp) & CISTPL_EXT_BIT) &&
-				(!(tp->flags & CISTPLF_MEM_ERR)));
-
-			/*
-			 * Check to see if we tried to read past the
-			 *	end of the tuple data; if we have,
-			 *	there's no point in trying to parse
-			 *	any more of the tuple.
-			 */
-		    if (tp->flags & CISTPLF_MEM_ERR)
-			return (HANDTPL_ERROR);
-		} /* if (CISTPL_CFTABLE_TPCE_FS_MISCM) */
-
-		/*
-		 * Check for and parse any additional subtuple
-		 *	information. We know that there is
-		 *	additional information if we haven't
-		 *	reached the end of the tuple data area
-		 *	and if the additional information is
-		 *	in standard tuple format.
-		 * If we don't recognize the additional info,
-		 *	then just silently ignore it, don't
-		 *	flag it as an error.
-		 */
-#ifdef	PARSE_STCE_TUPLES
-		if (GET_LEN(tp) > 0) {
-
-		ce->flags |= CISTPL_CFTABLE_TPCE_FS_STCE_EV
-		ce->flags |= CISTPL_CFTABLE_TPCE_FS_STCE_PD
-#endif
-
-	} /* if (HANDTPL_PARSE_LTUPLE) */
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_pd_parse - read and parse a power description structure
- *
- *	cisdata_t **ddp - pointer to pointer tuple data area
- *	cistpl_cftable_entry_pwr_t *pd - pointer to local power description
- *					structure
- */
-static void
-cistpl_pd_parse(cistpl_t *tp, cistpl_cftable_entry_pwr_t *pd)
-{
-	cisdata_t pdesc;
-
-	pdesc = GET_BYTE(tp);	/* power description selector */
-
-	/* nominal supply voltage */
-	if (pdesc & CISTPL_CFTABLE_PD_NOMV) {
-		pd->nomV = cistpl_expd_parse(tp, &pd->nomV_flags) / 100;
-		pd->nomV_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* minimum supply voltage */
-	if (pdesc & CISTPL_CFTABLE_PD_MINV) {
-		pd->minV = cistpl_expd_parse(tp, &pd->minV_flags) / 100;
-		pd->minV_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* maximum supply voltage */
-	if (pdesc & CISTPL_CFTABLE_PD_MAXV) {
-		pd->maxV = cistpl_expd_parse(tp, &pd->maxV_flags) / 100;
-		pd->maxV_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* continuous supply current */
-	if (pdesc & CISTPL_CFTABLE_PD_STATICI) {
-		pd->staticI_flags |= CISTPL_CFTABLE_PD_MUL10;
-		pd->staticI = cistpl_expd_parse(tp, &pd->staticI_flags);
-		pd->staticI_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* maximum current required averaged over 1 second */
-	if (pdesc & CISTPL_CFTABLE_PD_AVGI) {
-		pd->avgI_flags |= CISTPL_CFTABLE_PD_MUL10;
-		pd->avgI = cistpl_expd_parse(tp, &pd->avgI_flags);
-		pd->avgI_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* maximum current required averaged over 10mS */
-	if (pdesc & CISTPL_CFTABLE_PD_PEAKI) {
-		pd->peakI_flags |= CISTPL_CFTABLE_PD_MUL10;
-		pd->peakI = cistpl_expd_parse(tp, &pd->peakI_flags);
-		pd->peakI_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-
-	/* power down supply curent required */
-	if (pdesc & CISTPL_CFTABLE_PD_PDOWNI) {
-		pd->pdownI_flags |= CISTPL_CFTABLE_PD_MUL10;
-		pd->pdownI = cistpl_expd_parse(tp, &pd->pdownI_flags);
-		pd->pdownI_flags |= (pdesc | CISTPL_CFTABLE_PD_EXISTS);
-	}
-}
-
-/*
- * cistpl_expd_parse - read and parse an extended power description structure
- *
- *	cistpl_t *tp - pointer to pointer tuple data area
- *	int *flags - flags that get for this parameter:
- *			CISTPL_CFTABLE_PD_NC_SLEEP - no connection on
- *							sleep/power down
- *			CISTPL_CFTABLE_PD_ZERO - zero value required
- *			CISTPL_CFTABLE_PD_NC - no connection ever
- *
- * The power consumption is returned in the following units:
- *
- *				voltage - milliVOLTS
- *				current - microAMPS
- */
-extern cistpl_pd_struct_t cistpl_pd_struct;
-
-uint32_t
-cistpl_expd_parse(cistpl_t *tp, uint32_t *flags)
-{
-	cisdata_t pdesc;
-	uint32_t exponent, mantisa, val, digits = 0;
-
-	/*
-	 * Get the power description parameter byte and break it up
-	 *	into mantissa and exponent.
-	 */
-	pdesc = GET_BYTE(tp);
-	exponent = pdesc&7;
-	mantisa = (pdesc>>3)&0x0f;
-
-	if (pdesc & CISTPL_EXT_BIT) {
-		do {
-			if (LOOK_BYTE(tp) <= 0x63)
-				digits = LOOK_BYTE(tp);
-			if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_NC_SLEEPM)
-				*flags |= CISTPL_CFTABLE_PD_NC_SLEEP;
-			if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_ZEROM)
-				*flags |= CISTPL_CFTABLE_PD_ZERO;
-			if (LOOK_BYTE(tp) == CISTPL_CFTABLE_PD_NCM)
-				*flags |= CISTPL_CFTABLE_PD_NC;
-		} while (GET_BYTE(tp) & CISTPL_EXT_BIT);
-	}
-
-	val = CISTPL_PD_MAN(mantisa) * CISTPL_PD_EXP(exponent);
-
-	/*
-	 * If we have to multiply the power value by ten, then just
-	 *	don't bother dividing.
-	 */
-	if (! (*flags & CISTPL_CFTABLE_PD_MUL10))
-		val = val/10;	/* do this since our mantissa table is X 10 */
-
-	/*
-	 * If we need to add some digits to the right of the decimal, do
-	 *	that here.
-	 */
-	if (exponent)
-		val = val + (digits * CISTPL_PD_EXP(exponent-1));
-
-	val /= 1000;
-
-	return (val);
-}
-
-/*
- * cistpl_devspeed - returns device speed in nS
- *
- *	cistpl_t *tp - tuple pointer.
- *	cisdata_t spindex - device speed table index
- *	int flags - operation flags
- *		CISTPL_DEVSPEED_TABLE:
- *		    Use the spindex argument as an index into a simple
- *			device speed table. ref: PCMCIA Release 2.01
- *			Card Metaformat pg. 5-14 table 5-12.
- *		    When this flag is set, the spindex argument is ignored.
- *		CISTPL_DEVSPEED_EXT:
- *		    Use the tp argument to access the
- *			tuple data area containing an extended speed
- *			code table.  ref: PCMCIA Release 2.01 Card
- *			Metaformat pg. 5-15 table 5-13.
- *		    The tp->read argument must point to the first byte of
- *			an extended speed code table.
- *		    When this flag is set, the spindex argument is
- *			used as a power-of-10 scale factor.  We only allow
- *			a maximum scale factor of 10^16.
- *
- * The device speed is returned in nS for all combinations of flags and
- *	speed table entries.
- *
- * Note if you pass the CISTPL_DEVSPEED_TABLE with a spindex index that
- *	refers to an extended speed table, you will get back an undefined
- *	speed value.
- */
-extern cistpl_devspeed_struct_t cistpl_devspeed_struct;
-
-uint32_t
-cistpl_devspeed(cistpl_t *tp, cisdata_t spindex, uint32_t flags)
-{
-	int scale = 1, first;
-	cisdata_t exspeed;
-	int exponent, mantisa;
-	uint32_t speed;
-
-	switch (flags) {
-	case CISTPL_DEVSPEED_TABLE:
-		speed = CISTPL_DEVSPEED_TBL(spindex);
-		break;
-	case CISTPL_DEVSPEED_EXT:
-		do {
-			exspeed = GET_BYTE(tp);
-			first = 1;
-			if (first) {
-				/*
-				 * XXX - ugh! we don't understand additional
-				 *	exspeed bytes
-				 */
-				first = 0;
-				exponent = (exspeed & 0x07);
-				mantisa = (exspeed >> 3) & 0x0f;
-				spindex &= 0x0f;	/* only allow 10^16 */
-				while (spindex--)
-					scale *= 10;
-			} /* if (first) */
-		} while (exspeed & CISTPL_EXT_BIT);
-		speed = scale * CISTPL_DEVSPEED_MAN(mantisa) *
-						CISTPL_DEVSPEED_EXP(exponent);
-		speed = speed/10;	/* XXX - mantissa table is all X 10 */
-		break;
-	default:
-		break;
-	}
-
-	return (speed);
-}
-
-/*
- * cistpl_vers_2_handler - handler for the CISTPL_VERS_2 tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_vers_2_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_vers_2_t *cs = (cistpl_vers_2_t *)arg;
-
-		RESET_TP(tp);
-
-		cs->vers = GET_BYTE(tp);
-		cs->comply = GET_BYTE(tp);
-		cs->dindex = GET_SHORT(tp);
-
-		cs->reserved = GET_SHORT(tp);
-
-		cs->vspec8 = GET_BYTE(tp);
-		cs->vspec9 = GET_BYTE(tp);
-		cs->nhdr = GET_BYTE(tp);
-
-		(void) strcpy(cs->oem, cis_getstr(tp));
-
-		if (GET_LEN(tp) > 0)
-		    (void) strcpy(cs->info, cis_getstr(tp));
-		else
-		    (void) strcpy(cs->info, "(no info)");
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_jedec_handler - handler for JEDEC C and JEDEC A tuples
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_jedec_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		int nid;
-		cistpl_jedec_t *cs = (cistpl_jedec_t *)arg;
-
-		RESET_TP(tp);
-
-		for (nid = 0; GET_LEN(tp) > 0 &&
-					nid < CISTPL_JEDEC_MAX_IDENTIFIERS &&
-					LOOK_BYTE(tp) != 0xFF; nid++) {
-			cs->jid[nid].id = GET_BYTE(tp);
-			cs->jid[nid].info = GET_BYTE(tp);
-		}
-		cs->nid = nid;
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_format_handler - handler for the CISTPL_FORMAT and
- *				CISTPL_FORMAT_A tuples
- */
-uint32_t
-cistpl_format_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_format_t *cs = (cistpl_format_t *)arg;
-
-		RESET_TP(tp);
-
-		cs->type = GET_BYTE(tp);
-		cs->edc_length = LOOK_BYTE(tp) & EDC_LENGTH_MASK;
-		cs->edc_type = ((uint32_t)GET_BYTE(tp) >> EDC_TYPE_SHIFT) &
-								EDC_TYPE_MASK;
-		cs->offset = GET_LONG(tp);
-		cs->nbytes = GET_LONG(tp);
-
-		switch (cs->type) {
-		case TPLFMTTYPE_DISK:
-			cs->dev.disk.bksize = GET_SHORT(tp);
-			cs->dev.disk.nblocks = GET_LONG(tp);
-			cs->dev.disk.edcloc = GET_LONG(tp);
-			break;
-
-		case TPLFMTTYPE_MEM:
-			cs->dev.mem.flags = GET_BYTE(tp);
-			cs->dev.mem.reserved = GET_BYTE(tp);
-			cs->dev.mem.address = (caddr_t)(uintptr_t)GET_LONG(tp);
-			cs->dev.disk.edcloc = GET_LONG(tp);
-			break;
-		default:
-			/* don't know about any other type */
-			break;
-		}
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_geometry_handler - handler for the CISTPL_GEOMETRY tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_geometry_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-								void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_geometry_t *cs = (cistpl_geometry_t *)arg;
-
-		RESET_TP(tp);
-		cs->spt = GET_BYTE(tp);
-		cs->tpc = GET_BYTE(tp);
-		cs->ncyl = GET_SHORT(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_byteorder_handler - handler for the CISTPL_BYTEORDER tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_byteorder_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-								void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_byteorder_t *cs = (cistpl_byteorder_t *)arg;
-
-		RESET_TP(tp);
-		cs->order = GET_BYTE(tp);
-		cs->map = GET_BYTE(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_date_handler - handler for CISTPL_DATE card format tuple
- *
- *	void *arg - points to a cistpl_date_t * where the
- *			information is stuffed into
- */
-uint32_t
-cistpl_date_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_date_t *cs = (cistpl_date_t *)arg;
-
-		RESET_TP(tp);
-		cs->time = GET_SHORT(tp);
-		cs->day = GET_SHORT(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_battery_handler - handler for CISTPL_BATTERY battery replacement
- *				date tuple
- *
- *	void *arg - points to a cistpl_battery_t * where the
- *			information is stuffed into
- */
-uint32_t
-cistpl_battery_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_battery_t *cs = (cistpl_battery_t *)arg;
-
-		RESET_TP(tp);
-		cs->rday = GET_SHORT(tp);
-		cs->xday = GET_SHORT(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_org_handler - handler for CISTPL_ORG data organization tuple
- *
- *	void *arg - points to a cistpl_org_t * where the
- *			information is stuffed into
- */
-uint32_t
-cistpl_org_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_org_t *cs = (cistpl_org_t *)arg;
-
-		RESET_TP(tp);
-		cs->type = GET_BYTE(tp);
-
-		(void) strcpy(cs->desc, cis_getstr(tp));
-	}
-
-	return (CISTPLF_NOERROR);
-}
-
-
-/*
- * cistpl_manfid_handler - handler for CISTPL_MANFID, the manufacturer ID tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_manfid_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_manfid_t *cs = (cistpl_manfid_t *)arg;
-
-		RESET_TP(tp);
-		cs->manf = GET_SHORT(tp);
-		cs->card = GET_SHORT(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_funcid_handler - handler for CISTPL_FUNCID
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_funcid_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_funcid_t *cs = (cistpl_funcid_t *)arg;
-
-		RESET_TP(tp);
-
-		cs->function = GET_BYTE(tp);
-		cs->sysinit = GET_BYTE(tp);
-	}
-	return (CISTPLF_NOERROR);
-}
-
-
-/*
- * cistpl_funce_serial_handler - handler for the CISTPL_FUNCE/SERIAL tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_funce_serial_handler(cistpl_callout_t *co, cistpl_t *tp,
-						uint32_t flags, void *arg)
-{
-	int subfunction;
-
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		cistpl_funce_t *cs = (cistpl_funce_t *)arg;
-
-		RESET_TP(tp);
-
-		cs->function = TPLFUNC_SERIAL;
-		cs->subfunction = subfunction = GET_BYTE(tp);
-		switch (subfunction & 0xF) {
-		case TPLFE_SUB_SERIAL:
-		case TPLFE_CAP_SERIAL_DATA:
-		case TPLFE_CAP_SERIAL_FAX:
-		case TPLFE_CAP_SERIAL_VOICE:
-			cs->data.serial.ua = GET_BYTE(tp);
-			cs->data.serial.uc = GET_SHORT(tp);
-			break;
-		case TPLFE_SUB_MODEM_COMMON:
-		case TPLFE_CAP_MODEM_DATA:
-		case TPLFE_CAP_MODEM_FAX:
-		case TPLFE_CAP_MODEM_VOICE:
-			cs->data.modem.fc = GET_BYTE(tp);
-			cs->data.modem.cb = (GET_BYTE(tp) + 1) * 4;
-			cs->data.modem.eb = GET_INT24(tp);
-			cs->data.modem.tb = GET_INT24(tp);
-			break;
-		case TPLFE_SUB_MODEM_DATA:
-			cs->data.data_modem.ud = GET_BE_SHORT(tp) * 75;
-			cs->data.data_modem.ms = GET_SHORT(tp);
-			cs->data.data_modem.em = GET_BYTE(tp);
-			cs->data.data_modem.dc = GET_BYTE(tp);
-			cs->data.data_modem.cm = GET_BYTE(tp);
-			cs->data.data_modem.ex = GET_BYTE(tp);
-			cs->data.data_modem.dy = GET_BYTE(tp);
-			cs->data.data_modem.ef = GET_BYTE(tp);
-			for (cs->data.data_modem.ncd = 0;
-				GET_LEN(tp) > 0 && cs->data.data_modem.ncd < 16;
-						cs->data.data_modem.ncd++)
-				if (LOOK_BYTE(tp) != 255) {
-					cs->data.data_modem.cd[
-						cs->data.data_modem.ncd] =
-								GET_BYTE(tp);
-				} else {
-					GET_BYTE(tp);
-					break;
-				}
-			break;
-		case TPLFE_SUB_MODEM_FAX:
-			cs->data.fax.uf = GET_BE_SHORT(tp) * 75;
-			cs->data.fax.fm = GET_BYTE(tp);
-			cs->data.fax.fy = GET_BYTE(tp);
-			cs->data.fax.fs = GET_SHORT(tp);
-			for (cs->data.fax.ncf = 0;
-				GET_LEN(tp) > 0 && cs->data.fax.ncf < 16;
-							cs->data.fax.ncf++)
-				if (LOOK_BYTE(tp) != 255) {
-					cs->data.fax.cf[cs->data.fax.ncf] =
-								GET_BYTE(tp);
-				} else {
-					GET_BYTE(tp);
-					break;
-				}
-			break;
-		case TPLFE_SUB_VOICE:
-			cs->data.voice.uv = GET_BE_SHORT(tp) * 75;
-			for (cs->data.voice.nsr = 0; LOOK_BYTE(tp) != 0 &&
-				GET_LEN(tp) >= 2;
-						cs->data.voice.nsr++) {
-				cs->data.voice.sr[cs->data.voice.nsr] =
-					GET_BYTE(tp) * 1000;
-				cs->data.voice.sr[cs->data.voice.nsr] +=
-					GET_BYTE(tp) * 100;
-			}
-			for (cs->data.voice.nss = 0; LOOK_BYTE(tp) != 0 &&
-				GET_LEN(tp) >= 2;
-						cs->data.voice.nss++) {
-				cs->data.voice.ss[cs->data.voice.nss] =
-					GET_BYTE(tp) * 10;
-				cs->data.voice.ss[cs->data.voice.nss] +=
-								GET_BYTE(tp);
-			}
-			for (cs->data.voice.nsc = 0; LOOK_BYTE(tp) != 0 &&
-				GET_LEN(tp) >= 1;
-						cs->data.voice.nsc++) {
-				cs->data.voice.sc[cs->data.voice.nsc] =
-								GET_BYTE(tp);
-			}
-			break;
-		default:
-			break;
-		}
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_funce_lan_handler - handler for the CISTPL_FUNCE/LAN tuple
- *
- *	void *arg - points to a XXX where the information is stuffed into
- */
-uint32_t
-cistpl_funce_lan_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-								void *arg)
-{
-	int subfunction;
-
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * We don't currently validate this tuple. This call will
-	 *	always set tp->flags |= CISTPLF_VALID.
-	 */
-	if (flags & HANDTPL_COPY_DONE)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	if (flags & HANDTPL_PARSE_LTUPLE) {
-		int i;
-		cistpl_funce_t *cs = (cistpl_funce_t *)arg;
-
-		RESET_TP(tp);
-
-		cs->function = TPLFUNC_LAN;
-		cs->subfunction = subfunction = GET_BYTE(tp);
-
-		switch (subfunction) {
-		case TPLFE_NETWORK_INFO:
-			cs->data.lan.tech = GET_BYTE(tp);
-			cs->data.lan.speed = GET_BYTE(tp);
-			i = GET_BYTE(tp);
-			if (i < 24) {
-				cs->data.lan.speed <<= i;
-			} else {
-				/*
-				 * if speed is too large a value
-				 * to hold in a uint32 flag it and
-				 * store as [mantissa][exponent]
-				 * in least significant 16 bits
-				 */
-				cs->data.lan.speed = 0x80000000 |
-					(cs->data.lan.speed << 8) | i;
-			}
-			cs->data.lan.media = GET_BYTE(tp);
-			cs->data.lan.con = GET_BYTE(tp);
-			cs->data.lan.id_sz = GET_BYTE(tp);
-			if (cs->data.lan.id_sz <= 16) {
-				for (i = 0; i < cs->data.lan.id_sz; i++)
-					cs->data.lan.id[i] = GET_BYTE(tp);
-			}
-			break;
-		default:
-				/* unknown LAN tuple type */
-			return (CISTPLF_UNKNOWN);
-		}
-	}
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_linktarget_handler - handler for CISTPL_LINKTARGET tuple
- *
- *	void *arg - points to a cistpl_linktarget_t * where the
- *			information is stuffed into
- *
- *	If HANDTPL_COPY_DONE is set, we just validate the tuple but
- *		do not return any values.
- *	If HANDTPL_PARSE_LTUPLE is set, we validate the tuple and
- *		return the parsed tuple data if the tuple is valid.
- *
- *	If the tuple link field is invalid, the CISTPLF_LINK_INVALID flag
- *		will be set in the tp->flags field and HANDTPL_ERROR
- *		will be returned.
- *
- *	If the tuple data body is invalid, the CISTPLF_PARAMS_INVALID flag
- *		will be set in the tp->flags field and HANDTPL_ERROR
- *		will be returned.
- *
- *	The tuple is considered invalid if it's link field is less than
- *		MIN_LINKTARGET_LENGTH or if the data body of the tuple
- *		does not contain the pattern CISTPL_LINKTARGET_MAGIC.
- *
- * XXX At some point we should revisit this to see if we can call
- *	cis_validate_longlink_acm instead of doing the validation
- *	in both places.
- */
-uint32_t
-cistpl_linktarget_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-								void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * Validate the tuple for both the HANDTPL_COPY_DONE case and
-	 *	the HANDTPL_PARSE_LTUPLE case. Only return data in
-	 *	the HANDTPL_PARSE_LTUPLE case.
-	 */
-	if (flags & (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE)) {
-		uchar_t *cp;
-		cisdata_t tl;
-
-		if ((tl = tp->len) >= (cisdata_t)MIN_LINKTARGET_LENGTH) {
-			cisdata_t *ltm = (cisdata_t *)CISTPL_LINKTARGET_MAGIC;
-			int i;
-
-			RESET_TP(tp);
-
-			/*
-			 * Save the start address of this string in case
-			 *	the tuple turns out to be OK since we
-			 *	need to pass this address to the caller.
-			 */
-			cp = GET_BYTE_ADDR(tp);
-
-			/*
-			 * Check each byte of the tuple body to see if it
-			 *	matches what should be in a valid tuple.
-			 *	Note that we can't assume that this magic
-			 *	pattern is a string and we also only need
-			 *	to be sure that MIN_LINKTARGET_LENGTH bytes
-			 *	match; all bytes following this magic number
-			 *	in this tuple are ignored.
-			 */
-			for (i = 0; i < MIN_LINKTARGET_LENGTH; i++) {
-				if (GET_BYTE(tp) != *ltm++) {
-					tp->flags |= CISTPLF_PARAMS_INVALID;
-					return (HANDTPL_ERROR);
-				}
-			} /* MIN_LINKTARGET_LENGTH */
-
-			/*
-			 * This tuple is valid.
-			 */
-			if (flags & HANDTPL_COPY_DONE)
-				tp->flags |= CISTPLF_VALID;
-
-			/*
-			 * If we're also parsing this tuple, then
-			 *	setup the return values.
-			 */
-			if (flags & HANDTPL_PARSE_LTUPLE) {
-				cistpl_linktarget_t *cs =
-						(cistpl_linktarget_t *)arg;
-
-				cs->length = tl;
-				(void) strncpy(cs->tpltg_tag, (char *)cp,
-								cs->length);
-				cs->tpltg_tag[cs->length] = NULL;
-
-			} /* HANDTPL_PARSE_LTUPLE */
-
-		} else {
-
-			tp->flags |= CISTPLF_LINK_INVALID;
-			return (HANDTPL_ERROR);
-
-		} /* CISTPL_LINKTARGET */
-
-	} /* (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE) */
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_longlink_ac_handler - handler for CISTPL_LONGLINK_A and
- *				CISTPL_LONGLINK_C tuples
- *
- *	void *arg - points to a cistpl_longlink_ac_t * where the
- *			information is stuffed into
- *
- *	If the passed in tuple is CISTPL_LONGLINK_A the CISTPL_LONGLINK_AC_AM
- *		flag in cistpl_longlink_ac_t->flags is set.
- *	If the passed in tuple is CISTPL_LONGLINK_C the CISTPL_LONGLINK_AC_CM
- *		flag in cistpl_longlink_ac_t->flags is set.
- *
- *	If HANDTPL_COPY_DONE is set, we just validate the tuple but
- *		do not return any values.
- *	If HANDTPL_PARSE_LTUPLE is set, we validate the tuple and
- *		return the parsed tuple data if the tuple is valid.
- *
- *	If the tuple link field is invalid, the CISTPLF_LINK_INVALID flag
- *		will be set in the tp->flags field and HANDTPL_ERROR
- *		will be returned.
- *
- *	The tuple is considered invalid if it's link field is less than
- *		MIN_LONGLINK_AC_LENGTH.
- */
-uint32_t
-cistpl_longlink_ac_handler(cistpl_callout_t *co, cistpl_t *tp, uint32_t flags,
-								void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * Validate the tuple for both the HANDTPL_COPY_DONE case and
-	 *	the HANDTPL_PARSE_LTUPLE case. Only return data in
-	 *	the HANDTPL_PARSE_LTUPLE case.
-	 */
-	if (flags & (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE)) {
-
-		if (tp->len >= (cisdata_t)MIN_LONGLINK_AC_LENGTH) {
-
-			/*
-			 * This tuple is valid.
-			 */
-			if (flags & HANDTPL_COPY_DONE)
-				tp->flags |= CISTPLF_VALID;
-
-			if (flags & HANDTPL_PARSE_LTUPLE) {
-				cistpl_longlink_ac_t *cs =
-						(cistpl_longlink_ac_t *)arg;
-
-				switch (tp->type) {
-				    case CISTPL_LONGLINK_A:
-					cs->flags = CISTPL_LONGLINK_AC_AM;
-					break;
-
-				    case CISTPL_LONGLINK_C:
-					cs->flags = CISTPL_LONGLINK_AC_CM;
-					break;
-				    default:
-					break;
-				} /* switch */
-
-				RESET_TP(tp);
-
-				cs->tpll_addr = GET_LONG(tp);
-
-			} /* HANDTPL_PARSE_LTUPLE */
-
-		} else {
-			tp->flags |= CISTPLF_LINK_INVALID;
-			return (HANDTPL_ERROR);
-		} /* MIN_LONGLINK_AC_LENGTH */
-
-	} /* (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE) */
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cistpl_longlink_mfc_handler - handler for CISTPL_LONGLINK_MFC tuples
- *
- *	void *arg - points to a cistpl_longlink_mfc_t * where the
- *			information is stuffed into
- *
- *	If HANDTPL_COPY_DONE is set, we just validate the tuple but
- *		do not return any values.
- *	If HANDTPL_PARSE_LTUPLE is set, we validate the tuple and
- *		return the parsed tuple data if the tuple is valid.
- *
- *	If the tuple link field is invalid, the CISTPLF_LINK_INVALID flag
- *		will be set in the tp->flags field and HANDTPL_ERROR
- *		will be returned.
- *
- *	If the number of register sets is invalid, the CISTPLF_PARAMS_INVALID
- *		flag be set in the tp->flags field and HANDTPL_ERROR will be
- *		returned.
- *
- *	The tuple is considered invalid if it's link field is less than
- *		MIN_LONGLINK_MFC_LENGTH or if the number of register sets
- *		is not in the range [MIN_LONGLINK_MFC_NREGS..CIS_MAX_FUNCTIONS]
- */
-uint32_t
-cistpl_longlink_mfc_handler(cistpl_callout_t *co, cistpl_t *tp,
-					uint32_t flags, void *arg)
-{
-	/*
-	 * nothing special about our flags, so just call the
-	 *	generic handler for this
-	 */
-	if (flags & HANDTPL_SET_FLAGS)
-		return (cis_no_tuple_handler(co, tp, flags, arg));
-
-	/*
-	 * Validate the tuple for both the HANDTPL_COPY_DONE case and
-	 *	the HANDTPL_PARSE_LTUPLE case. Only return data in
-	 *	the HANDTPL_PARSE_LTUPLE case.
-	 */
-	if (flags & (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE)) {
-
-		if (tp->len >= (cisdata_t)MIN_LONGLINK_MFC_LENGTH) {
-
-			/*
-			 * This tuple is valid.
-			 */
-			if (flags & HANDTPL_COPY_DONE)
-				tp->flags |= CISTPLF_VALID;
-
-			if (flags & HANDTPL_PARSE_LTUPLE) {
-				cistpl_longlink_mfc_t *cs =
-						(cistpl_longlink_mfc_t *)arg;
-				int fn;
-
-				RESET_TP(tp);
-
-				/*
-				 * Get the number of register sets described
-				 *	by this tuple. The number of register
-				 *	sets must be greter than or equal to
-				 *	MIN_LONGLINK_MFC_NREGS and less than
-				 *	CIS_MAX_FUNCTIONS.
-				 * Note that the number of functions is equal
-				 *	to the number of register sets.
-				 */
-				cs->nregs = GET_BYTE(tp);
-				cs->nfuncs = cs->nregs;
-
-				if ((cs->nregs < MIN_LONGLINK_MFC_NREGS) ||
-					(cs->nregs > CIS_MAX_FUNCTIONS)) {
-				    tp->flags |= CISTPLF_PARAMS_INVALID;
-				    return (HANDTPL_ERROR);
-				}
-
-				/*
-				 * Cycle through each function and setup
-				 *	the appropriate parameter values.
-				 */
-				for (fn = 0; fn < cs->nregs; fn++) {
-				    cs->function[fn].tas = GET_BYTE(tp);
-				    cs->function[fn].addr = GET_LONG(tp);
-				} /* for (fn) */
-
-			} /* HANDTPL_PARSE_LTUPLE */
-
-		} else {
-			tp->flags |= CISTPLF_LINK_INVALID;
-			return (HANDTPL_ERROR);
-		} /* MIN_LONGLINK_MFC_LENGTH */
-
-	} /* (HANDTPL_COPY_DONE | HANDTPL_PARSE_LTUPLE) */
-
-	return (CISTPLF_NOERROR);
-}
-
-/*
- * cis_validate_longlink_acm - Validates the secondary tuple chain pointed
- *				to by cisptr and specified by a previous
- *				CISTPL_LONGLINK_A, CISTPL_LONGLINK_C or
- *				CISTPL_LONGLINK_MFC tuple.
- *
- *	cisptr->offset must be the offset to the first byte in the secondary
- *		tuple chain to validate
- *	cisptr->flags must be setup to specify the correct address space
- *
- * The cisptr->offset member is not updated after this function returns.
- *
- *	BAD_CIS_ADDR is returned is the raw CIS data cound not be read.
- *	HANDTPL_ERROR is returned if the secondary tuple chain does not
- *		contain a valid CISTPL_LINKTARGET tuple.
- */
-uint32_t
-cis_validate_longlink_acm(cisptr_t *cisptr)
-{
-	uchar_t cb[MIN_LINKTARGET_LENGTH + LINKTARGET_AC_HEADER_LENGTH];
-	cisptr_t t_cisptr, *cpt;
-	int tl;
-
-	/*
-	 * Since the NEXT_CIS_ADDR macro increments the cisptr_t->offset
-	 *	member, make a local copy of the cisptr and use the local
-	 *	copy to read data from the card.
-	 */
-	cpt = &t_cisptr;
-	bcopy((caddr_t)cisptr, (caddr_t)cpt, sizeof (cisptr_t));
-
-	for (tl = 0; tl < MIN_LINKTARGET_LENGTH +
-					LINKTARGET_AC_HEADER_LENGTH; tl++) {
-
-		cb[tl] = GET_CIS_DATA(cpt);
-		if (!NEXT_CIS_ADDR(cpt))
-			return ((uint32_t)BAD_CIS_ADDR);
-
-	} /* for */
-
-	if ((cb[0] == CISTPL_LINKTARGET) && (cb[1] >= MIN_LINKTARGET_LENGTH)) {
-		cisdata_t *ltm = (cisdata_t *)CISTPL_LINKTARGET_MAGIC;
-
-		for (tl = 0; tl < MIN_LINKTARGET_LENGTH; tl++, ltm++) {
-			if (cb[tl + LINKTARGET_AC_HEADER_LENGTH] != *ltm)
-				return (HANDTPL_ERROR);
-		}
-		return (CISTPLF_NOERROR);
-
-	} /* if */
-
-	return (HANDTPL_ERROR);
-}
-
-/*
- * cis_getstr (tp)
- *	we want the address of the first character returned
- *	but need to skip past the string in the cistpl_t structure
- */
-char *
-cis_getstr(cistpl_t *tp)
-{
-	uchar_t *cp, *cpp;
-	uchar_t x;
-
-	cp = tp->read.byte;
-	cpp = cp;
-
-	while ((x = LOOK_BYTE(tp)) != 0 && x != 0xff) {
-		x = GET_BYTE(tp);
-	}
-
-	(void) GET_BYTE(tp);	/* get past that last byte */
-
-	while ((*cpp != 0) && (*cpp != 0xff))
-	    cpp++;
-
-	*cpp = NULL;
-
-	return ((char *)cp);
-}
-
-/*
- * cis_return_name - returns name of tuple
- *
- *    calling:	co - pointer to cistpl_callout_t entry that contains
- *			tuple name to return
- *		gtn - pointer to cistpl_get_tuple_name_t to return
- *			name into
- */
-static void
-cis_return_name(cistpl_callout_t *co, cistpl_get_tuple_name_t *gtn)
-{
-	(void) strncpy(gtn->name, co->text, CIS_MAX_TUPLE_NAME_LEN);
-	gtn->name[CIS_MAX_TUPLE_NAME_LEN - 1] = NULL;
-}
-
-/*
- * cis_malloc/cis_free
- *	wrappers around kmem_alloc()/kmem_free() that
- *	provide malloc/free style usage
- */
-
-caddr_t
-cis_malloc(size_t len)
-{
-	caddr_t addr;
-
-	addr = kmem_zalloc(len + sizeof (size_t), KM_SLEEP);
-	*(size_t *)addr = len + sizeof (size_t);
-	addr += sizeof (size_t);
-	return (addr);
-}
-
-void
-cis_free(caddr_t addr)
-{
-	size_t len;
-	addr -= sizeof (size_t);
-	len = *(size_t *)addr;
-	kmem_free(addr, len);
-}
--- old/usr/src/uts/common/pcmcia/cis/cis_params.c	2014-11-12 17:44:40.719443557 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,236 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1995-1999 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/ddi_impldefs.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-
-/*
- *
- * The following speed tables are used by cistpl_devspeed() to generate
- *	device speeds from tuple data.
- *
- * Define the device speed table.  For a description of this table's contents,
- *	see PCMCIA Release 2.01 Card Metaformat pg. 5-14 table 5-12.
- *
- * All times in this table are in nS.
- */
-uint32_t cistpl_devspeed_table[CISTPL_DEVSPEED_MAX_TBL] = {
-    0,		/* 0x00 - DSPEED_NULL */
-    250,	/* 0x01 - DSPEED_250NS */
-    200,	/* 0x02 - DSPEED_200NS */
-    150,	/* 0x03 - DSPEED_150NS */
-    100,	/* 0x04 - DSPEED_100NS */
-    0,		/* 0x05 - reserved */
-    0,		/* 0x06 - reserved */
-    0		/* 0x07 - use extended speed byte */
-};
-
-/*
- * Define the power-of-10 table.
- */
-uint32_t cistpl_exspeed_tenfac[] = {
-    1,		/* 10^0 */
-    10,		/* 10^1 */
-    100,	/* 10^2 */
-    1000,	/* 10^3 */
-    10000,	/* 10^4 */
-    100000,	/* 10^5 */
-    1000000,	/* 10^6 */
-    10000000	/* 10^7	 */
-};
-
-/*
- * The extended device speed code mantissa table.
- *
- * This table is described in PCMCIA Release 2.01 Card Metaformat
- *	pg. 5-15 table 5-13.
- *
- * The description of this table uses non-integer values.  We multiply
- *	everything by 10 before it goes into the table, and the code
- *	will divide by 10 after it calculates the device speed.
- */
-uint32_t cistpl_devspeed_man[CISTPL_DEVSPEED_MAX_MAN] = {
-    0,		/* no units */
-    10,		/* no units */
-    12,		/* no units */
-    13,		/* no units */
-    15,		/* no units */
-    20,		/* no units */
-    25,		/* no units */
-    30,		/* no units */
-    35,		/* no units */
-    40,		/* no units */
-    45,		/* no units */
-    50,		/* no units */
-    55,		/* no units */
-    60,		/* no units */
-    70,		/* no units */
-    80,		/* no units */
-};
-
-/*
- * The extended device speed code exponent table.
- *
- * This table is described in PCMCIA Release 2.01 Card Metaformat
- *	pg. 5-15 table 5-13.
- *
- * The description of this table uses various timing units.  This
- *	table contains all times in nS.
- */
-uint32_t cistpl_devspeed_exp[CISTPL_DEVSPEED_MAX_EXP] = {
-    1,		/* 1 nS */
-    10,		/* 10 nS */
-    100,	/* 100 nS */
-    1000,	/* 1000 nS */
-    10000,	/* 10000 nS */
-    100000,	/* 100000 nS */
-    1000000,	/* 1000000 nS */
-    10000000	/* 10000000 nS */
-};
-
-/*
- * The power description mantissa table.
- *
- * This table is described in PCMCIA Release 2.01 Card Metaformat
- *	pg. 5-28 table 5-32.
- *
- * The description of this table uses non-integer values.  We multiply
- *	everything by 10 before it goes into the table, and the code
- *	will divide by 10 after it calculates the device power.
- */
-uint32_t cistpl_pd_man[] = {
-    10,		/* no units */
-    12,		/* no units */
-    13,		/* no units */
-    15,		/* no units */
-    20,		/* no units */
-    25,		/* no units */
-    30,		/* no units */
-    35,		/* no units */
-    40,		/* no units */
-    45,		/* no units */
-    50,		/* no units */
-    55,		/* no units */
-    60,		/* no units */
-    70,		/* no units */
-    80,		/* no units */
-    90,		/* no units */
-};
-
-/*
- * The power description exponent table.
- *
- * This table is described in PCMCIA Release 2.01 Card Metaformat
- *	pg. 5-28 table 5-32.
- *
- * The description of this table uses various voltage and current units.
- *	This table contains all currents in nanoAMPS and all voltages
- *	in microVOLTS.
- *
- * Note if you're doing a current table lookup, you need to multiply
- *	the lookup value by ten.
- */
-uint32_t cistpl_pd_exp[] = {
-    10,		/* 10 microVOLTS, 100 nanoAMPS */
-    100,	/* 100 microVOLTS, 1000 nanoAMPS */
-    1000,	/* 1000 microVOLTS, 10000 nanoAMPS */
-    10000,	/* 10000 microVOLTS, 100000 nanoAMPS */
-    100000,	/* 100000 microVOLTS, 1000000 nanoAMPS */
-    1000000,	/* 1000000 microVOLTS, 10000000 nanoAMPS */
-    10000000,	/* 10000000 microVOLTS, 100000000 nanoAMPS */
-    100000000	/* 100000000 microVOLTS, 1000000000 nanoAMPS */
-};
-
-/*
- * Fill out the structure pointers.
- */
-cistpl_devspeed_struct_t cistpl_devspeed_struct = {
-	cistpl_devspeed_table,
-	cistpl_exspeed_tenfac,
-	cistpl_devspeed_man,
-	cistpl_devspeed_exp,
-};
-
-cistpl_pd_struct_t cistpl_pd_struct = {
-	cistpl_pd_man,
-	cistpl_pd_exp,
-};
-
-/*
- * Some handy lookup tables that should probably eventually be
- *	done away with.
- *
- * These are used mostly by the CISTPL_CFTABLE_ENTRY tuple handler.
- */
-uint32_t cistpl_cftable_io_size_table[] = {
-	0,
-	1,
-	2,
-	4,
-};
-
-uint32_t cistpl_cftable_shift_table[] = {
-	0,
-	8,
-	16,
-	24,
-};
-
-/*
- * List of tuples in the global CIS to ignore if they show
- *	up in both the global and function-specific CIS lists.
- * This list MUST end with CISTPL_NULL.
- */
-cistpl_ignore_list_t cistpl_ignore_list[] = {
-	CISTPL_FUNCID,
-	CISTPL_FUNCE,
-	CISTPL_CONFIG,
-	CISTPL_CFTABLE_ENTRY,
-	CISTPL_NULL	/* list must end with CISTPL_NULL */
-};
--- old/usr/src/uts/common/pcmcia/cs/cs.c	2014-11-12 17:44:40.773231913 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,8883 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * PCMCIA Card Services
- *	The PCMCIA Card Services is a loadable module which
- *	presents the Card Services interface to client device
- *	drivers.
- *
- *	Card Services uses Socket Services-like calls into the
- *	PCMCIA nexus driver to manipulate socket and adapter
- *	resources.
- *
- * Note that a bunch of comments are not indented correctly with the
- *	code that they are commenting on. This is because cstyle is
- *	is inflexible concerning 4-column indenting.
- */
-
-#if defined(DEBUG)
-#define	CS_DEBUG
-#endif
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/debug.h>
-#include <sys/varargs.h>
-#include <sys/var.h>
-#include <sys/proc.h>
-#include <sys/thread.h>
-#include <sys/utsname.h>
-#include <sys/vtrace.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-#include <sys/time.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-#include <pcmcia/sys/cs_stubs.h>
-
-/*
- * The cs_strings header file is where all of the major strings that
- *	Card Services uses are located.
- */
-#include <pcmcia/sys/cs_strings.h>
-
-
-/*
- * Function declarations
- *
- * The main Card Services entry point
- */
-int CardServices(int function, ...);
-
-/*
- * functions and globals used by Socket Services
- *
- * WAS: void *(*cis_parser)(int, ...) = NULL;
- */
-void *(*cis_parser)(int, ...) = NULL;
-csfunction_t *cs_socket_services = NULL;
-
-/*
- * event handling functions
- */
-static event_t ss_to_cs_events(cs_socket_t *, event_t);
-static event_t cs_cse2sbm(event_t);
-static void cs_event_thread(uint32_t);
-static int cs_card_insertion(cs_socket_t *, event_t);
-static int cs_card_removal(cs_socket_t *);
-static void cs_ss_thread(uint32_t);
-void cs_ready_timeout(void *);
-static int cs_card_for_client(client_t *);
-static int cs_request_socket_mask(client_handle_t, request_socket_mask_t *);
-static int cs_release_socket_mask(client_handle_t, release_socket_mask_t *);
-static int cs_get_event_mask(client_handle_t, sockevent_t *);
-static int cs_set_event_mask(client_handle_t, sockevent_t *);
-static int cs_event2text(event2text_t *, int);
-static int cs_read_event_status(cs_socket_t *, client_t *, event_t *,
-						get_ss_status_t *, int);
-uint32_t cs_socket_event_softintr(caddr_t);
-void cs_event_softintr_timeout(void *);
-static int cs_get_status(client_handle_t, get_status_t *);
-static uint32_t cs_sbm2cse(uint32_t);
-static unsigned cs_merge_event_masks(cs_socket_t *, client_t *);
-static int cs_set_socket_event_mask(cs_socket_t *, unsigned);
-
-/*
- * SS<->CS communication and internal socket and window  handling functions
- */
-static uint32_t cs_add_socket(uint32_t);
-static uint32_t cs_drop_socket(uint32_t);
-static cs_socket_t *cs_get_sp(uint32_t);
-static cs_socket_t *cs_find_sp(uint32_t);
-static cs_window_t *cs_get_wp(uint32_t);
-static cs_window_t *cs_find_wp(uint32_t);
-static int cs_add_windows(int, uint32_t);
-static uint32_t cs_ss_init();
-static void cs_set_acc_attributes(set_window_t *, uint32_t);
-
-/*
- * CIS handling functions
- */
-cistpl_callout_t *cis_cistpl_std_callout;
-static int cs_parse_tuple(client_handle_t,  tuple_t *, cisparse_t *, cisdata_t);
-static int cs_get_tuple_data(client_handle_t, tuple_t *);
-static int cs_validate_cis(client_handle_t, cisinfo_t *);
-static int cs_get_firstnext_tuple(client_handle_t, tuple_t *, uint32_t);
-static int cs_create_cis(cs_socket_t *);
-static int cs_destroy_cis(cs_socket_t *);
-
-/*
- * client handling functions
- */
-unsigned cs_create_next_client_minor(unsigned, unsigned);
-static client_t *cs_find_client(client_handle_t, int *);
-static client_handle_t cs_create_client_handle(unsigned, client_t *);
-static int cs_destroy_client_handle(client_handle_t);
-static int cs_register_client(client_handle_t *, client_reg_t *);
-static int cs_deregister_client(client_handle_t);
-static int cs_deregister_mtd(client_handle_t);
-static void cs_clear_superclient_lock(int);
-static int cs_add_client_to_socket(unsigned, client_handle_t *,
-						client_reg_t *, int);
-static int cs_get_client_info(client_handle_t, client_info_t *);
-static int cs_get_firstnext_client(get_firstnext_client_t *, uint32_t);
-
-/*
- * window handling functions
- */
-static int cs_request_window(client_handle_t, window_handle_t *, win_req_t *);
-static int cs_release_window(window_handle_t);
-static int cs_modify_window(window_handle_t, modify_win_t *);
-static int cs_modify_mem_window(window_handle_t, modify_win_t *, win_req_t *,
-									int);
-static int cs_map_mem_page(window_handle_t, map_mem_page_t *);
-static int cs_find_mem_window(uint32_t, win_req_t *, uint32_t *);
-static int cs_memwin_space_and_map_ok(inquire_window_t *, win_req_t *);
-static int cs_valid_window_speed(inquire_window_t *, uint32_t);
-static window_handle_t cs_create_window_handle(uint32_t);
-static cs_window_t *cs_find_window(window_handle_t);
-static int cs_find_io_win(uint32_t, iowin_char_t *, uint32_t *, uint32_t *);
-
-/*
- * IO, IRQ and configuration handling functions
- */
-static int cs_request_io(client_handle_t, io_req_t *);
-static int cs_release_io(client_handle_t, io_req_t *);
-static int cs_allocate_io_win(uint32_t, uint32_t, uint32_t *);
-static int cs_setup_io_win(uint32_t, uint32_t, baseaddru_t *,
-					uint32_t *, uint32_t, uint32_t);
-static int cs_request_irq(client_handle_t, irq_req_t *);
-static int cs_release_irq(client_handle_t, irq_req_t *);
-static int cs_request_configuration(client_handle_t, config_req_t *);
-static int cs_release_configuration(client_handle_t, release_config_t *);
-static int cs_modify_configuration(client_handle_t, modify_config_t *);
-static int cs_access_configuration_register(client_handle_t,
-						access_config_reg_t *);
-
-/*
- * RESET and general info functions
- */
-static int cs_reset_function(client_handle_t, reset_function_t *);
-static int cs_get_configuration_info(client_handle_t *,
-						get_configuration_info_t *);
-static int cs_get_cardservices_info(client_handle_t,
-						get_cardservices_info_t *);
-static int cs_get_physical_adapter_info(client_handle_t,
-						get_physical_adapter_info_t *);
-
-/*
- * general functions
- */
-static uint32_t cs_get_socket(client_handle_t, uint32_t *, uint32_t *,
-					cs_socket_t **, client_t **);
-static int cs_convert_speed(convert_speed_t *);
-static int cs_convert_size(convert_size_t *);
-static char *cs_error2text(int, int);
-static int cs_map_log_socket(client_handle_t, map_log_socket_t *);
-static int cs_convert_powerlevel(uint32_t, uint32_t, uint32_t, unsigned *);
-static int cs_make_device_node(client_handle_t, make_device_node_t *);
-static int cs_remove_device_node(client_handle_t, remove_device_node_t *);
-static int cs_ddi_info(cs_ddi_info_t *);
-static int cs_init_cis_window(cs_socket_t *, uint32_t *, acc_handle_t *,
-				uint32_t);
-static int cs_sys_ctl(cs_sys_ctl_t *);
-
-/*
- * global variables
- */
-static int cs_max_client_handles = CS_MAX_CLIENTS;
-static client_t cs_socket_services_client;	/* global SS client */
-static client_types_t client_types[MAX_CLIENT_TYPES];
-static cs_globals_t cs_globals;
-int cs_reset_timeout_time = RESET_TIMEOUT_TIME;
-int cs_rc1_delay = CS_RC1_DELAY;
-int cs_rc2_delay = CS_RC2_DELAY;
-int cs_rq_delay = CS_RQ_DELAY;
-
-#ifdef	CS_DEBUG
-int	cs_debug = 0;
-#endif
-
-/*
- * cs_init - Initialize CS internal structures, databases, and state,
- *		and register with SS
- *
- * XXX - Need to make sure that if we fail at any point that we free
- *		any resources that we allocated, as well as kill any
- *		threads that may have been started.
- */
-int
-cs_init()
-{
-	client_types_t *ct;
-	client_t *client;
-
-	/*
-	 * Initialize the CS global structure
-	 */
-	bzero((caddr_t)&cs_globals, sizeof (cs_globals_t));
-
-	mutex_init(&cs_globals.global_lock, NULL, MUTEX_DRIVER, NULL);
-	mutex_init(&cs_globals.window_lock, NULL, MUTEX_DRIVER, NULL);
-
-	cs_globals.init_state = GLOBAL_INIT_STATE_MUTEX;
-
-	/*
-	 * Set up the global Socket Services client, since we're going to
-	 *	need it once we register with SS.
-	 */
-	client = &cs_socket_services_client;
-	bzero((caddr_t)client, sizeof (client_t));
-	client->client_handle = CS_SS_CLIENT_HANDLE;
-	client->flags |= (INFO_SOCKET_SERVICES | CLIENT_CARD_INSERTED);
-
-	/*
-	 * Setup the client type structure - this is used in the socket event
-	 *	thread to sequence the delivery of events to all clients on
-	 *	the socket.
-	 */
-	ct = &client_types[0];
-	ct->type = INFO_IO_CLIENT;
-	ct->order = CLIENT_EVENTS_LIFO;
-	ct->next = &client_types[1];
-
-	ct = ct->next;
-	ct->type = INFO_MTD_CLIENT;
-	ct->order = CLIENT_EVENTS_FIFO;
-	ct->next = &client_types[2];
-
-	ct = ct->next;
-	ct->type = INFO_MEM_CLIENT;
-	ct->order = CLIENT_EVENTS_FIFO;
-	ct->next = NULL;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_deinit - Deinitialize CS
- *
- * This function cleans up any allocated resources, stops any running threads,
- *	destroys any mutexes and condition variables, and finally frees up the
- *	global socket and window structure arrays.
- */
-int
-cs_deinit()
-{
-	cs_socket_t *sp;
-	int sn, have_clients = 0, have_sockets = 0;
-	cs_register_cardservices_t rcs;
-
-#if defined(CS_DEBUG)
-	if (cs_debug > 1)
-	    cmn_err(CE_CONT, "CS: cs_deinit\n");
-#endif
-
-	/*
-	 * Deregister with the Card Services kernel stubs module
-	 */
-	rcs.magic = CS_STUBS_MAGIC;
-	rcs.function = CS_ENTRY_DEREGISTER;
-	(void) csx_register_cardservices(&rcs);
-
-	/*
-	 * Set the GLOBAL_INIT_STATE_NO_CLIENTS flag to prevent new clients
-	 *	from registering.
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	cs_globals.init_state |= GLOBAL_INIT_STATE_NO_CLIENTS;
-	mutex_exit(&cs_globals.global_lock);
-
-	/*
-	 * Go through each socket and make sure that there are no clients
-	 *	on any of the sockets.  If there are, we can't deinit until
-	 *	all the clients for every socket are gone.
-	 */
-	for (sn = 0; sn < cs_globals.max_socket_num; sn++) {
-	    if ((sp = cs_get_sp(sn)) != NULL) {
-		have_sockets++;
-		if (sp->client_list) {
-		    cmn_err(CE_CONT, "cs_deinit: cannot unload module since "
-				"socket %d has registered clients\n", sn);
-		    have_clients++;
-		}
-	    }
-	}
-
-	/*
-	 * We don't allow unload if there are any clients registered
-	 *	or if there are still sockets that are active.
-	 */
-	if ((have_clients > 0) || (have_sockets > 0))
-	    return (BAD_FUNCTION);
-
-#ifdef	XXX
-	/*
-	 * If one or more sockets have been added, we need to deallocate
-	 *	the resources associated with those sockets.
-	 */
-
-	/*
-	 * First, tell Socket Services that we're leaving, so that we
-	 *	don't get any more event callbacks.
-	 */
-	SocketServices(CSUnregister);
-
-	/*
-	 * Wait for the soft int timer to tell us it's done
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	cs_globals.init_state |= GLOBAL_INIT_STATE_UNLOADING;
-	mutex_exit(&cs_globals.global_lock);
-	UNTIMEOUT(cs_globals.sotfint_tmo);
-
-	/*
-	 * Remove the soft interrupt handler.
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	if (cs_globals.init_state & GLOBAL_INIT_STATE_SOFTINTR) {
-	    ddi_remove_softintr(cs_globals.softint_id);
-	    cs_globals.init_state &= ~GLOBAL_INIT_STATE_SOFTINTR;
-	}
-	mutex_exit(&cs_globals.global_lock);
-
-	return (CS_SUCCESS);
-
-	/*
-	 * Go through each socket and free any resource allocated to that
-	 *	socket, as well as any mutexs and condition variables.
-	 */
-	for (sn = 0; sn < cs_globals.max_socket_num; sn++) {
-	    set_socket_t set_socket;
-
-	    if ((sp = cs_get_sp(sn)) != NULL) {
-
-		/*
-		 * untimeout possible pending ready/busy timer
-		 */
-		UNTIMEOUT(sp->rdybsy_tmo_id);
-
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_enter(&sp->lock);
-		sp->flags = SOCKET_UNLOAD_MODULE;
-		if (sp->init_state & SOCKET_INIT_STATE_SOFTINTR)
-		    sp->init_state &= ~SOCKET_INIT_STATE_SOFTINTR;
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_exit(&sp->lock);
-
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_enter(&sp->cis_lock);
-		(void) cs_destroy_cis(sp);
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_exit(&sp->cis_lock);
-
-		/*
-		 * Tell the event handler thread that we want it to exit, then
-		 *	wait around until it tells us that it has exited.
-		 */
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_enter(&sp->client_lock);
-		if (sp->init_state & SOCKET_INIT_STATE_THREAD) {
-		    sp->thread_state = SOCKET_THREAD_EXIT;
-		    cv_broadcast(&sp->thread_cv);
-		    cv_wait(&sp->caller_cv, &sp->client_lock);
-		}
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_exit(&sp->client_lock);
-
-		/*
-		 * Tell the SS work thread that we want it to exit, then
-		 *	wait around until it tells us that it has exited.
-		 */
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_enter(&sp->ss_thread_lock);
-		if (sp->init_state & SOCKET_INIT_STATE_SS_THREAD) {
-		    sp->ss_thread_state = SOCKET_THREAD_EXIT;
-		    cv_broadcast(&sp->ss_thread_cv);
-		    cv_wait(&sp->ss_caller_cv, &sp->ss_thread_lock);
-		}
-
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX)
-		    mutex_exit(&sp->ss_thread_lock);
-
-		/*
-		 * Free the mutexii and condition variables that we used.
-		 */
-		if (sp->init_state & SOCKET_INIT_STATE_MUTEX) {
-		    mutex_destroy(&sp->lock);
-		    mutex_destroy(&sp->client_lock);
-		    mutex_destroy(&sp->cis_lock);
-		    mutex_destroy(&sp->ss_thread_lock);
-		}
-
-		if (sp->init_state & SOCKET_INIT_STATE_CV) {
-		    cv_destroy(&sp->thread_cv);
-		    cv_destroy(&sp->caller_cv);
-		    cv_destroy(&sp->reset_cv);
-		    cv_destroy(&sp->ss_thread_cv);
-		    cv_destroy(&sp->ss_caller_cv);
-		}
-
-#ifdef	USE_IOMMAP_WINDOW
-		/*
-		 * Free the memory-mapped IO structure if we allocated one.
-		 */
-		if (sp->io_mmap_window)
-		    kmem_free(sp->io_mmap_window, sizeof (io_mmap_window_t));
-#endif	/* USE_IOMMAP_WINDOW */
-
-		/*
-		 * Return the socket to memory-only mode and turn off the
-		 *	socket power.
-		 */
-		sp->event_mask = 0;
-		set_socket.socket = sp->socket_num;
-		set_socket.SCIntMask = 0;
-		set_socket.IREQRouting = 0;
-		set_socket.IFType = IF_MEMORY;
-		set_socket.CtlInd = 0; /* turn off controls and indicators */
-		set_socket.State = (unsigned)~0; /* clear latched state bits */
-
-		(void) cs_convert_powerlevel(sp->socket_num, 0, VCC,
-						&set_socket.VccLevel);
-		(void) cs_convert_powerlevel(sp->socket_num, 0, VPP1,
-						&set_socket.Vpp1Level);
-		(void) cs_convert_powerlevel(sp->socket_num, 0, VPP2,
-						&set_socket.Vpp2Level);
-
-		/*
-		 * If we fail this call, there's not much we can do, so
-		 *	just continue with the resource deallocation.
-		 */
-		if ((ret =
-			SocketServices(SS_SetSocket, &set_socket)) != SUCCESS) {
-		    cmn_err(CE_CONT,
-			"cs_deinit: socket %d SS_SetSocket failure %d\n",
-							sp->socket_num, ret);
-		}
-	    } /* cs_get_sp */
-	} /* for (sn) */
-#endif	/* XXX */
-
-	/*
-	 * Destroy the global mutexii.
-	 */
-	mutex_destroy(&cs_globals.global_lock);
-	mutex_destroy(&cs_globals.window_lock);
-
-#ifdef	XXX
-	/*
-	 * Free the global "super-client" structure
-	 */
-	if (cs_globals.sclient_list)
-	    kmem_free(cs_globals.sclient_list,
-		(cs_globals.num_sockets * sizeof (struct sclient_list_t)));
-	cs_globals.sclient_list = NULL;
-#endif	/* XXX */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== drip, drip, drip - the Card Services waterfall :-) ====
- */
-
-/*
- * CardServices - general Card Services entry point for CS clients
- *			and Socket Services; the address of this
- *			function is handed to SS via the CSRegister
- *			SS call
- */
-int
-CardServices(int function, ...)
-{
-	va_list arglist;
-	int retcode = CS_UNSUPPORTED_FUNCTION;
-
-	cs_socket_t	*socp;
-	uint32_t	*offp;
-	acc_handle_t	*hp;
-	client_handle_t	ch;
-	client_handle_t	*chp;
-	window_handle_t	wh;
-	window_handle_t	*whp;
-	tuple_t		*tuple;
-	cisparse_t	*cisparse;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 127) {
-	    cmn_err(CE_CONT, "CardServices: called for function %s (0x%x)\n",
-				cs_error2text(function, CSFUN2TEXT_FUNCTION),
-				function);
-	}
-#endif
-
-	va_start(arglist, function);
-
-	/*
-	 * Here's the Card Services waterfall
-	 */
-	switch (function) {
-	/*
-	 * We got here as a result of the CIS module calling us
-	 *	in response to cs_ss_init() calling the CIS module
-	 *	at CIS_PARSER(CISP_CIS_SETUP, ...)
-	 */
-	    case CISRegister: {
-		cisregister_t *cisr;
-
-		    cisr = va_arg(arglist, cisregister_t *);
-
-		    if (cisr->cis_magic != PCCS_MAGIC ||
-			cisr->cis_version != PCCS_VERSION) {
-			    cmn_err(CE_WARN,
-				"CS: CISRegister (%lx, %lx, %lx, %lx) *ERROR*",
-					(long)cisr->cis_magic,
-					(long)cisr->cis_version,
-					(long)cisr->cis_parser,
-					(long)cisr->cistpl_std_callout);
-			retcode = CS_BAD_ARGS;
-		    } else {
-			/*
-			 * Replace the CIS Parser entry point if
-			 *	necessary.
-			 */
-			if (cisr->cis_parser != NULL)
-			    cis_parser = cisr->cis_parser;
-			cis_cistpl_std_callout = cisr->cistpl_std_callout;
-			retcode = CS_SUCCESS;
-		    }
-		}
-		break;
-	    case CISUnregister:	/* XXX - should we do some more checking */
-		/* XXX - need to protect this by a mutex */
-		cis_parser = NULL;
-		cis_cistpl_std_callout = NULL;
-		retcode = CS_SUCCESS;
-		break;
-	    case InitCISWindow:
-		socp	= va_arg(arglist, cs_socket_t *);
-		offp	= va_arg(arglist, uint32_t *);
-		hp	= va_arg(arglist, acc_handle_t *);
-		retcode = cs_init_cis_window(socp, offp, hp,
-				va_arg(arglist, uint32_t));
-		break;
-	    case RegisterClient:
-		chp = va_arg(arglist, client_handle_t *),
-		retcode = cs_register_client(chp,
-				va_arg(arglist, client_reg_t *));
-		break;
-	    case DeregisterClient:
-		retcode = cs_deregister_client(
-				va_arg(arglist, client_handle_t));
-		break;
-	    case GetStatus:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_status(ch,
-				va_arg(arglist, get_status_t *));
-		break;
-	    case ResetFunction:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_reset_function(ch,
-				va_arg(arglist, reset_function_t *));
-		break;
-	    case SetEventMask:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_set_event_mask(ch,
-				va_arg(arglist, sockevent_t *));
-		break;
-	    case GetEventMask:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_event_mask(ch,
-				va_arg(arglist, sockevent_t *));
-		break;
-	    case RequestIO:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_request_io(ch,
-				va_arg(arglist, io_req_t *));
-		break;
-	    case ReleaseIO:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_release_io(ch,
-				va_arg(arglist, io_req_t *));
-		break;
-	    case RequestIRQ:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_request_irq(ch,
-				va_arg(arglist, irq_req_t *));
-		break;
-	    case ReleaseIRQ:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_release_irq(ch,
-				va_arg(arglist, irq_req_t *));
-		break;
-	    case RequestWindow:
-		ch = va_arg(arglist, client_handle_t);
-		whp = va_arg(arglist, window_handle_t *);
-		retcode = cs_request_window(ch, whp,
-				va_arg(arglist, win_req_t *));
-		break;
-	    case ReleaseWindow:
-		retcode = cs_release_window(
-				va_arg(arglist, window_handle_t));
-		break;
-	    case ModifyWindow:
-		wh = va_arg(arglist, window_handle_t);
-		retcode = cs_modify_window(wh,
-				va_arg(arglist, modify_win_t *));
-		break;
-	    case MapMemPage:
-		wh = va_arg(arglist, window_handle_t);
-		retcode = cs_map_mem_page(wh,
-				va_arg(arglist, map_mem_page_t *));
-		break;
-	    case RequestSocketMask:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_request_socket_mask(ch,
-				va_arg(arglist, request_socket_mask_t *));
-		break;
-	    case ReleaseSocketMask:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_release_socket_mask(ch,
-				va_arg(arglist, release_socket_mask_t *));
-		break;
-	    case RequestConfiguration:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_request_configuration(ch,
-				va_arg(arglist, config_req_t *));
-		break;
-	    case GetPhysicalAdapterInfo:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_physical_adapter_info(ch,
-				va_arg(arglist, get_physical_adapter_info_t *));
-		break;
-	    case GetCardServicesInfo:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_cardservices_info(ch,
-				va_arg(arglist, get_cardservices_info_t *));
-		break;
-	    case GetConfigurationInfo:
-		chp = va_arg(arglist, client_handle_t *);
-		retcode = cs_get_configuration_info(chp,
-				va_arg(arglist, get_configuration_info_t *));
-		break;
-	    case ModifyConfiguration:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_modify_configuration(ch,
-				va_arg(arglist, modify_config_t *));
-		break;
-	    case AccessConfigurationRegister:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_access_configuration_register(ch,
-				va_arg(arglist, access_config_reg_t *));
-		break;
-	    case ReleaseConfiguration:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_release_configuration(ch,
-				va_arg(arglist, release_config_t *));
-		break;
-	    case OpenMemory:
-		cmn_err(CE_CONT, "CS: OpenMemory\n");
-		break;
-	    case ReadMemory:
-		cmn_err(CE_CONT, "CS: ReadMemory\n");
-		break;
-	    case WriteMemory:
-		cmn_err(CE_CONT, "CS: WriteMemory\n");
-		break;
-	    case CopyMemory:
-		cmn_err(CE_CONT, "CS: CopyMemory\n");
-		break;
-	    case RegisterEraseQueue:
-		cmn_err(CE_CONT, "CS: RegisterEraseQueue\n");
-		break;
-	    case CheckEraseQueue:
-		cmn_err(CE_CONT, "CS: CheckEraseQueue\n");
-		break;
-	    case DeregisterEraseQueue:
-		cmn_err(CE_CONT, "CS: DeregisterEraseQueue\n");
-		break;
-	    case CloseMemory:
-		cmn_err(CE_CONT, "CS: CloseMemory\n");
-		break;
-	    case GetFirstRegion:
-		cmn_err(CE_CONT, "CS: GetFirstRegion\n");
-		break;
-	    case GetNextRegion:
-		cmn_err(CE_CONT, "CS: GetNextRegion\n");
-		break;
-	    case GetFirstPartition:
-		cmn_err(CE_CONT, "CS: GetFirstPartition\n");
-		break;
-	    case GetNextPartition:
-		cmn_err(CE_CONT, "CS: GetNextPartition\n");
-		break;
-	    case ReturnSSEntry:
-		cmn_err(CE_CONT, "CS: ReturnSSEntry\n");
-		break;
-	    case MapLogSocket:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_map_log_socket(ch,
-				va_arg(arglist, map_log_socket_t *));
-		break;
-	    case MapPhySocket:
-		cmn_err(CE_CONT, "CS: MapPhySocket\n");
-		break;
-	    case MapLogWindow:
-		cmn_err(CE_CONT, "CS: MapLogWindow\n");
-		break;
-	    case MapPhyWindow:
-		cmn_err(CE_CONT, "CS: MapPhyWindow\n");
-		break;
-	    case RegisterMTD:
-		cmn_err(CE_CONT, "CS: RegisterMTD\n");
-		break;
-	    case RegisterTimer:
-		cmn_err(CE_CONT, "CS: RegisterTimer\n");
-		break;
-	    case SetRegion:
-		cmn_err(CE_CONT, "CS: SetRegion\n");
-		break;
-	    case RequestExclusive:
-		cmn_err(CE_CONT, "CS: RequestExclusive\n");
-		break;
-	    case ReleaseExclusive:
-		cmn_err(CE_CONT, "CS: ReleaseExclusive\n");
-		break;
-	    case GetFirstClient:
-		retcode = cs_get_firstnext_client(
-				va_arg(arglist, get_firstnext_client_t *),
-				CS_GET_FIRST_FLAG);
-		break;
-	    case GetNextClient:
-		retcode = cs_get_firstnext_client(
-				va_arg(arglist, get_firstnext_client_t *),
-				CS_GET_NEXT_FLAG);
-		break;
-	    case GetClientInfo:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_client_info(ch,
-				va_arg(arglist, client_info_t *));
-		break;
-	    case AddSocketServices:
-		cmn_err(CE_CONT, "CS: AddSocketServices\n");
-		break;
-	    case ReplaceSocketServices:
-		cmn_err(CE_CONT, "CS: ReplaceSocketServices\n");
-		break;
-	    case VendorSpecific:
-		cmn_err(CE_CONT, "CS: VendorSpecific\n");
-		break;
-	    case AdjustResourceInfo:
-		cmn_err(CE_CONT, "CS: AdjustResourceInfo\n");
-		break;
-	    case ValidateCIS:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_validate_cis(ch,
-				va_arg(arglist, cisinfo_t *));
-		break;
-	    case GetFirstTuple:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_firstnext_tuple(ch,
-				va_arg(arglist, tuple_t *),
-				CS_GET_FIRST_FLAG);
-		break;
-	    case GetNextTuple:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_firstnext_tuple(ch,
-				va_arg(arglist, tuple_t *),
-				CS_GET_NEXT_FLAG);
-		break;
-	    case GetTupleData:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_get_tuple_data(ch,
-				va_arg(arglist, tuple_t *));
-		break;
-	    case ParseTuple:
-		ch = va_arg(arglist, client_handle_t);
-		tuple = va_arg(arglist, tuple_t *);
-		cisparse = va_arg(arglist, cisparse_t *);
-		retcode = cs_parse_tuple(ch, tuple, cisparse,
-				va_arg(arglist, uint_t));
-		break;
-	    case MakeDeviceNode:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_make_device_node(ch,
-				va_arg(arglist, make_device_node_t *));
-		break;
-	    case RemoveDeviceNode:
-		ch = va_arg(arglist, client_handle_t);
-		retcode = cs_remove_device_node(ch,
-				va_arg(arglist, remove_device_node_t *));
-		break;
-	    case ConvertSpeed:
-		retcode = cs_convert_speed(
-				va_arg(arglist, convert_speed_t *));
-		break;
-	    case ConvertSize:
-		retcode = cs_convert_size(
-				va_arg(arglist, convert_size_t *));
-		break;
-	    case Event2Text:
-		retcode = cs_event2text(
-				va_arg(arglist, event2text_t *), 1);
-		break;
-	    case Error2Text: {
-		error2text_t *cft;
-
-		cft = va_arg(arglist, error2text_t *);
-		(void) strcpy(cft->text,
-				cs_error2text(cft->item, CSFUN2TEXT_RETURN));
-		retcode = CS_SUCCESS;
-		}
-		break;
-	    case CS_DDI_Info:
-		retcode = cs_ddi_info(va_arg(arglist, cs_ddi_info_t *));
-		break;
-	    case CS_Sys_Ctl:
-		retcode = cs_sys_ctl(va_arg(arglist, cs_sys_ctl_t *));
-		break;
-	    default:
-		cmn_err(CE_CONT, "CS: {unknown function %d}\n", function);
-		break;
-	} /* switch(function) */
-
-	va_end(arglist);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 127) {
-	    cmn_err(CE_CONT, "CardServices: returning %s (0x%x)\n",
-				cs_error2text(retcode, CSFUN2TEXT_RETURN),
-				retcode);
-	}
-#endif
-
-	return (retcode);
-}
-
-/*
- * ==== tuple and CIS handling section ====
- */
-
-/*
- * cs_parse_tuple - This function supports the CS ParseTuple function call.
- *
- *    returns:	CS_SUCCESS - if tuple parsed sucessfully
- *		CS_NO_CARD - if no card in socket
- *		CS_BAD_ARGS - if passed CIS list pointer is NULL
- *		CS_UNKNOWN_TUPLE - if unknown tuple passed to CIS parser
- *		CS_BAD_CIS - if generic parser error
- *		CS_NO_CIS - if no CIS for card/function
- *
- *    See notes for the cs_get_firstnext_tuple function.
- */
-static int
-cs_parse_tuple(client_handle_t client_handle, tuple_t *tuple,
-				cisparse_t *cisparse, cisdata_t cisdata)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	uint32_t fn;
-	int ret;
-
-	if ((ret = cs_get_socket(client_handle, &tuple->Socket,
-					&fn, &sp, &client)) != CS_SUCCESS)
-	    return (ret);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED))
-	    return (CS_NO_CARD);
-
-	/*
-	 * Sanity check to be sure that we've got a non-NULL CIS list
-	 *	pointer.
-	 */
-	if (!(tuple->CISOffset))
-	    return (CS_BAD_ARGS);
-
-	mutex_enter(&sp->cis_lock);
-
-	/*
-	 * Check to see if there is a valid CIS for this function.
-	 *	There is an implicit assumption here that if this
-	 *	is a multi-function CIS and the specified function
-	 *	number is not CS_GLOBAL_CIS that in order for there
-	 *	to be a valid function-specific CIS, there also must
-	 *	be a valid global CIS. This means that we don't need
-	 *	to know whether this tuple came from the global CIS
-	 *	or from the function-specific CIS.
-	 */
-	if ((sp->cis_flags & CW_VALID_CIS) &&
-				(sp->cis[fn].flags & CW_VALID_CIS)) {
-	    ret = (int)(uintptr_t)CIS_PARSER(CISP_CIS_PARSE_TUPLE,
-				cis_cistpl_std_callout,
-				tuple->CISOffset,
-				(tuple->Attributes & TUPLE_RETURN_NAME)?
-							HANDTPL_RETURN_NAME:
-							HANDTPL_PARSE_LTUPLE,
-				cisparse, cisdata);
-	    mutex_exit(&sp->cis_lock);
-	    if (ret == CISTPLF_UNKNOWN)
-		return (CS_UNKNOWN_TUPLE);
-	    if (ret != CISTPLF_NOERROR)
-		return (CS_BAD_CIS);
-	    ret = CS_SUCCESS;
-	} else {
-	    mutex_exit(&sp->cis_lock);
-	    ret = CS_NO_CIS;
-	} /* if (CW_VALID_CIS) */
-
-	return (ret);
-}
-
-/*
- * cs_get_firstnext_tuple - returns the first/next tuple of the specified type
- *				this is to support the GetFirstTuple and
- *				GetNextTuple function call
- *
- *    flags - one of:
- *		CS_GET_FIRST_FLAG causes function to support GetFirstTuple
- *		CS_GET_NEXT_FLAG causes function to support GetNextTuple
- *
- *	tuple_t->Attributes flags:
- *		TUPLE_RETURN_LINK - XXX Not implemented, see notes below.
- *		TUPLE_RETURN_IGNORED_TUPLES - return tuples with
- *				CISTPLF_IGNORE_TUPLE set in the
- *				cistpl_t->flags member.
- *
- *    Notes for regular PC card driver callers:
- *
- *	On a single-function card, the caller will get back all the tuples in
- *	the CIS.
- *
- *	On a multi-function card, the caller will get the tuples from the
- *	global CIS followed by the tuples in the function-specific CIS. The
- *	caller will not get any tuples from a function-specific CIS that
- *	does not belong to the caller's function.
- *
- *    Notes for Socket Services, the "super-client" or CSI driver callers:
- *
- *	On a single-function card, the operation is the same as for regular
- *	PC card driver callers with the addition that if the function number
- *	is set to CS_GLOBAL_CIS this function will return CS_NO_CIS.
- *
- *	On a multi-function card, the operation is the same as for regular
- *	PC card driver callers with the addition that if the function number
- *	is set to CS_GLOBAL_CIS the caller will only get tuples from the
- *	global CIS. If a particular function nubmer does not exist, this
- *	function will return CS_NO_CIS for that function.
- *
- *    General notes:
- *
- *	On both a single-function card and a multi-function card, if the tuple
- *	comes from the global CIS chain, the CISTPLF_GLOBAL_CIS flag will be
- *	set in the tuple_t->flags member.
- *
- *	On a multi-function card, if the tuple comes from the function-specific
- *	CIS chain, the CISTPLF_MF_CIS flag will be set in the tuple_t->flags
- *	member.
- *
- *	For other flags that are set in the tuple_t->flags member, see the
- *	comments for the cis_list_lcreate function in the cis.c file.
- *
- *	The CIS parser may not include all the tuples that are in the CIS in
- *	the private CIS list that it creates and maintains. See the CIS
- *	parser documentation for a list of tuples that the parser does not
- *	include in the list.
- *
- *	If a tuple has the CISTPLF_IGNORE_TUPLE flag set and the flags
- *	parameter CIS_GET_LTUPLE_IGNORE is not set, that tuple will not
- *	be returned to the caller. Instead, the next tuple that matches
- *	the calling criteria will be returned (or NULL if no other tuples
- *	match the calling criteria). If CIS_GET_LTUPLE_IGNORE is set in
- *	the flags paramter, tuples in the CIS list that match the calling
- *	criteria will be returned.
- *
- * XXX The PC Card 95 Standard says that if the TUPLE_RETURN_LINK flag in
- *	the tuple_t->Attributes member is not set, then we don't return
- *	any of the link tuples. This function ignores this flag and always
- *	returns link tuples.
- *
- *    Return codes:
- *		CS_SUCCESS - if tuple sucessfully found and returned
- *		CS_NO_CARD - if no card inserted
- *		CS_NO_CIS - if no CIS for the specified card/function
- *		CS_NO_MORE_ITEMS - if tuple not found or no more tuples
- *					to return
- *
- *    See notes for cs_get_socket for a description of valid client, socket
- *	and function number combinations.
- */
-static int
-cs_get_firstnext_tuple(client_handle_t client_handle,
-    tuple_t *tuple, uint32_t flags)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	uint32_t fn;
-	int ret;
-
-	if ((ret = cs_get_socket(client_handle, &tuple->Socket, &fn,
-						&sp, &client)) != CS_SUCCESS)
-	    return (ret);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED))
-	    return (CS_NO_CARD);
-
-	mutex_enter(&sp->cis_lock);
-
-	/*
-	 * If there's no CIS on this card or no CIS for the specified
-	 *	function, then we can't do much.
-	 */
-	if ((!(sp->cis_flags & CW_VALID_CIS)) ||
-				(!(sp->cis[fn].flags & CW_VALID_CIS))) {
-	    mutex_exit(&sp->cis_lock);
-	    return (CS_NO_CIS);
-	}
-
-	/*
-	 * This will set the CIS_GET_LTUPLE_IGNORE flag if the
-	 *	TUPLE_RETURN_IGNORED_TUPLES flag is set. The
-	 *	assumption here is that the CIS_GET_LTUPLE_IGNORE
-	 *	flag and the TUPLE_RETURN_IGNORED_TUPLES flag
-	 *	shares the same bit position. If this ever changes,
-	 *	we'll ahve to re-work this section of code.
-	 */
-	if (tuple->Attributes & TUPLE_RETURN_IGNORED_TUPLES)
-	    flags |= CIS_GET_LTUPLE_IGNORE;
-
-	/*
-	 * Are we GetFirstTuple or GetNextTuple?
-	 */
-	if ((flags & CIS_GET_LTUPLE_OPMASK) & CS_GET_FIRST_FLAG) {
-	/*
-	 * Initialize the tuple structure; we need this information when
-	 *	we have to process a GetNextTuple or ParseTuple call.
-	 * If this card has a multi-function CIS, then we always start out
-	 *	delivering tuples from the global CIS chain. If this card does
-	 *	not have a multi-function CIS, then the function 0 CIS chain
-	 *	will contain the complete CIS list.
-	 * If this is a multi-function card, then use the GET_FIRST_LTUPLE
-	 *	macro to return the first tuple in the CIS list - we do this
-	 *	since we don't want to return tuples with CISTPLF_IGNORE_TUPLE
-	 *	set unless CIS_GET_LTUPLE_IGNORE is set in the flags parameter.
-	 * Note that we don't have to cross over into the fucntion-specific
-	 *	CIS chain if GET_FIRST_LTUPLE returns NULL, since a MF CIS will
-	 *	always have at least a CISTPL_LONGLINK_MFC tuple in the global
-	 *	CIS chain - the test for NULL is just a sanity check.
-	 */
-	    if (sp->cis_flags & CW_MULTI_FUNCTION_CIS) {
-		if ((tuple->CISOffset =
-			GET_FIRST_LTUPLE(sp->cis[CS_GLOBAL_CIS].cis,
-							flags)) == NULL) {
-		    mutex_exit(&sp->cis_lock);
-		    return (CS_NO_MORE_ITEMS);
-		} /* GET_FIRST_LTUPLE */
-	    } else {
-		tuple->CISOffset = sp->cis[0].cis;
-	    } /* CW_MULTI_FUNCTION_CIS */
-	} else {
-	    cistpl_t *tp;
-
-		/*
-		 * Check to be sure that we have a non-NULL tuple list pointer.
-		 *	This is necessary in the case where the caller calls us
-		 *	with get next tuple requests but we don't have any more
-		 *	tuples to give back.
-		 */
-	    if (tuple->CISOffset == NULL) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_NO_MORE_ITEMS);
-	    }
-
-		/*
-		 * Point to the next tuple in the list.  If we're searching for
-		 *	a particular tuple, FIND_LTUPLE_FWD will find it.
-		 *
-		 * If there are no more tuples in the chain that we're looking
-		 *	at, then if we're looking at the global portion of a
-		 *	multi-function CIS, switch to the function-specific list
-		 *	and start looking there.
-		 */
-	    if ((tp = GET_NEXT_TUPLE(tuple->CISOffset, flags)) == NULL) {
-		if (sp->cis_flags & CW_MULTI_FUNCTION_CIS) {
-		    if ((tuple->CISOffset->flags & CISTPLF_GLOBAL_CIS) &&
-							(fn != CS_GLOBAL_CIS)) {
-			tp = GET_FIRST_LTUPLE(sp->cis[fn].cis, flags);
-		    } /* CISTPLF_GLOBAL_CIS */
-		} /* CW_MULTI_FUNCTION_CIS */
-	    } /* GET_NEXT_TUPLE */
-
-		/*
-		 * If there are no more tuples in the chain, then return.
-		 */
-	    if ((tuple->CISOffset = tp) == NULL) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_NO_MORE_ITEMS);
-	    }
-	} /* CS_GET_FIRST_FLAG */
-
-	/*
-	 * Check if we want to get the first of a particular type of tuple
-	 *	or just the first tuple in the chain.
-	 * If there are no more tuples of the type we're searching for in
-	 *	the chain that we're looking at, then if we're looking at
-	 *	the global portion of a multi-function CIS, switch to the
-	 *	function-specific list and start looking there.
-	 */
-	if (tuple->DesiredTuple != RETURN_FIRST_TUPLE) {
-	    cistpl_t *tp;
-
-	    if ((tp = FIND_LTUPLE_FWD(tuple->CISOffset,
-					tuple->DesiredTuple, flags)) == NULL) {
-		if (sp->cis_flags & CW_MULTI_FUNCTION_CIS) {
-		    if ((tuple->CISOffset->flags & CISTPLF_GLOBAL_CIS) &&
-							(fn != CS_GLOBAL_CIS)) {
-			tp = FIND_FIRST_LTUPLE(sp->cis[fn].cis,
-						tuple->DesiredTuple, flags);
-		    } /* CISTPLF_GLOBAL_CIS */
-		} /* CW_MULTI_FUNCTION_CIS */
-	    } /* FIND_LTUPLE_FWD */
-
-		/*
-		 * If there are no more tuples in the chain, then return.
-		 */
-	    if ((tuple->CISOffset = tp) == NULL) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_NO_MORE_ITEMS);
-	    }
-	} /* !RETURN_FIRST_TUPLE */
-
-	/*
-	 * We've got a tuple, now fill out the rest of the tuple_t
-	 *	structure.  Callers can use the flags member to
-	 *	determine whether or not the tuple data was copied
-	 *	to the linked list or if it's still on the card.
-	 */
-	tuple->Flags = tuple->CISOffset->flags;
-	tuple->TupleCode = tuple->CISOffset->type;
-	tuple->TupleLink = tuple->CISOffset->len;
-	tuple->TupleDataLen = tuple->CISOffset->len;
-
-	mutex_exit(&sp->cis_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_get_tuple_data - get the data portion of a tuple; this is to
- *	support the GetTupleData function call.
- *
- *    Note that if the data body of a tuple was not read from the CIS,
- *	then this function will return CS_NO_MORE_ITEMS.
- *
- *    For flags that are set in the tuple_t->flags member, see the
- *	comments for the cis_list_lcreate function in the cis.c file.
- *	These flags are copied into the tuple_t->flags member by the
- *	cs_get_firstnext_tuple function call.
- *
- *    See notes for the cs_get_firstnext_tuple function.
- */
-static int
-cs_get_tuple_data(client_handle_t client_handle, tuple_t *tuple)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int ret, nbytes;
-	uint32_t fn, flags;
-	cisdata_t *tsd, *tdd;
-	uint32_t newoffset;
-	acc_handle_t cis_handle;
-
-	if ((ret = cs_get_socket(client_handle, &tuple->Socket, &fn,
-						&sp, &client)) != CS_SUCCESS)
-	    return (ret);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED))
-	    return (CS_NO_CARD);
-
-	mutex_enter(&sp->cis_lock);
-
-	if ((sp->cis_flags & CW_VALID_CIS) &&
-				(sp->cis[fn].flags & CW_VALID_CIS)) {
-
-		/*
-		 * Check to be sure that we have a non-NULL pointer to
-		 *	a CIS list.
-		 */
-	    if (!(tuple->CISOffset)) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_NO_MORE_ITEMS);
-	    }
-
-	/*
-	 * Since the tuple data buffer that the caller calls us with
-	 *	is preallocated in the tuple_t structure, we ignore any
-	 *	TupleDataMax value that the caller has setup and use the
-	 *	actual size of the tuple data buffer in the structure.
-	 */
-	    tuple->TupleDataMax = sizeof (tuple->TupleData);
-
-	/*
-	 * Make sure the requested offset is not past the end of the
-	 *	tuple data body nor past the end of the user-supplied
-	 *	buffer.
-	 */
-	    if ((int)tuple->TupleOffset >= min((int)tuple->TupleLink,
-						(int)tuple->TupleDataMax)) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_NO_MORE_ITEMS);
-	    }
-
-	    tuple->TupleDataLen = tuple->TupleLink;
-
-	    if ((nbytes = min((int)tuple->TupleDataMax -
-						(int)tuple->TupleOffset,
-						(int)tuple->TupleDataLen -
-						(int)tuple->TupleOffset)) < 1) {
-		mutex_exit(&sp->cis_lock);
-		return (CS_BAD_ARGS);
-	    }
-
-	/*
-	 * The tuple data destination is always the tuple_t->TupleData
-	 *	buffer in the tuple_t structure no matter where we read the
-	 *	tuple data from.
-	 */
-	    tdd = tuple->TupleData;
-	    bzero((caddr_t)tdd, sizeof (tuple->TupleData));
-
-	/*
-	 * Do we have a copy of the tuple data?  If not, we have to
-	 *	get a pointer to the CIS and read the tuple data from the
-	 *	card itself.
-	 */
-	    switch (tuple->CISOffset->flags & CISTPLF_SPACE_MASK) {
-		case CISTPLF_LM_SPACE:
-		    tsd = (tuple->CISOffset->data +
-					(unsigned)tuple->TupleOffset);
-		    while (nbytes--)
-			*tdd++ = *tsd++;
-		    break;
-		case CISTPLF_AM_SPACE:
-		case CISTPLF_CM_SPACE:
-		    newoffset = tuple->CISOffset->offset;
-
-		/*
-		 * Setup the proper space flags as well as setup the
-		 *	address offset to point to the start of the tuple
-		 *	data area; we need to do the latter since the
-		 *	cis_store_cis_addr function in cis.c sets up the
-		 *	tuple->CISOffset->offset offset to point to the
-		 *	start of the tuple.
-		 */
-		    if (tuple->CISOffset->flags & CISTPLF_AM_SPACE) {
-			flags = CISTPLF_AM_SPACE;
-			newoffset += ((tuple->TupleOffset * 2) + 4);
-		    } else {
-			flags = CISTPLF_CM_SPACE;
-			newoffset += (tuple->TupleOffset + 2);
-		    }
-
-		    if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-							flags) != CS_SUCCESS) {
-			mutex_exit(&sp->cis_lock);
-			cmn_err(CE_CONT, "cs_get_tuple_data: socket %d "
-						"can't init CIS window\n",
-							sp->socket_num);
-			return (CS_GENERAL_FAILURE);
-		    } /* cs_init_cis_window */
-		    while (nbytes--) {
-			*tdd++ = csx_Get8(cis_handle, newoffset++);
-			if (tuple->CISOffset->flags & CISTPLF_AM_SPACE)
-			    newoffset++;
-		    } /* while */
-		    break;
-		default:
-		    mutex_exit(&sp->cis_lock);
-		    return (CS_GENERAL_FAILURE);
-	    } /* switch */
-
-	    ret = CS_SUCCESS;
-	} else {
-	    ret = CS_NO_CIS;
-	} /* if (CW_VALID_CIS) */
-
-	mutex_exit(&sp->cis_lock);
-
-	return (ret);
-}
-
-/*
- * cs_validate_cis - validates the CIS on a card in the given socket; this
- *			is to support the ValidateCIS function call.
- *
- *    Notes for regular PC card driver callers:
- *
- *	Regular PC card drivers calling ValidateCIS will get the meaning of
- *	the structure members as specified in the standard.
- *
- *    Notes for Socket Services, the "super-client" or CSI driver callers:
- *
- *		with: Function Number = CS_GLOBAL_CIS
- *
- *	For a single-function card, CS_NO_CIS will be returned and the
- *	cisinfo_t->Chains and cisinfo_t->Tuples members will be set to 0.
- *
- *	For a multi-function card, cisinfo_t->Chains will contain a count of
- *	the number of CIS chains in the global portion of the CIS, and
- *	cisinfo_t->Tuples will contain a count of the number of tuples in
- *	the global portion of the CIS.
- *
- *		with: 0 <= Function Number < CIS_MAX_FUNCTIONS
- *
- *	For a single-function card, if the function number is equal to 0 and
- *	has a CIS, cisinfo_t->Chains will contain a count of the number of
- *	CIS chains in the CIS, and cisinfo_t->Tuples will contain a count of
- *	the number of tuples in the CIS. If the card does not have a CIS, or
- *	if the function number is not equal to 0, CS_NO_CIS will be returned
- *	and the cisinfo_t->Chains and cisinfo_t->Tuples members will be set
- *	to 0.
- *
- *	For a multi-function card, cisinfo_t->Chains will contain a count of
- *	the number of CIS chains in the global and function-specific
- *	portions of the CIS, and cisinfo_t->Tuples will contain a count of
- *	the number of tuples in the global and function-specific portions of
- *	the CIS. If the function does not exist or has no CIS, CS_NO_CIS
- *	will be returned and the cisinfo_t->Chains and cisinfo_t->Tuples
- *	members will be set to 0.
- *
- *    General notes:
- *
- *	If the card does not have a CIS, or if the function does not exist
- *	or has no CIS, CS_NO_CIS will be returned and the cisinfo_t->Chains
- *	and cisinfo_t->Tuples members will be set to 0.
- *
- *	Most of the work of validating the CIS has already been done by the
- *	CIS parser module, so we don't have to do much here except for
- *	looking at the various flags and tuple/chain counts that were already
- *	setup by the CIS parser.
- *
- *    See notes for the cs_get_firstnext_tuple function.
- */
-static int
-cs_validate_cis(client_handle_t client_handle, cisinfo_t *cisinfo)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	uint32_t fn;
-	int ret;
-
-	if ((ret = cs_get_socket(client_handle, &cisinfo->Socket, &fn,
-						&sp, &client)) != CS_SUCCESS)
-	    return (ret);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED))
-	    return (CS_NO_CARD);
-
-	mutex_enter(&sp->cis_lock);
-	if ((sp->cis_flags & CW_VALID_CIS) &&
-				(sp->cis[fn].flags & CW_VALID_CIS)) {
-	    cisinfo->Chains = sp->cis[fn].nchains;
-	    cisinfo->Tuples = sp->cis[fn].ntuples;
-
-	    if ((fn != CS_GLOBAL_CIS) &&
-			(sp->cis[CS_GLOBAL_CIS].flags & CW_VALID_CIS)) {
-		cisinfo->Chains += sp->cis[CS_GLOBAL_CIS].nchains;
-		cisinfo->Tuples += sp->cis[CS_GLOBAL_CIS].ntuples;
-	    } /* !CS_GLOBAL_CIS */
-
-	    ret = CS_SUCCESS;
-	} else {
-	    cisinfo->Chains = 0;
-	    cisinfo->Tuples = 0;
-	    ret = CS_NO_CIS;
-	}
-	mutex_exit(&sp->cis_lock);
-
-	return (ret);
-}
-
-/*
- * cs_init_cis_window - initializes the CIS window for the passed socket
- *
- *	calling: *sp - pointer to the per-socket structure
- *		 *offset - offset from start of AM or CM space
- *		 *hp - pointer to acc_handle_t to store modified
- *				window access handle in
- *		 flags - one of:
- *				CISTPLF_AM_SPACE - set window to AM space
- *				CISTPLF_CM_SPACE - set window to CM space
- *
- *	returns: CS_SUCCESS if CIS window was set up
- *		 *offset - contains adjusted offset to use to access
- *				requested space
- *		 CS_BAD_WINDOW if CIS window could not be setup
- *		 CS_GENERAL_FAILURE if socket has a CIS window number
- *					but the window flags are wrong
- *
- *	Note: This function will check to be sure that there is a valid
- *		CIS window allocated to this socket.
- *	      If there is an error in setting up the window hardware, the
- *		CIS window information for this socket is cleared.
- *	      This function is also used by routines that need to get
- *		a pointer to the base of AM space to access the card's
- *		configuration registers.
- *	      The passed offset is the un-window-size-aligned offset.
- */
-int
-cs_init_cis_window(cs_socket_t *sp, uint32_t *offset,
-    acc_handle_t *hp, uint32_t flags)
-{
-	set_window_t sw;
-	get_window_t gw;
-	inquire_window_t iw;
-	set_page_t set_page;
-	cs_window_t *cw;
-
-	/*
-	 * Check to be sure that we have a valid CIS window
-	 */
-	if (!SOCKET_HAS_CIS_WINDOW(sp)) {
-	    cmn_err(CE_CONT,
-			"cs_init_cis_window: socket %d has no CIS window\n",
-				sp->socket_num);
-	    return (CS_BAD_WINDOW);
-	}
-
-	/*
-	 * Check to be sure that this window is allocated for CIS use
-	 */
-	if ((cw = cs_get_wp(sp->cis_win_num)) == NULL)
-	    return (CS_BAD_WINDOW);
-
-	if (!(cw->state & CW_CIS)) {
-	    cmn_err(CE_CONT,
-		"cs_init_cis_window: socket %d invalid CIS window state 0x%x\n",
-				sp->socket_num, cw->state);
-	    return (CS_BAD_WINDOW);
-	}
-
-	/*
-	 * Get the characteristics of this window - we use this to
-	 *	determine whether we need to re-map the window or
-	 *	just move the window offset on the card.
-	 */
-	iw.window = sp->cis_win_num;
-	SocketServices(SS_InquireWindow, &iw);
-
-	/*
-	 * We've got a window, now set up the hardware. If we've got
-	 *	a variable sized window, then all we need to do is to
-	 *	get a valid mapping to the base of the window using
-	 *	the current window size; if we've got a fixed-size
-	 *	window, then we need to get a mapping to the window
-	 *	starting at offset zero of the window.
-	 */
-	if (iw.mem_win_char.MemWndCaps & WC_SIZE) {
-	    sw.WindowSize = sp->cis_win_size;
-	    set_page.offset = ((*offset / sp->cis_win_size) *
-						sp->cis_win_size);
-	} else {
-	    set_page.offset = ((*offset / iw.mem_win_char.MinSize) *
-						iw.mem_win_char.MinSize);
-	    sw.WindowSize = (((*offset & ~(PAGESIZE - 1)) &
-					(set_page.offset - 1)) + PAGESIZE);
-	}
-
-	/*
-	 * Return a normalized base offset; this takes care of the case
-	 *	where the required offset is greater than the window size.
-	 * BugID 1236404
-	 *	code was:
-	 *		*offset = *offset & (set_page.offset - 1);
-	 */
-	*offset = *offset - set_page.offset;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 1)
-	    cmn_err(CE_CONT, "cs_init_cis_window: WindowSize 0x%x "
-							"offset 0x%x\n",
-							(int)sw.WindowSize,
-							(int)set_page.offset);
-	if (cs_debug > 1)
-	    cmn_err(CE_CONT, "\t*offset = 0x%x space = %s\n",
-							(int)*offset,
-					(flags & CISTPLF_AM_SPACE)?
-					"CISTPLF_AM_SPACE":"CISTPLF_CM_SPACE");
-#endif
-
-	sw.window = sp->cis_win_num;
-	sw.socket = sp->socket_num;
-	sw.state = (WS_ENABLED | WS_EXACT_MAPIN);
-	sw.attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-	sw.attr.devacc_attr_endian_flags = DDI_NEVERSWAP_ACC;
-	sw.attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-
-	/*
-	 * The PCMCIA SS spec specifies this be expressed in
-	 *	a device speed format per 5.2.7.1.3 but
-	 *	our implementation of SS_SetWindow uses
-	 *	actual nanoseconds.
-	 */
-	sw.speed = CIS_DEFAULT_SPEED;
-	sw.base = 0;
-	/*
-	 * Set up the window - if this fails, then just set the
-	 *	CIS window number back to it's initialized value so
-	 *	that we'll fail when we break out of the loop.
-	 */
-	if (SocketServices(SS_SetWindow, &sw) != SUCCESS) {
-	    sp->cis_win_num = PCMCIA_MAX_WINDOWS;
-	    cw->state = 0; /* XXX do we really want to do this? */
-	    return (CS_BAD_WINDOW);
-	} else {
-		set_page.window = sp->cis_win_num;
-		set_page.page = 0;
-		set_page.state = PS_ENABLED;
-		if (flags & CISTPLF_AM_SPACE)
-		    set_page.state |= PS_ATTRIBUTE;
-
-		if (SocketServices(SS_SetPage, &set_page) != SUCCESS) {
-		    sp->cis_win_num = PCMCIA_MAX_WINDOWS;
-		    cw->state = 0; /* XXX do we really want to do this? */
-		    return (CS_BAD_WINDOW);
-		} /* if (SS_SetPage) */
-	} /* if (SS_SetWindow) */
-
-	/*
-	 * Get the window information for the CIS window for this socket.
-	 */
-	gw.window = sp->cis_win_num;
-	gw.socket = sp->socket_num; /* XXX - SS_GetWindow should set this */
-	if (SocketServices(SS_GetWindow, &gw) != SUCCESS)
-	    return (CS_BAD_WINDOW);
-
-	*hp = (acc_handle_t)gw.handle;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== client registration/deregistration section ====
- */
-
-/*
- * cs_register_client - This supports the RegisterClient call.
- *
- * Upon successful registration, the client_handle_t * handle argument will
- *	contain the new client handle and we return CS_SUCCESS.
- */
-static int
-cs_register_client(client_handle_t *ch, client_reg_t *cr)
-{
-	uint32_t sn;
-	int super_client = 0;
-	sclient_reg_t *scr = cr->priv;
-	struct sclient_list_t *scli;
-
-	/*
-	 * See if we're not supposed to register any new clients.
-	 */
-	if (cs_globals.init_state & GLOBAL_INIT_STATE_NO_CLIENTS)
-	    return (CS_OUT_OF_RESOURCE);
-
-	/*
-	 * Do a version check - if the client expects a later version of
-	 *	Card Services than what we are, return CS_BAD_VERSION.
-	 * XXX - How do we specify just a PARTICULAR version of CS??
-	 */
-	if (CS_VERSION < cr->Version)
-	    return (CS_BAD_VERSION);
-
-	/*
-	 * Check to be sure that the client has given us a valid set of
-	 *	client type flags.  We also use this opportunity to see
-	 *	if the registering client is Socket Services or is a
-	 *	"super-client" or a CSI client.
-	 *
-	 * Note that SS can not set any flag in the Attributes field other
-	 *	than the INFO_SOCKET_SERVICES flag.
-	 *
-	 * Valid combinations of cr->Attributes and cr->EventMask flags:
-	 *
-	 *  for Socket Services:
-	 *	cr->Attributes:
-	 *	    set:
-	 *		INFO_SOCKET_SERVICES
-	 *	    clear:
-	 *		{all other flags}
-	 *	cr->EventMask:
-	 *	    don't care:
-	 *		{all flags}
-	 *
-	 *  for regular clients:
-	 *	cr->Attributes:
-	 *	    only one of:
-	 *		INFO_IO_CLIENT
-	 *		INFO_MTD_CLIENT
-	 *		INFO_MEM_CLIENT
-	 *	    don't care:
-	 *		INFO_CARD_SHARE
-	 *		INFO_CARD_EXCL
-	 *	cr->EventMask:
-	 *	    clear:
-	 *		CS_EVENT_ALL_CLIENTS
-	 *	    don't care:
-	 *		{all other flags}
-	 *
-	 *  for CSI clients:
-	 *	cr->Attributes:
-	 *	    set:
-	 *		INFO_IO_CLIENT
-	 *		INFO_CSI_CLIENT
-	 *	    clear:
-	 *		INFO_MTD_CLIENT
-	 *		INFO_MEM_CLIENT
-	 *	    don't care:
-	 *		INFO_CARD_SHARE
-	 *		INFO_CARD_EXCL
-	 *	cr->EventMask:
-	 *	    don't care:
-	 *		{all flags}
-	 *
-	 *  for "super-clients":
-	 *	cr->Attributes:
-	 *	    set:
-	 *		INFO_IO_CLIENT
-	 *		INFO_MTD_CLIENT
-	 *		INFO_SOCKET_SERVICES
-	 *		INFO_CARD_SHARE
-	 *	    clear:
-	 *		INFO_MEM_CLIENT
-	 *		INFO_CARD_EXCL
-	 *	cr->EventMask:
-	 *	    don't care:
-	 *		{all flags}
-	 */
-	switch (cr->Attributes & INFO_CLIENT_TYPE_MASK) {
-	/*
-	 * Check first to see if this is Socket Services registering; if
-	 *	so, we don't do anything but return the client handle that is
-	 *	in the global SS client.
-	 */
-	    case INFO_SOCKET_SERVICES:
-		*ch = cs_socket_services_client.client_handle;
-		return (CS_SUCCESS);
-		/* NOTREACHED */
-	    /* CSI clients */
-	    case (INFO_CSI_CLIENT | INFO_IO_CLIENT):
-		break;
-	    /* regular clients */
-	    case INFO_IO_CLIENT:
-	    case INFO_MTD_CLIENT:
-	    case INFO_MEM_CLIENT:
-		if (cr->EventMask & CS_EVENT_ALL_CLIENTS)
-		    return (CS_BAD_ATTRIBUTE);
-		break;
-	    /* "super-client" clients */
-	    case (INFO_IO_CLIENT | INFO_MTD_CLIENT | INFO_SOCKET_SERVICES):
-		if ((!(cr->Attributes & INFO_CARD_SHARE)) ||
-				(cr->Attributes & INFO_CARD_EXCL))
-		    return (CS_BAD_ATTRIBUTE);
-		/*
-		 * We only allow one "super-client" per system.
-		 */
-		mutex_enter(&cs_globals.global_lock);
-		if (cs_globals.flags & GLOBAL_SUPER_CLIENT_REGISTERED) {
-		    mutex_exit(&cs_globals.global_lock);
-		    return (CS_NO_MORE_ITEMS);
-		}
-		cs_globals.flags |= GLOBAL_SUPER_CLIENT_REGISTERED;
-		mutex_exit(&cs_globals.global_lock);
-		super_client = CLIENT_SUPER_CLIENT;
-		break;
-	    default:
-		return (CS_BAD_ATTRIBUTE);
-	} /* switch (cr->Attributes) */
-
-	/*
-	 * Now, actually create the client node on the socket; this will
-	 *	also return the new client handle if there were no errors
-	 *	creating the client node.
-	 * The DIP2SOCKET_NUM macro will return the socket and function
-	 *	number using the encoding specified in the cs_priv.h file.
-	 */
-	if (super_client != CLIENT_SUPER_CLIENT) {
-	    if (cr->Attributes & INFO_CSI_CLIENT)
-		sn = (uint32_t)(uintptr_t)cr->priv;
-	    else
-		sn = DIP2SOCKET_NUM(cr->dip);
-	    return (cs_add_client_to_socket(sn, ch, cr, super_client));
-	} /* CLIENT_SUPER_CLIENT */
-
-	/*
-	 * This registering client is a "super-client", so we create one
-	 *	client node for each socket in the system.  We use the
-	 *	client_reg_t.priv structure member to point to a struct
-	 *	that the "super-client" client knows about.  The client
-	 *	handle pointer is not used in this case.
-	 * We return CS_SUCCESS if at least one client node could be
-	 *	created.  The client must check the error codes in the
-	 *	error code array to determine which clients could not
-	 *	be created on which sockets.
-	 * We return CS_BAD_HANDLE if no client nodes could be created.
-	 */
-	scr->num_clients = 0;
-	scr->max_socket_num = cs_globals.max_socket_num;
-	scr->num_sockets = cs_globals.num_sockets;
-	scr->num_windows = cs_globals.num_windows;
-
-	*(scr->sclient_list) = cs_globals.sclient_list;
-
-	for (sn = 0; sn < scr->num_sockets; sn++) {
-	    scli = scr->sclient_list[sn];
-	    if ((scli->error = cs_add_client_to_socket(sn, &scli->client_handle,
-					    cr, super_client)) == CS_SUCCESS) {
-		scr->num_clients++;
-	    }
-	}
-
-	/*
-	 * If we couldn't create any client nodes at all, then
-	 *	return an error.
-	 */
-	if (!scr->num_clients) {
-	/*
-	 * XXX - The global superclient lock now gets
-	 * cleared in cs_deregister_client
-	 */
-	    /* cs_clear_superclient_lock(super_client); */
-	    return (CS_BAD_HANDLE);
-	}
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_add_client_to_socket - this function creates the client node on the
- *				requested socket.
- *
- * Note that if we return an error, there is no state that can be cleaned
- *	up.  The only way that we can return an error with allocated resources
- *	would be if one of the client handle functions had an internal error.
- *	Since we wouldn't get a valid client handle in this case anyway, there
- *	would be no way to find out what was allocated and what wasn't.
- */
-static int
-cs_add_client_to_socket(unsigned sn, client_handle_t *ch,
-					client_reg_t *cr, int super_client)
-{
-	cs_socket_t *sp;
-	client_t *client, *cclp;
-	int error, cie = 1;
-	int client_lock_acquired;
-
-	if (cr->event_handler == NULL)
-	    return (CS_BAD_ARGS);
-
-	if ((sp = cs_get_sp(sn)) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 * Run through all of the registered clients and compare the passed
-	 *	dip to the dip of each client to make sure that this client
-	 *	is not trying to register more than once.  If they are, then
-	 *	display a message and return an error.
-	 * XXX - we should really check all the sockets in case the client
-	 *	manipulates the instance number in the dip.
-	 * XXX - if we check each socket, we ned to also check for the
-	 *	"super-client" since it will use the same dip for all
-	 *	of it's client nodes.
-	 */
-	mutex_enter(&sp->lock);
-	client = sp->client_list;
-	while (client) {
-	    if (!(cr->Attributes & INFO_CSI_CLIENT) &&
-						(client->dip == cr->dip)) {
-		mutex_exit(&sp->lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		cmn_err(CE_CONT, "cs_add_client_to_socket: socket %d "
-					"function 0x%x\n"
-					"\tclient already registered with "
-					"handle 0x%x\n",
-						(int)CS_GET_SOCKET_NUMBER(sn),
-						(int)CS_GET_FUNCTION_NUMBER(sn),
-						(int)client->client_handle);
-		return (CS_BAD_HANDLE);
-	    }
-	    client = client->next;
-	} /* while (client) */
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Create a unique client handle then make sure that we can find it.
-	 *	This has the side effect of getting us a pointer to the
-	 *	client structure as well.
-	 * Create a client list entry - cs_create_client_handle will use this
-	 *	as the new client node.
-	 * We do it here so that we can grab the sp->lock mutex for the
-	 *	duration of our manipulation of the client list.
-	 * If this function fails, then it will not have added the newly
-	 *	allocated client node to the client list on this socket,
-	 *	so we have to free the node that we allocated.
-	 */
-	cclp = (client_t *)kmem_zalloc(sizeof (client_t), KM_SLEEP);
-
-	mutex_enter(&sp->lock);
-	if (!(*ch = cs_create_client_handle(sn, cclp))) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    kmem_free(cclp, sizeof (client_t));
-	    return (CS_OUT_OF_RESOURCE);
-	}
-
-	/*
-	 *  Make sure that this is a valid client handle.  We should never
-	 *	fail this since we just got a valid client handle.
-	 * If this fails, then we have an internal error so don't bother
-	 *	trying to clean up the allocated client handle since the
-	 *	whole system is probably hosed anyway and will shortly
-	 *	esplode.
-	 * It doesn't make sense to call cs_deregister_client at this point
-	 *	to clean up this broken client since the deregistration
-	 *	code will also call cs_find_client and most likely fail.
-	 */
-	if (!(client = cs_find_client(*ch, &error))) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    cmn_err(CE_CONT, "cs_add_client_to_socket: socket %d function 0x%x "
-				"invalid client handle created handle 0x%x\n",
-						(int)CS_GET_SOCKET_NUMBER(sn),
-						(int)CS_GET_FUNCTION_NUMBER(sn),
-						(int)*ch);
-	    return (error);
-	}
-
-	/*
-	 * Save the DDI information.
-	 */
-	client->dip = cr->dip;
-	cr->driver_name[MODMAXNAMELEN - 1] = NULL;
-	client->driver_name = (char *)kmem_zalloc(strlen(cr->driver_name) + 1,
-								KM_SLEEP);
-	(void) strcpy(client->driver_name, cr->driver_name);
-	client->instance = ddi_get_instance(cr->dip);
-
-	/*
-	 * Copy over the interesting items that the client gave us.
-	 */
-	client->flags = (cr->Attributes & INFO_CLIENT_TYPE_MASK);
-	client->event_callback_handler = cr->event_handler;
-	bcopy((caddr_t)&cr->event_callback_args,
-				(caddr_t)&client->event_callback_args,
-				sizeof (event_callback_args_t));
-	/*
-	 * Set the client handle since the client needs a client handle
-	 *	when they call us for their event handler.
-	 */
-	client->event_callback_args.client_handle = *ch;
-
-	/*
-	 * Initialize the IO window numbers; if an IO window number is equal
-	 *	to PCMCIA_MAX_WINDOWS it means that IO range is not in use.
-	 */
-	client->io_alloc.Window1 = PCMCIA_MAX_WINDOWS;
-	client->io_alloc.Window2 = PCMCIA_MAX_WINDOWS;
-
-	/*
-	 * Give the client the iblock and idevice cookies to use in
-	 *	the client's event handler high priority mutex.
-	 */
-	cr->iblk_cookie = sp->iblk;
-	cr->idev_cookie = sp->idev;
-
-	/*
-	 * Set up the global event mask information; we copy this directly
-	 *	from the client; since we are the only source of events,
-	 *	any bogus bits that the client puts in here won't matter
-	 *	because we'll never look at them.
-	 */
-	client->global_mask = cr->EventMask;
-
-	/*
-	 * If this client registered as a CSI client, set the appropriate
-	 *	flag in the client's flags area.
-	 */
-	if (cr->Attributes & INFO_CSI_CLIENT)
-	    client->flags |= CLIENT_CSI_CLIENT;
-
-	/*
-	 * If this client registered as a "super-client" set the appropriate
-	 *	flag in the client's flags area.
-	 */
-	if (super_client == CLIENT_SUPER_CLIENT)
-	    client->flags |= CLIENT_SUPER_CLIENT;
-
-	/*
-	 * Save other misc information that this client gave us - it is
-	 *	used in the GetClientInfo function.
-	 */
-	client->flags |= (cr->Attributes & INFO_CARD_FLAGS_MASK);
-
-	/*
-	 * Determine if we should give artificial card insertion events and
-	 *	a registration complete event. Since we don't differentiate
-	 *	between sharable and exclusive use cards when giving clients
-	 *	event notification, we modify the definition of the share/excl
-	 *	flags as follows:
-	 *
-	 *	    If either INFO_CARD_SHARE or INFO_CARD_EXCL is set,
-	 *	    the client will receive artificial card insertion
-	 *	    events (if the client's card is currently in the
-	 *	    socket) and a registration complete event.
-	 *
-	 *	    If neither of the INFO_CARD_SHARE or INFO_CARD_EXCL is
-	 *	    set, the client will not receive an artificial card
-	 *	    insertion event nor a registration complete event
-	 *	    due to the client's call to register client.
-	 *
-	 *	    The client's event mask is not affected by the setting
-	 *	    of these two bits.
-	 */
-	if (cr->Attributes & (INFO_CARD_SHARE | INFO_CARD_EXCL))
-	    client->pending_events = CS_EVENT_REGISTRATION_COMPLETE;
-
-	/*
-	 * Check to see if the card for this client is currently in
-	 *	the socket. If it is, then set CLIENT_CARD_INSERTED
-	 *	since clients that are calling GetStatus at attach
-	 *	time will typically check to see if their card is
-	 *	currently installed.
-	 * If this is the CSI client, we also need to check to see
-	 *	if there is any card inserted in the socket, since
-	 *	the cs_card_for_client function will always return
-	 *	TRUE for a CSI client.
-	 * XXX What about super-clients?
-	 */
-	if (client->flags & CLIENT_CSI_CLIENT) {
-	    get_ss_status_t get_ss_status;
-
-	    get_ss_status.socket = sp->socket_num;
-
-	    if (SocketServices(SS_GetStatus, &get_ss_status) != SUCCESS) {
-		mutex_exit(&sp->lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_SOCKET);
-	    } /* SS_GetStatus */
-
-	    if (!(cs_sbm2cse(get_ss_status.CardState) &
-			CS_EVENT_CARD_INSERTION))
-		cie = 0;
-
-	} /* CLIENT_CSI_CLIENT */
-
-	if (cs_card_for_client(client) && (cie != 0)) {
-	    client->pending_events |= CS_EVENT_CARD_INSERTION;
-	    client->flags |= CLIENT_CARD_INSERTED;
-	} /* cs_card_for_client */
-
-	sp->num_clients++;
-	mutex_exit(&sp->lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_deregister_client - This supports the DeregisterClient call.
- */
-static int
-cs_deregister_client(client_handle_t client_handle)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error, super_client = 0;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * Make sure that any resources allocated by this client are
-	 *	not still allocated, and that if this is an MTD that
-	 *	no MTD operations are still in progress.
-	 */
-	if (client->flags &    (CLIENT_IO_ALLOCATED	|
-				CLIENT_IRQ_ALLOCATED	|
-				CLIENT_WIN_ALLOCATED	|
-				REQ_CONFIGURATION_DONE	|
-				REQ_SOCKET_MASK_DONE	|
-				REQ_IO_DONE		|
-				REQ_IRQ_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BUSY);
-	}
-
-	if (client->flags & CLIENT_MTD_IN_PROGRESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_IN_USE);
-	}
-
-	/*
-	 * Any previously allocated resources are not allocated anymore, and
-	 *	no MTD operations are in progress, so if this is an MTD client
-	 *	then do any MTD-specific client deregistration, and then
-	 *	nuke this client.
-	 * We expect cs_deregister_mtd to never fail.
-	 */
-	if (client->flags & INFO_MTD_CLIENT)
-	    (void) cs_deregister_mtd(client_handle);
-
-	if (client->flags & CLIENT_SUPER_CLIENT)
-	    super_client = CLIENT_SUPER_CLIENT;
-
-	kmem_free(client->driver_name, strlen(client->driver_name) + 1);
-
-	error = cs_destroy_client_handle(client_handle);
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	/*
-	 * If this was the "super-client" deregistering, then this
-	 *	will clear the global "super-client" lock.
-	 * XXX - move this outside the per-socket code.
-	 */
-	cs_clear_superclient_lock(super_client);
-
-	return (error);
-}
-
-/*
- * cs_create_next_client_minor - returns the next available client minor
- *					number or 0 if none available
- *
- * Note that cs_find_client will always return a valid pointer to the
- *	global Socket Services client which has a client minor number
- *	of 0; this means that this function can never return a 0 as the
- *	next valid available client minor number.
- */
-unsigned
-cs_create_next_client_minor(unsigned socket_num, unsigned next_minor)
-{
-	unsigned max_client_handles = cs_max_client_handles;
-
-	do {
-	    next_minor &= CS_MAX_CLIENTS_MASK;
-	    if (!cs_find_client(MAKE_CLIENT_HANDLE(
-					CS_GET_SOCKET_NUMBER(socket_num),
-					CS_GET_FUNCTION_NUMBER(socket_num),
-							next_minor), NULL)) {
-		return (next_minor);
-	    }
-	    next_minor++;
-	} while (max_client_handles--);
-
-	return (0);
-}
-
-/*
- * cs_find_client - finds the client pointer associated with the client handle
- *			or NULL if client not found
- *
- * returns:	(client_t *)NULL - if client not found or an error occured
- *					If the error argument is not NULL,
- *					it is set to:
- *			CS_BAD_SOCKET - socket number in client_handle_t is
- *						invalid
- *			CS_BAD_HANDLE - client not found
- *			If no error, the error argument is not modified.
- *		(client_t *) - pointer to client_t structure
- *
- * Note that each socket always has a pseudo client with a client minor number
- *	of 0; this client minor number is used for Socket Services access to
- *	Card Services functions. The client pointer returned for client minor
- *	number 0 is the global Socket Services client pointer.
- */
-static client_t *
-cs_find_client(client_handle_t client_handle, int *error)
-{
-	cs_socket_t *sp;
-	client_t *clp;
-
-	/*
-	 * If we are being asked to see if a client with a minor number
-	 *	of 0 exists, always return a pointer to the global Socket
-	 *	Services client, since this client always exists, and is
-	 *	only for use by Socket Services.  There is no socket
-	 *	associated with this special client handle.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (&cs_socket_services_client);
-
-	/*
-	 * Check to be sure that the socket number is in range
-	 */
-	if (!(CHECK_SOCKET_NUM(GET_CLIENT_SOCKET(client_handle),
-					cs_globals.max_socket_num))) {
-	    if (error)
-		*error = CS_BAD_SOCKET;
-	    return (NULL);
-	}
-
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL) {
-	    if (error)
-		*error = CS_BAD_SOCKET;
-	    return (NULL);
-	}
-
-	clp = sp->client_list;
-
-	while (clp) {
-	    if (clp->client_handle == client_handle)
-		return (clp);
-	    clp = clp->next;
-	}
-
-	if (error)
-	    *error = CS_BAD_HANDLE;
-
-	return (NULL);
-}
-
-/*
- * cs_destroy_client_handle - destroys client handle and client structure of
- *				passed client handle
- *
- * returns:	CS_SUCCESS - if client handle sucessfully destroyed
- *		CS_BAD_HANDLE - if client handle is invalid or if trying
- *					to destroy global SS client
- *		{other errors} - other errors from cs_find_client()
- */
-static int
-cs_destroy_client_handle(client_handle_t client_handle)
-{
-	client_t *clp;
-	cs_socket_t *sp;
-	int error = CS_BAD_HANDLE;
-
-	/*
-	 * See if we were passed a valid client handle or if we're being asked
-	 *	to destroy the Socket Services client
-	 */
-	if ((!(clp = cs_find_client(client_handle, &error))) ||
-			(CLIENT_HANDLE_IS_SS(client_handle)))
-	    return (error);
-
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	/*
-	 * Recycle this client's minor number.  This will most likely
-	 *	be the next client minor number we use, but it is also
-	 *	a hint to cs_create_client_handle, and that function
-	 *	may actually create a new client handle using a minor
-	 *	number different that this number.
-	 */
-	mutex_enter(&sp->lock);
-	sp->next_cl_minor = GET_CLIENT_MINOR(client_handle);
-
-	/*
-	 * See if we're the first or not in the client list; if we're
-	 *	not first, then just adjust the client behind us to
-	 *	point to the client ahead of us; this could be NULL
-	 *	if we're the last client in the list.
-	 */
-	if (clp->prev) {
-	    clp->prev->next = clp->next;
-	} else {
-	/*
-	 * We are first, so adjust the client list head pointer
-	 *	in the socket to point to the client structure that
-	 *	follows us; this could turn out to be NULL if we're
-	 *	the only client on this socket.
-	 */
-	    sp->client_list = clp->next;
-	}
-
-	/*
-	 * If we're not the last client in the list, point the next
-	 *	client to the client behind us; this could turn out
-	 *	to be NULL if we're the first client on this socket.
-	 */
-	if (clp->next)
-	    clp->next->prev = clp->prev;
-
-	sp->num_clients--;
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Free this client's memory.
-	 */
-	kmem_free(clp, sizeof (client_t));
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_create_client_handle - create a new client handle for the passed
- *				socket and function number
- *
- * returns:	0 -  if can't create client for some reason
- *		client_handle_t - new client handle
- */
-static client_handle_t
-cs_create_client_handle(unsigned socket_num, client_t *cclp)
-{
-	client_t *clp;
-	cs_socket_t *sp;
-	unsigned next_minor;
-	client_handle_t client_handle;
-
-	if ((sp = cs_get_sp(socket_num)) == NULL)
-	    return (0);
-
-	/*
-	 * Get the next available minor number that we can use.  We use the
-	 *	next_cl_minor number as a hint to cs_create_next_client_minor
-	 *	and in most cases this will be the minor number we get back.
-	 * If for some reason we can't get a minor number, return an error.
-	 *	The only way we could get an error would be if there are
-	 *	already the maximum number of clients for this socket. Since
-	 *	the maximum number of clients per socket is pretty large,
-	 *	this error is unlikely to occur.
-	 */
-	if (!(next_minor =
-		cs_create_next_client_minor(socket_num, sp->next_cl_minor)))
-	    return (0);
-
-	/*
-	 * Got a new client minor number, now create a new client handle.
-	 */
-	client_handle = MAKE_CLIENT_HANDLE(CS_GET_SOCKET_NUMBER(socket_num),
-					CS_GET_FUNCTION_NUMBER(socket_num),
-					next_minor);
-
-	/*
-	 * If this client handle exists, then we have an internal
-	 *	error; this should never happen, BTW.  This is really
-	 *	a double-check on the cs_create_next_client_minor
-	 *	function, which also calls cs_find_client.
-	 */
-	if (cs_find_client(client_handle, NULL)) {
-	    cmn_err(CE_CONT,
-		"cs_create_client_handle: duplicate client handle 0x%x\n",
-							(int)client_handle);
-	    return (0);
-	}
-
-	/*
-	 * If we don't have any clients on this socket yet, create
-	 *	a new client and hang it on the socket client list.
-	 */
-	if (!sp->client_list) {
-	    sp->client_list = cclp;
-	    clp = sp->client_list;
-	} else {
-	/*
-	 * There are other clients on this socket, so look for
-	 *	the last client and add our new client after it.
-	 */
-	    clp = sp->client_list;
-	    while (clp->next) {
-		clp = clp->next;
-	    }
-
-	    clp->next = cclp;
-	    clp->next->prev = clp;
-	    clp = clp->next;
-	} /* if (!sp->client_list) */
-
-	/*
-	 * Assign the new client handle to this new client structure.
-	 */
-	clp->client_handle = client_handle;
-
-	/*
-	 * Create the next available client minor number for this socket
-	 *	and save it away.
-	 */
-	sp->next_cl_minor =
-		cs_create_next_client_minor(socket_num, sp->next_cl_minor);
-
-	return (client_handle);
-}
-
-/*
- * cs_clear_superclient_lock - clears the global "super-client" lock
- *
- * Note: this function uses the cs_globals.global_lock so observe proper
- *		nexting of locks!!
- */
-static void
-cs_clear_superclient_lock(int super_client)
-{
-
-	/*
-	 * If this was a "super-client" registering then we need
-	 *	to clear the GLOBAL_SUPER_CLIENT_REGISTERED flag
-	 *	so that other "super-clients" can register.
-	 */
-	if (super_client == CLIENT_SUPER_CLIENT) {
-	    mutex_enter(&cs_globals.global_lock);
-	    cs_globals.flags &= ~GLOBAL_SUPER_CLIENT_REGISTERED;
-	    mutex_exit(&cs_globals.global_lock);
-	}
-}
-
-/*
- * ==== event handling section ====
- */
-
-/*
- * cs_event - CS event hi-priority callback handler
- *
- *	This function gets called by SS and is passed the event type in
- *		the "event" argument, and the socket number in the "sn"
- *		argument. The "sn" argument is a valid logical socket
- *		number for all events except the PCE_SS_READY event.
- *
- *	The PCE_SS_INIT_STATE, PCE_ADD_SOCKET and PCE_DROP_SOCKET events
- *		are never called at high priority. These events return
- *		the following return codes:
- *
- *			CS_SUCCESS - operation sucessful
- *			CS_BAD_SOCKET - unable to complete operation
- *			CS_UNSUPPORTED_FUNCTION - bad subfunction of
- *							PCE_SS_INIT_STATE
- *
- *		The caller MUST look at these return codes!
- *
- *	This function is called at high-priority interrupt time for standard
- *		Card Services events, and the only standard Card Services
- *		event that it handles directly is the CS_EVENT_CARD_REMOVAL
- *		event, which gets shuttled right into the client's event
- *		handler.  All other events are just queued up and the socket
- *		event thread is woken up via the soft interrupt handler.
- *	Note that CS_EVENT_CARD_INSERTION events are not set in the clients'
- *		event field, since the CS card insertion/card ready processing
- *		code is responsible for setting this event in a client's
- *		event field.
- *
- */
-/*ARGSUSED*/
-uint32_t
-cs_event(event_t event, uint32_t sn, uint32_t arg)
-{
-	client_t *client;
-	cs_socket_t *sp;
-	client_types_t *ct;
-	uint32_t ret = CS_SUCCESS;
-
-	/*
-	 * Handle special SS<->CS events
-	 */
-	switch (event) {
-	    case PCE_SS_INIT_STATE:
-		mutex_enter(&cs_globals.global_lock);
-		switch (sn) {
-		    case PCE_SS_STATE_INIT:
-			if ((ret = cs_ss_init()) == CS_SUCCESS)
-			    cs_globals.init_state |= GLOBAL_INIT_STATE_SS_READY;
-			break;
-		    case PCE_SS_STATE_DEINIT:
-			cs_globals.init_state &= ~GLOBAL_INIT_STATE_SS_READY;
-			break;
-		    default:
-			ret = CS_UNSUPPORTED_FUNCTION;
-			cmn_err(CE_CONT, "cs_event: PCE_SS_INIT_STATE invalid "
-						"directive: 0x%x\n", sn);
-			break;
-		} /* switch (sn) */
-		mutex_exit(&cs_globals.global_lock);
-		return (ret);
-	    case PCE_ADD_SOCKET:
-		return (cs_add_socket(sn));
-	    case PCE_DROP_SOCKET:
-		return (cs_drop_socket(sn));
-	} /* switch (event) */
-
-	if ((sp = cs_get_sp(sn)) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	/*
-	 * Check to see if CS wants to unload - we do this since it's possible
-	 *	to disable certain sockets.  Do NOT acquire any locks yet.
-	 */
-	if (sp->flags & SOCKET_UNLOAD_MODULE) {
-	    if (event == PCE_CARD_INSERT)
-		cmn_err(CE_CONT, "PCMCIA: socket %d disabled - please "
-							"remove card\n", sn);
-	    return (CS_SUCCESS);
-	}
-
-	mutex_enter(&sp->lock);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 1) {
-	    event2text_t event2text;
-
-	    event2text.event = event;
-	    (void) cs_event2text(&event2text, 0);
-	    cmn_err(CE_CONT, "cs_event: event=%s (x%x), socket=0x%x\n",
-				event2text.text, (int)event, (int)sn);
-	}
-#endif
-
-	/*
-	 * Convert SS events to CS events; handle the PRR if necessary.
-	 */
-	sp->events |= ss_to_cs_events(sp, event);
-
-	/*
-	 * We want to maintain the required event dispatching order as
-	 *	specified in the PCMCIA spec, so we cycle through all
-	 *	clients on this socket to make sure that they are
-	 *	notified in the correct order of any high-priority
-	 *	events.
-	 */
-	ct = &client_types[0];
-	while (ct) {
-	/*
-	 * Point to the head of the client list for this socket, and go
-	 *	through each client to set up the client events as well as
-	 *	call the client's event handler directly if we have a high
-	 *	priority event that we need to tell the client about.
-	 */
-	    client = sp->client_list;
-
-	    if (ct->order & CLIENT_EVENTS_LIFO) {
-		client_t *clp = NULL;
-
-		while (client) {
-		    clp = client;
-		    client = client->next;
-		}
-		client = clp;
-	    }
-
-	    while (client) {
-		client->events |= ((sp->events & ~CS_EVENT_CARD_INSERTION) &
-				    (client->event_mask | client->global_mask));
-		if (client->flags & ct->type) {
-#ifdef	CS_DEBUG
-		    if (cs_debug > 1) {
-			cmn_err(CE_CONT, "cs_event: socket %d client [%s] "
-						"events 0x%x flags 0x%x\n",
-						sn, client->driver_name,
-						(int)client->events,
-						(int)client->flags);
-		    }
-#endif
-
-		/*
-		 * Handle the suspend and card removal events
-		 *	specially here so that the client can receive
-		 *	these events at high-priority.
-		 */
-		    if (client->events & CS_EVENT_PM_SUSPEND) {
-			if (client->flags & CLIENT_CARD_INSERTED) {
-			    CLIENT_EVENT_CALLBACK(client, CS_EVENT_PM_SUSPEND,
-							CS_EVENT_PRI_HIGH);
-			} /* if (CLIENT_CARD_INSERTED) */
-			client->events &= ~CS_EVENT_PM_SUSPEND;
-		    } /* if (CS_EVENT_PM_SUSPEND) */
-
-		    if (client->events & CS_EVENT_CARD_REMOVAL) {
-			if (client->flags & CLIENT_CARD_INSERTED) {
-			    client->flags &= ~(CLIENT_CARD_INSERTED |
-						CLIENT_SENT_INSERTION);
-			    CLIENT_EVENT_CALLBACK(client,
-							CS_EVENT_CARD_REMOVAL,
-							CS_EVENT_PRI_HIGH);
-			/*
-			 * Check to see if the client wants low priority
-			 *	removal events as well.
-			 */
-			    if ((client->event_mask | client->global_mask) &
-						CS_EVENT_CARD_REMOVAL_LOWP) {
-				client->events |= CS_EVENT_CARD_REMOVAL_LOWP;
-			    }
-			} /* if (CLIENT_CARD_INSERTED) */
-			client->events &= ~CS_EVENT_CARD_REMOVAL;
-		    } /* if (CS_EVENT_CARD_REMOVAL) */
-
-		} /* if (ct->type) */
-		if (ct->order & CLIENT_EVENTS_LIFO) {
-		    client = client->prev;
-		} else {
-		    client = client->next;
-		}
-	    } /* while (client) */
-
-	    ct = ct->next;
-	} /* while (ct) */
-
-	/*
-	 * Set the SOCKET_NEEDS_THREAD flag so that the soft interrupt
-	 *	handler will wakeup this socket's event thread.
-	 */
-	if (sp->events)
-	    sp->flags |= SOCKET_NEEDS_THREAD;
-
-	/*
-	 * Fire off a soft interrupt that will cause the socket thread
-	 *	to be woken up and any remaining events to be sent to
-	 *	the clients on this socket.
-	 */
-	if ((sp->init_state & SOCKET_INIT_STATE_SOFTINTR) &&
-			!(cs_globals.init_state & GLOBAL_INIT_STATE_UNLOADING))
-	    ddi_trigger_softintr(sp->softint_id);
-
-	mutex_exit(&sp->lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_card_insertion - handle card insertion and card ready events
- *
- * We read the CIS, if present, and store it away, then tell SS that
- *	we have read the CIS and it's ready to be parsed.  Since card
- *	insertion and card ready events are pretty closely intertwined,
- *	we handle both here.  For card ready events that are not the
- *	result of a card insertion event, we expect that the caller has
- *	already done the appropriate processing and that we will not be
- *	called unless we received a card ready event right after a card
- *	insertion event, i.e. that the SOCKET_WAIT_FOR_READY flag in
- *	sp->thread_state was set or if we get a CARD_READY event right
- *	after a CARD_INSERTION event.
- *
- *    calling:	sp - pointer to socket structure
- *		event - event to handle, one of:
- *				CS_EVENT_CARD_INSERTION
- *				CS_EVENT_CARD_READY
- *				CS_EVENT_SS_UPDATED
- */
-static int
-cs_card_insertion(cs_socket_t *sp, event_t event)
-{
-	int ret;
-
-	/*
-	 * Since we're only called while waiting for the card insertion
-	 *	and card ready sequence to occur, we may have a pending
-	 *	card ready timer that hasn't gone off yet if we got a
-	 *	real card ready event.
-	 */
-	UNTIMEOUT(sp->rdybsy_tmo_id);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 1) {
-	    cmn_err(CE_CONT, "cs_card_insertion: event=0x%x, socket=0x%x\n",
-						(int)event, sp->socket_num);
-	}
-#endif
-
-	/*
-	 * Handle card insertion processing
-	 */
-	if (event & CS_EVENT_CARD_INSERTION) {
-	    set_socket_t set_socket;
-	    get_ss_status_t gs;
-
-	/*
-	 * Check to be sure that we have a valid CIS window
-	 */
-	    if (!SOCKET_HAS_CIS_WINDOW(sp)) {
-		cmn_err(CE_CONT,
-			"cs_card_insertion: socket %d has no "
-							"CIS window\n",
-				sp->socket_num);
-		return (CS_GENERAL_FAILURE);
-	    }
-
-	/*
-	 * Apply power to the socket, enable card detect and card ready
-	 *	events, then reset the socket.
-	 */
-	    mutex_enter(&sp->lock);
-	    sp->event_mask =   (CS_EVENT_CARD_REMOVAL   |
-				CS_EVENT_CARD_READY);
-	    mutex_exit(&sp->lock);
-	    set_socket.socket = sp->socket_num;
-	    set_socket.SCIntMask = (SBM_CD | SBM_RDYBSY);
-	    set_socket.IREQRouting = 0;
-	    set_socket.IFType = IF_MEMORY;
-	    set_socket.CtlInd = 0; /* turn off controls and indicators */
-	    set_socket.State = (unsigned)~0;	/* clear latched state bits */
-
-	    (void) cs_convert_powerlevel(sp->socket_num, 50, VCC,
-						&set_socket.VccLevel);
-	    (void) cs_convert_powerlevel(sp->socket_num, 50, VPP1,
-						&set_socket.Vpp1Level);
-	    (void) cs_convert_powerlevel(sp->socket_num, 50, VPP2,
-						&set_socket.Vpp2Level);
-
-	    if ((ret = SocketServices(SS_SetSocket, &set_socket)) != SUCCESS) {
-		cmn_err(CE_CONT,
-		    "cs_card_insertion: socket %d SS_SetSocket failure %d\n",
-				sp->socket_num, ret);
-		return (ret);
-	    }
-
-	/*
-	 * Clear the ready and ready_timeout events since they are now
-	 *	bogus since we're about to reset the socket.
-	 * XXX - should these be cleared right after the RESET??
-	 */
-	    mutex_enter(&sp->lock);
-
-	    sp->events &= ~(CS_EVENT_CARD_READY | CS_EVENT_READY_TIMEOUT);
-	    mutex_exit(&sp->lock);
-
-	    SocketServices(SS_ResetSocket, sp->socket_num,
-						RESET_MODE_CARD_ONLY);
-
-	/*
-	 * We are required by the PCMCIA spec to wait some number of
-	 *	milliseconds after reset before we access the card, so
-	 *	we set up a timer here that will wake us up and allow us
-	 *	to continue with our card initialization.
-	 */
-	    mutex_enter(&sp->lock);
-	    sp->thread_state |= SOCKET_RESET_TIMER;
-	    (void) timeout(cs_ready_timeout, sp,
-		drv_usectohz(cs_reset_timeout_time * 1000));
-	    cv_wait(&sp->reset_cv, &sp->lock);
-	    sp->thread_state &= ~SOCKET_RESET_TIMER;
-	    mutex_exit(&sp->lock);
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 2) {
-		cmn_err(CE_CONT, "cs_card_insertion: socket %d out of RESET "
-		    "for %d mS sp->events 0x%x\n",
-		    sp->socket_num, cs_reset_timeout_time, (int)sp->events);
-	    }
-#endif
-
-	/*
-	 * If we have a pending CS_EVENT_CARD_REMOVAL event it
-	 *	means that we likely got CD line bounce on the
-	 *	insertion, so terminate this processing.
-	 */
-	    if (sp->events & CS_EVENT_CARD_REMOVAL) {
-#ifdef	CS_DEBUG
-		if (cs_debug > 0) {
-		    cmn_err(CE_CONT, "cs_card_insertion: socket %d "
-						"CS_EVENT_CARD_REMOVAL event "
-						"terminating insertion "
-						"processing\n",
-							sp->socket_num);
-		}
-#endif
-	    return (CS_SUCCESS);
-	    } /* if (CS_EVENT_CARD_REMOVAL) */
-
-	/*
-	 * If we got a card ready event after the reset, then don't
-	 *	bother setting up a card ready timer, since we'll blast
-	 *	right on through to the card ready processing.
-	 * Get the current card status to see if it's ready; if it
-	 *	is, we probably won't get a card ready event.
-	 */
-	    gs.socket = sp->socket_num;
-	    gs.CardState = 0;
-	    if ((ret = SocketServices(SS_GetStatus, &gs)) != SUCCESS) {
-		cmn_err(CE_CONT,
-		    "cs_card_insertion: socket %d SS_GetStatus failure %d\n",
-				sp->socket_num, ret);
-		return (ret);
-	    }
-
-	    mutex_enter(&sp->lock);
-	    if ((sp->events & CS_EVENT_CARD_READY) ||
-					(gs.CardState & SBM_RDYBSY)) {
-		event = CS_EVENT_CARD_READY;
-#ifdef	CS_DEBUG
-		if (cs_debug > 1) {
-		    cmn_err(CE_CONT, "cs_card_insertion: socket %d card "
-						"READY\n", sp->socket_num);
-		}
-#endif
-
-	    } else {
-#ifdef	CS_DEBUG
-		if (cs_debug > 1) {
-		    cmn_err(CE_CONT, "cs_card_insertion: socket %d setting "
-					"READY timer\n", sp->socket_num);
-		}
-#endif
-
-		sp->rdybsy_tmo_id = timeout(cs_ready_timeout, sp,
-		    READY_TIMEOUT_TIME);
-		sp->thread_state |= SOCKET_WAIT_FOR_READY;
-
-	    } /* if (CS_EVENT_CARD_READY) */
-
-	    mutex_exit(&sp->lock);
-
-	} /* if (CS_EVENT_CARD_INSERTION) */
-
-	/*
-	 * Handle card ready processing.  This is only card ready processing
-	 *	for card ready events in conjunction with a card insertion.
-	 */
-	if (event == CS_EVENT_CARD_READY) {
-	    get_socket_t get_socket;
-	    set_socket_t set_socket;
-
-	/*
-	 * The only events that we want to see now are card removal
-	 *	events.
-	 */
-	    mutex_enter(&sp->lock);
-	    sp->event_mask = CS_EVENT_CARD_REMOVAL;
-	    mutex_exit(&sp->lock);
-	    get_socket.socket = sp->socket_num;
-	    if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS) {
-		cmn_err(CE_CONT,
-			"cs_card_insertion: socket %d SS_GetSocket failed\n",
-							sp->socket_num);
-		return (CS_BAD_SOCKET);
-	    }
-
-	    set_socket.socket = sp->socket_num;
-	    set_socket.SCIntMask = SBM_CD;
-	    set_socket.VccLevel = get_socket.VccLevel;
-	    set_socket.Vpp1Level = get_socket.Vpp1Level;
-	    set_socket.Vpp2Level = get_socket.Vpp2Level;
-	    set_socket.IREQRouting = get_socket.IRQRouting;
-	    set_socket.IFType = get_socket.IFType;
-	    set_socket.CtlInd = get_socket.CtlInd;
-	    /* XXX (is ~0 correct here?) to reset latched values */
-	    set_socket.State = (unsigned)~0;
-
-	    if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS) {
-		cmn_err(CE_CONT,
-			"cs_card_insertion: socket %d SS_SetSocket failed\n",
-							sp->socket_num);
-
-		return (CS_BAD_SOCKET);
-	    }
-
-		/*
-		 * Grab the cis_lock mutex to protect the CIS-to-be and
-		 *	the CIS window, then fire off the CIS parser to
-		 *	create a local copy of the card's CIS.
-		 */
-		mutex_enter(&sp->cis_lock);
-
-		if ((ret = cs_create_cis(sp)) != CS_SUCCESS) {
-		    mutex_exit(&sp->cis_lock);
-		    return (ret);
-		}
-
-		mutex_exit(&sp->cis_lock);
-
-		/*
-		 * If we have a pending CS_EVENT_CARD_REMOVAL event it
-		 *	means that we likely got CD line bounce on the
-		 *	insertion, so destroy the CIS and terminate this
-		 *	processing. We'll get called back to handle the
-		 *	insertion again later.
-		 */
-		if (sp->events & CS_EVENT_CARD_REMOVAL) {
-		    mutex_enter(&sp->cis_lock);
-		    (void) cs_destroy_cis(sp);
-		    mutex_exit(&sp->cis_lock);
-		} else {
-			/*
-			 * Schedule the call to the Socket Services work thread.
-			 */
-		    mutex_enter(&sp->ss_thread_lock);
-		    sp->ss_thread_state |= SOCKET_THREAD_CSCISInit;
-		    cv_broadcast(&sp->ss_thread_cv);
-		    mutex_exit(&sp->ss_thread_lock);
-		} /* if (CS_EVENT_CARD_REMOVAL) */
-	} /* if (CS_EVENT_CARD_READY) */
-
-	/*
-	 * Socket Services has parsed the CIS and has done any other
-	 *	work to get the client driver loaded and attached if
-	 *	necessary, so setup the per-client state.
-	 */
-	if (event == CS_EVENT_SS_UPDATED) {
-	    client_t *client;
-
-	/*
-	 * Now that we and SS are done handling the card insertion
-	 *	semantics, go through each client on this socket and set
-	 *	the CS_EVENT_CARD_INSERTION event in each client's event
-	 *	field.  We do this here instead of in cs_event so that
-	 *	when a client gets a CS_EVENT_CARD_INSERTION event, the
-	 *	card insertion and ready processing has already been done
-	 *	and SocketServices has had a chance to create a dip for
-	 *	the card in this socket.
-	 */
-	    mutex_enter(&sp->lock);
-	    client = sp->client_list;
-	    while (client) {
-		client->events |= (CS_EVENT_CARD_INSERTION &
-				(client->event_mask | client->global_mask));
-		client = client->next;
-	    } /* while (client) */
-
-	    mutex_exit(&sp->lock);
-
-	} /* if (CS_EVENT_SS_UPDATED) */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_card_removal - handle card removal events
- *
- * Destroy the CIS.
- *
- *    calling:	sp - pointer to socket structure
- *
- */
-static int
-cs_card_removal(cs_socket_t *sp)
-{
-	set_socket_t set_socket;
-	int ret;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 0) {
-	    cmn_err(CE_CONT, "cs_card_removal: socket %d\n", sp->socket_num);
-	}
-#endif
-
-	/*
-	 * Remove any pending card ready timer
-	 */
-	UNTIMEOUT(sp->rdybsy_tmo_id);
-
-	/*
-	 * Clear various flags so that everyone else knows that there's
-	 *	nothing on this socket anymore.  Note that we clear the
-	 *	SOCKET_CARD_INSERTED and SOCKET_IS_IO flags in the
-	 *	ss_to_cs_events event mapping function.
-	 */
-	mutex_enter(&sp->lock);
-	sp->thread_state &= ~(SOCKET_WAIT_FOR_READY | SOCKET_RESET_TIMER);
-
-	/*
-	 * Turn off socket power and set the socket back to memory mode.
-	 * Disable all socket events except for CARD_INSERTION events.
-	 */
-	sp->event_mask = CS_EVENT_CARD_INSERTION;
-	mutex_exit(&sp->lock);
-	set_socket.socket = sp->socket_num;
-	set_socket.SCIntMask = SBM_CD;
-	set_socket.IREQRouting = 0;
-	set_socket.IFType = IF_MEMORY;
-	set_socket.CtlInd = 0; /* turn off controls and indicators */
-	set_socket.State = (unsigned)~0;	/* clear latched state bits */
-
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VCC,
-					&set_socket.VccLevel);
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VPP1,
-					&set_socket.Vpp1Level);
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VPP2,
-					&set_socket.Vpp2Level);
-
-	if ((ret = SocketServices(SS_SetSocket, &set_socket)) != SUCCESS) {
-	    cmn_err(CE_CONT,
-		"cs_card_removal: socket %d SS_SetSocket failure %d\n",
-				sp->socket_num, ret);
-	    return (ret);
-	}
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 2) {
-	    cmn_err(CE_CONT, "cs_card_removal: socket %d "
-					"calling cs_destroy_cis\n",
-							sp->socket_num);
-	}
-#endif
-
-	/*
-	 * Destroy the CIS and tell Socket Services that we're done
-	 *	handling the card removal event.
-	 */
-	mutex_enter(&sp->cis_lock);
-	(void) cs_destroy_cis(sp);
-	mutex_exit(&sp->cis_lock);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 2) {
-	    cmn_err(CE_CONT, "cs_card_removal: calling CSCardRemoved\n");
-	}
-#endif
-
-	SocketServices(CSCardRemoved, sp->socket_num);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ss_to_cs_events - convert Socket Services events to Card Services event
- *			masks; this function will not read the PRR if the
- *			socket is in IO mode; this happens in cs_event_thread
- *
- * This function returns a bit mask of events.
- *
- * Note that we do some simple hysterious on card insertion and card removal
- *	events to prevent spurious insertion and removal events from being
- *	propogated down the chain.
- */
-static event_t
-ss_to_cs_events(cs_socket_t *sp, event_t event)
-{
-	event_t revent = 0;
-
-	switch (event) {
-	    case PCE_CARD_STATUS_CHANGE:
-		revent |= CS_EVENT_STATUS_CHANGE;
-		break;
-	    case PCE_CARD_REMOVAL:
-		if (sp->flags & SOCKET_CARD_INSERTED) {
-		    sp->flags &= ~(SOCKET_CARD_INSERTED | SOCKET_IS_IO);
-		    revent |= CS_EVENT_CARD_REMOVAL;
-			/*
-			 * If we're processing a removal event, it makes
-			 *	no sense to keep any insertion or ready events,
-			 *	so nuke them here.  This will not clear any
-			 *	insertion events in the per-client event field.
-			 */
-		    sp->events &= ~(CS_EVENT_CARD_INSERTION |
-				    CS_EVENT_CARD_READY |
-				    CS_EVENT_READY_TIMEOUT);
-
-		/*
-		 * We also don't need to wait for READY anymore since
-		 *	it probably won't show up, or if it does, it will
-		 *	be a bogus READY event as the card is sliding out
-		 *	of the socket.  Since we never do a cv_wait on the
-		 *	card ready timer, it's OK for that timer to either
-		 *	never go off (via an UNTIMEOUT in cs_card_removal)
-		 *	or to go off but not do a cv_broadcast (since the
-		 *	SOCKET_WAIT_FOR_READY flag is cleared here).
-		 */
-		    sp->thread_state &= ~SOCKET_WAIT_FOR_READY;
-
-		}
-		break;
-	    case PCE_CARD_INSERT:
-		if (!(sp->flags & SOCKET_CARD_INSERTED)) {
-		    sp->flags |= SOCKET_CARD_INSERTED;
-		    revent |= CS_EVENT_CARD_INSERTION;
-		}
-		break;
-	    case PCE_CARD_READY:
-		if (sp->flags & SOCKET_CARD_INSERTED)
-		    revent |= CS_EVENT_CARD_READY;
-		break;
-	    case PCE_CARD_BATTERY_WARN:
-		if (sp->flags & SOCKET_CARD_INSERTED)
-		    revent |= CS_EVENT_BATTERY_LOW;
-		break;
-	    case PCE_CARD_BATTERY_DEAD:
-		if (sp->flags & SOCKET_CARD_INSERTED)
-		    revent |= CS_EVENT_BATTERY_DEAD;
-		break;
-	    case PCE_CARD_WRITE_PROTECT:
-		if (sp->flags & SOCKET_CARD_INSERTED)
-		    revent |= CS_EVENT_WRITE_PROTECT;
-		break;
-	    case PCE_PM_RESUME:
-		revent |= CS_EVENT_PM_RESUME;
-		break;
-	    case PCE_PM_SUSPEND:
-		revent |= CS_EVENT_PM_SUSPEND;
-		break;
-	    default:
-		cmn_err(CE_CONT, "ss_to_cs_events: unknown event 0x%x\n",
-								(int)event);
-		break;
-	} /* switch(event) */
-
-	return (revent);
-}
-
-/*
- * cs_ready_timeout - general purpose READY/BUSY and RESET timer
- *
- * Note that we really only expect one of the two events to be asserted when
- *	we are called.  XXX - Perhaps this might be a problem later on??
- *
- *	There is also the problem of cv_broadcast dropping the interrupt
- *	priority, even though we have our high-priority mutex held.  If
- *	we hold our high-priority mutex (sp->lock) over a cv_broadcast, and
- *	we get a high-priority interrupt during this time, the system will
- *	deadlock or panic.  Thanks to Andy Banta for finding this out in
- *	the SPC/S (stc.c) driver.
- *
- * This callback routine can not grab the sp->client_lock mutex or deadlock
- *	will result.
- */
-void
-cs_ready_timeout(void *arg)
-{
-	cs_socket_t *sp = arg;
-	kcondvar_t *cvp = NULL;
-
-	mutex_enter(&sp->lock);
-
-	if (sp->thread_state & SOCKET_RESET_TIMER) {
-#ifdef	CS_DEBUG
-	if (cs_debug > 1) {
-	    cmn_err(CE_CONT, "cs_ready_timeout: SOCKET_RESET_TIMER socket %d\n",
-							sp->socket_num);
-	}
-#endif
-
-	    cvp = &sp->reset_cv;
-	}
-
-	if (sp->thread_state & SOCKET_WAIT_FOR_READY) {
-	    sp->events |= CS_EVENT_READY_TIMEOUT;
-	    cvp = &sp->thread_cv;
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_ready_timeout: SOCKET_WAIT_FOR_READY "
-						"socket %d\n", sp->socket_num);
-	    }
-#endif
-
-	}
-
-	mutex_exit(&sp->lock);
-
-	if (cvp)
-	    cv_broadcast(cvp);
-}
-
-/*
- * cs_event_softintr_timeout - wrapper function to call cs_socket_event_softintr
- */
-/* ARGSUSED */
-void
-cs_event_softintr_timeout(void *arg)
-{
-
-	/*
-	 * If we're trying to unload this module, then don't do
-	 *	anything but exit.
-	 * We acquire the cs_globals.global_lock mutex here so that
-	 *	we can correctly synchronize with cs_deinit when it
-	 *	is telling us to shut down. XXX - is this bogus??
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	if (!(cs_globals.init_state & GLOBAL_INIT_STATE_UNLOADING)) {
-	    mutex_exit(&cs_globals.global_lock);
-	    (void) cs_socket_event_softintr(NULL);
-	    cs_globals.sotfint_tmo = timeout(cs_event_softintr_timeout,
-		NULL, SOFTINT_TIMEOUT_TIME);
-	} else {
-	    mutex_exit(&cs_globals.global_lock);
-	}
-}
-
-/*
- * cs_socket_event_softintr - This function just does a cv_broadcast on behalf
- *				of the high-priority interrupt handler.
- *
- *	Note: There is no calling argument.
- */
-/*ARGSUSED*/
-uint32_t
-cs_socket_event_softintr(caddr_t notused)
-{
-	cs_socket_t *sp;
-	uint32_t sn;
-	int ret = DDI_INTR_UNCLAIMED;
-
-	/*
-	 * If the module is on it's way out, then don't bother
-	 *	to do anything else except return.
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	if ((cs_globals.init_state & GLOBAL_INIT_STATE_UNLOADING) ||
-				(cs_globals.init_state & GLOBAL_IN_SOFTINTR)) {
-		mutex_exit(&cs_globals.global_lock);
-
-		/*
-		 * Note that we return DDI_INTR_UNCLAIMED here
-		 *	since we don't want to be constantly
-		 *	called back.
-		 */
-		return (ret);
-	} else {
-	    cs_globals.init_state |= GLOBAL_IN_SOFTINTR;
-	    mutex_exit(&cs_globals.global_lock);
-	}
-
-	/*
-	 * Go through each socket and dispatch the appropriate events.
-	 *	We have to funnel everything through this one routine because
-	 *	we can't do a cv_broadcast from a high level interrupt handler
-	 *	and we also can't have more than one soft interrupt handler
-	 *	on a single dip and using the same handler address.
-	 */
-	for (sn = 0; sn < cs_globals.max_socket_num; sn++) {
-	    if ((sp = cs_get_sp(sn)) != NULL) {
-		if (sp->init_state & SOCKET_INIT_STATE_READY) {
-			/*
-			 * If we're being asked to unload CS, then don't bother
-			 *	waking up the socket event thread handler.
-			 */
-		    if (!(sp->flags & SOCKET_UNLOAD_MODULE) &&
-					(sp->flags & SOCKET_NEEDS_THREAD)) {
-			ret = DDI_INTR_CLAIMED;
-			mutex_enter(&sp->client_lock);
-			cv_broadcast(&sp->thread_cv);
-			mutex_exit(&sp->client_lock);
-		    } /* if (SOCKET_NEEDS_THREAD) */
-		} /* if (SOCKET_INIT_STATE_READY) */
-	    } /* cs_get_sp */
-	} /* for (sn) */
-
-	mutex_enter(&cs_globals.global_lock);
-	cs_globals.init_state &= ~GLOBAL_IN_SOFTINTR;
-	mutex_exit(&cs_globals.global_lock);
-
-	return (ret);
-}
-
-/*
- * cs_event_thread - This is the per-socket event thread.
- */
-static void
-cs_event_thread(uint32_t sn)
-{
-	cs_socket_t	*sp;
-	client_t	*client;
-	client_types_t	*ct;
-
-	if ((sp = cs_get_sp(sn)) == NULL)
-	    return;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 1) {
-	    cmn_err(CE_CONT, "cs_event_thread: socket %d thread started\n",
-								sp->socket_num);
-	}
-#endif
-
-	CALLB_CPR_INIT(&sp->cprinfo_cs, &sp->client_lock,
-					callb_generic_cpr, "cs_event_thread");
-
-	mutex_enter(&sp->client_lock);
-
-	for (;;) {
-
-	    CALLB_CPR_SAFE_BEGIN(&sp->cprinfo_cs);
-	    cv_wait(&sp->thread_cv, &sp->client_lock);
-	    CALLB_CPR_SAFE_END(&sp->cprinfo_cs, &sp->client_lock);
-
-	    mutex_enter(&sp->lock);
-	    sp->flags &= ~SOCKET_NEEDS_THREAD;
-	    mutex_exit(&sp->lock);
-
-	/*
-	 * Check to see if there are any special thread operations that
-	 *	we are being asked to perform.
-	 */
-	    if (sp->thread_state & SOCKET_THREAD_EXIT) {
-#ifdef	CS_DEBUG
-		if (cs_debug > 1) {
-		    cmn_err(CE_CONT, "cs_event_thread: socket %d "
-							"SOCKET_THREAD_EXIT\n",
-							sp->socket_num);
-		}
-#endif
-		CALLB_CPR_EXIT(&sp->cprinfo_cs);
-		cv_broadcast(&sp->caller_cv);	/* wakes up cs_deinit */
-		mutex_exit(&sp->client_lock);
-		return;
-	    } /* if (SOCKET_THREAD_EXIT) */
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_event_thread: socket %d sp->events 0x%x\n",
-							sp->socket_num,
-							(int)sp->events);
-	    }
-#endif
-
-	/*
-	 * Handle CS_EVENT_CARD_INSERTION events
-	 */
-	    if (sp->events & CS_EVENT_CARD_INSERTION) {
-		mutex_enter(&sp->lock);
-		sp->events &= ~CS_EVENT_CARD_INSERTION;
-		mutex_exit(&sp->lock);
-
-		/*
-		 * If we have a pending CS_EVENT_CARD_REMOVAL event it
-		 *	means that we likely got CD line bounce on the
-		 *	insertion, so terminate this processing.
-		 */
-		if ((sp->events & CS_EVENT_CARD_REMOVAL) == 0) {
-		    (void) cs_card_insertion(sp, CS_EVENT_CARD_INSERTION);
-		}
-#ifdef	CS_DEBUG
-		else if (cs_debug > 0) {
-			cmn_err(CE_CONT, "cs_event_thread: socket %d "
-					"CS_EVENT_CARD_REMOVAL event "
-					"terminating "
-					"CS_EVENT_CARD_INSERTION "
-					"processing\n", sp->socket_num);
-		    }
-#endif
-	} /* if (CS_EVENT_CARD_INSERTION) */
-
-	/*
-	 * Handle CS_EVENT_CARD_READY and CS_EVENT_READY_TIMEOUT events
-	 */
-	    if (sp->events & (CS_EVENT_CARD_READY | CS_EVENT_READY_TIMEOUT)) {
-		mutex_enter(&sp->lock);
-		sp->events &= ~(CS_EVENT_CARD_READY | CS_EVENT_READY_TIMEOUT);
-		mutex_exit(&sp->lock);
-		if (sp->thread_state & SOCKET_WAIT_FOR_READY) {
-		    mutex_enter(&sp->lock);
-		    sp->thread_state &= ~SOCKET_WAIT_FOR_READY;
-		    mutex_exit(&sp->lock);
-		    (void) cs_card_insertion(sp, CS_EVENT_CARD_READY);
-		} /* if (SOCKET_WAIT_FOR_READY) */
-	    } /* if (CS_EVENT_CARD_READY) */
-
-	/*
-	 * Handle CS_EVENT_SS_UPDATED events
-	 */
-	    if (sp->events & CS_EVENT_SS_UPDATED) {
-		mutex_enter(&sp->lock);
-		sp->events &= ~CS_EVENT_SS_UPDATED;
-		mutex_exit(&sp->lock);
-		(void) cs_card_insertion(sp, CS_EVENT_SS_UPDATED);
-	    } /* if (CS_EVENT_SS_UPDATED) */
-
-	/*
-	 * Handle CS_EVENT_STATUS_CHANGE events
-	 */
-	    if (sp->events & CS_EVENT_STATUS_CHANGE) {
-		event_t revent;
-
-		mutex_enter(&sp->cis_lock);
-		mutex_enter(&sp->lock);
-		sp->events &= ~CS_EVENT_STATUS_CHANGE;
-
-		/*
-		 * Go through each client and add any events that we saw to
-		 *	the client's event list if the client has that event
-		 *	enabled in their event mask.
-		 * Remove any events that may be pending for this client if
-		 *	the client's event mask says that the client doesn't
-		 *	want to see those events anymore. This handles the
-		 *	case where the client had an event enabled in it's
-		 *	event mask when the event came in but between that
-		 *	time and the time we're called here the client
-		 *	disabled that event.
-		 */
-		client = sp->client_list;
-
-		while (client) {
-			/*
-			 * Read the PRR (if it exists) and check for any events.
-			 * The PRR will only be read if the socket is in IO
-			 * mode, if there is a card in the socket, and if there
-			 * is a PRR.
-			 * We don't have to clear revent before we call the
-			 * cs_read_event_status function since it will
-			 * clear it before adding any current events.
-			 */
-		    if (client->flags & CLIENT_CARD_INSERTED) {
-			(void) cs_read_event_status(sp, client,
-							&revent, NULL, 0);
-
-			client->events = ((client->events | revent) &
-						(client->event_mask |
-							client->global_mask));
-		    } /* CLIENT_CARD_INSERTED */
-		    client = client->next;
-		} /* while (client) */
-
-		mutex_exit(&sp->lock);
-		mutex_exit(&sp->cis_lock);
-	    } /* if (CS_EVENT_STATUS_CHANGE) */
-
-	/*
-	 * We want to maintain the required event dispatching order as
-	 *	specified in the PCMCIA spec, so we cycle through all
-	 *	clients on this socket to make sure that they are
-	 *	notified in the correct order.
-	 */
-	    ct = &client_types[0];
-	    while (ct) {
-		/*
-		 * Point to the head of the client list for this socket, and go
-		 *	through each client to set up the client events as well
-		 *	as call the client's event handler directly if we have
-		 *	a high priority event that we need to tell the client
-		 *	about.
-		 */
-		client = sp->client_list;
-
-		if (ct->order & CLIENT_EVENTS_LIFO) {
-		    client_t *clp = NULL;
-
-		    while (client) {
-			clp = client;
-			client = client->next;
-		    }
-		    client = clp;
-		}
-
-		while (client) {
-		    if (client->flags & ct->type) {
-			    uint32_t bit = 0;
-			    event_t event;
-
-			while (client->events) {
-
-			    switch (event = CS_BIT_GET(client->events, bit)) {
-				/*
-				 * Clients always receive registration complete
-				 *	events, even if there is no card of
-				 *	their type currently in the socket.
-				 */
-				case CS_EVENT_REGISTRATION_COMPLETE:
-				    CLIENT_EVENT_CALLBACK(client, event,
-							CS_EVENT_PRI_LOW);
-				    break;
-				/*
-				 * The client only gets a card insertion event
-				 *	if there is currently a card in the
-				 *	socket that the client can control.
-				 *	The nexus determines this. We also
-				 *	prevent the client from receiving
-				 *	multiple CS_EVENT_CARD_INSERTION
-				 *	events without receiving intervening
-				 *	CS_EVENT_CARD_REMOVAL events.
-				 */
-				case CS_EVENT_CARD_INSERTION:
-				    if (cs_card_for_client(client)) {
-					int send_insertion;
-
-					mutex_enter(&sp->lock);
-					send_insertion = client->flags;
-					client->flags |=
-						(CLIENT_CARD_INSERTED |
-						CLIENT_SENT_INSERTION);
-					mutex_exit(&sp->lock);
-					if (!(send_insertion &
-						    CLIENT_SENT_INSERTION)) {
-					    CLIENT_EVENT_CALLBACK(client,
-						event, CS_EVENT_PRI_LOW);
-					} /* if (!CLIENT_SENT_INSERTION) */
-				    }
-				    break;
-				/*
-				 * The CS_EVENT_CARD_REMOVAL_LOWP is a low
-				 *	priority CS_EVENT_CARD_REMOVAL event.
-				 */
-				case CS_EVENT_CARD_REMOVAL_LOWP:
-				    mutex_enter(&sp->lock);
-				    client->flags &= ~CLIENT_SENT_INSERTION;
-				    mutex_exit(&sp->lock);
-				    CLIENT_EVENT_CALLBACK(client,
-							CS_EVENT_CARD_REMOVAL,
-							CS_EVENT_PRI_LOW);
-				    break;
-				/*
-				 * The hardware card removal events are handed
-				 *	to the client in cs_event at high
-				 *	priority interrupt time; this card
-				 *	removal event is a software-generated
-				 *	event.
-				 */
-				case CS_EVENT_CARD_REMOVAL:
-				    if (client->flags & CLIENT_CARD_INSERTED) {
-					mutex_enter(&sp->lock);
-					client->flags &=
-						~(CLIENT_CARD_INSERTED |
-						CLIENT_SENT_INSERTION);
-					mutex_exit(&sp->lock);
-					CLIENT_EVENT_CALLBACK(client, event,
-							CS_EVENT_PRI_LOW);
-				    }
-				    break;
-				/*
-				 * Write protect events require the info field
-				 *	of the client's event callback args to
-				 *	be zero if the card is not write
-				 *	protected and one if it is.
-				 */
-				case CS_EVENT_WRITE_PROTECT:
-				    if (client->flags & CLIENT_CARD_INSERTED) {
-					get_ss_status_t gs;
-
-					mutex_enter(&sp->cis_lock);
-					mutex_enter(&sp->lock);
-					(void) cs_read_event_status(sp, client,
-									NULL,
-									&gs, 0);
-					if (gs.CardState & SBM_WP) {
-					    client->event_callback_args.info =
-						(void *)
-						CS_EVENT_WRITE_PROTECT_WPON;
-					} else {
-					    client->event_callback_args.info =
-						(void *)
-						CS_EVENT_WRITE_PROTECT_WPOFF;
-					}
-					mutex_exit(&sp->lock);
-					mutex_exit(&sp->cis_lock);
-					CLIENT_EVENT_CALLBACK(client, event,
-							CS_EVENT_PRI_LOW);
-				    } /* CLIENT_CARD_INSERTED */
-				    break;
-				case CS_EVENT_CLIENT_INFO:
-				    CLIENT_EVENT_CALLBACK(client, event,
-							CS_EVENT_PRI_LOW);
-				    break;
-				case 0:
-				    break;
-				default:
-				    if (client->flags & CLIENT_CARD_INSERTED) {
-					CLIENT_EVENT_CALLBACK(client, event,
-							CS_EVENT_PRI_LOW);
-				    }
-				    break;
-			    } /* switch */
-			    mutex_enter(&sp->lock);
-			    CS_BIT_CLEAR(client->events, bit);
-			    mutex_exit(&sp->lock);
-			    bit++;
-			} /* while (client->events) */
-		    } /* if (ct->type) */
-		    if (ct->order & CLIENT_EVENTS_LIFO) {
-			client = client->prev;
-		    } else {
-			client = client->next;
-		    }
-		} /* while (client) */
-
-		ct = ct->next;
-	    } /* while (ct) */
-
-	/*
-	 * Handle CS_EVENT_CARD_REMOVAL events
-	 */
-	    if (sp->events & CS_EVENT_CARD_REMOVAL) {
-		mutex_enter(&sp->lock);
-		sp->events &= ~CS_EVENT_CARD_REMOVAL;
-		mutex_exit(&sp->lock);
-		(void) cs_card_removal(sp);
-	    } /* if (CS_EVENT_CARD_REMOVAL) */
-
-		/*
-		 * If someone is waiting for us to complete, signal them now.
-		 */
-	    if (sp->thread_state & SOCKET_WAIT_SYNC) {
-		mutex_enter(&sp->lock);
-		sp->thread_state &= ~SOCKET_WAIT_SYNC;
-		mutex_exit(&sp->lock);
-		cv_broadcast(&sp->caller_cv);
-	    } /* SOCKET_WAIT_SYNC */
-
-	} /* for (;;) */
-}
-
-/*
- * cs_card_for_client - checks to see if a card that the client can control
- *			is currently inserted in the socket.  Socket Services
- *			has to tell us if this is the case.
- */
-static int
-cs_card_for_client(client_t *client)
-{
-
-	/*
-	 * If the client has set the CS_EVENT_ALL_CLIENTS it means that they
-	 *	want to get all events for all clients, irrespective of
-	 *	whether or not there is a card in the socket.  Such clients
-	 *	have to be very careful if they touch the card hardware in
-	 *	any way to prevent causing problems for other clients on the
-	 *	same socket.  This flag will typically only be set by the
-	 *	"super-client" or CSI types of clients that wish to get
-	 *	information on other clients or cards in the system.
-	 * Note that the CS_EVENT_ALL_CLIENTS must be set in either the
-	 *	client's global event mask or client event mask.
-	 * The client must also have registered as a "super-client" or as a
-	 *	CSI client for this socket.
-	 */
-	if ((client->flags & (CLIENT_SUPER_CLIENT | CLIENT_CSI_CLIENT)) &&
-			((client->global_mask | client->event_mask) &
-							CS_EVENT_ALL_CLIENTS))
-	    return (1);
-
-	/*
-	 * Look for the PCM_DEV_ACTIVE property on this client's dip; if
-	 *	it's found, it means that this client can control the card
-	 *	that is currently in the socket.  This is a boolean
-	 *	property managed by Socket Services.
-	 */
-	if (ddi_getprop(DDI_DEV_T_ANY, client->dip,    (DDI_PROP_CANSLEEP |
-							DDI_PROP_NOTPROM),
-							PCM_DEV_ACTIVE, NULL)) {
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_card_for_client: client handle 0x%x "
-					"driver [%s] says %s found\n",
-						(int)client->client_handle,
-						client->driver_name,
-						PCM_DEV_ACTIVE);
-	    }
-#endif
-	    return (1);
-	}
-
-	return (0);
-}
-
-/*
- * cs_ss_thread - This is the Socket Services work thread. We fire off
- *			any calls to Socket Services here that we want
- *			to run on a thread that is seperate from the
- *			per-socket event thread.
- */
-static void
-cs_ss_thread(uint32_t sn)
-{
-	cs_socket_t *sp;
-
-	if ((sp = cs_get_sp(sn)) == NULL)
-	    return;
-
-	/*
-	 * Tell CPR that we've started a new thread.
-	 */
-	CALLB_CPR_INIT(&sp->cprinfo_ss, &sp->ss_thread_lock,
-					callb_generic_cpr, "cs_ss_thread");
-
-	mutex_enter(&sp->ss_thread_lock);
-
-	for (;;) {
-
-	    CALLB_CPR_SAFE_BEGIN(&sp->cprinfo_ss);
-	    cv_wait(&sp->ss_thread_cv, &sp->ss_thread_lock);
-	    CALLB_CPR_SAFE_END(&sp->cprinfo_ss, &sp->ss_thread_lock);
-
-		/*
-		 * Check to see if there are any special thread operations
-		 * that we are being asked to perform.
-		 */
-	    if (sp->ss_thread_state & SOCKET_THREAD_EXIT) {
-#ifdef	CS_DEBUG
-		if (cs_debug > 1) {
-		    cmn_err(CE_CONT, "cs_ss_thread: socket %d "
-					"SOCKET_THREAD_EXIT\n",
-						sp->socket_num);
-		}
-#endif
-		CALLB_CPR_EXIT(&sp->cprinfo_ss);
-		cv_broadcast(&sp->ss_caller_cv);	/* wake up cs_deinit */
-		mutex_exit(&sp->ss_thread_lock);
-		return;
-	    } /* if (SOCKET_THREAD_EXIT) */
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_ss_thread: socket %d "
-					"ss_thread_state = 0x%x\n",
-						(int)sp->socket_num,
-						(int)sp->ss_thread_state);
-	    }
-#endif
-
-		/*
-		 * Call SocketServices(CSCISInit) to have SS parse the
-		 *	CIS and load/attach any client drivers necessary.
-		 */
-	    if (sp->ss_thread_state & SOCKET_THREAD_CSCISInit) {
-
-		sp->ss_thread_state &= ~SOCKET_THREAD_CSCISInit;
-
-		if (!(sp->flags & SOCKET_CARD_INSERTED)) {
-		    cmn_err(CE_CONT, "cs_ss_thread %d "
-					"card NOT inserted\n",
-					sp->socket_num);
-		}
-
-#ifdef	CS_DEBUG
-		if (cs_debug > 1) {
-		    cmn_err(CE_CONT, "cs_ss_thread: socket %d calling "
-						"CSCISInit\n", sp->socket_num);
-		}
-#endif
-
-		/*
-		 * Tell SS that we have a complete CIS and that it can now
-		 *	be parsed.
-		 * Note that in some cases the client driver may block in
-		 *	their attach routine, causing this call to block until
-		 *	the client completes their attach.
-		 */
-		SocketServices(CSCISInit, sp->socket_num);
-
-		/*
-		 * Set the CS_EVENT_SS_UPDATED event for this socket so that the
-		 *	event thread can continue any card insertion processing
-		 *	that it has to do.
-		 */
-		mutex_enter(&sp->lock);
-		sp->events |= CS_EVENT_SS_UPDATED;
-		mutex_exit(&sp->lock);
-
-		/*
-		 * Wake up this socket's event thread so that clients can
-		 *	continue any card insertion or attach processing
-		 *	that they need to do.
-		 */
-		cv_broadcast(&sp->thread_cv);
-	    } /* if ST_CSCISInit */
-
-	} /* for (;;) */
-}
-
-/*
- * cs_request_socket_mask - set the client's event mask as well as causes
- *				any events pending from RegisterClient to
- *				be scheduled to be sent to the client
- */
-static int
-cs_request_socket_mask(client_handle_t client_handle,
-					request_socket_mask_t *se)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If this client has already done a RequestSocketMask without
-	 *	a corresponding ReleaseSocketMask, then return an error.
-	 */
-	if (client->flags & REQ_SOCKET_MASK_DONE) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_IN_USE);
-	}
-
-	/*
-	 * Set up the event mask information; we copy this directly from
-	 *	the client; since we are the only source of events, any
-	 *	bogus bits that the client puts in here won't matter
-	 *	because we'll never look at them.
-	 */
-	client->event_mask = se->EventMask;
-
-	/*
-	 * If RegisterClient left us some events to process, set these
-	 *	events up here.
-	 */
-	if (client->pending_events) {
-	    client->events |= client->pending_events;
-	    client->pending_events = 0;
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_request_socket_mask: client_handle = 0x%x "
-				"driver_name = [%s] events = 0x%x\n",
-					(int)client->client_handle,
-					client->driver_name,
-					(int)client->events);
-	    }
-#endif
-	}
-
-	client->flags |= REQ_SOCKET_MASK_DONE;
-
-	/*
-	 * Merge all the clients' event masks and set the socket
-	 *	to generate the appropriate events.
-	 */
-	(void) cs_set_socket_event_mask(sp, cs_merge_event_masks(sp, client));
-
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Wakeup the event thread if there are any client events to process.
-	 */
-	if (client->events) {
-	    cv_broadcast(&sp->thread_cv);
-#ifdef	CS_DEBUG
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_request_socket_mask: did cv_broadcast for "
-				"client_handle = 0x%x "
-				"driver_name = [%s] events = 0x%x\n",
-					(int)client->client_handle,
-					client->driver_name,
-					(int)client->events);
-	    }
-#endif
-
-	}
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_release_socket_mask - clear the client's event mask
- *
- * Once this function returns, the client is guaranteed
- *	not to get any more event callbacks.
- */
-/*ARGSUSED*/
-static int
-cs_release_socket_mask(client_handle_t client_handle,
-					release_socket_mask_t *rsm)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If this client has already done a RequestSocketMask without
-	 *	a corresponding ReleaseSocketMask, then return an error.
-	 */
-	if (!(client->flags & REQ_SOCKET_MASK_DONE)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-	/*
-	 * Clear both the client event mask and the global event mask.
-	 *	We clear both since the semantics of this function are
-	 *	that once it returns, the client will not be called at
-	 *	it's event handler for any events until RequestSocketMask
-	 *	is called again.
-	 */
-	client->event_mask = 0;
-	client->global_mask = 0;
-	client->flags &= ~REQ_SOCKET_MASK_DONE;
-
-	/*
-	 * Merge all the clients' event masks and set the socket
-	 *	to generate the appropriate events.
-	 */
-	(void) cs_set_socket_event_mask(sp, cs_merge_event_masks(sp, client));
-
-	mutex_exit(&sp->lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_get_event_mask - return the event mask for this client
- */
-static int
-cs_get_event_mask(client_handle_t client_handle, sockevent_t *se)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-#ifdef	XXX
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 * XXX - how can a client get their event masks if their card
-	 *	goes away?
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-#endif
-
-	/*
-	 * We are only allowed to get the client event mask if a
-	 *	RequestSocketMask has been called previously.  We
-	 *	are allowed to get the global event mask at any
-	 *	time.
-	 * The global event mask is initially set by the client
-	 *	in the call to RegisterClient.  The client event
-	 *	mask is set by the client in calls to SetEventMask
-	 *	and RequestSocketMask and gotten in calls to
-	 *	GetEventMask.
-	 */
-	if (se->Attributes & CONF_EVENT_MASK_CLIENT) {
-	    if (!(client->flags & REQ_SOCKET_MASK_DONE)) {
-		mutex_exit(&sp->lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_SOCKET);
-	    }
-	    se->EventMask = client->event_mask;
-	} else {
-	    se->EventMask = client->global_mask;
-	}
-
-	mutex_exit(&sp->lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_set_event_mask - set the event mask for this client
- */
-static int
-cs_set_event_mask(client_handle_t client_handle, sockevent_t *se)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-#ifdef	XXX
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-#endif
-
-	/*
-	 * We are only allowed to set the client event mask if a
-	 *	RequestSocketMask has been called previously.  We
-	 *	are allowed to set the global event mask at any
-	 *	time.
-	 * The global event mask is initially set by the client
-	 *	in the call to RegisterClient.  The client event
-	 *	mask is set by the client in calls to SetEventMask
-	 *	and RequestSocketMask and gotten in calls to
-	 *	GetEventMask.
-	 */
-	if (se->Attributes & CONF_EVENT_MASK_CLIENT) {
-	    if (!(client->flags & REQ_SOCKET_MASK_DONE)) {
-		mutex_exit(&sp->lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_SOCKET);
-	    }
-	    client->event_mask = se->EventMask;
-	} else {
-	    client->global_mask = se->EventMask;
-	}
-
-	/*
-	 * Merge all the clients' event masks and set the socket
-	 *	to generate the appropriate events.
-	 */
-	(void) cs_set_socket_event_mask(sp, cs_merge_event_masks(sp, client));
-
-	mutex_exit(&sp->lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_read_event_status - handles PRR events and returns card status
- *
- *	calling: *sp - socket struct point
- *		 *client - client to check events on
- *		 *revent - pointer to event mask to update; if NULL, will
- *				not be updated, if non-NULL, will be updated
- *				with CS-format events; it is NOT necessary
- *				to clear this value before calling this
- *				function
- *		 *gs - pointer to a get_ss_status_t used for the SS GetStatus
- *				call; it is not necessary to initialize any
- *				members in this structure; set to NULL if
- *				not used
- *		flags - if CS_RES_IGNORE_NO_CARD is set, the check for a
- *				card present will not be done
- *
- *	returns: CS_SUCCESS
- *		 CS_NO_CARD - if no card is in the socket and the flags arg
- *				is not set to CS_RES_IGNORE_NO_CARD
- *		 CS_BAD_SOCKET - if the SS_GetStatus function returned an
- *					error
- *
- *	Note that if the client that configured this socket has told us that
- *		the READY pin in the PRR isn't valid and the socket is in IO
- *		mode, we always return that the card is READY.
- *
- *	Note that if gs is not NULL, the current card state will be returned
- *		in the gs->CardState member; this will always reflect the
- *		current card state and the state will come from both the
- *		SS_GetStatus call and the PRR, whichever is appropriate for
- *		the mode that the socket is currently in.
- */
-static int
-cs_read_event_status(cs_socket_t *sp, client_t *client, event_t *revent,
-						get_ss_status_t *gs, int flags)
-{
-	cfg_regs_t prrd = 0;
-
-	/*
-	 * SOCKET_IS_IO will only be set if a RequestConfiguration
-	 *	has been done by at least one client on this socket.
-	 * If there isn't a card in the socket or the caller wants to ignore
-	 *	whether the card is in the socket or not, get the current
-	 *	card status.
-	 */
-	if ((sp->flags & SOCKET_CARD_INSERTED) ||
-					(flags & CS_RES_IGNORE_NO_CARD)) {
-	    if (sp->flags & SOCKET_IS_IO) {
-		if (client->present & CONFIG_PINREPL_REG_PRESENT) {
-		    acc_handle_t cis_handle;
-		    uint32_t newoffset = client->config_regs_offset;
-
-			/*
-			 * Get a handle to the CIS window
-			 */
-		    if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-					CISTPLF_AM_SPACE) != CS_SUCCESS) {
-			cmn_err(CE_CONT, "cs_read_event_status: socket %d "
-					    "can't init CIS window\n",
-							sp->socket_num);
-			return (CS_GENERAL_FAILURE);
-		    } /* cs_init_cis_window */
-
-		    prrd = csx_Get8(cis_handle, client->config_regs.prr_p);
-		    prrd &= client->pin;
-
-#ifdef	CS_DEBUG
-		    if (cs_debug > 1) {
-			cmn_err(CE_CONT, "cs_read_event_status: "
-						"prrd 0x%x client->pin 0x%x\n",
-								(int)prrd,
-								client->pin);
-			cmn_err(CE_CONT, "PRR(1) = [%s%s%s%s%s%s%s%s]\n",
-						((prrd & PRR_WP_STATUS)?
-							"PRR_WP_STATUS ":""),
-						((prrd & PRR_READY_STATUS)?
-							"PRR_READY_STATUS ":""),
-						((prrd & PRR_BVD2_STATUS)?
-							"PRR_BVD2_STATUS ":""),
-						((prrd & PRR_BVD1_STATUS)?
-							"PRR_BVD1_STATUS ":""),
-						((prrd & PRR_WP_EVENT)?
-							"PRR_WP_EVENT ":""),
-						((prrd & PRR_READY_EVENT)?
-							"PRR_READY_EVENT ":""),
-						((prrd & PRR_BVD2_EVENT)?
-							"PRR_BVD2_EVENT ":""),
-						((prrd & PRR_BVD1_EVENT)?
-							"PRR_BVD1_EVENT ":""));
-		    }
-#endif
-
-			/*
-			 * The caller wants the event changes sent back and
-			 * the PRR event change bits cleared.
-			 */
-		    if (revent) {
-			get_socket_t get_socket;
-			set_socket_t set_socket;
-
-			/*
-			 * Bug ID: 1193636 - Card Services sends bogus
-			 *	events on CS_EVENT_STATUS_CHANGE events
-			 * Clear this before we OR-in any values.
-			 */
-			*revent = 0;
-
-			PRR_EVENT(prrd, PRR_WP_EVENT, PRR_WP_STATUS,
-					CS_EVENT_WRITE_PROTECT, *revent);
-
-			PRR_EVENT(prrd, PRR_READY_EVENT, PRR_READY_STATUS,
-					CS_EVENT_CARD_READY, *revent);
-
-			PRR_EVENT(prrd, PRR_BVD2_EVENT, PRR_BVD2_STATUS,
-					CS_EVENT_BATTERY_LOW, *revent);
-
-			PRR_EVENT(prrd, PRR_BVD1_EVENT, PRR_BVD1_STATUS,
-					CS_EVENT_BATTERY_DEAD, *revent);
-
-
-#ifdef	CS_DEBUG
-			if (cs_debug > 1) {
-
-			    cmn_err(CE_CONT, "PRR() = [%s%s%s%s%s%s%s%s]\n",
-						((prrd & PRR_WP_STATUS)?
-							"PRR_WP_STATUS ":""),
-						((prrd & PRR_READY_STATUS)?
-							"PRR_READY_STATUS ":""),
-						((prrd & PRR_BVD2_STATUS)?
-							"PRR_BVD2_STATUS ":""),
-						((prrd & PRR_BVD1_STATUS)?
-							"PRR_BVD1_STATUS ":""),
-						((prrd & PRR_WP_EVENT)?
-							"PRR_WP_EVENT ":""),
-						((prrd & PRR_READY_EVENT)?
-							"PRR_READY_EVENT ":""),
-						((prrd & PRR_BVD2_EVENT)?
-							"PRR_BVD2_EVENT ":""),
-						((prrd & PRR_BVD1_EVENT)?
-							"PRR_BVD1_EVENT ":""));
-			}
-#endif
-
-			if (prrd)
-			    csx_Put8(cis_handle, client->config_regs.prr_p,
-				prrd);
-
-			/*
-			 * We now have to reenable the status change interrupts
-			 *	if there are any valid bits in the PRR. Since
-			 *	the BVD1 signal becomes the STATUS_CHANGE
-			 *	signal when the socket is in IO mode, we just
-			 *	have to set the SBM_BVD1 enable bit in the
-			 *	event mask.
-			 */
-			if (client->pin) {
-			    get_socket.socket = sp->socket_num;
-			    SocketServices(SS_GetSocket, &get_socket);
-			    set_socket.socket = sp->socket_num;
-			    set_socket.SCIntMask =
-					get_socket.SCIntMask | SBM_BVD1;
-			    set_socket.VccLevel = get_socket.VccLevel;
-			    set_socket.Vpp1Level = get_socket.Vpp1Level;
-			    set_socket.Vpp2Level = get_socket.Vpp2Level;
-			    set_socket.IREQRouting = get_socket.IRQRouting;
-			    set_socket.IFType = get_socket.IFType;
-			    set_socket.CtlInd = get_socket.CtlInd;
-			    set_socket.State = get_socket.state;
-			    SocketServices(SS_SetSocket, &set_socket);
-			} /* if (client->pin) */
-		    } /* if (revent) */
-
-		} /* if (CONFIG_PINREPL_REG_PRESENT) */
-	    } /* if (SOCKET_IS_IO) */
-
-	/*
-	 * The caller wants the current card state; we just read
-	 *	it and return a copy of it but do not clear any of
-	 *	the event changed bits (if we're reading the PRR).
-	 */
-	    if (gs) {
-		gs->socket = sp->socket_num;
-		gs->CardState = 0;
-		if (SocketServices(SS_GetStatus, gs) != SUCCESS)
-		    return (CS_BAD_SOCKET);
-		if (sp->flags & SOCKET_IS_IO) {
-		/*
-		 * If the socket is in IO mode, then clear the
-		 *	gs->CardState bits that are now in the PRR
-		 */
-		    gs->CardState &= ~(SBM_WP | SBM_BVD1 |
-						SBM_BVD2 | SBM_RDYBSY);
-
-		/*
-		 * Convert PRR status to SS_GetStatus status
-		 */
-		    if (prrd & PRR_WP_STATUS)
-			gs->CardState |= SBM_WP;
-		    if (prrd & PRR_BVD2_STATUS)
-			gs->CardState |= SBM_BVD2;
-		    if (prrd & PRR_BVD1_STATUS)
-			gs->CardState |= SBM_BVD1;
-
-		/*
-		 * If the client has indicated that there is no
-		 *	PRR or that the READY bit in the PRR isn't
-		 *	valid, then we simulate the READY bit by
-		 *	always returning READY.
-		 */
-		    if (!(client->present & CONFIG_PINREPL_REG_PRESENT) ||
-			((client->present & CONFIG_PINREPL_REG_PRESENT) &&
-			!((client->pin &
-			    (PRR_READY_STATUS | PRR_READY_EVENT)) ==
-				(PRR_READY_STATUS | PRR_READY_EVENT))) ||
-				(prrd & PRR_READY_STATUS))
-			gs->CardState |= SBM_RDYBSY;
-
-#ifdef	CS_DEBUG
-			if (cs_debug > 1) {
-			    cmn_err(CE_CONT, "cs_read_event_status: prrd 0x%x "
-				"client->pin 0x%x "
-				"gs->CardState 0x%x\n",
-				prrd, client->pin, gs->CardState);
-			}
-#endif
-
-		} /* if (SOCKET_IS_IO) */
-	    } /* if (gs) */
-	    return (CS_SUCCESS);
-	} /* if (SOCKET_CARD_INSERTED) */
-
-	return (CS_NO_CARD);
-}
-
-/*
- * cs_get_status - gets live card status and latched card status changes
- *			supports the GetStatus CS call
- *
- *	returns: CS_SUCCESS
- *		 CS_BAD_HANDLE if the passed client handle is invalid
- *
- *	Note: This function resets the latched status values maintained
- *		by Socket Services
- */
-static int
-cs_get_status(client_handle_t client_handle, get_status_t *gs)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	get_ss_status_t get_ss_status;
-	get_socket_t get_socket;
-	set_socket_t set_socket;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't do anything except for return success.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_SUCCESS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * Get the current card status as well as the latched card
-	 *	state.  Set the CS_RES_IGNORE_NO_CARD so that even
-	 *	if there is no card in the socket we'll still get
-	 *	a valid status.
-	 * Note that it is not necessary to initialize any values
-	 *	in the get_ss_status structure.
-	 */
-	mutex_enter(&sp->cis_lock);
-	if ((error = cs_read_event_status(sp, client, NULL, &get_ss_status,
-					CS_RES_IGNORE_NO_CARD)) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	mutex_exit(&sp->cis_lock);
-
-	gs->raw_CardState = cs_sbm2cse(get_ss_status.CardState);
-
-	/*
-	 * Assign the "live" card state to the "real" card state. If there's
-	 *	no card in the socket or the card in the socket is not
-	 *	for this client, then we lie and tell the caller that the
-	 *	card is not inserted.
-	 */
-	gs->CardState = gs->raw_CardState;
-	if (!(client->flags & CLIENT_CARD_INSERTED))
-	    gs->CardState &= ~CS_EVENT_CARD_INSERTION;
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	get_socket.socket = sp->socket_num;
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS)
-	    return (CS_BAD_SOCKET);
-
-	gs->SocketState = cs_sbm2cse(get_socket.state);
-
-	set_socket.socket = sp->socket_num;
-	set_socket.SCIntMask = get_socket.SCIntMask;
-	set_socket.VccLevel = get_socket.VccLevel;
-	set_socket.Vpp1Level = get_socket.Vpp1Level;
-	set_socket.Vpp2Level = get_socket.Vpp2Level;
-	set_socket.IREQRouting = get_socket.IRQRouting;
-	set_socket.IFType = get_socket.IFType;
-	set_socket.CtlInd = get_socket.CtlInd;
-	/* XXX (is ~0 correct here?) reset latched values */
-	set_socket.State = (unsigned)~0;
-
-	if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS)
-	    return (CS_BAD_SOCKET);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_cse2sbm - converts a CS event mask to an SS (SBM_XXX) event mask
- */
-static event_t
-cs_cse2sbm(event_t event_mask)
-{
-	event_t sbm_event = 0;
-
-	/*
-	 * XXX - we need to handle PM_CHANGE and RESET here as well
-	 */
-	if (event_mask & CS_EVENT_WRITE_PROTECT)
-	    sbm_event |= SBM_WP;
-	if (event_mask & CS_EVENT_BATTERY_DEAD)
-	    sbm_event |= SBM_BVD1;
-	if (event_mask & CS_EVENT_BATTERY_LOW)
-	    sbm_event |= SBM_BVD2;
-	if (event_mask & CS_EVENT_CARD_READY)
-	    sbm_event |= SBM_RDYBSY;
-	if (event_mask & CS_EVENT_CARD_LOCK)
-	    sbm_event |= SBM_LOCKED;
-	if (event_mask & CS_EVENT_EJECTION_REQUEST)
-	    sbm_event |= SBM_EJECT;
-	if (event_mask & CS_EVENT_INSERTION_REQUEST)
-	    sbm_event |= SBM_INSERT;
-	if (event_mask & (CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL))
-	    sbm_event |= SBM_CD;
-
-	return (sbm_event);
-}
-
-/*
- * cs_sbm2cse - converts SBM_xxx state to CS event bits
- *
- * This function should never set any of the following bits:
- *
- *		CS_EVENT_MTD_REQUEST
- *		CS_EVENT_CLIENT_INFO
- *		CS_EVENT_TIMER_EXPIRED
- *		CS_EVENT_CARD_REMOVAL
- *		CS_EVENT_CARD_REMOVAL_LOWP
- *		CS_EVENT_ALL_CLIENTS
- *		CS_EVENT_READY_TIMEOUT
- *
- *	These bits are defined in the CS_STATUS_XXX series and are
- *	used by GetStatus.
- */
-static uint32_t
-cs_sbm2cse(uint32_t state)
-{
-	uint32_t rstate = 0;
-
-	/*
-	 * XXX - we need to handle PM_CHANGE and RESET here as well
-	 */
-	if (state & SBM_WP)
-	    rstate |= CS_EVENT_WRITE_PROTECT;
-	if (state & SBM_BVD1)
-	    rstate |= CS_EVENT_BATTERY_DEAD;
-	if (state & SBM_BVD2)
-	    rstate |= CS_EVENT_BATTERY_LOW;
-	if (state & SBM_RDYBSY)
-	    rstate |= CS_EVENT_CARD_READY;
-	if (state & SBM_LOCKED)
-	    rstate |= CS_EVENT_CARD_LOCK;
-	if (state & SBM_EJECT)
-	    rstate |= CS_EVENT_EJECTION_REQUEST;
-	if (state & SBM_INSERT)
-	    rstate |= CS_EVENT_INSERTION_REQUEST;
-	if (state & SBM_CD)
-	    rstate |= CS_EVENT_CARD_INSERTION;
-
-	return (rstate);
-}
-
-/*
- * cs_merge_event_masks - merge the CS global socket event mask with the
- *				passed client's event masks
- */
-static unsigned
-cs_merge_event_masks(cs_socket_t *sp, client_t *client)
-{
-	unsigned SCIntMask;
-	uint32_t event_mask;
-
-	/*
-	 * We always want to see card detect and status change events.
-	 */
-	SCIntMask = SBM_CD;
-
-	event_mask = client->event_mask | client->global_mask |
-							sp->event_mask;
-
-	if (!(sp->flags & SOCKET_IS_IO)) {
-	    SCIntMask |= cs_cse2sbm(event_mask);
-	} else {
-		/*
-		 * If the socket is in IO mode and there is a PRR present,
-		 *	then we may need to enable PCE_CARD_STATUS_CHANGE
-		 *	events.
-		 */
-	    if (client->present & CONFIG_PINREPL_REG_PRESENT) {
-
-		SCIntMask |= (cs_cse2sbm(event_mask) &
-				~(SBM_WP | SBM_BVD1 | SBM_BVD2 | SBM_RDYBSY));
-
-		if ((client->pin & (PRR_WP_STATUS | PRR_WP_EVENT)) ==
-					(PRR_WP_STATUS | PRR_WP_EVENT))
-		    if (event_mask & CS_EVENT_WRITE_PROTECT)
-			SCIntMask |= SBM_BVD1;
-
-		if ((client->pin & (PRR_READY_STATUS | PRR_READY_EVENT)) ==
-					(PRR_READY_STATUS | PRR_READY_EVENT))
-		    if (event_mask & CS_EVENT_CARD_READY)
-			    SCIntMask |= SBM_BVD1;
-
-		if ((client->pin & (PRR_BVD2_STATUS | PRR_BVD2_EVENT)) ==
-					(PRR_BVD2_STATUS | PRR_BVD2_EVENT))
-		    if (event_mask & CS_EVENT_BATTERY_LOW)
-			    SCIntMask |= SBM_BVD1;
-
-		if ((client->pin & (PRR_BVD1_STATUS | PRR_BVD1_EVENT)) ==
-					(PRR_BVD1_STATUS | PRR_BVD1_EVENT))
-		    if (event_mask & CS_EVENT_BATTERY_DEAD)
-			    SCIntMask |= SBM_BVD1;
-
-	    } /* if (CONFIG_PINREPL_REG_PRESENT) */
-	} /* if (!SOCKET_IS_IO) */
-
-	return (SCIntMask);
-}
-
-/*
- * cs_set_socket_event_mask - set the event mask for the socket
- */
-static int
-cs_set_socket_event_mask(cs_socket_t *sp, unsigned event_mask)
-{
-	get_socket_t get_socket;
-	set_socket_t set_socket;
-
-	get_socket.socket = sp->socket_num;
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS)
-	    return (CS_BAD_SOCKET);
-
-	set_socket.socket = sp->socket_num;
-	set_socket.SCIntMask = event_mask;
-	set_socket.VccLevel = get_socket.VccLevel;
-	set_socket.Vpp1Level = get_socket.Vpp1Level;
-	set_socket.Vpp2Level = get_socket.Vpp2Level;
-	set_socket.IREQRouting = get_socket.IRQRouting;
-	set_socket.IFType = get_socket.IFType;
-	set_socket.CtlInd = get_socket.CtlInd;
-	/* XXX (is ~0 correct here?) reset latched values */
-	set_socket.State = (unsigned)~0;
-
-	if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS)
-	    return (CS_BAD_SOCKET);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== MTD handling section ====
- */
-static int
-cs_deregister_mtd(client_handle_t client_handle)
-{
-
-	cmn_err(CE_CONT, "cs_deregister_mtd: client_handle 0x%x\n",
-							(int)client_handle);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== memory window handling section ====
- */
-
-/*
- * cs_request_window  - searches through window list for the socket to find a
- *			memory window that matches the requested criteria;
- *			this is RequestWindow
- *
- * calling:  cs_request_window(client_handle_t, *window_handle_t, win_req_t *)
- *
- *	On sucessful return, the window_handle_t * pointed to will
- *		contain a valid window handle for this window.
- *
- *	returns: CS_SUCCESS - if window found
- *		 CS_OUT_OF_RESOURCE - if no windows match requirements
- *		 CS_BAD_HANDLE - client handle is invalid
- *		 CS_BAD_SIZE - if requested size can not be met
- *		 CS_BAD_WINDOW - if an internal error occured
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_NO_CARD - if no card is in socket
- *		 CS_BAD_ATTRIBUTE - if any of the unsupported Attrbute
- *					flags are set
- */
-static int
-cs_request_window(client_handle_t client_handle,
-				window_handle_t *wh,
-				win_req_t *rw)
-{
-	cs_socket_t *sp;
-	cs_window_t *cw;
-	client_t *client;
-	modify_win_t mw;
-	inquire_window_t iw;
-	uint32_t aw;
-	int error;
-	int client_lock_acquired;
-	uint32_t socket_num;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Make sure that none of the unsupported flags are set.
-	 */
-	if (rw->Attributes &   (/* Compatability */
-				WIN_PAGED |
-				WIN_SHARED |
-				WIN_FIRST_SHARED |
-				WIN_BINDING_SPECIFIC |
-				/* CS internal */
-				WIN_DATA_WIDTH_VALID |
-				/* IO window flags */
-				WIN_MEMORY_TYPE_IO |
-				/* CardBus flags */
-				WIN_DATA_WIDTH_32 |
-				WIN_PREFETCH_CACHE_MASK |
-				WIN_BAR_MASK))
-	    return (CS_BAD_ATTRIBUTE);
-
-	mutex_enter(&cs_globals.window_lock);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_NO_CARD);
-	}
-
-	mutex_exit(&sp->lock);
-
-	socket_num = CS_MAKE_SOCKET_NUMBER(GET_CLIENT_SOCKET(client_handle),
-	    GET_CLIENT_FUNCTION(client_handle));
-
-
-	/*
-	 * See if we can find a window that matches the caller's criteria.
-	 *	If we can't, then thre's not much more that we can do except
-	 *	for return an error.
-	 */
-	if ((error = cs_find_mem_window(sp->socket_num, rw, &aw)) !=
-								CS_SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	/*
-	 * We got a window, now synthesize a new window handle for this
-	 *	client and get a pointer to the global window structs
-	 *	and assign this window to this client.
-	 * We don't have to check for errors from cs_create_window_handle
-	 *	since that function always returns a valid window handle
-	 *	if it is given a valid window number.
-	 */
-	*wh = cs_create_window_handle(aw);
-	if ((cw = cs_get_wp(aw)) == NULL) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_WINDOW);
-	}
-
-	cw->window_handle = *wh;
-	cw->client_handle = client_handle;
-	cw->socket_num = sp->socket_num;
-	cw->state |= (CW_ALLOCATED | CW_MEM);
-
-	mw.Attributes = (
-				rw->Attributes |
-				WIN_DATA_WIDTH_VALID |
-				WIN_ACCESS_SPEED_VALID);
-	mw.AccessSpeed = rw->win_params.AccessSpeed;
-
-	if ((error = cs_modify_mem_window(*wh, &mw, rw, socket_num)) !=
-	    CS_SUCCESS) {
-	    cw->state = 0;
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	/*
-	 * Get any required card offset and pass it back to the client.
-	 *	This is not defined in the current PCMCIA spec.  It is
-	 *	an aid to clients that want to use it to generate an
-	 *	optimum card offset.
-	 */
-	iw.window = GET_WINDOW_NUMBER(*wh);
-	SocketServices(SS_InquireWindow, &iw);
-
-	if (iw.mem_win_char.MemWndCaps & WC_CALIGN)
-	    rw->ReqOffset = rw->Size;
-	else
-	    rw->ReqOffset = iw.mem_win_char.ReqOffset;
-
-	/*
-	 * Increment the client's memory window count; this is how we know
-	 *	when a client has any allocated memory windows.
-	 */
-	client->memwin_count++;
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_release_window - deallocates the window associated with the passed
- *			window handle; this is ReleaseWindow
- *
- *	returns: CS_SUCCESS if window handle is valid and window was
- *			sucessfully deallocated
- *		 CS_BAD_HANDLE if window handle is invalid or if window
- *			handle is valid but window is not allocated
- */
-static int
-cs_release_window(window_handle_t wh)
-{
-	cs_socket_t *sp;
-	cs_window_t *cw;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	mutex_enter(&cs_globals.window_lock);
-
-	if (!(cw = cs_find_window(wh))) {
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_HANDLE);
-	}
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(cw->client_handle)) {
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_UNSUPPORTED_FUNCTION);
-	}
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(cw->client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(cw->client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	/*
-	 * Mark this window as not in use anymore.
-	 */
-	cw->state &= ~CW_WIN_IN_USE;
-
-	/*
-	 * Decrement the client's memory window count; this is how we know
-	 *	when a client has any allocated memory windows.
-	 */
-	if (!(--(client->memwin_count)))
-	    client->flags &= ~CLIENT_WIN_ALLOCATED;
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_modify_window - modifies a window's characteristics; this is ModifyWindow
- */
-static int
-cs_modify_window(window_handle_t wh, modify_win_t *mw)
-{
-	cs_socket_t *sp;
-	cs_window_t *cw;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-
-	mutex_enter(&cs_globals.window_lock);
-
-	/*
-	 * Do some sanity checking - make sure that we can find a pointer
-	 *	to the window structure, and if we can, get the client that
-	 *	has allocated that window.
-	 */
-	if (!(cw = cs_find_window(wh))) {
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_HANDLE);
-	}
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(cw->client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	if (!(client = cs_find_client(cw->client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_NO_CARD);
-	}
-
-	mutex_exit(&sp->lock);
-
-	mw->Attributes &= (
-				WIN_MEMORY_TYPE_MASK |
-				WIN_ENABLE |
-				WIN_ACCESS_SPEED_VALID |
-				WIN_ACC_ENDIAN_MASK |
-				WIN_ACC_ORDER_MASK);
-
-	mw->Attributes &= ~WIN_DATA_WIDTH_VALID;
-
-	if ((error = cs_modify_mem_window(wh, mw, NULL, NULL)) != CS_SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_modify_mem_window - modifies a window's characteristics; used internally
- *				by Card Services
- *
- *    If *wr is NULL, it means that we're being called by ModifyWindow
- *    If *wr is non-NULL, it means that we are being called by RequestWindow
- *	and so we can't use SS_GetWindow.
- */
-static int
-cs_modify_mem_window(window_handle_t wh, modify_win_t *mw,
-						win_req_t *wr, int sn)
-{
-	get_window_t gw;
-	set_window_t sw;
-	set_page_t set_page;
-	get_page_t get_page;
-
-	/*
-	 * If the win_req_t struct pointer is NULL, it means that
-	 *	we're being called by ModifyWindow, so get the
-	 *	current window characteristics.
-	 */
-	if (!wr) {
-	    gw.window = GET_WINDOW_NUMBER(wh);
-	    if (SocketServices(SS_GetWindow, &gw) != SUCCESS)
-		return (CS_BAD_WINDOW);
-	    sw.state = gw.state;
-	    sw.socket = gw.socket;
-	    sw.WindowSize = gw.size;
-	} else {
-	    sw.state = 0;
-	    sw.socket = sn;
-	    sw.WindowSize = wr->Size;
-	}
-
-	/*
-	 * If we're being called by RequestWindow, we must always have
-	 *	WIN_ACCESS_SPEED_VALID set since get_window_t is not
-	 *	defined.
-	 */
-	if (mw->Attributes & WIN_ACCESS_SPEED_VALID) {
-	    convert_speed_t convert_speed;
-
-	    convert_speed.Attributes = CONVERT_DEVSPEED_TO_NS;
-	    convert_speed.devspeed = mw->AccessSpeed;
-
-	    if (cs_convert_speed(&convert_speed) != CS_SUCCESS)
-		return (CS_BAD_SPEED);
-
-	    sw.speed = convert_speed.nS;
-	} else {
-	    sw.speed = gw.speed;
-	}
-
-	if (!wr) {
-	    get_page.window = GET_WINDOW_NUMBER(wh);
-	    get_page.page = 0;
-	    if (SocketServices(SS_GetPage, &get_page) != SUCCESS)
-		return (CS_BAD_WINDOW);
-	    set_page.state = get_page.state;
-	    set_page.offset = get_page.offset;
-	} else {
-	    set_page.state = 0;
-	    set_page.offset = 0;
-	}
-
-	if (mw->Attributes & WIN_ENABLE) {
-	    sw.state |= WS_ENABLED;
-	    set_page.state |= PS_ENABLED;
-	} else {
-	    sw.state &= ~WS_ENABLED;
-	    set_page.state &= ~PS_ENABLED;
-	}
-
-	if (mw->Attributes & WIN_DATA_WIDTH_VALID) {
-	    if (mw->Attributes & WIN_DATA_WIDTH_16)
-		sw.state |= WS_16BIT;
-	    else
-		sw.state &= ~WS_16BIT;
-	}
-
-	sw.window = GET_WINDOW_NUMBER(wh);
-	sw.base = 0;
-
-	cs_set_acc_attributes(&sw, mw->Attributes);
-
-	if (SocketServices(SS_SetWindow, &sw) != SUCCESS)
-	    return (CS_BAD_WINDOW);
-
-	if (mw->Attributes & WIN_MEMORY_TYPE_AM)
-	    set_page.state |= PS_ATTRIBUTE;
-	else
-	    set_page.state &= ~PS_ATTRIBUTE;
-
-	set_page.window = GET_WINDOW_NUMBER(wh);
-	set_page.page = 0;
-	if (SocketServices(SS_SetPage, &set_page) != SUCCESS)
-	    return (CS_BAD_OFFSET);
-
-	/*
-	 * Return the current base address of this window
-	 */
-	if (wr) {
-	    gw.window = GET_WINDOW_NUMBER(wh);
-	    if (SocketServices(SS_GetWindow, &gw) != SUCCESS)
-		return (CS_BAD_WINDOW);
-
-	    wr->Base.handle = (acc_handle_t)gw.handle;
-	}
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_map_mem_page - sets the card offset of the mapped window
- */
-static int
-cs_map_mem_page(window_handle_t wh, map_mem_page_t *mmp)
-{
-	cs_socket_t *sp;
-	cs_window_t *cw;
-	client_t *client;
-	inquire_window_t iw;
-	get_window_t gw;
-	set_page_t set_page;
-	get_page_t get_page;
-	int error;
-	uint32_t size;
-	int client_lock_acquired;
-
-	/*
-	 * We don't support paged windows, so never allow a page number
-	 *	of other than 0
-	 */
-	if (mmp->Page)
-	    return (CS_BAD_PAGE);
-
-	mutex_enter(&cs_globals.window_lock);
-
-	/*
-	 * Do some sanity checking - make sure that we can find a pointer
-	 *	to the window structure, and if we can, get the client that
-	 *	has allocated that window.
-	 */
-	if (!(cw = cs_find_window(wh))) {
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_HANDLE);
-	}
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(cw->client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	if (!(client = cs_find_client(cw->client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_NO_CARD);
-	}
-
-	mutex_exit(&sp->lock);
-
-	gw.window = GET_WINDOW_NUMBER(wh);
-	SocketServices(SS_GetWindow, &gw);
-
-	iw.window = GET_WINDOW_NUMBER(wh);
-	SocketServices(SS_InquireWindow, &iw);
-
-	if (iw.mem_win_char.MemWndCaps & WC_CALIGN)
-	    size = gw.size;
-	else
-	    size = iw.mem_win_char.ReqOffset;
-
-	if (((mmp->CardOffset/size)*size) != mmp->CardOffset) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_OFFSET);
-	}
-
-	get_page.window = GET_WINDOW_NUMBER(wh);
-	get_page.page = 0;
-	SocketServices(SS_GetPage, &get_page);
-
-	set_page.window = GET_WINDOW_NUMBER(wh);
-	set_page.page = 0;
-	set_page.state = get_page.state;
-	set_page.offset = mmp->CardOffset;
-	if (SocketServices(SS_SetPage, &set_page) != SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_OFFSET);
-	}
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_find_window - finds the window associated with the passed window
- *			handle; if the window handle is invalid or no
- *			windows match the passed window handle, NULL
- *			is returned.  Note that the window must be
- *			allocated for this function to return a valid
- *			window pointer.
- *
- *	returns: cs_window_t * pointer to the found window
- *		 NULL if window handle invalid or window not allocated
- */
-cs_window_t *
-cs_find_window(window_handle_t wh)
-{
-	cs_window_t *cw;
-
-	if ((GET_WINDOW_NUMBER(wh) > cs_globals.num_windows) ||
-			(GET_WINDOW_MAGIC(wh) != WINDOW_HANDLE_MAGIC))
-	    return ((cs_window_t *)NULL);
-
-	if ((cw = cs_get_wp(GET_WINDOW_NUMBER(wh))) == NULL)
-	    return (NULL);
-
-	if ((cw->state & CW_ALLOCATED) && (cw->state & CW_MEM))
-	    return (cw);
-
-	return ((cs_window_t *)NULL);
-}
-
-/*
- * cs_create_window_handle - creates a unique window handle based on the
- *				passed window number.
- */
-static window_handle_t
-cs_create_window_handle(uint32_t aw)
-{
-	return (WINDOW_HANDLE_MAGIC | (aw & WINDOW_HANDLE_MASK));
-}
-
-/*
- * cs_find_mem_window - tries to find a memory window matching the caller's
- *			criteria
- *
- *	We return the first window that matches the requested criteria.
- *
- *	returns: CS_SUCCESS - if memory window found
- *		 CS_OUT_OF_RESOURCE - if no windows match requirements
- *		 CS_BAD_SIZE - if requested size can not be met
- *		 CS_BAD_WINDOW - if an internal error occured
- */
-/* BEGIN CSTYLED */
-static int
-cs_find_mem_window(uint32_t sn, win_req_t *rw, uint32_t *assigned_window)
-{
-	uint32_t wn;
-	int error = CS_OUT_OF_RESOURCE;
-	uint32_t window_num = PCMCIA_MAX_WINDOWS;
-	uint32_t min_size = UINT_MAX;
-	inquire_window_t inquire_window, *iw;
-	uint32_t MinSize, MaxSize, ReqGran, MemWndCaps, WndCaps;
-	uint32_t tws;
-
-	iw = &inquire_window;
-
-	for (wn = 0; wn < cs_globals.num_windows; wn++) {
-	    cs_window_t *cw;
-
-	    /*
-	     * If we can't get a pointer to this window, we should contine
-	     *	with scanning the next window, since this window might have
-	     *	been dropped.
-	     */
-	    if ((cw = cs_get_wp(wn)) != NULL) {
-	      iw->window = wn;
-
-	      if (SocketServices(SS_InquireWindow, iw) != SUCCESS)
-		return (CS_BAD_WINDOW);
-
-	      MinSize = iw->mem_win_char.MinSize;
-	      MaxSize = iw->mem_win_char.MaxSize;
-	      ReqGran = iw->mem_win_char.ReqGran;
-	      MemWndCaps = iw->mem_win_char.MemWndCaps;
-	      WndCaps = iw->WndCaps;
-
-	      if (WINDOW_FOR_SOCKET(iw->Sockets, sn) &&
-					WINDOW_AVAILABLE_FOR_MEM(cw) &&
-					WndCaps & (WC_COMMON|WC_ATTRIBUTE)) {
-		if ((error = cs_valid_window_speed(iw, rw->win_params.AccessSpeed)) ==
-					CS_SUCCESS) {
-		    error = CS_OUT_OF_RESOURCE;
-		    if (cs_memwin_space_and_map_ok(iw, rw)) {
-			error = CS_BAD_SIZE;
-			if (!rw->Size) {
-			    min_size = min(min_size, MinSize);
-			    window_num = wn;
-			    goto found_window;
-			} else {
-			    if (!(MemWndCaps & WC_SIZE)) {
-				if (rw->Size == MinSize) {
-				    min_size = MinSize;
-				    window_num = wn;
-				    goto found_window;
-				}
-			    } else { /* WC_SIZE */
-			      if (!ReqGran) {
-				error = CS_BAD_WINDOW;
-			      } else {
-				if ((rw->Size >= MinSize) &&
-							(rw->Size <= MaxSize)) {
-				    if (MemWndCaps & WC_POW2) {
-				      unsigned rg = ReqGran;
-					for (tws = MinSize; tws <= MaxSize;
-								rg = (rg<<1)) {
-					    if (rw->Size == tws) {
-						min_size = tws;
-						window_num = wn;
-						goto found_window;
-					    }
-					    tws += rg;
-					  } /* for (tws) */
-				    } else {
-					for (tws = MinSize; tws <= MaxSize;
-							tws += ReqGran) {
-					    if (rw->Size == tws) {
-						min_size = tws;
-						window_num = wn;
-						goto found_window;
-					    }
-					  } /* for (tws) */
-				    } /* if (!WC_POW2) */
-				} /* if (Size >= MinSize) */
-			      } /* if (!ReqGran) */
-			    } /* if (WC_SIZE) */
-			} /* if (rw->Size) */
-		    } /* if (cs_space_and_map_ok) */
-		} /* if (cs_valid_window_speed) */
-	      } /* if (WINDOW_FOR_SOCKET) */
-	    } /* if (cs_get_wp) */
-	} /* for (wn) */
-
-	/*
-	 * If we got here and the window_num wasn't set by any window
-	 *	 matches in the above code, it means that we didn't
-	 *	find a window matching the caller's criteria.
-	 * If the error is CS_BAD_TYPE, it means that the last reason
-	 *	that we couldn't match a window was because the caller's
-	 *	requested speed was out of range of the last window that
-	 *	we checked.  We convert this error code to CS_OUT_OF_RESOURCE
-	 *	to conform to the RequestWindow section of the PCMCIA
-	 *	Card Services spec.
-	 */
-	if (window_num == PCMCIA_MAX_WINDOWS) {
-	    if (error == CS_BAD_TYPE)
-		error = CS_OUT_OF_RESOURCE;
-	    return (error);
-	}
-
-found_window:
-	rw->Size = min_size;
-	*assigned_window = window_num;
-	iw->window = window_num;
-	SocketServices(SS_InquireWindow, iw);
-	MemWndCaps = iw->mem_win_char.MemWndCaps;
-
-	if (MemWndCaps & WC_CALIGN)
-	    rw->Attributes |= WIN_OFFSET_SIZE;
-	else
-	    rw->Attributes &= ~WIN_OFFSET_SIZE;
-	return (CS_SUCCESS);
-}
-/* END CSTYLED */
-
-/*
- * cs_memwin_space_and_map_ok - checks to see if the passed window mapping
- *				capabilities and window speeds are in the
- *				range of the passed window.
- *
- *	returns: 0 - if the capabilities are out of range
- *		 1 - if the capabilities are in range
- */
-static int
-cs_memwin_space_and_map_ok(inquire_window_t *iw, win_req_t *rw)
-{
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 240)
-	    printf("-> s&m_ok: Attributes 0x%x AccessSpeed 0x%x "
-					"WndCaps 0x%x MemWndCaps 0x%x\n",
-					(int)rw->Attributes,
-					(int)rw->win_params.AccessSpeed,
-					iw->WndCaps,
-					iw->mem_win_char.MemWndCaps);
-#endif
-
-	if (rw->win_params.AccessSpeed & WIN_USE_WAIT) {
-	    if (!(iw->WndCaps & WC_WAIT))
-		return (0);
-	}
-
-	if (rw->Attributes & WIN_DATA_WIDTH_16) {
-	    if (!(iw->mem_win_char.MemWndCaps & WC_16BIT))
-		return (0);
-	} else {
-	    if (!(iw->mem_win_char.MemWndCaps & WC_8BIT))
-		return (0);
-	}
-
-	if (rw->Attributes & WIN_MEMORY_TYPE_AM) {
-	    if (!(iw->WndCaps & WC_ATTRIBUTE))
-		return (0);
-	}
-
-	if (rw->Attributes & WIN_MEMORY_TYPE_CM) {
-	    if (!(iw->WndCaps & WC_COMMON))
-		return (0);
-	}
-
-	return (1);
-}
-
-/*
- * cs_valid_window_speed - checks to see if requested window speed
- *				is in range of passed window
- *
- *	The inquire_window_t struct gives us speeds in nS, and we
- *	get speeds in the AccessSpeed variable as a devspeed code.
- *
- *	returns: CS_BAD_SPEED - if AccessSpeed is invalid devspeed code
- *		 CS_BAD_TYPE -	if AccessSpeed is not in range of valid
- *				speed for this window
- *		 CS_SUCCESS -	if window speed is in range
- */
-static int
-cs_valid_window_speed(inquire_window_t *iw, uint32_t AccessSpeed)
-{
-	convert_speed_t convert_speed, *cs;
-
-	cs = &convert_speed;
-
-	cs->Attributes = CONVERT_DEVSPEED_TO_NS;
-	cs->devspeed = AccessSpeed;
-
-	if (cs_convert_speed(cs) != CS_SUCCESS)
-	    return (CS_BAD_SPEED);
-
-	if ((cs->nS < iw->mem_win_char.Fastest) ||
-		(cs->nS > iw->mem_win_char.Slowest))
-	    return (CS_BAD_TYPE);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== IO window handling section ====
- */
-
-/*
- * cs_request_io - provides IO resources for clients; this is RequestIO
- *
- *	calling: cs_request_io(client_handle_t, io_req_t *)
- *
- *	returns: CS_SUCCESS - if IO resources available for client
- *		 CS_OUT_OF_RESOURCE - if no windows match requirements
- *		 CS_BAD_HANDLE - client handle is invalid
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_NO_CARD - if no card is in socket
- *		 CS_BAD_ATTRIBUTE - if any of the unsupported Attribute
- *					flags are set
- *		 CS_BAD_BASE - if either or both base port addresses
- *					are invalid or out of range
- *		 CS_CONFIGURATION_LOCKED - a RequestConfiguration has
- *					already been done
- *		 CS_IN_USE - IO ports already in use or function has
- *					already been called
- *		 CS_BAD_WINDOW - if failure while trying to set window
- *					characteristics
- */
-static int
-cs_request_io(client_handle_t client_handle, io_req_t *ior)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-	uint32_t socket_num;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * If the client has only requested one IO range, then make sure
-	 *	that the Attributes2 filed is clear.
-	 */
-	if (!ior->NumPorts2)
-	    ior->Attributes2 = 0;
-
-	/*
-	 * Make sure that none of the unsupported or reserved flags are set.
-	 */
-	if ((ior->Attributes1 | ior->Attributes2) &    (IO_SHARED |
-							IO_FIRST_SHARED |
-							IO_FORCE_ALIAS_ACCESS |
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW))
-	    return (CS_BAD_ATTRIBUTE);
-
-	/*
-	 * Make sure that we have a port count for the first region.
-	 */
-	if (!ior->NumPorts1)
-	    return (CS_BAD_BASE);
-
-	/*
-	 * If we're being asked for multiple IO ranges, then both base port
-	 *	members must be non-zero.
-	 */
-	if ((ior->NumPorts2) && !(ior->BasePort1.base && ior->BasePort2.base))
-	    return (CS_BAD_BASE);
-
-	mutex_enter(&cs_globals.window_lock);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has already been done, we don't allow
-	 *	this call.
-	 */
-	if (client->flags & REQ_CONFIGURATION_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_CONFIGURATION_LOCKED);
-	}
-
-	/*
-	 * If RequestIO has already been done, we don't allow this call.
-	 */
-	if (client->flags & REQ_IO_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_IN_USE);
-	}
-
-	mutex_enter(&sp->lock);
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    mutex_exit(&sp->lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_NO_CARD);
-	}
-
-	mutex_exit(&sp->lock);
-
-	/*
-	 * If we're only being asked for one IO range, then set BasePort2 to
-	 *	zero, since we use it later on.
-	 */
-	if (!ior->NumPorts2)
-	    ior->BasePort2.base = 0;
-
-	/*
-	 * See if we can allow Card Services to select the base address
-	 *	value for this card; if the client has specified a non-zero
-	 *	base IO address but the card doesn't decode enough IO
-	 *	address lines to uniquely use that address, then we have
-	 *	the flexibility to choose an alternative base address.
-	 * Note that if the client specifies that the card decodes zero
-	 *	IO address lines, then we have to use the NumPortsX
-	 *	values to figure out how many address lines the card
-	 *	actually decodes, and we have to round the NumPortsX
-	 *	values up to the closest power of two.
-	 */
-	if (ior->IOAddrLines) {
-	    ior->BasePort1.base = IOADDR_FROBNITZ(ior->BasePort1.base,
-		ior->IOAddrLines);
-	    ior->BasePort2.base = IOADDR_FROBNITZ(ior->BasePort2.base,
-		ior->IOAddrLines);
-	} else {
-	    ior->BasePort1.base = ior->BasePort1.base &
-				((IONUMPORTS_FROBNITZ(ior->NumPorts1) +
-				IONUMPORTS_FROBNITZ(ior->NumPorts2)) - 1);
-	    ior->BasePort2.base = ior->BasePort2.base &
-				((IONUMPORTS_FROBNITZ(ior->NumPorts1) +
-				IONUMPORTS_FROBNITZ(ior->NumPorts2)) - 1);
-	}
-
-	socket_num = CS_MAKE_SOCKET_NUMBER(GET_CLIENT_SOCKET(client_handle),
-	    GET_CLIENT_FUNCTION(client_handle));
-
-
-#ifdef	USE_IOMMAP_WINDOW
-	/*
-	 * Here is where the code diverges, depending on the type of IO windows
-	 *	that this socket supports.  If this socket supportes memory
-	 *	mapped IO windows, as determined by cs_init allocating an
-	 *	io_mmap_window_t structure on the socket structure, then we
-	 *	use one IO window for all the clients on this socket.  We can
-	 *	do this safely since a memory mapped IO window implies that
-	 *	only this socket shares the complete IO space of the card.
-	 * See the next major block of code for a description of what we do
-	 *	if a socket doesn't support memory mapped IO windows.
-	 */
-	if (sp->io_mmap_window) {
-	    cs_window_t *cw;
-	    io_mmap_window_t *imw = sp->io_mmap_window;
-	    uint32_t offset;
-
-		/*
-		 * If we haven't allocated an IO window yet, do it now.
-		 * Try to allocate the IO window that cs_init found for us;
-		 * if that fails, then call cs_find_io_win to find a window.
-		 */
-	    if (!imw->count) {
-		set_window_t set_window;
-
-		if (!WINDOW_AVAILABLE_FOR_IO(imw->number)) {
-		    iowin_char_t iowin_char;
-
-		    iowin_char.IOWndCaps = (WC_IO_RANGE_PER_WINDOW |
-					    WC_8BIT |
-					    WC_16BIT);
-		    if ((error = cs_find_io_win(sp->socket_num, &iowin_char,
-				    &imw->number, &imw->size)) != CS_SUCCESS) {
-			EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-			mutex_exit(&cs_globals.window_lock);
-		    } /* cs_find_io_win */
-		} /* if (!WINDOW_AVAILABLE_FOR_IO) */
-
-		set_window.socket = socket_num;
-		set_window.window = imw->number;
-		set_window.speed = IO_WIN_SPEED;
-		set_window.base.base = 0;
-		set_window.WindowSize = imw->size;
-		set_window.state = (WS_ENABLED | WS_16BIT |
-				    WS_EXACT_MAPIN | WS_IO);
-
-		/* XXX - what to d here? XXX */
-		cs_set_acc_attributes(&set_window, Attributes);
-
-		if (SocketServices(SS_SetWindow, &set_window) != SUCCESS) {
-		    (void) cs_setup_io_win(socket_num, imw->number,
-						NULL, NULL, NULL,
-						(IO_DEALLOCATE_WINDOW |
-						IO_DISABLE_WINDOW));
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    mutex_exit(&cs_globals.window_lock);
-		    return (CS_BAD_WINDOW);
-		}
-
-		imw->handle = set_window.base.handle;
-		imw->size = set_window.WindowSize;
-
-		/*
-		 * Check the caller's port requirements to be sure that they
-		 *	fit within our found IO window.
-		 */
-		if ((ior->BasePort1.base + ior->NumPorts1 +
-			ior->BasePort2.base + ior->NumPorts2) > imw->size) {
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    mutex_exit(&cs_globals.window_lock);
-		    return (CS_BAD_BASE);
-		}
-
-		if ((cw = cs_get_wp(imw->number)) == NULL) {
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    mutex_exit(&cs_globals.window_lock);
-		    return (CS_BAD_WINDOW)
-		}
-		cw->state |= (CW_ALLOCATED | CW_IO);
-
-	    } /* if (!imw->count) */
-
-	    imw->count++;
-
-		/*
-		 * All common access handles for this type of adapter are
-		 * duped.  We never give the original back to the caller.
-		 */
-	    /* XXX need to set endianess and data ordering flags */
-	    csx_DupHandle(imw->handle, &ior->BasePort1.handle, 0);
-	    csx_GetHandleOffset(ior->BasePort1.handle, &offset);
-	    csx_SetHandleOffset(ior->BasePort1.handle,
-		ior->BasePort1.base + offset);
-
-	    if (ior->NumPorts2) {
-		/* XXX need to set endianess and data ordering flags */
-		csx_DupHandle(imw->handle, &ior->BasePort2.handle, 0);
-		csx_GetHandleOffset(ior->BasePort2.handle, &offset);
-		csx_SetHandleOffset(ior->BasePort2.handle,
-		    ior->BasePort1.base + offset);
-	    }
-
-		/*
-		 * We don't really use these two values if we've got a memory
-		 * mapped IO window since the assigned window number is stored
-		 * in imw->number.
-		 */
-	    client->io_alloc.Window1 = imw->number;
-	    client->io_alloc.Window2 = PCMCIA_MAX_WINDOWS;
-
-	/*
-	 * This socket supports only IO port IO windows.
-	 */
-	} else {
-#else	/* USE_IOMMAP_WINDOW */
-	{
-#endif	/* USE_IOMMAP_WINDOW */
-	    baseaddru_t baseaddru;
-
-	    baseaddru.base = ior->BasePort1.base;
-
-	    if ((error = cs_allocate_io_win(sp->socket_num, ior->Attributes1,
-		&client->io_alloc.Window1)) != CS_SUCCESS) {
-
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		mutex_exit(&cs_globals.window_lock);
-		return (error);
-	    } /* if (cs_allocate_io_win(1)) */
-
-		/*
-		 * Setup the window hardware; if this fails, then we need to
-		 *	deallocate the previously allocated window.
-		 */
-	    if ((error = cs_setup_io_win(socket_num,
-						client->io_alloc.Window1,
-						&baseaddru,
-						&ior->NumPorts1,
-						ior->IOAddrLines,
-						ior->Attributes1)) !=
-								CS_SUCCESS) {
-		(void) cs_setup_io_win(socket_num, client->io_alloc.Window1,
-					NULL, NULL, NULL,
-					(
-						IO_DEALLOCATE_WINDOW |
-						IO_DISABLE_WINDOW));
-
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		mutex_exit(&cs_globals.window_lock);
-		return (error);
-	    } /* if (cs_setup_io_win(1)) */
-
-	    ior->BasePort1.handle = (acc_handle_t)baseaddru.handle;
-	    ior->BasePort1.base = baseaddru.base;
-
-		/*
-		 * See if the client wants two IO ranges.
-		 */
-	    if (ior->NumPorts2) {
-		baseaddru_t baseaddru;
-
-		baseaddru.base = ior->BasePort2.base;
-
-		/*
-		 * If we fail to allocate this window, then we must deallocate
-		 *	the previous IO window that is already allocated.
-		 */
-		if ((error = cs_allocate_io_win(sp->socket_num,
-						ior->Attributes2,
-						&client->io_alloc.Window2)) !=
-								CS_SUCCESS) {
-		    (void) cs_setup_io_win(socket_num,
-						client->io_alloc.Window2,
-						NULL, NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    mutex_exit(&cs_globals.window_lock);
-		    return (error);
-		} /* if (cs_allocate_io_win(2)) */
-		/*
-		 * Setup the window hardware; if this fails, then we need to
-		 *	deallocate the previously allocated window.
-		 */
-		if ((error = cs_setup_io_win(socket_num,
-						client->io_alloc.Window2,
-						&baseaddru,
-						&ior->NumPorts2,
-						ior->IOAddrLines,
-						ior->Attributes2)) !=
-								CS_SUCCESS) {
-		    (void) cs_setup_io_win(socket_num,
-						client->io_alloc.Window1,
-						NULL, NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-		    (void) cs_setup_io_win(socket_num,
-						client->io_alloc.Window2,
-						NULL, NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    mutex_exit(&cs_globals.window_lock);
-		    return (error);
-		} /* if (cs_setup_io_win(2)) */
-
-		ior->BasePort2.handle = (acc_handle_t)baseaddru.handle;
-		ior->BasePort2.base = baseaddru.base;
-
-	    } else {
-		client->io_alloc.Window2 = PCMCIA_MAX_WINDOWS;
-	    } /* if (ior->NumPorts2) */
-	} /* if (sp->io_mmap_window) */
-
-	/*
-	 * Save a copy of the client's port information so that we
-	 *	can use it in the RequestConfiguration call.  We set
-	 *	the IO window number(s) allocated in the respective
-	 *	section of code, above.
-	 */
-	client->io_alloc.BasePort1.base = ior->BasePort1.base;
-	client->io_alloc.BasePort1.handle = ior->BasePort1.handle;
-	client->io_alloc.NumPorts1 = ior->NumPorts1;
-	client->io_alloc.Attributes1 = ior->Attributes1;
-	client->io_alloc.BasePort2.base = ior->BasePort2.base;
-	client->io_alloc.BasePort2.handle = ior->BasePort2.handle;
-	client->io_alloc.NumPorts2 = ior->NumPorts2;
-	client->io_alloc.Attributes2 = ior->Attributes2;
-	client->io_alloc.IOAddrLines = ior->IOAddrLines;
-
-	/*
-	 * Mark this client as having done a successful RequestIO call.
-	 */
-	client->flags |= (REQ_IO_DONE | CLIENT_IO_ALLOCATED);
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_release_io - releases IO resources allocated by RequestIO; this is
- *			ReleaseIO
- *
- *	calling: cs_release_io(client_handle_t, io_req_t *)
- *
- *	returns: CS_SUCCESS - if IO resources sucessfully deallocated
- *		 CS_BAD_HANDLE - client handle is invalid
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_CONFIGURATION_LOCKED - a RequestConfiguration has been
- *				done without a ReleaseConfiguration
- *		 CS_IN_USE - no RequestIO has been done
- */
-static int
-cs_release_io(client_handle_t client_handle, io_req_t *ior)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int error;
-	int client_lock_acquired;
-	uint32_t socket_num;
-
-#ifdef	lint
-	ior = NULL;
-#endif
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	mutex_enter(&cs_globals.window_lock);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has already been done, we don't allow
-	 *	this call.
-	 */
-	if (client->flags & REQ_CONFIGURATION_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_CONFIGURATION_LOCKED);
-	}
-
-	/*
-	 * If RequestIO has not been done, we don't allow this call.
-	 */
-	if (!(client->flags & REQ_IO_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_IN_USE);
-	}
-
-	socket_num = CS_MAKE_SOCKET_NUMBER(GET_CLIENT_SOCKET(client_handle),
-	    GET_CLIENT_FUNCTION(client_handle));
-
-#ifdef	XXX
-	/*
-	 * Check the passed IO allocation with the stored allocation; if
-	 *	they don't match, then return an error.
-	 */
-	if ((client->io_alloc.BasePort1 != ior->BasePort1) ||
-	    (client->io_alloc.NumPorts1 != ior->NumPorts1) ||
-	    (client->io_alloc.Attributes1 != ior->Attributes1) ||
-	    (client->io_alloc.BasePort2 != ior->BasePort2) ||
-	    (client->io_alloc.NumPorts2 != ior->NumPorts2) ||
-	    (client->io_alloc.Attributes2 != ior->Attributes2) ||
-	    (client->io_alloc.IOAddrLines != ior->IOAddrLines)) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		mutex_exit(&cs_globals.window_lock);
-		return (CS_BAD_ARGS);
-	}
-#endif
-
-#ifdef	USE_IOMMAP_WINDOW
-	/*
-	 * The code diverges here depending on if this socket supports
-	 *	memory mapped IO windows or not.  See comments in the
-	 *	cs_request_io function for a description of what's
-	 *	going on here.
-	 */
-	if (sp->io_mmap_window) {
-	    io_mmap_window_t *imw = sp->io_mmap_window;
-
-		/*
-		 * We should never see this; if we do, it's an internal
-		 *	consistency error.
-		 */
-	    if (!imw->count) {
-		cmn_err(CE_CONT, "cs_release_io: socket %d !imw->count\n",
-							    sp->socket_num);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		mutex_exit(&cs_globals.window_lock);
-		return (CS_GENERAL_FAILURE);
-	    }
-
-		/*
-		 * All common access handles for this type of adapter are
-		 *	duped. We never give the original back to the caller,
-		 *	so it's OK to unconditionally free the handle here.
-		 */
-	    csx_FreeHandle(&ior->BasePort1.handle);
-
-		/*
-		 * If the IO window referance count is zero, then deallocate
-		 * and disable this window.
-		 */
-	    if (!--(imw->count)) {
-		(void) cs_setup_io_win(socket_num, imw->number, NULL,
-								NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-	    } /* if (imw->count) */
-	} else {
-#endif	/* USE_IOMMAP_WINDOW */
-	    (void) cs_setup_io_win(socket_num, client->io_alloc.Window1,
-						NULL, NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-	    if (client->io_alloc.Window2 != PCMCIA_MAX_WINDOWS)
-		(void) cs_setup_io_win(socket_num, client->io_alloc.Window2,
-						NULL, NULL, NULL,
-						(
-							IO_DEALLOCATE_WINDOW |
-							IO_DISABLE_WINDOW));
-#ifdef	USE_IOMMAP_WINDOW
-	} /* if (sp->io_mmap_window) */
-#endif	/* USE_IOMMAP_WINDOW */
-
-	/*
-	 * Mark the client as not having any IO resources allocated.
-	 */
-	client->flags &= ~(REQ_IO_DONE | CLIENT_IO_ALLOCATED);
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	mutex_exit(&cs_globals.window_lock);
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_find_io_win - finds an IO window that matches the parameters specified
- *			in the flags argument
- *
- *	calling: sn - socket number to look for IO window on
- *		 *iwc - other window characteristics to match
- *		 *assigned_window - pointer to where we return the assigned
- *					window number if we found a window or
- *					undefined otherwise
- *		 *size - if non-NULL, the found window size will be stored here
- *
- *	returns: CS_SUCCESS - if IO window found
- *		 CS_OUT_OF_RESOURCE - if no windows match requirements
- */
-static int
-cs_find_io_win(uint32_t sn, iowin_char_t *iwc, uint32_t *assigned_window,
-    uint32_t *size)
-{
-	inquire_window_t inquire_window, *iw;
-	unsigned wn;
-
-	iw = &inquire_window;
-
-	for (wn = 0; wn < cs_globals.num_windows; wn++) {
-	    iowin_char_t *iowc;
-	    cs_window_t *cw;
-
-	    if ((cw = cs_get_wp(wn)) != NULL) {
-
-		iw->window = wn;
-		SocketServices(SS_InquireWindow, iw);
-
-		iowc = &iw->iowin_char;
-
-		if (WINDOW_FOR_SOCKET(iw->Sockets, sn) &&
-		    WINDOW_AVAILABLE_FOR_IO(cw) &&
-		    (iw->WndCaps & WC_IO) &&
-		    ((iowc->IOWndCaps & iwc->IOWndCaps) == iwc->IOWndCaps)) {
-
-			*assigned_window = wn;
-
-			if (size)
-			    *size = iw->iowin_char.ReqGran;
-			return (CS_SUCCESS);
-		    } /* if (WINDOW_FOR_SOCKET) */
-	    } /* cs_get_wp */
-	} /* for (wn) */
-
-	return (CS_OUT_OF_RESOURCE);
-}
-
-/*
- * cs_allocate_io_win - finds and allocates an IO window
- *
- *	calling: sn - socket number to look for window on
- *		 Attributes - window attributes in io_req_t.Attributes format
- *		 *assigned_window - pointer to return assigned window number
- *
- *	returns: CS_SUCCESS - IO window found and allocated
- *		 CS_OUT_OF_RESOURCE - if cs_find_io_win couldn't find a
- *				window that matches the passed criteria
- *
- * Note: This fucntion will find and allocate an IO window.  The caller is
- *	responsible for deallocating the window.
- */
-static int
-cs_allocate_io_win(uint32_t sn, uint32_t Attributes, uint32_t *assigned_window)
-{
-	iowin_char_t iowin_char;
-	cs_window_t *cw;
-
-	iowin_char.IOWndCaps =
-		((Attributes & IO_DATA_PATH_WIDTH_16)?WC_16BIT:WC_8BIT);
-
-	if (cs_find_io_win(sn, &iowin_char, assigned_window, NULL) ==
-								CS_SUCCESS) {
-	    if ((cw = cs_get_wp(*assigned_window)) == NULL)
-		return (CS_OUT_OF_RESOURCE);
-
-	    cw->state = (cw->state & CW_WINDOW_VALID) | (CW_ALLOCATED | CW_IO);
-	    return (CS_SUCCESS);
-	}
-
-	return (CS_OUT_OF_RESOURCE);
-}
-
-/*
- * cs_setup_io_win - setup and destroy an IO window
- *
- *	calling: sn - socket number
- *		 wn - window number
- * XXX Base - pointer to XXX
- *		 *NumPorts - pointer to number of allocated ports to return
- *		 IOAddrLines - number of IO address lines decoded by this card
- *		 Attributes - either io_req_t attributes, or a combination of
- *				the following flags:
- *				    IO_DEALLOCATE_WINDOW - deallocate the window
- *				    IO_DISABLE_WINDOW - disable the window
- *				When either of these two flags are set, *Base
- *				    and NumPorts should be NULL.
- *
- *	returns: CS_SUCCESS - if no failure
- *		 CS_BAD_WINDOW - if error while trying to configure window
- *
- * Note: We use the IOAddrLines value to determine what base address to pass
- *		to Socket Services.
- */
-static int
-cs_setup_io_win(uint32_t sn, uint32_t wn, baseaddru_t *Base, uint32_t *NumPorts,
-    uint32_t IOAddrLines, uint32_t Attributes)
-{
-	set_window_t set_window;
-
-	if (Attributes & (IO_DEALLOCATE_WINDOW | IO_DISABLE_WINDOW)) {
-
-	    if (Attributes & IO_DEALLOCATE_WINDOW) {
-		cs_window_t *cw;
-
-		if ((cw = cs_get_wp(wn)) == NULL)
-		    return (CS_BAD_WINDOW);
-		cw->state &= CW_WINDOW_VALID;
-
-	    } /* IO_DEALLOCATE_WINDOW */
-
-	    if (Attributes & IO_DISABLE_WINDOW) {
-		get_window_t get_window;
-
-		get_window.window = wn;
-
-		SocketServices(SS_GetWindow, &get_window);
-
-		set_window.socket = get_window.socket;
-		set_window.window = get_window.window;
-		set_window.speed = get_window.speed;
-		set_window.base = 0;
-		set_window.WindowSize = get_window.size;
-		set_window.state = get_window.state & ~WS_ENABLED;
-
-		cs_set_acc_attributes(&set_window, Attributes);
-
-		SocketServices(SS_SetWindow, &set_window);
-	    } /* IO_DISABLE_WINDOW */
-
-	    return (CS_SUCCESS);
-
-	} /* if (IO_DEALLOCATE_WINDOW | IO_DISABLE_WINDOW) */
-
-	/*
-	 * See if we can allow Socket Services to select the base address
-	 *	value for this card; if the client has specified a non-zero
-	 *	base IO address but the card doesn't decode enough IO
-	 *	address lines to uniquely use that address, then we have
-	 *	the flexibility to choose an alternative base address.
-	 * XXX - Is this really correct in all cases?
-	 */
-	if (!IOAddrLines)
-	    Base->base = 0;
-	else
-	    Base->base = IOADDR_FROBNITZ(Base->base, IOAddrLines);
-
-	set_window.socket = sn;
-	set_window.window = wn;
-	set_window.speed = IO_WIN_SPEED;
-	set_window.base = Base->base;
-	set_window.WindowSize = *NumPorts;
-	set_window.state = (WS_ENABLED | WS_IO |
-			((Attributes & IO_DATA_PATH_WIDTH_16)?WS_16BIT:0));
-
-	cs_set_acc_attributes(&set_window, Attributes);
-
-	if (SocketServices(SS_SetWindow, &set_window) != SUCCESS)
-	    return (CS_BAD_WINDOW);
-
-	Base->base = set_window.base;
-	Base->handle = set_window.handle;
-	*NumPorts = set_window.WindowSize;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== IRQ handling functions ====
- */
-
-/*
- * cs_request_irq - add's client's IRQ handler; supports RequestIRQ
- *
- *	calling: irq_req_t.Attributes - must have the IRQ_TYPE_EXCLUSIVE
- *			flag set, and all other flags clear, or
- *			CS_BAD_ATTRIBUTE will be returned
- *
- *	returns: CS_SUCCESS - if IRQ resources available for client
- *		 CS_BAD_IRQ - if IRQ can not be allocated
- *		 CS_BAD_HANDLE - client handle is invalid
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_NO_CARD - if no card is in socket
- *		 CS_BAD_ATTRIBUTE - if any of the unsupported Attribute
- *					flags are set
- *		 CS_CONFIGURATION_LOCKED - a RequestConfiguration has
- *					already been done
- *		 CS_IN_USE - IRQ ports already in use or function has
- *					already been called
- *
- * Note: We only allow level-mode interrupts.
- */
-static int
-cs_request_irq(client_handle_t client_handle, irq_req_t *irqr)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	set_irq_handler_t set_irq_handler;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Make sure that none of the unsupported or reserved flags are set.
-	 */
-	if ((irqr->Attributes &	(IRQ_TYPE_TIME | IRQ_TYPE_DYNAMIC_SHARING |
-				IRQ_FIRST_SHARED | IRQ_PULSE_ALLOCATED |
-				IRQ_FORCED_PULSE)) ||
-		!(irqr->Attributes & IRQ_TYPE_EXCLUSIVE))
-	    return (CS_BAD_ATTRIBUTE);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has already been done, we don't allow
-	 *	this call.
-	 */
-	if (client->flags & REQ_CONFIGURATION_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_CONFIGURATION_LOCKED);
-	}
-
-	/*
-	 * If RequestIRQ has already been done, we don't allow this call.
-	 */
-	if (client->flags & REQ_IRQ_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_IN_USE);
-	}
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-
-	/*
-	 * Set up the parameters and ask Socket Services to give us an IRQ
-	 *	for this client.  We don't really do much, since the IRQ
-	 *	resources are managed by SS and the kernel.  We also don't
-	 *	care which IRQ level we are given.
-	 */
-	set_irq_handler.socket =
-		CS_MAKE_SOCKET_NUMBER(GET_CLIENT_SOCKET(client_handle),
-					GET_CLIENT_FUNCTION(client_handle));
-	set_irq_handler.irq = IRQ_ANY;
-
-	set_irq_handler.handler_id = client_handle;
-	set_irq_handler.handler = (f_t *)irqr->irq_handler;
-	set_irq_handler.arg1 = irqr->irq_handler_arg;
-	set_irq_handler.arg2 = NULL;
-
-	if ((error = SocketServices(SS_SetIRQHandler,
-					&set_irq_handler)) != SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_IRQ);
-	}
-
-	irqr->iblk_cookie = set_irq_handler.iblk_cookie;
-	irqr->idev_cookie = set_irq_handler.idev_cookie;
-
-	/*
-	 * Save the allocated IRQ information for this client.
-	 */
-	client->irq_alloc.Attributes = irqr->Attributes;
-	client->irq_alloc.irq = set_irq_handler.irq;
-	client->irq_alloc.handler_id = set_irq_handler.handler_id;
-	client->irq_alloc.irq_handler = (f_t *)set_irq_handler.handler;
-	client->irq_alloc.irq_handler_arg1 = set_irq_handler.arg1;
-	client->irq_alloc.irq_handler_arg2 = set_irq_handler.arg2;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 0)
-	    cmn_err(CE_CONT, "cs_request_irq: socket %d irqr->Attributes 0x%x "
-						"set_irq_handler.irq 0x%x\n",
-						sp->socket_num,
-						(int)irqr->Attributes,
-						set_irq_handler.irq);
-#endif
-
-	/*
-	 * Mark this client as having done a successful RequestIRQ call.
-	 */
-	client->flags |= (REQ_IRQ_DONE | CLIENT_IRQ_ALLOCATED);
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_release_irq - releases IRQ resources allocated by RequestIRQ; this is
- *			ReleaseIRQ
- *
- *	calling: cs_release_irq(client_handle_t, irq_req_t *)
- *
- *	returns: CS_SUCCESS - if IRQ resources sucessfully deallocated
- *		 CS_BAD_IRQ - if IRQ can not be deallocated
- *		 CS_BAD_HANDLE - client handle is invalid
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_CONFIGURATION_LOCKED - a RequestConfiguration has been
- *				done without a ReleaseConfiguration
- *		 CS_IN_USE - no RequestIRQ has been done
- */
-static int
-cs_release_irq(client_handle_t client_handle, irq_req_t *irqr)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	clear_irq_handler_t clear_irq_handler;
-	int error;
-	int client_lock_acquired;
-
-#ifdef	lint
-	irqr = NULL;
-#endif
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has already been done, we don't allow
-	 *	this call.
-	 */
-	if (client->flags & REQ_CONFIGURATION_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_CONFIGURATION_LOCKED);
-	}
-
-	/*
-	 * If RequestIRQ has not been done, we don't allow this call.
-	 */
-	if (!(client->flags & REQ_IRQ_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_IN_USE);
-	}
-
-	/*
-	 * Tell Socket Services that we want to deregister this client's
-	 *	IRQ handler.
-	 */
-	clear_irq_handler.socket =
-		CS_MAKE_SOCKET_NUMBER(GET_CLIENT_SOCKET(client_handle),
-				GET_CLIENT_FUNCTION(client_handle));
-	clear_irq_handler.handler_id = client->irq_alloc.handler_id;
-	clear_irq_handler.handler = (f_t *)client->irq_alloc.irq_handler;
-
-	/*
-	 * At this point, we should never fail this SS call; if we do, it
-	 *	means that there is an internal consistancy error in either
-	 *	Card Services or Socket Services.
-	 */
-	if ((error = SocketServices(SS_ClearIRQHandler, &clear_irq_handler)) !=
-								SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_IRQ);
-	}
-
-	/*
-	 * Mark the client as not having any IRQ resources allocated.
-	 */
-	client->flags &= ~(REQ_IRQ_DONE | CLIENT_IRQ_ALLOCATED);
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== configuration handling functions ====
- */
-
-/*
- * cs_request_configuration - sets up socket and card configuration on behalf
- *		of the client; this is RequestConfiguration
- *
- *	returns: CS_SUCCESS - if configuration sucessfully set
- *		 CS_BAD_SOCKET - if Socket Services returns an error
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_BAD_ATTRIBUTE - if any unsupported or reserved flags
- *					are set
- *		 CS_BAD_TYPE - if the socket doesn't support a mem and IO
- *				interface (SOCKET_INTERFACE_MEMORY_AND_IO set)
- *		 CS_CONFIGURATION_LOCKED - a RequestConfiguration has
- *					already been done
- *		 CS_BAD_VCC - if Vcc value is not supported by socket
- *		 CS_BAD_VPP1 - if Vpp1 value is not supported by socket
- *		 CS_BAD_VPP2 - if Vpp2 value is not supported by socket
- *
- * Bug ID: 1193637 - Card Services RequestConfiguration does not conform
- *	to PCMCIA standard
- * We allow clients to do a RequestConfiguration even if they haven't
- *	done a RequestIO or RequestIRQ.
- */
-static int
-cs_request_configuration(client_handle_t client_handle, config_req_t *cr)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	volatile config_regs_t *crt;
-	set_socket_t set_socket;
-	get_socket_t get_socket;
-	acc_handle_t cis_handle;
-	int error;
-	uint32_t newoffset;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-#ifdef	XXX
-	/*
-	 * If the client specifies Vcc = 0 and any non-zero value for
-	 *	either of the Vpp members, that's an illegal condition.
-	 */
-	if (!(cr->Vcc) && (cr->Vpp1 || cr->Vpp2))
-	    return (CS_BAD_VCC);
-#endif
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	/*
-	 * If the client is asking for a memory and IO interface on this
-	 *	socket, then check the socket capabilities to be sure that
-	 *	this socket supports this configuration.
-	 */
-	if (cr->IntType & SOCKET_INTERFACE_MEMORY_AND_IO) {
-	    inquire_socket_t inquire_socket;
-
-	    inquire_socket.socket = sp->socket_num;
-
-	    if (SocketServices(SS_InquireSocket, &inquire_socket) != SUCCESS)
-		return (CS_BAD_SOCKET);
-
-	    if (!(inquire_socket.SocketCaps & IF_IO))
-		return (CS_BAD_TYPE);
-
-	} /* if (SOCKET_INTERFACE_MEMORY_AND_IO) */
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has already been done, we don't allow
-	 *	this call.
-	 */
-	if (client->flags & REQ_CONFIGURATION_DONE) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_CONFIGURATION_LOCKED);
-	}
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-
-	/*
-	 * At this point, most of the client's calling parameters have been
-	 *	validated, so we can go ahead and configure the socket and
-	 *	the card.
-	 */
-	mutex_enter(&sp->cis_lock);
-
-	/*
-	 * Configure the socket with the interface type and voltages requested
-	 *	by the client.
-	 */
-	get_socket.socket = sp->socket_num;
-
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 0)
-	    cmn_err(CE_CONT, "cs_request_configuration: socket %d "
-					"client->irq_alloc.irq 0x%x "
-					"get_socket.IRQRouting 0x%x\n",
-						sp->socket_num,
-						(int)client->irq_alloc.irq,
-						get_socket.IRQRouting);
-#endif
-
-	bzero(&set_socket, sizeof (set_socket));
-	set_socket.socket = sp->socket_num;
-	set_socket.IREQRouting = client->irq_alloc.irq & ~IRQ_ENABLE;
-
-	set_socket.CtlInd = get_socket.CtlInd;
-	set_socket.State = 0;	/* don't reset latched values */
-
-	if (cs_convert_powerlevel(sp->socket_num, cr->Vcc, VCC,
-					&set_socket.VccLevel) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_VCC);
-	}
-
-	if (cs_convert_powerlevel(sp->socket_num, cr->Vpp1, VPP1,
-					&set_socket.Vpp1Level) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_VPP);
-	}
-
-	if (cs_convert_powerlevel(sp->socket_num, cr->Vpp2, VPP2,
-					&set_socket.Vpp2Level) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_VPP);
-	}
-
-	if (!(cr->IntType & SOCKET_INTERFACE_MEMORY_AND_IO))
-		set_socket.IFType = IF_MEMORY;
-	else {
-		set_socket.IFType = IF_IO;
-
-		/*
-		 * The Cirrus Logic PD6710/672X/others? adapters will write
-		 * protect the CIS if the socket is in MEMORY mode and the
-		 * WP/IOCS16 pin is true.  When this happens, the CIS registers
-		 * will fail to be written.  Go ahead and set the socket,
-		 * even though the event mask isn't complete yet, so we can
-		 * configure the adapter.  Afterwards, set the socket again
-		 * to make sure the event mask is correct.
-		 */
-		if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS) {
-			sp->flags &= ~SOCKET_IS_IO;
-			mutex_exit(&sp->cis_lock);
-			EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-			return (CS_BAD_SOCKET);
-		}
-	}
-
-	if (cs_rc2_delay)
-	    drv_usecwait(cs_rc2_delay * 1000);
-
-	/*
-	 * Get a pointer to a window that contains the configuration
-	 *	registers.
-	 */
-	mutex_enter(&sp->lock);
-	client->config_regs_offset = cr->ConfigBase;
-	newoffset = client->config_regs_offset;
-	mutex_exit(&sp->lock);
-	if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-					CISTPLF_AM_SPACE) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    cmn_err(CE_CONT, "cs_request_configuration: socket %d can't init "
-				"CIS window\n", sp->socket_num);
-	    return (CS_GENERAL_FAILURE);
-	}
-
-	/*
-	 * Setup the config register pointers.
-	 * Note that these pointers are not the complete virtual address;
-	 *	the complete address is constructed each time the registers
-	 *	are accessed.
-	 */
-	mutex_enter(&sp->lock);
-	crt = &client->config_regs;
-	client->present = cr->Present;
-
-	bzero((char *)crt, sizeof (config_regs_t));
-
-	/* Configuration Option Register */
-	if (client->present & CONFIG_OPTION_REG_PRESENT)
-	    crt->cor_p = (newoffset + CONFIG_OPTION_REG_OFFSET);
-
-	/* Configuration and Status Register */
-	if (client->present & CONFIG_STATUS_REG_PRESENT)
-	    crt->ccsr_p = (newoffset + CONFIG_STATUS_REG_OFFSET);
-
-	/* Pin Replacement Register */
-	if (client->present & CONFIG_PINREPL_REG_PRESENT)
-	    crt->prr_p = (newoffset + CONFIG_PINREPL_REG_OFFSET);
-
-	/* Socket and Copy Register */
-	if (client->present & CONFIG_COPY_REG_PRESENT)
-	    crt->scr_p = (newoffset + CONFIG_COPY_REG_OFFSET);
-
-	/* Extended Status Register */
-	if (client->present & CONFIG_EXSTAT_REG_PRESENT)
-	    crt->exstat_p = (newoffset + CONFIG_EXSTAT_REG_OFFSET);
-
-	/* IO Base 0 Register */
-	if (client->present & CONFIG_IOBASE0_REG_PRESENT)
-	    crt->iobase0_p = (newoffset + CONFIG_IOBASE0_REG_OFFSET);
-
-	/* IO Base 1 Register */
-	if (client->present & CONFIG_IOBASE1_REG_PRESENT)
-	    crt->iobase1_p = (newoffset + CONFIG_IOBASE1_REG_OFFSET);
-
-	/* IO Base 2 Register */
-	if (client->present & CONFIG_IOBASE2_REG_PRESENT)
-	    crt->iobase2_p = (newoffset + CONFIG_IOBASE2_REG_OFFSET);
-
-	/* IO Base 3 Register */
-	if (client->present & CONFIG_IOBASE3_REG_PRESENT)
-	    crt->iobase3_p = (newoffset + CONFIG_IOBASE3_REG_OFFSET);
-
-	/* IO Limit Register */
-	if (client->present & CONFIG_IOLIMIT_REG_PRESENT)
-	    crt->iolimit_p = (newoffset + CONFIG_IOLIMIT_REG_OFFSET);
-
-	/*
-	 * Setup the bits in the PRR mask that are valid; this is easy, just
-	 *	copy the Pin value that the client gave us.  Note that for
-	 *	this to work, the client must set both of the XXX_STATUS
-	 *	and the XXX_EVENT bits in the Pin member.
-	 */
-	client->pin = cr->Pin;
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 128)
-	    cmn_err(CE_CONT, "cs_request_configuration: client->pin 0x%x "
-		"client->config_regs_offset 0x%x newoffset 0x%x cor_p 0x%x "
-		"ccsr_p 0x%x prr_p 0x%x scr_p 0x%x\n",
-		client->pin, (int)client->config_regs_offset, newoffset,
-		(int)crt->cor_p, (int)crt->ccsr_p, (int)crt->prr_p,
-		(int)crt->scr_p);
-#endif
-
-	/*
-	 * If the socket isn't in IO mode, WP is asserted,  and we're going to
-	 * write any of the config registers, issue a warning.
-	 */
-	if ((client->present != 0) &&
-	    (!(cr->IntType & SOCKET_INTERFACE_MEMORY_AND_IO)) &&
-	    (get_socket.state & SBM_WP)) {
-		cmn_err(CE_NOTE, "!cs_request_configuration: attempting to "
-		    "write CIS config regs with WP set\n");
-	}
-
-	/*
-	 * Write any configuration registers that the client tells us are
-	 *	present to the card; save a copy of what we wrote so that we
-	 *	can return them if the client calls GetConfigurationInfo.
-	 * The order in which we write the configuration registers is
-	 *	specified by the PCMCIA spec; we must write the socket/copy
-	 *	register first (if it exists), and then we can write the
-	 *	registers in any arbitrary order.
-	 */
-	/* Socket and Copy Register */
-	if (client->present & CONFIG_COPY_REG_PRESENT) {
-	    crt->scr = cr->Copy;
-	    csx_Put8(cis_handle, crt->scr_p, crt->scr);
-	}
-
-	/* Pin Replacement Register */
-	if (client->present & CONFIG_PINREPL_REG_PRESENT) {
-	    crt->prr = cr->Pin;
-	    csx_Put8(cis_handle, crt->prr_p, crt->prr);
-	}
-
-	/* Configuration and Status Register */
-	/* XXX should we set CCSR_SIG_CHG in the CCSR? XXX */
-	if (client->present & CONFIG_STATUS_REG_PRESENT) {
-	    crt->ccsr = cr->Status;
-	    csx_Put8(cis_handle, crt->ccsr_p, crt->ccsr);
-	}
-
-	/* Extended Status Register */
-	if (client->present & CONFIG_EXSTAT_REG_PRESENT) {
-	    crt->exstat = cr->ExtendedStatus;
-	    csx_Put8(cis_handle, crt->exstat_p, crt->exstat);
-	}
-
-	/*
-	 * If any IO base and limit registers exist, and this client
-	 *	has done a RequestIO, setup the IO Base and IO Limit
-	 *	registers.
-	 */
-	if (client->flags & REQ_IO_DONE) {
-	    if (client->present & CONFIG_IOBASE0_REG_PRESENT) {
-		uint32_t base = client->io_alloc.BasePort1.base;
-		uint32_t present = (client->present &
-					CONFIG_IOBASE_REG_MASK) >>
-						CONFIG_IOBASE_REG_SHIFT;
-		uint32_t reg = crt->iobase0_p;
-
-		do {
-		    csx_Put8(cis_handle, reg, base & 0x0ff);
-		    reg = reg + 2;
-		    base = base >> 8;
-		    present = present >> 1;
-		} while (present);
-	    } /* CONFIG_IOBASE0_REG_PRESENT */
-
-	    if (client->present & CONFIG_IOLIMIT_REG_PRESENT) {
-		uint32_t np = client->io_alloc.NumPorts1 +
-					client->io_alloc.NumPorts2;
-		uint32_t limit, do_bit = 0;
-		int lm;
-
-		limit = (IONUMPORTS_FROBNITZ(np) - 1);
-
-		for (lm = 7; lm >= 0; lm--) {
-		    if (limit & (1 << lm))
-			do_bit = 1;
-		    if (do_bit)
-			limit |= (1 << lm);
-		} /* for */
-
-		csx_Put8(cis_handle, crt->iolimit_p, limit);
-	    } /* CONFIG_IOLIMIT_REG_PRESENT */
-	} /* REQ_IO_DONE */
-
-	/*
-	 * Mark the socket as being in IO mode.
-	 */
-	if (cr->IntType & SOCKET_INTERFACE_MEMORY_AND_IO)
-	    sp->flags |= SOCKET_IS_IO;
-
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Enable the interrupt if needed
-	 */
-	if (cr->Attributes & CONF_ENABLE_IRQ_STEERING)
-	    set_socket.IREQRouting |= IRQ_ENABLE;
-
-	/*
-	 * Now that we know if the PRR is present and if it is, which
-	 *	bits in the PRR are valid, we can construct the correct
-	 *	socket event mask.
-	 */
-	set_socket.SCIntMask = cs_merge_event_masks(sp, client);
-
-	/*
-	 * Configuration Option Register - we handle this specially since
-	 *	we don't allow the client to manipulate the RESET or
-	 *	INTERRUPT bits (although a client can manipulate these
-	 *	bits via an AccessConfigurationRegister call - explain
-	 *	THAT logic to me).
-	 * XXX - we force level-mode interrupts (COR_LEVEL_IRQ)
-	 * XXX - we always enable the function on a multi-function card
-	 */
-	if (client->present & CONFIG_OPTION_REG_PRESENT) {
-	    crt->cor = (cr->ConfigIndex & ~COR_SOFT_RESET) | COR_LEVEL_IRQ;
-	    if (client->present & CONFIG_IOBASE0_REG_PRESENT)
-		crt->cor |= COR_ENABLE_BASE_LIMIT;
-	    if (sp->cis_flags & CW_MULTI_FUNCTION_CIS) {
-		crt->cor |= COR_ENABLE_FUNCTION;
-		crt->cor &= ~COR_ENABLE_IREQ_ROUTING;
-		if (cr->Attributes & CONF_ENABLE_IRQ_STEERING)
-		    crt->cor |= COR_ENABLE_IREQ_ROUTING;
-	    } /* CW_MULTI_FUNCTION_CIS */
-
-#ifdef  CS_DEBUG
-	if (cs_debug > 0)
-		cmn_err(CE_CONT, "cs_request_configuration "
-		    "cor=x%x ConfigIndex=x%x Attributes=x%x flags=x%x\n"
-		    "present=x%x cis_handle=%p cor_p=x%x\n",
-		    crt->cor, cr->ConfigIndex, cr->Attributes, sp->cis_flags,
-		    client->present, cis_handle, crt->cor_p);
-#endif
-
-	    csx_Put8(cis_handle, crt->cor_p, crt->cor);
-	} /* CONFIG_OPTION_REG_PRESENT */
-
-	if (cs_rc1_delay)
-	    drv_usecwait(cs_rc1_delay * 1000);
-
-	/*
-	 * Set the socket to the parameters that the client requested.
-	 */
-	if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS) {
-	    if (client->present & CONFIG_OPTION_REG_PRESENT) {
-		crt->cor = 0; /* XXX is 0 the right thing here? */
-		csx_Put8(cis_handle, crt->cor_p, crt->cor);
-	    }
-	    sp->flags &= ~SOCKET_IS_IO;
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-	if (cs_rc2_delay)
-	    drv_usecwait(cs_rc2_delay * 1000);
-
-	/*
-	 * Mark this client as having done a successful RequestConfiguration
-	 *	call.
-	 */
-	client->flags |= REQ_CONFIGURATION_DONE;
-
-	mutex_exit(&sp->cis_lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_release_configuration - releases configuration previously set via the
- *		RequestConfiguration call; this is ReleaseConfiguration
- *
- *	returns: CS_SUCCESS - if configuration sucessfully released
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_BAD_SOCKET - if Socket Services returns an error
- *		 CS_BAD_HANDLE - a RequestConfiguration has not been done
- */
-/*ARGSUSED*/
-static int
-cs_release_configuration(client_handle_t client_handle, release_config_t *rcfg)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	volatile config_regs_t *crt;
-	set_socket_t set_socket;
-	get_socket_t get_socket;
-	acc_handle_t cis_handle;
-	int error;
-	uint32_t newoffset;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has not been done, we don't allow
-	 *	this call.
-	 */
-	if (!(client->flags & REQ_CONFIGURATION_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_HANDLE);
-	}
-
-#ifdef  CS_DEBUG
-	if (cs_debug > 0)
-		cmn_err(CE_CONT, "cs_release_configuration: "
-		    "flags=0x%x CW_MULTI_FUNCTION_CIS =0x%x \n",
-		    sp->cis_flags, CW_MULTI_FUNCTION_CIS);
-
-#endif
-	mutex_enter(&sp->cis_lock);
-
-	/*
-	 * Set the card back to a memory-only interface byte writing a zero
-	 *	to the COR.  Note that we don't update our soft copy of the
-	 *	COR state since the PCMCIA spec only requires us to maintain
-	 *	the last value that was written to that register during a
-	 *	call to RequestConfiguration.
-	 */
-	crt = &client->config_regs;
-
-	newoffset = client->config_regs_offset;
-	if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-					CISTPLF_AM_SPACE) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    cmn_err(CE_CONT, "cs_release_configuration: socket %d can't init "
-				"CIS window\n", sp->socket_num);
-	    return (CS_GENERAL_FAILURE);
-	}
-
-	if (sp->cis_flags & CW_MULTI_FUNCTION_CIS) {
-		/*
-		 * For the Multifunction cards do not reset the socket
-		 * to a memory only interface but do clear the
-		 * Configuration Option Register and  mark this client
-		 * as not having a configuration by clearing the
-		 * REQ_CONFIGURATION_DONE flag.
-		 */
-		client->flags &= ~REQ_CONFIGURATION_DONE;
-		csx_Put8(cis_handle, crt->cor_p, 0);
-
-		mutex_exit(&sp->cis_lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_SUCCESS);
-	}
-
-	/*
-	 * Set the socket back to a memory-only interface; don't change
-	 *	any other parameter of the socket.
-	 */
-	get_socket.socket = sp->socket_num;
-
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-	mutex_enter(&sp->lock);
-	sp->flags &= ~SOCKET_IS_IO;
-	set_socket.SCIntMask = cs_merge_event_masks(sp, client);
-	mutex_exit(&sp->lock);
-
-	set_socket.socket = sp->socket_num;
-	set_socket.IREQRouting = 0;
-	set_socket.CtlInd = get_socket.CtlInd;
-	set_socket.State = 0;	/* don't reset latched values */
-	set_socket.VccLevel = get_socket.VccLevel;
-	set_socket.Vpp1Level = get_socket.Vpp1Level;
-	set_socket.Vpp2Level = get_socket.Vpp2Level;
-	set_socket.IFType = IF_MEMORY;
-
-	if (client->present & CONFIG_OPTION_REG_PRESENT)
-	    csx_Put8(cis_handle, crt->cor_p, 0);
-
-	if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-	/*
-	 * Mark this client as not having a configuration.
-	 */
-	client->flags &= ~REQ_CONFIGURATION_DONE;
-
-	mutex_exit(&sp->cis_lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_modify_configuration - modifies a configuration established by
- *		RequestConfiguration; this is ModifyConfiguration
- *
- *	returns: CS_SUCCESS - if configuration sucessfully modified
- *		 CS_BAD_SOCKET - if Socket Services returns an error
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_BAD_HANDLE - a RequestConfiguration has not been done
- *		 CS_NO_CARD - if no card in socket
- *		 CS_BAD_ATTRIBUTE - if any unsupported or reserved flags
- *					are set
- *		 CS_BAD_VCC - if Vcc value is not supported by socket
- *		 CS_BAD_VPP1 - if Vpp1 value is not supported by socket
- *		 CS_BAD_VPP2 - if Vpp2 value is not supported by socket
- */
-static int
-cs_modify_configuration(client_handle_t client_handle, modify_config_t *mc)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	set_socket_t set_socket;
-	get_socket_t get_socket;
-	int error;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If RequestConfiguration has not been done, we don't allow
-	 *	this call.
-	 */
-	if (!(client->flags & REQ_CONFIGURATION_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_HANDLE);
-	}
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-
-	/*
-	 * Get the current socket parameters so that we can modify them.
-	 */
-	get_socket.socket = sp->socket_num;
-
-	if (SocketServices(SS_GetSocket, &get_socket) != SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 0)
-	    cmn_err(CE_CONT, "cs_modify_configuration: socket %d "
-				"client->irq_alloc.irq 0x%x "
-				"get_socket.IRQRouting 0x%x\n",
-				sp->socket_num, (int)client->irq_alloc.irq,
-				get_socket.IRQRouting);
-#endif
-
-	set_socket.socket = sp->socket_num;
-	set_socket.SCIntMask = get_socket.SCIntMask;
-	set_socket.CtlInd = get_socket.CtlInd;
-	set_socket.State = 0;	/* don't reset latched values */
-	set_socket.IFType = get_socket.IFType;
-
-	set_socket.IREQRouting = get_socket.IRQRouting;
-
-	/*
-	 * Modify the IRQ routing if the client wants it modified.
-	 */
-	if (mc->Attributes & CONF_IRQ_CHANGE_VALID) {
-	    set_socket.IREQRouting &= ~IRQ_ENABLE;
-
-	    if ((sp->cis_flags & CW_MULTI_FUNCTION_CIS) &&
-			(client->present & CONFIG_OPTION_REG_PRESENT)) {
-		config_regs_t *crt = &client->config_regs;
-		acc_handle_t cis_handle;
-		uint32_t newoffset = client->config_regs_offset;
-
-		/*
-		 * Get a pointer to a window that contains the configuration
-		 *	registers.
-		 */
-		if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-					CISTPLF_AM_SPACE) != CS_SUCCESS) {
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    cmn_err(CE_CONT,
-			"cs_modify_configuration: socket %d can't init "
-			"CIS window\n", sp->socket_num);
-		    return (CS_GENERAL_FAILURE);
-		} /* cs_init_cis_window */
-
-		crt->cor &= ~COR_ENABLE_IREQ_ROUTING;
-
-		if (mc->Attributes & CONF_ENABLE_IRQ_STEERING)
-		    crt->cor |= COR_ENABLE_IREQ_ROUTING;
-
-#ifdef  CS_DEBUG
-		if (cs_debug > 0)
-			cmn_err(CE_CONT, "cs_modify_configuration:"
-			    " cor_p=0x%x cor=0x%x\n",
-			    crt->cor_p, crt->cor);
-#endif
-		csx_Put8(cis_handle, crt->cor_p, crt->cor);
-
-	    } /* CW_MULTI_FUNCTION_CIS */
-
-	    if (mc->Attributes & CONF_ENABLE_IRQ_STEERING)
-		set_socket.IREQRouting |= IRQ_ENABLE;
-
-	} /* CONF_IRQ_CHANGE_VALID */
-
-	/*
-	 * Modify the voltage levels that the client specifies.
-	 */
-	set_socket.VccLevel = get_socket.VccLevel;
-
-	if (mc->Attributes & CONF_VPP1_CHANGE_VALID) {
-	    if (cs_convert_powerlevel(sp->socket_num, mc->Vpp1, VPP1,
-					&set_socket.Vpp1Level) != CS_SUCCESS) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_VPP);
-	    }
-	} else {
-	    set_socket.Vpp1Level = get_socket.Vpp1Level;
-	}
-
-	if (mc->Attributes & CONF_VPP2_CHANGE_VALID) {
-	    if (cs_convert_powerlevel(sp->socket_num, mc->Vpp2, VPP2,
-					&set_socket.Vpp2Level) != CS_SUCCESS) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_VPP);
-	    }
-	} else {
-	    set_socket.Vpp2Level = get_socket.Vpp2Level;
-	}
-
-	/*
-	 * Setup the modified socket configuration.
-	 */
-	if (SocketServices(SS_SetSocket, &set_socket) != SUCCESS) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_BAD_SOCKET);
-	}
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_access_configuration_register - provides a client access to the card's
- *		configuration registers; this is AccessConfigurationRegister
- *
- *	returns: CS_SUCCESS - if register accessed successfully
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_BAD_ARGS - if arguments are out of range
- *		 CS_NO_CARD - if no card in socket
- *		 CS_BAD_BASE - if no config registers base address
- *		 CS_UNSUPPORTED_MODE - if no RequestConfiguration has
- *				been done yet
- */
-static int
-cs_access_configuration_register(client_handle_t client_handle,
-						access_config_reg_t *acr)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	acc_handle_t cis_handle;
-	int error;
-	uint32_t newoffset;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Make sure that the specifed offset is in range.
-	 */
-	if (acr->Offset > ((CISTPL_CONFIG_MAX_CONFIG_REGS * 2) - 2))
-	    return (CS_BAD_ARGS);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-
-	/*
-	 * If RequestConfiguration has not been done, we don't allow
-	 *	this call.
-	 */
-	if (!(client->flags & REQ_CONFIGURATION_DONE)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_UNSUPPORTED_MODE);
-	}
-
-	mutex_enter(&sp->cis_lock);
-
-	/*
-	 * Get a pointer to the CIS window
-	 */
-	newoffset = client->config_regs_offset + acr->Offset;
-	if (cs_init_cis_window(sp, &newoffset, &cis_handle,
-					CISTPLF_AM_SPACE) != CS_SUCCESS) {
-	    mutex_exit(&sp->cis_lock);
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    cmn_err(CE_CONT, "cs_ACR: socket %d can't init CIS window\n",
-							sp->socket_num);
-	    return (CS_GENERAL_FAILURE);
-	}
-
-	/*
-	 * Create the address for the config register that the client
-	 *	wants to access.
-	 */
-	mutex_enter(&sp->lock);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 1) {
-	    cmn_err(CE_CONT, "cs_ACR: config_regs_offset 0x%x "
-		"Offset 0x%x newoffset 0x%x\n",
-		(int)client->config_regs_offset,
-		(int)acr->Offset, newoffset);
-	}
-#endif
-
-	/*
-	 * Determine what the client wants us to do.  The client is
-	 *	allowed to specify any valid offset, even if it would
-	 *	cause an unimplemented configuration register to be
-	 *	accessed.
-	 */
-	error = CS_SUCCESS;
-	switch (acr->Action) {
-	    case CONFIG_REG_READ:
-		acr->Value = csx_Get8(cis_handle, newoffset);
-		break;
-	    case CONFIG_REG_WRITE:
-		csx_Put8(cis_handle, newoffset, acr->Value);
-		break;
-	    default:
-		error = CS_BAD_ARGS;
-		break;
-	} /* switch */
-
-	mutex_exit(&sp->lock);
-	mutex_exit(&sp->cis_lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (error);
-}
-
-/*
- * ==== RESET and general info functions ====
- */
-
-/*
- * cs_reset_function - RESET the requested function on the card; this
- *			is ResetFunction
- *
- *    Note: We don't support this functionality yet, and the standard
- *		says it's OK to reutrn CS_IN_USE if we can't do this
- *		operation.
- */
-/*ARGSUSED*/
-static int
-cs_reset_function(client_handle_t ch, reset_function_t *rf)
-{
-	return (CS_IN_USE);
-}
-
-/*
- * cs_get_configuration_info - return configuration info for the passed
- *				socket and function number to the caller;
- *				this is GetConfigurationInfo
- */
-/*ARGSUSED*/
-static int
-cs_get_configuration_info(client_handle_t *chp, get_configuration_info_t *gci)
-{
-	cs_socket_t *sp;
-	uint32_t fn;
-	client_t *client;
-	int client_lock_acquired;
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(CS_GET_SOCKET_NUMBER(gci->Socket))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-	mutex_enter(&sp->lock);
-
-	fn = CS_GET_FUNCTION_NUMBER(gci->Socket);
-
-	client = sp->client_list;
-	while (client) {
-
-	    if (GET_CLIENT_FUNCTION(client->client_handle) == fn) {
-
-		/*
-		 * If there's no card in the socket or the card in the
-		 *	socket is not for this client, then return
-		 *	an error.
-		 */
-		if (!(client->flags & CLIENT_CARD_INSERTED)) {
-		    mutex_exit(&sp->lock);
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    return (CS_NO_CARD);
-		}
-
-		mutex_exit(&sp->lock);
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_SUCCESS);
-
-	    } /* GET_CLIENT_FUNCTION == fn */
-
-	    client = client->next;
-	} /* while (client) */
-
-	mutex_exit(&sp->lock);
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_BAD_SOCKET);
-}
-
-/*
- * cs_get_cardservices_info - return info about Card Services to the
- *	caller; this is GetCardServicesInfo
- */
-/*ARGSUSED*/
-static int
-cs_get_cardservices_info(client_handle_t ch, get_cardservices_info_t *gcsi)
-{
-	gcsi->Signature[0] = 'C';
-	gcsi->Signature[1] = 'S';
-	gcsi->NumSockets = cs_globals.num_sockets;
-	gcsi->Revision = CS_INTERNAL_REVISION_LEVEL;
-	gcsi->CSLevel = CS_VERSION;
-	gcsi->FuncsPerSocket = CIS_MAX_FUNCTIONS;
-	(void) strncpy(gcsi->VendorString,
-					CS_GET_CARDSERVICES_INFO_VENDOR_STRING,
-					CS_GET_CARDSERVICES_INFO_MAX_VS_LEN);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_get_physical_adapter_info - returns information about the requested
- *					physical adapter; this is
- *					GetPhysicalAdapterInfo
- *
- *	calling: client_handle_t:
- *			NULL - use map_log_socket_t->LogSocket member
- *				to specify logical socket number
- *			!NULL - extract logical socket number from
- *				client_handle_t
- *
- *	returns: CS_SUCCESS
- *		 CS_BAD_SOCKET - if client_handle_t is NULL and invalid
- *					socket number is specified in
- *					map_log_socket_t->LogSocket
- *		 CS_BAD_HANDLE - if client_handle_t is !NULL and invalid
- *					client handle is specified
- */
-static int
-cs_get_physical_adapter_info(client_handle_t ch,
-					get_physical_adapter_info_t *gpai)
-{
-	cs_socket_t *sp;
-	int client_lock_acquired;
-
-	if (ch == NULL)
-	    gpai->PhySocket = CS_GET_SOCKET_NUMBER(gpai->LogSocket);
-	else
-	    gpai->PhySocket = GET_CLIENT_SOCKET(ch);
-
-	/*
-	 * Determine if the passed socket number is valid or not.
-	 */
-	if ((sp = cs_get_sp(CS_GET_SOCKET_NUMBER(gpai->PhySocket))) == NULL)
-	    return ((ch == NULL) ? CS_BAD_SOCKET : CS_BAD_HANDLE);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 * If we were passed a client handle, determine if it's valid or not.
-	 */
-	if (ch != NULL) {
-	    if (cs_find_client(ch, NULL) == NULL) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_HANDLE);
-	    } /* cs_find_client */
-	} /* ch != NULL */
-
-	gpai->flags = sp->adapter.flags;
-	(void) strcpy(gpai->name, sp->adapter.name);
-	gpai->major = sp->adapter.major;
-	gpai->minor = sp->adapter.minor;
-	gpai->instance = sp->adapter.instance;
-	gpai->number = sp->adapter.number;
-	gpai->num_sockets = sp->adapter.num_sockets;
-	gpai->first_socket = sp->adapter.first_socket;
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * ==== general functions ====
- */
-
-/*
- * cs_map_log_socket - returns the physical socket number associated with
- *			either the passed client handle or the passed
- *			logical socket number; this is MapLogSocket
- *
- *	calling: client_handle_t:
- *			NULL - use map_log_socket_t->LogSocket member
- *				to specify logical socket number
- *			!NULL - extract logical socket number from
- *				client_handle_t
- *
- *	returns: CS_SUCCESS
- *		 CS_BAD_SOCKET - if client_handle_t is NULL and invalid
- *					socket number is specified in
- *					map_log_socket_t->LogSocket
- *		 CS_BAD_HANDLE - if client_handle_t is !NULL and invalid
- *					client handle is specified
- *
- * Note: We provide this function since the instance number of a client
- *		driver doesn't necessary correspond to the physical
- *		socket number
- */
-static int
-cs_map_log_socket(client_handle_t ch, map_log_socket_t *mls)
-{
-	cs_socket_t *sp;
-	int client_lock_acquired;
-
-	if (ch == NULL)
-	    mls->PhySocket = CS_GET_SOCKET_NUMBER(mls->LogSocket);
-	else
-	    mls->PhySocket = GET_CLIENT_SOCKET(ch);
-
-	/*
-	 * Determine if the passed socket number is valid or not.
-	 */
-	if ((sp = cs_get_sp(CS_GET_SOCKET_NUMBER(mls->PhySocket))) == NULL)
-	    return ((ch == NULL) ? CS_BAD_SOCKET : CS_BAD_HANDLE);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 * If we were passed a client handle, determine if it's valid or not.
-	 */
-	if (ch != NULL) {
-	    if (cs_find_client(ch, NULL) == NULL) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_BAD_HANDLE);
-	    } /* cs_find_client */
-	} /* ch != NULL */
-
-	mls->PhyAdapter = sp->adapter.number;
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_convert_speed - convers nS to devspeed and devspeed to nS
- *
- * The actual function is is in the CIS parser module; this
- *	is only a wrapper.
- */
-static int
-cs_convert_speed(convert_speed_t *cs)
-{
-	return ((int)(uintptr_t)CIS_PARSER(CISP_CIS_CONV_DEVSPEED, cs));
-}
-
-/*
- * cs_convert_size - converts a devsize value to a size in bytes value
- *			or a size in bytes value to a devsize value
- *
- * The actual function is is in the CIS parser module; this
- *	is only a wrapper.
- */
-static int
-cs_convert_size(convert_size_t *cs)
-{
-	return ((int)(uintptr_t)CIS_PARSER(CISP_CIS_CONV_DEVSIZE, cs));
-}
-
-/*
- * cs_convert_powerlevel - converts a power level in tenths of a volt
- *			to a power table entry for the specified socket
- *
- *	returns: CS_SUCCESS - if volts converted to a valid power level
- *		 CS_BAD_ADAPTER - if SS_InquireAdapter fails
- *		 CS_BAD_ARGS - if volts are not supported on this socket
- *				and adapter
- */
-static int
-cs_convert_powerlevel(uint32_t sn, uint32_t volts, uint32_t flags, unsigned *pl)
-{
-	inquire_adapter_t inquire_adapter;
-	int i;
-
-#ifdef	lint
-	if (sn == 0)
-	    panic("lint panic");
-#endif
-
-	*pl = 0;
-
-	if (SocketServices(SS_InquireAdapter, &inquire_adapter) != SUCCESS)
-	    return (CS_BAD_ADAPTER);
-
-	for (i = 0; (i < inquire_adapter.NumPower); i++) {
-	    if ((inquire_adapter.power_entry[i].ValidSignals & flags) &&
-		(inquire_adapter.power_entry[i].PowerLevel == volts)) {
-		*pl = i;
-		return (CS_SUCCESS);
-	    }
-	}
-
-	return (CS_BAD_ARGS);
-}
-
-/*
- * cs_event2text - returns text string(s) associated with the event; this
- *			function supports the Event2Text CS call.
- *
- *	calling: event2text_t * - pointer to event2text struct
- *		 int event_source - specifies event type in event2text_t:
- *					0 - SS event
- *					1 - CS event
- *
- *	returns: CS_SUCCESS
- */
-static int
-cs_event2text(event2text_t *e2t, int event_source)
-{
-	event_t event;
-	char *sepchar = "|";
-
-	/*
-	 * If event_source is 0, this is a SS event
-	 */
-	if (!event_source) {
-	    for (event = 0; event < MAX_SS_EVENTS; event++) {
-		if (cs_ss_event_text[event].ss_event == e2t->event) {
-		    (void) strcpy(e2t->text, cs_ss_event_text[event].text);
-		    return (CS_SUCCESS);
-		}
-	    }
-	    (void) strcpy(e2t->text, cs_ss_event_text[MAX_CS_EVENTS].text);
-	    return (CS_SUCCESS);
-	} else {
-		/*
-		 * This is a CS event
-		 */
-	    e2t->text[0] = '\0';
-	    for (event = 0; event < MAX_CS_EVENTS; event++) {
-		if (cs_ss_event_text[event].cs_event & e2t->event) {
-		    (void) strcat(e2t->text, cs_ss_event_text[event].text);
-		    (void) strcat(e2t->text, sepchar);
-		} /* if (cs_ss_event_text) */
-	    } /* for (event) */
-	    if (e2t->text[0])
-		e2t->text[strlen(e2t->text)-1] = NULL;
-	} /* if (!event_source) */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_error2text - returns a pointer to a text string containing the name
- *			of the passed Card Services function or return code
- *
- *	This function supports the Error2Text CS call.
- */
-static char *
-cs_error2text(int function, int type)
-{
-	cs_csfunc2text_strings_t *cfs;
-	int end_marker;
-
-	if (type == CSFUN2TEXT_FUNCTION) {
-	    cfs = cs_csfunc2text_funcstrings;
-	    end_marker = CSFuncListEnd;
-	} else {
-	    cfs = cs_csfunc2text_returnstrings;
-	    end_marker = CS_ERRORLIST_END;
-	}
-
-	while (cfs->item != end_marker) {
-	    if (cfs->item == function)
-		return (cfs->text);
-	    cfs++;
-	}
-
-	return (cfs->text);
-}
-
-/*
- * cs_make_device_node - creates/removes device nodes on a client's behalf;
- *				this is MakeDeviceNode and RemoveDeviceNode
- *
- *	returns: CS_SUCCESS - if all device nodes successfully created/removed
- *		 CS_BAD_ATTRIBUTE - if NumDevNodes is not zero when Action
- *				is REMOVAL_ALL_DEVICES
- *		 CS_BAD_ARGS - if an invalid Action code is specified
- *		 CS_UNSUPPORTED_FUNCTION - if SS is trying to call us
- *		 CS_OUT_OF_RESOURCE - if can't create/remove device node
- */
-static int
-cs_make_device_node(client_handle_t client_handle, make_device_node_t *mdn)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	ss_make_device_node_t ss_make_device_node;
-	int error, i;
-	int client_lock_acquired;
-
-	/*
-	 * Check to see if this is the Socket Services client handle; if it
-	 *	is, we don't support SS using this call.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle))
-	    return (CS_UNSUPPORTED_FUNCTION);
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	/*
-	 *  Make sure that this is a valid client handle.
-	 */
-	if (!(client = cs_find_client(client_handle, &error))) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (error);
-	}
-
-#ifdef	XXX
-	/*
-	 * If there's no card in the socket or the card in the socket is not
-	 *	for this client, then return an error.
-	 */
-	if (!(client->flags & CLIENT_CARD_INSERTED)) {
-	    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	    return (CS_NO_CARD);
-	}
-#endif
-
-	/*
-	 * Setup the client's dip, since we use it later on.
-	 */
-	ss_make_device_node.dip = client->dip;
-
-	/*
-	 * Make sure that we're being given a valid Action.  Set the default
-	 *	error code as well.
-	 */
-	error = CS_BAD_ARGS;	/* for default case */
-	switch (mdn->Action) {
-	    case CREATE_DEVICE_NODE:
-	    case REMOVE_DEVICE_NODE:
-		break;
-	    case REMOVAL_ALL_DEVICE_NODES:
-		if (mdn->NumDevNodes) {
-		    error = CS_BAD_ATTRIBUTE;
-		} else {
-		    ss_make_device_node.flags = SS_CSINITDEV_REMOVE_DEVICE;
-		    ss_make_device_node.name = NULL;
-		    SocketServices(CSInitDev, &ss_make_device_node);
-		    error = CS_SUCCESS;
-		}
-		/* fall-through case */
-	    default:
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (error);
-		/* NOTREACHED */
-	} /* switch */
-
-	/*
-	 * Loop through the device node descriptions and create or destroy
-	 *	the device node.
-	 */
-	for (i = 0; i < mdn->NumDevNodes; i++) {
-	    devnode_desc_t *devnode_desc = &mdn->devnode_desc[i];
-
-	    ss_make_device_node.name = devnode_desc->name;
-	    ss_make_device_node.spec_type = devnode_desc->spec_type;
-	    ss_make_device_node.minor_num = devnode_desc->minor_num;
-	    ss_make_device_node.node_type = devnode_desc->node_type;
-
-	/*
-	 * Set the appropriate flag for the action that we want
-	 *	SS to perform. Note that if we ever OR-in the flag
-	 *	here, we need to be sure to clear the flags member
-	 *	since we sometimes OR-in other flags below.
-	 */
-	    if (mdn->Action == CREATE_DEVICE_NODE) {
-		ss_make_device_node.flags = SS_CSINITDEV_CREATE_DEVICE;
-	    } else {
-		ss_make_device_node.flags = SS_CSINITDEV_REMOVE_DEVICE;
-	    }
-
-	/*
-	 * If this is not the last device to process, then we need
-	 *	to tell SS that more device process requests are on
-	 *	their way after this one.
-	 */
-	    if (i < (mdn->NumDevNodes - 1))
-		ss_make_device_node.flags |= SS_CSINITDEV_MORE_DEVICES;
-
-	    if (SocketServices(CSInitDev, &ss_make_device_node) != SUCCESS) {
-		EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		return (CS_OUT_OF_RESOURCE);
-	    } /* CSInitDev */
-	} /* for (mdn->NumDevNodes) */
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_remove_device_node - removes device nodes
- *
- *	(see cs_make_device_node for a description of the calling
- *		and return parameters)
- */
-static int
-cs_remove_device_node(client_handle_t client_handle, remove_device_node_t *rdn)
-{
-
-	/*
-	 * XXX - Note the assumption here that the make_device_node_t and
-	 *	remove_device_node_t structures are identical.
-	 */
-	return (cs_make_device_node(client_handle, (make_device_node_t *)rdn));
-}
-
-/*
- * cs_ddi_info - this function is used by clients that need to support
- *			the xxx_getinfo function; this is CS_DDI_Info
- */
-static int
-cs_ddi_info(cs_ddi_info_t *cdi)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	int client_lock_acquired;
-
-	if (cdi->driver_name == NULL)
-	    return (CS_BAD_ATTRIBUTE);
-
-#ifdef	CS_DEBUG
-	if (cs_debug > 0) {
-	    cmn_err(CE_CONT, "cs_ddi_info: socket %d client [%s]\n",
-					(int)cdi->Socket, cdi->driver_name);
-	}
-#endif
-
-	/*
-	 * Check to see if the socket number is in range - the system
-	 *	framework may cause a client driver to call us with
-	 *	a socket number that used to be present but isn't
-	 *	anymore. This is not a bug, and it's OK to return
-	 *	an error if the socket number is out of range.
-	 */
-	if (!CHECK_SOCKET_NUM(cdi->Socket, cs_globals.max_socket_num)) {
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 0) {
-		cmn_err(CE_CONT, "cs_ddi_info: socket %d client [%s] "
-						"SOCKET IS OUT OF RANGE\n",
-							(int)cdi->Socket,
-							cdi->driver_name);
-	    }
-#endif
-
-	    return (CS_BAD_SOCKET);
-	} /* if (!CHECK_SOCKET_NUM) */
-
-	/*
-	 * Get a pointer to this client's socket structure.
-	 */
-	if ((sp = cs_get_sp(cdi->Socket)) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	EVENT_THREAD_MUTEX_ENTER(client_lock_acquired, sp);
-
-	client = sp->client_list;
-	while (client) {
-
-#ifdef	CS_DEBUG
-	    if (cs_debug > 0) {
-		cmn_err(CE_CONT, "cs_ddi_info: socket %d checking client [%s] "
-							"handle 0x%x\n",
-						(int)cdi->Socket,
-						client->driver_name,
-						(int)client->client_handle);
-	    }
-#endif
-
-	    if (client->driver_name != NULL) {
-		if (!(strcmp(client->driver_name, cdi->driver_name))) {
-		    cdi->dip = client->dip;
-		    cdi->instance = client->instance;
-
-#ifdef	CS_DEBUG
-		    if (cs_debug > 0) {
-			cmn_err(CE_CONT, "cs_ddi_info: found client [%s] "
-						"instance %d handle 0x%x\n",
-					client->driver_name, client->instance,
-					(int)client->client_handle);
-		    }
-#endif
-
-		    EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-		    return (CS_SUCCESS);
-		} /* strcmp */
-	    } /* driver_name != NULL */
-	    client = client->next;
-	} /* while (client) */
-
-	EVENT_THREAD_MUTEX_EXIT(client_lock_acquired, sp);
-	return (CS_BAD_SOCKET);
-}
-
-/*
- * cs_sys_ctl - Card Services system control; this is CS_Sys_Ctl
- */
-static int
-cs_sys_ctl(cs_sys_ctl_t *csc)
-{
-	cs_socket_t *sp;
-	client_t *cp;
-	int sn, ret = CS_UNSUPPORTED_MODE;
-
-	switch (csc->Action) {
-	    case CS_SYS_CTL_SEND_EVENT:
-		if (csc->Flags & CS_SYS_CTL_EVENT_SOCKET)
-		    sn = CS_GET_SOCKET_NUMBER(csc->Socket);
-		else
-		    sn = GET_CLIENT_SOCKET(csc->client_handle);
-		if ((sp = cs_get_sp(sn)) == NULL)
-		    return (CS_BAD_SOCKET);
-		mutex_enter(&sp->client_lock);
-		mutex_enter(&sp->lock);
-		csc->Events &= CS_EVENT_CLIENT_EVENTS_MASK;
-		if (csc->Flags & CS_SYS_CTL_EVENT_SOCKET)
-		    sp->events |= csc->Events;
-		if (csc->Flags & CS_SYS_CTL_EVENT_CLIENT) {
-		    if ((cp = cs_find_client(csc->client_handle, &ret)) ==
-									NULL) {
-			mutex_exit(&sp->lock);
-			mutex_exit(&sp->client_lock);
-			return (ret);
-		    } /* cs_find_client */
-			/*
-			 * Setup the events that we want to send to the client.
-			 */
-		    cp->events |= (csc->Events &
-					(cp->event_mask | cp->global_mask));
-		} /* CS_SYS_CTL_EVENT_CLIENT */
-
-		if (csc->Flags & CS_SYS_CTL_WAIT_SYNC) {
-		    sp->thread_state |= SOCKET_WAIT_SYNC;
-		    mutex_exit(&sp->lock);
-		    cv_broadcast(&sp->thread_cv);
-		    cv_wait(&sp->caller_cv, &sp->client_lock);
-		} else {
-		    mutex_exit(&sp->lock);
-		    cv_broadcast(&sp->thread_cv);
-		} /* CS_SYS_CTL_WAIT_SYNC */
-		mutex_exit(&sp->client_lock);
-		ret = CS_SUCCESS;
-		break;
-	    default:
-		break;
-	} /* switch */
-
-	return (ret);
-}
-
-/*
- * cs_get_sp - returns pointer to per-socket structure for passed
- *		socket number
- *
- *	return:	(cs_socket_t *) - pointer to socket structure
- *		NULL - invalid socket number passed in
- */
-static cs_socket_t *
-cs_get_sp(uint32_t sn)
-{
-	cs_socket_t *sp = cs_globals.sp;
-
-	if (!(cs_globals.init_state & GLOBAL_INIT_STATE_SS_READY))
-	    return (NULL);
-
-	if ((sp = cs_find_sp(sn)) == NULL)
-	    return (NULL);
-
-	if (sp->flags & SOCKET_IS_VALID)
-	    return (sp);
-
-	return (NULL);
-}
-
-/*
- * cs_find_sp - searches socket list and returns pointer to passed socket
- *			number
- *
- *	return:	(cs_socket_t *) - pointer to socket structure if found
- *		NULL - socket not found
- */
-static cs_socket_t *
-cs_find_sp(uint32_t sn)
-{
-	cs_socket_t *sp = cs_globals.sp;
-
-	while (sp) {
-	    if (sp->socket_num == CS_GET_SOCKET_NUMBER(sn))
-		return (sp);
-	    sp = sp->next;
-	} /* while */
-
-	return (NULL);
-}
-
-/*
- * cs_add_socket - add a socket
- *
- *	call:	sn - socket number to add
- *
- *	return:	CS_SUCCESS - operation sucessful
- *		CS_BAD_SOCKET - unable to add socket
- *		CS_BAD_WINDOW - unable to get CIS window for socket
- *
- * We get called here once for each socket that the framework wants to
- *	add. When we are called, the framework guarentees that until we
- *	complete this routine, no other adapter instances will be allowed
- *	to attach and thus no other PCE_ADD_SOCKET events will occur.
- *	It is safe to call SS_InquireAdapter to get the number of
- *	windows that the framework currently knows about.
- */
-static uint32_t
-cs_add_socket(uint32_t sn)
-{
-	cs_socket_t *sp;
-	sservice_t sservice;
-	get_cookies_and_dip_t *gcad;
-	win_req_t win_req;
-	convert_speed_t convert_speed;
-	set_socket_t set_socket;
-	cs_window_t *cw;
-	inquire_adapter_t inquire_adapter;
-	inquire_window_t inquire_window;
-	int ret, added_windows;
-
-	if (!(cs_globals.init_state & GLOBAL_INIT_STATE_SS_READY))
-	    return (CS_BAD_SOCKET);
-
-	/*
-	 * See if this socket has already been added - if it has, we
-	 *	fail this. If we can't find the socket, then allocate
-	 *	a new socket structure. If we do find the socket, then
-	 *	check to see if it's already added; if it is, then
-	 *	this is an error and return CS_BAD_SOCKET; if not,
-	 *	then traverse the socket structure list and add this
-	 *	next socket strcture to the end of the list.
-	 * XXX What about locking this list while we update it? Is
-	 *	that necessary since we're using the SOCKET_IS_VALID
-	 *	flag and since we never delete a socket from the
-	 *	list once it's been added?
-	 */
-	if ((sp = cs_find_sp(sn)) == NULL) {
-	    cs_socket_t *spp = cs_globals.sp;
-
-	    sp = (cs_socket_t *)kmem_zalloc(sizeof (cs_socket_t), KM_SLEEP);
-
-	    if (cs_globals.sp == NULL)
-		cs_globals.sp = sp;
-	    else
-		while (spp) {
-		    if (spp->next == NULL) {
-			spp->next = sp;
-			break;
-		    } /* if */
-		    spp = spp->next;
-		} /* while */
-
-	} else {
-	    if (sp->flags & SOCKET_IS_VALID)
-		return (CS_BAD_SOCKET);
-	} /* cs_find_sp */
-
-	/*
-	 * Setup the socket number
-	 */
-	sp->socket_num = sn;
-
-	/*
-	 * Find out how many windows the framework knows about
-	 *	so far. If this number of windows is greater
-	 *	than our current window count, bump up our
-	 *	current window count.
-	 * XXX Note that there is a BIG assumption here and that
-	 *	is that once the framework tells us that it has
-	 *	a window (as reflected in the NumWindows
-	 *	value) it can NEVER remove that window.
-	 *	When we really get the drop socket and drop
-	 *	window mechanism working correctly, we'll have
-	 *	to revisit this.
-	 */
-	SocketServices(SS_InquireAdapter, &inquire_adapter);
-
-	mutex_enter(&cs_globals.window_lock);
-	added_windows = inquire_adapter.NumWindows - cs_globals.num_windows;
-	if (added_windows > 0) {
-	    if (cs_add_windows(added_windows,
-				cs_globals.num_windows) != CS_SUCCESS) {
-		mutex_exit(&cs_globals.window_lock);
-		return (CS_BAD_WINDOW);
-	    } /* cs_add_windows */
-
-	    cs_globals.num_windows = inquire_adapter.NumWindows;
-
-	} /* if (added_windows) */
-
-	/*
-	 * Find a window that we can use for this socket's CIS window.
-	 */
-	sp->cis_win_num = PCMCIA_MAX_WINDOWS;
-
-	convert_speed.Attributes = CONVERT_NS_TO_DEVSPEED;
-	convert_speed.nS = CIS_DEFAULT_SPEED;
-	(void) cs_convert_speed(&convert_speed);
-
-	win_req.win_params.AccessSpeed = convert_speed.devspeed;
-	win_req.Attributes = (WIN_MEMORY_TYPE_AM | WIN_DATA_WIDTH_8);
-	win_req.Attributes = (WIN_MEMORY_TYPE_AM | WIN_MEMORY_TYPE_CM);
-	win_req.Base.base = 0;
-	win_req.Size = 0;
-
-	if ((ret = cs_find_mem_window(sp->socket_num, &win_req,
-					&sp->cis_win_num)) != CS_SUCCESS) {
-	    mutex_exit(&cs_globals.window_lock);
-	    sp->cis_win_num = PCMCIA_MAX_WINDOWS;
-	    cmn_err(CE_CONT, "cs_add_socket: socket %d can't get CIS "
-						"window - error 0x%x\n",
-						sp->socket_num, ret);
-	    return (CS_BAD_WINDOW);
-	} /* cs_find_mem_window */
-
-	if ((cw = cs_get_wp(sp->cis_win_num)) == NULL) {
-	    mutex_exit(&cs_globals.window_lock);
-	    return (CS_BAD_WINDOW);
-	}
-
-	inquire_window.window = sp->cis_win_num;
-	SocketServices(SS_InquireWindow, &inquire_window);
-
-	/*
-	 * If the CIS window is a variable sized window, then use
-	 *	the size that cs_find_mem_window returned to us,
-	 *	since this will be the minimum size that we can
-	 *	set this window to. If the CIS window is a fixed
-	 *	sized window, then use the system pagesize as the
-	 *	CIS window size.
-	 */
-	if (inquire_window.mem_win_char.MemWndCaps & WC_SIZE) {
-	    sp->cis_win_size = win_req.Size;
-	} else {
-	    sp->cis_win_size = PAGESIZE;
-	}
-
-	cw->state |= (CW_CIS | CW_ALLOCATED);
-	cw->socket_num = sp->socket_num;
-
-	mutex_exit(&cs_globals.window_lock);
-
-#if defined(CS_DEBUG)
-	    if (cs_debug > 1) {
-		cmn_err(CE_CONT, "cs_add_socket: socket %d using CIS window %d "
-					"size 0x%x\n", (int)sp->socket_num,
-					(int)sp->cis_win_num,
-					(int)sp->cis_win_size);
-	    }
-#endif
-
-	/*
-	 * Get the adapter information associated with this socket so
-	 *	that we can initialize the mutexes, condition variables,
-	 *	soft interrupt handler and per-socket adapter info.
-	 */
-	gcad = &sservice.get_cookies;
-	gcad->socket = sp->socket_num;
-	if (SocketServices(CSGetCookiesAndDip, &sservice) != SUCCESS) {
-	    cmn_err(CE_CONT, "cs_add_socket: socket %d CSGetCookiesAndDip "
-						"failure\n", sp->socket_num);
-	    return (CS_BAD_SOCKET);
-	} /* CSGetCookiesAndDip */
-
-	/*
-	 * Save the iblock and idev cookies for RegisterClient
-	 */
-	sp->iblk = gcad->iblock;
-	sp->idev = gcad->idevice;
-
-	/*
-	 * Setup the per-socket adapter info
-	 */
-	sp->adapter.flags = 0;
-	(void) strcpy(sp->adapter.name, gcad->adapter_info.name);
-	sp->adapter.major = gcad->adapter_info.major;
-	sp->adapter.minor = gcad->adapter_info.minor;
-	sp->adapter.instance = ddi_get_instance(gcad->dip);
-	sp->adapter.number = gcad->adapter_info.number;
-	sp->adapter.num_sockets = gcad->adapter_info.num_sockets;
-	sp->adapter.first_socket = gcad->adapter_info.first_socket;
-
-	/* Setup for cs_event and cs_event_thread */
-	mutex_init(&sp->lock, NULL, MUTEX_DRIVER, *(gcad->iblock));
-	mutex_init(&sp->client_lock, NULL, MUTEX_DRIVER, NULL);
-	mutex_init(&sp->cis_lock, NULL, MUTEX_DRIVER, NULL);
-
-	/* Setup for Socket Services work thread */
-	mutex_init(&sp->ss_thread_lock, NULL, MUTEX_DRIVER, NULL);
-
-	sp->init_state |= SOCKET_INIT_STATE_MUTEX;
-
-	/* Setup for cs_event_thread */
-	cv_init(&sp->thread_cv, NULL, CV_DRIVER, NULL);
-	cv_init(&sp->caller_cv, NULL, CV_DRIVER, NULL);
-	cv_init(&sp->reset_cv, NULL, CV_DRIVER, NULL);
-
-	/* Setup for Socket Services work thread */
-	cv_init(&sp->ss_thread_cv, NULL, CV_DRIVER, NULL);
-	cv_init(&sp->ss_caller_cv, NULL, CV_DRIVER, NULL);
-
-	sp->init_state |= SOCKET_INIT_STATE_CV;
-
-	/*
-	 * If we haven't installed it yet, then install the soft interrupt
-	 *	handler and save away the softint id.
-	 */
-	if (!(cs_globals.init_state & GLOBAL_INIT_STATE_SOFTINTR)) {
-	    if (ddi_add_softintr(gcad->dip, DDI_SOFTINT_HIGH,
-						&sp->softint_id,
-						NULL, NULL,
-						cs_socket_event_softintr,
-						(caddr_t)NULL) != DDI_SUCCESS) {
-		    cmn_err(CE_CONT, "cs_add_socket: socket %d can't add "
-						"softintr\n", sp->socket_num);
-		    return (CS_BAD_SOCKET);
-	    } /* ddi_add_softintr */
-
-	    mutex_enter(&cs_globals.global_lock);
-	    cs_globals.softint_id = sp->softint_id;
-	    cs_globals.init_state |= GLOBAL_INIT_STATE_SOFTINTR;
-	    /* XXX this timer is hokey at best... */
-	    cs_globals.sotfint_tmo = timeout(cs_event_softintr_timeout,
-		NULL, SOFTINT_TIMEOUT_TIME);
-	    mutex_exit(&cs_globals.global_lock);
-	} else {
-		/*
-		 * We've already added the soft interrupt handler, so just
-		 *	store away the softint id.
-		 */
-	    sp->softint_id = cs_globals.softint_id;
-	} /* if (!GLOBAL_INIT_STATE_SOFTINTR) */
-
-	/*
-	 * While this next flag doesn't really describe a per-socket
-	 *	resource, we still set it for each socket.  When the soft
-	 *	interrupt handler finally gets removed in cs_deinit, this
-	 *	flag will get cleared.
-	 */
-	sp->init_state |= SOCKET_INIT_STATE_SOFTINTR;
-
-	/*
-	 * Socket Services defaults all sockets to power off and
-	 *	clears all event masks.  We want to receive at least
-	 *	card insertion events, so enable them.  Turn off power
-	 *	to the socket as well.  We will turn it on again when
-	 *	we get a card insertion event.
-	 */
-	sp->event_mask = CS_EVENT_CARD_INSERTION;
-	set_socket.socket = sp->socket_num;
-	set_socket.SCIntMask = SBM_CD;
-	set_socket.IREQRouting = 0;
-	set_socket.IFType = IF_MEMORY;
-	set_socket.CtlInd = 0; /* turn off controls and indicators */
-	set_socket.State = (unsigned)~0;	/* clear latched state bits */
-
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VCC,
-						&set_socket.VccLevel);
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VPP1,
-						&set_socket.Vpp1Level);
-	(void) cs_convert_powerlevel(sp->socket_num, 0, VPP2,
-						&set_socket.Vpp2Level);
-
-	if ((ret = SocketServices(SS_SetSocket, &set_socket)) != SUCCESS) {
-	    cmn_err(CE_CONT, "cs_add_socket: socket %d SS_SetSocket "
-					"failure %d\n", sp->socket_num, ret);
-		return (CS_BAD_SOCKET);
-	} /* SS_SetSocket */
-
-	/*
-	 * The various socket-specific variables are now set up, so
-	 *	increment the global socket count and also mark the
-	 *	socket as available. We need to set this before we
-	 *	start any of the per-socket threads so that the threads
-	 *	can get a valid socket pointer when they start.
-	 */
-	mutex_enter(&cs_globals.global_lock);
-	cs_globals.num_sockets++;
-	cs_globals.max_socket_num =
-			max(cs_globals.max_socket_num, sp->socket_num + 1);
-	mutex_exit(&cs_globals.global_lock);
-	sp->flags = SOCKET_IS_VALID;
-
-	/*
-	 * Create the per-socket event handler thread.
-	 */
-	sp->event_thread = CREATE_SOCKET_EVENT_THREAD(cs_event_thread,
-		(uintptr_t)sn);
-
-	mutex_enter(&sp->lock);
-	sp->init_state |= SOCKET_INIT_STATE_THREAD;
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Create the per-socket Socket Services work thread.
-	 */
-	sp->ss_thread = CREATE_SOCKET_EVENT_THREAD(cs_ss_thread,
-		(uintptr_t)sn);
-
-	mutex_enter(&sp->lock);
-	sp->init_state |= (SOCKET_INIT_STATE_SS_THREAD |
-						SOCKET_INIT_STATE_READY);
-	sp->event_mask = CS_EVENT_CARD_INSERTION;
-	mutex_exit(&sp->lock);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_drop_socket - drop a socket
- *
- *	call:	sn - socket number to drop
- *
- *	return:	CS_SUCCESS - operation sucessful
- *		CS_BAD_SOCKET - unable to drop socket
- */
-/*ARGSUSED*/
-static uint32_t
-cs_drop_socket(uint32_t sn)
-{
-#ifdef	XXX
-	cs_socket_t *sp;
-
-	/*
-	 * Tell the socket event thread to exit and then wait for it
-	 *	to do so.
-	 */
-	mutex_enter(&sp->client_lock);
-	sp->thread_state |= SOCKET_THREAD_EXIT;
-	cv_broadcast(&sp->thread_cv);
-	cv_wait(&sp->caller_cv, &sp->client_lock);
-	mutex_exit(&sp->client_lock);
-
-	/*
-	 * Tell the socket SS thread to exit and then wait for it
-	 *	to do so.
-	 */
-
-	/*
-	 * Mark the socket as dropped.
-	 */
-	sp->flags &= ~SOCKET_IS_VALID;
-
-#endif	/* XXX */
-
-	/* XXX for now don't allow dropping sockets XXX */
-	return (CS_BAD_SOCKET);
-}
-
-/*
- * cs_get_socket - returns the socket and function numbers and a pointer
- *			to the socket structure
- *
- * calling:	client_handle_t client_handle - client handle to extract
- *						socket number from
- *		uint32_t *socket -  pointer to socket number to use if
- *					client_handle is for the SS client;
- *					this value will be filled in on
- *					return with the correct socket
- *					and function numbers if we
- *					return CS_SUCCESS
- *		uint32_t *function - pointer to return function number into
- *					if not NULL
- *		cs_socket_t **sp - pointer to a pointer where a pointer
- *					to the socket struct will be
- *					placed if this is non-NULL
- *		client_t **clp - pointer to a pointer where a pointer
- *					to the client struct will be
- *					placed if this is non-NULL
- *
- *    The socket and function numbers are derived as follows:
- *
- *	Client Type		Socket Number		Function Number
- *	PC card client		From client_handle	From client_handle
- *	Socket Services client	From *socket		From *socket
- *	CSI client		From client_handle	From *socket
- */
-static uint32_t
-cs_get_socket(client_handle_t client_handle, uint32_t *socket,
-    uint32_t *function, cs_socket_t **csp, client_t **clp)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	uint32_t sn, fn;
-	int ret;
-
-	sn = *socket;
-
-	/*
-	 * If this is the Socket Services client, then return the
-	 *	socket and function numbers specified in the passed
-	 *	socket number parameter, otherwise extract the socket
-	 *	and function numbers from the client handle.
-	 */
-	if (CLIENT_HANDLE_IS_SS(client_handle)) {
-	    fn = CS_GET_FUNCTION_NUMBER(sn);
-	    sn = CS_GET_SOCKET_NUMBER(sn);
-	} else {
-	    fn = GET_CLIENT_FUNCTION(client_handle);
-	    sn = GET_CLIENT_SOCKET(client_handle);
-	}
-
-	/*
-	 * Check to be sure that the socket number is in range
-	 */
-	if (!(CHECK_SOCKET_NUM(sn, cs_globals.max_socket_num)))
-	    return (CS_BAD_SOCKET);
-
-	if ((sp = cs_get_sp(sn)) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	/*
-	 * If we were given a pointer, then fill it in with a pointer
-	 *	to this socket.
-	 */
-	if (csp)
-	    *csp = sp;
-
-	/*
-	 * Search for the client; if it's not found, return an error.
-	 */
-	mutex_enter(&sp->lock);
-	if (!(client = cs_find_client(client_handle, &ret))) {
-	    mutex_exit(&sp->lock);
-	    return (ret);
-	}
-
-	/*
-	 * If we're a CIS client, then extract the function number
-	 *	from the socket number.
-	 */
-	if (client->flags & CLIENT_CSI_CLIENT)
-	    fn = CS_GET_FUNCTION_NUMBER(*socket);
-
-	mutex_exit(&sp->lock);
-
-	/*
-	 * Return the found client pointer if the caller wants it.
-	 */
-	if (clp)
-	    *clp = client;
-
-	/*
-	 * Return a socket number that is made up of the socket number
-	 *	and the function number.
-	 */
-	*socket = CS_MAKE_SOCKET_NUMBER(sn, fn);
-
-	/*
-	 * Return the function number if the caller wants it.
-	 */
-	if (function)
-	    *function = fn;
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_get_wp - returns pointer to passed window number
- *
- *	return: (cs_window_t *) - pointer to window structure
- *		NULL - if invalid window number passed in
- */
-static cs_window_t *
-cs_get_wp(uint32_t wn)
-{
-	cs_window_t *cw;
-
-	if (!(cs_globals.init_state & GLOBAL_INIT_STATE_SS_READY))
-	    return (NULL);
-
-	if ((cw = cs_find_wp(wn)) == NULL)
-	    return (NULL);
-
-	if (cw->state & CW_WINDOW_VALID)
-	    return (cw);
-
-#ifdef  CS_DEBUG
-	if (cs_debug > 0) {
-		cmn_err(CE_CONT, "cs_get_wp(): wn=%d  cw=%p\n",
-		    (int)wn, (void *)cw);
-	}
-#endif
-
-	return (NULL);
-}
-
-/*
- * cs_find_wp - searches window list and returns pointer to passed window
- *			number
- *
- *	return: (cs_window_t *) - pointer to window structure
- *		NULL - window not found
- */
-static cs_window_t *
-cs_find_wp(uint32_t wn)
-{
-	cs_window_t *cw = cs_globals.cw;
-
-	while (cw) {
-	    if (cw->window_num == wn)
-		return (cw);
-	    cw = cw->next;
-	} /* while */
-
-#ifdef  CS_DEBUG
-	if (cs_debug > 0) {
-		cmn_err(CE_CONT, "cs_find_wp(): wn=%d  window_num=%d cw=%p\n",
-		    (int)wn, (int)cw->window_num, (void *)cw);
-	}
-#endif
-
-	return (NULL);
-}
-
-/*
- * cs_add_windows - adds number of windows specified in "aw" to
- *			the global window list; start the window
- *			numbering at "bn"
- *
- *	return: CS_SUCCESS - if windows added sucessfully
- *		CS_BAD_WINDOW - if unable to add windows
- *
- * Note: The window list must be protected by a lock by the caller.
- */
-static int
-cs_add_windows(int aw, uint32_t bn)
-{
-	cs_window_t *cwp = cs_globals.cw;
-	cs_window_t *cw, *cwpp;
-
-	if (aw <= 0)
-	    return (CS_BAD_WINDOW);
-
-	while (cwp) {
-	    cwpp = cwp;
-	    cwp = cwp->next;
-	}
-
-	while (aw--) {
-	    cw = (cs_window_t *)kmem_zalloc(sizeof (cs_window_t), KM_SLEEP);
-
-	    if (cs_globals.cw == NULL) {
-		cs_globals.cw = cw;
-		cwpp = cs_globals.cw;
-	    } else {
-		cwpp->next = cw;
-		cwpp = cwpp->next;
-	    }
-
-	    cwpp->window_num = bn++;
-	    cwpp->state = CW_WINDOW_VALID;
-
-	} /* while (aw) */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_ss_init - initialize CS items that need to wait until we receive
- *			a PCE_SS_INIT_STATE/PCE_SS_STATE_INIT event
- *
- *	return: CS_SUCESS - if sucessfully initialized
- *		(various) if error initializing
- *
- *	At this point, we expect that Socket Services has setup the
- *	following global variables for us:
- *
- *		cs_socket_services - Socket Services entry point
- *		cis_parser - CIS parser entry point
- */
-static uint32_t
-cs_ss_init()
-{
-	cs_register_cardservices_t rcs;
-	csregister_t csr;
-	uint32_t ret;
-
-	/*
-	 * Fill out the parameters for CISP_CIS_SETUP
-	 */
-	csr.cs_magic = PCCS_MAGIC;
-	csr.cs_version = PCCS_VERSION;
-	csr.cs_card_services = CardServices;
-	csr.cs_event = NULL;
-
-	/*
-	 * Call into the CIS module and tell it what the private
-	 *	Card Services entry point is. The CIS module will
-	 *	call us back at CardServices(CISRegister, ...)
-	 *	with the address of various CIS-specific global
-	 *	data structures.
-	 */
-	CIS_PARSER(CISP_CIS_SETUP, &csr);
-
-	/*
-	 * Register with the Card Services kernel stubs module
-	 */
-	rcs.magic = CS_STUBS_MAGIC;
-	rcs.function = CS_ENTRY_REGISTER;
-	rcs.cardservices = CardServices;
-
-	if ((ret = csx_register_cardservices(&rcs)) != CS_SUCCESS) {
-	    cmn_err(CE_CONT, "cs_ss_init: can't register with "
-					"cs_stubs, retcode = 0x%x\n", ret);
-		return (ret);
-	} /* csx_register_cardservices */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_create_cis - reads CIS on card in socket and creates CIS lists
- *
- * Most of the work is done in the CIS module in the CISP_CIS_LIST_CREATE
- *	function.
- *
- * This function returns:
- *
- *	CS_SUCCESS - if the CIS lists were created sucessfully
- *	CS_BAD_WINDOW or CS_GENERAL_FAILURE - if CIS window could
- *			not be setup
- *	CS_BAD_CIS - if error creating CIS chains
- *	CS_BAD_OFFSET - if the CIS parser tried to read past the
- *			boundries of the allocated CIS window
- */
-static int
-cs_create_cis(cs_socket_t *sp)
-{
-	uint32_t ret;
-
-	ret = (uint32_t)(uintptr_t)CIS_PARSER(CISP_CIS_LIST_CREATE,
-	    cis_cistpl_std_callout, sp);
-
-#ifdef	CS_DEBUG
-	if (ret == CS_NO_CIS) {
-	    if (cs_debug > 0)
-		cmn_err(CE_CONT, "cs_create_cis: socket %d has no CIS\n",
-								sp->socket_num);
-	} else if (ret != CS_SUCCESS) {
-	    if (cs_debug > 0)
-		cmn_err(CE_CONT, "cs_create_cis: socket %d ERROR = 0x%x\n",
-							sp->socket_num, ret);
-	    return (ret);
-	}
-#else
-	if (ret != CS_NO_CIS)
-	    if (ret != CS_SUCCESS)
-		return (ret);
-#endif
-
-	/*
-	 * If this card didn't have any CIS at all, there's not much
-	 *	else for us to do.
-	 */
-	if (!(sp->cis_flags & CW_VALID_CIS))
-	    return (CS_SUCCESS);
-
-	/*
-	 * If this is a single-function card, we need to move the CIS list
-	 *	that is currently on CS_GLOBAL_CIS to the function zero
-	 *	CIS list.
-	 */
-	if (!(sp->cis_flags & CW_MULTI_FUNCTION_CIS)) {
-	    bcopy((caddr_t)&sp->cis[CS_GLOBAL_CIS],
-				(caddr_t)&sp->cis[0], sizeof (cis_info_t));
-	    bzero((caddr_t)&sp->cis[CS_GLOBAL_CIS], sizeof (cis_info_t));
-	} /* !CW_MULTI_FUNCTION_CIS */
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_destroy_cis - destroys CIS list for socket
- */
-static int
-cs_destroy_cis(cs_socket_t *sp)
-{
-	CIS_PARSER(CISP_CIS_LIST_DESTROY, sp);
-
-	return (CS_SUCCESS);
-}
-
-/*
- * cs_get_client_info - This function is GetClientInfo.
- *
- *    calling:	client_handle_t - client handle to get client info on
- *		client_info_t * - pointer to a client_info_t structure
- *					to return client information in
- *
- *    returns:	CS_SUCCESS - if client info retreived from client
- *		CS_BAD_SOCKET, CS_BAD_HANDLE - if invalid client
- *					handle passed in
- *		CS_NO_MORE_ITEMS - if client does not handle the
- *					CS_EVENT_CLIENT_INFO event
- *					or if invalid client info
- *					retreived from client
- */
-static int
-cs_get_client_info(client_handle_t client_handle, client_info_t *ci)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	client_info_t *cinfo;
-	int ret = CS_SUCCESS;
-
-	if (CLIENT_HANDLE_IS_SS(client_handle)) {
-	    ci->Attributes = (CS_CLIENT_INFO_SOCKET_SERVICES |
-						CS_CLIENT_INFO_VALID);
-	    return (CS_SUCCESS);
-	} /* CLIENT_HANDLE_IS_SS */
-
-	if ((sp = cs_get_sp(GET_CLIENT_SOCKET(client_handle))) == NULL)
-	    return (CS_BAD_SOCKET);
-
-	mutex_enter(&sp->client_lock);
-	mutex_enter(&sp->lock);
-
-	if ((client = cs_find_client(client_handle, &ret)) == NULL) {
-	    mutex_exit(&sp->lock);
-	    mutex_exit(&sp->client_lock);
-	    return (ret);
-	} /* cs_find_client */
-
-	/*
-	 * If this client is not handling CS_EVENT_CLIENT_INFO events,
-	 *	then don't bother to even wake up the event thread.
-	 */
-	if (!((client->event_mask | client->global_mask) &
-					CS_EVENT_CLIENT_INFO)) {
-	    mutex_exit(&sp->lock);
-	    mutex_exit(&sp->client_lock);
-	    return (CS_NO_MORE_ITEMS);
-	} /* !CS_EVENT_CLIENT_INFO */
-
-	cinfo = &client->event_callback_args.client_info;
-
-	bzero((caddr_t)cinfo, sizeof (client_info_t));
-	cinfo->Attributes = (ci->Attributes & CS_CLIENT_INFO_SUBSVC_MASK);
-
-	client->events |= CS_EVENT_CLIENT_INFO;
-
-	sp->thread_state |= SOCKET_WAIT_SYNC;
-	mutex_exit(&sp->lock);
-	cv_broadcast(&sp->thread_cv);
-	cv_wait(&sp->caller_cv, &sp->client_lock);
-
-	if (cinfo->Attributes & CS_CLIENT_INFO_VALID) {
-	    bcopy((caddr_t)cinfo, (caddr_t)ci, sizeof (client_info_t));
-	    ci->Attributes &= (CS_CLIENT_INFO_FLAGS_MASK |
-					CS_CLIENT_INFO_SUBSVC_MASK);
-	    ci->Attributes &= ~(CS_CLIENT_INFO_CLIENT_MASK |
-						INFO_CARD_FLAGS_MASK |
-						CS_CLIENT_INFO_CLIENT_ACTIVE);
-	    ci->Attributes |= (client->flags & (CS_CLIENT_INFO_CLIENT_MASK |
-						INFO_CARD_FLAGS_MASK));
-	    (void) strcpy(ci->DriverName, client->driver_name);
-	    if (cs_card_for_client(client))
-		ci->Attributes |= CS_CLIENT_INFO_CLIENT_ACTIVE;
-	} else {
-	    ret = CS_NO_MORE_ITEMS;
-	} /* CS_CLIENT_INFO_VALID */
-
-	mutex_exit(&sp->client_lock);
-
-	return (ret);
-}
-
-/*
- * cs_get_firstnext_client - This function is GetFirstClient and
- *				GetNextClient
- *
- *    calling:	get_firstnext_client_t * - pointer to a get_firstnext_client_t
- *					structure to return client handle and
- *					attributes in
- *		flags - one of the following:
- *				CS_GET_FIRST_FLAG - get first client handle
- *				CS_GET_NEXT_FLAG - get next client handle
- *
- *    returns:	CS_SUCCESS - if client info retreived from client
- *		CS_BAD_SOCKET, CS_BAD_HANDLE - if invalid client
- *					handle passed in
- *		CS_NO_MORE_ITEMS - if client does not handle the
- *					CS_EVENT_CLIENT_INFO event
- *					or if invalid client info
- *					retreived from client
- */
-static int
-cs_get_firstnext_client(get_firstnext_client_t *fnc, uint32_t flags)
-{
-	cs_socket_t *sp;
-	client_t *client;
-	uint32_t sn = 0;
-	int ret = CS_SUCCESS;
-
-	switch (flags) {
-	    case CS_GET_FIRST_FLAG:
-		if (fnc->Attributes & CS_GET_FIRSTNEXT_CLIENT_ALL_CLIENTS) {
-		    while (sn < cs_globals.max_socket_num) {
-			if ((sp = cs_get_sp(sn)) != NULL) {
-			    mutex_enter(&sp->client_lock);
-			    if ((client = sp->client_list) != NULL)
-				break;
-			    mutex_exit(&sp->client_lock);
-			} /* if */
-			sn++;
-		    } /* while */
-
-		    if (sn == cs_globals.max_socket_num)
-			return (CS_NO_MORE_ITEMS);
-		} else if (fnc->Attributes &
-					CS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY) {
-		    if ((sp = cs_get_sp(CS_GET_SOCKET_NUMBER(fnc->Socket))) ==
-									NULL)
-			return (CS_BAD_SOCKET);
-		    mutex_enter(&sp->client_lock);
-		    if ((client = sp->client_list) == NULL) {
-			mutex_exit(&sp->client_lock);
-			return (CS_NO_MORE_ITEMS);
-		    }
-		} else {
-		    return (CS_BAD_ATTRIBUTE);
-		}
-
-		fnc->client_handle = client->client_handle;
-		fnc->num_clients = sp->num_clients;
-		mutex_exit(&sp->client_lock);
-		break;
-	    case CS_GET_NEXT_FLAG:
-		if (fnc->Attributes & CS_GET_FIRSTNEXT_CLIENT_ALL_CLIENTS) {
-		    sn = GET_CLIENT_SOCKET(fnc->client_handle);
-
-		    if ((sp = cs_get_sp(sn)) == NULL)
-			return (CS_BAD_SOCKET);
-
-		    mutex_enter(&sp->client_lock);
-		    if ((client = cs_find_client(fnc->client_handle,
-				&ret)) == NULL) {
-			mutex_exit(&sp->client_lock);
-			return (ret);
-		    }
-		    if ((client = client->next) == NULL) {
-			mutex_exit(&sp->client_lock);
-			sn++;
-			while (sn < cs_globals.max_socket_num) {
-			    if ((sp = cs_get_sp(sn)) != NULL) {
-				mutex_enter(&sp->client_lock);
-				if ((client = sp->client_list) != NULL)
-				    break;
-				mutex_exit(&sp->client_lock);
-			    } /* if */
-			    sn++;
-			} /* while */
-
-			if (sn == cs_globals.max_socket_num)
-			    return (CS_NO_MORE_ITEMS);
-		    } /* client = client->next */
-
-		} else if (fnc->Attributes &
-					CS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY) {
-		    sp = cs_get_sp(GET_CLIENT_SOCKET(fnc->client_handle));
-		    if (sp == NULL)
-			return (CS_BAD_SOCKET);
-		    mutex_enter(&sp->client_lock);
-		    if ((client = cs_find_client(fnc->client_handle,
-				&ret)) == NULL) {
-			mutex_exit(&sp->client_lock);
-			return (ret);
-		    }
-		    if ((client = client->next) == NULL) {
-			mutex_exit(&sp->client_lock);
-			return (CS_NO_MORE_ITEMS);
-		    }
-		} else {
-		    return (CS_BAD_ATTRIBUTE);
-		}
-
-		fnc->client_handle = client->client_handle;
-		fnc->num_clients = sp->num_clients;
-		mutex_exit(&sp->client_lock);
-		break;
-	    default:
-		ret = CS_BAD_ATTRIBUTE;
-		break;
-
-	} /* switch */
-
-	return (ret);
-}
-
-/*
- * cs_set_acc_attributes - converts Card Services endianness and
- *				data ordering values to values
- *				that Socket Services understands
- *
- *	calling: *sw - pointer to a set_window_t to set attributes in
- *		 Attributes - CS attributes
- */
-static void
-cs_set_acc_attributes(set_window_t *sw, uint32_t Attributes)
-{
-	sw->attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-
-	switch (Attributes & WIN_ACC_ENDIAN_MASK) {
-	    case WIN_ACC_LITTLE_ENDIAN:
-		sw->attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
-		break;
-	    case WIN_ACC_BIG_ENDIAN:
-		sw->attr.devacc_attr_endian_flags = DDI_STRUCTURE_BE_ACC;
-		break;
-	    case WIN_ACC_NEVER_SWAP:
-	    default:
-		sw->attr.devacc_attr_endian_flags = DDI_NEVERSWAP_ACC;
-		break;
-	} /* switch */
-
-	switch (Attributes & WIN_ACC_ORDER_MASK) {
-	    case WIN_ACC_UNORDERED_OK:
-		sw->attr.devacc_attr_dataorder = DDI_UNORDERED_OK_ACC;
-		break;
-	    case WIN_ACC_MERGING_OK:
-		sw->attr.devacc_attr_dataorder = DDI_MERGING_OK_ACC;
-		break;
-	    case WIN_ACC_LOADCACHING_OK:
-		sw->attr.devacc_attr_dataorder = DDI_LOADCACHING_OK_ACC;
-		break;
-	    case WIN_ACC_STORECACHING_OK:
-		sw->attr.devacc_attr_dataorder = DDI_STORECACHING_OK_ACC;
-		break;
-	    case WIN_ACC_STRICT_ORDER:
-	    default:
-		sw->attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-		break;
-	} /* switch */
-}
--- old/usr/src/uts/common/pcmcia/cs/cs_stubs.c	2014-11-12 17:44:40.853948229 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,1226 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This is the PCMCIA Card Services kernel stubs module. It provides
- *	the various PCMCIA kernel framework entry points.
- */
-
-#if defined(DEBUG)
-#define	CS_STUBS_DEBUG
-#endif
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-#include <sys/debug.h>
-#include <sys/varargs.h>
-#include <sys/var.h>
-#include <sys/proc.h>
-#include <sys/thread.h>
-#include <sys/utsname.h>
-#include <sys/vtrace.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-
-#include <sys/pctypes.h>
-#include <pcmcia/sys/cs_types.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-#include <pcmcia/sys/cs_stubs.h>
-
-#ifdef	CS_STUBS_DEBUG
-int cs_stubs_debug = 0;
-#endif
-
-static csfunction_t *cardservices = NULL;
-static int do_cs_call = 0;
-static int cs_no_carservices(void);
-
-#define	CardServices	(do_cs_call ? (*cardservices) :		\
-			((csfunction_t *)cs_no_carservices))
-
-#ifdef	USE_CS_STUBS_MODULE
-
-/*
- * Module linkage information for the kernel.
- */
-static struct modlmisc modlmisc = {
-	&mod_miscops,
-	"PCMCIA Card Services stub module"
-};
-
-static struct modlinkage modlinkage = {
-	MODREV_1,
-	(void *)&modlmisc,
-	NULL
-};
-
-int
-_init(void)
-{
-	return (mod_install(&modlinkage));
-}
-
-int
-_fini(void)
-{
-	if (!do_cs_call)
-	    return (mod_remove(&modlinkage));
-	else
-	    return (EBUSY);
-}
-
-int
-_info(struct modinfo *modinfop)
-{
-	return (mod_info(&modlinkage, modinfop));
-}
-#endif	/* USE_CS_STUBS_MODULE */
-
-/*
- * csx_register_cardservices - The Card Services loadable module
- *	calls this runction to register it's entry point.
- *
- * Returns:	CS_SUCCESS - if operation sucessful
- *		CS_UNSUPPORTED_FUNCTION - if invalid function code
- *		CS_BAD_HANDLE - if Card Services is not registered
- */
-int32_t
-csx_register_cardservices(cs_register_cardservices_t *rcs)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 2)
-	    cmn_err(CE_CONT, "csx_register_cardservices: "
-		"magic: 0x%x function: 0x%x cardservices: 0x%p\n",
-		rcs->magic, rcs->function, (void *)rcs->cardservices);
-#endif
-
-	if (rcs->magic != CS_STUBS_MAGIC)
-	    return (CS_BAD_ARGS);
-
-	switch (rcs->function) {
-	    case CS_ENTRY_REGISTER:
-		cardservices = rcs->cardservices;
-		do_cs_call = 1;
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 2)
-	    cmn_err(CE_CONT, "csx_register_cardservices: CS_ENTRY_REGISTER\n");
-#endif
-
-		return (CS_SUCCESS);
-
-	    case CS_ENTRY_DEREGISTER:
-		do_cs_call = 0;
-		cardservices = (csfunction_t *)cs_no_carservices;
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 2)
-	    cmn_err(CE_CONT,
-		"csx_register_cardservices: CS_ENTRY_DEREGISTER\n");
-#endif
-		return (CS_UNSUPPORTED_FUNCTION);
-
-	    case CS_ENTRY_INQUIRE:
-		rcs->cardservices = cardservices;
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 2)
-	    cmn_err(CE_CONT, "csx_register_cardservices: CS_ENTRY_INQUIRE\n");
-#endif
-
-		if (do_cs_call)
-		    return (CS_SUCCESS);
-		else
-		    return (CS_BAD_HANDLE);
-
-	    default:
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 2)
-	    cmn_err(CE_CONT, "csx_register_cardservices: (unknown function)\n");
-#endif
-		return (CS_UNSUPPORTED_FUNCTION);
-	}
-
-}
-
-int32_t
-csx_RegisterClient(client_handle_t *ch, client_reg_t *cr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RegisterClient: (no handle yet)\n");
-#endif
-	return (CardServices(RegisterClient, ch, cr));
-}
-
-int32_t
-csx_DeregisterClient(client_handle_t ch)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_DeregisterClient: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(DeregisterClient, ch));
-}
-
-int32_t
-csx_GetStatus(client_handle_t ch, get_status_t *gs)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetStatus: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(GetStatus, ch, gs));
-}
-
-int32_t
-csx_SetEventMask(client_handle_t ch, sockevent_t *se)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_SetEventMask: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(SetEventMask, ch, se));
-}
-
-int32_t
-csx_GetEventMask(client_handle_t ch, sockevent_t *se)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetEventMask: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(GetEventMask, ch, se));
-}
-
-int32_t
-csx_RequestIO(client_handle_t ch, io_req_t *ior)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RequestIO: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RequestIO, ch, ior));
-}
-
-int32_t
-csx_ReleaseIO(client_handle_t ch, io_req_t *ior)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ReleaseIO: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ReleaseIO, ch, ior));
-}
-
-int32_t
-csx_RequestIRQ(client_handle_t ch, irq_req_t *irqr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RequestIRQ: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RequestIRQ, ch, irqr));
-}
-
-int32_t
-csx_ReleaseIRQ(client_handle_t ch, irq_req_t *irqr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ReleaseIRQ: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ReleaseIRQ, ch, irqr));
-}
-
-int32_t
-csx_RequestWindow(client_handle_t ch, window_handle_t *wh, win_req_t *wr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RequestWindow: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RequestWindow, ch, wh, wr));
-}
-
-int32_t
-csx_ReleaseWindow(window_handle_t wh)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ReleaseWindow: handle: 0x%x\n", wh);
-#endif
-	return (CardServices(ReleaseWindow, wh));
-}
-
-int32_t
-csx_ModifyWindow(window_handle_t wh, modify_win_t *mw)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ModifyWindow: handle: 0x%x\n", wh);
-#endif
-	return (CardServices(ModifyWindow, wh, mw));
-}
-
-int32_t
-csx_MapMemPage(window_handle_t wh, map_mem_page_t *mmp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_MapMemPage: handle: 0x%x\n", wh);
-#endif
-	return (CardServices(MapMemPage, wh, mmp));
-}
-
-int32_t
-csx_RequestSocketMask(client_handle_t ch, request_socket_mask_t *sm)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RequestSocketMask: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RequestSocketMask, ch, sm));
-}
-
-int32_t
-csx_ReleaseSocketMask(client_handle_t ch, release_socket_mask_t *rsm)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ReleaseSocketMask: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ReleaseSocketMask, ch, rsm));
-}
-
-int32_t
-csx_RequestConfiguration(client_handle_t ch, config_req_t *cr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RequestConfiguration: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RequestConfiguration, ch, cr));
-}
-
-int32_t
-csx_ModifyConfiguration(client_handle_t ch, modify_config_t *mc)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ModifyConfiguration: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ModifyConfiguration, ch, mc));
-}
-
-int32_t
-csx_ReleaseConfiguration(client_handle_t ch, release_config_t *rc)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ReleaseConfiguration: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ReleaseConfiguration, ch, rc));
-}
-
-int32_t
-csx_AccessConfigurationRegister(client_handle_t ch, access_config_reg_t *acr)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT,
-		"csx_AccessConfigurationRegister: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(AccessConfigurationRegister, ch, acr));
-}
-
-int32_t
-csx_GetFirstTuple(client_handle_t ch, tuple_t *tp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetFirstTuple: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(GetFirstTuple, ch, tp));
-}
-
-int32_t
-csx_GetNextTuple(client_handle_t ch, tuple_t *tp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetNextTuple: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(GetNextTuple, ch, tp));
-}
-
-int32_t
-csx_GetTupleData(client_handle_t ch, tuple_t *tp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetTupleData: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(GetTupleData, ch, tp));
-}
-
-int32_t
-csx_MapLogSocket(client_handle_t ch, map_log_socket_t *mls)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_MapLogSocket: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(MapLogSocket, ch, mls));
-}
-
-int32_t
-csx_ValidateCIS(client_handle_t ch, cisinfo_t *ci)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ValidateCIS: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ValidateCIS, ch, ci));
-}
-
-int32_t
-csx_MakeDeviceNode(client_handle_t ch, make_device_node_t *mdn)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_MakeDeviceNode: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(MakeDeviceNode, ch, mdn));
-}
-
-int32_t
-csx_RemoveDeviceNode(client_handle_t ch, remove_device_node_t *rdn)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_RemoveDeviceNode: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(RemoveDeviceNode, ch, rdn));
-}
-
-int32_t
-csx_ConvertSpeed(convert_speed_t *cp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ConvertSpeed\n");
-#endif
-	return (CardServices(ConvertSpeed, cp));
-}
-
-int32_t
-csx_ConvertSize(convert_size_t *cp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ConvertSize\n");
-#endif
-	return (CardServices(ConvertSize, cp));
-}
-
-int32_t
-csx_Event2Text(event2text_t *e2t)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Event2Text\n");
-#endif
-	return (CardServices(Event2Text, e2t));
-}
-
-int32_t
-csx_Error2Text(error2text_t *e2t)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Error2Text\n");
-#endif
-	return (CardServices(Error2Text, e2t));
-}
-
-int32_t
-csx_CS_DDI_Info(cs_ddi_info_t *cp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_CS_DDI_Info\n");
-#endif
-	return (CardServices(CS_DDI_Info, cp));
-}
-
-int32_t
-csx_CS_Sys_Ctl(cs_sys_ctl_t *csc)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_CS_Sys_Ctl\n");
-#endif
-	return (CardServices(CS_Sys_Ctl, csc));
-}
-
-int32_t
-csx_GetClientInfo(client_handle_t ch, client_info_t *ci)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetClientInfo: handle: 0x%x\n", ch);
-#endif
-
-	return (CardServices(GetClientInfo, ch, ci));
-}
-
-int32_t
-csx_GetFirstClient(get_firstnext_client_t *fnc)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetFirstClient\n");
-#endif
-
-	return (CardServices(GetFirstClient, fnc));
-}
-
-int32_t
-csx_GetNextClient(get_firstnext_client_t *fnc)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetNextClient\n");
-#endif
-
-	return (CardServices(GetNextClient, fnc));
-}
-
-int32_t
-csx_ResetFunction(client_handle_t ch, reset_function_t *rf)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ResetFunction: handle: 0x%x\n", ch);
-#endif
-
-	return (CardServices(ResetFunction, ch, rf));
-}
-
-int32_t
-csx_GetCardServicesInfo(client_handle_t ch, get_cardservices_info_t *gcsi)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetCardServicesInfo: handle: 0x%x\n", ch);
-#endif
-
-	return (CardServices(GetCardServicesInfo, ch, gcsi));
-}
-
-int32_t
-csx_GetConfigurationInfo(client_handle_t *ch, get_configuration_info_t *gci)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetConfigurationInfo: "
-		"handle: (no handle yet)\n");
-#endif
-
-	return (CardServices(GetConfigurationInfo, ch, gci));
-}
-
-int32_t
-csx_GetPhysicalAdapterInfo(client_handle_t ch, get_physical_adapter_info_t *gp)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetPhysicalAdapterInfo: handle: 0x%x\n", ch);
-#endif
-
-	return (CardServices(GetPhysicalAdapterInfo, ch, gp));
-}
-
-/*
- * CIS tuple parsing functions - one entrypoint per tuple that we know
- *	how to parse
- */
-int32_t
-csx_Parse_CISTPL_CONFIG(client_handle_t ch, tuple_t *tp, cistpl_config_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_CONFIG: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_CONFIG;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICE(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICE;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICE_A(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_A: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICE_A;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICE_OA(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OA: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICE_OA;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICE_OC(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OC: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICE_OC;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_VERS_1(client_handle_t ch, tuple_t *tp, cistpl_vers_1_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_1: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_VERS_1;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_VERS_2(client_handle_t ch, tuple_t *tp, cistpl_vers_2_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_2: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_VERS_2;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_JEDEC_A(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_A: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_JEDEC_A;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_JEDEC_C(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_C: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_JEDEC_C;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_FORMAT(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_FORMAT;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_FORMAT_A(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT_A: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_FORMAT_A;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_GEOMETRY(client_handle_t ch, tuple_t *tp,
-    cistpl_geometry_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_GEOMETRY: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_GEOMETRY;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_BYTEORDER(client_handle_t ch, tuple_t *tp,
-    cistpl_byteorder_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BYTEORDER: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_BYTEORDER;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DATE(client_handle_t ch, tuple_t *tp, cistpl_date_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DATE: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DATE;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_BATTERY(client_handle_t ch, tuple_t *tp, cistpl_battery_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BATTERY: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_BATTERY;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_ORG(client_handle_t ch, tuple_t *tp, cistpl_org_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_ORG: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_ORG;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_MANFID(client_handle_t ch, tuple_t *tp, cistpl_manfid_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_MANFID: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_MANFID;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_FUNCID(client_handle_t ch, tuple_t *tp, cistpl_funcid_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCID: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_FUNCID;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_FUNCE(client_handle_t ch, tuple_t *tp,
-    cistpl_funce_t *pt, uint32_t function)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCE: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_FUNCE;
-	return (CardServices(ParseTuple, ch, tp, pt, function));
-}
-
-int32_t
-csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t ch, tuple_t *tp,
-    cistpl_cftable_entry_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT,
-		"csx_Parse_CISTPL_CFTABLE_ENTRY: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_CFTABLE_ENTRY;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_LINKTARGET(client_handle_t ch, tuple_t *tp,
-    cistpl_linktarget_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LINKTARGET: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_LINKTARGET;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_LONGLINK_A(client_handle_t ch, tuple_t *tp,
-    cistpl_longlink_ac_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_A: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_LONGLINK_A;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_LONGLINK_C(client_handle_t ch, tuple_t *tp,
-    cistpl_longlink_ac_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_C: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_LONGLINK_C;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t ch, tuple_t *tp,
-    cistpl_longlink_mfc_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_MFC: "
-						"handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_LONGLINK_MFC;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t csx_Parse_CISTPL_LONGLINK_CB(client_handle_t ch, tuple_t *tp,
-    cistpl_longlink_cb_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_CB: "
-						"handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_LONGLINK_CB;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_SPCL(client_handle_t ch, tuple_t *tp,
-    cistpl_spcl_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_SPCL: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_SPCL;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_SWIL(client_handle_t ch, tuple_t *tp,
-    cistpl_swil_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_SWIL: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_SWIL;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t csx_Parse_CISTPL_BAR(client_handle_t ch, tuple_t *tp,
-    cistpl_bar_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BAR: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_BAR;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICEGEO(client_handle_t ch, tuple_t *tp,
-    cistpl_devicegeo_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO: handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICEGEO;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t ch, tuple_t *tp,
-    cistpl_devicegeo_t *pt)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO_A: "
-						"handle: 0x%x\n", ch);
-#endif
-	tp->DesiredTuple = CISTPL_DEVICEGEO_A;
-	return (CardServices(ParseTuple, ch, tp, pt));
-}
-
-int32_t
-csx_ParseTuple(client_handle_t ch, tuple_t *tp, cisparse_t *cp, uint32_t ef)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_ParseTuple: handle: 0x%x\n", ch);
-#endif
-	return (CardServices(ParseTuple, ch, tp, cp, ef));
-}
-
-/*
- * The following functions are used to access various datatypes.
- *	These functions are not specific to PCMCIA client drivers
- *	and they don't depend on Card Services being present to
- *	operate.
- */
-void
-csx_Put8(acc_handle_t handle, uint32_t offset, uint8_t value)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_put8(handle, (uint8_t *)(hp->ah_addr + offset), value);
-}
-
-void
-csx_Put16(acc_handle_t handle, uint32_t offset, uint16_t value)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_put16(handle, (uint16_t *)(hp->ah_addr + offset), value);
-}
-
-void
-csx_Put32(acc_handle_t handle, uint32_t offset, uint32_t value)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_put32(handle, (uint32_t *)(hp->ah_addr + offset), value);
-}
-
-void
-csx_Put64(acc_handle_t handle, uint32_t offset, uint64_t value)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_put64(handle, (uint64_t *)(hp->ah_addr + offset), value);
-}
-
-uint8_t
-csx_Get8(acc_handle_t handle, uint32_t offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	return (ddi_get8(handle, (uint8_t *)(hp->ah_addr + offset)));
-}
-
-uint16_t
-csx_Get16(acc_handle_t handle, uint32_t offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	return (ddi_get16(handle, (uint16_t *)(hp->ah_addr + offset)));
-}
-
-uint32_t
-csx_Get32(acc_handle_t handle, uint32_t offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	return (ddi_get32(handle, (uint32_t *)(hp->ah_addr + offset)));
-}
-
-uint64_t
-csx_Get64(acc_handle_t handle, uint32_t offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	return (ddi_get64(handle, (uint64_t *)(hp->ah_addr + offset)));
-}
-
-void
-csx_RepPut8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_put8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepPut16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_put16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepPut32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_put32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepPut64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_put64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepGet8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_get8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepGet16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_get16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepGet32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_get32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-void
-csx_RepGet64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset,
-						uint32_t rc, uint32_t flags)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-	ddi_rep_get64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset),
-		rc, (uint32_t)flags);
-}
-
-/*
- * The following two functions return the mapped (virtual) or physical
- *	base address associated with the passed handle if the address
- *	can be directly accessed by the caller. If the object represented
- *	by the handle needs to be accessed through a common access
- *	function, CS_BAD_BASE is returned.
- *
- * XXX - Need to figure out how to determine when to return CS_BAD_BASE
- *	and also we need more generic return codes not tied to CS.
- */
-int32_t
-csx_GetMappedAddr(acc_handle_t handle, void **addr)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetMappedAddr: handle: 0x%p\n", handle);
-#endif
-
-	*addr = hp->ah_addr;
-
-	return (CS_SUCCESS);	/* XXX should be generic return code */
-}
-
-int32_t
-csx_GetPhysAddr(acc_handle_t handle, void **addr)
-{
-#ifndef	lint
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-#endif	/* lint */
-
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetPhysAddr: handle: 0x%p\n", handle);
-#endif
-
-	*addr = NULL;
-
-	return (CS_BAD_BASE);
-}
-
-/*ARGSUSED*/
-int32_t
-csx_DupHandle(acc_handle_t handle, acc_handle_t *dup, uint32_t flags)
-{
-#ifndef	lint
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-#endif	/* lint */
-
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_DupHandle: handle: 0x%p\n", handle);
-#endif
-
-	return (CS_BAD_HANDLE);
-
-#ifdef	XXX
-	*dup = (acc_handle_t)kmem_alloc(sizeof (acc_hdl_t), KM_SLEEP);
-	((acc_hdl_t *)*dup)->ddi_handle =
-		(ddi_acc_handle_t *)kmem_alloc(sizeof (ddi_acc_impl_t),
-		    KM_SLEEP);
-
-	bcopy((caddr_t)hp, (caddr_t)((acc_hdl_t *)*dup)->ddi_handle,
-	    sizeof (ddi_acc_impl_t));
-
-	return (CS_SUCCESS);
-#endif
-}
-
-int32_t
-csx_FreeHandle(acc_handle_t *handle)
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_FreeHandle: handle: 0x%p\n", *handle);
-#endif
-	return (CS_BAD_HANDLE);
-
-#ifdef	XXX
-
-	kmem_free((void *)((acc_hdl_t *)*handle)->ddi_handle,
-		sizeof (ddi_acc_impl_t));
-	kmem_free((void *)(acc_hdl_t *)*handle, sizeof (acc_hdl_t));
-
-	return (CS_SUCCESS);
-#endif
-}
-
-/*
- * XXX - Probably want to remove these fucntions soon
- */
-int32_t
-csx_GetHandleOffset(acc_handle_t handle, uint32_t *offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_GetHandleOffset: handle: 0x%p\n", handle);
-#endif
-
-	*offset = hp->ah_offset;
-
-	return (CS_SUCCESS);
-}
-
-int32_t
-csx_SetHandleOffset(acc_handle_t handle, uint32_t offset)
-{
-	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
-
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "csx_SetHandleOffset: handle: 0x%p\n", handle);
-#endif
-
-	hp->ah_offset = offset;
-
-	return (CS_SUCCESS);
-}
-
-static int
-cs_no_carservices()
-{
-#ifdef	CS_STUBS_DEBUG
-	if (cs_stubs_debug > 3)
-	    cmn_err(CE_CONT, "cs_no_carservices\n");
-#endif
-	return (CS_UNSUPPORTED_FUNCTION);
-}
--- old/usr/src/uts/common/pcmcia/nexus/pcmcia.c	2014-11-12 17:44:40.909962573 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,5550 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * PCMCIA NEXUS
- *	The PCMCIA module is a generalized interface for
- *	implementing PCMCIA nexus drivers.  It preserves
- *	the logical socket name space while allowing multiple
- *	instances of the hardware to be properly represented
- *	in the device tree.
- *
- *	The nexus also exports events to an event manager
- *	driver if it has registered.
- */
-
-#include <sys/types.h>
-#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/buf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/conf.h>
-#include <sys/stat.h>
-#include <sys/autoconf.h>
-#include <sys/vtoc.h>
-#include <sys/dkio.h>
-#include <sys/ddi.h>
-#include <sys/debug.h>
-#include <sys/sunddi.h>
-#include <sys/sunndi.h>
-#include <sys/cred.h>
-#include <sys/kstat.h>
-#include <sys/kmem.h>
-#include <sys/modctl.h>
-#include <sys/kobj.h>
-#include <sys/callb.h>
-#include <sys/param.h>
-#include <sys/thread.h>
-#include <sys/proc.h>
-
-#include <sys/pctypes.h>
-#include <sys/pcmcia.h>
-#include <sys/sservice.h>
-#include <pcmcia/sys/cs_types.h>
-#include <pcmcia/sys/cis.h>
-#include <pcmcia/sys/cis_handlers.h>
-#include <pcmcia/sys/cs.h>
-#include <pcmcia/sys/cs_priv.h>
-
-#ifdef sparc
-#include <sys/ddi_subrdefs.h>
-
-#elif defined(__x86) || defined(__amd64)
-#include <sys/mach_intr.h>
-#endif
-
-#undef SocketServices
-
-/* some bus specific stuff */
-
-/* need PCI regspec size for worst case at present */
-#include <sys/pci.h>
-
-typedef struct pcmcia_logical_socket {
-	int			ls_socket; /* adapter's socket number */
-	uint32_t		ls_flags;
-	struct pcmcia_adapter	*ls_adapter;
-	pcmcia_if_t		*ls_if;
-	dev_info_t		*ls_sockdrv;
-	dev_info_t		*ls_dip[PCMCIA_MAX_FUNCTIONS];
-	dev_info_t		*ls_mfintr_dip;
-	int			ls_functions;
-	uint32_t		ls_cs_events;
-	uint32_t		ls_intr_pri;
-	uint32_t		ls_intr_vec;
-	int			ls_intrrefs;
-	struct intrspec		ls_intrspec; /* MFC intrspec */
-	inthandler_t		*ls_inthandlers; /* for multifunction cards */
-	ddi_iblock_cookie_t	ls_iblk;
-	ddi_idevice_cookie_t	ls_idev;
-	kmutex_t		ls_ilock;
-	int			ls_error; /* error for CS return */
-} pcmcia_logical_socket_t;
-
-/*
- * entry points used by the true nexus
- */
-int pcmcia_detach(dev_info_t *, ddi_detach_cmd_t);
-int pcmcia_ctlops(dev_info_t *, dev_info_t *, ddi_ctl_enum_t, void *, void *);
-int pcmcia_prop_op(dev_t, dev_info_t *, dev_info_t *, ddi_prop_op_t,
-			int, char *, caddr_t, int *);
-void pcmcia_set_assigned(dev_info_t *, int, ra_return_t *);
-int pcmcia_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
-    ddi_intr_handle_impl_t *hdlp, void *result);
-
-/*
- * prototypes used internally by the nexus and sometimes Card Services
- */
-int SocketServices(int function, ...);
-
-
-void *CISParser(int function, ...);
-extern void *(*cis_parser)(int, ...);
-
-struct regspec *pcmcia_cons_regspec(dev_info_t *, int, uchar_t *,
-					ra_return_t *);
-
-static int (*pcmcia_card_services)(int, ...) = NULL;
-
-/*
- * variables used in the logical/physical mappings
- * that the nexus common code maintains.
- */
-struct pcmcia_adapter *pcmcia_adapters[PCMCIA_MAX_ADAPTERS];
-int    pcmcia_num_adapters;
-pcmcia_logical_socket_t *pcmcia_sockets[PCMCIA_MAX_SOCKETS];
-int    pcmcia_num_sockets;
-pcmcia_logical_window_t *pcmcia_windows[PCMCIA_MAX_WINDOWS];
-int    pcmcia_num_windows;
-struct power_entry pcmcia_power_table[PCMCIA_MAX_POWER];
-int	pcmcia_num_power;
-
-struct pcmcia_mif *pcmcia_mif_handlers = NULL;
-pcm_dev_node_t *pcmcia_devnodes = NULL;
-
-kmutex_t pcmcia_global_lock;
-kcondvar_t pcmcia_condvar;
-kmutex_t pcmcia_enum_lock;
-
-/*
- * Mapping of the device "type" to names acceptable to
- * the DDI
- */
-static char *pcmcia_dev_type[] = {
-	"multifunction",
-	"byte",
-	"serial",
-	"parallel",
-	"block",
-	"display",
-	"network",
-	"block",
-	"byte"
-};
-
-char *pcmcia_default_pm_mode = "parental-suspend-resume";
-
-/*
- * generic names from the approved list:
- *	disk tape pci sbus scsi token-ring isa keyboard display mouse
- *	audio ethernet timer memory parallel serial rtc nvram scanner
- *	floppy(controller) fddi isdn atm ide pccard video-in video-out
- * in some cases there will need to be device class dependent names.
- * network -> ethernet, token-ring, etc.
- * this list is a first guess and is used when all else fails.
- */
-
-char *pcmcia_generic_names[] = {
-	"multifunction",
-	"memory",
-	"serial",
-	"parallel",
-	"disk",
-	"video",		/* no spec for video-out yet */
-	"network",
-	"aims",
-	"scsi",
-	"security"
-};
-
-#define	PCM_GENNAME_SIZE	(sizeof (pcmcia_generic_names) / \
-					sizeof (char *))
-#define	PCMCIA_MAP_IO	0x0
-#define	PCMCIA_MAP_MEM	0x1
-#define	PPB_SUBTRACTIVE	((PCI_CLASS_BRIDGE << 16) | (PCI_BRIDGE_PCI << 8) | \
-		(PCI_BRIDGE_PCI_IF_SUBDECODE))
-
-/*
- * The following should be 2^^n - 1
- */
-#define	PCMCIA_SOCKET_BITS	0x7f
-
-#ifdef PCMCIA_DEBUG
-int pcmcia_debug = 0x0;
-static void pcmcia_dump_minors(dev_info_t *);
-#endif
-
-static f_tt *pcmcia_cs_event = NULL;
-int pcmcia_timer_id;
-dev_info_t	*pcmcia_dip;
-/*
- * XXX - See comments in cs.c
- */
-static f_tt *pcmcia_cis_parser = NULL;
-
-extern struct pc_socket_services pc_socket_services;
-
-/* some function declarations */
-static int pcm_adapter_callback(dev_info_t *, int, int, int);
-extern void pcmcia_init_adapter(anp_t *, dev_info_t *);
-extern void pcmcia_find_cards(anp_t *);
-extern void pcmcia_merge_power(struct power_entry *);
-extern void pcmcia_do_resume(int, pcmcia_logical_socket_t *);
-extern void pcmcia_resume(int, pcmcia_logical_socket_t *);
-extern void pcmcia_do_suspend(int, pcmcia_logical_socket_t *);
-extern void pcm_event_manager(int, int, void *);
-static void pcmcia_create_dev_info(int);
-static int pcmcia_create_device(ss_make_device_node_t *);
-static void pcmcia_init_devinfo(dev_info_t *, struct pcm_device_info *);
-void pcmcia_fix_string(char *str);
-dev_info_t *pcmcia_number_socket(dev_info_t *, int);
-static int pcmcia_merge_conf(dev_info_t *);
-static uint32_t pcmcia_mfc_intr(caddr_t, caddr_t);
-void pcmcia_free_resources(dev_info_t *);
-static void pcmcia_ppd_free(struct pcmcia_parent_private *ppd);
-int pcmcia_get_intr(dev_info_t *, int);
-int pcmcia_return_intr(dev_info_t *, int);
-int pcmcia_ra_alloc(dev_info_t *, ndi_ra_request_t *, ra_return_t *, char *,
-		dev_info_t **);
-int pcmcia_ra_free(dev_info_t *, ra_return_t *, char *);
-
-extern int cs_init(void);
-extern int cs_deinit(void);
-extern void cisp_init(void);
-extern void cis_deinit(void);
-
-/*
- * non-DDI compliant functions are listed here
- * some will be declared while others that have
- * entries in .h files. All will be commented on.
- *
- * with declarations:
- *	ddi_add_child
- *	ddi_binding_name
- *	ddi_bus_prop_op
- *	ddi_ctlops
- *	ddi_find_devinfo
- *	ddi_get_name_addr
- *	ddi_get_parent_data
- *	ddi_hold_installed_driver
- *	ddi_name_to_major
- *	ddi_node_name
- *	ddi_pathname
- *	ddi_rele_driver
- *	ddi_set_name_addr
- *	ddi_set_parent_data
- *	ddi_unorphan_devs
- *	i_ddi_bind_node_to_driver
- *	i_ddi_bind_node_to_driver
- *	i_ddi_bus_map
- *	i_ddi_map_fault
- *	i_ddi_mem_alloc
- *	i_ddi_mem_alloc
- *	i_ddi_mem_free
- *	i_ddi_mem_free
- *	modload
- *	modunload
- */
-
-extern void ddi_unorphan_devs(major_t);
-
-/* Card&Socket Services entry points */
-static int GetCookiesAndDip(sservice_t *);
-static int SSGetAdapter(get_adapter_t *);
-static int SSGetPage(get_page_t *);
-static int SSGetSocket(get_socket_t *);
-static int SSGetStatus(get_ss_status_t *);
-static int SSGetWindow(get_window_t *);
-static int SSInquireAdapter(inquire_adapter_t *);
-static int SSInquireSocket(inquire_socket_t *);
-static int SSInquireWindow(inquire_window_t *);
-static int SSResetSocket(int, int);
-static int SSSetPage(set_page_t *);
-static int SSSetSocket(set_socket_t *);
-static int SSSetWindow(set_window_t *);
-static int SSSetIRQHandler(set_irq_handler_t *);
-static int SSClearIRQHandler(clear_irq_handler_t *);
-
-static struct modldrv modlmisc = {
-	&mod_miscops,		/* Type of module. This one is a driver */
-	"PCMCIA Nexus Support", /* Name of the module. */
-};
-
-static struct modlinkage modlinkage = {
-	MODREV_1, (void *)&modlmisc, NULL
-};
-
-int
-_init()
-{
-	int	ret;
-
-	cisp_init();
-
-	if (cs_init() != CS_SUCCESS) {
-		if (cs_deinit() != CS_SUCCESS)
-			cmn_err(CE_CONT, "pcmcia: _init cs_deinit error\n");
-		return (-1);
-	}
-
-	mutex_init(&pcmcia_global_lock, NULL, MUTEX_DEFAULT, NULL);
-	cv_init(&pcmcia_condvar, NULL, CV_DRIVER, NULL);
-	mutex_init(&pcmcia_enum_lock, NULL, MUTEX_DEFAULT, NULL);
-
-	if ((ret = mod_install(&modlinkage)) != 0) {
-		mutex_destroy(&pcmcia_global_lock);
-		cv_destroy(&pcmcia_condvar);
-		mutex_destroy(&pcmcia_enum_lock);
-	}
-	return (ret);
-}
-
-int
-_fini()
-{
-	int	ret;
-
-	if ((ret = mod_remove(&modlinkage)) == 0) {
-		mutex_destroy(&pcmcia_global_lock);
-		cv_destroy(&pcmcia_condvar);
-		mutex_destroy(&pcmcia_enum_lock);
-		cis_deinit();
-		if (cs_deinit() != CS_SUCCESS) {
-			cmn_err(CE_CONT, "pcmcia: _fini cs_deinit error\n");
-		}
-	}
-	return (ret);
-}
-
-int
-_info(struct modinfo *modinfop)
-{
-	return (mod_info(&modlinkage, modinfop));
-}
-
-extern pri_t minclsyspri;
-
-/*
- * pcmcia_attach()
- *	the attach routine must make sure that everything needed is present
- *	including real hardware.  The sequence of events is:
- *		attempt to load all adapter drivers
- *		attempt to load Card Services
- *		initialize logical sockets
- *		report the nexus exists
- */
-
-int
-pcmcia_attach(dev_info_t *dip, anp_t *adapter)
-{
-	int count, done, i;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_attach: dip=0x%p adapter=0x%p\n",
-		    (void *)dip, (void *)adapter);
-	}
-#endif
-
-	pcmcia_dip = dip;
-
-	mutex_enter(&pcmcia_enum_lock);
-	mutex_enter(&pcmcia_global_lock);
-	if (pcmcia_num_adapters == 0) {
-		pcmcia_cis_parser = (f_tt *)CISParser;
-		cis_parser = (void *(*)(int, ...)) CISParser;
-		pcmcia_cs_event = (f_tt *)cs_event;
-		cs_socket_services = SocketServices;
-		/* tell CS we are up with basic init level */
-		(void) cs_event(PCE_SS_INIT_STATE, PCE_SS_STATE_INIT, 0);
-	}
-
-	(void) ddi_prop_update_string(DDI_DEV_T_NONE, dip,
-	    PCM_DEVICETYPE, "pccard");
-
-	ddi_report_dev(dip);	/* directory/device naming */
-
-	/*
-	 * now setup any power management stuff necessary.
-	 * we do it here in order to ensure that all PC Card nexi
-	 * implement it.
-	 */
-
-	if (pm_create_components(dip, 1) != DDI_SUCCESS) {
-		cmn_err(CE_WARN, "%s: not power managed\n",
-		    ddi_get_name_addr(dip));
-	} else {
-		pm_set_normal_power(dip, 0, 1);
-	}
-
-	/*
-	 * setup the info necessary for Card Services/SocketServices
-	 * and notify CS when ready.
-	 */
-
-	pcmcia_free_resources(dip);
-	pcmcia_init_adapter(adapter, dip);
-	/* exit mutex so CS can run for any cards found */
-	mutex_exit(&pcmcia_global_lock);
-
-	/*
-	 * make sure the devices are identified before
-	 * returning.  We do this by checking each socket to see if
-	 * a card is present.  If there is one, and there isn't a dip,
-	 * we can't be done.  We scan the list of sockets doing the
-	 * check. if we aren't done, wait for a condition variable to
-	 * wakeup.
-	 * Because we can miss a wakeup and because things can
-	 * take time, we do eventually give up and have a timeout.
-	 */
-
-	for (count = 0, done = 0;
-	    done == 0 && count < max(pcmcia_num_sockets, 16);
-	    count++) {
-		done = 1;
-		/* block CS while checking so we don't miss anything */
-		mutex_enter(&pcmcia_global_lock);
-		for (i = 0; i < pcmcia_num_sockets; i++) {
-			get_ss_status_t status;
-			if (pcmcia_sockets[i] == NULL)
-				continue;
-			bzero(&status, sizeof (status));
-			status.socket = i;
-			if (SSGetStatus(&status) == SUCCESS) {
-				if (status.CardState & SBM_CD &&
-				    pcmcia_sockets[i]->ls_dip[0] == NULL) {
-					done = 0;
-				}
-			}
-		}
-		/* only wait if we aren't done with this set */
-		if (!done) {
-			mutex_exit(&pcmcia_global_lock);
-			delay(10); /* give up CPU for a time */
-			mutex_enter(&pcmcia_global_lock);
-		}
-		mutex_exit(&pcmcia_global_lock);
-	}
-
-	mutex_exit(&pcmcia_enum_lock);
-	return (DDI_SUCCESS);
-}
-
-/*
- * pcmcia_detach
- *	unload everything and then detach the nexus
- */
-/* ARGSUSED */
-int
-pcmcia_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
-{
-	switch (cmd) {
-	case DDI_DETACH:
-		pm_destroy_components(dip);
-		return (DDI_SUCCESS);
-
-	/*
-	 * resume from a checkpoint
-	 * We don't do anything special here since the adapter
-	 * driver will generate resume events that we intercept
-	 * and convert to insert events.
-	 */
-	case DDI_SUSPEND:
-	case DDI_PM_SUSPEND:
-		return (DDI_SUCCESS);
-
-	default:
-		return (DDI_FAILURE);
-	}
-}
-
-/*
- * card_services_error()
- *	used to make 2.4/2.5 drivers get an error when
- *	they try to initialize.
- */
-static int
-card_services_error()
-{
-	return (CS_BAD_VERSION);
-}
-static int (*cs_error_ptr)() = card_services_error;
-
-/*
- * pcmcia_ctlops
- *	handle the nexus control operations for the cases where
- *	a PC Card driver gets called and we need to modify the
- *	devinfo structure or otherwise do bus specific operations
- */
-int
-pcmcia_ctlops(dev_info_t *dip, dev_info_t *rdip,
-	ddi_ctl_enum_t ctlop, void *arg, void *result)
-{
-	int e;
-	char name[64];
-	struct pcmcia_parent_private *ppd;
-	power_req_t *pm;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_ctlops(%p, %p, %d, %p, %p)\n",
-		    (void *)dip, (void *)rdip, ctlop, (void *)arg,
-		    (void *)result);
-		if (rdip != NULL && ddi_get_name(rdip) != NULL)
-			cmn_err(CE_CONT, "\t[%s]\n", ddi_get_name(rdip));
-	}
-#endif
-
-	switch (ctlop) {
-	case DDI_CTLOPS_REPORTDEV:
-		if (rdip == (dev_info_t *)0)
-			return (DDI_FAILURE);
-
-		if (strcmp("pcs", ddi_node_name(rdip)) == 0)
-			cmn_err(CE_CONT, "?PCCard socket %d at %s@%s\n",
-			    ddi_get_instance(rdip),
-			    ddi_driver_name(dip), ddi_get_name_addr(dip));
-		else
-			cmn_err(CE_CONT, "?%s%d at %s@%s in socket %d\n",
-			    ddi_driver_name(rdip),
-			    ddi_get_instance(rdip),
-			    ddi_driver_name(dip),
-			    ddi_get_name_addr(dip),
-			    CS_GET_SOCKET_NUMBER(
-			    ddi_getprop(DDI_DEV_T_NONE, rdip,
-			    DDI_PROP_DONTPASS,
-			    PCM_DEV_SOCKET, -1)));
-
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_INITCHILD:
-		/*
-		 * we get control here before the child is called.
-		 * we can change things if necessary.  This is where
-		 * the CardServices hook gets planted.
-		 */
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug) {
-			cmn_err(CE_CONT, "pcmcia: init child: %s(%d) @%p\n",
-			    ddi_node_name(arg), ddi_get_instance(arg),
-			    (void *)arg);
-			if (DEVI(arg)->devi_binding_name != NULL)
-				cmn_err(CE_CONT, "\tbinding_name=%s\n",
-				    DEVI(arg)->devi_binding_name);
-			if (DEVI(arg)->devi_node_name != NULL)
-				cmn_err(CE_CONT, "\tnode_name=%s\n",
-				    DEVI(arg)->devi_node_name);
-		}
-#endif
-
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data((dev_info_t *)arg);
-		if (ppd == NULL)
-			return (DDI_FAILURE);
-
-		if (strcmp("pcs", ddi_node_name((dev_info_t *)arg)) == 0) {
-			if (ppd == NULL)
-				return (DDI_FAILURE);
-			(void) sprintf(name, "%x",
-			    (int)ppd->ppd_reg[0].phys_hi);
-			ddi_set_name_addr((dev_info_t *)arg, name);
-			return (DDI_SUCCESS);
-		}
-
-		/*
-		 * We don't want driver.conf files that stay in
-		 * pseudo device form.	It is acceptable to have
-		 * .conf files add properties only.
-		 */
-		if (ndi_dev_is_persistent_node((dev_info_t *)arg) == 0) {
-			(void) pcmcia_merge_conf((dev_info_t *)arg);
-			cmn_err(CE_WARN, "%s%d: %s.conf invalid",
-			    ddi_get_name((dev_info_t *)arg),
-			    ddi_get_instance((dev_info_t *)arg),
-			    ddi_get_name((dev_info_t *)arg));
-			return (DDI_FAILURE);
-		}
-
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug && ppd != NULL) {
-			cmn_err(CE_CONT, "\tnreg=%x, intr=%x, socket=%x,"
-			    " function=%x, active=%x, flags=%x\n",
-			    ppd->ppd_nreg, ppd->ppd_intr,
-			    ppd->ppd_socket, ppd->ppd_function,
-			    ppd->ppd_active, ppd->ppd_flags);
-		}
-#endif
-
-		/*
-		 * make sure names are relative to socket number
-		 */
-		if (ppd->ppd_function > 0) {
-			int sock;
-			int func;
-			sock = ppd->ppd_socket;
-			func = ppd->ppd_function;
-			(void) sprintf(name, "%x,%x", sock, func);
-		} else {
-			(void) sprintf(name, "%x", ppd->ppd_socket);
-		}
-		ddi_set_name_addr((dev_info_t *)arg, name);
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "pcmcia: system init done for %s [%s] "
-			    "nodeid: %x @%s\n",
-			    ddi_get_name(arg), ddi_get_name_addr(arg),
-			    DEVI(arg)->devi_nodeid, name);
-		if (pcmcia_debug > 1)
-			pcmcia_dump_minors((dev_info_t *)arg);
-#endif
-
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_UNINITCHILD:
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug) {
-			cmn_err(CE_CONT, "pcmcia: uninit child: %s(%d) @%p\n",
-			    ddi_node_name(arg), ddi_get_instance(arg),
-			    (void *)arg);
-			if (DEVI(arg)->devi_binding_name != NULL)
-				cmn_err(CE_CONT, "\tbinding_name=%s\n",
-				    DEVI(arg)->devi_binding_name);
-			if (DEVI(arg)->devi_node_name != NULL)
-				cmn_err(CE_CONT, "\tnode_name=%s\n",
-				    DEVI(arg)->devi_node_name);
-		}
-#endif
-
-		ddi_set_name_addr((dev_info_t *)arg, NULL);
-		ddi_remove_minor_node((dev_info_t *)arg, NULL);
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_SLAVEONLY:
-		/* PCMCIA devices can't ever be busmaster until CardBus */
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(rdip);
-		if (ppd != NULL && ppd->ppd_flags & PPD_CB_BUSMASTER)
-			return (DDI_FAILURE); /* at most */
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_SIDDEV:
-		/* in general this is true. */
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_NREGS:
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(rdip);
-		if (ppd != NULL)
-			*((uint32_t *)result) = (ppd->ppd_nreg);
-		else
-			*((uint32_t *)result) = 0;
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_REGSIZE:
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(rdip);
-		if (ppd != NULL && ppd->ppd_nreg > 0)
-			*((off_t *)result) =  sizeof (struct pcm_regs);
-		else
-			*((off_t *)result) = 0;
-		return (DDI_SUCCESS);
-
-	case DDI_CTLOPS_POWER:
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(rdip);
-
-		if (ppd == NULL)
-			return (DDI_FAILURE);
-		/*
-		 * if this is not present, don't bother (claim success)
-		 * since it is already in the right state.  Don't
-		 * do any resume either since the card insertion will
-		 * happen independently.
-		 */
-		if (!ppd->ppd_active)
-			return (DDI_SUCCESS);
-		for (e = 0; e < pcmcia_num_adapters; e++)
-			if (pcmcia_adapters[e] ==
-			    pcmcia_sockets[ppd->ppd_socket]->ls_adapter)
-				break;
-		if (e == pcmcia_num_adapters)
-			return (DDI_FAILURE);
-		pm = (power_req_t *)arg;
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug) {
-			cmn_err(CE_WARN, "power: %d: %p, %d, %d [%s]\n",
-			    pm->request_type,
-			    (void *)pm->req.set_power_req.who,
-			    pm->req.set_power_req.cmpt,
-			    pm->req.set_power_req.level,
-			    ddi_get_name_addr(rdip));
-		}
-#endif
-		e = ppd->ppd_socket;
-		switch (pm->request_type) {
-		case PMR_SUSPEND:
-			if (!(pcmcia_sockets[e]->ls_flags &
-			    PCS_SUSPENDED)) {
-				pcmcia_do_suspend(ppd->ppd_socket,
-				    pcmcia_sockets[e]);
-			}
-			ppd->ppd_flags |= PPD_SUSPENDED;
-			return (DDI_SUCCESS);
-		case PMR_RESUME:
-			/* for now, we just succeed since the rest is done */
-			return (DDI_SUCCESS);
-		case PMR_SET_POWER:
-			/*
-			 * not sure how to handle power control
-			 * for now, we let the child handle it itself
-			 */
-			(void) pcmcia_power(pm->req.set_power_req.who,
-			    pm->req.set_power_req.cmpt,
-			    pm->req.set_power_req.level);
-			break;
-		default:
-			break;
-		}
-		return (DDI_FAILURE);
-		/* These CTLOPS will need to be implemented for new form */
-		/* let CardServices know about this */
-	case DDI_CTLOPS_DETACH:
-		return (DDI_SUCCESS);
-	case DDI_CTLOPS_ATTACH:
-		return (DDI_SUCCESS);
-
-	default:
-		/* if we don't understand, pass up the tree */
-		/* most things default to general ops */
-		return (ddi_ctlops(dip, rdip, ctlop, arg, result));
-	}
-}
-
-struct pcmcia_props {
-	char *name;
-	int   len;
-	int   prop;
-} pcmcia_internal_props[] = {
-	{ PCM_DEV_ACTIVE, 0, PCMCIA_PROP_ACTIVE },
-	{ PCM_DEV_R2TYPE, 0, PCMCIA_PROP_R2TYPE },
-	{ PCM_DEV_CARDBUS, 0, PCMCIA_PROP_CARDBUS },
-	{ CS_PROP, sizeof (void *), PCMCIA_PROP_OLDCS },
-	{ "reg", 0, PCMCIA_PROP_REG },
-	{ "interrupts", sizeof (int), PCMCIA_PROP_INTR },
-	{ "pm-hardware-state", 0, PCMCIA_PROP_DEFAULT_PM },
-};
-
-/*
- * pcmcia_prop_decode(name)
- *	decode the name and determine if this is a property
- *	we construct on the fly, one we have on the prop list
- *	or one that requires calling the CIS code.
- */
-static int
-pcmcia_prop_decode(char *name)
-{
-	int i;
-	if (strncmp(name, "cistpl_", 7) == 0)
-		return (PCMCIA_PROP_CIS);
-
-	for (i = 0; i < (sizeof (pcmcia_internal_props) /
-	    sizeof (struct pcmcia_props)); i++) {
-		if (strcmp(name, pcmcia_internal_props[i].name) == 0)
-			return (i);
-	}
-
-	return (PCMCIA_PROP_UNKNOWN);
-}
-
-/*
- * pcmcia_prop_op()
- *	we don't have properties in PROM per se so look for them
- *	only in the devinfo node.  Future may allow us to find
- *	certain CIS tuples via this interface if a user asks for
- *	a property of the form "cistpl-<tuplename>" but not yet.
- *
- *	The addition of 1275 properties adds to the necessity.
- */
-int
-pcmcia_prop_op(dev_t dev, dev_info_t *dip, dev_info_t *ch_dip,
-    ddi_prop_op_t prop_op, int mod_flags,
-    char *name, caddr_t valuep, int *lengthp)
-{
-	int len, proplen, which, flags;
-	caddr_t buff, propptr;
-	struct pcmcia_parent_private *ppd;
-
-	len = *lengthp;
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(ch_dip);
-
-	switch (which = pcmcia_prop_decode(name)) {
-	default:
-		if (ppd == NULL)
-			return (DDI_PROP_NOT_FOUND);
-
-		/* note that proplen may get modified */
-		proplen = pcmcia_internal_props[which].len;
-		switch (pcmcia_internal_props[which].prop) {
-		case PCMCIA_PROP_DEFAULT_PM:
-			propptr = pcmcia_default_pm_mode;
-			proplen = strlen(propptr) + 1;
-			break;
-		case PCMCIA_PROP_OLDCS:
-			propptr = (caddr_t)&cs_error_ptr;
-			break;
-		case PCMCIA_PROP_REG:
-			propptr = (caddr_t)ppd->ppd_reg;
-			proplen = ppd->ppd_nreg * sizeof (struct pcm_regs);
-			break;
-		case PCMCIA_PROP_INTR:
-			propptr = (caddr_t)&ppd->ppd_intr;
-			break;
-
-		/* the next set are boolean values */
-		case PCMCIA_PROP_ACTIVE:
-			propptr = NULL;
-			if (!ppd->ppd_active) {
-				return (DDI_PROP_NOT_FOUND);
-			}
-			break;
-		case PCMCIA_PROP_R2TYPE:
-			propptr = NULL;
-			if (ppd->ppd_flags & PPD_CARD_CARDBUS)
-				return (DDI_PROP_NOT_FOUND);
-			break;
-		case PCMCIA_PROP_CARDBUS:
-			propptr = NULL;
-			if (!(ppd->ppd_flags * PPD_CARD_CARDBUS))
-				return (DDI_PROP_NOT_FOUND);
-			break;
-		}
-
-		break;
-
-	case PCMCIA_PROP_CIS:
-		/*
-		 * once we have the lookup code in place
-		 * it is sufficient to break out of the switch
-		 * once proplen and propptr are set.
-		 * The common prop_op code deals with the rest.
-		 */
-	case PCMCIA_PROP_UNKNOWN:
-		return (ddi_bus_prop_op(dev, dip, ch_dip, prop_op,
-		    mod_flags | DDI_PROP_NOTPROM,
-		    name, valuep, lengthp));
-	}
-
-	if (prop_op == PROP_LEN) {
-		/* just the length */
-		*lengthp = proplen;
-		return (DDI_PROP_SUCCESS);
-	}
-	switch (prop_op) {
-	case PROP_LEN_AND_VAL_ALLOC:
-		if (mod_flags & DDI_PROP_CANSLEEP)
-			flags = KM_SLEEP;
-		else
-			flags = KM_NOSLEEP;
-		buff = kmem_alloc((size_t)proplen, flags);
-		if (buff == NULL)
-			return (DDI_PROP_NO_MEMORY);
-		*(caddr_t *)valuep = (caddr_t)buff;
-		break;
-	case PROP_LEN_AND_VAL_BUF:
-		buff = (caddr_t)valuep;
-		if (len < proplen)
-			return (DDI_PROP_BUF_TOO_SMALL);
-		break;
-	default:
-		break;
-	}
-
-	if (proplen > 0)
-		bcopy(propptr, buff, proplen);
-	*lengthp = proplen;
-	return (DDI_PROP_SUCCESS);
-}
-
-
-struct regspec *
-pcmcia_rnum_to_regspec(dev_info_t *dip, int rnumber)
-{
-	struct pcmcia_parent_private *ppd;
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-	if (ppd->ppd_nreg < rnumber)
-		return (NULL);
-	return ((struct regspec *)&ppd->ppd_reg[rnumber]);
-}
-
-struct regspec *
-pcmcia_rnum_to_mapped(dev_info_t *dip, int rnumber)
-{
-	struct pcmcia_parent_private *ppd;
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-	if (ppd->ppd_nreg < rnumber)
-		return (NULL);
-	if (ppd->ppd_assigned == NULL)
-		return (NULL);
-	if (ppd->ppd_assigned[rnumber].phys_len == 0)
-		return (NULL);
-	else
-		return ((struct regspec *)&ppd->ppd_assigned[rnumber]);
-}
-
-int
-pcmcia_find_rnum(dev_info_t *dip, struct regspec *reg)
-{
-	struct pcmcia_parent_private *ppd;
-	struct regspec *regp;
-	int i;
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-	if (ppd == NULL)
-		return (-1);
-	for (regp = (struct regspec *)ppd->ppd_reg, i = 0;
-	    i < ppd->ppd_nreg; i++, regp++) {
-		if (bcmp(reg, regp, sizeof (struct regspec)) == 0)
-			return (i);
-	}
-	for (regp = (struct regspec *)ppd->ppd_assigned, i = 0;
-	    i < ppd->ppd_nreg; i++, regp++) {
-		if (bcmp(reg, regp, sizeof (struct regspec)) == 0)
-			return (i);
-	}
-
-	return (-1);
-}
-
-int
-pcmcia_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
-	off_t offset, off_t len, caddr_t *vaddrp)
-{
-	struct pcm_regs *regs, *mregs = NULL, tmp_reg;
-	ddi_map_req_t mr = *mp;
-	ra_return_t ret;
-	int check, rnum = -1;
-	uint32_t base;
-	uchar_t regbuf[sizeof (pci_regspec_t)];
-
-	mp = &mr;		/* a copy of original request */
-
-	/* check for register number */
-	switch (mp->map_type) {
-	case DDI_MT_REGSPEC:
-		regs = (struct pcm_regs *)mp->map_obj.rp;
-		mregs = (struct pcm_regs *)mp->map_obj.rp;
-		/*
-		 * when using regspec, must not be relocatable
-		 * and should be from assigned space.
-		 */
-		if (!PC_REG_RELOC(regs->phys_hi))
-			return (DDI_FAILURE);
-		rnum = pcmcia_find_rnum(rdip, (struct regspec *)mregs);
-		break;
-	case DDI_MT_RNUMBER:
-		regs = (struct pcm_regs *)
-		    pcmcia_rnum_to_regspec(rdip, mp->map_obj.rnumber);
-		mregs = (struct pcm_regs *)
-		    pcmcia_rnum_to_mapped(rdip, mp->map_obj.rnumber);
-		rnum = mp->map_obj.rnumber;
-		if (regs == NULL)
-			return (DDI_FAILURE);
-		mp->map_type = DDI_MT_REGSPEC;
-		mp->map_obj.rp = (struct regspec *)mregs;
-		break;
-	default:
-		return (DDI_ME_INVAL);
-	}
-
-	/* basic sanity checks */
-	switch (mp->map_op) {
-	default:
-		return (DDI_ME_UNIMPLEMENTED);
-	case DDI_MO_UNMAP:
-		if (mregs == NULL)
-			return (DDI_FAILURE);
-		regs = mregs;
-		break;
-	case DDI_MO_MAP_LOCKED:
-	case DDI_MO_MAP_HANDLE:
-		panic("unsupported bus operation");
-		/*NOTREACHED*/
-	}
-
-	/*
-	 * we need a private copy for manipulation and
-	 * calculation of the correct ranges
-	 */
-	tmp_reg = *regs;
-	mp->map_obj.rp = (struct regspec *)(regs = &tmp_reg);
-	base = regs->phys_lo;
-	if (base == 0 && offset != 0) {
-		/*
-		 * for now this is an error.  What does it really mean
-		 * to ask for an offset from an address that hasn't
-		 * been allocated yet.
-		 */
-		return (DDI_ME_INVAL);
-	}
-	regs->phys_lo += (uint32_t)offset;
-	if (len != 0) {
-		if (len > regs->phys_len) {
-			return (DDI_ME_INVAL);
-		}
-		regs->phys_len = len;
-	}
-
-	/*
-	 * basic sanity is checked so now make sure
-	 * we can actually allocate something for this
-	 * request and then convert to a "standard"
-	 * regspec for the next layer up (pci/isa/rootnex/etc.)
-	 */
-
-	switch (PC_GET_REG_TYPE(regs->phys_hi)) {
-	case PC_REG_SPACE_IO:
-		check = PCA_RES_NEED_IO;
-		break;
-	case PC_REG_SPACE_MEMORY:
-		check = PCA_RES_NEED_MEM;
-		break;
-	default:
-		/* not a valid register type */
-		return (DDI_FAILURE);
-	}
-
-	mr.map_type = DDI_MT_REGSPEC;
-	ret.ra_addr_hi = 0;
-	ret.ra_addr_lo = regs->phys_lo;
-	ret.ra_len = regs->phys_len;
-	mr.map_obj.rp = pcmcia_cons_regspec(dip,
-	    (check == PCA_RES_NEED_IO) ?
-	    PCMCIA_MAP_IO : PCMCIA_MAP_MEM,
-	    regbuf, &ret);
-	switch (mp->map_op) {
-	case DDI_MO_UNMAP:
-		pcmcia_set_assigned(rdip, rnum, NULL);
-		break;
-	default:
-		break;
-	}
-	return (ddi_map(dip, &mr, (off_t)0, (off_t)0, vaddrp));
-}
-
-/*
- * pcmcia_cons_regspec()
- * based on parent's bus type, construct a regspec that is usable
- * by that parent to map the resource into the system.
- */
-#define	PTYPE_PCI	1
-#define	PTYPE_ISA	0
-struct regspec *
-pcmcia_cons_regspec(dev_info_t *dip, int type, uchar_t *buff, ra_return_t *ret)
-{
-	int ptype = -1, len, bus;
-	char device_type[MODMAXNAMELEN + 1];
-	dev_info_t *pdip;
-	struct regspec *defreg;
-	pci_regspec_t *pcireg;
-
-	pdip = ddi_get_parent(dip);
-	if (pdip != ddi_root_node()) {
-		/* we're not a child of root so find out what */
-		len = sizeof (device_type);
-		if (ddi_prop_op(DDI_DEV_T_ANY, pdip, PROP_LEN_AND_VAL_BUF, 0,
-		    "device_type", (caddr_t)device_type, &len) ==
-		    DDI_PROP_SUCCESS) {
-			/* check things out */
-			if (strcmp(device_type, "pci") == 0)
-				ptype = PTYPE_PCI;
-			else if (strcmp(device_type, "isa") == 0)
-				ptype = PTYPE_ISA;
-		}
-	}
-	switch (ptype) {
-	case PTYPE_PCI:
-		/* XXX need to look at carefully */
-		if (ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-		    "reg", (caddr_t)&pcireg, &len) == DDI_SUCCESS) {
-			bus = PCI_REG_BUS_G(pcireg->pci_phys_hi);
-			kmem_free(pcireg, len);
-		} else {
-			bus = 0;
-		}
-		pcireg = (pci_regspec_t *)buff;
-		pcireg->pci_phys_hi = (type == PCMCIA_MAP_IO ? PCI_ADDR_IO :
-		    PCI_ADDR_MEM32) | PCI_RELOCAT_B | (bus << 16);
-		pcireg->pci_phys_mid = ret->ra_addr_hi;
-		pcireg->pci_phys_low = ret->ra_addr_lo;
-		if (type == PCMCIA_MAP_IO)
-			pcireg->pci_phys_low &= 0xFFFF;
-		pcireg->pci_size_hi = 0;
-		pcireg->pci_size_low = ret->ra_len;
-		break;
-	default:
-		/* default case is to use struct regspec */
-		defreg = (struct regspec *)buff;
-		defreg->regspec_bustype = type == PCMCIA_MAP_IO ? 1 : 0;
-		defreg->regspec_addr = ret->ra_addr_lo;
-		defreg->regspec_size = ret->ra_len;
-		break;
-	}
-	return ((struct regspec *)buff);
-}
-
-/*
- * pcmcia_init_adapter
- *	Initialize the per-adapter structures and check to see if
- *	there are possible other instances coming.
- */
-void
-pcmcia_init_adapter(anp_t *adapter, dev_info_t *dip)
-{
-	int i, n;
-	pcmcia_if_t *ls_if;
-
-	i = pcmcia_num_adapters++;
-	pcmcia_adapters[i] = kmem_zalloc(sizeof (struct pcmcia_adapter),
-	    KM_SLEEP);
-	pcmcia_adapters[i]->pca_dip = dip;
-	/* should this be pca_winshift??? */
-	pcmcia_adapters[i]->pca_module = ddi_driver_major(dip);
-	pcmcia_adapters[i]->pca_unit = ddi_get_instance(dip);
-	pcmcia_adapters[i]->pca_iblock = adapter->an_iblock;
-	pcmcia_adapters[i]->pca_idev = adapter->an_idev;
-	pcmcia_adapters[i]->pca_if = ls_if = adapter->an_if;
-	pcmcia_adapters[i]->pca_number = i;
-	(void) strcpy(pcmcia_adapters[i]->pca_name, ddi_get_name(dip));
-	pcmcia_adapters[i]->
-	    pca_name[sizeof (pcmcia_adapters[i]->pca_name) - 1] = NULL;
-
-	if (ls_if != NULL) {
-		inquire_adapter_t conf;
-		int sock, win;
-
-		if (ls_if->pcif_inquire_adapter != NULL)
-			GET_CONFIG(ls_if, dip, &conf);
-
-		/* resources - assume worst case and fix from there */
-		pcmcia_adapters[i]->pca_flags = PCA_RES_NEED_IRQ |
-		    PCA_RES_NEED_IO | PCA_RES_NEED_MEM;
-		/* indicate first socket not initialized */
-		pcmcia_adapters[i]->pca_first_socket = -1;
-
-		if (conf.ResourceFlags & RES_OWN_IRQ)
-			pcmcia_adapters[i]->pca_flags &= ~PCA_RES_NEED_IRQ;
-		if (conf.ResourceFlags & RES_OWN_IO)
-			pcmcia_adapters[i]->pca_flags &= ~PCA_RES_NEED_IO;
-		if (conf.ResourceFlags & RES_OWN_MEM)
-			pcmcia_adapters[i]->pca_flags &= ~PCA_RES_NEED_MEM;
-		if (conf.ResourceFlags & RES_IRQ_SHAREABLE)
-			pcmcia_adapters[i]->pca_flags |= PCA_IRQ_SHAREABLE;
-		if (conf.ResourceFlags & RES_IRQ_NEXUS)
-			pcmcia_adapters[i]->pca_flags |= PCA_IRQ_SMI_SHARE;
-
-		/* need to know interrupt limitations */
-		if (conf.ActiveLow) {
-			pcmcia_adapters[i]->pca_avail_intr = conf.ActiveLow;
-			pcmcia_adapters[i]->pca_flags |= PCA_IRQ_ISA;
-		} else
-			pcmcia_adapters[i]->pca_avail_intr = conf.ActiveHigh;
-
-		/* power entries for adapter */
-		pcmcia_adapters[i]->pca_power = conf.power_entry;
-		pcmcia_adapters[i]->pca_numpower = conf.NumPower;
-
-		for (n = 0; n < conf.NumPower; n++)
-			pcmcia_merge_power(&conf.power_entry[n]);
-
-		/* now setup the per socket info */
-		for (sock = 0; sock < conf.NumSockets;
-		    sock++) {
-			dev_info_t *sockdrv = NULL;
-			sockdrv = pcmcia_number_socket(dip, sock);
-			if (sockdrv == NULL)
-				n = sock + pcmcia_num_sockets;
-			else {
-				n = ddi_get_instance(sockdrv);
-			}
-			/* make sure we know first socket on adapter */
-			if (pcmcia_adapters[i]->pca_first_socket == -1)
-				pcmcia_adapters[i]->pca_first_socket = n;
-
-			/*
-			 * the number of sockets is weird.
-			 * we might have only two sockets but
-			 * due to persistence of instances we
-			 * will need to call them something other
-			 * than 0 and 1.  So, we use the largest
-			 * instance number as the number and
-			 * have some that just don't get used.
-			 */
-			if (n >= pcmcia_num_sockets)
-				pcmcia_num_sockets = n + 1;
-#if defined(PCMCIA_DEBUG)
-			if (pcmcia_debug) {
-				cmn_err(CE_CONT,
-				    "pcmcia_init: new socket added %d "
-				    "(%d)\n",
-				    n, pcmcia_num_sockets);
-			}
-#endif
-
-			pcmcia_sockets[n] =
-			    kmem_zalloc(sizeof (pcmcia_logical_socket_t),
-			    KM_SLEEP);
-			pcmcia_sockets[n]->ls_socket = sock;
-			pcmcia_sockets[n]->ls_if = ls_if;
-			pcmcia_sockets[n]->ls_adapter =
-			    pcmcia_adapters[i];
-			pcmcia_sockets[n]->ls_cs_events = 0L;
-			pcmcia_sockets[n]->ls_sockdrv = sockdrv;
-			/* Prototype of intrspec */
-			pcmcia_sockets[n]->ls_intr_pri = adapter->an_ipl;
-#if defined(PCMCIA_DEBUG)
-			if (pcmcia_debug)
-				cmn_err(CE_CONT,
-				    "phys sock %d, log sock %d\n",
-				    sock, n);
-#endif
-			mutex_init(&pcmcia_sockets[n]->ls_ilock, NULL,
-			    MUTEX_DRIVER, *adapter->an_iblock);
-		}
-
-		pcmcia_adapters[i]->pca_numsockets = conf.NumSockets;
-		/* now setup the per window information */
-		for (win = 0; win < conf.NumWindows; win++) {
-			n = win + pcmcia_num_windows;
-			pcmcia_windows[n] =
-			    kmem_zalloc(sizeof (pcmcia_logical_window_t),
-			    KM_SLEEP);
-			pcmcia_windows[n]->lw_window = win;
-			pcmcia_windows[n]->lw_if = ls_if;
-			pcmcia_windows[n]->lw_adapter =
-			    pcmcia_adapters[i];
-		}
-		pcmcia_num_windows += conf.NumWindows;
-		SET_CALLBACK(ls_if, dip,
-		    pcm_adapter_callback, i);
-
-		/* now tell CS about each socket */
-		for (sock = 0; sock < pcmcia_num_sockets; sock++) {
-#if defined(PCMCIA_DEBUG)
-			if (pcmcia_debug) {
-				cmn_err(CE_CONT,
-				    "pcmcia_init: notify CS socket %d "
-				    "sockp=%p\n",
-				    sock, (void *)pcmcia_sockets[sock]);
-			}
-#endif
-			if (pcmcia_sockets[sock] == NULL ||
-			    (pcmcia_sockets[sock]->ls_flags &
-			    PCS_SOCKET_ADDED)) {
-				/* skip the ones that are done already */
-				continue;
-			}
-			pcmcia_sockets[sock]->ls_flags |= PCS_SOCKET_ADDED;
-			if (cs_event(PCE_ADD_SOCKET, sock, 0) !=
-			    CS_SUCCESS) {
-				/* flag socket as broken */
-				pcmcia_sockets[sock]->ls_flags = 0;
-			} else {
-				pcm_event_manager(PCE_ADD_SOCKET,
-				    sock, NULL);
-			}
-		}
-
-	}
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "logical sockets:\n");
-		for (i = 0; i < pcmcia_num_sockets; i++) {
-			if (pcmcia_sockets[i] == NULL)
-				continue;
-			cmn_err(CE_CONT,
-			    "\t%d: phys sock=%d, if=%p, adapt=%p\n",
-			    i, pcmcia_sockets[i]->ls_socket,
-			    (void *)pcmcia_sockets[i]->ls_if,
-			    (void *)pcmcia_sockets[i]->ls_adapter);
-		}
-		cmn_err(CE_CONT, "logical windows:\n");
-		for (i = 0; i < pcmcia_num_windows; i++) {
-			cmn_err(CE_CONT,
-			    "\t%d: phys_window=%d, if=%p, adapt=%p\n",
-			    i, pcmcia_windows[i]->lw_window,
-			    (void *)pcmcia_windows[i]->lw_if,
-			    (void *)pcmcia_windows[i]->lw_adapter);
-		}
-		cmn_err(CE_CONT, "\tpcmcia_num_power=%d\n", pcmcia_num_power);
-		for (n = 0; n < pcmcia_num_power; n++)
-			cmn_err(CE_CONT,
-			    "\t\tPowerLevel: %d\tValidSignals: %x\n",
-			    pcmcia_power_table[n].PowerLevel,
-			    pcmcia_power_table[n].ValidSignals);
-	}
-#endif
-}
-
-/*
- * pcmcia_find_cards()
- *	check the adapter to see if there are cards present at
- *	driver attach time.  If there are, generate an artificial
- *	card insertion event to get CS running and the PC Card ultimately
- *	identified.
- */
-void
-pcmcia_find_cards(anp_t *adapt)
-{
-	int i;
-	get_ss_status_t status;
-	for (i = 0; i < pcmcia_num_sockets; i++) {
-		if (pcmcia_sockets[i] &&
-		    pcmcia_sockets[i]->ls_if == adapt->an_if) {
-			/* check the status */
-			status.socket = i;
-			if (SSGetStatus(&status) == SUCCESS &&
-			    status.IFType != IF_CARDBUS &&
-			    status.CardState & SBM_CD &&
-			    pcmcia_sockets[i]->ls_dip[0] == NULL) {
-				(void) cs_event(PCE_CARD_INSERT, i, 0);
-				delay(1);
-			}
-		}
-	}
-}
-
-/*
- * pcmcia_number_socket(dip, adapt)
- *	we determine socket number by creating a driver for each
- *	socket on the adapter and then forcing it to attach.  This
- *	results in an instance being assigned which becomes the
- *	logical socket number.	If it fails, then we are the first
- *	set of sockets and renumbering occurs later.  We do this
- *	one socket at a time and return the dev_info_t so the
- *	instance number can be used.
- */
-dev_info_t *
-pcmcia_number_socket(dev_info_t *dip, int localsocket)
-{
-	dev_info_t *child = NULL;
-	struct pcmcia_parent_private *ppd;
-
-	if (ndi_devi_alloc(dip, "pcs", (pnode_t)DEVI_SID_NODEID,
-	    &child) == NDI_SUCCESS) {
-		ppd = kmem_zalloc(sizeof (struct pcmcia_parent_private),
-		    KM_SLEEP);
-		ppd->ppd_reg = kmem_zalloc(sizeof (struct pcm_regs), KM_SLEEP);
-		ppd->ppd_nreg = 1;
-		ppd->ppd_reg[0].phys_hi = localsocket;
-		ddi_set_parent_data(child, (caddr_t)ppd);
-		if (ndi_devi_online(child, 0) != NDI_SUCCESS) {
-			kmem_free(ppd->ppd_reg, sizeof (struct pcm_regs));
-			kmem_free(ppd, sizeof (struct pcmcia_parent_private));
-			(void) ndi_devi_free(child);
-			child = NULL;
-		}
-	}
-	return (child);
-}
-
-/*
- * pcm_phys_to_log_socket()
- *	from an adapter and socket number return the logical socket
- */
-int
-pcm_phys_to_log_socket(struct pcmcia_adapter *adapt, int socket)
-{
-	register pcmcia_logical_socket_t *sockp;
-	int i;
-
-	for (i = 0, sockp = pcmcia_sockets[0];
-	    i < pcmcia_num_sockets; i++, sockp = pcmcia_sockets[i]) {
-		if (sockp == NULL)
-			continue;
-		if (sockp->ls_socket == socket && sockp->ls_adapter == adapt)
-			break;
-	}
-	if (i >= pcmcia_num_sockets) {
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT,
-			    "\tbad socket/adapter: %x/%p != %x/%x\n",
-			    socket, (void *)adapt, pcmcia_num_sockets,
-			    pcmcia_num_adapters);
-#endif
-		return (-1);
-	}
-
-	return (i);		/* want logical socket */
-}
-
-/*
- * pcm_adapter_callback()
- *	this function is called back by the adapter driver at interrupt time.
- *	It is here that events should get generated for the event manager if it
- *	is present.  It would also be the time where a device information
- *	tree could be constructed for a card that was added in if we
- *	choose to create them dynamically.
- */
-
-#if defined(PCMCIA_DEBUG)
-char *cblist[] = {
-	"removal",
-	"insert",
-	"ready",
-	"battery-warn",
-	"battery-dead",
-	"status-change",
-	"write-protect", "reset", "unlock", "client-info", "eject-complete",
-	"eject-request", "erase-complete", "exclusive-complete",
-	"exclusive-request", "insert-complete", "insert-request",
-	"reset-complete", "reset-request", "timer-expired",
-	"resume", "suspend"
-};
-#endif
-
-/*ARGSUSED*/
-static int
-pcm_adapter_callback(dev_info_t *dip, int adapter, int event, int socket)
-{
-	pcmcia_logical_socket_t *sockp;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcm_adapter_callback: %p %x %x %x: ",
-		    (void *)dip, adapter, event, socket);
-		cmn_err(CE_CONT, "[%s]\n", cblist[event]);
-	}
-#endif
-
-	if (adapter >= pcmcia_num_adapters || adapter < 0) {
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "\tbad adapter number: %d : %d\n",
-			    adapter, pcmcia_num_adapters);
-#endif
-		return (1);
-	}
-
-	/* get the logical socket since that is what CS knows */
-	socket = pcm_phys_to_log_socket(pcmcia_adapters[adapter], socket);
-	if (socket == -1) {
-		cmn_err(CE_WARN, "pcmcia callback - bad logical socket\n");
-		return (0);
-	}
-	sockp = pcmcia_sockets[socket];
-	switch (event) {
-	case -1:		/* special case of adapter going away */
-	case PCE_CARD_INSERT:
-		sockp->ls_cs_events |= PCE_E2M(PCE_CARD_INSERT) |
-		    PCE_E2M(PCE_CARD_REMOVAL);
-		break;
-	case PCE_CARD_REMOVAL:
-				/* disable interrupts at this point */
-		sockp->ls_cs_events |= PCE_E2M(PCE_CARD_INSERT) |
-		    PCE_E2M(PCE_CARD_REMOVAL);
-		/* remove children that never attached */
-
-		break;
-	case PCE_PM_RESUME:
-		pcmcia_do_resume(socket, sockp);
-		/* event = PCE_CARD_INSERT; */
-		break;
-	case PCE_PM_SUSPEND:
-		pcmcia_do_suspend(socket, sockp);
-		/* event = PCE_CARD_REMOVAL; */
-		break;
-	default:
-		/* nothing to do */
-		break;
-	}
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT,
-		    "\tevent %d, event mask=%x, match=%x (log socket=%d)\n",
-		    event,
-		    (int)sockp->ls_cs_events,
-		    (int)(sockp->ls_cs_events & PCE_E2M(event)), socket);
-	}
-#endif
-
-	if (pcmcia_cs_event && sockp->ls_cs_events & (1 << event)) {
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "\tcalling CS event handler (%p) "
-			    "with event=%d\n",
-			    (void *)pcmcia_cs_event, event);
-#endif
-		CS_EVENT(event, socket, 0);
-	}
-
-	/* let the event manager(s) know about the event */
-	pcm_event_manager(event, socket, NULL);
-
-	return (0);
-}
-
-/*
- * pcm_event_manager()
- *	checks for registered management driver callback handlers
- *	if there are any, call them if the event warrants it
- */
-void
-pcm_event_manager(int event, int socket, void *arg)
-{
-	struct pcmcia_mif *mif;
-
-	for (mif = pcmcia_mif_handlers; mif != NULL; mif = mif->mif_next) {
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT,
-			    "pcm_event_manager: event=%d, mif_events=%x"
-			    " (tst:%d)\n",
-			    event, (int)*(uint32_t *)mif->mif_events,
-			    PR_GET(mif->mif_events, event));
-#endif
-		if (PR_GET(mif->mif_events, event)) {
-			mif->mif_function(mif->mif_id, event, socket, arg);
-		}
-	}
-
-}
-
-/*
- * pcm_search_devinfo(dev_info_t *, pcm_device_info *, int)
- * search for an immediate child node to the nexus and not siblings of nexus
- * and not grandchildren.  We follow the same sequence that name binding
- * follows so we match same class of device (modem == modem) and don't
- * have to depend on features that might not exist.
- */
-dev_info_t *
-pcm_search_devinfo(dev_info_t *self, struct pcm_device_info *info, int socket)
-{
-	char bf[256];
-	struct pcmcia_parent_private *ppd;
-	dev_info_t *dip;
-	int circ;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT,
-		    "pcm_search_devinfo: socket=%x [%s|%s|%s] pd_flags=%x\n",
-		    socket, info->pd_bind_name, info->pd_generic_name,
-		    info->pd_vers1_name, info->pd_flags);
-#endif
-
-	ndi_devi_enter(self, &circ);
-	/* do searches in compatible property order */
-	for (dip = (dev_info_t *)DEVI(self)->devi_child;
-	    dip != NULL;
-	    dip = (dev_info_t *)DEVI(dip)->devi_sibling) {
-		int ppd_socket;
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(dip);
-		if (ppd == NULL) {
-#if defined(PCMCIA_DEBUG)
-			cmn_err(CE_WARN, "No parent private data\n");
-#endif
-			continue;
-		}
-		ppd_socket = CS_MAKE_SOCKET_NUMBER(ppd->ppd_socket,
-		    ppd->ppd_function);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug) {
-			cmn_err(CE_CONT, "\tbind=[%s], node=[%s]\n",
-			    DEVI(dip)->devi_binding_name,
-			    DEVI(dip)->devi_node_name);
-		}
-#endif
-		if (info->pd_flags & PCM_NAME_VERS1) {
-			(void) strcpy(bf, info->pd_vers1_name);
-			pcmcia_fix_string(bf);
-			if (DEVI(dip)->devi_binding_name &&
-			    strcmp(DEVI(dip)->devi_binding_name, bf) == 0 &&
-			    socket == ppd_socket)
-				break;
-		}
-		if ((info->pd_flags & (PCM_NAME_1275 | PCM_MULTI_FUNCTION)) ==
-		    (PCM_NAME_1275 | PCM_MULTI_FUNCTION)) {
-			(void) sprintf(bf, "%s,%x", info->pd_bind_name,
-			    info->pd_function);
-			if (strcmp(bf, DEVI(dip)->devi_binding_name) == 0 &&
-			    socket == ppd->ppd_socket)
-				break;
-		}
-		if (info->pd_flags & PCM_NAME_1275) {
-			if (DEVI(dip)->devi_binding_name &&
-			    strcmp(DEVI(dip)->devi_binding_name,
-			    info->pd_bind_name) == 0 &&
-			    socket == ppd_socket)
-				break;
-		}
-		if (info->pd_flags & PCM_NAME_GENERIC) {
-			(void) sprintf(bf, "%s,%s", PCMDEV_NAMEPREF,
-			    info->pd_generic_name);
-			if (DEVI(dip)->devi_binding_name &&
-			    strcmp(DEVI(dip)->devi_binding_name, bf) == 0 &&
-			    socket == ppd_socket)
-				break;
-		}
-		if (info->pd_flags & PCM_NAME_GENERIC) {
-			if (DEVI(dip)->devi_binding_name &&
-			    strcmp(DEVI(dip)->devi_binding_name,
-			    info->pd_generic_name) == 0 &&
-			    socket == ppd_socket)
-				break;
-		}
-		if (info->pd_flags & PCM_NO_CONFIG) {
-			if (DEVI(dip)->devi_binding_name &&
-			    strcmp(DEVI(dip)->devi_binding_name,
-			    "pccard,memory") == 0 &&
-			    socket == ppd_socket)
-				break;
-		}
-	}
-	ndi_devi_exit(self, circ);
-	return (dip);
-}
-
-/*
- * pcm_find_devinfo()
- *	this is a wrapper around DDI calls to "find" any
- *	devinfo node and then from there find the one associated
- *	with the socket
- */
-dev_info_t *
-pcm_find_devinfo(dev_info_t *pdip, struct pcm_device_info *info, int socket)
-{
-	dev_info_t *dip;
-
-	dip = pcm_search_devinfo(pdip, info, socket);
-	if (dip == NULL)
-		return (NULL);
-	/*
-	 * we have at least a base level dip
-	 * see if there is one (this or a sibling)
-	 * that has the correct socket number
-	 * if there is, return that one else
-	 * NULL so a new one is created
-	 */
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "find: initial dip = %p, socket=%d, name=%s "
-		    "(instance=%d, socket=%d, name=%s)\n",
-		    (void *)dip, socket, info->pd_bind_name,
-		    ddi_get_instance(dip),
-		    ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-		    PCM_DEV_SOCKET, -1),
-		    ddi_get_name(dip));
-#endif
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug && dip != NULL)
-		cmn_err(CE_CONT, "\treturning non-NULL dip (%s)\n",
-		    ddi_get_name(dip));
-#endif
-	return (dip);
-}
-
-/*
- * pcm_find_parent_dip(socket)
- *	find the correct parent dip for this logical socket
- */
-dev_info_t *
-pcm_find_parent_dip(int socket)
-{
-	if ((socket < 0 || socket >= pcmcia_num_sockets) ||
-	    pcmcia_sockets[socket] == NULL)
-		return (NULL);
-	return (pcmcia_sockets[socket]->ls_adapter->pca_dip);
-}
-
-/*
- * pcmcia_set_em_handler()
- *	This is called by the management and event driver to tell
- *	the nexus what to call.	 Multiple drivers are allowed
- *	but normally only one will exist.
- */
-int
-pcmcia_set_em_handler(int (*handler)(), caddr_t events, int elen,
-			uint32_t id, void **cs, void **ss)
-{
-	struct pcmcia_mif *mif, *tmp;
-
-	if (handler == NULL) {
-		/* NULL means remove the handler based on the ID */
-		if (pcmcia_mif_handlers == NULL)
-			return (0);
-		mutex_enter(&pcmcia_global_lock);
-		if (pcmcia_mif_handlers->mif_id == id) {
-			mif = pcmcia_mif_handlers;
-			pcmcia_mif_handlers = mif->mif_next;
-			kmem_free(mif, sizeof (struct pcmcia_mif));
-		} else {
-			for (mif = pcmcia_mif_handlers;
-			    mif->mif_next != NULL &&
-			    mif->mif_next->mif_id != id;
-			    mif = mif->mif_next)
-				;
-			if (mif->mif_next != NULL &&
-			    mif->mif_next->mif_id == id) {
-				tmp = mif->mif_next;
-				mif->mif_next = tmp->mif_next;
-				kmem_free(tmp, sizeof (struct pcmcia_mif));
-			}
-		}
-		mutex_exit(&pcmcia_global_lock);
-	} else {
-
-		if (pcmcia_num_adapters == 0) {
-			return (ENXIO);
-		}
-		if (elen > EM_EVENTSIZE)
-			return (EINVAL);
-
-		mif = (struct pcmcia_mif *)
-		    kmem_zalloc(sizeof (struct pcmcia_mif), KM_NOSLEEP);
-		if (mif == NULL)
-			return (ENOSPC);
-
-		mif->mif_function = (void (*)())handler;
-		bcopy(events, mif->mif_events, elen);
-		mif->mif_id = id;
-		mutex_enter(&pcmcia_global_lock);
-		mif->mif_next = pcmcia_mif_handlers;
-		pcmcia_mif_handlers = mif;
-		if (cs != NULL)
-			*cs = (void *)pcmcia_card_services;
-		if (ss != NULL) {
-			*ss = (void *)SocketServices;
-		}
-
-		mutex_exit(&pcmcia_global_lock);
-	}
-	return (0);
-}
-
-/*
- * pcm_fix_bits(uchar_t *data, int num, int dir)
- *	shift socket bits left(0) or right(0)
- *	This is used when mapping logical and physical
- */
-void
-pcm_fix_bits(socket_enum_t src, socket_enum_t dst, int num, int dir)
-{
-	int i;
-
-	PR_ZERO(dst);
-
-	if (dir == 0) {
-				/* LEFT */
-		for (i = 0; i <= (sizeof (dst) * PR_WORDSIZE) - num; i++) {
-			if (PR_GET(src, i))
-				PR_SET(dst, i + num);
-		}
-	} else {
-				/* RIGHT */
-		for (i = num; i < sizeof (dst) * PR_WORDSIZE; i++) {
-			if (PR_GET(src, i))
-				PR_SET(dst, i - num);
-		}
-	}
-}
-
-uint32_t
-genmask(int len)
-{
-	uint32_t mask;
-	for (mask = 0; len > 0; len--) {
-		mask |= 1 << (len - 1);
-	}
-	return (mask);
-}
-
-int
-genp2(int val)
-{
-	int i;
-	if (val == 0)
-		return (0);
-	for (i = 0; i < 32; i++)
-		if (val > (1 << i))
-			return (i);
-	return (0);
-}
-
-#if defined(PCMCIA_DEBUG)
-char *ssfuncs[128] = {
-	"GetAdapter", "GetPage", "GetSocket", "GetStatus", "GetWindow",
-	"InquireAdapter", "InquireSocket", "InquireWindow", "ResetSocket",
-	"SetPage", "SetAdapter", "SetSocket", "SetWindow", "SetIRQHandler",
-	"ClearIRQHandler",
-	/* 15 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 25 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 35 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 45 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 55 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 65 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 75 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 85 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-	/* 95 */ NULL, NULL, NULL,
-	"CSIsActiveDip",
-	"CSInitDev", "CSRegister", "CSCISInit", "CSUnregister",
-	"CISGetAddress", "CISSetAddress", "CSCardRemoved", "CSGetCookiesAndDip"
-};
-#endif
-
-/*
- * SocketServices
- *	general entrypoint for Card Services to find
- *	Socket Services.  Finding the entry requires
- *	a _depends_on[] relationship.
- *
- *	In some cases, the work is done locally but usually
- *	the parameters are adjusted and the adapter driver
- *	code asked to do the work.
- */
-int
-SocketServices(int function, ...)
-{
-	va_list arglist;
-	uint32_t args[16];
-	csregister_t *reg;
-	sservice_t *serv;
-	dev_info_t *dip;
-	int socket, func;
-	int error = SUCCESS;
-	pcmcia_logical_socket_t *sockp;
-
-	va_start(arglist, function);
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug > 1)
-		cmn_err(CE_CONT, "SocketServices called for function %d [%s]\n",
-		    function,
-		    ((function < 128) && ssfuncs[function] != NULL) ?
-		    ssfuncs[function] : "UNKNOWN");
-#endif
-	switch (function) {
-	case CSRegister:
-	case CISGetAddress:
-	case CISSetAddress:
-
-		reg = va_arg(arglist, csregister_t *);
-
-		if (reg->cs_magic != PCCS_MAGIC ||
-		    reg->cs_version != PCCS_VERSION) {
-			cmn_err(CE_WARN,
-			    "pcmcia: CSRegister (%x, %x, %p, %p) *ERROR*",
-			    reg->cs_magic, reg->cs_version,
-			    (void *)reg->cs_card_services,
-			    (void *)reg->cs_event);
-			error = BAD_FUNCTION;
-			break;
-		}
-
-		switch (function) {
-		case CISGetAddress:
-			reg->cs_event = pcmcia_cis_parser;
-			break;
-		case CISSetAddress:
-			pcmcia_cis_parser = reg->cs_event;
-			break;
-		case CSRegister:
-			break;
-		}
-		break;
-
-	case CSUnregister:
-		break;
-
-	case CSCISInit:
-		args[0] = va_arg(arglist, int);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT,
-			    "CSCISInit: CIS is initialized on socket %d\n",
-			    (int)args[0]);
-#endif
-		/*
-		 * now that the CIS has been parsed (there may not
-		 * be one but the work is done) we can create the
-		 * device information structures.
-		 *
-		 * we serialize the node creation to avoid problems
-		 * with initial probe/attach of nexi.
-		 */
-
-		mutex_enter(&pcmcia_global_lock);
-		pcmcia_create_dev_info(args[0]);
-		cv_broadcast(&pcmcia_condvar); /* wakeup the nexus attach */
-		mutex_exit(&pcmcia_global_lock);
-		break;
-
-	case CSInitDev:
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "CSInitDev: initialize device\n");
-#endif
-		/*
-		 * this is where we create the /devices entries
-		 * that let us out into the world
-		 */
-
-		(void) pcmcia_create_device(va_arg(arglist,
-		    ss_make_device_node_t *));
-		break;
-
-	case CSCardRemoved:
-		args[0] = va_arg(arglist, uint32_t);
-		socket = CS_GET_SOCKET_NUMBER(args[0]);
-		func = CS_GET_FUNCTION_NUMBER(args[0]);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT,
-			    "CSCardRemoved! (socket=%d)\n", (int)args[0]);
-#endif
-		if (socket >= pcmcia_num_sockets)
-			break;
-
-		sockp = pcmcia_sockets[socket];
-		if (sockp == NULL) {
-			cmn_err(CE_WARN,
-			    "pcmcia: bad socket = %x", socket);
-			break;
-		}
-
-		if (!(sockp->ls_flags & PCS_SUSPENDED)) {
-			for (func = 0; func < sockp->ls_functions; func++) {
-				/*
-				 * break the association of dip and socket
-				 * for all functions on that socket
-				 */
-				dip = sockp->ls_dip[func];
-				sockp->ls_dip[func] = NULL;
-				if (dip != NULL) {
-					struct pcmcia_parent_private *ppd;
-					ppd = (struct pcmcia_parent_private *)
-					    ddi_get_parent_data(dip);
-					ppd->ppd_active = 0;
-					(void) ndi_devi_offline(dip,
-					    NDI_DEVI_REMOVE);
-
-					pcmcia_ppd_free(ppd);
-				}
-#if defined(PCMCIA_DEBUG)
-				else {
-					if (pcmcia_debug)
-						cmn_err(CE_CONT,
-						    "CardRemoved: no "
-						    "dip present "
-						    "on socket %d!\n",
-						    (int)args[0]);
-				}
-#endif
-			}
-		} else {
-			mutex_enter(&pcmcia_global_lock);
-			sockp->ls_flags &= ~PCS_SUSPENDED;
-			cv_broadcast(&pcmcia_condvar);
-			mutex_exit(&pcmcia_global_lock);
-		}
-		break;
-
-	case CSGetCookiesAndDip:
-		serv = va_arg(arglist, sservice_t *);
-		if (serv != NULL)
-			error = GetCookiesAndDip(serv);
-		else
-			error = BAD_SOCKET;
-		break;
-
-	case CSGetActiveDip:
-		/*
-		 * get the dip associated with the card currently
-		 * in the specified socket
-		 */
-		args[0] = va_arg(arglist, uint32_t);
-		socket = CS_GET_SOCKET_NUMBER(args[0]);
-		func = CS_GET_FUNCTION_NUMBER(args[0]);
-		error = (long)pcmcia_sockets[socket]->ls_dip[func];
-		break;
-
-		/*
-		 * the remaining entries are SocketServices calls
-		 */
-	case SS_GetAdapter:
-		error = SSGetAdapter(va_arg(arglist, get_adapter_t *));
-		break;
-	case SS_GetPage:
-		error = SSGetPage(va_arg(arglist, get_page_t *));
-		break;
-	case SS_GetSocket:
-		error = SSGetSocket(va_arg(arglist, get_socket_t *));
-		break;
-	case SS_GetStatus:
-		error = SSGetStatus(va_arg(arglist, get_ss_status_t *));
-		break;
-	case SS_GetWindow:
-		error = SSGetWindow(va_arg(arglist, get_window_t *));
-		break;
-	case SS_InquireAdapter:
-		error = SSInquireAdapter(va_arg(arglist, inquire_adapter_t *));
-		break;
-	case SS_InquireSocket:
-		error = SSInquireSocket(va_arg(arglist, inquire_socket_t *));
-		break;
-	case SS_InquireWindow:
-		error = SSInquireWindow(va_arg(arglist, inquire_window_t *));
-		break;
-	case SS_ResetSocket:
-		args[0] = va_arg(arglist, uint32_t);
-		args[1] = va_arg(arglist, int);
-		error = SSResetSocket(args[0], args[1]);
-		break;
-	case SS_SetPage:
-		error = SSSetPage(va_arg(arglist, set_page_t *));
-		break;
-	case SS_SetSocket:
-		error = SSSetSocket(va_arg(arglist, set_socket_t *));
-		break;
-	case SS_SetWindow:
-		error = SSSetWindow(va_arg(arglist, set_window_t *));
-		break;
-	case SS_SetIRQHandler:
-		error = SSSetIRQHandler(va_arg(arglist, set_irq_handler_t *));
-		break;
-	case SS_ClearIRQHandler:
-		error = SSClearIRQHandler(va_arg(arglist,
-		    clear_irq_handler_t *));
-		break;
-	default:
-		error = BAD_FUNCTION;
-		break;
-	}
-	va_end(arglist);
-	return (error);
-}
-
-/*
- * pcmcia_merge_power()
- *	The adapters may have different power tables so it
- *	is necessary to construct a single power table that
- *	can be used throughout the system.  The result is
- *	a merger of all capabilities.  The nexus adds
- *	power table entries one at a time.
- */
-void
-pcmcia_merge_power(struct power_entry *power)
-{
-	int i;
-	struct power_entry pwr;
-
-	pwr = *power;
-
-	for (i = 0; i < pcmcia_num_power; i++) {
-		if (pwr.PowerLevel == pcmcia_power_table[i].PowerLevel) {
-			if (pwr.ValidSignals ==
-			    pcmcia_power_table[i].ValidSignals) {
-				return;
-			} else {
-				/* partial match */
-				pwr.ValidSignals &=
-				    ~pcmcia_power_table[i].ValidSignals;
-			}
-		}
-	}
-	/* what's left becomes a new entry */
-	if (pcmcia_num_power == PCMCIA_MAX_POWER)
-		return;
-	pcmcia_power_table[pcmcia_num_power++] = pwr;
-}
-
-/*
- * pcmcia_do_suspend()
- *	tell CS that a suspend has happened by passing a
- *	card removal event.  Then cleanup the socket state
- *	to fake the cards being removed so resume works
- */
-void
-pcmcia_do_suspend(int socket, pcmcia_logical_socket_t *sockp)
-{
-	get_ss_status_t stat;
-	struct pcmcia_adapter *adapt;
-	pcmcia_if_t *ls_if;
-	dev_info_t *dip;
-	int i;
-
-#ifdef	XXX
-	if (pcmcia_cs_event == NULL) {
-		return;
-	}
-#endif
-
-	ls_if = sockp->ls_if;
-	adapt = sockp->ls_adapter;
-
-	if (ls_if == NULL || ls_if->pcif_get_status == NULL) {
-		return;
-	}
-
-	stat.socket = socket;
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT,
-		    "pcmcia_do_suspend(%d, %p)\n", socket, (void *)sockp);
-	}
-#endif
-
-	if (GET_STATUS(ls_if, adapt->pca_dip, &stat) != SUCCESS)
-		return;
-
-	/*
-	 * If there is a card in the socket, then we need to send
-	 *	everyone a PCE_CARD_REMOVAL event, and remove the
-	 *	card active property.
-	 */
-
-	for (i = 0; i < sockp->ls_functions; i++) {
-		struct pcmcia_parent_private *ppd;
-		dip = sockp->ls_dip[i];
-		if (dip != NULL) {
-			ppd = (struct pcmcia_parent_private *)
-			    ddi_get_parent_data(dip);
-			ppd->ppd_flags |= PPD_SUSPENDED;
-		}
-#if 0
-		sockp->ls_dip[i] = NULL;
-#endif
-	}
-	sockp->ls_flags |= PCS_SUSPENDED;
-
-	if (pcmcia_cs_event &&
-	    (sockp->ls_cs_events & (1 << PCE_PM_SUSPEND))) {
-		CS_EVENT(PCE_PM_SUSPEND, socket, 0);
-	}
-	pcm_event_manager(PCE_PM_SUSPEND, socket, NULL);
-}
-
-/*
- * pcmcia_do_resume()
- *	tell CS that a suspend has happened by passing a
- *	card removal event.  Then cleanup the socket state
- *	to fake the cards being removed so resume works
- */
-void
-pcmcia_do_resume(int socket, pcmcia_logical_socket_t *sockp)
-{
-	get_ss_status_t stat;
-	struct pcmcia_adapter *adapt;
-	pcmcia_if_t *ls_if;
-
-#ifdef	XXX
-	if (pcmcia_cs_event == NULL) {
-		return;
-	}
-#endif
-
-	ls_if = sockp->ls_if;
-	adapt = sockp->ls_adapter;
-
-	if (ls_if == NULL || ls_if->pcif_get_status == NULL) {
-		return;
-	}
-
-	stat.socket = socket;
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT,
-		    "pcmcia_do_resume(%d, %p)\n", socket, (void *)sockp);
-	}
-#endif
-	if (GET_STATUS(ls_if, adapt->pca_dip, &stat) ==
-	    SUCCESS) {
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "\tsocket=%x, CardState=%x\n",
-			    socket, stat.CardState);
-#endif
-#if 0
-		/* now have socket info -- do we have events? */
-		if ((stat.CardState & SBM_CD) == SBM_CD) {
-			if (pcmcia_cs_event &&
-			    (sockp->ls_cs_events & (1 << PCE_CARD_INSERT))) {
-				CS_EVENT(PCE_CARD_INSERT, socket, 0);
-			}
-
-			/* we should have card removed from CS soon */
-			pcm_event_manager(PCE_CARD_INSERT, socket, NULL);
-		}
-#else
-		if (pcmcia_cs_event &&
-		    (sockp->ls_cs_events & (1 << PCE_PM_SUSPEND))) {
-			CS_EVENT(PCE_PM_RESUME, socket, 0);
-			CS_EVENT(PCE_CARD_REMOVAL, socket, 0);
-			if ((stat.CardState & SBM_CD) == SBM_CD)
-				CS_EVENT(PCE_CARD_INSERT, socket, 0);
-		}
-#endif
-	}
-}
-
-/*
- * pcmcia_map_power_set()
- *	Given a power table entry and level, find it in the
- *	master table and return the index in the adapter table.
- */
-static int
-pcmcia_map_power_set(struct pcmcia_adapter *adapt, int level, int which)
-{
-	int plevel, i;
-	struct power_entry *pwr = (struct power_entry *)adapt->pca_power;
-	plevel = pcmcia_power_table[level].PowerLevel;
-	/* mask = pcmcia_power_table[level].ValidSignals; */
-	for (i = 0; i < adapt->pca_numpower; i++)
-		if (plevel == pwr[i].PowerLevel &&
-		    pwr[i].ValidSignals & which)
-			return (i);
-	return (0);
-}
-
-/*
- * pcmcia_map_power_get()
- *	Given an adapter power entry, find the appropriate index
- *	in the master table.
- */
-static int
-pcmcia_map_power_get(struct pcmcia_adapter *adapt, int level, int which)
-{
-	int plevel, i;
-	struct power_entry *pwr = (struct power_entry *)adapt->pca_power;
-	plevel = pwr[level].PowerLevel;
-	/* mask = pwr[level].ValidSignals; */
-	for (i = 0; i < pcmcia_num_power; i++)
-		if (plevel == pcmcia_power_table[i].PowerLevel &&
-		    pcmcia_power_table[i].ValidSignals & which)
-			return (i);
-	return (0);
-}
-
-/*
- * XXX - SS really needs a way to allow the caller to express
- *	interest in PCE_CARD_STATUS_CHANGE events.
- */
-static uint32_t
-pcm_event_map[32] = {
-	PCE_E2M(PCE_CARD_WRITE_PROTECT)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_CARD_UNLOCK)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_EJECTION_REQUEST)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_INSERTION_REQUEST)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_CARD_BATTERY_WARN)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_CARD_BATTERY_DEAD)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_CARD_READY)|PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_CARD_REMOVAL)|PCE_E2M(PCE_CARD_INSERT)|
-					PCE_E2M(PCE_CARD_STATUS_CHANGE),
-	PCE_E2M(PCE_PM_SUSPEND)|PCE_E2M(PCE_PM_RESUME),
-};
-
-static int
-pcm_mapevents(uint32_t eventmask)
-{
-	uint32_t mask;
-	int i;
-
-	for (i = 0, mask = 0; eventmask && i < 32; i++) {
-		if (eventmask & (1 << i)) {
-			mask |= pcm_event_map[i];
-			eventmask &= ~(1 << i);
-		}
-	}
-	return (mask);
-}
-
-
-/*
- * PCMCIA Generic Naming Support
- *
- * With 2.6, PCMCIA naming moves to the 1275 and generic naming model.
- * Consequently, the whole naming mechanism is to be changed.  This is
- * not backward compatible with the current names but that isn't a problem
- * due to so few drivers existing.
- *
- * For cards with a device_id tuple, a generic name will be used.
- * if there is no device_id, then the 1275 name will be used if possible.
- * The 1275 name is of the form pccardNNNN,MMMM from the manfid tuple.
- * if there is not manfid tuple, an attempt will be made to bind the
- * node to the version_1 strings.
- *
- * In all cases, a "compatible" property is created with a number
- * of names.  The most generic name will be last in the list.
- */
-
-/*
- * pcmcia_fix_string()
- * want to avoid special characters in alias strings so convert
- * to something innocuous
- */
-
-void
-pcmcia_fix_string(char *str)
-{
-	for (; str && *str; str++) {
-		switch (*str) {
-			case ' ':
-			case '\t':
-				*str = '_';
-				break;
-		}
-	}
-}
-
-void
-pcmcia_1275_name(int socket, struct pcm_device_info *info,
-			client_handle_t handle)
-{
-	cistpl_manfid_t manfid;
-	cistpl_jedec_t jedec;
-	tuple_t tuple;
-	int i;
-
-	tuple.Socket = socket;
-
-	/* get MANFID if it exists -- this is most important form */
-	tuple.DesiredTuple = CISTPL_MANFID;
-	tuple.Attributes = 0;
-	if ((i = csx_GetFirstTuple(handle, &tuple)) ==
-	    SUCCESS) {
-		i = csx_Parse_CISTPL_MANFID(handle, &tuple,
-		    &manfid);
-		if (i == SUCCESS) {
-			(void) sprintf(info->pd_bind_name, "%s%x,%x",
-			    PCMDEV_NAMEPREF,
-			    manfid.manf, manfid.card);
-			info->pd_flags |= PCM_NAME_1275;
-		}
-	} else {
-		tuple.Attributes = 0;
-		tuple.DesiredTuple = CISTPL_JEDEC_A;
-		if ((i = csx_GetFirstTuple(handle, &tuple)) ==
-		    SUCCESS) {
-			i = csx_Parse_CISTPL_JEDEC_A(handle, &tuple,
-			    &jedec);
-			if (i == SUCCESS) {
-				(void) sprintf(info->pd_bind_name, "%s%x,%x",
-				    PCMDEV_NAMEPREF,
-				    jedec.jid[0].id, jedec.jid[0].info);
-				info->pd_flags |= PCM_NAME_1275;
-			}
-		}
-	}
-}
-
-void
-pcmcia_vers1_name(int socket, struct pcm_device_info *info,
-    client_handle_t handle)
-{
-	cistpl_vers_1_t vers1;
-	tuple_t tuple;
-	int which = 0;
-	int i, len, space;
-
-	tuple.Socket = socket;
-	info->pd_vers1_name[0] = '\0';
-
-	/* Version 1 strings */
-	tuple.DesiredTuple = CISTPL_VERS_1;
-	tuple.Attributes = 0;
-	if (!which &&
-	    (i = csx_GetFirstTuple(handle, &tuple)) == SUCCESS) {
-		i = csx_Parse_CISTPL_VERS_1(handle, &tuple, &vers1);
-		if (i == SUCCESS) {
-			/* BEGIN CSTYLED */
-			for (i = 0, len = 0, space = 0; i < vers1.ns; i++) {
-			    if ((space + len + strlen(info->pd_vers1_name)) >=
-				sizeof (info->pd_vers1_name))
-				    break;
-			    if (space) {
-				    info->pd_vers1_name[len++] = ',';
-			    }
-			    (void) strcpy(info->pd_vers1_name + len,
-				(char *)vers1.pi[i]);
-			    len += strlen((char *)vers1.pi[i]);
-			    /* strip trailing spaces off of string */
-			    while (info->pd_vers1_name[len - 1] == ' ' &&
-				    len > 0)
-				    len--;
-			    space = 1;
-			}
-			/* END CSTYLED */
-			info->pd_vers1_name[len] = '\0';
-			info->pd_flags |= PCM_NAME_VERS1;
-		}
-	}
-}
-
-
-int
-pcmcia_get_funce(client_handle_t handle, tuple_t *tuple)
-{
-	int ret = 0;
-
-	tuple->Attributes = 0;
-	while (csx_GetNextTuple(handle, tuple) == SUCCESS) {
-		if (tuple->TupleCode == CISTPL_FUNCID) {
-			break;
-		}
-		if (tuple->TupleCode == CISTPL_FUNCE) {
-			ret = 1;
-			break;
-		}
-		tuple->Attributes = 0;
-	}
-	return (ret);
-}
-
-char *pcmcia_lan_types[] = {
-	"arcnet",
-	"ethernet",
-	"token-ring",
-	"localtalk",
-	"fddi",
-	"atm",
-	"wireless",
-	"reserved"
-};
-
-void
-pcmcia_generic_name(int socket, struct pcm_device_info *info,
-			client_handle_t handle)
-{
-	cistpl_funcid_t funcid;
-	cistpl_funce_t funce;
-	tuple_t tuple;
-	int which = 0;
-	int i;
-
-	tuple.Socket = socket;
-
-	tuple.DesiredTuple = CISTPL_FUNCID;
-	tuple.Attributes = 0;
-	if ((i = csx_GetFirstTuple(handle, &tuple)) ==
-	    SUCCESS) {
-		/*
-		 * need to make sure that CISTPL_FUNCID is not
-		 * present in both a global and local CIS for MF
-		 * cards.  3COM seems to do this erroneously
-		 */
-
-		if (info->pd_flags & PCM_MULTI_FUNCTION &&
-		    tuple.Flags & CISTPLF_GLOBAL_CIS) {
-			tuple_t ltuple;
-			ltuple = tuple;
-			ltuple.DesiredTuple = CISTPL_FUNCID;
-			ltuple.Attributes = 0;
-			if ((i = csx_GetNextTuple(handle, &ltuple)) ==
-			    SUCCESS) {
-				/* this is the per-function funcid */
-				tuple = ltuple;
-			}
-		}
-
-		i = csx_Parse_CISTPL_FUNCID(handle, &tuple, &funcid);
-		if (i == SUCCESS) {
-			/* in case no function extension */
-			if (funcid.function < PCM_GENNAME_SIZE)
-				(void) strcpy(info->pd_generic_name,
-				    pcmcia_generic_names[funcid.function]);
-			else
-				(void) sprintf(info->pd_generic_name,
-				    "class,%x",
-				    funcid.function);
-		}
-		info->pd_type = funcid.function;
-		switch (funcid.function) {
-		case TPLFUNC_LAN:
-			which = pcmcia_get_funce(handle, &tuple);
-			if (which) {
-				i = csx_Parse_CISTPL_FUNCE(handle,
-				    &tuple,
-				    &funce, TPLFUNC_LAN);
-				if (i == SUCCESS) {
-					i = funce.data.lan.tech;
-					if (i >= sizeof (pcmcia_lan_types) /
-					    sizeof (char *)) {
-						break;
-					}
-					(void) strcpy(info->pd_generic_name,
-					    pcmcia_lan_types[i]);
-				}
-			}
-			break;
-		case TPLFUNC_VIDEO:
-#ifdef future_pcmcia_spec
-			which = pcmcia_get_funce(handle, &tuple);
-			if (which) {
-				i = csx_Parse_CISTPL_FUNCE(handle,
-				    &tuple,
-				    &funce, TPLFUNC_VIDEO);
-				if (i == SUCCESS) {
-					i = funce.video.tech;
-					if (i > sizeof (pcmcia_lan_types) /
-					    sizeof (char *)) {
-						break;
-					}
-					(void) strcpy(info->pd_generic_names,
-					    pcmcia_lan_types[i]);
-				}
-			}
-#endif
-			break;
-		}
-		info->pd_flags |= PCM_NAME_GENERIC;
-	} else {
-		/* if no FUNCID, do we have CONFIG */
-		tuple.DesiredTuple = CISTPL_CONFIG;
-		tuple.Attributes = 0;
-		if (csx_GetFirstTuple(handle, &tuple) != SUCCESS) {
-			info->pd_flags |= PCM_NO_CONFIG | PCM_NAME_GENERIC;
-			(void) strcpy(info->pd_generic_name,
-			    pcmcia_generic_names[PCM_TYPE_MEMORY]);
-			info->pd_type = PCM_TYPE_MEMORY;
-		}
-	}
-}
-
-
-/*
- * pcmcia_add_compatible()
- * add the cached compatible property list.
- */
-void
-pcmcia_add_compatible(dev_info_t *dip, struct pcm_device_info *info)
-{
-	int length = 0, i;
-	char buff[MAXNAMELEN];
-	char *compat_name[8];
-	int ci = 0;
-
-	bzero(compat_name, sizeof (compat_name));
-
-	if (info->pd_flags & PCM_NAME_VERS1) {
-		(void) sprintf(buff, "%s,%s", PCMDEV_NAMEPREF,
-		    info->pd_vers1_name);
-		pcmcia_fix_string(buff); /* don't want spaces */
-		length = strlen(buff) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], buff);
-	}
-
-	if ((info->pd_flags & (PCM_NAME_1275 | PCM_MULTI_FUNCTION)) ==
-	    (PCM_NAME_1275 | PCM_MULTI_FUNCTION)) {
-		(void) sprintf(buff, "%s,%x", info->pd_bind_name,
-		    info->pd_function);
-		length = strlen(buff) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], buff);
-	}
-
-	if (info->pd_flags & PCM_NAME_1275) {
-		length = strlen(info->pd_bind_name) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], info->pd_bind_name);
-	}
-
-	if (info->pd_flags & PCM_NAME_GENERIC) {
-		if (strncmp(info->pd_generic_name, "class,", 6) == 0) {
-			/* no generic without "pccard" */
-			(void) sprintf(buff, "%s%s", PCMDEV_NAMEPREF,
-			    info->pd_generic_name);
-		} else {
-			/* first pccard,generic-name */
-			(void) sprintf(buff, "%s,%s", PCMDEV_NAMEPREF,
-			    info->pd_generic_name);
-		}
-		length = strlen(buff) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], buff);
-
-		/* now the simple generic name */
-		length = strlen(info->pd_generic_name) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], info->pd_generic_name);
-	}
-
-	if (info->pd_flags & PCM_NO_CONFIG) {
-		char *mem = "pccard,memory";
-		/*
-		 * I/O cards are required to have a config tuple.
-		 * there are some that violate the spec and don't
-		 * but it is most likely that this is a memory card
-		 * so tag it as such.  "memory" is more general
-		 * than other things so needs to come last.
-		 */
-		length = strlen(mem) + 1;
-		compat_name[ci] = kmem_alloc(length, KM_SLEEP);
-		(void) strcpy(compat_name[ci++], mem);
-	}
-
-	if (ci == 0)
-		return;
-
-	if (ndi_prop_update_string_array(DDI_DEV_T_NONE, dip,
-	    "compatible", (char **)compat_name, ci) != DDI_PROP_SUCCESS)
-		cmn_err(CE_WARN, "pcmcia: unable to create compatible prop");
-
-	for (i = 0; i < ci; i++)
-		kmem_free(compat_name[i], strlen(compat_name[i]) + 1);
-}
-/*
- * CIS parsing and other PC Card specific code
- */
-
-/*
- * pcmcia_get_mem_regs()
- */
-static int
-pcmcia_get_mem_regs(struct pcm_regs *regs, struct pcm_device_info *info,
-			int type, int pctype)
-{
-	int num_regs = 0;
-	tuple_t tuple;
-	cistpl_device_t device;
-	uint32_t curr_base;
-	int ret, len;
-	int space;
-
-	/*
-	 * current plan for reg spec:
-	 * device_a will be accumulated to determine max size of
-	 * attribute memory.  device for common.  Then config
-	 * tuples to get a worst case I/O size.
-	 */
-	bzero(&tuple, sizeof (tuple));
-	tuple.Socket = info->pd_socket;
-
-	tuple.DesiredTuple = (cisdata_t)type;
-
-	space = (type == CISTPL_DEVICE_A) ? PC_REG_SPACE_ATTRIBUTE :
-	    PC_REG_SPACE_MEMORY;
-	if ((ret = csx_GetFirstTuple(info->pd_handle, &tuple)) == CS_SUCCESS) {
-		bzero(&device, sizeof (device));
-
-		if (type == CISTPL_DEVICE)
-			ret = csx_Parse_CISTPL_DEVICE(info->pd_handle, &tuple,
-			    &device);
-		else
-			ret = csx_Parse_CISTPL_DEVICE_A(info->pd_handle, &tuple,
-			    &device);
-
-		if (ret == CS_SUCCESS) {
-			curr_base = 0;
-			for (ret = 0; ret < device.num_devices; ret++) {
-				/* need to order these for real mem first */
-				if (device.devnode[ret].type !=
-				    CISTPL_DEVICE_DTYPE_NULL) {
-					/* how to represent types??? */
-					regs[num_regs].phys_hi =
-					    PC_REG_PHYS_HI(0, 0,
-					    pctype,
-					    space,
-					    info->pd_socket,
-					    info->pd_function,
-					    0);
-					regs[num_regs].phys_lo = curr_base;
-					len = device.devnode[ret].size_in_bytes;
-					curr_base += len;
-					regs[num_regs].phys_len = len;
-					num_regs++;
-				} else {
-					/*
-					 * NULL device is a "hole"
-					 */
-					curr_base +=
-					    device.devnode[ret].size_in_bytes;
-				}
-			}
-		}
-	}
-	return (num_regs);
-}
-
-/*
- *
- */
-static int
-pcmcia_get_io_regs(struct pcm_regs *regs, struct pcm_device_info *info,
-		    int pctype)
-{
-	int num_regs = 0;
-	tuple_t tuple;
-	uint32_t curr_base;
-	int len, curr, i, curr_len;
-	cistpl_config_t config;
-	cistpl_cftable_entry_t cftable;
-	struct pcm_regs tmp[16];
-	int found = 0;
-
-	bzero(&tuple, sizeof (tuple));
-	tuple.DesiredTuple = CISTPL_CONFIG;
-	tuple.Socket = info->pd_socket;
-	tuple.Attributes = 0;
-	curr_base = 0;
-	len = 0;
-
-	if (csx_GetFirstTuple(info->pd_handle, &tuple) == CS_SUCCESS) {
-		if (csx_Parse_CISTPL_CONFIG(info->pd_handle,
-		    &tuple, &config) != CS_SUCCESS) {
-			info->pd_flags |= PCM_NO_CONFIG; /* must be memory */
-			return (0);
-		}
-		curr = 0;
-
-		tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-		tuple.Socket = info->pd_socket;
-		tuple.Attributes = 0;
-		bzero(tmp, sizeof (tmp));
-
-	while (csx_GetNextTuple(info->pd_handle, &tuple) == CS_SUCCESS) {
-		bzero(&cftable, sizeof (cftable));
-
-		if (csx_Parse_CISTPL_CFTABLE_ENTRY(info->pd_handle,
-		    &tuple, &cftable) == CS_SUCCESS) {
-
-		/* BEGIN CSTYLED */
-		if (cftable.flags & CISTPL_CFTABLE_TPCE_FS_IO) {
-		    /* we have an I/O entry */
-		    if (cftable.io.flags &
-			CISTPL_CFTABLE_TPCE_FS_IO_RANGE) {
-			len = cftable.io.addr_lines;
-			if (len != 0)
-				len = 1 << len;
-			for (i = 0; i < cftable.io.ranges && curr < 16; i++) {
-			    curr_base = cftable.io.range[i].addr;
-			    curr_len = cftable.io.range[i].length;
-			    if (curr_len == 0)
-				    curr_len = len;
-			    if (len != 0 || cftable.io.addr_lines == 0) {
-				/* we have potential relocation */
-				int mask;
-				mask = cftable.io.addr_lines ?
-				    cftable.io.addr_lines : genp2(len);
-				mask = genmask(mask);
-				if ((mask & curr_base) == 0) {
-					/* more accurate length */
-					regs->phys_len = curr_len;
-					regs->phys_lo = 0;
-					regs->phys_hi =
-					    PC_REG_PHYS_HI(0,
-					    0,
-					    pctype,
-					    PC_REG_SPACE_IO,
-					    info->pd_socket,
-					    info->pd_function,
-					    0);
-					num_regs++;
-					found = 2;
-					break;
-				}
-			    }
-			    tmp[curr].phys_len = curr_len;
-			    tmp[curr].phys_lo = curr_base;
-			    curr++;
-			    found = 1;
-			}
-			if (found == 2)
-				break;
-		    } else {
-			/* no I/O range so just a mask */
-			regs->phys_len = 1 << cftable.io.addr_lines;
-			regs->phys_hi =
-			    PC_REG_PHYS_HI(0,
-			    0,
-			    pctype,
-			    PC_REG_SPACE_IO,
-			    info->pd_socket,
-			    info->pd_function,
-			    0);
-			regs->phys_lo = 0;
-			num_regs++;
-			regs++;
-			/* quit on "good" entry */
-			break;
-		    }
-		    /* was this the last CFTABLE Entry? */
-		    if (config.last == cftable.index)
-			    break;
-		}
-		/* END CSTYLE */
-		}
-	}
-	if (found == 1) {
-		/*
-		 * have some non-relocatable values
-		 * so we include them all for now
-		 */
-		for (i = 0; i < curr && num_regs < 8; i++) {
-		    regs->phys_len = tmp[i].phys_len;
-		    regs->phys_lo = tmp[i].phys_lo;
-		    regs->phys_hi = PC_REG_PHYS_HI(1, 0, pctype,
-			    PC_REG_SPACE_IO, info->pd_socket,
-			    info->pd_function, 0);
-		    regs++;
-		    num_regs++;
-		}
-	    }
-	}
-	return (num_regs);
-}
-
-/*
- * pcmcia_create_regs()
- *	create a valid set of regspecs for the card
- *	The first one is always for CIS access and naming
- */
-/*ARGSUSED*/
-static void
-pcmcia_find_regs(dev_info_t *dip, struct pcm_device_info *info,
-			struct pcmcia_parent_private *ppd)
-{
-	struct pcm_regs regs[32]; /* assume worst case */
-	int num_regs = 0;
-	int len;
-	int bustype;
-
-	if (ppd->ppd_flags & PPD_CARD_CARDBUS) {
-		/* always have a CIS map */
-		regs[0].phys_hi = PC_REG_PHYS_HI(0, 0, PC_REG_TYPE_CARDBUS,
-		    PC_REG_SPACE_CONFIG,
-		    info->pd_socket,
-		    info->pd_function, 0);
-		bustype = PC_REG_TYPE_CARDBUS;
-	} else {
-		/* always have a CIS map */
-		regs[0].phys_hi = PC_REG_PHYS_HI(0, 0, PC_REG_TYPE_16BIT,
-		    PC_REG_SPACE_ATTRIBUTE,
-		    info->pd_socket,
-		    info->pd_function, 0);
-		bustype = PC_REG_TYPE_16BIT;
-	}
-	regs[0].phys_lo = 0;	/* always starts at zero */
-	regs[0].phys_len = 0;
-	num_regs++;
-	/*
-	 * need to search CIS for other memory instances
-	 */
-
-	if (info->pd_flags & PCM_OTHER_NOCIS) {
-		/* special case of memory only card without CIS */
-		regs[1].phys_hi = PC_REG_PHYS_HI(0, 0, PC_REG_TYPE_16BIT,
-		    PC_REG_SPACE_MEMORY,
-		    info->pd_socket,
-		    info->pd_function, 0);
-		regs[1].phys_lo = 0;
-		regs[1].phys_len = PCM_MAX_R2_MEM;
-		num_regs++;
-	} else {
-		/*
-		 * want to get any other memory and/or I/O regions
-		 * on the card and represent them here.
-		 */
-		num_regs += pcmcia_get_mem_regs(&regs[num_regs], info,
-		    CISTPL_DEVICE_A, bustype);
-		num_regs += pcmcia_get_mem_regs(&regs[num_regs], info,
-		    CISTPL_DEVICE, bustype);
-
-		/* now look for an I/O space to configure */
-		num_regs += pcmcia_get_io_regs(&regs[num_regs], info,
-		    bustype);
-
-	}
-
-	len = num_regs * sizeof (uint32_t) * 3;
-	ppd->ppd_nreg = num_regs;
-	ppd->ppd_reg = kmem_alloc(len, KM_SLEEP);
-	bcopy(regs, ppd->ppd_reg, len);
-	len = sizeof (struct pcm_regs) * ppd->ppd_nreg;
-	ppd->ppd_assigned = kmem_zalloc(len, KM_SLEEP);
-}
-
-
-/*
- * pcmcia_need_intr()
- *	check to see if an interrupt tuple exists.
- *	existence means we need one in the intrspec.
- */
-static int
-pcmcia_need_intr(int socket, struct pcm_device_info *info)
-{
-	cistpl_config_t config;
-	cistpl_cftable_entry_t cftable;
-	tuple_t tuple;
-	int i;
-
-	bzero(&tuple, sizeof (tuple));
-	tuple.DesiredTuple = CISTPL_CONFIG;
-	tuple.Socket = socket;
-	tuple.Attributes = 0;
-	if (csx_GetFirstTuple(info->pd_handle, &tuple) != CS_SUCCESS) {
-		return (0);
-	}
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_need_intr: have config tuple\n");
-	}
-#endif
-	bzero(&config, sizeof (config));
-	if (csx_Parse_CISTPL_CONFIG(info->pd_handle,
-	    &tuple, &config) != CS_SUCCESS) {
-		cmn_err(CE_WARN, "pcmcia: config failed to parse\n");
-		return (0);
-	}
-
-	for (cftable.index = (int)-1, i = -1;
-	    i != config.last; i = cftable.index) {
-		tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-		tuple.Attributes = 0;
-		if (csx_GetNextTuple(info->pd_handle,
-		    &tuple) != CS_SUCCESS) {
-			cmn_err(CE_WARN, "pcmcia: get cftable failed\n");
-			break;
-		}
-		bzero(&cftable, sizeof (cftable));
-		if (csx_Parse_CISTPL_CFTABLE_ENTRY(info->pd_handle,
-		    &tuple, &cftable) !=
-		    CS_SUCCESS) {
-			cmn_err(CE_WARN, "pcmcia: parse cftable failed\n");
-			break;
-		}
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "\t%x: flags=%x (%x)\n",
-			    i, cftable.flags,
-			    cftable.flags & CISTPL_CFTABLE_TPCE_FS_IRQ);
-#endif
-		if (cftable.flags & CISTPL_CFTABLE_TPCE_FS_IRQ)
-			return (1);
-	}
-	return (0);
-
-}
-
-/*
- * pcmcia_num_funcs()
- *	look for a CISTPL_LONGLINK_MFC
- *	if there is one, return the number of functions
- *	if there isn't one, then there is one function
- */
-static int
-pcmcia_num_funcs(int socket, client_handle_t handle)
-{
-	int count = 1;
-	cistpl_longlink_mfc_t mfc;
-	tuple_t tuple;
-
-	bzero(&tuple, sizeof (tuple_t));
-	tuple.DesiredTuple = CISTPL_LONGLINK_MFC;
-	tuple.Socket = socket;
-	tuple.Attributes = 0;
-	if (csx_GetFirstTuple(handle, &tuple) == CS_SUCCESS) {
-		/* this is a multifunction card */
-		if (csx_ParseTuple(handle, &tuple, (cisparse_t *)&mfc,
-		    CISTPL_LONGLINK_MFC) == CS_SUCCESS) {
-			count = mfc.nfuncs;
-		}
-	}
-	return (count);
-}
-
-client_handle_t pcmcia_cs_handle;
-
-/*
- * pcmcia_create_dev_info(socket)
- *	either find or create the device information structure
- *	for the card(s) just inserted.	We don't care about removal yet.
- *	In any case, we will only do this at CS request
- */
-static void
-pcmcia_create_dev_info(int socket)
-{
-	struct pcm_device_info card_info;
-	client_reg_t reg;
-	cisinfo_t cisinfo;
-	int i;
-	dev_info_t *pdip;
-	static int handle_def = 0;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "create dev_info_t for device in socket %d\n",
-		    socket);
-#endif
-
-	/*
-	 * before we can do anything else, we need the parent
-	 * devinfo of the socket.  This gets things in the right
-	 * place in the device tree.
-	 */
-
-	pdip = pcm_find_parent_dip(socket);
-	if (pdip == NULL)
-		return;
-
-	/* Card Services calls needed to get CIS info */
-	reg.dip = NULL;
-	reg.Attributes = INFO_SOCKET_SERVICES;
-	reg.EventMask = 0;
-	reg.event_handler = NULL;
-	reg.Version = CS_VERSION;
-
-	bzero(&card_info, sizeof (card_info));
-
-	if (handle_def == 0) {
-		if (csx_RegisterClient(&pcmcia_cs_handle,
-		    &reg) != CS_SUCCESS) {
-#if defined(PCMCIA_DEBUG)
-			if (pcmcia_debug)
-				cmn_err(CE_CONT,
-				    "pcmcia: RegisterClient failed\n");
-#endif
-			return;
-		}
-		handle_def++;
-	}
-	card_info.pd_handle = pcmcia_cs_handle;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT,
-		    "pcmcia_create_dev_info: handle = %x\n",
-		    (int)card_info.pd_handle);
-#endif
-	card_info.pd_type = -1; /* no type to start */
-	card_info.pd_socket = socket;
-	card_info.pd_function = 0;
-	pcmcia_sockets[socket]->ls_functions = 1; /* default */
-
-	cisinfo.Socket = socket;
-
-	if ((i = csx_ValidateCIS(card_info.pd_handle,
-	    &cisinfo)) != SUCCESS ||
-	    cisinfo.Tuples == 0) {
-		/* no CIS means memory */
-		(void) strcpy(card_info.pd_generic_name, "memory");
-		card_info.pd_flags |= PCM_NAME_GENERIC |
-		    PCM_OTHER_NOCIS | PCM_NAME_1275;
-		(void) strcpy(card_info.pd_bind_name, "pccard,memory");
-		(void) strcpy(card_info.pd_generic_name, "memory");
-		card_info.pd_type = PCM_TYPE_MEMORY;
-	} else {
-		int functions, lsocket;
-		card_info.pd_tuples = cisinfo.Tuples;
-
-		/*
-		 * how many functions on the card?
-		 * we need to know and then we do one
-		 * child node for each function using
-		 * the function specific tuples.
-		 */
-		lsocket = CS_MAKE_SOCKET_NUMBER(socket, CS_GLOBAL_CIS);
-		functions = pcmcia_num_funcs(lsocket,
-		    card_info.pd_handle);
-		pcmcia_sockets[socket]->ls_functions = functions;
-		if (functions > 1) {
-			card_info.pd_flags |= PCM_MULTI_FUNCTION;
-		}
-		for (i = 0; i < functions; i++) {
-			register int flags;
-			lsocket = CS_MAKE_SOCKET_NUMBER(socket, i);
-			card_info.pd_socket = socket;
-			card_info.pd_function = i;
-			/*
-			 * new name construction
-			 */
-			if (functions != 1) {
-				/* need per function handle */
-				card_info.pd_function = i;
-				/* get new handle */
-			}
-			pcmcia_1275_name(lsocket, &card_info,
-			card_info.pd_handle);
-			pcmcia_vers1_name(lsocket, &card_info,
-			card_info.pd_handle);
-			pcmcia_generic_name(lsocket, &card_info,
-			card_info.pd_handle);
-			flags = card_info.pd_flags;
-			if (!(flags & PCM_NAME_1275)) {
-				if (flags & PCM_NAME_VERS1) {
-				    (void) strcpy(card_info.pd_bind_name,
-					PCMDEV_NAMEPREF);
-				    card_info.pd_bind_name[
-				        sizeof (PCMDEV_NAMEPREF)] = ',';
-				    (void) strncpy(card_info.pd_bind_name +
-					sizeof (PCMDEV_NAMEPREF),
-					card_info.pd_vers1_name,
-					MODMAXNAMELEN -
-					sizeof (PCMDEV_NAMEPREF));
-				    pcmcia_fix_string(card_info.pd_bind_name);
-				} else {
-					/*
-					 * have a CIS but not the right info
-					 * so treat as generic "pccard"
-					 */
-					(void) strcpy(card_info.pd_generic_name,
-					    "pccard,memory");
-					card_info.pd_flags |= PCM_NAME_GENERIC;
-					(void) strcpy(card_info.pd_bind_name,
-					    "pccard,memory");
-				}
-			}
-			pcmcia_init_devinfo(pdip, &card_info);
-		}
-		return;
-	}
-
-	pcmcia_init_devinfo(pdip, &card_info);
-}
-
-/*
- * pcmcia_init_devinfo()
- *	if there isn't a device info structure, create one
- *	if there is, we don't do much.
- *
- *	Note: this will need updating as 1275 finalizes their spec.
- */
-static void
-pcmcia_init_devinfo(dev_info_t *pdip, struct pcm_device_info *info)
-{
-	int unit;
-	dev_info_t *dip;
-	char *name;
-	struct pcmcia_parent_private *ppd;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "init_devinfo(%s, %d)\n", info->pd_bind_name,
-		    info->pd_socket);
-#endif
-
-	/*
-	 * find out if there is already an instance of this
-	 * device.  We don't want to create a new one unnecessarily
-	 */
-	unit = CS_MAKE_SOCKET_NUMBER(info->pd_socket, info->pd_function);
-
-	dip = pcm_find_devinfo(pdip, info, unit);
-	if ((dip != NULL) && (ddi_getprop(DDI_DEV_T_NONE, dip,
-	    DDI_PROP_DONTPASS, PCM_DEV_SOCKET, -1) != -1)) {
-		/* it already exist but isn't a .conf file */
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "\tfound existing device node (%s)\n",
-			    ddi_get_name(dip));
-#endif
-		if (strlen(info->pd_vers1_name) > 0)
-			(void) ndi_prop_update_string(DDI_DEV_T_NONE,
-			    dip, PCM_DEV_MODEL, info->pd_vers1_name);
-
-		ppd = (struct pcmcia_parent_private *)
-		    ddi_get_parent_data(dip);
-
-		pcmcia_sockets[info->pd_socket]->ls_dip[info->pd_function] =
-		    dip;
-
-		ppd->ppd_active = 1;
-
-		if (ndi_devi_online(dip, 0) == NDI_FAILURE) {
-			pcmcia_sockets[info->pd_socket]-> \
-			    ls_dip[info->pd_function] = NULL;
-			ppd->ppd_active = 0;
-		}
-	} else {
-
-		char *dtype;
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "pcmcia: create child [%s](%d): %s\n",
-			    info->pd_bind_name, info->pd_socket,
-			    info->pd_generic_name);
-#endif
-
-		if (info->pd_flags & PCM_NAME_GENERIC)
-			name = info->pd_generic_name;
-		else
-			name = info->pd_bind_name;
-
-		if (ndi_devi_alloc(pdip, name, (pnode_t)DEVI_SID_NODEID,
-		    &dip) !=
-		    NDI_SUCCESS) {
-			cmn_err(CE_WARN,
-			    "pcmcia: unable to create device [%s](%d)\n",
-			    name, info->pd_socket);
-			return;
-		}
-		/*
-		 * construct the "compatible" property if the device
-		 * has a generic name
-		 */
-		pcmcia_add_compatible(dip, info);
-
-		ppd = kmem_zalloc(sizeof (struct pcmcia_parent_private),
-		    KM_SLEEP);
-
-		ppd->ppd_socket = info->pd_socket;
-		ppd->ppd_function = info->pd_function;
-
-		/*
-		 * add the "socket" property
-		 * the value of this property contains the logical PCMCIA
-		 * socket number the device has been inserted in, along
-		 * with the function # if the device is part of a
-		 * multi-function device.
-		 */
-		(void) ndi_prop_update_int(DDI_DEV_T_NONE, dip,
-		    PCM_DEV_SOCKET, unit);
-
-		if (info->pd_flags & PCM_MULTI_FUNCTION)
-			ppd->ppd_flags |= PPD_CARD_MULTI;
-
-		/*
-		 * determine all the properties we need for PPD
-		 * then create the properties
-		 */
-		/* socket is unique */
-		pcmcia_find_regs(dip, info, ppd);
-
-		ppd->ppd_intr = pcmcia_need_intr(unit, info);
-
-		if (ppd->ppd_nreg > 0)
-			(void) ddi_prop_update_int_array(DDI_DEV_T_NONE, dip,
-			    "reg", (int *)ppd->ppd_reg, ppd->ppd_nreg *
-			    sizeof (struct pcm_regs) / sizeof (int));
-		if (ppd->ppd_intr) {
-			(void) ddi_prop_update_int(DDI_DEV_T_NONE, dip,
-			    "interrupts", ppd->ppd_intr);
-			ppd->ppd_intrspec =
-			    kmem_zalloc(sizeof (struct intrspec), KM_SLEEP);
-		}
-
-		/* set parent private - our own format */
-		ddi_set_parent_data(dip, (caddr_t)ppd);
-
-		/* init the device type */
-		if (info->pd_type >= 0 &&
-		    info->pd_type < (sizeof (pcmcia_dev_type) /
-		    (sizeof (char *))))
-			dtype = pcmcia_dev_type[info->pd_type];
-		else
-			dtype = "unknown";
-
-		if (strlen(info->pd_vers1_name) > 0)
-			(void) ndi_prop_update_string(DDI_DEV_T_NONE,
-			    dip, PCM_DEV_MODEL, info->pd_vers1_name);
-
-		(void) ndi_prop_update_string(DDI_DEV_T_NONE, dip,
-		    PCM_DEVICETYPE, dtype);
-
-		/* set PC Card as active and present in socket */
-		pcmcia_sockets[info->pd_socket]->ls_dip[info->pd_function] =
-		    dip;
-
-		ppd->ppd_active = 1;
-
-		/*
-		 * We should not call ndi_devi_online here if
-		 * pcmcia attach is in progress. This causes a deadlock.
-		 */
-		if (pcmcia_dip != dip) {
-			if (ndi_devi_online_async(dip, 0)
-			    != NDI_SUCCESS) {
-				pcmcia_sockets[info->pd_socket]->\
-				    ls_dip[info->pd_function] = NULL;
-				pcmcia_ppd_free(ppd);
-				(void) ndi_devi_free(dip);
-				return;
-			}
-		}
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "\tjust added \"active\" to %s in %d\n",
-		    ddi_get_name(dip), info->pd_socket);
-#endif
-	}
-
-	/*
-	 * inform the event manager that a child was added
-	 * to the device tree.
-	 */
-	pcm_event_manager(PCE_DEV_IDENT, unit, ddi_get_name(dip));
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug > 1) {
-		pcmcia_dump_minors(dip);
-	}
-#endif
-}
-
-/*
- * free any allocated parent-private data
- */
-static void
-pcmcia_ppd_free(struct pcmcia_parent_private *ppd)
-{
-	size_t len;
-
-	if (ppd->ppd_nreg != 0) {
-		len = ppd->ppd_nreg * sizeof (uint32_t) * 3;
-		kmem_free(ppd->ppd_reg, len);
-		len = sizeof (struct pcm_regs) * ppd->ppd_nreg;
-		kmem_free(ppd->ppd_assigned, len);
-	}
-
-	/*
-	 * pcmcia only allocates 1 intrspec today
-	 */
-	if (ppd->ppd_intr != 0) {
-		len = sizeof (struct intrspec) * ppd->ppd_intr;
-		kmem_free(ppd->ppd_intrspec, len);
-	}
-
-	kmem_free(ppd, sizeof (*ppd));
-}
-
-
-/*
- * pcmcia_get_devinfo(socket)
- *	entry point to allow finding the device info structure
- *	for a given logical socket.  Used by event manager
- */
-dev_info_t *
-pcmcia_get_devinfo(int socket)
-{
-	int func = CS_GET_FUNCTION_NUMBER(socket);
-	socket = CS_GET_SOCKET_NUMBER(socket);
-	if (pcmcia_sockets[socket])
-		return (pcmcia_sockets[socket]->ls_dip[func]);
-	return ((dev_info_t *)NULL);
-}
-
-/*
- * CSGetCookiesAndDip()
- *	get info needed by CS to setup soft interrupt handler and provide
- *		socket-specific adapter information
- */
-static int
-GetCookiesAndDip(sservice_t *serv)
-{
-	pcmcia_logical_socket_t *socket;
-	csss_adapter_info_t *ai;
-	int sock;
-
-	sock = CS_GET_SOCKET_NUMBER(serv->get_cookies.socket);
-
-	if (sock >= pcmcia_num_sockets ||
-	    (int)serv->get_cookies.socket < 0)
-		return (BAD_SOCKET);
-
-	socket = pcmcia_sockets[sock];
-	ai = &serv->get_cookies.adapter_info;
-	serv->get_cookies.dip = socket->ls_adapter->pca_dip;
-	serv->get_cookies.iblock = socket->ls_adapter->pca_iblock;
-	serv->get_cookies.idevice = socket->ls_adapter->pca_idev;
-
-	/*
-	 * Setup the adapter info for Card Services
-	 */
-	(void) strcpy(ai->name, socket->ls_adapter->pca_name);
-	ai->major = socket->ls_adapter->pca_module;
-	ai->minor = socket->ls_adapter->pca_unit;
-	ai->number = socket->ls_adapter->pca_number;
-	ai->num_sockets = socket->ls_adapter->pca_numsockets;
-	ai->first_socket = socket->ls_adapter->pca_first_socket;
-
-	return (SUCCESS);
-}
-
-/*
- * Note:
- *	The following functions that start with 'SS'
- *	implement SocketServices interfaces.  They
- *	simply map the socket and/or window number to
- *	the adapter specific number based on the general
- *	value that CardServices uses.
- *
- *	See the descriptions in SocketServices for
- *	details.  Also refer to specific adapter drivers
- *	for implementation reference.
- */
-
-static int
-SSGetAdapter(get_adapter_t *adapter)
-{
-	int n;
-	get_adapter_t info;
-
-	adapter->state = (unsigned)0xFFFFFFFF;
-	adapter->SCRouting = 0xFFFFFFFF;
-
-	for (n = 0; n < pcmcia_num_adapters; n++) {
-		GET_ADAPTER(pcmcia_adapters[n]->pca_if,
-		    pcmcia_adapters[n]->pca_dip, &info);
-		adapter->state &= info.state;
-		adapter->SCRouting &= info.SCRouting;
-	}
-
-	return (SUCCESS);
-}
-
-static int
-SSGetPage(get_page_t *page)
-{
-	pcmcia_logical_window_t *window;
-	get_page_t newpage;
-	int retval, win;
-
-	if (page->window > pcmcia_num_windows) {
-		return (BAD_WINDOW);
-	}
-
-	window = pcmcia_windows[page->window];
-	newpage = *page;
-	win = newpage.window = window->lw_window; /* real window */
-
-	retval = GET_PAGE(window->lw_if, window->lw_adapter->pca_dip,
-	    &newpage);
-	if (retval == SUCCESS) {
-		*page = newpage;
-		page->window = win;
-	}
-	return (retval);
-}
-
-static int
-SSGetSocket(get_socket_t *socket)
-{
-	int retval, sock;
-	get_socket_t newsocket;
-	pcmcia_logical_socket_t *sockp;
-
-	sock = socket->socket;
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL) {
-		return (BAD_SOCKET);
-	}
-
-	newsocket = *socket;
-	newsocket.socket = sockp->ls_socket;
-	retval = GET_SOCKET(sockp->ls_if, sockp->ls_adapter->pca_dip,
-	    &newsocket);
-	if (retval == SUCCESS) {
-		newsocket.VccLevel = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsocket.VccLevel,
-		    VCC);
-		newsocket.Vpp1Level = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsocket.Vpp1Level,
-		    VPP1);
-		newsocket.Vpp2Level = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsocket.Vpp2Level,
-		    VPP2);
-		*socket = newsocket;
-		socket->socket = sock;
-	}
-
-	return (retval);
-}
-
-static int
-SSGetStatus(get_ss_status_t *status)
-{
-	get_ss_status_t newstat;
-	int sock, retval;
-	pcmcia_logical_socket_t *sockp;
-
-	sock = status->socket;
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL) {
-		return (BAD_SOCKET);
-	}
-
-	newstat = *status;
-	newstat.socket = sockp->ls_socket;
-	retval = GET_STATUS(sockp->ls_if, sockp->ls_adapter->pca_dip,
-	    &newstat);
-	if (retval == SUCCESS) {
-		*status = newstat;
-		status->socket = sock;
-	}
-
-	return (retval);
-}
-
-static int
-SSGetWindow(get_window_t *window)
-{
-	int win, retval;
-	get_window_t newwin;
-	pcmcia_logical_window_t *winp;
-
-	win = window->window;
-	winp = pcmcia_windows[win];
-	newwin = *window;
-	newwin.window = winp->lw_window;
-
-	retval = GET_WINDOW(winp->lw_if, winp->lw_adapter->pca_dip,
-	    &newwin);
-	if (retval == SUCCESS) {
-		newwin.socket = winp->lw_socket;
-		newwin.window = win;
-		*window = newwin;
-	}
-	return (retval);
-}
-
-/*
- * SSInquireAdapter()
- *	Get the capabilities of the "generic" adapter
- *	we are exporting to CS.
- */
-static int
-SSInquireAdapter(inquire_adapter_t *adapter)
-{
-	adapter->NumSockets = pcmcia_num_sockets;
-	adapter->NumWindows = pcmcia_num_windows;
-	adapter->NumEDCs = 0;
-	/*
-	 * notes: Adapter Capabilities are going to be difficult to
-	 * determine with reliability.	Fortunately, most of them
-	 * don't matter under Solaris or can be handled transparently
-	 */
-	adapter->AdpCaps = 0;	/* need to fix these */
-	/*
-	 * interrupts need a little work.  For x86, the valid IRQs will
-	 * be restricted to those that the system has exported to the nexus.
-	 * for SPARC, it will be the DoRight values.
-	 */
-	adapter->ActiveHigh = 0;
-	adapter->ActiveLow = 0;
-	adapter->power_entry = pcmcia_power_table; /* until we resolve this */
-	adapter->NumPower = pcmcia_num_power;
-	return (SUCCESS);
-}
-
-static int
-SSInquireSocket(inquire_socket_t *socket)
-{
-	int retval, sock;
-	inquire_socket_t newsocket;
-	pcmcia_logical_socket_t *sockp;
-
-	sock = socket->socket;
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL)
-		return (BAD_SOCKET);
-	newsocket = *socket;
-	newsocket.socket = sockp->ls_socket;
-	retval = INQUIRE_SOCKET(sockp->ls_if, sockp->ls_adapter->pca_dip,
-	    &newsocket);
-	if (retval == SUCCESS) {
-		*socket = newsocket;
-		socket->socket = sock;
-	}
-	return (retval);
-}
-
-static int
-SSInquireWindow(inquire_window_t *window)
-{
-	int retval, win;
-	pcmcia_logical_window_t *winp;
-	inquire_window_t newwin;
-	int slide;
-
-	win = window->window;
-	if (win > pcmcia_num_windows)
-		return (BAD_WINDOW);
-
-	winp = pcmcia_windows[win];
-	newwin = *window;
-	newwin.window = winp->lw_window;
-	retval = INQUIRE_WINDOW(winp->lw_if, winp->lw_adapter->pca_dip,
-	    &newwin);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug > 1)
-			cmn_err(CE_CONT, "SSInquireWindow: win=%d, pwin=%d\n",
-			    win, newwin.window);
-#endif
-	if (retval == SUCCESS) {
-		*window = newwin;
-		/* just in case */
-		window->iowin_char.IOWndCaps &= ~WC_BASE;
-		slide = winp->lw_adapter->pca_first_socket;
-		/*
-		 * note that sockets are relative to the adapter.
-		 * we have to adjust the bits to show a logical
-		 * version.
-		 */
-
-		pcm_fix_bits(newwin.Sockets, window->Sockets, slide, 0);
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug > 1) {
-			cmn_err(CE_CONT, "iw: orig bits=%x, new bits=%x\n",
-			    (int)*(uint32_t *)newwin.Sockets,
-			    (int)*(uint32_t *)window->Sockets);
-			cmn_err(CE_CONT, "\t%x.%x.%x\n", window->WndCaps,
-			    window->mem_win_char.MemWndCaps,
-			    window->mem_win_char.MinSize);
-		}
-#endif
-		window->window = win;
-	}
-	return (retval);
-}
-
-static int
-SSResetSocket(int socket, int mode)
-{
-	pcmcia_logical_socket_t *sockp;
-
-	if (socket >= pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[socket]) == NULL)
-		return (BAD_SOCKET);
-
-	return (RESET_SOCKET(sockp->ls_if, sockp->ls_adapter->pca_dip,
-	    sockp->ls_socket, mode));
-}
-
-static int
-SSSetPage(set_page_t *page)
-{
-	int window, retval;
-	set_page_t newpage;
-	pcmcia_logical_window_t *winp;
-
-	window = page->window;
-	if (window > pcmcia_num_windows) {
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug > 1)
-			cmn_err(CE_CONT, "SSSetPage: window=%d (of %d)\n",
-			    window, pcmcia_num_windows);
-#endif
-		return (BAD_WINDOW);
-	}
-
-	winp = pcmcia_windows[window];
-	newpage = *page;
-	newpage.window = winp->lw_window;
-	retval = SET_PAGE(winp->lw_if, winp->lw_adapter->pca_dip, &newpage);
-	if (retval == SUCCESS) {
-		newpage.window = window;
-		*page = newpage;
-	}
-#if defined(PCMCIA_DEBUG)
-	if ((pcmcia_debug > 1) && retval != SUCCESS)
-		cmn_err(CE_CONT, "\tSetPage: returning error %x\n", retval);
-#endif
-	return (retval);
-}
-
-static int
-SSSetWindow(set_window_t *win)
-{
-	int socket, window, retval, func;
-	set_window_t newwin;
-	pcmcia_logical_window_t *winp;
-	pcmcia_logical_socket_t *sockp;
-
-	window = win->window;
-	if (window > pcmcia_num_windows)
-		return (BAD_WINDOW);
-
-	socket = CS_GET_SOCKET_NUMBER(win->socket);
-	func = CS_GET_FUNCTION_NUMBER(win->socket);
-
-	if (socket > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[socket]) == NULL) {
-		return (BAD_SOCKET);
-	}
-
-	winp = pcmcia_windows[window];
-	winp->lw_socket = win->socket; /* reverse map */
-	newwin = *win;
-	newwin.window = winp->lw_window;
-	newwin.socket = sockp->ls_socket;
-	newwin.child = sockp->ls_dip[func]; /* so we carry the dip around */
-
-	retval = SET_WINDOW(winp->lw_if, winp->lw_adapter->pca_dip, &newwin);
-	if (retval == SUCCESS) {
-		newwin.window = window;
-		newwin.socket = winp->lw_socket;
-		*win = newwin;
-	}
-	return (retval);
-}
-
-static int
-SSSetSocket(set_socket_t *socket)
-{
-	int sock, retval;
-	pcmcia_logical_socket_t *sockp;
-	set_socket_t newsock;
-
-	sock = socket->socket;
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL) {
-		return (BAD_SOCKET);
-	}
-
-	newsock = *socket;
-	/* note: we force CS to always get insert/removal events */
-	sockp->ls_cs_events = pcm_mapevents(newsock.SCIntMask) |
-	    PCE_E2M(PCE_CARD_INSERT) | PCE_E2M(PCE_CARD_REMOVAL) |
-	    PCE_E2M(PCE_PM_SUSPEND);
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug > 1)
-		cmn_err(CE_CONT,
-		    "SetSocket: SCIntMask = %x\n", newsock.SCIntMask);
-#endif
-	newsock.socket = sockp->ls_socket;
-	newsock.VccLevel = pcmcia_map_power_set(sockp->ls_adapter,
-	    newsock.VccLevel, VCC);
-	newsock.Vpp1Level = pcmcia_map_power_set(sockp->ls_adapter,
-	    newsock.Vpp1Level, VPP1);
-	newsock.Vpp2Level = pcmcia_map_power_set(sockp->ls_adapter,
-	    newsock.Vpp2Level, VPP2);
-	retval = SET_SOCKET(sockp->ls_if, sockp->ls_adapter->pca_dip,
-	    &newsock);
-	if (retval == SUCCESS) {
-		newsock.socket = sock;
-		newsock.VccLevel = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsock.VccLevel,
-		    VCC);
-		newsock.Vpp1Level = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsock.Vpp1Level,
-		    VPP1);
-		newsock.Vpp2Level = pcmcia_map_power_get(sockp->ls_adapter,
-		    newsock.Vpp2Level,
-		    VPP2);
-		*socket = newsock;
-		if (socket->IREQRouting & IRQ_ENABLE) {
-			sockp->ls_flags |= PCS_IRQ_ENABLED;
-		} else {
-			sockp->ls_flags &= ~PCS_IRQ_ENABLED;
-		}
-	}
-	return (retval);
-}
-
-/*
- * SSSetIRQHandler()
- *	arrange for IRQ to be allocated if appropriate and always
- *	arrange that PC Card interrupt handlers get called.
- */
-static int
-SSSetIRQHandler(set_irq_handler_t *handler)
-{
-	int sock, retval, func;
-	pcmcia_logical_socket_t *sockp;
-	struct pcmcia_parent_private *ppd;
-	dev_info_t *dip;
-	ddi_iblock_cookie_t iblk;
-	ddi_idevice_cookie_t idev;
-
-	sock = CS_GET_SOCKET_NUMBER(handler->socket);
-	func = CS_GET_FUNCTION_NUMBER(handler->socket);
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL) {
-		return (BAD_SOCKET);
-	}
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-
-		cmn_err(CE_CONT, "SSSetIRQHandler: socket=%x, function=%x\n",
-		    sock, func);
-		cmn_err(CE_CONT, "\thandler(%p): socket=%x, irq=%x, id=%x\n",
-		    (void *)handler->handler, handler->socket, handler->irq,
-		    handler->handler_id);
-	}
-#endif
-	dip = sockp->ls_dip[func];
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-
-	handler->iblk_cookie = &iblk;
-	handler->idev_cookie = &idev;
-
-	retval = ddi_add_intr(dip, 0, handler->iblk_cookie,
-	    handler->idev_cookie,
-	    (uint32_t(*)(caddr_t)) handler->handler,
-	    handler->arg1);
-
-	if (retval == DDI_SUCCESS) {
-		handler->iblk_cookie = &sockp->ls_iblk;
-		handler->idev_cookie = &sockp->ls_idev;
-		handler->irq = ppd->ppd_intrspec->intrspec_vec;
-		retval = SUCCESS;
-	} else {
-		retval = sockp->ls_error;
-	}
-	return (retval);
-}
-
-/*
- * SSClearIRQHandler()
- *	Arrange to have the interrupt handler specified removed
- *	from the interrupt list.
- */
-static int
-SSClearIRQHandler(clear_irq_handler_t *handler)
-{
-	int sock, func;
-	pcmcia_logical_socket_t *sockp;
-	dev_info_t *dip;
-
-	sock = CS_GET_SOCKET_NUMBER(handler->socket);
-	func = CS_GET_FUNCTION_NUMBER(handler->socket);
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-
-		cmn_err(CE_CONT,
-		    "SSClearIRQHandler: socket=%x, function=%x\n",
-		    sock, func);
-		cmn_err(CE_CONT,
-		    "\thandler(%p): socket=%x, id=%x\n",
-		    (void *)handler, handler->socket,
-		    handler->handler_id);
-	}
-#endif
-
-	if (sock > pcmcia_num_sockets ||
-	    (sockp = pcmcia_sockets[sock]) == NULL) {
-		return (BAD_SOCKET);
-	}
-	dip = sockp->ls_dip[func];
-	if (dip) {
-		ddi_remove_intr(dip, 0, NULL);
-		return (SUCCESS);
-	}
-	return (BAD_SOCKET);
-}
-
-
-/*
- * pcm_pathname()
- *	make a partial path from dip.
- *	used to mknods relative to /devices/pcmcia/
- *
- * XXX - we now use ddi_get_name_addr to get the "address" portion
- *	of the name; that way, we only have to modify the name creation
- *	algorithm in one place
- */
-static void
-pcm_pathname(dev_info_t *dip, char *name, char *path)
-{
-	(void) sprintf(path, "%s@%s:%s", ddi_node_name(dip),
-	    ddi_get_name_addr(dip), name);
-}
-
-/*
- * pcmcia_create_device()
- *	create the /devices entries for the driver
- *	it is assumed that the PC Card driver will do a
- *	RegisterClient for each subdevice.
- *	The device type string is encoded here to match
- *	the standardized names when possible.
- * XXX - note that we may need to provide a way for the
- *	caller to specify the complete name string that
- *	we pass to ddi_set_name_addr
- */
-static int
-pcmcia_create_device(ss_make_device_node_t *init)
-{
-	int err = SUCCESS;
-	struct pcm_make_dev device;
-	struct dev_ops *ops;
-	major_t major;
-
-	/*
-	 * Now that we have the name, create it.
-	 */
-
-	bzero(&device, sizeof (device));
-	if (init->flags & SS_CSINITDEV_CREATE_DEVICE) {
-		if ((err = ddi_create_minor_node(init->dip,
-		    init->name,
-		    init->spec_type,
-		    init->minor_num,
-		    init->node_type,
-		    0)) != DDI_SUCCESS) {
-#if defined(PCMCIA_DEBUG)
-			if (pcmcia_debug)
-				cmn_err(CE_CONT,
-				    "pcmcia_create_device: failed "
-				    "create\n");
-#endif
-			return (BAD_ATTRIBUTE);
-		}
-
-		major = ddi_driver_major(init->dip);
-		ops = ddi_get_driver(init->dip);
-		LOCK_DEV_OPS(&devnamesp[major].dn_lock);
-		INCR_DEV_OPS_REF(ops);
-		(void) ddi_pathname(init->dip, device.path);
-		DECR_DEV_OPS_REF(ops);
-		UNLOCK_DEV_OPS(&devnamesp[major].dn_lock);
-		(void) sprintf(device.path + strlen(device.path), ":%s",
-		    init->name);
-
-		(void) strcpy(device.driver, ddi_binding_name(init->dip));
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT,
-			    "pcmcia_create_device: created %s "
-			    "from %s [%s]\n",
-			    device.path, init->name, device.driver);
-#endif
-		device.dev =
-		    makedevice(ddi_driver_major(init->dip), init->minor_num);
-		device.flags |= (init->flags & SS_CSINITDEV_MORE_DEVICES) ?
-		    PCM_EVENT_MORE : 0;
-		device.type = init->spec_type;
-		device.op = SS_CSINITDEV_CREATE_DEVICE;
-		device.socket = ddi_getprop(DDI_DEV_T_ANY, init->dip,
-		    DDI_PROP_CANSLEEP, PCM_DEV_SOCKET,
-		    -1);
-	} else if (init->flags & SS_CSINITDEV_REMOVE_DEVICE) {
-		device.op = SS_CSINITDEV_REMOVE_DEVICE;
-		device.socket = ddi_getprop(DDI_DEV_T_ANY, init->dip,
-		    DDI_PROP_CANSLEEP, PCM_DEV_SOCKET,
-		    -1);
-		if (init->name != NULL)
-			(void) strcpy(device.path, init->name);
-		device.dev = makedevice(ddi_driver_major(init->dip), 0);
-		ddi_remove_minor_node(init->dip, init->name);
-	}
-
-	/*
-	 *	we send an event for ALL devices created.
-	 *	To do otherwise ties us to using drvconfig
-	 *	forever.  There are relatively few devices
-	 *	ever created so no need to do otherwise.
-	 *	The existence of the event manager must never
-	 *	be visible to a PCMCIA device driver.
-	 */
-	pcm_event_manager(PCE_INIT_DEV, device.socket, &device);
-
-	return (err);
-}
-
-/*
- * pcmcia_get_minors()
- *	We need to traverse the minor node list of the
- *	dip if there are any.  This takes two passes;
- *	one to get the count and buffer size and the
- *	other to actually copy the data into the buffer.
- *	The framework requires that the dip be locked
- *	during this time to avoid breakage as well as the
- *	driver being locked.
- */
-int
-pcmcia_get_minors(dev_info_t *dip, struct pcm_make_dev **minors)
-{
-	int circ;
-	int count = 0;
-	struct ddi_minor_data *dp;
-	struct pcm_make_dev *md;
-	int socket;
-	major_t major;
-	struct dev_ops *ops;
-
-	socket = ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    PCM_DEV_SOCKET, -1);
-	ndi_devi_enter(dip, &circ);
-	if (DEVI(dip)->devi_minor != (struct ddi_minor_data *)NULL) {
-		for (dp = DEVI(dip)->devi_minor;
-		    dp != (struct ddi_minor_data *)NULL;
-		    dp = dp->next) {
-			count++; /* have one more */
-		}
-		/* we now know how many nodes to allocate */
-		md = kmem_zalloc(count * sizeof (struct pcm_make_dev),
-		    KM_NOSLEEP);
-		if (md != NULL) {
-			*minors = md;
-			for (dp = DEVI(dip)->devi_minor;
-			    dp != (struct ddi_minor_data *)NULL;
-			    dp = dp->next, md++) {
-#if defined(PCMCIA_DEBUG)
-				if (pcmcia_debug > 1) {
-					cmn_err(CE_CONT,
-					    "pcmcia_get_minors: name=%s,"
-					    "socket=%d, stype=%x, "
-					    "ntype=%s, dev_t=%x",
-					    dp->ddm_name,
-					    socket,
-					    dp->ddm_spec_type,
-					    dp->ddm_node_type,
-					    (int)dp->ddm_dev);
-					cmn_err(CE_CONT,
-					    "\tbind name = %s\n",
-					    ddi_binding_name(dip));
-				}
-#endif
-				md->socket = socket;
-				md->op = SS_CSINITDEV_CREATE_DEVICE;
-				md->dev = dp->ddm_dev;
-				md->type = dp->ddm_spec_type;
-				(void) strcpy(md->driver,
-				    ddi_binding_name(dip));
-				major = ddi_driver_major(dip);
-				ops = ddi_get_driver(dip);
-				LOCK_DEV_OPS(&devnamesp[major].dn_lock);
-				pcm_pathname(dip, dp->ddm_name, md->path);
-				INCR_DEV_OPS_REF(ops);
-				(void) ddi_pathname(dip, md->path);
-				DECR_DEV_OPS_REF(ops);
-				UNLOCK_DEV_OPS(&devnamesp[major].dn_lock);
-				(void) sprintf(md->path + strlen(md->path),
-				    ":%s", dp->ddm_name);
-				if (dp->next == NULL)
-					/* no more */
-					md->flags |= PCM_EVENT_MORE;
-			}
-		} else {
-			count = 0;
-		}
-	}
-	ndi_devi_exit(dip, circ);
-	return (count);
-}
-
-#if defined(PCMCIA_DEBUG)
-static char *ddmtypes[] = { "minor", "alias", "default", "internal" };
-
-static void
-pcmcia_dump_minors(dev_info_t *dip)
-{
-	int circ;
-	int count = 0;
-	struct ddi_minor_data *dp;
-	int unit, major;
-	dev_info_t *np;
-
-	unit = ddi_getprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
-	    PCM_DEV_SOCKET, -1);
-	cmn_err(CE_CONT,
-	    "pcmcia_dump_minors: dip=%p, socket=%d\n", (void *)dip, unit);
-
-	major = ddi_driver_major(dip);
-	if (major != -1) {
-		for (np = devnamesp[major].dn_head; np != NULL;
-		    np = (dev_info_t *)DEVI(np)->devi_next) {
-			char *cf2 = "";
-			char *cur = "";
-			if (i_ddi_node_state(np) == DS_READY)
-				cf2 = "DS_READY";
-			if (np == dip)
-				cur = "CUR";
-			cmn_err(CE_CONT, "\tsibs: %s %s %s\n",
-			    ddi_binding_name(np), cf2, cur);
-
-			ndi_devi_enter(np, &circ);
-			if (DEVI(np)->devi_minor !=
-			    (struct ddi_minor_data *)NULL) {
-				for (dp = DEVI(np)->devi_minor;
-				    dp != (struct ddi_minor_data *)NULL;
-				    dp = dp->next) {
-					count++; /* have one more */
-				}
-				for (dp = DEVI(dip)->devi_minor;
-				    dp != (struct ddi_minor_data *)NULL;
-				    dp = dp->next) {
-					cmn_err(CE_CONT, "\ttype=%s, name=%s,"
-					    "socket=%d, stype=%x, "
-					    "ntype=%s, dev_t=%x",
-					    ddmtypes[dp->type],
-					    dp->ddm_name,
-					    unit,
-					    dp->ddm_spec_type,
-					    dp->ddm_node_type,
-					    (int)dp->ddm_dev);
-					cmn_err(CE_CONT, "\tbind name = %s\n",
-					    ddi_binding_name(np));
-				}
-			}
-			ndi_devi_exit(np, circ);
-		}
-	}
-}
-#endif
-
-/*
- * experimental merging code
- * what are the things that we should merge on?
- *	match something by name in the "compatible" property
- *	restrict to a specific "socket"
- *	restrict to a specific "instance"
- */
-/*ARGSUSED*/
-static int
-pcmcia_merge_conf(dev_info_t *dip)
-{
-	return (0);		/* merge failed */
-}
-
-/*
- * pcmcia_mfc_intr()
- *	Multifunction Card interrupt handler
- *	While some adapters share interrupts at the lowest
- *	level, some can't.  In order to be consistent, we
- *	split multifunction cards out with this intercept and
- *	allow the low level to do what is best for it.
- *	the arg is a pcmcia_socket structure and all interrupts
- *	are per-socket in this case.  We also have the option
- *	to optimize if the cards support it.  It also means
- *	that we can use the INTRACK mode if it proves desirable
- */
-/*ARGSUSED*/
-static uint32_t
-pcmcia_mfc_intr(caddr_t arg1, caddr_t arg2)
-{
-	pcmcia_logical_socket_t *sockp;
-	inthandler_t *intr, *first;
-	int done, result;
-
-	sockp = (pcmcia_logical_socket_t *)arg1;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug > 1) {
-		cmn_err(CE_CONT, "pcmcia_mfc_intr sockp=%p"
-		    " ls_inthandlers=%p\n"
-		    "\t ls_flags=0x%x PCS_IRQ_ENABLED=0x%x \n",
-		    (void *) sockp, (void *) sockp->ls_inthandlers,
-		    sockp->ls_flags, PCS_IRQ_ENABLED);
-	}
-#endif
-
-	if (sockp == NULL || sockp->ls_inthandlers == NULL ||
-	    !(sockp->ls_flags & PCS_IRQ_ENABLED))
-		return (DDI_INTR_UNCLAIMED);
-
-	mutex_enter(&sockp->ls_ilock);
-	for (done = 0, result = 0, first = intr = sockp->ls_inthandlers;
-	    intr != NULL && !done; intr = intr->next) {
-		result |= intr->intr(intr->arg1, intr->arg2);
-		if (intr->next == first)
-			done++;
-	}
-	if (intr == NULL) {
-		cmn_err(CE_WARN, "pcmcia_mfc_intr: bad MFC handler list");
-	}
-	if (sockp->ls_inthandlers)
-		sockp->ls_inthandlers = sockp->ls_inthandlers->next;
-
-	mutex_exit(&sockp->ls_ilock);
-	return (result ? DDI_INTR_CLAIMED : DDI_INTR_UNCLAIMED);
-}
-
-/*
- * pcmcia_power(dip)
- *	control power for nexus and children
- */
-int
-pcmcia_power(dev_info_t *dip, int component, int level)
-{
-#if 0
-	anp_t *anp = (anp_t *)ddi_get_driver_private(dip);
-	int i;
-	/*
-	 * for now, we only have one component.  Should there be one per-socket?
-	 * the level is only one (power on or off)
-	 */
-	if (component != 0 || level > 1)
-		return (DDI_FAILURE);
-
-	for (i = 0; i < pcic->pc_numsockets; i++) {
-		if (pcic->pc_callback)
-			PC_CALLBACK(dip, pcic->pc_cb_arg,
-			    (level == 0) ? PCE_PM_SUSPEND :
-			    PCE_PM_RESUME,
-			    i);
-	}
-#else
-	cmn_err(CE_WARN, "pcmcia_power: component=%d, level=%d for %s",
-	    component, level, ddi_get_name_addr(dip));
-	return (DDI_FAILURE);
-#endif
-}
-
-void
-pcmcia_begin_resume(dev_info_t *dip)
-{
-	int i;
-	struct pcmcia_adapter *adapt = NULL;
-	for (i = 0; i < pcmcia_num_adapters; i++) {
-		if (pcmcia_adapters[i]->pca_dip == dip) {
-			adapt = pcmcia_adapters[i];
-			break;
-		}
-	}
-	if (adapt == NULL)
-		return;
-
-	for (i = 0; i < adapt->pca_numsockets; i++) {
-		int s;
-		s = adapt->pca_first_socket + i;
-		if (pcmcia_sockets[s]->ls_flags & PCS_SUSPENDED) {
-			if (pcmcia_sockets[s]->ls_flags &
-			    (1 << PCE_PM_RESUME)) {
-				(void) cs_event(PCE_PM_RESUME, s, 0);
-				pcm_event_manager(PCE_PM_RESUME, s, NULL);
-			}
-			(void) cs_event(PCE_CARD_REMOVAL, s, 0);
-			pcm_event_manager(PCE_CARD_REMOVAL, s, NULL);
-		}
-	}
-}
-
-/*
- * mark a cardbus card as "suspended" in the pcmcia module
- */
-void
-pcmcia_cb_suspended(int socket)
-{
-	mutex_enter(&pcmcia_global_lock);
-	pcmcia_sockets[socket]->ls_flags |= PCS_SUSPENDED;
-	mutex_exit(&pcmcia_global_lock);
-
-}
-
-/*
- * mark a cardbus card as "resumed" in the pcmcia module
- */
-void
-pcmcia_cb_resumed(int socket)
-{
-	if (pcmcia_sockets[socket]->ls_flags & PCS_SUSPENDED) {
-		mutex_enter(&pcmcia_global_lock);
-		pcmcia_sockets[socket]->ls_flags &= ~PCS_SUSPENDED;
-		cv_broadcast(&pcmcia_condvar);
-		mutex_exit(&pcmcia_global_lock);
-#ifdef PCMCIA_DEBUG
-		if (pcmcia_debug) {
-			cmn_err(CE_NOTE, "pcmcia_cb_resume RESUMED");
-		}
-#endif
-	}
-
-}
-
-void
-pcmcia_wait_insert(dev_info_t *dip)
-{
-	int i, f, tries, done;
-	struct pcmcia_adapter *adapt = NULL;
-	anp_t *nexus;
-
-	for (i = 0; i < pcmcia_num_adapters; i++) {
-		if (pcmcia_adapters[i]->pca_dip == dip) {
-			adapt = pcmcia_adapters[i];
-			break;
-		}
-	}
-	if (adapt == NULL)
-		return;
-
-	for (tries = adapt->pca_numsockets * 10; tries > 0; tries--) {
-		done = 1;
-		mutex_enter(&pcmcia_global_lock);
-		for (i = 0; i < adapt->pca_numsockets; i++) {
-			int s;
-			s = adapt->pca_first_socket + i;
-			for (f = 0; f < PCMCIA_MAX_FUNCTIONS; f++)
-				if (pcmcia_sockets[s] &&
-				    pcmcia_sockets[s]->ls_flags &
-				    PCS_SUSPENDED) {
-
-#ifdef PCMCIA_DEBUG
-					if (pcmcia_debug) {
-						cmn_err(CE_NOTE,
-						    "pcmcia_wait_insert: "
-						    "socket in SUSPENDED "
-						    "state");
-					}
-#endif
-					done = 0;
-					break;
-				}
-		}
-		if (!done) {
-			(void) cv_reltimedwait(&pcmcia_condvar,
-			    &pcmcia_global_lock, drv_usectohz(100000),
-			    TR_CLOCK_TICK);
-		} else {
-			tries = 0;
-		}
-		mutex_exit(&pcmcia_global_lock);
-	}
-
-	if (tries == 0) {
-		cmn_err(CE_NOTE, "pcmcia_wait_insert timed out");
-	}
-
-	nexus = (anp_t *)ddi_get_driver_private(dip);
-	pcmcia_find_cards(nexus);
-}
-
-int
-pcmcia_map_reg(dev_info_t *pdip, dev_info_t *dip, ra_return_t *ra,
-		uint32_t state, caddr_t *base,
-		ddi_acc_handle_t *handle, ddi_device_acc_attr_t *attrib,
-		uint32_t req_base)
-{
-	struct pcmcia_parent_private *ppd;
-	int rnum = 0, type = PCMCIA_MAP_MEM;
-	ddi_map_req_t mr;
-	ddi_acc_hdl_t *hp;
-	int result;
-	struct regspec *reg;
-	ddi_device_acc_attr_t attr;
-
-	if (dip != NULL) {
-		ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-		if (ppd == NULL)
-			return (DDI_FAILURE);
-		for (rnum = 1; rnum < ppd->ppd_nreg; rnum++) {
-			struct pcm_regs *p;
-			p = &ppd->ppd_reg[rnum];
-			if (state & WS_IO) {
-				/* need I/O */
-				type = PCMCIA_MAP_IO;
-				/*
-				 * We want to find an IO regspec. When we
-				 *	find one, it either has to match
-				 *	the caller's requested base address
-				 *	or it has to be relocatable.
-				 * We match on the requested base address
-				 *	rather than the allocated base
-				 *	address so that we handle the case
-				 *	of adapters that have IO window base
-				 *	relocation registers.
-				 */
-				if ((p->phys_hi &
-				    PC_REG_SPACE(PC_REG_SPACE_IO)) &&
-				    ((req_base == p->phys_lo) ||
-				    !(p->phys_hi & PC_REG_RELOC(1))))
-					break;
-			} else {
-				/* need memory */
-				type = PCMCIA_MAP_MEM;
-				if (p->phys_hi &
-				    PC_REG_SPACE(PC_REG_SPACE_MEMORY|
-				    PC_REG_SPACE_ATTRIBUTE))
-					break;
-			}
-		}
-		if (rnum >= ppd->ppd_nreg)
-			return (DDI_FAILURE);
-	} else if (state & WS_IO) {
-		return (DDI_FAILURE);
-	}
-
-	reg = kmem_zalloc(sizeof (pci_regspec_t), KM_SLEEP);
-	reg = pcmcia_cons_regspec(pdip, type, (uchar_t *)reg, ra);
-
-	if (attrib == NULL ||
-	    attrib->devacc_attr_version != DDI_DEVICE_ATTR_V0) {
-		attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
-		attr.devacc_attr_endian_flags = DDI_NEVERSWAP_ACC;
-		attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
-	} else {
-		attr = *attrib;
-	}
-	/*
-	 * Allocate and initialize the common elements of data access handle.
-	 */
-	*handle = impl_acc_hdl_alloc(KM_SLEEP, NULL);
-	hp = impl_acc_hdl_get(*handle);
-	hp->ah_vers = VERS_ACCHDL;
-	hp->ah_dip = dip != NULL ? dip : pdip;
-	hp->ah_rnumber = rnum;
-	hp->ah_offset = 0;
-	hp->ah_len = ra->ra_len;
-	hp->ah_acc = attr;
-
-	/*
-	 * Set up the mapping request and call to parent.
-	 */
-	mr.map_op = DDI_MO_MAP_LOCKED;
-	mr.map_type = DDI_MT_REGSPEC;
-	mr.map_obj.rp = reg;
-	mr.map_prot = PROT_READ | PROT_WRITE;
-	mr.map_flags = DDI_MF_KERNEL_MAPPING;
-	mr.map_handlep = hp;
-	mr.map_vers = DDI_MAP_VERSION;
-
-	result = ddi_map(pdip, &mr, 0, ra->ra_len, base);
-	if (result != DDI_SUCCESS) {
-		impl_acc_hdl_free(*handle);
-		*handle = (ddi_acc_handle_t)NULL;
-	} else {
-		hp->ah_addr = *base;
-		if (mr.map_op == DDI_MO_UNMAP)
-			ra = NULL;
-		if (dip != NULL)
-			pcmcia_set_assigned(dip, rnum, ra);
-	}
-
-	kmem_free(reg, sizeof (pci_regspec_t));
-
-	return (result);
-}
-
-struct pcmcia_adapter *
-pcmcia_get_adapter(dev_info_t *dip)
-{
-	int i;
-
-	for (i = 0; i < pcmcia_num_adapters; i++) {
-		if (pcmcia_adapters[i] &&
-		    pcmcia_adapters[i]->pca_dip == dip) {
-			return (pcmcia_adapters[i]);
-		}
-	}
-	return (NULL);
-}
-
-
-void
-pcmcia_set_assigned(dev_info_t *dip, int rnum, ra_return_t *ret)
-{
-	struct pcmcia_parent_private *ppd;
-	struct pcm_regs *reg, *assign;
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(dip);
-	if (ppd) {
-		reg = &ppd->ppd_reg[rnum];
-		assign = &ppd->ppd_assigned[rnum];
-		if (ret) {
-			if (assign->phys_hi == 0) {
-				assign->phys_hi = reg->phys_hi;
-				assign->phys_lo = ret->ra_addr_lo;
-				assign->phys_len = ret->ra_len;
-			} else if (assign->phys_lo != ret->ra_addr_lo) {
-#ifdef PCMCIA_DEBUG
-				cmn_err(CE_WARN, "pcmcia: bad address:"
-				    "%s=<%x,%x>",
-				    ddi_get_name_addr(dip),
-				    ret->ra_addr_lo, assign->phys_lo);
-#else
-				cmn_err(CE_WARN, "!pcmcia: bad address:"
-				    "%s=<%x,%x>",
-				    ddi_get_name_addr(dip),
-				    ret->ra_addr_lo, (int)assign->phys_lo);
-#endif
-			}
-			assign->phys_hi = PC_INCR_REFCNT(assign->phys_hi);
-		} else {
-			int i;
-			assign->phys_hi = PC_DECR_REFCNT(assign->phys_hi);
-			i = PC_GET_REG_REFCNT(assign->phys_hi);
-			if (i == 0) {
-				assign->phys_hi = 0;
-				assign->phys_lo = 0;
-				assign->phys_len = 0;
-			}
-		}
-	}
-}
-
-int
-pcmcia_alloc_mem(dev_info_t *dip, ndi_ra_request_t *req, ra_return_t *ret,
-		dev_info_t **res_dip)
-{
-	return (pcmcia_ra_alloc(dip, req, ret, NDI_RA_TYPE_MEM, res_dip));
-}
-
-int
-pcmcia_alloc_io(dev_info_t *dip, ndi_ra_request_t *req, ra_return_t *ret,
-		dev_info_t **res_dip)
-{
-	return (pcmcia_ra_alloc(dip, req, ret, NDI_RA_TYPE_IO, res_dip));
-}
-
-static boolean_t
-is_subtractv(dev_info_t *dip)
-{
-	uint_t  class;
-
-	if (dip == NULL)
-		return (B_FALSE);
-	class = ddi_getprop(DDI_DEV_T_ANY, dip,
-	    DDI_PROP_CANSLEEP|DDI_PROP_DONTPASS,
-	    "class-code", 0xff);
-	if (class == PPB_SUBTRACTIVE) {
-		return (B_TRUE);
-	}
-	return (B_FALSE);
-}
-
-/*
- * pcmcia_pci_alloc()
- * 	allocate mem or I/O resource from the ancestor of the cardbus bridge.
- * 	First start from the parent node. If the parent is a subtractive
- * 	decode bridge and it does not have the requested resource, go up the
- * 	device tree to find the resource.
- *
- * 	dip		the parent node of the cardbus bridge
- *
- * 	res_dip		returns a pointer to the node from which the
- * 			resource is obtained. *res_dip could point to
- * 			the parent or a higher level ancestor. *res_dip
- * 			should be saved by the caller and later passed
- * 			to pcmcia_ra_free();
- */
-int
-pcmcia_pci_alloc(dev_info_t *dip, ndi_ra_request_t *req, ra_return_t *ret,
-		char *type, dev_info_t **res_dip)
-{
-	uint64_t base = 0;
-	uint64_t len = 0;
-
-	if ((ndi_ra_alloc(dip, req, &base, &len, type, NDI_RA_PASS)
-	    == NDI_FAILURE) ||
-	    ((base >> 32) != 0)) {
-		if (is_subtractv(dip)) {
-			return (pcmcia_pci_alloc(ddi_get_parent(dip),
-			    req, ret, type, res_dip));
-
-		} else {
-			ret->ra_addr_hi = 0;
-			ret->ra_addr_lo = 0;
-			ret->ra_len = 0;
-			return (DDI_FAILURE);
-		}
-	}
-	ret->ra_addr_lo =  base & 0xffffffff;
-	ret->ra_addr_hi = 0;
-	ret->ra_len = len;
-	*res_dip = dip;
-	return (DDI_SUCCESS);
-}
-
-int
-pcmcia_ra_alloc(dev_info_t *dip, ndi_ra_request_t *req, ra_return_t *ret,
-		char *type, dev_info_t **res_dip)
-{
-	uint64_t base = 0;
-	uint64_t len = 0;
-
-	/*
-	 * Allocate space from busra resource list
-	 * should not return an address > 32 bits
-	 */
-
-	if ((ndi_ra_alloc(dip, req, &base, &len, type, NDI_RA_PASS)
-	    == NDI_FAILURE) ||
-	    ((base >> 32) != 0)) {
-		return (pcmcia_pci_alloc(ddi_get_parent(dip), req, ret,
-		    type, res_dip));
-	} else {
-		ret->ra_addr_lo =  base & 0xffffffff;
-		ret->ra_addr_hi = 0;
-		ret->ra_len = len;
-		*res_dip = dip;
-		return (DDI_SUCCESS);
-	}
-}
-
-int
-pcmcia_free_mem(dev_info_t *dip, ra_return_t *ret)
-{
-	return (pcmcia_ra_free(dip, ret, NDI_RA_TYPE_MEM));
-}
-
-int
-pcmcia_free_io(dev_info_t *dip, ra_return_t *ret)
-{
-	return (pcmcia_ra_free(dip, ret, NDI_RA_TYPE_IO));
-}
-
-int
-pcmcia_ra_free(dev_info_t *dip, ra_return_t *ret, char *type)
-{
-	if (dip == (dev_info_t *)-1)
-		return (DDI_FAILURE);
-	if (ndi_ra_free(dip, (uint64_t)ret->ra_addr_lo, (uint64_t)ret->ra_len,
-	    type, NDI_RA_PASS) == NDI_SUCCESS) {
-		return (DDI_SUCCESS);
-	} else {
-		return (DDI_FAILURE);
-	}
-}
-
-
-/*
- * when the low level device configuration does resource assignment
- * (devconf) then free the allocated resources so we can reassign them
- * later.  Walk the child list to get them.
- */
-void
-pcmcia_free_resources(dev_info_t *self)
-{
-	struct regspec *assigned;
-	int len;
-	dev_info_t *dip;
-	int circ;
-
-	ndi_devi_enter(self, &circ);
-	/* do searches in compatible property order */
-	for (dip = (dev_info_t *)DEVI(self)->devi_child;
-	    dip != NULL;
-	    dip = (dev_info_t *)DEVI(dip)->devi_sibling) {
-		len = 0;
-		if (ddi_getlongprop(DDI_DEV_T_ANY, dip,
-		    DDI_PROP_DONTPASS|DDI_PROP_CANSLEEP,
-		    "assigned-addresses",
-		    (caddr_t)&assigned,
-		    &len) == DDI_PROP_SUCCESS) {
-			/*
-			 * if there are assigned resources at this point,
-			 * then the OBP or devconf have assigned them and
-			 * they need to be freed.
-			 */
-			kmem_free(assigned, len);
-		}
-	}
-	ndi_devi_exit(self, circ);
-}
-
-/*
- * this is the equivalent of pcm_get_intr using ra_allocs.
- * returns -1 if failed, otherwise returns the allocated irq.
- * The input request, if less than zero it means not a specific
- * irq requested. If larger then 0 then we are requesting that specific
- * irq
- */
-int
-pcmcia_get_intr(dev_info_t *dip, int request)
-{
-	ndi_ra_request_t req;
-	uint64_t base;
-	uint64_t len;
-	int err;
-
-	bzero(&req, sizeof (req));
-	base = 0;
-	len = 1;
-	if (request >= 0) {
-		req.ra_flags = NDI_RA_ALLOC_SPECIFIED;
-		req.ra_len = 1;
-		req.ra_addr = (uint64_t)request;
-	}
-
-	req.ra_boundbase = 0;
-	req.ra_boundlen = 0xffffffffUL;
-	req.ra_flags |= NDI_RA_ALLOC_BOUNDED;
-
-	err = ndi_ra_alloc(dip, &req, &base, &len, NDI_RA_TYPE_INTR,
-	    NDI_RA_PASS);
-
-	if (err == NDI_FAILURE) {
-		return (-1);
-	} else {
-		return ((int)base);
-	}
-}
-
-
-int
-pcmcia_return_intr(dev_info_t *dip, int request)
-{
-	if ((ndi_ra_free(dip, (uint64_t)request, 1, NDI_RA_TYPE_INTR,
-	    NDI_RA_PASS)) == NDI_SUCCESS) {
-		return (0);
-	} else
-		return (-1);
-
-}
-
-#ifdef sparc
-
-int
-pcmcia_add_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-
-	struct pcmcia_parent_private *ppd;
-	pcmcia_logical_socket_t *sockp;
-	int socket, ret;
-	struct pcmcia_adapter *adapt;
-	set_irq_handler_t handler;
-	struct intrspec *pispec;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT,
-		    "pcmcia_add_intr_impl() entered "
-		    "dip=%p rdip=%p hdlp=%p \n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-	}
-#endif
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	socket = ppd->ppd_socket;
-	sockp = pcmcia_sockets[socket];
-	adapt = sockp->ls_adapter;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_add_intr_impl()"
-		    " ppd_flags=0X%x PPD_CARD_MULTI=0X%x\n"
-		    " ppd_intrspec=%p ls_inthandlers=%p\n",
-		    ppd->ppd_flags, PPD_CARD_MULTI,
-		    (void *) ppd->ppd_intrspec,
-		    (void *)sockp->ls_inthandlers);
-	}
-#endif
-
-	/*
-	 * calculate IPL level when we support multiple levels
-	 */
-	pispec = ppd->ppd_intrspec;
-	if (pispec == NULL) {
-		sockp->ls_error = BAD_IRQ;
-		return (DDI_FAILURE);
-	}
-
-	handler.socket = sockp->ls_socket;
-	handler.irq = 0;	/* default case */
-	handler.handler = (f_tt *)hdlp->ih_cb_func;
-	handler.arg1 = hdlp->ih_cb_arg1;
-	handler.arg2 = hdlp->ih_cb_arg2;
-	handler.handler_id = (uint32_t)(uintptr_t)rdip;
-
-	/*
-	 * check if multifunction and do the right thing
-	 * we put an intercept in between the mfc handler and
-	 * us so we can catch and process.  We might be able
-	 * to optimize this depending on the card features
-	 * (a future option).
-	 */
-	if (ppd->ppd_flags & PPD_CARD_MULTI) {
-		inthandler_t *intr;
-		/*
-		 * note that the first function is a special
-		 * case since it sets things up.  We fall through
-		 * to the lower code and get the hardware set up.
-		 * subsequent times we just lock the list and insert
-		 * the handler and all is well.
-		 */
-		intr = kmem_zalloc(sizeof (inthandler_t), KM_NOSLEEP);
-		if (intr == NULL) {
-			sockp->ls_error = BAD_IRQ;
-			return (DDI_FAILURE);
-		}
-		intr->intr = hdlp->ih_cb_func;
-		intr->handler_id = (uint_t)(uintptr_t)rdip;
-		intr->arg1 = hdlp->ih_cb_arg1;
-		intr->arg2 = hdlp->ih_cb_arg2;
-		intr->socket = socket;
-
-		mutex_enter(&sockp->ls_ilock);
-		if (sockp->ls_inthandlers == NULL) {
-			intr->next = intr->prev = intr;
-			sockp->ls_inthandlers = intr;
-			sockp->ls_mfintr_dip = rdip;
-			mutex_exit(&sockp->ls_ilock);
-
-			/*
-			 * replace first function handler with
-			 * the mfc handler
-			 */
-			handler.handler =  (f_tt *)pcmcia_mfc_intr;
-			handler.arg1 = (caddr_t)sockp;
-			handler.arg2 = NULL;
-		} else {
-			insque(intr, sockp->ls_inthandlers);
-			mutex_exit(&sockp->ls_ilock);
-
-			pispec->intrspec_vec = sockp->ls_intr_vec;
-			pispec->intrspec_pri = sockp->ls_intr_pri;
-			hdlp->ih_pri = sockp->ls_intr_pri;
-
-			return (DDI_SUCCESS);
-		}
-	}
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_add_intr_impl() let adapter do it\n");
-	}
-#endif
-	pispec->intrspec_func = (uint32_t (*)())handler.handler;
-
-	/* set default IPL then check for override */
-
-	pispec->intrspec_pri = sockp->ls_intr_pri;
-	hdlp->ih_pri = pispec->intrspec_pri;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_add_intr_impl() socket=%d irq=%d"
-		    " handler_id=0X%x handler=%p arg1=%p arg2=%p\n",
-		    handler.socket, handler.irq,
-		    handler.handler_id, (void *)handler.handler, handler.arg1,
-		    handler.arg2);
-	}
-#endif
-
-	if ((ret = SET_IRQ(sockp->ls_if, adapt->pca_dip, &handler)) !=
-	    SUCCESS) {
-		sockp->ls_error = ret;
-		return (DDI_FAILURE);
-	}
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_add_intr_impl()"
-		    " iblk_cookie=%p idev_cookie=%p\n"
-		    " ls_flags=0X%x PCS_COOKIES_VALID=0X%x\n",
-		    (void *)handler.iblk_cookie,
-		    (void *)handler.idev_cookie,
-		    sockp->ls_flags, PCS_COOKIES_VALID);
-	}
-#endif
-
-	if (!(sockp->ls_flags & PCS_COOKIES_VALID)) {
-		hdlp->ih_pri = (uint_t)(uintptr_t)*handler.iblk_cookie;
-		sockp->ls_iblk = *handler.iblk_cookie;
-		sockp->ls_idev = *handler.idev_cookie;
-		sockp->ls_flags |= PCS_COOKIES_VALID;
-	}
-
-	return (DDI_SUCCESS);
-}
-
-void
-pcmcia_remove_intr_impl(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-
-	struct pcmcia_parent_private *ppd;
-	pcmcia_logical_socket_t *sockp;
-	clear_irq_handler_t handler;
-	struct intrspec *pispec;
-	int socket;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_remove_intr_impl() entered"
-		    " dip=%p rdip=%p hdlp=%p\n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-	}
-#endif
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	socket = ppd->ppd_socket;
-	sockp = pcmcia_sockets[socket];
-	pispec = ppd->ppd_intrspec;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_remove_intr_impl()"
-		    " ls_inthandlers=%p ls_intrspec=%p\n",
-		    (void *)sockp->ls_inthandlers,
-		    (void *)&sockp->ls_intrspec);
-	}
-#endif
-
-	/* first handle the multifunction case since it is simple */
-	mutex_enter(&sockp->ls_ilock);
-	if (sockp->ls_inthandlers != NULL) {
-		/* we must be MFC */
-		inthandler_t *intr;
-		int remhandler = 0;
-		intr = sockp->ls_inthandlers;
-
-		/* Check if there is only one handler left */
-		if ((intr->next == intr) && (intr->prev == intr)) {
-			if (intr->handler_id == (unsigned)(uintptr_t)rdip) {
-				sockp->ls_inthandlers = NULL;
-				remhandler++;
-				kmem_free(intr, sizeof (inthandler_t));
-			}
-		} else {
-			inthandler_t *first;
-			int done;
-
-			for (done = 0, first = intr; !done; intr = intr->next) {
-				if (intr->next == first)
-					done++;
-				if (intr->handler_id ==
-				    (unsigned)(uintptr_t)rdip) {
-					done++;
-
-					/*
-					 * If we're about to remove the
-					 *	handler at the head of
-					 *	the list, make the next
-					 *	handler in line the head.
-					 */
-					if (sockp->ls_inthandlers == intr)
-						sockp->ls_inthandlers =
-						    intr->next;
-
-					remque(intr);
-					kmem_free(intr, sizeof (inthandler_t));
-					break;
-				} /* handler_id */
-			} /* for */
-		} /* intr->next */
-
-		if (!remhandler) {
-			mutex_exit(&sockp->ls_ilock);
-			return;
-		}
-
-		/* need to get the dip that was used to add the handler */
-		rdip = sockp->ls_mfintr_dip;
-	}
-
-	mutex_exit(&sockp->ls_ilock);
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_remove_intr_impl()"
-		    " pispec=%p rdip=%p\n",
-		    (void *)pispec, (void *)rdip);
-	}
-#endif
-
-	handler.socket = sockp->ls_socket;
-	handler.handler_id = (uint32_t)(uintptr_t)rdip;
-	handler.handler = (f_tt *)pispec->intrspec_func;
-	CLEAR_IRQ(sockp->ls_if, dip, &handler);
-}
-
-
-/* Consolidated interrupt processing interface */
-/*ARGSUSED*/
-int
-pcmcia_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
-    ddi_intr_handle_impl_t *hdlp, void *result)
-{
-	int	ret = DDI_SUCCESS;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug) {
-		cmn_err(CE_CONT, "pcmcia_intr_ops() intr_op=%d\n",
-		    (int)intr_op);
-	}
-#endif
-
-	switch (intr_op) {
-	case DDI_INTROP_GETCAP:
-		*(int *)result = DDI_INTR_FLAG_LEVEL;
-		break;
-	case DDI_INTROP_SETCAP:
-		ret = DDI_ENOTSUP;
-		break;
-	case DDI_INTROP_ALLOC:
-		*(int *)result = hdlp->ih_scratch1;
-		break;
-	case DDI_INTROP_FREE:
-		break;
-	case DDI_INTROP_GETPRI:
-		if (pcmcia_add_intr_impl(dip, rdip, hdlp) != DDI_SUCCESS)
-			return (DDI_FAILURE);
-		*(int *)result = hdlp->ih_pri;
-		pcmcia_remove_intr_impl(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_SETPRI:
-		break;
-	case DDI_INTROP_ADDISR:
-		ret = pcmcia_add_intr_impl(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_REMISR:
-		pcmcia_remove_intr_impl(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_ENABLE:
-	case DDI_INTROP_DISABLE:
-		break;
-	case DDI_INTROP_NINTRS:
-	case DDI_INTROP_NAVAIL:
-		*(int *)result = i_ddi_get_intx_nintrs(rdip);
-		break;
-	case DDI_INTROP_SUPPORTED_TYPES:
-		/* PCI nexus driver supports only fixed interrupts */
-		*(int *)result = i_ddi_get_intx_nintrs(rdip) ?
-		    DDI_INTR_TYPE_FIXED : 0;
-		break;
-	default:
-		ret = DDI_ENOTSUP;
-		break;
-	}
-
-	return (ret);
-}
-
-#elif defined(__x86) || defined(__amd64)
-
-static struct intrspec	*pcmcia_intr_get_ispec(dev_info_t *, int,
-			    pcmcia_logical_socket_t **);
-static struct intrspec	*pcmcia_intr_add_isr(dev_info_t *, dev_info_t *,
-			    ddi_intr_handle_impl_t *);
-static int		pcmcia_intr_enable_isr(dev_info_t *, dev_info_t *,
-			    ddi_intr_handle_impl_t *);
-static void		pcmcia_intr_remove_isr(dev_info_t *, dev_info_t *,
-			    ddi_intr_handle_impl_t *);
-static void		pcmcia_intr_disable_isr(dev_info_t *, dev_info_t *,
-			    ddi_intr_handle_impl_t *);
-
-/*
- * pcmcia_intr_get_ispec:
- *	This is mostly copied from older 'pcmcia_get_intrspec' function
- */
-static struct intrspec *
-pcmcia_intr_get_ispec(dev_info_t *rdip, int inum,
-    pcmcia_logical_socket_t **sockp)
-{
-	int				socket;
-	struct intrspec			*intrspec;
-	struct pcmcia_parent_private	*ppd;
-
-	if ((int)inum > 0 || (ddi_getprop(DDI_DEV_T_ANY, rdip,
-	    DDI_PROP_DONTPASS, "interrupts", -1) < 0))
-		return (NULL);
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	if (ppd == NULL || ppd->ppd_intrspec == NULL)
-		return (NULL);
-
-	if ((socket = ppd->ppd_socket) < 0)
-		return (NULL);
-
-	if ((*sockp = pcmcia_sockets[socket]) == NULL)
-		return (NULL);
-
-	intrspec = ppd->ppd_intrspec;
-	if (intrspec->intrspec_vec == 0 && (*sockp)->ls_intr_vec != 0)
-		intrspec->intrspec_vec = (*sockp)->ls_intr_vec;
-
-	return (intrspec);
-}
-
-static struct intrspec *
-pcmcia_intr_add_isr(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-	int				socket;
-	struct intrspec			*ispecp;
-	struct pcmcia_adapter		*adapt;
-	pcmcia_logical_socket_t		*sockp;
-	struct pcmcia_parent_private	*ppd;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_add_isr: "
-		    "dip=0x%p rdip=0x%p hdlp=0x%p\n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-#endif	/* PCMCIA_DEBUG */
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	socket = ppd->ppd_socket;
-	sockp = pcmcia_sockets[socket];
-	adapt = sockp->ls_adapter;
-
-	ispecp = ppd->ppd_intrspec;
-	if (ispecp == NULL) {
-		sockp->ls_error = BAD_IRQ;
-		return (ispecp);
-	}
-
-	/*
-	 * check if multifunction and do the right thing
-	 * we put an intercept in between the mfc handler and us so we can
-	 * catch and process. We might be able to optimize this depending
-	 * on the card features (a future option).
-	 */
-	if (ppd->ppd_flags & PPD_CARD_MULTI &&
-	    hdlp->ih_cb_func != pcmcia_mfc_intr) {
-		inthandler_t *intr;
-
-		/*
-		 * note that the first function is a special case since it
-		 * sets things up.  We fall through to the lower code and
-		 * get the hardware set up. Subsequent times we just lock
-		 * the list and insert the handler and all is well.
-		 */
-		intr = kmem_zalloc(sizeof (inthandler_t), KM_NOSLEEP);
-		if (intr == NULL) {
-			sockp->ls_error = BAD_IRQ;
-			return (NULL);
-		}
-
-		intr->intr = (uint32_t (*)())hdlp->ih_cb_func;
-		intr->handler_id = (uint32_t)(uintptr_t)rdip;
-		intr->arg1 = hdlp->ih_cb_arg1;
-		intr->arg2 = hdlp->ih_cb_arg2;
-		intr->socket = socket;
-		mutex_enter(&sockp->ls_ilock);
-		if (sockp->ls_inthandlers == NULL) {
-			intr->next = intr->prev = intr;
-			sockp->ls_inthandlers = intr;
-			sockp->ls_mfintr_dip = rdip;
-		} else {
-			insque(intr, sockp->ls_inthandlers);
-		}
-		mutex_exit(&sockp->ls_ilock);
-		return (ispecp);
-	}
-
-	/*
-	 * Do we need to allocate an IRQ at this point or not?
-	 */
-	if (adapt->pca_flags & PCA_RES_NEED_IRQ) {
-		int i, irq;
-
-		/*
-		 * this adapter needs IRQ allocations
-		 * this is only necessary if it is the first function on the
-		 * card being setup. The socket will keep the allocation info
-		 */
-		/* all functions use same intrspec except mfc handler */
-		if (hdlp->ih_cb_func == pcmcia_mfc_intr) {
-			/*
-			 * We treat this special in order to allow things to
-			 * work properly for MFC cards. The intrspec for the
-			 * mfc dispatcher is intercepted and taken from the
-			 * logical socket in order to not be trying to
-			 * multiplex the meaning when ENABLE is called.
-			 */
-			ispecp = &sockp->ls_intrspec;
-			((ihdl_plat_t *)hdlp->ih_private)->ip_ispecp = ispecp;
-		}
-
-		if (adapt->pca_flags & PCA_IRQ_ISA) {
-			for (irq = -1, i = 1; irq == -1 && i < 16; i++) {
-				/* find available and usable IRQ level */
-				if (adapt->pca_avail_intr & (1 << i))
-					irq = pcmcia_get_intr(dip, i);
-			}
-		}
-		if (irq < 0) {
-			sockp->ls_error = NO_RESOURCE;
-			return (NULL);
-		}
-		hdlp->ih_vector = sockp->ls_intr_vec = irq;
-
-
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "allocated irq=%x\n", irq);
-#endif	/* PCMCIA_DEBUG */
-
-		ispecp->intrspec_vec = sockp->ls_intr_vec;
-		ispecp->intrspec_pri = sockp->ls_intr_pri;
-		return (ispecp);
-	}
-
-	if (ispecp->intrspec_func != NULL)
-		ispecp->intrspec_func = hdlp->ih_cb_func;
-
-	/* set default IPL then check for override */
-	ispecp->intrspec_pri = sockp->ls_intr_pri;
-	return (ispecp);
-}
-
-
-static int
-pcmcia_intr_enable_isr(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-	int				socket, ret;
-	int				irq = 0;	/* default case */
-	dev_info_t			*parent = ddi_root_node();
-	struct intrspec			*ispecp;
-	set_irq_handler_t		handler;
-	struct pcmcia_adapter		*adapt;
-	pcmcia_logical_socket_t		*sockp;
-	struct pcmcia_parent_private	*ppd;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_enable_isr: "
-		    "dip=0x%p rdip=0x%p hdlp=0x%p\n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-#endif	/* PCMCIA_DEBUG */
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	socket = ppd->ppd_socket;
-	sockp = pcmcia_sockets[socket];
-	adapt = sockp->ls_adapter;
-
-	ispecp = ppd->ppd_intrspec;
-	ASSERT(ispecp);
-
-	mutex_enter(&sockp->ls_ilock);
-	if ((sockp->ls_inthandlers != NULL) &&
-	    ((ihdl_plat_t *)hdlp->ih_private)->ip_ispecp !=
-	    &sockp->ls_intrspec) {
-		inthandler_t *intr = sockp->ls_inthandlers;
-
-		ASSERT(ppd->ppd_flags & PPD_CARD_MULTI);
-
-		/* Only one handler. So, call ddi_add_intr on it */
-		if ((intr->next == intr) && (intr->prev == intr)) {
-			hdlp->ih_cb_func = pcmcia_mfc_intr;
-			hdlp->ih_cb_arg1 = (caddr_t)sockp;
-			hdlp->ih_cb_arg2 = NULL;
-
-			ret = (*(DEVI(parent)->devi_ops->devo_bus_ops->
-			    bus_intr_op))(parent, rdip, DDI_INTROP_ENABLE,
-			    hdlp, NULL);
-
-			if (ret == DDI_FAILURE) {
-				sockp->ls_inthandlers = NULL;
-				kmem_free(intr, sizeof (inthandler_t));
-				sockp->ls_error = BAD_IRQ;
-				mutex_exit(&sockp->ls_ilock);
-				return (ret);
-			}
-		}
-		mutex_exit(&sockp->ls_ilock);
-		hdlp->ih_vector = ispecp->intrspec_vec = sockp->ls_intr_vec;
-		hdlp->ih_pri = sockp->ls_intr_pri;
-		sockp->ls_iblk = (ddi_iblock_cookie_t)(uintptr_t)
-		    sockp->ls_intr_pri;
-		sockp->ls_idev.idev_vector = (ushort_t)hdlp->ih_vector;
-		sockp->ls_idev.idev_priority = (ushort_t)sockp->ls_intr_pri;
-		return (DDI_SUCCESS);
-	}
-	mutex_exit(&sockp->ls_ilock);
-
-	if (adapt->pca_flags & PCA_RES_NEED_IRQ) {
-		if (hdlp->ih_cb_func == pcmcia_mfc_intr)
-			ispecp = (struct intrspec *)&sockp->ls_intrspec;
-
-		/* XXX: remove it later as this is done in _add_isr as well */
-		ispecp->intrspec_vec = sockp->ls_intr_vec;
-		ispecp->intrspec_pri = sockp->ls_intr_pri;
-
-		/* Enable interrupts */
-		ret = (*(DEVI(parent)->devi_ops->devo_bus_ops->bus_intr_op))(
-		    parent, rdip, DDI_INTROP_ENABLE, hdlp, NULL);
-
-		sockp->ls_iblk = (ddi_iblock_cookie_t)(uintptr_t)
-		    sockp->ls_intr_pri;
-		sockp->ls_idev.idev_vector = (ushort_t)sockp->ls_intr_vec;
-		sockp->ls_idev.idev_priority = (ushort_t)sockp->ls_intr_pri;
-
-		if (ret != DDI_SUCCESS)
-			sockp->ls_error = BAD_IRQ;
-		return (ret);
-	}
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_enable_isr; let adapter do it\n");
-#endif	/* PCMCIA_DEBUG */
-
-	handler.socket = sockp->ls_socket;
-	handler.irq = irq;
-	handler.handler = (f_tt *)hdlp->ih_cb_func;
-	handler.arg1 = hdlp->ih_cb_arg1;
-	handler.arg2 = hdlp->ih_cb_arg2;
-	handler.handler_id = (uint32_t)(uintptr_t)rdip;
-	if (ispecp->intrspec_func != NULL)
-		ispecp->intrspec_func = hdlp->ih_cb_func;
-
-	/* set default IPL then check for override */
-	ispecp->intrspec_pri = sockp->ls_intr_pri;
-
-	if ((ret = SET_IRQ(sockp->ls_if, adapt->pca_dip, &handler)) !=
-	    SUCCESS) {
-		sockp->ls_error = ret;
-		return (DDI_FAILURE);
-	}
-	ispecp->intrspec_func = hdlp->ih_cb_func;
-	if (!(sockp->ls_flags & PCS_COOKIES_VALID)) {
-		sockp->ls_iblk = *handler.iblk_cookie;
-		sockp->ls_idev = *handler.idev_cookie;
-		sockp->ls_flags |= PCS_COOKIES_VALID;
-	}
-	return (DDI_SUCCESS);
-}
-
-/* ARGSUSED */
-static void
-pcmcia_intr_remove_isr(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-	int				done, remhandler = 0;
-	inthandler_t			*intr, *first;
-	struct intrspec			*ispecp;
-	pcmcia_logical_socket_t		*sockp;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_remove_isr: "
-		    "dip=0x%p rdip=0x%p hdlp=0x%p\n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-#endif	/* PCMCIA_DEBUG */
-
-	ispecp = pcmcia_intr_get_ispec(rdip, hdlp->ih_inum, &sockp);
-	ASSERT(ispecp);
-
-	/* first handle the multifunction case since it is simple */
-	mutex_enter(&sockp->ls_ilock);
-	if (sockp->ls_inthandlers != NULL &&
-	    ((ihdl_plat_t *)hdlp->ih_private)->ip_ispecp !=
-	    &sockp->ls_intrspec) {
-
-		intr = sockp->ls_inthandlers;
-
-		/* Check if there is only one handler left */
-		if ((intr->next == intr) && (intr->prev == intr)) {
-			if (intr->handler_id == (uint32_t)(uintptr_t)rdip) {
-				sockp->ls_inthandlers = NULL;
-				remhandler++;
-				kmem_free(intr, sizeof (inthandler_t));
-			}
-
-		} else {
-			for (done = 0, first = intr; !done; intr = intr->next) {
-				if (intr->next == first)
-					done++;
-				if (intr->handler_id ==
-				    (uint32_t)(uintptr_t)rdip) {
-					done++;
-
-					/*
-					 * If we're about to remove the handler
-					 * at the head of the list, make the
-					 * next handler in line the head.
-					 */
-					if (sockp->ls_inthandlers == intr)
-						sockp->ls_inthandlers =
-						    intr->next;
-
-					remque(intr);
-					kmem_free(intr, sizeof (inthandler_t));
-					break;
-				} /* handler_id */
-			} /* end of for */
-		} /* end of if intr->next */
-
-		if (!remhandler) {
-			mutex_exit(&sockp->ls_ilock);
-			return;
-		}
-	}
-	mutex_exit(&sockp->ls_ilock);
-
-	if (sockp->ls_adapter->pca_flags & PCA_RES_NEED_IRQ) {
-		sockp->ls_intr_vec = 0;
-		ispecp->intrspec_vec = 0;
-	}
-}
-
-
-static void
-pcmcia_intr_disable_isr(dev_info_t *dip, dev_info_t *rdip,
-    ddi_intr_handle_impl_t *hdlp)
-{
-	int				socket, ret;
-	dev_info_t			*parent;
-	struct intrspec			*ispecp;
-	clear_irq_handler_t		handler;
-	struct pcmcia_adapter		*adapt;
-	pcmcia_logical_socket_t		*sockp;
-	struct pcmcia_parent_private	*ppd;
-	ihdl_plat_t			*ihdl_plat_datap =
-	    (ihdl_plat_t *)hdlp->ih_private;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_disable_isr: "
-		    "dip=0x%p rdip=0x%p hdlp=0x%p\n",
-		    (void *)dip, (void *)rdip, (void *)hdlp);
-#endif	/* PCMCIA_DEBUG */
-
-	ppd = (struct pcmcia_parent_private *)ddi_get_parent_data(rdip);
-	socket = ppd->ppd_socket;
-	sockp = pcmcia_sockets[socket];
-	adapt = sockp->ls_adapter;
-	ispecp = ppd->ppd_intrspec;
-	ASSERT(ispecp);
-
-	mutex_enter(&sockp->ls_ilock);
-	if (sockp->ls_inthandlers != NULL &&
-	    ihdl_plat_datap->ip_ispecp != &sockp->ls_intrspec) {
-		inthandler_t	*intr = sockp->ls_inthandlers;
-
-		/* Check if there is only one handler left */
-		if ((intr->next == intr) && (intr->prev == intr)) {
-			if (intr->handler_id != (uint32_t)(uintptr_t)rdip)
-				/*
-				 * need to get the dip that was
-				 * used to add the handler
-				 */
-				rdip = sockp->ls_mfintr_dip;
-				ispecp = (struct intrspec *)&sockp->ls_intrspec;
-		} else {
-			/* Don't call cleanup if list still has members */
-			mutex_exit(&sockp->ls_ilock);
-			return;
-		}
-	}
-	mutex_exit(&sockp->ls_ilock);
-
-	if (ihdl_plat_datap->ip_ispecp ==
-	    (struct intrspec *)&sockp->ls_intrspec)
-		ispecp = ihdl_plat_datap->ip_ispecp;
-
-	if (adapt->pca_flags & PCA_RES_NEED_IRQ) {
-		ret = ispecp->intrspec_vec;
-		parent = ddi_root_node();
-		ret = (*(DEVI(parent)->devi_ops->devo_bus_ops->bus_intr_op))(
-		    parent, rdip, DDI_INTROP_DISABLE, hdlp, NULL);
-		(void) pcmcia_return_intr(dip, hdlp->ih_vector);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "pcmcia_intr_disable_isr: "
-			    "INTROP_DISABLE returned %x\n", ret);
-#endif	/* PCMCIA_DEBUG */
-	} else {
-		handler.socket = sockp->ls_socket;
-		handler.handler_id = (uint32_t)(uintptr_t)rdip;
-		handler.handler = (f_tt *)ispecp->intrspec_func;
-		ret = CLEAR_IRQ(sockp->ls_if, dip, &handler);
-#if defined(PCMCIA_DEBUG)
-		if (pcmcia_debug)
-			cmn_err(CE_CONT, "pcmcia_intr_disable_isr: "
-			    "CLEAR_IRQ returned %x\n", ret);
-#endif	/* PCMCIA_DEBUG */
-	}
-}
-
-/* Consolidated interrupt processing interface */
-int
-pcmcia_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
-    ddi_intr_handle_impl_t *hdlp, void *result)
-{
-	struct intrspec		*ispecp;
-	pcmcia_logical_socket_t	*sockp;
-
-#if defined(PCMCIA_DEBUG)
-	if (pcmcia_debug)
-		cmn_err(CE_CONT, "pcmcia_intr_ops: "
-		    "dip=0x%p rdip=0x%p op=0x%x hdlp=0x%p\n",
-		    (void *)dip, (void *)rdip, intr_op, (void *)hdlp);
-#endif	/* PCMCIA_DEBUG */
-
-	switch (intr_op) {
-	case DDI_INTROP_SUPPORTED_TYPES:
-		if (ddi_get_parent_data(rdip) == NULL) {
-			*(int *)result = 0;
-			return (DDI_FAILURE);
-		}
-		*(int *)result = DDI_INTR_TYPE_FIXED;
-		break;
-	case DDI_INTROP_GETCAP:
-		*(int *)result = DDI_INTR_FLAG_LEVEL;
-		break;
-	case DDI_INTROP_NINTRS:
-	case DDI_INTROP_NAVAIL:
-		if (i_ddi_get_intx_nintrs(rdip) == 0) {
-			*(int *)result = 0;
-			return (DDI_FAILURE);
-		}
-		*(int *)result = 1;	/* for PCMCIA there is only one intr */
-		break;
-	case DDI_INTROP_ALLOC:
-		if ((ispecp = pcmcia_intr_get_ispec(rdip, hdlp->ih_inum,
-		    &sockp)) == NULL)
-			return (DDI_FAILURE);
-		*(int *)result = hdlp->ih_scratch1;
-		break;
-	case DDI_INTROP_FREE:
-		break;
-	case DDI_INTROP_GETPRI:
-		ispecp = pcmcia_intr_get_ispec(rdip, hdlp->ih_inum, &sockp);
-		if (ispecp == NULL) {
-			*(int *)result = 0;
-			return (DDI_FAILURE);
-		}
-
-		*(int *)result = ispecp->intrspec_pri = sockp->ls_intr_pri;
-		break;
-	case DDI_INTROP_SETPRI:
-		if (*(int *)result > LOCK_LEVEL)
-			return (DDI_FAILURE);
-		ispecp = pcmcia_intr_get_ispec(rdip, hdlp->ih_inum, &sockp);
-		ASSERT(ispecp);
-		ispecp->intrspec_pri = sockp->ls_intr_pri = *(int *)result;
-		break;
-	case DDI_INTROP_ADDISR:
-		if ((ispecp = pcmcia_intr_add_isr(dip, rdip, hdlp)) == NULL)
-			return (DDI_FAILURE);
-		((ihdl_plat_t *)hdlp->ih_private)->ip_ispecp = ispecp;
-		break;
-	case DDI_INTROP_REMISR:
-		pcmcia_intr_remove_isr(dip, rdip, hdlp);
-		break;
-	case DDI_INTROP_ENABLE:
-		if (pcmcia_intr_enable_isr(dip, rdip, hdlp) != DDI_SUCCESS)
-			return (DDI_FAILURE);
-		break;
-	case DDI_INTROP_DISABLE:
-		pcmcia_intr_disable_isr(dip, rdip, hdlp);
-		break;
-	default:
-		return (DDI_ENOTSUP);
-	}
-
-	return (DDI_SUCCESS);
-}
-#endif
--- old/usr/src/uts/common/pcmcia/pcs/pcs.c	2014-11-12 17:44:40.979842915 +0100
+++ /dev/null	2014-11-12 17:44:40.000000000 +0100
@@ -1,183 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-#include <sys/types.h>
-#include <sys/byteorder.h>
-#include <sys/systm.h>
-#include <sys/ddi.h>
-#include <sys/sunddi.h>
-
-int pcs_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **);
-int pcs_attach(dev_info_t *, ddi_attach_cmd_t);
-int pcs_detach(dev_info_t *, ddi_detach_cmd_t);
-dev_info_t *pcs_dip;
-
-static struct dev_ops pcs_devops = {
-	DEVO_REV,
-	0,
-	pcs_getinfo,
-	nulldev,
-	nulldev,
-	pcs_attach,
-	pcs_detach,
-	nulldev,
-	NULL,
-	NULL,
-	NULL,
-	ddi_quiesce_not_needed,		/* quiesce */
-};
-/*
- * This is the loadable module wrapper.
- */
-#include <sys/modctl.h>
-
-extern struct mod_ops mod_driverops;
-
-static struct modldrv modldrv = {
-	&mod_driverops,		/* Type of module. This one is a driver */
-	"PCMCIA Socket Driver",	/* Name of the module. */
-	&pcs_devops,		/* driver ops */
-};
-
-static struct modlinkage modlinkage = {
-	MODREV_1, (void *)&modldrv, NULL
-};
-
-struct pcs_inst {
-	dev_info_t *dip;
-} *pcs_instances;
-
-int
-_init()
-{
-	int ret;
-	if ((ret = ddi_soft_state_init((void **)&pcs_instances,
-	    sizeof (struct pcs_inst), 1)) != 0)
-		return (ret);
-	if ((ret = mod_install(&modlinkage)) != 0) {
-		ddi_soft_state_fini((void **)&pcs_instances);
-	}
-	return (ret);
-}
-
-int
-_fini()
-{
-	int ret;
-	ret = mod_remove(&modlinkage);
-	if (ret == 0) {
-		ddi_soft_state_fini((void **)&pcs_instances);
-	}
-	return (ret);
-}
-
-int
-_info(struct modinfo *modinfop)
-{
-	return (mod_info(&modlinkage, modinfop));
-}
-
-int
-pcs_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **result)
-{
-	int error = DDI_SUCCESS;
-	int inum;
-	struct pcs_inst *inst;
-#ifdef lint
-	dip = dip;
-#endif
-
-	switch (cmd) {
-	case DDI_INFO_DEVT2DEVINFO:
-		inum = getminor((dev_t)arg);
-		inst = (struct pcs_inst *)ddi_get_soft_state(pcs_instances,
-		    inum);
-		if (inst == NULL)
-			error = DDI_FAILURE;
-		else
-			*result = inst->dip;
-		break;
-	case DDI_INFO_DEVT2INSTANCE:
-		inum = getminor((dev_t)arg);
-		inst = (struct pcs_inst *)ddi_get_soft_state(pcs_instances,
-		    inum);
-		if (inst == NULL)
-			error = DDI_FAILURE;
-		else
-			*result = (void *)(uintptr_t)inum;
-		break;
-	default:
-		error = DDI_FAILURE;
-	}
-	return (error);
-}
-
-int
-pcs_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
-{
-	int ret = DDI_SUCCESS;
-	int inum;
-	struct pcs_inst *inst;
-
-	switch (cmd) {
-	case DDI_RESUME:
-		return (DDI_SUCCESS);
-	case DDI_ATTACH:
-		break;
-	default:
-		return (DDI_FAILURE);
-	}
-
-	inum = ddi_get_instance(dip);
-
-	if (ddi_soft_state_zalloc(pcs_instances, inum) == DDI_SUCCESS) {
-		inst = (struct pcs_inst *)ddi_get_soft_state(pcs_instances,
-		    inum);
-		if (inst == NULL)
-			ret = DDI_FAILURE;
-		else
-			inst->dip = dip;
-	}
-
-	return (ret);
-}
-
-int
-pcs_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
-{
-	switch (cmd) {
-	case DDI_DETACH:
-		ddi_soft_state_free(pcs_instances, ddi_get_instance(dip));
-		return (DDI_SUCCESS);
-
-	case DDI_SUSPEND:
-	case DDI_PM_SUSPEND:
-		return (DDI_SUCCESS);
-	default:
-		break;
-	}
-	return (DDI_FAILURE);
-}
--- old/usr/src/uts/common/pcmcia/sys/Makefile	2014-11-12 17:44:41.031472420 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#ident	"%W%	%E% SMI"
-#
-# Copyright (c) 1995-1996 by Sun Microsystems, Inc.
-# All rights reserved.
-#
-# uts/common/pcmcia/sys/Makefile
-#
-# include global definitions
-include ../../../../Makefile.master
-
-HDRS=	cis.h			\
-	cis_handlers.h		\
-	cis_protos.h		\
-	cs.h			\
-	cs_priv.h		\
-	cs_strings.h		\
-	cs_types.h		\
-	cs_stubs.h
-
-ROOTDIR=	$(ROOT)/usr/include/sys
-ROOTHDRS=	$(HDRS:%=$(ROOTDIR)/%)
-
-# install rules
-
-$(ROOTDIR)/%: %
-	$(INS.file)
-
-CHECKHDRS= $(HDRS:%.h=%.check)
-
-.KEEP_STATE:
-
-.PARALLEL: $(CHECKHDRS)
-
-install_h: $(ROOTDIR) .WAIT $(ROOTHDRS)
-
-$(ROOTDIR):
-	$(INS.dir)
-
-check:	$(CHECKHDRS)
--- old/usr/src/uts/common/pcmcia/sys/cis.h	2014-11-12 17:44:41.082521591 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,371 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _CIS_H
-#define	_CIS_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This is the Card Services Card Information Structure (CIS) interpreter
- *	header file.  CIS information in this file is based on the
- *	Release 2.01 PCMCIA standard.
- */
-
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-
-#if defined(DEBUG)
-#define	CIS_DEBUG
-#endif
-
-
-/*
- * The CIS interpreter has a single entry point with a bunch of function
- *	id numbers.
- */
-#define	CISP_CIS_SETUP		0x01	/* setup CS address in CIS */
-#define	CISP_CIS_LIST_CREATE	0x02	/* create the CIS linked list */
-#define	CISP_CIS_LIST_DESTROY	0x03	/* destroy the CIS linked list */
-#define	CISP_CIS_GET_LTUPLE	0x04	/* get a tuple */
-#define	CISP_CIS_PARSE_TUPLE	0x05	/* parse a tuple */
-#define	CISP_CIS_CONV_DEVSPEED	0x06	/* convert devspeed to nS and back */
-#define	CISP_CIS_CONV_DEVSIZE	0x07	/* convert device size */
-
-/*
- * Make the  calls to CardServices look like function calls.
- */
-#define	CIS_CARD_SERVICES	(*cis_card_services)
-
-/*
- * define the tuples that we recognize
- *
- * Layer 1 - Basic Compatability TUples
- */
-#define	CISTPL_NULL		0x000	/* null tuple - ignore */
-#define	CISTPL_DEVICE		0x001	/* device information */
-#define	CISTPL_LONGLINK_CB	0x002	/* longlink to next tuple chain */
-#define	CISTPL_CONFIG_CB	0x004	/* configuration tuple */
-#define	CISTPL_CFTABLE_ENTRY_CB	0x005	/* configuration table entry */
-#define	CISTPL_LONGLINK_MFC	0x006	/* multi-function tuple */
-#define	CISTPL_BAR		0x007	/* Base Address Register definition */
-#define	CISTPL_CHECKSUM		0x010	/* checksum control */
-#define	CISTPL_LONGLINK_A	0x011	/* long-link to AM */
-#define	CISTPL_LONGLINK_C	0x012	/* long-link to CM */
-#define	CISTPL_LINKTARGET	0x013	/* link-target control */
-#define	CISTPL_NO_LINK		0x014	/* no-link control */
-#define	CISTPL_VERS_1		0x015	/* level 1 version information */
-#define	CISTPL_ALTSTR		0x016	/* alternate language string */
-#define	CISTPL_DEVICE_A		0x017	/* AM device information */
-#define	CISTPL_JEDEC_C		0x018	/* JEDEC programming info for CM */
-#define	CISTPL_JEDEC_A		0x019	/* JEDEC programming info for AM */
-#define	CISTPL_CONFIG		0x01a	/* configuration */
-#define	CISTPL_CFTABLE_ENTRY	0x01b	/* configuration-table-entry */
-#define	CISTPL_DEVICE_OC	0x01c	/* other op conditions CM device info */
-#define	CISTPL_DEVICE_OA	0x01d	/* other op conditions AM device info */
-#define	CISTPL_DEVICEGEO	0x01e	/* Common Memory device geometry */
-#define	CISTPL_DEVICEGEO_A	0x01f	/* Attribute Memory device geometry */
-#define	CISTPL_MANFID		0x020 	/* manufacturer identification */
-#define	CISTPL_FUNCID		0x021	/* function identification */
-#define	CISTPL_FUNCE		0x022	/* function extension */
-
-/*
- * Layer 2 - Data Recording Format Tuples
- */
-#define	CISTPL_SWIL		0x023	/* software interleave */
-#define	CISTPL_VERS_2		0x040	/* level 2 version information */
-#define	CISTPL_FORMAT		0x041	/* Common Memory recording format */
-#define	CISTPL_GEOMETRY		0x042	/* geometry */
-#define	CISTPL_BYTEORDER	0x043	/* byte order */
-#define	CISTPL_DATE		0x044	/* card initialization date */
-#define	CISTPL_BATTERY		0x045	/* battery replacement date */
-#define	CISTPL_FORMAT_A		0x047	/* Attribute Memory recording format */
-
-/*
- * Layer 3 - Data Organization Tuples
- */
-#define	CISTPL_ORG		0x046	/* organization */
-
-/*
- * Layer 4 - System Specific Standard Tuples
- */
-#define	CISTPL_VEND_SPEC_80	0x080	/* vendor-specific 0x80 */
-#define	CISTPL_VEND_SPEC_81	0x081	/* vendor-specific 0x81 */
-#define	CISTPL_VEND_SPEC_82	0x082	/* vendor-specific 0x82 */
-#define	CISTPL_VEND_SPEC_83	0x083	/* vendor-specific 0x83 */
-#define	CISTPL_VEND_SPEC_84	0x084	/* vendor-specific 0x84 */
-#define	CISTPL_VEND_SPEC_85	0x085	/* vendor-specific 0x85 */
-#define	CISTPL_VEND_SPEC_86	0x086	/* vendor-specific 0x86 */
-#define	CISTPL_VEND_SPEC_87	0x087	/* vendor-specific 0x87 */
-#define	CISTPL_VEND_SPEC_88	0x088	/* vendor-specific 0x88 */
-#define	CISTPL_VEND_SPEC_89	0x089	/* vendor-specific 0x89 */
-#define	CISTPL_VEND_SPEC_8a	0x08a	/* vendor-specific 0x8a */
-#define	CISTPL_VEND_SPEC_8b	0x08b	/* vendor-specific 0x8b */
-#define	CISTPL_VEND_SPEC_8c	0x08c	/* vendor-specific 0x8c */
-#define	CISTPL_VEND_SPEC_8d	0x08d	/* vendor-specific 0x8d */
-#define	CISTPL_VEND_SPEC_8e	0x08e	/* vendor-specific 0x8e */
-#define	CISTPL_VEND_SPEC_8f	0x08f	/* vendor-specific 0x8f */
-#define	CISTPL_SPCL		0x090	/* special-purpose tuple */
-#define	CISTPL_END		0x0ff	/* end-of-list tuple */
-
-/*
- * Macro to check if tuple is a vendor-specific tuple.
- */
-#define	CISTPL_VENDSPEC_START	CISTPL_VEND_SPEC_80
-#define	CISTPL_VENDSPEC_END	CISTPL_VEND_SPEC_8f
-#define	CISTPL_IS_VENDOR_SPECIFIC(td)	(((td) >= CISTPL_VENDSPEC_START) &&   \
-						((td) <= CISTPL_VENDSPEC_END))
-
-/*
- * The GetFirstTuple and GetNextTuple Card Services function calls use
- *	the DesiredTuple member of the tuple_t structure to determine
- *	while tuple type to return; since the CIS parser doesn't ever
- *	return CISTPL_END tuples, we can never ask for those tuples,
- *	so we overload this tuple code to mean that we want the
- *	first (or next) tuple in the chain.
- * XXX - If we ever do return CISTPL_END tuples, we'll have to
- *	re-think this.
- */
-#define	RETURN_FIRST_TUPLE	0x0ff	/* return first/next tuple */
-#define	RETURN_NEXT_TUPLE	0x0ff	/* return first/next tuple */
-
-/*
- * types for data in CIS and pointers into PC card's CIS space
- *
- * The "size" member is used by the NEXT_CIS_ADDR macro so that
- *	we don't run past the end of the mapped CIS address space.
- */
-typedef uchar_t cisdata_t;
-
-typedef struct cisptr_t {
-    acc_handle_t	handle;	/* access handle of CIS space */
-    uint32_t		size;	/* size of mapped area */
-    uint32_t		offset;	/* byte offset into CIS space */
-	/* see flag definitions for cistpl_t structure */
-    uint32_t		flags;
-} cisptr_t;
-
-/*
- * This is the maximum length that the data portion of a tuple can be.
- *	We have to use this since the brain-damaged 2.01 PCMCIA spec
- *	specifies that you can end a CIS chain by putting a CISTPL_END
- *	in the link field of the last VALID tuple.
- */
-#define	CIS_MAX_TUPLE_DATA_LEN	254
-
-/*
- * This is the maximum size of the string used to describe the name
- *	of the tuple.
- */
-#define	CIS_MAX_TUPLE_NAME_LEN	40
-
-/*
- * CIS_MAX_FUNCTIONS defines the maximum number of functions that can
- *	exist on a card.
- */
-#define	CIS_MAX_FUNCTIONS	8	/* max number of functions per card */
-
-/*
- * Macros to manipulate addresses and data in various CIS spaces
- *
- * NEXT_CIS_ADDR(cisptr_t *) increments the offset to point to the
- *	next data element in the CIS, based on what space the CIS
- *	we are reading resides in.  If the resulting address would
- *	be past the end of the mapped-in area, we return NULL,
- *	otherwise the adjusted offset value is returned. Note that
- *	this only works if the "size" member specifies the maximum
- *	mapped in window size and an "offset" member value of zero
- *	refers to the first byte of the window.
- *
- * GET_CIS_DATA(ptr) returns the data byte at the current CIS location.
- *
- * GET_CIS_ADDR(tp,ptr) returns the virtual address that was saved by a
- *	call to STORE_CIS_ADDR.
- *
- * BAD_CIS_ADDR is a flag that should be returned by callers of NEXT_CIS_ADDR
- *	if that macro returns NULL.  Note that this flag shares the same bit
- *	field definitions as the tuple handler flags defined in cis_handlers.h
- *	so check that file if you make any changes to these flags.
- * XXX - not the best distribution of flags, I'm afraid
- */
-#define	NEXT_CIS_ADDR(ptr)	\
-			(((ptr->flags&CISTPLF_AM_SPACE)?(ptr->offset += 2): \
-				(ptr->offset++)),	\
-				((ptr->offset > ptr->size)?(NULL):ptr->offset))
-#define	GET_CIS_DATA(ptr)	csx_Get8(ptr->handle, ptr->offset)
-#define	GET_CIS_ADDR(tp)	((cisdata_t *)(uintptr_t)(tp)->offset)
-#define	BAD_CIS_ADDR	0x080000000 /* read past end of mapped CIS error */
-
-/*
- * CIS_MEM_ALLOC(len) is used to allocate memory for our local linked
- *	CIS list; we use a macro so that the same code can be used in
- *	the kernel as well as in user space
- *
- * CIS_MEM_FREE(ptr) - same comment as CIS_MEM_ALLOC
- */
-#if !defined(_KERNEL)
-#ifdef	CISMALLOC_DEBUG
-#define	CIS_MEM_ALLOC(len)		cis_malloc((uint32_t)len)
-#define	CIS_MEM_FREE(ptr)		cis_free(ptr)
-#else
-#define	CIS_MEM_ALLOC(len)		malloc((uint32_t)len)
-#define	CIS_MEM_FREE(ptr)		free(ptr)
-#endif	/* CISMALLOC_DEBUG */
-#else
-#define	CIS_MEM_ALLOC(len)		cis_malloc((uint32_t)len)
-#define	CIS_MEM_FREE(ptr)		cis_free(ptr)
-#endif
-
-typedef struct cis_u_malloc_tag_t {
-	caddr_t		addr;
-	uint32_t	len;
-} cis_u_malloc_tag_t;
-
-/*
- * We keep the tuples in a locally-maintained linked list.  This allows
- *	us to return the tuple information at any time to a client for
- *	those cards that make their CIS inaccessible once the card is
- *	configured.
- */
-typedef struct cistpl_t {
-	cisdata_t	type;	/* type of tuple */
-	cisdata_t	len;	/* length of tuple data */
-	cisdata_t	*data;	/* data in tuple */
-	union {
-		cisdata_t	*byte;	/* read pointer for GET_BYTE macros */
-		uint16_t	*sword;
-	}		read;
-	uint32_t	flags;	/* misc flags */
-	uint32_t	offset;	/* CIS address offset of start of tuple */
-	struct cistpl_t	*prev;	/* back pointer */
-	struct cistpl_t	*next;	/* forward pointer */
-} cistpl_t;
-
-/*
- * Flags that are used in the cistpl_t and cisptr_t linked lists
- */
-#define	CISTPLF_NOERROR		0x000000000 /* no error return from handler */
-#define	CISTPLF_UNKNOWN		0x000000001 /* unknown tuple */
-#define	CISTPLF_REGS		0x000000002 /* tuple contains registers */
-#define	CISTPLF_COPYOK		0x000000004 /* OK to copy tuple data */
-#define	CISTPLF_VALID		0x000000008 /* tuple is valid */
-#define	CISTPLF_GLOBAL_CIS	0x000000010 /* tuple from global CIS */
-#define	CISTPLF_MF_CIS		0x000000020 /* tuple from MF CIS chain */
-#define	CISTPLF_FROM_AM		0x000000040 /* tuple read from AM space */
-#define	CISTPLF_FROM_CM		0x000000080 /* tuple read from CM space */
-#define	CISTPLF_IGNORE_TUPLE	0x000000100 /* ignore this tuple */
-#define	CISTPLF_VENDOR_SPECIFIC	0x000000200 /* vnedor-specific tuple */
-#define	CISTPLF_LINK_INVALID	0x001000000 /* tuple link is invalid */
-#define	CISTPLF_PARAMS_INVALID	0x002000000 /* tuple body is invalid */
-#define	CISTPLF_AM_SPACE	0x010000000 /* this tuple is in AM space */
-#define	CISTPLF_CM_SPACE	0x020000000 /* this tuple is in CM space */
-#define	CISTPLF_LM_SPACE	0x040000000 /* this tuple is in local memory */
-#define	CISTPLF_MEM_ERR		0x080000000 /* GET_BYTE macros memory error */
-
-/*
- * Some convienience macros
- */
-#define	CISTPLF_SPACE_MASK	(CISTPLF_AM_SPACE | CISTPLF_CM_SPACE |	\
-							CISTPLF_LM_SPACE)
-#define	CISTPLF_FROM_MASK	(CISTPLF_FROM_AM | CISTPLF_FROM_CM)
-
-/*
- * Values used internally on calls to cis_get_ltuple.
- *
- * The GET_XXX_LTUPLEF and FIND_XXX_XXX values are mutually exclusive,
- *	i.e. cis_get_ltuple can only do one of these operations per call.
- *
- * The other flags are bit flags and they share the flags parameter.
- *
- *    CIS_GET_LTUPLE_IGNORE - return tuples with CISTPLF_IGNORE_TUPLE
- *				set in cistpl_t->flags
- */
-#define	GET_FIRST_LTUPLEF	0x000000001 /* return first tuple in list */
-#define	GET_LAST_LTUPLEF	0x000000002 /* return last tuple in list */
-#define	FIND_LTUPLE_FWDF	0x000000003 /* find tuple, fwd search from tp */
-#define	FIND_LTUPLE_BACKF	0x000000004 /* find tuple, backward from tp */
-#define	FIND_NEXT_LTUPLEF	0x000000005 /* find tuple, fwd from tp+1 */
-#define	FIND_PREV_LTUPLEF	0x000000006 /* find tuple, backward from tp-1 */
-#define	GET_NEXT_LTUPLEF	0x000000007 /* return next tuple in list */
-#define	GET_PREV_LTUPLEF	0x000000008 /* return prev tuple in list */
-#define	CIS_GET_LTUPLE_OPMASK	0x00000ffff /* mask for operation values */
-#define	CIS_GET_LTUPLE_IGNORE	0x000010000 /* return ignored tuples */
-
-/*
- * macros for getting various data types out of a tuple
- * Note that due to the modem tuple using a few big-endian values,
- * we have to support both big and little endian macros
- *
- * Common Memory Specific macros - these will also work for tuples in
- *	local memory
- */
-#define	GET_CM_BYTE(tp)	(((size_t)(tp)->len >= \
-				((uintptr_t)(tp)->read.byte - \
-					(uintptr_t)(tp)->data)) ? \
-			 *(tp)->read.byte++ : ((tp)->flags |= CISTPLF_MEM_ERR))
-#define	GET_CM_LEN(tp)	((size_t)(tp)->len - \
-				((uintptr_t)(tp)->read.byte - \
-				(uintptr_t)(tp)->data))
-
-/* Attribute Memory Specific macros */
-#define	GET_AM_BYTE(tp)	(((size_t)(tp)->len >= \
-				(((uintptr_t)(tp)->read.byte - \
-					(uintptr_t)(tp)->data))>>1) ? \
-			 *(cisdata_t *)(tp)->read.sword++ : \
-				((tp)->flags |= CISTPLF_MEM_ERR))
-#define	GET_AM_LEN(tp)	((size_t)(tp)->len - (((uintptr_t)(tp)->read.byte - \
-				(uintptr_t)(tp)->data) >> 1))
-
-/* generic macros */
-#define	RESET_TP(tp)	(tp)->read.byte = (tp)->data
-#define	LOOK_BYTE(tp)	*(tp)->read.byte
-#define	GET_BYTE_ADDR(tp) (tp)->read.byte
-
-#define	GET_BYTE(tp)	(((tp)->flags & CISTPLF_AM_SPACE) ? \
-				GET_AM_BYTE(tp) : GET_CM_BYTE(tp))
-#define	GET_SHORT(tp)		cis_get_short(tp)
-#define	GET_BE_SHORT(tp)	cis_get_be_short(tp)
-#define	GET_INT24(tp)		cis_get_int24(tp)
-#define	GET_LONG(tp)		cis_get_long(tp)
-#define	GET_LEN(tp)	(((tp)->flags & CISTPLF_AM_SPACE) ? \
-				GET_AM_LEN(tp) : GET_CM_LEN(tp))
-
-/*
- * cistpl_ignore_list_t - this structure describes tuples in the global
- *				CIS list that we want to ignore if they
- *				also show up in a function-specific CIS.
- */
-typedef struct cistpl_ignore_list_t {
-	cisdata_t	type;
-} cistpl_ignore_list_t;
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CIS_H */
--- old/usr/src/uts/common/pcmcia/sys/cis_handlers.h	2014-11-12 17:44:41.134722103 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,1137 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1995-2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _CIS_HANDLERS_H
-#define	_CIS_HANDLERS_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * This is the CIS tuple handler header file.
- *
- * Each tuple that we recognize and are prepared to handle is assigned a
- *	cistpl_callout_t structure.  This lets us specify a handler for
- *	this tuple, as well as flags that describe this tuple and which
- *	are used by the CIS interpreter and tuple parser.
- */
-typedef struct cistpl_callout_t {
-    cisdata_t	type;		/* type of tuple */
-    cisdata_t	subtype;	/* only used for CISTPL_FUNCE */
-    uint32_t	flags;		/* misc flags */
-    uint32_t	(*handler)();	/* tuple handler */
-    char	*text;		/* name of tuple */
-} cistpl_callout_t;
-
-/*
- * Flags that are used by a tuple handler to specify what action it
- *	should perform.
- */
-#define	HANDTPL_NOERROR		0x000000000 /* no error */
-#define	HANDTPL_SET_FLAGS	0x000000001 /* set tuple flags */
-#define	HANDTPL_COPY_DONE	0x000000002 /* tuple data copy is done */
-#define	HANDTPL_PARSE_LTUPLE	0x000000004 /* parse tuple, return opt data */
-#define	HANDTPL_RETURN_NAME	0x000000008 /* return tuple name string */
-
-/*
- * This flag is returned by tuple handlers if they encounter an error. It
- *	is returned by cis_list_lcreate if any of the tuple handlers have
- *	return an error while processing the CIS.
- *
- * Note that the following bit is reserved:
- *		#define	BAD_CIS_ADDR	0x080000000
- *	It appears in cis.h and is used to indicate that cis_list_create
- *	tried to read past the end of the mapped in CIS space.
- */
-#define	HANDTPL_ERROR		0x001000000 /* handler returned an error */
-
-/*
- * General-use constants and macros that aren't specific to a tuple.
- */
-#define	CISTPL_EXT_BIT	0x080		/* additional extension bytes follow */
-
-/*
- * Constants, macros and structures used by cistpl_devspeed and
- *	cis_convert_devspeed functions.
- */
-#define	CISTPL_DEVSPEED_TABLE	0x000000001 /* use the device speed table */
-#define	CISTPL_DEVSPEED_EXT	0x000000002 /* use the extended speed table */
-#define	CISTPL_DEVSPEED_MAX_TBL	8 		/* max devspeed table entries */
-#define	CISTPL_DEVSPEED_MAX_EXP	8		/* max exponent entries */
-#define	CISTPL_DEVSPEED_MAX_MAN	16		/* max mantissa entries */
-#define	CISTPL_DEVSPEED_TBL(t)	cistpl_devspeed_struct.table[(t) &	\
-						(CISTPL_DEVSPEED_MAX_TBL - 1)]
-#define	CISTPL_DEVSPEED_MAN(m)	cistpl_devspeed_struct.mantissa[(m) &	\
-						(CISTPL_DEVSPEED_MAX_MAN - 1)]
-#define	CISTPL_DEVSPEED_EXP(e)	cistpl_devspeed_struct.exponent[(e) &	\
-						(CISTPL_DEVSPEED_MAX_EXP - 1)]
-typedef struct cistpl_devspeed_struct_t {
-	uint32_t	*table;
-	uint32_t	*tenfac;
-	uint32_t	*mantissa;
-	uint32_t	*exponent;
-} cistpl_devspeed_struct_t;
-
-/*
- * Constants, flags and structure typedefs that are used by specific tuples.
- *
- * CISTPL_DEVICE, CISTPL_DEVICE_A, CISTPL_DEVICE_OC and CISTPL_DEVICE_OA
- */
-#define	CISTPL_DEVICE_DTYPE_NULL	0x00	/* a NULL device (hole) */
-#define	CISTPL_DEVICE_DTYPE_ROM		0x01	/* device is of type ROM */
-#define	CISTPL_DEVICE_DTYPE_OTPROM	0x02	/* device is of type OTPROM */
-#define	CISTPL_DEVICE_DTYPE_EPROM	0x03	/* device is of type EPROM */
-#define	CISTPL_DEVICE_DTYPE_EEPROM	0x04	/* device is of type EEPROM */
-#define	CISTPL_DEVICE_DTYPE_FLASH	0x05	/* device is of type FLASH */
-#define	CISTPL_DEVICE_DTYPE_SRAM	0x06	/* device is of type SRAM */
-#define	CISTPL_DEVICE_DTYPE_DRAM	0x07	/* device is of type DRAM */
-#define	CISTPL_DEVICE_DTYPE_RSVD_8	0x08	/* reserved */
-#define	CISTPL_DEVICE_DTYPE_RSVD_9	0x09	/* reserved */
-#define	CISTPL_DEVICE_DTYPE_RSVD_a	0x0a	/* reserved */
-#define	CISTPL_DEVICE_DTYPE_RSVD_b	0x0b	/* reserved */
-#define	CISTPL_DEVICE_DTYPE_RSVD_c	0x0c	/* reserved */
-#define	CISTPL_DEVICE_DTYPE_FUNCSPEC	0x0d	/* device is of type FUNCSPEC */
-#define	CISTPL_DEVICE_DTYPE_EXTEND	0x0e	/* device is of type extended */
-#define	CISTPL_DEVICE_DTYPE_RSVD_f	0x0f	/* reserved */
-
-/*
- * Flags for cistpl_device_node_t->flags member for CISTPL_DEVICE
- *	and CISTPL_DEVICE_A tuples
- */
-#define	CISTPL_DEVICE_WPS		0x00000001	/* WPS bit is set */
-/*
- * Flags and values for cistpl_device_node_t->flags member for
- *	CISTPL_DEVICE_OC and CISTPL_DEVICE_OA tuples
- */
-#define	CISTPL_DEVICE_OC_MWAIT		0x00010000	/* use MWAIT */
-#define	CISTPL_DEVICE_OC_Vcc_MASK	0x00060000	/* mask for Vcc value */
-#define	CISTPL_DEVICE_OC_Vcc5		0x00000000	/* 5.0 volt operation */
-#define	CISTPL_DEVICE_OC_Vcc33		0x00020000	/* 3.3 volt operation */
-#define	CISTPL_DEVICE_OC_VccXX		0x00040000	/* X.X volt operation */
-#define	CISTPL_DEVICE_OC_VccYY		0x00060000	/* Y.Y volt operation */
-/*
- * CISTPL_DEVICE_MAX_DEVICES defines the maximum number of devices that
- *	we can parse in a CISTPL_DEVICE{...} tuple
- */
-#define	CISTPL_DEVICE_MAX_DEVICES	10
-
-/*
- * CISTPL_DEVICE_SPEED_SIZE_IGNORE if the device speed is set to this, then
- *	ignore the speed and size values
- */
-#define	CISTPL_DEVICE_SPEED_SIZE_IGNORE	0x0ff	/* ignore size and speed info */
-
-typedef struct cistpl_device_node_t {
-	uint32_t	flags;	/* flags specific to this device */
-	uint32_t	speed;	/* device speed in device speed code format */
-	uint32_t	nS_speed; /* device speed in nS */
-	uint32_t	type;	/* device type */
-	uint32_t	size;	/* device size */
-	uint32_t	size_in_bytes; /* device size in bytes */
-} cistpl_device_node_t;
-
-typedef struct cistpl_device_t {
-	uint32_t		num_devices; /* number of devices found */
-	cistpl_device_node_t	devnode[CISTPL_DEVICE_MAX_DEVICES];
-} cistpl_device_t;
-
-/*
- * CISTPL_CONFIG
- */
-#define	MAKE_CONFIG_REG_ADDR(base, reg)	(base + (reg * 2))
-#define	CISTPL_CONFIG_MAX_CONFIG_REGS	128 /* max num config regs */
-typedef struct cistpl_config_t {
-    uint32_t	present;	/* register present flags */
-    uint32_t	nr;		/* number of config registers found */
-    uint32_t	hr;		/* highest config register index found */
-    uint32_t	regs[CISTPL_CONFIG_MAX_CONFIG_REGS];	/* reg offsets */
-    uint32_t	base;		/* base offset of config registers */
-    uint32_t	last;		/* last config index */
-} cistpl_config_t;
-
-/*
- * CISTPL_VERS_1
- */
-#define	CISTPL_VERS_1_MAX_PROD_STRINGS	4 /* max number product strings */
-typedef struct cistpl_vers_1_t {
-    uint32_t	major;		/* major version number */
-    uint32_t	minor;		/* minor version number */
-    uint32_t	ns;		/* number of information strings */
-				/* pointers to product information strings */
-    char	pi[CISTPL_VERS_1_MAX_PROD_STRINGS][CIS_MAX_TUPLE_DATA_LEN];
-} cistpl_vers_1_t;
-
-/*
- * CISTPL_VERS_2
- */
-typedef struct cistpl_vers_2_t {
-    uint32_t	vers;		/* version number */
-    uint32_t	comply;		/* level of compliance */
-    uint32_t	dindex;		/* byte address of first data byte in card */
-    uint32_t	reserved;	/* two reserved bytes */
-    uint32_t	vspec8;		/* vendor specific (byte 8) */
-    uint32_t	vspec9;		/* vendor specific (byte 9) */
-    uint32_t	nhdr;		/* number of copies of CIS present on device */
-    char	oem[CIS_MAX_TUPLE_DATA_LEN];	/* Vendor of software that */
-							/* formatted card */
-    char	info[CIS_MAX_TUPLE_DATA_LEN];	/* Informational message */
-							/* about card */
-} cistpl_vers_2_t;
-
-/*
- * CISTPL_JEDEC_A and CISTPL_JEDEC_C
- */
-#define	CISTPL_JEDEC_MAX_IDENTIFIERS	4
-typedef struct jedec_ident_t {
-	uint32_t	id;	/* manufacturer id */
-	uint32_t	info;	/* manufacturer specific info */
-} jedec_ident_t;
-
-typedef struct cistpl_jedec_t {
-	uint32_t	nid;		/* # of JEDEC identifiers present */
-	jedec_ident_t	jid[CISTPL_JEDEC_MAX_IDENTIFIERS];
-} cistpl_jedec_t;
-
-/*
- * CISTPL_FORMAT and CISTPL_FORMAT_A
- *
- * These tuples describe the data recording format for a region.
- */
-typedef struct cistpl_format_t {
-	uint32_t	type;	/* format type code */
-	uint32_t	edc_length; /* error detection code length */
-	uint32_t	edc_type; /* error detection code type */
-	uint32_t	offset;	/* offset of first byte of data in this part */
-	uint32_t	nbytes;	/* number of bytes of data in this partition */
-	union {
-		struct disk {
-		    uint32_t	bksize; /* block size */
-		    uint32_t	nblocks; /* nblocks data for disk-like device */
-		    uint32_t	edcloc; /* location of error detection code */
-		} disk;
-		struct mem {
-		    uint32_t	flags; /* various flags */
-		    uint32_t	reserved; /* reserved byte */
-		    caddr_t	address; /* physical addr for mem-like device */
-		    uint32_t	edcloc; /* location of error detection code */
-		} mem;
-	} dev;
-} cistpl_format_t;
-
-/*
- * device format types
- */
-#define	TPLFMTTYPE_DISK	0x00	/* disk-like format */
-#define	TPLFMTTYPE_MEM	0x01	/* memory-like format */
-#define	TPLFMTTYPE_VS	0x80	/* vendor specific format */
-
-/*
- * error detection code types
- */
-#define	TPLFMTEDC_NONE	0x00	/* no error detection code */
-#define	TPLFMTEDC_CKSUM	0x01	/* arithmetic checksum is used */
-#define	TPLFMTEDC_CRC	0x02	/* 16-bit CRC */
-#define	TPLFMTEDC_PCC	0x03	/* whole-partition arithmetic checksum */
-#define	TPLFMTEDC_VS	0x80	/* vendor specific error checking */
-
-#define	EDC_LENGTH_MASK	0x07
-#define	EDC_TYPE_MASK   0x0f
-#define	EDC_TYPE_SHIFT	3
-
-/*
- * flags for memory-like devices
- */
-#define	TPLFMTFLAGS_ADDR	0x01	/* address is valid */
-#define	TPLFMTFLAGS_AUTO	0x02	/* automatically map memory region */
-
-/*
- * CISTPL_GEOMETRY
- */
-typedef struct cistpl_geometry_t {
-	uint32_t	spt;
-	uint32_t	tpc;
-	uint32_t	ncyl;
-} cistpl_geometry_t;
-
-/*
- * CISTPL_BYTEORDER
- */
-typedef struct cistpl_byteorder_t {
-	uint32_t	order;		/* byte order code */
-	uint32_t	map;		/* byte mapping code */
-} cistpl_byteorder_t;
-
-/*
- * byte order and mapping codes
- */
-#define	TPLBYTEORD_LOW	0x00	/* specifies little endian order */
-#define	TPLBYTEORD_HIGH	0x01	/* specifies big endian order */
-#define	TPLBYTEORD_VS	0x80	/* vendor specific order 0x80-0xFF */
-
-#define	TPLBYTEMAP_LOW	0x00	/* byte zero is least significant byte */
-#define	TPLBYTEMAP_HIGH	0x01	/* byte zero is most significant byte */
-#define	TPLBYTEMAP_VS	0x80	/* vendor specific mapping */
-
-/*
- * CISTPL_DATE
- */
-typedef struct cistpl_date_t {
-	uint32_t	time;
-	uint32_t	day;
-} cistpl_date_t;
-
-/*
- * CISTPL_BATTERY
- */
-typedef struct cistpl_battery_t {
-	uint32_t	rday;		/* replacement date */
-	uint32_t	xday;		/* expiration date */
-} cistpl_battery_t;
-
-/*
- * CISTPL_ORG
- */
-typedef struct cistpl_org_t {
-	uint32_t	type;		/* data organization code */
-	char	desc[CIS_MAX_TUPLE_DATA_LEN];	/* text description of */
-						/* this organization */
-} cistpl_org_t;
-
-/*
- * CISTPL_MANFID
- */
-typedef struct cistpl_manfid_t {
-	uint32_t	manf;		/* PCMCIA PC Card manufacturer code */
-	uint32_t	card;		/* manufacturer information */
-} cistpl_manfid_t;
-
-/*
- * CISTPL_FUNCID
- */
-typedef struct cistpl_funcid_t {
-	uint32_t	function;		/* PC Card function code */
-	uint32_t	sysinit;		/* system initialization mask */
-} cistpl_funcid_t;
-
-/*
- * Function types for CISTPL_FUNCID; note that the TPLFUNC_UNKNOWN is
- *	not defined by the PCMCIA standard.
- *
- * Definitions for cistpl_funcid_t->function
- */
-#define	TPLFUNC_MULTI		0x000	/* vendor-specific multifunction card */
-#define	TPLFUNC_MEMORY		0x001	/* memory card */
-#define	TPLFUNC_SERIAL		0x002	/* serial I/O port */
-#define	TPLFUNC_PARALLEL	0x003	/* parallel printer port */
-#define	TPLFUNC_FIXED		0x004	/* fixed disk, silicon or removeable */
-#define	TPLFUNC_VIDEO		0x005	/* video interface */
-#define	TPLFUNC_LAN		0x006	/* Local Area Network adapter */
-#define	TPLFUNC_AIMS		0x007	/* Auto Incrementing Mass Storage */
-#define	TPLFUNC_SCSI		0x008	/* SCSI bridge */
-#define	TPLFUNC_SECURITY	0x009	/* Security Cards */
-#define	TPLFUNC_VENDOR_SPECIFIC	0x0fe	/* Vendor Specific */
-#define	TPLFUNC_UNKNOWN		0x0ff	/* unknown function(s) */
-/*
- * Definitions for cistpl_funcid_t->sysinit
- */
-#define	TPLINIT_POST		0x01	/* POST should attempt configure */
-#define	TPLINIT_ROM		0x02	/* map ROM during sys init */
-
-/*
- * CISTPL_FUNCE
- */
-typedef struct cistpl_funce_t {
-	uint32_t	function;		/* type of extended data */
-	uint32_t	subfunction;
-	union {
-		struct serial {
-			uint32_t ua;	/* UART in use */
-			uint32_t uc;	/* UART capabilities */
-		} serial;
-		struct modem {
-			uint32_t fc;	/* supported flow control methods */
-			uint32_t cb;	/* size of DCE command buffer */
-			uint32_t eb;	/* size of DCE to DCE buffer */
-			uint32_t tb;	/* size of DTE to DCE buffer */
-		} modem;
-		struct data_modem {
-			uint32_t ud;	/* highest data rate */
-			uint32_t ms;	/* modulation standards */
-			/* err correct proto and non-CCITT modulation */
-			uint32_t em;
-			uint32_t dc;	/* data compression protocols */
-			uint32_t cm;	/* command protocols */
-			uint32_t ex;	/* escape mechanisms */
-			uint32_t dy;	/* standardized data encryption */
-			uint32_t ef;	/* misc. end user features */
-			uint32_t ncd;	/* number of country codes */
-			uchar_t cd[16];	/* CCITT country code */
-		} data_modem;
-		struct fax {
-			uint32_t uf;	/* highest data rate in DTE/UART */
-			uint32_t fm;	/* CCITT modulation standards */
-			uint32_t fy;	/* standardized data encryption */
-			uint32_t fs;	/* feature selection */
-			uint32_t ncf; /* number of country codes */
-			uchar_t cf[16];	/* CCITT country codes */
-		} fax;
-		struct voice {
-			uint32_t uv;	/* highest data rate */
-			uint32_t nsr;
-			uint32_t sr[16]; /* voice sampling rates (*100) */
-			uint32_t nss;
-			uint32_t ss[16]; /* voice sample sizes (*10) */
-			uint32_t nsc;
-			uint32_t sc[16]; /* voice compression methods */
-		} voice;
-		struct lan {
-			uint32_t tech; /* network technology */
-			uint32_t speed; /* media bit or baud rate */
-			uint32_t media; /* network media supported */
-			uint32_t con; /* open/closed connector standard */
-			uint32_t id_sz; /* length of lan station id */
-			uchar_t id[16]; /* station ID */
-		} lan;
-	}   data;
-} cistpl_funce_t;
-
-/* serial port subfunctions */
-#define	TPLFE_SUB_SERIAL	0 /* serial port */
-#define	TPLFE_SUB_MODEM_COMMON	1 /* common modem interface */
-#define	TPLFE_SUB_MODEM_DATA	2 /* data modem services */
-#define	TPLFE_SUB_MODEM_FAX	3 /* fax modem services */
-#define	TPLFE_SUB_VOICE		4 /* voice services */
-/* modem subfunctions for description of capabilities */
-#define	TPLFE_CAP_MODEM_DATA	5 /* data modem capabilities */
-#define	TPLFE_CAP_MODEM_FAX	6 /* fax modem capabilities */
-#define	TPLFE_CAP_MODEM_VOICE	7 /* voice modem capabilities */
-/* serial port subfunctions for description of capabilities */
-#define	TPLFE_CAP_SERIAL_DATA	8 /* serial port capabilities - data modem */
-#define	TPLFE_CAP_SERIAL_FAX	9 /* serial port capabilities - fax modem */
-#define	TPLFE_CAP_SERIAL_VOICE 10 /* serial port capabilities - voice */
-
-/* serial port UART definitions */
-#define	TPLFE_UA_8250		0 /* Intel 8250 */
-#define	TPLFE_UA_16450		1 /* NS 16450 */
-#define	TPLFE_UA_16550		2 /* NS 16550 */
-
-/* serial port capabilities definitions */
-#define	TPLFE_UC_PARITY_SPACE	0x0001 /* space parity supported */
-#define	TPLFE_UC_PARITY_MARK	0x0002 /* mark parity supported */
-#define	TPLFE_UC_PARITY_ODD	0x0004 /* odd parity supported */
-#define	TPLFE_UC_PARITY_EVEN	0x0008 /* even parity supported */
-#define	TPLFE_UC_CS5		0x0100 /* 5 bit characters supported */
-#define	TPLFE_UC_CS6		0x0200 /* 6 bit characters supported */
-#define	TPLFE_UC_CS7		0x0400 /* 7 bit characters supported */
-#define	TPLFE_UC_CS8		0x0800 /* 8 bit characters supported */
-#define	TPLFE_UC_STOP_1		0x1000 /* 1 stop bit supported */
-#define	TPLFE_UC_STOP_15	0x2000 /* 1.5 stop bits supported */
-#define	TPLFE_UC_STOP_2		0x4000 /* 2 stop bits supported */
-
-/* modem flow control methods */
-#define	TPLFE_FC_TX_XONOFF	0x01 /* transmit XON/XOFF */
-#define	TPLFE_FC_RX_XONOFF	0x02 /* receiver XON/XOFF */
-#define	TPLFE_FC_TX_HW		0x04 /* transmit hardware flow control (CTS) */
-#define	TPLFE_FC_RX_HW		0x08 /* receiver hardware flow control (RTS) */
-#define	TPLFE_FC_TRANS		0x10 /* tranparent flow control */
-
-/* modem modulation standards */
-#define	TPLFE_MS_BELL103	0x0001 /* 300bps */
-#define	TPLFE_MS_V21		0x0002 /* 300bps (V.21) */
-#define	TPLFE_MS_V23		0x0004 /* 600/1200bps (V.23) */
-#define	TPLFE_MS_V22AB		0x0008 /* 1200bps (V.22A V.22B) */
-#define	TPLFE_MS_BELL212	0x0010 /* 2400bsp (US Bell 212) */
-#define	TPLFE_MS_V22BIS		0x0020 /* 2400bps (V.22bis) */
-#define	TPLFE_MS_V26		0x0040 /* 2400bps leased line (V.26) */
-#define	TPLFE_MS_V26BIS		0x0080 /* 2400bps (V.26bis) */
-#define	TPLFE_MS_V27BIS		0x0100 /* 4800/2400bps leased line (V.27bis) */
-#define	TPLFE_MS_V29		0x0200 /* 9600/7200/4800 leased line (V.29) */
-#define	TPLFE_MS_V32		0x0400 /* up to 9600bps (V.32) */
-#define	TPLFE_MS_V32BIS		0x0800 /* up to 14400bps (V.32bis) */
-#define	TPLFE_MS_VFAST		0x1000 /* up to 28800 V.FAST */
-
-/* modem error correction/detection protocols */
-#define	TPLFE_EM_MNP		0x01 /* MNP levels 2-4 */
-#define	TPLFE_EM_V42		0x02 /* CCITT LAPM (V.42) */
-
-/* modem data compression protocols */
-#define	TPLFE_DC_V42BIS		0x01 /* CCITT compression V.42 */
-#define	TPLFE_DC_MNP5		0x02 /* MNP compression (uses MNP 2, 3 or 4) */
-
-/* modem command protocols */
-#define	TPLFE_CM_AT1	0x01 /* ANSI/EIA/TIA 602 "Action" commands */
-#define	TPLFE_CM_AT2	0x02 /* ANSI/EIA/TIA 602 "ACE/DCE IF Params" */
-#define	TPLFE_CM_AT3	0x04 /* ANSI/EIA/TIA 602 "Ace Parameters" */
-#define	TPLFE_CM_MNP_AT	0x08 /* MNP specificat AT commands */
-#define	TPLFE_CM_V25BIS	0x10 /* V.25bis calling commands */
-#define	TPLFE_CM_V25A	0x20 /* V.25bis test procedures */
-#define	TPLFE_CM_DMCL	0x40 /* DMCL command mode */
-
-/* modem escape mechanism */
-#define	TPLFE_EX_BREAK		0x01 /* BREAK support standardized */
-#define	TPLFE_EX_PLUS		0x02 /* +++ returns to command mode */
-#define	TPLFE_EX_UD		0x04 /* user defined escape character */
-
-/* modem miscellaneous features */
-#define	TPLFE_EF_CALLERID	0x01 /* Caller ID is supported */
-
-/* fax modulation standards */
-#define	TPLFE_FM_V21C2	0x01 /* 300bps (V.21-C2) */
-#define	TPLFE_FM_V27TER	0x02 /* 4800/2400bps (V.27ter) */
-#define	TPLFE_FM_V29	0x04 /* 9600/7200/4800 leased line (V.29) */
-#define	TPLFE_FM_V17	0x08 /* 14.4K/12K/9600/7200bps (V.17) */
-#define	TPLFE_FM_V33	0x10 /* 14.4K/12K/9600/7200 lease line (V.33) */
-
-/* fax feature selection */
-#define	TPLFE_FS_T3		0x01 /* Group 2 (T.3) service class */
-#define	TPLFE_FS_T4		0x02 /* Group 3 (T.4) service class */
-#define	TPLFE_FS_T6		0x04 /* Group 4 (T.6) service class */
-#define	TPLFE_FS_ECM		0x08 /* Error Correction Modeer */
-#define	TPLFE_FS_VOICEREQ	0x10 /* voice requests allowed */
-#define	TPLFE_FS_POLLING	0x20 /* polling support */
-#define	TPLFE_FS_FTP		0x40 /* file transfer support */
-#define	TPLFE_FS_PASSWORD	0x80 /* password support */
-
-/* LAN tuple definitions */
-#define	TPLFE_NETWORK_INFO	0x00
-
-/* LAN technology types */
-#define	TPLFE_LAN_TECH_ARCNET		1
-#define	TPLFE_LAN_TECH_ETHERNET		2
-#define	TPLFE_LAN_TECH_TOKENRING	3
-#define	TPLFE_LAN_TECH_LOCALTALK	4
-#define	TPLFE_LAN_TECH_FDDI		5
-#define	TPLFE_LAN_TECH_ATM		6
-#define	TPLFE_LAN_TECH_WIRELESS		7
-
-/* LAN media types */
-#define	TPLFE_LAN_MEDIA_INHERENT	0
-#define	TPLFE_LAN_MEDIA_UTP		1
-#define	TPLFE_LAN_MEDIA_STP		2
-#define	TPLFE_LAN_MEDIA_THIN_COAX	3
-#define	TPLFE_LAN_MEDIA_THICK_COAX	4
-#define	TPLFE_LAN_MEDIA_FIBER		5
-#define	TPLFE_LAN_MEDIA_SSR_902		6
-#define	TPLFE_LAN_MEDIA_SSR_2_4		7
-#define	TPLFE_LAN_MEDIA_SSR_5_4		8
-#define	TPLFE_LAN_MEDIA_DIFFUSE_IR	9
-#define	TPLFE_LAN_MEDIA_PTP_IR		10
-
-/*
- * CISTPL_CFTABLE_ENTRY
- *
- * These flags and macros are used internally to the handler.
- */
-	/* mask to get the config entry number from TPCE_INDX */
-#define	CISTPL_CFTABLE_TPCE_CFGENTRYM		0x03f
-		/* default config bit in TPCE_INDX */
-#define	CISTPL_CFTABLE_TPCE_DEFAULTM		0x040
-		/* interface config byte follows */
-#define	CISTPL_CFTABLE_TPCE_IFM			0x080
-
-		/* power bit mask for tpce_fs */
-#define	CISTPL_CFTABLE_TPCE_FS_PWRM		0x003
-		/* Vcc, Vpp1 and Vpp2 descriptions */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP2M	0x003
-		/* Vcc and Vpp1=Vpp2 descriptions */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP1M	0x002
-		/* Vcc description only */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VCCM		0x001
-		/* no connection on sleep/power down */
-#define	CISTPL_CFTABLE_PD_NC_SLEEPM		0x07d
-		/* zero value required */
-#define	CISTPL_CFTABLE_PD_ZEROM			0x07e
-		/* no connection ever */
-#define	CISTPL_CFTABLE_PD_NCM			0x07f
-
-		/* timing data exists */
-#define	CISTPL_CFTABLE_TPCE_FS_TDM		0x004
-		/* WAIT scale mask */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_WAITM		0x003
-#define	GET_TPCE_FS_TD_WAITS(sf)	((sf)& \
-					    CISTPL_CFTABLE_TPCE_FS_TD_WAITM)
-		/* RDY/BSY scale mask */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_RDYM		0x01c
-#define	GET_TPCE_FS_TD_RDYS(sf)	(((sf)>>2)& \
-					CISTPL_CFTABLE_TPCE_FS_TD_RDYM)
-		/* RSVD scale mask */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_RSVDM		0x0e0
-#define	GET_TPCE_FS_TD_RSVDS(sf)	(((sf)>>5)& \
-					    CISTPL_CFTABLE_TPCE_FS_TD_RSVDM)
-
-#define	CISTPL_CFTABLE_TPCE_FS_IOM		0x008	/* I/O data exists */
-		/* I/O addr lines mask */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_ALM		0x01f
-		/* RANGE bit in TPCE_IO */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_RANGEM	0x080
-		/* max of 16 I/O ranges */
-#define	CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES	16
-
-#define	CISTPL_CFTABLE_TPCE_FS_IRQM		0x010	/* IRQ data exists */
-		/* extended IRQ mask exists */
-#define	CISTPL_CFTABLE_TPCE_FS_IRQ_MASKM	0x010
-
-#define	CISTPL_CFTABLE_TPCE_FS_MEMM		0x060	/* mem space mask */
-		/* space selection byte ... */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM3M		0x060
-		/* length (2 bytes) and card address (2 bytes) */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM2M		0x040
-		/* single 2-byte length */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM1M		0x020
-		/* max of 8 mem space descriptors */
-#define	CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS	8
-		/* number of bytes/page description */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM_PGSIZE	256
-		/* host addr info present */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM_HOSTM	0x080
-
-#define	CISTPL_CFTABLE_TPCE_FS_MISCM		0x080	/* misc fields mask */
-
-/*
- * Constants, macros, structures and flags used by cistpl_pd_parse()
- *	cistpl_expd_parse() and the CISTPL_CFTABLE_ENTRY tuple handler.
- */
-#define	CISTPL_PD_MAN(m)	cistpl_pd_struct.mantissa[m&15]
-#define	CISTPL_PD_EXP(e)	cistpl_pd_struct.exponent[e&7]
-typedef struct cistpl_pd_struct_t {
-    uint32_t	*mantissa;
-    uint32_t	*exponent;
-} cistpl_pd_struct_t;
-
-/*
- * These flags are passed to the caller in the cistpl_cftable_entry_t->flags
- *	field and indicate what interface information is available.  The low
- *	order byte of this field is reserved and no flags should be defined
- *	to exist there.
- */
-#define	CISTPL_CFTABLE_TPCE_DEFAULT	0x000000100 /* this is a default conf */
-
-/* interface config description present flags */
-#define	CISTPL_CFTABLE_TPCE_IF		0x000000200 /* if config byte exists */
-/*
- * When the CISTPL_CFTABLE_TPCE_IF flag is set, the following flags
- *	are available in the ifc member of the cistpl_cftable_entry_t
- *	structure.
- */
-#define	CISTPL_CFTABLE_TPCE_IF_MEMORY	0x00	/* memory interface */
-#define	CISTPL_CFTABLE_TPCE_IF_IO_MEM	0x01	/* IO and memory */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_2	0x02	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_3	0x03	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_0	0x04	/* custom interface 0 */
-#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_1	0x05	/* custom interface 1 */
-#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_2	0x06	/* custom interface 2 */
-#define	CISTPL_CFTABLE_TPCE_IF_CUSTOM_3	0x07	/* custom interface 3 */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_8	0x08	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_9	0x09	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_a	0x0a	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_b	0x0b	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_c	0x0c	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_d	0x0d	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_e	0x0e	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_RSVD_f	0x0f	/* reserved */
-#define	CISTPL_CFTABLE_TPCE_IF_MASK	0x0f	/* interface type mask */
-#define	CISTPL_CFTABLE_TPCE_IF_BVD	0x10	/* BVD active in PRR */
-#define	CISTPL_CFTABLE_TPCE_IF_WP	0x20	/* WP active in PRR */
-#define	CISTPL_CFTABLE_TPCE_IF_RDY	0x40	/* RDY active in PRR */
-#define	CISTPL_CFTABLE_TPCE_IF_MWAIT	0x80	/* WAIT - mem cycles */
-
-/* power description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR	0x000001000 /* power info exists */
-
-/* timing description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_TD	0x000010000 /* timing info exists */
-
-/* I/O description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_IO	0x000100000 /* I/O information exists */
-
-/* IRQ description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_IRQ	0x000200000 /* IRQ information exists */
-
-/* memory space description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM	0x001000000 /* MEM space info exists */
-
-/* misc description present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_MISC	0x002000000 /* MISC info exists */
-
-/* additional information tuples present flags */
-#define	CISTPL_CFTABLE_TPCE_FS_STCE_EV	0x004000000 /* STCE_EV exists */
-#define	CISTPL_CFTABLE_TPCE_FS_STCE_PD	0x008000000 /* STCE_PD exists */
-
-/*
- * Power description flags and structures.
- *
- * The following eight values represent what the power description structure
- *	parameter selection byte tells us is present.  A copy of this byte
- *	is in the low order byte of each parameter's flag field.
- */
-#define	CISTPL_CFTABLE_PD_NOMV		0x001	/* nominal supply voltage */
-#define	CISTPL_CFTABLE_PD_MINV		0x002	/* minimum supply voltage */
-#define	CISTPL_CFTABLE_PD_MAXV		0x004	/* maximum supply voltage */
-#define	CISTPL_CFTABLE_PD_STATICI	0x008	/* continuous supply current */
-		/* max current required averaged over 1 second */
-#define	CISTPL_CFTABLE_PD_AVGI		0x010
-		/* maximum current required averaged over 10mS */
-#define	CISTPL_CFTABLE_PD_PEAKI		0x020
-		/* power down supply curent required */
-#define	CISTPL_CFTABLE_PD_PDOWNI	0x040
-		/* power supply is about to blow up */
-#define	CISTPL_CFTABLE_PD_RFU		0x080
-
-/*
- * For each voltage/current parameter, there is an associated flags field.
- *	The following flags are in this field.  The low order byte of each
- *	of these flags fields also contains a copy of the power description
- *	structure parameter selection byte as read from the tuple, that's why
- *	we start the flag values at 0x0100 and go up from there.
- */
-		/* this parameter exists */
-#define	CISTPL_CFTABLE_PD_EXISTS	0x000000100
-		/* multiply return value by 10 */
-#define	CISTPL_CFTABLE_PD_MUL10		0x000000200
-		/* no connection on sleep/power down */
-#define	CISTPL_CFTABLE_PD_NC_SLEEP	0x000001000
-		/* zero value required */
-#define	CISTPL_CFTABLE_PD_ZERO		0x000002000
-		/* no connection ever */
-#define	CISTPL_CFTABLE_PD_NC		0x000004000
-
-typedef struct cistpl_cftable_entry_pwr_t {
-	uint32_t	nomV;		/* nominal supply voltage */
-	uint32_t	nomV_flags;
-	uint32_t	minV;		/* minimum supply voltage */
-	uint32_t	minV_flags;
-	uint32_t	maxV;		/* maximum supply voltage */
-	uint32_t	maxV_flags;
-	uint32_t	staticI;	/* continuous supply current */
-	uint32_t	staticI_flags;
-	uint32_t	avgI;		/* max current required */
-					/* averaged over 1 sec. */
-	uint32_t	avgI_flags;
-	uint32_t	peakI;		/* max current required */
-					/* averaged over 10mS */
-	uint32_t	peakI_flags;
-	uint32_t	pdownI;		/* power down supply curent required */
-	uint32_t	pdownI_flags;
-} cistpl_cftable_entry_pwr_t;
-
-/*
- * Flags for the global power description structure.  These show up in
- *	the flags field of the structure.
- */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VCC	0x000000001 /* Vcc description valid  */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP1	0x000000002 /* vpp1 description valid */
-#define	CISTPL_CFTABLE_TPCE_FS_PWR_VPP2	0x000000004 /* Vpp2 description valid */
-
-typedef struct cistpl_cftable_entry_pd_t {
-	uint32_t	flags; /* which descriptions are valid */
-	struct cistpl_cftable_entry_pwr_t pd_vcc; /* VCC power description */
-	struct cistpl_cftable_entry_pwr_t pd_vpp1; /* Vpp1 power description */
-	struct cistpl_cftable_entry_pwr_t pd_vpp2; /* Vpp2 power description */
-} cistpl_cftable_entry_pd_t;
-
-/*
- * Device speed structure.  Each field is only valid if the
- *	CISTPL_CFTABLE_TPCE_FS_TD flag is set.
- *
- * The following flags describe which timing information is available.
- *	They appear in the flags field of the device speed structure.
- */
-		/* WAIT timing exists */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_WAIT	0x000000001
-		/* RDY/BSY timing exists */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_RDY	0x000000002
-		/* RSVD timing exists */
-#define	CISTPL_CFTABLE_TPCE_FS_TD_RSVD	0x000000004
-
-typedef struct cistpl_cftable_entry_speed_t {
-    uint32_t	flags;		/* which timing information is present */
-    uint32_t	wait;		/* max WAIT time in device speed format */
-    uint32_t	nS_wait;	/* max WAIT time in nS */
-    uint32_t	rdybsy;		/* max RDY/BSY time in device speed format */
-    uint32_t	nS_rdybsy;	/* max RDY/BSY time in nS */
-    uint32_t	rsvd;		/* max RSVD time in device speed format */
-    uint32_t	nS_rsvd;	/* max RSVD time in nS */
-} cistpl_cftable_entry_speed_t;
-
-/*
- * Device I/O range description structures.  Only valid if the
- *	CISTPL_CFTABLE_TPCE_FS_IO flag is set.
- *
- * The following flags describe the IO description information. They
- *	appear in the flags field of the IO space description structure.
- */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS	0x060	/* bus width mask */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS8	0x020	/* 8-bit flag */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_BUS16	0x040	/* 16-bit flag */
-#define	CISTPL_CFTABLE_TPCE_FS_IO_RANGE	0x080	/* IO address ranges exist */
-
-typedef struct cistpl_cftable_entry_io_range_t {
-    uint32_t	addr;		/* I/O start address */
-    uint32_t	length;		/* I/O register length */
-} cistpl_cftable_entry_io_range_t;
-typedef struct cistpl_cftable_entry_io_t {
-    uint32_t	flags;		/* direct copy of TPCE_IO byte in tuple */
-    uint32_t	addr_lines;	/* number of decoded I/O address lines */
-    uint32_t	ranges;		/* number of I/O ranges */
-    struct cistpl_cftable_entry_io_range_t
-	    range[CISTPL_CFTABLE_ENTRY_MAX_IO_RANGES];
-} cistpl_cftable_entry_io_t;
-
-/*
- * Device IRQ description structure.  Only valid if the
- *	CISTPL_CFTABLE_TPCE_FS_IRQ flag is set.
- */
-typedef struct cistpl_cftable_entry_irq_t {
-    uint32_t	flags;		/* direct copy of TPCE_IR byte in tuple */
-    uint32_t	irqs;		/* bit mask for each allowed IRQ */
-} cistpl_cftable_entry_irq_t;
-
-/*
- * Device memory space description structure.  Only valid if the
- *	CISTPL_CFTABLE_TPCE_FS_MEM flag is set.
- *
- * The following flags describe the memory description information.  They
- *	appear in the flags field of the memory space description structure.
- */
-		/* space descriptors */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM3	0x000000001
-		/* host_addr=card_addr */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM2	0x000000002
-		/* card address=0, any host address */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM1	0x000000004
-		/* if host address is present in MEM3 */
-#define	CISTPL_CFTABLE_TPCE_FS_MEM_HOST	0x000000008
-
-typedef struct cistpl_cftable_entry_mem_window_t {
-    uint32_t	length;		/* length of this window */
-    uint32_t	card_addr;	/* card address */
-    uint32_t	host_addr;	/* host address */
-} cistpl_cftable_entry_mem_window_t;
-typedef struct cistpl_cftable_entry_mem_t {
-    uint32_t	flags;		/* memory desc type and host addr info */
-    uint32_t	windows;	/* number of memory space descriptors */
-    cistpl_cftable_entry_mem_window_t
-	    window[CISTPL_CFTABLE_ENTRY_MAX_MEM_WINDOWS];
-} cistpl_cftable_entry_mem_t;
-
-/*
- * Devices misc description structure.  Only valid if the
- *	CISTPL_CFTABLE_TPCE_FS_MISC flag is set.
- */
-#define	CISTPL_CFTABLE_TPCE_FS_MISC_MAX	2	   /* # bytes we understand */
-#define	CISTPL_CFTABLE_TPCE_MI_MTC_MASK	0x00000007 /* max twin cards mask */
-#define	CISTPL_CFTABLE_TPCE_MI_AUDIO	0x00000008 /* audio on BVD2 */
-#define	CISTPL_CFTABLE_TPCE_MI_READONLY	0x00000010 /* R/O storage */
-#define	CISTPL_CFTABLE_TPCE_MI_PWRDOWN	0x00000020 /* powerdown capable */
-#define	CISTPL_CFTABLE_TPCE_MI_DRQ_MASK	0x00000c00 /* DMAREQ mask */
-#define	CISTPL_CFTABLE_TPCE_MI_DRQ_SPK	0x00000400 /* DMAREQ on SPKR */
-#define	CISTPL_CFTABLE_TPCE_MI_DRQ_IOIS	0x00000800 /* DMAREQ on IOIS16 */
-#define	CISTPL_CFTABLE_TPCE_MI_DRQ_INP	0x00000c00 /* DMAREQ on INPACK */
-#define	CISTPL_CFTABLE_TPCE_MI_DMA_8	0x00000000 /* DMA width 8 bits */
-#define	CISTPL_CFTABLE_TPCE_MI_DMA_16	0x00001000 /* DMA width 16 bits */
-
-typedef struct cistpl_cftable_entry_misc_t {
-    uint32_t	flags;		/* misc features flags */
-} cistpl_cftable_entry_misc_t;
-
-/*
- * Additional information sub-tuples defines and structure
- */
-#define	STCE_EV		0x0c0	/* Environment Descriptor Subtuple */
-#define	STCE_PD		0x0c1	/* Physical Device Name Subtuple */
-typedef struct cistpl_cftable_entry_stce_ev_t {
-	char	stev_strs[CIS_MAX_TUPLE_DATA_LEN];
-} cistpl_cftable_entry_stce_ev_t;
-
-typedef struct cistpl_cftable_entry_stce_pd_t {
-	char	stpd_strs[CIS_MAX_TUPLE_DATA_LEN];
-} cistpl_cftable_entry_stce_pd_t;
-
-/*
- * cistpl_cftable_entry_t - this is the struct that the caller passes
- *				to the CISTPL_CFTABLE_ENTRY handler
- */
-typedef struct cistpl_cftable_entry_t {
-    uint32_t	flags;		/* which descriptions are valid */
-    uint32_t	ifc;		/* interface description info */
-    uint32_t	pin;		/* values for PRR */
-    uint32_t	index;		/* configuration index number */
-    struct cistpl_cftable_entry_pd_t	pd; /* power requirements description */
-    struct cistpl_cftable_entry_speed_t	speed; /* device speed description */
-    struct cistpl_cftable_entry_io_t	io; /* device I/O map */
-    struct cistpl_cftable_entry_irq_t	irq; /* device IRQ utilization */
-    struct cistpl_cftable_entry_mem_t	mem; /* device memory space */
-    struct cistpl_cftable_entry_misc_t	misc; /* misc device features */
-} cistpl_cftable_entry_t;
-
-/*
- * CISTPL_LINKTARGET
- *
- * This tuple is used to verify that tuple chains other than the primary
- *	chain which starts at offset 0 in Attribute Memory are valid. All
- *	secondary tuple chains are required to contain this tuple as the
- *	first tuple of the chain.
- * This tuple must have a link field of at least MIN_LINKTARGET_LENGTH and
- *	must contain the byte pattern CISTPL_LINKTARGET_MAGIC.
- * LINKTARGET_AC_HEADER_LENGTH is the number of bytes contained in a
- *	valid CISTPL_LINKTARGET tuple header.
- */
-#define	MIN_LINKTARGET_LENGTH		3
-#define	CISTPL_LINKTARGET_MAGIC		"CIS"
-#define	LINKTARGET_AC_HEADER_LENGTH	2
-
-typedef struct cistpl_linktarget_t {
-	uint32_t	length;		/* number of bytes in tpltg_tag */
-	char	tpltg_tag[CIS_MAX_TUPLE_DATA_LEN];
-} cistpl_linktarget_t;
-
-/*
- * CISTPL_LONGLINK_A and CISTPL_LONGLINK_C
- *
- * Both of these tuples are processed the same way. The target address is
- *	really an offset from the beginning of the specified address space
- *	and is not a virtual address.
- * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH.
- */
-#define	MIN_LONGLINK_AC_LENGTH		4
-
-typedef struct cistpl_longlink_ac_t {
-	uint32_t		flags;		/* space flags */
-	uint32_t		tpll_addr;	/* target address, normalized */
-} cistpl_longlink_ac_t;
-/*
- * Flags for cistpl_longlink_ac_t->flags
- */
-#define	CISTPL_LONGLINK_AC_AM	0x0001	/* longlink to AM */
-#define	CISTPL_LONGLINK_AC_CM	0x0002	/* longlink to CM */
-
-/*
- * CISTPL_LONGLINK_MFC
- *
- * This tuple describes the start of the function-specific CIS for each
- *	function on a multi-function card.
- *
- * This tuple must have a link field of at least MIN_LONGLINK_AC_LENGTH.
- */
-#define	MIN_LONGLINK_MFC_LENGTH		6
-#define	MIN_LONGLINK_MFC_NREGS		1
-
-typedef struct cis_function_t {
-	uint32_t	tas;    /* target address space of function */
-	uint32_t	addr;   /* target address offset */
-} cis_function_t;
-
-typedef struct cistpl_longlink_mfc_t {
-	uint32_t	nfuncs;		/* number of functions */
-	uint32_t	nregs;		/* number of config register sets */
-	cis_function_t	function[CIS_MAX_FUNCTIONS];
-} cistpl_longlink_mfc_t;
-/*
- * Flags for cistpl_longlink_mfc_t->function[n]->tas
- */
-#define	CISTPL_LONGLINK_MFC_TAS_AM	0x00	/* CIS in attribute memory */
-#define	CISTPL_LONGLINK_MFC_TAS_CM	0x01	/* CIS in common memory */
-
-/*
- * CISTPL_LONGLINK_CB
- *
- * This tuple describes the start of a function's CIS chain
- *	for CardBus cards
- */
-typedef struct cistpl_longlink_cb_t {
-	uint32_t	flags;		/* address space flags */
-	uint32_t	addr;		/* raw (unproessed) address value */
-	union {
-	    /* device-dependant config space info */
-	    struct {
-		uint32_t	offset;	/* offset within config space */
-	    } cfg;
-	    /* memory space info */
-	    struct {
-		uint32_t	asi;	/* BAR */
-		uint32_t	offset;	/* offset within BAR space */
-	    } mem;
-	    /* expansion ROM space info */
-	    struct {
-		uint32_t	image;	/* image number */
-		uint32_t	offset;	/* offset from iamge base */
-	    } rom;
-	} space;
-} cistpl_longlink_cb_t;
-/*
- * Flags for cistpl_longlink_cb_t->flags
- */
-#define	CISTPL_LONGLINK_CB_CFG	0x0001	/* config space info valid */
-#define	CISTPL_LONGLINK_CB_MEM	0x0002	/* memory space info valid */
-#define	CISTPL_LONGLINK_CB_ROM	0x0004	/* expansion ROM space info valid */
-
-/*
- * CISTPL_SPCL
- *
- * This tuple is the Special Purpose tuple and it's contents are dependant
- *	on the meaning of the header information in this tuple.
- */
-typedef struct cistpl_spcl_t {
-	uint32_t	id;		/* tuple contents identification */
-	uint32_t	seq;		/* data sequence number */
-	uint32_t	bytes;		/* number of bytes following */
-	uchar_t		data[CIS_MAX_TUPLE_DATA_LEN];
-} cistpl_spcl_t;
-/*
- * Flags for cistpl_spcl_t->seq
- */
-#define	CISTPL_SPCL_SEQ_END	0x080	/* last tuple in sequence */
-
-/*
- * CISTPL_SWIL
- *
- * This tuple describes the software interleaving of data within a
- *	partition on the card.
- */
-typedef struct cistpl_swil_t {
-	uint32_t	intrlv;		/* interleave */
-} cistpl_swil_t;
-
-/*
- * CISTPL_BAR
- *
- * This tuple describes the CardBus Base Address Registers
- */
-typedef struct cistpl_bar_t {
-	uint32_t	attributes;	/* attributes */
-	uint32_t	size;		/* BAR size */
-} cistpl_bar_t;
-/*
- * Flags for cistpl_bar_t->attributes
- */
-#define	CISTPL_BAR_ASI_MASK	0x007	/* Base Address Register mask */
-#define	CISTPL_BAR_ASI_BAR_1	0x001	/* Base Address Register 1 */
-#define	CISTPL_BAR_ASI_BAR_2	0x002	/* Base Address Register 2 */
-#define	CISTPL_BAR_ASI_BAR_3	0x003	/* Base Address Register 3 */
-#define	CISTPL_BAR_ASI_BAR_4	0x004	/* Base Address Register 4 */
-#define	CISTPL_BAR_ASI_BAR_5	0x005	/* Base Address Register 5 */
-#define	CISTPL_BAR_ASI_BAR_6	0x006	/* Base Address Register 6 */
-#define	CISTPL_BAR_ASI_BAR_7	0x007	/* Base Address Register 7 */
-#define	CISTPL_BAR_ASI_EXP_ROM	0x007	/* Expansion ROM BAR */
-
-#define	CISTPL_BAR_AS_MEM	0x000	/* BAR is of type memory */
-#define	CISTPL_BAR_AS_IO	0x008	/* BAR is of type IO */
-
-#define	CISTPL_BAR_PREFETCH_CACHE_MASK	0x060	/* prefetch/cache mask */
-#define	CISTPL_BAR_PREFETCH		0x020	/* prefetchable not cacheable */
-#define	CISTPL_BAR_PREFETCH_CACHE	0x040	/* prefetchable and cacheable */
-
-#define	CISTPL_BAR_BELOW_1MB	0x080	/* must locate within first MB */
-
-/*
- * CISTPL_DEVICEGEO and CISTPL_DEVICEGEO_A
- *
- * These tuples describe the device geometry of memory partitions.
- */
-#define	CISTPL_DEVICEGEO_MAX_PARTITIONS	42
-typedef struct cistpl_devicegeo_info_t {
-	uint32_t	bus;		/* card interface width in bytes */
-	uint32_t	ebs;		/* minimum erase block size */
-	uint32_t	rbs;		/* minimum read block size */
-	uint32_t	wbs;		/* minimum write bock size */
-	uint32_t	part;		/* segment partition subdivisions */
-	uint32_t	hwil;		/* hardware interleave */
-} cistpl_devicegeo_info_t;
-typedef struct cistpl_devicegeo_t {
-	cistpl_devicegeo_info_t	info[CISTPL_DEVICEGEO_MAX_PARTITIONS];
-} cistpl_devicegeo_t;
-
-/*
- * The cistpl_get_tuple_name_t used to support the HANDTPL_RETURN_NAME
- *	operation of the CIS parser.
- */
-typedef struct cistpl_get_tuple_name_t {
-	char	name[CIS_MAX_TUPLE_NAME_LEN];
-} cistpl_get_tuple_name_t;
-
-/*
- * cisparse_t - the structure that unifies all tuple parsing structures
- */
-typedef union cisparse_t {
-	cistpl_config_t		cistpl_config;
-	cistpl_device_t		cistpl_device;
-	cistpl_vers_1_t		cistpl_vers_1;
-	cistpl_vers_2_t		cistpl_vers_2;
-	cistpl_jedec_t		cistpl_jedec;
-	cistpl_format_t		cistpl_format;
-	cistpl_geometry_t	cistpl_geometry;
-	cistpl_byteorder_t	cistpl_byteorder;
-	cistpl_date_t		cistpl_date;
-	cistpl_battery_t	cistpl_battery;
-	cistpl_org_t		cistpl_org;
-	cistpl_manfid_t		cistpl_manfid;
-	cistpl_funcid_t		cistpl_funcid;
-	cistpl_funce_t		cistpl_funce;
-	cistpl_cftable_entry_t	cistpl_cftable_entry;
-	cistpl_linktarget_t	cistpl_linktarget;
-	cistpl_longlink_ac_t	cistpl_longlink_ac;
-	cistpl_longlink_mfc_t	cistpl_longlink_mfc;
-	cistpl_spcl_t		cistpl_spcl;
-	cistpl_swil_t		cistpl_swil;
-	cistpl_bar_t		cistpl_bar;
-	cistpl_devicegeo_t	cistpl_devicegeo;
-	cistpl_longlink_cb_t	cistpl_longlink_cb;
-	cistpl_get_tuple_name_t	cistpl_get_tuple_name;
-	/* members below are for legacy support - REMOVE THEM BEFORE FCS!! */
-	cistpl_config_t		config;
-	cistpl_device_t		device;
-	cistpl_vers_1_t		version_1;
-	cistpl_vers_2_t		version_2;
-	cistpl_jedec_t		jedec;
-	cistpl_format_t		format;
-	cistpl_geometry_t	geometry;
-	cistpl_byteorder_t	byteorder;
-	cistpl_date_t		date;
-	cistpl_battery_t	battery;
-	cistpl_org_t		org;
-	cistpl_manfid_t		manfid;
-	cistpl_funcid_t		funcid;
-	cistpl_funce_t		funce;
-	cistpl_cftable_entry_t	cftable;
-	cistpl_linktarget_t	linktarget;
-	cistpl_longlink_ac_t	longlink_ac;
-	cistpl_longlink_mfc_t	longlink_mfc;
-	cistpl_spcl_t		spcl;
-	cistpl_swil_t		swil;
-	cistpl_bar_t		bar;
-	cistpl_devicegeo_t	devgeo;
-	cistpl_longlink_cb_t	longlink_cb;
-	cistpl_get_tuple_name_t	tuple_name;
-} cisparse_t;
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CIS_HANDLERS_H */
--- old/usr/src/uts/common/pcmcia/sys/cis_protos.h	2014-11-12 17:44:41.188749969 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,113 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1999,2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _CIS_PROTOS_H
-#define	_CIS_PROTOS_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains all of the function prototypes for functions
- *	used by the CIS interpreter.
- *
- * Prototypes for general functions
- */
-uint32_t	cis_list_create(cistpl_callout_t *, cs_socket_t *);
-uint32_t	cis_list_destroy(cs_socket_t *);
-uint32_t	cis_list_lcreate(cistpl_callout_t *, cisptr_t *,
-			cis_info_t *, cisparse_t *, cs_socket_t *);
-uint32_t	cis_list_ldestroy(cistpl_t **);
-cistpl_t	*cis_get_ltuple(cistpl_t *, cisdata_t, uint32_t);
-uint32_t	cistpl_devspeed(cistpl_t *, cisdata_t, uint32_t);
-uint32_t	cistpl_expd_parse(cistpl_t *, uint32_t *);
-uint32_t	cis_convert_devspeed(convert_speed_t *);
-uint32_t	cis_convert_devsize(convert_size_t *);
-uint32_t	cis_validate_longlink_acm(cisptr_t *);
-
-/*
- * Prototypes for the tuple handlers
- */
-uint32_t	cis_tuple_handler(cistpl_callout_t *, cistpl_t *, uint32_t,
-					void *, cisdata_t);
-uint32_t	cis_no_tuple_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cis_unknown_tuple_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_vers_1_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_config_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_device_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_cftable_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_jedec_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_vers_2_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_format_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_geometry_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_byteorder_handler(cistpl_callout_t *,
-					cistpl_t *, uint32_t, void *);
-uint32_t	cistpl_date_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_battery_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_org_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_funcid_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_funce_serial_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_funce_lan_handler(cistpl_callout_t *,
-					cistpl_t *, uint32_t, void *);
-uint32_t	cistpl_manfid_handler(cistpl_callout_t *, cistpl_t *,
-					uint32_t, void *);
-uint32_t	cistpl_linktarget_handler(cistpl_callout_t *,
-					cistpl_t *, uint32_t, void *);
-uint32_t	cistpl_longlink_ac_handler(cistpl_callout_t *,
-					cistpl_t *, uint32_t, void *);
-uint32_t	cistpl_longlink_mfc_handler(cistpl_callout_t *,
-					cistpl_t *, uint32_t, void *);
-
-char	*cis_getstr(cistpl_t *);
-
-#ifdef	_KERNEL
-caddr_t	cis_malloc(size_t);
-void	cis_free(caddr_t);
-#endif	/* _KERNEL */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CIS_PROTOS_H */
--- old/usr/src/uts/common/pcmcia/sys/cs.h	2014-11-12 17:44:41.240117856 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,1228 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _CS_H
-#define	_CS_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * PCMCIA Card Services header file
- */
-
-/*
- * XXX - This define really should be in a global header file
- *	somewhere; we do this stunt here since a lot of
- *	people include this header file but not necessarily
- *	the header file in which this is defined.
- */
-#ifndef	_VERSION
-#define	_VERSION(major, minor)	((major)<<16|(minor))
-#endif
-
-/*
- * Define this version of CS - this should correspond to the PCMCIA
- *	version number specified in the PCMCIA standard.
- */
-#define	CS_VERSION	_VERSION(5, 2)
-
-/*
- * CS_INTERNAL_REVISION_LEVEL is our internal revision level value returned
- *	via GetCardServicesInfo in get_cardservices_info_t->Revision
- */
-#define	CS_INTERNAL_REVISION_LEVEL	_VERSION(2, 0)
-
-#define	CS_GET_CARDSERVICES_INFO_VENDOR_STRING	"Solaris UNIX Card Services\n" \
-	"Copyright 2008 Sun Microsystems, Inc.  All rights reserved.\n" \
-	"Use is subject to license terms.\n" \
-	"@(#)cs.h	1.69 08/10/17 SMI\n" \
-	"Based on the PC Card Standard, February 1995\n"
-
-/*
- * typedef for function pointers to quiet lint and cc -v
- */
-typedef	int32_t (csfunction_t)(int32_t, ...);	/* for lint - cc -v quieting */
-
-/*
- * CS_SUN_VENDOR_DESCRIPTION - can be returned by clients handling
- *				the CS_EVENT_CLIENT_INFO event in the
- *				client_info_t->VendorName member.
- */
-#define	CS_SUN_VENDOR_DESCRIPTION	"Sun Microsystems, Inc. (c) 1996"
-
-/*
- * Return codes from Card Services - these correspond to the PCMCIA
- *	standard and also include some implementation-specific return
- *	codes.
- */
-#define	CS_SUCCESS		0x00	/* Request succeeded */
-#define	CS_BAD_ADAPTER		0x01	/* Specified adapter is invalid */
-#define	CS_BAD_ATTRIBUTE	0x02	/* Bad attribute value */
-#define	CS_BAD_BASE		0x03	/* System base address invalid */
-#define	CS_BAD_EDC		0x04	/* EDC generator is invalid */
-	/* RESERVED - 0x05 */
-#define	CS_BAD_IRQ		0x06	/* Invalid IRQ */
-#define	CS_BAD_OFFSET		0x07	/* Card offset invalid */
-#define	CS_BAD_PAGE		0x08	/* Card page invalid */
-#define	CS_READ_FAILURE		0x09	/* Unable to complete read request */
-#define	CS_BAD_SIZE		0x0a	/* Size is invalid */
-#define	CS_BAD_SOCKET		0x0b	/* Specified socket is invalid */
-	/* RESERVED - 0x0c */
-#define	CS_BAD_TYPE		0x0d	/* Window/interface type invalid */
-#define	CS_BAD_VCC		0x0e	/* Vcc value/index invalid */
-#define	CS_BAD_VPP		0x0f	/* Vpp value/index invalid */
-#define	CS_BAD_WINDOW		0x11	/* Specified window is invalid */
-#define	CS_WRITE_FAILURE	0x12	/* Unable to complete write request */
-	/* RESERVED - 0x13 */
-#define	CS_NO_CARD		0x14	/* No PC card in socket */
-#define	CS_UNSUPPORTED_FUNCTION	0x15	/* Unsupported function */
-#define	CS_UNSUPPORTED_MODE	0x16	/* Unsupported processor mode */
-#define	CS_BAD_SPEED		0x17	/* Specified speed is unavailable */
-#define	CS_BUSY			0x18	/* CS is busy - try again later */
-#define	CS_GENERAL_FAILURE	0x19	/* Undefined error */
-#define	CS_WRITE_PROTECTED	0x1a	/* Media is write protected */
-#define	CS_BAD_ARG_LENGTH	0x1b	/* Arg length invalid */
-#define	CS_BAD_ARGS		0x1c	/* Arg values invalid */
-#define	CS_CONFIGURATION_LOCKED	0x1d	/* This configuration is locked */
-#define	CS_IN_USE		0x1e	/* Requested resource in use */
-#define	CS_NO_MORE_ITEMS	0x1f	/* No more of requested item */
-#define	CS_OUT_OF_RESOURCE	0x20	/* Internal CS resources exhausted */
-#define	CS_BAD_HANDLE		0x21	/* client or window handle invalid */
-
-/*
- * The following are Solaris-specific extended return codes
- */
-#define	CS_NO_CIS		0x80	/* No CIS on card */
-#define	CS_BAD_CIS		0x81	/* Bad CIS on card */
-#define	CS_UNKNOWN_TUPLE	0x82	/* unknown tuple */
-#define	CS_BAD_VERSION		0x83	/* bad CS version */
-#define	CS_UNSUPPORTED_EVENT	0x84	/* Unsupported event in client */
-#define	CS_CSI_ERROR		0x85	/* error in csi driver protocol */
-#define	CS_CSI_NOT_INIT		0x86	/* csi library/driver not initialized */
-#define	CS_NO_TUPLE_PARSER	0x87	/* no tuple parser for this tuple */
-#define	CS_CARD_NOT_READY	0x88	/* card not ready */
-#define	CS_ERRORLIST_END	0x8000	/* end of error list */
-
-/*
- * Card Services event codes - these do NOT correspond to the PCMCIA
- *	standard event codes for CS since these events are encoded as
- *	bit flags, while the PCMCIA standard event codes are encoded
- *	as numerical values.  In practice, this shouldn't be a problem
- *	since no one should be looking at the absolute value of the
- *	event codes; these defines should be used.
- *
- * The numerical value of an event code determines in what order a client
- *	will receive the event if other events are also pending for that
- *	client. XXX - need to make event_t a 64-bit field.
- *
- * Card Services receives these events from Socket Services or by reading
- *	the card's Pin Replacement Register.  In either case, the client
- *	always gets the same type of notification.
- */
-#define	CS_EVENT_REGISTRATION_COMPLETE	0x00000001 /* 0x82 */
-#define	CS_EVENT_PM_RESUME		0x00000002 /* 0x05 */
-#define	CS_EVENT_CARD_INSERTION		0x00000004 /* 0x0c */
-#define	CS_EVENT_CARD_READY		0x00000008 /* 0x01 */
-#define	CS_EVENT_BATTERY_LOW		0x00000010 /* 0x02 is also BVD2 */
-#define	CS_EVENT_BATTERY_DEAD		0x00000020 /* 0x40 is also BVD1 */
-#define	CS_EVENT_CARD_LOCK		0x00000040 /* 0x03 */
-#define	CS_EVENT_PM_SUSPEND		0x00000080 /* 0x04 */
-#define	CS_EVENT_CARD_RESET		0x00000100 /* 0x11 */
-#define	CS_EVENT_CARD_UNLOCK		0x00000200 /* 0x06 */
-#define	CS_EVENT_EJECTION_COMPLETE	0x00000400 /* 0x07 */
-#define	CS_EVENT_EJECTION_REQUEST	0x00000800 /* 0x08 */
-#define	CS_EVENT_ERASE_COMPLETE		0x00001000 /* 0x81 */
-#define	CS_EVENT_EXCLUSIVE_COMPLETE	0x00002000 /* 0x0d */
-#define	CS_EVENT_EXCLUSIVE_REQUEST	0x00004000 /* 0x0e */
-#define	CS_EVENT_INSERTION_COMPLETE	0x00008000 /* 0x09 */
-#define	CS_EVENT_INSERTION_REQUEST	0x00010000 /* 0x0a */
-#define	CS_EVENT_RESET_COMPLETE		0x00020000 /* 0x80 */
-#define	CS_EVENT_RESET_PHYSICAL		0x00040000 /* 0x0f */
-#define	CS_EVENT_RESET_REQUEST		0x00080000 /* 0x10 */
-#define	CS_EVENT_MTD_REQUEST		0x00100000 /* 0x12 */
-#define	CS_EVENT_CLIENT_INFO		0x00200000 /* 0x14 */
-#define	CS_EVENT_TIMER_EXPIRED		0x00400000 /* 0x15 */
-#define	CS_EVENT_WRITE_PROTECT		0x01000000 /* 0x17 */
-
-/*
- * The CS_EVENT_SS_UPDATED event is generated when Socket Services
- *	has completed parsing the CIS and has done any necessary
- *	work to get the client driver loaded and attached.
- */
-#define	CS_EVENT_SS_UPDATED		0x00800000 /* 0x16 */
-
-/*
- * The CS_EVENT_STATUS_CHANGE event is generated by a Socket Services
- *	PCE_CARD_STATUS_CHANGE event; this event gets converted to
- *	the appropriate Card Services events when Card Services
- *	reads the PRR.
- */
-#define	CS_EVENT_STATUS_CHANGE		0x02000000 /* ?? */
-
-/*
- * The CS_EVENT_CARD_REMOVAL is the last "real" CS event and must
- *	have the highest value of all "real" CS events so that this
- *	event is handed to the client after all other queued events
- *	have been processed.
- * If the client has set the CS_EVENT_CARD_REMOVAL_LOWP flag in
- *	either of their event masks, then they will also receive
- *	a CS_EVENT_CARD_REMOVAL at low (cs_event_thread) priority;
- *	in this low priority removal event, the client can call
- *	many CS functions that they can't call when they recieve
- *	the high priority removal event.
- */
-#define	CS_EVENT_CARD_REMOVAL		0x10000000 /* 0x0b */
-#define	CS_EVENT_CARD_REMOVAL_LOWP	0x20000000 /* ?? */
-/*
- * The following are not events but they share the event flags field
- *	and are used internally by CS.  These bit patterns will never
- *	be seen by clients.
- * CS_EVENT_ALL_CLIENTS can only be set by the super-client and by
- *	the CSI clients; setting this bit causes the driver to
- *	receive any events specified in their event masks whenever
- *	any such events occur on the socket.
- * CS_EVENT_READY_TIMEOUT is a CS-private flag and should never be
- *	set by clients.
- */
-#define	CS_EVENT_ALL_CLIENTS		0x40000000 /* ?? */
-#define	CS_EVENT_READY_TIMEOUT		0x80000000 /* ?? */
-
-/*
- * CS_EVENT_CLIENT_EVENTS_MASK is a msk of events that only the framework
- *	is allowed to manipulate.
- */
-#define	CS_EVENT_CLIENT_EVENTS_MASK	~(CS_EVENT_SS_UPDATED |		\
-						CS_EVENT_ALL_CLIENTS |	\
-						CS_EVENT_CARD_REMOVAL_LOWP)
-
-/*
- * client_info_t structure used by clients for a CS_EVENT_CLIENT_INFO
- *	event and for the GetClientInfo function.
- */
-#define	CS_CLIENT_INFO_MAX_NAME_LEN	80
-typedef struct client_info_t {
-	uint32_t	Attributes;
-	uint32_t	Revision;	/* BCD value of client revision */
-	uint32_t	CSLevel;	/* BCD value of CS release */
-	uint32_t	RevDate;	/* revision date */
-	char		ClientName[CS_CLIENT_INFO_MAX_NAME_LEN];
-	char		VendorName[CS_CLIENT_INFO_MAX_NAME_LEN];
-	char		DriverName[MODMAXNAMELEN];
-} client_info_t;
-
-/*
- * Flags for client_info_t->Attributes
- *
- * The low order byte bit values are used to return the data passed
- *	in to RegisterClient in the client_reg_t->Attributes member.
- */
-#define	CS_CLIENT_INFO_SOCKET_SERVICES	INFO_SOCKET_SERVICES
-#define	CS_CLIENT_INFO_IO_CLIENT	INFO_IO_CLIENT
-#define	CS_CLIENT_INFO_MTD_CLIENT	INFO_MTD_CLIENT
-#define	CS_CLIENT_INFO_MEM_CLIENT	INFO_MEM_CLIENT
-#define	CS_CLIENT_INFO_CSI_CLIENT	INFO_CSI_CLIENT
-#define	CS_CLIENT_INFO_CARD_SHARE	INFO_CARD_SHARE
-#define	CS_CLIENT_INFO_CARD_EXCL	INFO_CARD_EXCL
-#define	CS_CLIENT_INFO_CLIENT_MASK	0x000000ff
-/*
- * Control and status flags.
- */
-#define	CS_CLIENT_INFO_VALID		0x00010000	/* client info valid */
-#define	CS_CLIENT_INFO_CLIENT_ACTIVE	0x00020000	/* client is for card */
-#define	CS_CLIENT_INFO_FLAGS_MASK	0xffff0000
-/*
- * Client Info subservice flags and types.
- */
-#define	CS_CLIENT_INFO_SUBSVC_CS	0x00000000	/* CS client data */
-#define	CS_CLIENT_INFO_SUBSVC_MASK	0x0000ff00	/* sub-service mask */
-#define	GET_CLIENT_INFO_SUBSVC(s)	(((s) & CS_CLIENT_INFO_SUBSVC_MASK)>>8)
-#define	SET_CLIENT_INFO_SUBSVC(s)	(((s)<<8) & CS_CLIENT_INFO_SUBSVC_MASK)
-
-/*
- * CS_CLIENT_INFO_MAKE_DATE - Macro to make constructing the
- *	client_info_t->RevDate member easier. Parameters are:
- *
- *	day - from 1 to 31
- *	month - from 1 to 12
- *	year - year relative to 1980
- *			00 - 1980
- *			06 - 1986
- *			12 = 1992
- *			16 - 1996, etc...
- */
-#define	CS_CLIENT_INFO_MAKE_DATE(d, m, y)	(((d) & 0x01f) |	\
-						(((m) & 0x0f) << 5) |	\
-						(((y) & 0x7f) << 9))
-#define	CS_CLIENT_INFO_GET_DAY(d)		((d) & 0x1f)
-#define	CS_CLIENT_INFO_GET_MONTH(m)		(((m) >> 5) & 0x0f)
-#define	CS_CLIENT_INFO_GET_YEAR(y)		((((y) >> 9) & 0x7f) + 1980)
-#define	CS_CLIENT_INFO_GET_YEAR_OFFSET(y)	(((y) >> 9) & 0x7f)
-
-/*
- * get_firstnext_client_t_t structure used for GetFirstClient and GetNextClient
- */
-typedef struct get_firstnext_client_t {
-	uint32_t	Socket;
-	uint32_t	Attributes;
-	client_handle_t	client_handle;		/* returned client handle */
-	uint32_t	num_clients;
-} get_firstnext_client_t;
-
-/*
- * Flags for get_firstnext_client_t->Attributes
- */
-#define	CS_GET_FIRSTNEXT_CLIENT_ALL_CLIENTS	0x00000001
-#define	CS_GET_FIRSTNEXT_CLIENT_SOCKET_ONLY	0x00000002
-
-/*
- * The client event callback argument structure - this is passed in to
- *	the client event handler.  Most of these arguments are identical
- *	to the PCMCIA-specified arguments.
- */
-typedef struct event_callback_args_t {
-	client_handle_t	client_handle;
-	void		*info;
-	void		*mtdrequest;
-	void		*buffer;
-	void		*misc;
-	void		*client_data;
-	client_info_t	client_info;
-} event_callback_args_t;
-
-/*
- * Event priority flag passed to the client's event handler; the client
- *	uses this priority to determine which mutex to use.
- */
-#define	CS_EVENT_PRI_LOW	0x0001
-#define	CS_EVENT_PRI_HIGH	0x0002
-#define	CS_EVENT_PRI_NONE	0x0004
-
-/*
- * Event-specific event_callback_args_t->info values
- *
- * CS_EVENT_WRITE_PROTECT
- *	CS_EVENT_WRITE_PROTECT_WPOFF - card is not write protected
- *	CS_EVENT_WRITE_PROTECT_WPON - card is write protected
- */
-#define	CS_EVENT_WRITE_PROTECT_WPOFF	0x0000
-#define	CS_EVENT_WRITE_PROTECT_WPON	0xffff
-
-/*
- * Endinanness and data ordering Attribute bits common to both R2 and
- *	CardBus windows and common to RequestIO, RequestWindow and
- *	DupHandle.
- */
-#define	WIN_ACC_ENDIAN_MASK	0x00300000	/* endian mask */
-#define	WIN_ACC_NEVER_SWAP	0x00000000	/* i/o access: no swap */
-#define	WIN_ACC_BIG_ENDIAN	0x00100000	/* big endian */
-#define	WIN_ACC_LITTLE_ENDIAN	0x00200000	/* little endian */
-
-#define	WIN_ACC_ORDER_MASK	0x00700000	/* order mask */
-#define	WIN_ACC_STRICT_ORDER	0x00000000	/* strict order */
-#define	WIN_ACC_UNORDERED_OK	0x00100000	/* may be re-ordered */
-#define	WIN_ACC_MERGING_OK	0x00200000	/* may merge i/o */
-#define	WIN_ACC_LOADCACHING_OK	0x00300000	/* may cache reads */
-#define	WIN_ACC_STORECACHING_OK	0x00400000	/* may cache all i/o */
-
-/*
- * io_req_t structure used for RequestIO and ReleaseIO
- */
-typedef struct io_req_t {
-	uint32_t	Socket;
-	baseaddru_t	BasePort1;
-	uint32_t	NumPorts1;	/* 1st IO range no. contiguous ports */
-	uint32_t	Attributes1;	/* 1st IO range attributes */
-	baseaddru_t	BasePort2;
-	uint32_t	NumPorts2;	/* 2nd IO range no. contiguous ports */
-	uint32_t	Attributes2;	/* 2nd IO range attributes */
-	uint32_t	IOAddrLines;	/* number of IO address lines decoded */
-} io_req_t;
-
-/*
- * Flags for RequestIO and ReleaseIO
- */
-#define	IO_DATA_WIDTH_MASK	0x00000001	/* data path width mask */
-#define	IO_DATA_WIDTH_8		0x00000000	/* 8 bit data path */
-#define	IO_DATA_WIDTH_16	0x00000001	/* 16 bit data path */
-
-/*
- * The following flags are included for compatability with other versions of
- *	Card Services, but they are not implemented in this version.  They
- *	are assigned values as placeholders only.  If any of these flags
- *	are set on a call to RequestIO, CS_BAD_ATTRIBUTE is returned.
- */
-#define	IO_SHARED		0x00010000	/* for compatability only */
-#define	IO_FIRST_SHARED		0x00020000	/* for compatability only */
-#define	IO_FORCE_ALIAS_ACCESS	0x00040000	/* for compatability only */
-
-/*
- * The following flags are private to Card Services and should never be set
- *	by a client.  Doing so will cause the system to take a supervisor
- *	trap at level twenty-nine.
- */
-#define	IO_DEALLOCATE_WINDOW	0x10000000	/* CS private */
-#define	IO_DISABLE_WINDOW	0x20000000	/* CS private */
-
-/*
- * win_req_t structure used for RequestWindow
- *
- * Note that the ReqOffset member is not defined in the current PCMCIA
- *	spec but is included here to aid clients in determining the
- *	optimum offset to give to MapMemPage.
- */
-typedef struct win_req_t {
-	uint32_t	Socket;
-	uint32_t	Attributes;	/* window flags */
-	union {
-	    uint32_t		base;	/* requested window base address */
-	    acc_handle_t	handle;	/* access handle for base of window */
-	} Base;
-	uint32_t	Size;		/* window size requested/granted */
-	union {
-	    uint32_t		AccessSpeed;	/* window access speed */
-	    uint32_t		IOAddrLines;	/* for I/O windows only */
-	} win_params;
-	uint32_t	ReqOffset;	/* required window offest */
-} win_req_t;
-
-/*
- * modify_win_t structure used for ModifyWindow
- */
-typedef struct modify_win_t {
-	uint32_t	Attributes;	/* window flags */
-	uint32_t	AccessSpeed;	/* window access speed */
-} modify_win_t;
-
-/*
- * Flags for RequestWindow and ModifyWindow
- */
-#define	WIN_MEMORY_TYPE_MASK	0x00000021	/* window type mask */
-#define	WIN_MEMORY_TYPE_CM	0x00000000	/* window points to CM */
-#define	WIN_MEMORY_TYPE_AM	0x00000001	/* window points to AM */
-#define	WIN_MEMORY_TYPE_IO	0x00000020	/* window points to IO */
-
-#define	WIN_DATA_WIDTH_MASK	0x00000042	/* data path width mask */
-#define	WIN_DATA_WIDTH_8	0x00000000	/* 8-bit data path */
-#define	WIN_DATA_WIDTH_16	0x00000002	/* 16-bit data path */
-#define	WIN_DATA_WIDTH_32	0x00000040	/* 32-bit data path */
-
-#define	WIN_ENABLE		0x00000004	/* enable/disable window */
-#define	WIN_OFFSET_SIZE		0x00000008	/* card offsets window sized */
-#define	WIN_ACCESS_SPEED_VALID	0x00000010	/* speed valid (ModifyWindow) */
-
-#define	WIN_PREFETCH_CACHE_MASK	0x00000300	/* prefetch/cache mask */
-#define	WIN_PREFETCH		0x00000100	/* prefetchable not cacheable */
-#define	WIN_PREFETCH_CACHE	0x00000200	/* prefetchable and cacheable */
-
-#define	WIN_BAR_MASK		0x00007000	/* Base Address Register mask */
-#define	WIN_BAR_1		0x00001000	/* Base Address Register 1 */
-#define	WIN_BAR_2		0x00002000	/* Base Address Register 2 */
-#define	WIN_BAR_3		0x00003000	/* Base Address Register 3 */
-#define	WIN_BAR_4		0x00004000	/* Base Address Register 4 */
-#define	WIN_BAR_5		0x00005000	/* Base Address Register 5 */
-#define	WIN_BAR_6		0x00006000	/* Base Address Register 6 */
-#define	WIN_BAR_7		0x00007000	/* Base Address Register 7 */
-
-/*
- * The following flag is used internally by Card Services and should never
- *	be set by the caller.
- */
-#define	WIN_DATA_WIDTH_VALID	0x00008000	/* CS internal */
-
-/*
- * The following flags are included for compatability with other versions of
- *	Card Services, but they are not implemented in this version.  They
- *	are assigned values as placeholders only.  If any of these flags
- *	are set on a call to RequestWindow, CS_BAD_ATTRIBUTE is returned.
- */
-#define	WIN_PAGED		0x00010000	/* for compatability only */
-#define	WIN_SHARED		0x00020000	/* for compatability only */
-#define	WIN_FIRST_SHARED	0x00040000	/* for compatability only */
-#define	WIN_BINDING_SPECIFIC	0x00080000	/* for compatability only */
-
-/*
- * The following flag is actually part of the AccessSpeed member
- */
-#define	WIN_USE_WAIT		0x80	/* use window that supports WAIT */
-
-/*
- * client_reg_t structure for RegisterClient
- */
-typedef struct client_reg_t {
-	uint32_t		Attributes;
-	uint32_t		EventMask;
-	event_callback_args_t	event_callback_args;
-	uint32_t		Version;	/* CS version to expect */
-	csfunction_t		*event_handler;
-	/* DDI support */
-	ddi_iblock_cookie_t	*iblk_cookie;	/* event iblk cookie */
-	ddi_idevice_cookie_t	*idev_cookie;	/* event idev cookie */
-	dev_info_t		*dip;		/* client's dip */
-	char			driver_name[MODMAXNAMELEN];
-	/* CS private */
-	void			*priv;		/* CS private data */
-} client_reg_t;
-
-/*
- * Flags for RegisterClient - some of these flags are also used internally
- *	by CS to sequence the order of event callbacks and to allow Socket
- *	Services to register as a "super" client.
- *
- * The client_reg_t->Attributes structure member uses these flags.
- *
- * The client_info_t->Attributes, client_types_t->type and client_t->flags
- *	tructure members use these flags as well.
- *
- * Client types - mutually exclusive.
- */
-#define	INFO_SOCKET_SERVICES	0x00000001
-#define	INFO_IO_CLIENT		0x00000002
-#define	INFO_MTD_CLIENT		0x00000004
-#define	INFO_MEM_CLIENT		0x00000008
-#define	INFO_CSI_CLIENT		0x00000010
-#define	INFO_CLIENT_TYPE_MASK	(INFO_SOCKET_SERVICES |		\
-					INFO_IO_CLIENT |	\
-					INFO_MTD_CLIENT	|	\
-					INFO_MEM_CLIENT |	\
-					INFO_CSI_CLIENT)
-#define	MAX_CLIENT_TYPES	3	/* doesn't include SS or CSI clients */
-
-/*
- * The following two are for backwards-compatability with the PCMCIA spec.
- *	We will give the client CARD_INSERTION and REGISTRATION_COMPLETE
- *	if either of these two bits are set.  Normally, all IO and MEM
- *	clients should set both of these bits.
- */
-#define	INFO_CARD_SHARE		0x00000020
-#define	INFO_CARD_EXCL		0x00000040
-#define	INFO_CARD_FLAGS_MASK	(INFO_CARD_SHARE | INFO_CARD_EXCL)
-
-/*
- * tuple_t struct used for GetFirstTuple, GetNextTuple, GetTupleData
- *	and ParseTuple
- *
- * Note that the values for DesiredTuple are defined in the cis.h header
- *	file.
- */
-typedef struct tuple_t {
-	uint32_t	Socket;		/* socket number to get tuple from */
-	uint32_t	Attributes;	/* tuple return attributes */
-	cisdata_t	DesiredTuple;	/* tuple to search for or flags */
-	cisdata_t	TupleOffset;	/* offset in tuple data body */
-	uint32_t	Flags;		/* CS private */
-	cistpl_t	*LinkOffset;	/* CS private */
-	cistpl_t	*CISOffset;	/* CS private */
-	cisdata_t	TupleDataMax;	/* max size of tuple data area */
-	cisdata_t	TupleDataLen;	/* actual size of tuple data area */
-					/* tuple body data buffer */
-	cisdata_t	TupleData[CIS_MAX_TUPLE_DATA_LEN];
-	cisdata_t	TupleCode;	/* tuple type code */
-	cisdata_t	TupleLink;	/* tuple data body size */
-} tuple_t;
-
-/*
- * Attribute flags definitions for CS tuple functions.
- *
- */
-#define	TUPLE_RETURN_LINK		0x00000002 /* return link tuples */
-#define	TUPLE_RETURN_IGNORED_TUPLES	0x00010000 /* return ignored tuples */
-#define	TUPLE_RETURN_NAME		0x00020000 /* return tuple name */
-
-/*
- * cisinfo_t structure used for ValidateCIS
- */
-typedef struct cisinfo_t {
-	uint32_t	Socket;		/* socket number to validate CIS on */
-	uint32_t	Chains;		/* number of tuple chains in CIS */
-	uint32_t	Tuples;		/* total number of tuples in CIS */
-} cisinfo_t;
-
-/*
- * map_mem_page_t structure used for MapMemPage
- */
-typedef struct map_mem_page_t {
-	uint32_t	CardOffset;	/* card offset */
-	uint32_t	Page;		/* page number */
-} map_mem_page_t;
-
-/*
- * sockevent_t structure used for GetEventMask and SetEventMask
- */
-typedef struct sockevent_t {
-	uint32_t	Attributes;	/* attribute flags for call */
-	uint32_t	EventMask;	/* event mask to set or return */
-	uint32_t	Socket;		/* socket number if necessary */
-} sockevent_t;
-
-/*
- * request_socket_mask_t structure used for RequestSocketMask
- */
-typedef struct request_socket_mask_t {
-	uint32_t	Socket;		/* socket number if necessary */
-	uint32_t	EventMask;	/* event mask to set or return */
-} request_socket_mask_t;
-
-/*
- * release_socket_mask_t structure used for ReleaseSocketMask
- */
-typedef struct release_socket_mask_t {
-	uint32_t	Socket;
-} release_socket_mask_t;
-
-/*
- * Flags for GetEventMask and SetEventMask
- */
-#define	CONF_EVENT_MASK_GLOBAL	0x00000000	/* global event mask */
-#define	CONF_EVENT_MASK_CLIENT	0x00000001	/* client event mask */
-#define	CONF_EVENT_MASK_VALID	0x00000001	/* client event mask */
-
-/*
- * convert_speed_t structure used for ConvertSpeed
- */
-typedef struct convert_speed_t {
-	uint32_t	Attributes;
-	uint32_t	nS;
-	uint32_t	devspeed;
-} convert_speed_t;
-
-/*
- * Flags for ConvertSpeed
- */
-#define	CONVERT_NS_TO_DEVSPEED	0x00000001
-#define	CONVERT_DEVSPEED_TO_NS	0x00000002
-
-/*
- * convert_size_t structure used for ConvertSize
- */
-typedef struct convert_size_t {
-	uint32_t	Attributes;
-	uint32_t	bytes;
-	uint32_t	devsize;
-} convert_size_t;
-
-/*
- * Flags for ConvertSize
- */
-#define	CONVERT_BYTES_TO_DEVSIZE	0x00000001
-#define	CONVERT_DEVSIZE_TO_BYTES	0x00000002
-
-#define	MAX_CS_EVENT_BUFSIZE		64	/* single event */
-#define	MAX_MULTI_EVENT_BUFSIZE		512	/* all events */
-
-#define	CS_EVENT_MAX_BUFSIZE	MAX_MULTI_EVENT_BUFSIZE
-#define	CS_ERROR_MAX_BUFSIZE	MAX_CS_EVENT_BUFSIZE
-
-/*
- * event2text_t structure used for Event2Text
- */
-typedef struct event2text_t {
-	event_t		event;		/* events */
-					/* buffer to return text strings */
-	char		text[CS_EVENT_MAX_BUFSIZE];
-} event2text_t;
-
-/*
- * error2text_t structure used for Error2Text
- */
-typedef struct error2text_t {
-	uint32_t	item;
-	char		text[CS_ERROR_MAX_BUFSIZE];
-} error2text_t;
-
-/*
- * get_status_t structure used for GetStatus
- *
- * The values in the status members are the same as the CS_EVENT_XXX values.
- */
-typedef struct get_status_t {
-	uint32_t	Socket;
-	uint32_t	CardState;	/* "live" card status for this client */
-	uint32_t	SocketState;	/* latched socket values */
-	uint32_t	raw_CardState;	/* raw live card status */
-} get_status_t;
-
-/*
- * GetStatus returns card state using the same bit definitions
- *	as the CS_EVENT_XXX bits. Some of the CS_EVENT_XXX bits
- *	are not meaningful for GetStatus and are reused here for
- *	status definitions.
- *
- * get_status_t->CardState and get_status_t->raw_CardState bits
- */
-#define	CS_STATUS_WRITE_PROTECTED	CS_EVENT_WRITE_PROTECT
-#define	CS_STATUS_CARD_LOCKED		CS_EVENT_CARD_LOCK
-#define	CS_STATUS_EJECTION_REQUEST	CS_EVENT_EJECTION_REQUEST
-#define	CS_STATUS_INSERTION_REQUEST	CS_EVENT_INSERTION_REQUEST
-#define	CS_STATUS_BATTERY_DEAD		CS_EVENT_BATTERY_DEAD
-#define	CS_STATUS_BATTERY_LOW		CS_EVENT_BATTERY_LOW
-#define	CS_STATUS_CARD_READY		CS_EVENT_CARD_READY
-#define	CS_STATUS_CARD_INSERTED		CS_EVENT_CARD_INSERTION
-#define	CS_STATUS_RES_EVT1		0x00100000
-#define	CS_STATUS_RES_EVT2		0x00200000
-#define	CS_STATUS_RES_EVT3		0x00400000
-#define	CS_STATUS_VCC_50		0x10000000
-#define	CS_STATUS_VCC_33		0x20000000
-#define	CS_STATUS_VCC_XX		0x40000000
-#define	CS_STATUS_REQ_ATTN		0x80000000
-/*
- * get_status_t->SocketState bits
- */
-#define	CS_SOCK_STATUS_WRITE_PROTECT_CHANGE	CS_EVENT_WRITE_PROTECT
-#define	CS_SOCK_STATUS_CARD_LOCK_CHNAGE		CS_EVENT_CARD_LOCK
-#define	CS_SOCK_STATUS_EJECTION_PENDING		CS_EVENT_EJECTION_REQUEST
-#define	CS_SOCK_STATUS_INSERTION_PENDING	CS_EVENT_INSERTION_REQUEST
-#define	CS_SOCK_STATUS_BATTERY_DEAD_CHNAGE	CS_EVENT_BATTERY_DEAD
-#define	CS_SOCK_STATUS_BATTERY_LOW_CHNAGE	CS_EVENT_BATTERY_LOW
-#define	CS_SOCK_STATUS_CARD_READY_CHANGE	CS_EVENT_CARD_READY
-#define	CS_SOCK_STATUS_CARD_DETECT_CHNAGE	CS_EVENT_CARD_INSERTION
-
-/*
- * map_log_socket_t structure used for MapLogSocket
- */
-typedef struct map_log_socket_t {
-	uint32_t	LogSocket;	/* logical socket */
-	uint32_t	PhyAdapter;	/* physical adapter */
-	uint32_t	PhySocket;	/* physical socket */
-} map_log_socket_t;
-
-/*
- * get_physical_adapter_info_t structure used for GetPhysicalAdapterInfo
- */
-typedef struct get_physical_adapter_info_t {
-	uint32_t	LogSocket;	/* logical socket */
-	uint32_t	PhySocket;	/* physical socket */
-	uint32_t	flags;		/* adapter flags */
-	char		name[MODMAXNAMELEN]; /* adapter module name */
-	uint32_t	major;		/* adapter major number */
-	uint32_t	minor;		/* adapter minor number */
-	uint32_t	instance;	/* instance number of this adapter */
-	uint32_t	number;		/* canonical adapter number */
-	uint32_t	num_sockets;	/* # sockets on this adapter */
-	uint32_t	first_socket;	/* first socket # on this adapter */
-} get_physical_adapter_info_t;
-
-/*
- * irq_req_t structure used for RequestIRQ and ReleaseIRQ
- */
-typedef struct irq_req_t {
-	uint32_t		Socket;
-	uint32_t		Attributes;	/* IRQ attribute flags */
-	csfunction_t		*irq_handler;
-	void			*irq_handler_arg;
-	ddi_iblock_cookie_t	*iblk_cookie;	/* IRQ iblk cookie */
-	ddi_idevice_cookie_t	*idev_cookie;	/* IRQ idev cookie */
-} irq_req_t;
-
-/*
- * Flags for RequestIRQ and ReleaseIRQ
- */
-#define	IRQ_TYPE_EXCLUSIVE		0x00000002
-/*
- * The following flags are included for compatability with other versions of
- *	Card Services, but they are not implemented in this version.  They
- *	are assigned values as placeholders only.  If any of these flags
- *	are set on a call to RequestIRQ, CS_BAD_ATTRIBUTE is returned.
- */
-#define	IRQ_FORCED_PULSE		0x00010000
-#define	IRQ_TYPE_TIME			0x00020000
-#define	IRQ_TYPE_DYNAMIC_SHARING	0x00040000
-#define	IRQ_FIRST_SHARED		0x00080000
-#define	IRQ_PULSE_ALLOCATED		0x00100000
-
-/*
- * release_config_t structure used for ReleaseConfiguration
- */
-typedef struct release_config_t {
-	uint32_t	Socket;
-} release_config_t;
-
-/*
- * config_req_t structure used for RequestConfiguration
- */
-typedef struct config_req_t {
-	uint32_t	Socket;
-	uint32_t	Attributes;	/* configuration attributes */
-	uint32_t	Vcc;		/* Vcc value */
-	uint32_t	Vpp1;		/* Vpp1 value */
-	uint32_t	Vpp2;		/* Vpp2 value */
-	uint32_t	IntType;	/* socket interface type - mem or IO */
-	uint32_t	ConfigBase;	/* offset from start of AM space */
-	uint32_t	Status;		/* value to write to STATUS register */
-	uint32_t	Pin;		/* value to write to PRR */
-	uint32_t	Copy;		/* value to write to COPY register */
-	uint32_t	ConfigIndex;	/* value to write to COR */
-	uint32_t	Present;	/* which config registers present */
-	uint32_t	ExtendedStatus;	/* value to write to EXSTAT register */
-} config_req_t;
-
-/*
- * Flags for RequestConfiguration - note that the CONF_ENABLE_IRQ_STEERING
- *	flag shares the same bit field as the Attributes flags for
- *	ModifyConfiguration.
- */
-#define	CONF_ENABLE_IRQ_STEERING	0x00010000
-/*
- * The following flags are used for the IntType member to specify which
- *	type of socket interface the client wants.
- */
-#define	SOCKET_INTERFACE_MEMORY		0x00000001
-#define	SOCKET_INTERFACE_MEMORY_AND_IO	0x00000002
-/*
- * The following flags are used for the Present member to specify which
- *	configuration registers are present.  They may also be used by
- *	clients for their internal state.
- */
-#define	CONFIG_OPTION_REG_PRESENT	0x00000001 /* COR present */
-#define	CONFIG_STATUS_REG_PRESENT	0x00000002 /* STAT reg present */
-#define	CONFIG_PINREPL_REG_PRESENT	0x00000004 /* PRR present */
-#define	CONFIG_COPY_REG_PRESENT		0x00000008 /* COPY reg present */
-#define	CONFIG_EXSTAT_REG_PRESENT	0x00000010 /* EXSTAT reg present */
-#define	CONFIG_IOBASE0_REG_PRESENT	0x00000020 /* IOBASE0 reg present */
-#define	CONFIG_IOBASE1_REG_PRESENT	0x00000040 /* IOBASE1 reg present */
-#define	CONFIG_IOBASE2_REG_PRESENT	0x00000080 /* IOBASE2 reg present */
-#define	CONFIG_IOBASE3_REG_PRESENT	0x00000100 /* IOBASE3 reg present */
-#define	CONFIG_IOLIMIT_REG_PRESENT	0x00000200 /* IOLIMIT reg present */
-
-/*
- * CONFIG_IOBASE_REG_MASK - mask of IO Base Port register present bits
- * CONFIG_IOBASE_REG_SHIFT - shifts IO Base Port register present bits
- */
-#define	CONFIG_IOBASE_REG_MASK		0x000001e0 /* IOBASEn present mask */
-#define	CONFIG_IOBASE_REG_SHIFT		5
-
-/*
- * Bit definitions for configuration registers.
- *
- * Pin Replacement Register (PRR) bits - these are used for calls to
- *	RequestConfiguration, AccessConfigurationRegister and
- *	GetConfigurationInfo, as well as internally by clients
- *	and Card Services.
- * To inform Card Services that a particular bit in the PRR is valid on
- *	a call to RequestConfiguration, both the XXX_STATUS and the
- *	XXX_EVENT bits must be set.
- */
-#define	PRR_WP_STATUS		0x01	/* R-WP state W-write WP Cbit */
-#define	PRR_READY_STATUS	0x02	/* R-READY state W-write READY Cbit */
-#define	PRR_BVD2_STATUS		0x04	/* R-BVD2 state W-write BVD2 Cbit */
-#define	PRR_BVD1_STATUS		0x08	/* R-BVD1 state W-write BVD1 Cbit */
-#define	PRR_WP_EVENT		0x10	/* WP changed */
-#define	PRR_READY_EVENT		0x20	/* READY changed */
-#define	PRR_BVD2_EVENT		0x40	/* BVD2 changed */
-#define	PRR_BVD1_EVENT		0x80	/* BVD1 changed */
-/*
- * Configuration Option Register (COR) bits
- */
-#define	COR_ENABLE_FUNCTION	0x01	/* enable function */
-#define	COR_ENABLE_BASE_LIMIT	0x02	/* enable base and limit registers */
-#define	COR_ENABLE_IREQ_ROUTING	0x04	/* enable IREQ routing */
-#define	COR_STATUS_CHANGE_MODE	0x08	/* status change mode */
-#define	COR_LEVEL_IRQ		0x40	/* set to enable level interrupts */
-#define	COR_SOFT_RESET		0x80	/* soft reset bit */
-/*
- * Card Configuration Status Register (CCSR)
- */
-#define	CCSR_INTR_ACK		0x01	/* interrupt acknowledge */
-#define	CCSR_INTR		0x02	/* interrupt pending */
-#define	CCSR_POWER_DOWN		0x04	/* power down card */
-#define	CCSR_AUDIO		0x08	/* enable Audio signal */
-#define	CCSR_IO_IS_8		0x20	/* only 8-bit IO data path */
-#define	CCSR_SIG_CHG		0x40	/* enable status changes */
-#define	CCSR_CHANGED		0x80	/* one of the PRR bits has changed */
-/*
- * Macros to manipulate the Socket and Copy Register (SCR) values
- */
-#define	SCR_GET_SOCKET(r)		((r)&0x0f)
-#define	SCR_GET_COPY(r)			(((r)>>4)&7)
-#define	SCR_SET_SOCKET(s)		((s)&0x0f)
-#define	SCR_SET_COPY(c)			(((c)&7)<<4)
-#define	SCR_SET_SOCKET_COPY(s, c)	(((s)&0x0f) | (((c)&7)<<4))
-
-/*
- * modify_config_t structure used for ModifyConfiguration
- */
-typedef struct modify_config_t {
-	uint32_t	Socket;
-	uint32_t	Attributes;	/* attributes to modify */
-	uint32_t	Vpp1;		/* Vpp1 value */
-	uint32_t	Vpp2;		/* Vpp2 value */
-} modify_config_t;
-
-/*
- * Flags for ModifyConfiguration - note that the CONF_ENABLE_IRQ_STEERING
- *	flag used with RequestConfiguration shares this bit field.
- */
-#define	CONF_VPP1_CHANGE_VALID		0x00000002	/* Vpp1 is valid */
-#define	CONF_VPP2_CHANGE_VALID		0x00000004	/* Vpp2 is valid */
-#define	CONF_IRQ_CHANGE_VALID		0x00000008	/* IRQ is valid */
-
-/*
- * access_config_reg_t structure used for AccessConfigurationRegister
- */
-typedef struct access_config_reg_t {
-	uint32_t	Socket;
-	uint32_t	Action;		/* register access operation */
-	uint32_t	Offset;		/* config register offset */
-	uint32_t	Value;		/* value read or written */
-} access_config_reg_t;
-/*
- * Flags for AccessConfigurationRegister
- */
-#define	CONFIG_REG_READ		0x00000001	/* read config register */
-#define	CONFIG_REG_WRITE	0x00000002	/* write config register */
-/*
- * The following offsets are used to specify the configuration register
- *	offset to AccessConfigurationRegister
- */
-#define	CONFIG_OPTION_REG_OFFSET	0x00	/* COR offset */
-#define	CONFIG_STATUS_REG_OFFSET	0x02	/* STAT reg offset */
-#define	CONFIG_PINREPL_REG_OFFSET	0x04	/* PRR offset */
-#define	CONFIG_COPY_REG_OFFSET		0x06	/* COPY reg offset */
-#define	CONFIG_EXSTAT_REG_OFFSET	0x08	/* EXSTAT reg offset */
-#define	CONFIG_IOBASE0_REG_OFFSET	0x0a	/* IOBASE0 reg offset */
-#define	CONFIG_IOBASE1_REG_OFFSET	0x0c	/* IOBASE1 reg offset */
-#define	CONFIG_IOBASE2_REG_OFFSET	0x0e	/* IOBASE2 reg offset */
-#define	CONFIG_IOBASE3_REG_OFFSET	0x10	/* IOBASE3 reg offset */
-#define	CONFIG_IOLIMIT_REG_OFFSET	0x12	/* IOLIMIT reg offset */
-
-/*
- * reset_function_t structure used for ResetFunction
- */
-typedef struct reset_function_t {
-	uint32_t	Socket;
-	uint32_t	Attributes;
-} reset_function_t;
-
-/*
- * get_cardservices_info_t structure used for GetCardServicesInfo
- */
-#define	CS_GET_CARDSERVICES_INFO_MAX_VS_LEN	512
-typedef struct get_cardservices_info_t {
-	char		Signature[2];	/* CS signature bytes */
-	uint32_t	NumSockets;	/* number of sockets */
-	uint32_t	Revision;	/* BCD value of CS revision */
-	uint32_t	CSLevel;	/* BCD value of CS release */
-	uint32_t	FuncsPerSocket;	/* max number of functions per socket */
-	char		VendorString[CS_GET_CARDSERVICES_INFO_MAX_VS_LEN];
-} get_cardservices_info_t;
-
-/*
- * get_configuration_info_t structure used by GetConfigurationInfo
- */
-typedef struct get_configuration_info_t {
-	uint32_t	Socket;		/* Socket/function to get info for */
-	uint32_t	Attributes;	/* configuration attributes */
-	uint32_t	Vcc;		/* Vcc value */
-	uint32_t	Vpp1;		/* Vpp1 value */
-	uint32_t	Vpp2;		/* Vpp2 value */
-	uint32_t	IntType;	/* memory only or memory and IO ifc */
-	uint32_t	ConfigBase;	/* offset from start of AM space */
-	uint32_t	Status;		/* value written to STATUS register */
-	uint32_t	Pin;		/* value written to PRR */
-	uint32_t	Copy;		/* value to written COPY register */
-	uint32_t	Option;		/* which written to COR */
-	uint32_t	Present;	/* which config registers present */
-	uint32_t	FirstDevType;	/* from CISTPL_DEVICE */
-	uint32_t	FuncCode;	/* from CISTPL_FUNCID */
-	uint32_t	SysInitMask;	/* from CISTPL_FUNCID */
-	uint32_t	ManufCode;	/* from CISTPL_MANFID */
-	uint32_t	ManufInfo;	/* from CISTPL_MANFID */
-	uint32_t	CardValues;	/* which config registers written */
-	uint32_t	AssignedIRQ;	/* IRQ assigned to card */
-	uint32_t	IRQ_Attributes;	/* IRQ attributes */
-	uint32_t	BasePort1;	/* address of 1st IO range */
-	uint32_t	NumPorts1;	/* 1st IO range no. contiguous ports */
-	uint32_t	Attributes1;	/* 1st IO range attributes */
-	uint32_t	BasePort2;	/* address of 2nd IO range */
-	uint32_t	NumPorts2;	/* 2nd IO range no. contiguous ports */
-	uint32_t	Attributes2;	/* 2nd IO range attributes */
-	uint32_t	IOAddrLines;	/* number of IO address lines decoded */
-	uint32_t	ExStat;		/* value written to EXSTAT register */
-	uint32_t	DMA_Attributes;	/* signals used for DMA */
-	uint32_t	DMA_Assign_Chan;	/* assigned DMA channel */
-	uint32_t	NumIOWindows;	/* number of IO windows in use */
-	uint32_t	NumMemWindows;	/* number of memory windows in use */
-} get_configuration_info_t;
-
-/*
- * devnode_desc_t structure used in make_device_node_t and remove_device_node_t
- *	for MakeDeviceNode and RemoveDeviceNode
- */
-typedef struct devnode_desc_t {
-	char	*name;		/* device node path and name */
-	int32_t	spec_type;	/* dev special type (block or char) */
-	int32_t	minor_num;	/* device node minor number */
-	char	*node_type;	/* device node type */
-} devnode_desc_t;
-
-/*
- * make_device_node_t structure used for MakeDeviceNode
- */
-typedef struct make_device_node_t {
-	uint32_t	Action;		/* device operation */
-	uint32_t	NumDevNodes;	/* number of nodes to create */
-	devnode_desc_t	*devnode_desc;	/* description of device nodes */
-} make_device_node_t;
-/*
- * Action values for MakeDeviceNode
- */
-#define	CREATE_DEVICE_NODE		0x01	/* create device node */
-
-/*
- * remove_device_node_t structure used for RemoveDeviceNode
- */
-typedef struct remove_device_node_t {
-	uint32_t	Action;		/* device operation */
-	uint32_t	NumDevNodes;	/* number of nodes to remove */
-	devnode_desc_t	*devnode_desc;	/* description of device nodes */
-} remove_device_node_t;
-/*
- * Action values for RemoveDeviceNode
- *
- * Note: The "Action" member for make_device_node_t and remove_device_node_t
- *		share the same set of values.
- */
-#define	REMOVE_DEVICE_NODE		0x02	/* remove device node */
-#define	REMOVE_ALL_DEVICE_NODES		0x03	/* remove all device nodes */
-
-/*
- * cs_ddi_info_t for CS_DDI_Info
- */
-typedef struct cs_ddi_info_t {
-	uint32_t	Socket;		/* socket number */
-	char		*driver_name;	/* unique driver name */
-	dev_info_t	*dip;		/* dip */
-	int32_t		instance;	/* instance */
-} cs_ddi_info_t;
-
-/*
- * cs_sys_ctl_t for CS_Sys_Ctl
- */
-typedef struct cs_sys_ctl_t {
-	uint32_t	Socket;
-	uint32_t	Action;
-	uint32_t	Flags;
-	uint32_t	Events;
-	client_handle_t	client_handle;
-} cs_sys_ctl_t;
-/*
- * cs_sys_ctl_t->Action defines
- *
- * CS_SYS_CTL_SEND_EVENT - send events in cs_sys_ctl_t->Events to clients
- */
-#define	CS_SYS_CTL_SEND_EVENT	0x0001	/* simulate events */
-/*
- * cs_sys_ctl_t->Flags defines
- *
- * CS_SYS_CTL_WAIT_SYNC - wait for operation to complete, otherwise
- *	return immediately
- * CS_SYS_CTL_EVENT_SOCKET - send events to all clients on specified
- *	socket
- * CS_SYS_CTL_EVENT_CLIENT - send events to client specified by
- *	cs_sys_ctl_t->client_handle
- */
-#define	CS_SYS_CTL_WAIT_SYNC	0x00000001	/* synchornize with thread */
-#define	CS_SYS_CTL_EVENT_SOCKET	0x00000002	/* to all clients on socket */
-#define	CS_SYS_CTL_EVENT_CLIENT	0x00000004	/* to client specified */
-
-/*
- * Autoincrement control flags for RepPut8, RepPut16, RepPut32, RepPut32,
- *	RepGet8, RepGet16, RepGet32, RepGet64
- */
-#define	CS_DEV_AUTOINCR		DDI_DEV_AUTOINCR
-#define	CS_DEV_NO_AUTOINCR	DDI_DEV_NO_AUTOINCR
-
-/*
- * Card Services function prototypes
- */
-int32_t csx_RegisterClient(client_handle_t *, client_reg_t *);
-int32_t csx_DeregisterClient(client_handle_t);
-int32_t csx_GetStatus(client_handle_t, get_status_t *);
-int32_t csx_SetEventMask(client_handle_t, sockevent_t *);
-int32_t csx_GetEventMask(client_handle_t, sockevent_t *);
-int32_t csx_RequestIO(client_handle_t, io_req_t *);
-int32_t csx_ReleaseIO(client_handle_t, io_req_t *);
-int32_t csx_RequestIRQ(client_handle_t, irq_req_t *);
-int32_t csx_ReleaseIRQ(client_handle_t, irq_req_t *);
-int32_t csx_RequestWindow(client_handle_t, window_handle_t *, win_req_t *);
-int32_t csx_ReleaseWindow(window_handle_t);
-int32_t csx_ModifyWindow(window_handle_t, modify_win_t *);
-int32_t csx_MapMemPage(window_handle_t, map_mem_page_t *);
-int32_t csx_RequestSocketMask(client_handle_t, request_socket_mask_t *);
-int32_t csx_ReleaseSocketMask(client_handle_t, release_socket_mask_t *);
-int32_t csx_RequestConfiguration(client_handle_t, config_req_t *);
-int32_t csx_ModifyConfiguration(client_handle_t, modify_config_t *);
-int32_t csx_ReleaseConfiguration(client_handle_t, release_config_t *);
-int32_t csx_AccessConfigurationRegister(client_handle_t, access_config_reg_t *);
-int32_t csx_GetFirstTuple(client_handle_t, tuple_t *);
-int32_t csx_GetNextTuple(client_handle_t, tuple_t *);
-int32_t csx_GetTupleData(client_handle_t, tuple_t *);
-int32_t csx_MapLogSocket(client_handle_t, map_log_socket_t *);
-int32_t csx_ValidateCIS(client_handle_t, cisinfo_t *);
-int32_t csx_MakeDeviceNode(client_handle_t, make_device_node_t *);
-int32_t csx_RemoveDeviceNode(client_handle_t, remove_device_node_t *);
-int32_t csx_ConvertSpeed(convert_speed_t *);
-int32_t csx_ConvertSize(convert_size_t *);
-int32_t csx_Event2Text(event2text_t *);
-int32_t csx_Error2Text(error2text_t *);
-int32_t csx_CS_DDI_Info(cs_ddi_info_t *);
-int32_t csx_CS_Sys_Ctl(cs_sys_ctl_t *);
-int32_t csx_ResetFunction(client_handle_t, reset_function_t *);
-int32_t csx_GetFirstClient(get_firstnext_client_t *);
-int32_t csx_GetNextClient(get_firstnext_client_t *);
-int32_t csx_GetClientInfo(client_handle_t, client_info_t *);
-int32_t csx_GetCardServicesInfo(client_handle_t, get_cardservices_info_t *);
-int32_t csx_GetConfigurationInfo(client_handle_t *, get_configuration_info_t *);
-int32_t csx_GetPhysicalAdapterInfo(client_handle_t,
-					get_physical_adapter_info_t *);
-
-/*
- * CIS tuple parsing functions
- */
-int32_t csx_Parse_CISTPL_CONFIG(client_handle_t, tuple_t *, cistpl_config_t *);
-int32_t csx_Parse_CISTPL_DEVICE(client_handle_t, tuple_t *, cistpl_device_t *);
-int32_t csx_Parse_CISTPL_DEVICE_A(client_handle_t, tuple_t *,
-					cistpl_device_t *);
-int32_t csx_Parse_CISTPL_DEVICE_OA(client_handle_t, tuple_t *,
-					cistpl_device_t *);
-int32_t csx_Parse_CISTPL_DEVICE_OC(client_handle_t, tuple_t *,
-					cistpl_device_t *);
-int32_t csx_Parse_CISTPL_VERS_1(client_handle_t, tuple_t *, cistpl_vers_1_t *);
-int32_t csx_Parse_CISTPL_VERS_2(client_handle_t, tuple_t *, cistpl_vers_2_t *);
-int32_t csx_Parse_CISTPL_JEDEC_A(client_handle_t, tuple_t *, cistpl_jedec_t *);
-int32_t csx_Parse_CISTPL_JEDEC_C(client_handle_t, tuple_t *, cistpl_jedec_t *);
-int32_t csx_Parse_CISTPL_FORMAT(client_handle_t, tuple_t *, cistpl_format_t *);
-int32_t csx_Parse_CISTPL_FORMAT_A(client_handle_t, tuple_t *,
-					cistpl_format_t *);
-int32_t csx_Parse_CISTPL_GEOMETRY(client_handle_t, tuple_t *,
-					cistpl_geometry_t *);
-int32_t csx_Parse_CISTPL_BYTEORDER(client_handle_t, tuple_t *,
-					cistpl_byteorder_t *);
-int32_t csx_Parse_CISTPL_DATE(client_handle_t, tuple_t *, cistpl_date_t *);
-int32_t csx_Parse_CISTPL_BATTERY(client_handle_t, tuple_t *,
-					cistpl_battery_t *);
-int32_t csx_Parse_CISTPL_ORG(client_handle_t, tuple_t *, cistpl_org_t *);
-int32_t csx_Parse_CISTPL_MANFID(client_handle_t, tuple_t *, cistpl_manfid_t *);
-int32_t csx_Parse_CISTPL_FUNCID(client_handle_t, tuple_t *, cistpl_funcid_t *);
-int32_t csx_Parse_CISTPL_FUNCE(client_handle_t, tuple_t *, cistpl_funce_t *,
-					uint32_t);
-int32_t csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t, tuple_t *,
-					cistpl_cftable_entry_t *);
-int32_t csx_Parse_CISTPL_LINKTARGET(client_handle_t, tuple_t *,
-					cistpl_linktarget_t *);
-int32_t csx_Parse_CISTPL_LONGLINK_A(client_handle_t, tuple_t *,
-					cistpl_longlink_ac_t *);
-int32_t csx_Parse_CISTPL_LONGLINK_C(client_handle_t, tuple_t *,
-					cistpl_longlink_ac_t *);
-int32_t csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t, tuple_t *,
-					cistpl_longlink_mfc_t *);
-int32_t csx_Parse_CISTPL_SPCL(client_handle_t, tuple_t *,
-					cistpl_spcl_t *);
-int32_t csx_Parse_CISTPL_SWIL(client_handle_t, tuple_t *,
-					cistpl_swil_t *);
-int32_t csx_Parse_CISTPL_BAR(client_handle_t, tuple_t *,
-					cistpl_bar_t *);
-int32_t csx_Parse_CISTPL_DEVICEGEO(client_handle_t, tuple_t *,
-					cistpl_devicegeo_t *);
-int32_t csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t, tuple_t *,
-					cistpl_devicegeo_t *);
-int32_t csx_Parse_CISTPL_LONGLINK_CB(client_handle_t, tuple_t *,
-					cistpl_longlink_cb_t *);
-int32_t csx_ParseTuple(client_handle_t, tuple_t *, cisparse_t *, uint32_t);
-
-/*
- * Data access functions
- */
-void csx_Put8(acc_handle_t, uint32_t, uint8_t);
-void csx_Put16(acc_handle_t, uint32_t, uint16_t);
-void csx_Put32(acc_handle_t, uint32_t, uint32_t);
-void csx_Put64(acc_handle_t, uint32_t, uint64_t);
-uint8_t csx_Get8(acc_handle_t, uint32_t);
-uint16_t csx_Get16(acc_handle_t, uint32_t);
-uint32_t csx_Get32(acc_handle_t, uint32_t);
-uint64_t csx_Get64(acc_handle_t, uint32_t);
-void csx_RepPut8(acc_handle_t, uint8_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepPut16(acc_handle_t, uint16_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepPut32(acc_handle_t, uint32_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepPut64(acc_handle_t, uint64_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepGet8(acc_handle_t, uint8_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepGet16(acc_handle_t, uint16_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepGet32(acc_handle_t, uint32_t *, uint32_t, uint32_t, uint32_t);
-void csx_RepGet64(acc_handle_t, uint64_t *, uint32_t, uint32_t, uint32_t);
-
-/*
- * Data access handle manipulation functions
- */
-int32_t csx_GetMappedAddr(acc_handle_t, void **);
-int32_t csx_GetPhysAddr(acc_handle_t, void **);
-int32_t csx_DupHandle(acc_handle_t, acc_handle_t *, uint32_t);
-int32_t csx_FreeHandle(acc_handle_t *);
-int32_t csx_GetHandleOffset(acc_handle_t, uint32_t *);
-int32_t csx_SetHandleOffset(acc_handle_t, uint32_t);
-
-/*
- * XXX - PCMCIA Shady Meadows Retirement Community
- *
- * The defines in this section should be retired once the PS drivers
- *	get updated.
- *
- * XXX This is an old version of WIN_DATA_WIDTH_MASK and should be
- *	retired soon. RETIRE
- */
-#define	WIN_DATA_WIDTH		0x00000002	/* 16-bit data path */
-/*
- * XXX The following are old versions of the IO_DATA_WIDTH_XXX names and
- *	should be retured soon. RETIRE
- */
-#define	IO_DATA_PATH_WIDTH	0x00000001	/* 16 bit data path */
-#define	IO_DATA_PATH_WIDTH_8	0x00000000	/* 8 bit data path */
-#define	IO_DATA_PATH_WIDTH_16	0x00000001	/* 16 bit data path */
-/*
- * XXX - REMOVAL_ALL_DEVICE_NODES typo, remove soon. RETIRE
- */
-#define	REMOVAL_ALL_DEVICE_NODES	0x03	/* remove all device nodes */
-
-/*
- * The old name of the csx_RequestSocketMask structure was
- *	sockmask_t for some bizzare reason. This typedef
- *	keeps that old name around until we can fix
- *	the drivers.
- */
-typedef struct request_socket_mask_t sockmask_t;	/* RETIRE */
-
-/* XXX - RETIRE and change to a typedef XXX */
-struct devnode_desc {
-    char	*name;		/* device node path and name */
-    int32_t	spec_type;	/* dev special type (block or char) */
-    int32_t	minor_num;	/* device node minor number */
-    char	*node_type;	/* device node type */
-};
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CS_H */
--- old/usr/src/uts/common/pcmcia/sys/cs_priv.h	2014-11-12 17:44:41.295074059 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,774 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _CS_PRIV_H
-#define	_CS_PRIV_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * PCMCIA Card Services private header file
- */
-
-/*
- * typedef for function pointers to quiet lint and cc -v
- */
-typedef	int32_t (f_t)(int32_t, ...);	/* for lint - cc -v quieting */
-
-/*
- * Magic number we use when talking with Socket Services
- */
-#define	CS_MAGIC	PCCS_MAGIC
-
-/*
- * Make the calls to SocketServices and the CIS Parser look like
- *	function calls.
- */
-#define	SocketServices	(*cs_socket_services)
-#define	CIS_PARSER	(*cis_parser)
-
-/*
- * CIS_DEFAULT_SPEED is the default speed to use to read the CIS
- *	in AM space.  It is expressed in nS.
- */
-#define	CIS_DEFAULT_SPEED	250
-
-/*
- * This is the IO window speed.
- */
-#define	IO_WIN_SPEED		250
-
-/*
- * Flags to support various internal first/next functions. All of
- *	these must be within CIS_GET_LTUPLE_OPMASK which is defined
- *	in the cis.h file. Values outside this mask range are used
- *	internally by the CIS parser.
- */
-#define	CS_GET_FIRST_FLAG	0x0001
-#define	CS_GET_NEXT_FLAG	0x0002
-
-/*
- * Macros to manipulate bits - only does up to uint32_t size
- */
-#define	CS_BIT_WORDSIZE		(sizeof (uint32_t))
-
-#define	CS_BIT_GET(val, bit)	\
-			((uint32_t)(val) & (uint32_t)(1<<(uint32_t)(bit)))
-
-#define	CS_BIT_CLEAR(val, bit)	((val) &= (uint32_t)~(1<<(uint32_t)(bit)))
-
-#define	CS_BIT_SET(val, bit)	\
-			((uint32_t)(val) |= (uint32_t)(1<<(uint32_t)(bit)))
-
-/*
- * Minimum time to wait after socket reset before we are allowed to
- *	access the card.  The PCMCIA specification says at least 20mS
- *	must elapse from the time that the card is reset until the
- *	first access of any kind can be made to the card. This time
- *	value is expressed in mS.
- */
-#define	RESET_TIMEOUT_TIME	180
-
-/*
- * Maximum time to wait for card ready after resetting the socket.
- *	We wait for card ready a maximum of 20 seconds after card
- *	reset before considering that we have an error condition.
- * XXX - what does PCMCIA specify as the max time here??
- */
-#define	READY_TIMEOUT_TIME	(drv_usectohz(20000000))
-
-/*
- * Time between periodically kicking the soft interrupt handler.
- */
-#define	SOFTINT_TIMEOUT_TIME	(drv_usectohz(2000000))
-
-/*
- * Various delays are necessary when switching the card and socket
- *	between IO and memory modes. All delays are in mS.
- *
- *  cs_request_configuration parameters:
- *    CS_RC1_DELAY - delay between writing COR and switching socket
- *			to IO mode
- *    CS_RC2_DELAY - delay after switching socket to IO mode
- *
- *  cs_release_configuration parameters:
- *	CS_RQ_DELAY - amount of time that the RESET bit in the COR is
- *			held asserted
- */
-#define	CS_RC1_DELAY		20	/* COR->IO delay in mS */
-#define	CS_RC2_DELAY		300	/* post-COR delay in mS */
-#define	CS_RQ_DELAY		100	/* COR(RESET) delay in mS */
-
-/*
- * Handy macro to do untimeout.
- */
-#define	UNTIMEOUT(id)		\
-	if ((id)) {		\
-	    (void) untimeout((id));	\
-	    (id) = 0;		\
-	}
-
-/*
- * Macros to enter/exit event thread mutex
- */
-#define	EVENT_THREAD_MUTEX_ENTER(acq, sp)		\
-	acq = !MUTEX_HELD(&sp->client_lock);		\
-	if (acq)					\
-	    mutex_enter(&sp->client_lock);
-#define	EVENT_THREAD_MUTEX_EXIT(acq, sp)		\
-	if (acq)					\
-	    mutex_exit(&sp->client_lock);
-
-/*
- * cisregister_t structure is used to support the CISRegister
- *	and the CISUnregister function calls
- */
-typedef struct cisregister_t {
-	uint32_t		cis_magic;
-	uint32_t		cis_version;
-	void *			(*cis_parser)(int32_t function, ...);
-	cistpl_callout_t	*cistpl_std_callout; /* standard callout list */
-} cisregister_t;
-
-/*
- * These two defines are to support CISRegister and CISUnregister
- */
-#define	CIS_MAGIC	0x20434953
-#define	CIS_VERSION	_VERSION(0, 1)
-
-/*
- * CS_MAX_CIS defines the number of CIS chains that we hang off the per-socket
- *	structure.
- *
- * CS_GLOBAL_CIS defines the index where the CIS parser puts the first CIS list
- *	for a single-function card or the global CIS list for a multi-function
- *	card.
- *
- * CS_MAX_CIS is one greater than CIS_MAX_FUNCTIONS since the CIS parser
- *	puts the global CIS chain on the CS_GLOBAL_CIS function index as
- * 	follows:
- *
- *	For single-function cards:
- *	    sp->cis[0] - CIS chain
- *	    sp->cis[1..(CIS_MAX_FUNCTIONS - 1)] - not used
- *	    sp->cis[CS_GLOBAL_CIS] - not used
- *
- *	For multi-function cards:
- *	    sp->cis[0..(CIS_MAX_FUNCTIONS - 1)] - global CIS chain followed
- *					by per-function CIS chain
- *	    sp->cis[CS_GLOBAL_CIS] - global CIS chain
- */
-#define	CS_MAX_CIS	(CIS_MAX_FUNCTIONS + 1)
-#define	CS_GLOBAL_CIS	CIS_MAX_FUNCTIONS
-
-/*
- * CS_SS_CLIENT_HANDLE is a special client handle that Socket Services gets
- *	when it registers with RegisterClient.
- */
-#define	CS_SS_CLIENT_HANDLE	0x00000000
-
-/*
- * Client handle, socket number, function number and socket pointer
- *	macros. The client handle encoding is private to Card Services,
- *	and external modules should not use these macros to manipulate
- *	client handles.
- *
- *	The encoding of the client handle is:
- *
- *		xxxxxfff | xsssssss | cccccccc | cccccccc
- *
- *	f - function number bit
- *	s - socket number bit
- *	c - client number bit
- *	x - don't care bits
- */
-#define	CLIENT_HANDLE_IS_SS(ch)		(!GET_CLIENT_MINOR((ch)))
-#define	CS_MAX_SOCKETS_MASK		(PCMCIA_MAX_SOCKETS - 1)
-#define	CS_MAX_FUNCTIONS_MASK		(CIS_MAX_FUNCTIONS - 1)
-#define	CS_MAX_CLIENTS_MASK		0x0ffff
-#define	CS_MAX_CLIENTS			(CS_MAX_CLIENTS_MASK - 2)
-#define	MAKE_CLIENT_HANDLE(s, f, c)	((((f)&CS_MAX_FUNCTIONS_MASK)<<24) | \
-					    (((s)&CS_MAX_SOCKETS_MASK)<<16) | \
-					    ((c)&CS_MAX_CLIENTS_MASK))
-#define	GET_CLIENT_SOCKET(ch)		(((ch)>>16)&CS_MAX_SOCKETS_MASK)
-#define	GET_CLIENT_FUNCTION(ch)		(((ch)>>24)&CS_MAX_FUNCTIONS_MASK)
-#define	GET_CLIENT_MINOR(ch)		((ch)&CS_MAX_CLIENTS_MASK)
-
-/*
- * Socket number macros. These are used by Socket Services, CSI
- *	drivers and the "super-client" driver to specify which
- *	socket and function number on that socket they wish to
- *	manipulate. This socket number encoding is typically passed
- *	to various Card Services functions by these drivers.
- *
- *	The encoding of the socket number is:
- *
- *		xxxxxxxx | xxxxgfff | xxxxxxxx | xsssssss
- *
- *	g - global CIS bit
- *	f - function number bit
- *	s - socket number bit
- *	x - don't care bits
- */
-#define	CS_GET_SOCKET_NUMBER(s)		((s)&CS_MAX_SOCKETS_MASK)
-#define	CS_GET_FUNCTION_NUMBER(s)	(((s)>>16)&(CS_MAX_FUNCTIONS_MASK | \
-							CIS_MAX_FUNCTIONS))
-#define	CS_SET_SOCKET_NUMBER(s)		((s)&CS_MAX_SOCKETS_MASK)
-#define	CS_SET_FUNCTION_NUMBER(f)	(((f)&(CS_MAX_FUNCTIONS_MASK | \
-						CIS_MAX_FUNCTIONS))<<16)
-#define	CS_MAKE_SOCKET_NUMBER(s, f)	(CS_SET_SOCKET_NUMBER(s) | \
-						CS_SET_FUNCTION_NUMBER(f))
-
-/*
- * DIP2SOCKET_NUM(dip) - this macro gets the PCM_DEV_SOCKET property from
- *	the passed dip.  If the property can't be found, then the default
- *	value of cs_globals.max_socket_num is returned.
- */
-#define	DIP2SOCKET_NUM(dip)		ddi_getprop(DDI_DEV_T_NONE, dip,\
-						(DDI_PROP_CANSLEEP |	\
-							DDI_PROP_NOTPROM), \
-						PCM_DEV_SOCKET,		\
-						cs_globals.max_socket_num)
-
-/*
- * Range checking macros
- *
- * CHECK_SOCKET_NUM(socket_number, max_sockets) returns 1 if
- *	socket_number is in range
- */
-#define	CHECK_SOCKET_NUM(sn, ms)	(((sn) >= (ms))?0:1)
-
-/*
- * window macros
- *
- * These all expect that the window has been validated as a valid
- *	window (i.e. CW_WINDOW_VALID is set in window state)
- *
- * Note that WINDOW_FOR_SOCKET expects a socket mask for the wsm
- *	parameter (this is a socket_enum_t type, and NOT just a
- *	plain old uint32_t)
- */
-#define	WINDOW_FOR_SOCKET(wsm, sn)	((wsm)[sn/PR_WORDSIZE] & \
-						(1 << ((sn) & PR_MASK)))
-#define	WINDOW_AVAILABLE_FOR_MEM(cwp)	(!(cwp->state & CW_WIN_IN_USE))
-#define	WINDOW_AVAILABLE_FOR_IO(cwp)	\
-		(!(cwp->state & (CW_CIS | CW_MEM | CW_ALLOCATED)))
-
-/*
- * IO Base and NumPorts address frobnitz macros
- */
-#define	IOADDR_FROBNITZ(Base, IOAddrLines)	(Base&((1<<IOAddrLines)-1))
-#define	IONUMPORTS_FROBNITZ(np)			(((np)&1)?((np)+1):(np))
-
-/*
- * Structure that contains offsets to the card's configuration registers
- *	as well as copies of the data written to them in RequestConfiguration.
- *	We use an offset per register approach since not all cards have
- *	all registers implemented, and by specifying a NULL register offset,
- *	we know not to try to access that register.
- */
-typedef struct config_regs_t {
-	cfg_regs_t	cor;		/* Configuration Option Register */
-	uint32_t	cor_p;
-	cfg_regs_t	ccsr;		/* Configuration and Status Register */
-	uint32_t	ccsr_p;
-	cfg_regs_t	prr;		/* Pin Replacement Register */
-	uint32_t	prr_p;
-	cfg_regs_t	scr;		/* Socket and Copy Register */
-	uint32_t	scr_p;
-	cfg_regs_t	exstat;		/* Extended Status Register */
-	uint32_t	exstat_p;
-	cfg_regs_t	iobase0;	/* IO Base 0 Register */
-	uint32_t	iobase0_p;
-	cfg_regs_t	iobase1;	/* IO Base 1 Register */
-	uint32_t	iobase1_p;
-	cfg_regs_t	iobase2;	/* IO Base 2 Register */
-	uint32_t	iobase2_p;
-	cfg_regs_t	iobase3;	/* IO Base 3 Register */
-	uint32_t	iobase3_p;
-	cfg_regs_t	iolimit;	/* IO Limit Register */
-	uint32_t	iolimit_p;
-} config_regs_t;
-
-/*
- * Macro to make calling the client's event handler look like a function.
- */
-#define	CLIENT_EVENT_CALLBACK(cp, event, pri)		\
-	    (cp)->event_callback_handler(event, pri,	\
-			&(cp)->event_callback_args)
-
-/*
- * Macro to return event in PRR - this also clears the changed bit if
- *	the event occured.
- */
-#define	PRR_EVENT(prrx, pe, ps, ce, re)	\
-	if (prrx & pe) {		\
-	    if (prrx & ps)		\
-		(re) |= ce;		\
-	    prrx &= ~pe;		\
-	    prrx |= ps;			\
-	}
-
-/*
- * io_alloc_t struct used to keep track of a client's IO window allocation
- */
-typedef struct io_alloc_t {
-	uint32_t	Window1;	/* allocated IO window no. for set #1 */
-	baseaddru_t	BasePort1;	/* 1st IO range base address or port */
-	uint32_t	NumPorts1;	/* 1st IO range no. contiguous ports */
-	uint32_t	Attributes1;	/* 1st IO range attributes */
-	uint32_t	Window2;	/* allocated IO window no. for set #2 */
-	baseaddru_t	BasePort2;	/* s2nd IO range base address or port */
-	uint32_t	NumPorts2;	/* 2nd IO range no. contiguous ports */
-	uint32_t	Attributes2;	/* second IO range attributes */
-	uint32_t	IOAddrLines;	/* number of IO address lines decoded */
-} io_alloc_t;
-
-/*
- * irq_alloc_t structure used to keep track of a client's IRQ allocation
- */
-typedef struct irq_alloc_t {
-	uint32_t	Attributes;	/* IRQ attribute flags */
-	uint32_t	irq;		/* assigned IRQ number */
-	uint32_t	handler_id;	/* IRQ handler ID for this IRQ */
-	f_t		*irq_handler;
-	void		*irq_handler_arg1;
-	void		*irq_handler_arg2;
-} irq_alloc_t;
-
-/*
- * The client data structure
- */
-typedef struct client_t {
-	client_handle_t	client_handle;	/* this client's client handle */
-	unsigned	flags;		/* client flags */
-	/* resource control */
-	uint32_t	memwin_count;	/* number of mem windows allocated */
-	io_alloc_t	io_alloc;	/* IO resource allocations */
-	irq_alloc_t	irq_alloc;	/* IRQ resource allocations */
-	/* event support */
-	uint32_t	event_mask;	/* client event mask */
-	uint32_t	global_mask;	/* client global event mask */
-	uint32_t	events;		/* current events pending */
-	uint32_t	pending_events;	/* events pending in RegisterClient */
-	csfunction_t	*event_callback_handler;
-	event_callback_args_t	event_callback_args;
-	/* config registers support */
-	config_regs_t	config_regs;	/* pointers to config registers */
-	uint32_t	config_regs_offset; /* offset from start of AM */
-	unsigned	pin;		/* valid bits in PRR */
-	uint32_t	present;	/* which config registers present */
-	/* DDI support */
-	dev_info_t	*dip;		/* this client's dip */
-	char		*driver_name;	/* client's driver name */
-	int32_t		instance;	/* client's driver instance */
-	/* list control */
-	struct client_t	*next;		/* next client pointer */
-	struct client_t	*prev;		/* previous client pointer */
-} client_t;
-
-/*
- * Flags for client structure - note that we share the client_t->flags
- *	member with the definitions in cs.h that are used by the
- *	RegisterClient function.
- *
- * We can start our flags from 0x00001000 and on up.
- */
-#define	REQ_CONFIGURATION_DONE	0x00001000	/* RequestConfiguration done */
-#define	REQ_SOCKET_MASK_DONE	0x00002000	/* RequestSocketMask done */
-#define	REQ_IO_DONE		0x00004000	/* RequestIO done */
-#define	REQ_IRQ_DONE		0x00008000	/* RequestIRQ done */
-#define	CLIENT_SUPER_CLIENT	0x00010000	/* "super-client" client */
-#define	CLIENT_CSI_CLIENT	0x00020000	/* CSI client */
-#define	CLIENT_CARD_INSERTED	0x00100000	/* current card for client */
-#define	CLIENT_SENT_INSERTION	0x00200000	/* send CARD_INSERTION */
-#define	CLIENT_MTD_IN_PROGRESS	0x01000000	/* MTD op in progress */
-#define	CLIENT_IO_ALLOCATED	0x02000000	/* IO resources allocated */
-#define	CLIENT_IRQ_ALLOCATED	0x04000000	/* IRQ resources allocated */
-#define	CLIENT_WIN_ALLOCATED	0x08000000	/* window resources allocated */
-
-#ifdef	USE_IOMMAP_WINDOW
-/*
- * io_mmap_window_t structure that describes the memory-mapped IO
- *	window on this socket
- */
-typedef struct io_mmap_window_t {
-	uint32_t		flags;	/* window flags */
-	uint32_t		number;	/* IO window number */
-	uint32_t		size;	/* size of mapped IO window */
-	ddi_acc_handle_t	handle;	/* window mapped base address */
-	uint32_t		count;	/* referance count */
-} io_mmap_window_t;
-#endif	/* USE_IOMMAP_WINDOW */
-
-/*
- * cis_info_t structure used to hold per-socket CIS information
- */
-typedef struct cis_info_t {
-	uint32_t	flags;		/* CIS-specific flags */
-	cistpl_t	*cis;		/* CIS linked lists */
-	uint32_t	nchains;	/* number of tuple chains in CIS */
-	uint32_t	ntuples;	/* number of tuples in CIS */
-} cis_info_t;
-
-/*
- * cs_adapter_t structure used to hold per-socket
- *	adapter-specific info
- */
-typedef struct cs_adapter_t {
-	uint32_t	flags;		/* adapter flags */
-	char		name[MODMAXNAMELEN]; /* adapter module name */
-	uint32_t	major;		/* adapter major number */
-	uint32_t	minor;		/* adapter minor number */
-	uint32_t	instance;	/* instance number of this adapter */
-	uint32_t	number;		/* canonical adapter number */
-	uint32_t	num_sockets;	/* # sockets on this adapter */
-	uint32_t	first_socket;	/* first socket # on this adapter */
-} cs_adapter_t;
-
-/*
- * The per-socket structure.
- */
-typedef struct cs_socket_t {
-	unsigned	socket_num;	/* socket number */
-	uint32_t	flags;		/* socket flags */
-	uint32_t	init_state;	/* cs_init state */
-	cs_adapter_t	adapter;	/* adapter info */
-	/* socket thread control and status */
-	kthread_t	*event_thread;	/* per-socket work thread */
-	uint32_t	thread_state;	/* socket thread state flags */
-	kmutex_t	lock;		/* protects events and clients */
-	kcondvar_t	thread_cv;	/* event handling synchronization */
-	kcondvar_t	caller_cv;	/* event handling synchronization */
-	kcondvar_t	reset_cv;	/* for use after card RESET */
-	uint32_t	events;		/* socket events */
-	uint32_t	event_mask;	/* socket event mask */
-	ddi_softintr_t	softint_id;	/* soft interrupt handler ID */
-	timeout_id_t	rdybsy_tmo_id;	/* timer ID for READY/BUSY timer */
-	ddi_iblock_cookie_t	*iblk;	/* event iblk cookie */
-	ddi_idevice_cookie_t	*idev;	/* event idev cookie */
-	callb_cpr_t	cprinfo_cs;	/* CPR cookie for cs_event_thread */
-	callb_cpr_t	cprinfo_ss;	/* CPR cookie for cs_ss_thread */
-	/* client management */
-	client_t	*client_list;	/* clients on this socket */
-	unsigned	next_cl_minor;	/* next available client minor num */
-	kmutex_t	client_lock;	/* protects client list */
-	uint32_t	num_clients;	/* number of clients on this socket */
-	/* CIS support */
-	uint32_t	cis_win_num;	/* CIS window number */
-	unsigned	cis_win_size;	/* CIS window size */
-	uint32_t	cis_flags;
-	uint32_t	nfuncs;		/* number of functions */
-	cis_info_t	cis[CS_MAX_CIS]; /* CIS information */
-	kmutex_t	cis_lock;	/* protects CIS */
-#ifdef	USE_IOMMAP_WINDOW
-	/* memory mapped IO window support */
-	io_mmap_window_t *io_mmap_window;
-#endif	/* USE_IOMMAP_WINDOW */
-	/* Socket Services work thread control and status */
-	kthread_t	*ss_thread;	/* SS work thread */
-	uint32_t	ss_thread_state; /* SS work thread state */
-	kcondvar_t	ss_thread_cv;	/* SS work thread synchronization */
-	kcondvar_t	ss_caller_cv;	/* SS work thread synchronization */
-	kmutex_t	ss_thread_lock;	/* protects SS work thread state */
-	struct cs_socket_t	*next;	/* next socket in list */
-} cs_socket_t;
-
-/*
- * cs_socket_t->flags flags
- */
-#define	SOCKET_CARD_INSERTED		0x00000001	/* card is inserted */
-#define	SOCKET_IS_IO			0x00000002	/* socket in IO mode */
-#define	SOCKET_UNLOAD_MODULE		0x00000004	/* want to unload CS */
-#define	SOCKET_NEEDS_THREAD		0x00000008	/* wake event thread */
-#define	SOCKET_IS_VALID			0x00000020	/* socket OK to use */
-
-/*
- * cs_socket_t->thread_state and cs_socket_t->ss_thread_state flags
- */
-
-/* generic for all threads */
-#define	SOCKET_THREAD_EXIT		0x00000001	/* exit event thread */
-
-/* only used for per-socket event thread */
-#define	SOCKET_WAIT_FOR_READY		0x00001000	/* waiting for READY */
-#define	SOCKET_RESET_TIMER		0x00002000	/* RESET timer */
-#define	SOCKET_WAIT_SYNC		0x00004000	/* SYNC */
-
-/* only used for Socket Services work thread */
-#define	SOCKET_THREAD_CSCISInit		0x00100000	/* call CSCISInit */
-
-/*
- * cs_socket_t->cis_flags and cs_socket_t->cis_info_t->flags flags
- */
-#define	CW_VALID_CIS			0x00000001	/* valid CIS */
-#define	CW_MULTI_FUNCTION_CIS		0x00000002	/* multifunction card */
-#define	CW_LONGLINK_A_FOUND		0x00000004	/* CISTPL_LONGLINK_A */
-#define	CW_LONGLINK_C_FOUND		0x00000008	/* CISTP_LONGLINK_C */
-#define	CW_LONGLINK_MFC_FOUND		0x00000010	/* LONGLINK_MFC */
-#define	CW_CHECK_LINKTARGET		0x00000020	/* check linktarget */
-#define	CW_RET_ON_LINKTARGET_ERROR	0x00000040	/* linktarget invalid */
-#define	CW_CHECK_PRIMARY_CHAIN		0x00000080	/* check for primary */
-							/* chain tuples */
-
-/*
- * CW_LONGLINK_FOUND - a combination of the various CW_LONGLINK_XXX_FOUND
- *			flags used to make the code less dense.
- */
-#define	CW_LONGLINK_FOUND		(CW_LONGLINK_A_FOUND |	\
-					CW_LONGLINK_C_FOUND |	\
-					CW_LONGLINK_MFC_FOUND)
-
-/*
- * macro to test for a valid CIS window on a socket
- */
-#define	SOCKET_HAS_CIS_WINDOW(sp)	(sp->cis_win_num != PCMCIA_MAX_WINDOWS)
-
-/*
- * cs_socket_t->init_state flags - these flags are used to keep track of what
- *	was allocated in cs_init so that things can be deallocated properly
- *	in cs_deinit.
- */
-#define	SOCKET_INIT_STATE_MUTEX		0x00000001	/* mutexii are OK */
-#define	SOCKET_INIT_STATE_CV		0x00000002	/* cvii are OK */
-#define	SOCKET_INIT_STATE_THREAD	0x00000004	/* thread OK */
-#define	SOCKET_INIT_STATE_READY		0x00000008	/* socket OK */
-#define	SOCKET_INIT_STATE_SS_THREAD	0x00000010	/* SS thread OK */
-/*
- * While this next flag doesn't really describe a per-socket resource,
- *	we still set it for each socket.  When the soft interrupt handler
- *	finally gets removed in cs_deinit, this flag will get cleared.
- *	The value of this flag should follow the previous SOCKET_INIT
- *	flag values.
- */
-#define	SOCKET_INIT_STATE_SOFTINTR	0x00000020	/* softintr handler */
-
-/*
- * Macro to create a socket event thread.
- */
-#define	CS_THREAD_PRIORITY		(v.v_maxsyspri - 4)
-#define	CREATE_SOCKET_EVENT_THREAD(eh, csp)			\
-	thread_create(NULL, 0, eh, (void *)csp,			\
-	0, &p0, TS_RUN, CS_THREAD_PRIORITY)
-
-/*
- * The per-window structure.
- */
-typedef struct cs_window_t {
-	uint32_t	window_num;	/* window number */
-	window_handle_t	window_handle;	/* unique window handle */
-	client_handle_t	client_handle;	/* owner of this window */
-	unsigned	socket_num;	/* socket number */
-	unsigned	state;		/* window state flags */
-	struct cs_window_t	*next;	/* next window in list */
-} cs_window_t;
-
-/*
- * Window structure state flags - if none of the bits in the
- *	CW_WIN_IN_USE mask are set AND if CW_WINDOW_VALID is set,
- *	it means that this window is available and not being used
- *	by anyone.
- * Setting the CW_ALLOCATED will prevent the window from being found
- *	as an available window for memory or IO; since memory windows
- *	are not shared between clients, RequestWindow will always set
- *	the CW_ALLOCATED flag when it has assigned a memory window to
- *	a client.  Since we can sometimes share IO windows, RequestIO
- *	will only set the CW_ALLOCATED flag if it doesn't want the IO
- *	window to be used by other calls to RequestIO.
- * When CW_WINDOW_VALID is set, it means that this is a valid window
- *	that has been added by the framework and can be used. If this
- *	bit is not set, this window can not be used at all.
- */
-#define	CW_ALLOCATED	0x00000001	/* window is allocated  */
-#define	CW_CIS		0x00000002	/* window being used as CIS window */
-#define	CW_MEM		0x00000004	/* window being used as mem window */
-#define	CW_IO		0x00000008	/* window being used as IO window */
-#define	CW_WIN_IN_USE	0x0000ffff	/* window in use mask */
-#define	CW_WINDOW_VALID	0x00010000	/* window is valid */
-
-/*
- * window handle defines - the WINDOW_HANDLE_MASK implies the maximum number
- *	of windows allowed
- */
-#define	WINDOW_HANDLE_MAGIC	0x574d0000
-#define	WINDOW_HANDLE_MASK	0x0000ffff
-#define	GET_WINDOW_NUMBER(wh)	((wh) & WINDOW_HANDLE_MASK)
-#define	GET_WINDOW_MAGIC(wh)	((wh) & ~WINDOW_HANDLE_MASK)
-
-/*
- * The client type structures, used to sequence events to clients on a
- *	socket. The "type" flags are the same as are used for the
- *	RegisterClient function.
- */
-typedef struct client_types_t {
-	uint32_t		type;
-	uint32_t		order;
-	struct client_types_t	*next;
-} client_types_t;
-
-/*
- * Flags that specify the order of client event notifications for the
- *	client_types_t structure.
- */
-#define	CLIENT_EVENTS_LIFO	0x00000001
-#define	CLIENT_EVENTS_FIFO	0x00000002
-
-/*
- * This is a structure that CS uses to keep track of items that are global
- *	to all functions in the module.
- */
-typedef struct cs_globals_t {
-	cs_socket_t	*sp;		/* head of socket list */
-	cs_window_t	*cw;		/* head of window list */
-	kmutex_t	global_lock;	/* protects this struct */
-	kmutex_t	window_lock;	/* protects cs_windows */
-	ddi_softintr_t	softint_id;	/* soft interrupt handler id */
-	timeout_id_t	sotfint_tmo;	/* soft interrupt handler timeout id */
-	uint32_t	init_state;	/* flags set in cs_init */
-	uint32_t	flags;		/* general global flags */
-	uint32_t	max_socket_num;	/* highest socket number plus one */
-	uint32_t	num_sockets;	/* total number of sockets */
-	uint32_t	num_windows;	/* total number of windows */
-	struct sclient_list_t	*sclient_list;
-} cs_globals_t;
-
-/*
- * Flags for cs_globals_t->init_state
- */
-#define	GLOBAL_INIT_STATE_SOFTINTR	0x00010000	/* softintr handler */
-#define	GLOBAL_INIT_STATE_MUTEX		0x00020000	/* global mutex init */
-#define	GLOBAL_INIT_STATE_NO_CLIENTS	0x00040000	/* no new clients */
-#define	GLOBAL_INIT_STATE_UNLOADING	0x00080000	/* cs_deinit running */
-#define	GLOBAL_INIT_STATE_SS_READY	0x00100000	/* SS ready for */
-							/* callbacks */
-/*
- * Flags for cs_globals_t->flags
- */
-#define	GLOBAL_SUPER_CLIENT_REGISTERED	0x00000001	/* "super-client" reg */
-#define	GLOBAL_IN_SOFTINTR		0x00000002	/* in soft int code */
-
-/*
- * sclient_reg_t struct for RegisterClient when a "super-client" is
- *	registering.
- * This structure is actually hung off of the client_reg_t.private
- *	structure member.  Since we don't make public how to write
- *	a "super-client", the actual structure that the client uses
- *	is defined in this private header file.
- */
-typedef struct sclient_reg_t {
-	uint32_t		max_socket_num;
-	uint32_t		num_sockets;
-	uint32_t		num_windows;
-	uint32_t		num_clients;
-	struct sclient_list_t {
-		client_handle_t	client_handle;
-		uint32_t	error;
-	} **sclient_list;
-} sclient_reg_t;
-
-/*
- * structure for event text used for cs_ss_event_text
- */
-typedef struct cs_ss_event_text_t {
-	event_t		ss_event;	/* SS event code */
-	event_t		cs_event;	/* CS event code */
-	char		*text;
-} cs_ss_event_text_t;
-
-/*
- * Flags for cs_read_event_status
- */
-#define	CS_RES_IGNORE_NO_CARD		0x0001	/* don't check for card */
-
-/*
- * cs_csfunc2text_strings_t structure used internally in Error2Text
- */
-typedef struct cs_csfunc2text_strings_t {
-	uint32_t	item;
-	char		*text;
-} cs_csfunc2text_strings_t;
-
-/*
- * Flags for Error2Text - not used by clients; the struct is defined
- *	in the cs.h header file.
- */
-#define	CSFUN2TEXT_FUNCTION	0x0001	/* return text of CS function code */
-#define	CSFUN2TEXT_RETURN	0x0002	/* return text of CS return code */
-
-/*
- * Macros to walk the local linked CIS list.
- *
- * These macros can take any valid local list tuple pointer.  They return
- *	another tuple pointer or NULL if they fail.
- */
-#define	GET_NEXT_TUPLE(tp, f)		CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,  \
-						NULL, GET_NEXT_LTUPLEF |     \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	GET_PREV_TUPLE(tp, f)		CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,  \
-						NULL, GET_PREV_LTUPLEF |     \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	GET_FIRST_LTUPLE(tp, f)		CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						NULL, GET_FIRST_LTUPLEF |     \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	GET_LAST_LTUPLE(tp, f)		CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						NULL, GET_LAST_LTUPLEF |      \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	FIND_LTUPLE_FWD(tp, tu, f)	CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						tu, FIND_LTUPLE_FWDF |        \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	FIND_LTUPLE_BACK(tp, tu, f)	CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						tu, FIND_LTUPLE_BACKF |       \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	FIND_NEXT_LTUPLE(tp, tu, f)	CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						tu, FIND_NEXT_LTUPLEF |       \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	FIND_PREV_LTUPLE(tp, tu, f)	CIS_PARSER(CISP_CIS_GET_LTUPLE, tp,   \
-						tu, FIND_PREV_LTUPLEF |       \
-						(f & ~CIS_GET_LTUPLE_OPMASK))
-#define	FIND_FIRST_LTUPLE(tp, tu, f)	FIND_LTUPLE_FWD(GET_FIRST_LTUPLE(tp,  \
-								f), tu, f)
-
-
-/*
- * Card Services hooks and general nexus prototypes
- */
-int	 cs_init(void);
-uint32_t cs_event(event_t, uint32_t, uint32_t);
-int	 pcmcia_set_em_handler(int (*handler)(), caddr_t events,
-	    int elen, uint32_t id, void **cs, void **ss);
-
-extern csfunction_t	*cs_socket_services;
-
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CS_PRIV_H */
--- old/usr/src/uts/common/pcmcia/sys/cs_strings.h	2014-11-12 17:44:41.348208047 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,201 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1995-1996 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _CS_STRINGS_H
-#define	_CS_STRINGS_H
-
-#pragma ident	"%W%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * These values depend on the size of the cs_ss_event_text_t array
- *	and on the number of CS events that we want the client to
- *	be able to display.
- * XXX - this should be determined automatically
- */
-#define	MAX_SS_EVENTS	9	/* maximum SS events */
-#define	MAX_CS_EVENTS	28	/* maximum CS events */
-
-/*
- * The cs_ss_event_text_t structure is used to support the Event2Text
- *	and cs_event2text function.  MAX_SS_EVENTS and MAX_CS_EVENTS
- *	are defined in the cs_priv.h header file.  If the size of this
- *	array or strctures changes, the MAX_CS_EVENT_BUFSIZE define
- *	which is in cs.h might need to be changed as well.
- */
-cs_ss_event_text_t cs_ss_event_text[MAX_CS_EVENTS+1] = {
-	{ PCE_CARD_REMOVAL, CS_EVENT_CARD_REMOVAL, "CARD_REMOVAL" },
-	{ PCE_CARD_INSERT, CS_EVENT_CARD_INSERTION, "CARD_INSERTION" },
-	{ PCE_CARD_READY, CS_EVENT_CARD_READY, "CARD_READY" },
-	{ PCE_CARD_BATTERY_WARN, CS_EVENT_BATTERY_LOW, "BATTERY_WARN" },
-	{ PCE_CARD_BATTERY_DEAD, CS_EVENT_BATTERY_DEAD, "BATTERY_DEAD" },
-	{ PCE_CARD_STATUS_CHANGE, 0, "STATUS_CHANGE" },
-	{ PCE_CARD_WRITE_PROTECT, CS_EVENT_WRITE_PROTECT, "WRITE_PROTECT" },
-	{ PCE_PM_RESUME, CS_EVENT_PM_RESUME, "PM_RESUME" },
-	{ PCE_PM_SUSPEND, CS_EVENT_PM_SUSPEND, "PM_SUSPEND" },
-	{ 0, CS_EVENT_REGISTRATION_COMPLETE, "REGISTRATION_COMPLETE" },
-	{ 0, CS_EVENT_CARD_LOCK, "CARD_LOCK" },
-	{ 0, CS_EVENT_CARD_RESET, "CARD_RESET" },
-	{ 0, CS_EVENT_CARD_UNLOCK, "CARD_UNLOCK" },
-	{ 0, CS_EVENT_EJECTION_COMPLETE, "EJECTION_COMPLETE" },
-	{ 0, CS_EVENT_EJECTION_REQUEST, "EJECTION_REQUEST" },
-	{ 0, CS_EVENT_ERASE_COMPLETE, "ERASE_COMPLETE" },
-	{ 0, CS_EVENT_EXCLUSIVE_COMPLETE, "EXCLUSIVE_COMPLETE" },
-	{ 0, CS_EVENT_EXCLUSIVE_REQUEST, "EXCLUSIVE_REQUEST" },
-	{ 0, CS_EVENT_INSERTION_COMPLETE, "INSERTION_COMPLETE" },
-	{ 0, CS_EVENT_INSERTION_REQUEST, "INSERTION_REQUEST" },
-	{ 0, CS_EVENT_RESET_COMPLETE, "RESET_COMPLETE" },
-	{ 0, CS_EVENT_RESET_PHYSICAL, "RESET_PHYSICAL" },
-	{ 0, CS_EVENT_RESET_REQUEST, "RESET_REQUEST" },
-	{ 0, CS_EVENT_MTD_REQUEST, "MTD_REQUEST" },
-	{ 0, CS_EVENT_CLIENT_INFO, "CLIENT_INFO" },
-	{ 0, CS_EVENT_TIMER_EXPIRED, "TIMER_EXPIRED" },
-	{ 0, CS_EVENT_SS_UPDATED, "SS_UPDATED" },
-	{ 0, CS_EVENT_CARD_REMOVAL_LOWP, "CARD_REMOVAL_LOWP" },
-	{ MAX_SS_EVENTS, 0, "{undefined}" },
-};
-
-cs_csfunc2text_strings_t cs_csfunc2text_funcstrings[] = {
-	{ CISRegister, "CISRegister" },
-	{ CISUnregister, "CISUnregister" },
-	{ InitCISWindow, "InitCISWindow" },
-	{ GetCardServicesInfo, "GetCardServicesInfo" },
-	{ RegisterClient, "RegisterClient" },
-	{ DeregisterClient, "DeregisterClient" },
-	{ GetStatus, "GetStatus" },
-	{ ResetFunction, "ResetFunction" },
-	{ SetEventMask, "SetEventMask" },
-	{ GetEventMask, "GetEventMask" },
-	{ RequestIO, "RequestIO" },
-	{ ReleaseIO, "ReleaseIO" },
-	{ RequestIRQ, "RequestIRQ" },
-	{ ReleaseIRQ, "ReleaseIRQ" },
-	{ RequestWindow, "RequestWindow" },
-	{ ReleaseWindow, "ReleaseWindow" },
-	{ ModifyWindow, "ModifyWindow" },
-	{ MapMemPage, "MapMemPage" },
-	{ RequestSocketMask, "RequestSocketMask" },
-	{ ReleaseSocketMask, "ReleaseSocketMask" },
-	{ RequestConfiguration, "RequestConfiguration" },
-	{ GetConfigurationInfo, "GetConfigurationInfo" },
-	{ ModifyConfiguration, "ModifyConfiguration" },
-	{ ReleaseConfiguration, "ReleaseConfiguration" },
-	{ OpenMemory, "OpenMemory" },
-	{ ReadMemory, "ReadMemory" },
-	{ WriteMemory, "WriteMemory" },
-	{ CopyMemory, "CopyMemory" },
-	{ RegisterEraseQueue, "RegisterEraseQueue" },
-	{ CheckEraseQueue, "CheckEraseQueue" },
-	{ DeregisterEraseQueue, "DeregisterEraseQueue" },
-	{ CloseMemory, "CloseMemory" },
-	{ GetFirstRegion, "GetFirstRegion" },
-	{ GetNextRegion, "GetNextRegion" },
-	{ GetFirstPartition, "GetFirstPartition" },
-	{ GetNextPartition, "GetNextPartition" },
-	{ ReturnSSEntry, "ReturnSSEntry" },
-	{ MapLogSocket, "MapLogSocket" },
-	{ MapPhySocket, "MapPhySocket" },
-	{ MapLogWindow, "MapLogWindow" },
-	{ MapPhyWindow, "MapPhyWindow" },
-	{ RegisterMTD, "RegisterMTD" },
-	{ RegisterTimer, "RegisterTimer" },
-	{ SetRegion, "SetRegion" },
-	{ RequestExclusive, "RequestExclusive" },
-	{ ReleaseExclusive, "ReleaseExclusive" },
-	{ GetFirstClient, "GetFirstClient" },
-	{ GetNextClient, "GetNextClient" },
-	{ GetClientInfo, "GetClientInfo" },
-	{ AddSocketServices, "AddSocketServices" },
-	{ ReplaceSocketServices, "ReplaceSocketServices" },
-	{ VendorSpecific, "VendorSpecific" },
-	{ AdjustResourceInfo, "AdjustResourceInfo" },
-	{ ValidateCIS, "ValidateCIS" },
-	{ GetFirstTuple, "GetFirstTuple" },
-	{ GetNextTuple, "GetNextTuple" },
-	{ GetTupleData, "GetTupleData" },
-	{ ParseTuple, "ParseTuple" },
-	{ MakeDeviceNode, "MakeDeviceNode" },
-	{ RemoveDeviceNode, "RemoveDeviceNode" },
-	{ ConvertSpeed, "ConvertSpeed" },
-	{ ConvertSize, "ConvertSize" },
-	{ Event2Text, "Event2Text" },
-	{ Error2Text, "Error2Text" },
-	{ AccessConfigurationRegister, "AccessConfigurationRegister" },
-	{ CS_DDI_Info, "CS_DDI_Info" },
-	{ CS_Sys_Ctl, "CS_Sys_Ctl" },
-	{ CSFuncListEnd, "{unknown Card Services function}" },
-};
-
-cs_csfunc2text_strings_t cs_csfunc2text_returnstrings[] = {
-	{ CS_SUCCESS, "CS_SUCCESS" },
-	{ CS_BAD_ADAPTER, "CS_BAD_ADAPTER" },
-	{ CS_BAD_ATTRIBUTE, "CS_BAD_ATTRIBUTE" },
-	{ CS_BAD_BASE, "CS_BAD_BASE" },
-	{ CS_BAD_EDC, "CS_BAD_EDC" },
-	{ CS_BAD_IRQ, "CS_BAD_IRQ" },
-	{ CS_BAD_OFFSET, "CS_BAD_OFFSET" },
-	{ CS_BAD_PAGE, "CS_BAD_PAGE" },
-	{ CS_READ_FAILURE, "CS_READ_FAILURE" },
-	{ CS_BAD_SIZE, "CS_BAD_SIZE" },
-	{ CS_BAD_SOCKET, "CS_BAD_SOCKET" },
-	{ CS_BAD_TYPE, "CS_BAD_TYPE" },
-	{ CS_BAD_VCC, "CS_BAD_VCC" },
-	{ CS_BAD_VPP, "CS_BAD_VPP" },
-	{ CS_BAD_WINDOW, "CS_BAD_WINDOW" },
-	{ CS_WRITE_FAILURE, "CS_WRITE_FAILURE" },
-	{ CS_NO_CARD, "CS_NO_CARD" },
-	{ CS_UNSUPPORTED_FUNCTION, "CS_UNSUPPORTED_FUNCTION" },
-	{ CS_UNSUPPORTED_MODE, "CS_UNSUPPORTED_MODE" },
-	{ CS_BAD_SPEED, "CS_BAD_SPEED" },
-	{ CS_BUSY, "CS_BUSY" },
-	{ CS_GENERAL_FAILURE, "CS_GENERAL_FAILURE" },
-	{ CS_WRITE_PROTECTED, "CS_WRITE_PROTECTED" },
-	{ CS_BAD_ARG_LENGTH, "CS_BAD_ARG_LENGTH" },
-	{ CS_BAD_ARGS, "CS_BAD_ARGS" },
-	{ CS_CONFIGURATION_LOCKED, "CS_CONFIGURATION_LOCKED" },
-	{ CS_IN_USE, "CS_IN_USE" },
-	{ CS_NO_MORE_ITEMS, "CS_NO_MORE_ITEMS" },
-	{ CS_OUT_OF_RESOURCE, "CS_OUT_OF_RESOURCE" },
-	{ CS_BAD_HANDLE, "CS_BAD_HANDLE" },
-	{ CS_NO_CIS, "CS_NO_CIS" },
-	{ CS_BAD_CIS, "CS_BAD_CIS" },
-	{ CS_UNKNOWN_TUPLE, "CS_UNKNOWN_TUPLE" },
-	{ CS_BAD_VERSION, "CS_BAD_VERSION" },
-	{ CS_UNSUPPORTED_EVENT, "CS_UNSUPPORTED_EVENT" },
-	{ CS_CSI_ERROR, "CS_CSI_ERROR" },
-	{ CS_CSI_NOT_INIT, "CS_CSI_NOT_INIT" },
-	{ CS_NO_TUPLE_PARSER, "CS_NO_TUPLE_PARSER" },
-	{ CS_ERRORLIST_END, "{unknown Card Services return code}" },
-};
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif /* _CS_STRINGS_H */
--- old/usr/src/uts/common/pcmcia/sys/cs_stubs.h	2014-11-12 17:44:41.399672110 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,166 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _CS_STUBS_H
-#define	_CS_STUBS_H
-
-#pragma ident	"%W%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-
-/*
- * Magic number for Card Services to use when registering it's entry
- *	point with the Card Services stubs module.
- */
-#define	CS_STUBS_MAGIC	0x19960300
-
-/*
- * Card Services function identifiers - these correspond to the PCMCIA
- *	standard function codes for CS with the exception of a few
- *	private and implementation-specific function identifiers.
- *
- * client services functions
- */
-#define	GetCardServicesInfo		0x000b
-#define	RegisterClient			0x0010
-#define	DeregisterClient		0x0002
-#define	GetStatus			0x000c
-#define	ResetFunction			0x0011
-#define	SetEventMask			0x0031
-#define	GetEventMask			0x002e
-/*
- * reource management functions
- */
-#define	RequestIO			0x001f
-#define	ReleaseIO			0x001b
-#define	RequestIRQ			0x0020
-#define	ReleaseIRQ			0x001c
-#define	RequestWindow			0x0021
-#define	ReleaseWindow			0x001d
-#define	ModifyWindow			0x0017
-#define	MapMemPage			0x0014
-#define	RequestSocketMask		0x0022
-#define	ReleaseSocketMask		0x002f
-#define	RequestConfiguration		0x0030
-#define	GetConfigurationInfo		0x0004
-#define	ModifyConfiguration		0x0027
-#define	ReleaseConfiguration		0x001e
-#define	AccessConfigurationRegister	0x0036
-/*
- * bulk memory service functions
- */
-#define	OpenMemory			0x0018
-#define	ReadMemory			0x0019
-#define	WriteMemory			0x0024
-#define	CopyMemory			0x0001
-#define	RegisterEraseQueue		0x000f
-#define	CheckEraseQueue			0x0026
-#define	DeregisterEraseQueue		0x0025
-#define	CloseMemory			0x0000
-/*
- * client utility functions
- */
-#define	GetFirstTuple			0x0007
-#define	GetNextTuple			0x000a
-#define	GetTupleData			0x000d
-#define	GetFirstRegion			0x0006
-#define	GetNextRegion			0x0009
-#define	GetFirstPartition		0x0005
-#define	GetNextPartition		0x0008
-/*
- * advanced client services functions
- */
-#define	ReturnSSEntry			0x0023
-#define	MapLogSocket			0x0012
-#define	MapPhySocket			0x0015
-#define	MapLogWindow			0x0013
-#define	MapPhyWindow			0x0016
-#define	RegisterMTD			0x001a
-#define	RegisterTimer			0x0028
-#define	SetRegion			0x0029
-#define	ValidateCIS			0x002b
-#define	RequestExclusive		0x002c
-#define	ReleaseExclusive		0x002d
-#define	GetFirstClient			0x000e
-#define	GetNextClient			0x002a
-#define	GetClientInfo			0x0003
-#define	AddSocketServices		0x0032
-#define	ReplaceSocketServices		0x0033
-#define	VendorSpecific			0x0034
-#define	AdjustResourceInfo		0x0035
-/*
- * private functions - clients should never call these; if they do,
- *	the system will esplode.
- */
-#define	CISRegister			0x1000
-#define	CISUnregister			0x1001
-#define	InitCISWindow			0x1002
-/*
- * Card Services functions specific to this implementation
- */
-#define	ParseTuple		0x2000	/* parses contents of tuples */
-#define	MakeDeviceNode		0x2001	/* makes device nodes in fs */
-#define	ConvertSpeed		0x2002	/* converts device speeds */
-#define	ConvertSize		0x2003	/* converts device sizes */
-#define	Event2Text		0x2004	/* return string of event type */
-#define	Error2Text		0x2005	/* function or ret code string */
-#define	CS_DDI_Info		0x2006	/* set/get DDI info */
-#define	CS_Sys_Ctl		0x2007  /* CS system control */
-#define	RemoveDeviceNode	0x2008	/* removes device nodes in fs */
-#define	GetPhysicalAdapterInfo	0x2009	/* returns physical adapter info */
-#define	CSFuncListEnd		0x8000	/* end of CS function list */
-
-/*
- * Structure used when Card Services registers it's entry point with
- *	the Card Services stubs module
- */
-typedef struct cs_register_cardservices_t {
-	uint32_t	function;
-	uint32_t	magic;
-	csfunction_t	*cardservices;
-	csfunction_t	*socketservices;
-} cs_register_cardservices_t;
-
-/*
- * Functions for cs_register_cardservices_t
- */
-#define	CS_ENTRY_REGISTER	0x0001
-#define	CS_ENTRY_DEREGISTER	0x0002
-#define	CS_ENTRY_INQUIRE	0x0003
-
-/*
- * Function prototypes
- */
-int32_t csx_register_cardservices(cs_register_cardservices_t *);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CS_STUBS_H */
--- old/usr/src/uts/common/pcmcia/sys/cs_types.h	2014-11-12 17:44:41.450771861 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,54 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1995-1996 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#ifndef _CS_TYPES_H
-#define	_CS_TYPES_H
-
-#pragma ident	"%W%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * PCMCIA Card Services types header file
- */
-
-typedef uint32_t client_handle_t;
-typedef	uint32_t window_handle_t;
-typedef uint32_t event_t;
-typedef uint8_t	cfg_regs_t;
-
-typedef struct baseaddru_t {
-	uint32_t		base;
-	ddi_acc_handle_t	handle;
-} baseaddru_t;
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _CS_TYPES_H */
--- old/usr/src/uts/common/sys/Makefile	2014-11-12 17:44:41.502346272 +0100
+++ new/usr/src/uts/common/sys/Makefile	2014-11-12 17:44:41.507432735 +0100
@@ -21,7 +21,7 @@
 #
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2013, Joyent, Inc. All rights reserved.
-# Copyright 2013 Garrett D'Amore <garrett@damore.org>
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 include $(SRC)/uts/Makefile.uts
@@ -424,12 +424,10 @@
 	queue.h			\
 	serializer.h		\
 	pbio.h			\
-	pccard.h		\
 	pci.h			\
 	pcie.h			\
 	pci_impl.h		\
 	pci_tools.h		\
-	pcmcia.h		\
 	pctypes.h		\
 	pfmod.h			\
 	pg.h			\
@@ -517,7 +515,6 @@
 	squeue.h		\
 	squeue_impl.h		\
 	srn.h			\
-	sservice.h		\
 	stat.h			\
 	statfs.h		\
 	statvfs.h		\
@@ -1113,8 +1110,6 @@
 	avintr.h	\
 	dma_engine.h	\
 	i8272A.h	\
-	pcic_reg.h	\
-	pcic_var.h	\
 	pic.h		\
 	pit.h		\
 	rtc.h
--- old/usr/src/uts/common/sys/pccard.h	2014-11-12 17:44:41.678764530 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,67 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * PCMCIA PC Card client driver master header file
- *
- * All PC Card client drivers must include this header file
- */
-
-#ifndef _PCCARD_H
-#define	_PCCARD_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/kmem.h>
-
-#ifdef	_KERNEL
-#include <sys/systm.h>
-#include <sys/sysmacros.h>
-#include <sys/cmn_err.h>
-#include <sys/debug.h>
-#include <sys/devops.h>
-#endif	/* _KERNEL */
-
-#include <sys/dditypes.h>
-#include <sys/modctl.h>
-
-#include <sys/pctypes.h>
-#include <sys/cs_types.h>
-#include <sys/cis.h>
-#include <sys/cis_handlers.h>
-#include <sys/cs.h>
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _PCCARD_H */
--- old/usr/src/uts/common/sys/pcic_reg.h	2014-11-12 17:44:41.729882164 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,631 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Intel 82365SL device and register definitions
- */
-
-#ifndef _PCIC_REG_H
-#define	_PCIC_REG_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * global information
- */
-#define	PCIC_MAX_CONTROLLERS	4 /* maximum of 4 chips in system */
-
-/*
- * per socket information
- */
-
-#define	PCIC_SOCKETS	2	/* number of sockets per PCIC chip */
-#define	PCIC_MEMWINDOWS	5	/* number of memory windows per socket */
-#define	PCIC_IOWINDOWS	2	/* number of I/O address windows per socket */
-/* number of windows per chip */
-#define	PCIC_NUMWINDOWS ((PCIC_MEMWINDOWS + PCIC_IOWINDOWS) * PCIC_SOCKETS)
-/* number of windows per socket */
-#define	PCIC_NUMWINSOCK	(PCIC_MEMWINDOWS+PCIC_IOWINDOWS)
-
-/*
- * socket selection registers
- *
- * the PCIC allows up to 8 sockets per system
- * this is done by having two sockets per chip and up to 4 chips per
- * system.  There can be up to 4 sockets (2 PCIC chips) per I/O address.
- * There are two possible I/O address (index register) values.
- * socket#	I/O address	value to write to index register
- *   0		INDEX_REG0	BASE0 + SOCKET_0 + register offset
- *   1		INDEX_REG0	BASE0 + SOCKET_1 + register offset
- *   2		INDEX_REG0	BASE1 + SOCKET_0 + register offset
- *   3		INDEX_REG0	BASE1 + SOCKET_1 + register offset
- * next 4 are based off of INDEX_REG1
- */
-
-#define	PCIC_INDEX_REG0	0x3e0	/* first possible index register */
-#define	PCIC_INDEX_REG1	0x3e2	/* second possible index register */
-
-#define	PCIC_BASE0	0x00	/* first set of sockets */
-#define	PCIC_BASE1	0x80	/* second set of sockets */
-
-#define	PCIC_SOCKET_0	0x00	/* first socket */
-#define	PCIC_SOCKET_1	0x40	/* second socket */
-
-#define	PCIC_DATA_REG0	(PCIC_INDEX_REG0+1)
-#define	PCIC_DATA_REG1	(PCIC_INDEX_REG1+1)
-
-/*
- * per socket register
- * these are accessed by writing the offset value into the
- * index register and adding the appropriate base offset and socket offset
- * the register is then present in the data register.
- */
-
-/* General Registers */
-
-#define	PCIC_CHIP_REVISION	0x00 /* identification and revision */
-#define	PCIC_INTERFACE_STATUS	0x01 /* Interface status */
-#define	PCIC_POWER_CONTROL	0x02 /* Power and RESETDRV control */
-#define	PCIC_CARD_STATUS_CHANGE	0x04 /* card status change */
-#define	PCIC_MAPPING_ENABLE	0x06 /* address window mapping enable */
-#define	PCIC_CARD_DETECT	0x16 /* card detect&general control register */
-#define	PCIC_MISC_CTL_1		0x16 /* CL version */
-#define	PCIC_GLOBAL_CONTROL	0x1e /* global control register */
-#define	PCIC_MISC_CTL_2		0x1e /* CL version */
-#define	PCIC_CHIP_INFO		0x1f /* Cirrus Logic chip info register */
-
-/* Interrupt Registers */
-
-#define	PCIC_INTERRUPT		0x03 /* interrupt & general control register */
-#define	PCIC_MANAGEMENT_INT	0x05 /* card status change interrupt register */
-
-/* I/O Registers */
-
-#define	PCIC_IO_CONTROL		0x07 /* I/O Control register */
-#define	PCIC_IO_ADDR_0_STARTLOW	0x08 /* I/O address map 0 start low byte */
-#define	PCIC_IO_ADDR_0_STARTHI	0x09 /* I/O address map 0 start high byte */
-#define	PCIC_IO_ADDR_0_STOPLOW	0x0a /* I/O address map 0 stop low byte */
-#define	PCIC_IO_ADDR_0_STOPHI	0x0b /* I/O address map 0 stop high byte */
-#define	PCIC_IO_OFFSET_LOW	0x36 /* I/O Offset for CL */
-#define	PCIC_IO_OFFSET_HI	0x37
-#define	PCIC_IO_OFFSET_OFFSET	2
-
-#define	PCIC_IO_ADDR_1_OFFSET	5 /* offset to second I/O map register set */
-#define	PCIC_IO_WIN_MASK	0xf
-
-/* Memory Registers */
-				/* window 0 */
-#define	PCIC_SYSMEM_0_STARTLOW	0x10 /* system memory map 0 start low byte */
-#define	PCIC_SYSMEM_0_STARTHI	0x11 /* system memory map 0 start high byte */
-#define	PCIC_SYSMEM_0_STOPLOW	0x12 /* system memory map 0 stop low byte */
-#define	PCIC_SYSMEM_0_STOPHI	0x13 /* system memory map 0 stop high byte */
-#define	PCIC_CARDMEM_0_LOW	0x14 /* card memory offset 0 low byte */
-#define	PCIC_CARDMEM_0_HI	0x15 /* card memory offset 0 high byte */
-
-				/* window 1 */
-#define	PCIC_SYSMEM_1_STARTLOW	0x18 /* system memory map 0 start low byte */
-#define	PCIC_SYSMEM_1_STARTHI	0x19 /* system memory map 0 start high byte */
-#define	PCIC_SYSMEM_1_STOPLOW	0x1a /* system memory map 0 stop low byte */
-#define	PCIC_SYSMEM_1_STOPHI	0x1b /* system memory map 0 stop high byte */
-#define	PCIC_CARDMEM_1_LOW	0x1c /* card memory offset 0 low byte */
-#define	PCIC_CARDMEM_1_HI	0x1d /* card memory offset 0 high byte */
-
-#define	PCIC_MEM_1_OFFSET	8 /* offset to second memory map register set */
-#define	PCIC_MEM_2_OFFSET	16
-#define	PCIC_MEM_3_OFFSET	24
-#define	PCIC_MEM_4_OFFSET	32
-
-#define	PCIC_IO_OFFSET		4 /* offset to next set of I/O map registers */
-
-/* Cirrus Logic specific registers */
-#define	PCIC_TIME_SETUP_0	0x3A
-#define	PCIC_TIME_SETUP_1	0x3D
-#define	PCIC_TIME_COMMAND_0	0x3B
-#define	PCIC_TIME_COMMAND_1	0x3E
-#define	PCIC_TIME_RECOVER_0	0x3C
-#define	PCIC_TIME_RECOVER_1	0x3F
-#define	PCIC_ATA_CONTROL	0x26
-#define	PCIC_FIFO_CONTROL	0x17
-#define	PCIC_CL_EXINDEX		0x2e
-#define	PCIC_CL_EXDATA		0x2f
-
-/*
- * Cirrus Logic PCI-PCMCIA adapters extension register indicies
- */
-#define	PCIC_CLEXT_SCRATCH	0x00
-#define	PCIC_CLEXT_DMASK_0	0x01
-#define	PCIC_CLEXT_EXT_CTL_1	0x03
-#define	PCIC_CLEXT_MMAP0_UA	0x05
-#define	PCIC_CLEXT_MMAP1_UA	0x06
-#define	PCIC_CLEXT_MMAP2_UA	0x07
-#define	PCIC_CLEXT_MMAP3_UA	0x08
-#define	PCIC_CLEXT_MMAP4_UA	0x09
-#define	PCIC_CLEXT_EXDATA	0x0a
-#define	PCIC_CLEXT_EXT_CTL_2	0x0b	/* 6729 */
-#define	PCIC_CLEXT_MISC_CTL_3	0x25	/* 6730 */
-#define	PCIC_CLEXT_SMB_CTL	0x26	/* 6730 */
-
-/* the 6832 is mapped into different offsets for extension regs */
-
-#define	PCIC_CBCLEXT_MMAP0_UA	0x40 /* minus the 0x800 */
-#define	PCIC_CBCLEXT_MMAP1_UA	0x41
-#define	PCIC_CBCLEXT_MMAP2_UA	0x42
-#define	PCIC_CBCLEXT_MMAP3_UA	0x43
-#define	PCIC_CBCLEXT_MMAP4_UA	0x44
-#define	PCIC_CBCLEXT_MMAP5_UA	0x45
-
-#define	PCIC_CLEXT_MISC_CTL_3_REV_MASK	0xf0
-
-/*
- * Cirrus Logic PCI-PCMCIA PCIC_CLEXT_EXT_CTL_1 reg bit definitions
- */
-#define	PCIC_CLEXT_IRQ_LVL_MODE	0x08
-#define	PCIC_CLEXT_SMI_LVL_MODE	0x00 /* see errata 1.0 */
-
-/*
- * Cirrus Logic PCI-PCMCIA PCIC_MISC_CTL_2 reg bit definitions
- */
-#define	PCIC_CL_LP_DYN_MODE	0x02	/* low-power dynamic mode */
-#define	PCIC_CL_TIMER_CLK_DIV	0x10	/* PCI clock divide */
-
-/*
- * Cirrus Logic PCI-PCMCIA PCIC_CLEXT_MISC_CTL_3 reg bit definitions
- */
-#define	PCIC_CLEXT_INT_PC_PCI	0x00
-#define	PCIC_CLEXT_INT_EXT_HW	0x01
-#define	PCIC_CLEXT_INT_PCI_WAY	0x10
-#define	PCIC_CLEXT_INT_PCI	0x03 /* see errata 1.0 */
-#define	PCIC_CLEXT_PWR_EXT_HW	0x00
-#define	PCIC_CLEXT_PWR_RESERVED	0x04
-#define	PCIC_CLEXT_PWR_TI	0x80
-#define	PCIC_CLEXT_PWR_SMB	0xc0
-
-/*
- * Intel 82092-AA reg and bit definitions
- */
-#define	PCIC_82092_PCICON	0x40	/* PCI configuration control */
-#define	PCIC_82092_PCICLK_25MHZ	0x01	/* 25MHz PCI clock */
-#define	PCIC_82092_SLOT_CONFIG	0x06	/* config mask */
-#define	PCIC_82092_2_SOCKETS	0x00	/* 2 sockets */
-#define	PCIC_82092_1_SOCKET	0x02	/* 1 socket + IDE */
-#define	PCIC_82092_4_SOCKETS	0x04	/* 4 sockets + IDE */
-#define	PCIC_82092_EN_TIMING	0x20	/* enhanced memory window timing */
-#define	PCIC_82092_PWB		0x08	/* Post Write Buffering */
-#define	PCIC_82092_RPFB		0x10	/* Read Prefetch Buffering */
-#define	PCIC_82092_PPIRR	0x50	/* interrupt routing register */
-#define	PCIC_82092_SMI_CTL(sock, state)	(state << (sock * 2))
-#define	PCIC_82092_IRQ_CTL(sock, state)	(state << ((sock * 2) + 1))
-#define	PCIC_82092_CTL_SMI	0x01
-#define	PCIC_82092_CTL_IRQ	0x02
-#define	PCIC_82092_INT_DISABLE	0x00
-#define	PCIC_82092_INT_ENABLE	0x01
-#define	PCIC_82092_CPAGE	0x26	/* CPAGE register */
-
-/*
- * identification and revision register
- */
-#define	PCIC_REV_ID_MASK	0xc0
-#define	PCIC_REV_ID_IO		0x00
-#define	PCIC_REV_ID_MEM		0x40
-#define	PCIC_REV_ID_BOTH	0x80
-
-/*
- * interface status register bit definitions
- */
-#define	PCIC_ISTAT_CD_MASK	0xC /* card detect mask */
-#define	PCIC_CD_PRESENT_OK	0xC /* card is present and fully seated */
-#define	PCIC_CD_NOTPRESENT	0x0 /* card not present */
-#define	PCIC_CD_NOTSEATED_1	0x8 /* card not fully seated */
-#define	PCIC_CD1		0x8
-#define	PCIC_CD_NOTSEATED_2	0x4 /* card not fully seated */
-#define	PCIC_CD2		0x4
-#define	PCIC_WRITE_PROTECT	0x10
-#define	PCIC_READY		0x20
-#define	PCIC_POWER_ON		0x40
-#define	PCIC_VPP_VALID		0x80
-#define	PCIC_BVD1		0x1
-#define	PCIC_BVD2		0x2
-
-/*
- * memory register definitions
- */
-#define	SYSMEM_LOW(x)		(((uint32_t)(x)>>12)&0xFF)
-#define	SYSMEM_HIGH(x)		(((uint32_t)(x)>>20)&0xF)
-#define	SYSMEM_EXT(x)		(((uint32_t)(x)>>24)&0xFF)
-#define	SYSMEM_WINDOW(x)	(1<<(x))
-#define	SYSMEM_ZERO_WAIT	0x40 /* zero wait state bit */
-#define	SYSMEM_DATA_16		0x80 /* 16 bit memory bit */
-#define	SYSMEM_MEM16		0x20 /* 16 bit memory in window enable */
-#define	SYSMEM_CLTIMER_SET_0	0x00
-#define	SYSMEM_CLTIMER_SET_1	0x80
-
-#define	SYSMEM_82092_600NS	0x0110
-#define	SYSMEM_82092_250NS	0x0101
-#define	SYSMEM_82092_200NS	0x0100
-#define	SYSMEM_82092_150NS	0x0011
-#define	SYSMEM_82092_100NS	0x0010
-#define	SYSMEM_82092_80NS	0x0001
-
-#define	DEFAULT_AM_ADDR		0xd0000
-
-#define	CARDMEM_REG_ACTIVE	0x40
-#define	CARDMEM_WRITE_PROTECT	0x80
-
-#define	CARDMEM_LOW(x)		(((uint32_t)((x))>>12)&0xFF)
-#define	CARDMEM_HIGH(x)		(((uint32_t)((x))>>20)&0x3F)
-
-#define	POWER_CARD_ENABLE	0x10
-#define	POWER_3VCARD_ENABLE	0x18
-#define	POWER_OUTPUT_ENABLE	0x80
-#define	POWER_VPP_VCC_ENABLE	0x01
-#define	POWER_VPP_12V_ENABLE	0x02
-
-/* interrupt register definitions */
-#define	PCIC_INTR_ENABLE	0x10
-#define	PCIC_IO_CARD		0x20
-#define	PCIC_RESET		0x40
-#define	PCIC_INTR_MASK		0x0f
-
-/* card status change register definitions */
-#define	PCIC_CD_DETECT		0x08
-#define	PCIC_RD_DETECT		0x04
-#define	PCIC_BW_DETECT		0x02
-#define	PCIC_BD_DETECT		0x01
-#define	PCIC_CHANGE_MASK	0x0f
-
-/* card status change interrupt register definitions */
-#define	PCIC_CD_ENABLE		0x08 /* card detect enable */
-#define	PCIC_RD_ENABLE		0x04 /* ready change enable */
-#define	PCIC_BW_ENABLE		0x02 /* battery warning enable */
-#define	PCIC_BD_ENABLE		0x01 /* battery deat enable */
-#define	PCIC_GPI_CHANGE		0x10 /* general purpose interrupt */
-#define	PCIC_CHANGE_DEFAULT	(PCIC_CD_ENABLE|PCIC_RD_ENABLE|\
-					PCIC_BW_ENABLE|PCIC_BD_ENABLE)
-
-/* card detect change register */
-#define	PCIC_GPI_ENABLE		0x04
-#define	PCIC_GPI_TRANSITION	0x08
-#define	PCIC_16MDI		0x01
-#define	PCIC_SOFT_CD_INTR	0x20
-
-/* misc control 1 */
-#define	PCIC_MC_5VDETECT	0x01
-#define	PCIC_MC_3VCC		0x02
-#define	PCIC_MC_PULSE_SMI	0x04
-#define	PCIC_MC_PULSE_IRQ	0x08
-#define	PCIC_MC_SPEAKER_ENB	0x10
-#define	PCIC_MC_INPACK_ENB 	0x80
-
-/* global control registers definitions */
-#define	PCIC_GC_POWERDOWN	0x01
-#define	PCIC_GC_LEVELMODE	0x02
-#define	PCIC_GC_CSC_WRITE	0x04
-#define	PCIC_GC_IRQ1_PULSE	0x08
-
-/* misc control 2 */
-#define	PCIC_MC_BYPASS_FS	0x01
-#define	PCIC_MC_LOWPOWER	0x02
-#define	PCIC_MC_SUSPEND 	0x04
-#define	PCIC_5V_CORE		0x08
-#define	PCIC_LED_ENABLE		0x10
-#define	PCIC_THREESTATE		0x20
-#define	PCIC_CL_DMA		0x40
-#define	PCIC_IRQ15_RI_OUT	0x80
-
-/* chip info register (Cirrus) definitions */
-#define	PCIC_CI_ID	0xc0
-#define	PCIC_CI_SLOTS	0x20
-
-/* Vadem unique registers */
-#define	PCIC_VADEM_P1	0x0E
-#define	PCIC_VADEM_P2	0x37
-
-#define	PCIC_VG_VSENSE	0x1f
-#define	PCIC_VG_VSELECT	0x2f
-#define	PCIC_VG_CONTROL	0x38
-#define	PCIC_VG_TIMER	0x39
-#define	PCIC_VG_DMA	0x3A
-#define	PCIC_VG_EXT_A	0x3C
-#define	PCIC_VG_STATUS	0x3E
-
-/* Vadem DMA Register */
-#define	PCIC_V_DMAWSB	0x04
-#define	PCIC_V_VADEMREV	0x40
-#define	PCIC_V_UNLOCK	0x80
-
-/* Vadem identification register */
-#define	PCIC_VADEM_D3	0x8
-#define	PCIC_VADEM_365	0x9
-#define	PCIC_VADEM_465	0x8
-#define	PCIC_VADEM_468	0xB
-#define	PCIC_VADEM_469	0xC
-
-/* Vadem Voltage Select */
-#define	PCIC_VSEL_EXTENDED	0x10 /* extended mode */
-#define	PCIC_VSEL_BUSSEL	0x20 /* extended buffers on ISA */
-
-/* Vadem Control Register */
-#define	PCIC_VC_DELAYENABLE	0x10
-
-/* Vadem Extended Mode Register A */
-#define	PCIC_VEXT_CABLEMODE	0x08 /* enable external cable */
-
-#define	PCIC_YENTA_MEM_PAGE	0x40 /* yenta defined extended address byte */
-
-/* Ricoh Specific Registers */
-#define	PCIC_RF_CHIP_IDENT	0x3A
-#define	PCIC_RF_296		0x32
-#define	PCIC_RF_396		0xB2
-#define	PCIC_RF_MEM_PAGE	PCIC_YENTA_MEM_PAGE
-
-/* O2 Micro Specific registers */
-#define	PCIC_CENTDMA	0x3C
-#define	PCIC_MULTIFUNC	0x8C
-#define	PCIC_O2_CTRL1	0xD0
-#define	PCIC_O2_CTRL2	0xD4
-
-/* Texas Instruments specific Registers */
-#define	PCIC_INTLINE_REG	0x3C
-#define	PCIC_INTPIN_REG		0x3D
-#define	PCIC_BRIDGE_CTL_REG	0x3e
-#define	PCIC_FUN_INT_MOD_ISA	0x80
-
-/* for PCI1420 chip */
-#define	PCIC_BRDGCTL_INTR_MASK	0x80
-#define	PCIC_GPIO0_REG		0x88
-#define	PCIC_GPIO1_REG		0x89
-#define	PCIC_GPIO2_REG		0x8A
-#define	PCIC_GPIO3_REG		0x8B
-
-#define	PCIC_MFROUTE_REG	0x8c
-#define	PCIC_MFUNC0_MASK	0xF
-#define	PCIC_MFUNC0_INTA	0x2
-
-#define	PCIC_DIAG_REG		0x93
-#define	PCIC_GPIO_FMASK		0xC0
-#define	PCIC_GPIO_INTENBL	0x10
-#define	PCIC_GPIO_DELTA		0x08
-#define	PCIC_GPIO_DOUT		0x02
-#define	PCIC_GPIO_DIN		0x01
-#define	PCIC_GPIO_FOUTPUT	0xC0
-#define	PCIC_GPIO_FINPUT	0x80
-#define	PCIC_GPIO2_IS_PCILOCK	0x00
-#define	PCIC_GPIO3_IS_INTA	0x00
-#define	PCIC_TI_WINDOW_PAGE	0x3C /* legacy */
-#define	PCIC_TI_WINDOW_PAGE_PCI	0x40
-
-#define	PCIC_DIAG_REG		0x93 /* Diagnostic Register */
-/* for PCI1225 chip */
-#define	PCIC_DIAG_CSC		0x20 /* CSC Interrupt Routing Control */
-/* for PCI1221 and PCI1225 chips */
-#define	PCIC_DIAG_ASYNC		0x01 /* Async. interrupt enable */
-
-#define	PCIC_DEVCTL_REG		0x92 /* Device Control Register */
-#define	PCIC_DEVCTL_INTR_MASK	0x06 /* to mask out mode */
-#define	PCIC_DEVCTL_INTR_PCI	0x00 /* PCI style interrupts */
-#define	PCIC_DEVCTL_INTR_ISA	0x02 /* ISA style interrupts */
-#define	PCIC_DEVCTL_INTR_SER	0x04 /* serialize IRQ scheme */
-#define	PCIC_DEVCTL_INTR_RSVD	0x06 /* reserved */
-/* for PCI1221 and PCI1225 chips */
-#define	PCIC_DEVCTL_3VCAPABLE	0x40 /* 3V socket capable force */
-#define	PCIC_DEVCTL_INTR_DFLT	0x06 /* default interrupt mode */
-
-#define	PCIC_CRDCTL_REG		0x91 /* Card Control Register */
-#define	PCIC_CRDCTL_RIENABLE    0x80 /* Ring indicate enable on TI1250a */
-#define	PCIC_CRDCTL_ZVENABLE    0x40 /* Z buffer enable on TI1250a */
-#define	PCIC_CRDCTL_PCIINTR	0x20 /* use PCI INT A/B */
-#define	PCIC_CRDCTL_PCICSC	0x10 /* PCI intr for status */
-#define	PCIC_CRDCTL_PCIFUNC	0x08 /* use PCI intr for cards */
-#define	PCIC_CRDCTL_SPKR_ENBL	0x02 /* Enable speaker plumbing */
-#define	PCIC_CRDCTL_IFG		0x01 /* card interrupt flag */
-
-#define	PCIC_SYSCTL_REG		0x80 /* System Control Register */
-#define	PCIC_SYSCTL_INTRTIE	0x20 /* tie INTA and INTB */
-
-/* for Toshiba chips */
-#define	PCIC_TOSHIBA_SLOT_CTL_REG	0xa0 /* slot control register */
-#define	PCIC_TOSHIBA_SCR_SLOTON		0x80
-#define	PCIC_TOSHIBA_SCR_SLOTEN		0x40
-#define	PCIC_TOSHIBA_SCR_PRT_MASK	0xc
-#define	PCIC_TOSHIBA_SCR_PRT_3E0	0x0
-#define	PCIC_TOSHIBA_SCR_PRT_3E2	0x4
-#define	PCIC_TOSHIBA_SCR_PRT_3E4	0x8
-#define	PCIC_TOSHIBA_SCR_PRT_3E6	0xc
-#define	PCIC_TOSHIBA_INTR_CTL_REG	0xa1 /* interrupt control register */
-#define	PCIC_TOSHIBA_ICR_PIN_MASK	0x30
-#define	PCIC_TOSHIBA_ICR_PIN_DISEN	0x0
-#define	PCIC_TOSHIBA_ICR_PIN_INTA	0x10
-#define	PCIC_TOSHIBA_ICR_PIN_INTB	0x20
-#define	PCIC_TOSHIBA_ICR_MOD_CSC	0x4 /* CSC interrupt mode */
-#define	PCIC_TOSHIBA_ICR_MOD_FUN	0x2 /* Funtional interrupt mode */
-#define	PCIC_TOSHIBA_ICR_SRC		0x1 /* INTA or IRQ */
-
-/* for Ricoh chips */
-#define	PCIC_RICOH_MISC_CTL	0x82
-#define	PCIC_RICOH_SIRQ_EN	0x80	/* serialized IRQ */
-#define	PCIC_RICOH_MISC_CTL_2	0xa0	/* ricoh */
-#define	PCIC_RICOH_CSC_INT_MOD	0x80	/* csc to ISA */
-#define	PCIC_RICOH_FUN_INT_MOD	0x40	/* cint to ISA */
-
-/* for o2micro */
-#define	PCIC_O2MICRO_MISC_CTL	0x28
-#define	PCIC_O2MICRO_INT_MOD_MASK	0x300
-#define	PCIC_O2MICRO_INT_MOD_PCI	0x300
-#define	PCIC_O2MICRO_ISA_LEGACY		0x800
-/*  */
-
-/* SMC 34C90 specific registers */
-#define	PCIC_SMC_MEM_PAGE	0x40
-
-/* available interrupts and interrupt mask */
-#define	PCIC_IRQ(irq)	(1 << (irq))
-#define	PCIC_IRQ03	PCIC_IRQ(3)
-#define	PCIC_IRQ04	PCIC_IRQ(4)
-#define	PCIC_IRQ05	PCIC_IRQ(5)
-#define	PCIC_IRQ07	PCIC_IRQ(7)
-#define	PCIC_IRQ09	PCIC_IRQ(9)
-#define	PCIC_IRQ10	PCIC_IRQ(10)
-#define	PCIC_IRQ11	PCIC_IRQ(11)
-#define	PCIC_IRQ12	PCIC_IRQ(12)
-#define	PCIC_IRQ14	PCIC_IRQ(14)
-#define	PCIC_IRQ15	PCIC_IRQ(15)
-
-#define	PCIC_AVAIL_IRQS	(PCIC_IRQ03|PCIC_IRQ04|PCIC_IRQ05|PCIC_IRQ07|\
-				PCIC_IRQ09|PCIC_IRQ10|PCIC_IRQ11|PCIC_IRQ12|\
-				PCIC_IRQ14|PCIC_IRQ15)
-
-/* page size used for window mapping and memory resource page size */
-#define	PCIC_PAGE	4096
-
-/* used in I/O window mapping */
-#define	HIGH_BYTE(x)	(uchar_t)((((ushort_t)(x)) >> 8) & 0xFF)
-#define	LOW_BYTE(x)	(uchar_t)(((ushort_t)(x)) & 0xFF)
-#define	PCIC_IO_0_MASK	0x0f
-#define	PCIC_IO_1_MASK	0xf0
-#define	IOMEM_WINDOW(x)	(1<<((x)+6))
-
-#define	IOMEM_16BIT		0x01
-#define	IOMEM_IOCS16		0x02
-#define	IOMEM_ZERO_WAIT		0x04
-#define	IOMEM_CLTIMER_SET_0	0x00	/* CL timer set selection */
-#define	IOMEM_CLTIMER_SET_1	0x08	/* CL timer set selection */
-#define	IOMEM_WAIT16		0x08
-#define	IOMEM_SETWIN(w, x)	((x) << ((w)*4))
-
-#define	IOMEM_FIRST	0	/* First I/O address */
-#define	IOMEM_LAST	0xFFFF	/* Last I/O address */
-#define	IOMEM_MIN	1	/* minimum I/O window size */
-#define	IOMEM_MAX	0x10000	/* maximum I/O window size */
-#define	IOMEM_GRAN	1	/* granularity of request */
-#define	IOMEM_DECODE	16	/* number of address lines decoded */
-
-#define	MEM_FIRST	0x10000	/* first memory address */
-#define	MEM_LAST	0xFFFFF	/* last memory address */
-#define	MEM_MIN		PCIC_PAGE /* minimum window size */
-#define	MEM_MAX		0x10000	/* maximum window size */
-#define	PAGE_SHIFT	12	/* bits to shift */
-
-#define	SYSCLK		120	/* sysclk min time (ns) */
-#define	MEM_SPEED_MIN	(SYSCLK*2)
-#define	MEM_SPEED_MAX	(SYSCLK*6)
-
-/* CardBus (Yenta) specific values */
-#define	CB_R2_OFFSET	0x800	/* R2 is always at offset 0x800 */
-#define	CB_CLEXT_OFFSET	0x900	/* Cirrus Logic extended at offset 0x900 */
-#define	CB_CB_OFFSET	0x00	/* Cardbus registers at offset 0 */
-
-/* Cardbus registers in TI 1250A/Cirrus 6832 and probably others.  */
-/* Register offsets (these are 32 bit registers).  */
-#define	CB_STATUS_EVENT		0x00
-#define	CB_STATUS_MASK		0x04
-#define	CB_PRESENT_STATE	0x08
-#define	CB_EVENT_FORCE		0x0c
-#define	CB_CONTROL		0x10
-
-/* TI1420 */
-#define	CB_SOCKET_POWER		0x20
-
-/* Cardbus registers in 02 0Z6912.  */
-#define	CB_SZVCTRL		0x20
-#define	CB_SIMDCTRL		0x24
-#define	CB_MISCCTRL		0x28
-
-/* Register bit definitions.  */
-#define	BYTE_3(x)		((x)<<24)
-#define	BYTE_2(x)		((x)<<16)
-#define	BYTE_1(x)		((x)<<8)
-#define	BYTE_0(x)		(x)
-
-#define	CB_SE_POWER_CYCLE	BYTE_0(0x08)
-#define	CB_SE_CCDMASK		BYTE_0(0x06)
-#define	CB_SE_CCD2		BYTE_0(0x04)
-#define	CB_SE_CCD1		BYTE_0(0x02)
-#define	CB_SE_CSTSCHG		BYTE_0(0x01)
-
-#define	CB_SM_POWER_CYCLE	BYTE_0(0x08)
-#define	CB_SM_CCDMASK		BYTE_0(0x06)
-#define	CB_SM_CCD2		BYTE_0(0x04)
-#define	CB_SM_CCD1		BYTE_0(0x02)
-#define	CB_SM_CSTSCHG		BYTE_0(0x01)
-
-#define	CB_PS_CSTSCHG		BYTE_0(0x01)
-#define	CB_PS_CCDMASK		BYTE_0(0x06)
-#define	CB_PS_NCCD1		BYTE_0(0x02)
-#define	CB_PS_NCCD2		BYTE_0(0x04)
-#define	CB_PS_POWER_CYCLE	BYTE_0(0x08)
-#define	CB_PS_16BITCARD		BYTE_0(0x10)
-#define	CB_PS_CBCARD		BYTE_0(0x20)
-#define	CB_PS_INTERRUPT		BYTE_0(0x40)
-#define	CB_PS_NOTACARD		BYTE_0(0x80)
-
-#define	CB_PS_DATALOST		BYTE_1(0x01)
-#define	CB_PS_BADVCC		BYTE_1(0x02)
-#define	CB_PS_50VCARD		BYTE_1(0x04)
-#define	CB_PS_33VCARD		BYTE_1(0x08)
-#define	CB_PS_XVCARD		BYTE_1(0x10)
-#define	CB_PS_YVCARD		BYTE_1(0x20)
-
-#define	CB_PS_50VSOCKET		BYTE_3(0x10)
-#define	CB_PS_33VSOCKET		BYTE_3(0x20)
-#define	CB_PS_XVSOCKET		BYTE_3(0x40)
-#define	CB_PS_YVSOCKET		BYTE_3(0x80)
-
-#define	CB_EF_CSTSCHG		BYTE_0(0x01)
-#define	CB_EF_CCD1		BYTE_0(0x02)
-#define	CB_EF_CCD2		BYTE_0(0x04)
-#define	CB_EF_POWER_CYCLE	BYTE_0(0x08)
-#define	CB_EF_16BITCARD		BYTE_0(0x10)
-#define	CB_EF_CBCARD		BYTE_0(0x20)
-#define	CB_EF_NOTACARD		BYTE_0(0x80)
-
-#define	CB_EF_DATALOST		BYTE_1(0x01)
-#define	CB_EF_BADVCC		BYTE_1(0x02)
-#define	CB_EF_50V		BYTE_1(0x04)
-#define	CB_EF_33V		BYTE_1(0x08)
-#define	CB_EF_XV		BYTE_1(0x10)
-#define	CB_EF_YV		BYTE_1(0x20)
-#define	CB_EF_CVTEST		BYTE_1(0x40)
-
-#define	CB_C_VPPMASK		BYTE_0(0x07)
-#define	CB_C_VCCMASK		BYTE_0(0x70)
-
-#define	CB_C_VPP0V		BYTE_0(0x00)
-#define	CB_C_VPP12V		BYTE_0(0x01)
-#define	CB_C_VPPVCC		BYTE_0(0x03)
-
-#define	CB_C_VCC0V		BYTE_0(0x00)
-#define	CB_C_VCC50V		BYTE_0(0x20)
-#define	CB_C_VCC33V		BYTE_0(0x30)
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _PCIC_REG_H */
--- old/usr/src/uts/common/sys/pcic_var.h	2014-11-12 17:44:41.783684291 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,618 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * PCIC driver specific data structures
- */
-
-#ifndef _PCIC_VAR_H
-#define	_PCIC_VAR_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * defines and default values for power management simulation
- */
-#define	PCIC_PM_TIME		3	/* PM timer timeout time in secs */
-#define	PCIC_PM_DETWIN		6	/* detection window in secs */
-#define	PCIC_PM_METHOD_TIME	0x0001	/* use time check */
-#define	PCIC_PM_METHOD_REG	0x0002	/* use reg check */
-#define	PCIC_PM_DEF_METHOD	0	/* use no methods as default */
-
-#define	PCIC_PM_INIT	0x0001	/* init PM handler */
-#define	PCIC_PM_RUN	0x0002	/* normal PM handler operation */
-
-typedef struct pcic_pm_t {
-	int		state;	/* state */
-	uint32_t	ptime;	/* previous time check */
-	dev_info_t	*dip;	/* dip to pass */
-} pcic_pm_t;
-
-/*
- * Card insertion/removal processing debounce parameters
- */
-#define	PCIC_REM_DEBOUNCE_CNT	40
-#define	PCIC_REM_DEBOUNCE_TIME	0x1000	/* in uS */
-#define	PCIC_DEBOUNCE_OK_CNT    10
-
-/*
- * Loop control in pcic_ready_wait
- *
- * Multiplying PCIC_READY_WAIT_LOOPS * PCIC_READY_WAIT_TIME gives
- *	total loop time in mS
- */
-#define	PCIC_READY_WAIT_LOOPS	205	/* count */
-#define	PCIC_READY_WAIT_TIME	20	/* mS */
-
-typedef struct pcs_memwin {
-	int			pcw_status;
-	uint32_t		pcw_base;
-	int			pcw_len;
-	uint32_t		pcw_speed;
-	volatile caddr_t	pcw_hostmem;
-	off_t			pcw_offset;
-	ddi_acc_handle_t	pcw_handle;
-	dev_info_t		*res_dip; /* dip from which mem is allocated */
-} pcs_memwin_t;
-
-typedef struct pci_iowin {
-	int 			pcw_status;
-	uint32_t		pcw_base;
-	int			pcw_len;
-	uint32_t		pcw_speed;
-	volatile caddr_t	pcw_hostmem;
-				/* Cirrus Logic specific offset info */
-	int			pcw_offset;
-	ddi_acc_handle_t	pcw_handle;
-	dev_info_t		*res_dip; /* dip from which io is allocated */
-} pcs_iowin_t;
-
-#define	PCW_MAPPED	0x0001	/* window is mapped */
-#define	PCW_ENABLED	0x0002	/* window is enabled */
-#define	PCW_ATTRIBUTE	0x0004	/* window is in attribute memory */
-#define	PCW_WP		0x0008	/* window is write protected */
-#define	PCW_OFFSET	0x0010	/* window uses CL style offset */
-
-typedef
-struct pcic_socket {
-	int	pcs_flags;
-	uchar_t	*pcs_io;	/* I/O address of PCIC controller */
-	int	pcs_socket;	/* socket to determine register set */
-	char    pcs_cd_softint_flg;
-	timeout_id_t pcs_debounce_id;	/* timeout for CD debounce */
-	ddi_softint_handle_t pcs_cd_softint_hdl; /* Debounce softint id */
-	struct pcicdev_t *pcs_pcic;
-	caddr_t pcs_phys;
-	int	pcs_iobase;
-	int	pcs_iolen;
-	caddr_t pcs_confbase;
-	int	pcs_conflen;
-	int	pcs_conf_index;	/* used to select which cftable entry to use */
-	int 	pcs_irq;
-	int	pcs_smi;
-	int	pcs_state;
-	int	pcs_status;
-	int	pcs_intmask;
-	uint32_t pcs_vcc;
-	uint32_t pcs_vpp1;
-	uint32_t pcs_vpp2;
-	union pcic_window {
-		pcs_memwin_t mem;
-		pcs_iowin_t  io;
-	}	pcs_windows[PCIC_IOWINDOWS + PCIC_MEMWINDOWS];
-} pcic_socket_t;
-
-#define	PCS_CARD_PRESENT	0x0001	/* card inserted in socket */
-#define	PCS_CARD_IDENTIFIED	0x0002	/* card has been identified */
-#define	PCS_CARD_ENABLED	0x0004	/* card and socket enabled */
-#define	PCS_CARD_WPS		0x0008	/* write protect ignored */
-#define	PCS_IRQ_ENABLED		0x0010	/* irq is a mask of values */
-#define	PCS_CARD_RAM		0x0020	/* ram needs to be mapped */
-#define	PCS_CARD_IO		0x0040	/* card is I/O type */
-#define	PCS_CARD_16BIT		0x0080	/* set in 16-bit mode */
-#define	PCS_SOCKET_IO		0x0100	/* socket is I/O type */
-#define	PCS_READY		0x0200	/* socket just came ready */
-#define	PCS_WAITING		0x0400	/* Doing a wait on this socket */
-#define	PCS_STARTING		0x0800	/* Starting up flag */
-#define	PCS_CARD_ISCARDBUS	0x1000	/* NJH - 32 bit (CARDBUS) card */
-#define	PCS_CARD_IS16BIT	0x2000	/* So we can tell if it's OK */
-#define	PCS_CARD_REMOVED	0x4000	/* Removed but still work to do */
-#define	PCS_CARD_CBREM		0x8000	/* Cardbus specific work to do */
-#define	PCS_DEBOUNCING		0x10000  /* Socket in debouncing state */
-
-#define	PCIC_MAX_SOCKETS 4	/* 2 per chip up to 2 chips per IO addr */
-
-typedef struct pcic_debounce_state {
-	int insert_cnt;
-	int remove_cnt;
-	int uncertain_cnt;
-	int prev_status;
-	int debounce_cnt;
-	timeout_id_t timeout_id;
-} pcic_debounce_state_t;
-
-typedef struct pcicdev_t {
-	uint32_t		pc_flags;
-	uint32_t		pc_type;
-	char			*pc_chipname;
-	uint32_t		pc_irqs;	/* the possible IRQ levels */
-	uint32_t		pc_smi;		/* SMI IRQ */
-	uint32_t		pc_irq;		/* IO IRQ */
-	int			pc_io_type;
-	int			pc_intr_mode;	/* which interrupt method */
-	dev_info_t		*dip;
-	ddi_idevice_cookie_t	pc_dcookie;	/* Stay compatible w/ PCMCIA */
-	inthandler_t		*sirq[14];	/* List for each level */
-	uint16_t		si_actflg;	/* Bit for each active level */
-	inthandler_t		*irq_top;
-	inthandler_t		*irq_current;
-	ddi_intr_handle_t	*pc_pci_intr_hdlp; /* For PCI based adapters */
-	ddi_iblock_cookie_t	pc_pri;		/* Priority saved for mutexes */
-	ddi_intr_handle_t	*pc_intr_htblp;	/* ISA: interrupt handles */
-	ddi_softint_handle_t	pc_softint_hdl;	/* Softinterrupt handle */
-	kmutex_t		pc_lock;	/* general register lock */
-	kmutex_t		intr_lock;	/* protects fields modified */
-						/* in pcic_intr() */
-	int			pc_numsockets;
-				/* used to inform nexus of events */
-	int			(*pc_callback)();
-	int			pc_cb_arg;
-	int			(*pc_ss_bios)();
-	struct pcic_socket	pc_sockets[PCIC_MAX_SOCKETS];
-	int			pc_numpower;
-	struct power_entry	*pc_power;
-	timeout_id_t		pc_pmtimer;	/* timeout for simulating PM */
-	pcic_pm_t		pmt;		/* PM handler structure */
-	kcondvar_t		pm_cv;		/* CV for suspend/resume sync */
-	ddi_acc_handle_t	handle;		/* PCIC register handle */
-	ddi_acc_handle_t	cfg_handle;	/* PCIC config space handle */
-	uchar_t			*cfgaddr;	/* config address */
-	uchar_t			*ioaddr;	/* PCIC register IO base */
-	int			mem_reg_num;	/* memory space reg number */
-	offset_t		mem_reg_offset;
-	int			io_reg_num;	/* IO space reg number */
-	offset_t		io_reg_offset;
-	int			bus_speed;	/* parent bus speed */
-	uint32_t		pc_timestamp;   /* last time touched */
-	inthandler_t		*pc_handlers;
-	int			pc_lastreg;
-	uint32_t		pc_base;	/* first possible mem-addr */
-	uint32_t		pc_bound;	/* bound length */
-	uint32_t		pc_iobase;	/* first io addr */
-	uint32_t		pc_iobound;
-	pcic_debounce_state_t   deb_state[PCIC_MAX_SOCKETS];
-	int			pc_softintr_req[PCIC_MAX_SOCKETS];
-	struct pcic_cd_change_param {
-		struct pcicdev_t	*pcic;
-		pcic_socket_t		*sockp;
-		int			sn;
-	}  pcic_cd_change_param[PCIC_MAX_SOCKETS];
-} pcicdev_t;
-
-
-
-#define	PCF_ATTACHED	0x00000001
-#define	PCF_CALLBACK	0x00000002	/* callback handler registered */
-#define	PCF_GPI_EJECT	0x00000004	/* GPI signal is eject/insert */
-#define	PCF_INTRENAB	0x00000008
-#define	PCF_USE_SMI	0x00000010	/* use the SMI enable */
-#define	PCF_AUDIO	0x00000020	/* use audio if available */
-#define	PCF_SUSPENDED	0x00000040	/* driver attached but suspended */
-#define	PCF_EXTEND_INTR	0x00000080	/* Use Vadem interrupt sharing */
-#define	PCF_1SOCKET	0x00000100	/* Chip only has one socket  */
-#define	PCF_33VCAP	0x00000200	/* 3.3 Volt capable and coded */
-#define	PCF_CBPWRCTL	0x00000400	/* Use cardbus regs for power ctl */
-#define	PCF_DEBOUNCE	0x00002000	/* Chip has hardware debounce enabled */
-#define	PCF_VPPX	0x00004000	/* Vpp1 and Vpp2 tied together */
-#define	PCF_EXTBUFF	0x00008000	/* Chip strapped for external buffers */
-#define	PCF_PCIBUS	0x00010000	/* this instance on a PCI bus */
-#define	PCF_NOIO_OFF	0x00020000	/* 0 offset for IO mapping */
-#define	PCF_MULT_IRQ	0x00040000
-#define	PCF_IO_REMAP	0x00080000	/* adapter can remap I/O */
-#define	PCF_CARDBUS	0x00100000	/* Yenta CardBus */
-#define	PCF_MEM_PAGE	0x00200000	/* all windows same 16M page */
-
-/* newer features */
-#define	PCF_DMA		0x00400000	/* supports DMA */
-#define	PCF_ZV		0x00800000	/* supports Zoom Video */
-
-#define	PCF_ISA6729	0x01000000	/* 6729 */
-
-/*
- * misc flags
- */
-#define	PCIC_FOUND_ADAPTER	0x00000001
-#define	PCIC_ENABLE_IO		0x00000002
-#define	PCIC_ENABLE_MEM		0x00000004
-
-#define	PCIC_SOFTINT_PRI_VAL	0x04	/* value used while adding softint */
-
-/*
- * interrupt modes
- * the pcic variants provide a number of interrupt modes.
- * e.g. on PCI, we can either use PCI interrupts or ISA interrupts
- * but the SPARC version must use PCI interrupts and x86 "depends"
- */
-
-#define	PCIC_INTR_MODE_ISA	00 /* default- use ISA mode */
-#define	PCIC_INTR_MODE_PCI	01 /* use pure PCI */
-#define	PCIC_INTR_MODE_PCI_1	02 /* use pure PCI but share */
-#define	PCIC_INTR_MODE_PCI_S	03 /* serial PCI interrupts */
-
-#define	PCIC_INTR_DEF_PRI	11 /* default IPL level */
-
-/*
- * I/O access types
- */
-#define	PCIC_IO_TYPE_82365SL	0 /* uses index/data reg model */
-#define	PCIC_IO_TYPE_YENTA	1 /* uses the Yenta spec memory model */
-
-/*
- * On some PCI busses, the IO and memory resources available to us are
- *	available via the last two tuples in the reg property. The
- *	following defines are the reg numbers from the end of the reg
- *	property, and NOT the reg number itself.
- */
-#define	PCIC_PCI_MEM_REG_OFFSET	2
-#define	PCIC_PCI_IO_REG_OFFSET	3
-
-/* I/O type 82365SL is default, Yenta is alternative */
-#define	PCIC_IOTYPE_82365SL	0
-#define	PCIC_IOTYPE_YENTA	1 /* CardBus memory mode */
-
-/*
- * On Yenta cards, the PCI configuration space bridge control register
- * must match the interrupt * type we have selected.
- */
-
-#define	PCIC_CB_BRIDGE_CTL	0x3E
-#define	PCIC_BCTL_IREQ_ISA	0x80
-
-/*
- * On all PCI busses, we get at least two tuples in the reg property. One
- *	of the tuples is the config space tuple and the other is the PCIC
- *	IO control register space tuple.
- */
-
-#define	PCIC_PCI_CONFIG_REG_NUM	0
-#define	PCIC_PCI_CONFIG_REG_OFFSET	0
-#define	PCIC_PCI_CONFIG_REG_LENGTH	0x100
-
-#define	PCIC_PCI_CONTROL_REG_NUM	1
-#define	PCIC_PCI_CONTROL_REG_OFFSET	0
-#define	PCIC_PCI_CONTROL_REG_LENGTH	4
-#define	PCIC_CB_CONTROL_REG_LENGTH	4096 /* CardBus is 4K mem page */
-
-/*
- * On ISA/EISA/MCA our reg property must look like this:
- *
- *	IOreg,0x0,0x8, 0x0,0x0,0x100000, 0x1,0x0,0x1000
- *	^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^
- *	adapter regs    general memory	   general IO
- *
- * where IOreg specifies the adapter's control registers in
- *	IO space.
- * The value of PCIC_ISA_IO_REG_OFFSET must be the first
- *	component of the third (general IO) register spec.
- */
-#define	PCIC_ISA_IO_REG_OFFSET		1
-#define	PCIC_ISA_CONTROL_REG_NUM	0
-#define	PCIC_ISA_CONTROL_REG_OFFSET	0	/* XXX MUST be 0! */
-#define	PCIC_ISA_CONTROL_REG_LENGTH	2
-
-#define	PCIC_ISA_MEM_REG_NUM		1
-#define	PCIC_ISA_IO_REG_NUM		2
-
-/*
- * there are several variants of the 82365 chip from different "clone"
- * vendors.  Each has a few differences which may or may not have to be
- * handled.  The following defines are used to identify the chip being
- * used.  If it can't be determined, then 82365SL is assumed.
- *
- * The following are ISA/EISA/MCA-R2 adapters
- */
-#define	PCIC_I82365SL		0x00 /* Intel 82365SL */
-#define	PCIC_TYPE_I82365SL	"i82365SL"
-#define	PCIC_CL_PD6710		0x01 /* Cirrus Logic CL-PD6710/6720 */
-#define	PCIC_CL_PD6722		0x05 /* Cirrus Logic CL-PD6722 */
-#define	PCIC_TYPE_PD6710	"PD6710"
-#define	PCIC_TYPE_PD6720	"PD6720"
-#define	PCIC_TYPE_PD6722	"PD6722"
-#define	PCIC_VADEM		0x02 /* Vadem VG465/365 */
-#define	PCIC_VADEM_VG469	0x03 /* Vadem VG469 - P&P, etc. */
-#define	PCIC_VG_465		"VG465"
-#define	PCIC_VG_365		"VG365"
-#define	PCIC_VG_468		"VG468"
-#define	PCIC_VG_469		"VG469"
-#define	PCIC_RICOH		0x04
-#define	PCIC_TYPE_RF5C296	"RF5C296"
-#define	PCIC_TYPE_RF5C396	"RF5C396"
-
-/* PCI adapters are known by 32-bit value of vendor+device id */
-#define	PCI_ID(vend, dev)	((uint32_t)(((uint32_t)(vend) << 16) | (dev)))
-
-/*
- * The following are PCI-R2 adapters
- * The Cirrus Logic PCI adapters typically have their IRQ3 line
- *	routed to the PCI INT A# line.
- */
-#define	PCIC_CL_VENDORID	0x1013
-#define	PCIC_PD6729_DEVID	0x1100
-#define	PCIC_TYPE_PD6729	"PD6729"
-#define	PCIC_CL_PD6729		PCI_ID(PCIC_CL_VENDORID, PCIC_PD6729_DEVID)
-#define	PCIC_PD6729_INTA_ROUTE	0x03
-
-#define	PCIC_TYPE_PD6730	"PD6730"
-#define	PCIC_PD6730_DEVID	0x1101
-#define	PCIC_CL_PD6730		PCI_ID(PCIC_CL_VENDORID, PCIC_PD6730_DEVID)
-#define	PCIC_PD6730_INTA_ROUTE	0x09
-
-#define	PCIC_TYPE_PD6832	"PD6832"
-#define	PCIC_PD6832_DEVID	0x1110
-#define	PCIC_CL_PD6832		PCI_ID(PCIC_CL_VENDORID, PCIC_PD6832_DEVID)
-
-/* Intel i82092AA controller */
-
-#define	PCIC_INTEL_VENDORID	0x8086
-#define	PCIC_TYPE_i82092	"i82092"
-#define	PCIC_i82092_DEVID	0x1221
-#define	PCIC_INTEL_i82092	PCI_ID(PCIC_INTEL_VENDORID, \
-					PCIC_i82092_DEVID)
-#define	PCIC_i82092_INTA_ROUTE	0x0	/* XXX ? what is it really ? XXX */
-
-/* Texas Instruments */
-
-#define	PCIC_TI_VENDORID	0x104C
-#define	PCIC_PCI1050_DEVID	0xAC10
-#define	PCIC_PCI1130_DEVID	0xAC12
-#define	PCIC_PCI1031_DEVID	0xAC13 /* R2 only with Yenta IF */
-#define	PCIC_PCI1131_DEVID	0xAC15
-#define	PCIC_PCI1250_DEVID	0xAC16
-#define	PCIC_PCI1221_DEVID	0xAC19
-#define	PCIC_PCI1225_DEVID	0xAC1C
-#define	PCIC_PCI1220_DEVID	0xAC17
-#define	PCIC_PCI1260_DEVID	0xAC18
-#define	PCIC_PCI1210_DEVID	0xAC1A
-#define	PCIC_PCI1450_DEVID	0xAC1B
-#define	PCIC_PCI1251_DEVID	0xAC1D
-#define	PCIC_PCI1211_DEVID	0xAC1E
-#define	PCIC_PCI1251B_DEVID	0xAC1F
-#define	PCIC_PCI1260B_DEVID	0xAC30
-#define	PCIC_PCI4450_DEVID	0xAC40
-#define	PCIC_PCI4410_DEVID	0xAC41
-#define	PCIC_PCI4451_DEVID	0xAC42
-#define	PCIC_PCI4510_DEVID	0xAC44
-#define	PCIC_PCI1410_DEVID	0xAC50
-#define	PCIC_PCI1420_DEVID	0xAC51
-#define	PCIC_PCI1451_DEVID	0xAC52
-#define	PCIC_PCI1421_DEVID	0xAC53
-#define	PCIC_PCI1520_DEVID	0xAC55
-#define	PCIC_PCI1510_DEVID	0xAC56
-
-#define	PCIC_TI_PCI1130		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1130_DEVID)
-#define	PCIC_TYPE_PCI1130	"PCI1130"
-#define	PCIC_TI_PCI1031		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1031_DEVID)
-#define	PCIC_TYPE_PCI1031	"PCI1031"
-#define	PCIC_TI_PCI1131		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1131_DEVID)
-#define	PCIC_TYPE_PCI1131	"PCI1131"
-#define	PCIC_TI_PCI1250		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1250_DEVID)
-#define	PCIC_TYPE_PCI1250	"PCI1250"
-#define	PCIC_TI_PCI1050		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1050_DEVID)
-#define	PCIC_TYPE_PCI1050	"PCI1050"
-#define	PCIC_TI_PCI1221		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1221_DEVID)
-#define	PCIC_TYPE_PCI1221	"PCI1221"
-#define	PCIC_TI_PCI1225		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1225_DEVID)
-#define	PCIC_TYPE_PCI1225	"PCI1225"
-#define	PCIC_TI_PCI1220		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1220_DEVID)
-#define	PCIC_TYPE_PCI1220	"PCI1220"
-#define	PCIC_TI_PCI1260		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1260_DEVID)
-#define	PCIC_TYPE_PCI1260	"PCI1260"
-#define	PCIC_TI_PCI1210		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1210_DEVID)
-#define	PCIC_TYPE_PCI1210	"PCI1210"
-#define	PCIC_TI_PCI1450		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1450_DEVID)
-#define	PCIC_TYPE_PCI1450	"PCI1450"
-#define	PCIC_TI_PCI1251		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1251_DEVID)
-#define	PCIC_TYPE_PCI1251	"PCI1251"
-#define	PCIC_TI_PCI1211		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1211_DEVID)
-#define	PCIC_TYPE_PCI1211	"PCI1211"
-#define	PCIC_TI_PCI1251B	PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1251B_DEVID)
-#define	PCIC_TYPE_PCI1251B	"PCI1251B"
-#define	PCIC_TI_PCI1260B	PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1260B_DEVID)
-#define	PCIC_TYPE_PCI1260B	"PCI1260B"
-#define	PCIC_TI_PCI4450		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI4450_DEVID)
-#define	PCIC_TYPE_PCI4450	"PCI4450"
-#define	PCIC_TI_PCI4410		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI4410_DEVID)
-#define	PCIC_TYPE_PCI4410	"PCI4410"
-#define	PCIC_TI_PCI4451		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI4451_DEVID)
-#define	PCIC_TYPE_PCI4451	"PCI4451"
-#define	PCIC_TI_PCI4510		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI4510_DEVID)
-#define	PCIC_TYPE_PCI4510	"PCI4510"
-#define	PCIC_TI_PCI1410		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1410_DEVID)
-#define	PCIC_TYPE_PCI1410	"PCI1410"
-#define	PCIC_TI_PCI1420		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1420_DEVID)
-#define	PCIC_TYPE_PCI1420	"PCI1420"
-#define	PCIC_TI_PCI1451		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1451_DEVID)
-#define	PCIC_TYPE_PCI1451	"PCI1451"
-#define	PCIC_TI_PCI1421		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1421_DEVID)
-#define	PCIC_TYPE_PCI1421	"PCI1421"
-#define	PCIC_TI_PCI1510		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1510_DEVID)
-#define	PCIC_TYPE_PCI1510	"PCI1510"
-#define	PCIC_TI_PCI1520		PCI_ID(PCIC_TI_VENDORID, PCIC_PCI1520_DEVID)
-#define	PCIC_TYPE_PCI1520	"PCI1520"
-#define	PCIC_TI_VENDOR		PCI_ID(PCIC_TI_VENDORID, 0x0000)
-#define	PCIC_TYPE_TI		"PCIC_TI"
-
-/* O2 Micro */
-#define	PCIC_O2_VENDORID	0x1217
-#define	PCIC_OZ6912_DEVID	0x6972
-#define	PCIC_O2_OZ6912		PCI_ID(PCIC_O2_VENDORID, PCIC_OZ6912_DEVID)
-#define	PCIC_TYPE_OZ6912	"OZ6912"
-#define	PCIC_O2MICRO_VENDOR	PCI_ID(PCIC_O2_VENDORID, 0x0000)
-#define	PCIC_TYPE_O2MICRO	"O2Micro"
-
-/* ENE */
-#define	PCIC_ENE_VENDORID	0x1524
-#define	PCIC_ENE1410_DEVID	0x1410
-#define	PCIC_ENE_1410		PCI_ID(PCIC_ENE_VENDORID, PCIC_ENE1410_DEVID)
-#define	PCIC_TYPE_1410		"ENE1410"
-#define	PCIC_ENE1420_DEVID	0x1420
-#define	PCIC_ENE_1420		PCI_ID(PCIC_ENE_VENDORID, PCIC_ENE1420_DEVID)
-#define	PCIC_TYPE_1420		"ENE1420"
-
-/* SMC 34C90 */
-#define	PCIC_SMC_VENDORID	0x10B3
-#define	PCIC_SMC34C90_DEVID	0xB106
-#define	PCIC_SMC_34C90		PCI_ID(PCIC_SMC_VENDORID, PCIC_SMC34C90_DEVID)
-#define	PCIC_TYPE_34C90		"SMC34c90"
-
-/* Ricoh RL5CXXX */
-#define	PCIC_RICOH_VENDORID	0x1180
-#define	PCIC_RL5C466_DEVID	0x0466
-#define	PCIC_RL5C475_DEVID	0x0475
-#define	PCIC_RL5C476_DEVID	0x0476
-#define	PCIC_RL5C477_DEVID	0x0477
-#define	PCIC_RL5C478_DEVID	0x0478
-#define	PCIC_RICOH_RL5C466	PCI_ID(PCIC_RICOH_VENDORID, PCIC_RL5C466_DEVID)
-#define	PCIC_RICOH_RL5C475	PCI_ID(PCIC_RICOH_VENDORID, PCIC_RL5C475_DEVID)
-#define	PCIC_RICOH_RL5C476	PCI_ID(PCIC_RICOH_VENDORID, PCIC_RL5C476_DEVID)
-#define	PCIC_RICOH_RL5C477	PCI_ID(PCIC_RICOH_VENDORID, PCIC_RL5C477_DEVID)
-#define	PCIC_RICOH_RL5C478	PCI_ID(PCIC_RICOH_VENDORID, PCIC_RL5C478_DEVID)
-#define	PCIC_TYPE_RL5C466		"RL5C466"
-#define	PCIC_TYPE_RL5C475		"RL5C475"
-#define	PCIC_TYPE_RL5C476		"RL5C476"
-#define	PCIC_TYPE_RL5C477		"RL5C477"
-#define	PCIC_TYPE_RL5C478		"RL5C478"
-#define	PCIC_RICOH_VENDOR	PCI_ID(PCIC_RICOH_VENDORID, 0x0000)
-#define	PCIC_TYPE_RICOH		"Ricoh"
-
-/* Toshiba */
-#define	PCIC_TOSHIBA_VENDORID	0x1179
-#define	PCIC_TOPIC95_DEVID	0x0603
-#define	PCIC_TOSHIBA_TOPIC95	PCI_ID(PCIC_TOSHIBA_VENDORID, \
-					PCIC_TOPIC95_DEVID)
-#define	PCIC_TYPE_TOPIC95	"ToPIC95"
-#define	PCIC_TOPIC100_DEVID	0x0617
-#define	PCIC_TOSHIBA_TOPIC100	PCI_ID(PCIC_TOSHIBA_VENDORID, \
-					PCIC_TOPIC100_DEVID)
-#define	PCIC_TYPE_TOPIC100	"ToPIC100"
-#define	PCIC_TOSHIBA_VENDOR	PCI_ID(PCIC_TOSHIBA_VENDORID, 0x0000)
-#define	PCIC_TYPE_TOSHIBA	"Toshiba"
-
-/* Generic Yenta compliant chip */
-#define	PCIC_TYPE_YENTA		"Yenta"
-
-/* Yenta-compliant vcc register, bits */
-#define	PCIC_PRESENT_STATE_REG	0x8
-#define	PCIC_VCC_MASK		0xc00
-#define	PCIC_VCC_3VCARD		0x800
-#define	PCIC_VCC_5VCARD		0x400
-
-#define	PCIC_16BIT_CARD		0x010		/* 16 bit card */
-#define	PCIC_CB_CARD		0x020		/* cardbus card */
-#define	PCIC_CINT_IREQ		0x040		/* Interrupt present */
-#define	PCIC_NOT_A_CARD		0x080		/* Not a card */
-#define	PCIC_DATA_LOST		0x100		/* Data lost */
-#define	PCIC_BAD_VCC_REQ	0x200		/* Bad Vcc request */
-
-
-/* TI Multi Function Terminal selection (MFUNC0 selected as INTA) */
-#define	PCIC_TI_MFUNC_SEL	0x22
-
-#define	PCICPROP_CTL		"controller"
-
-#define	PCIC_REV_LEVEL_LOW	0x02
-#define	PCIC_REV_LEVEL_HI 	0x04
-#define	PCIC_REV_C		0x04
-#define	PCIC_REV_MASK		0x0f
-
-#define	PCIC_ID_NAME		"pcic"
-#define	PCIC_DEV_NAME		"pcic"
-
-#ifndef	DEVI_PCI_NEXNAME
-#define	DEVI_PCI_NEXNAME	"pci"
-#endif
-
-#ifndef DEVI_PCIEX_NEXNAME
-#define	DEVI_PCIEX_NEXNAME	"pciex"
-#endif
-
-/* PCI Class Code stuff */
-#define	PCIC_PCI_CLASS(cls, subclass)	(((cls) << 16) | ((subclass) << 8))
-#define	PCIC_PCI_PCMCIA	PCIC_PCI_CLASS(PCI_CLASS_BRIDGE, PCI_BRIDGE_PCMCIA)
-#define	PCIC_PCI_CARDBUS PCIC_PCI_CLASS(PCI_CLASS_BRIDGE, PCI_BRIDGE_CARDBUS)
-
-#define	PCIC_MEM_AM	0	/* Attribute Memory */
-#define	PCIC_MEM_CM	1	/* Common Memory */
-
-#define	PCS_SUBTYPE_UNKNOWN	0x00 /* haven't processed this yet */
-#define	PCS_SUBTYPE_MEMORY	0x01 /* normal memory access */
-#define	PCS_SUBTYPE_FAT		0x02 /* DOS floppy (FAT) file system */
-
-/*
- * For speed calculation, assume a SYSCLK rate of 8.33MHz
- *	unless our parent tells us otherwise. 8.33MHz is a
- *	reasonable default for an ISA bus.
- */
-#define	PCIC_ISA_DEF_SYSCLK	8	/* MHZ */
-#define	PCIC_PCI_DEF_SYSCLK	33	/* MHZ */
-#define	PCIC_PCI_25MHZ		25
-#define	mhztons(c)		(1000000 / (uint32_t)((c) * 1000))
-#define	PCIC_SYSCLK_25MHZ	25 * 1000 * 1000
-#define	PCIC_SYSCLK_33MHZ	33 * 1000 * 1000
-
-/* simplify the callback so it looks like straight function call */
-#define	PC_CALLBACK	(*pcic->pc_callback)
-
-/* hardware event capabilities -- needs sservice.h */
-#define	PCIC_DEFAULT_INT_CAPS	(SBM_BVD1|SBM_BVD2|SBM_RDYBSY|SBM_CD)
-#define	PCIC_DEFAULT_RPT_CAPS	(PCIC_DEFAULT_INT_CAPS|SBM_WP)
-/* note that we don't support indicators via the PCIC */
-#define	PCIC_DEFAULT_CTL_CAPS	(0)
-
-/* format of pcic "ranges" property */
-typedef struct pcic_ranges {
-	uint32_t pcic_range_caddrhi;
-	uint32_t pcic_range_caddrlo;
-	uint32_t pcic_range_paddrhi;
-	uint32_t pcic_range_paddrmid;
-	uint32_t pcic_range_paddrlo;
-	uint32_t pcic_range_size;
-} pcic_ranges_t;
-
-/* debug stuff */
-#if defined(DEBUG)
-#define	PCIC_DEBUG
-#endif
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _PCIC_VAR_H */
--- old/usr/src/uts/common/sys/pcmcia.h	2014-11-12 17:44:41.836884245 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,500 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * PCMCIA nexus
- */
-
-#ifndef _PCMCIA_H
-#define	_PCMCIA_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#if defined(DEBUG)
-#define	PCMCIA_DEBUG
-#endif
-
-#include <sys/modctl.h>
-
-#define	PCMCIA_MAX_ADAPTERS	8 /* maximum distinct adapters */
-#define	PCMCIA_MAX_SOCKETS	64 /* maximum distinct sockets */
-#define	PCMCIA_MAX_WIN_ADAPT	40
-#define	PCMCIA_MAX_WINDOWS	(PCMCIA_MAX_ADAPTERS*PCMCIA_MAX_WIN_ADAPT)
-#define	PCMCIA_MAX_POWER	16 /* maximum power table entries */
-
-#define	_VERSION(major, minor)	((major)<<16|(minor))
-
-/*
- * DDI/Nexus stuff
- */
-
-#define	PCMCIA_NEXUS_NAME	"pcmcia"
-#define	PCMCIA_ADAPTER_NODE	"ddi_pcmcia:adapter"
-#define	PCMCIA_SOCKET_NODE	"ddi_pcmcia:socket"
-#define	PCMCIA_PCCARD_NODE	"ddi_pcmcia:pccard"
-
-/*
- * private interface between nexus and adapter specific driver
- * This is only an "ops" type structure
- */
-
-typedef struct pcmcia_if {
-	uint32_t  pcif_magic;	/* magic number to verify correct scructure */
-	uint32_t  pcif_version;
-	int	(*pcif_set_callback)();
-	int	(*pcif_get_adapter)();
-	int	(*pcif_get_page)();
-	int	(*pcif_get_socket)();
-	int	(*pcif_get_status)();
-	int	(*pcif_get_window)();
-	int	(*pcif_inquire_adapter)();
-	int	(*pcif_inquire_socket)();
-	int	(*pcif_inquire_window)();
-	int	(*pcif_reset_socket)();
-	int	(*pcif_set_page)();
-	int	(*pcif_set_window)();
-	int	(*pcif_set_socket)();
-	int	(*pcif_set_interrupt)();
-	int	(*pcif_clr_interrupt)();
-	int	(*pcic_init_dev)();
-	uint32_t  (*pcic_get_tstamp)();
-} pcmcia_if_t;
-
-/*
- * magic number and version information to identify
- * variant of the PCMCIA nexus.
- */
-#define	PCIF_MAGIC 0x50434946
-#define	PCIF_VERSION	_VERSION(0, 1)
-#define	PCIF_MIN_VERSION _VERSION(0, 1)
-#define	DEFAULT_CS_NAME	"cs"
-
-/*
- * all adapter drivers use a commonly defined structure for
- * their private data.  This structure must be filled in
- * and set.  The an_private member is for the driver writer's
- * use and is not looked at by the nexus.
- */
-struct pcmcia_adapter_nexus_private {
-	dev_info_t	*an_dip;
-	pcmcia_if_t	*an_if;
-	void		*an_private;
-	ddi_iblock_cookie_t *an_iblock;	/* high priority handler cookies */
-	ddi_idevice_cookie_t *an_idev;
-	uint32_t	an_ipl;
-};
-
-typedef struct pcmcia_adapter_nexus_private anp_t;
-
-struct pcm_regs {
-	uint32_t phys_hi;
-	uint32_t phys_lo;
-	uint32_t phys_len;
-};
-
-/*
- * shared interrupts are handled by the
- * nexus going through the list
- */
-typedef struct inthandler {
-	struct inthandler	*next;
-	struct inthandler	*prev;
-	int			flags;
-	uint32_t		(*intr)(caddr_t, caddr_t);
-	unsigned		handler_id;
-	void			*arg1;
-	void			*arg2;
-	unsigned		socket;
-	unsigned		irq;
-	unsigned		priority;
-	ddi_softintr_t		softid;
-	ddi_iblock_cookie_t	iblk_cookie;
-	ddi_idevice_cookie_t	idev_cookie;
-} inthandler_t;
-
-/*
- * parent private data area
- *	not using the old style but will adapt on request
- *	this allows better framework handling and 1275 compliance
- */
-
-struct pcmcia_parent_private {
-	int	ppd_nreg;	/* number of regs */
-	struct	pcm_regs *ppd_reg; /* array of regs in parsed form */
-	int	ppd_intr;	/* number intrspecs (always 0 or 1) */
-	struct	intrspec *ppd_intrspec;
-	void	*pcm_dummy[3];	/* fill for prtconf -v */
-	struct	pcm_regs *ppd_assigned; /* array of regs in parsed form */
-	short	ppd_socket;	/* socket number of this instance */
-	short	ppd_function;	/* function number */
-	int	ppd_active;	/* is PC Card in a socket and active */
-	uint32_t  ppd_flags;
-	void	*ppd_handle; /* client handle */
-};
-
-#define	PPD_CARD_MULTI		0x0001 /* card is multifunction card */
-#define	PPD_CARD_CARDBUS	0x0002 /* card is CardBus type */
-#define	PPD_CB_BUSMASTER	0x0004 /* card bus card is busmaster */
-#define	PPD_SUSPENDED		0x0008 /* this device was pm suspended */
-
-/*
- * macros to make indirect functions easier
- * and shorter (makes cstyle happier)
- */
-
-#define	GET_SOCKET_STATUS(f, dip, sock, stat)\
-			(*(f)->pcif_get_socket_status)(dip, sock, stat)
-#define	SET_CALLBACK(f, dip, callback, sock)\
-			(*(f)->pcif_set_callback)(dip, callback, sock)
-
-#define	GET_ADAPTER(f, dip, conf) (*(f)->pcif_get_adapter) (dip, conf)
-#define	GET_SOCKET(f, dip, sock) (*(f)->pcif_get_socket)(dip, sock)
-#define	GET_STATUS(f, dip, status) (*(f)->pcif_get_status)(dip, status)
-#define	GET_WINDOW(f, dip, window) (*(f)->pcif_get_window)(dip, window)
-#define	INQUIRE_ADAPTER(f, dip, inquire) (*(f)->pcif_inquire_adapter)(dip,\
-						inquire)
-#define	GET_CONFIG(f, dip, conf) INQUIRE_ADAPTER(f, dip, conf)
-#define	INQUIRE_SOCKET(f, dip, sock) (*(f)->pcif_inquire_socket)(dip, \
-						sock)
-#define	GET_PAGE(f, dip, page) (*(f)->pcif_get_page)(dip, page)
-#define	INQUIRE_WINDOW(f, dip, window) (*(f)->pcif_inquire_window)(dip, window)
-#define	RESET_SOCKET(f, dip, socket, mode) \
-			(*(f)->pcif_reset_socket)(dip, socket, mode)
-#define	SET_PAGE(f, dip, page) (*(f)->pcif_set_page)(dip, page)
-#define	SET_WINDOW(f, dip, window) (*(f)->pcif_set_window)(dip, window)
-#define	SET_SOCKET(f, dip, socket) (*(f)->pcif_set_socket)(dip, socket)
-#define	SET_IRQ(f, dip, handler) (*(f)->pcif_set_interrupt)(dip, handler)
-#define	CLEAR_IRQ(f, dip, handler) (*(f)->pcif_clr_interrupt)(dip, handler)
-
-typedef struct pcmcia_cs {
-	uint32_t   pccs_magic;	/* magic number of verify correct structure */
-	uint32_t   pccs_version;
-	int   (*pccs_callback)();
-	int   (*pccs_getconfig)();
-} pcmcia_cs_t;
-
-#define	PCCS_MAGIC	0x50434353
-#define	PCCS_VERSION	_VERSION(2, 1)
-
-/* properties used by the nexus for setup */
-#define	ADAPT_PROP	"adapters"	/* property used to find adapter list */
-#define	CS_PROP		"card-services"	/* property specifying Card Services */
-#define	DEF_DRV_PROP	"default-driver" /* default driver to load if no CIS */
-
-/*
- * per adapter structure
- * this structure defines everything necessary for the
- * the nexus to interact with the adapter specific driver
- */
-
-struct pcmcia_adapter {
-	int		pca_module;	/* adapter major number */
-	int		pca_unit;	/* adapter minor number */
-	int		pca_number;	/* canonical adapter number */
-	struct dev_ops	*pca_ops;
-	dev_info_t	*pca_dip;
-	pcmcia_if_t	*pca_if;
-	void		*pca_power;
-	ddi_iblock_cookie_t *pca_iblock;
-	ddi_idevice_cookie_t *pca_idev;
-	kmutex_t	*pca_mutex;
-	int		pca_numpower;
-	int		pca_numsockets;
-	int		pca_first_socket;
-	uint32_t	pca_flags;
-	char		pca_name[MODMAXNAMELEN];
-	uint32_t	pca_avail_intr;
-	inthandler_t	pca_int_handlers;
-};
-
-#define	PCA_RES_NEED_IRQ	0x0001 /* needs IRQ allocation */
-#define	PCA_RES_NEED_IO		0x0002 /* needs I/O allocation */
-#define	PCA_RES_NEED_MEM	0x0004 /* needs memory allocation */
-#define	PCA_RES_CONSTRAINT	0x0008 /* resource constraints defined */
-#define	PCA_IRQ_SMI_SHARE	0x0010 /* SMI and child share */
-#define	PCA_IRQ_SHAREABLE	0x0020 /* all interrupts sharable */
-#define	PCA_IRQ_ISA		0x0040 /* ISA style (host) interrupts */
-
-/* These flags are for open/close -- hot-plug support in future */
-#define	PCMCIA_MAX_FUNCTIONS	8
-#define	PCS_CARD_PRESENT	0x0001 /* card in socket */
-#define	PCS_MULTI_FUNCTION	0x0002 /* indicates dip is multifunction */
-#define	PCS_SOCKET_ADDED	0x0004 /* CS knows about the socket */
-#define	PCS_COOKIES_VALID	0x0008 /* iblk and idev valid */
-#define	PCS_IRQ_ENABLED		0x0010 /* IRQ has been enabled */
-#define	PCS_SUSPENDED		0x0020 /* PM SUSPEND was done */
-
-typedef struct pcmcia_logical_window {
-	int			lw_window; /* window number */
-	int			lw_socket; /* logical socket number assigned */
-	struct pcmcia_adapter	*lw_adapter;
-	pcmcia_if_t		*lw_if;
-	uint32_t		lw_status;
-	baseaddr_t		lw_base;
-	int			lw_len;
-} pcmcia_logical_window_t;
-
-#define	PCS_ENABLED		0x0002 /* window is enabled */
-
-/*
- * management interface hook
- */
-#define	EM_EVENTSIZE	4
-struct pcmcia_mif {
-	struct pcmcia_mif *mif_next;
-	void		(*mif_function)();
-	uint32_t	  mif_id;
-	uchar_t		  mif_events[EM_EVENTSIZE]; /* events registered for */
-};
-
-#define	PR_WORDSIZE	8	/* bits in word */
-#define	PR_MASK		0x7
-#define	PR_GET(map, bit)	(((uchar_t *)(map))[(bit)/PR_WORDSIZE] &\
-					(1 << ((bit) & PR_MASK)))
-#define	PR_SET(map, bit)	(((uchar_t *)(map))[(bit)/PR_WORDSIZE] |=\
-					(1 << ((bit) & PR_MASK)))
-#define	PR_CLEAR(map, bit)	(((uchar_t *)(map))[(bit)/PR_WORDSIZE] &=\
-					~(1 << ((bit) & PR_MASK)))
-#define	PR_ADDR(map, bit)	(((uchar_t *)(map)) + ((bit)/PR_WORDSIZE))
-#define	PR_ZERO(map)		bzero((caddr_t)map, sizeof (map))
-
-/* socket bit map */
-typedef uchar_t socket_enum_t[PCMCIA_MAX_SOCKETS/PR_WORDSIZE];
-
-/*
- * Max resoruce limits - all of these have to be power-of-2 aligned
- *	and the PR_MAX_IO_LEN and PR_MAX_MEM_LEN values must be at
- *	least 64 or the allocators will panic.
- */
-#define	PR_MAX_IO_LEN		1024	/* bytes of IO space */
-#define	PR_MAX_IO_RANGES	4
-#define	PR_MAX_MEM_LEN		1024 /* pages or 4M bytes */
-#define	PR_MAX_MEM_RANGES	32
-
-#define	PR_MAX_IOADDR		0xffffffff
-#define	PR_MAX_MEMADDR		0xffffffff
-#define	PR_MAX_INTERRUPTS	0xff
-
-
-/*
- * structures and definitions used in the private interface
- */
-
-/* general values */
-#define	PC_SUCCESS	1
-#define	PC_FAILURE	0
-
-/* set_mem() */
-#define	PC_MEM_AM	0
-#define	PC_MEM_CM	1
-
-/* device classes */
-#define	PCC_MULTI	0
-#define	PCC_MEMORY	1
-#define	PCC_SERIAL	2
-#define	PCC_PARALLEL	3
-#define	PCC_FIXED_DISK	4
-#define	PCC_VIDEO	5
-#define	PCC_LAN		6
-
-/*
- * device information structure information
- * this is what is used for initial construction of a device node
- */
-
-struct pcm_device_info {
-	int		pd_socket;
-	int		pd_function;
-	int		pd_type;
-	uint32_t	pd_handle;
-	uint32_t	pd_tuples;
-	uint32_t	pd_flags;
-	char		pd_bind_name[MODMAXNAMELEN];
-	char		pd_vers1_name[MODMAXNAMELEN*4];
-	char		pd_generic_name[MODMAXNAMELEN];
-};
-
-#define	PCM_GET_SOCKET(socknum)		((socknum) & 0x1F)
-#define	PCM_GET_FUNCTION(socknum)	(((socknum) >> 5) & 0x7)
-
-#define	PCM_DEFAULT_NODEID		(-1)
-#define	PCM_DEV_MODEL	"model"
-#define	PCM_DEV_ACTIVE	"card-active"
-#define	PCM_DEV_SOCKET	"socket"
-#define	PCM_DEV_R2TYPE	"16bitcard"
-#define	PCM_DEV_CARDBUS	"cardbus"
-
-typedef
-struct init_dev {
-	int	socket;
-} init_dev_t;
-
-/*
- * device descriptions
- * used to determine what driver to associate with a PC Card
- * so that automatic creation of device information trees can
- * be supported.
- */
-
-typedef
-struct pcm_device_node {
-	struct pcm_device_node *pd_next;
-	dev_info_t *pd_dip;	/* proto device info */
-	char	pd_name[16];
-	int	pd_flags;
-	int	pd_devtype;	/* from device tuple */
-	int	pd_funcid;
-	int	pd_manfid;
-	int	pd_manmask;
-} pcm_dev_node_t;
-
-#define	PCMD_DEVTYPE	0x0001	/* match device type */
-#define	PCMD_FUNCID	0x0002	/* match function ID */
-#define	PCMD_MANFID	0x0004	/* match manufacturer ID */
-#define	PCMD_FUNCE	0x0008	/* match function extension */
-#define	PCMD_VERS1	0x0010	/* match VERSION_1 string(s) */
-#define	PCMD_JEDEC	0x0020	/* JEDEC ID */
-
-#define	PCM_NAME_1275		0x0001
-#define	PCM_NAME_VERS1		0x0002
-#define	PCM_NAME_GENERIC	0x0004
-#define	PCM_NO_CONFIG		0x0008
-#define	PCM_OTHER_NOCIS		0x0100
-#define	PCM_MULTI_FUNCTION	0x0200
-
-#define	PCM_MAX_R2_MEM		0x3ffffff
-
-#define	PCMDEV_PREFIX	"PC,"
-#define	PCMDEV_NAMEPREF "pccard"
-
-/* property names */
-#define	PCM_PROP_DEVICE	"device"
-#define	PCM_PROP_FUNCID "funcid"
-
-/* 1275 specific properties */
-#define	PCM_1275_NUMWIN		"#windows"
-#define	PCM_1275_NUMSOCK	"#sockets"
-#define	PCM_1275_SCIC		"status-change-int_caps"
-
-/* basic device types */
-
-#define	PCM_TYPE_MULTI		0
-#define	PCM_TYPE_MEMORY		1
-#define	PCM_TYPE_SERIAL		2
-#define	PCM_TYPE_PARALLEL	3
-#define	PCM_TYPE_FIXED		4
-#define	PCM_TYPE_VIDEO		5
-#define	PCM_TYPE_LAN		6
-
-
-typedef
-struct string_to_int {
-	char *sti_str;
-	uint32_t sti_int;
-} str_int_t;
-
-/*
- * PCMCIA nexus/adapter specific ioctl commands
- */
-
-#define	PCIOC	('P' << 8)
-/* SS is temporary until design done */
-#define	PC_SS_CMD(cmd)		(PCIOC|(cmd))
-
-/* stuff that used to be in obpdefs.h but no longer */
-#define	PCM_DEVICETYPE	"device_type"
-
-/*
- * new regspec and other 1275 stuff
- */
-#define	PC_REG_RELOC(x)		((((uint32_t)x) & 0x1) << 31)
-#define	PC_REG_PREFETCH(x)	(((x) & 0x1) << 30)
-#define	PC_REG_TYPE(x)		(((x) & 0x1) << 29)
-#define	PC_REG_SPACE(x)		(((x) & 0x7) << 24)
-#define	PC_REG_SOCKET(x)	(((x) & 0x1f) << 11)
-#define	PC_REG_FUNCTION(x)	(((x) & 0x7) << 8)
-#define	PC_REG_BASEREG(x)	((x) & 0xff)
-/* solaris internal only */
-#define	PC_REG_REFCNT(x)	(((x) & 0xFF) << 16)
-
-#define	PC_GET_REG_RELOC(x)	(((x) >> 31) & 1)
-#define	PC_GET_REG_PREFETCH(x)	(((x) >> 30) & 1)
-#define	PC_GET_REG_TYPE(x)	(((x) >> 29) & 1)
-#define	PC_GET_REG_SPACE(x)	(((x) >> 24) & 7)
-#define	PC_GET_REG_SOCKET(x)	(((x) >> 11) & 0x1f)
-#define	PC_GET_REG_FUNCTION(x)	(((x) >> 8) & 0x7)
-#define	PC_GET_REG_BASEREG(x)	((x) & 0xff)
-/* solaris internal only */
-#define	PC_GET_REG_REFCNT(x)	(((x) >> 16) & 0xFF)
-#define	PC_INCR_REFCNT(x)	(((x) & 0xFF00FFFF) | \
-				    PC_REG_REFCNT(PC_GET_REG_REFCNT(x) + 1))
-#define	PC_DECR_REFCNT(x)	(((x) & 0xFF00FFFF) | \
-				    PC_REG_REFCNT(PC_GET_REG_REFCNT(x) - 1))
-
-#define	PC_REG_PHYS_HI(n, p, t, c, s, f, r) (uint32_t)( \
-			PC_REG_RELOC(n) | \
-			PC_REG_PREFETCH(p) | \
-			PC_REG_TYPE(t) | \
-			PC_REG_SPACE(c) | \
-			PC_REG_SOCKET(s) | \
-			PC_REG_FUNCTION(f) | \
-			PC_REG_BASEREG(r))
-
-#define	PC_REG_TYPE_CARDBUS	0
-#define	PC_REG_TYPE_16BIT	1
-
-#define	PC_REG_SPACE_CONFIG	0x0
-#define	PC_REG_SPACE_IO		0x1
-#define	PC_REG_SPACE_MEMORY	0x2
-#define	PC_REG_SPACE_ATTRIBUTE	0x4
-
-/*
- * internal properties and other prop_op defines
- */
-
-#define	PCMCIA_PROP_UNKNOWN	0x10000	/* pass to DDI decode */
-#define	PCMCIA_PROP_CIS		0x20000	/* need to get the tuple */
-
-	/* specific known properties */
-#define	PCMCIA_PROP_SOCKET	0 /* "socket" */
-#define	PCMCIA_PROP_COMPAT	1 /* "compatible" */
-#define	PCMCIA_PROP_DEFAULT_PM	2 /* power managment timestamp */
-#define	PCMCIA_PROP_ACTIVE	3 /* card-active property */
-#define	PCMCIA_PROP_R2TYPE	4 /* 16 bit card */
-#define	PCMCIA_PROP_CARDBUS	5 /* card is cardbus */
-#define	PCMCIA_PROP_OLDCS	6 /* old card services property */
-#define	PCMCIA_PROP_REG		7 /* standard reg= property */
-#define	PCMCIA_PROP_INTR	8 /* interrupts property */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _PCMCIA_H */
--- old/usr/src/uts/common/sys/sservice.h	2014-11-12 17:44:41.889635497 +0100
+++ /dev/null	2014-11-12 17:44:41.000000000 +0100
@@ -1,590 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_SSERVICE_H
-#define	_SSERVICE_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-typedef int(f_tt)(int, ...);	/* for lint - cc -v quieting */
-
-/*
- * identifiers for all SS functions implemented
- */
-#define	SS_GetAdapter		0
-#define	SS_GetPage		1
-#define	SS_GetSocket		2
-#define	SS_GetStatus		3
-#define	SS_GetWindow		4
-#define	SS_InquireAdapter	5
-#define	SS_InquireSocket	6
-#define	SS_InquireWindow	7
-#define	SS_ResetSocket		8
-#define	SS_SetPage		9
-#define	SS_SetAdapter		10
-#define	SS_SetSocket		11
-#define	SS_SetWindow		12
-#define	SS_SetIRQHandler	13
-#define	SS_ClearIRQHandler	14
-#define	CSGetActiveDip		98
-#define	CSInitDev		99
-#define	CSRegister		100
-#define	CSCISInit		101
-#define	CSUnregister		102
-
-/*
- * XXX
- */
-#define	CISGetAddress		103
-#define	CISSetAddress		104
-#define	CSCardRemoved		105
-#define	CSGetCookiesAndDip	106
-
-/*
- * returns a la Socket Services
- */
-
-#define	SUCCESS		0x00
-#define	BAD_ADAPTER		0x01
-#define	BAD_ATTRIBUTE	0x02
-#define	BAD_BASE		0x03
-#define	BAD_EDC		0x04
-#define	BAD_IRQ		0x06
-#define	BAD_OFFSET		0x07
-#define	BAD_PAGE		0x08
-#define	READ_FAILURE		0x09
-#define	BAD_SIZE		0x0a
-#define	BAD_SOCKET		0x0b
-#define	BAD_TYPE		0x0d
-#define	BAD_VCC		0x0e
-#define	BAD_VPP		0x0f
-#define	BAD_WINDOW		0x11
-#define	WRITE_FAILURE	0x12
-#define	NO_CARD		0x14
-#define	BAD_FUNCTION		0x15
-#define	BAD_MODE		0x16
-#define	BAD_SPEED		0x17
-#define	BUSY			0x18
-#define	NO_RESOURCE		0x20
-
-/* events for callback */
-				/* card related events */
-#define	PCE_CARD_REMOVAL	0 /* card removed */
-#define	PCE_CARD_INSERT		1 /* card inserted */
-#define	PCE_CARD_READY		2 /* ready state changed */
-#define	PCE_CARD_BATTERY_WARN	3 /* battery is getting low */
-#define	PCE_CARD_BATTERY_DEAD	4 /* battery is dead */
-#define	PCE_CARD_STATUS_CHANGE	5 /* card status change for I/O card */
-#define	PCE_CARD_WRITE_PROTECT	6 /* card write protect status change */
-#define	PCE_CARD_RESET		7 /* client requested reset complete */
-#define	PCE_CARD_UNLOCK		8 /* lock has been unlocked (opt) */
-#define	PCE_CLIENT_INFO		9 /* someone wants client information */
-#define	PCE_EJECTION_COMPLETE	10 /* Motor has finished ejecting card */
-#define	PCE_EJECTION_REQUEST	11 /* request to eject card */
-#define	PCE_ERASE_COMPLETE	12 /* a Flash Erase request completed */
-#define	PCE_EXCLUSIVE_COMPLETE	13
-#define	PCE_EXCLUSIVE_REQUEST	14
-#define	PCE_INSERTION_COMPLETE	15
-#define	PCE_INSERTION_REQUEST	16
-#define	PCE_REGISTRATION_COMPLETE	17
-#define	PCE_RESET_COMPLETE	18
-#define	PCE_RESET_PHYSICAL	19
-#define	PCE_RESET_REQUEST	20
-#define	PCE_TIMER_EXPIRED	21
-
-/* added for SPARC CPR support */
-#define	PCE_PM_RESUME		22
-#define	PCE_PM_SUSPEND		23
-
-/* added for dynamic nexus registration */
-#define	PCE_SS_INIT_STATE	24 /* SS init state */
-#define	PCE_ADD_SOCKET		25 /* add a new socket */
-#define	PCE_DROP_SOCKET		26 /* drop an existing socket */
-
-#define	PCE_DEV_IDENT		30 /* The nexus has identified the device */
-#define	PCE_INIT_DEV		31 /* asking for a device */
-
-#define	PCE_E2M(event)		(1 << (event))
-
-/* event callback uses an indirect call -- make it look like a function */
-#define	CS_EVENT(event, socket, arg)	(*pcmcia_cs_event) (event, socket, arg)
-
-/* values for "socket number" field for PCE_SS_INIT_STATE event */
-#define	PCE_SS_STATE_INIT	0x0001  /* SS ready for callbacks */
-#define	PCE_SS_STATE_DEINIT	0x0002  /* SS not ready for callbacks */
-
-/*
- * The following structure is to support CSRegister
- */
-typedef struct csregister {
-	uint32_t	cs_magic;		/* magic number */
-	uint32_t		cs_version;		/* CS version number */
-						/* CS entry point */
-	int		(*cs_card_services)(int, ...);
-						/* CS event entry point */
-	f_tt		*cs_event;
-} csregister_t;
-
-/* GetAdapter(get_adapter_t) */
-
-typedef struct get_adapter {
-	unsigned	state;		/* adapter hardware state */
-	irq_t		SCRouting;	/* status change IRQ routing */
-} get_adapter_t;
-
-/* IRQ definitions */
-#define	IRQ_ENABLE	0x8000
-
-/* GetPage(get_page_t) */
-
-typedef struct get_page {
-	unsigned	window;		/* window number */
-	unsigned	page;		/* page number within window */
-	unsigned	state;		/* page state: */
-					/*
-					 * PS_ATTRIBUTE
-					 * PS_COMMON
-					 * PS_IO (for DoRight?)
-					 * PS_ENABLED
-					 * PS_WP
-					 */
-	off_t		offset;		/* PC card's memory offset */
-} get_page_t;
-
-/*
- * PS flags
- */
-
-#define	PS_ATTRIBUTE	0x01
-#define	PS_ENABLED	0x02
-#define	PS_WP		0x04
-#define	PS_IO		0x08	/* needed? for DoRight */
-
-/* GetSocket(get_socket_t) */
-
-typedef struct get_socket {
-	unsigned	socket;		/* socket number */
-	unsigned	SCIntMask;	/* status change interrupt mask */
-	unsigned	VccLevel;	/* VCC voltage in 1/10 volt */
-	unsigned	Vpp1Level;	/* VPP1 voltage in 1/10 volt */
-	unsigned	Vpp2Level;	/* VPP2 voltage in 1/10 volt */
-	unsigned	state;		/* latched status change signals */
-	unsigned	CtlInd;		/* controls and indicators */
-	irq_t		IRQRouting;	/* I/O IRQ routing */
-	unsigned	IFType;		/* memory-only or memory & I/O */
-} get_socket_t;
-
-/* GetStatus(get_ss_status_t) */
-
-typedef struct get_ss_status {
-	unsigned	socket;		/* socket number */
-	unsigned	CardState;	/* real-time card state */
-	unsigned	SocketState;	/* latched status change signals */
-	unsigned	CtlInd;		/* controls and indicators */
-	irq_t		IRQRouting;	/* I/O IRQ routing */
-	unsigned	IFType;		/* memory-only or memory & I/O */
-} get_ss_status_t;
-
-/*
- * Socket specific flags and capabilities
- */
-
-#define	SBM_WP		0x01
-#define	SBM_LOCKED	0x02
-#define	SBM_EJECT	0x04
-#define	SBM_INSERT	0x08
-#define	SBM_BVD1	0x10
-#define	SBM_BVD2	0x20
-#define	SBM_RDYBSY	0x40
-#define	SBM_CD		0x80
-
-				/* capabilities only */
-#define	SBM_LOCK	0x10
-#define	SBM_BATT	0x20
-#define	SBM_BUSY	0x40
-#define	SBM_XID		0x80
-
-/* GetWindow(get_window_t) */
-typedef uint32_t speed_t;	/* memory speed in nanoseconds */
-
-typedef struct get_window {
-	unsigned		window;	/* window number */
-	unsigned		socket;	/* socket this window is assigned to */
-	unsigned		size;	/* size in bytes */
-	unsigned		state;	/* current state of window hardware */
-	uint_t			speed;	/* speed in nanoseconds */
-	uint_t			base;
-	ddi_acc_handle_t	handle;		/* base addr in host space */
-} get_window_t;
-
-/*
- * window flags (state and capabilities)
- */
-#define	WS_IO		0x01
-#define	WS_ENABLED	0x02
-#define	WS_16BIT	0x04
-#define	WS_PAGED	0x80
-#define	WS_EISA		0x10
-#define	WS_CENABLE	0x20
-#define	WS_EXACT_MAPIN	0x40	/* map exactly what's asked for */
-
-/* Inquire Adapter(inquire_adapter_t) */
-
-typedef struct inquire_adapter {
-	unsigned	NumSockets;	/* number of sockets */
-	unsigned	NumWindows;	/* number of windows */
-	unsigned	NumEDCs;	/* number of EDCs */
-
-	unsigned	AdpCaps;	/* adapter power capabilities */
-	irq_t		ActiveHigh;	/* active high status change IRQ */
-	irq_t		ActiveLow;	/* active low status change IRQ */
-	int		NumPower;	/* number of power entries */
-	struct power_entry {
-		unsigned	PowerLevel;	/* voltage in 1/10 volt */
-		unsigned	ValidSignals;	/* voltage is valid for: */
-						/*
-						 * VCC
-						 * VPP1
-						 * VPP2
-						 * if none are set, this is end
-						 * of list
-						 */
-	} *power_entry;
-	int		NumInterrupts; /* number of interrupts supportable */
-	struct intr_entry {
-		int	pri;
-		int	intr;
-	}		*AvailInterrupts; /* array of intrs, one per intr */
-	uint_t		ResourceFlags; /* resource allocation requirements */
-} inquire_adapter_t;
-
-#define	VCC	0x80
-#define	VPP1	0x40
-#define	VPP2	0x20
-#define	V_MASK	(VCC|VPP1|VPP2)
-
-#define	RES_OWN_IRQ	0x0001	/* adapter owns own IRQ resources */
-#define	RES_OWN_IO	0x0002	/* adapter owns own I/O resources */
-#define	RES_OWN_MEM	0x0004	/* adapter owns own memory resources */
-#define	RES_IRQ_NEXUS	0x0008	/* adapter/nexus must multiplex IRQs */
-#define	RES_IRQ_SHAREABLE	0x0010 /* IRQ can be shared */
-
-/* InquireSocket(inquire_socket_t) */
-
-typedef struct inquire_socket {
-	unsigned	socket;		/* socket number */
-	unsigned	SCIntCaps;	/* status change interrupt events */
-	unsigned	SCRptCaps;	/* reportable status change events */
-	unsigned	CtlIndCaps;	/* controls and indicators */
-	unsigned	SocketCaps;	/* socket capabilities */
-	irq_t		ActiveHigh;	/* active high status change IRQ */
-	irq_t		ActiveLow;	/* active low status change IRQ */
-} inquire_socket_t;
-
-/* InquireWindow(inquire_window_t) */
-
-typedef struct memwin_char {
-	unsigned	MemWndCaps;	/* memory window characteristcs */
-	baseaddr_t	FirstByte;	/* first byte in host space */
-	baseaddr_t	LastByte;	/* last byte in host space */
-	unsigned	MinSize;	/* minimum window size */
-	unsigned	MaxSize;	/* maximum window size */
-	unsigned	ReqGran;	/* window size constraints */
-	unsigned	ReqBase;	/* base address alignment boundry */
-	unsigned	ReqOffset;	/* offset alignment boundry */
-	unsigned	Slowest;	/* slowest speed in nanoseconds */
-	unsigned	Fastest;	/* fastest speed in nanoseconds */
-} mem_win_char_t;
-
-typedef struct iowin_char {
-	unsigned	IOWndCaps;	/* I/O window characteristcs */
-	baseaddr_t	FirstByte;	/* first byte in host space */
-	baseaddr_t	LastByte;	/* last byte in host space */
-	unsigned	MinSize;	/* minimum window size */
-	unsigned	MaxSize;	/* maximum window size */
-	unsigned	ReqGran;	/* window size constraints */
-	unsigned	AddrLines;	/* number of address lines decoded */
-	unsigned	EISASlot;	/* EISA I/O address decoding */
-} iowin_char_t;
-
-typedef struct inquire_window {
-	unsigned	window;		/* window number */
-	unsigned	WndCaps;	/* window capabilities */
-	socket_enum_t	Sockets;	/* window<->socket assignment mask */
-	/* note that we always declare both forms */
-	mem_win_char_t	mem_win_char;
-	iowin_char_t	iowin_char;
-} inquire_window_t;
-
-
-/* interface definitions */
-#define	IF_CARDBUS	0x00	/* CardBus interface */
-#define	IF_IO		0x01	/* IO + memory */
-#define	IF_MEMORY	0x02	/* memory only */
-#define	IF_TYPE_MASK	0x03
-
-#define	DREQ_MASK	0x0c
-#define	DREQ_NONE	0x00
-#define	DREQ_SPKR	0x04
-#define	DREQ_IOIS16	0x08
-#define	DREQ_INPACK	0x0c
-
-#define	DMA_CHAN_MASK	0xf0
-#define	DMA_GET_CHAN(x) (((x) >> 4) & 0xF)
-#define	DMA_SET_CHAN(x, y) (((x) & 0xF) | ((y) & ~DMA_CHAN_MASK))
-
-#define	IF_CB		0x04
-#define	IF_DMA		0x08
-#define	IF_VSKEY	0x10
-#define	IF_33VC		0x20
-#define	IF_XXVCC	0x40
-
-
-#define	PC_PAGESIZE	0x4000	/* 16K page size */
-
-/* window capabilities */
-				/* generic */
-#define	WC_IO		0x0004
-#define	WC_WAIT		0x0080
-#define	WC_COMMON	0x0001
-#define	WC_ATTRIBUTE	0x0002
-				/* I/O and memory */
-#define	WC_BASE		0x0001
-#define	WC_SIZE		0x0002
-#define	WC_WENABLE	0x0004
-#define	WC_8BIT		0x0008
-#define	WC_16BIT	0x0010
-#define	WC_BALIGN	0x0020
-#define	WC_POW2		0x0040
-				/* memory only */
-#define	WC_CALIGN	0x0080
-#define	WC_PAVAIL	0x0100
-#define	WC_PSHARED	0x0200
-#define	WC_PENABLE	0x0400
-#define	WC_WP		0x0800
-				/* I/O only */
-#define	WC_INPACK	0x0080
-#define	WC_EISA		0x0100
-#define	WC_CENABLE	0x0200
-				/* Solaris/SPARC */
-#define	WC_IO_RANGE_PER_WINDOW	0x8000 /* I/O range unique for each window */
-
-/* SetPage(set_page_t *) */
-typedef struct set_page {
-	unsigned	window;	/* window number */
-	unsigned	page;	/* page number */
-	unsigned	state;	/* page state */
-	off_t		offset;	/* offset in PC card space */
-} set_page_t;
-
-/* SetSocket(set_socket_t) */
-
-typedef struct set_socket {
-	unsigned	socket;	/* socket number */
-	unsigned	SCIntMask; /* status change enables */
-	unsigned	Vcontrol; /* power control flags */
-	unsigned	VccLevel; /* Vcc power index level */
-	unsigned	Vpp1Level; /* Vpp1 power index level */
-	unsigned	Vpp2Level; /* Vpp2 power index level */
-	unsigned	State;
-	unsigned	CtlInd;	/* control and indicator bits */
-	irq_t		IREQRouting; /* I/O IRQ routing */
-	unsigned	IFType;	/* interface type (mem/IO) */
-} set_socket_t;
-
-#define	VCTL_CISREAD	0x01	/* controlled by Vcc/Vpp sense pins */
-#define	VCTL_OVERRIDE	0x02	/* 16-bit cards, ignore the sense pins */
-
-/* SetIRQHandler(set_irq_handler_t) */
-
-typedef struct set_irq_handler {
-	unsigned	socket;	/* associate with a socket for now */
-	unsigned	irq;
-	unsigned	handler_id;	/* ID of this client's handler */
-	f_tt		*handler;	/* client IO IRQ handler entry point */
-	void		*arg1;		/* arg to call client handler with */
-	void		*arg2;		/* arg to call client handler with */
-	ddi_iblock_cookie_t	*iblk_cookie;	/* iblk cookie pointer */
-	ddi_idevice_cookie_t	*idev_cookie;	/* idev cookie pointer */
-} set_irq_handler_t;
-
-#define	IRQ_ANY		0x0
-
-/* interrupt priority levels */
-#define	PRIORITY_LOW	0x00
-#define	PRIORITY_HIGH	0x10
-
-/* ClearIRQHandler(clear_irq_handler_t) */
-
-typedef struct clear_irq_handler {
-	unsigned	socket;
-	unsigned	handler_id;	/* client handler ID to remove */
-	f_tt		*handler;	/* client IO IRQ handler entry point */
-} clear_irq_handler_t;
-
-/* SetWindow(set_window_t) */
-
-typedef struct set_window {
-	unsigned		window;		/* window number */
-	unsigned		socket;		/* socket number */
-	unsigned		WindowSize;	/* window size in bytes */
-	unsigned		state;		/* window state */
-	unsigned		speed;		/* window speed, nanoseconds */
-	uint_t			base;
-	ddi_acc_handle_t	handle;		/* base addr in host space */
-	dev_info_t		*child;		/* child's dip */
-	ddi_device_acc_attr_t	attr;
-} set_window_t;
-
-/* CSInitDev */
-typedef
-struct ss_make_device_node {
-	uint32_t		flags;		/* operation flags */
-	dev_info_t	*dip;		/* dip for this client */
-	char		*name;		/* device node path and name */
-	char		*slot;		/* slot name string */
-	char		*busaddr;	/* bus addr name string */
-	int		spec_type;	/* dev special type (block/char) */
-	int		minor_num;	/* device node minor number */
-	char		*node_type;	/* device node type */
-} ss_make_device_node_t;
-
-#define	SS_CSINITDEV_CREATE_DEVICE	0x01	/* create device node */
-#define	SS_CSINITDEV_REMOVE_DEVICE	0x02	/* remove device node */
-#define	SS_CSINITDEV_USE_SLOT		0x04	/* use slot name from caller */
-#define	SS_CSINITDEV_USE_BUSADDR	0x08	/* use bus addr from caller */
-#define	SS_CSINITDEV_MORE_DEVICES	0x10	/* send PCE_INIT_DEV */
-#define	SS_CSINITDEV_SEND_DEV_EVENT	0x10	/* send PCE_INIT_DEV */
-
-/*
- * csss_adapter_info_t - provides additional per-socket adapter info
- */
-typedef struct csss_adapter_info_t {
-	char	name[MODMAXNAMELEN];	/* adapter name */
-	int	major;			/* adapter major number */
-	int	minor;			/* adapter minor number */
-	int	number;			/* canonical adapter number */
-	int	num_sockets;		/* # sockets on this adapter */
-	int	first_socket;		/* first socket # on this adapter */
-} csss_adapter_info_t;
-
-/* CSGetCookiesAndDip */
-typedef struct get_cookies_and_dip_t {
-	unsigned		socket;		/* socket number */
-	dev_info_t		*dip;		/* adapter instance dip */
-	ddi_iblock_cookie_t	*iblock;	/* for event handler */
-	ddi_idevice_cookie_t	*idevice;	/* for event handler */
-	csss_adapter_info_t	adapter_info;	/* adapter info for socket */
-} get_cookies_and_dip_t;
-
-/* ResetSocket */
-#define	RESET_MODE_FULL		0 /* Reset to SocketServices Specification */
-#define	RESET_MODE_CARD_ONLY	1 /* only reset the card itself */
-
-/* union of all exported functions functions */
-typedef
-union sservice {
-	get_adapter_t	get_adapter;
-	get_page_t	get_page;
-	get_socket_t	get_socket;
-	get_window_t	get_window;
-	get_ss_status_t	get_ss_status;
-	inquire_adapter_t	inquire_adapter;
-	inquire_socket_t	inquire_socket;
-	inquire_window_t	inquire_window;
-	set_page_t	set_page;
-	set_socket_t	set_socket;
-	set_irq_handler_t	set_irq_handler;
-	set_window_t	set_window;
-	get_cookies_and_dip_t get_cookies;
-	ss_make_device_node_t make_device;
-} sservice_t;
-
-/* event manager structures */
-struct pcm_make_dev {
-	int	socket;
-	int	flags;
-	int	op;
-	dev_t	dev;
-	int	type;
-	char	driver[MODMAXNAMELEN];
-	char	path[MAXPATHLEN];
-};
-
-#define	PCM_EVENT_MORE		0x0001	/* more events of this type coming */
-
-#ifdef	_KERNEL
-
-#include <sys/sunndi.h>
-
-/*
- * prototypes for nexi
- */
-
-int pcmcia_attach(dev_info_t *, struct pcmcia_adapter_nexus_private *);
-int pcmcia_ctlops(dev_info_t *, dev_info_t *, ddi_ctl_enum_t, void *, void *);
-int pcmcia_prop_op(dev_t, dev_info_t *, dev_info_t *, ddi_prop_op_t,
-			int, char *, caddr_t, int *);
-int pcmcia_intr_ops(dev_info_t *dip, dev_info_t *rdip, ddi_intr_op_t intr_op,
-    ddi_intr_handle_impl_t *hdlp, void *result);
-
-int pcmcia_open(dev_t *, int, int, cred_t *);
-int pcmcia_close(dev_t, int, int, cred_t *);
-int pcmcia_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
-int pcmcia_power(dev_info_t *, int, int);
-void pcmcia_begin_resume(dev_info_t *);
-void pcmcia_wait_insert(dev_info_t *);
-
-
-/* resource allocation functions and structure */
-typedef struct ra_return {
-	uint_t	ra_addr_hi;
-	uint_t	ra_addr_lo;
-	uint_t	ra_len;
-} ra_return_t;
-
-int pcmcia_alloc_mem(dev_info_t *, ndi_ra_request_t *, ra_return_t *,
-		dev_info_t **);
-int pcmcia_alloc_io(dev_info_t *, ndi_ra_request_t *, ra_return_t *,
-		dev_info_t **);
-int pcmcia_free_mem(dev_info_t *, ra_return_t *);
-int pcmcia_free_io(dev_info_t *, ra_return_t *);
-int pcmcia_map_reg(dev_info_t *, dev_info_t *, ra_return_t *,
-			uint32_t, caddr_t *, ddi_acc_handle_t *,
-			ddi_device_acc_attr_t *, uint32_t);
-int pcmcia_bus_map(dev_info_t *, dev_info_t *, ddi_map_req_t *,
-	off_t, off_t, caddr_t *);
-
-#endif /* _KERNEL */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SSERVICE_H */
--- old/usr/src/uts/intel/Makefile.intel	2014-11-12 17:44:41.942631884 +0100
+++ new/usr/src/uts/intel/Makefile.intel	2014-11-12 17:44:41.947641801 +0100
@@ -21,6 +21,7 @@
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2014 Nexenta Systems, Inc. All rights reserved.
 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 
 #
 #	This makefile contains the common definitions for all intel
@@ -288,7 +289,6 @@
 DRV_KMODS	+= oce
 DRV_KMODS	+= openeepr
 DRV_KMODS	+= pci_pci
-DRV_KMODS	+= pcic
 DRV_KMODS	+= pcieb
 DRV_KMODS	+= physmem
 DRV_KMODS	+= pit_beep
@@ -441,12 +441,6 @@
 DRV_KMODS	+= iscsi
 
 #
-#	PCMCIA specific module(s)
-#
-DRV_KMODS	+= pcs
-MISC_KMODS	+= cardbus
-
-#
 #	SCSI Enclosure Services driver
 #
 DRV_KMODS	+= ses
@@ -608,7 +602,6 @@
 MISC_KMODS	+= pci_autoconfig
 MISC_KMODS	+= pcicfg
 MISC_KMODS	+= pcihp
-MISC_KMODS	+= pcmcia
 MISC_KMODS	+= rpcsec
 MISC_KMODS	+= rpcsec_gss
 MISC_KMODS	+= rsmops
--- /dev/null	2014-11-12 17:44:42.000000000 +0100
+++ new/usr/src/uts/intel/Makefile.intel.orig	2014-11-12 17:44:42.108624948 +0100
@@ -0,0 +1,722 @@
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014 Nexenta Systems, Inc. All rights reserved.
+# Copyright (c) 2013 Andrew Stormont.  All rights reserved.
+
+#
+#	This makefile contains the common definitions for all intel
+#	implementation architecture independent modules.
+#
+
+#
+#	Machine type (implementation architecture):
+#
+PLATFORM	 = i86pc
+
+#
+#	Everybody needs to know how to build modstubs.o and to locate unix.o.
+#	Note that unix.o must currently be selected from among the possible
+#	"implementation architectures". Note further, that unix.o is only
+#	used as an optional error check for undefines so (theoretically)
+#	any "implementation architectures" could be used. We choose i86pc
+#	because it is the reference port.
+#
+UNIX_DIR	 = $(UTSBASE)/i86pc/unix
+GENLIB_DIR	 = $(UTSBASE)/intel/genunix
+IPDRV_DIR	 = $(UTSBASE)/intel/ip
+MODSTUBS_DIR	 = $(UNIX_DIR)
+DSF_DIR		 = $(UTSBASE)/$(PLATFORM)/genassym
+LINTS_DIR	 = $(OBJS_DIR)
+LINT_LIB_DIR	 = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)
+
+UNIX_O		 = $(UNIX_DIR)/$(OBJS_DIR)/unix.o
+GENLIB		 = $(GENLIB_DIR)/$(OBJS_DIR)/libgenunix.so
+MODSTUBS_O	 = $(MODSTUBS_DIR)/$(OBJS_DIR)/modstubs.o
+LINT_LIB	 = $(UTSBASE)/i86pc/lint-libs/$(OBJS_DIR)/llib-lunix.ln
+GEN_LINT_LIB	 = $(UTSBASE)/intel/lint-libs/$(OBJS_DIR)/llib-lgenunix.ln
+
+#
+#	Include the makefiles which define build rule templates, the
+#	collection of files per module, and a few specific flags. Note
+#	that order is significant, just as with an include path. The
+#	first build rule template which matches the files name will be
+#	used. By including these in order from most machine dependent
+#	to most machine independent, we allow a machine dependent file
+#	to be used in preference over a machine independent version
+#	(Such as a machine specific optimization, which preserves the
+#	interfaces.)
+#
+include $(UTSBASE)/intel/Makefile.files
+include $(UTSBASE)/common/Makefile.files
+
+#
+# ----- TRANSITIONAL SECTION --------------------------------------------------
+#
+
+#
+#	Not everything which *should* be a module is a module yet. The
+#	following is a list of such objects which are currently part of
+#	genunix but which might someday become kmods.  This must be
+#	defined before we include Makefile.uts, or else genunix's build
+#	won't be as parallel as we might like.
+#
+NOT_YET_KMODS	 = $(OLDPTY_OBJS) $(PTY_OBJS) $(VCONS_CONF_OBJS) $(MOD_OBJS)
+
+#
+# ----- END OF TRANSITIONAL SECTION -------------------------------------------
+#
+#	Include machine independent rules. Note that this does not imply
+#	that the resulting module from rules in Makefile.uts is	machine
+#	independent. Only that the build rules are machine independent.
+#
+include $(UTSBASE)/Makefile.uts
+
+#
+#	The following must be defined for all implementations:
+#
+MODSTUBS		= $(UTSBASE)/intel/ia32/ml/modstubs.s
+
+#
+#	Define supported builds
+#
+DEF_BUILDS		= $(DEF_BUILDS64) $(DEF_BUILDS32)
+ALL_BUILDS		= $(ALL_BUILDS64) $(ALL_BUILDS32)
+
+#
+#	x86 or amd64 inline templates
+#
+INLINES_32		= $(UTSBASE)/intel/ia32/ml/ia32.il
+INLINES_64		= $(UTSBASE)/intel/amd64/ml/amd64.il
+INLINES			+= $(INLINES_$(CLASS))
+
+#
+#	kernel-specific optimizations; override default in Makefile.master
+#
+
+CFLAGS_XARCH_32		= $(i386_CFLAGS)
+CFLAGS_XARCH_64		= $(amd64_CFLAGS)
+CFLAGS_XARCH		= $(CFLAGS_XARCH_$(CLASS))
+
+COPTFLAG_32		= $(COPTFLAG)
+COPTFLAG_64		= $(COPTFLAG64)
+COPTIMIZE		= $(COPTFLAG_$(CLASS))
+
+CFLAGS			= $(CFLAGS_XARCH)
+CFLAGS			+= $(COPTIMIZE)
+CFLAGS			+= $(INLINES) -D_ASM_INLINES
+CFLAGS			+= $(CCMODE)
+CFLAGS			+= $(SPACEFLAG)
+CFLAGS			+= $(CCUNBOUND)
+CFLAGS			+= $(CFLAGS_uts)
+CFLAGS			+= -xstrconst
+
+ASFLAGS_XARCH_32	= $(i386_ASFLAGS)
+ASFLAGS_XARCH_64	= $(amd64_ASFLAGS)
+ASFLAGS_XARCH		= $(ASFLAGS_XARCH_$(CLASS))
+
+ASFLAGS			+= $(ASFLAGS_XARCH)
+
+#
+#	Define the base directory for installation.
+#
+BASE_INS_DIR	= $(ROOT)
+
+#
+#	Debugging level
+#
+#	Special knowledge of which special debugging options affect which
+#	file is used to optimize the build if these flags are changed.
+#
+DEBUG_DEFS_OBJ32	=
+DEBUG_DEFS_DBG32	= -DDEBUG
+DEBUG_DEFS_OBJ64	=
+DEBUG_DEFS_DBG64	= -DDEBUG
+DEBUG_DEFS		= $(DEBUG_DEFS_$(BUILD_TYPE))
+
+DEBUG_COND_OBJ32	= $(POUND_SIGN)
+DEBUG_COND_DBG32	=
+DEBUG_COND_OBJ64	= $(POUND_SIGN)
+DEBUG_COND_DBG64	=
+IF_DEBUG_OBJ		= $(DEBUG_COND_$(BUILD_TYPE))$(OBJS_DIR)/
+
+$(IF_DEBUG_OBJ)syscall.o	:=	DEBUG_DEFS	+= -DSYSCALLTRACE
+$(IF_DEBUG_OBJ)clock.o		:=	DEBUG_DEFS	+= -DKSLICE=1
+
+#
+#	Collect the preprocessor definitions to be associated with *all*
+#	files.
+#
+ALL_DEFS	 = $(DEBUG_DEFS) $(OPTION_DEFS)
+
+#
+#	The kernels modules which are "implementation architecture"
+#	specific for this machine are enumerated below. Note that most
+#	of these modules must exist (in one form or another) for each
+#	architecture.
+#
+#	Common Drivers (usually pseudo drivers) (/kernel/drv)
+#	DRV_KMODS are built both 32-bit and 64-bit
+#	DRV_KMODS_32 are built only 32-bit
+#	DRV_KMODS_64 are built only 64-bit
+#
+DRV_KMODS	+= aac
+DRV_KMODS	+= aggr
+DRV_KMODS	+= ahci
+DRV_KMODS	+= amd64_gart
+DRV_KMODS	+= amr
+DRV_KMODS	+= agpgart
+DRV_KMODS	+= srn
+DRV_KMODS	+= agptarget
+DRV_KMODS       += arn
+DRV_KMODS	+= arp
+DRV_KMODS	+= asy
+DRV_KMODS	+= ata
+DRV_KMODS	+= ath
+DRV_KMODS	+= atu
+DRV_KMODS	+= audio
+DRV_KMODS	+= audio1575
+DRV_KMODS	+= audio810
+DRV_KMODS	+= audiocmi
+DRV_KMODS	+= audiocmihd
+DRV_KMODS	+= audioemu10k
+DRV_KMODS	+= audioens
+DRV_KMODS	+= audiohd
+DRV_KMODS	+= audioixp
+DRV_KMODS	+= audiols
+DRV_KMODS	+= audiop16x
+DRV_KMODS	+= audiopci
+DRV_KMODS	+= audiosolo
+DRV_KMODS	+= audiots
+DRV_KMODS	+= audiovia823x
+DRV_KMODS_32	+= audiovia97
+DRV_KMODS	+= bl 
+DRV_KMODS	+= blkdev
+DRV_KMODS	+= bge
+DRV_KMODS	+= bofi
+DRV_KMODS	+= bpf
+DRV_KMODS	+= bridge
+DRV_KMODS	+= bscbus
+DRV_KMODS	+= bscv
+DRV_KMODS	+= chxge
+DRV_KMODS	+= cxgbe
+DRV_KMODS	+= ntxn
+DRV_KMODS	+= myri10ge
+DRV_KMODS	+= clone
+DRV_KMODS	+= cmdk
+DRV_KMODS	+= cn
+DRV_KMODS	+= conskbd
+DRV_KMODS	+= consms
+DRV_KMODS	+= cpqary3
+DRV_KMODS	+= cpuid
+DRV_KMODS	+= cpunex
+DRV_KMODS	+= crypto
+DRV_KMODS	+= cryptoadm
+DRV_KMODS	+= dca
+DRV_KMODS	+= devinfo
+DRV_KMODS	+= dld
+DRV_KMODS	+= dlpistub
+DRV_KMODS_32	+= dnet
+DRV_KMODS	+= dump
+DRV_KMODS	+= ecpp
+DRV_KMODS	+= emlxs
+DRV_KMODS	+= fd
+DRV_KMODS	+= fdc
+DRV_KMODS	+= fm
+DRV_KMODS	+= fssnap
+DRV_KMODS	+= hxge
+DRV_KMODS	+= i8042
+DRV_KMODS	+= i915
+DRV_KMODS	+= icmp
+DRV_KMODS	+= icmp6
+DRV_KMODS	+= intel_nb5000
+DRV_KMODS	+= intel_nhm
+DRV_KMODS	+= ip
+DRV_KMODS	+= ip6
+DRV_KMODS	+= ipd
+DRV_KMODS	+= ipf
+DRV_KMODS       += ipnet
+DRV_KMODS	+= ippctl
+DRV_KMODS	+= ipsecah
+DRV_KMODS	+= ipsecesp
+DRV_KMODS	+= ipw
+DRV_KMODS	+= iwh
+DRV_KMODS	+= iwi
+DRV_KMODS	+= iwk
+DRV_KMODS	+= iwp
+DRV_KMODS	+= iwscn
+DRV_KMODS	+= kb8042
+DRV_KMODS	+= keysock
+DRV_KMODS	+= kssl
+DRV_KMODS	+= kstat
+DRV_KMODS	+= ksyms
+DRV_KMODS	+= kmdb
+DRV_KMODS	+= llc1
+DRV_KMODS	+= lofi
+DRV_KMODS	+= log
+DRV_KMODS	+= logindmux
+DRV_KMODS	+= mega_sas
+DRV_KMODS	+= mc-amd
+DRV_KMODS	+= mm
+DRV_KMODS	+= mouse8042
+DRV_KMODS	+= mpt_sas
+DRV_KMODS	+= mr_sas
+DRV_KMODS	+= mwl 
+DRV_KMODS	+= nca
+DRV_KMODS	+= nsmb
+DRV_KMODS	+= nulldriver
+DRV_KMODS	+= nv_sata
+DRV_KMODS	+= nxge
+DRV_KMODS	+= oce
+DRV_KMODS	+= openeepr
+DRV_KMODS	+= pci_pci
+DRV_KMODS	+= pcic
+DRV_KMODS	+= pcieb
+DRV_KMODS	+= physmem
+DRV_KMODS	+= pit_beep
+DRV_KMODS	+= pm
+DRV_KMODS	+= poll
+DRV_KMODS	+= pool
+DRV_KMODS	+= power
+DRV_KMODS	+= pseudo
+DRV_KMODS	+= ptc
+DRV_KMODS	+= ptm
+DRV_KMODS	+= pts
+DRV_KMODS	+= ptsl
+DRV_KMODS	+= qlge
+DRV_KMODS	+= radeon
+DRV_KMODS	+= ral
+DRV_KMODS	+= ramdisk
+DRV_KMODS	+= random
+DRV_KMODS	+= rds
+DRV_KMODS	+= rdsv3
+DRV_KMODS	+= rpcib
+DRV_KMODS	+= rsm
+DRV_KMODS	+= rts
+DRV_KMODS	+= rtw
+DRV_KMODS	+= rum
+DRV_KMODS	+= rwd
+DRV_KMODS	+= rwn
+DRV_KMODS	+= sad
+DRV_KMODS	+= sd
+DRV_KMODS	+= sdhost
+DRV_KMODS	+= sgen
+DRV_KMODS	+= si3124
+DRV_KMODS	+= smbios
+DRV_KMODS	+= skd
+DRV_KMODS	+= softmac
+DRV_KMODS	+= spdsock
+DRV_KMODS	+= smbsrv
+DRV_KMODS	+= smp
+DRV_KMODS	+= sppp
+DRV_KMODS	+= sppptun
+DRV_KMODS	+= srpt
+DRV_KMODS	+= st
+DRV_KMODS	+= sy
+DRV_KMODS	+= sysevent
+DRV_KMODS	+= sysmsg
+DRV_KMODS	+= tcp
+DRV_KMODS	+= tcp6
+DRV_KMODS	+= tl
+DRV_KMODS	+= tnf
+DRV_KMODS	+= tpm
+DRV_KMODS	+= trill
+DRV_KMODS	+= udp
+DRV_KMODS	+= udp6
+DRV_KMODS	+= ucode
+DRV_KMODS	+= ural
+DRV_KMODS	+= uath
+DRV_KMODS	+= urtw
+DRV_KMODS	+= vgatext
+DRV_KMODS	+= heci
+DRV_KMODS	+= vnic
+DRV_KMODS	+= vscan
+DRV_KMODS	+= wc
+DRV_KMODS	+= winlock
+DRV_KMODS	+= wpi
+DRV_KMODS	+= xge
+DRV_KMODS	+= yge
+DRV_KMODS	+= zcons
+DRV_KMODS	+= zyd
+DRV_KMODS	+= simnet
+DRV_KMODS	+= stmf
+DRV_KMODS	+= stmf_sbd
+DRV_KMODS	+= fct
+DRV_KMODS	+= fcoe
+DRV_KMODS	+= fcoet
+DRV_KMODS	+= fcoei
+DRV_KMODS	+= qlt
+DRV_KMODS	+= iscsit
+DRV_KMODS	+= pppt
+DRV_KMODS	+= ncall nsctl sdbc nskern sv
+DRV_KMODS	+= ii rdc rdcsrv rdcstub 
+DRV_KMODS	+= iptun
+
+#
+# Common code drivers
+#
+
+DRV_KMODS	+= afe
+DRV_KMODS	+= atge
+DRV_KMODS	+= bfe
+DRV_KMODS	+= dmfe
+DRV_KMODS	+= e1000g
+DRV_KMODS	+= efe
+DRV_KMODS	+= elxl
+DRV_KMODS	+= hme
+DRV_KMODS	+= mxfe
+DRV_KMODS	+= nge
+DRV_KMODS	+= pcn
+DRV_KMODS	+= rge
+DRV_KMODS	+= rtls
+DRV_KMODS	+= sfe
+DRV_KMODS	+= amd8111s
+DRV_KMODS	+= igb
+DRV_KMODS	+= ipmi
+DRV_KMODS	+= iprb
+DRV_KMODS	+= ixgbe
+DRV_KMODS	+= vr
+
+#
+# Virtio drivers
+#
+
+# Virtio core
+DRV_KMODS	+= virtio
+
+# Virtio block driver
+DRV_KMODS	+= vioblk
+
+#
+#	DTrace and DTrace Providers
+#
+DRV_KMODS	+= dtrace
+DRV_KMODS	+= fbt
+DRV_KMODS	+= lockstat
+DRV_KMODS	+= profile
+DRV_KMODS	+= sdt
+DRV_KMODS	+= systrace
+DRV_KMODS	+= fasttrap
+DRV_KMODS	+= dcpc
+
+#
+#	I/O framework test drivers
+#
+DRV_KMODS	+= pshot
+DRV_KMODS	+= gen_drv
+DRV_KMODS	+= tvhci tphci tclient
+DRV_KMODS	+= emul64
+
+#
+#	Machine Specific Driver Modules (/kernel/drv):
+#
+DRV_KMODS	+= options
+DRV_KMODS	+= scsi_vhci
+DRV_KMODS	+= pmcs
+DRV_KMODS	+= pmcs8001fw
+DRV_KMODS	+= arcmsr
+DRV_KMODS	+= fcp
+DRV_KMODS	+= fcip
+DRV_KMODS	+= fcsm
+DRV_KMODS	+= fp
+DRV_KMODS	+= qlc
+DRV_KMODS	+= iscsi
+
+#
+#	PCMCIA specific module(s)
+#
+DRV_KMODS	+= pcs
+MISC_KMODS	+= cardbus
+
+#
+#	SCSI Enclosure Services driver
+#
+DRV_KMODS	+= ses
+
+#
+#	USB specific modules
+#
+DRV_KMODS	+= hid
+DRV_KMODS	+= hwarc hwahc
+DRV_KMODS	+= hubd
+DRV_KMODS	+= uhci
+DRV_KMODS	+= ehci
+DRV_KMODS	+= ohci
+DRV_KMODS	+= usb_mid
+DRV_KMODS	+= usb_ia
+DRV_KMODS	+= scsa2usb
+DRV_KMODS	+= usbprn
+DRV_KMODS	+= ugen
+DRV_KMODS	+= usbser
+DRV_KMODS	+= usbsacm
+DRV_KMODS	+= usbsksp
+DRV_KMODS	+= usbsprl
+DRV_KMODS	+= usb_ac
+DRV_KMODS	+= usb_as
+DRV_KMODS	+= usbskel
+DRV_KMODS	+= usbvc
+DRV_KMODS	+= usbftdi
+DRV_KMODS	+= wusb_df
+DRV_KMODS	+= wusb_ca
+DRV_KMODS	+= usbecm
+
+#
+#	1394 modules
+#
+MISC_KMODS	+= s1394 sbp2
+DRV_KMODS	+= hci1394 scsa1394
+DRV_KMODS	+= av1394
+DRV_KMODS	+= dcam1394
+
+#
+#	InfiniBand pseudo drivers
+#
+DRV_KMODS	+= ib ibp eibnx eoib rdsib sdp iser daplt hermon tavor sol_ucma sol_uverbs
+DRV_KMODS	+= sol_umad 
+
+#
+#	LVM modules
+#
+DRV_KMODS	+= md
+MISC_KMODS	+= md_stripe md_hotspares md_mirror md_raid md_trans md_notify
+MISC_KMODS	+= md_sp
+
+#
+#	Brand modules
+#
+BRAND_KMODS	+= sn1_brand s10_brand
+
+#
+#	Exec Class Modules (/kernel/exec):
+#
+EXEC_KMODS	+= elfexec intpexec shbinexec javaexec
+
+#
+#	Scheduling Class Modules (/kernel/sched):
+#
+SCHED_KMODS	+= IA RT TS RT_DPTBL TS_DPTBL FSS FX FX_DPTBL SDC
+
+#
+#	File System Modules (/kernel/fs):
+#
+FS_KMODS	+= autofs cachefs ctfs dcfs dev devfs fdfs fifofs hsfs lofs
+FS_KMODS	+= mntfs namefs nfs objfs zfs zut
+FS_KMODS	+= pcfs procfs sockfs specfs tmpfs udfs ufs sharefs
+FS_KMODS	+= smbfs
+
+#
+#	Streams Modules (/kernel/strmod):
+#
+STRMOD_KMODS	+= bufmod connld dedump ldterm pckt pfmod pipemod
+STRMOD_KMODS	+= ptem redirmod rpcmod rlmod telmod timod
+STRMOD_KMODS	+= spppasyn spppcomp
+STRMOD_KMODS	+= tirdwr ttcompat
+STRMOD_KMODS	+= usbkbm
+STRMOD_KMODS	+= usbms
+STRMOD_KMODS	+= usbwcm
+STRMOD_KMODS	+= usb_ah
+STRMOD_KMODS	+= drcompat
+STRMOD_KMODS	+= cryptmod
+STRMOD_KMODS	+= vuid2ps2
+STRMOD_KMODS	+= vuid3ps2
+STRMOD_KMODS	+= vuidm3p
+STRMOD_KMODS	+= vuidm4p
+STRMOD_KMODS	+= vuidm5p
+
+#
+#	'System' Modules (/kernel/sys):
+#
+SYS_KMODS	+= c2audit
+SYS_KMODS	+= doorfs
+SYS_KMODS	+= exacctsys
+SYS_KMODS	+= inst_sync
+SYS_KMODS	+= kaio
+SYS_KMODS	+= msgsys
+SYS_KMODS	+= pipe
+SYS_KMODS	+= portfs
+SYS_KMODS	+= pset
+SYS_KMODS	+= semsys
+SYS_KMODS	+= shmsys
+SYS_KMODS	+= sysacct
+SYS_KMODS	+= acctctl
+
+#
+#	'Misc' Modules (/kernel/misc)
+#	MISC_KMODS are built both 32-bit and 64-bit
+#	MISC_KMODS_32 are built only 32-bit
+#	MISC_KMODS_64 are built only 64-bit
+#
+MISC_KMODS	+= ac97
+MISC_KMODS	+= acpica
+MISC_KMODS	+= agpmaster
+MISC_KMODS	+= bignum
+MISC_KMODS	+= bootdev
+MISC_KMODS	+= busra
+MISC_KMODS	+= cmlb
+MISC_KMODS	+= consconfig
+MISC_KMODS	+= ctf
+MISC_KMODS	+= dadk
+MISC_KMODS	+= dcopy
+MISC_KMODS	+= dls
+MISC_KMODS	+= drm
+MISC_KMODS	+= fssnap_if
+MISC_KMODS	+= gda
+MISC_KMODS	+= gld
+MISC_KMODS	+= hidparser
+MISC_KMODS	+= hook
+MISC_KMODS	+= hpcsvc
+MISC_KMODS	+= ibcm
+MISC_KMODS	+= ibdm
+MISC_KMODS	+= ibdma
+MISC_KMODS	+= ibmf
+MISC_KMODS	+= ibtl
+MISC_KMODS	+= idm
+MISC_KMODS	+= idmap
+MISC_KMODS	+= iommulib
+MISC_KMODS	+= ipc
+MISC_KMODS	+= kbtrans
+MISC_KMODS	+= kcf
+MISC_KMODS	+= kgssapi
+MISC_KMODS	+= kmech_dummy
+MISC_KMODS	+= kmech_krb5
+MISC_KMODS	+= ksocket
+MISC_KMODS	+= mac
+MISC_KMODS	+= mii
+MISC_KMODS	+= mwlfw
+MISC_KMODS	+= net80211
+MISC_KMODS	+= nfs_dlboot
+MISC_KMODS	+= nfssrv
+MISC_KMODS	+= neti
+MISC_KMODS	+= pci_autoconfig
+MISC_KMODS	+= pcicfg
+MISC_KMODS	+= pcihp
+MISC_KMODS	+= pcmcia
+MISC_KMODS	+= rpcsec
+MISC_KMODS	+= rpcsec_gss
+MISC_KMODS	+= rsmops
+MISC_KMODS	+= sata
+MISC_KMODS	+= scsi
+MISC_KMODS	+= sda
+MISC_KMODS	+= sol_ofs
+MISC_KMODS	+= spuni
+MISC_KMODS	+= strategy
+MISC_KMODS	+= strplumb
+MISC_KMODS	+= tem
+MISC_KMODS	+= tlimod
+MISC_KMODS	+= usba usba10 usbs49_fw
+MISC_KMODS	+= scsi_vhci_f_sym_hds
+MISC_KMODS	+= scsi_vhci_f_sym
+MISC_KMODS	+= scsi_vhci_f_tpgs
+MISC_KMODS	+= scsi_vhci_f_asym_sun
+MISC_KMODS	+= scsi_vhci_f_tape
+MISC_KMODS	+= scsi_vhci_f_tpgs_tape
+MISC_KMODS	+= fctl
+MISC_KMODS	+= emlxs_fw
+MISC_KMODS	+= qlc_fw_2200
+MISC_KMODS	+= qlc_fw_2300
+MISC_KMODS	+= qlc_fw_2400
+MISC_KMODS	+= qlc_fw_2500
+MISC_KMODS	+= qlc_fw_6322
+MISC_KMODS	+= qlc_fw_8100
+MISC_KMODS	+= hwa1480_fw
+MISC_KMODS	+= uathfw
+MISC_KMODS	+= uwba
+
+MISC_KMODS	+= klmmod klmops
+
+#
+#	Software Cryptographic Providers (/kernel/crypto):
+#
+CRYPTO_KMODS	+= aes
+CRYPTO_KMODS	+= arcfour
+CRYPTO_KMODS	+= blowfish
+CRYPTO_KMODS	+= des
+CRYPTO_KMODS	+= ecc
+CRYPTO_KMODS	+= md4
+CRYPTO_KMODS	+= md5
+CRYPTO_KMODS	+= rsa
+CRYPTO_KMODS	+= sha1
+CRYPTO_KMODS	+= sha2
+CRYPTO_KMODS	+= swrand
+
+#
+#	IP Policy Modules (/kernel/ipp)
+#
+IPP_KMODS	+= dlcosmk
+IPP_KMODS	+= flowacct
+IPP_KMODS	+= ipgpc
+IPP_KMODS	+= dscpmk
+IPP_KMODS	+= tokenmt
+IPP_KMODS	+= tswtclmt
+
+#
+#	generic-unix module (/kernel/genunix):
+#
+GENUNIX_KMODS	+= genunix
+
+#
+#	Modules eXcluded from the product:
+#
+
+#
+#	'Dacf' Modules (/kernel/dacf):
+#
+
+#
+#	Performance Counter BackEnd modules (/usr/kernel/pcbe)
+#
+PCBE_KMODS	+= p123_pcbe p4_pcbe opteron_pcbe core_pcbe
+
+#
+#	MAC-Type Plugin Modules (/kernel/mac)
+#
+MAC_KMODS	+= mac_6to4
+MAC_KMODS	+= mac_ether
+MAC_KMODS	+= mac_ipv4
+MAC_KMODS	+= mac_ipv6
+MAC_KMODS	+= mac_wifi
+MAC_KMODS	+= mac_ib
+
+#
+# socketmod (kernel/socketmod)
+#
+SOCKET_KMODS	+= sockpfp
+SOCKET_KMODS	+= socksctp
+SOCKET_KMODS    += socksdp
+SOCKET_KMODS	+= sockrds
+SOCKET_KMODS	+= ksslf
+
+#
+#	kiconv modules (/kernel/kiconv):
+#
+KICONV_KMODS	+= kiconv_emea kiconv_ja kiconv_ko kiconv_sc kiconv_tc
+
+#
+#	'Dacf' Modules (/kernel/dacf):
+#
+DACF_KMODS	+= net_dacf
+
+#
+# Ensure that the variable member of the cpu_t (cpu_m) is defined
+# for the lint builds so as not to cause lint errors during the
+# global cross check.
+#
+LINTFLAGS	+= -D_MACHDEP -I$(UTSBASE)/i86pc
--- old/usr/src/uts/intel/cardbus/Makefile	2014-11-12 17:44:42.179646873 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,113 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# uts/intel/cardbus/Makefile
-#
-
-#
-#	This makefile drives the production of the cardbus kernel module.
-#
-#	intel architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE		= ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= cardbus
-OBJECTS		= $(CARDBUS_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(CARDBUS_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/intel/Makefile.intel
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-# 
-# 	Include sun4u specific header files
-#
-INC_PATH        += -I$(UTSBASE)/sun4u -I$(UTSBASE)/sun4 -I$(UTSBASE)/i86pc
-
-#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-
-CPPFLAGS        +=      -DHOTPLUG
-
-#	dependency
-LDFLAGS	+=	-dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/hpcsvc
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_STATIC_UNUSED
-LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-
-CERRWARN	+= -_gcc=-Wno-uninitialized
-CERRWARN	+= -_gcc=-Wno-parentheses
-CERRWARN	+= -_gcc=-Wno-unused-function
-CERRWARN	+= -_gcc=-Wno-unused-variable
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS)
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#	Include common targets.
-#
-include $(UTSBASE)/intel/Makefile.targ
--- old/usr/src/uts/intel/pcic/Makefile	2014-11-12 17:44:42.231043069 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,105 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-#	This makefile drives the PCIC style PCMCIA adapter
-#	It is mostly a standard driver
-#
-#	intel architecture dependent
-#
-
-#
-#	Paths to the base of the uts directory trees
-#
-UTSBASE		= ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcic
-OBJECTS		= $(PCIC_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCIC_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
-CONF_SRCDIR	= $(UTSBASE)/common/io
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/intel/Makefile.intel
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
-
-CPPFLAGS	+=	-DCARDBUS -DHOTPLUG
-#
-#	Dependency
-#
-LDFLAGS		+= -dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/cardbus
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_STATIC_UNUSED
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-
-CERRWARN	+= -_gcc=-Wno-parentheses
-CERRWARN	+= -_gcc=-Wno-unused-variable
-CERRWARN	+= -_gcc=-Wno-unused-function
-CERRWARN	+= -_gcc=-Wno-uninitialized
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS)
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#
-#	Include common targets.
-#
-include $(UTSBASE)/intel/Makefile.targ
--- old/usr/src/uts/intel/pcmcia/Makefile	2014-11-12 17:44:42.282665068 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,110 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# uts/intel/pcmcia/Makefile
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-#	This file makes the pcmcia nexus for an intel system
-#
-#	intel architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE	= ../..
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcmcia
-OBJECTS		= $(PCMCIA_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCMCIA_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/intel/Makefile.intel
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-#
-#	Override defaults to build a unique, local modstubs.o.
-#
-MODSTUBS_DIR	 = $(OBJS_DIR)
-$(MODSTUBS_O)	:= AS_CPPFLAGS += -DPCMCIA_MODULE
-CLEANFILES	+= $(MODSTUBS_O)
-
-#
-#	Include i86pc specific header files
-#
-INC_PATH        += -I$(UTSBASE)/i86pc
-
-#
-#	dependency
-#
-LDFLAGS	+=	-dy -Nmisc/busra -Nmisc/pci_autoconfig
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-
-CERRWARN	+= -_gcc=-Wno-uninitialized
-CERRWARN	+= -_gcc=-Wno-parentheses
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS)
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#
-#	Include common targets.
-#
-include $(UTSBASE)/intel/Makefile.targ
--- old/usr/src/uts/intel/pcs/Makefile	2014-11-12 17:44:42.334087523 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,83 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# uts/intel/pcs/Makefile
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-#
-#	This makefile drives the production of the DoRight driver kernel module.
-#
-#	intel architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE	= ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcs
-OBJECTS		= $(PCS_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCS_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/intel/Makefile.intel
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS)
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#	Include common targets.
-#
-include $(UTSBASE)/intel/Makefile.targ
--- old/usr/src/uts/sparc/Makefile.sparc	2014-11-12 17:44:42.385464162 +0100
+++ new/usr/src/uts/sparc/Makefile.sparc	2014-11-12 17:44:42.390483892 +0100
@@ -21,7 +21,7 @@
 
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2013 Andrew Stormont.  All rights reserved.
-
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 
 #
 #	This makefile contains the common definitions for all sparc
@@ -324,12 +324,7 @@
 DRV_KMODS	+= tvhci tphci tclient
 DRV_KMODS	+= emul64
 
-#
-# PCMCIA specific module(s)
-#
-DRV_KMODS	+= pcs
-MISC_KMODS	+= busra cardbus dada pcmcia
-DRV_KMODS	+= pcic
+MISC_KMODS	+= busra dada
 
 # Add lvm
 #
--- old/usr/src/uts/sparc/cardbus/Makefile	2014-11-12 17:44:42.540935720 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,120 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# uts/sparc/cardbus/Makefile
-#
-
-#
-#	This makefile drives the production of the cardbus kernel module.
-#
-#	sparc architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE   = ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= cardbus
-OBJECTS		= $(CARDBUS_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(CARDBUS_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/sparc/Makefile.sparc
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-# 
-# 	Include sun4u specific header files
-#
-INC_PATH        += -I$(UTSBASE)/sun4u -I$(UTSBASE)/sun4
-
-#
-#	Overrides
-#
-DEF_BUILDS	= $(DEF_BUILDS64)
-ALL_BUILDS	= $(ALL_BUILDS64)
-CLEANLINTFILES	+= $(LINT64_FILES)
-
-#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-
-CPPFLAGS        +=      -DHOTPLUG
-
-#	dependency
-LDFLAGS	+=	-dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/hpcsvc
-
-CERRWARN	+= -_gcc=-Wno-uninitialized
-CERRWARN	+= -_gcc=-Wno-parentheses
-CERRWARN	+= -_gcc=-Wno-unused-function
-CERRWARN	+= -_gcc=-Wno-unused-variable
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_PTRDIFF_OVERFLOW
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-LINTTAGS	+= -erroff=E_STATIC_UNUSED
-LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS) lint64
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#	Include common targets.
-#
-include $(UTSBASE)/sparc/Makefile.targ
--- old/usr/src/uts/sparc/pcic/Makefile	2014-11-12 17:44:42.592146158 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,118 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-#	This makefile drives the production of the PCIC driver kernel module.
-#
-#	sparc architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE   = ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcic
-OBJECTS		= $(PCIC_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCIC_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
-CONF_SRCDIR	= $(UTSBASE)/common/io
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/sparc/Makefile.sparc
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY) $(SRC_CONFILE)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
-
-#
-#       Include sun4u specific header files
-#
-INC_PATH        += -I$(UTSBASE)/sun4u
-
-#
-#	Overrides
-#
-DEF_BUILDS	= $(DEF_BUILDS64)
-ALL_BUILDS	= $(ALL_BUILDS64)
-CLEANLINTFILES	+= $(LINT64_FILES)
-
-#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-CPPFLAGS        +=      -DCARDBUS -DHOTPLUG
-
-#	dependency
-LDFLAGS	+=	-dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/cardbus
-
-CERRWARN	+= -_gcc=-Wno-parentheses
-CERRWARN	+= -_gcc=-Wno-unused-variable
-CERRWARN	+= -_gcc=-Wno-unused-function
-CERRWARN	+= -_gcc=-Wno-uninitialized
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-LINTTAGS	+= -erroff=E_STATIC_UNUSED
-LINTTAGS	+= -erroff=E_SUSPICIOUS_COMPARISON
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS) lint64
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#	Include common targets.
-#
-include $(UTSBASE)/sparc/Makefile.targ
--- old/usr/src/uts/sparc/pcmcia/Makefile	2014-11-12 17:44:42.643450124 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,113 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# uts/sparc/pcmcia/Makefile
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#
-#	This file makes the pcmcia nexus driver
-#
-#	sparc architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE	= ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcmcia
-OBJECTS		= $(PCMCIA_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCMCIA_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_MISC_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/sparc/Makefile.sparc
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-#
-#	Override defaults to build a unique, local modstubs.o.
-#
-MODSTUBS_DIR	 = $(OBJS_DIR)
-$(MODSTUBS_O)	:= AS_CPPFLAGS += -DPCMCIA_MODULE
-CLEANFILES	+= $(MODSTUBS_O)
-CLEANLINTFILES	+= $(LINT64_FILES)
-
-#
-#	Include sun4 specific header files
-#
-INC_PATH	+= -I$(UTSBASE)/sun4
-
-#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-
-# dependency
-LDFLAGS	+=	-dy -Nmisc/busra
-
-#
-# For now, disable these lint checks; maintainers should endeavor
-# to investigate and remove these for maximum lint coverage.
-# Please do not carry these forward to new Makefiles.
-#
-LINTTAGS	+= -erroff=E_BAD_PTR_CAST_ALIGN
-LINTTAGS	+= -erroff=E_ASSIGN_NARROW_CONV
-
-CERRWARN	+= -_gcc=-Wno-uninitialized
-CERRWARN	+= -_gcc=-Wno-parentheses
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS)
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#
-#	Include common targets.
-#
-include $(UTSBASE)/sparc/Makefile.targ
--- old/usr/src/uts/sparc/pcs/Makefile	2014-11-12 17:44:42.694536594 +0100
+++ /dev/null	2014-11-12 17:44:42.000000000 +0100
@@ -1,94 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# uts/sparc/pcs/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
-#	This makefile drives the production of the DoRight driver kernel module.
-#
-#	sparc architecture dependent
-#
-
-#
-#	Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE	= ../..
-
-#
-#	Define the module and object file sets.
-#
-MODULE		= pcs
-OBJECTS		= $(PCS_OBJS:%=$(OBJS_DIR)/%)
-LINTS		= $(PCS_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE	= $(ROOT_DRV_DIR)/$(MODULE)
-
-#
-#	Include common rules.
-#
-include $(UTSBASE)/sparc/Makefile.sparc
-
-#
-#	Define targets
-#
-ALL_TARGET	= $(BINARY)
-LINT_TARGET	= $(MODULE).lint
-INSTALL_TARGET	= $(BINARY) $(ROOTMODULE)
-
-#
-#	Overrides
-#
-DEF_BUILDS	= $(DEF_BUILDS64)
-ALL_BUILDS	= $(ALL_BUILDS64)
-CLEANLINTFILES	+= $(LINT64_FILES)
-
-#
-# lint pass one enforcement
-#
-CFLAGS += $(CCVERBOSE)
-
-#
-#	Default build targets.
-#
-.KEEP_STATE:
-
-def:		$(DEF_DEPS)
-
-all:		$(ALL_DEPS)
-
-clean:		$(CLEAN_DEPS)
-
-clobber:	$(CLOBBER_DEPS)
-
-lint:		$(LINT_DEPS)
-
-modlintlib:	$(MODLINTLIB_DEPS) lint64
-
-clean.lint:	$(CLEAN_LINT_DEPS)
-
-install:	$(INSTALL_DEPS)
-
-#	Include common targets.
-#
-include $(UTSBASE)/sparc/Makefile.targ
