Print this page
11622 clean up rarer mandoc lint warnings
   1 '\" te
   2 .\"  Copyright (c) 20002 Sun Microsystems, Inc.
   3 .\"  All Rights Reserved.
   4 .\" 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.
   5 .\" 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.
   6 .\" 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]
   7 .TH PRNIO 7I "Jan 2, 2002"
   8 .SH NAME
   9 prnio \- generic printer interface
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fB#include <sys/prnio.h>\fR
  14 .fi
  15 
  16 .SH DESCRIPTION
  17 .sp
  18 .LP
  19 The \fBprnio\fR generic printer interface defines ioctl commands and data
  20 structures for printer device drivers.
  21 .sp
  22 .LP
  23 \fBprnio\fR defines and provides facilities for five basic phases of the
  24 printing process:
  25 .RS +4
  26 .TP
  27 .ie t \(bu
  28 .el o
  29 Identification \(em Retrieve device information/attributes
  30 .RE
  31 .RS +4
  32 .TP
  33 .ie t \(bu
  34 .el o
  35 Setup \(em Set device attributes
  36 .RE
  37 .RS +4
  38 .TP


  67 .LP
  68 During the Transfer phase, data is transferred in a forward (host to
  69 peripheral) or reverse direction (peripheral to host). Transfer is accomplished
  70 using \fBwrite\fR(2) and \fBread\fR(2) system calls. For \fBprnio\fR compliant
  71 printer drivers, forward transfer support is mandatory, while reverse transfer
  72 support is optional. Applications can also use \fBPRNIOC_GET_STATUS\fR and
  73 \fBPRNIOC_GET_1284_STATUS\fR commands during the transfer to monitor the device
  74 state.
  75 .sp
  76 .LP
  77 The Cleanup phase is accomplished by closing the device using \fBclose\fR(2).
  78 Device drivers supporting \fBprnio\fR may set non-zero error code as
  79 appropriate. Applications should explicitly \fBclose\fR(2) a device before
  80 exiting and check \fBerrno\fR value.
  81 .sp
  82 .LP
  83 The Abort phase is accomplished by interrupting the \fBwrite\fR(2) and
  84 \fBread\fR(2) system calls. The application can perform some additional cleanup
  85 during the Abort phase as described in \fBPRNIOC_GET_IFCAP\fR section.
  86 .SH IOCTLS
  87 .sp
  88 .ne 2
  89 .na
  90 \fB\fBPRNIOC_GET_IFCAP\fR\fR
  91 .ad
  92 .RS 21n
  93 Application can retrieve printer interface capabilities using this command. The
  94 \fBioctl\fR(2) argument is a pointer to \fBuint_t\fR, a bit field representing
  95 a set of properties and services provided by a printer driver. Set bit means
  96 supported capability. The following values are defined:
  97 .br
  98 .in +2
  99 \fBPRN_BIDI\fR - When this bit is set,  the interface operates in a
 100 bidirectional mode,  instead of forward-only mode.
 101 .in -2
 102 .br
 103 .in +2
 104 \fBPRN_HOTPLUG\fR - If this bit is set, the interface allows device
 105 hot-plugging.
 106 .in -2
 107 .br


 254 .LP
 255 For convenience, the two-byte length field is not considered part of device ID
 256 string and is not returned in the user buffer. Instead, \fBid_rlen\fR  value
 257 shall be set to (length - 2) by the driver, where length is the ID length field
 258 value. If buffer length is less than \fBid_rlen\fR, the driver returns the
 259 first \fBid_len\fR bytes of the ID.
 260 .sp
 261 .LP
 262 The printer driver must return the most up-to-date value of the device ID.
 263 .sp
 264 .ne 2
 265 .na
 266 \fBPRNIOC_GET_STATUS\fR
 267 .ad
 268 .RS 21n
 269 This command can be used by applications to retrieve current device status. The
 270 argument is a pointer to \fBuint_t\fR, where the status word is returned.
 271 Status is a combination of the following bits:
 272 .RE
 273 
 274 .br
 275 .in +2
 276 \fBPRN_ONLINE\fR - For devices that support \fBPRN_HOTPLUG\fR capability,
 277 this bit is set when the device is online, otherwise the device is offline.
 278 Devices without \fBPRN_HOTPLUG\fR support should always have this bit set.
 279 .in -2
 280 .br
 281 .in +2
 282 \fBPRN_READY\fR - This bit indicates if the device is ready to receive/send
 283 data. Applications may use this bit for an outbound flow control
 284 .in -2
 285 .sp
 286 .ne 2
 287 .na
 288 \fB\fBPRNIOC_GET_1284_STATUS\fR\fR
 289 .ad
 290 .RS 26n
 291 Devices that support \fBPRN_1284_STATUS\fR capability accept this ioctl to
 292 retrieve the device status lines defined in \fIIEEE 1284\fR for use in
 293 Compatibility mode. The following bits may be set by the driver:
 294 .br


 330 .in -2
 331 
 332 .sp
 333 .LP
 334 \fBtmo_forward\fR and \fBtmo_reverse\fR define forward and reverse transfer
 335 timeouts in seconds. This command is only valid for drivers that support
 336 \fBPRN_TIMEOUTS\fR capability.
 337 .sp
 338 .ne 2
 339 .na
 340 \fB\fBPRNIOC_SET_TIMEOUTS\fR\fR
 341 .ad
 342 .RS 23n
 343 This command sets current transfer  timeout values for the driver. The
 344 argument is  a pointer to \fBstruct prn_timeouts\fR. See
 345 \fBPRNIOC_GET_TIMEOUTS\fR for description of  this structure. This  command is
 346 only valid for drivers that support \fBPRN_TIMEOUTS\fR capability.
 347 .RE
 348 
 349 .SH ATTRIBUTES
 350 .sp
 351 .LP
 352 See \fBattributes\fR(5) for descriptions of the following attributes:
 353 .sp
 354 
 355 .sp
 356 .TS
 357 box;
 358 c | c
 359 l | l .
 360 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 361 _
 362 Architecture     SPARC, IA
 363 _
 364 Interface Stability     Evolving
 365 .TE
 366 
 367 .SH SEE ALSO
 368 .sp
 369 .LP
 370 \fBclose\fR(2), \fBioctl\fR(2), \fBread\fR(2), \fBwrite\fR(2),
 371 \fBattributes\fR(5), \fBecpp\fR(7D), \fBusbprn\fR(7D), \fBlp\fR(7D)
 372 .sp
 373 .LP
 374 \fIIEEE Std 1284-1994\fR
   1 '\" te
   2 .\"  Copyright (c) 20002 Sun Microsystems, Inc.
   3 .\"  All Rights Reserved.
   4 .\" 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.
   5 .\" 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.
   6 .\" 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]
   7 .TH PRNIO 7I "Jan 2, 2002"
   8 .SH NAME
   9 prnio \- generic printer interface
  10 .SH SYNOPSIS

  11 .nf
  12 \fB#include <sys/prnio.h>\fR
  13 .fi
  14 
  15 .SH DESCRIPTION


  16 The \fBprnio\fR generic printer interface defines ioctl commands and data
  17 structures for printer device drivers.
  18 .sp
  19 .LP
  20 \fBprnio\fR defines and provides facilities for five basic phases of the
  21 printing process:
  22 .RS +4
  23 .TP
  24 .ie t \(bu
  25 .el o
  26 Identification \(em Retrieve device information/attributes
  27 .RE
  28 .RS +4
  29 .TP
  30 .ie t \(bu
  31 .el o
  32 Setup \(em Set device attributes
  33 .RE
  34 .RS +4
  35 .TP


  64 .LP
  65 During the Transfer phase, data is transferred in a forward (host to
  66 peripheral) or reverse direction (peripheral to host). Transfer is accomplished
  67 using \fBwrite\fR(2) and \fBread\fR(2) system calls. For \fBprnio\fR compliant
  68 printer drivers, forward transfer support is mandatory, while reverse transfer
  69 support is optional. Applications can also use \fBPRNIOC_GET_STATUS\fR and
  70 \fBPRNIOC_GET_1284_STATUS\fR commands during the transfer to monitor the device
  71 state.
  72 .sp
  73 .LP
  74 The Cleanup phase is accomplished by closing the device using \fBclose\fR(2).
  75 Device drivers supporting \fBprnio\fR may set non-zero error code as
  76 appropriate. Applications should explicitly \fBclose\fR(2) a device before
  77 exiting and check \fBerrno\fR value.
  78 .sp
  79 .LP
  80 The Abort phase is accomplished by interrupting the \fBwrite\fR(2) and
  81 \fBread\fR(2) system calls. The application can perform some additional cleanup
  82 during the Abort phase as described in \fBPRNIOC_GET_IFCAP\fR section.
  83 .SH IOCTLS

  84 .ne 2
  85 .na
  86 \fB\fBPRNIOC_GET_IFCAP\fR\fR
  87 .ad
  88 .RS 21n
  89 Application can retrieve printer interface capabilities using this command. The
  90 \fBioctl\fR(2) argument is a pointer to \fBuint_t\fR, a bit field representing
  91 a set of properties and services provided by a printer driver. Set bit means
  92 supported capability. The following values are defined:
  93 .br
  94 .in +2
  95 \fBPRN_BIDI\fR - When this bit is set,  the interface operates in a
  96 bidirectional mode,  instead of forward-only mode.
  97 .in -2
  98 .br
  99 .in +2
 100 \fBPRN_HOTPLUG\fR - If this bit is set, the interface allows device
 101 hot-plugging.
 102 .in -2
 103 .br


 250 .LP
 251 For convenience, the two-byte length field is not considered part of device ID
 252 string and is not returned in the user buffer. Instead, \fBid_rlen\fR  value
 253 shall be set to (length - 2) by the driver, where length is the ID length field
 254 value. If buffer length is less than \fBid_rlen\fR, the driver returns the
 255 first \fBid_len\fR bytes of the ID.
 256 .sp
 257 .LP
 258 The printer driver must return the most up-to-date value of the device ID.
 259 .sp
 260 .ne 2
 261 .na
 262 \fBPRNIOC_GET_STATUS\fR
 263 .ad
 264 .RS 21n
 265 This command can be used by applications to retrieve current device status. The
 266 argument is a pointer to \fBuint_t\fR, where the status word is returned.
 267 Status is a combination of the following bits:
 268 .RE
 269 

 270 .in +2
 271 \fBPRN_ONLINE\fR - For devices that support \fBPRN_HOTPLUG\fR capability,
 272 this bit is set when the device is online, otherwise the device is offline.
 273 Devices without \fBPRN_HOTPLUG\fR support should always have this bit set.
 274 .in -2
 275 .br
 276 .in +2
 277 \fBPRN_READY\fR - This bit indicates if the device is ready to receive/send
 278 data. Applications may use this bit for an outbound flow control
 279 .in -2
 280 .sp
 281 .ne 2
 282 .na
 283 \fB\fBPRNIOC_GET_1284_STATUS\fR\fR
 284 .ad
 285 .RS 26n
 286 Devices that support \fBPRN_1284_STATUS\fR capability accept this ioctl to
 287 retrieve the device status lines defined in \fIIEEE 1284\fR for use in
 288 Compatibility mode. The following bits may be set by the driver:
 289 .br


 325 .in -2
 326 
 327 .sp
 328 .LP
 329 \fBtmo_forward\fR and \fBtmo_reverse\fR define forward and reverse transfer
 330 timeouts in seconds. This command is only valid for drivers that support
 331 \fBPRN_TIMEOUTS\fR capability.
 332 .sp
 333 .ne 2
 334 .na
 335 \fB\fBPRNIOC_SET_TIMEOUTS\fR\fR
 336 .ad
 337 .RS 23n
 338 This command sets current transfer  timeout values for the driver. The
 339 argument is  a pointer to \fBstruct prn_timeouts\fR. See
 340 \fBPRNIOC_GET_TIMEOUTS\fR for description of  this structure. This  command is
 341 only valid for drivers that support \fBPRN_TIMEOUTS\fR capability.
 342 .RE
 343 
 344 .SH ATTRIBUTES


 345 See \fBattributes\fR(5) for descriptions of the following attributes:
 346 .sp
 347 
 348 .sp
 349 .TS
 350 box;
 351 c | c
 352 l | l .
 353 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 354 _
 355 Architecture     SPARC, IA
 356 _
 357 Interface Stability     Evolving
 358 .TE
 359 
 360 .SH SEE ALSO


 361 \fBclose\fR(2), \fBioctl\fR(2), \fBread\fR(2), \fBwrite\fR(2),
 362 \fBattributes\fR(5), \fBecpp\fR(7D), \fBusbprn\fR(7D), \fBlp\fR(7D)
 363 .sp
 364 .LP
 365 \fIIEEE Std 1284-1994\fR