1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate /* 30*7c478bd9Sstevel@tonic-gate * This is the PCMCIA Card Services kernel stubs module. It provides 31*7c478bd9Sstevel@tonic-gate * the various PCMCIA kernel framework entry points. 32*7c478bd9Sstevel@tonic-gate */ 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gate #if defined(DEBUG) 35*7c478bd9Sstevel@tonic-gate #define CS_STUBS_DEBUG 36*7c478bd9Sstevel@tonic-gate #endif 37*7c478bd9Sstevel@tonic-gate 38*7c478bd9Sstevel@tonic-gate #include <sys/types.h> 39*7c478bd9Sstevel@tonic-gate #include <sys/systm.h> 40*7c478bd9Sstevel@tonic-gate #include <sys/user.h> 41*7c478bd9Sstevel@tonic-gate #include <sys/buf.h> 42*7c478bd9Sstevel@tonic-gate #include <sys/file.h> 43*7c478bd9Sstevel@tonic-gate #include <sys/uio.h> 44*7c478bd9Sstevel@tonic-gate #include <sys/conf.h> 45*7c478bd9Sstevel@tonic-gate #include <sys/stat.h> 46*7c478bd9Sstevel@tonic-gate #include <sys/autoconf.h> 47*7c478bd9Sstevel@tonic-gate #include <sys/vtoc.h> 48*7c478bd9Sstevel@tonic-gate #include <sys/dkio.h> 49*7c478bd9Sstevel@tonic-gate #include <sys/ddi.h> 50*7c478bd9Sstevel@tonic-gate #include <sys/sunddi.h> 51*7c478bd9Sstevel@tonic-gate #include <sys/debug.h> 52*7c478bd9Sstevel@tonic-gate #include <sys/varargs.h> 53*7c478bd9Sstevel@tonic-gate #include <sys/var.h> 54*7c478bd9Sstevel@tonic-gate #include <sys/proc.h> 55*7c478bd9Sstevel@tonic-gate #include <sys/thread.h> 56*7c478bd9Sstevel@tonic-gate #include <sys/utsname.h> 57*7c478bd9Sstevel@tonic-gate #include <sys/vtrace.h> 58*7c478bd9Sstevel@tonic-gate #include <sys/kstat.h> 59*7c478bd9Sstevel@tonic-gate #include <sys/kmem.h> 60*7c478bd9Sstevel@tonic-gate #include <sys/modctl.h> 61*7c478bd9Sstevel@tonic-gate #include <sys/kobj.h> 62*7c478bd9Sstevel@tonic-gate #include <sys/callb.h> 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate #include <sys/pctypes.h> 65*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_types.h> 66*7c478bd9Sstevel@tonic-gate #include <sys/pcmcia.h> 67*7c478bd9Sstevel@tonic-gate #include <sys/sservice.h> 68*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cis.h> 69*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cis_handlers.h> 70*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs.h> 71*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_priv.h> 72*7c478bd9Sstevel@tonic-gate #include <pcmcia/sys/cs_stubs.h> 73*7c478bd9Sstevel@tonic-gate 74*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 75*7c478bd9Sstevel@tonic-gate int cs_stubs_debug = 0; 76*7c478bd9Sstevel@tonic-gate #endif 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate static csfunction_t *cardservices = NULL; 79*7c478bd9Sstevel@tonic-gate static int do_cs_call = 0; 80*7c478bd9Sstevel@tonic-gate static int cs_no_carservices(void); 81*7c478bd9Sstevel@tonic-gate 82*7c478bd9Sstevel@tonic-gate #define CardServices (do_cs_call ? (*cardservices) : \ 83*7c478bd9Sstevel@tonic-gate ((csfunction_t *)cs_no_carservices)) 84*7c478bd9Sstevel@tonic-gate 85*7c478bd9Sstevel@tonic-gate #ifdef USE_CS_STUBS_MODULE 86*7c478bd9Sstevel@tonic-gate 87*7c478bd9Sstevel@tonic-gate /* 88*7c478bd9Sstevel@tonic-gate * Module linkage information for the kernel. 89*7c478bd9Sstevel@tonic-gate */ 90*7c478bd9Sstevel@tonic-gate static struct modlmisc modlmisc = { 91*7c478bd9Sstevel@tonic-gate &mod_miscops, 92*7c478bd9Sstevel@tonic-gate "PCMCIA Card Services stub module" 93*7c478bd9Sstevel@tonic-gate }; 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate static struct modlinkage modlinkage = { 96*7c478bd9Sstevel@tonic-gate MODREV_1, 97*7c478bd9Sstevel@tonic-gate (void *)&modlmisc, 98*7c478bd9Sstevel@tonic-gate NULL 99*7c478bd9Sstevel@tonic-gate }; 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate int 102*7c478bd9Sstevel@tonic-gate _init(void) 103*7c478bd9Sstevel@tonic-gate { 104*7c478bd9Sstevel@tonic-gate return (mod_install(&modlinkage)); 105*7c478bd9Sstevel@tonic-gate } 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate int 108*7c478bd9Sstevel@tonic-gate _fini(void) 109*7c478bd9Sstevel@tonic-gate { 110*7c478bd9Sstevel@tonic-gate if (!do_cs_call) 111*7c478bd9Sstevel@tonic-gate return (mod_remove(&modlinkage)); 112*7c478bd9Sstevel@tonic-gate else 113*7c478bd9Sstevel@tonic-gate return (EBUSY); 114*7c478bd9Sstevel@tonic-gate } 115*7c478bd9Sstevel@tonic-gate 116*7c478bd9Sstevel@tonic-gate int 117*7c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop) 118*7c478bd9Sstevel@tonic-gate { 119*7c478bd9Sstevel@tonic-gate return (mod_info(&modlinkage, modinfop)); 120*7c478bd9Sstevel@tonic-gate } 121*7c478bd9Sstevel@tonic-gate #endif /* USE_CS_STUBS_MODULE */ 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gate /* 124*7c478bd9Sstevel@tonic-gate * csx_register_cardservices - The Card Services loadable module 125*7c478bd9Sstevel@tonic-gate * calls this runction to register it's entry point. 126*7c478bd9Sstevel@tonic-gate * 127*7c478bd9Sstevel@tonic-gate * Returns: CS_SUCCESS - if operation sucessful 128*7c478bd9Sstevel@tonic-gate * CS_UNSUPPORTED_FUNCTION - if invalid function code 129*7c478bd9Sstevel@tonic-gate * CS_BAD_HANDLE - if Card Services is not registered 130*7c478bd9Sstevel@tonic-gate */ 131*7c478bd9Sstevel@tonic-gate int32_t 132*7c478bd9Sstevel@tonic-gate csx_register_cardservices(cs_register_cardservices_t *rcs) 133*7c478bd9Sstevel@tonic-gate { 134*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 135*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 2) 136*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_register_cardservices: " 137*7c478bd9Sstevel@tonic-gate "magic: 0x%x function: 0x%x cardservices: 0x%p\n", 138*7c478bd9Sstevel@tonic-gate rcs->magic, rcs->function, (void *)rcs->cardservices); 139*7c478bd9Sstevel@tonic-gate #endif 140*7c478bd9Sstevel@tonic-gate 141*7c478bd9Sstevel@tonic-gate if (rcs->magic != CS_STUBS_MAGIC) 142*7c478bd9Sstevel@tonic-gate return (CS_BAD_ARGS); 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate switch (rcs->function) { 145*7c478bd9Sstevel@tonic-gate case CS_ENTRY_REGISTER: 146*7c478bd9Sstevel@tonic-gate cardservices = rcs->cardservices; 147*7c478bd9Sstevel@tonic-gate do_cs_call = 1; 148*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 149*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 2) 150*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_register_cardservices: CS_ENTRY_REGISTER\n"); 151*7c478bd9Sstevel@tonic-gate #endif 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 154*7c478bd9Sstevel@tonic-gate 155*7c478bd9Sstevel@tonic-gate case CS_ENTRY_DEREGISTER: 156*7c478bd9Sstevel@tonic-gate do_cs_call = 0; 157*7c478bd9Sstevel@tonic-gate cardservices = (csfunction_t *)cs_no_carservices; 158*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 159*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 2) 160*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, 161*7c478bd9Sstevel@tonic-gate "csx_register_cardservices: CS_ENTRY_DEREGISTER\n"); 162*7c478bd9Sstevel@tonic-gate #endif 163*7c478bd9Sstevel@tonic-gate return (CS_UNSUPPORTED_FUNCTION); 164*7c478bd9Sstevel@tonic-gate 165*7c478bd9Sstevel@tonic-gate case CS_ENTRY_INQUIRE: 166*7c478bd9Sstevel@tonic-gate rcs->cardservices = cardservices; 167*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 168*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 2) 169*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_register_cardservices: CS_ENTRY_INQUIRE\n"); 170*7c478bd9Sstevel@tonic-gate #endif 171*7c478bd9Sstevel@tonic-gate 172*7c478bd9Sstevel@tonic-gate if (do_cs_call) 173*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 174*7c478bd9Sstevel@tonic-gate else 175*7c478bd9Sstevel@tonic-gate return (CS_BAD_HANDLE); 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gate default: 178*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 179*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 2) 180*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_register_cardservices: (unknown function)\n"); 181*7c478bd9Sstevel@tonic-gate #endif 182*7c478bd9Sstevel@tonic-gate return (CS_UNSUPPORTED_FUNCTION); 183*7c478bd9Sstevel@tonic-gate } 184*7c478bd9Sstevel@tonic-gate 185*7c478bd9Sstevel@tonic-gate } 186*7c478bd9Sstevel@tonic-gate 187*7c478bd9Sstevel@tonic-gate int32_t 188*7c478bd9Sstevel@tonic-gate csx_RegisterClient(client_handle_t *ch, client_reg_t *cr) 189*7c478bd9Sstevel@tonic-gate { 190*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 191*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 192*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RegisterClient: (no handle yet)\n"); 193*7c478bd9Sstevel@tonic-gate #endif 194*7c478bd9Sstevel@tonic-gate return (CardServices(RegisterClient, ch, cr)); 195*7c478bd9Sstevel@tonic-gate } 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gate int32_t 198*7c478bd9Sstevel@tonic-gate csx_DeregisterClient(client_handle_t ch) 199*7c478bd9Sstevel@tonic-gate { 200*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 201*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 202*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_DeregisterClient: handle: 0x%x\n", ch); 203*7c478bd9Sstevel@tonic-gate #endif 204*7c478bd9Sstevel@tonic-gate return (CardServices(DeregisterClient, ch)); 205*7c478bd9Sstevel@tonic-gate } 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate int32_t 208*7c478bd9Sstevel@tonic-gate csx_GetStatus(client_handle_t ch, get_status_t *gs) 209*7c478bd9Sstevel@tonic-gate { 210*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 211*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 212*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetStatus: handle: 0x%x\n", ch); 213*7c478bd9Sstevel@tonic-gate #endif 214*7c478bd9Sstevel@tonic-gate return (CardServices(GetStatus, ch, gs)); 215*7c478bd9Sstevel@tonic-gate } 216*7c478bd9Sstevel@tonic-gate 217*7c478bd9Sstevel@tonic-gate int32_t 218*7c478bd9Sstevel@tonic-gate csx_SetEventMask(client_handle_t ch, sockevent_t *se) 219*7c478bd9Sstevel@tonic-gate { 220*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 221*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 222*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_SetEventMask: handle: 0x%x\n", ch); 223*7c478bd9Sstevel@tonic-gate #endif 224*7c478bd9Sstevel@tonic-gate return (CardServices(SetEventMask, ch, se)); 225*7c478bd9Sstevel@tonic-gate } 226*7c478bd9Sstevel@tonic-gate 227*7c478bd9Sstevel@tonic-gate int32_t 228*7c478bd9Sstevel@tonic-gate csx_GetEventMask(client_handle_t ch, sockevent_t *se) 229*7c478bd9Sstevel@tonic-gate { 230*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 231*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 232*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetEventMask: handle: 0x%x\n", ch); 233*7c478bd9Sstevel@tonic-gate #endif 234*7c478bd9Sstevel@tonic-gate return (CardServices(GetEventMask, ch, se)); 235*7c478bd9Sstevel@tonic-gate } 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate int32_t 238*7c478bd9Sstevel@tonic-gate csx_RequestIO(client_handle_t ch, io_req_t *ior) 239*7c478bd9Sstevel@tonic-gate { 240*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 241*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 242*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RequestIO: handle: 0x%x\n", ch); 243*7c478bd9Sstevel@tonic-gate #endif 244*7c478bd9Sstevel@tonic-gate return (CardServices(RequestIO, ch, ior)); 245*7c478bd9Sstevel@tonic-gate } 246*7c478bd9Sstevel@tonic-gate 247*7c478bd9Sstevel@tonic-gate int32_t 248*7c478bd9Sstevel@tonic-gate csx_ReleaseIO(client_handle_t ch, io_req_t *ior) 249*7c478bd9Sstevel@tonic-gate { 250*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 251*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 252*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ReleaseIO: handle: 0x%x\n", ch); 253*7c478bd9Sstevel@tonic-gate #endif 254*7c478bd9Sstevel@tonic-gate return (CardServices(ReleaseIO, ch, ior)); 255*7c478bd9Sstevel@tonic-gate } 256*7c478bd9Sstevel@tonic-gate 257*7c478bd9Sstevel@tonic-gate int32_t 258*7c478bd9Sstevel@tonic-gate csx_RequestIRQ(client_handle_t ch, irq_req_t *irqr) 259*7c478bd9Sstevel@tonic-gate { 260*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 261*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 262*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RequestIRQ: handle: 0x%x\n", ch); 263*7c478bd9Sstevel@tonic-gate #endif 264*7c478bd9Sstevel@tonic-gate return (CardServices(RequestIRQ, ch, irqr)); 265*7c478bd9Sstevel@tonic-gate } 266*7c478bd9Sstevel@tonic-gate 267*7c478bd9Sstevel@tonic-gate int32_t 268*7c478bd9Sstevel@tonic-gate csx_ReleaseIRQ(client_handle_t ch, irq_req_t *irqr) 269*7c478bd9Sstevel@tonic-gate { 270*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 271*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 272*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ReleaseIRQ: handle: 0x%x\n", ch); 273*7c478bd9Sstevel@tonic-gate #endif 274*7c478bd9Sstevel@tonic-gate return (CardServices(ReleaseIRQ, ch, irqr)); 275*7c478bd9Sstevel@tonic-gate } 276*7c478bd9Sstevel@tonic-gate 277*7c478bd9Sstevel@tonic-gate int32_t 278*7c478bd9Sstevel@tonic-gate csx_RequestWindow(client_handle_t ch, window_handle_t *wh, win_req_t *wr) 279*7c478bd9Sstevel@tonic-gate { 280*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 281*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 282*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RequestWindow: handle: 0x%x\n", ch); 283*7c478bd9Sstevel@tonic-gate #endif 284*7c478bd9Sstevel@tonic-gate return (CardServices(RequestWindow, ch, wh, wr)); 285*7c478bd9Sstevel@tonic-gate } 286*7c478bd9Sstevel@tonic-gate 287*7c478bd9Sstevel@tonic-gate int32_t 288*7c478bd9Sstevel@tonic-gate csx_ReleaseWindow(window_handle_t wh) 289*7c478bd9Sstevel@tonic-gate { 290*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 291*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 292*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ReleaseWindow: handle: 0x%x\n", wh); 293*7c478bd9Sstevel@tonic-gate #endif 294*7c478bd9Sstevel@tonic-gate return (CardServices(ReleaseWindow, wh)); 295*7c478bd9Sstevel@tonic-gate } 296*7c478bd9Sstevel@tonic-gate 297*7c478bd9Sstevel@tonic-gate int32_t 298*7c478bd9Sstevel@tonic-gate csx_ModifyWindow(window_handle_t wh, modify_win_t *mw) 299*7c478bd9Sstevel@tonic-gate { 300*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 301*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 302*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ModifyWindow: handle: 0x%x\n", wh); 303*7c478bd9Sstevel@tonic-gate #endif 304*7c478bd9Sstevel@tonic-gate return (CardServices(ModifyWindow, wh, mw)); 305*7c478bd9Sstevel@tonic-gate } 306*7c478bd9Sstevel@tonic-gate 307*7c478bd9Sstevel@tonic-gate int32_t 308*7c478bd9Sstevel@tonic-gate csx_MapMemPage(window_handle_t wh, map_mem_page_t *mmp) 309*7c478bd9Sstevel@tonic-gate { 310*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 311*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 312*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_MapMemPage: handle: 0x%x\n", wh); 313*7c478bd9Sstevel@tonic-gate #endif 314*7c478bd9Sstevel@tonic-gate return (CardServices(MapMemPage, wh, mmp)); 315*7c478bd9Sstevel@tonic-gate } 316*7c478bd9Sstevel@tonic-gate 317*7c478bd9Sstevel@tonic-gate int32_t 318*7c478bd9Sstevel@tonic-gate csx_RequestSocketMask(client_handle_t ch, request_socket_mask_t *sm) 319*7c478bd9Sstevel@tonic-gate { 320*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 321*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 322*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RequestSocketMask: handle: 0x%x\n", ch); 323*7c478bd9Sstevel@tonic-gate #endif 324*7c478bd9Sstevel@tonic-gate return (CardServices(RequestSocketMask, ch, sm)); 325*7c478bd9Sstevel@tonic-gate } 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate int32_t 328*7c478bd9Sstevel@tonic-gate csx_ReleaseSocketMask(client_handle_t ch, release_socket_mask_t *rsm) 329*7c478bd9Sstevel@tonic-gate { 330*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 331*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 332*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ReleaseSocketMask: handle: 0x%x\n", ch); 333*7c478bd9Sstevel@tonic-gate #endif 334*7c478bd9Sstevel@tonic-gate return (CardServices(ReleaseSocketMask, ch, rsm)); 335*7c478bd9Sstevel@tonic-gate } 336*7c478bd9Sstevel@tonic-gate 337*7c478bd9Sstevel@tonic-gate int32_t 338*7c478bd9Sstevel@tonic-gate csx_RequestConfiguration(client_handle_t ch, config_req_t *cr) 339*7c478bd9Sstevel@tonic-gate { 340*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 341*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 342*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RequestConfiguration: handle: 0x%x\n", ch); 343*7c478bd9Sstevel@tonic-gate #endif 344*7c478bd9Sstevel@tonic-gate return (CardServices(RequestConfiguration, ch, cr)); 345*7c478bd9Sstevel@tonic-gate } 346*7c478bd9Sstevel@tonic-gate 347*7c478bd9Sstevel@tonic-gate int32_t 348*7c478bd9Sstevel@tonic-gate csx_ModifyConfiguration(client_handle_t ch, modify_config_t *mc) 349*7c478bd9Sstevel@tonic-gate { 350*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 351*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 352*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ModifyConfiguration: handle: 0x%x\n", ch); 353*7c478bd9Sstevel@tonic-gate #endif 354*7c478bd9Sstevel@tonic-gate return (CardServices(ModifyConfiguration, ch, mc)); 355*7c478bd9Sstevel@tonic-gate } 356*7c478bd9Sstevel@tonic-gate 357*7c478bd9Sstevel@tonic-gate int32_t 358*7c478bd9Sstevel@tonic-gate csx_ReleaseConfiguration(client_handle_t ch, release_config_t *rc) 359*7c478bd9Sstevel@tonic-gate { 360*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 361*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 362*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ReleaseConfiguration: handle: 0x%x\n", ch); 363*7c478bd9Sstevel@tonic-gate #endif 364*7c478bd9Sstevel@tonic-gate return (CardServices(ReleaseConfiguration, ch, rc)); 365*7c478bd9Sstevel@tonic-gate } 366*7c478bd9Sstevel@tonic-gate 367*7c478bd9Sstevel@tonic-gate int32_t 368*7c478bd9Sstevel@tonic-gate csx_AccessConfigurationRegister(client_handle_t ch, access_config_reg_t *acr) 369*7c478bd9Sstevel@tonic-gate { 370*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 371*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 372*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, 373*7c478bd9Sstevel@tonic-gate "csx_AccessConfigurationRegister: handle: 0x%x\n", ch); 374*7c478bd9Sstevel@tonic-gate #endif 375*7c478bd9Sstevel@tonic-gate return (CardServices(AccessConfigurationRegister, ch, acr)); 376*7c478bd9Sstevel@tonic-gate } 377*7c478bd9Sstevel@tonic-gate 378*7c478bd9Sstevel@tonic-gate int32_t 379*7c478bd9Sstevel@tonic-gate csx_GetFirstTuple(client_handle_t ch, tuple_t *tp) 380*7c478bd9Sstevel@tonic-gate { 381*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 382*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 383*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetFirstTuple: handle: 0x%x\n", ch); 384*7c478bd9Sstevel@tonic-gate #endif 385*7c478bd9Sstevel@tonic-gate return (CardServices(GetFirstTuple, ch, tp)); 386*7c478bd9Sstevel@tonic-gate } 387*7c478bd9Sstevel@tonic-gate 388*7c478bd9Sstevel@tonic-gate int32_t 389*7c478bd9Sstevel@tonic-gate csx_GetNextTuple(client_handle_t ch, tuple_t *tp) 390*7c478bd9Sstevel@tonic-gate { 391*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 392*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 393*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetNextTuple: handle: 0x%x\n", ch); 394*7c478bd9Sstevel@tonic-gate #endif 395*7c478bd9Sstevel@tonic-gate return (CardServices(GetNextTuple, ch, tp)); 396*7c478bd9Sstevel@tonic-gate } 397*7c478bd9Sstevel@tonic-gate 398*7c478bd9Sstevel@tonic-gate int32_t 399*7c478bd9Sstevel@tonic-gate csx_GetTupleData(client_handle_t ch, tuple_t *tp) 400*7c478bd9Sstevel@tonic-gate { 401*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 402*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 403*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetTupleData: handle: 0x%x\n", ch); 404*7c478bd9Sstevel@tonic-gate #endif 405*7c478bd9Sstevel@tonic-gate return (CardServices(GetTupleData, ch, tp)); 406*7c478bd9Sstevel@tonic-gate } 407*7c478bd9Sstevel@tonic-gate 408*7c478bd9Sstevel@tonic-gate int32_t 409*7c478bd9Sstevel@tonic-gate csx_MapLogSocket(client_handle_t ch, map_log_socket_t *mls) 410*7c478bd9Sstevel@tonic-gate { 411*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 412*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 413*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_MapLogSocket: handle: 0x%x\n", ch); 414*7c478bd9Sstevel@tonic-gate #endif 415*7c478bd9Sstevel@tonic-gate return (CardServices(MapLogSocket, ch, mls)); 416*7c478bd9Sstevel@tonic-gate } 417*7c478bd9Sstevel@tonic-gate 418*7c478bd9Sstevel@tonic-gate int32_t 419*7c478bd9Sstevel@tonic-gate csx_ValidateCIS(client_handle_t ch, cisinfo_t *ci) 420*7c478bd9Sstevel@tonic-gate { 421*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 422*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 423*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ValidateCIS: handle: 0x%x\n", ch); 424*7c478bd9Sstevel@tonic-gate #endif 425*7c478bd9Sstevel@tonic-gate return (CardServices(ValidateCIS, ch, ci)); 426*7c478bd9Sstevel@tonic-gate } 427*7c478bd9Sstevel@tonic-gate 428*7c478bd9Sstevel@tonic-gate int32_t 429*7c478bd9Sstevel@tonic-gate csx_MakeDeviceNode(client_handle_t ch, make_device_node_t *mdn) 430*7c478bd9Sstevel@tonic-gate { 431*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 432*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 433*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_MakeDeviceNode: handle: 0x%x\n", ch); 434*7c478bd9Sstevel@tonic-gate #endif 435*7c478bd9Sstevel@tonic-gate return (CardServices(MakeDeviceNode, ch, mdn)); 436*7c478bd9Sstevel@tonic-gate } 437*7c478bd9Sstevel@tonic-gate 438*7c478bd9Sstevel@tonic-gate int32_t 439*7c478bd9Sstevel@tonic-gate csx_RemoveDeviceNode(client_handle_t ch, remove_device_node_t *rdn) 440*7c478bd9Sstevel@tonic-gate { 441*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 442*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 443*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_RemoveDeviceNode: handle: 0x%x\n", ch); 444*7c478bd9Sstevel@tonic-gate #endif 445*7c478bd9Sstevel@tonic-gate return (CardServices(RemoveDeviceNode, ch, rdn)); 446*7c478bd9Sstevel@tonic-gate } 447*7c478bd9Sstevel@tonic-gate 448*7c478bd9Sstevel@tonic-gate int32_t 449*7c478bd9Sstevel@tonic-gate csx_ConvertSpeed(convert_speed_t *cp) 450*7c478bd9Sstevel@tonic-gate { 451*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 452*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 453*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ConvertSpeed\n"); 454*7c478bd9Sstevel@tonic-gate #endif 455*7c478bd9Sstevel@tonic-gate return (CardServices(ConvertSpeed, cp)); 456*7c478bd9Sstevel@tonic-gate } 457*7c478bd9Sstevel@tonic-gate 458*7c478bd9Sstevel@tonic-gate int32_t 459*7c478bd9Sstevel@tonic-gate csx_ConvertSize(convert_size_t *cp) 460*7c478bd9Sstevel@tonic-gate { 461*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 462*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 463*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ConvertSize\n"); 464*7c478bd9Sstevel@tonic-gate #endif 465*7c478bd9Sstevel@tonic-gate return (CardServices(ConvertSize, cp)); 466*7c478bd9Sstevel@tonic-gate } 467*7c478bd9Sstevel@tonic-gate 468*7c478bd9Sstevel@tonic-gate int32_t 469*7c478bd9Sstevel@tonic-gate csx_Event2Text(event2text_t *e2t) 470*7c478bd9Sstevel@tonic-gate { 471*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 472*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 473*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Event2Text\n"); 474*7c478bd9Sstevel@tonic-gate #endif 475*7c478bd9Sstevel@tonic-gate return (CardServices(Event2Text, e2t)); 476*7c478bd9Sstevel@tonic-gate } 477*7c478bd9Sstevel@tonic-gate 478*7c478bd9Sstevel@tonic-gate int32_t 479*7c478bd9Sstevel@tonic-gate csx_Error2Text(error2text_t *e2t) 480*7c478bd9Sstevel@tonic-gate { 481*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 482*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 483*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Error2Text\n"); 484*7c478bd9Sstevel@tonic-gate #endif 485*7c478bd9Sstevel@tonic-gate return (CardServices(Error2Text, e2t)); 486*7c478bd9Sstevel@tonic-gate } 487*7c478bd9Sstevel@tonic-gate 488*7c478bd9Sstevel@tonic-gate int32_t 489*7c478bd9Sstevel@tonic-gate csx_CS_DDI_Info(cs_ddi_info_t *cp) 490*7c478bd9Sstevel@tonic-gate { 491*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 492*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 493*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_CS_DDI_Info\n"); 494*7c478bd9Sstevel@tonic-gate #endif 495*7c478bd9Sstevel@tonic-gate return (CardServices(CS_DDI_Info, cp)); 496*7c478bd9Sstevel@tonic-gate } 497*7c478bd9Sstevel@tonic-gate 498*7c478bd9Sstevel@tonic-gate int32_t 499*7c478bd9Sstevel@tonic-gate csx_CS_Sys_Ctl(cs_sys_ctl_t *csc) 500*7c478bd9Sstevel@tonic-gate { 501*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 502*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 503*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_CS_Sys_Ctl\n"); 504*7c478bd9Sstevel@tonic-gate #endif 505*7c478bd9Sstevel@tonic-gate return (CardServices(CS_Sys_Ctl, csc)); 506*7c478bd9Sstevel@tonic-gate } 507*7c478bd9Sstevel@tonic-gate 508*7c478bd9Sstevel@tonic-gate int32_t 509*7c478bd9Sstevel@tonic-gate csx_GetClientInfo(client_handle_t ch, client_info_t *ci) 510*7c478bd9Sstevel@tonic-gate { 511*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 512*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 513*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetClientInfo: handle: 0x%x\n", ch); 514*7c478bd9Sstevel@tonic-gate #endif 515*7c478bd9Sstevel@tonic-gate 516*7c478bd9Sstevel@tonic-gate return (CardServices(GetClientInfo, ch, ci)); 517*7c478bd9Sstevel@tonic-gate } 518*7c478bd9Sstevel@tonic-gate 519*7c478bd9Sstevel@tonic-gate int32_t 520*7c478bd9Sstevel@tonic-gate csx_GetFirstClient(get_firstnext_client_t *fnc) 521*7c478bd9Sstevel@tonic-gate { 522*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 523*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 524*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetFirstClient\n"); 525*7c478bd9Sstevel@tonic-gate #endif 526*7c478bd9Sstevel@tonic-gate 527*7c478bd9Sstevel@tonic-gate return (CardServices(GetFirstClient, fnc)); 528*7c478bd9Sstevel@tonic-gate } 529*7c478bd9Sstevel@tonic-gate 530*7c478bd9Sstevel@tonic-gate int32_t 531*7c478bd9Sstevel@tonic-gate csx_GetNextClient(get_firstnext_client_t *fnc) 532*7c478bd9Sstevel@tonic-gate { 533*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 534*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 535*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetNextClient\n"); 536*7c478bd9Sstevel@tonic-gate #endif 537*7c478bd9Sstevel@tonic-gate 538*7c478bd9Sstevel@tonic-gate return (CardServices(GetNextClient, fnc)); 539*7c478bd9Sstevel@tonic-gate } 540*7c478bd9Sstevel@tonic-gate 541*7c478bd9Sstevel@tonic-gate int32_t 542*7c478bd9Sstevel@tonic-gate csx_ResetFunction(client_handle_t ch, reset_function_t *rf) 543*7c478bd9Sstevel@tonic-gate { 544*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 545*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 546*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ResetFunction: handle: 0x%x\n", ch); 547*7c478bd9Sstevel@tonic-gate #endif 548*7c478bd9Sstevel@tonic-gate 549*7c478bd9Sstevel@tonic-gate return (CardServices(ResetFunction, ch, rf)); 550*7c478bd9Sstevel@tonic-gate } 551*7c478bd9Sstevel@tonic-gate 552*7c478bd9Sstevel@tonic-gate int32_t 553*7c478bd9Sstevel@tonic-gate csx_GetCardServicesInfo(client_handle_t ch, get_cardservices_info_t *gcsi) 554*7c478bd9Sstevel@tonic-gate { 555*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 556*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 557*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetCardServicesInfo: handle: 0x%x\n", ch); 558*7c478bd9Sstevel@tonic-gate #endif 559*7c478bd9Sstevel@tonic-gate 560*7c478bd9Sstevel@tonic-gate return (CardServices(GetCardServicesInfo, ch, gcsi)); 561*7c478bd9Sstevel@tonic-gate } 562*7c478bd9Sstevel@tonic-gate 563*7c478bd9Sstevel@tonic-gate int32_t 564*7c478bd9Sstevel@tonic-gate csx_GetConfigurationInfo(client_handle_t *ch, get_configuration_info_t *gci) 565*7c478bd9Sstevel@tonic-gate { 566*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 567*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 568*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetConfigurationInfo: " 569*7c478bd9Sstevel@tonic-gate "handle: (no handle yet)\n"); 570*7c478bd9Sstevel@tonic-gate #endif 571*7c478bd9Sstevel@tonic-gate 572*7c478bd9Sstevel@tonic-gate return (CardServices(GetConfigurationInfo, ch, gci)); 573*7c478bd9Sstevel@tonic-gate } 574*7c478bd9Sstevel@tonic-gate 575*7c478bd9Sstevel@tonic-gate int32_t 576*7c478bd9Sstevel@tonic-gate csx_GetPhysicalAdapterInfo(client_handle_t ch, get_physical_adapter_info_t *gp) 577*7c478bd9Sstevel@tonic-gate { 578*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 579*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 580*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetPhysicalAdapterInfo: handle: 0x%x\n", ch); 581*7c478bd9Sstevel@tonic-gate #endif 582*7c478bd9Sstevel@tonic-gate 583*7c478bd9Sstevel@tonic-gate return (CardServices(GetPhysicalAdapterInfo, ch, gp)); 584*7c478bd9Sstevel@tonic-gate } 585*7c478bd9Sstevel@tonic-gate 586*7c478bd9Sstevel@tonic-gate /* 587*7c478bd9Sstevel@tonic-gate * CIS tuple parsing functions - one entrypoint per tuple that we know 588*7c478bd9Sstevel@tonic-gate * how to parse 589*7c478bd9Sstevel@tonic-gate */ 590*7c478bd9Sstevel@tonic-gate int32_t 591*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_CONFIG(client_handle_t ch, tuple_t *tp, cistpl_config_t *pt) 592*7c478bd9Sstevel@tonic-gate { 593*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 594*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 595*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_CONFIG: handle: 0x%x\n", ch); 596*7c478bd9Sstevel@tonic-gate #endif 597*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_CONFIG; 598*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 599*7c478bd9Sstevel@tonic-gate } 600*7c478bd9Sstevel@tonic-gate 601*7c478bd9Sstevel@tonic-gate int32_t 602*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt) 603*7c478bd9Sstevel@tonic-gate { 604*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 605*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 606*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE: handle: 0x%x\n", ch); 607*7c478bd9Sstevel@tonic-gate #endif 608*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICE; 609*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 610*7c478bd9Sstevel@tonic-gate } 611*7c478bd9Sstevel@tonic-gate 612*7c478bd9Sstevel@tonic-gate int32_t 613*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_A(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt) 614*7c478bd9Sstevel@tonic-gate { 615*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 616*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 617*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_A: handle: 0x%x\n", ch); 618*7c478bd9Sstevel@tonic-gate #endif 619*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICE_A; 620*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 621*7c478bd9Sstevel@tonic-gate } 622*7c478bd9Sstevel@tonic-gate 623*7c478bd9Sstevel@tonic-gate int32_t 624*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_OA(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt) 625*7c478bd9Sstevel@tonic-gate { 626*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 627*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 628*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OA: handle: 0x%x\n", ch); 629*7c478bd9Sstevel@tonic-gate #endif 630*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICE_OA; 631*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 632*7c478bd9Sstevel@tonic-gate } 633*7c478bd9Sstevel@tonic-gate 634*7c478bd9Sstevel@tonic-gate int32_t 635*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICE_OC(client_handle_t ch, tuple_t *tp, cistpl_device_t *pt) 636*7c478bd9Sstevel@tonic-gate { 637*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 638*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 639*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICE_OC: handle: 0x%x\n", ch); 640*7c478bd9Sstevel@tonic-gate #endif 641*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICE_OC; 642*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 643*7c478bd9Sstevel@tonic-gate } 644*7c478bd9Sstevel@tonic-gate 645*7c478bd9Sstevel@tonic-gate int32_t 646*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_VERS_1(client_handle_t ch, tuple_t *tp, cistpl_vers_1_t *pt) 647*7c478bd9Sstevel@tonic-gate { 648*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 649*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 650*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_1: handle: 0x%x\n", ch); 651*7c478bd9Sstevel@tonic-gate #endif 652*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_VERS_1; 653*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 654*7c478bd9Sstevel@tonic-gate } 655*7c478bd9Sstevel@tonic-gate 656*7c478bd9Sstevel@tonic-gate int32_t 657*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_VERS_2(client_handle_t ch, tuple_t *tp, cistpl_vers_2_t *pt) 658*7c478bd9Sstevel@tonic-gate { 659*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 660*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 661*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_VERS_2: handle: 0x%x\n", ch); 662*7c478bd9Sstevel@tonic-gate #endif 663*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_VERS_2; 664*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 665*7c478bd9Sstevel@tonic-gate } 666*7c478bd9Sstevel@tonic-gate 667*7c478bd9Sstevel@tonic-gate int32_t 668*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_JEDEC_A(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt) 669*7c478bd9Sstevel@tonic-gate { 670*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 671*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 672*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_A: handle: 0x%x\n", ch); 673*7c478bd9Sstevel@tonic-gate #endif 674*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_JEDEC_A; 675*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 676*7c478bd9Sstevel@tonic-gate } 677*7c478bd9Sstevel@tonic-gate 678*7c478bd9Sstevel@tonic-gate int32_t 679*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_JEDEC_C(client_handle_t ch, tuple_t *tp, cistpl_jedec_t *pt) 680*7c478bd9Sstevel@tonic-gate { 681*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 682*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 683*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_JEDEC_C: handle: 0x%x\n", ch); 684*7c478bd9Sstevel@tonic-gate #endif 685*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_JEDEC_C; 686*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 687*7c478bd9Sstevel@tonic-gate } 688*7c478bd9Sstevel@tonic-gate 689*7c478bd9Sstevel@tonic-gate int32_t 690*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FORMAT(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt) 691*7c478bd9Sstevel@tonic-gate { 692*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 693*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 694*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT: handle: 0x%x\n", ch); 695*7c478bd9Sstevel@tonic-gate #endif 696*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_FORMAT; 697*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 698*7c478bd9Sstevel@tonic-gate } 699*7c478bd9Sstevel@tonic-gate 700*7c478bd9Sstevel@tonic-gate int32_t 701*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FORMAT_A(client_handle_t ch, tuple_t *tp, cistpl_format_t *pt) 702*7c478bd9Sstevel@tonic-gate { 703*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 704*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 705*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_FORMAT_A: handle: 0x%x\n", ch); 706*7c478bd9Sstevel@tonic-gate #endif 707*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_FORMAT_A; 708*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 709*7c478bd9Sstevel@tonic-gate } 710*7c478bd9Sstevel@tonic-gate 711*7c478bd9Sstevel@tonic-gate int32_t 712*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_GEOMETRY(client_handle_t ch, tuple_t *tp, 713*7c478bd9Sstevel@tonic-gate cistpl_geometry_t *pt) 714*7c478bd9Sstevel@tonic-gate { 715*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 716*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 717*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_GEOMETRY: handle: 0x%x\n", ch); 718*7c478bd9Sstevel@tonic-gate #endif 719*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_GEOMETRY; 720*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 721*7c478bd9Sstevel@tonic-gate } 722*7c478bd9Sstevel@tonic-gate 723*7c478bd9Sstevel@tonic-gate int32_t 724*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_BYTEORDER(client_handle_t ch, tuple_t *tp, 725*7c478bd9Sstevel@tonic-gate cistpl_byteorder_t *pt) 726*7c478bd9Sstevel@tonic-gate { 727*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 728*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 729*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_BYTEORDER: handle: 0x%x\n", ch); 730*7c478bd9Sstevel@tonic-gate #endif 731*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_BYTEORDER; 732*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 733*7c478bd9Sstevel@tonic-gate } 734*7c478bd9Sstevel@tonic-gate 735*7c478bd9Sstevel@tonic-gate int32_t 736*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DATE(client_handle_t ch, tuple_t *tp, cistpl_date_t *pt) 737*7c478bd9Sstevel@tonic-gate { 738*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 739*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 740*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DATE: handle: 0x%x\n", ch); 741*7c478bd9Sstevel@tonic-gate #endif 742*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DATE; 743*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 744*7c478bd9Sstevel@tonic-gate } 745*7c478bd9Sstevel@tonic-gate 746*7c478bd9Sstevel@tonic-gate int32_t 747*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_BATTERY(client_handle_t ch, tuple_t *tp, cistpl_battery_t *pt) 748*7c478bd9Sstevel@tonic-gate { 749*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 750*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 751*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_BATTERY: handle: 0x%x\n", ch); 752*7c478bd9Sstevel@tonic-gate #endif 753*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_BATTERY; 754*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 755*7c478bd9Sstevel@tonic-gate } 756*7c478bd9Sstevel@tonic-gate 757*7c478bd9Sstevel@tonic-gate int32_t 758*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_ORG(client_handle_t ch, tuple_t *tp, cistpl_org_t *pt) 759*7c478bd9Sstevel@tonic-gate { 760*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 761*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 762*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_ORG: handle: 0x%x\n", ch); 763*7c478bd9Sstevel@tonic-gate #endif 764*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_ORG; 765*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 766*7c478bd9Sstevel@tonic-gate } 767*7c478bd9Sstevel@tonic-gate 768*7c478bd9Sstevel@tonic-gate int32_t 769*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_MANFID(client_handle_t ch, tuple_t *tp, cistpl_manfid_t *pt) 770*7c478bd9Sstevel@tonic-gate { 771*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 772*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 773*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_MANFID: handle: 0x%x\n", ch); 774*7c478bd9Sstevel@tonic-gate #endif 775*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_MANFID; 776*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 777*7c478bd9Sstevel@tonic-gate } 778*7c478bd9Sstevel@tonic-gate 779*7c478bd9Sstevel@tonic-gate int32_t 780*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FUNCID(client_handle_t ch, tuple_t *tp, cistpl_funcid_t *pt) 781*7c478bd9Sstevel@tonic-gate { 782*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 783*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 784*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCID: handle: 0x%x\n", ch); 785*7c478bd9Sstevel@tonic-gate #endif 786*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_FUNCID; 787*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 788*7c478bd9Sstevel@tonic-gate } 789*7c478bd9Sstevel@tonic-gate 790*7c478bd9Sstevel@tonic-gate int32_t 791*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_FUNCE(client_handle_t ch, tuple_t *tp, 792*7c478bd9Sstevel@tonic-gate cistpl_funce_t *pt, uint32_t function) 793*7c478bd9Sstevel@tonic-gate { 794*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 795*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 796*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_FUNCE: handle: 0x%x\n", ch); 797*7c478bd9Sstevel@tonic-gate #endif 798*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_FUNCE; 799*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt, function)); 800*7c478bd9Sstevel@tonic-gate } 801*7c478bd9Sstevel@tonic-gate 802*7c478bd9Sstevel@tonic-gate int32_t 803*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_CFTABLE_ENTRY(client_handle_t ch, tuple_t *tp, 804*7c478bd9Sstevel@tonic-gate cistpl_cftable_entry_t *pt) 805*7c478bd9Sstevel@tonic-gate { 806*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 807*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 808*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, 809*7c478bd9Sstevel@tonic-gate "csx_Parse_CISTPL_CFTABLE_ENTRY: handle: 0x%x\n", ch); 810*7c478bd9Sstevel@tonic-gate #endif 811*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_CFTABLE_ENTRY; 812*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 813*7c478bd9Sstevel@tonic-gate } 814*7c478bd9Sstevel@tonic-gate 815*7c478bd9Sstevel@tonic-gate int32_t 816*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LINKTARGET(client_handle_t ch, tuple_t *tp, 817*7c478bd9Sstevel@tonic-gate cistpl_linktarget_t *pt) 818*7c478bd9Sstevel@tonic-gate { 819*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 820*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 821*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_LINKTARGET: handle: 0x%x\n", ch); 822*7c478bd9Sstevel@tonic-gate #endif 823*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_LINKTARGET; 824*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 825*7c478bd9Sstevel@tonic-gate } 826*7c478bd9Sstevel@tonic-gate 827*7c478bd9Sstevel@tonic-gate int32_t 828*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_A(client_handle_t ch, tuple_t *tp, 829*7c478bd9Sstevel@tonic-gate cistpl_longlink_ac_t *pt) 830*7c478bd9Sstevel@tonic-gate { 831*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 832*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 833*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_A: handle: 0x%x\n", ch); 834*7c478bd9Sstevel@tonic-gate #endif 835*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_LONGLINK_A; 836*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 837*7c478bd9Sstevel@tonic-gate } 838*7c478bd9Sstevel@tonic-gate 839*7c478bd9Sstevel@tonic-gate int32_t 840*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_C(client_handle_t ch, tuple_t *tp, 841*7c478bd9Sstevel@tonic-gate cistpl_longlink_ac_t *pt) 842*7c478bd9Sstevel@tonic-gate { 843*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 844*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 845*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_C: handle: 0x%x\n", ch); 846*7c478bd9Sstevel@tonic-gate #endif 847*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_LONGLINK_C; 848*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 849*7c478bd9Sstevel@tonic-gate } 850*7c478bd9Sstevel@tonic-gate 851*7c478bd9Sstevel@tonic-gate int32_t 852*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_LONGLINK_MFC(client_handle_t ch, tuple_t *tp, 853*7c478bd9Sstevel@tonic-gate cistpl_longlink_mfc_t *pt) 854*7c478bd9Sstevel@tonic-gate { 855*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 856*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 857*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_MFC: " 858*7c478bd9Sstevel@tonic-gate "handle: 0x%x\n", ch); 859*7c478bd9Sstevel@tonic-gate #endif 860*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_LONGLINK_MFC; 861*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 862*7c478bd9Sstevel@tonic-gate } 863*7c478bd9Sstevel@tonic-gate 864*7c478bd9Sstevel@tonic-gate int32_t csx_Parse_CISTPL_LONGLINK_CB(client_handle_t ch, tuple_t *tp, 865*7c478bd9Sstevel@tonic-gate cistpl_longlink_cb_t *pt) 866*7c478bd9Sstevel@tonic-gate { 867*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 868*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 869*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_LONGLINK_CB: " 870*7c478bd9Sstevel@tonic-gate "handle: 0x%x\n", ch); 871*7c478bd9Sstevel@tonic-gate #endif 872*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_LONGLINK_CB; 873*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 874*7c478bd9Sstevel@tonic-gate } 875*7c478bd9Sstevel@tonic-gate 876*7c478bd9Sstevel@tonic-gate int32_t 877*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_SPCL(client_handle_t ch, tuple_t *tp, 878*7c478bd9Sstevel@tonic-gate cistpl_spcl_t *pt) 879*7c478bd9Sstevel@tonic-gate { 880*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 881*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 882*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_SPCL: handle: 0x%x\n", ch); 883*7c478bd9Sstevel@tonic-gate #endif 884*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_SPCL; 885*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 886*7c478bd9Sstevel@tonic-gate } 887*7c478bd9Sstevel@tonic-gate 888*7c478bd9Sstevel@tonic-gate int32_t 889*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_SWIL(client_handle_t ch, tuple_t *tp, 890*7c478bd9Sstevel@tonic-gate cistpl_swil_t *pt) 891*7c478bd9Sstevel@tonic-gate { 892*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 893*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 894*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_SWIL: handle: 0x%x\n", ch); 895*7c478bd9Sstevel@tonic-gate #endif 896*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_SWIL; 897*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 898*7c478bd9Sstevel@tonic-gate } 899*7c478bd9Sstevel@tonic-gate 900*7c478bd9Sstevel@tonic-gate int32_t csx_Parse_CISTPL_BAR(client_handle_t ch, tuple_t *tp, 901*7c478bd9Sstevel@tonic-gate cistpl_bar_t *pt) 902*7c478bd9Sstevel@tonic-gate { 903*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 904*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 905*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_BAR: handle: 0x%x\n", ch); 906*7c478bd9Sstevel@tonic-gate #endif 907*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_BAR; 908*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 909*7c478bd9Sstevel@tonic-gate } 910*7c478bd9Sstevel@tonic-gate 911*7c478bd9Sstevel@tonic-gate int32_t 912*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICEGEO(client_handle_t ch, tuple_t *tp, 913*7c478bd9Sstevel@tonic-gate cistpl_devicegeo_t *pt) 914*7c478bd9Sstevel@tonic-gate { 915*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 916*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 917*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO: handle: 0x%x\n", ch); 918*7c478bd9Sstevel@tonic-gate #endif 919*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICEGEO; 920*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 921*7c478bd9Sstevel@tonic-gate } 922*7c478bd9Sstevel@tonic-gate 923*7c478bd9Sstevel@tonic-gate int32_t 924*7c478bd9Sstevel@tonic-gate csx_Parse_CISTPL_DEVICEGEO_A(client_handle_t ch, tuple_t *tp, 925*7c478bd9Sstevel@tonic-gate cistpl_devicegeo_t *pt) 926*7c478bd9Sstevel@tonic-gate { 927*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 928*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 929*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_Parse_CISTPL_DEVICEGEO_A: " 930*7c478bd9Sstevel@tonic-gate "handle: 0x%x\n", ch); 931*7c478bd9Sstevel@tonic-gate #endif 932*7c478bd9Sstevel@tonic-gate tp->DesiredTuple = CISTPL_DEVICEGEO_A; 933*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, pt)); 934*7c478bd9Sstevel@tonic-gate } 935*7c478bd9Sstevel@tonic-gate 936*7c478bd9Sstevel@tonic-gate int32_t 937*7c478bd9Sstevel@tonic-gate csx_ParseTuple(client_handle_t ch, tuple_t *tp, cisparse_t *cp, uint32_t ef) 938*7c478bd9Sstevel@tonic-gate { 939*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 940*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 941*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_ParseTuple: handle: 0x%x\n", ch); 942*7c478bd9Sstevel@tonic-gate #endif 943*7c478bd9Sstevel@tonic-gate return (CardServices(ParseTuple, ch, tp, cp, ef)); 944*7c478bd9Sstevel@tonic-gate } 945*7c478bd9Sstevel@tonic-gate 946*7c478bd9Sstevel@tonic-gate /* 947*7c478bd9Sstevel@tonic-gate * The following functions are used to access various datatypes. 948*7c478bd9Sstevel@tonic-gate * These functions are not specific to PCMCIA client drivers 949*7c478bd9Sstevel@tonic-gate * and they don't depend on Card Services being present to 950*7c478bd9Sstevel@tonic-gate * operate. 951*7c478bd9Sstevel@tonic-gate */ 952*7c478bd9Sstevel@tonic-gate void 953*7c478bd9Sstevel@tonic-gate csx_Put8(acc_handle_t handle, uint32_t offset, uint8_t value) 954*7c478bd9Sstevel@tonic-gate { 955*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 956*7c478bd9Sstevel@tonic-gate 957*7c478bd9Sstevel@tonic-gate ddi_put8(handle, (uint8_t *)(hp->ah_addr + offset), value); 958*7c478bd9Sstevel@tonic-gate } 959*7c478bd9Sstevel@tonic-gate 960*7c478bd9Sstevel@tonic-gate void 961*7c478bd9Sstevel@tonic-gate csx_Put16(acc_handle_t handle, uint32_t offset, uint16_t value) 962*7c478bd9Sstevel@tonic-gate { 963*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 964*7c478bd9Sstevel@tonic-gate 965*7c478bd9Sstevel@tonic-gate ddi_put16(handle, (uint16_t *)(hp->ah_addr + offset), value); 966*7c478bd9Sstevel@tonic-gate } 967*7c478bd9Sstevel@tonic-gate 968*7c478bd9Sstevel@tonic-gate void 969*7c478bd9Sstevel@tonic-gate csx_Put32(acc_handle_t handle, uint32_t offset, uint32_t value) 970*7c478bd9Sstevel@tonic-gate { 971*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 972*7c478bd9Sstevel@tonic-gate 973*7c478bd9Sstevel@tonic-gate ddi_put32(handle, (uint32_t *)(hp->ah_addr + offset), value); 974*7c478bd9Sstevel@tonic-gate } 975*7c478bd9Sstevel@tonic-gate 976*7c478bd9Sstevel@tonic-gate void 977*7c478bd9Sstevel@tonic-gate csx_Put64(acc_handle_t handle, uint32_t offset, uint64_t value) 978*7c478bd9Sstevel@tonic-gate { 979*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 980*7c478bd9Sstevel@tonic-gate 981*7c478bd9Sstevel@tonic-gate ddi_put64(handle, (uint64_t *)(hp->ah_addr + offset), value); 982*7c478bd9Sstevel@tonic-gate } 983*7c478bd9Sstevel@tonic-gate 984*7c478bd9Sstevel@tonic-gate uint8_t 985*7c478bd9Sstevel@tonic-gate csx_Get8(acc_handle_t handle, uint32_t offset) 986*7c478bd9Sstevel@tonic-gate { 987*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 988*7c478bd9Sstevel@tonic-gate 989*7c478bd9Sstevel@tonic-gate return (ddi_get8(handle, (uint8_t *)(hp->ah_addr + offset))); 990*7c478bd9Sstevel@tonic-gate } 991*7c478bd9Sstevel@tonic-gate 992*7c478bd9Sstevel@tonic-gate uint16_t 993*7c478bd9Sstevel@tonic-gate csx_Get16(acc_handle_t handle, uint32_t offset) 994*7c478bd9Sstevel@tonic-gate { 995*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 996*7c478bd9Sstevel@tonic-gate 997*7c478bd9Sstevel@tonic-gate return (ddi_get16(handle, (uint16_t *)(hp->ah_addr + offset))); 998*7c478bd9Sstevel@tonic-gate } 999*7c478bd9Sstevel@tonic-gate 1000*7c478bd9Sstevel@tonic-gate uint32_t 1001*7c478bd9Sstevel@tonic-gate csx_Get32(acc_handle_t handle, uint32_t offset) 1002*7c478bd9Sstevel@tonic-gate { 1003*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1004*7c478bd9Sstevel@tonic-gate 1005*7c478bd9Sstevel@tonic-gate return (ddi_get32(handle, (uint32_t *)(hp->ah_addr + offset))); 1006*7c478bd9Sstevel@tonic-gate } 1007*7c478bd9Sstevel@tonic-gate 1008*7c478bd9Sstevel@tonic-gate uint64_t 1009*7c478bd9Sstevel@tonic-gate csx_Get64(acc_handle_t handle, uint32_t offset) 1010*7c478bd9Sstevel@tonic-gate { 1011*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1012*7c478bd9Sstevel@tonic-gate 1013*7c478bd9Sstevel@tonic-gate return (ddi_get64(handle, (uint64_t *)(hp->ah_addr + offset))); 1014*7c478bd9Sstevel@tonic-gate } 1015*7c478bd9Sstevel@tonic-gate 1016*7c478bd9Sstevel@tonic-gate void 1017*7c478bd9Sstevel@tonic-gate csx_RepPut8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset, 1018*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1019*7c478bd9Sstevel@tonic-gate { 1020*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1021*7c478bd9Sstevel@tonic-gate 1022*7c478bd9Sstevel@tonic-gate ddi_rep_put8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset), 1023*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1024*7c478bd9Sstevel@tonic-gate } 1025*7c478bd9Sstevel@tonic-gate 1026*7c478bd9Sstevel@tonic-gate void 1027*7c478bd9Sstevel@tonic-gate csx_RepPut16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset, 1028*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1029*7c478bd9Sstevel@tonic-gate { 1030*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1031*7c478bd9Sstevel@tonic-gate 1032*7c478bd9Sstevel@tonic-gate ddi_rep_put16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset), 1033*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1034*7c478bd9Sstevel@tonic-gate } 1035*7c478bd9Sstevel@tonic-gate 1036*7c478bd9Sstevel@tonic-gate void 1037*7c478bd9Sstevel@tonic-gate csx_RepPut32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset, 1038*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1039*7c478bd9Sstevel@tonic-gate { 1040*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1041*7c478bd9Sstevel@tonic-gate 1042*7c478bd9Sstevel@tonic-gate ddi_rep_put32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset), 1043*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1044*7c478bd9Sstevel@tonic-gate } 1045*7c478bd9Sstevel@tonic-gate 1046*7c478bd9Sstevel@tonic-gate void 1047*7c478bd9Sstevel@tonic-gate csx_RepPut64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset, 1048*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1049*7c478bd9Sstevel@tonic-gate { 1050*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1051*7c478bd9Sstevel@tonic-gate 1052*7c478bd9Sstevel@tonic-gate ddi_rep_put64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset), 1053*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1054*7c478bd9Sstevel@tonic-gate } 1055*7c478bd9Sstevel@tonic-gate 1056*7c478bd9Sstevel@tonic-gate void 1057*7c478bd9Sstevel@tonic-gate csx_RepGet8(acc_handle_t handle, uint8_t *hostaddr, uint32_t offset, 1058*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1059*7c478bd9Sstevel@tonic-gate { 1060*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1061*7c478bd9Sstevel@tonic-gate 1062*7c478bd9Sstevel@tonic-gate ddi_rep_get8(handle, hostaddr, (uint8_t *)(hp->ah_addr + offset), 1063*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1064*7c478bd9Sstevel@tonic-gate } 1065*7c478bd9Sstevel@tonic-gate 1066*7c478bd9Sstevel@tonic-gate void 1067*7c478bd9Sstevel@tonic-gate csx_RepGet16(acc_handle_t handle, uint16_t *hostaddr, uint32_t offset, 1068*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1069*7c478bd9Sstevel@tonic-gate { 1070*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1071*7c478bd9Sstevel@tonic-gate 1072*7c478bd9Sstevel@tonic-gate ddi_rep_get16(handle, hostaddr, (uint16_t *)(hp->ah_addr + offset), 1073*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1074*7c478bd9Sstevel@tonic-gate } 1075*7c478bd9Sstevel@tonic-gate 1076*7c478bd9Sstevel@tonic-gate void 1077*7c478bd9Sstevel@tonic-gate csx_RepGet32(acc_handle_t handle, uint32_t *hostaddr, uint32_t offset, 1078*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1079*7c478bd9Sstevel@tonic-gate { 1080*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1081*7c478bd9Sstevel@tonic-gate 1082*7c478bd9Sstevel@tonic-gate ddi_rep_get32(handle, hostaddr, (uint32_t *)(hp->ah_addr + offset), 1083*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1084*7c478bd9Sstevel@tonic-gate } 1085*7c478bd9Sstevel@tonic-gate 1086*7c478bd9Sstevel@tonic-gate void 1087*7c478bd9Sstevel@tonic-gate csx_RepGet64(acc_handle_t handle, uint64_t *hostaddr, uint32_t offset, 1088*7c478bd9Sstevel@tonic-gate uint32_t rc, uint32_t flags) 1089*7c478bd9Sstevel@tonic-gate { 1090*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1091*7c478bd9Sstevel@tonic-gate 1092*7c478bd9Sstevel@tonic-gate ddi_rep_get64(handle, hostaddr, (uint64_t *)(hp->ah_addr + offset), 1093*7c478bd9Sstevel@tonic-gate rc, (uint32_t)flags); 1094*7c478bd9Sstevel@tonic-gate } 1095*7c478bd9Sstevel@tonic-gate 1096*7c478bd9Sstevel@tonic-gate /* 1097*7c478bd9Sstevel@tonic-gate * The following two functions return the mapped (virtual) or physical 1098*7c478bd9Sstevel@tonic-gate * base address associated with the passed handle if the address 1099*7c478bd9Sstevel@tonic-gate * can be directly accessed by the caller. If the object represented 1100*7c478bd9Sstevel@tonic-gate * by the handle needs to be accessed through a common access 1101*7c478bd9Sstevel@tonic-gate * function, CS_BAD_BASE is returned. 1102*7c478bd9Sstevel@tonic-gate * 1103*7c478bd9Sstevel@tonic-gate * XXX - Need to figure out how to determine when to return CS_BAD_BASE 1104*7c478bd9Sstevel@tonic-gate * and also we need more generic return codes not tied to CS. 1105*7c478bd9Sstevel@tonic-gate */ 1106*7c478bd9Sstevel@tonic-gate int32_t 1107*7c478bd9Sstevel@tonic-gate csx_GetMappedAddr(acc_handle_t handle, void **addr) 1108*7c478bd9Sstevel@tonic-gate { 1109*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1110*7c478bd9Sstevel@tonic-gate 1111*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1112*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1113*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetMappedAddr: handle: 0x%p\n", handle); 1114*7c478bd9Sstevel@tonic-gate #endif 1115*7c478bd9Sstevel@tonic-gate 1116*7c478bd9Sstevel@tonic-gate *addr = hp->ah_addr; 1117*7c478bd9Sstevel@tonic-gate 1118*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); /* XXX should be generic return code */ 1119*7c478bd9Sstevel@tonic-gate } 1120*7c478bd9Sstevel@tonic-gate 1121*7c478bd9Sstevel@tonic-gate int32_t 1122*7c478bd9Sstevel@tonic-gate csx_GetPhysAddr(acc_handle_t handle, void **addr) 1123*7c478bd9Sstevel@tonic-gate { 1124*7c478bd9Sstevel@tonic-gate #ifndef lint 1125*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1126*7c478bd9Sstevel@tonic-gate #endif /* lint */ 1127*7c478bd9Sstevel@tonic-gate 1128*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1129*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1130*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetPhysAddr: handle: 0x%p\n", handle); 1131*7c478bd9Sstevel@tonic-gate #endif 1132*7c478bd9Sstevel@tonic-gate 1133*7c478bd9Sstevel@tonic-gate *addr = NULL; 1134*7c478bd9Sstevel@tonic-gate 1135*7c478bd9Sstevel@tonic-gate return (CS_BAD_BASE); 1136*7c478bd9Sstevel@tonic-gate } 1137*7c478bd9Sstevel@tonic-gate 1138*7c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 1139*7c478bd9Sstevel@tonic-gate int32_t 1140*7c478bd9Sstevel@tonic-gate csx_DupHandle(acc_handle_t handle, acc_handle_t *dup, uint32_t flags) 1141*7c478bd9Sstevel@tonic-gate { 1142*7c478bd9Sstevel@tonic-gate #ifndef lint 1143*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1144*7c478bd9Sstevel@tonic-gate #endif /* lint */ 1145*7c478bd9Sstevel@tonic-gate 1146*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1147*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1148*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_DupHandle: handle: 0x%p\n", handle); 1149*7c478bd9Sstevel@tonic-gate #endif 1150*7c478bd9Sstevel@tonic-gate 1151*7c478bd9Sstevel@tonic-gate return (CS_BAD_HANDLE); 1152*7c478bd9Sstevel@tonic-gate 1153*7c478bd9Sstevel@tonic-gate #ifdef XXX 1154*7c478bd9Sstevel@tonic-gate *dup = (acc_handle_t)kmem_alloc(sizeof (acc_hdl_t), KM_SLEEP); 1155*7c478bd9Sstevel@tonic-gate ((acc_hdl_t *)*dup)->ddi_handle = 1156*7c478bd9Sstevel@tonic-gate (ddi_acc_handle_t *)kmem_alloc(sizeof (ddi_acc_impl_t), 1157*7c478bd9Sstevel@tonic-gate KM_SLEEP); 1158*7c478bd9Sstevel@tonic-gate 1159*7c478bd9Sstevel@tonic-gate bcopy((caddr_t)hp, (caddr_t)((acc_hdl_t *)*dup)->ddi_handle, 1160*7c478bd9Sstevel@tonic-gate sizeof (ddi_acc_impl_t)); 1161*7c478bd9Sstevel@tonic-gate 1162*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 1163*7c478bd9Sstevel@tonic-gate #endif 1164*7c478bd9Sstevel@tonic-gate } 1165*7c478bd9Sstevel@tonic-gate 1166*7c478bd9Sstevel@tonic-gate int32_t 1167*7c478bd9Sstevel@tonic-gate csx_FreeHandle(acc_handle_t *handle) 1168*7c478bd9Sstevel@tonic-gate { 1169*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1170*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1171*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_FreeHandle: handle: 0x%p\n", *handle); 1172*7c478bd9Sstevel@tonic-gate #endif 1173*7c478bd9Sstevel@tonic-gate return (CS_BAD_HANDLE); 1174*7c478bd9Sstevel@tonic-gate 1175*7c478bd9Sstevel@tonic-gate #ifdef XXX 1176*7c478bd9Sstevel@tonic-gate 1177*7c478bd9Sstevel@tonic-gate kmem_free((void *)((acc_hdl_t *)*handle)->ddi_handle, 1178*7c478bd9Sstevel@tonic-gate sizeof (ddi_acc_impl_t)); 1179*7c478bd9Sstevel@tonic-gate kmem_free((void *)(acc_hdl_t *)*handle, sizeof (acc_hdl_t)); 1180*7c478bd9Sstevel@tonic-gate 1181*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 1182*7c478bd9Sstevel@tonic-gate #endif 1183*7c478bd9Sstevel@tonic-gate } 1184*7c478bd9Sstevel@tonic-gate 1185*7c478bd9Sstevel@tonic-gate /* 1186*7c478bd9Sstevel@tonic-gate * XXX - Probably want to remove these fucntions soon 1187*7c478bd9Sstevel@tonic-gate */ 1188*7c478bd9Sstevel@tonic-gate int32_t 1189*7c478bd9Sstevel@tonic-gate csx_GetHandleOffset(acc_handle_t handle, uint32_t *offset) 1190*7c478bd9Sstevel@tonic-gate { 1191*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1192*7c478bd9Sstevel@tonic-gate 1193*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1194*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1195*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_GetHandleOffset: handle: 0x%p\n", handle); 1196*7c478bd9Sstevel@tonic-gate #endif 1197*7c478bd9Sstevel@tonic-gate 1198*7c478bd9Sstevel@tonic-gate *offset = hp->ah_offset; 1199*7c478bd9Sstevel@tonic-gate 1200*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 1201*7c478bd9Sstevel@tonic-gate } 1202*7c478bd9Sstevel@tonic-gate 1203*7c478bd9Sstevel@tonic-gate int32_t 1204*7c478bd9Sstevel@tonic-gate csx_SetHandleOffset(acc_handle_t handle, uint32_t offset) 1205*7c478bd9Sstevel@tonic-gate { 1206*7c478bd9Sstevel@tonic-gate ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle); 1207*7c478bd9Sstevel@tonic-gate 1208*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1209*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1210*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "csx_SetHandleOffset: handle: 0x%p\n", handle); 1211*7c478bd9Sstevel@tonic-gate #endif 1212*7c478bd9Sstevel@tonic-gate 1213*7c478bd9Sstevel@tonic-gate hp->ah_offset = offset; 1214*7c478bd9Sstevel@tonic-gate 1215*7c478bd9Sstevel@tonic-gate return (CS_SUCCESS); 1216*7c478bd9Sstevel@tonic-gate } 1217*7c478bd9Sstevel@tonic-gate 1218*7c478bd9Sstevel@tonic-gate static int 1219*7c478bd9Sstevel@tonic-gate cs_no_carservices() 1220*7c478bd9Sstevel@tonic-gate { 1221*7c478bd9Sstevel@tonic-gate #ifdef CS_STUBS_DEBUG 1222*7c478bd9Sstevel@tonic-gate if (cs_stubs_debug > 3) 1223*7c478bd9Sstevel@tonic-gate cmn_err(CE_CONT, "cs_no_carservices\n"); 1224*7c478bd9Sstevel@tonic-gate #endif 1225*7c478bd9Sstevel@tonic-gate return (CS_UNSUPPORTED_FUNCTION); 1226*7c478bd9Sstevel@tonic-gate } 1227