1IEEE1284_NEGOTIATION(3) Functions IEEE1284_NEGOTIATION(3)
2
3
4
6 ieee1284_negotiate, ieee1284_terminate - IEEE 1284 negotiation
7
9 #include <ieee1284.h>
10
11 int ieee1284_negotiate(struct parport *port, int mode);
12
13 void ieee1284_terminate(struct parport *port);
14
16 These functions are for negotiating to and terminating from IEEE 1284
17 data transfer modes. The default mode is called compatibility mode, or
18 in other words normal printer protocol. It is a host-to-peripheral mode
19 only. There are special modes that allow peripheral-to-host transfer as
20 well, which may be negotiated to using ieee1284_negotiate. IEEE 1284
21 negotiation is a process by which the host requests a transfer mode and
22 the peripheral accepts or rejects it. An IEEE 1284-compliant device
23 will require a successful negotiation to a particular mode before it is
24 used for data transfer (but simpler devices may not if they only speak
25 one transfer mode).
26
27 To terminate the special mode and go back to compatilibity mode use
28 ieee1284_terminate.
29
30 These functions act on the parallel port associated with port, which
31 must be claimed.
32
33 With a device strictly complying to IEEE 1284 you will need to call
34 ieee1284_terminate in between any two calls to ieee1284_negotiate for
35 modes other than M1284_COMPAT.
36
38 Uni-directional modes
39 · M1284_COMPAT: Compatibility mode. Normal printer protocol. This is
40 not a negotiated mode, but is the default mode in absence of
41 negotiation. ieee1284_negotiate(port, M1284_COMPAT) is equivalent
42 to ieee1284_terminate(port). This host-to-peripheral mode is used
43 for sending data to printers, and is historically the mode that has
44 been used for that before IEEE 1284.
45
46 · M1284_NIBBLE: Nibble mode. This peripheral-to-host mode uses the
47 status lines to read data from the peripheral four bits at a time.
48
49 · M1284_BYTE: Byte mode. This peripheral-to-host mode uses the data
50 lines in reverse mode to read data from the peripheral a byte at a
51 time.
52
53 Bi-directional modes
54 · M1284_ECP: ECP mode. On entry to ECP mode it is a
55 host-to-peripheral (i.e. forward) mode, but it may be set to
56 reverse mode using ieee1284_ecp_fwd_to_rev(3). It is common for PC
57 hardware to provide assistance with this mode by the use of a FIFO
58 which the host (or, in reverse mode, the peripheral) may fill, so
59 that the hardware can do the handshaking itself.
60
61 · M1284_EPP: EPP mode. In this bi-directional mode the direction of
62 data transfer is signalled at each byte.
63
64 Mode variations
65 · M1284_FLAG_DEVICEID: Device ID retrieval. This flag may be combined
66 with a nibble, byte, or ECP mode to notify the device that it
67 should send its IEEE 1284 Device ID when asked for data.
68
69 · M1284_BECP: Bounded ECP is a modification to ECP that makes it more
70 robust at the point that the direction is changed. (Unfortunately
71 it is not yet implemented in the Linux kernel driver.)
72
73 · M1284_ECPRLE: ECP with run length encoding. In this mode,
74 consecutive data bytes of the same value may be transferred in only
75 a few cycles.
76
78 E1284_OK
79 The negotiation was successful.
80
81 E1284_NOTAVAIL
82 Negotiation is not available with this port type.
83
84 E1284_REJECTED
85 Negotiation was rejected by the peripheral.
86
87 E1284_NEGFAILED
88 Negotiation failed for some reason. Perhaps the device is not IEEE
89 1284 compliant.
90
91 E1284_SYS
92 A system error occured during negotiation.
93
94 E1284_INVALIDPORT
95 The port parameter is invalid (for instance, perhaps the port is
96 not claimed).
97
99 Tim Waugh <twaugh@redhat.com>
100 Author.
101
103 Copyright © 2001-2003 Tim Waugh
104
105
106
107[FIXME: source] 07/22/2010 IEEE1284_NEGOTIATION(3)