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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
'\" te
.\" Copyright (c) 2002, 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_REGISTERCLIENT 9F "April 9, 2016"
.SH NAME
csx_RegisterClient \- register a client
.SH SYNOPSIS
.LP
.nf
#include <sys/pccard.h>
\fBint32_t\fR \fBcsx_RegisterClient\fR(\fBclient_handle_t *\fR\fIch\fR, \fBclient_reg_t *\fR\fIcr\fR);
.fi
.SH INTERFACE LEVEL
.LP
Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
.SH PARAMETERS
.ne 2
.na
\fB\fIch\fR\fR
.ad
.RS 6n
Pointer to a \fBclient_handle_t\fR structure.
.RE
.sp
.ne 2
.na
\fB\fImc\fR\fR
.ad
.RS 6n
Pointer to a \fBclient_reg_t\fR structure.
.RE
.SH DESCRIPTION
.LP
This function registers a client with Card Services and returns a unique client
handle for the client. The client handle must be passed to
\fBcsx_DeregisterClient\fR(9F) when the client terminates.
.SH STRUCTURE MEMBERS
.LP
The structure members of \fBclient_reg_t\fR are:
.sp
.in +2
.nf
uint32_t Attributes;
uint32_t EventMask;
event_callback_args_t event_callback_args;
uint32_t Version; /* CS version to expect */
csfunction_t *event_handler;
ddi_iblock_cookie_t *iblk_cookie; /* event iblk cookie */
ddi_idevice_cookie_t *idev_cookie; /* event idev cookie */
dev_info_t *dip; /* client's dip */
char driver_name[MODMAXNAMELEN];
.fi
.in -2
.sp
.LP
The fields are defined as follows:
.sp
.ne 2
.na
\fB\fBAttributes\fR\fR
.ad
.RS 23n
This field is bit-mapped and defined as follows:
.sp
.ne 2
.na
\fB\fBINFO_MEM_CLIENT\fR\fR
.ad
.sp .6
.RS 4n
Memory client device driver.
.RE
.sp
.ne 2
.na
\fB\fBINFO_MTD_CLIENT\fR\fR
.ad
.sp .6
.RS 4n
Memory Technology Driver client.
.RE
.sp
.ne 2
.na
\fB\fBINFO_IO_CLIENT\fR\fR
.ad
.sp .6
.RS 4n
\fBIO\fR client device driver.
.RE
.sp
.ne 2
.na
\fB\fBINFO_CARD_SHARE\fR\fR
.ad
.sp .6
.RS 4n
Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
\fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
.RE
.sp
.ne 2
.na
\fB\fBINFO_CARD_EXCL\fR\fR
.ad
.sp .6
.RS 4n
Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
\fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
.sp
.ne 2
.na
\fB\fBINFO_MEM_CLIENT\fR\fR
.ad
.br
.na
\fB\fBINFO_MTD_CLIENT\fR\fR
.ad
.br
.na
\fB\fBINFO_IO_CLIENT\fR\fR
.ad
.sp .6
.RS 4n
These bits are mutually exclusive (that is, only one bit may be set), but one
of the bits must be set.
.RE
.sp
.ne 2
.na
\fB\fBINFO_CARD_SHARE\fR\fR
.ad
.br
.na
\fB\fBINFO_CARD_EXCL\fR\fR
.ad
.sp .6
.RS 4n
If either of these bits is set, the client will receive a
\fBCS_EVENT_REGISTRATION_COMPLETE\fR event when Card Services has completed its
internal client registration processing and after a successful call to
\fBcsx_RequestSocketMask\fR(9F).
.sp
Also, if either of these bits is set, and if a card of the type that the client
can control is currently inserted in the socket (and after a successful call to
\fBcsx_RequestSocketMask\fR(9F)), the client will receive an artificial
\fBCS_EVENT_CARD_INSERTION\fR event.
.RE
.RE
.RE
.sp
.ne 2
.na
\fB\fBEvent\fR \fBMask\fR\fR
.ad
.RS 23n
This field is bit-mapped and specifies the client's global event mask. Card
Services performs event notification based on this field. See
\fBcsx_event_handler\fR(9E) for valid event definitions and for additional
information about handling events.
.RE
.sp
.ne 2
.na
\fB\fBevent_callback_args\fR\fR
.ad
.RS 23n
The \fBevent_callback_args_t\fR structure members are:
.sp
.in +2
.nf
void *client_data;
.fi
.in -2
The \fBclient_data\fR field may be used to provide data available to the event
handler (see \fBcsx_event_handler\fR(9E)). Typically, this is the client
driver's soft state pointer.
.RE
.sp
.ne 2
.na
\fB\fBVersion\fR\fR
.ad
.RS 23n
This field contains the specific Card Services version number that the client
expects to use. Typically, the client will use the \fBCS_VERSION\fR macro to
specify to Card Services which version of Card Services the client expects.
.RE
.sp
.ne 2
.na
\fB\fBevent_handler\fR\fR
.ad
.RS 23n
The client event callback handler entry point is passed in the
\fBevent_handler\fR field.
.RE
.sp
.ne 2
.na
\fB\fBiblk_cookie\fR\fR
.ad
.br
.na
\fB\fBidev_cookie\fR\fR
.ad
.RS 23n
These fields must be used by the client to set up mutexes that are used in the
client's event callback handler when handling high priority events.
.RE
.sp
.ne 2
.na
\fB\fBdip\fR\fR
.ad
.RS 23n
The client must set this field with a pointer to the client's dip.
.RE
.sp
.ne 2
.na
\fB\fBdriver_name\fR\fR
.ad
.RS 23n
The client must copy a driver-unique name into this member. This name must be
identical across all instances of the driver.
.RE
.SH RETURN VALUES
.ne 2
.na
\fB\fBCS_SUCCESS\fR\fR
.ad
.RS 27n
Successful operation.
.RE
.sp
.ne 2
.na
\fB\fBCS_BAD_ATTRIBUTE\fR\fR
.ad
.RS 27n
No client type or more than one client type specified.
.RE
.sp
.ne 2
.na
\fB\fBCS_OUT_OF_RESOURCE\fR\fR
.ad
.RS 27n
Card Services is unable to register client.
.RE
.sp
.ne 2
.na
\fB\fBCS_BAD_VERSION\fR\fR
.ad
.RS 27n
Card Services version is incompatible with client.
.RE
.sp
.ne 2
.na
\fB\fBCS_BAD_HANDLE\fR\fR
.ad
.RS 27n
Client has already registered for this socket.
.RE
.sp
.ne 2
.na
\fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
.ad
.RS 27n
No \fBPCMCIA\fR hardware installed.
.RE
.SH CONTEXT
.LP
This function may be called from user or kernel context.
.SH SEE ALSO
.LP
\fBcsx_DeregisterClient\fR(9F), \fBcsx_RequestSocketMask\fR(9F)
.sp
.LP
\fIPC Card 95 Standard\fR, PCMCIA/JEIDA
|