2 .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" 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]
6 .TH CSX_CS_DDI_INFO 9F "Jul 19, 1996"
8 csx_CS_DDI_Info \- obtain DDI information
12 #include <sys/pccard.h>
16 \fBint32_t\fR \fBcsx_CS_DDI_Info\fR(\fBcs_ddi_info_t *\fR\fIcdi\fR);
22 Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
30 Pointer to a \fBcs_ddi_info_t\fR structure.
36 This function is a Solaris-specific extension that is used by clients that need
37 to provide the \fIxx_getinfo\fR driver entry point (see \fBgetinfo\fR(9E)). It
38 provides a method for clients to obtain \fBDDI \fRinformation based on their
39 socket number and client driver name.
43 The structure members of \fBcs_ddi_info_t\fR are:
47 uint32_t Socket; /* socket number */
48 char* driver_name; /* unique driver name */
49 dev_info_t *dip; /* dip */
50 int32_t instance; /* instance */
56 The fields are defined as follows:
63 This field must be set to the physical socket number that the client is
64 interested in getting information about.
70 \fB\fBdriver_name\fR \fR
73 This field must be set to a string containing the name of the client driver to
74 get information about.
79 If \fBcsx_CS_DDI_Info()\fR is used in a client's \fIxx_getinfo\fR function,
80 then the client will typically extract the \fBSocket\fR value from the
81 \fB*\fR\fIarg\fR argument and it \fImust\fR set the \fBdriver_name\fR field to
82 the same string used with \fBcsx_RegisterClient\fR(9F).
85 If the \fBdriver_name\fR is found on the \fBSocket\fR, the
86 \fBcsx_CS_DDI_Info()\fR function returns both the \fBdev_info\fR pointer and
87 the \fBinstance\fR fields for the requested driver instance.
92 \fB\fBCS_SUCCESS\fR \fR
101 \fB\fBCS_BAD_SOCKET\fR \fR
104 Client not found on \fBSocket\fR.
110 \fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
113 No \fBPCMCIA \fRhardware installed.
119 This function may be called from user or kernel context.
122 \fBExample 1 \fR: Using csx_CS_DDI_Info
125 The following example shows how a client might call the \fBcsx_CS_DDI_Info()\fR
126 in the client's \fIxx_getinfo\fR function to return the dip or the instance
133 pcepp_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
136 int error = DDI_SUCCESS;
138 cs_ddi_info_t cs_ddi_info;
142 case DDI_INFO_DEVT2DEVINFO:
143 cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
144 cs_ddi_info.driver_name = pcepp_name;
145 if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
146 return (DDI_FAILURE);
147 if (!(pps = ddi_get_soft_state(pcepp_soft_state_p,
148 cs_ddi_info.instance))) {
155 case DDI_INFO_DEVT2INSTANCE:
156 cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
157 cs_ddi_info.driver_name = pcepp_name;
158 if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
159 return (DDI_FAILURE);
160 *result = (void *)cs_ddi_info.instance;
177 \fBgetinfo\fR(9E), \fBcsx_RegisterClient\fR(9F), \fBddi_get_instance\fR(9F)
180 \fIPC Card 95 Standard, PCMCIA/JEIDA\fR