ia64/linux-2.6.18-xen.hg

annotate Documentation/parport-lowlevel.txt @ 854:950b9eb27661

usbback: fix urb interval value for interrupt urbs.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:51:20 2009 +0100 (2009-04-06)
parents 831230e53067
children
rev   line source
ian@0 1 PARPORT interface documentation
ian@0 2 -------------------------------
ian@0 3
ian@0 4 Time-stamp: <2000-02-24 13:30:20 twaugh>
ian@0 5
ian@0 6 Described here are the following functions:
ian@0 7
ian@0 8 Global functions:
ian@0 9 parport_register_driver
ian@0 10 parport_unregister_driver
ian@0 11 parport_enumerate
ian@0 12 parport_register_device
ian@0 13 parport_unregister_device
ian@0 14 parport_claim
ian@0 15 parport_claim_or_block
ian@0 16 parport_release
ian@0 17 parport_yield
ian@0 18 parport_yield_blocking
ian@0 19 parport_wait_peripheral
ian@0 20 parport_poll_peripheral
ian@0 21 parport_wait_event
ian@0 22 parport_negotiate
ian@0 23 parport_read
ian@0 24 parport_write
ian@0 25 parport_open
ian@0 26 parport_close
ian@0 27 parport_device_id
ian@0 28 parport_device_num
ian@0 29 parport_device_coords
ian@0 30 parport_find_class
ian@0 31 parport_find_device
ian@0 32 parport_set_timeout
ian@0 33
ian@0 34 Port functions (can be overridden by low-level drivers):
ian@0 35 SPP:
ian@0 36 port->ops->read_data
ian@0 37 port->ops->write_data
ian@0 38 port->ops->read_status
ian@0 39 port->ops->read_control
ian@0 40 port->ops->write_control
ian@0 41 port->ops->frob_control
ian@0 42 port->ops->enable_irq
ian@0 43 port->ops->disable_irq
ian@0 44 port->ops->data_forward
ian@0 45 port->ops->data_reverse
ian@0 46
ian@0 47 EPP:
ian@0 48 port->ops->epp_write_data
ian@0 49 port->ops->epp_read_data
ian@0 50 port->ops->epp_write_addr
ian@0 51 port->ops->epp_read_addr
ian@0 52
ian@0 53 ECP:
ian@0 54 port->ops->ecp_write_data
ian@0 55 port->ops->ecp_read_data
ian@0 56 port->ops->ecp_write_addr
ian@0 57
ian@0 58 Other:
ian@0 59 port->ops->nibble_read_data
ian@0 60 port->ops->byte_read_data
ian@0 61 port->ops->compat_write_data
ian@0 62
ian@0 63 The parport subsystem comprises 'parport' (the core port-sharing
ian@0 64 code), and a variety of low-level drivers that actually do the port
ian@0 65 accesses. Each low-level driver handles a particular style of port
ian@0 66 (PC, Amiga, and so on).
ian@0 67
ian@0 68 The parport interface to the device driver author can be broken down
ian@0 69 into global functions and port functions.
ian@0 70
ian@0 71 The global functions are mostly for communicating between the device
ian@0 72 driver and the parport subsystem: acquiring a list of available ports,
ian@0 73 claiming a port for exclusive use, and so on. They also include
ian@0 74 'generic' functions for doing standard things that will work on any
ian@0 75 IEEE 1284-capable architecture.
ian@0 76
ian@0 77 The port functions are provided by the low-level drivers, although the
ian@0 78 core parport module provides generic 'defaults' for some routines.
ian@0 79 The port functions can be split into three groups: SPP, EPP, and ECP.
ian@0 80
ian@0 81 SPP (Standard Parallel Port) functions modify so-called 'SPP'
ian@0 82 registers: data, status, and control. The hardware may not actually
ian@0 83 have registers exactly like that, but the PC does and this interface is
ian@0 84 modelled after common PC implementations. Other low-level drivers may
ian@0 85 be able to emulate most of the functionality.
ian@0 86
ian@0 87 EPP (Enhanced Parallel Port) functions are provided for reading and
ian@0 88 writing in IEEE 1284 EPP mode, and ECP (Extended Capabilities Port)
ian@0 89 functions are used for IEEE 1284 ECP mode. (What about BECP? Does
ian@0 90 anyone care?)
ian@0 91
ian@0 92 Hardware assistance for EPP and/or ECP transfers may or may not be
ian@0 93 available, and if it is available it may or may not be used. If
ian@0 94 hardware is not used, the transfer will be software-driven. In order
ian@0 95 to cope with peripherals that only tenuously support IEEE 1284, a
ian@0 96 low-level driver specific function is provided, for altering 'fudge
ian@0 97 factors'.
ian@0 98
ian@0 99 GLOBAL FUNCTIONS
ian@0 100 ----------------
ian@0 101
ian@0 102 parport_register_driver - register a device driver with parport
ian@0 103 -----------------------
ian@0 104
ian@0 105 SYNOPSIS
ian@0 106
ian@0 107 #include <linux/parport.h>
ian@0 108
ian@0 109 struct parport_driver {
ian@0 110 const char *name;
ian@0 111 void (*attach) (struct parport *);
ian@0 112 void (*detach) (struct parport *);
ian@0 113 struct parport_driver *next;
ian@0 114 };
ian@0 115 int parport_register_driver (struct parport_driver *driver);
ian@0 116
ian@0 117 DESCRIPTION
ian@0 118
ian@0 119 In order to be notified about parallel ports when they are detected,
ian@0 120 parport_register_driver should be called. Your driver will
ian@0 121 immediately be notified of all ports that have already been detected,
ian@0 122 and of each new port as low-level drivers are loaded.
ian@0 123
ian@0 124 A 'struct parport_driver' contains the textual name of your driver,
ian@0 125 a pointer to a function to handle new ports, and a pointer to a
ian@0 126 function to handle ports going away due to a low-level driver
ian@0 127 unloading. Ports will only be detached if they are not being used
ian@0 128 (i.e. there are no devices registered on them).
ian@0 129
ian@0 130 The visible parts of the 'struct parport *' argument given to
ian@0 131 attach/detach are:
ian@0 132
ian@0 133 struct parport
ian@0 134 {
ian@0 135 struct parport *next; /* next parport in list */
ian@0 136 const char *name; /* port's name */
ian@0 137 unsigned int modes; /* bitfield of hardware modes */
ian@0 138 struct parport_device_info probe_info;
ian@0 139 /* IEEE1284 info */
ian@0 140 int number; /* parport index */
ian@0 141 struct parport_operations *ops;
ian@0 142 ...
ian@0 143 };
ian@0 144
ian@0 145 There are other members of the structure, but they should not be
ian@0 146 touched.
ian@0 147
ian@0 148 The 'modes' member summarises the capabilities of the underlying
ian@0 149 hardware. It consists of flags which may be bitwise-ored together:
ian@0 150
ian@0 151 PARPORT_MODE_PCSPP IBM PC registers are available,
ian@0 152 i.e. functions that act on data,
ian@0 153 control and status registers are
ian@0 154 probably writing directly to the
ian@0 155 hardware.
ian@0 156 PARPORT_MODE_TRISTATE The data drivers may be turned off.
ian@0 157 This allows the data lines to be used
ian@0 158 for reverse (peripheral to host)
ian@0 159 transfers.
ian@0 160 PARPORT_MODE_COMPAT The hardware can assist with
ian@0 161 compatibility-mode (printer)
ian@0 162 transfers, i.e. compat_write_block.
ian@0 163 PARPORT_MODE_EPP The hardware can assist with EPP
ian@0 164 transfers.
ian@0 165 PARPORT_MODE_ECP The hardware can assist with ECP
ian@0 166 transfers.
ian@0 167 PARPORT_MODE_DMA The hardware can use DMA, so you might
ian@0 168 want to pass ISA DMA-able memory
ian@0 169 (i.e. memory allocated using the
ian@0 170 GFP_DMA flag with kmalloc) to the
ian@0 171 low-level driver in order to take
ian@0 172 advantage of it.
ian@0 173
ian@0 174 There may be other flags in 'modes' as well.
ian@0 175
ian@0 176 The contents of 'modes' is advisory only. For example, if the
ian@0 177 hardware is capable of DMA, and PARPORT_MODE_DMA is in 'modes', it
ian@0 178 doesn't necessarily mean that DMA will always be used when possible.
ian@0 179 Similarly, hardware that is capable of assisting ECP transfers won't
ian@0 180 necessarily be used.
ian@0 181
ian@0 182 RETURN VALUE
ian@0 183
ian@0 184 Zero on success, otherwise an error code.
ian@0 185
ian@0 186 ERRORS
ian@0 187
ian@0 188 None. (Can it fail? Why return int?)
ian@0 189
ian@0 190 EXAMPLE
ian@0 191
ian@0 192 static void lp_attach (struct parport *port)
ian@0 193 {
ian@0 194 ...
ian@0 195 private = kmalloc (...);
ian@0 196 dev[count++] = parport_register_device (...);
ian@0 197 ...
ian@0 198 }
ian@0 199
ian@0 200 static void lp_detach (struct parport *port)
ian@0 201 {
ian@0 202 ...
ian@0 203 }
ian@0 204
ian@0 205 static struct parport_driver lp_driver = {
ian@0 206 "lp",
ian@0 207 lp_attach,
ian@0 208 lp_detach,
ian@0 209 NULL /* always put NULL here */
ian@0 210 };
ian@0 211
ian@0 212 int lp_init (void)
ian@0 213 {
ian@0 214 ...
ian@0 215 if (parport_register_driver (&lp_driver)) {
ian@0 216 /* Failed; nothing we can do. */
ian@0 217 return -EIO;
ian@0 218 }
ian@0 219 ...
ian@0 220 }
ian@0 221
ian@0 222 SEE ALSO
ian@0 223
ian@0 224 parport_unregister_driver, parport_register_device, parport_enumerate
ian@0 225
ian@0 226 parport_unregister_driver - tell parport to forget about this driver
ian@0 227 -------------------------
ian@0 228
ian@0 229 SYNOPSIS
ian@0 230
ian@0 231 #include <linux/parport.h>
ian@0 232
ian@0 233 struct parport_driver {
ian@0 234 const char *name;
ian@0 235 void (*attach) (struct parport *);
ian@0 236 void (*detach) (struct parport *);
ian@0 237 struct parport_driver *next;
ian@0 238 };
ian@0 239 void parport_unregister_driver (struct parport_driver *driver);
ian@0 240
ian@0 241 DESCRIPTION
ian@0 242
ian@0 243 This tells parport not to notify the device driver of new ports or of
ian@0 244 ports going away. Registered devices belonging to that driver are NOT
ian@0 245 unregistered: parport_unregister_device must be used for each one.
ian@0 246
ian@0 247 EXAMPLE
ian@0 248
ian@0 249 void cleanup_module (void)
ian@0 250 {
ian@0 251 ...
ian@0 252 /* Stop notifications. */
ian@0 253 parport_unregister_driver (&lp_driver);
ian@0 254
ian@0 255 /* Unregister devices. */
ian@0 256 for (i = 0; i < NUM_DEVS; i++)
ian@0 257 parport_unregister_device (dev[i]);
ian@0 258 ...
ian@0 259 }
ian@0 260
ian@0 261 SEE ALSO
ian@0 262
ian@0 263 parport_register_driver, parport_enumerate
ian@0 264
ian@0 265 parport_enumerate - retrieve a list of parallel ports (DEPRECATED)
ian@0 266 -----------------
ian@0 267
ian@0 268 SYNOPSIS
ian@0 269
ian@0 270 #include <linux/parport.h>
ian@0 271
ian@0 272 struct parport *parport_enumerate (void);
ian@0 273
ian@0 274 DESCRIPTION
ian@0 275
ian@0 276 Retrieve the first of a list of valid parallel ports for this machine.
ian@0 277 Successive parallel ports can be found using the 'struct parport
ian@0 278 *next' element of the 'struct parport *' that is returned. If 'next'
ian@0 279 is NULL, there are no more parallel ports in the list. The number of
ian@0 280 ports in the list will not exceed PARPORT_MAX.
ian@0 281
ian@0 282 RETURN VALUE
ian@0 283
ian@0 284 A 'struct parport *' describing a valid parallel port for the machine,
ian@0 285 or NULL if there are none.
ian@0 286
ian@0 287 ERRORS
ian@0 288
ian@0 289 This function can return NULL to indicate that there are no parallel
ian@0 290 ports to use.
ian@0 291
ian@0 292 EXAMPLE
ian@0 293
ian@0 294 int detect_device (void)
ian@0 295 {
ian@0 296 struct parport *port;
ian@0 297
ian@0 298 for (port = parport_enumerate ();
ian@0 299 port != NULL;
ian@0 300 port = port->next) {
ian@0 301 /* Try to detect a device on the port... */
ian@0 302 ...
ian@0 303 }
ian@0 304 }
ian@0 305
ian@0 306 ...
ian@0 307 }
ian@0 308
ian@0 309 NOTES
ian@0 310
ian@0 311 parport_enumerate is deprecated; parport_register_driver should be
ian@0 312 used instead.
ian@0 313
ian@0 314 SEE ALSO
ian@0 315
ian@0 316 parport_register_driver, parport_unregister_driver
ian@0 317
ian@0 318 parport_register_device - register to use a port
ian@0 319 -----------------------
ian@0 320
ian@0 321 SYNOPSIS
ian@0 322
ian@0 323 #include <linux/parport.h>
ian@0 324
ian@0 325 typedef int (*preempt_func) (void *handle);
ian@0 326 typedef void (*wakeup_func) (void *handle);
ian@0 327 typedef int (*irq_func) (int irq, void *handle, struct pt_regs *);
ian@0 328
ian@0 329 struct pardevice *parport_register_device(struct parport *port,
ian@0 330 const char *name,
ian@0 331 preempt_func preempt,
ian@0 332 wakeup_func wakeup,
ian@0 333 irq_func irq,
ian@0 334 int flags,
ian@0 335 void *handle);
ian@0 336
ian@0 337 DESCRIPTION
ian@0 338
ian@0 339 Use this function to register your device driver on a parallel port
ian@0 340 ('port'). Once you have done that, you will be able to use
ian@0 341 parport_claim and parport_release in order to use the port.
ian@0 342
ian@0 343 This function will register three callbacks into your driver:
ian@0 344 'preempt', 'wakeup' and 'irq'. Each of these may be NULL in order to
ian@0 345 indicate that you do not want a callback.
ian@0 346
ian@0 347 When the 'preempt' function is called, it is because another driver
ian@0 348 wishes to use the parallel port. The 'preempt' function should return
ian@0 349 non-zero if the parallel port cannot be released yet -- if zero is
ian@0 350 returned, the port is lost to another driver and the port must be
ian@0 351 re-claimed before use.
ian@0 352
ian@0 353 The 'wakeup' function is called once another driver has released the
ian@0 354 port and no other driver has yet claimed it. You can claim the
ian@0 355 parallel port from within the 'wakeup' function (in which case the
ian@0 356 claim is guaranteed to succeed), or choose not to if you don't need it
ian@0 357 now.
ian@0 358
ian@0 359 If an interrupt occurs on the parallel port your driver has claimed,
ian@0 360 the 'irq' function will be called. (Write something about shared
ian@0 361 interrupts here.)
ian@0 362
ian@0 363 The 'handle' is a pointer to driver-specific data, and is passed to
ian@0 364 the callback functions.
ian@0 365
ian@0 366 'flags' may be a bitwise combination of the following flags:
ian@0 367
ian@0 368 Flag Meaning
ian@0 369 PARPORT_DEV_EXCL The device cannot share the parallel port at all.
ian@0 370 Use this only when absolutely necessary.
ian@0 371
ian@0 372 The typedefs are not actually defined -- they are only shown in order
ian@0 373 to make the function prototype more readable.
ian@0 374
ian@0 375 The visible parts of the returned 'struct pardevice' are:
ian@0 376
ian@0 377 struct pardevice {
ian@0 378 struct parport *port; /* Associated port */
ian@0 379 void *private; /* Device driver's 'handle' */
ian@0 380 ...
ian@0 381 };
ian@0 382
ian@0 383 RETURN VALUE
ian@0 384
ian@0 385 A 'struct pardevice *': a handle to the registered parallel port
ian@0 386 device that can be used for parport_claim, parport_release, etc.
ian@0 387
ian@0 388 ERRORS
ian@0 389
ian@0 390 A return value of NULL indicates that there was a problem registering
ian@0 391 a device on that port.
ian@0 392
ian@0 393 EXAMPLE
ian@0 394
ian@0 395 static int preempt (void *handle)
ian@0 396 {
ian@0 397 if (busy_right_now)
ian@0 398 return 1;
ian@0 399
ian@0 400 must_reclaim_port = 1;
ian@0 401 return 0;
ian@0 402 }
ian@0 403
ian@0 404 static void wakeup (void *handle)
ian@0 405 {
ian@0 406 struct toaster *private = handle;
ian@0 407 struct pardevice *dev = private->dev;
ian@0 408 if (!dev) return; /* avoid races */
ian@0 409
ian@0 410 if (want_port)
ian@0 411 parport_claim (dev);
ian@0 412 }
ian@0 413
ian@0 414 static int toaster_detect (struct toaster *private, struct parport *port)
ian@0 415 {
ian@0 416 private->dev = parport_register_device (port, "toaster", preempt,
ian@0 417 wakeup, NULL, 0,
ian@0 418 private);
ian@0 419 if (!private->dev)
ian@0 420 /* Couldn't register with parport. */
ian@0 421 return -EIO;
ian@0 422
ian@0 423 must_reclaim_port = 0;
ian@0 424 busy_right_now = 1;
ian@0 425 parport_claim_or_block (private->dev);
ian@0 426 ...
ian@0 427 /* Don't need the port while the toaster warms up. */
ian@0 428 busy_right_now = 0;
ian@0 429 ...
ian@0 430 busy_right_now = 1;
ian@0 431 if (must_reclaim_port) {
ian@0 432 parport_claim_or_block (private->dev);
ian@0 433 must_reclaim_port = 0;
ian@0 434 }
ian@0 435 ...
ian@0 436 }
ian@0 437
ian@0 438 SEE ALSO
ian@0 439
ian@0 440 parport_unregister_device, parport_claim
ian@0 441
ian@0 442 parport_unregister_device - finish using a port
ian@0 443 -------------------------
ian@0 444
ian@0 445 SYNPOPSIS
ian@0 446
ian@0 447 #include <linux/parport.h>
ian@0 448
ian@0 449 void parport_unregister_device (struct pardevice *dev);
ian@0 450
ian@0 451 DESCRIPTION
ian@0 452
ian@0 453 This function is the opposite of parport_register_device. After using
ian@0 454 parport_unregister_device, 'dev' is no longer a valid device handle.
ian@0 455
ian@0 456 You should not unregister a device that is currently claimed, although
ian@0 457 if you do it will be released automatically.
ian@0 458
ian@0 459 EXAMPLE
ian@0 460
ian@0 461 ...
ian@0 462 kfree (dev->private); /* before we lose the pointer */
ian@0 463 parport_unregister_device (dev);
ian@0 464 ...
ian@0 465
ian@0 466 SEE ALSO
ian@0 467
ian@0 468 parport_unregister_driver
ian@0 469
ian@0 470 parport_claim, parport_claim_or_block - claim the parallel port for a device
ian@0 471 -------------------------------------
ian@0 472
ian@0 473 SYNOPSIS
ian@0 474
ian@0 475 #include <linux/parport.h>
ian@0 476
ian@0 477 int parport_claim (struct pardevice *dev);
ian@0 478 int parport_claim_or_block (struct pardevice *dev);
ian@0 479
ian@0 480 DESCRIPTION
ian@0 481
ian@0 482 These functions attempt to gain control of the parallel port on which
ian@0 483 'dev' is registered. 'parport_claim' does not block, but
ian@0 484 'parport_claim_or_block' may do. (Put something here about blocking
ian@0 485 interruptibly or non-interruptibly.)
ian@0 486
ian@0 487 You should not try to claim a port that you have already claimed.
ian@0 488
ian@0 489 RETURN VALUE
ian@0 490
ian@0 491 A return value of zero indicates that the port was successfully
ian@0 492 claimed, and the caller now has possession of the parallel port.
ian@0 493
ian@0 494 If 'parport_claim_or_block' blocks before returning successfully, the
ian@0 495 return value is positive.
ian@0 496
ian@0 497 ERRORS
ian@0 498
ian@0 499 -EAGAIN The port is unavailable at the moment, but another attempt
ian@0 500 to claim it may succeed.
ian@0 501
ian@0 502 SEE ALSO
ian@0 503
ian@0 504 parport_release
ian@0 505
ian@0 506 parport_release - release the parallel port
ian@0 507 ---------------
ian@0 508
ian@0 509 SYNOPSIS
ian@0 510
ian@0 511 #include <linux/parport.h>
ian@0 512
ian@0 513 void parport_release (struct pardevice *dev);
ian@0 514
ian@0 515 DESCRIPTION
ian@0 516
ian@0 517 Once a parallel port device has been claimed, it can be released using
ian@0 518 'parport_release'. It cannot fail, but you should not release a
ian@0 519 device that you do not have possession of.
ian@0 520
ian@0 521 EXAMPLE
ian@0 522
ian@0 523 static size_t write (struct pardevice *dev, const void *buf,
ian@0 524 size_t len)
ian@0 525 {
ian@0 526 ...
ian@0 527 written = dev->port->ops->write_ecp_data (dev->port, buf,
ian@0 528 len);
ian@0 529 parport_release (dev);
ian@0 530 ...
ian@0 531 }
ian@0 532
ian@0 533
ian@0 534 SEE ALSO
ian@0 535
ian@0 536 change_mode, parport_claim, parport_claim_or_block, parport_yield
ian@0 537
ian@0 538 parport_yield, parport_yield_blocking - temporarily release a parallel port
ian@0 539 -------------------------------------
ian@0 540
ian@0 541 SYNOPSIS
ian@0 542
ian@0 543 #include <linux/parport.h>
ian@0 544
ian@0 545 int parport_yield (struct pardevice *dev)
ian@0 546 int parport_yield_blocking (struct pardevice *dev);
ian@0 547
ian@0 548 DESCRIPTION
ian@0 549
ian@0 550 When a driver has control of a parallel port, it may allow another
ian@0 551 driver to temporarily 'borrow' it. 'parport_yield' does not block;
ian@0 552 'parport_yield_blocking' may do.
ian@0 553
ian@0 554 RETURN VALUE
ian@0 555
ian@0 556 A return value of zero indicates that the caller still owns the port
ian@0 557 and the call did not block.
ian@0 558
ian@0 559 A positive return value from 'parport_yield_blocking' indicates that
ian@0 560 the caller still owns the port and the call blocked.
ian@0 561
ian@0 562 A return value of -EAGAIN indicates that the caller no longer owns the
ian@0 563 port, and it must be re-claimed before use.
ian@0 564
ian@0 565 ERRORS
ian@0 566
ian@0 567 -EAGAIN Ownership of the parallel port was given away.
ian@0 568
ian@0 569 SEE ALSO
ian@0 570
ian@0 571 parport_release
ian@0 572
ian@0 573 parport_wait_peripheral - wait for status lines, up to 35ms
ian@0 574 -----------------------
ian@0 575
ian@0 576 SYNOPSIS
ian@0 577
ian@0 578 #include <linux/parport.h>
ian@0 579
ian@0 580 int parport_wait_peripheral (struct parport *port,
ian@0 581 unsigned char mask,
ian@0 582 unsigned char val);
ian@0 583
ian@0 584 DESCRIPTION
ian@0 585
ian@0 586 Wait for the status lines in mask to match the values in val.
ian@0 587
ian@0 588 RETURN VALUE
ian@0 589
ian@0 590 -EINTR a signal is pending
ian@0 591 0 the status lines in mask have values in val
ian@0 592 1 timed out while waiting (35ms elapsed)
ian@0 593
ian@0 594 SEE ALSO
ian@0 595
ian@0 596 parport_poll_peripheral
ian@0 597
ian@0 598 parport_poll_peripheral - wait for status lines, in usec
ian@0 599 -----------------------
ian@0 600
ian@0 601 SYNOPSIS
ian@0 602
ian@0 603 #include <linux/parport.h>
ian@0 604
ian@0 605 int parport_poll_peripheral (struct parport *port,
ian@0 606 unsigned char mask,
ian@0 607 unsigned char val,
ian@0 608 int usec);
ian@0 609
ian@0 610 DESCRIPTION
ian@0 611
ian@0 612 Wait for the status lines in mask to match the values in val.
ian@0 613
ian@0 614 RETURN VALUE
ian@0 615
ian@0 616 -EINTR a signal is pending
ian@0 617 0 the status lines in mask have values in val
ian@0 618 1 timed out while waiting (usec microseconds have elapsed)
ian@0 619
ian@0 620 SEE ALSO
ian@0 621
ian@0 622 parport_wait_peripheral
ian@0 623
ian@0 624 parport_wait_event - wait for an event on a port
ian@0 625 ------------------
ian@0 626
ian@0 627 SYNOPSIS
ian@0 628
ian@0 629 #include <linux/parport.h>
ian@0 630
ian@0 631 int parport_wait_event (struct parport *port, signed long timeout)
ian@0 632
ian@0 633 DESCRIPTION
ian@0 634
ian@0 635 Wait for an event (e.g. interrupt) on a port. The timeout is in
ian@0 636 jiffies.
ian@0 637
ian@0 638 RETURN VALUE
ian@0 639
ian@0 640 0 success
ian@0 641 <0 error (exit as soon as possible)
ian@0 642 >0 timed out
ian@0 643
ian@0 644 parport_negotiate - perform IEEE 1284 negotiation
ian@0 645 -----------------
ian@0 646
ian@0 647 SYNOPSIS
ian@0 648
ian@0 649 #include <linux/parport.h>
ian@0 650
ian@0 651 int parport_negotiate (struct parport *, int mode);
ian@0 652
ian@0 653 DESCRIPTION
ian@0 654
ian@0 655 Perform IEEE 1284 negotiation.
ian@0 656
ian@0 657 RETURN VALUE
ian@0 658
ian@0 659 0 handshake OK; IEEE 1284 peripheral and mode available
ian@0 660 -1 handshake failed; peripheral not compliant (or none present)
ian@0 661 1 handshake OK; IEEE 1284 peripheral present but mode not
ian@0 662 available
ian@0 663
ian@0 664 SEE ALSO
ian@0 665
ian@0 666 parport_read, parport_write
ian@0 667
ian@0 668 parport_read - read data from device
ian@0 669 ------------
ian@0 670
ian@0 671 SYNOPSIS
ian@0 672
ian@0 673 #include <linux/parport.h>
ian@0 674
ian@0 675 ssize_t parport_read (struct parport *, void *buf, size_t len);
ian@0 676
ian@0 677 DESCRIPTION
ian@0 678
ian@0 679 Read data from device in current IEEE 1284 transfer mode. This only
ian@0 680 works for modes that support reverse data transfer.
ian@0 681
ian@0 682 RETURN VALUE
ian@0 683
ian@0 684 If negative, an error code; otherwise the number of bytes transferred.
ian@0 685
ian@0 686 SEE ALSO
ian@0 687
ian@0 688 parport_write, parport_negotiate
ian@0 689
ian@0 690 parport_write - write data to device
ian@0 691 -------------
ian@0 692
ian@0 693 SYNOPSIS
ian@0 694
ian@0 695 #include <linux/parport.h>
ian@0 696
ian@0 697 ssize_t parport_write (struct parport *, const void *buf, size_t len);
ian@0 698
ian@0 699 DESCRIPTION
ian@0 700
ian@0 701 Write data to device in current IEEE 1284 transfer mode. This only
ian@0 702 works for modes that support forward data transfer.
ian@0 703
ian@0 704 RETURN VALUE
ian@0 705
ian@0 706 If negative, an error code; otherwise the number of bytes transferred.
ian@0 707
ian@0 708 SEE ALSO
ian@0 709
ian@0 710 parport_read, parport_negotiate
ian@0 711
ian@0 712 parport_open - register device for particular device number
ian@0 713 ------------
ian@0 714
ian@0 715 SYNOPSIS
ian@0 716
ian@0 717 #include <linux/parport.h>
ian@0 718
ian@0 719 struct pardevice *parport_open (int devnum, const char *name,
ian@0 720 int (*pf) (void *),
ian@0 721 void (*kf) (void *),
ian@0 722 void (*irqf) (int, void *,
ian@0 723 struct pt_regs *),
ian@0 724 int flags, void *handle);
ian@0 725
ian@0 726 DESCRIPTION
ian@0 727
ian@0 728 This is like parport_register_device but takes a device number instead
ian@0 729 of a pointer to a struct parport.
ian@0 730
ian@0 731 RETURN VALUE
ian@0 732
ian@0 733 See parport_register_device. If no device is associated with devnum,
ian@0 734 NULL is returned.
ian@0 735
ian@0 736 SEE ALSO
ian@0 737
ian@0 738 parport_register_device, parport_device_num
ian@0 739
ian@0 740 parport_close - unregister device for particular device number
ian@0 741 -------------
ian@0 742
ian@0 743 SYNOPSIS
ian@0 744
ian@0 745 #include <linux/parport.h>
ian@0 746
ian@0 747 void parport_close (struct pardevice *dev);
ian@0 748
ian@0 749 DESCRIPTION
ian@0 750
ian@0 751 This is the equivalent of parport_unregister_device for parport_open.
ian@0 752
ian@0 753 SEE ALSO
ian@0 754
ian@0 755 parport_unregister_device, parport_open
ian@0 756
ian@0 757 parport_device_id - obtain IEEE 1284 Device ID
ian@0 758 -----------------
ian@0 759
ian@0 760 SYNOPSIS
ian@0 761
ian@0 762 #include <linux/parport.h>
ian@0 763
ian@0 764 ssize_t parport_device_id (int devnum, char *buffer, size_t len);
ian@0 765
ian@0 766 DESCRIPTION
ian@0 767
ian@0 768 Obtains the IEEE 1284 Device ID associated with a given device.
ian@0 769
ian@0 770 RETURN VALUE
ian@0 771
ian@0 772 If negative, an error code; otherwise, the number of bytes of buffer
ian@0 773 that contain the device ID. The format of the device ID is as
ian@0 774 follows:
ian@0 775
ian@0 776 [length][ID]
ian@0 777
ian@0 778 The first two bytes indicate the inclusive length of the entire Device
ian@0 779 ID, and are in big-endian order. The ID is a sequence of pairs of the
ian@0 780 form:
ian@0 781
ian@0 782 key:value;
ian@0 783
ian@0 784 NOTES
ian@0 785
ian@0 786 Many devices have ill-formed IEEE 1284 Device IDs.
ian@0 787
ian@0 788 SEE ALSO
ian@0 789
ian@0 790 parport_find_class, parport_find_device, parport_device_num
ian@0 791
ian@0 792 parport_device_num - convert device coordinates to device number
ian@0 793 ------------------
ian@0 794
ian@0 795 SYNOPSIS
ian@0 796
ian@0 797 #include <linux/parport.h>
ian@0 798
ian@0 799 int parport_device_num (int parport, int mux, int daisy);
ian@0 800
ian@0 801 DESCRIPTION
ian@0 802
ian@0 803 Convert between device coordinates (port, multiplexor, daisy chain
ian@0 804 address) and device number (zero-based).
ian@0 805
ian@0 806 RETURN VALUE
ian@0 807
ian@0 808 Device number, or -1 if no device at given coordinates.
ian@0 809
ian@0 810 SEE ALSO
ian@0 811
ian@0 812 parport_device_coords, parport_open, parport_device_id
ian@0 813
ian@0 814 parport_device_coords - convert device number to device coordinates
ian@0 815 ------------------
ian@0 816
ian@0 817 SYNOPSIS
ian@0 818
ian@0 819 #include <linux/parport.h>
ian@0 820
ian@0 821 int parport_device_coords (int devnum, int *parport, int *mux,
ian@0 822 int *daisy);
ian@0 823
ian@0 824 DESCRIPTION
ian@0 825
ian@0 826 Convert between device number (zero-based) and device coordinates
ian@0 827 (port, multiplexor, daisy chain address).
ian@0 828
ian@0 829 RETURN VALUE
ian@0 830
ian@0 831 Zero on success, in which case the coordinates are (*parport, *mux,
ian@0 832 *daisy).
ian@0 833
ian@0 834 SEE ALSO
ian@0 835
ian@0 836 parport_device_num, parport_open, parport_device_id
ian@0 837
ian@0 838 parport_find_class - find a device by its class
ian@0 839 ------------------
ian@0 840
ian@0 841 SYNOPSIS
ian@0 842
ian@0 843 #include <linux/parport.h>
ian@0 844
ian@0 845 typedef enum {
ian@0 846 PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
ian@0 847 PARPORT_CLASS_PRINTER,
ian@0 848 PARPORT_CLASS_MODEM,
ian@0 849 PARPORT_CLASS_NET,
ian@0 850 PARPORT_CLASS_HDC, /* Hard disk controller */
ian@0 851 PARPORT_CLASS_PCMCIA,
ian@0 852 PARPORT_CLASS_MEDIA, /* Multimedia device */
ian@0 853 PARPORT_CLASS_FDC, /* Floppy disk controller */
ian@0 854 PARPORT_CLASS_PORTS,
ian@0 855 PARPORT_CLASS_SCANNER,
ian@0 856 PARPORT_CLASS_DIGCAM,
ian@0 857 PARPORT_CLASS_OTHER, /* Anything else */
ian@0 858 PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
ian@0 859 PARPORT_CLASS_SCSIADAPTER
ian@0 860 } parport_device_class;
ian@0 861
ian@0 862 int parport_find_class (parport_device_class cls, int from);
ian@0 863
ian@0 864 DESCRIPTION
ian@0 865
ian@0 866 Find a device by class. The search starts from device number from+1.
ian@0 867
ian@0 868 RETURN VALUE
ian@0 869
ian@0 870 The device number of the next device in that class, or -1 if no such
ian@0 871 device exists.
ian@0 872
ian@0 873 NOTES
ian@0 874
ian@0 875 Example usage:
ian@0 876
ian@0 877 int devnum = -1;
ian@0 878 while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) {
ian@0 879 struct pardevice *dev = parport_open (devnum, ...);
ian@0 880 ...
ian@0 881 }
ian@0 882
ian@0 883 SEE ALSO
ian@0 884
ian@0 885 parport_find_device, parport_open, parport_device_id
ian@0 886
ian@0 887 parport_find_device - find a device by its class
ian@0 888 ------------------
ian@0 889
ian@0 890 SYNOPSIS
ian@0 891
ian@0 892 #include <linux/parport.h>
ian@0 893
ian@0 894 int parport_find_device (const char *mfg, const char *mdl, int from);
ian@0 895
ian@0 896 DESCRIPTION
ian@0 897
ian@0 898 Find a device by vendor and model. The search starts from device
ian@0 899 number from+1.
ian@0 900
ian@0 901 RETURN VALUE
ian@0 902
ian@0 903 The device number of the next device matching the specifications, or
ian@0 904 -1 if no such device exists.
ian@0 905
ian@0 906 NOTES
ian@0 907
ian@0 908 Example usage:
ian@0 909
ian@0 910 int devnum = -1;
ian@0 911 while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) {
ian@0 912 struct pardevice *dev = parport_open (devnum, ...);
ian@0 913 ...
ian@0 914 }
ian@0 915
ian@0 916 SEE ALSO
ian@0 917
ian@0 918 parport_find_class, parport_open, parport_device_id
ian@0 919
ian@0 920 parport_set_timeout - set the inactivity timeout
ian@0 921 -------------------
ian@0 922
ian@0 923 SYNOPSIS
ian@0 924
ian@0 925 #include <linux/parport.h>
ian@0 926
ian@0 927 long parport_set_timeout (struct pardevice *dev, long inactivity);
ian@0 928
ian@0 929 DESCRIPTION
ian@0 930
ian@0 931 Set the inactivity timeout, in jiffies, for a registered device. The
ian@0 932 previous timeout is returned.
ian@0 933
ian@0 934 RETURN VALUE
ian@0 935
ian@0 936 The previous timeout, in jiffies.
ian@0 937
ian@0 938 NOTES
ian@0 939
ian@0 940 Some of the port->ops functions for a parport may take time, owing to
ian@0 941 delays at the peripheral. After the peripheral has not responded for
ian@0 942 'inactivity' jiffies, a timeout will occur and the blocking function
ian@0 943 will return.
ian@0 944
ian@0 945 A timeout of 0 jiffies is a special case: the function must do as much
ian@0 946 as it can without blocking or leaving the hardware in an unknown
ian@0 947 state. If port operations are performed from within an interrupt
ian@0 948 handler, for instance, a timeout of 0 jiffies should be used.
ian@0 949
ian@0 950 Once set for a registered device, the timeout will remain at the set
ian@0 951 value until set again.
ian@0 952
ian@0 953 SEE ALSO
ian@0 954
ian@0 955 port->ops->xxx_read/write_yyy
ian@0 956
ian@0 957 PORT FUNCTIONS
ian@0 958 --------------
ian@0 959
ian@0 960 The functions in the port->ops structure (struct parport_operations)
ian@0 961 are provided by the low-level driver responsible for that port.
ian@0 962
ian@0 963 port->ops->read_data - read the data register
ian@0 964 --------------------
ian@0 965
ian@0 966 SYNOPSIS
ian@0 967
ian@0 968 #include <linux/parport.h>
ian@0 969
ian@0 970 struct parport_operations {
ian@0 971 ...
ian@0 972 unsigned char (*read_data) (struct parport *port);
ian@0 973 ...
ian@0 974 };
ian@0 975
ian@0 976 DESCRIPTION
ian@0 977
ian@0 978 If port->modes contains the PARPORT_MODE_TRISTATE flag and the
ian@0 979 PARPORT_CONTROL_DIRECTION bit in the control register is set, this
ian@0 980 returns the value on the data pins. If port->modes contains the
ian@0 981 PARPORT_MODE_TRISTATE flag and the PARPORT_CONTROL_DIRECTION bit is
ian@0 982 not set, the return value _may_ be the last value written to the data
ian@0 983 register. Otherwise the return value is undefined.
ian@0 984
ian@0 985 SEE ALSO
ian@0 986
ian@0 987 write_data, read_status, write_control
ian@0 988
ian@0 989 port->ops->write_data - write the data register
ian@0 990 ---------------------
ian@0 991
ian@0 992 SYNOPSIS
ian@0 993
ian@0 994 #include <linux/parport.h>
ian@0 995
ian@0 996 struct parport_operations {
ian@0 997 ...
ian@0 998 void (*write_data) (struct parport *port, unsigned char d);
ian@0 999 ...
ian@0 1000 };
ian@0 1001
ian@0 1002 DESCRIPTION
ian@0 1003
ian@0 1004 Writes to the data register. May have side-effects (a STROBE pulse,
ian@0 1005 for instance).
ian@0 1006
ian@0 1007 SEE ALSO
ian@0 1008
ian@0 1009 read_data, read_status, write_control
ian@0 1010
ian@0 1011 port->ops->read_status - read the status register
ian@0 1012 ----------------------
ian@0 1013
ian@0 1014 SYNOPSIS
ian@0 1015
ian@0 1016 #include <linux/parport.h>
ian@0 1017
ian@0 1018 struct parport_operations {
ian@0 1019 ...
ian@0 1020 unsigned char (*read_status) (struct parport *port);
ian@0 1021 ...
ian@0 1022 };
ian@0 1023
ian@0 1024 DESCRIPTION
ian@0 1025
ian@0 1026 Reads from the status register. This is a bitmask:
ian@0 1027
ian@0 1028 - PARPORT_STATUS_ERROR (printer fault, "nFault")
ian@0 1029 - PARPORT_STATUS_SELECT (on-line, "Select")
ian@0 1030 - PARPORT_STATUS_PAPEROUT (no paper, "PError")
ian@0 1031 - PARPORT_STATUS_ACK (handshake, "nAck")
ian@0 1032 - PARPORT_STATUS_BUSY (busy, "Busy")
ian@0 1033
ian@0 1034 There may be other bits set.
ian@0 1035
ian@0 1036 SEE ALSO
ian@0 1037
ian@0 1038 read_data, write_data, write_control
ian@0 1039
ian@0 1040 port->ops->read_control - read the control register
ian@0 1041 -----------------------
ian@0 1042
ian@0 1043 SYNOPSIS
ian@0 1044
ian@0 1045 #include <linux/parport.h>
ian@0 1046
ian@0 1047 struct parport_operations {
ian@0 1048 ...
ian@0 1049 unsigned char (*read_control) (struct parport *port);
ian@0 1050 ...
ian@0 1051 };
ian@0 1052
ian@0 1053 DESCRIPTION
ian@0 1054
ian@0 1055 Returns the last value written to the control register (either from
ian@0 1056 write_control or frob_control). No port access is performed.
ian@0 1057
ian@0 1058 SEE ALSO
ian@0 1059
ian@0 1060 read_data, write_data, read_status, write_control
ian@0 1061
ian@0 1062 port->ops->write_control - write the control register
ian@0 1063 ------------------------
ian@0 1064
ian@0 1065 SYNOPSIS
ian@0 1066
ian@0 1067 #include <linux/parport.h>
ian@0 1068
ian@0 1069 struct parport_operations {
ian@0 1070 ...
ian@0 1071 void (*write_control) (struct parport *port, unsigned char s);
ian@0 1072 ...
ian@0 1073 };
ian@0 1074
ian@0 1075 DESCRIPTION
ian@0 1076
ian@0 1077 Writes to the control register. This is a bitmask:
ian@0 1078 _______
ian@0 1079 - PARPORT_CONTROL_STROBE (nStrobe)
ian@0 1080 _______
ian@0 1081 - PARPORT_CONTROL_AUTOFD (nAutoFd)
ian@0 1082 _____
ian@0 1083 - PARPORT_CONTROL_INIT (nInit)
ian@0 1084 _________
ian@0 1085 - PARPORT_CONTROL_SELECT (nSelectIn)
ian@0 1086
ian@0 1087 SEE ALSO
ian@0 1088
ian@0 1089 read_data, write_data, read_status, frob_control
ian@0 1090
ian@0 1091 port->ops->frob_control - write control register bits
ian@0 1092 -----------------------
ian@0 1093
ian@0 1094 SYNOPSIS
ian@0 1095
ian@0 1096 #include <linux/parport.h>
ian@0 1097
ian@0 1098 struct parport_operations {
ian@0 1099 ...
ian@0 1100 unsigned char (*frob_control) (struct parport *port,
ian@0 1101 unsigned char mask,
ian@0 1102 unsigned char val);
ian@0 1103 ...
ian@0 1104 };
ian@0 1105
ian@0 1106 DESCRIPTION
ian@0 1107
ian@0 1108 This is equivalent to reading from the control register, masking out
ian@0 1109 the bits in mask, exclusive-or'ing with the bits in val, and writing
ian@0 1110 the result to the control register.
ian@0 1111
ian@0 1112 As some ports don't allow reads from the control port, a software copy
ian@0 1113 of its contents is maintained, so frob_control is in fact only one
ian@0 1114 port access.
ian@0 1115
ian@0 1116 SEE ALSO
ian@0 1117
ian@0 1118 read_data, write_data, read_status, write_control
ian@0 1119
ian@0 1120 port->ops->enable_irq - enable interrupt generation
ian@0 1121 ---------------------
ian@0 1122
ian@0 1123 SYNOPSIS
ian@0 1124
ian@0 1125 #include <linux/parport.h>
ian@0 1126
ian@0 1127 struct parport_operations {
ian@0 1128 ...
ian@0 1129 void (*enable_irq) (struct parport *port);
ian@0 1130 ...
ian@0 1131 };
ian@0 1132
ian@0 1133 DESCRIPTION
ian@0 1134
ian@0 1135 The parallel port hardware is instructed to generate interrupts at
ian@0 1136 appropriate moments, although those moments are
ian@0 1137 architecture-specific. For the PC architecture, interrupts are
ian@0 1138 commonly generated on the rising edge of nAck.
ian@0 1139
ian@0 1140 SEE ALSO
ian@0 1141
ian@0 1142 disable_irq
ian@0 1143
ian@0 1144 port->ops->disable_irq - disable interrupt generation
ian@0 1145 ----------------------
ian@0 1146
ian@0 1147 SYNOPSIS
ian@0 1148
ian@0 1149 #include <linux/parport.h>
ian@0 1150
ian@0 1151 struct parport_operations {
ian@0 1152 ...
ian@0 1153 void (*disable_irq) (struct parport *port);
ian@0 1154 ...
ian@0 1155 };
ian@0 1156
ian@0 1157 DESCRIPTION
ian@0 1158
ian@0 1159 The parallel port hardware is instructed not to generate interrupts.
ian@0 1160 The interrupt itself is not masked.
ian@0 1161
ian@0 1162 SEE ALSO
ian@0 1163
ian@0 1164 enable_irq
ian@0 1165
ian@0 1166 port->ops->data_forward - enable data drivers
ian@0 1167 -----------------------
ian@0 1168
ian@0 1169 SYNOPSIS
ian@0 1170
ian@0 1171 #include <linux/parport.h>
ian@0 1172
ian@0 1173 struct parport_operations {
ian@0 1174 ...
ian@0 1175 void (*data_forward) (struct parport *port);
ian@0 1176 ...
ian@0 1177 };
ian@0 1178
ian@0 1179 DESCRIPTION
ian@0 1180
ian@0 1181 Enables the data line drivers, for 8-bit host-to-peripheral
ian@0 1182 communications.
ian@0 1183
ian@0 1184 SEE ALSO
ian@0 1185
ian@0 1186 data_reverse
ian@0 1187
ian@0 1188 port->ops->data_reverse - tristate the buffer
ian@0 1189 -----------------------
ian@0 1190
ian@0 1191 SYNOPSIS
ian@0 1192
ian@0 1193 #include <linux/parport.h>
ian@0 1194
ian@0 1195 struct parport_operations {
ian@0 1196 ...
ian@0 1197 void (*data_reverse) (struct parport *port);
ian@0 1198 ...
ian@0 1199 };
ian@0 1200
ian@0 1201 DESCRIPTION
ian@0 1202
ian@0 1203 Places the data bus in a high impedance state, if port->modes has the
ian@0 1204 PARPORT_MODE_TRISTATE bit set.
ian@0 1205
ian@0 1206 SEE ALSO
ian@0 1207
ian@0 1208 data_forward
ian@0 1209
ian@0 1210 port->ops->epp_write_data - write EPP data
ian@0 1211 -------------------------
ian@0 1212
ian@0 1213 SYNOPSIS
ian@0 1214
ian@0 1215 #include <linux/parport.h>
ian@0 1216
ian@0 1217 struct parport_operations {
ian@0 1218 ...
ian@0 1219 size_t (*epp_write_data) (struct parport *port, const void *buf,
ian@0 1220 size_t len, int flags);
ian@0 1221 ...
ian@0 1222 };
ian@0 1223
ian@0 1224 DESCRIPTION
ian@0 1225
ian@0 1226 Writes data in EPP mode, and returns the number of bytes written.
ian@0 1227
ian@0 1228 The 'flags' parameter may be one or more of the following,
ian@0 1229 bitwise-or'ed together:
ian@0 1230
ian@0 1231 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
ian@0 1232 32-bit registers. However, if a transfer
ian@0 1233 times out, the return value may be unreliable.
ian@0 1234
ian@0 1235 SEE ALSO
ian@0 1236
ian@0 1237 epp_read_data, epp_write_addr, epp_read_addr
ian@0 1238
ian@0 1239 port->ops->epp_read_data - read EPP data
ian@0 1240 ------------------------
ian@0 1241
ian@0 1242 SYNOPSIS
ian@0 1243
ian@0 1244 #include <linux/parport.h>
ian@0 1245
ian@0 1246 struct parport_operations {
ian@0 1247 ...
ian@0 1248 size_t (*epp_read_data) (struct parport *port, void *buf,
ian@0 1249 size_t len, int flags);
ian@0 1250 ...
ian@0 1251 };
ian@0 1252
ian@0 1253 DESCRIPTION
ian@0 1254
ian@0 1255 Reads data in EPP mode, and returns the number of bytes read.
ian@0 1256
ian@0 1257 The 'flags' parameter may be one or more of the following,
ian@0 1258 bitwise-or'ed together:
ian@0 1259
ian@0 1260 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
ian@0 1261 32-bit registers. However, if a transfer
ian@0 1262 times out, the return value may be unreliable.
ian@0 1263
ian@0 1264 SEE ALSO
ian@0 1265
ian@0 1266 epp_write_data, epp_write_addr, epp_read_addr
ian@0 1267
ian@0 1268 port->ops->epp_write_addr - write EPP address
ian@0 1269 -------------------------
ian@0 1270
ian@0 1271 SYNOPSIS
ian@0 1272
ian@0 1273 #include <linux/parport.h>
ian@0 1274
ian@0 1275 struct parport_operations {
ian@0 1276 ...
ian@0 1277 size_t (*epp_write_addr) (struct parport *port,
ian@0 1278 const void *buf, size_t len, int flags);
ian@0 1279 ...
ian@0 1280 };
ian@0 1281
ian@0 1282 DESCRIPTION
ian@0 1283
ian@0 1284 Writes EPP addresses (8 bits each), and returns the number written.
ian@0 1285
ian@0 1286 The 'flags' parameter may be one or more of the following,
ian@0 1287 bitwise-or'ed together:
ian@0 1288
ian@0 1289 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
ian@0 1290 32-bit registers. However, if a transfer
ian@0 1291 times out, the return value may be unreliable.
ian@0 1292
ian@0 1293 (Does PARPORT_EPP_FAST make sense for this function?)
ian@0 1294
ian@0 1295 SEE ALSO
ian@0 1296
ian@0 1297 epp_write_data, epp_read_data, epp_read_addr
ian@0 1298
ian@0 1299 port->ops->epp_read_addr - read EPP address
ian@0 1300 ------------------------
ian@0 1301
ian@0 1302 SYNOPSIS
ian@0 1303
ian@0 1304 #include <linux/parport.h>
ian@0 1305
ian@0 1306 struct parport_operations {
ian@0 1307 ...
ian@0 1308 size_t (*epp_read_addr) (struct parport *port, void *buf,
ian@0 1309 size_t len, int flags);
ian@0 1310 ...
ian@0 1311 };
ian@0 1312
ian@0 1313 DESCRIPTION
ian@0 1314
ian@0 1315 Reads EPP addresses (8 bits each), and returns the number read.
ian@0 1316
ian@0 1317 The 'flags' parameter may be one or more of the following,
ian@0 1318 bitwise-or'ed together:
ian@0 1319
ian@0 1320 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
ian@0 1321 32-bit registers. However, if a transfer
ian@0 1322 times out, the return value may be unreliable.
ian@0 1323
ian@0 1324 (Does PARPORT_EPP_FAST make sense for this function?)
ian@0 1325
ian@0 1326 SEE ALSO
ian@0 1327
ian@0 1328 epp_write_data, epp_read_data, epp_write_addr
ian@0 1329
ian@0 1330 port->ops->ecp_write_data - write a block of ECP data
ian@0 1331 -------------------------
ian@0 1332
ian@0 1333 SYNOPSIS
ian@0 1334
ian@0 1335 #include <linux/parport.h>
ian@0 1336
ian@0 1337 struct parport_operations {
ian@0 1338 ...
ian@0 1339 size_t (*ecp_write_data) (struct parport *port,
ian@0 1340 const void *buf, size_t len, int flags);
ian@0 1341 ...
ian@0 1342 };
ian@0 1343
ian@0 1344 DESCRIPTION
ian@0 1345
ian@0 1346 Writes a block of ECP data. The 'flags' parameter is ignored.
ian@0 1347
ian@0 1348 RETURN VALUE
ian@0 1349
ian@0 1350 The number of bytes written.
ian@0 1351
ian@0 1352 SEE ALSO
ian@0 1353
ian@0 1354 ecp_read_data, ecp_write_addr
ian@0 1355
ian@0 1356 port->ops->ecp_read_data - read a block of ECP data
ian@0 1357 ------------------------
ian@0 1358
ian@0 1359 SYNOPSIS
ian@0 1360
ian@0 1361 #include <linux/parport.h>
ian@0 1362
ian@0 1363 struct parport_operations {
ian@0 1364 ...
ian@0 1365 size_t (*ecp_read_data) (struct parport *port,
ian@0 1366 void *buf, size_t len, int flags);
ian@0 1367 ...
ian@0 1368 };
ian@0 1369
ian@0 1370 DESCRIPTION
ian@0 1371
ian@0 1372 Reads a block of ECP data. The 'flags' parameter is ignored.
ian@0 1373
ian@0 1374 RETURN VALUE
ian@0 1375
ian@0 1376 The number of bytes read. NB. There may be more unread data in a
ian@0 1377 FIFO. Is there a way of stunning the FIFO to prevent this?
ian@0 1378
ian@0 1379 SEE ALSO
ian@0 1380
ian@0 1381 ecp_write_block, ecp_write_addr
ian@0 1382
ian@0 1383 port->ops->ecp_write_addr - write a block of ECP addresses
ian@0 1384 -------------------------
ian@0 1385
ian@0 1386 SYNOPSIS
ian@0 1387
ian@0 1388 #include <linux/parport.h>
ian@0 1389
ian@0 1390 struct parport_operations {
ian@0 1391 ...
ian@0 1392 size_t (*ecp_write_addr) (struct parport *port,
ian@0 1393 const void *buf, size_t len, int flags);
ian@0 1394 ...
ian@0 1395 };
ian@0 1396
ian@0 1397 DESCRIPTION
ian@0 1398
ian@0 1399 Writes a block of ECP addresses. The 'flags' parameter is ignored.
ian@0 1400
ian@0 1401 RETURN VALUE
ian@0 1402
ian@0 1403 The number of bytes written.
ian@0 1404
ian@0 1405 NOTES
ian@0 1406
ian@0 1407 This may use a FIFO, and if so shall not return until the FIFO is empty.
ian@0 1408
ian@0 1409 SEE ALSO
ian@0 1410
ian@0 1411 ecp_read_data, ecp_write_data
ian@0 1412
ian@0 1413 port->ops->nibble_read_data - read a block of data in nibble mode
ian@0 1414 ---------------------------
ian@0 1415
ian@0 1416 SYNOPSIS
ian@0 1417
ian@0 1418 #include <linux/parport.h>
ian@0 1419
ian@0 1420 struct parport_operations {
ian@0 1421 ...
ian@0 1422 size_t (*nibble_read_data) (struct parport *port,
ian@0 1423 void *buf, size_t len, int flags);
ian@0 1424 ...
ian@0 1425 };
ian@0 1426
ian@0 1427 DESCRIPTION
ian@0 1428
ian@0 1429 Reads a block of data in nibble mode. The 'flags' parameter is ignored.
ian@0 1430
ian@0 1431 RETURN VALUE
ian@0 1432
ian@0 1433 The number of whole bytes read.
ian@0 1434
ian@0 1435 SEE ALSO
ian@0 1436
ian@0 1437 byte_read_data, compat_write_data
ian@0 1438
ian@0 1439 port->ops->byte_read_data - read a block of data in byte mode
ian@0 1440 -------------------------
ian@0 1441
ian@0 1442 SYNOPSIS
ian@0 1443
ian@0 1444 #include <linux/parport.h>
ian@0 1445
ian@0 1446 struct parport_operations {
ian@0 1447 ...
ian@0 1448 size_t (*byte_read_data) (struct parport *port,
ian@0 1449 void *buf, size_t len, int flags);
ian@0 1450 ...
ian@0 1451 };
ian@0 1452
ian@0 1453 DESCRIPTION
ian@0 1454
ian@0 1455 Reads a block of data in byte mode. The 'flags' parameter is ignored.
ian@0 1456
ian@0 1457 RETURN VALUE
ian@0 1458
ian@0 1459 The number of bytes read.
ian@0 1460
ian@0 1461 SEE ALSO
ian@0 1462
ian@0 1463 nibble_read_data, compat_write_data
ian@0 1464
ian@0 1465 port->ops->compat_write_data - write a block of data in compatibility mode
ian@0 1466 ----------------------------
ian@0 1467
ian@0 1468 SYNOPSIS
ian@0 1469
ian@0 1470 #include <linux/parport.h>
ian@0 1471
ian@0 1472 struct parport_operations {
ian@0 1473 ...
ian@0 1474 size_t (*compat_write_data) (struct parport *port,
ian@0 1475 const void *buf, size_t len, int flags);
ian@0 1476 ...
ian@0 1477 };
ian@0 1478
ian@0 1479 DESCRIPTION
ian@0 1480
ian@0 1481 Writes a block of data in compatibility mode. The 'flags' parameter
ian@0 1482 is ignored.
ian@0 1483
ian@0 1484 RETURN VALUE
ian@0 1485
ian@0 1486 The number of bytes written.
ian@0 1487
ian@0 1488 SEE ALSO
ian@0 1489
ian@0 1490 nibble_read_data, byte_read_data