1 '\" te
   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_GETSTATUS 9F "Jul 19, 1996"
   7 .SH NAME
   8 csx_GetStatus \- return the current status of a PC Card and its socket
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 #include <sys/pccard.h>
  13 
  14 
  15 
  16 \fBint32_t\fR \fBcsx_GetStatus\fR(\fBclient_handle_t\fR \fIch\fR, \fBget_status_t *\fR\fIgs\fR);
  17 .fi
  18 
  19 .SH INTERFACE LEVEL
  20 .sp
  21 .LP
  22 Solaris \fBDDI \fRSpecific (Solaris \fBDDI) \fR
  23 .SH PARAMETERS
  24 .sp
  25 .ne 2
  26 .na
  27 \fB\fIch\fR \fR
  28 .ad
  29 .RS 7n
  30 Client handle returned from \fBcsx_RegisterClient\fR(9F).
  31 .RE
  32 
  33 .sp
  34 .ne 2
  35 .na
  36 \fB\fIgs\fR \fR
  37 .ad
  38 .RS 7n
  39 Pointer to a \fBget_status_t\fR structure.
  40 .RE
  41 
  42 .SH DESCRIPTION
  43 .sp
  44 .LP
  45 This function returns the current status of a \fBPC \fRCard and its socket.
  46 .SH STRUCTURE MEMBERS
  47 .sp
  48 .LP
  49 The structure members of \fBget_status_t\fR are:
  50 .sp
  51 .in +2
  52 .nf
  53 uint32_t     Socket;          /* socket number*/
  54 uint32_t     CardState;       /* "live" card status for this client*/
  55 uint32_t     SocketState;     /* latched socket values */
  56 uint32_t     raw_CardState;   /* raw live card status */
  57 .fi
  58 .in -2
  59 
  60 .sp
  61 .LP
  62 The fields are defined as follows:
  63 .sp
  64 .ne 2
  65 .na
  66 \fB\fBSocket\fR \fR
  67 .ad
  68 .RS 18n
  69 Not used in Solaris, but for portability with other Card Services
  70 implementations, it should be set to the logical socket number.
  71 .RE
  72 
  73 .sp
  74 .ne 2
  75 .na
  76 \fB\fBCardState\fR \fR
  77 .ad
  78 .RS 18n
  79 The \fBCardState\fR field is the bit-mapped output data returned from Card
  80 Services. The bits identify what Card Services thinks the current state of the
  81 installed \fBPC \fRCard is. The bits are:
  82 .sp
  83 .ne 2
  84 .na
  85 \fBCS_STATUS_WRITE_PROTECTED\fR
  86 .ad
  87 .sp .6
  88 .RS 4n
  89 Card is write protected
  90 .RE
  91 
  92 .sp
  93 .ne 2
  94 .na
  95 \fBCS_STATUS_CARD_LOCKED\fR
  96 .ad
  97 .sp .6
  98 .RS 4n
  99 Card is locked
 100 .RE
 101 
 102 .sp
 103 .ne 2
 104 .na
 105 \fBCS_STATUS_EJECTION_REQUEST\fR
 106 .ad
 107 .sp .6
 108 .RS 4n
 109 Ejection request in progress
 110 .RE
 111 
 112 .sp
 113 .ne 2
 114 .na
 115 \fBCS_STATUS_INSERTION_REQUEST\fR
 116 .ad
 117 .sp .6
 118 .RS 4n
 119 Insertion request in progress
 120 .RE
 121 
 122 .sp
 123 .ne 2
 124 .na
 125 \fBCS_STATUS_BATTERY_DEAD\fR
 126 .ad
 127 .sp .6
 128 .RS 4n
 129 Card battery is dead
 130 .RE
 131 
 132 .sp
 133 .ne 2
 134 .na
 135 \fBCS_STATUS_BATTERY_DEAD\fR
 136 .ad
 137 .sp .6
 138 .RS 4n
 139 Card battery is dead (\fBBVD1\fR)
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fBCS_STATUS_BATTERY_LOW\fR
 146 .ad
 147 .sp .6
 148 .RS 4n
 149 Card battery is low (\fBBVD2\fR)
 150 .RE
 151 
 152 .sp
 153 .ne 2
 154 .na
 155 \fBCS_STATUS_CARD_READY\fR
 156 .ad
 157 .sp .6
 158 .RS 4n
 159 Card is READY
 160 .RE
 161 
 162 .sp
 163 .ne 2
 164 .na
 165 \fBCS_STATUS_CARD_INSERTED\fR
 166 .ad
 167 .sp .6
 168 .RS 4n
 169 Card is inserted
 170 .RE
 171 
 172 .sp
 173 .ne 2
 174 .na
 175 \fBCS_STATUS_REQ_ATTN\fR
 176 .ad
 177 .sp .6
 178 .RS 4n
 179 Extended status attention request
 180 .RE
 181 
 182 .sp
 183 .ne 2
 184 .na
 185 \fBCS_STATUS_RES_EVT1\fR
 186 .ad
 187 .sp .6
 188 .RS 4n
 189 Extended status reserved event status
 190 .RE
 191 
 192 .sp
 193 .ne 2
 194 .na
 195 \fBCS_STATUS_RES_EVT2\fR
 196 .ad
 197 .sp .6
 198 .RS 4n
 199 Extended status reserved event status
 200 .RE
 201 
 202 .sp
 203 .ne 2
 204 .na
 205 \fB CS_STATUS_RES_EVT3\fR
 206 .ad
 207 .sp .6
 208 .RS 4n
 209 Extended status reserved event status
 210 .RE
 211 
 212 .sp
 213 .ne 2
 214 .na
 215 \fBCS_STATUS_VCC_50\fR
 216 .ad
 217 .sp .6
 218 .RS 4n
 219 5.0 Volts Vcc Indicated
 220 .RE
 221 
 222 .sp
 223 .ne 2
 224 .na
 225 \fBCS_STATUS_VCC_33\fR
 226 .ad
 227 .sp .6
 228 .RS 4n
 229 3.3 Volts Vcc Indicated
 230 .RE
 231 
 232 .sp
 233 .ne 2
 234 .na
 235 \fBCS_STATUS_VCC_XX\fR
 236 .ad
 237 .sp .6
 238 .RS 4n
 239 X.X Volts Vcc Indicated
 240 .RE
 241 
 242 The state of the \fBCS_STATUS_CARD_INSERTED\fR bit indicates whether the \fBPC
 243 \fRCard associated with this driver instance, not just any card, is inserted in
 244 the socket. If an \fBI/O \fRcard is installed in the specified socket, card
 245 state is returned from the \fBPRR\fR (Pin Replacement Register) and the
 246 \fBESR\fR (Extended Status Register) (if present). If certain state bits are
 247 not present in the \fBPRR\fR or \fBESR\fR, a simulated state bit value is
 248 returned as defined below:
 249 .sp
 250 .ne 2
 251 .na
 252 \fBCS_STATUS_WRITE_PROTECTED\fR
 253 .ad
 254 .RS 29n
 255 Not write protected
 256 .RE
 257 
 258 .sp
 259 .ne 2
 260 .na
 261 \fBCS_STATUS_BATTERY_DEAD\fR
 262 .ad
 263 .RS 29n
 264 Power good
 265 .RE
 266 
 267 .sp
 268 .ne 2
 269 .na
 270 \fBPCS_STATUS_BATTERY_LOW\fR
 271 .ad
 272 .RS 29n
 273 Power good
 274 .RE
 275 
 276 .sp
 277 .ne 2
 278 .na
 279 \fBCS_STATUS_CARD_READY\fR
 280 .ad
 281 .RS 29n
 282 Ready
 283 .RE
 284 
 285 .sp
 286 .ne 2
 287 .na
 288 \fBCS_STATUS_REQ_ATTN\fR
 289 .ad
 290 .RS 29n
 291 Not set
 292 .RE
 293 
 294 .sp
 295 .ne 2
 296 .na
 297 \fBCS_STATUS_RES_EVT1\fR
 298 .ad
 299 .RS 29n
 300 Not set
 301 .RE
 302 
 303 .sp
 304 .ne 2
 305 .na
 306 \fBCS_STATUS_RES_EVT2\fR
 307 .ad
 308 .RS 29n
 309 Not set
 310 .RE
 311 
 312 .sp
 313 .ne 2
 314 .na
 315 \fBCS_STATUS_RES_EVT3\fR
 316 .ad
 317 .RS 29n
 318 Not set
 319 .RE
 320 
 321 .RE
 322 
 323 .sp
 324 .ne 2
 325 .na
 326 \fB\fBSocketState\fR \fR
 327 .ad
 328 .RS 18n
 329 The \fBSocketState\fR field is a bit-map of the current card and socket state.
 330 The bits are:
 331 .sp
 332 .ne 2
 333 .na
 334 \fBCS_SOCK_STATUS_WRITE_PROTECT_CHANGE\fR
 335 .ad
 336 .sp .6
 337 .RS 4n
 338 Write Protect
 339 .RE
 340 
 341 .sp
 342 .ne 2
 343 .na
 344 \fBECS_SOCK_STATUS_CARD_LOCK_CHANGE\fR
 345 .ad
 346 .sp .6
 347 .RS 4n
 348 Card Lock Change
 349 .RE
 350 
 351 .sp
 352 .ne 2
 353 .na
 354 \fBCS_SOCK_STATUS_EJECTION_PENDING\fR
 355 .ad
 356 .sp .6
 357 .RS 4n
 358 Ejection Request
 359 .RE
 360 
 361 .sp
 362 .ne 2
 363 .na
 364 \fBCS_SOCK_STATUS_INSERTION_PENDING\fR
 365 .ad
 366 .sp .6
 367 .RS 4n
 368 Insertion Request
 369 .RE
 370 
 371 .sp
 372 .ne 2
 373 .na
 374 \fBCS_SOCK_STATUS_BATTERY_DEAD_CHANGE\fR
 375 .ad
 376 .sp .6
 377 .RS 4n
 378 Battery Dead
 379 .RE
 380 
 381 .sp
 382 .ne 2
 383 .na
 384 \fBCS_SOCK_STATUS_BATTERY_LOW_CHANGE\fR
 385 .ad
 386 .sp .6
 387 .RS 4n
 388 Battery Low
 389 .RE
 390 
 391 .sp
 392 .ne 2
 393 .na
 394 \fBCS_SOCK_STATUS_CARD_READY_CHANGE\fR
 395 .ad
 396 .sp .6
 397 .RS 4n
 398 Ready Change
 399 .RE
 400 
 401 .sp
 402 .ne 2
 403 .na
 404 \fBCS_SOCK_STATUS_CARD_INSERTION_CHANGE\fR
 405 .ad
 406 .sp .6
 407 .RS 4n
 408 Card is inserted
 409 .sp
 410  The state reported in the SocketState field may be different from the state
 411 reported in the CardState field. Clients should normally depend only on the
 412 state reported in the CardState field.
 413 .sp
 414 The state reported in the \fBSocketState\fR field may be different from the
 415 state reported in the \fBCardState\fR field. Clients should normally depend
 416 only on the state reported in the \fBCardState\fR field.
 417 .RE
 418 
 419 .RE
 420 
 421 .sp
 422 .ne 2
 423 .na
 424 \fB\fBraw_CardState\fR \fR
 425 .ad
 426 .RS 18n
 427 The \fBraw_CardState\fR field is a Solaris-specific extension that allows the
 428 client to determine if any card is inserted in the socket. The bit definitions
 429 in the \fBraw_CardState\fR field are identical to those in the \fBCardState\fR
 430 field with the exception that the \fBCS_STATUS_CARD_INSERTED\fR bit in the
 431 \fBraw_CardState\fR field is set whenever any card is inserted into the socket.
 432 .RE
 433 
 434 .SH RETURN VALUES
 435 .sp
 436 .ne 2
 437 .na
 438 \fB\fBCS_SUCCESS\fR \fR
 439 .ad
 440 .RS 28n
 441 Successful operation.
 442 .RE
 443 
 444 .sp
 445 .ne 2
 446 .na
 447 \fB\fBCS_BAD_HANDLE\fR \fR
 448 .ad
 449 .RS 28n
 450 Client handle is invalid.
 451 .RE
 452 
 453 .sp
 454 .ne 2
 455 .na
 456 \fB\fBCS_BAD_SOCKET\fR \fR
 457 .ad
 458 .RS 28n
 459 Error getting socket state.
 460 .RE
 461 
 462 .sp
 463 .ne 2
 464 .na
 465 \fB\fBCS_UNSUPPORTED_FUNCTION\fR \fR
 466 .ad
 467 .RS 28n
 468 No \fBPCMCIA \fRhardware installed.
 469 .RE
 470 
 471 .sp
 472 .LP
 473 \fBCS_NO_CARD\fR will not be returned if there is no \fBPC \fRCard present in
 474 the socket.
 475 .SH CONTEXT
 476 .sp
 477 .LP
 478 This function may be called from user or kernel context.
 479 .SH SEE ALSO
 480 .sp
 481 .LP
 482 \fBcsx_RegisterClient\fR(9F)
 483 .sp
 484 .LP
 485 \fIPC Card 95 Standard, PCMCIA/JEIDA\fR