/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This is the PCMCIA Card Services kernel stubs module. It provides
* the various PCMCIA kernel framework entry points.
*/
#if defined(DEBUG)
#define CS_STUBS_DEBUG
#endif
#include <sys/autoconf.h>
#include <sys/sservice.h>
#ifdef CS_STUBS_DEBUG
int cs_stubs_debug = 0;
#endif
static int do_cs_call = 0;
static int cs_no_carservices(void);
#ifdef USE_CS_STUBS_MODULE
/*
* Module linkage information for the kernel.
*/
"PCMCIA Card Services stub module"
};
(void *)&modlmisc,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
if (!do_cs_call)
return (mod_remove(&modlinkage));
else
return (EBUSY);
}
int
{
}
#endif /* USE_CS_STUBS_MODULE */
/*
* csx_register_cardservices - The Card Services loadable module
* calls this runction to register it's entry point.
*
* Returns: CS_SUCCESS - if operation sucessful
* CS_UNSUPPORTED_FUNCTION - if invalid function code
* CS_BAD_HANDLE - if Card Services is not registered
*/
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 2)
"magic: 0x%x function: 0x%x cardservices: 0x%p\n",
#endif
return (CS_BAD_ARGS);
case CS_ENTRY_REGISTER:
do_cs_call = 1;
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 2)
#endif
return (CS_SUCCESS);
case CS_ENTRY_DEREGISTER:
do_cs_call = 0;
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 2)
"csx_register_cardservices: CS_ENTRY_DEREGISTER\n");
#endif
return (CS_UNSUPPORTED_FUNCTION);
case CS_ENTRY_INQUIRE:
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 2)
#endif
if (do_cs_call)
return (CS_SUCCESS);
else
return (CS_BAD_HANDLE);
default:
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 2)
#endif
return (CS_UNSUPPORTED_FUNCTION);
}
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"csx_AccessConfigurationRegister: handle: 0x%x\n", ch);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"handle: (no handle yet)\n");
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
/*
* CIS tuple parsing functions - one entrypoint per tuple that we know
* how to parse
*/
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"csx_Parse_CISTPL_CFTABLE_ENTRY: handle: 0x%x\n", ch);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"handle: 0x%x\n", ch);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"handle: 0x%x\n", ch);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
"handle: 0x%x\n", ch);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
}
/*
* The following functions are used to access various datatypes.
* These functions are not specific to PCMCIA client drivers
* and they don't depend on Card Services being present to
* operate.
*/
void
{
}
void
{
}
void
{
}
void
{
}
{
}
{
}
{
}
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
/*
* The following two functions return the mapped (virtual) or physical
* base address associated with the passed handle if the address
* can be directly accessed by the caller. If the object represented
* by the handle needs to be accessed through a common access
* function, CS_BAD_BASE is returned.
*
* XXX - Need to figure out how to determine when to return CS_BAD_BASE
* and also we need more generic return codes not tied to CS.
*/
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_SUCCESS); /* XXX should be generic return code */
}
{
#ifndef lint
#endif /* lint */
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_BAD_BASE);
}
/*ARGSUSED*/
{
#ifndef lint
#endif /* lint */
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_BAD_HANDLE);
#ifdef XXX
KM_SLEEP);
sizeof (ddi_acc_impl_t));
return (CS_SUCCESS);
#endif
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_BAD_HANDLE);
#ifdef XXX
sizeof (ddi_acc_impl_t));
return (CS_SUCCESS);
#endif
}
/*
* XXX - Probably want to remove these fucntions soon
*/
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_SUCCESS);
}
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_SUCCESS);
}
static int
{
#ifdef CS_STUBS_DEBUG
if (cs_stubs_debug > 3)
#endif
return (CS_UNSUPPORTED_FUNCTION);
}