1 ===============================
2 PARPORT interface documentation
3 ===============================
5 :Time-stamp: <2000-02-24 13:30:20 twaugh>
7 Described here are the following functions:
10 parport_register_driver
11 parport_unregister_driver
13 parport_register_device
14 parport_unregister_device
16 parport_claim_or_block
19 parport_yield_blocking
20 parport_wait_peripheral
21 parport_poll_peripheral
34 Port functions (can be overridden by low-level drivers):
39 port->ops->read_status
40 port->ops->read_control
41 port->ops->write_control
42 port->ops->frob_control
44 port->ops->disable_irq
45 port->ops->data_forward
46 port->ops->data_reverse
49 port->ops->epp_write_data
50 port->ops->epp_read_data
51 port->ops->epp_write_addr
52 port->ops->epp_read_addr
55 port->ops->ecp_write_data
56 port->ops->ecp_read_data
57 port->ops->ecp_write_addr
60 port->ops->nibble_read_data
61 port->ops->byte_read_data
62 port->ops->compat_write_data
64 The parport subsystem comprises ``parport`` (the core port-sharing
65 code), and a variety of low-level drivers that actually do the port
66 accesses. Each low-level driver handles a particular style of port
67 (PC, Amiga, and so on).
69 The parport interface to the device driver author can be broken down
70 into global functions and port functions.
72 The global functions are mostly for communicating between the device
73 driver and the parport subsystem: acquiring a list of available ports,
74 claiming a port for exclusive use, and so on. They also include
75 ``generic`` functions for doing standard things that will work on any
76 IEEE 1284-capable architecture.
78 The port functions are provided by the low-level drivers, although the
79 core parport module provides generic ``defaults`` for some routines.
80 The port functions can be split into three groups: SPP, EPP, and ECP.
82 SPP (Standard Parallel Port) functions modify so-called ``SPP``
83 registers: data, status, and control. The hardware may not actually
84 have registers exactly like that, but the PC does and this interface is
85 modelled after common PC implementations. Other low-level drivers may
86 be able to emulate most of the functionality.
88 EPP (Enhanced Parallel Port) functions are provided for reading and
89 writing in IEEE 1284 EPP mode, and ECP (Extended Capabilities Port)
90 functions are used for IEEE 1284 ECP mode. (What about BECP? Does
93 Hardware assistance for EPP and/or ECP transfers may or may not be
94 available, and if it is available it may or may not be used. If
95 hardware is not used, the transfer will be software-driven. In order
96 to cope with peripherals that only tenuously support IEEE 1284, a
97 low-level driver specific function is provided, for altering 'fudge
103 parport_register_driver - register a device driver with parport
104 ---------------------------------------------------------------
111 #include <linux/parport.h>
113 struct parport_driver {
115 void (*attach) (struct parport *);
116 void (*detach) (struct parport *);
117 struct parport_driver *next;
119 int parport_register_driver (struct parport_driver *driver);
124 In order to be notified about parallel ports when they are detected,
125 parport_register_driver should be called. Your driver will
126 immediately be notified of all ports that have already been detected,
127 and of each new port as low-level drivers are loaded.
129 A ``struct parport_driver`` contains the textual name of your driver,
130 a pointer to a function to handle new ports, and a pointer to a
131 function to handle ports going away due to a low-level driver
132 unloading. Ports will only be detached if they are not being used
133 (i.e. there are no devices registered on them).
135 The visible parts of the ``struct parport *`` argument given to
140 struct parport *next; /* next parport in list */
141 const char *name; /* port's name */
142 unsigned int modes; /* bitfield of hardware modes */
143 struct parport_device_info probe_info;
145 int number; /* parport index */
146 struct parport_operations *ops;
150 There are other members of the structure, but they should not be
153 The ``modes`` member summarises the capabilities of the underlying
154 hardware. It consists of flags which may be bitwise-ored together:
156 ============================= ===============================================
157 PARPORT_MODE_PCSPP IBM PC registers are available,
158 i.e. functions that act on data,
159 control and status registers are
160 probably writing directly to the
162 PARPORT_MODE_TRISTATE The data drivers may be turned off.
163 This allows the data lines to be used
164 for reverse (peripheral to host)
166 PARPORT_MODE_COMPAT The hardware can assist with
167 compatibility-mode (printer)
168 transfers, i.e. compat_write_block.
169 PARPORT_MODE_EPP The hardware can assist with EPP
171 PARPORT_MODE_ECP The hardware can assist with ECP
173 PARPORT_MODE_DMA The hardware can use DMA, so you might
174 want to pass ISA DMA-able memory
175 (i.e. memory allocated using the
176 GFP_DMA flag with kmalloc) to the
177 low-level driver in order to take
179 ============================= ===============================================
181 There may be other flags in ``modes`` as well.
183 The contents of ``modes`` is advisory only. For example, if the
184 hardware is capable of DMA, and PARPORT_MODE_DMA is in ``modes``, it
185 doesn't necessarily mean that DMA will always be used when possible.
186 Similarly, hardware that is capable of assisting ECP transfers won't
192 Zero on success, otherwise an error code.
197 None. (Can it fail? Why return int?)
204 static void lp_attach (struct parport *port)
207 private = kmalloc (...);
208 dev[count++] = parport_register_device (...);
212 static void lp_detach (struct parport *port)
217 static struct parport_driver lp_driver = {
221 NULL /* always put NULL here */
227 if (parport_register_driver (&lp_driver)) {
228 /* Failed; nothing we can do. */
238 parport_unregister_driver, parport_register_device, parport_enumerate
242 parport_unregister_driver - tell parport to forget about this driver
243 --------------------------------------------------------------------
250 #include <linux/parport.h>
252 struct parport_driver {
254 void (*attach) (struct parport *);
255 void (*detach) (struct parport *);
256 struct parport_driver *next;
258 void parport_unregister_driver (struct parport_driver *driver);
263 This tells parport not to notify the device driver of new ports or of
264 ports going away. Registered devices belonging to that driver are NOT
265 unregistered: parport_unregister_device must be used for each one.
272 void cleanup_module (void)
275 /* Stop notifications. */
276 parport_unregister_driver (&lp_driver);
278 /* Unregister devices. */
279 for (i = 0; i < NUM_DEVS; i++)
280 parport_unregister_device (dev[i]);
287 parport_register_driver, parport_enumerate
291 parport_enumerate - retrieve a list of parallel ports (DEPRECATED)
292 ------------------------------------------------------------------
299 #include <linux/parport.h>
301 struct parport *parport_enumerate (void);
306 Retrieve the first of a list of valid parallel ports for this machine.
307 Successive parallel ports can be found using the ``struct parport
308 *next`` element of the ``struct parport *`` that is returned. If ``next``
309 is NULL, there are no more parallel ports in the list. The number of
310 ports in the list will not exceed PARPORT_MAX.
315 A ``struct parport *`` describing a valid parallel port for the machine,
316 or NULL if there are none.
321 This function can return NULL to indicate that there are no parallel
329 int detect_device (void)
331 struct parport *port;
333 for (port = parport_enumerate ();
336 /* Try to detect a device on the port... */
347 parport_enumerate is deprecated; parport_register_driver should be
353 parport_register_driver, parport_unregister_driver
357 parport_register_device - register to use a port
358 ------------------------------------------------
365 #include <linux/parport.h>
367 typedef int (*preempt_func) (void *handle);
368 typedef void (*wakeup_func) (void *handle);
369 typedef int (*irq_func) (int irq, void *handle, struct pt_regs *);
371 struct pardevice *parport_register_device(struct parport *port,
373 preempt_func preempt,
382 Use this function to register your device driver on a parallel port
383 (``port``). Once you have done that, you will be able to use
384 parport_claim and parport_release in order to use the port.
386 The (``name``) argument is the name of the device that appears in /proc
387 filesystem. The string must be valid for the whole lifetime of the
388 device (until parport_unregister_device is called).
390 This function will register three callbacks into your driver:
391 ``preempt``, ``wakeup`` and ``irq``. Each of these may be NULL in order to
392 indicate that you do not want a callback.
394 When the ``preempt`` function is called, it is because another driver
395 wishes to use the parallel port. The ``preempt`` function should return
396 non-zero if the parallel port cannot be released yet -- if zero is
397 returned, the port is lost to another driver and the port must be
398 re-claimed before use.
400 The ``wakeup`` function is called once another driver has released the
401 port and no other driver has yet claimed it. You can claim the
402 parallel port from within the ``wakeup`` function (in which case the
403 claim is guaranteed to succeed), or choose not to if you don't need it
406 If an interrupt occurs on the parallel port your driver has claimed,
407 the ``irq`` function will be called. (Write something about shared
410 The ``handle`` is a pointer to driver-specific data, and is passed to
411 the callback functions.
413 ``flags`` may be a bitwise combination of the following flags:
415 ===================== =================================================
417 ===================== =================================================
418 PARPORT_DEV_EXCL The device cannot share the parallel port at all.
419 Use this only when absolutely necessary.
420 ===================== =================================================
422 The typedefs are not actually defined -- they are only shown in order
423 to make the function prototype more readable.
425 The visible parts of the returned ``struct pardevice`` are::
428 struct parport *port; /* Associated port */
429 void *private; /* Device driver's 'handle' */
436 A ``struct pardevice *``: a handle to the registered parallel port
437 device that can be used for parport_claim, parport_release, etc.
442 A return value of NULL indicates that there was a problem registering
443 a device on that port.
450 static int preempt (void *handle)
455 must_reclaim_port = 1;
459 static void wakeup (void *handle)
461 struct toaster *private = handle;
462 struct pardevice *dev = private->dev;
463 if (!dev) return; /* avoid races */
469 static int toaster_detect (struct toaster *private, struct parport *port)
471 private->dev = parport_register_device (port, "toaster", preempt,
475 /* Couldn't register with parport. */
478 must_reclaim_port = 0;
480 parport_claim_or_block (private->dev);
482 /* Don't need the port while the toaster warms up. */
486 if (must_reclaim_port) {
487 parport_claim_or_block (private->dev);
488 must_reclaim_port = 0;
496 parport_unregister_device, parport_claim
500 parport_unregister_device - finish using a port
501 -----------------------------------------------
507 #include <linux/parport.h>
509 void parport_unregister_device (struct pardevice *dev);
514 This function is the opposite of parport_register_device. After using
515 parport_unregister_device, ``dev`` is no longer a valid device handle.
517 You should not unregister a device that is currently claimed, although
518 if you do it will be released automatically.
526 kfree (dev->private); /* before we lose the pointer */
527 parport_unregister_device (dev);
534 parport_unregister_driver
536 parport_claim, parport_claim_or_block - claim the parallel port for a device
537 ----------------------------------------------------------------------------
544 #include <linux/parport.h>
546 int parport_claim (struct pardevice *dev);
547 int parport_claim_or_block (struct pardevice *dev);
552 These functions attempt to gain control of the parallel port on which
553 ``dev`` is registered. ``parport_claim`` does not block, but
554 ``parport_claim_or_block`` may do. (Put something here about blocking
555 interruptibly or non-interruptibly.)
557 You should not try to claim a port that you have already claimed.
562 A return value of zero indicates that the port was successfully
563 claimed, and the caller now has possession of the parallel port.
565 If ``parport_claim_or_block`` blocks before returning successfully, the
566 return value is positive.
571 ========== ==========================================================
572 -EAGAIN The port is unavailable at the moment, but another attempt
573 to claim it may succeed.
574 ========== ==========================================================
582 parport_release - release the parallel port
583 -------------------------------------------
590 #include <linux/parport.h>
592 void parport_release (struct pardevice *dev);
597 Once a parallel port device has been claimed, it can be released using
598 ``parport_release``. It cannot fail, but you should not release a
599 device that you do not have possession of.
606 static size_t write (struct pardevice *dev, const void *buf,
610 written = dev->port->ops->write_ecp_data (dev->port, buf,
612 parport_release (dev);
620 change_mode, parport_claim, parport_claim_or_block, parport_yield
624 parport_yield, parport_yield_blocking - temporarily release a parallel port
625 ---------------------------------------------------------------------------
632 #include <linux/parport.h>
634 int parport_yield (struct pardevice *dev)
635 int parport_yield_blocking (struct pardevice *dev);
640 When a driver has control of a parallel port, it may allow another
641 driver to temporarily ``borrow`` it. ``parport_yield`` does not block;
642 ``parport_yield_blocking`` may do.
647 A return value of zero indicates that the caller still owns the port
648 and the call did not block.
650 A positive return value from ``parport_yield_blocking`` indicates that
651 the caller still owns the port and the call blocked.
653 A return value of -EAGAIN indicates that the caller no longer owns the
654 port, and it must be re-claimed before use.
659 ========= ==========================================================
660 -EAGAIN Ownership of the parallel port was given away.
661 ========= ==========================================================
670 parport_wait_peripheral - wait for status lines, up to 35ms
671 -----------------------------------------------------------
678 #include <linux/parport.h>
680 int parport_wait_peripheral (struct parport *port,
687 Wait for the status lines in mask to match the values in val.
692 ======== ==========================================================
693 -EINTR a signal is pending
694 0 the status lines in mask have values in val
695 1 timed out while waiting (35ms elapsed)
696 ======== ==========================================================
701 parport_poll_peripheral
705 parport_poll_peripheral - wait for status lines, in usec
706 --------------------------------------------------------
713 #include <linux/parport.h>
715 int parport_poll_peripheral (struct parport *port,
723 Wait for the status lines in mask to match the values in val.
728 ======== ==========================================================
729 -EINTR a signal is pending
730 0 the status lines in mask have values in val
731 1 timed out while waiting (usec microseconds have elapsed)
732 ======== ==========================================================
737 parport_wait_peripheral
741 parport_wait_event - wait for an event on a port
742 ------------------------------------------------
749 #include <linux/parport.h>
751 int parport_wait_event (struct parport *port, signed long timeout)
756 Wait for an event (e.g. interrupt) on a port. The timeout is in
762 ======= ==========================================================
764 <0 error (exit as soon as possible)
766 ======= ==========================================================
768 parport_negotiate - perform IEEE 1284 negotiation
769 -------------------------------------------------
776 #include <linux/parport.h>
778 int parport_negotiate (struct parport *, int mode);
783 Perform IEEE 1284 negotiation.
788 ======= ==========================================================
789 0 handshake OK; IEEE 1284 peripheral and mode available
790 -1 handshake failed; peripheral not compliant (or none present)
791 1 handshake OK; IEEE 1284 peripheral present but mode not
793 ======= ==========================================================
798 parport_read, parport_write
802 parport_read - read data from device
803 ------------------------------------
810 #include <linux/parport.h>
812 ssize_t parport_read (struct parport *, void *buf, size_t len);
817 Read data from device in current IEEE 1284 transfer mode. This only
818 works for modes that support reverse data transfer.
823 If negative, an error code; otherwise the number of bytes transferred.
828 parport_write, parport_negotiate
832 parport_write - write data to device
833 ------------------------------------
840 #include <linux/parport.h>
842 ssize_t parport_write (struct parport *, const void *buf, size_t len);
847 Write data to device in current IEEE 1284 transfer mode. This only
848 works for modes that support forward data transfer.
853 If negative, an error code; otherwise the number of bytes transferred.
858 parport_read, parport_negotiate
862 parport_open - register device for particular device number
863 -----------------------------------------------------------
870 #include <linux/parport.h>
872 struct pardevice *parport_open (int devnum, const char *name,
875 void (*irqf) (int, void *,
877 int flags, void *handle);
882 This is like parport_register_device but takes a device number instead
883 of a pointer to a struct parport.
888 See parport_register_device. If no device is associated with devnum,
894 parport_register_device
898 parport_close - unregister device for particular device number
899 --------------------------------------------------------------
906 #include <linux/parport.h>
908 void parport_close (struct pardevice *dev);
913 This is the equivalent of parport_unregister_device for parport_open.
918 parport_unregister_device, parport_open
922 parport_device_id - obtain IEEE 1284 Device ID
923 ----------------------------------------------
930 #include <linux/parport.h>
932 ssize_t parport_device_id (int devnum, char *buffer, size_t len);
937 Obtains the IEEE 1284 Device ID associated with a given device.
942 If negative, an error code; otherwise, the number of bytes of buffer
943 that contain the device ID. The format of the device ID is as
948 The first two bytes indicate the inclusive length of the entire Device
949 ID, and are in big-endian order. The ID is a sequence of pairs of the
957 Many devices have ill-formed IEEE 1284 Device IDs.
962 parport_find_class, parport_find_device
966 parport_device_coords - convert device number to device coordinates
967 -------------------------------------------------------------------
974 #include <linux/parport.h>
976 int parport_device_coords (int devnum, int *parport, int *mux,
982 Convert between device number (zero-based) and device coordinates
983 (port, multiplexor, daisy chain address).
988 Zero on success, in which case the coordinates are (``*parport``, ``*mux``,
994 parport_open, parport_device_id
998 parport_find_class - find a device by its class
999 -----------------------------------------------
1006 #include <linux/parport.h>
1009 PARPORT_CLASS_LEGACY = 0, /* Non-IEEE1284 device */
1010 PARPORT_CLASS_PRINTER,
1011 PARPORT_CLASS_MODEM,
1013 PARPORT_CLASS_HDC, /* Hard disk controller */
1014 PARPORT_CLASS_PCMCIA,
1015 PARPORT_CLASS_MEDIA, /* Multimedia device */
1016 PARPORT_CLASS_FDC, /* Floppy disk controller */
1017 PARPORT_CLASS_PORTS,
1018 PARPORT_CLASS_SCANNER,
1019 PARPORT_CLASS_DIGCAM,
1020 PARPORT_CLASS_OTHER, /* Anything else */
1021 PARPORT_CLASS_UNSPEC, /* No CLS field in ID */
1022 PARPORT_CLASS_SCSIADAPTER
1023 } parport_device_class;
1025 int parport_find_class (parport_device_class cls, int from);
1030 Find a device by class. The search starts from device number from+1.
1035 The device number of the next device in that class, or -1 if no such
1044 while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) {
1045 struct pardevice *dev = parport_open (devnum, ...);
1052 parport_find_device, parport_open, parport_device_id
1056 parport_find_device - find a device by its class
1057 ------------------------------------------------
1064 #include <linux/parport.h>
1066 int parport_find_device (const char *mfg, const char *mdl, int from);
1071 Find a device by vendor and model. The search starts from device
1077 The device number of the next device matching the specifications, or
1078 -1 if no such device exists.
1086 while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) {
1087 struct pardevice *dev = parport_open (devnum, ...);
1094 parport_find_class, parport_open, parport_device_id
1098 parport_set_timeout - set the inactivity timeout
1099 ------------------------------------------------
1106 #include <linux/parport.h>
1108 long parport_set_timeout (struct pardevice *dev, long inactivity);
1113 Set the inactivity timeout, in jiffies, for a registered device. The
1114 previous timeout is returned.
1119 The previous timeout, in jiffies.
1124 Some of the port->ops functions for a parport may take time, owing to
1125 delays at the peripheral. After the peripheral has not responded for
1126 ``inactivity`` jiffies, a timeout will occur and the blocking function
1129 A timeout of 0 jiffies is a special case: the function must do as much
1130 as it can without blocking or leaving the hardware in an unknown
1131 state. If port operations are performed from within an interrupt
1132 handler, for instance, a timeout of 0 jiffies should be used.
1134 Once set for a registered device, the timeout will remain at the set
1135 value until set again.
1140 port->ops->xxx_read/write_yyy
1148 The functions in the port->ops structure (struct parport_operations)
1149 are provided by the low-level driver responsible for that port.
1151 port->ops->read_data - read the data register
1152 ---------------------------------------------
1159 #include <linux/parport.h>
1161 struct parport_operations {
1163 unsigned char (*read_data) (struct parport *port);
1170 If port->modes contains the PARPORT_MODE_TRISTATE flag and the
1171 PARPORT_CONTROL_DIRECTION bit in the control register is set, this
1172 returns the value on the data pins. If port->modes contains the
1173 PARPORT_MODE_TRISTATE flag and the PARPORT_CONTROL_DIRECTION bit is
1174 not set, the return value _may_ be the last value written to the data
1175 register. Otherwise the return value is undefined.
1180 write_data, read_status, write_control
1184 port->ops->write_data - write the data register
1185 -----------------------------------------------
1192 #include <linux/parport.h>
1194 struct parport_operations {
1196 void (*write_data) (struct parport *port, unsigned char d);
1203 Writes to the data register. May have side-effects (a STROBE pulse,
1209 read_data, read_status, write_control
1213 port->ops->read_status - read the status register
1214 -------------------------------------------------
1221 #include <linux/parport.h>
1223 struct parport_operations {
1225 unsigned char (*read_status) (struct parport *port);
1232 Reads from the status register. This is a bitmask:
1234 - PARPORT_STATUS_ERROR (printer fault, "nFault")
1235 - PARPORT_STATUS_SELECT (on-line, "Select")
1236 - PARPORT_STATUS_PAPEROUT (no paper, "PError")
1237 - PARPORT_STATUS_ACK (handshake, "nAck")
1238 - PARPORT_STATUS_BUSY (busy, "Busy")
1240 There may be other bits set.
1245 read_data, write_data, write_control
1249 port->ops->read_control - read the control register
1250 ---------------------------------------------------
1257 #include <linux/parport.h>
1259 struct parport_operations {
1261 unsigned char (*read_control) (struct parport *port);
1268 Returns the last value written to the control register (either from
1269 write_control or frob_control). No port access is performed.
1274 read_data, write_data, read_status, write_control
1278 port->ops->write_control - write the control register
1279 -----------------------------------------------------
1286 #include <linux/parport.h>
1288 struct parport_operations {
1290 void (*write_control) (struct parport *port, unsigned char s);
1297 Writes to the control register. This is a bitmask::
1300 - PARPORT_CONTROL_STROBE (nStrobe)
1302 - PARPORT_CONTROL_AUTOFD (nAutoFd)
1304 - PARPORT_CONTROL_INIT (nInit)
1306 - PARPORT_CONTROL_SELECT (nSelectIn)
1311 read_data, write_data, read_status, frob_control
1315 port->ops->frob_control - write control register bits
1316 -----------------------------------------------------
1323 #include <linux/parport.h>
1325 struct parport_operations {
1327 unsigned char (*frob_control) (struct parport *port,
1336 This is equivalent to reading from the control register, masking out
1337 the bits in mask, exclusive-or'ing with the bits in val, and writing
1338 the result to the control register.
1340 As some ports don't allow reads from the control port, a software copy
1341 of its contents is maintained, so frob_control is in fact only one
1347 read_data, write_data, read_status, write_control
1351 port->ops->enable_irq - enable interrupt generation
1352 ---------------------------------------------------
1359 #include <linux/parport.h>
1361 struct parport_operations {
1363 void (*enable_irq) (struct parport *port);
1370 The parallel port hardware is instructed to generate interrupts at
1371 appropriate moments, although those moments are
1372 architecture-specific. For the PC architecture, interrupts are
1373 commonly generated on the rising edge of nAck.
1382 port->ops->disable_irq - disable interrupt generation
1383 -----------------------------------------------------
1390 #include <linux/parport.h>
1392 struct parport_operations {
1394 void (*disable_irq) (struct parport *port);
1401 The parallel port hardware is instructed not to generate interrupts.
1402 The interrupt itself is not masked.
1411 port->ops->data_forward - enable data drivers
1412 ---------------------------------------------
1419 #include <linux/parport.h>
1421 struct parport_operations {
1423 void (*data_forward) (struct parport *port);
1430 Enables the data line drivers, for 8-bit host-to-peripheral
1440 port->ops->data_reverse - tristate the buffer
1441 ---------------------------------------------
1448 #include <linux/parport.h>
1450 struct parport_operations {
1452 void (*data_reverse) (struct parport *port);
1459 Places the data bus in a high impedance state, if port->modes has the
1460 PARPORT_MODE_TRISTATE bit set.
1469 port->ops->epp_write_data - write EPP data
1470 ------------------------------------------
1477 #include <linux/parport.h>
1479 struct parport_operations {
1481 size_t (*epp_write_data) (struct parport *port, const void *buf,
1482 size_t len, int flags);
1489 Writes data in EPP mode, and returns the number of bytes written.
1491 The ``flags`` parameter may be one or more of the following,
1492 bitwise-or'ed together:
1494 ======================= =================================================
1495 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
1496 32-bit registers. However, if a transfer
1497 times out, the return value may be unreliable.
1498 ======================= =================================================
1503 epp_read_data, epp_write_addr, epp_read_addr
1507 port->ops->epp_read_data - read EPP data
1508 ----------------------------------------
1515 #include <linux/parport.h>
1517 struct parport_operations {
1519 size_t (*epp_read_data) (struct parport *port, void *buf,
1520 size_t len, int flags);
1527 Reads data in EPP mode, and returns the number of bytes read.
1529 The ``flags`` parameter may be one or more of the following,
1530 bitwise-or'ed together:
1532 ======================= =================================================
1533 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
1534 32-bit registers. However, if a transfer
1535 times out, the return value may be unreliable.
1536 ======================= =================================================
1541 epp_write_data, epp_write_addr, epp_read_addr
1545 port->ops->epp_write_addr - write EPP address
1546 ---------------------------------------------
1553 #include <linux/parport.h>
1555 struct parport_operations {
1557 size_t (*epp_write_addr) (struct parport *port,
1558 const void *buf, size_t len, int flags);
1565 Writes EPP addresses (8 bits each), and returns the number written.
1567 The ``flags`` parameter may be one or more of the following,
1568 bitwise-or'ed together:
1570 ======================= =================================================
1571 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
1572 32-bit registers. However, if a transfer
1573 times out, the return value may be unreliable.
1574 ======================= =================================================
1576 (Does PARPORT_EPP_FAST make sense for this function?)
1581 epp_write_data, epp_read_data, epp_read_addr
1585 port->ops->epp_read_addr - read EPP address
1586 -------------------------------------------
1593 #include <linux/parport.h>
1595 struct parport_operations {
1597 size_t (*epp_read_addr) (struct parport *port, void *buf,
1598 size_t len, int flags);
1605 Reads EPP addresses (8 bits each), and returns the number read.
1607 The ``flags`` parameter may be one or more of the following,
1608 bitwise-or'ed together:
1610 ======================= =================================================
1611 PARPORT_EPP_FAST Use fast transfers. Some chips provide 16-bit and
1612 32-bit registers. However, if a transfer
1613 times out, the return value may be unreliable.
1614 ======================= =================================================
1616 (Does PARPORT_EPP_FAST make sense for this function?)
1621 epp_write_data, epp_read_data, epp_write_addr
1625 port->ops->ecp_write_data - write a block of ECP data
1626 -----------------------------------------------------
1633 #include <linux/parport.h>
1635 struct parport_operations {
1637 size_t (*ecp_write_data) (struct parport *port,
1638 const void *buf, size_t len, int flags);
1645 Writes a block of ECP data. The ``flags`` parameter is ignored.
1650 The number of bytes written.
1655 ecp_read_data, ecp_write_addr
1659 port->ops->ecp_read_data - read a block of ECP data
1660 ---------------------------------------------------
1667 #include <linux/parport.h>
1669 struct parport_operations {
1671 size_t (*ecp_read_data) (struct parport *port,
1672 void *buf, size_t len, int flags);
1679 Reads a block of ECP data. The ``flags`` parameter is ignored.
1684 The number of bytes read. NB. There may be more unread data in a
1685 FIFO. Is there a way of stunning the FIFO to prevent this?
1690 ecp_write_block, ecp_write_addr
1694 port->ops->ecp_write_addr - write a block of ECP addresses
1695 ----------------------------------------------------------
1702 #include <linux/parport.h>
1704 struct parport_operations {
1706 size_t (*ecp_write_addr) (struct parport *port,
1707 const void *buf, size_t len, int flags);
1714 Writes a block of ECP addresses. The ``flags`` parameter is ignored.
1719 The number of bytes written.
1724 This may use a FIFO, and if so shall not return until the FIFO is empty.
1729 ecp_read_data, ecp_write_data
1733 port->ops->nibble_read_data - read a block of data in nibble mode
1734 -----------------------------------------------------------------
1741 #include <linux/parport.h>
1743 struct parport_operations {
1745 size_t (*nibble_read_data) (struct parport *port,
1746 void *buf, size_t len, int flags);
1753 Reads a block of data in nibble mode. The ``flags`` parameter is ignored.
1758 The number of whole bytes read.
1763 byte_read_data, compat_write_data
1767 port->ops->byte_read_data - read a block of data in byte mode
1768 -------------------------------------------------------------
1775 #include <linux/parport.h>
1777 struct parport_operations {
1779 size_t (*byte_read_data) (struct parport *port,
1780 void *buf, size_t len, int flags);
1787 Reads a block of data in byte mode. The ``flags`` parameter is ignored.
1792 The number of bytes read.
1797 nibble_read_data, compat_write_data
1801 port->ops->compat_write_data - write a block of data in compatibility mode
1802 --------------------------------------------------------------------------
1809 #include <linux/parport.h>
1811 struct parport_operations {
1813 size_t (*compat_write_data) (struct parport *port,
1814 const void *buf, size_t len, int flags);
1821 Writes a block of data in compatibility mode. The ``flags`` parameter
1827 The number of bytes written.
1832 nibble_read_data, byte_read_data