2 .\" Copyright (c) 2002, 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_REGISTERCLIENT 9F "April 9, 2016"
8 csx_RegisterClient \- register a client
12 #include <sys/pccard.h>
16 \fBint32_t\fR \fBcsx_RegisterClient\fR(\fBclient_handle_t *\fR\fIch\fR, \fBclient_reg_t *\fR\fIcr\fR);
21 Solaris \fBDDI\fR Specific (Solaris \fBDDI\fR)
28 Pointer to a \fBclient_handle_t\fR structure.
37 Pointer to a \fBclient_reg_t\fR structure.
42 This function registers a client with Card Services and returns a unique client
43 handle for the client. The client handle must be passed to
44 \fBcsx_DeregisterClient\fR(9F) when the client terminates.
47 The structure members of \fBclient_reg_t\fR are:
53 event_callback_args_t event_callback_args;
54 uint32_t Version; /* CS version to expect */
55 csfunction_t *event_handler;
56 ddi_iblock_cookie_t *iblk_cookie; /* event iblk cookie */
57 ddi_idevice_cookie_t *idev_cookie; /* event idev cookie */
58 dev_info_t *dip; /* client's dip */
59 char driver_name[MODMAXNAMELEN];
65 The fields are defined as follows:
69 \fB\fBAttributes\fR\fR
72 This field is bit-mapped and defined as follows:
76 \fB\fBINFO_MEM_CLIENT\fR\fR
80 Memory client device driver.
86 \fB\fBINFO_MTD_CLIENT\fR\fR
90 Memory Technology Driver client.
96 \fB\fBINFO_IO_CLIENT\fR\fR
100 \fBIO\fR client device driver.
106 \fB\fBINFO_CARD_SHARE\fR\fR
110 Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
111 \fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
117 \fB\fBINFO_CARD_EXCL\fR\fR
121 Generate artificial \fBCS_EVENT_CARD_INSERTION\fR and
122 \fBCS_EVENT_REGISTRATION_COMPLETE\fR events.
126 \fB\fBINFO_MEM_CLIENT\fR\fR
130 \fB\fBINFO_MTD_CLIENT\fR\fR
134 \fB\fBINFO_IO_CLIENT\fR\fR
138 These bits are mutually exclusive (that is, only one bit may be set), but one
139 of the bits must be set.
145 \fB\fBINFO_CARD_SHARE\fR\fR
149 \fB\fBINFO_CARD_EXCL\fR\fR
153 If either of these bits is set, the client will receive a
154 \fBCS_EVENT_REGISTRATION_COMPLETE\fR event when Card Services has completed its
155 internal client registration processing and after a successful call to
156 \fBcsx_RequestSocketMask\fR(9F).
158 Also, if either of these bits is set, and if a card of the type that the client
159 can control is currently inserted in the socket (and after a successful call to
160 \fBcsx_RequestSocketMask\fR(9F)), the client will receive an artificial
161 \fBCS_EVENT_CARD_INSERTION\fR event.
171 \fB\fBEvent\fR \fBMask\fR\fR
174 This field is bit-mapped and specifies the client's global event mask. Card
175 Services performs event notification based on this field. See
176 \fBcsx_event_handler\fR(9E) for valid event definitions and for additional
177 information about handling events.
183 \fB\fBevent_callback_args\fR\fR
186 The \fBevent_callback_args_t\fR structure members are:
194 The \fBclient_data\fR field may be used to provide data available to the event
195 handler (see \fBcsx_event_handler\fR(9E)). Typically, this is the client
196 driver's soft state pointer.
205 This field contains the specific Card Services version number that the client
206 expects to use. Typically, the client will use the \fBCS_VERSION\fR macro to
207 specify to Card Services which version of Card Services the client expects.
213 \fB\fBevent_handler\fR\fR
216 The client event callback handler entry point is passed in the
217 \fBevent_handler\fR field.
223 \fB\fBiblk_cookie\fR\fR
227 \fB\fBidev_cookie\fR\fR
230 These fields must be used by the client to set up mutexes that are used in the
231 client's event callback handler when handling high priority events.
240 The client must set this field with a pointer to the client's dip.
246 \fB\fBdriver_name\fR\fR
249 The client must copy a driver-unique name into this member. This name must be
250 identical across all instances of the driver.
256 \fB\fBCS_SUCCESS\fR\fR
259 Successful operation.
265 \fB\fBCS_BAD_ATTRIBUTE\fR\fR
268 No client type or more than one client type specified.
274 \fB\fBCS_OUT_OF_RESOURCE\fR\fR
277 Card Services is unable to register client.
283 \fB\fBCS_BAD_VERSION\fR\fR
286 Card Services version is incompatible with client.
292 \fB\fBCS_BAD_HANDLE\fR\fR
295 Client has already registered for this socket.
301 \fB\fBCS_UNSUPPORTED_FUNCTION\fR\fR
304 No \fBPCMCIA\fR hardware installed.
309 This function may be called from user or kernel context.
312 \fBcsx_DeregisterClient\fR(9F), \fBcsx_RequestSocketMask\fR(9F)
315 \fIPC Card 95 Standard\fR, PCMCIA/JEIDA