Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ieee1284_open(3) [centos man page]

IEEE1284_OPEN(3)						     Functions							  IEEE1284_OPEN(3)

NAME
ieee1284_open - open a port SYNOPSIS
#include <ieee1284.h> int ieee1284_open(struct parport *port, int flags, int *capabilities); DESCRIPTION
In order to begin using a port it must be opened. Any initial set-up of the port is done at this stage. When an open port is no longer needed it should be closed with ieee1284_close(3). The possible flags are: F1284_EXCL This device cannot share the port with any other device. If this is the case it must be declared at this stage, so that other drivers trying to access the port know not to bother; otherwise they will wait until this driver releases the port, i.e. never. The iopl/dev-port access methods don't support this yet, but the ppdev ones do. If capabilities is not NULL it must point to storage for an int, which will be treated as a set of flags, one per bit, which the library sets or clears as appropriate. If a capability is present it will be used when asked for. They are: CAP1284_RAW Pin-level access is available. If this capability is present then the following functions are effective: ieee1284_write_data, ieee1284_read_status, ieee1284_wait_status, ieee1284_write_control, ieee1284_read_control, ieee1284_frob_control. CAP1284_NIBBLE There is an implementation of nibble mode for this port. CAP1284_BYTE There is an implementation of byte mode for this port. CAP1284_COMPAT There is an implementation of compatibility mode for this port. CAP1284_ECP There is a hardware implementation of ECP mode for this port. CAP1284_ECPRLE There is an RLE-aware implementation of ECP mode for this port (the F1284_RLE flag is recognised by the ECP transfer functions). CAP1284_ECPSWE There is a software implementation of ECP mode for this port. CAP1284_BECP There is an implementation of bounded ECP mode for this port. CAP1284_EPP There is a hardware implementation of EPP mode for this port. CAP1284_EPPSWE There is a software implementation of EPP mode for this port. CAP1284_IRQ An interrupt line is configured for this port and interrupt notifications can be received using ieee1284_get_irq_fd(3). CAP1284_DMA A DMA channel is configured for this port. RETURN VALUE
E1284_OK The port is now opened. E1284_INIT There was a problem during port initialization. This could be because another driver has opened the port exclusively, or some other reason. E1284_NOMEM There is not enough memory. E1284_NOTAVAIL One or more of the supplied flags is not supported by this type of port. E1284_INVALIDPORT The port parameter is invalid (for instance, the port may already be open). E1284_SYS There was a problem at the operating system level. The global variable errno has been set appropriately. SEE ALSO
ieee1284_close(3) AUTHOR
Tim Waugh <twaugh@redhat.com> Author. COPYRIGHT
Copyright (C) 2001-2003 Tim Waugh [FIXME: source] 06/17/2014 IEEE1284_OPEN(3)

Check Out this Related Man Page

IEEE1284_TRANSFER(3)						     Functions						      IEEE1284_TRANSFER(3)

NAME
ieee1284_nibble_read, ieee1284_compat_write, ieee1284_byte_read, ieee1284_epp_read_data, ieee1284_epp_write_data, ieee1284_epp_read_addr, ieee1284_epp_write_addr, ieee1284_ecp_read_data, ieee1284_ecp_write_data, ieee1284_ecp_read_addr, ieee1284_ecp_write_addr - data transfer functions SYNOPSIS
#include <ieee1284.h> ssize_t ieee1284_nibble_read(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_compat_write(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_byte_read(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_read_data(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_write_data(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_epp_read_addr(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_write_addr(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_ecp_read_data(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_ecp_write_data(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_ecp_read_addr(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_ecp_write_addr(struct parport *port, int flags, const char *buffer, size_t len); DESCRIPTION
This set of functions is for tranferring bytes in the relevant transfer mode. For ECP and EPP modes two types of transfer are possible: data and address (usually referred to as channel in ECP). The supplied port must be a claimed port. The supplied buffer must be at least len bytes long. When reading, the transferred data is stored in the buffer; when writing the data to be transferred is taken from the buffer. For reads (peripheral to host): if no data is available and F1284_NONBLOCK is not in effect, the inactivity timer is started. If data becomes available before the inactivity time-out elapses it is read; otherwise the return value will be E1284_TIMEDOUT. For writes (host to peripheral): if the peripheral is not willing to accept data and F1284_NONBLOCK is not in effect, the inactivity timer is started. If the peripheral indicates that it is willing to accept data before the inactivity time-out elapses it is sent; otherwise the return value will be E1284_TIMEDOUT The flags may alter the behaviour slightly: F1284_NONBLOCK For reads (peripheral to host): if no data is available, return immediately (with E1284_TIMEDOUT). For writes (host to peripheral): if the peripheral is not willing to accept data, return immediately (with E1284_TIMEDOUT). F1284_SWE Don't use hardware assistance for the transfer, but instead set the parallel port pins according to the wire protocol. F1284_RLE (for ECP only) Use run length encoding. If the peripheral is in ECP mode with RLE, calls to ieee1284_ecp_read_datamust set this flag in order for the RLE from the peripheral to be interpreted correctly, and calls to ieee1284_ecp_write_datamay set this flag in order to take advantage of RLE. F1284_FASTEPP (for EPP only) Use multi-byte transfers. Several bytes at a time are transferred using hardware assistance, if supporting hardware is present. The price of this increased speed is that the return value will be less reliable when this flag is used. For ECP mode, a given direction is in force at any particular time, and it is up to the application to ensure that it is only writing when in forward mode, and reading when in reverse mode. RETURN VALUE
The return value is the number of bytes successfully transferred or, if negative, one of: E1284_NOTIMPL This transfer mode and flags combination is not yet implemented in libieee1284. E1284_TIMEDOUT Timed out waiting for peripheral to handshake. E1284_NOMEM Not enough memory is available. E1284_SYS There was a problem at the operating system level. The global variable errno has been set appropriately. E1284_INVALIDPORT The port parameter is invalid (for instance, perhaps the port is not claimed). If any bytes are successfully transferred, that number is returned. An error is returned only if no bytes are transferred. For host-to-peripheral transfers, all data is at the peripheral by the time the call returns. SEE ALSO
ieee1284_ecp_fwd_to_rev(3) AUTHOR
Tim Waugh <twaugh@redhat.com> Author. COPYRIGHT
Copyright (C) 2001-2003 Tim Waugh [FIXME: source] 06/17/2014 IEEE1284_TRANSFER(3)
Man Page