90 lines
4.5 KiB
HTML
90 lines
4.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
|
|
<TITLE> Plug-and-Play-HOWTO: PnP for External and Plug-in Devices</TITLE>
|
|
<LINK HREF="Plug-and-Play-HOWTO-9.html" REL=next>
|
|
<LINK HREF="Plug-and-Play-HOWTO-7.html" REL=previous>
|
|
<LINK HREF="Plug-and-Play-HOWTO.html#toc8" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="Plug-and-Play-HOWTO-9.html">Next</A>
|
|
<A HREF="Plug-and-Play-HOWTO-7.html">Previous</A>
|
|
<A HREF="Plug-and-Play-HOWTO.html#toc8">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s8">8.</A> <A HREF="Plug-and-Play-HOWTO.html#toc8">PnP for External and Plug-in Devices</A></H2>
|
|
|
|
<H2><A NAME="ss8.1">8.1</A> <A HREF="Plug-and-Play-HOWTO.html#toc8.1">USB Bus</A>
|
|
</H2>
|
|
|
|
<P>The USB (Universal Serial Bus) is a high speed bus on an external
|
|
cable that plugs into a PC. The external bus cable has its own
|
|
communication protocols and doesn't use any IRQs, I/0 addresses (or
|
|
other bus-resources). Communication is by packets, something like the
|
|
Internet, only there are time-slice allocations which prevent any one
|
|
device from hogging the bus if other devices need it. There are free
|
|
time slots which allow every device to send a short message to the bus
|
|
controller without any need for IRQs on the bus.</P>
|
|
<P>However, the USB bus controller inside the PC does have an IRQ and an
|
|
address on the PCI bus (or ISA) which are used for communication
|
|
between the CPU and all devices on the USB. Thus there's no resource
|
|
allocations needed for the individual devices on the USB. One could
|
|
also think of this as all devices on the USB sharing the one interrupt
|
|
and address. If a device is on the USB it needs a driver that
|
|
understands the USB.</P>
|
|
<P>But each device on the USB does have an IDs, just like cards do on the PCI
|
|
bus. So Linux likely maintains a table of these IDs so that device
|
|
drivers can check them to find their device. The USB also support
|
|
"hot plug". To find out what is on the USB bus, you could use a
|
|
general hardware detection tool like "discover" or "hwinfo".</P>
|
|
|
|
<H2><A NAME="ss8.2">8.2</A> <A HREF="Plug-and-Play-HOWTO.html#toc8.2">Hot Plug</A>
|
|
</H2>
|
|
|
|
<P>"Hot plug" is where you plug something into a PC (usually via a
|
|
cable connection) and it is instantly detected. If required, it is
|
|
configured with bus-resources. The driver for it is also started,
|
|
perhaps by loading a module for it. For this to work the hardware
|
|
used must be designed for hot plugging. One can hot plug certain PCI
|
|
cards (Cardbus), USB devices, and IEEE 1394 devices (Firewire).</P>
|
|
<P>When a new device is detected, it's registers are read so as to get
|
|
the ID number of the device. Then to find a driver, Linux must
|
|
maintain a table mapping ID numbers to drivers. It wasn't until
|
|
kernel 2.4 that such a table existed since Linux once shunned
|
|
centralized PnP. It's named: MODULE_DEVICE_TABLE.</P>
|
|
|
|
<H2><A NAME="ss8.3">8.3</A> <A HREF="Plug-and-Play-HOWTO.html#toc8.3">Hot Swap</A>
|
|
</H2>
|
|
|
|
<P>"Hot Swap" is where you remove an old device and then plug in a new
|
|
device to replace the old one. You have thus "swapped" devices. Now
|
|
in addition to being able to detect that a new device has been plugged
|
|
in, the removal of the old device needs to be detected too.</P>
|
|
|
|
<H2><A NAME="ss8.4">8.4</A> <A HREF="Plug-and-Play-HOWTO.html#toc8.4">PnP Finds Devices Plugged Into Serial Ports</A>
|
|
</H2>
|
|
|
|
<P> External devices that connect to the serial port via a cable (such
|
|
as external modems) can also be called Plug-and-Play. Since only the
|
|
serial port itself needs bus-resources (an IRQ and I/O address) there are
|
|
no bus-resources to allocate to such plug-in devices. In this case,
|
|
PnP is used only to identify the modem (read it's model code number).
|
|
This could be important if the modem is a software modem (linmodem)
|
|
and requires a special driver. There is a special PnP specification
|
|
for such external serial devices (something connected to the serial
|
|
port).</P>
|
|
<P>Linux doesn't support this yet ?? For a hardware modem, the ordinary
|
|
serial driver will work OK so there's little need for using the
|
|
special serial PnP to find a driver. You still need to tell the
|
|
communications program what port (such as /dev/ttyS1) the modem is on.
|
|
With PnP you wouldn't need to even do this. With the advent of
|
|
software modems that have Linux drivers (linmodems), it would be nice
|
|
to have the appropriate driver install itself automatically via PnP.</P>
|
|
|
|
<HR>
|
|
<A HREF="Plug-and-Play-HOWTO-9.html">Next</A>
|
|
<A HREF="Plug-and-Play-HOWTO-7.html">Previous</A>
|
|
<A HREF="Plug-and-Play-HOWTO.html#toc8">Contents</A>
|
|
</BODY>
|
|
</HTML>
|