diff -Nru a/CREDITS b/CREDITS
--- a/CREDITS Sun May 9 19:33:46 2004
+++ b/CREDITS Sun May 9 19:33:46 2004
@@ -289,6 +289,15 @@
S: Terni 05100
S: Italy
+N: Krzysztof Benedyczak
+E: golbi@mat.uni.torun.pl
+W: http://www.mat.uni.torun.pl/~golbi
+D: POSIX message queues fs (with M. Wronski)
+S: ul. Podmiejska 52
+S: Radunica
+S: 83-000 Pruszcz Gdanski
+S: Poland
+
N: Randolph Bentson
E: bentson@grieg.seaslug.org
W: http://www.aa.net/~bentson/
@@ -1299,11 +1308,10 @@
N: Benjamin Herrenschmidt
E: benh@kernel.crashing.org
-E: benh@mipsys.com
-D: Various parts of PPC & PowerMac
-S: 122, boulevard Baille
-S: 13005 Marseille
-S: France
+D: Various parts of PPC/PPC64 & PowerMac
+S: 312/107 Canberra Avenue
+S: Griffith, ACT 2603
+S: Australia
N: Sebastian Hetze
E: she@lunetix.de
@@ -1935,6 +1943,12 @@
S: Niwot, Colorado 80503
S: USA
+N: Pete Popov
+E: pete_popov@yahoo.com
+D: Linux/MIPS AMD/Alchemy Port and mips hacking and debugging
+S: San Jose, CA 95134
+S: USA
+
N: Robert M. Love
E: rml@tech9.net
E: rml@ufl.edu
@@ -2258,7 +2272,7 @@
S: Germany
N: Thomas Molina
-E: tmolina@cox.net
+E: tmolina@cablespeed.com
D: bug fixes, documentation, minor hackery
N: James Morris
@@ -3484,6 +3498,14 @@
S: 12725 SW Millikan Way, Suite 400
S: Beaverton, OR 97005
S: USA
+
+N: Michal Wronski
+E: wrona@mat.uni.torun.pl
+W: http://www.mat.uni.torun.pl/~wrona
+D: POSIX message queues fs (with K. Benedyczak)
+S: ul. Teczowa 23/12
+S: 80-680 Gdansk-Sobieszewo
+S: Poland
N: Frank Xia
E: qx@math.columbia.edu
diff -Nru a/Documentation/Changes b/Documentation/Changes
--- a/Documentation/Changes Sun May 9 19:33:47 2004
+++ b/Documentation/Changes Sun May 9 19:33:47 2004
@@ -112,8 +112,8 @@
Architectural changes
---------------------
-DevFS is now in the kernel. See Documentation/filesystems/devfs/* in
-the kernel source tree for all the gory details.
+DevFS has been obsoleted in favour of udev
+(http://www.kernel.org/pub/linux/utils/kernel/hotplug/)
32-bit UID support is now in place. Have fun!
@@ -400,8 +400,3 @@
o
-Suggestions and corrections
-===========================
-
-Please feel free to submit changes, corrections, gripes, flames,
-money, etc. to me . Happy Linuxing!
diff -Nru a/Documentation/CodingStyle b/Documentation/CodingStyle
--- a/Documentation/CodingStyle Sun May 9 19:33:37 2004
+++ b/Documentation/CodingStyle Sun May 9 19:33:37 2004
@@ -254,6 +254,8 @@
(interactive)
(c-mode)
(c-set-style "K&R")
+ (setq tab-width 8)
+ (setq indent-tabs-mode t)
(setq c-basic-offset 8))
This will define the M-x linux-c-mode command. When hacking on a
diff -Nru a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
--- a/Documentation/DMA-mapping.txt Sun May 9 19:33:39 2004
+++ b/Documentation/DMA-mapping.txt Sun May 9 19:33:39 2004
@@ -132,7 +132,7 @@
The standard 32-bit addressing PCI device would do something like
this:
- if (pci_set_dma_mask(pdev, 0xffffffff)) {
+ if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING
"mydev: No suitable DMA available.\n");
goto ignore_this_device;
@@ -151,9 +151,9 @@
int using_dac;
- if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {
+ if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
using_dac = 1;
- } else if (!pci_set_dma_mask(pdev, 0xffffffff)) {
+ } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
using_dac = 0;
} else {
printk(KERN_WARNING
@@ -166,14 +166,14 @@
int using_dac, consistent_using_dac;
- if (!pci_set_dma_mask(pdev, 0xffffffffffffffff)) {
+ if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
using_dac = 1;
consistent_using_dac = 1;
- pci_set_consistent_dma_mask(pdev, 0xffffffffffffffff)
- } else if (!pci_set_dma_mask(pdev, 0xffffffff)) {
+ pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+ } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
using_dac = 0;
consistent_using_dac = 0;
- pci_set_consistent_dma_mask(pdev, 0xffffffff)
+ pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
} else {
printk(KERN_WARNING
"mydev: No suitable DMA available.\n");
@@ -215,7 +215,7 @@
Here is pseudo-code showing how this might be done:
- #define PLAYBACK_ADDRESS_BITS 0xffffffff
+ #define PLAYBACK_ADDRESS_BITS DMA_32BIT_MASK
#define RECORD_ADDRESS_BITS 0x00ffffff
struct my_sound_card *card;
diff -Nru a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
--- a/Documentation/DocBook/Makefile Sun May 9 19:33:38 2004
+++ b/Documentation/DocBook/Makefile Sun May 9 19:33:38 2004
@@ -7,11 +7,10 @@
# list of DOCBOOKS.
DOCBOOKS := wanbook.sgml z8530book.sgml mcabook.sgml videobook.sgml \
- parportbook.sgml kernel-hacking.sgml \
- kernel-locking.sgml via-audio.sgml mousedrivers.sgml \
- deviceiobook.sgml procfs-guide.sgml tulip-user.sgml \
- writing_usb_driver.sgml scsidrivers.sgml sis900.sgml \
- kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \
+ kernel-hacking.sgml kernel-locking.sgml via-audio.sgml \
+ mousedrivers.sgml deviceiobook.sgml procfs-guide.sgml \
+ tulip-user.sgml writing_usb_driver.sgml scsidrivers.sgml \
+ sis900.sgml kernel-api.sgml journal-api.sgml lsm.sgml usb.sgml \
gadget.sgml libata.sgml
###
@@ -93,16 +92,6 @@
$(obj)/procfs-guide.sgml: $(C-procfs-example2)
###
-# The parportbook includes a few images.
-# Force them to be build before the books
-IMG-parportbook := parport-share.fig parport-multi.fig parport-structure.fig
-IMG-parportbook2 := $(addprefix $(obj)/,$(IMG-parportbook))
-EPS-parportbook := $(patsubst %.fig,%.eps, $(IMG-parportbook2))
-PNG-parportbook := $(patsubst %.fig,%.png, $(IMG-parportbook2))
-$(obj)/parportbook.html: $(PNG-parportbook)
-$(obj)/parportbook.ps $(obj)/parportbook.pdf: $(EPS-parportbook) $(PNG-parportbook)
-
-###
# Rules to generate postscript, PDF and HTML
# db2html creates a directory. Generate a html file used for timestamp
@@ -194,8 +183,6 @@
$(patsubst %.sgml, %.pdf, $(DOCBOOKS)) \
$(patsubst %.sgml, %.html, $(DOCBOOKS)) \
$(patsubst %.sgml, %.9, $(DOCBOOKS)) \
- $(patsubst %.fig,%.eps, $(IMG-parportbook)) \
- $(patsubst %.fig,%.png, $(IMG-parportbook)) \
$(C-procfs-example)
ifneq ($(wildcard $(patsubst %.html,%,$(HTML))),)
diff -Nru a/Documentation/DocBook/kernel-hacking.tmpl b/Documentation/DocBook/kernel-hacking.tmpl
--- a/Documentation/DocBook/kernel-hacking.tmpl Sun May 9 19:33:39 2004
+++ b/Documentation/DocBook/kernel-hacking.tmpl Sun May 9 19:33:39 2004
@@ -204,11 +204,11 @@
- lists the
+ lists the
different BH's. No matter how many CPUs you have, no two BHs will run at
the same time. This made the transition to SMP simpler, but sucks hard for
scalable performance. A very important bottom half is the timer
- BH (): you
+ BH (): you
can register to have it call functions for you in a given length of time.
@@ -224,7 +224,7 @@
- tasklets ()
+ tasklets ()
are like softirqs, except they are dynamically-registrable (meaning you
can have as many as you want), and they also guarantee that any tasklet
will only run on one CPU at any time, although different tasklets can
@@ -241,7 +241,7 @@
You can tell you are in a softirq (or bottom half, or tasklet)
using the in_softirq() macro
- ().
+ ().
@@ -330,7 +330,7 @@
You create a character device and implement an appropriate ioctl
for it. This is much more flexible than system calls, doesn't have
to be entered in every architecture's
- and
+ and
arch/kernel/entry.S file, and is much more
likely to be accepted by Linus.
@@ -343,7 +343,7 @@
Inside the ioctl you're in user context to a process. When a
error occurs you return a negated errno (see
- ),
+ ),
otherwise you return 0.
@@ -429,7 +429,7 @@
printk()
-
+
@@ -447,7 +447,7 @@
- See ;
+ See ;
for other KERN_ values; these are interpreted by syslog as the
level. Special case: for printing an IP address use
@@ -487,7 +487,7 @@
get_user()
/
put_user()
-
+
@@ -525,7 +525,7 @@
kmalloc()/kfree()
-
+
[MAY SLEEP: SEE BELOW]
@@ -593,10 +593,10 @@
If you are allocating at least PAGE_SIZE
- () bytes,
+ () bytes,
consider using __get_free_pages()
- (). It
+ (). It
takes an order argument (0 for page sized, 1 for double page, 2
for four pages etc.) and the same memory priority flag word as
above.
@@ -619,13 +619,13 @@
Before inventing your own cache of often-used objects consider
using a slab cache in
-
+
current
-
+
This global variable (really a macro) contains a pointer to
@@ -638,8 +638,8 @@
udelay()/mdelay()
-
-
+
+
@@ -652,7 +652,7 @@
cpu_to_be32()/be32_to_cpu()/cpu_to_le32()/le32_to_cpu()
-
+
@@ -675,7 +675,7 @@
local_irq_save()/local_irq_restore()
-
+
@@ -690,7 +690,7 @@
local_bh_disable()/local_bh_enable()
-
+
These routines disable soft interrupts on the local CPU, and
@@ -703,7 +703,7 @@
smp_processor_id()
-
+
smp_processor_id() returns the current
@@ -715,7 +715,7 @@
__init/__exit/__initdata
-
+
After boot, the kernel frees up a special section; functions
@@ -738,7 +738,7 @@
__initcall()/module_init()
-
+
Many parts of the kernel are well served as a module
(dynamically-loadable parts of the kernel). Using the
@@ -768,7 +768,7 @@
module_exit()
-
+
This macro defines the function to be called at module removal
@@ -781,7 +781,7 @@
MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
-
+
These manipulate the module usage count, to protect against
@@ -839,7 +839,7 @@
Wait Queues
-
+
[SLEEPS]
@@ -874,7 +874,7 @@
There is a macro to do this:
wait_event_interruptible()
- The
+ The
first argument is the wait queue head, and the second is an
expression which is evaluated; the macro returns
0 when this expression is true, or
@@ -900,7 +900,7 @@
Call wake_up()
- ;,
+ ;,
which will wake up every process in the queue. The exception is
if one has TASK_EXCLUSIVE set, in which case
the remainder of the queue will not be woken.
@@ -915,7 +915,7 @@
Certain operations are guaranteed atomic on all platforms. The
first class of operations work on atomic_t
- ; this
+ ; this
contains a signed integer (at least 24 bits long), and you must use
these functions to manipulate or read atomic_t variables.
atomic_read() and
@@ -943,7 +943,7 @@
The second class of atomic operations is atomic bit operations on a
long, defined in
- . These
+ . These
operations generally take a pointer to the bit pattern, and a bit
number: 0 is the least significant bit.
set_bit(), clear_bit()
@@ -982,7 +982,7 @@
EXPORT_SYMBOL()
-
+
This is the classic method of exporting a symbol, and it works
@@ -995,7 +995,7 @@
EXPORT_SYMBOL_GPL()
-
+
Similar to EXPORT_SYMBOL() except that the
@@ -1012,7 +1012,7 @@
Double-linked lists
-
+
There are three sets of linked-list routines in the kernel
@@ -1039,7 +1039,7 @@
The filesystem code uses ERR_PTR()
- ; to
+ ; to
encode a negative error number into a pointer, and
IS_ERR() and PTR_ERR()
to get it back out again: avoids a separate pointer parameter for
diff -Nru a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl
--- a/Documentation/DocBook/kernel-locking.tmpl Sun May 9 19:33:38 2004
+++ b/Documentation/DocBook/kernel-locking.tmpl Sun May 9 19:33:38 2004
@@ -87,7 +87,7 @@
Expected Results
-
+
@@ -133,7 +133,7 @@
Possible Results
-
+
Instance 1
@@ -222,14 +222,14 @@
There are two main types of kernel locks. The fundamental type
is the spinlock
- (),
+ (),
which is a very simple single-holder lock: if you can't get the
spinlock, you keep trying (spinning) until you can. Spinlocks are
very small and fast, and can be used anywhere.
The second type is a semaphore
- (): it
+ (): it
can have more than one holder at any time (the number decided at
initialization time), although it is most commonly used as a
single-holder lock (a mutex). If you can't get a semaphore,
@@ -315,7 +315,7 @@
user context can be interrupted by a softirq, and secondly, the
critical region could be entered from another CPU. This is where
spin_lock_bh()
- () is
+ () is
used. It disables softirqs on that CPU, then grabs the lock.
spin_unlock_bh() does the reverse. (The
'_bh' suffix is a historical reference to "Bottom Halves", the
@@ -333,7 +333,7 @@
This works perfectly for UP
as well: the spin lock vanishes, and this macro
simply becomes local_bh_disable()
- (), which
+ (), which
protects you from the softirq being run.
@@ -463,7 +463,7 @@
This works perfectly for UP as well: the spin lock vanishes,
and this macro simply becomes local_irq_disable()
- (), which
+ (), which
protects you from the softirq/tasklet/BH being run.
@@ -545,7 +545,7 @@
Table of Locking Requirements
-
+
@@ -1026,7 +1026,7 @@
refcnt. There are a number of atomic
operations defined in
-: these are
+: these are
guaranteed to be seen atomically from all CPUs in the system, so no
lock is required. In this case, it is simpler than using spinlocks,
although for anything non-trivial using spinlocks is clearer. The
@@ -1296,7 +1296,7 @@
Consequences
-
+
@@ -1437,7 +1437,7 @@
themselves (by calling add_timer() at the end
of their timer function). Because this is a fairly common case
which is prone to races, you should use del_timer_sync()
- ()
+ ()
to handle this case. It returns the number of times the timer
had to be deleted before we finally stopped it from adding itself back
in.
@@ -1749,7 +1749,7 @@
an exclusive lock. See DEFINE_PER_CPU(),
get_cpu_var() and
put_cpu_var()
- ().
+ ().
@@ -1757,7 +1757,7 @@
local_t type, and the
cpu_local_inc() and related functions,
which are more efficient than simple code on some architectures
- ().
+ ().
diff -Nru a/Documentation/DocBook/lsm.tmpl b/Documentation/DocBook/lsm.tmpl
--- a/Documentation/DocBook/lsm.tmpl Sun May 9 19:33:46 2004
+++ b/Documentation/DocBook/lsm.tmpl Sun May 9 19:33:46 2004
@@ -27,7 +27,7 @@
cvance@nai.com
-
Introduction
diff -Nru a/Documentation/DocBook/mousedrivers.tmpl b/Documentation/DocBook/mousedrivers.tmpl
--- a/Documentation/DocBook/mousedrivers.tmpl Sun May 9 19:33:46 2004
+++ b/Documentation/DocBook/mousedrivers.tmpl Sun May 9 19:33:46 2004
@@ -88,9 +88,9 @@
Each read from a bus mouse interface device returns a block of data.
The first three bytes of each read are defined as follows:
-
+
Mouse Data Encoding
-
+
Byte 0
diff -Nru a/Documentation/DocBook/parport-multi.fig b/Documentation/DocBook/parport-multi.fig
--- a/Documentation/DocBook/parport-multi.fig Sun May 9 19:33:46 2004
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,59 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-6 1425 4350 5175 5475
-6 3450 5100 4425 5475
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 4425 5475 4425 5100 3450 5100 3450 5475 4425 5475
-4 0 0 50 0 0 12 0.0000 4 135 510 3600 5400 Printer\001
--6
-6 3375 4350 5175 4725
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 5175 4725 5175 4350 3375 4350 3375 4725 5175 4725
-4 0 0 50 0 0 12 0.0000 4 180 870 3825 4650 Multiplexor\001
--6
-6 1425 4650 2775 5475
-6 1425 4650 2775 5475
-2 4 0 1 0 7 50 0 -1 0.000 0 0 6 0 0 5
- 2757 5475 2757 4650 1425 4650 1425 5475 2757 5475
-4 0 0 50 0 0 12 0.0000 4 180 735 1725 5100 Computer\001
--6
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2775 4875 2700 4875 2700 5025 2775 5025 2775 4875
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2775 5175 2700 5175 2700 5325 2775 5325 2775 5175
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2775 4950 3600 4725
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2775 5250 3450 5325
--6
-6 3150 2625 4125 3525
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 4125 3075 4125 2625 3150 2625 3150 3075 4125 3075
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 3675 3075 3675 3525
-4 0 0 50 0 0 12 0.0000 4 135 510 3300 2925 Printer\001
--6
-6 4275 3450 5250 4350
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 5250 3900 5250 3450 4275 3450 4275 3900 5250 3900
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 4800 3900 4800 4350
-4 0 0 50 0 0 12 0.0000 4 135 510 4425 3750 Printer\001
--6
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 3900 4050 3900 3525 3375 3525 3375 4050 3900 4050
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 3675 4050 3675 4350
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3600 4350 3750 4350 3750 4425 3600 4425 3600 4350
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4725 4350 4875 4350 4875 4425 4725 4425 4725 4350
-4 0 0 50 0 0 12 0.0000 4 135 285 3450 3900 ZIP\001
diff -Nru a/Documentation/DocBook/parport-share.fig b/Documentation/DocBook/parport-share.fig
--- a/Documentation/DocBook/parport-share.fig Sun May 9 19:33:36 2004
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,154 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-0 32 #8e8e8e
-0 33 #8e8e8e
-0 34 #aeaaae
-0 35 #515551
-0 36 #414141
-0 37 #868286
-0 38 #8e8e8e
-0 39 #414141
-0 40 #868286
-0 41 #c7c3c7
-0 42 #e7e3e7
-0 43 #414141
-0 44 #868286
-0 45 #c7c3c7
-0 46 #e7e3e7
-0 47 #868286
-0 48 #c7c3c7
-0 49 #e7e3e7
-6 1200 3000 2250 4950
-6 1275 3150 2175 3675
-6 1312 3487 1837 3637
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 5
- 1312 3562 1312 3524 1474 3524 1474 3487 1675 3487
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 3
- 1474 3637 1474 3562 1675 3562
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 2
- 1675 3524 1837 3524
-2 1 0 1 7 -1 19 0 -1 0.000 2 0 -1 0 0 2
- 1675 3487 1675 3524
-2 1 0 1 7 -1 19 0 -1 0.000 2 0 -1 0 0 2
- 1312 3562 1474 3562
-2 1 0 1 7 -1 19 0 -1 0.000 2 0 -1 0 0 5
- 1474 3637 1675 3637 1675 3562 1837 3562 1837 3524
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 3
- 1716 3637 1797 3637 1797 3600
-2 1 0 1 7 -1 19 0 -1 0.000 2 0 -1 0 0 3
- 1716 3637 1716 3600 1797 3600
--6
-6 1413 3345 2070 3397
-6 1994 3352 2070 3390
-2 1 0 1 7 40 19 0 -1 0.000 2 0 -1 0 0 3
- 1994 3390 1994 3352 2070 3352
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 3
- 1994 3390 2070 3390 2070 3352
--6
-6 1531 3353 1643 3389
-2 2 0 0 40 41 19 0 20 0.000 2 0 -1 0 0 5
- 1568 3353 1606 3353 1606 3389 1568 3389 1568 3353
-2 2 0 0 40 39 19 0 20 0.000 2 0 -1 0 0 5
- 1606 3353 1643 3353 1643 3389 1606 3389 1606 3353
-2 2 0 0 40 41 19 0 20 0.000 2 0 -1 0 0 5
- 1568 3353 1531 3353 1531 3389 1568 3389 1568 3353
--6
-6 1413 3345 1465 3397
-1 3 0 0 0 39 18 0 20 0.000 1 0.0000 1439 3371 26 26 1439 3371 1439 3397
-1 3 0 0 40 41 18 0 20 0.000 1 0.0000 1439 3371 15 15 1439 3371 1443 3385
--6
-2 2 0 0 40 7 19 0 20 0.000 2 0 -1 0 0 3
- 1950 3371 1875 3371 1950 3371
-2 2 0 0 40 41 19 0 20 0.000 2 0 -1 0 0 5
- 1945 3384 1896 3384 1896 3357 1945 3357 1945 3384
--6
-6 1350 3183 2100 3300
-2 1 0 1 7 40 19 0 -1 0.000 2 0 -1 0 0 3
- 1350 3300 1350 3183 2100 3183
-2 1 0 1 40 -1 19 0 -1 0.000 2 0 -1 0 0 3
- 1350 3300 2100 3300 2100 3183
--6
-2 1 0 1 7 7 19 0 -1 0.000 2 0 -1 0 0 5
- 1275 3675 1875 3675 1875 3450 2175 3450 2175 3150
-2 1 0 1 40 7 19 0 -1 0.000 2 0 -1 0 0 3
- 1275 3675 1275 3150 2175 3150
--6
-6 1950 3750 2175 3975
-5 1 0 1 7 7 19 0 -1 0.000 0 0 0 0 2038.000 3900.000 1985 3953 1985 3847 2091 3847
-5 1 0 1 40 7 19 0 -1 0.000 0 1 0 0 2038.000 3900.000 1985 3953 2091 3953 2091 3847
--6
-6 1200 4050 1800 4800
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4125 1725 4125
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4200 1725 4200
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4275 1725 4275
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4350 1725 4350
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4425 1725 4425
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4500 1725 4500
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4575 1725 4575
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4650 1725 4650
-2 1 0 2 40 7 19 0 -1 0.000 2 1 -1 0 0 2
- 1275 4725 1725 4725
--6
-2 2 0 1 0 39 20 0 20 0.000 2 0 -1 0 0 5
- 1200 4950 1425 4950 1425 4911 1200 4911 1200 4950
-2 2 0 1 0 39 20 0 20 0.000 2 0 -1 0 0 5
- 2025 4950 2250 4950 2250 4911 2025 4911 2025 4950
-2 2 0 1 0 42 20 0 20 0.000 2 0 -1 0 0 5
- 1200 4907 2250 4907 2250 3000 1200 3000 1200 4907
--6
-6 2374 3225 3375 4050
-3 2 0 1 0 37 50 0 -1 0.000 0 0 0 3
- 2374 3402 3139 3402 3257 4050
- 0.000 -1.000 0.000
-3 2 0 1 0 37 50 0 -1 0.000 0 0 0 3
- 2374 3461 3096 3437 3198 4050
- 0.000 -1.000 0.000
--6
-2 2 0 1 0 1 50 0 20 0.000 0 0 -1 0 0 5
- 2925 4575 4050 4575 4050 4875 2925 4875 2925 4575
-2 3 0 1 0 32 50 0 20 0.000 0 0 -1 0 0 5
- 1200 3000 1575 2475 2400 2475 2250 3000 1200 3000
-2 3 0 1 0 8 50 0 20 0.000 0 0 -1 0 0 5
- 2925 4575 3000 4200 4050 4200 4050 4575 2925 4575
-2 2 0 1 0 0 50 0 20 0.000 0 0 -1 0 0 5
- 3075 4725 3900 4725 3900 4800 3075 4800 3075 4725
-2 2 0 1 0 46 50 0 20 0.000 0 0 -1 0 0 5
- 4800 3975 6450 3975 6450 4875 4800 4875 4800 3975
-2 2 0 1 0 36 50 0 20 0.000 0 0 -1 0 0 5
- 5025 4575 6225 4575 6225 4725 5025 4725 5025 4575
-2 2 0 1 0 36 50 0 20 0.000 0 0 -1 0 0 5
- 5025 3975 6225 3975 6225 3300 5025 3300 5025 3975
-2 3 0 1 0 37 50 0 20 0.000 0 0 -1 0 0 5
- 4800 3975 4800 3825 5025 3825 5025 3975 4800 3975
-2 3 0 1 0 37 50 0 20 0.000 0 0 -1 0 0 5
- 6225 3825 6375 3825 6450 3975 6225 3975 6225 3825
-2 3 0 1 0 32 50 0 20 0.000 0 0 -1 0 0 5
- 2400 2475 2250 3000 2250 4875 2400 4350 2400 2475
-2 3 0 1 0 37 50 0 -1 0.000 0 0 -1 0 0 6
- 3075 4200 3075 4050 3300 4050 3375 4050 3375 4200 3075 4200
-2 3 0 1 0 37 50 0 -1 0.000 0 0 -1 0 0 6
- 3900 4200 3900 4050 3675 4050 3600 4050 3600 4200 3900 4200
-3 2 0 1 0 37 50 0 -1 0.000 0 0 0 5
- 3705 4050 3825 3675 4185 3390 4590 3615 4800 4035
- 0.000 -1.000 -1.000 -1.000 0.000
-3 2 0 1 0 37 50 0 -1 0.000 0 0 0 5
- 3765 4050 3874 3708 4202 3449 4571 3654 4800 4185
- 0.000 -1.000 -1.000 -1.000 0.000
-4 0 0 50 0 0 12 0.0000 4 180 735 1350 5400 Computer\001
-4 0 0 50 0 0 12 0.0000 4 180 675 3150 5400 Zip drive\001
-4 0 0 50 0 0 12 0.0000 4 135 510 5325 5400 Printer\001
diff -Nru a/Documentation/DocBook/parport-structure.fig b/Documentation/DocBook/parport-structure.fig
--- a/Documentation/DocBook/parport-structure.fig Sun May 9 19:33:38 2004
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,60 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-0 32 #414541
-0 33 #8e8e8e
-0 34 #414541
-0 35 #8e8e8e
-0 36 #414541
-0 37 #8e8e8e
-0 38 #414541
-0 39 #8e8e8e
-0 40 #414541
-0 41 #8e8e8e
-0 42 #414541
-0 43 #8e8e8e
-0 44 #414141
-0 45 #868286
-0 46 #c7c3c7
-0 47 #8e8e8e
-0 48 #414141
-0 49 #868286
-0 50 #c7c3c7
-0 51 #e7e3e7
-6 2025 1800 3075 2250
-2 4 0 1 0 7 50 0 -1 0.000 0 0 3 0 0 5
- 3045 2250 3045 1800 2025 1800 2025 2250 3045 2250
-4 0 0 50 0 14 12 0.0000 4 180 210 2400 2100 lp\001
--6
-6 4125 1800 5175 2250
-2 4 0 1 0 7 50 0 -1 0.000 0 0 3 0 0 5
- 5145 2250 5145 1800 4125 1800 4125 2250 5145 2250
-4 0 0 50 0 14 12 0.0000 4 135 315 4425 2100 ppa\001
--6
-6 3225 3075 4275 3525
-6 3375 3225 4125 3450
-4 0 0 50 0 14 12 0.0000 4 165 735 3375 3375 parport\001
--6
-2 4 0 1 0 7 50 0 -1 0.000 0 0 3 0 0 5
- 4245 3525 4245 3075 3225 3075 3225 3525 4245 3525
--6
-6 3000 4350 4500 4800
-2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
- 4500 4800 4500 4350 3000 4350 3000 4800 4500 4800
-4 0 0 50 0 14 12 0.0000 4 165 1050 3225 4650 parport_pc\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 1 1 1.00 60.00 120.00
- 2550 2250 3600 3075
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 1 1 1.00 60.00 120.00
- 4650 2250 3825 3075
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 1 1 1.00 60.00 120.00
- 3750 3525 3750 4350
diff -Nru a/Documentation/DocBook/parportbook.tmpl b/Documentation/DocBook/parportbook.tmpl
--- a/Documentation/DocBook/parportbook.tmpl Sun May 9 19:33:36 2004
+++ /dev/null Wed Dec 31 16:00:00 1969
@@ -1,2738 +0,0 @@
-
-
-
-
-
- The Linux 2.4 Parallel Port Subsystem
-
-
-
- Tim
- Waugh
-
-
- twaugh@redhat.com
-
-
-
-
-
-
- 1999-2000
- Tim Waugh
-
-
-
-
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU Free Documentation License,
- Version 1.1 or any later version published by the Free Software
- Foundation; with no Invariant Sections, with no Front-Cover Texts,
- and with no Back-Cover Texts. A copy of the license is included
- in the section entitled "GNU Free Documentation License".
-
-
-
-
-
-
-
- Design goals
-
-
- The problems
-
-
- The first parallel port support for Linux came with the line
- printer driver, lp. The printer driver is a
- character special device, and (in Linux 2.0) had support for
- writing, via write, and configuration and
- statistics reporting via ioctl.
-
-
-
- The printer driver could be used on any computer that had an IBM
- PC-compatible parallel port. Because some architectures have
- parallel ports that aren't really the same as PC-style ports,
- other variants of the printer driver were written in order to
- support Amiga and Atari parallel ports.
-
-
-
- When the Iomega Zip drive was released, and a driver written for
- it, a problem became apparent. The Zip drive is a parallel port
- device that provides a parallel port of its own---it is designed
- to sit between a computer and an attached printer, with the
- printer plugged into the Zip drive, and the Zip drive plugged into
- the computer.
-
-
-
- The problem was that, although printers and Zip drives were both
- supported, for any given port only one could be used at a time.
- Only one of the two drivers could be present in the kernel at
- once. This was because of the fact that both drivers wanted to
- drive the same hardware---the parallel port. When the printer
- driver initialised, it would call the
- check_region function to make sure that the
- IO region associated with the parallel port was free, and then it
- would call request_region to allocate it.
- The Zip drive used the same mechanism. Whichever driver
- initialised first would gain exclusive control of the parallel
- port.
-
-
-
- The only way around this problem at the time was to make sure that
- both drivers were available as loadable kernel modules. To use
- the printer, load the printer driver module; then for the Zip
- drive, unload the printer driver module and load the Zip driver
- module.
-
-
-
- The net effect was that printing a document that was stored on a
- Zip drive was a bit of an ordeal, at least if the Zip drive and
- printer shared a parallel port. A better solution was
- needed.
-
-
-
- Zip drives are not the only devices that presented problems for
- Linux. There are other devices with pass-through ports, for
- example parallel port CD-ROM drives. There are also printers that
- report their status textually rather than using simple error pins:
- sending a command to the printer can cause it to report the number
- of pages that it has ever printed, or how much free memory it has,
- or whether it is running out of toner, and so on. The printer
- driver didn't originally offer any facility for reading back this
- information (although Carsten Gross added nibble mode readback
- support for kernel 2.2).
-
-
-
- The IEEE has issued a standards document called IEEE 1284, which
- documents existing practice for parallel port communications in a
- variety of modes. Those modes are: compatibility
,
- reverse nibble, reverse byte, ECP and EPP. Newer devices often
- use the more advanced modes of transfer (ECP and EPP). In Linux
- 2.0, the printer driver only supported compatibility
- mode
(i.e. normal printer protocol) and reverse nibble
- mode.
-
-
-
-
-
- The solutions
-
-
-
-
- The parport code in Linux 2.2 was designed to
- meet these problems of architectural differences in parallel
- ports, of port-sharing between devices with pass-through ports,
- and of lack of support for IEEE 1284 transfer modes.
-
-
-
-
-
- There are two layers to the parport
- subsystem, only one of which deals directly with the hardware.
- The other layer deals with sharing and IEEE 1284 transfer modes.
- In this way, parallel support for a particular architecture comes
- in the form of a module which registers itself with the generic
- sharing layer.
-
-
-
-
-
- The sharing model provided by the parport
- subsystem is one of exclusive access. A device driver, such as
- the printer driver, must ask the parport
- layer for access to the port, and can only use the port once
- access has been granted. When it has finished a
- transaction
, it can tell the
- parport layer that it may release the port
- for other device drivers to use.
-
-
-
-
-
- Devices with pass-through ports all manage to share a parallel
- port with other devices in generally the same way. The device has
- a latch for each of the pins on its pass-through port. The normal
- state of affairs is pass-through mode, with the device copying the
- signal lines between its host port and its pass-through port.
- When the device sees a special signal from the host port, it
- latches the pass-through port so that devices further downstream
- don't get confused by the pass-through device's conversation with
- the host parallel port: the device connected to the pass-through
- port (and any devices connected in turn to it) are effectively cut
- off from the computer. When the pass-through device has completed
- its transaction with the computer, it enables the pass-through
- port again.
-
-
-
-
-
-
-
-
-
-
-
-
- This technique relies on certain special signals
- being invisible to devices that aren't watching for them. This
- tends to mean only changing the data signals and leaving the
- control signals alone. IEEE 1284.3 documents a standard protocol
- for daisy-chaining devices together with parallel ports.
-
-
-
-
-
- Support for standard transfer modes are provided as operations
- that can be performed on a port, along with operations for setting
- the data lines, or the control lines, or reading the status lines.
- These operations appear to the device driver as function pointers;
- more later.
-
-
-
-
-
-
-
- Standard transfer modes
-
-
-
-
-
- The standard
transfer modes in use over the parallel
- port are defined
by a document called IEEE 1284. It
- really just codifies existing practice and documents protocols (and
- variations on protocols) that have been in common use for quite
- some time.
-
-
-
- The original definitions of which pin did what were set out by
- Centronics Data Computer Corporation, but only the printer-side
- interface signals were specified.
-
-
-
- By the early 1980s, IBM's host-side implementation had become the
- most widely used. New printers emerged that claimed Centronics
- compatibility, but although compatible with Centronics they
- differed from one another in a number of ways.
-
-
-
- As a result of this, when IEEE 1284 was published in 1994, all that
- it could really do was document the various protocols that are used
- for printers (there are about six variations on a theme).
-
-
-
- In addition to the protocol used to talk to Centronics-compatible
- printers, IEEE 1284 defined other protocols that are used for
- unidirectional peripheral-to-host transfers (reverse nibble and
- reverse byte) and for fast bidirectional transfers (ECP and
- EPP).
-
-
-
-
-
- Structure
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sharing core
-
-
- At the core of the parport subsystem is the
- sharing mechanism (see
- drivers/parport/share.c). This module,
- parport, is responsible for keeping track of
- which ports there are in the system, which device drivers might be
- interested in new ports, and whether or not each port is available
- for use (or if not, which driver is currently using it).
-
-
-
-
-
- Parports and their overrides
-
-
- The generic parport sharing code doesn't
- directly handle the parallel port hardware. That is done instead
- by low-level
parport drivers.
- The function of a low-level parport driver is
- to detect parallel ports, register them with the sharing code, and
- provide a list of access functions for each port.
-
-
-
- The most basic access functions that must be provided are ones for
- examining the status lines, for setting the control lines, and for
- setting the data lines. There are also access functions for
- setting the direction of the data lines; normally they are in the
- forward
direction (that is, the computer drives
- them), but some ports allow switching to reverse
- mode (driven by the peripheral). There is an access function for
- examining the data lines once in reverse mode.
-
-
-
-
-
- IEEE 1284 transfer modes
-
-
- Stacked on top of the sharing mechanism, but still in the
- parport module, are functions for
- transferring data. They are provided for the device drivers to
- use, and are very much like library routines. Since these
- transfer functions are provided by the generic
- parport core they must use the lowest
- common denominator
set of access functions: they can set
- the control lines, examine the status lines, and use the data
- lines. With some parallel ports the data lines can only be set
- and not examined, and with other ports accessing the data register
- causes control line activity; with these types of situations, the
- IEEE 1284 transfer functions make a best effort attempt to do the
- right thing. In some cases, it is not physically possible to use
- particular IEEE 1284 transfer modes.
-
-
-
- The low-level parport drivers also provide
- IEEE 1284 transfer functions, as names in the access function
- list. The low-level driver can just name the generic IEEE 1284
- transfer functions for this. Some parallel ports can do IEEE 1284
- transfers in hardware; for those ports, the low-level driver can
- provide functions to utilise that feature.
-
-
-
-
-
-
-
- Pardevices and parport_drivers
-
-
- When a parallel port device driver (such as
- lp) initialises it tells the sharing layer
- about itself using parport_register_driver.
- The information is put into a struct
- parport_driver, which is put into a linked list. The
- information in a struct parport_driver
- really just amounts to some function pointers to callbacks in the
- parallel port device driver.
-
-
-
- During its initialisation, a low-level port driver tells the
- sharing layer about all the ports that it has found (using
- parport_register_port), and the sharing layer
- creates a struct parport for each of
- them. Each struct parport contains
- (among other things) a pointer to a struct
- parport_operations, which is a list of function
- pointers for the various operations that can be performed on a
- port. You can think of a struct parport
- as a parallel port object
, if
- object-orientated
programming is your thing. The
- parport structures are chained in a
- linked list, whose head is portlist (in
- drivers/parport/share.c).
-
-
-
- Once the port has been registered, the low-level port driver
- announces it. The parport_announce_port
- function walks down the list of parallel port device drivers
- (struct parport_drivers) calling the
- attach function of each (which may block).
-
-
-
- Similarly, a low-level port driver can undo the effect of
- registering a port with the
- parport_unregister_port function, and device
- drivers are notified using the detach
- callback (which may not block).
-
-
-
- Device drivers can undo the effect of registering themselves with
- the parport_unregister_driver
- function.
-
-
-
-
-
-
-
- The IEEE 1284.3 API
-
-
- The ability to daisy-chain devices is very useful, but if every
- device does it in a different way it could lead to lots of
- complications for device driver writers. Fortunately, the IEEE
- are standardising it in IEEE 1284.3, which covers daisy-chain
- devices and port multiplexors.
-
-
-
- At the time of writing, IEEE 1284.3 has not been published, but
- the draft specifies the on-the-wire protocol for daisy-chaining
- and multiplexing, and also suggests a programming interface for
- using it. That interface (or most of it) has been implemented in
- the parport code in Linux.
-
-
-
- At initialisation of the parallel port bus
,
- daisy-chained devices are assigned addresses starting from zero.
- There can only be four devices with daisy-chain addresses, plus
- one device on the end that doesn't know about daisy-chaining and
- thinks it's connected directly to a computer.
-
-
-
- Another way of connecting more parallel port devices is to use a
- multiplexor. The idea is to have a device that is connected
- directly to a parallel port on a computer, but has a number of
- parallel ports on the other side for other peripherals to connect
- to (two or four ports are allowed). The multiplexor switches
- control to different ports under software control---it is, in
- effect, a programmable printer switch.
-
-
-
- Combining the ability of daisy-chaining five devices together with
- the ability to multiplex one parallel port between four gives the
- potential to have twenty peripherals connected to the same
- parallel port!
-
-
-
- In addition, of course, a single computer can have multiple
- parallel ports. So, each parallel port peripheral in the system
- can be identified with three numbers, or co-ordinates: the
- parallel port, the multiplexed port, and the daisy-chain
- address.
-
-
-
-
-
-
-
-
-
-
-
-
- Each device in the system is numbered at initialisation (by
- parport_daisy_init). You can convert between
- this device number and its co-ordinates with
- parport_device_num and
- parport_device_coords.
-
-
-
-
-#include <parport.h>
-
-
- int parport_device_num
- int parport
- int mux
- int daisy
-
-
-
-
-
- int parport_device_coords
- int devnum
- int *parport
- int *mux
- int *daisy
-
-
-
-
- Any parallel port peripheral will be connected directly or
- indirectly to a parallel port on the system, but it won't have a
- daisy-chain address if it does not know about daisy-chaining, and
- it won't be connected through a multiplexor port if there is no
- multiplexor. The special co-ordinate value
- -1 is used to indicate these cases.
-
-
-
- Two functions are provided for finding devices based on their IEEE
- 1284 Device ID: parport_find_device and
- parport_find_class.
-
-
-
-
-#include <parport.h>
-
-
- int parport_find_device
- const char *mfg
- const char *mdl
- int from
-
-
-
-
-
- int parport_find_class
- parport_device_class cls
- int from
-
-
-
-
- These functions take a device number (in addition to some other
- things), and return another device number. They walk through the
- list of detected devices until they find one that matches the
- requirements, and then return that device number (or
- -1 if there are no more such devices). They
- start their search at the device after the one in the list with
- the number given (at from+1, in other
- words).
-
-
-
-
-
-
-
- Device driver's view
-
-
-
-
-
-
-
-
-
-
- This section is written from the point of view of the device driver
- programmer, who might be writing a driver for a printer or a
- scanner or else anything that plugs into the parallel port. It
- explains how to use the parport interface to
- find parallel ports, use them, and share them with other device
- drivers.
-
-
-
- We'll start out with a description of the various functions that
- can be called, and then look at a reasonably simple example of
- their use: the printer driver.
-
-
-
- The interactions between the device driver and the
- parport layer are as follows. First, the
- device driver registers its existence with
- parport, in order to get told about any
- parallel ports that have been (or will be) detected. When it gets
- told about a parallel port, it then tells
- parport that it wants to drive a device on
- that port. Thereafter it can claim exclusive access to the port in
- order to talk to its device.
-
-
-
- So, the first thing for the device driver to do is tell
- parport that it wants to know what parallel
- ports are on the system. To do this, it uses the
- parport_register_driver function:
-
-
-
-
-#include <parport.h>
-
-struct parport_driver {
- const char *name;
- void (*attach) (struct parport *);
- void (*detach) (struct parport *);
- struct parport_driver *next;
-};
-
-
-
- int parport_register_driver
- struct parport_driver *driver
-
-
-
-
- In other words, the device driver passes pointers to a couple of
- functions to parport, and
- parport calls attach for
- each port that's detected (and detach for each
- port that disappears---yes, this can happen).
-
-
-
- The next thing that happens is that the device driver tells
- parport that it thinks there's a device on the
- port that it can drive. This typically will happen in the driver's
- attach function, and is done with
- parport_register_device:
-
-
-
-
-#include <parport.h>
-
-
- struct pardevice *parport_register_device
- struct parport *port
- const char *name
- int (*pf)
- void *
- void (*kf)
- void *
- void (*irq_func)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-
-
- The port comes from the parameter supplied
- to the attach function when it is called, or
- alternatively can be found from the list of detected parallel ports
- directly with the (now deprecated)
- parport_enumerate function. A better way of
- doing this is with parport_find_number or
- parport_find_base functions, which find ports
- by number and by base I/O address respectively.
-
-
-
-
-#include <parport.h>
-
-
- struct parport *parport_find_number
- int number
-
-
-
-
-#include <parport.h>
-
-
- struct parport *parport_find_base
- unsigned long base
-
-
-
-
- The next three parameters, pf,
- kf, and irq_func, are
- more function pointers. These callback functions get called under
- various circumstances, and are always given the
- handle as one of their parameters.
-
-
-
- The preemption callback, pf, is called when
- the driver has claimed access to the port but another device driver
- wants access. If the driver is willing to let the port go, it
- should return zero and the port will be released on its behalf.
- There is no need to call parport_release. If
- pf gets called at a bad time for letting the
- port go, it should return non-zero and no action will be taken. It
- is good manners for the driver to try to release the port at the
- earliest opportunity after its preemption callback is
- called.
-
-
-
- The kick
callback, kf, is
- called when the port can be claimed for exclusive access; that is,
- parport_claim is guaranteed to succeed inside
- the kick
callback. If the driver wants to claim the
- port it should do so; otherwise, it need not take any
- action.
-
-
-
- The irq_func callback is called,
- predictably, when a parallel port interrupt is generated. But it
- is not the only code that hooks on the interrupt. The sequence is
- this: the lowlevel driver is the one that has done
- request_irq; it then does whatever
- hardware-specific things it needs to do to the parallel port
- hardware (for PC-style ports, there is nothing special to do); it
- then tells the IEEE 1284 code about the interrupt, which may
- involve reacting to an IEEE 1284 event, depending on the current
- IEEE 1284 phase; and finally the irq_func
- function is called.
-
-
-
- None of the callback functions are allowed to block.
-
-
-
- The flags are for telling
- parport any requirements or hints that are
- useful. The only useful value here (other than
- 0, which is the usual value) is
- PARPORT_DEV_EXCL. The point of that flag is
- to request exclusive access at all times---once a driver has
- successfully called parport_register_device
- with that flag, no other device drivers will be able to register
- devices on that port (until the successful driver deregisters its
- device, of course).
-
-
-
- The PARPORT_DEV_EXCL flag is for preventing
- port sharing, and so should only be used when sharing the port with
- other device drivers is impossible and would lead to incorrect
- behaviour. Use it sparingly!
-
-
-
- Devices can also be registered by device drivers based on their
- device numbers (the same device numbers as in the previous
- section).
-
-
-
- The parport_open function is similar to
- parport_register_device, and
- parport_close is the equivalent of
- parport_unregister_device. The difference is
- that parport_open takes a device number rather
- than a pointer to a struct parport.
-
-
-
-
-#include <parport.h>
-
-
- struct pardevice *parport_open
- int devnum
- const char *name
- int (*pf)
- void *
- int (*kf)
- void *
- int (*irqf)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-
-
-
- void parport_close
- struct pardevice *dev
-
-
-
-
-
- struct pardevice *parport_register_device
- struct parport *port
- const char *name
- int (*pf)
- void *
- int (*kf)
- void *
- int (*irqf)
- int, void *, struct pt_regs *
- int flags
- void *handle
-
-
-
-
-
- void parport_unregister_device
- struct pardevice *dev
-
-
-
-
- The intended use of these functions is during driver initialisation
- while the driver looks for devices that it supports, as
- demonstrated by the following code fragment:
-
-
-
-
-
-
- Once your device driver has registered its device and been handed a
- pointer to a struct pardevice, the next
- thing you are likely to want to do is communicate with the device
- you think is there. To do that you'll need to claim access to the
- port.
-
-
-
-
-#include <parport.h>
-
-
- int parport_claim
- struct pardevice *dev
-
-
-
-
-
- int parport_claim_or_block
- struct pardevice *dev
-
-
-
-
-
- void parport_release
- struct pardevice *dev
-
-
-
-
- To claim access to the port, use parport_claim
- or parport_claim_or_block. The first of these
- will not block, and so can be used from interrupt context. If
- parport_claim succeeds it will return zero and
- the port is available to use. It may fail (returning non-zero) if
- the port is in use by another driver and that driver is not willing
- to relinquish control of the port.
-
-
-
- The other function, parport_claim_or_block,
- will block if necessary to wait for the port to be free. If it
- slept, it returns 1; if it succeeded without
- needing to sleep it returns 0. If it fails it
- will return a negative error code.
-
-
-
- When you have finished communicating with the device, you can give
- up access to the port so that other drivers can communicate with
- their devices. The parport_release function
- cannot fail, but it should not be called without the port claimed.
- Similarly, you should not try to claim the port if you already have
- it claimed.
-
-
-
- You may find that although there are convenient points for your
- driver to relinquish the parallel port and allow other drivers to
- talk to their devices, it would be preferable to keep hold of the
- port. The printer driver only needs the port when there is data to
- print, for example, but a network driver (such as PLIP) could be
- sent a remote packet at any time. With PLIP, it is no huge
- catastrophe if a network packet is dropped, since it will likely be
- sent again, so it is possible for that kind of driver to share the
- port with other (pass-through) devices.
-
-
-
- The parport_yield and
- parport_yield_blocking functions are for
- marking points in the driver at which other drivers may claim the
- port and use their devices. Yielding the port is similar to
- releasing it and reclaiming it, but is more efficient because
- nothing is done if there are no other devices needing the port. In
- fact, nothing is done even if there are other devices waiting but
- the current device is still within its timeslice
.
- The default timeslice is half a second, but it can be adjusted via
- a /proc entry.
-
-
-
-
-#include <parport.h>
-
-
- int parport_yield
- struct pardevice *dev
-
-
-
-
-
- int parport_yield_blocking
- struct pardevice *dev
-
-
-
-
- The first of these, parport_yield, will not
- block but as a result may fail. The return value for
- parport_yield is the same as for
- parport_claim. The blocking version,
- parport_yield_blocking, has the same return
- code as parport_claim_or_block.
-
-
-
- Once the port has been claimed, the device driver can use the
- functions in the struct parport_operations
- pointer in the struct parport it has a
- pointer to. For example:
-
-
-
- ops->write_data (port, d);
- ]]>
-
-
- Some of these operations have shortcuts
. For
- instance, parport_write_data is equivalent to
- the above, but may be a little bit faster (it's a macro that in
- some cases can avoid needing to indirect through
- port and ops).
-
-
-
-
-
- Port drivers
-
-
-
-
- To recap, then:
-
-
-
-
-
- The device driver registers itself with parport.
-
-
-
-
-
- A low-level driver finds a parallel port and registers it with
- parport (these first two things can happen
- in either order). This registration creates a struct
- parport which is linked onto a list of known ports.
-
-
-
-
-
- parport calls the
- attach function of each registered device
- driver, passing it the pointer to the new struct
- parport.
-
-
-
-
-
- The device driver gets a handle from
- parport, for use with
- parport_claim/release.
- This handle takes the form of a pointer to a struct
- pardevice, representing a particular device on the
- parallel port, and is acquired using
- parport_register_device.
-
-
-
-
-
- The device driver claims the port using
- parport_claim (or
- function_claim_or_block).
-
-
-
-
-
- Then it goes ahead and uses the port. When finished it releases
- the port.
-
-
-
-
-
-
- The purpose of the low-level drivers, then, is to detect parallel
- ports and provide methods of accessing them (i.e. implementing the
- operations in struct
- parport_operations).
-
-
-
-
- A more complete description of which operation is supposed to do
- what is available in
- Documentation/parport-lowlevel.txt.
-
-
-
-
-
- The printer driver
-
-
-
-
-
- The printer driver, lp is a character special
- device driver and a parport client. As a
- character special device driver it registers a struct
- file_operations using
- register_chrdev, with pointers filled in for
- write, ioctl,
- open and
- release. As a client of
- parport, it registers a struct
- parport_driver using
- parport_register_driver, so that
- parport knows to call
- lp_attach when a new parallel port is
- discovered (and lp_detach when it goes
- away).
-
-
-
- The parallel port console functionality is also implemented in
- drivers/char/lp.c, but that won't be covered
- here (it's quite simple though).
-
-
-
- The initialisation of the driver is quite easy to understand (see
- lp_init). The lp_table is
- an array of structures that contain information about a specific
- device (the struct pardevice associated
- with it, for example). That array is initialised to sensible
- values first of all.
-
-
-
- Next, the printer driver calls register_chrdev
- passing it a pointer to lp_fops, which contains
- function pointers for the printer driver's implementation of
- open, write, and so on.
- This part is the same as for any character special device
- driver.
-
-
-
- After successfully registering itself as a character special device
- driver, the printer driver registers itself as a
- parport client using
- parport_register_driver. It passes a pointer
- to this structure:
-
-
-
-
-
-
- The lp_detach function is not very interesting
- (it does nothing); the interesting bit is
- lp_attach. What goes on here depends on
- whether the user supplied any parameters. The possibilities are:
- no parameters supplied, in which case the printer driver uses every
- port that is detected; the user supplied the parameter
- auto
, in which case only ports on which the device
- ID string indicates a printer is present are used; or the user
- supplied a list of parallel port numbers to try, in which case only
- those are used.
-
-
-
- For each port that the printer driver wants to use (see
- lp_register), it calls
- parport_register_device and stores the
- resulting struct pardevice pointer in the
- lp_table. If the user told it to do so, it then
- resets the printer.
-
-
-
- The other interesting piece of the printer driver, from the point
- of view of parport, is
- lp_write. In this function, the user space
- process has data that it wants printed, and the printer driver
- hands it off to the parport code to deal with.
-
-
-
- The parport functions it uses that we have not
- seen yet are parport_negotiate,
- parport_set_timeout, and
- parport_write. These functions are part of
- the IEEE 1284 implementation.
-
-
-
- The way the IEEE 1284 protocol works is that the host tells the
- peripheral what transfer mode it would like to use, and the
- peripheral either accepts that mode or rejects it; if the mode is
- rejected, the host can try again with a different mode. This is
- the negotiation phase. Once the peripheral has accepted a
- particular transfer mode, data transfer can begin that mode.
-
-
-
- The particular transfer mode that the printer driver wants to use
- is named in IEEE 1284 as compatibility
mode, and the
- function to request a particular mode is called
- parport_negotiate.
-
-
-
-
-#include <parport.h>
-
-
- int parport_negotiate
- struct parport *port
- int mode
-
-
-
-
- The modes parameter is a symbolic constant
- representing an IEEE 1284 mode; in this instance, it is
- IEEE1284_MODE_COMPAT. (Compatibility mode is
- slightly different to the other modes---rather than being
- specifically requested, it is the default until another mode is
- selected.)
-
-
-
- Back to lp_write then. First, access to the
- parallel port is secured with
- parport_claim_or_block. At this point the
- driver might sleep, waiting for another driver (perhaps a Zip drive
- driver, for instance) to let the port go. Next, it goes to
- compatibility mode using parport_negotiate.
-
-
-
- The main work is done in the write-loop. In particular, the line
- that hands the data over to parport reads:
-
-
-
-
-
-
- The parport_write function writes data to the
- peripheral using the currently selected transfer mode
- (compatibility mode, in this case). It returns the number of bytes
- successfully written:
-
-
-
-
-#include <parport.h>
-
-
- ssize_t parport_write
- struct parport *port
- const void *buf
- size_t len
-
-
-
-
-
- ssize_t parport_read
- struct parport *port
- void *buf
- size_t len
-
-
-
-
- (parport_read does what it sounds like, but
- only works for modes in which reverse transfer is possible. Of
- course, parport_write only works in modes in
- which forward transfer is possible, too.)
-
-
-
- The buf pointer should be to kernel space
- memory, and obviously the len parameter
- specifies the amount of data to transfer.
-
-
-
- In fact what parport_write does is call the
- appropriate block transfer function from the struct
- parport_operations:
-
-
-
-
-
-
- The transfer code in parport will tolerate a
- data transfer stall only for so long, and this timeout can be
- specified with parport_set_timeout, which
- returns the previous timeout:
-
-
-
-
-#include <parport.h>
-
-
- long parport_set_timeout
- struct pardevice *dev
- long inactivity
-
-
-
-
- This timeout is specific to the device, and is restored on
- parport_claim.
-
-
-
- The next function to look at is the one that allows processes to
- read from /dev/lp0:
- lp_read. It's short, like
- lp_write.
-
-
-
- The semantics of reading from a line printer device are as follows:
-
-
-
-
-
- Switch to reverse nibble mode.
-
-
-
-
-
- Try to read data from the peripheral using reverse nibble mode,
- until either the user-provided buffer is full or the peripheral
- indicates that there is no more data.
-
-
-
-
-
- If there was data, stop, and return it.
-
-
-
-
-
- Otherwise, we tried to read data and there was none. If the user
- opened the device node with the O_NONBLOCK
- flag, return. Otherwise wait until an interrupt occurs on the
- port (or a timeout elapses).
-
-
-
-
-
-
-
- User-level device drivers
-
-
-
- Introduction to ppdev
-
-
- The printer is accessible through /dev/lp0;
- in the same way, the parallel port itself is accessible through
- /dev/parport0. The difference is in the
- level of control that you have over the wires in the parallel port
- cable.
-
-
-
- With the printer driver, a user-space program (such as the printer
- spooler) can send bytes in printer protocol
.
- Briefly, this means that for each byte, the eight data lines are
- set up, then a strobe
line tells the printer to
- look at the data lines, and the printer sets an
- acknowledgement
line to say that it got the byte.
- The printer driver also allows the user-space program to read
- bytes in nibble mode
, which is a way of
- transferring data from the peripheral to the computer half a byte
- at a time (and so it's quite slow).
-
-
-
- In contrast, the ppdev driver (accessed via
- /dev/parport0) allows you to:
-
-
-
-
-
-
- examine status lines,
-
-
-
-
-
- set control lines,
-
-
-
-
-
- set/examine data lines (and control the direction of the data
- lines),
-
-
-
-
-
- wait for an interrupt (triggered by one of the status lines),
-
-
-
-
-
- find out how many new interrupts have occurred,
-
-
-
-
-
- set up a response to an interrupt,
-
-
-
-
-
- use IEEE 1284 negotiation (for telling peripheral which transfer
- mode, to use)
-
-
-
-
-
- transfer data using a specified IEEE 1284 mode.
-
-
-
-
-
-
-
-
- User-level or kernel-level driver?
-
-
- The decision of whether to choose to write a kernel-level device
- driver or a user-level device driver depends on several factors.
- One of the main ones from a practical point of view is speed:
- kernel-level device drivers get to run faster because they are not
- preemptable, unlike user-level applications.
-
-
-
- Another factor is ease of development. It is in general easier to
- write a user-level driver because (a) one wrong move does not
- result in a crashed machine, (b) you have access to user libraries
- (such as the C library), and (c) debugging is easier.
-
-
-
-
-
- Programming interface
-
-
- The ppdev interface is largely the same as that
- of other character special devices, in that it supports
- open, close,
- read, write, and
- ioctl. The constants for the
- ioctl commands are in
- include/linux/ppdev.h.
-
-
-
-
- Starting and stopping: open and
- close
-
-
-
- The device node /dev/parport0 represents any
- device that is connected to parport0, the
- first parallel port in the system. Each time the device node is
- opened, it represents (to the process doing the opening) a
- different device. It can be opened more than once, but only one
- instance can actually be in control of the parallel port at any
- time. A process that has opened
- /dev/parport0 shares the parallel port in
- the same way as any other device driver. A user-land driver may
- be sharing the parallel port with in-kernel device drivers as
- well as other user-land drivers.
-
-
-
-
- Control: ioctl
-
-
- Most of the control is done, naturally enough, via the
- ioctl call. Using
- ioctl, the user-land driver can control both
- the ppdev driver in the kernel and the
- physical parallel port itself. The ioctl
- call takes as parameters a file descriptor (the one returned from
- opening the device node), a command, and optionally (a pointer
- to) some data.
-
-
-
- PPCLAIM
-
-
-
- Claims access to the port. As a user-land device driver
- writer, you will need to do this before you are able to
- actually change the state of the parallel port in any way.
- Note that some operations only affect the
- ppdev driver and not the port, such as
- PPSETMODE; they can be performed while
- access to the port is not claimed.
-
-
-
-
- PPEXCL
-
-
-
- Instructs the kernel driver to forbid any sharing of the port
- with other drivers, i.e. it requests exclusivity. The
- PPEXCL command is only valid when the
- port is not already claimed for use, and it may mean that the
- next PPCLAIM ioctl
- will fail: some other driver may already have registered
- itself on that port.
-
-
-
- Most device drivers don't need exclusive access to the port.
- It's only provided in case it is really needed, for example
- for devices where access to the port is required for extensive
- periods of time (many seconds).
-
-
-
- Note that the PPEXCL
- ioctl doesn't actually claim the port
- there and then---action is deferred until the
- PPCLAIM ioctl is
- performed.
-
-
-
-
- PPRELEASE
-
-
-
- Releases the port. Releasing the port undoes the effect of
- claiming the port. It allows other device drivers to talk to
- their devices (assuming that there are any).
-
-
-
-
- PPYIELD
-
-
-
- Yields the port to another driver. This
- ioctl is a kind of short-hand for
- releasing the port and immediately reclaiming it. It gives
- other drivers a chance to talk to their devices, but
- afterwards claims the port back. An example of using this
- would be in a user-land printer driver: once a few characters
- have been written we could give the port to another device
- driver for a while, but if we still have characters to send to
- the printer we would want the port back as soon as possible.
-
-
-
- It is important not to claim the parallel port for too long,
- as other device drivers will have no time to service their
- devices. If your device does not allow for parallel port
- sharing at all, it is better to claim the parallel port
- exclusively (see PPEXCL).
-
-
-
-
- PPNEGOT
-
-
-
- Performs IEEE 1284 negotiation into a particular mode.
- Briefly, negotiation is the method by which the host and the
- peripheral decide on a protocol to use when transferring data.
-
-
-
- An IEEE 1284 compliant device will start out in compatibility
- mode, and then the host can negotiate to another mode (such as
- ECP).
-
-
-
- The ioctl parameter should be a pointer
- to an int; values for this are in
- incluce/linux/parport.h and include:
-
-
-
-
- IEEE1284_MODE_COMPAT
-
- IEEE1284_MODE_NIBBLE
-
- IEEE1284_MODE_BYTE
-
- IEEE1284_MODE_EPP
-
- IEEE1284_MODE_ECP
-
-
-
- The PPNEGOT ioctl
- actually does two things: it performs the on-the-wire
- negotiation, and it sets the behaviour of subsequent
- read/write calls so
- that they use that mode (but see
- PPSETMODE).
-
-
-
-
- PPSETMODE
-
-
-
- Sets which IEEE 1284 protocol to use for the
- read and write
- calls.
-
-
-
- The ioctl parameter should be a pointer
- to an int.
-
-
-
-
- PPGETMODE
-
-
-
- Retrieves the current IEEE 1284 mode to use for
- read and write.
-
-
-
-
- PPGETTIME
-
-
-
- Retrieves the time-out value. The read
- and write calls will time out if the
- peripheral doesn't respond quickly enough. The
- PPGETTIME ioctl
- retrieves the length of time that the peripheral is allowed to
- have before giving up.
-
-
-
- The ioctl parameter should be a pointer
- to a struct timeval.
-
-
-
-
- PPSETTIME
-
-
-
- Sets the time-out. The ioctl parameter
- should be a pointer to a struct
- timeval.
-
-
-
-
- PPGETMODES
-
-
-
- Retrieves the capabilities of the hardware (i.e. the
- modes field of the
- parport structure).
-
-
-
-
- PPSETFLAGS
-
-
-
- Sets flags on the ppdev device which can
- affect future I/O operations. Available flags are:
-
-
-
-
- PP_FASTWRITE
-
- PP_FASTREAD
-
- PP_W91284PIC
-
-
-
-
- PPWCONTROL
-
-
-
- Sets the control lines. The ioctl
- parameter is a pointer to an unsigned char, the
- bitwise OR of the control line values in
- include/linux/parport.h.
-
-
-
-
- PPRCONTROL
-
-
-
- Returns the last value written to the control register, in the
- form of an unsigned char: each bit corresponds to
- a control line (although some are unused). The
- ioctl parameter should be a pointer to an
- unsigned char.
-
-
-
- This doesn't actually touch the hardware; the last value
- written is remembered in software. This is because some
- parallel port hardware does not offer read access to the
- control register.
-
-
-
- The control lines bits are defined in
- include/linux/parport.h:
-
-
-
-
- PARPORT_CONTROL_STROBE
-
- PARPORT_CONTROL_AUTOFD
-
- PARPORT_CONTROL_SELECT
-
- PARPORT_CONTROL_INIT
-
-
-
-
- PPFCONTROL
-
-
-
- Frobs the control lines. Since a common operation is to
- change one of the control signals while leaving the others
- alone, it would be quite inefficient for the user-land driver
- to have to use PPRCONTROL, make the
- change, and then use PPWCONTROL. Of
- course, each driver could remember what state the control
- lines are supposed to be in (they are never changed by
- anything else), but in order to provide
- PPRCONTROL, ppdev
- must remember the state of the control lines anyway.
-
-
-
- The PPFCONTROL ioctl
- is for frobbing
control lines, and is like
- PPWCONTROL but acts on a restricted set
- of control lines. The ioctl parameter is
- a pointer to a struct
- ppdev_frob_struct:
-
-
-
-
-
-
-
- The mask and
- val fields are bitwise ORs of
- control line names (such as in
- PPWCONTROL). The operation performed by
- PPFCONTROL is:
-
-
-
-
-
-
-
- In other words, the signals named in
- mask are set to the values in
- val.
-
-
-
-
- PPRSTATUS
-
-
-
- Returns an unsigned char containing bits set for
- each status line that is set (for instance,
- PARPORT_STATUS_BUSY). The
- ioctl parameter should be a pointer to an
- unsigned char.
-
-
-
-
- PPDATADIR
-
-
-
- Controls the data line drivers. Normally the computer's
- parallel port will drive the data lines, but for byte-wide
- transfers from the peripheral to the host it is useful to turn
- off those drivers and let the peripheral drive the
- signals. (If the drivers on the computer's parallel port are
- left on when this happens, the port might be damaged.)
-
-
-
- This is only needed in conjunction with
- PPWDATA or
- PPRDATA.
-
-
-
- The ioctl parameter is a pointer to an
- int. If the int is zero, the
- drivers are turned on (forward direction); if non-zero, the
- drivers are turned off (reverse direction).
-
-
-
-
- PPWDATA
-
-
-
- Sets the data lines (if in forward mode). The
- ioctl parameter is a pointer to an
- unsigned char.
-
-
-
-
- PPRDATA
-
-
-
- Reads the data lines (if in reverse mode). The
- ioctl parameter is a pointer to an
- unsigned char.
-
-
-
-
- PPCLRIRQ
-
-
-
- Clears the interrupt count. The ppdev
- driver keeps a count of interrupts as they are triggered.
- PPCLRIRQ stores this count in an
- int, a pointer to which is passed in as the
- ioctl parameter.
-
-
-
- In addition, the interrupt count is reset to zero.
-
-
-
-
- PPWCTLONIRQ
-
-
-
- Set a trigger response. Afterwards when an interrupt is
- triggered, the interrupt handler will set the control lines as
- requested. The ioctl parameter is a
- pointer to an unsigned char, which is interpreted
- in the same way as for PPWCONTROL.
-
-
-
- The reason for this ioctl is simply
- speed. Without this ioctl, responding to
- an interrupt would start in the interrupt handler, switch
- context to the user-land driver via poll
- or select, and then switch context back
- to the kernel in order to handle
- PPWCONTROL. Doing the whole lot in the
- interrupt handler is a lot faster.
-
-
-
-
-
-
-
-
-
-
-
- Transferring data: read and
- write
-
-
- Transferring data using read and
- write is straightforward. The data is
- transferring using the current IEEE 1284 mode (see the
- PPSETMODE ioctl). For
- modes which can only transfer data in one direction, only the
- appropriate function will work, of course.
-
-
-
-
- Waiting for events: poll and
- select
-
-
- The ppdev driver provides user-land device
- drivers with the ability to wait for interrupts, and this is done
- using poll (and select,
- which is implemented in terms of poll).
-
-
-
- When a user-land device driver wants to wait for an interrupt, it
- sleeps with poll. When the interrupt
- arrives, ppdev wakes it up (with a
- read
event, although strictly speaking there is
- nothing to actually read).
-
-
-
-
-
-
-
- Examples
-
-
- Presented here are two demonstrations of how to write a simple
- printer driver for ppdev. Firstly we will
- use the write function, and after that we
- will drive the control and data lines directly.
-
-
-
- The first thing to do is to actually open the device.
-
-
-
-
-
- Here name should be something along the lines
- of "/dev/parport0". (If you don't have any
- /dev/parport files, you can make them with
- mknod; they are character special device nodes
- with major 99.)
-
-
-
- In order to do anything with the port we need to claim access to
- it.
-
-
-
-
-
- Our printer driver will copy its input (from
- stdin) to the printer, and it can do that it
- one of two ways. The first way is to hand it all off to the
- kernel driver, with the knowledge that the protocol that the
- printer speaks is IEEE 1284's compatibility
- mode.
-
-
- 0) {
- int written = write_printer (fd, ptr, got);
-
- if (written < 0) {
- perror ("write");
- close (fd);
- return 1;
- }
-
- ptr += written;
- got -= written;
- }
- }
- ]]>
-
-
- The write_printer function is not pictured
- above. This is because the main loop that is shown can be used
- for both methods of driving the printer. Here is one
- implementation of write_printer:
-
-
-
-
-
- We hand the data to the kernel-level driver (using
- write) and it handles the printer
- protocol.
-
-
-
- Now let's do it the hard way! In this particular example there is
- no practical reason to do anything other than just call
- write, because we know that the printer talks
- an IEEE 1284 protocol. On the other hand, this particular example
- does not even need a user-land driver since there is already a
- kernel-level one; for the purpose of this discussion, try to
- imagine that the printer speaks a protocol that is not already
- implemented under Linux.
-
-
-
- So, here is the alternative implementation of
- write_printer (for brevity, error checking
- has been omitted):
-
-
-
-
-
- To show a bit more of the ppdev interface,
- here is a small piece of code that is intended to mimic the
- printer's side of printer protocol.
-
-
- 1)
- fprintf (stderr, "Arghh! Missed %d interrupt%s!\n",
- irqc - 1, irqc == 2 ? "s" : "");
-
- /* Ack it. */
- ioctl (fd, PPWCONTROL, &acking);
- usleep (2);
- ioctl (fd, PPWCONTROL, &busy);
-
- putchar (ch);
- }
- ]]>
-
-
- And here is an example (with no error checking at all) to show how
- to read data from the port, using ECP mode, with optional
- negotiation to ECP mode first.
-
-
-
-
-
-
-
-
-
-
- Linux parallel port driver API reference
-
-
-!Fdrivers/parport/daisy.c parport_device_num
-!Fdrivers/parport/daisy.c parport_device_coords
-!Fdrivers/parport/daisy.c parport_find_device
-!Fdrivers/parport/daisy.c parport_find_class
-!Fdrivers/parport/share.c parport_register_driver
-!Fdrivers/parport/share.c parport_unregister_driver
-!Fdrivers/parport/share.c parport_get_port
-!Fdrivers/parport/share.c parport_put_port
-!Fdrivers/parport/share.c parport_find_number parport_find_base
-!Fdrivers/parport/share.c parport_register_device
-!Fdrivers/parport/share.c parport_unregister_device
-!Fdrivers/parport/daisy.c parport_open
-!Fdrivers/parport/daisy.c parport_close
-!Fdrivers/parport/share.c parport_claim
-!Fdrivers/parport/share.c parport_claim_or_block
-!Fdrivers/parport/share.c parport_release
-!Finclude/linux/parport.h parport_yield
-!Finclude/linux/parport.h parport_yield_blocking
-!Fdrivers/parport/ieee1284.c parport_negotiate
-!Fdrivers/parport/ieee1284.c parport_write
-!Fdrivers/parport/ieee1284.c parport_read
-!Fdrivers/parport/ieee1284.c parport_set_timeout
-
-
-
-
-
- The Linux 2.2 Parallel Port Subsystem
-
-
-
- Although the interface described in this document is largely new
- with the 2.4 kernel, the sharing mechanism is available in the 2.2
- kernel as well. The functions available in 2.2 are:
-
-
-
-
-
- parport_register_device
-
-
-
-
-
- parport_unregister_device
-
-
-
-
-
- parport_claim
-
-
-
-
-
- parport_claim_or_block
-
-
-
-
-
- parport_release
-
-
-
-
-
- parport_yield
-
-
-
-
-
- parport_yield_blocking
-
-
-
-
-
- In addition, negotiation to reverse nibble mode is supported:
-
-
-
-
- int parport_ieee1284_nibble_mode_ok
- struct parport *port
- unsigned char mode
-
-
-
-
- The only valid values for mode are 0 (for
- reverse nibble mode) and 4 (for Device ID in reverse nibble mode).
-
-
-
- This function is obsoleted by
- parport_negotiate in Linux 2.4, and has been
- removed.
-
-
-
-
-
- GNU Free Documentation License
-
-
-
- GNU Free Documentation License
- Version 1.1, March 2000
-
- Copyright (C) 2000 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-written document "free" in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The "Document", below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as "you".
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section entitled "History", and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. In any section entitled "Acknowledgements" or "Dedications",
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section as "Endorsements"
- or to conflict in title with any Invariant Section.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections entitled "History"
-in the various original documents, forming one section entitled
-"History"; likewise combine any sections entitled "Acknowledgements",
-and any sections entitled "Dedications". You must delete all sections
-entitled "Endorsements."
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an "aggregate", and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns. See
-http:///www.gnu.org/copyleft/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
- or any later version published by the Free Software Foundation;
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have no Invariant Sections, write "with no Invariant Sections"
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write "no Front-Cover Texts" instead of
-"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-
-
-
-
-
-
-
-
diff -Nru a/Documentation/DocBook/sis900.tmpl b/Documentation/DocBook/sis900.tmpl
--- a/Documentation/DocBook/sis900.tmpl Sun May 9 19:33:39 2004
+++ b/Documentation/DocBook/sis900.tmpl Sun May 9 19:33:39 2004
@@ -336,7 +336,7 @@
distribution. If you have to install the driver other than those bundled
in kernel release, you should have your driver file
sis900.c and sis900.h
-copied into /usr/src/linux/drivers/net/ first.
+copied into /usr/src/linux/drivers/net/ first.
There are two alternative ways to install the driver
diff -Nru a/Documentation/DocBook/via-audio.tmpl b/Documentation/DocBook/via-audio.tmpl
--- a/Documentation/DocBook/via-audio.tmpl Sun May 9 19:33:48 2004
+++ b/Documentation/DocBook/via-audio.tmpl Sun May 9 19:33:48 2004
@@ -227,7 +227,7 @@
Version 1.9.1
-
+
DSP read/write bugfixes from Thomas Sailer.
@@ -252,7 +252,7 @@
Version 1.1.15
-
+
Support for variable fragment size and variable fragment number (Rui
@@ -325,7 +325,7 @@
Version 1.1.14
-
+
Use VM_RESERVE when available, to eliminate unnecessary page faults.
@@ -337,7 +337,7 @@
Version 1.1.12
-
+
mmap bug fixes from Linus.
@@ -349,7 +349,7 @@
Version 1.1.11
-
+
Many more bug fixes. mmap enabled by default, but may still be buggy.
@@ -368,7 +368,7 @@
Version 1.1.10
-
+
Many bug fixes. mmap enabled by default, but may still be buggy.
@@ -380,7 +380,7 @@
Version 1.1.9
-
+
Redesign and rewrite audio playback implementation. (faster and smaller, hopefully)
@@ -478,7 +478,7 @@
Version 1.1.8
-
+
Clean up interrupt handler output. Fixes the following kernel error message:
@@ -501,7 +501,7 @@
Version 1.1.7
-
+
Fix module unload bug where mixer device left registered
@@ -514,7 +514,7 @@
Version 1.1.6
-
+
Rewrite via_set_rate to mimic ALSA basic AC97 rate setting
@@ -546,7 +546,7 @@
Version 1.1.5
-
+
Disable some overly-verbose debugging code
@@ -573,7 +573,7 @@
Version 1.1.4
-
+
Completed rewrite of driver. Eliminated SoundBlaster compatibility
diff -Nru a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl
--- a/Documentation/DocBook/videobook.tmpl Sun May 9 19:33:48 2004
+++ b/Documentation/DocBook/videobook.tmpl Sun May 9 19:33:48 2004
@@ -176,8 +176,8 @@
The types available are
- Device Types
-
+ Device Types
+
VFL_TYPE_RADIO>/dev/radio{n}>
@@ -299,8 +299,8 @@
allows the applications to find out what sort of a card they have found and
to figure out what they want to do about it. The fields in the structure are
- struct video_capability fields
-
+ struct video_capability fields
+
name>The device text name. This is intended for the user.>
@@ -373,8 +373,8 @@
The video_tuner structure has the following fields
- struct video_tuner fields
-
+ struct video_tuner fields
+
int tuner>The number of the tuner in question
@@ -406,8 +406,8 @@
- struct video_tuner flags
-
+ struct video_tuner flags
+
VIDEO_TUNER_PAL>A PAL TV tuner
@@ -429,8 +429,8 @@
- struct video_tuner modes
-
+ struct video_tuner modes
+
VIDEO_MODE_PAL>PAL Format
@@ -580,8 +580,8 @@
Then we fill in the video_audio structure. This has the following format
- struct video_audio fields
-
+ struct video_audio fields
+
audio>The input the user wishes to query>
@@ -615,8 +615,8 @@
- struct video_audio flags
-
+ struct video_audio flags
+
VIDEO_AUDIO_MUTE>The audio is currently muted. We
@@ -633,8 +633,8 @@
- struct video_audio modes
-
+ struct video_audio modes
+
VIDEO_SOUND_MONO>Mono sound
@@ -862,8 +862,8 @@
We use the extra video capability flags that did not apply to the
radio interface. The video related flags are
- Capture Capabilities
-
+ Capture Capabilities
+
VID_TYPE_CAPTURE>We support image capture>
@@ -1204,8 +1204,8 @@
inputs to the video card). Our example card has a single camera input. The
fields in the structure are
- struct video_channel fields
-
+ struct video_channel fields
+
@@ -1227,8 +1227,8 @@
- struct video_channel flags
-
+ struct video_channel flags
+
VIDEO_VC_TUNER>Channel has a tuner.
@@ -1238,8 +1238,8 @@
- struct video_channel types
-
+ struct video_channel types
+
VIDEO_TYPE_TV>Television input.
@@ -1251,8 +1251,8 @@
- struct video_channel norms
-
+ struct video_channel norms
+
VIDEO_MODE_PAL>PAL encoded Television
@@ -1337,8 +1337,8 @@
for every other pixel in the image. The other common formats the interface
defines are
- Framebuffer Encodings
-
+ Framebuffer Encodings
+
GREY>Linear greyscale. This is for simple cameras and the
@@ -1475,8 +1475,8 @@
display. The video_window structure is used to describe the way the image
should be displayed.
- struct video_window fields
-
+ struct video_window fields
+
width>The width in pixels of the desired image. The card
@@ -1512,8 +1512,8 @@
Each clip is a struct video_clip which has the following fields
- video_clip fields
-
+ video_clip fields
+
x, y>Co-ordinates relative to the display>
diff -Nru a/Documentation/IPMI.txt b/Documentation/IPMI.txt
--- a/Documentation/IPMI.txt Sun May 9 19:33:35 2004
+++ b/Documentation/IPMI.txt Sun May 9 19:33:35 2004
@@ -22,6 +22,58 @@
http://www.intel.com/design/servers/ipmi/index.htm. IPMI is a big
subject and I can't cover it all here!
+Configuration
+-------------
+
+The LinuxIPMI driver is modular, which means you have to pick several
+things to have it work right depending on your hardware. Most of
+these are available in the 'Character Devices' menu.
+
+No matter what, you must pick 'IPMI top-level message handler' to use
+IPMI. What you do beyond that depends on your needs and hardware.
+
+The message handler does not provide any user-level interfaces.
+Kernel code (like the watchdog) can still use it. If you need access
+from userland, you need to select 'Device interface for IPMI' if you
+want access through a device driver. Another interface is also
+available, you may select 'IPMI sockets' in the 'Networking Support'
+main menu. This provides a socket interface to IPMI. You may select
+both of these at the same time, they will both work together.
+
+The driver interface depends on your hardware. If you have a board
+with a standard interface (These will generally be either "KCS",
+"SMIC", or "BT", consult your hardware manual), choose the 'IPMI SI
+handler' option. A driver also exists for direct I2C access to the
+IPMI management controller. Some boards support this, but it is
+unknown if it will work on every board. For this, choose 'IPMI SMBus
+handler', but be ready to try to do some figuring to see if it will
+work.
+
+There is also a KCS-only driver interface supplied, but it is
+depracated in favor of the SI interface.
+
+You should generally enable ACPI on your system, as systems with IPMI
+should have ACPI tables describing them.
+
+If you have a standard interface and the board manufacturer has done
+their job correctly, the IPMI controller should be automatically
+detect (via ACPI or SMBIOS tables) and should just work. Sadly, many
+boards do not have this information. The driver attempts standard
+defaults, but they may not work. If you fall into this situation, you
+need to read the section below named 'The SI Driver' on how to
+hand-configure your system.
+
+IPMI defines a standard watchdog timer. You can enable this with the
+'IPMI Watchdog Timer' config option. If you compile the driver into
+the kernel, then via a kernel command-line option you can have the
+watchdog timer start as soon as it intitializes. It also have a lot
+of other options, see the 'Watchdog' section below for more details.
+Note that you can also have the watchdog continue to run if it is
+closed (by default it is disabled on close). Go into the 'Watchdog
+Cards' menu, enable 'Watchdog Timer Support', and enable the option
+'Disable watchdog shutdown on close'.
+
+
Basic Design
------------
@@ -41,18 +93,30 @@
driver, each open file for this device ties in to the message handler
as an IPMI user.
-ipmi_kcs_drv - A driver for the KCS SMI. Most system have a KCS
-interface for IPMI.
+ipmi_si - A driver for various system interfaces. This supports
+KCS, SMIC, and may support BT in the future. Unless you have your own
+custom interface, you probably need to use this.
+
+ipmi_smb - A driver for accessing BMCs on the SMBus. It uses the
+I2C kernel driver's SMBus interfaces to send and receive IPMI messages
+over the SMBus.
+af_ipmi - A network socket interface to IPMI. This doesn't take up
+a character device in your system.
+
+Note that the KCS-only interface ahs been removed.
Much documentation for the interface is in the include files. The
IPMI include files are:
-ipmi.h - Contains the user interface and IOCTL interface for IPMI.
+net/af_ipmi.h - Contains the socket interface.
+
+linux/ipmi.h - Contains the user interface and IOCTL interface for IPMI.
-ipmi_smi.h - Contains the interface for SMI drivers to use.
+linux/ipmi_smi.h - Contains the interface for system management interfaces
+(things that interface to IPMI controllers) to use.
-ipmi_msgdefs.h - General definitions for base IPMI messaging.
+linux/ipmi_msgdefs.h - General definitions for base IPMI messaging.
Addressing
@@ -260,70 +324,131 @@
in the order they register, although if an SMI unregisters and then
another one registers, all bets are off.
-The ipmi_smi.h defines the interface for SMIs, see that for more
-details.
+The ipmi_smi.h defines the interface for management interfaces, see
+that for more details.
-The KCS Driver
---------------
+The SI Driver
+-------------
-The KCS driver allows up to 4 KCS interfaces to be configured in the
-system. By default, the driver will register one KCS interface at the
-spec-specified I/O port 0xca2 without interrupts. You can change this
-at module load time (for a module) with:
+The SI driver allows up to 4 KCS or SMIC interfaces to be configured
+in the system. By default, scan the ACPI tables for interfaces, and
+if it doesn't find any the driver will attempt to register one KCS
+interface at the spec-specified I/O port 0xca2 without interrupts.
+You can change this at module load time (for a module) with:
- insmod ipmi_kcs_drv.o kcs_ports=,... kcs_addrs=,
- kcs_irqs=,... kcs_trydefaults=[0|1]
+ modprobe ipmi_si.o type=,....
+ ports=,... addrs=,...
+ irqs=,... trydefaults=[0|1]
-The KCS driver supports two types of interfaces, ports (for I/O port
-based KCS interfaces) and memory addresses (for KCS interfaces in
-memory). The driver will support both of them simultaneously, setting
-the port to zero (or just not specifying it) will allow the memory
-address to be used. The port will override the memory address if it
-is specified and non-zero. kcs_trydefaults sets whether the standard
-IPMI interface at 0xca2 and any interfaces specified by ACPE are
-tried. By default, the driver tries it, set this value to zero to
-turn this off.
+Each of these except si_trydefaults is a list, the first item for the
+first interface, second item for the second interface, etc.
+
+The si_type may be either "kcs", "smic", or "bt". If you leave it blank, it
+defaults to "kcs".
+
+If you specify si_addrs as non-zero for an interface, the driver will
+use the memory address given as the address of the device. This
+overrides si_ports.
+
+If you specify si_ports as non-zero for an interface, the driver will
+use the I/O port given as the device address.
+
+If you specify si_irqs as non-zero for an interface, the driver will
+attempt to use the given interrupt for the device.
+
+si_trydefaults sets whether the standard IPMI interface at 0xca2 and
+any interfaces specified by ACPE are tried. By default, the driver
+tries it, set this value to zero to turn this off.
When compiled into the kernel, the addresses can be specified on the
kernel command line as:
- ipmi_kcs=:,:....,[nodefault]
-
-The values is either "p" or "m" for port or memory
-addresses. So for instance, a KCS interface at port 0xca2 using
-interrupt 9 and a memory interface at address 0xf9827341 with no
-interrupt would be specified "ipmi_kcs=p0xca2:9,m0xf9827341".
-If you specify zero for in irq or don't specify it, the driver will
-run polled unless the software can detect the interrupt to use in the
-ACPI tables.
-
-By default, the driver will attempt to detect a KCS device at the
-spec-specified 0xca2 address and any address specified by ACPI. If
-you want to turn this off, use the "nodefault" option.
+ ipmi_si.type=,...
+ ipmi_si.ports=,... ipmi_si.addrs=,...
+ ipmi_si.irqs=,... ipmi_si.trydefaults=[0|1]
+
+It works the same as the module parameters of the same names.
+
+By default, the driver will attempt to detect any device specified by
+ACPI, and if none of those then a KCS device at the spec-specified
+0xca2. If you want to turn this off, set the "trydefaults" option to
+false.
If you have high-res timers compiled into the kernel, the driver will
use them to provide much better performance. Note that if you do not
have high-res timers enabled in the kernel and you don't have
interrupts enabled, the driver will run VERY slowly. Don't blame me,
-the KCS interface sucks.
+these interfaces suck.
+
+
+The SMBus Driver
+----------------
+
+The SMBus driver allows up to 4 SMBus devices to be configured in the
+system. By default, the driver will register any SMBus interfaces it finds
+in the I2C address range of 0x20 to 0x4f on any adapter. You can change this
+at module load time (for a module) with:
+
+ modprobe ipmi_smb.o
+ addr=,[,,[,...]]
+ dbg=,...
+ [defaultprobe=0] [dbg_probe=1]
+
+The addresses are specified in pairs, the first is the adapter ID and the
+second is the I2C address on that adapter.
+
+The debug flags are bit flags for each BMC found, they are:
+IPMI messages: 1, driver state: 2, timing: 4, I2C probe: 8
+
+Setting smb_defaultprobe to zero disabled the default probing of SMBus
+interfaces at address range 0x20 to 0x4f. This means that only the
+BMCs specified on the smb_addr line will be detected.
+
+Setting smb_dbg_probe to 1 will enable debugging of the probing and
+detection process for BMCs on the SMBusses.
+
+Discovering the IPMI compilant BMC on the SMBus can cause devices
+on the I2C bus to fail. The SMBus driver writes a "Get Device ID" IPMI
+message as a block write to the I2C bus and waits for a response.
+This action can be detrimental to some I2C devices. It is highly recommended
+that the known I2c address be given to the SMBus driver in the smb_addr
+parameter. The default adrress range will not be used when a smb_addr
+parameter is provided.
+
+When compiled into the kernel, the addresses can be specified on the
+kernel command line as:
+
+ ipmb_smb.addr=,[,,[,...]]
+ ipmi_smb.dbg=,...
+ ipmi_smb.defaultprobe=0 ipmi_smb.dbg_probe=1
+
+These are the same options as on the module command line.
+
+Note that you might need some I2C changes if CONFIG_IPMI_PANIC_EVENT
+is enabled along with this, so the I2C driver knows to run to
+completion during sending a panic event.
Other Pieces
------------
Watchdog
+--------
A watchdog timer is provided that implements the Linux-standard
watchdog timer interface. It has three module parameters that can be
used to control it:
- insmod ipmi_watchdog timeout= pretimeout= action=
- preaction= preop=
+ modprobe ipmi_watchdog timeout=