1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
'\" te
.\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH CSX_CS_DDI_INFO 9F "Jul 19, 1996"
.SH NAME
csx_CS_DDI_Info \- obtain DDI information
.SH SYNOPSIS
.nf
#include <sys/pccard.h>
\fBint32_t\fR \fBcsx_CS_DDI_Info\fR(\fBcs_ddi_info_t *\fR\fIcdi\fR);
.fi
.SH INTERFACE LEVEL
illumos \fBDDI \fRSpecific (illumos \fBDDI) \fR
.SH PARAMETERS
.ne 2
.na
\fB\fIcdi\fR \fR
.ad
.RS 8n
Pointer to a \fBcs_ddi_info_t\fR structure.
.RE
.SH DESCRIPTION
This function is an illumos-specific extension that is used by clients that need
to provide the \fIxx_getinfo\fR driver entry point (see \fBgetinfo\fR(9E)). It
provides a method for clients to obtain \fBDDI \fRinformation based on their
socket number and client driver name.
.SH STRUCTURE MEMBERS
The structure members of \fBcs_ddi_info_t\fR are:
.sp
.in +2
.nf
uint32_t Socket; /* socket number */
char* driver_name; /* unique driver name */
dev_info_t *dip; /* dip */
int32_t instance; /* instance */
.fi
.in -2
.sp
.LP
The fields are defined as follows:
.sp
.ne 2
.na
\fB\fBSocket\fR \fR
.ad
.RS 16n
This field must be set to the physical socket number that the client is
interested in getting information about.
.RE
.sp
.ne 2
.na
\fB\fBdriver_name\fR \fR
.ad
.RS 16n
This field must be set to a string containing the name of the client driver to
get information about.
.RE
.sp
.LP
If \fBcsx_CS_DDI_Info()\fR is used in a client's \fIxx_getinfo\fR function,
then the client will typically extract the \fBSocket\fR value from the
\fB*\fR\fIarg\fR argument and it \fImust\fR set the \fBdriver_name\fR field to
the same string used with \fBcsx_RegisterClient\fR(9F).
.sp
.LP
If the \fBdriver_name\fR is found on the \fBSocket\fR, the
\fBcsx_CS_DDI_Info()\fR function returns both the \fBdev_info\fR pointer and
the \fBinstance\fR fields for the requested driver instance.
.SH RETURN VALUES
.ne 2
.na
\fB\fBCS_SUCCESS\fR \fR
.ad
.RS 28n
Successful operation.
.RE
.sp
.ne 2
.na
\fB\fBCS_BAD_SOCKET\fR \fR
.ad
.RS 28n
Client not found on \fBSocket\fR.
.RE
.sp
.ne 2
.na
\fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
.ad
.RS 28n
No \fBPCMCIA \fRhardware installed.
.RE
.SH CONTEXT
This function may be called from user or kernel context.
.SH EXAMPLES
\fBExample 1 \fR: Using csx_CS_DDI_Info
.sp
.LP
The following example shows how a client might call the \fBcsx_CS_DDI_Info()\fR
in the client's \fIxx_getinfo\fR function to return the dip or the instance
number:
.sp
.in +2
.nf
static int
pcepp_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
void **result)
{
int error = DDI_SUCCESS;
pcepp_state_t *pps;
cs_ddi_info_t cs_ddi_info;
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
cs_ddi_info.driver_name = pcepp_name;
if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
return (DDI_FAILURE);
if (!(pps = ddi_get_soft_state(pcepp_soft_state_p,
cs_ddi_info.instance))) {
*result = NULL;
} else {
*result = pps->dip;
}
break;
case DDI_INFO_DEVT2INSTANCE:
cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
cs_ddi_info.driver_name = pcepp_name;
if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
return (DDI_FAILURE);
*result = (void *)cs_ddi_info.instance;
break;
default:
error = DDI_FAILURE;
break;
}
return (error);
}
.fi
.in -2
.SH SEE ALSO
.BR getinfo (9E),
.BR csx_RegisterClient (9F),
.BR ddi_get_instance (9F)
.sp
.LP
\fIPC Card 95 Standard, PCMCIA/JEIDA\fR
|