Back to home page

OSCL-LXR

 
 

    


0001 ===============================
0002 PARPORT interface documentation
0003 ===============================
0004 
0005 :Time-stamp: <2000-02-24 13:30:20 twaugh>
0006 
0007 Described here are the following functions:
0008 
0009 Global functions::
0010   parport_register_driver
0011   parport_unregister_driver
0012   parport_enumerate
0013   parport_register_device
0014   parport_unregister_device
0015   parport_claim
0016   parport_claim_or_block
0017   parport_release
0018   parport_yield
0019   parport_yield_blocking
0020   parport_wait_peripheral
0021   parport_poll_peripheral
0022   parport_wait_event
0023   parport_negotiate
0024   parport_read
0025   parport_write
0026   parport_open
0027   parport_close
0028   parport_device_id
0029   parport_device_coords
0030   parport_find_class
0031   parport_find_device
0032   parport_set_timeout
0033 
0034 Port functions (can be overridden by low-level drivers):
0035 
0036   SPP::
0037     port->ops->read_data
0038     port->ops->write_data
0039     port->ops->read_status
0040     port->ops->read_control
0041     port->ops->write_control
0042     port->ops->frob_control
0043     port->ops->enable_irq
0044     port->ops->disable_irq
0045     port->ops->data_forward
0046     port->ops->data_reverse
0047 
0048   EPP::
0049     port->ops->epp_write_data
0050     port->ops->epp_read_data
0051     port->ops->epp_write_addr
0052     port->ops->epp_read_addr
0053 
0054   ECP::
0055     port->ops->ecp_write_data
0056     port->ops->ecp_read_data
0057     port->ops->ecp_write_addr
0058 
0059   Other::
0060     port->ops->nibble_read_data
0061     port->ops->byte_read_data
0062     port->ops->compat_write_data
0063 
0064 The parport subsystem comprises ``parport`` (the core port-sharing
0065 code), and a variety of low-level drivers that actually do the port
0066 accesses.  Each low-level driver handles a particular style of port
0067 (PC, Amiga, and so on).
0068 
0069 The parport interface to the device driver author can be broken down
0070 into global functions and port functions.
0071 
0072 The global functions are mostly for communicating between the device
0073 driver and the parport subsystem: acquiring a list of available ports,
0074 claiming a port for exclusive use, and so on.  They also include
0075 ``generic`` functions for doing standard things that will work on any
0076 IEEE 1284-capable architecture.
0077 
0078 The port functions are provided by the low-level drivers, although the
0079 core parport module provides generic ``defaults`` for some routines.
0080 The port functions can be split into three groups: SPP, EPP, and ECP.
0081 
0082 SPP (Standard Parallel Port) functions modify so-called ``SPP``
0083 registers: data, status, and control.  The hardware may not actually
0084 have registers exactly like that, but the PC does and this interface is
0085 modelled after common PC implementations.  Other low-level drivers may
0086 be able to emulate most of the functionality.
0087 
0088 EPP (Enhanced Parallel Port) functions are provided for reading and
0089 writing in IEEE 1284 EPP mode, and ECP (Extended Capabilities Port)
0090 functions are used for IEEE 1284 ECP mode. (What about BECP? Does
0091 anyone care?)
0092 
0093 Hardware assistance for EPP and/or ECP transfers may or may not be
0094 available, and if it is available it may or may not be used.  If
0095 hardware is not used, the transfer will be software-driven.  In order
0096 to cope with peripherals that only tenuously support IEEE 1284, a
0097 low-level driver specific function is provided, for altering 'fudge
0098 factors'.
0099 
0100 Global functions
0101 ================
0102 
0103 parport_register_driver - register a device driver with parport
0104 ---------------------------------------------------------------
0105 
0106 SYNOPSIS
0107 ^^^^^^^^
0108 
0109 ::
0110 
0111         #include <linux/parport.h>
0112 
0113         struct parport_driver {
0114                 const char *name;
0115                 void (*attach) (struct parport *);
0116                 void (*detach) (struct parport *);
0117                 struct parport_driver *next;
0118         };
0119         int parport_register_driver (struct parport_driver *driver);
0120 
0121 DESCRIPTION
0122 ^^^^^^^^^^^
0123 
0124 In order to be notified about parallel ports when they are detected,
0125 parport_register_driver should be called.  Your driver will
0126 immediately be notified of all ports that have already been detected,
0127 and of each new port as low-level drivers are loaded.
0128 
0129 A ``struct parport_driver`` contains the textual name of your driver,
0130 a pointer to a function to handle new ports, and a pointer to a
0131 function to handle ports going away due to a low-level driver
0132 unloading.  Ports will only be detached if they are not being used
0133 (i.e. there are no devices registered on them).
0134 
0135 The visible parts of the ``struct parport *`` argument given to
0136 attach/detach are::
0137 
0138         struct parport
0139         {
0140                 struct parport *next; /* next parport in list */
0141                 const char *name;     /* port's name */
0142                 unsigned int modes;   /* bitfield of hardware modes */
0143                 struct parport_device_info probe_info;
0144                                 /* IEEE1284 info */
0145                 int number;           /* parport index */
0146                 struct parport_operations *ops;
0147                 ...
0148         };
0149 
0150 There are other members of the structure, but they should not be
0151 touched.
0152 
0153 The ``modes`` member summarises the capabilities of the underlying
0154 hardware.  It consists of flags which may be bitwise-ored together:
0155 
0156   ============================= ===============================================
0157   PARPORT_MODE_PCSPP            IBM PC registers are available,
0158                                 i.e. functions that act on data,
0159                                 control and status registers are
0160                                 probably writing directly to the
0161                                 hardware.
0162   PARPORT_MODE_TRISTATE         The data drivers may be turned off.
0163                                 This allows the data lines to be used
0164                                 for reverse (peripheral to host)
0165                                 transfers.
0166   PARPORT_MODE_COMPAT           The hardware can assist with
0167                                 compatibility-mode (printer)
0168                                 transfers, i.e. compat_write_block.
0169   PARPORT_MODE_EPP              The hardware can assist with EPP
0170                                 transfers.
0171   PARPORT_MODE_ECP              The hardware can assist with ECP
0172                                 transfers.
0173   PARPORT_MODE_DMA              The hardware can use DMA, so you might
0174                                 want to pass ISA DMA-able memory
0175                                 (i.e. memory allocated using the
0176                                 GFP_DMA flag with kmalloc) to the
0177                                 low-level driver in order to take
0178                                 advantage of it.
0179   ============================= ===============================================
0180 
0181 There may be other flags in ``modes`` as well.
0182 
0183 The contents of ``modes`` is advisory only.  For example, if the
0184 hardware is capable of DMA, and PARPORT_MODE_DMA is in ``modes``, it
0185 doesn't necessarily mean that DMA will always be used when possible.
0186 Similarly, hardware that is capable of assisting ECP transfers won't
0187 necessarily be used.
0188 
0189 RETURN VALUE
0190 ^^^^^^^^^^^^
0191 
0192 Zero on success, otherwise an error code.
0193 
0194 ERRORS
0195 ^^^^^^
0196 
0197 None. (Can it fail? Why return int?)
0198 
0199 EXAMPLE
0200 ^^^^^^^
0201 
0202 ::
0203 
0204         static void lp_attach (struct parport *port)
0205         {
0206                 ...
0207                 private = kmalloc (...);
0208                 dev[count++] = parport_register_device (...);
0209                 ...
0210         }
0211 
0212         static void lp_detach (struct parport *port)
0213         {
0214                 ...
0215         }
0216 
0217         static struct parport_driver lp_driver = {
0218                 "lp",
0219                 lp_attach,
0220                 lp_detach,
0221                 NULL /* always put NULL here */
0222         };
0223 
0224         int lp_init (void)
0225         {
0226                 ...
0227                 if (parport_register_driver (&lp_driver)) {
0228                         /* Failed; nothing we can do. */
0229                         return -EIO;
0230                 }
0231                 ...
0232         }
0233 
0234 
0235 SEE ALSO
0236 ^^^^^^^^
0237 
0238 parport_unregister_driver, parport_register_device, parport_enumerate
0239 
0240 
0241 
0242 parport_unregister_driver - tell parport to forget about this driver
0243 --------------------------------------------------------------------
0244 
0245 SYNOPSIS
0246 ^^^^^^^^
0247 
0248 ::
0249 
0250         #include <linux/parport.h>
0251 
0252         struct parport_driver {
0253                 const char *name;
0254                 void (*attach) (struct parport *);
0255                 void (*detach) (struct parport *);
0256                 struct parport_driver *next;
0257         };
0258         void parport_unregister_driver (struct parport_driver *driver);
0259 
0260 DESCRIPTION
0261 ^^^^^^^^^^^
0262 
0263 This tells parport not to notify the device driver of new ports or of
0264 ports going away.  Registered devices belonging to that driver are NOT
0265 unregistered: parport_unregister_device must be used for each one.
0266 
0267 EXAMPLE
0268 ^^^^^^^
0269 
0270 ::
0271 
0272         void cleanup_module (void)
0273         {
0274                 ...
0275                 /* Stop notifications. */
0276                 parport_unregister_driver (&lp_driver);
0277 
0278                 /* Unregister devices. */
0279                 for (i = 0; i < NUM_DEVS; i++)
0280                         parport_unregister_device (dev[i]);
0281                 ...
0282         }
0283 
0284 SEE ALSO
0285 ^^^^^^^^
0286 
0287 parport_register_driver, parport_enumerate
0288 
0289 
0290 
0291 parport_enumerate - retrieve a list of parallel ports (DEPRECATED)
0292 ------------------------------------------------------------------
0293 
0294 SYNOPSIS
0295 ^^^^^^^^
0296 
0297 ::
0298 
0299         #include <linux/parport.h>
0300 
0301         struct parport *parport_enumerate (void);
0302 
0303 DESCRIPTION
0304 ^^^^^^^^^^^
0305 
0306 Retrieve the first of a list of valid parallel ports for this machine.
0307 Successive parallel ports can be found using the ``struct parport
0308 *next`` element of the ``struct parport *`` that is returned.  If ``next``
0309 is NULL, there are no more parallel ports in the list.  The number of
0310 ports in the list will not exceed PARPORT_MAX.
0311 
0312 RETURN VALUE
0313 ^^^^^^^^^^^^
0314 
0315 A ``struct parport *`` describing a valid parallel port for the machine,
0316 or NULL if there are none.
0317 
0318 ERRORS
0319 ^^^^^^
0320 
0321 This function can return NULL to indicate that there are no parallel
0322 ports to use.
0323 
0324 EXAMPLE
0325 ^^^^^^^
0326 
0327 ::
0328 
0329         int detect_device (void)
0330         {
0331                 struct parport *port;
0332 
0333                 for (port = parport_enumerate ();
0334                 port != NULL;
0335                 port = port->next) {
0336                         /* Try to detect a device on the port... */
0337                         ...
0338                 }
0339                 }
0340 
0341                 ...
0342         }
0343 
0344 NOTES
0345 ^^^^^
0346 
0347 parport_enumerate is deprecated; parport_register_driver should be
0348 used instead.
0349 
0350 SEE ALSO
0351 ^^^^^^^^
0352 
0353 parport_register_driver, parport_unregister_driver
0354 
0355 
0356 
0357 parport_register_device - register to use a port
0358 ------------------------------------------------
0359 
0360 SYNOPSIS
0361 ^^^^^^^^
0362 
0363 ::
0364 
0365         #include <linux/parport.h>
0366 
0367         typedef int (*preempt_func) (void *handle);
0368         typedef void (*wakeup_func) (void *handle);
0369         typedef int (*irq_func) (int irq, void *handle, struct pt_regs *);
0370 
0371         struct pardevice *parport_register_device(struct parport *port,
0372                                                   const char *name,
0373                                                   preempt_func preempt,
0374                                                   wakeup_func wakeup,
0375                                                   irq_func irq,
0376                                                   int flags,
0377                                                   void *handle);
0378 
0379 DESCRIPTION
0380 ^^^^^^^^^^^
0381 
0382 Use this function to register your device driver on a parallel port
0383 (``port``).  Once you have done that, you will be able to use
0384 parport_claim and parport_release in order to use the port.
0385 
0386 The (``name``) argument is the name of the device that appears in /proc
0387 filesystem. The string must be valid for the whole lifetime of the
0388 device (until parport_unregister_device is called).
0389 
0390 This function will register three callbacks into your driver:
0391 ``preempt``, ``wakeup`` and ``irq``.  Each of these may be NULL in order to
0392 indicate that you do not want a callback.
0393 
0394 When the ``preempt`` function is called, it is because another driver
0395 wishes to use the parallel port.  The ``preempt`` function should return
0396 non-zero if the parallel port cannot be released yet -- if zero is
0397 returned, the port is lost to another driver and the port must be
0398 re-claimed before use.
0399 
0400 The ``wakeup`` function is called once another driver has released the
0401 port and no other driver has yet claimed it.  You can claim the
0402 parallel port from within the ``wakeup`` function (in which case the
0403 claim is guaranteed to succeed), or choose not to if you don't need it
0404 now.
0405 
0406 If an interrupt occurs on the parallel port your driver has claimed,
0407 the ``irq`` function will be called. (Write something about shared
0408 interrupts here.)
0409 
0410 The ``handle`` is a pointer to driver-specific data, and is passed to
0411 the callback functions.
0412 
0413 ``flags`` may be a bitwise combination of the following flags:
0414 
0415   ===================== =================================================
0416         Flag            Meaning
0417   ===================== =================================================
0418   PARPORT_DEV_EXCL      The device cannot share the parallel port at all.
0419                         Use this only when absolutely necessary.
0420   ===================== =================================================
0421 
0422 The typedefs are not actually defined -- they are only shown in order
0423 to make the function prototype more readable.
0424 
0425 The visible parts of the returned ``struct pardevice`` are::
0426 
0427         struct pardevice {
0428                 struct parport *port;   /* Associated port */
0429                 void *private;          /* Device driver's 'handle' */
0430                 ...
0431         };
0432 
0433 RETURN VALUE
0434 ^^^^^^^^^^^^
0435 
0436 A ``struct pardevice *``: a handle to the registered parallel port
0437 device that can be used for parport_claim, parport_release, etc.
0438 
0439 ERRORS
0440 ^^^^^^
0441 
0442 A return value of NULL indicates that there was a problem registering
0443 a device on that port.
0444 
0445 EXAMPLE
0446 ^^^^^^^
0447 
0448 ::
0449 
0450         static int preempt (void *handle)
0451         {
0452                 if (busy_right_now)
0453                         return 1;
0454 
0455                 must_reclaim_port = 1;
0456                 return 0;
0457         }
0458 
0459         static void wakeup (void *handle)
0460         {
0461                 struct toaster *private = handle;
0462                 struct pardevice *dev = private->dev;
0463                 if (!dev) return; /* avoid races */
0464 
0465                 if (want_port)
0466                         parport_claim (dev);
0467         }
0468 
0469         static int toaster_detect (struct toaster *private, struct parport *port)
0470         {
0471                 private->dev = parport_register_device (port, "toaster", preempt,
0472                                                         wakeup, NULL, 0,
0473                                                         private);
0474                 if (!private->dev)
0475                         /* Couldn't register with parport. */
0476                         return -EIO;
0477 
0478                 must_reclaim_port = 0;
0479                 busy_right_now = 1;
0480                 parport_claim_or_block (private->dev);
0481                 ...
0482                 /* Don't need the port while the toaster warms up. */
0483                 busy_right_now = 0;
0484                 ...
0485                 busy_right_now = 1;
0486                 if (must_reclaim_port) {
0487                         parport_claim_or_block (private->dev);
0488                         must_reclaim_port = 0;
0489                 }
0490                 ...
0491         }
0492 
0493 SEE ALSO
0494 ^^^^^^^^
0495 
0496 parport_unregister_device, parport_claim
0497 
0498 
0499 
0500 parport_unregister_device - finish using a port
0501 -----------------------------------------------
0502 
0503 SYNPOPSIS
0504 
0505 ::
0506 
0507         #include <linux/parport.h>
0508 
0509         void parport_unregister_device (struct pardevice *dev);
0510 
0511 DESCRIPTION
0512 ^^^^^^^^^^^
0513 
0514 This function is the opposite of parport_register_device.  After using
0515 parport_unregister_device, ``dev`` is no longer a valid device handle.
0516 
0517 You should not unregister a device that is currently claimed, although
0518 if you do it will be released automatically.
0519 
0520 EXAMPLE
0521 ^^^^^^^
0522 
0523 ::
0524 
0525         ...
0526         kfree (dev->private); /* before we lose the pointer */
0527         parport_unregister_device (dev);
0528         ...
0529 
0530 SEE ALSO
0531 ^^^^^^^^
0532 
0533 
0534 parport_unregister_driver
0535 
0536 parport_claim, parport_claim_or_block - claim the parallel port for a device
0537 ----------------------------------------------------------------------------
0538 
0539 SYNOPSIS
0540 ^^^^^^^^
0541 
0542 ::
0543 
0544         #include <linux/parport.h>
0545 
0546         int parport_claim (struct pardevice *dev);
0547         int parport_claim_or_block (struct pardevice *dev);
0548 
0549 DESCRIPTION
0550 ^^^^^^^^^^^
0551 
0552 These functions attempt to gain control of the parallel port on which
0553 ``dev`` is registered.  ``parport_claim`` does not block, but
0554 ``parport_claim_or_block`` may do. (Put something here about blocking
0555 interruptibly or non-interruptibly.)
0556 
0557 You should not try to claim a port that you have already claimed.
0558 
0559 RETURN VALUE
0560 ^^^^^^^^^^^^
0561 
0562 A return value of zero indicates that the port was successfully
0563 claimed, and the caller now has possession of the parallel port.
0564 
0565 If ``parport_claim_or_block`` blocks before returning successfully, the
0566 return value is positive.
0567 
0568 ERRORS
0569 ^^^^^^
0570 
0571 ========== ==========================================================
0572   -EAGAIN  The port is unavailable at the moment, but another attempt
0573            to claim it may succeed.
0574 ========== ==========================================================
0575 
0576 SEE ALSO
0577 ^^^^^^^^
0578 
0579 
0580 parport_release
0581 
0582 parport_release - release the parallel port
0583 -------------------------------------------
0584 
0585 SYNOPSIS
0586 ^^^^^^^^
0587 
0588 ::
0589 
0590         #include <linux/parport.h>
0591 
0592         void parport_release (struct pardevice *dev);
0593 
0594 DESCRIPTION
0595 ^^^^^^^^^^^
0596 
0597 Once a parallel port device has been claimed, it can be released using
0598 ``parport_release``.  It cannot fail, but you should not release a
0599 device that you do not have possession of.
0600 
0601 EXAMPLE
0602 ^^^^^^^
0603 
0604 ::
0605 
0606         static size_t write (struct pardevice *dev, const void *buf,
0607                         size_t len)
0608         {
0609                 ...
0610                 written = dev->port->ops->write_ecp_data (dev->port, buf,
0611                                                         len);
0612                 parport_release (dev);
0613                 ...
0614         }
0615 
0616 
0617 SEE ALSO
0618 ^^^^^^^^
0619 
0620 change_mode, parport_claim, parport_claim_or_block, parport_yield
0621 
0622 
0623 
0624 parport_yield, parport_yield_blocking - temporarily release a parallel port
0625 ---------------------------------------------------------------------------
0626 
0627 SYNOPSIS
0628 ^^^^^^^^
0629 
0630 ::
0631 
0632         #include <linux/parport.h>
0633 
0634         int parport_yield (struct pardevice *dev)
0635         int parport_yield_blocking (struct pardevice *dev);
0636 
0637 DESCRIPTION
0638 ^^^^^^^^^^^
0639 
0640 When a driver has control of a parallel port, it may allow another
0641 driver to temporarily ``borrow`` it.  ``parport_yield`` does not block;
0642 ``parport_yield_blocking`` may do.
0643 
0644 RETURN VALUE
0645 ^^^^^^^^^^^^
0646 
0647 A return value of zero indicates that the caller still owns the port
0648 and the call did not block.
0649 
0650 A positive return value from ``parport_yield_blocking`` indicates that
0651 the caller still owns the port and the call blocked.
0652 
0653 A return value of -EAGAIN indicates that the caller no longer owns the
0654 port, and it must be re-claimed before use.
0655 
0656 ERRORS
0657 ^^^^^^
0658 
0659 ========= ==========================================================
0660   -EAGAIN  Ownership of the parallel port was given away.
0661 ========= ==========================================================
0662 
0663 SEE ALSO
0664 ^^^^^^^^
0665 
0666 parport_release
0667 
0668 
0669 
0670 parport_wait_peripheral - wait for status lines, up to 35ms
0671 -----------------------------------------------------------
0672 
0673 SYNOPSIS
0674 ^^^^^^^^
0675 
0676 ::
0677 
0678         #include <linux/parport.h>
0679 
0680         int parport_wait_peripheral (struct parport *port,
0681                                      unsigned char mask,
0682                                      unsigned char val);
0683 
0684 DESCRIPTION
0685 ^^^^^^^^^^^
0686 
0687 Wait for the status lines in mask to match the values in val.
0688 
0689 RETURN VALUE
0690 ^^^^^^^^^^^^
0691 
0692 ======== ==========================================================
0693  -EINTR  a signal is pending
0694       0  the status lines in mask have values in val
0695       1  timed out while waiting (35ms elapsed)
0696 ======== ==========================================================
0697 
0698 SEE ALSO
0699 ^^^^^^^^
0700 
0701 parport_poll_peripheral
0702 
0703 
0704 
0705 parport_poll_peripheral - wait for status lines, in usec
0706 --------------------------------------------------------
0707 
0708 SYNOPSIS
0709 ^^^^^^^^
0710 
0711 ::
0712 
0713         #include <linux/parport.h>
0714 
0715         int parport_poll_peripheral (struct parport *port,
0716                                      unsigned char mask,
0717                                      unsigned char val,
0718                                      int usec);
0719 
0720 DESCRIPTION
0721 ^^^^^^^^^^^
0722 
0723 Wait for the status lines in mask to match the values in val.
0724 
0725 RETURN VALUE
0726 ^^^^^^^^^^^^
0727 
0728 ======== ==========================================================
0729  -EINTR  a signal is pending
0730       0  the status lines in mask have values in val
0731       1  timed out while waiting (usec microseconds have elapsed)
0732 ======== ==========================================================
0733 
0734 SEE ALSO
0735 ^^^^^^^^
0736 
0737 parport_wait_peripheral
0738 
0739 
0740 
0741 parport_wait_event - wait for an event on a port
0742 ------------------------------------------------
0743 
0744 SYNOPSIS
0745 ^^^^^^^^
0746 
0747 ::
0748 
0749         #include <linux/parport.h>
0750 
0751         int parport_wait_event (struct parport *port, signed long timeout)
0752 
0753 DESCRIPTION
0754 ^^^^^^^^^^^
0755 
0756 Wait for an event (e.g. interrupt) on a port.  The timeout is in
0757 jiffies.
0758 
0759 RETURN VALUE
0760 ^^^^^^^^^^^^
0761 
0762 ======= ==========================================================
0763       0  success
0764      <0  error (exit as soon as possible)
0765      >0  timed out
0766 ======= ==========================================================
0767 
0768 parport_negotiate - perform IEEE 1284 negotiation
0769 -------------------------------------------------
0770 
0771 SYNOPSIS
0772 ^^^^^^^^
0773 
0774 ::
0775 
0776         #include <linux/parport.h>
0777 
0778         int parport_negotiate (struct parport *, int mode);
0779 
0780 DESCRIPTION
0781 ^^^^^^^^^^^
0782 
0783 Perform IEEE 1284 negotiation.
0784 
0785 RETURN VALUE
0786 ^^^^^^^^^^^^
0787 
0788 ======= ==========================================================
0789      0  handshake OK; IEEE 1284 peripheral and mode available
0790     -1  handshake failed; peripheral not compliant (or none present)
0791      1  handshake OK; IEEE 1284 peripheral present but mode not
0792         available
0793 ======= ==========================================================
0794 
0795 SEE ALSO
0796 ^^^^^^^^
0797 
0798 parport_read, parport_write
0799 
0800 
0801 
0802 parport_read - read data from device
0803 ------------------------------------
0804 
0805 SYNOPSIS
0806 ^^^^^^^^
0807 
0808 ::
0809 
0810         #include <linux/parport.h>
0811 
0812         ssize_t parport_read (struct parport *, void *buf, size_t len);
0813 
0814 DESCRIPTION
0815 ^^^^^^^^^^^
0816 
0817 Read data from device in current IEEE 1284 transfer mode.  This only
0818 works for modes that support reverse data transfer.
0819 
0820 RETURN VALUE
0821 ^^^^^^^^^^^^
0822 
0823 If negative, an error code; otherwise the number of bytes transferred.
0824 
0825 SEE ALSO
0826 ^^^^^^^^
0827 
0828 parport_write, parport_negotiate
0829 
0830 
0831 
0832 parport_write - write data to device
0833 ------------------------------------
0834 
0835 SYNOPSIS
0836 ^^^^^^^^
0837 
0838 ::
0839 
0840         #include <linux/parport.h>
0841 
0842         ssize_t parport_write (struct parport *, const void *buf, size_t len);
0843 
0844 DESCRIPTION
0845 ^^^^^^^^^^^
0846 
0847 Write data to device in current IEEE 1284 transfer mode.  This only
0848 works for modes that support forward data transfer.
0849 
0850 RETURN VALUE
0851 ^^^^^^^^^^^^
0852 
0853 If negative, an error code; otherwise the number of bytes transferred.
0854 
0855 SEE ALSO
0856 ^^^^^^^^
0857 
0858 parport_read, parport_negotiate
0859 
0860 
0861 
0862 parport_open - register device for particular device number
0863 -----------------------------------------------------------
0864 
0865 SYNOPSIS
0866 ^^^^^^^^
0867 
0868 ::
0869 
0870         #include <linux/parport.h>
0871 
0872         struct pardevice *parport_open (int devnum, const char *name,
0873                                         int (*pf) (void *),
0874                                         void (*kf) (void *),
0875                                         void (*irqf) (int, void *,
0876                                                       struct pt_regs *),
0877                                         int flags, void *handle);
0878 
0879 DESCRIPTION
0880 ^^^^^^^^^^^
0881 
0882 This is like parport_register_device but takes a device number instead
0883 of a pointer to a struct parport.
0884 
0885 RETURN VALUE
0886 ^^^^^^^^^^^^
0887 
0888 See parport_register_device.  If no device is associated with devnum,
0889 NULL is returned.
0890 
0891 SEE ALSO
0892 ^^^^^^^^
0893 
0894 parport_register_device
0895 
0896 
0897 
0898 parport_close - unregister device for particular device number
0899 --------------------------------------------------------------
0900 
0901 SYNOPSIS
0902 ^^^^^^^^
0903 
0904 ::
0905 
0906         #include <linux/parport.h>
0907 
0908         void parport_close (struct pardevice *dev);
0909 
0910 DESCRIPTION
0911 ^^^^^^^^^^^
0912 
0913 This is the equivalent of parport_unregister_device for parport_open.
0914 
0915 SEE ALSO
0916 ^^^^^^^^
0917 
0918 parport_unregister_device, parport_open
0919 
0920 
0921 
0922 parport_device_id - obtain IEEE 1284 Device ID
0923 ----------------------------------------------
0924 
0925 SYNOPSIS
0926 ^^^^^^^^
0927 
0928 ::
0929 
0930         #include <linux/parport.h>
0931 
0932         ssize_t parport_device_id (int devnum, char *buffer, size_t len);
0933 
0934 DESCRIPTION
0935 ^^^^^^^^^^^
0936 
0937 Obtains the IEEE 1284 Device ID associated with a given device.
0938 
0939 RETURN VALUE
0940 ^^^^^^^^^^^^
0941 
0942 If negative, an error code; otherwise, the number of bytes of buffer
0943 that contain the device ID.  The format of the device ID is as
0944 follows::
0945 
0946         [length][ID]
0947 
0948 The first two bytes indicate the inclusive length of the entire Device
0949 ID, and are in big-endian order.  The ID is a sequence of pairs of the
0950 form::
0951 
0952         key:value;
0953 
0954 NOTES
0955 ^^^^^
0956 
0957 Many devices have ill-formed IEEE 1284 Device IDs.
0958 
0959 SEE ALSO
0960 ^^^^^^^^
0961 
0962 parport_find_class, parport_find_device
0963 
0964 
0965 
0966 parport_device_coords - convert device number to device coordinates
0967 -------------------------------------------------------------------
0968 
0969 SYNOPSIS
0970 ^^^^^^^^
0971 
0972 ::
0973 
0974         #include <linux/parport.h>
0975 
0976         int parport_device_coords (int devnum, int *parport, int *mux,
0977                                    int *daisy);
0978 
0979 DESCRIPTION
0980 ^^^^^^^^^^^
0981 
0982 Convert between device number (zero-based) and device coordinates
0983 (port, multiplexor, daisy chain address).
0984 
0985 RETURN VALUE
0986 ^^^^^^^^^^^^
0987 
0988 Zero on success, in which case the coordinates are (``*parport``, ``*mux``,
0989 ``*daisy``).
0990 
0991 SEE ALSO
0992 ^^^^^^^^
0993 
0994 parport_open, parport_device_id
0995 
0996 
0997 
0998 parport_find_class - find a device by its class
0999 -----------------------------------------------
1000 
1001 SYNOPSIS
1002 ^^^^^^^^
1003 
1004 ::
1005 
1006         #include <linux/parport.h>
1007 
1008         typedef enum {
1009                 PARPORT_CLASS_LEGACY = 0,       /* Non-IEEE1284 device */
1010                 PARPORT_CLASS_PRINTER,
1011                 PARPORT_CLASS_MODEM,
1012                 PARPORT_CLASS_NET,
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;
1024 
1025         int parport_find_class (parport_device_class cls, int from);
1026 
1027 DESCRIPTION
1028 ^^^^^^^^^^^
1029 
1030 Find a device by class.  The search starts from device number from+1.
1031 
1032 RETURN VALUE
1033 ^^^^^^^^^^^^
1034 
1035 The device number of the next device in that class, or -1 if no such
1036 device exists.
1037 
1038 NOTES
1039 ^^^^^
1040 
1041 Example usage::
1042 
1043         int devnum = -1;
1044         while ((devnum = parport_find_class (PARPORT_CLASS_DIGCAM, devnum)) != -1) {
1045                 struct pardevice *dev = parport_open (devnum, ...);
1046                 ...
1047         }
1048 
1049 SEE ALSO
1050 ^^^^^^^^
1051 
1052 parport_find_device, parport_open, parport_device_id
1053 
1054 
1055 
1056 parport_find_device - find a device by its class
1057 ------------------------------------------------
1058 
1059 SYNOPSIS
1060 ^^^^^^^^
1061 
1062 ::
1063 
1064         #include <linux/parport.h>
1065 
1066         int parport_find_device (const char *mfg, const char *mdl, int from);
1067 
1068 DESCRIPTION
1069 ^^^^^^^^^^^
1070 
1071 Find a device by vendor and model.  The search starts from device
1072 number from+1.
1073 
1074 RETURN VALUE
1075 ^^^^^^^^^^^^
1076 
1077 The device number of the next device matching the specifications, or
1078 -1 if no such device exists.
1079 
1080 NOTES
1081 ^^^^^
1082 
1083 Example usage::
1084 
1085         int devnum = -1;
1086         while ((devnum = parport_find_device ("IOMEGA", "ZIP+", devnum)) != -1) {
1087                 struct pardevice *dev = parport_open (devnum, ...);
1088                 ...
1089         }
1090 
1091 SEE ALSO
1092 ^^^^^^^^
1093 
1094 parport_find_class, parport_open, parport_device_id
1095 
1096 
1097 
1098 parport_set_timeout - set the inactivity timeout
1099 ------------------------------------------------
1100 
1101 SYNOPSIS
1102 ^^^^^^^^
1103 
1104 ::
1105 
1106         #include <linux/parport.h>
1107 
1108         long parport_set_timeout (struct pardevice *dev, long inactivity);
1109 
1110 DESCRIPTION
1111 ^^^^^^^^^^^
1112 
1113 Set the inactivity timeout, in jiffies, for a registered device.  The
1114 previous timeout is returned.
1115 
1116 RETURN VALUE
1117 ^^^^^^^^^^^^
1118 
1119 The previous timeout, in jiffies.
1120 
1121 NOTES
1122 ^^^^^
1123 
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
1127 will return.
1128 
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.
1133 
1134 Once set for a registered device, the timeout will remain at the set
1135 value until set again.
1136 
1137 SEE ALSO
1138 ^^^^^^^^
1139 
1140 port->ops->xxx_read/write_yyy
1141 
1142 
1143 
1144 
1145 PORT FUNCTIONS
1146 ==============
1147 
1148 The functions in the port->ops structure (struct parport_operations)
1149 are provided by the low-level driver responsible for that port.
1150 
1151 port->ops->read_data - read the data register
1152 ---------------------------------------------
1153 
1154 SYNOPSIS
1155 ^^^^^^^^
1156 
1157 ::
1158 
1159         #include <linux/parport.h>
1160 
1161         struct parport_operations {
1162                 ...
1163                 unsigned char (*read_data) (struct parport *port);
1164                 ...
1165         };
1166 
1167 DESCRIPTION
1168 ^^^^^^^^^^^
1169 
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.
1176 
1177 SEE ALSO
1178 ^^^^^^^^
1179 
1180 write_data, read_status, write_control
1181 
1182 
1183 
1184 port->ops->write_data - write the data register
1185 -----------------------------------------------
1186 
1187 SYNOPSIS
1188 ^^^^^^^^
1189 
1190 ::
1191 
1192         #include <linux/parport.h>
1193 
1194         struct parport_operations {
1195                 ...
1196                 void (*write_data) (struct parport *port, unsigned char d);
1197                 ...
1198         };
1199 
1200 DESCRIPTION
1201 ^^^^^^^^^^^
1202 
1203 Writes to the data register.  May have side-effects (a STROBE pulse,
1204 for instance).
1205 
1206 SEE ALSO
1207 ^^^^^^^^
1208 
1209 read_data, read_status, write_control
1210 
1211 
1212 
1213 port->ops->read_status - read the status register
1214 -------------------------------------------------
1215 
1216 SYNOPSIS
1217 ^^^^^^^^
1218 
1219 ::
1220 
1221         #include <linux/parport.h>
1222 
1223         struct parport_operations {
1224                 ...
1225                 unsigned char (*read_status) (struct parport *port);
1226                 ...
1227         };
1228 
1229 DESCRIPTION
1230 ^^^^^^^^^^^
1231 
1232 Reads from the status register.  This is a bitmask:
1233 
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")
1239 
1240 There may be other bits set.
1241 
1242 SEE ALSO
1243 ^^^^^^^^
1244 
1245 read_data, write_data, write_control
1246 
1247 
1248 
1249 port->ops->read_control - read the control register
1250 ---------------------------------------------------
1251 
1252 SYNOPSIS
1253 ^^^^^^^^
1254 
1255 ::
1256 
1257         #include <linux/parport.h>
1258 
1259         struct parport_operations {
1260                 ...
1261                 unsigned char (*read_control) (struct parport *port);
1262                 ...
1263         };
1264 
1265 DESCRIPTION
1266 ^^^^^^^^^^^
1267 
1268 Returns the last value written to the control register (either from
1269 write_control or frob_control).  No port access is performed.
1270 
1271 SEE ALSO
1272 ^^^^^^^^
1273 
1274 read_data, write_data, read_status, write_control
1275 
1276 
1277 
1278 port->ops->write_control - write the control register
1279 -----------------------------------------------------
1280 
1281 SYNOPSIS
1282 ^^^^^^^^
1283 
1284 ::
1285 
1286         #include <linux/parport.h>
1287 
1288         struct parport_operations {
1289                 ...
1290                 void (*write_control) (struct parport *port, unsigned char s);
1291                 ...
1292         };
1293 
1294 DESCRIPTION
1295 ^^^^^^^^^^^
1296 
1297 Writes to the control register. This is a bitmask::
1298 
1299                                   _______
1300         - PARPORT_CONTROL_STROBE (nStrobe)
1301                                   _______
1302         - PARPORT_CONTROL_AUTOFD (nAutoFd)
1303                                 _____
1304         - PARPORT_CONTROL_INIT (nInit)
1305                                   _________
1306         - PARPORT_CONTROL_SELECT (nSelectIn)
1307 
1308 SEE ALSO
1309 ^^^^^^^^
1310 
1311 read_data, write_data, read_status, frob_control
1312 
1313 
1314 
1315 port->ops->frob_control - write control register bits
1316 -----------------------------------------------------
1317 
1318 SYNOPSIS
1319 ^^^^^^^^
1320 
1321 ::
1322 
1323         #include <linux/parport.h>
1324 
1325         struct parport_operations {
1326                 ...
1327                 unsigned char (*frob_control) (struct parport *port,
1328                                         unsigned char mask,
1329                                         unsigned char val);
1330                 ...
1331         };
1332 
1333 DESCRIPTION
1334 ^^^^^^^^^^^
1335 
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.
1339 
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
1342 port access.
1343 
1344 SEE ALSO
1345 ^^^^^^^^
1346 
1347 read_data, write_data, read_status, write_control
1348 
1349 
1350 
1351 port->ops->enable_irq - enable interrupt generation
1352 ---------------------------------------------------
1353 
1354 SYNOPSIS
1355 ^^^^^^^^
1356 
1357 ::
1358 
1359         #include <linux/parport.h>
1360 
1361         struct parport_operations {
1362                 ...
1363                 void (*enable_irq) (struct parport *port);
1364                 ...
1365         };
1366 
1367 DESCRIPTION
1368 ^^^^^^^^^^^
1369 
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.
1374 
1375 SEE ALSO
1376 ^^^^^^^^
1377 
1378 disable_irq
1379 
1380 
1381 
1382 port->ops->disable_irq - disable interrupt generation
1383 -----------------------------------------------------
1384 
1385 SYNOPSIS
1386 ^^^^^^^^
1387 
1388 ::
1389 
1390         #include <linux/parport.h>
1391 
1392         struct parport_operations {
1393                 ...
1394                 void (*disable_irq) (struct parport *port);
1395                 ...
1396         };
1397 
1398 DESCRIPTION
1399 ^^^^^^^^^^^
1400 
1401 The parallel port hardware is instructed not to generate interrupts.
1402 The interrupt itself is not masked.
1403 
1404 SEE ALSO
1405 ^^^^^^^^
1406 
1407 enable_irq
1408 
1409 
1410 
1411 port->ops->data_forward - enable data drivers
1412 ---------------------------------------------
1413 
1414 SYNOPSIS
1415 ^^^^^^^^
1416 
1417 ::
1418 
1419         #include <linux/parport.h>
1420 
1421         struct parport_operations {
1422                 ...
1423                 void (*data_forward) (struct parport *port);
1424                 ...
1425         };
1426 
1427 DESCRIPTION
1428 ^^^^^^^^^^^
1429 
1430 Enables the data line drivers, for 8-bit host-to-peripheral
1431 communications.
1432 
1433 SEE ALSO
1434 ^^^^^^^^
1435 
1436 data_reverse
1437 
1438 
1439 
1440 port->ops->data_reverse - tristate the buffer
1441 ---------------------------------------------
1442 
1443 SYNOPSIS
1444 ^^^^^^^^
1445 
1446 ::
1447 
1448         #include <linux/parport.h>
1449 
1450         struct parport_operations {
1451                 ...
1452                 void (*data_reverse) (struct parport *port);
1453                 ...
1454         };
1455 
1456 DESCRIPTION
1457 ^^^^^^^^^^^
1458 
1459 Places the data bus in a high impedance state, if port->modes has the
1460 PARPORT_MODE_TRISTATE bit set.
1461 
1462 SEE ALSO
1463 ^^^^^^^^
1464 
1465 data_forward
1466 
1467 
1468 
1469 port->ops->epp_write_data - write EPP data
1470 ------------------------------------------
1471 
1472 SYNOPSIS
1473 ^^^^^^^^
1474 
1475 ::
1476 
1477         #include <linux/parport.h>
1478 
1479         struct parport_operations {
1480                 ...
1481                 size_t (*epp_write_data) (struct parport *port, const void *buf,
1482                                         size_t len, int flags);
1483                 ...
1484         };
1485 
1486 DESCRIPTION
1487 ^^^^^^^^^^^
1488 
1489 Writes data in EPP mode, and returns the number of bytes written.
1490 
1491 The ``flags`` parameter may be one or more of the following,
1492 bitwise-or'ed together:
1493 
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 ======================= =================================================
1499 
1500 SEE ALSO
1501 ^^^^^^^^
1502 
1503 epp_read_data, epp_write_addr, epp_read_addr
1504 
1505 
1506 
1507 port->ops->epp_read_data - read EPP data
1508 ----------------------------------------
1509 
1510 SYNOPSIS
1511 ^^^^^^^^
1512 
1513 ::
1514 
1515         #include <linux/parport.h>
1516 
1517         struct parport_operations {
1518                 ...
1519                 size_t (*epp_read_data) (struct parport *port, void *buf,
1520                                         size_t len, int flags);
1521                 ...
1522         };
1523 
1524 DESCRIPTION
1525 ^^^^^^^^^^^
1526 
1527 Reads data in EPP mode, and returns the number of bytes read.
1528 
1529 The ``flags`` parameter may be one or more of the following,
1530 bitwise-or'ed together:
1531 
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 ======================= =================================================
1537 
1538 SEE ALSO
1539 ^^^^^^^^
1540 
1541 epp_write_data, epp_write_addr, epp_read_addr
1542 
1543 
1544 
1545 port->ops->epp_write_addr - write EPP address
1546 ---------------------------------------------
1547 
1548 SYNOPSIS
1549 ^^^^^^^^
1550 
1551 ::
1552 
1553         #include <linux/parport.h>
1554 
1555         struct parport_operations {
1556                 ...
1557                 size_t (*epp_write_addr) (struct parport *port,
1558                                         const void *buf, size_t len, int flags);
1559                 ...
1560         };
1561 
1562 DESCRIPTION
1563 ^^^^^^^^^^^
1564 
1565 Writes EPP addresses (8 bits each), and returns the number written.
1566 
1567 The ``flags`` parameter may be one or more of the following,
1568 bitwise-or'ed together:
1569 
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 ======================= =================================================
1575 
1576 (Does PARPORT_EPP_FAST make sense for this function?)
1577 
1578 SEE ALSO
1579 ^^^^^^^^
1580 
1581 epp_write_data, epp_read_data, epp_read_addr
1582 
1583 
1584 
1585 port->ops->epp_read_addr - read EPP address
1586 -------------------------------------------
1587 
1588 SYNOPSIS
1589 ^^^^^^^^
1590 
1591 ::
1592 
1593         #include <linux/parport.h>
1594 
1595         struct parport_operations {
1596                 ...
1597                 size_t (*epp_read_addr) (struct parport *port, void *buf,
1598                                         size_t len, int flags);
1599                 ...
1600         };
1601 
1602 DESCRIPTION
1603 ^^^^^^^^^^^
1604 
1605 Reads EPP addresses (8 bits each), and returns the number read.
1606 
1607 The ``flags`` parameter may be one or more of the following,
1608 bitwise-or'ed together:
1609 
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 ======================= =================================================
1615 
1616 (Does PARPORT_EPP_FAST make sense for this function?)
1617 
1618 SEE ALSO
1619 ^^^^^^^^
1620 
1621 epp_write_data, epp_read_data, epp_write_addr
1622 
1623 
1624 
1625 port->ops->ecp_write_data - write a block of ECP data
1626 -----------------------------------------------------
1627 
1628 SYNOPSIS
1629 ^^^^^^^^
1630 
1631 ::
1632 
1633         #include <linux/parport.h>
1634 
1635         struct parport_operations {
1636                 ...
1637                 size_t (*ecp_write_data) (struct parport *port,
1638                                         const void *buf, size_t len, int flags);
1639                 ...
1640         };
1641 
1642 DESCRIPTION
1643 ^^^^^^^^^^^
1644 
1645 Writes a block of ECP data.  The ``flags`` parameter is ignored.
1646 
1647 RETURN VALUE
1648 ^^^^^^^^^^^^
1649 
1650 The number of bytes written.
1651 
1652 SEE ALSO
1653 ^^^^^^^^
1654 
1655 ecp_read_data, ecp_write_addr
1656 
1657 
1658 
1659 port->ops->ecp_read_data - read a block of ECP data
1660 ---------------------------------------------------
1661 
1662 SYNOPSIS
1663 ^^^^^^^^
1664 
1665 ::
1666 
1667         #include <linux/parport.h>
1668 
1669         struct parport_operations {
1670                 ...
1671                 size_t (*ecp_read_data) (struct parport *port,
1672                                         void *buf, size_t len, int flags);
1673                 ...
1674         };
1675 
1676 DESCRIPTION
1677 ^^^^^^^^^^^
1678 
1679 Reads a block of ECP data.  The ``flags`` parameter is ignored.
1680 
1681 RETURN VALUE
1682 ^^^^^^^^^^^^
1683 
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?
1686 
1687 SEE ALSO
1688 ^^^^^^^^
1689 
1690 ecp_write_block, ecp_write_addr
1691 
1692 
1693 
1694 port->ops->ecp_write_addr - write a block of ECP addresses
1695 ----------------------------------------------------------
1696 
1697 SYNOPSIS
1698 ^^^^^^^^
1699 
1700 ::
1701 
1702         #include <linux/parport.h>
1703 
1704         struct parport_operations {
1705                 ...
1706                 size_t (*ecp_write_addr) (struct parport *port,
1707                                         const void *buf, size_t len, int flags);
1708                 ...
1709         };
1710 
1711 DESCRIPTION
1712 ^^^^^^^^^^^
1713 
1714 Writes a block of ECP addresses.  The ``flags`` parameter is ignored.
1715 
1716 RETURN VALUE
1717 ^^^^^^^^^^^^
1718 
1719 The number of bytes written.
1720 
1721 NOTES
1722 ^^^^^
1723 
1724 This may use a FIFO, and if so shall not return until the FIFO is empty.
1725 
1726 SEE ALSO
1727 ^^^^^^^^
1728 
1729 ecp_read_data, ecp_write_data
1730 
1731 
1732 
1733 port->ops->nibble_read_data - read a block of data in nibble mode
1734 -----------------------------------------------------------------
1735 
1736 SYNOPSIS
1737 ^^^^^^^^
1738 
1739 ::
1740 
1741         #include <linux/parport.h>
1742 
1743         struct parport_operations {
1744                 ...
1745                 size_t (*nibble_read_data) (struct parport *port,
1746                                         void *buf, size_t len, int flags);
1747                 ...
1748         };
1749 
1750 DESCRIPTION
1751 ^^^^^^^^^^^
1752 
1753 Reads a block of data in nibble mode.  The ``flags`` parameter is ignored.
1754 
1755 RETURN VALUE
1756 ^^^^^^^^^^^^
1757 
1758 The number of whole bytes read.
1759 
1760 SEE ALSO
1761 ^^^^^^^^
1762 
1763 byte_read_data, compat_write_data
1764 
1765 
1766 
1767 port->ops->byte_read_data - read a block of data in byte mode
1768 -------------------------------------------------------------
1769 
1770 SYNOPSIS
1771 ^^^^^^^^
1772 
1773 ::
1774 
1775         #include <linux/parport.h>
1776 
1777         struct parport_operations {
1778                 ...
1779                 size_t (*byte_read_data) (struct parport *port,
1780                                         void *buf, size_t len, int flags);
1781                 ...
1782         };
1783 
1784 DESCRIPTION
1785 ^^^^^^^^^^^
1786 
1787 Reads a block of data in byte mode.  The ``flags`` parameter is ignored.
1788 
1789 RETURN VALUE
1790 ^^^^^^^^^^^^
1791 
1792 The number of bytes read.
1793 
1794 SEE ALSO
1795 ^^^^^^^^
1796 
1797 nibble_read_data, compat_write_data
1798 
1799 
1800 
1801 port->ops->compat_write_data - write a block of data in compatibility mode
1802 --------------------------------------------------------------------------
1803 
1804 SYNOPSIS
1805 ^^^^^^^^
1806 
1807 ::
1808 
1809         #include <linux/parport.h>
1810 
1811         struct parport_operations {
1812                 ...
1813                 size_t (*compat_write_data) (struct parport *port,
1814                                         const void *buf, size_t len, int flags);
1815                 ...
1816         };
1817 
1818 DESCRIPTION
1819 ^^^^^^^^^^^
1820 
1821 Writes a block of data in compatibility mode.  The ``flags`` parameter
1822 is ignored.
1823 
1824 RETURN VALUE
1825 ^^^^^^^^^^^^
1826 
1827 The number of bytes written.
1828 
1829 SEE ALSO
1830 ^^^^^^^^
1831 
1832 nibble_read_data, byte_read_data