17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * This is the PCMCIA Card Services kernel stubs module. It provides
297c478bd9Sstevel@tonic-gate  *	the various PCMCIA kernel framework entry points.
307c478bd9Sstevel@tonic-gate  */
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #if defined(DEBUG)
337c478bd9Sstevel@tonic-gate #define	CS_STUBS_DEBUG
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate #include <sys/systm.h>
387c478bd9Sstevel@tonic-gate #include <sys/user.h>
397c478bd9Sstevel@tonic-gate #include <sys/buf.h>
407c478bd9Sstevel@tonic-gate #include <sys/file.h>
417c478bd9Sstevel@tonic-gate #include <sys/uio.h>
427c478bd9Sstevel@tonic-gate #include <sys/conf.h>
437c478bd9Sstevel@tonic-gate #include <sys/stat.h>
447c478bd9Sstevel@tonic-gate #include <sys/autoconf.h>
457c478bd9Sstevel@tonic-gate #include <sys/vtoc.h>
467c478bd9Sstevel@tonic-gate #include <sys/dkio.h>
477c478bd9Sstevel@tonic-gate #include <sys/ddi.h>
487c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
497c478bd9Sstevel@tonic-gate #include <sys/debug.h>
507c478bd9Sstevel@tonic-gate #include <sys/varargs.h>
517c478bd9Sstevel@tonic-gate #include <sys/var.h>
527c478bd9Sstevel@tonic-gate #include <sys/proc.h>
537c478bd9Sstevel@tonic-gate #include <sys/thread.h>
547c478bd9Sstevel@tonic-gate #include <sys/utsname.h>
557c478bd9Sstevel@tonic-gate #include <sys/vtrace.h>
567c478bd9Sstevel@tonic-gate #include <sys/kstat.h>
577c478bd9Sstevel@tonic-gate #include <sys/kmem.h>
587c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
597c478bd9Sstevel@tonic-gate #include <sys/kobj.h>
607c478bd9Sstevel@tonic-gate #include <sys/callb.h>
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #include <sys/pctypes.h>
637c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_types.h>
647c478bd9Sstevel@tonic-gate #include <sys/pcmcia.h>
657c478bd9Sstevel@tonic-gate #include <sys/sservice.h>
667c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cis.h>
677c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cis_handlers.h>
687c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs.h>
697c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_priv.h>
707c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_stubs.h>
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
737c478bd9Sstevel@tonic-gate int cs_stubs_debug = 0;
747c478bd9Sstevel@tonic-gate #endif
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate static csfunction_t *cardservices = NULL;
777c478bd9Sstevel@tonic-gate static int do_cs_call = 0;
78ebf37352SToomas Soome static int cs_no_carservices(int32_t, ...);
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #define	CardServices	(do_cs_call ? (*cardservices) :		\
81ebf37352SToomas Soome 			(cs_no_carservices))
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate #ifdef	USE_CS_STUBS_MODULE
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * Module linkage information for the kernel.
877c478bd9Sstevel@tonic-gate  */
887c478bd9Sstevel@tonic-gate static struct modlmisc modlmisc = {
897c478bd9Sstevel@tonic-gate 	&mod_miscops,
907c478bd9Sstevel@tonic-gate 	"PCMCIA Card Services stub module"
917c478bd9Sstevel@tonic-gate };
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate static struct modlinkage modlinkage = {
947c478bd9Sstevel@tonic-gate 	MODREV_1,
957c478bd9Sstevel@tonic-gate 	(void *)&modlmisc,
967c478bd9Sstevel@tonic-gate 	NULL
977c478bd9Sstevel@tonic-gate };
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate int
_init(void)1007c478bd9Sstevel@tonic-gate _init(void)
1017c478bd9Sstevel@tonic-gate {
1027c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
1037c478bd9Sstevel@tonic-gate }
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate int
_fini(void)1067c478bd9Sstevel@tonic-gate _fini(void)
1077c478bd9Sstevel@tonic-gate {
1087c478bd9Sstevel@tonic-gate 	if (!do_cs_call)
1097c478bd9Sstevel@tonic-gate 	    return (mod_remove(&modlinkage));
1107c478bd9Sstevel@tonic-gate 	else
1117c478bd9Sstevel@tonic-gate 	    return (EBUSY);
1127c478bd9Sstevel@tonic-gate }
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate int
_info(struct modinfo * modinfop)1157c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
1167c478bd9Sstevel@tonic-gate {
1177c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
1187c478bd9Sstevel@tonic-gate }
1197c478bd9Sstevel@tonic-gate #endif	/* USE_CS_STUBS_MODULE */
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate /*
1227c478bd9Sstevel@tonic-gate  * csx_register_cardservices - The Card Services loadable module
1237c478bd9Sstevel@tonic-gate  *	calls this runction to register it's entry point.
1247c478bd9Sstevel@tonic-gate  *
1257c478bd9Sstevel@tonic-gate  * Returns:	CS_SUCCESS - if operation sucessful
1267c478bd9Sstevel@tonic-gate  *		CS_UNSUPPORTED_FUNCTION - if invalid function code
1277c478bd9Sstevel@tonic-gate  *		CS_BAD_HANDLE - if Card Services is not registered
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate int32_t
csx_register_cardservices(cs_register_cardservices_t * rcs)1307c478bd9Sstevel@tonic-gate csx_register_cardservices(cs_register_cardservices_t *rcs)
1317c478bd9Sstevel@tonic-gate {
1327c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
1337c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 2)
134*3df2e8b2SRobert Mustacchi 		cmn_err(CE_CONT, "csx_register_cardservices: "
135*3df2e8b2SRobert Mustacchi 		    "magic: 0x%x function: 0x%x cardservices: 0x%p\n",
136*3df2e8b2SRobert Mustacchi 		    rcs->magic, rcs->function, (void *)rcs->cardservices);
1377c478bd9Sstevel@tonic-gate #endif
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate 	if (rcs->magic != CS_STUBS_MAGIC)
1407c478bd9Sstevel@tonic-gate 	    return (CS_BAD_ARGS);
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate 	switch (rcs->function) {
1437c478bd9Sstevel@tonic-gate 	    case CS_ENTRY_REGISTER:
1447c478bd9Sstevel@tonic-gate 		cardservices = rcs->cardservices;
1457c478bd9Sstevel@tonic-gate 		do_cs_call = 1;
1467c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
147*3df2e8b2SRobert Mustacchi 		if (cs_stubs_debug > 2)
148*3df2e8b2SRobert Mustacchi 			cmn_err(CE_CONT, "csx_register_cardservices: "
149*3df2e8b2SRobert Mustacchi 			    "CS_ENTRY_REGISTER\n");
1507c478bd9Sstevel@tonic-gate #endif
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate 		return (CS_SUCCESS);
1537c478bd9Sstevel@tonic-gate 
1547c478bd9Sstevel@tonic-gate 	    case CS_ENTRY_DEREGISTER:
1557c478bd9Sstevel@tonic-gate 		do_cs_call = 0;
156ebf37352SToomas Soome 		cardservices = cs_no_carservices;
1577c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
158*3df2e8b2SRobert Mustacchi 		if (cs_stubs_debug > 2)
159*3df2e8b2SRobert Mustacchi 			cmn_err(CE_CONT, "csx_register_cardservices: "
160*3df2e8b2SRobert Mustacchi 			    "CS_ENTRY_DEREGISTER\n");
1617c478bd9Sstevel@tonic-gate #endif
1627c478bd9Sstevel@tonic-gate 		return (CS_UNSUPPORTED_FUNCTION);
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate 	    case CS_ENTRY_INQUIRE:
1657c478bd9Sstevel@tonic-gate 		rcs->cardservices = cardservices;
1667c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
167*3df2e8b2SRobert Mustacchi 		if (cs_stubs_debug > 2)
168*3df2e8b2SRobert Mustacchi 			cmn_err(CE_CONT, "csx_register_cardservices: "
169*3df2e8b2SRobert Mustacchi 			    "CS_ENTRY_INQUIRE\n");
1707c478bd9Sstevel@tonic-gate #endif
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate 		if (do_cs_call)
1737c478bd9Sstevel@tonic-gate 		    return (CS_SUCCESS);
1747c478bd9Sstevel@tonic-gate 		else
1757c478bd9Sstevel@tonic-gate 		    return (CS_BAD_HANDLE);
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate 	    default:
1787c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
179*3df2e8b2SRobert Mustacchi 		if (cs_stubs_debug > 2)
180*3df2e8b2SRobert Mustacchi 			cmn_err(CE_CONT, "csx_register_cardservices: "
181*3df2e8b2SRobert Mustacchi 			    "(unknown function)\n");
1827c478bd9Sstevel@tonic-gate #endif
1837c478bd9Sstevel@tonic-gate 		return (CS_UNSUPPORTED_FUNCTION);
1847c478bd9Sstevel@tonic-gate 	}
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate }
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate int32_t
csx_RegisterClient(client_handle_t * ch,client_reg_t * cr)1897c478bd9Sstevel@tonic-gate csx_RegisterClient(client_handle_t *ch, client_reg_t *cr)
1907c478bd9Sstevel@tonic-gate {
1917c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
1927c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
1937c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RegisterClient: (no handle yet)\n");
1947c478bd9Sstevel@tonic-gate #endif
1957c478bd9Sstevel@tonic-gate 	return (CardServices(RegisterClient, ch, cr));
1967c478bd9Sstevel@tonic-gate }
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate int32_t
csx_DeregisterClient(client_handle_t ch)1997c478bd9Sstevel@tonic-gate csx_DeregisterClient(client_handle_t ch)
2007c478bd9Sstevel@tonic-gate {
2017c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2027c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2037c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_DeregisterClient: handle: 0x%x\n", ch);
2047c478bd9Sstevel@tonic-gate #endif
2057c478bd9Sstevel@tonic-gate 	return (CardServices(DeregisterClient, ch));
2067c478bd9Sstevel@tonic-gate }
2077c478bd9Sstevel@tonic-gate 
2087c478bd9Sstevel@tonic-gate int32_t
csx_GetStatus(client_handle_t ch,get_status_t * gs)2097c478bd9Sstevel@tonic-gate csx_GetStatus(client_handle_t ch, get_status_t *gs)
2107c478bd9Sstevel@tonic-gate {
2117c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2127c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2137c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetStatus: handle: 0x%x\n", ch);
2147c478bd9Sstevel@tonic-gate #endif
2157c478bd9Sstevel@tonic-gate 	return (CardServices(GetStatus, ch, gs));
2167c478bd9Sstevel@tonic-gate }
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate int32_t
csx_SetEventMask(client_handle_t ch,sockevent_t * se)2197c478bd9Sstevel@tonic-gate csx_SetEventMask(client_handle_t ch, sockevent_t *se)
2207c478bd9Sstevel@tonic-gate {
2217c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2227c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2237c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_SetEventMask: handle: 0x%x\n", ch);
2247c478bd9Sstevel@tonic-gate #endif
2257c478bd9Sstevel@tonic-gate 	return (CardServices(SetEventMask, ch, se));
2267c478bd9Sstevel@tonic-gate }
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate int32_t
csx_GetEventMask(client_handle_t ch,sockevent_t * se)2297c478bd9Sstevel@tonic-gate csx_GetEventMask(client_handle_t ch, sockevent_t *se)
2307c478bd9Sstevel@tonic-gate {
2317c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2327c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2337c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetEventMask: handle: 0x%x\n", ch);
2347c478bd9Sstevel@tonic-gate #endif
2357c478bd9Sstevel@tonic-gate 	return (CardServices(GetEventMask, ch, se));
2367c478bd9Sstevel@tonic-gate }
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate int32_t
csx_RequestIO(client_handle_t ch,io_req_t * ior)2397c478bd9Sstevel@tonic-gate csx_RequestIO(client_handle_t ch, io_req_t *ior)
2407c478bd9Sstevel@tonic-gate {
2417c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2427c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2437c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RequestIO: handle: 0x%x\n", ch);
2447c478bd9Sstevel@tonic-gate #endif
2457c478bd9Sstevel@tonic-gate 	return (CardServices(RequestIO, ch, ior));
2467c478bd9Sstevel@tonic-gate }
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate int32_t
csx_ReleaseIO(client_handle_t ch,io_req_t * ior)2497c478bd9Sstevel@tonic-gate csx_ReleaseIO(client_handle_t ch, io_req_t *ior)
2507c478bd9Sstevel@tonic-gate {
2517c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2527c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2537c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ReleaseIO: handle: 0x%x\n", ch);
2547c478bd9Sstevel@tonic-gate #endif
2557c478bd9Sstevel@tonic-gate 	return (CardServices(ReleaseIO, ch, ior));
2567c478bd9Sstevel@tonic-gate }
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate int32_t
csx_RequestIRQ(client_handle_t ch,irq_req_t * irqr)2597c478bd9Sstevel@tonic-gate csx_RequestIRQ(client_handle_t ch, irq_req_t *irqr)
2607c478bd9Sstevel@tonic-gate {
2617c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2627c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2637c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RequestIRQ: handle: 0x%x\n", ch);
2647c478bd9Sstevel@tonic-gate #endif
2657c478bd9Sstevel@tonic-gate 	return (CardServices(RequestIRQ, ch, irqr));
2667c478bd9Sstevel@tonic-gate }
2677c478bd9Sstevel@tonic-gate 
2687c478bd9Sstevel@tonic-gate int32_t
csx_ReleaseIRQ(client_handle_t ch,irq_req_t * irqr)2697c478bd9Sstevel@tonic-gate csx_ReleaseIRQ(client_handle_t ch, irq_req_t *irqr)
2707c478bd9Sstevel@tonic-gate {
2717c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2727c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2737c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ReleaseIRQ: handle: 0x%x\n", ch);
2747c478bd9Sstevel@tonic-gate #endif
2757c478bd9Sstevel@tonic-gate 	return (CardServices(ReleaseIRQ, ch, irqr));
2767c478bd9Sstevel@tonic-gate }
2777c478bd9Sstevel@tonic-gate 
2787c478bd9Sstevel@tonic-gate int32_t
csx_RequestWindow(client_handle_t ch,window_handle_t * wh,win_req_t * wr)2797c478bd9Sstevel@tonic-gate csx_RequestWindow(client_handle_t ch, window_handle_t *wh, win_req_t *wr)
2807c478bd9Sstevel@tonic-gate {
2817c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2827c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2837c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RequestWindow: handle: 0x%x\n", ch);
2847c478bd9Sstevel@tonic-gate #endif
2857c478bd9Sstevel@tonic-gate 	return (CardServices(RequestWindow, ch, wh, wr));
2867c478bd9Sstevel@tonic-gate }
2877c478bd9Sstevel@tonic-gate 
2887c478bd9Sstevel@tonic-gate int32_t
csx_ReleaseWindow(window_handle_t wh)2897c478bd9Sstevel@tonic-gate csx_ReleaseWindow(window_handle_t wh)
2907c478bd9Sstevel@tonic-gate {
2917c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
2927c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
2937c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ReleaseWindow: handle: 0x%x\n", wh);
2947c478bd9Sstevel@tonic-gate #endif
2957c478bd9Sstevel@tonic-gate 	return (CardServices(ReleaseWindow, wh));
2967c478bd9Sstevel@tonic-gate }
2977c478bd9Sstevel@tonic-gate 
2987c478bd9Sstevel@tonic-gate int32_t
csx_ModifyWindow(window_handle_t wh,modify_win_t * mw)2997c478bd9Sstevel@tonic-gate csx_ModifyWindow(window_handle_t wh, modify_win_t *mw)
3007c478bd9Sstevel@tonic-gate {
3017c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3027c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3037c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ModifyWindow: handle: 0x%x\n", wh);
3047c478bd9Sstevel@tonic-gate #endif
3057c478bd9Sstevel@tonic-gate 	return (CardServices(ModifyWindow, wh, mw));
3067c478bd9Sstevel@tonic-gate }
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate int32_t
csx_MapMemPage(window_handle_t wh,map_mem_page_t * mmp)3097c478bd9Sstevel@tonic-gate csx_MapMemPage(window_handle_t wh, map_mem_page_t *mmp)
3107c478bd9Sstevel@tonic-gate {
3117c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3127c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3137c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_MapMemPage: handle: 0x%x\n", wh);
3147c478bd9Sstevel@tonic-gate #endif
3157c478bd9Sstevel@tonic-gate 	return (CardServices(MapMemPage, wh, mmp));
3167c478bd9Sstevel@tonic-gate }
3177c478bd9Sstevel@tonic-gate 
3187c478bd9Sstevel@tonic-gate int32_t
csx_RequestSocketMask(client_handle_t ch,request_socket_mask_t * sm)3197c478bd9Sstevel@tonic-gate csx_RequestSocketMask(client_handle_t ch, request_socket_mask_t *sm)
3207c478bd9Sstevel@tonic-gate {
3217c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3227c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3237c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RequestSocketMask: handle: 0x%x\n", ch);
3247c478bd9Sstevel@tonic-gate #endif
3257c478bd9Sstevel@tonic-gate 	return (CardServices(RequestSocketMask, ch, sm));
3267c478bd9Sstevel@tonic-gate }
3277c478bd9Sstevel@tonic-gate 
3287c478bd9Sstevel@tonic-gate int32_t
csx_ReleaseSocketMask(client_handle_t ch,release_socket_mask_t * rsm)3297c478bd9Sstevel@tonic-gate csx_ReleaseSocketMask(client_handle_t ch, release_socket_mask_t *rsm)
3307c478bd9Sstevel@tonic-gate {
3317c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3327c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3337c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ReleaseSocketMask: handle: 0x%x\n", ch);
3347c478bd9Sstevel@tonic-gate #endif
3357c478bd9Sstevel@tonic-gate 	return (CardServices(ReleaseSocketMask, ch, rsm));
3367c478bd9Sstevel@tonic-gate }
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate int32_t
csx_RequestConfiguration(client_handle_t ch,config_req_t * cr)3397c478bd9Sstevel@tonic-gate csx_RequestConfiguration(client_handle_t ch, config_req_t *cr)
3407c478bd9Sstevel@tonic-gate {
3417c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3427c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3437c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RequestConfiguration: handle: 0x%x\n", ch);
3447c478bd9Sstevel@tonic-gate #endif
3457c478bd9Sstevel@tonic-gate 	return (CardServices(RequestConfiguration, ch, cr));
3467c478bd9Sstevel@tonic-gate }
3477c478bd9Sstevel@tonic-gate 
3487c478bd9Sstevel@tonic-gate int32_t
csx_ModifyConfiguration(client_handle_t ch,modify_config_t * mc)3497c478bd9Sstevel@tonic-gate csx_ModifyConfiguration(client_handle_t ch, modify_config_t *mc)
3507c478bd9Sstevel@tonic-gate {
3517c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3527c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3537c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ModifyConfiguration: handle: 0x%x\n", ch);
3547c478bd9Sstevel@tonic-gate #endif
3557c478bd9Sstevel@tonic-gate 	return (CardServices(ModifyConfiguration, ch, mc));
3567c478bd9Sstevel@tonic-gate }
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate int32_t
csx_ReleaseConfiguration(client_handle_t ch,release_config_t * rc)3597c478bd9Sstevel@tonic-gate csx_ReleaseConfiguration(client_handle_t ch, release_config_t *rc)
3607c478bd9Sstevel@tonic-gate {
3617c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3627c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3637c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ReleaseConfiguration: handle: 0x%x\n", ch);
3647c478bd9Sstevel@tonic-gate #endif
3657c478bd9Sstevel@tonic-gate 	return (CardServices(ReleaseConfiguration, ch, rc));
3667c478bd9Sstevel@tonic-gate }
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate int32_t
csx_AccessConfigurationRegister(client_handle_t ch,access_config_reg_t * acr)3697c478bd9Sstevel@tonic-gate csx_AccessConfigurationRegister(client_handle_t ch, access_config_reg_t *acr)
3707c478bd9Sstevel@tonic-gate {
3717c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3727c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3737c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT,
3747c478bd9Sstevel@tonic-gate 		"csx_AccessConfigurationRegister: handle: 0x%x\n", ch);
3757c478bd9Sstevel@tonic-gate #endif
3767c478bd9Sstevel@tonic-gate 	return (CardServices(AccessConfigurationRegister, ch, acr));
3777c478bd9Sstevel@tonic-gate }
3787c478bd9Sstevel@tonic-gate 
3797c478bd9Sstevel@tonic-gate int32_t
csx_GetFirstTuple(client_handle_t ch,tuple_t * tp)3807c478bd9Sstevel@tonic-gate csx_GetFirstTuple(client_handle_t ch, tuple_t *tp)
3817c478bd9Sstevel@tonic-gate {
3827c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3837c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3847c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetFirstTuple: handle: 0x%x\n", ch);
3857c478bd9Sstevel@tonic-gate #endif
3867c478bd9Sstevel@tonic-gate 	return (CardServices(GetFirstTuple, ch, tp));
3877c478bd9Sstevel@tonic-gate }
3887c478bd9Sstevel@tonic-gate 
3897c478bd9Sstevel@tonic-gate int32_t
csx_GetNextTuple(client_handle_t ch,tuple_t * tp)3907c478bd9Sstevel@tonic-gate csx_GetNextTuple(client_handle_t ch, tuple_t *tp)
3917c478bd9Sstevel@tonic-gate {
3927c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
3937c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
3947c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetNextTuple: handle: 0x%x\n", ch);
3957c478bd9Sstevel@tonic-gate #endif
3967c478bd9Sstevel@tonic-gate 	return (CardServices(GetNextTuple, ch, tp));
3977c478bd9Sstevel@tonic-gate }
3987c478bd9Sstevel@tonic-gate 
3997c478bd9Sstevel@tonic-gate int32_t
csx_GetTupleData(client_handle_t ch,tuple_t * tp)4007c478bd9Sstevel@tonic-gate csx_GetTupleData(client_handle_t ch, tuple_t *tp)
4017c478bd9Sstevel@tonic-gate {
4027c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4037c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4047c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetTupleData: handle: 0x%x\n", ch);
4057c478bd9Sstevel@tonic-gate #endif
4067c478bd9Sstevel@tonic-gate 	return (CardServices(GetTupleData, ch, tp));
4077c478bd9Sstevel@tonic-gate }
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate int32_t
csx_MapLogSocket(client_handle_t ch,map_log_socket_t * mls)4107c478bd9Sstevel@tonic-gate csx_MapLogSocket(client_handle_t ch, map_log_socket_t *mls)
4117c478bd9Sstevel@tonic-gate {
4127c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4137c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4147c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_MapLogSocket: handle: 0x%x\n", ch);
4157c478bd9Sstevel@tonic-gate #endif
4167c478bd9Sstevel@tonic-gate 	return (CardServices(MapLogSocket, ch, mls));
4177c478bd9Sstevel@tonic-gate }
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate int32_t
csx_ValidateCIS(client_handle_t ch,cisinfo_t * ci)4207c478bd9Sstevel@tonic-gate csx_ValidateCIS(client_handle_t ch, cisinfo_t *ci)
4217c478bd9Sstevel@tonic-gate {
4227c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4237c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4247c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ValidateCIS: handle: 0x%x\n", ch);
4257c478bd9Sstevel@tonic-gate #endif
4267c478bd9Sstevel@tonic-gate 	return (CardServices(ValidateCIS, ch, ci));
4277c478bd9Sstevel@tonic-gate }
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate int32_t
csx_MakeDeviceNode(client_handle_t ch,make_device_node_t * mdn)4307c478bd9Sstevel@tonic-gate csx_MakeDeviceNode(client_handle_t ch, make_device_node_t *mdn)
4317c478bd9Sstevel@tonic-gate {
4327c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4337c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4347c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_MakeDeviceNode: handle: 0x%x\n", ch);
4357c478bd9Sstevel@tonic-gate #endif
4367c478bd9Sstevel@tonic-gate 	return (CardServices(MakeDeviceNode, ch, mdn));
4377c478bd9Sstevel@tonic-gate }
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate int32_t
csx_RemoveDeviceNode(client_handle_t ch,remove_device_node_t * rdn)4407c478bd9Sstevel@tonic-gate csx_RemoveDeviceNode(client_handle_t ch, remove_device_node_t *rdn)
4417c478bd9Sstevel@tonic-gate {
4427c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4437c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4447c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_RemoveDeviceNode: handle: 0x%x\n", ch);
4457c478bd9Sstevel@tonic-gate #endif
4467c478bd9Sstevel@tonic-gate 	return (CardServices(RemoveDeviceNode, ch, rdn));
4477c478bd9Sstevel@tonic-gate }
4487c478bd9Sstevel@tonic-gate 
4497c478bd9Sstevel@tonic-gate int32_t
csx_ConvertSpeed(convert_speed_t * cp)4507c478bd9Sstevel@tonic-gate csx_ConvertSpeed(convert_speed_t *cp)
4517c478bd9Sstevel@tonic-gate {
4527c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4537c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4547c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ConvertSpeed\n");
4557c478bd9Sstevel@tonic-gate #endif
4567c478bd9Sstevel@tonic-gate 	return (CardServices(ConvertSpeed, cp));
4577c478bd9Sstevel@tonic-gate }
4587c478bd9Sstevel@tonic-gate 
4597c478bd9Sstevel@tonic-gate int32_t
csx_ConvertSize(convert_size_t * cp)4607c478bd9Sstevel@tonic-gate csx_ConvertSize(convert_size_t *cp)
4617c478bd9Sstevel@tonic-gate {
4627c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4637c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4647c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ConvertSize\n");
4657c478bd9Sstevel@tonic-gate #endif
4667c478bd9Sstevel@tonic-gate 	return (CardServices(ConvertSize, cp));
4677c478bd9Sstevel@tonic-gate }
4687c478bd9Sstevel@tonic-gate 
4697c478bd9Sstevel@tonic-gate int32_t
csx_Event2Text(event2text_t * e2t)4707c478bd9Sstevel@tonic-gate csx_Event2Text(event2text_t *e2t)
4717c478bd9Sstevel@tonic-gate {
4727c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4737c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4747c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Event2Text\n");
4757c478bd9Sstevel@tonic-gate #endif
4767c478bd9Sstevel@tonic-gate 	return (CardServices(Event2Text, e2t));
4777c478bd9Sstevel@tonic-gate }
4787c478bd9Sstevel@tonic-gate 
4797c478bd9Sstevel@tonic-gate int32_t
csx_Error2Text(error2text_t * e2t)4807c478bd9Sstevel@tonic-gate csx_Error2Text(error2text_t *e2t)
4817c478bd9Sstevel@tonic-gate {
4827c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4837c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4847c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Error2Text\n");
4857c478bd9Sstevel@tonic-gate #endif
4867c478bd9Sstevel@tonic-gate 	return (CardServices(Error2Text, e2t));
4877c478bd9Sstevel@tonic-gate }
4887c478bd9Sstevel@tonic-gate 
4897c478bd9Sstevel@tonic-gate int32_t
csx_CS_DDI_Info(cs_ddi_info_t * cp)4907c478bd9Sstevel@tonic-gate csx_CS_DDI_Info(cs_ddi_info_t *cp)
4917c478bd9Sstevel@tonic-gate {
4927c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
4937c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
4947c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_CS_DDI_Info\n");
4957c478bd9Sstevel@tonic-gate #endif
4967c478bd9Sstevel@tonic-gate 	return (CardServices(CS_DDI_Info, cp));
4977c478bd9Sstevel@tonic-gate }
4987c478bd9Sstevel@tonic-gate 
4997c478bd9Sstevel@tonic-gate int32_t
csx_CS_Sys_Ctl(cs_sys_ctl_t * csc)5007c478bd9Sstevel@tonic-gate csx_CS_Sys_Ctl(cs_sys_ctl_t *csc)
5017c478bd9Sstevel@tonic-gate {
5027c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5037c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5047c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_CS_Sys_Ctl\n");
5057c478bd9Sstevel@tonic-gate #endif
5067c478bd9Sstevel@tonic-gate 	return (CardServices(CS_Sys_Ctl, csc));
5077c478bd9Sstevel@tonic-gate }
5087c478bd9Sstevel@tonic-gate 
5097c478bd9Sstevel@tonic-gate int32_t
csx_GetClientInfo(client_handle_t ch,client_info_t * ci)5107c478bd9Sstevel@tonic-gate csx_GetClientInfo(client_handle_t ch, client_info_t *ci)
5117c478bd9Sstevel@tonic-gate {
5127c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5137c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5147c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetClientInfo: handle: 0x%x\n", ch);
5157c478bd9Sstevel@tonic-gate #endif
5167c478bd9Sstevel@tonic-gate 
5177c478bd9Sstevel@tonic-gate 	return (CardServices(GetClientInfo, ch, ci));
5187c478bd9Sstevel@tonic-gate }
5197c478bd9Sstevel@tonic-gate 
5207c478bd9Sstevel@tonic-gate int32_t
csx_GetFirstClient(get_firstnext_client_t * fnc)5217c478bd9Sstevel@tonic-gate csx_GetFirstClient(get_firstnext_client_t *fnc)
5227c478bd9Sstevel@tonic-gate {
5237c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5247c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5257c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetFirstClient\n");
5267c478bd9Sstevel@tonic-gate #endif
5277c478bd9Sstevel@tonic-gate 
5287c478bd9Sstevel@tonic-gate 	return (CardServices(GetFirstClient, fnc));
5297c478bd9Sstevel@tonic-gate }
5307c478bd9Sstevel@tonic-gate 
5317c478bd9Sstevel@tonic-gate int32_t
csx_GetNextClient(get_firstnext_client_t * fnc)5327c478bd9Sstevel@tonic-gate csx_GetNextClient(get_firstnext_client_t *fnc)
5337c478bd9Sstevel@tonic-gate {
5347c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5357c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5367c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetNextClient\n");
5377c478bd9Sstevel@tonic-gate #endif
5387c478bd9Sstevel@tonic-gate 
5397c478bd9Sstevel@tonic-gate 	return (CardServices(GetNextClient, fnc));
5407c478bd9Sstevel@tonic-gate }
5417c478bd9Sstevel@tonic-gate 
5427c478bd9Sstevel@tonic-gate int32_t
csx_ResetFunction(client_handle_t ch,reset_function_t * rf)5437c478bd9Sstevel@tonic-gate csx_ResetFunction(client_handle_t ch, reset_function_t *rf)
5447c478bd9Sstevel@tonic-gate {
5457c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5467c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5477c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ResetFunction: handle: 0x%x\n", ch);
5487c478bd9Sstevel@tonic-gate #endif
5497c478bd9Sstevel@tonic-gate 
5507c478bd9Sstevel@tonic-gate 	return (CardServices(ResetFunction, ch, rf));
5517c478bd9Sstevel@tonic-gate }
5527c478bd9Sstevel@tonic-gate 
5537c478bd9Sstevel@tonic-gate int32_t
csx_GetCardServicesInfo(client_handle_t ch,get_cardservices_info_t * gcsi)5547c478bd9Sstevel@tonic-gate csx_GetCardServicesInfo(client_handle_t ch, get_cardservices_info_t *gcsi)
5557c478bd9Sstevel@tonic-gate {
5567c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5577c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5587c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetCardServicesInfo: handle: 0x%x\n", ch);
5597c478bd9Sstevel@tonic-gate #endif
5607c478bd9Sstevel@tonic-gate 
5617c478bd9Sstevel@tonic-gate 	return (CardServices(GetCardServicesInfo, ch, gcsi));
5627c478bd9Sstevel@tonic-gate }
5637c478bd9Sstevel@tonic-gate 
5647c478bd9Sstevel@tonic-gate int32_t
csx_GetConfigurationInfo(client_handle_t * ch,get_configuration_info_t * gci)5657c478bd9Sstevel@tonic-gate csx_GetConfigurationInfo(client_handle_t *ch, get_configuration_info_t *gci)
5667c478bd9Sstevel@tonic-gate {
5677c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5687c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5697c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetConfigurationInfo: "
5707c478bd9Sstevel@tonic-gate 		"handle: (no handle yet)\n");
5717c478bd9Sstevel@tonic-gate #endif
5727c478bd9Sstevel@tonic-gate 
5737c478bd9Sstevel@tonic-gate 	return (CardServices(GetConfigurationInfo, ch, gci));
5747c478bd9Sstevel@tonic-gate }
5757c478bd9Sstevel@tonic-gate 
5767c478bd9Sstevel@tonic-gate int32_t
csx_GetPhysicalAdapterInfo(client_handle_t ch,get_physical_adapter_info_t * gp)5777c478bd9Sstevel@tonic-gate csx_GetPhysicalAdapterInfo(client_handle_t ch, get_physical_adapter_info_t *gp)
5787c478bd9Sstevel@tonic-gate {
5797c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5807c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5817c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetPhysicalAdapterInfo: handle: 0x%x\n", ch);
5827c478bd9Sstevel@tonic-gate #endif
5837c478bd9Sstevel@tonic-gate 
5847c478bd9Sstevel@tonic-gate 	return (CardServices(GetPhysicalAdapterInfo, ch, gp));
5857c478bd9Sstevel@tonic-gate }
5867c478bd9Sstevel@tonic-gate 
5877c478bd9Sstevel@tonic-gate /*
5887c478bd9Sstevel@tonic-gate  * CIS tuple parsing functions - one entrypoint per tuple that we know
5897c478bd9Sstevel@tonic-gate  *	how to parse
5907c478bd9Sstevel@tonic-gate  */
5917c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_CONFIG(client_handle_t ch,tuple_t * tp,cistpl_config_t * pt)5927c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_CONFIG(client_handle_t ch, tuple_t *tp, cistpl_config_t *pt)
5937c478bd9Sstevel@tonic-gate {
5947c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
5957c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
5967c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_CONFIG: handle: 0x%x\n", ch);
5977c478bd9Sstevel@tonic-gate #endif
5987c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_CONFIG;
5997c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6007c478bd9Sstevel@tonic-gate }
6017c478bd9Sstevel@tonic-gate 
6027c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICE(client_handle_t ch,tuple_t * tp,cistpl_device_t * pt)6037c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
6047c478bd9Sstevel@tonic-gate {
6057c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6067c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6077c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE: handle: 0x%x\n", ch);
6087c478bd9Sstevel@tonic-gate #endif
6097c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICE;
6107c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6117c478bd9Sstevel@tonic-gate }
6127c478bd9Sstevel@tonic-gate 
6137c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICE_A(client_handle_t ch,tuple_t * tp,cistpl_device_t * pt)6147c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_A(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
6157c478bd9Sstevel@tonic-gate {
6167c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6177c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6187c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_A: handle: 0x%x\n", ch);
6197c478bd9Sstevel@tonic-gate #endif
6207c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICE_A;
6217c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6227c478bd9Sstevel@tonic-gate }
6237c478bd9Sstevel@tonic-gate 
6247c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICE_OA(client_handle_t ch,tuple_t * tp,cistpl_device_t * pt)6257c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_OA(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
6267c478bd9Sstevel@tonic-gate {
6277c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6287c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6297c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OA: handle: 0x%x\n", ch);
6307c478bd9Sstevel@tonic-gate #endif
6317c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICE_OA;
6327c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6337c478bd9Sstevel@tonic-gate }
6347c478bd9Sstevel@tonic-gate 
6357c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICE_OC(client_handle_t ch,tuple_t * tp,cistpl_device_t * pt)6367c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_OC(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt)
6377c478bd9Sstevel@tonic-gate {
6387c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6397c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6407c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OC: handle: 0x%x\n", ch);
6417c478bd9Sstevel@tonic-gate #endif
6427c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICE_OC;
6437c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6447c478bd9Sstevel@tonic-gate }
6457c478bd9Sstevel@tonic-gate 
6467c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_VERS_1(client_handle_t ch,tuple_t * tp,cistpl_vers_1_t * pt)6477c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_VERS_1(client_handle_t ch, tuple_t *tp, cistpl_vers_1_t *pt)
6487c478bd9Sstevel@tonic-gate {
6497c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6507c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6517c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_1: handle: 0x%x\n", ch);
6527c478bd9Sstevel@tonic-gate #endif
6537c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_VERS_1;
6547c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6557c478bd9Sstevel@tonic-gate }
6567c478bd9Sstevel@tonic-gate 
6577c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_VERS_2(client_handle_t ch,tuple_t * tp,cistpl_vers_2_t * pt)6587c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_VERS_2(client_handle_t ch, tuple_t *tp, cistpl_vers_2_t *pt)
6597c478bd9Sstevel@tonic-gate {
6607c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6617c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6627c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_2: handle: 0x%x\n", ch);
6637c478bd9Sstevel@tonic-gate #endif
6647c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_VERS_2;
6657c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6667c478bd9Sstevel@tonic-gate }
6677c478bd9Sstevel@tonic-gate 
6687c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_JEDEC_A(client_handle_t ch,tuple_t * tp,cistpl_jedec_t * pt)6697c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_JEDEC_A(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt)
6707c478bd9Sstevel@tonic-gate {
6717c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6727c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6737c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_A: handle: 0x%x\n", ch);
6747c478bd9Sstevel@tonic-gate #endif
6757c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_JEDEC_A;
6767c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6777c478bd9Sstevel@tonic-gate }
6787c478bd9Sstevel@tonic-gate 
6797c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_JEDEC_C(client_handle_t ch,tuple_t * tp,cistpl_jedec_t * pt)6807c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_JEDEC_C(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt)
6817c478bd9Sstevel@tonic-gate {
6827c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6837c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6847c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_C: handle: 0x%x\n", ch);
6857c478bd9Sstevel@tonic-gate #endif
6867c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_JEDEC_C;
6877c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6887c478bd9Sstevel@tonic-gate }
6897c478bd9Sstevel@tonic-gate 
6907c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_FORMAT(client_handle_t ch,tuple_t * tp,cistpl_format_t * pt)6917c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FORMAT(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt)
6927c478bd9Sstevel@tonic-gate {
6937c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
6947c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
6957c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT: handle: 0x%x\n", ch);
6967c478bd9Sstevel@tonic-gate #endif
6977c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_FORMAT;
6987c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
6997c478bd9Sstevel@tonic-gate }
7007c478bd9Sstevel@tonic-gate 
7017c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_FORMAT_A(client_handle_t ch,tuple_t * tp,cistpl_format_t * pt)7027c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FORMAT_A(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt)
7037c478bd9Sstevel@tonic-gate {
7047c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7057c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7067c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT_A: handle: 0x%x\n", ch);
7077c478bd9Sstevel@tonic-gate #endif
7087c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_FORMAT_A;
7097c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7107c478bd9Sstevel@tonic-gate }
7117c478bd9Sstevel@tonic-gate 
7127c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_GEOMETRY(client_handle_t ch,tuple_t * tp,cistpl_geometry_t * pt)7137c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_GEOMETRY(client_handle_t ch, tuple_t *tp,
7147c478bd9Sstevel@tonic-gate     cistpl_geometry_t *pt)
7157c478bd9Sstevel@tonic-gate {
7167c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7177c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7187c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_GEOMETRY: handle: 0x%x\n", ch);
7197c478bd9Sstevel@tonic-gate #endif
7207c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_GEOMETRY;
7217c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7227c478bd9Sstevel@tonic-gate }
7237c478bd9Sstevel@tonic-gate 
7247c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_BYTEORDER(client_handle_t ch,tuple_t * tp,cistpl_byteorder_t * pt)7257c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_BYTEORDER(client_handle_t ch, tuple_t *tp,
7267c478bd9Sstevel@tonic-gate     cistpl_byteorder_t *pt)
7277c478bd9Sstevel@tonic-gate {
7287c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7297c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7307c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BYTEORDER: handle: 0x%x\n", ch);
7317c478bd9Sstevel@tonic-gate #endif
7327c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_BYTEORDER;
7337c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7347c478bd9Sstevel@tonic-gate }
7357c478bd9Sstevel@tonic-gate 
7367c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DATE(client_handle_t ch,tuple_t * tp,cistpl_date_t * pt)7377c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DATE(client_handle_t ch, tuple_t *tp, cistpl_date_t *pt)
7387c478bd9Sstevel@tonic-gate {
7397c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7407c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7417c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DATE: handle: 0x%x\n", ch);
7427c478bd9Sstevel@tonic-gate #endif
7437c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DATE;
7447c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7457c478bd9Sstevel@tonic-gate }
7467c478bd9Sstevel@tonic-gate 
7477c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_BATTERY(client_handle_t ch,tuple_t * tp,cistpl_battery_t * pt)7487c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_BATTERY(client_handle_t ch, tuple_t *tp, cistpl_battery_t *pt)
7497c478bd9Sstevel@tonic-gate {
7507c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7517c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7527c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BATTERY: handle: 0x%x\n", ch);
7537c478bd9Sstevel@tonic-gate #endif
7547c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_BATTERY;
7557c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7567c478bd9Sstevel@tonic-gate }
7577c478bd9Sstevel@tonic-gate 
7587c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_ORG(client_handle_t ch,tuple_t * tp,cistpl_org_t * pt)7597c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_ORG(client_handle_t ch, tuple_t *tp, cistpl_org_t *pt)
7607c478bd9Sstevel@tonic-gate {
7617c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7627c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7637c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_ORG: handle: 0x%x\n", ch);
7647c478bd9Sstevel@tonic-gate #endif
7657c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_ORG;
7667c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7677c478bd9Sstevel@tonic-gate }
7687c478bd9Sstevel@tonic-gate 
7697c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_MANFID(client_handle_t ch,tuple_t * tp,cistpl_manfid_t * pt)7707c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_MANFID(client_handle_t ch, tuple_t *tp, cistpl_manfid_t *pt)
7717c478bd9Sstevel@tonic-gate {
7727c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7737c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7747c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_MANFID: handle: 0x%x\n", ch);
7757c478bd9Sstevel@tonic-gate #endif
7767c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_MANFID;
7777c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7787c478bd9Sstevel@tonic-gate }
7797c478bd9Sstevel@tonic-gate 
7807c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_FUNCID(client_handle_t ch,tuple_t * tp,cistpl_funcid_t * pt)7817c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FUNCID(client_handle_t ch, tuple_t *tp, cistpl_funcid_t *pt)
7827c478bd9Sstevel@tonic-gate {
7837c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7847c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7857c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCID: handle: 0x%x\n", ch);
7867c478bd9Sstevel@tonic-gate #endif
7877c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_FUNCID;
7887c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
7897c478bd9Sstevel@tonic-gate }
7907c478bd9Sstevel@tonic-gate 
7917c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_FUNCE(client_handle_t ch,tuple_t * tp,cistpl_funce_t * pt,uint32_t function)7927c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FUNCE(client_handle_t ch, tuple_t *tp,
7937c478bd9Sstevel@tonic-gate     cistpl_funce_t *pt, uint32_t function)
7947c478bd9Sstevel@tonic-gate {
7957c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
7967c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
7977c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCE: handle: 0x%x\n", ch);
7987c478bd9Sstevel@tonic-gate #endif
7997c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_FUNCE;
8007c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt, function));
8017c478bd9Sstevel@tonic-gate }
8027c478bd9Sstevel@tonic-gate 
8037c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t ch,tuple_t * tp,cistpl_cftable_entry_t * pt)8047c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t ch, tuple_t *tp,
8057c478bd9Sstevel@tonic-gate     cistpl_cftable_entry_t *pt)
8067c478bd9Sstevel@tonic-gate {
8077c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8087c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8097c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT,
8107c478bd9Sstevel@tonic-gate 		"csx_Parse_CISTPL_CFTABLE_ENTRY: handle: 0x%x\n", ch);
8117c478bd9Sstevel@tonic-gate #endif
8127c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_CFTABLE_ENTRY;
8137c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8147c478bd9Sstevel@tonic-gate }
8157c478bd9Sstevel@tonic-gate 
8167c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_LINKTARGET(client_handle_t ch,tuple_t * tp,cistpl_linktarget_t * pt)8177c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LINKTARGET(client_handle_t ch, tuple_t *tp,
8187c478bd9Sstevel@tonic-gate     cistpl_linktarget_t *pt)
8197c478bd9Sstevel@tonic-gate {
8207c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8217c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8227c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LINKTARGET: handle: 0x%x\n", ch);
8237c478bd9Sstevel@tonic-gate #endif
8247c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_LINKTARGET;
8257c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8267c478bd9Sstevel@tonic-gate }
8277c478bd9Sstevel@tonic-gate 
8287c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_LONGLINK_A(client_handle_t ch,tuple_t * tp,cistpl_longlink_ac_t * pt)8297c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_A(client_handle_t ch, tuple_t *tp,
8307c478bd9Sstevel@tonic-gate     cistpl_longlink_ac_t *pt)
8317c478bd9Sstevel@tonic-gate {
8327c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8337c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8347c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_A: handle: 0x%x\n", ch);
8357c478bd9Sstevel@tonic-gate #endif
8367c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_LONGLINK_A;
8377c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8387c478bd9Sstevel@tonic-gate }
8397c478bd9Sstevel@tonic-gate 
8407c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_LONGLINK_C(client_handle_t ch,tuple_t * tp,cistpl_longlink_ac_t * pt)8417c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_C(client_handle_t ch, tuple_t *tp,
8427c478bd9Sstevel@tonic-gate     cistpl_longlink_ac_t *pt)
8437c478bd9Sstevel@tonic-gate {
8447c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8457c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8467c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_C: handle: 0x%x\n", ch);
8477c478bd9Sstevel@tonic-gate #endif
8487c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_LONGLINK_C;
8497c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8507c478bd9Sstevel@tonic-gate }
8517c478bd9Sstevel@tonic-gate 
8527c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t ch,tuple_t * tp,cistpl_longlink_mfc_t * pt)8537c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t ch, tuple_t *tp,
8547c478bd9Sstevel@tonic-gate     cistpl_longlink_mfc_t *pt)
8557c478bd9Sstevel@tonic-gate {
8567c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8577c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8587c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_MFC: "
8597c478bd9Sstevel@tonic-gate 						"handle: 0x%x\n", ch);
8607c478bd9Sstevel@tonic-gate #endif
8617c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_LONGLINK_MFC;
8627c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8637c478bd9Sstevel@tonic-gate }
8647c478bd9Sstevel@tonic-gate 
csx_Parse_CISTPL_LONGLINK_CB(client_handle_t ch,tuple_t * tp,cistpl_longlink_cb_t * pt)8657c478bd9Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_CB(client_handle_t ch, tuple_t *tp,
8667c478bd9Sstevel@tonic-gate     cistpl_longlink_cb_t *pt)
8677c478bd9Sstevel@tonic-gate {
8687c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8697c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8707c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_CB: "
8717c478bd9Sstevel@tonic-gate 						"handle: 0x%x\n", ch);
8727c478bd9Sstevel@tonic-gate #endif
8737c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_LONGLINK_CB;
8747c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8757c478bd9Sstevel@tonic-gate }
8767c478bd9Sstevel@tonic-gate 
8777c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_SPCL(client_handle_t ch,tuple_t * tp,cistpl_spcl_t * pt)8787c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_SPCL(client_handle_t ch, tuple_t *tp,
8797c478bd9Sstevel@tonic-gate     cistpl_spcl_t *pt)
8807c478bd9Sstevel@tonic-gate {
8817c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8827c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8837c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_SPCL: handle: 0x%x\n", ch);
8847c478bd9Sstevel@tonic-gate #endif
8857c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_SPCL;
8867c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8877c478bd9Sstevel@tonic-gate }
8887c478bd9Sstevel@tonic-gate 
8897c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_SWIL(client_handle_t ch,tuple_t * tp,cistpl_swil_t * pt)8907c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_SWIL(client_handle_t ch, tuple_t *tp,
8917c478bd9Sstevel@tonic-gate     cistpl_swil_t *pt)
8927c478bd9Sstevel@tonic-gate {
8937c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
8947c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
8957c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_SWIL: handle: 0x%x\n", ch);
8967c478bd9Sstevel@tonic-gate #endif
8977c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_SWIL;
8987c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
8997c478bd9Sstevel@tonic-gate }
9007c478bd9Sstevel@tonic-gate 
csx_Parse_CISTPL_BAR(client_handle_t ch,tuple_t * tp,cistpl_bar_t * pt)9017c478bd9Sstevel@tonic-gate int32_t csx_Parse_CISTPL_BAR(client_handle_t ch, tuple_t *tp,
9027c478bd9Sstevel@tonic-gate     cistpl_bar_t *pt)
9037c478bd9Sstevel@tonic-gate {
9047c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
9057c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
9067c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_BAR: handle: 0x%x\n", ch);
9077c478bd9Sstevel@tonic-gate #endif
9087c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_BAR;
9097c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
9107c478bd9Sstevel@tonic-gate }
9117c478bd9Sstevel@tonic-gate 
9127c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICEGEO(client_handle_t ch,tuple_t * tp,cistpl_devicegeo_t * pt)9137c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICEGEO(client_handle_t ch, tuple_t *tp,
9147c478bd9Sstevel@tonic-gate     cistpl_devicegeo_t *pt)
9157c478bd9Sstevel@tonic-gate {
9167c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
9177c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
9187c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO: handle: 0x%x\n", ch);
9197c478bd9Sstevel@tonic-gate #endif
9207c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICEGEO;
9217c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
9227c478bd9Sstevel@tonic-gate }
9237c478bd9Sstevel@tonic-gate 
9247c478bd9Sstevel@tonic-gate int32_t
csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t ch,tuple_t * tp,cistpl_devicegeo_t * pt)9257c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t ch, tuple_t *tp,
9267c478bd9Sstevel@tonic-gate     cistpl_devicegeo_t *pt)
9277c478bd9Sstevel@tonic-gate {
9287c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
9297c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
9307c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO_A: "
9317c478bd9Sstevel@tonic-gate 						"handle: 0x%x\n", ch);
9327c478bd9Sstevel@tonic-gate #endif
9337c478bd9Sstevel@tonic-gate 	tp->DesiredTuple = CISTPL_DEVICEGEO_A;
9347c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, pt));
9357c478bd9Sstevel@tonic-gate }
9367c478bd9Sstevel@tonic-gate 
9377c478bd9Sstevel@tonic-gate int32_t
csx_ParseTuple(client_handle_t ch,tuple_t * tp,cisparse_t * cp,uint32_t ef)9387c478bd9Sstevel@tonic-gate csx_ParseTuple(client_handle_t ch, tuple_t *tp, cisparse_t *cp, uint32_t ef)
9397c478bd9Sstevel@tonic-gate {
9407c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
9417c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
9427c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_ParseTuple: handle: 0x%x\n", ch);
9437c478bd9Sstevel@tonic-gate #endif
9447c478bd9Sstevel@tonic-gate 	return (CardServices(ParseTuple, ch, tp, cp, ef));
9457c478bd9Sstevel@tonic-gate }
9467c478bd9Sstevel@tonic-gate 
9477c478bd9Sstevel@tonic-gate /*
9487c478bd9Sstevel@tonic-gate  * The following functions are used to access various datatypes.
9497c478bd9Sstevel@tonic-gate  *	These functions are not specific to PCMCIA client drivers
9507c478bd9Sstevel@tonic-gate  *	and they don't depend on Card Services being present to
9517c478bd9Sstevel@tonic-gate  *	operate.
9527c478bd9Sstevel@tonic-gate  */
9537c478bd9Sstevel@tonic-gate void
csx_Put8(acc_handle_t handle,uint32_t offset,uint8_t value)9547c478bd9Sstevel@tonic-gate csx_Put8(acc_handle_t handle, uint32_t offset, uint8_t value)
9557c478bd9Sstevel@tonic-gate {
9567c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9577c478bd9Sstevel@tonic-gate 
9587c478bd9Sstevel@tonic-gate 	ddi_put8(handle, (uint8_t *)(hp->ah_addr + offset), value);
9597c478bd9Sstevel@tonic-gate }
9607c478bd9Sstevel@tonic-gate 
9617c478bd9Sstevel@tonic-gate void
csx_Put16(acc_handle_t handle,uint32_t offset,uint16_t value)9627c478bd9Sstevel@tonic-gate csx_Put16(acc_handle_t handle, uint32_t offset, uint16_t value)
9637c478bd9Sstevel@tonic-gate {
9647c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9657c478bd9Sstevel@tonic-gate 
9667c478bd9Sstevel@tonic-gate 	ddi_put16(handle, (uint16_t *)(hp->ah_addr + offset), value);
9677c478bd9Sstevel@tonic-gate }
9687c478bd9Sstevel@tonic-gate 
9697c478bd9Sstevel@tonic-gate void
csx_Put32(acc_handle_t handle,uint32_t offset,uint32_t value)9707c478bd9Sstevel@tonic-gate csx_Put32(acc_handle_t handle, uint32_t offset, uint32_t value)
9717c478bd9Sstevel@tonic-gate {
9727c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9737c478bd9Sstevel@tonic-gate 
9747c478bd9Sstevel@tonic-gate 	ddi_put32(handle, (uint32_t *)(hp->ah_addr + offset), value);
9757c478bd9Sstevel@tonic-gate }
9767c478bd9Sstevel@tonic-gate 
9777c478bd9Sstevel@tonic-gate void
csx_Put64(acc_handle_t handle,uint32_t offset,uint64_t value)9787c478bd9Sstevel@tonic-gate csx_Put64(acc_handle_t handle, uint32_t offset, uint64_t value)
9797c478bd9Sstevel@tonic-gate {
9807c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9817c478bd9Sstevel@tonic-gate 
9827c478bd9Sstevel@tonic-gate 	ddi_put64(handle, (uint64_t *)(hp->ah_addr + offset), value);
9837c478bd9Sstevel@tonic-gate }
9847c478bd9Sstevel@tonic-gate 
9857c478bd9Sstevel@tonic-gate uint8_t
csx_Get8(acc_handle_t handle,uint32_t offset)9867c478bd9Sstevel@tonic-gate csx_Get8(acc_handle_t handle, uint32_t offset)
9877c478bd9Sstevel@tonic-gate {
9887c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9897c478bd9Sstevel@tonic-gate 
9907c478bd9Sstevel@tonic-gate 	return (ddi_get8(handle, (uint8_t *)(hp->ah_addr + offset)));
9917c478bd9Sstevel@tonic-gate }
9927c478bd9Sstevel@tonic-gate 
9937c478bd9Sstevel@tonic-gate uint16_t
csx_Get16(acc_handle_t handle,uint32_t offset)9947c478bd9Sstevel@tonic-gate csx_Get16(acc_handle_t handle, uint32_t offset)
9957c478bd9Sstevel@tonic-gate {
9967c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
9977c478bd9Sstevel@tonic-gate 
9987c478bd9Sstevel@tonic-gate 	return (ddi_get16(handle, (uint16_t *)(hp->ah_addr + offset)));
9997c478bd9Sstevel@tonic-gate }
10007c478bd9Sstevel@tonic-gate 
10017c478bd9Sstevel@tonic-gate uint32_t
csx_Get32(acc_handle_t handle,uint32_t offset)10027c478bd9Sstevel@tonic-gate csx_Get32(acc_handle_t handle, uint32_t offset)
10037c478bd9Sstevel@tonic-gate {
10047c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10057c478bd9Sstevel@tonic-gate 
10067c478bd9Sstevel@tonic-gate 	return (ddi_get32(handle, (uint32_t *)(hp->ah_addr + offset)));
10077c478bd9Sstevel@tonic-gate }
10087c478bd9Sstevel@tonic-gate 
10097c478bd9Sstevel@tonic-gate uint64_t
csx_Get64(acc_handle_t handle,uint32_t offset)10107c478bd9Sstevel@tonic-gate csx_Get64(acc_handle_t handle, uint32_t offset)
10117c478bd9Sstevel@tonic-gate {
10127c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10137c478bd9Sstevel@tonic-gate 
10147c478bd9Sstevel@tonic-gate 	return (ddi_get64(handle, (uint64_t *)(hp->ah_addr + offset)));
10157c478bd9Sstevel@tonic-gate }
10167c478bd9Sstevel@tonic-gate 
10177c478bd9Sstevel@tonic-gate void
csx_RepPut8(acc_handle_t handle,uint8_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10187c478bd9Sstevel@tonic-gate csx_RepPut8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset,
10197c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10207c478bd9Sstevel@tonic-gate {
10217c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10227c478bd9Sstevel@tonic-gate 
10237c478bd9Sstevel@tonic-gate 	ddi_rep_put8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset),
10247c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10257c478bd9Sstevel@tonic-gate }
10267c478bd9Sstevel@tonic-gate 
10277c478bd9Sstevel@tonic-gate void
csx_RepPut16(acc_handle_t handle,uint16_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10287c478bd9Sstevel@tonic-gate csx_RepPut16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset,
10297c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10307c478bd9Sstevel@tonic-gate {
10317c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10327c478bd9Sstevel@tonic-gate 
10337c478bd9Sstevel@tonic-gate 	ddi_rep_put16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset),
10347c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10357c478bd9Sstevel@tonic-gate }
10367c478bd9Sstevel@tonic-gate 
10377c478bd9Sstevel@tonic-gate void
csx_RepPut32(acc_handle_t handle,uint32_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10387c478bd9Sstevel@tonic-gate csx_RepPut32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset,
10397c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10407c478bd9Sstevel@tonic-gate {
10417c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10427c478bd9Sstevel@tonic-gate 
10437c478bd9Sstevel@tonic-gate 	ddi_rep_put32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset),
10447c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10457c478bd9Sstevel@tonic-gate }
10467c478bd9Sstevel@tonic-gate 
10477c478bd9Sstevel@tonic-gate void
csx_RepPut64(acc_handle_t handle,uint64_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10487c478bd9Sstevel@tonic-gate csx_RepPut64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset,
10497c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10507c478bd9Sstevel@tonic-gate {
10517c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10527c478bd9Sstevel@tonic-gate 
10537c478bd9Sstevel@tonic-gate 	ddi_rep_put64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset),
10547c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10557c478bd9Sstevel@tonic-gate }
10567c478bd9Sstevel@tonic-gate 
10577c478bd9Sstevel@tonic-gate void
csx_RepGet8(acc_handle_t handle,uint8_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10587c478bd9Sstevel@tonic-gate csx_RepGet8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset,
10597c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10607c478bd9Sstevel@tonic-gate {
10617c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10627c478bd9Sstevel@tonic-gate 
10637c478bd9Sstevel@tonic-gate 	ddi_rep_get8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset),
10647c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10657c478bd9Sstevel@tonic-gate }
10667c478bd9Sstevel@tonic-gate 
10677c478bd9Sstevel@tonic-gate void
csx_RepGet16(acc_handle_t handle,uint16_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10687c478bd9Sstevel@tonic-gate csx_RepGet16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset,
10697c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10707c478bd9Sstevel@tonic-gate {
10717c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10727c478bd9Sstevel@tonic-gate 
10737c478bd9Sstevel@tonic-gate 	ddi_rep_get16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset),
10747c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10757c478bd9Sstevel@tonic-gate }
10767c478bd9Sstevel@tonic-gate 
10777c478bd9Sstevel@tonic-gate void
csx_RepGet32(acc_handle_t handle,uint32_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10787c478bd9Sstevel@tonic-gate csx_RepGet32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset,
10797c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10807c478bd9Sstevel@tonic-gate {
10817c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10827c478bd9Sstevel@tonic-gate 
10837c478bd9Sstevel@tonic-gate 	ddi_rep_get32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset),
10847c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10857c478bd9Sstevel@tonic-gate }
10867c478bd9Sstevel@tonic-gate 
10877c478bd9Sstevel@tonic-gate void
csx_RepGet64(acc_handle_t handle,uint64_t * hostaddr,uint32_t offset,uint32_t rc,uint32_t flags)10887c478bd9Sstevel@tonic-gate csx_RepGet64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset,
10897c478bd9Sstevel@tonic-gate 						uint32_t rc, uint32_t flags)
10907c478bd9Sstevel@tonic-gate {
10917c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
10927c478bd9Sstevel@tonic-gate 
10937c478bd9Sstevel@tonic-gate 	ddi_rep_get64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset),
10947c478bd9Sstevel@tonic-gate 		rc, (uint32_t)flags);
10957c478bd9Sstevel@tonic-gate }
10967c478bd9Sstevel@tonic-gate 
10977c478bd9Sstevel@tonic-gate /*
10987c478bd9Sstevel@tonic-gate  * The following two functions return the mapped (virtual) or physical
10997c478bd9Sstevel@tonic-gate  *	base address associated with the passed handle if the address
11007c478bd9Sstevel@tonic-gate  *	can be directly accessed by the caller. If the object represented
11017c478bd9Sstevel@tonic-gate  *	by the handle needs to be accessed through a common access
11027c478bd9Sstevel@tonic-gate  *	function, CS_BAD_BASE is returned.
11037c478bd9Sstevel@tonic-gate  *
11047c478bd9Sstevel@tonic-gate  * XXX - Need to figure out how to determine when to return CS_BAD_BASE
11057c478bd9Sstevel@tonic-gate  *	and also we need more generic return codes not tied to CS.
11067c478bd9Sstevel@tonic-gate  */
11077c478bd9Sstevel@tonic-gate int32_t
csx_GetMappedAddr(acc_handle_t handle,void ** addr)11087c478bd9Sstevel@tonic-gate csx_GetMappedAddr(acc_handle_t handle, void **addr)
11097c478bd9Sstevel@tonic-gate {
11107c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
11117c478bd9Sstevel@tonic-gate 
11127c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
11137c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
11147c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetMappedAddr: handle: 0x%p\n", handle);
11157c478bd9Sstevel@tonic-gate #endif
11167c478bd9Sstevel@tonic-gate 
11177c478bd9Sstevel@tonic-gate 	*addr = hp->ah_addr;
11187c478bd9Sstevel@tonic-gate 
11197c478bd9Sstevel@tonic-gate 	return (CS_SUCCESS);	/* XXX should be generic return code */
11207c478bd9Sstevel@tonic-gate }
11217c478bd9Sstevel@tonic-gate 
11227c478bd9Sstevel@tonic-gate int32_t
csx_GetPhysAddr(acc_handle_t handle,void ** addr)11237c478bd9Sstevel@tonic-gate csx_GetPhysAddr(acc_handle_t handle, void **addr)
11247c478bd9Sstevel@tonic-gate {
11257c478bd9Sstevel@tonic-gate #ifndef	lint
11267c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
11277c478bd9Sstevel@tonic-gate #endif	/* lint */
11287c478bd9Sstevel@tonic-gate 
11297c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
11307c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
11317c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetPhysAddr: handle: 0x%p\n", handle);
11327c478bd9Sstevel@tonic-gate #endif
11337c478bd9Sstevel@tonic-gate 
11347c478bd9Sstevel@tonic-gate 	*addr = NULL;
11357c478bd9Sstevel@tonic-gate 
11367c478bd9Sstevel@tonic-gate 	return (CS_BAD_BASE);
11377c478bd9Sstevel@tonic-gate }
11387c478bd9Sstevel@tonic-gate 
11397c478bd9Sstevel@tonic-gate /*ARGSUSED*/
11407c478bd9Sstevel@tonic-gate int32_t
csx_DupHandle(acc_handle_t handle,acc_handle_t * dup,uint32_t flags)11417c478bd9Sstevel@tonic-gate csx_DupHandle(acc_handle_t handle, acc_handle_t *dup, uint32_t flags)
11427c478bd9Sstevel@tonic-gate {
11437c478bd9Sstevel@tonic-gate #ifndef	lint
11447c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
11457c478bd9Sstevel@tonic-gate #endif	/* lint */
11467c478bd9Sstevel@tonic-gate 
11477c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
11487c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
11497c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_DupHandle: handle: 0x%p\n", handle);
11507c478bd9Sstevel@tonic-gate #endif
11517c478bd9Sstevel@tonic-gate 
11527c478bd9Sstevel@tonic-gate 	return (CS_BAD_HANDLE);
11537c478bd9Sstevel@tonic-gate 
11547c478bd9Sstevel@tonic-gate #ifdef	XXX
11557c478bd9Sstevel@tonic-gate 	*dup = (acc_handle_t)kmem_alloc(sizeof (acc_hdl_t), KM_SLEEP);
11567c478bd9Sstevel@tonic-gate 	((acc_hdl_t *)*dup)->ddi_handle =
11577c478bd9Sstevel@tonic-gate 		(ddi_acc_handle_t *)kmem_alloc(sizeof (ddi_acc_impl_t),
11587c478bd9Sstevel@tonic-gate 		    KM_SLEEP);
11597c478bd9Sstevel@tonic-gate 
11607c478bd9Sstevel@tonic-gate 	bcopy((caddr_t)hp, (caddr_t)((acc_hdl_t *)*dup)->ddi_handle,
11617c478bd9Sstevel@tonic-gate 	    sizeof (ddi_acc_impl_t));
11627c478bd9Sstevel@tonic-gate 
11637c478bd9Sstevel@tonic-gate 	return (CS_SUCCESS);
11647c478bd9Sstevel@tonic-gate #endif
11657c478bd9Sstevel@tonic-gate }
11667c478bd9Sstevel@tonic-gate 
11677c478bd9Sstevel@tonic-gate int32_t
csx_FreeHandle(acc_handle_t * handle)11687c478bd9Sstevel@tonic-gate csx_FreeHandle(acc_handle_t *handle)
11697c478bd9Sstevel@tonic-gate {
11707c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
11717c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
11727c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_FreeHandle: handle: 0x%p\n", *handle);
11737c478bd9Sstevel@tonic-gate #endif
11747c478bd9Sstevel@tonic-gate 	return (CS_BAD_HANDLE);
11757c478bd9Sstevel@tonic-gate 
11767c478bd9Sstevel@tonic-gate #ifdef	XXX
11777c478bd9Sstevel@tonic-gate 
11787c478bd9Sstevel@tonic-gate 	kmem_free((void *)((acc_hdl_t *)*handle)->ddi_handle,
11797c478bd9Sstevel@tonic-gate 		sizeof (ddi_acc_impl_t));
11807c478bd9Sstevel@tonic-gate 	kmem_free((void *)(acc_hdl_t *)*handle, sizeof (acc_hdl_t));
11817c478bd9Sstevel@tonic-gate 
11827c478bd9Sstevel@tonic-gate 	return (CS_SUCCESS);
11837c478bd9Sstevel@tonic-gate #endif
11847c478bd9Sstevel@tonic-gate }
11857c478bd9Sstevel@tonic-gate 
11867c478bd9Sstevel@tonic-gate /*
11877c478bd9Sstevel@tonic-gate  * XXX - Probably want to remove these fucntions soon
11887c478bd9Sstevel@tonic-gate  */
11897c478bd9Sstevel@tonic-gate int32_t
csx_GetHandleOffset(acc_handle_t handle,uint32_t * offset)11907c478bd9Sstevel@tonic-gate csx_GetHandleOffset(acc_handle_t handle, uint32_t *offset)
11917c478bd9Sstevel@tonic-gate {
11927c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
11937c478bd9Sstevel@tonic-gate 
11947c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
11957c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
11967c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_GetHandleOffset: handle: 0x%p\n", handle);
11977c478bd9Sstevel@tonic-gate #endif
11987c478bd9Sstevel@tonic-gate 
11997c478bd9Sstevel@tonic-gate 	*offset = hp->ah_offset;
12007c478bd9Sstevel@tonic-gate 
12017c478bd9Sstevel@tonic-gate 	return (CS_SUCCESS);
12027c478bd9Sstevel@tonic-gate }
12037c478bd9Sstevel@tonic-gate 
12047c478bd9Sstevel@tonic-gate int32_t
csx_SetHandleOffset(acc_handle_t handle,uint32_t offset)12057c478bd9Sstevel@tonic-gate csx_SetHandleOffset(acc_handle_t handle, uint32_t offset)
12067c478bd9Sstevel@tonic-gate {
12077c478bd9Sstevel@tonic-gate 	ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
12087c478bd9Sstevel@tonic-gate 
12097c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
12107c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
12117c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "csx_SetHandleOffset: handle: 0x%p\n", handle);
12127c478bd9Sstevel@tonic-gate #endif
12137c478bd9Sstevel@tonic-gate 
12147c478bd9Sstevel@tonic-gate 	hp->ah_offset = offset;
12157c478bd9Sstevel@tonic-gate 
12167c478bd9Sstevel@tonic-gate 	return (CS_SUCCESS);
12177c478bd9Sstevel@tonic-gate }
12187c478bd9Sstevel@tonic-gate 
12197c478bd9Sstevel@tonic-gate static int
cs_no_carservices(int32_t arg __unused,...)1220ebf37352SToomas Soome cs_no_carservices(int32_t arg __unused, ...)
12217c478bd9Sstevel@tonic-gate {
12227c478bd9Sstevel@tonic-gate #ifdef	CS_STUBS_DEBUG
12237c478bd9Sstevel@tonic-gate 	if (cs_stubs_debug > 3)
12247c478bd9Sstevel@tonic-gate 	    cmn_err(CE_CONT, "cs_no_carservices\n");
12257c478bd9Sstevel@tonic-gate #endif
12267c478bd9Sstevel@tonic-gate 	return (CS_UNSUPPORTED_FUNCTION);
12277c478bd9Sstevel@tonic-gate }
1228