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