old-www/LDP/nag2/x-087-2-hardware.drivers.pl...

578 lines
11 KiB
HTML

<HTML
><HEAD
><TITLE
>The PLIP Driver</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux Network Administrators Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Configuringthe NetworkingHardware"
HREF="x-087-2-hardware.html"><LINK
REL="PREVIOUS"
TITLE="Ethernet Installation"
HREF="x-087-2-hardware.drivers.ethernet.html"><LINK
REL="NEXT"
TITLE="The PPP and SLIP Drivers"
HREF="x-087-2-hardware.drivers.slip.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Network Administrators Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x-087-2-hardware.drivers.ethernet.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 3. Configuringthe NetworkingHardware</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x-087-2-hardware.drivers.slip.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="X-087-2-HARDWARE.DRIVERS.PLIP"
>3.4. The PLIP Driver</A
></H1
><P
><I
CLASS="EMPHASIS"
>Parallel Line IP</I
> (PLIP) is a cheap way to
network when you want to connect only two machines. It uses a parallel port
and a special cable, achieving speeds of 10 kilobytes per second to 20 kilobytes per second.</P
><P
>PLIP was originally developed by Crynwr, Inc. Its design at the time was
rather ingenious (or, if you prefer, a
hack), because the original parallel ports on
IBM PCs were designed to spend their time being unidirectional printer ports;
the eight data lines could be used only to send data from the PC to the
peripheral device, but not the other way around.<A
NAME="X-087-2-FNHW05"
HREF="#FTN.X-087-2-FNHW05"
>[1]</A
> The Cyrnwr
PLIP design worked around this limitation by using the port's five
status lines for input, which limited it to transferring all data as
nibbles (half bytes) only, but allowed for bidirectional
transfer. This mode of operation was called PLIP &#8220;mode 0.&#8221;
Today, the parallel ports supplied on PC hardware cater to full
bidirectional 8-bit data transfer, and PLIP has been extended to
accomodate this with the addition of PLIP &#8220;mode 1.&#8221;</P
><P
>
Linux kernels up to and including Version 2.0 support PLIP mode 0 only,
and an enhanced parallel port driver exists as a
patch against the 2.0 kernel and as a
standard part of the 2.2 kernel code to provide PLIP mode 1 operation, too.
<A
NAME="X-087-2-FNHW06"
HREF="#FTN.X-087-2-FNHW06"
>[2]</A
>
Unlike earlier versions of the PLIP code, the driver now attempts to be
compatible with the PLIP implementations from Crynwr, as well as the PLIP
driver in NCSA <B
CLASS="COMMAND"
>telnet</B
>.<A
NAME="X-087-2-FNHW07"
HREF="#FTN.X-087-2-FNHW07"
>[3]</A
>
To connect two machines using PLIP, you need a special cable sold at some
shops as a Null Printer or Turbo Laplink cable.
You can, however, make one yourself fairly easily;
<A
HREF="x-087-2-appendix.cables.html"
>Appendix B</A
> shows you how.</P
><P
>&#13;The PLIP driver for Linux is the work of almost countless persons. It is
currently maintained by Niibe Yutaka.<A
NAME="X-087-2-FNHW08"
HREF="#FTN.X-087-2-FNHW08"
>[4]</A
>
If compiled into the kernel, it sets up a network interface for each of the
possible printer ports, with <TT
CLASS="FILENAME"
>plip0</TT
> corresponding to
parallel port <TT
CLASS="FILENAME"
>lp0</TT
>, <TT
CLASS="FILENAME"
>plip1</TT
>
corresponding to <TT
CLASS="FILENAME"
>lp1</TT
>, etc. The mapping of interfaces to
ports differs in the 2.0 kernels and the 2.2
kernels. In the 2.0 kernels, the mapping was hardwired in the
<TT
CLASS="FILENAME"
>drivers/net/Spacd.c</TT
> file in the kernel
source. The default mappings in this file are:</P
><DIV
CLASS="INFORMALTABLE"
><A
NAME="AEN2637"
></A
><P
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Interface</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>I/O Port</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>IRQ</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>plip0</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0x3BC</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>7</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>plip1</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0x378</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>7</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="FILENAME"
>plip2</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><TT
CLASS="LITERAL"
>0x278</TT
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>5</TD
></TR
></TBODY
></TABLE
><P
></P
></DIV
><P
>&#13;If you configured your printer port in a different way, you
must change these values in <TT
CLASS="FILENAME"
>drivers/net/Space.c</TT
> in
the Linux kernel source and build a new kernel.</P
><P
>In the 2.2 kernels, the PLIP driver uses the &#8220;parport&#8221; parallel port
sharing driver developed by Philip Blundell.<A
NAME="X-087-2-FNHW09"
HREF="#FTN.X-087-2-FNHW09"
>[5]</A
> The new driver allocates the PLIP network device names serially,
just as for the Ethernet or PPP drivers, so the first PLIP device created is
<TT
CLASS="FILENAME"
>plip0</TT
>, the second is <TT
CLASS="FILENAME"
>plip1</TT
>, and so on.
The physical parallel port hardware is also allocated serially. By default, the
parallel port driver will attempt to detect your parallel port hardware with an
autoprobe routine, recording the physical device information in the order found. It is better practice to explicitly tell the kernel the physical I/O
parameters. You can do this by supplying arguments to the
<TT
CLASS="FILENAME"
>parport_pc.o</TT
> module as you load it, or if you have
compiled the driver into your kernel, using lilo to supply
arguments to the kernel at boot time. The IRQ setting of any device may be
changed later by writing the new IRQ value to the related
<TT
CLASS="FILENAME"
>/proc/parport/*/irq</TT
> file.</P
><P
>Configuring the physical I/O parameters in a 2.2 kernel when loading the
module is straightforward. For instance, to tell the driver that you have
two PC-style parallel ports at I/O addresses <TT
CLASS="LITERAL"
>0x278</TT
> and
<TT
CLASS="LITERAL"
>0c378</TT
> and IRQs 5 and 7, respectively, you would load the
module with the following arguments:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>modprobe parport_&#8201;pc io=0x278,0x378 irq=5,7</PRE
></TD
></TR
></TABLE
>
The corresponding arguments to pass to the kernel for a compiled-in driver are:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>parport=0x278,5 parport=0x378,7</PRE
></TD
></TR
></TABLE
>
You would use the lilo <SPAN
CLASS="SYSTEMITEM"
>append</SPAN
>
keyword to have these arguments
passed to the kernel automatically at boot time.</P
><P
>When the PLIP driver is initialized, either at boot time if it is
built-in, or when the <TT
CLASS="FILENAME"
>plip.o</TT
> module is loaded,
each of the parallel ports will have a <TT
CLASS="FILENAME"
>plip</TT
>
network device associated with it. <TT
CLASS="FILENAME"
>plip0</TT
> will be
assigned to the first parallel port device, <TT
CLASS="FILENAME"
>plip1</TT
>
the second, and so on. You can manually override this automatic
assignment using another set of kernel arguments. For instance, to
assign <TT
CLASS="LITERAL"
>parport0</TT
> to network device
<TT
CLASS="LITERAL"
>plip0</TT
>, and <TT
CLASS="LITERAL"
>parport1</TT
> to network
device <TT
CLASS="LITERAL"
>plip1</TT
>, you would use kernel arguments of:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>plip=parport1 plip=parport0</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>This mapping does not mean, however, that you cannot use these parallel ports
for printing or other purposes. The physical parallel port devices are used
by the PLIP driver only when the corresponding interface is configured
<SPAN
CLASS="SYSTEMITEM"
>up</SPAN
>.</P
></DIV
><H3
CLASS="FOOTNOTES"
>Notes</H3
><TABLE
BORDER="0"
CLASS="FOOTNOTES"
WIDTH="100%"
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNHW05"
HREF="x-087-2-hardware.drivers.plip.html#X-087-2-FNHW05"
>[1]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>Fight to clear the hacking name! Always use &#8220;cracker&#8221; when
you are referring to people who are consciously trying to defeat the
security of a system, and &#8220;hacker&#8221; when you are referring
to people who have found a clever way of solving a problem. Hackers
can be crackers, but the two should never be confused. Consult the New
Hackers Dictionary (popularly found as the Jargon file) for a more
complete understanding of the terms. </P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNHW06"
HREF="x-087-2-hardware.drivers.plip.html#X-087-2-FNHW06"
>[2]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>The enhanced parallel port adaptor patch for 2.0 kernel is available from
<SPAN
CLASS="SYSTEMITEM"
>http://www.cyberelk.demon.co.uk/parport.html</SPAN
>.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNHW07"
HREF="x-087-2-hardware.drivers.plip.html#X-087-2-FNHW07"
>[3]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>NCSA <B
CLASS="COMMAND"
>telnet</B
> is a popular program for DOS that runs TCP/IP
over Ethernet or PLIP, and supports <B
CLASS="COMMAND"
>telnet</B
> and FTP.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNHW08"
HREF="x-087-2-hardware.drivers.plip.html#X-087-2-FNHW08"
>[4]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>Niibe can be reached at
<SPAN
CLASS="SYSTEMITEM"
>gniibe@mri.co.jp</SPAN
>.</P
></TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="5%"
><A
NAME="FTN.X-087-2-FNHW09"
HREF="x-087-2-hardware.drivers.plip.html#X-087-2-FNHW09"
>[5]</A
></TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
WIDTH="95%"
><P
>You can reach Philip at <SPAN
CLASS="SYSTEMITEM"
><I
CLASS="EMPHASIS"
>Philip.Blundell@pobox.com</I
></SPAN
>.</P
></TD
></TR
></TABLE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x-087-2-hardware.drivers.ethernet.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x-087-2-hardware.drivers.slip.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Ethernet Installation</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x-087-2-hardware.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The PPP and SLIP Drivers</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>