Blob Blame History Raw
.\"     Title: ieee1284_open
.\"    Author: Tim Waugh <twaugh@redhat.com>
.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
.\"      Date: 09/18/2007
.\"    Manual: Functions
.\"    Source: 
.\"
.TH "IEEE1284_OPEN" "3" "09/18/2007" "" "Functions"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
ieee1284_open \- open a port
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <ieee1284.h>
.fi
.ft
.HP 18
.BI "int ieee1284_open(struct\ parport\ *" "port" ", int\ " "flags" ", int\ *" "capabilities" ");"
.SH "DESCRIPTION"
.PP
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
\fBieee1284_close\fR(3).
.PP
The possible
\fIflags\fR
are:
.PP
\fBF1284_EXCL\fR
.RS 4
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.
.sp
The iopl/dev\-port access methods don't support this yet, but the ppdev ones do.
.RE
.PP
If
\fIcapabilities\fR
is not
\fBNULL\fR
it must point to storage for an
\fBint\fR, 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:
.PP
\fBCAP1284_RAW\fR
.RS 4
Pin\-level access is available. If this capability is present then the following functions are effective:
\fBieee1284_write_data\fR,
\fBieee1284_read_status\fR,
\fBieee1284_wait_status\fR,
\fBieee1284_write_control\fR,
\fBieee1284_read_control\fR,
\fBieee1284_frob_control\fR.
.RE
.PP
\fBCAP1284_NIBBLE\fR
.RS 4
There is an implementation of nibble mode for this port.
.RE
.PP
\fBCAP1284_BYTE\fR
.RS 4
There is an implementation of byte mode for this port.
.RE
.PP
\fBCAP1284_COMPAT\fR
.RS 4
There is an implementation of compatibility mode for this port.
.RE
.PP
\fBCAP1284_ECP\fR
.RS 4
There is a hardware implementation of ECP mode for this port.
.RE
.PP
\fBCAP1284_ECPRLE\fR
.RS 4
There is an RLE\-aware implementation of ECP mode for this port (the
\fBF1284_RLE\fR
flag is recognised by the ECP transfer functions).
.RE
.PP
\fBCAP1284_ECPSWE\fR
.RS 4
There is a software implementation of ECP mode for this port.
.RE
.PP
\fBCAP1284_BECP\fR
.RS 4
There is an implementation of bounded ECP mode for this port.
.RE
.PP
\fBCAP1284_EPP\fR
.RS 4
There is a hardware implementation of EPP mode for this port.
.RE
.PP
\fBCAP1284_EPPSWE\fR
.RS 4
There is a software implementation of EPP mode for this port.
.RE
.PP
\fBCAP1284_IRQ\fR
.RS 4
An interrupt line is configured for this port and interrupt notifications can be received using
\fBieee1284_get_irq_fd\fR(3).
.RE
.PP
\fBCAP1284_DMA\fR
.RS 4
A DMA channel is configured for this port.
.RE
.SH "RETURN VALUE"
.PP
\fBE1284_OK\fR
.RS 4
The port is now opened.
.RE
.PP
\fBE1284_INIT\fR
.RS 4
There was a problem during port initialization. This could be because another driver has opened the port exclusively, or some other reason.
.RE
.PP
\fBE1284_NOMEM\fR
.RS 4
There is not enough memory.
.RE
.PP
\fBE1284_NOTAVAIL\fR
.RS 4
One or more of the supplied flags is not supported by this type of port.
.RE
.PP
\fBE1284_INVALIDPORT\fR
.RS 4
The
\fIport\fR
parameter is invalid (for instance, the
\fIport\fR
may already be open).
.RE
.PP
\fBE1284_SYS\fR
.RS 4
There was a problem at the operating system level. The global variable
\fIerrno\fR
has been set appropriately.
.RE
.SH "SEE ALSO"
.PP
\fBieee1284_close\fR(3)
.SH "AUTHOR"
.PP
\fBTim Waugh\fR <\&twaugh@redhat.com\&>
.sp -1n
.IP "" 4
Author.
.SH "COPYRIGHT"
Copyright \(co 2001\-2003 Tim Waugh
.br