aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
commitf0cd91a68acdc9b49d7f6738b514a426da627649 (patch)
tree8ad73564015794197583b094217ae0a71e71e753 /Documentation
parent60eef25701d25e99c991dd0f4a9f3832a0c3ad3e (diff)
parent128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff)
Merge ../linux-2.6
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/DMA-API.txt49
-rw-r--r--Documentation/DMA-mapping.txt22
-rw-r--r--Documentation/HOWTO3
-rw-r--r--Documentation/block/switching-sched.txt22
-rw-r--r--Documentation/cpu-freq/index.txt2
-rw-r--r--Documentation/devices.txt5
-rw-r--r--Documentation/dvb/get_dvb_firmware8
-rw-r--r--Documentation/feature-removal-schedule.txt14
-rw-r--r--Documentation/filesystems/sysfs.txt5
-rw-r--r--Documentation/firmware_class/README17
-rw-r--r--Documentation/firmware_class/firmware_sample_driver.c11
-rw-r--r--Documentation/i2c/busses/i2c-parport16
-rw-r--r--Documentation/memory-barriers.txt4
-rw-r--r--Documentation/networking/operstates.txt161
-rw-r--r--Documentation/networking/xfrm_sync.txt166
-rw-r--r--Documentation/pci.txt12
-rw-r--r--Documentation/power/video.txt2
-rw-r--r--Documentation/scsi/ChangeLog.megaraid25
-rw-r--r--Documentation/serial/driver31
-rw-r--r--Documentation/sound/alsa/Audiophile-Usb.txt81
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl4
-rw-r--r--Documentation/spi/pxa2xx234
-rw-r--r--Documentation/spi/spi-summary34
-rw-r--r--Documentation/vm/hugetlbpage.txt11
-rw-r--r--Documentation/watchdog/watchdog-api.txt3
25 files changed, 834 insertions, 108 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 1af0f2d50220..2ffb0d62f0fe 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -33,7 +33,9 @@ pci_alloc_consistent(struct pci_dev *dev, size_t size,
33 33
34Consistent memory is memory for which a write by either the device or 34Consistent memory is memory for which a write by either the device or
35the processor can immediately be read by the processor or device 35the processor can immediately be read by the processor or device
36without having to worry about caching effects. 36without having to worry about caching effects. (You may however need
37to make sure to flush the processor's write buffers before telling
38devices to read that memory.)
37 39
38This routine allocates a region of <size> bytes of consistent memory. 40This routine allocates a region of <size> bytes of consistent memory.
39it also returns a <dma_handle> which may be cast to an unsigned 41it also returns a <dma_handle> which may be cast to an unsigned
@@ -304,12 +306,12 @@ dma address with dma_mapping_error(). A non zero return value means the mapping
304could not be created and the driver should take appropriate action (eg 306could not be created and the driver should take appropriate action (eg
305reduce current DMA mapping usage or delay and try again later). 307reduce current DMA mapping usage or delay and try again later).
306 308
307int 309 int
308dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 310 dma_map_sg(struct device *dev, struct scatterlist *sg,
309 enum dma_data_direction direction) 311 int nents, enum dma_data_direction direction)
310int 312 int
311pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, 313 pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
312 int nents, int direction) 314 int nents, int direction)
313 315
314Maps a scatter gather list from the block layer. 316Maps a scatter gather list from the block layer.
315 317
@@ -327,12 +329,33 @@ critical that the driver do something, in the case of a block driver
327aborting the request or even oopsing is better than doing nothing and 329aborting the request or even oopsing is better than doing nothing and
328corrupting the filesystem. 330corrupting the filesystem.
329 331
330void 332With scatterlists, you use the resulting mapping like this:
331dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 333
332 enum dma_data_direction direction) 334 int i, count = dma_map_sg(dev, sglist, nents, direction);
333void 335 struct scatterlist *sg;
334pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, 336
335 int nents, int direction) 337 for (i = 0, sg = sglist; i < count; i++, sg++) {
338 hw_address[i] = sg_dma_address(sg);
339 hw_len[i] = sg_dma_len(sg);
340 }
341
342where nents is the number of entries in the sglist.
343
344The implementation is free to merge several consecutive sglist entries
345into one (e.g. with an IOMMU, or if several pages just happen to be
346physically contiguous) and returns the actual number of sg entries it
347mapped them to. On failure 0, is returned.
348
349Then you should loop count times (note: this can be less than nents times)
350and use sg_dma_address() and sg_dma_len() macros where you previously
351accessed sg->address and sg->length as shown above.
352
353 void
354 dma_unmap_sg(struct device *dev, struct scatterlist *sg,
355 int nhwentries, enum dma_data_direction direction)
356 void
357 pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
358 int nents, int direction)
336 359
337unmap the previously mapped scatter/gather list. All the parameters 360unmap the previously mapped scatter/gather list. All the parameters
338must be the same as those and passed in to the scatter/gather mapping 361must be the same as those and passed in to the scatter/gather mapping
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index 10bf4deb96aa..7c717699032c 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -58,11 +58,15 @@ translating each of those pages back to a kernel address using
58something like __va(). [ EDIT: Update this when we integrate 58something like __va(). [ EDIT: Update this when we integrate
59Gerd Knorr's generic code which does this. ] 59Gerd Knorr's generic code which does this. ]
60 60
61This rule also means that you may not use kernel image addresses 61This rule also means that you may use neither kernel image addresses
62(ie. items in the kernel's data/text/bss segment, or your driver's) 62(items in data/text/bss segments), nor module image addresses, nor
63nor may you use kernel stack addresses for DMA. Both of these items 63stack addresses for DMA. These could all be mapped somewhere entirely
64might be mapped somewhere entirely different than the rest of physical 64different than the rest of physical memory. Even if those classes of
65memory. 65memory could physically work with DMA, you'd need to ensure the I/O
66buffers were cacheline-aligned. Without that, you'd see cacheline
67sharing problems (data corruption) on CPUs with DMA-incoherent caches.
68(The CPU could write to one word, DMA would write to a different one
69in the same cache line, and one of them could be overwritten.)
66 70
67Also, this means that you cannot take the return of a kmap() 71Also, this means that you cannot take the return of a kmap()
68call and DMA to/from that. This is similar to vmalloc(). 72call and DMA to/from that. This is similar to vmalloc().
@@ -284,6 +288,11 @@ There are two types of DMA mappings:
284 288
285 in order to get correct behavior on all platforms. 289 in order to get correct behavior on all platforms.
286 290
291 Also, on some platforms your driver may need to flush CPU write
292 buffers in much the same way as it needs to flush write buffers
293 found in PCI bridges (such as by reading a register's value
294 after writing it).
295
287- Streaming DMA mappings which are usually mapped for one DMA transfer, 296- Streaming DMA mappings which are usually mapped for one DMA transfer,
288 unmapped right after it (unless you use pci_dma_sync_* below) and for which 297 unmapped right after it (unless you use pci_dma_sync_* below) and for which
289 hardware can optimize for sequential accesses. 298 hardware can optimize for sequential accesses.
@@ -303,6 +312,9 @@ There are two types of DMA mappings:
303 312
304Neither type of DMA mapping has alignment restrictions that come 313Neither type of DMA mapping has alignment restrictions that come
305from PCI, although some devices may have such restrictions. 314from PCI, although some devices may have such restrictions.
315Also, systems with caches that aren't DMA-coherent will work better
316when the underlying buffers don't share cache lines with other data.
317
306 318
307 Using Consistent DMA mappings. 319 Using Consistent DMA mappings.
308 320
diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 6c9e746267da..915ae8c986c6 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -603,7 +603,8 @@ start exactly where you are now.
603 603
604 604
605---------- 605----------
606Thanks to Paolo Ciarrocchi who allowed the "Development Process" section 606Thanks to Paolo Ciarrocchi who allowed the "Development Process"
607(http://linux.tar.bz/articles/2.6-development_process) section
607to be based on text he had written, and to Randy Dunlap and Gerrit 608to be based on text he had written, and to Randy Dunlap and Gerrit
608Huizenga for some of the list of things you should and should not say. 609Huizenga for some of the list of things you should and should not say.
609Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers, 610Also thanks to Pat Mochel, Hanna Linder, Randy Dunlap, Kay Sievers,
diff --git a/Documentation/block/switching-sched.txt b/Documentation/block/switching-sched.txt
new file mode 100644
index 000000000000..5fa130a67531
--- /dev/null
+++ b/Documentation/block/switching-sched.txt
@@ -0,0 +1,22 @@
1As of the Linux 2.6.10 kernel, it is now possible to change the
2IO scheduler for a given block device on the fly (thus making it possible,
3for instance, to set the CFQ scheduler for the system default, but
4set a specific device to use the anticipatory or noop schedulers - which
5can improve that device's throughput).
6
7To set a specific scheduler, simply do this:
8
9echo SCHEDNAME > /sys/block/DEV/queue/scheduler
10
11where SCHEDNAME is the name of a defined IO scheduler, and DEV is the
12device name (hda, hdb, sga, or whatever you happen to have).
13
14The list of defined schedulers can be found by simply doing
15a "cat /sys/block/DEV/queue/scheduler" - the list of valid names
16will be displayed, with the currently selected scheduler in brackets:
17
18# cat /sys/block/hda/queue/scheduler
19noop anticipatory deadline [cfq]
20# echo anticipatory > /sys/block/hda/queue/scheduler
21# cat /sys/block/hda/queue/scheduler
22noop [anticipatory] deadline cfq
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt
index 5009805f9378..ffdb5323df37 100644
--- a/Documentation/cpu-freq/index.txt
+++ b/Documentation/cpu-freq/index.txt
@@ -53,4 +53,4 @@ the CPUFreq Mailing list:
53* http://lists.linux.org.uk/mailman/listinfo/cpufreq 53* http://lists.linux.org.uk/mailman/listinfo/cpufreq
54 54
55Clock and voltage scaling for the SA-1100: 55Clock and voltage scaling for the SA-1100:
56* http://www.lart.tudelft.nl/projects/scaling 56* http://www.lartmaker.nl/projects/scaling
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 3c406acd4dfa..b369a8c46a73 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -1721,11 +1721,6 @@ Your cooperation is appreciated.
1721 These devices support the same API as the generic SCSI 1721 These devices support the same API as the generic SCSI
1722 devices. 1722 devices.
1723 1723
1724 97 block Packet writing for CD/DVD devices
1725 0 = /dev/pktcdvd0 First packet-writing module
1726 1 = /dev/pktcdvd1 Second packet-writing module
1727 ...
1728
1729 98 char Control and Measurement Device (comedi) 1724 98 char Control and Measurement Device (comedi)
1730 0 = /dev/comedi0 First comedi device 1725 0 = /dev/comedi0 First comedi device
1731 1 = /dev/comedi1 Second comedi device 1726 1 = /dev/comedi1 Second comedi device
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
index 15fc8fbef67e..4820366b6ae8 100644
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -259,9 +259,9 @@ sub dibusb {
259} 259}
260 260
261sub nxt2002 { 261sub nxt2002 {
262 my $sourcefile = "Broadband4PC_4_2_11.zip"; 262 my $sourcefile = "Technisat_DVB-PC_4_4_COMPACT.zip";
263 my $url = "http://www.bbti.us/download/windows/$sourcefile"; 263 my $url = "http://www.bbti.us/download/windows/$sourcefile";
264 my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; 264 my $hash = "476befae8c7c1bb9648954060b1eec1f";
265 my $outfile = "dvb-fe-nxt2002.fw"; 265 my $outfile = "dvb-fe-nxt2002.fw";
266 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); 266 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
267 267
@@ -269,8 +269,8 @@ sub nxt2002 {
269 269
270 wgetfile($sourcefile, $url); 270 wgetfile($sourcefile, $url);
271 unzip($sourcefile, $tmpdir); 271 unzip($sourcefile, $tmpdir);
272 verify("$tmpdir/SkyNETU.sys", $hash); 272 verify("$tmpdir/SkyNET.sys", $hash);
273 extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); 273 extract("$tmpdir/SkyNET.sys", 331624, 5908, $outfile);
274 274
275 $outfile; 275 $outfile;
276} 276}
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 293fed113dff..43ab119963d5 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -25,8 +25,9 @@ Who: Adrian Bunk <bunk@stusta.de>
25 25
26--------------------------- 26---------------------------
27 27
28What: drivers depending on OBSOLETE_OSS_DRIVER 28What: drivers that were depending on OBSOLETE_OSS_DRIVER
29When: January 2006 29 (config options already removed)
30When: before 2.6.19
30Why: OSS drivers with ALSA replacements 31Why: OSS drivers with ALSA replacements
31Who: Adrian Bunk <bunk@stusta.de> 32Who: Adrian Bunk <bunk@stusta.de>
32 33
@@ -56,6 +57,15 @@ Who: Jody McIntyre <scjody@steamballoon.com>
56 57
57--------------------------- 58---------------------------
58 59
60What: sbp2: module parameter "force_inquiry_hack"
61When: July 2006
62Why: Superceded by parameter "workarounds". Both parameters are meant to be
63 used ad-hoc and for single devices only, i.e. not in modprobe.conf,
64 therefore the impact of this feature replacement should be low.
65Who: Stefan Richter <stefanr@s5r6.in-berlin.de>
66
67---------------------------
68
59What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. 69What: Video4Linux API 1 ioctls and video_decoder.h from Video devices.
60When: July 2006 70When: July 2006
61Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 71Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index c8bce82ddcac..89b1d196ca80 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -246,6 +246,7 @@ class/
246devices/ 246devices/
247firmware/ 247firmware/
248net/ 248net/
249fs/
249 250
250devices/ contains a filesystem representation of the device tree. It maps 251devices/ contains a filesystem representation of the device tree. It maps
251directly to the internal kernel device tree, which is a hierarchy of 252directly to the internal kernel device tree, which is a hierarchy of
@@ -264,6 +265,10 @@ drivers/ contains a directory for each device driver that is loaded
264for devices on that particular bus (this assumes that drivers do not 265for devices on that particular bus (this assumes that drivers do not
265span multiple bus types). 266span multiple bus types).
266 267
268fs/ contains a directory for some filesystems. Currently each
269filesystem wanting to export attributes must create its own hierarchy
270below fs/ (see ./fuse.txt for an example).
271
267 272
268More information can driver-model specific features can be found in 273More information can driver-model specific features can be found in
269Documentation/driver-model/. 274Documentation/driver-model/.
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index 43e836c07ae8..e9cc8bb26f7d 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -105,20 +105,3 @@
105 on the setup, so I think that the choice on what firmware to make 105 on the setup, so I think that the choice on what firmware to make
106 persistent should be left to userspace. 106 persistent should be left to userspace.
107 107
108 - Why register_firmware()+__init can be useful:
109 - For boot devices needing firmware.
110 - To make the transition easier:
111 The firmware can be declared __init and register_firmware()
112 called on module_init. Then the firmware is warranted to be
113 there even if "firmware hotplug userspace" is not there yet or
114 it doesn't yet provide the needed firmware.
115 Once the firmware is widely available in userspace, it can be
116 removed from the kernel. Or made optional (CONFIG_.*_FIRMWARE).
117
118 In either case, if firmware hotplug support is there, it can move the
119 firmware out of kernel memory into the real filesystem for later
120 usage.
121
122 Note: If persistence is implemented on top of initramfs,
123 register_firmware() may not be appropriate.
124
diff --git a/Documentation/firmware_class/firmware_sample_driver.c b/Documentation/firmware_class/firmware_sample_driver.c
index ad3edaba4533..87feccdb5c9f 100644
--- a/Documentation/firmware_class/firmware_sample_driver.c
+++ b/Documentation/firmware_class/firmware_sample_driver.c
@@ -5,8 +5,6 @@
5 * 5 *
6 * Sample code on how to use request_firmware() from drivers. 6 * Sample code on how to use request_firmware() from drivers.
7 * 7 *
8 * Note that register_firmware() is currently useless.
9 *
10 */ 8 */
11 9
12#include <linux/module.h> 10#include <linux/module.h>
@@ -17,11 +15,6 @@
17 15
18#include "linux/firmware.h" 16#include "linux/firmware.h"
19 17
20#define WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
21#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
22char __init inkernel_firmware[] = "let's say that this is firmware\n";
23#endif
24
25static struct device ghost_device = { 18static struct device ghost_device = {
26 .bus_id = "ghost0", 19 .bus_id = "ghost0",
27}; 20};
@@ -104,10 +97,6 @@ static void sample_probe_async(void)
104 97
105static int sample_init(void) 98static int sample_init(void)
106{ 99{
107#ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE
108 register_firmware("sample_driver_fw", inkernel_firmware,
109 sizeof(inkernel_firmware));
110#endif
111 device_initialize(&ghost_device); 100 device_initialize(&ghost_device);
112 /* since there is no real hardware insertion I just call the 101 /* since there is no real hardware insertion I just call the
113 * sample probe functions here */ 102 * sample probe functions here */
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport
index d9f23c0763f1..77b995dfca22 100644
--- a/Documentation/i2c/busses/i2c-parport
+++ b/Documentation/i2c/busses/i2c-parport
@@ -12,18 +12,22 @@ meant as a replacement for the older, individual drivers:
12 teletext adapters) 12 teletext adapters)
13 13
14It currently supports the following devices: 14It currently supports the following devices:
15 * Philips adapter 15 * (type=0) Philips adapter
16 * home brew teletext adapter 16 * (type=1) home brew teletext adapter
17 * Velleman K8000 adapter 17 * (type=2) Velleman K8000 adapter
18 * ELV adapter 18 * (type=3) ELV adapter
19 * Analog Devices evaluation boards (ADM1025, ADM1030, ADM1031, ADM1032) 19 * (type=4) Analog Devices ADM1032 evaluation board
20 * Barco LPT->DVI (K5800236) adapter 20 * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
21 * (type=6) Barco LPT->DVI (K5800236) adapter
21 22
22These devices use different pinout configurations, so you have to tell 23These devices use different pinout configurations, so you have to tell
23the driver what you have, using the type module parameter. There is no 24the driver what you have, using the type module parameter. There is no
24way to autodetect the devices. Support for different pinout configurations 25way to autodetect the devices. Support for different pinout configurations
25can be easily added when needed. 26can be easily added when needed.
26 27
28Earlier kernels defaulted to type=0 (Philips). But now, if the type
29parameter is missing, the driver will simply fail to initialize.
30
27 31
28Building your own adapter 32Building your own adapter
29------------------------- 33-------------------------
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 92f0056d928c..c61d8b876fdb 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -1031,7 +1031,7 @@ conflict on any particular lock.
1031LOCKS VS MEMORY ACCESSES 1031LOCKS VS MEMORY ACCESSES
1032------------------------ 1032------------------------
1033 1033
1034Consider the following: the system has a pair of spinlocks (N) and (Q), and 1034Consider the following: the system has a pair of spinlocks (M) and (Q), and
1035three CPUs; then should the following sequence of events occur: 1035three CPUs; then should the following sequence of events occur:
1036 1036
1037 CPU 1 CPU 2 1037 CPU 1 CPU 2
@@ -1678,7 +1678,7 @@ CPU's caches by some other cache event:
1678 smp_wmb(); 1678 smp_wmb();
1679 <A:modify v=2> <C:busy> 1679 <A:modify v=2> <C:busy>
1680 <C:queue v=2> 1680 <C:queue v=2>
1681 p = &b; q = p; 1681 p = &v; q = p;
1682 <D:request p> 1682 <D:request p>
1683 <B:modify p=&v> <D:commit p=&v> 1683 <B:modify p=&v> <D:commit p=&v>
1684 <D:read p> 1684 <D:read p>
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt
new file mode 100644
index 000000000000..4a21d9bb836b
--- /dev/null
+++ b/Documentation/networking/operstates.txt
@@ -0,0 +1,161 @@
1
21. Introduction
3
4Linux distinguishes between administrative and operational state of an
5interface. Admininstrative state is the result of "ip link set dev
6<dev> up or down" and reflects whether the administrator wants to use
7the device for traffic.
8
9However, an interface is not usable just because the admin enabled it
10- ethernet requires to be plugged into the switch and, depending on
11a site's networking policy and configuration, an 802.1X authentication
12to be performed before user data can be transferred. Operational state
13shows the ability of an interface to transmit this user data.
14
15Thanks to 802.1X, userspace must be granted the possibility to
16influence operational state. To accommodate this, operational state is
17split into two parts: Two flags that can be set by the driver only, and
18a RFC2863 compatible state that is derived from these flags, a policy,
19and changeable from userspace under certain rules.
20
21
222. Querying from userspace
23
24Both admin and operational state can be queried via the netlink
25operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK
26to be notified of updates. This is important for setting from userspace.
27
28These values contain interface state:
29
30ifinfomsg::if_flags & IFF_UP:
31 Interface is admin up
32ifinfomsg::if_flags & IFF_RUNNING:
33 Interface is in RFC2863 operational state UP or UNKNOWN. This is for
34 backward compatibility, routing daemons, dhcp clients can use this
35 flag to determine whether they should use the interface.
36ifinfomsg::if_flags & IFF_LOWER_UP:
37 Driver has signaled netif_carrier_on()
38ifinfomsg::if_flags & IFF_DORMANT:
39 Driver has signaled netif_dormant_on()
40
41These interface flags can also be queried without netlink using the
42SIOCGIFFLAGS ioctl.
43
44TLV IFLA_OPERSTATE
45
46contains RFC2863 state of the interface in numeric representation:
47
48IF_OPER_UNKNOWN (0):
49 Interface is in unknown state, neither driver nor userspace has set
50 operational state. Interface must be considered for user data as
51 setting operational state has not been implemented in every driver.
52IF_OPER_NOTPRESENT (1):
53 Unused in current kernel (notpresent interfaces normally disappear),
54 just a numerical placeholder.
55IF_OPER_DOWN (2):
56 Interface is unable to transfer data on L1, f.e. ethernet is not
57 plugged or interface is ADMIN down.
58IF_OPER_LOWERLAYERDOWN (3):
59 Interfaces stacked on an interface that is IF_OPER_DOWN show this
60 state (f.e. VLAN).
61IF_OPER_TESTING (4):
62 Unused in current kernel.
63IF_OPER_DORMANT (5):
64 Interface is L1 up, but waiting for an external event, f.e. for a
65 protocol to establish. (802.1X)
66IF_OPER_UP (6):
67 Interface is operational up and can be used.
68
69This TLV can also be queried via sysfs.
70
71TLV IFLA_LINKMODE
72
73contains link policy. This is needed for userspace interaction
74described below.
75
76This TLV can also be queried via sysfs.
77
78
793. Kernel driver API
80
81Kernel drivers have access to two flags that map to IFF_LOWER_UP and
82IFF_DORMANT. These flags can be set from everywhere, even from
83interrupts. It is guaranteed that only the driver has write access,
84however, if different layers of the driver manipulate the same flag,
85the driver has to provide the synchronisation needed.
86
87__LINK_STATE_NOCARRIER, maps to !IFF_LOWER_UP:
88
89The driver uses netif_carrier_on() to clear and netif_carrier_off() to
90set this flag. On netif_carrier_off(), the scheduler stops sending
91packets. The name 'carrier' and the inversion are historical, think of
92it as lower layer.
93
94netif_carrier_ok() can be used to query that bit.
95
96__LINK_STATE_DORMANT, maps to IFF_DORMANT:
97
98Set by the driver to express that the device cannot yet be used
99because some driver controlled protocol establishment has to
100complete. Corresponding functions are netif_dormant_on() to set the
101flag, netif_dormant_off() to clear it and netif_dormant() to query.
102
103On device allocation, networking core sets the flags equivalent to
104netif_carrier_ok() and !netif_dormant().
105
106
107Whenever the driver CHANGES one of these flags, a workqueue event is
108scheduled to translate the flag combination to IFLA_OPERSTATE as
109follows:
110
111!netif_carrier_ok():
112 IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN
113 otherwise. Kernel can recognise stacked interfaces because their
114 ifindex != iflink.
115
116netif_carrier_ok() && netif_dormant():
117 IF_OPER_DORMANT
118
119netif_carrier_ok() && !netif_dormant():
120 IF_OPER_UP if userspace interaction is disabled. Otherwise
121 IF_OPER_DORMANT with the possibility for userspace to initiate the
122 IF_OPER_UP transition afterwards.
123
124
1254. Setting from userspace
126
127Applications have to use the netlink interface to influence the
128RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1
129via RTM_SETLINK instructs the kernel that an interface should go to
130IF_OPER_DORMANT instead of IF_OPER_UP when the combination
131netif_carrier_ok() && !netif_dormant() is set by the
132driver. Afterwards, the userspace application can set IFLA_OPERSTATE
133to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
134netif_carrier_off() or netif_dormant_on(). Changes made by userspace
135are multicasted on the netlink group RTMGRP_LINK.
136
137So basically a 802.1X supplicant interacts with the kernel like this:
138
139-subscribe to RTMGRP_LINK
140-set IFLA_LINKMODE to 1 via RTM_SETLINK
141-query RTM_GETLINK once to get initial state
142-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until
143 netlink multicast signals this state
144-do 802.1X, eventually abort if flags go down again
145-send RTM_SETLINK to set operstate to IF_OPER_UP if authentication
146 succeeds, IF_OPER_DORMANT otherwise
147-see how operstate and IFF_RUNNING is echoed via netlink multicast
148-set interface back to IF_OPER_DORMANT if 802.1X reauthentication
149 fails
150-restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag
151
152if supplicant goes down, bring back IFLA_LINKMODE to 0 and
153IFLA_OPERSTATE to a sane value.
154
155A routing daemon or dhcp client just needs to care for IFF_RUNNING or
156waiting for operstate to go IF_OPER_UP/IF_OPER_UNKNOWN before
157considering the interface / querying a DHCP address.
158
159
160For technical questions and/or comments please e-mail to Stefan Rompf
161(stefan at loplof.de).
diff --git a/Documentation/networking/xfrm_sync.txt b/Documentation/networking/xfrm_sync.txt
new file mode 100644
index 000000000000..8be626f7c0b8
--- /dev/null
+++ b/Documentation/networking/xfrm_sync.txt
@@ -0,0 +1,166 @@
1
2The sync patches work is based on initial patches from
3Krisztian <hidden@balabit.hu> and others and additional patches
4from Jamal <hadi@cyberus.ca>.
5
6The end goal for syncing is to be able to insert attributes + generate
7events so that the an SA can be safely moved from one machine to another
8for HA purposes.
9The idea is to synchronize the SA so that the takeover machine can do
10the processing of the SA as accurate as possible if it has access to it.
11
12We already have the ability to generate SA add/del/upd events.
13These patches add ability to sync and have accurate lifetime byte (to
14ensure proper decay of SAs) and replay counters to avoid replay attacks
15with as minimal loss at failover time.
16This way a backup stays as closely uptodate as an active member.
17
18Because the above items change for every packet the SA receives,
19it is possible for a lot of the events to be generated.
20For this reason, we also add a nagle-like algorithm to restrict
21the events. i.e we are going to set thresholds to say "let me
22know if the replay sequence threshold is reached or 10 secs have passed"
23These thresholds are set system-wide via sysctls or can be updated
24per SA.
25
26The identified items that need to be synchronized are:
27- the lifetime byte counter
28note that: lifetime time limit is not important if you assume the failover
29machine is known ahead of time since the decay of the time countdown
30is not driven by packet arrival.
31- the replay sequence for both inbound and outbound
32
331) Message Structure
34----------------------
35
36nlmsghdr:aevent_id:optional-TLVs.
37
38The netlink message types are:
39
40XFRM_MSG_NEWAE and XFRM_MSG_GETAE.
41
42A XFRM_MSG_GETAE does not have TLVs.
43A XFRM_MSG_NEWAE will have at least two TLVs (as is
44discussed further below).
45
46aevent_id structure looks like:
47
48 struct xfrm_aevent_id {
49 struct xfrm_usersa_id sa_id;
50 __u32 flags;
51 };
52
53xfrm_usersa_id in this message layout identifies the SA.
54
55flags are used to indicate different things. The possible
56flags are:
57 XFRM_AE_RTHR=1, /* replay threshold*/
58 XFRM_AE_RVAL=2, /* replay value */
59 XFRM_AE_LVAL=4, /* lifetime value */
60 XFRM_AE_ETHR=8, /* expiry timer threshold */
61 XFRM_AE_CR=16, /* Event cause is replay update */
62 XFRM_AE_CE=32, /* Event cause is timer expiry */
63 XFRM_AE_CU=64, /* Event cause is policy update */
64
65How these flags are used is dependent on the direction of the
66message (kernel<->user) as well the cause (config, query or event).
67This is described below in the different messages.
68
69The pid will be set appropriately in netlink to recognize direction
70(0 to the kernel and pid = processid that created the event
71when going from kernel to user space)
72
73A program needs to subscribe to multicast group XFRMNLGRP_AEVENTS
74to get notified of these events.
75
762) TLVS reflect the different parameters:
77-----------------------------------------
78
79a) byte value (XFRMA_LTIME_VAL)
80This TLV carries the running/current counter for byte lifetime since
81last event.
82
83b)replay value (XFRMA_REPLAY_VAL)
84This TLV carries the running/current counter for replay sequence since
85last event.
86
87c)replay threshold (XFRMA_REPLAY_THRESH)
88This TLV carries the threshold being used by the kernel to trigger events
89when the replay sequence is exceeded.
90
91d) expiry timer (XFRMA_ETIMER_THRESH)
92This is a timer value in milliseconds which is used as the nagle
93value to rate limit the events.
94
953) Default configurations for the parameters:
96----------------------------------------------
97
98By default these events should be turned off unless there is
99at least one listener registered to listen to the multicast
100group XFRMNLGRP_AEVENTS.
101
102Programs installing SAs will need to specify the two thresholds, however,
103in order to not change existing applications such as racoon
104we also provide default threshold values for these different parameters
105in case they are not specified.
106
107the two sysctls/proc entries are:
108a) /proc/sys/net/core/sysctl_xfrm_aevent_etime
109used to provide default values for the XFRMA_ETIMER_THRESH in incremental
110units of time of 100ms. The default is 10 (1 second)
111
112b) /proc/sys/net/core/sysctl_xfrm_aevent_rseqth
113used to provide default values for XFRMA_REPLAY_THRESH parameter
114in incremental packet count. The default is two packets.
115
1164) Message types
117----------------
118
119a) XFRM_MSG_GETAE issued by user-->kernel.
120XFRM_MSG_GETAE does not carry any TLVs.
121The response is a XFRM_MSG_NEWAE which is formatted based on what
122XFRM_MSG_GETAE queried for.
123The response will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
124*if XFRM_AE_RTHR flag is set, then XFRMA_REPLAY_THRESH is also retrieved
125*if XFRM_AE_ETHR flag is set, then XFRMA_ETIMER_THRESH is also retrieved
126
127b) XFRM_MSG_NEWAE is issued by either user space to configure
128or kernel to announce events or respond to a XFRM_MSG_GETAE.
129
130i) user --> kernel to configure a specific SA.
131any of the values or threshold parameters can be updated by passing the
132appropriate TLV.
133A response is issued back to the sender in user space to indicate success
134or failure.
135In the case of success, additionally an event with
136XFRM_MSG_NEWAE is also issued to any listeners as described in iii).
137
138ii) kernel->user direction as a response to XFRM_MSG_GETAE
139The response will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
140The threshold TLVs will be included if explicitly requested in
141the XFRM_MSG_GETAE message.
142
143iii) kernel->user to report as event if someone sets any values or
144thresholds for an SA using XFRM_MSG_NEWAE (as described in #i above).
145In such a case XFRM_AE_CU flag is set to inform the user that
146the change happened as a result of an update.
147The message will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
148
149iv) kernel->user to report event when replay threshold or a timeout
150is exceeded.
151In such a case either XFRM_AE_CR (replay exceeded) or XFRM_AE_CE (timeout
152happened) is set to inform the user what happened.
153Note the two flags are mutually exclusive.
154The message will always have XFRMA_LTIME_VAL and XFRMA_REPLAY_VAL TLVs.
155
156Exceptions to threshold settings
157--------------------------------
158
159If you have an SA that is getting hit by traffic in bursts such that
160there is a period where the timer threshold expires with no packets
161seen, then an odd behavior is seen as follows:
162The first packet arrival after a timer expiry will trigger a timeout
163aevent; i.e we dont wait for a timeout period or a packet threshold
164to be reached. This is done for simplicity and efficiency reasons.
165
166-JHS
diff --git a/Documentation/pci.txt b/Documentation/pci.txt
index 711210b38f5f..66bbbf1d1ef6 100644
--- a/Documentation/pci.txt
+++ b/Documentation/pci.txt
@@ -259,7 +259,17 @@ on the bus need to be capable of doing it, so this is something which needs
259to be handled by platform and generic code, not individual drivers. 259to be handled by platform and generic code, not individual drivers.
260 260
261 261
2628. Obsolete functions 2628. Vendor and device identifications
263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264For the future, let's avoid adding device ids to include/linux/pci_ids.h.
265
266PCI_VENDOR_ID_xxx for vendors, and a hex constant for device ids.
267
268Rationale: PCI_VENDOR_ID_xxx constants are re-used, but device ids are not.
269 Further, device ids are arbitrary hex numbers, normally used only in a
270 single location, the pci_device_id table.
271
2729. Obsolete functions
263~~~~~~~~~~~~~~~~~~~~~ 273~~~~~~~~~~~~~~~~~~~~~
264There are several functions which you might come across when trying to 274There are several functions which you might come across when trying to
265port an old driver to the new PCI interface. They are no longer present 275port an old driver to the new PCI interface. They are no longer present
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index d18a57d1a531..43a889f8f08d 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -140,7 +140,7 @@ IBM TP T41p s3_bios (2), switch to X after resume
140IBM TP T42 s3_bios (2) 140IBM TP T42 s3_bios (2)
141IBM ThinkPad T42p (2373-GTG) s3_bios (2) 141IBM ThinkPad T42p (2373-GTG) s3_bios (2)
142IBM TP X20 ??? (*) 142IBM TP X20 ??? (*)
143IBM TP X30 s3_bios (2) 143IBM TP X30 s3_bios, s3_mode (4)
144IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight. 144IBM TP X31 / Type 2672-XXH none (1), use radeontool (http://fdd.com/software/radeon/) to turn off backlight.
145IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results? 145IBM TP X32 none (1), but backlight is on and video is trashed after long suspend. s3_bios,s3_mode (4) works too. Perhaps that gets better results?
146IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4) 146IBM Thinkpad X40 Type 2371-7JG s3_bios,s3_mode (4)
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid
index 09f6300eda4b..c173806c91fa 100644
--- a/Documentation/scsi/ChangeLog.megaraid
+++ b/Documentation/scsi/ChangeLog.megaraid
@@ -1,3 +1,28 @@
1Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
4
51. Fixed a bug in megaraid_reset_handler().
6 Customer reported "Unable to handle kernel NULL pointer dereference
7 at virtual address 00000000" when system goes to reset condition
8 for some reason. It happened randomly.
9 Root Cause: in the megaraid_reset_handler(), there is possibility not
10 returning pending packets in the pend_list if there are multiple
11 pending packets.
12 Fix: Made the change in the driver so that it will return all packets
13 in the pend_list.
14
152. Added change request.
16 As found in the following URL, rmb() only didn't help the
17 problem. I had to increase the loop counter to 0xFFFFFF. (6 F's)
18 http://marc.theaimsgroup.com/?l=linux-scsi&m=110971060502497&w=2
19
20 I attached a patch for your reference, too.
21 Could you check and get this fix in your driver?
22
23 Best Regards,
24 Jun'ichi Nomura
25
1Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com> 26Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com>
2Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) 27Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
3Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) 28Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module)
diff --git a/Documentation/serial/driver b/Documentation/serial/driver
index 42ef9970bc86..88ad615dd338 100644
--- a/Documentation/serial/driver
+++ b/Documentation/serial/driver
@@ -3,14 +3,11 @@
3 -------------------- 3 --------------------
4 4
5 5
6 $Id: driver,v 1.10 2002/07/22 15:27:30 rmk Exp $
7
8
9This document is meant as a brief overview of some aspects of the new serial 6This document is meant as a brief overview of some aspects of the new serial
10driver. It is not complete, any questions you have should be directed to 7driver. It is not complete, any questions you have should be directed to
11<rmk@arm.linux.org.uk> 8<rmk@arm.linux.org.uk>
12 9
13The reference implementation is contained within serial_amba.c. 10The reference implementation is contained within amba_pl011.c.
14 11
15 12
16 13
@@ -31,6 +28,11 @@ The serial core provides a few helper functions. This includes identifing
31the correct port structure (via uart_get_console) and decoding command line 28the correct port structure (via uart_get_console) and decoding command line
32arguments (uart_parse_options). 29arguments (uart_parse_options).
33 30
31There is also a helper function (uart_write_console) which performs a
32character by character write, translating newlines to CRLF sequences.
33Driver writers are recommended to use this function rather than implementing
34their own version.
35
34 36
35Locking 37Locking
36------- 38-------
@@ -86,6 +88,7 @@ hardware.
86 - TIOCM_DTR DTR signal. 88 - TIOCM_DTR DTR signal.
87 - TIOCM_OUT1 OUT1 signal. 89 - TIOCM_OUT1 OUT1 signal.
88 - TIOCM_OUT2 OUT2 signal. 90 - TIOCM_OUT2 OUT2 signal.
91 - TIOCM_LOOP Set the port into loopback mode.
89 If the appropriate bit is set, the signal should be driven 92 If the appropriate bit is set, the signal should be driven
90 active. If the bit is clear, the signal should be driven 93 active. If the bit is clear, the signal should be driven
91 inactive. 94 inactive.
@@ -141,6 +144,10 @@ hardware.
141 enable_ms(port) 144 enable_ms(port)
142 Enable the modem status interrupts. 145 Enable the modem status interrupts.
143 146
147 This method may be called multiple times. Modem status
148 interrupts should be disabled when the shutdown method is
149 called.
150
144 Locking: port->lock taken. 151 Locking: port->lock taken.
145 Interrupts: locally disabled. 152 Interrupts: locally disabled.
146 This call must not sleep 153 This call must not sleep
@@ -160,6 +167,8 @@ hardware.
160 state. Enable the port for reception. It should not activate 167 state. Enable the port for reception. It should not activate
161 RTS nor DTR; this will be done via a separate call to set_mctrl. 168 RTS nor DTR; this will be done via a separate call to set_mctrl.
162 169
170 This method will only be called when the port is initially opened.
171
163 Locking: port_sem taken. 172 Locking: port_sem taken.
164 Interrupts: globally disabled. 173 Interrupts: globally disabled.
165 174
@@ -169,6 +178,11 @@ hardware.
169 RTS nor DTR; this will have already been done via a separate 178 RTS nor DTR; this will have already been done via a separate
170 call to set_mctrl. 179 call to set_mctrl.
171 180
181 Drivers must not access port->info once this call has completed.
182
183 This method will only be called when there are no more users of
184 this port.
185
172 Locking: port_sem taken. 186 Locking: port_sem taken.
173 Interrupts: caller dependent. 187 Interrupts: caller dependent.
174 188
@@ -200,12 +214,13 @@ hardware.
200 The interaction of the iflag bits is as follows (parity error 214 The interaction of the iflag bits is as follows (parity error
201 given as an example): 215 given as an example):
202 Parity error INPCK IGNPAR 216 Parity error INPCK IGNPAR
203 None n/a n/a character received 217 n/a 0 n/a character received, marked as
204 Yes n/a 0 character discarded 218 TTY_NORMAL
205 Yes 0 1 character received, marked as 219 None 1 n/a character received, marked as
206 TTY_NORMAL 220 TTY_NORMAL
207 Yes 1 1 character received, marked as 221 Yes 1 0 character received, marked as
208 TTY_PARITY 222 TTY_PARITY
223 Yes 1 1 character discarded
209 224
210 Other flags may be used (eg, xon/xoff characters) if your 225 Other flags may be used (eg, xon/xoff characters) if your
211 hardware supports hardware "soft" flow control. 226 hardware supports hardware "soft" flow control.
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt
index 4692c8e77dc1..b535c2a198f8 100644
--- a/Documentation/sound/alsa/Audiophile-Usb.txt
+++ b/Documentation/sound/alsa/Audiophile-Usb.txt
@@ -1,4 +1,4 @@
1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.2 1 Guide to using M-Audio Audiophile USB with ALSA and Jack v1.3
2 ======================================================== 2 ========================================================
3 3
4 Thibault Le Meur <Thibault.LeMeur@supelec.fr> 4 Thibault Le Meur <Thibault.LeMeur@supelec.fr>
@@ -22,16 +22,16 @@ The device has 4 audio interfaces, and 2 MIDI ports:
22 * Midi In (Mi) 22 * Midi In (Mi)
23 * Midi Out (Mo) 23 * Midi Out (Mo)
24 24
25The internal DAC/ADC has the following caracteristics: 25The internal DAC/ADC has the following characteristics:
26* sample depth of 16 or 24 bits 26* sample depth of 16 or 24 bits
27* sample rate from 8kHz to 96kHz 27* sample rate from 8kHz to 96kHz
28* Two ports can't use different sample depths at the same time.Moreover, the 28* Two ports can't use different sample depths at the same time. Moreover, the
29Audiophile USB documentation gives the following Warning: "Please exit any 29Audiophile USB documentation gives the following Warning: "Please exit any
30audio application running before switching between bit depths" 30audio application running before switching between bit depths"
31 31
32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be 32Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
33activated at the same time depending on the audio mode selected: 33activated at the same time depending on the audio mode selected:
34 * 16-bit/48kHz ==> 4 channels in/ 4 channels out 34 * 16-bit/48kHz ==> 4 channels in/4 channels out
35 - Ai+Ao+Di+Do 35 - Ai+Ao+Di+Do
36 * 24-bit/48kHz ==> 4 channels in/2 channels out, 36 * 24-bit/48kHz ==> 4 channels in/2 channels out,
37 or 2 channels in/4 channels out 37 or 2 channels in/4 channels out
@@ -41,8 +41,8 @@ activated at the same time depending on the audio mode selected:
41 41
42Important facts about the Digital interface: 42Important facts about the Digital interface:
43-------------------------------------------- 43--------------------------------------------
44 * The Do port additionnaly supports surround-encoded AC-3 and DTS passthrough, 44 * The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
45though I haven't tested it under linux 45though I haven't tested it under Linux
46 - Note that in this setup only the Do interface can be enabled 46 - Note that in this setup only the Do interface can be enabled
47 * Apart from recording an audio digital stream, enabling the Di port is a way 47 * Apart from recording an audio digital stream, enabling the Di port is a way
48to synchronize the device to an external sample clock 48to synchronize the device to an external sample clock
@@ -60,24 +60,23 @@ synchronization error (for instance sound played at an odd sample rate)
60The Audiophile USB MIDI ports will be automatically supported once the 60The Audiophile USB MIDI ports will be automatically supported once the
61following modules have been loaded: 61following modules have been loaded:
62 * snd-usb-audio 62 * snd-usb-audio
63 * snd-seq
64 * snd-seq-midi 63 * snd-seq-midi
65 64
66No additionnal setting is required. 65No additional setting is required.
67 66
682.2 - Audio ports 672.2 - Audio ports
69----------------- 68-----------------
70 69
71Audio functions of the Audiophile USB device are handled by the snd-usb-audio 70Audio functions of the Audiophile USB device are handled by the snd-usb-audio
72module. This module can work in a default mode (without any device-specific 71module. This module can work in a default mode (without any device-specific
73parameter), or in an advanced mode with the device-specific parameter called 72parameter), or in an "advanced" mode with the device-specific parameter called
74"device_setup". 73"device_setup".
75 74
762.2.1 - Default Alsa driver mode 752.2.1 - Default Alsa driver mode
77 76
78The default behaviour of the snd-usb-audio driver is to parse the device 77The default behavior of the snd-usb-audio driver is to parse the device
79capabilities at startup and enable all functions inside the device (including 78capabilities at startup and enable all functions inside the device (including
80all ports at any sample rates and any sample depths supported). This approach 79all ports at any supported sample rates and sample depths). This approach
81has the advantage to let the driver easily switch from sample rates/depths 80has the advantage to let the driver easily switch from sample rates/depths
82automatically according to the need of the application claiming the device. 81automatically according to the need of the application claiming the device.
83 82
@@ -114,9 +113,9 @@ gain).
114For people having this problem, the snd-usb-audio module has a new module 113For people having this problem, the snd-usb-audio module has a new module
115parameter called "device_setup". 114parameter called "device_setup".
116 115
1172.2.2.1 - Initializing the working mode of the Audiohile USB 1162.2.2.1 - Initializing the working mode of the Audiophile USB
118 117
119As far as the Audiohile USB device is concerned, this value let the user 118As far as the Audiophile USB device is concerned, this value let the user
120specify: 119specify:
121 * the sample depth 120 * the sample depth
122 * the sample rate 121 * the sample rate
@@ -174,20 +173,20 @@ The parameter can be given:
174 173
175IMPORTANT NOTE WHEN SWITCHING CONFIGURATION: 174IMPORTANT NOTE WHEN SWITCHING CONFIGURATION:
176------------------------------------------- 175-------------------------------------------
177 * You may need to _first_ intialize the module with the correct device_setup 176 * You may need to _first_ initialize the module with the correct device_setup
178 parameter and _only_after_ turn on the Audiophile USB device 177 parameter and _only_after_ turn on the Audiophile USB device
179 * This is especially true when switching the sample depth: 178 * This is especially true when switching the sample depth:
180 - first trun off the device 179 - first turn off the device
181 - de-register the snd-usb-audio module 180 - de-register the snd-usb-audio module (modprobe -r)
182 - change the device_setup parameter (by either manually reprobing the module 181 - change the device_setup parameter by changing the device_setup
183 or changing modprobe.conf) 182 option in /etc/modprobe.conf
184 - turn on the device 183 - turn on the device
185 184
1862.2.2.3 - Audiophile USB's device_setup structure 1852.2.2.3 - Audiophile USB's device_setup structure
187 186
188If you want to understand the device_setup magic numbers for the Audiophile 187If you want to understand the device_setup magic numbers for the Audiophile
189USB, you need some very basic understanding of binary computation. However, 188USB, you need some very basic understanding of binary computation. However,
190this is not required to use the parameter and you may skip thi section. 189this is not required to use the parameter and you may skip this section.
191 190
192The device_setup is one byte long and its structure is the following: 191The device_setup is one byte long and its structure is the following:
193 192
@@ -231,11 +230,11 @@ Caution:
231 230
2322.2.3 - USB implementation details for this device 2312.2.3 - USB implementation details for this device
233 232
234You may safely skip this section if you're not interrested in driver 233You may safely skip this section if you're not interested in driver
235development. 234development.
236 235
237This section describes some internals aspect of the device and summarize the 236This section describes some internal aspects of the device and summarize the
238data I got by usb-snooping the windows and linux drivers. 237data I got by usb-snooping the windows and Linux drivers.
239 238
240The M-Audio Audiophile USB has 7 USB Interfaces: 239The M-Audio Audiophile USB has 7 USB Interfaces:
241a "USB interface": 240a "USB interface":
@@ -277,9 +276,9 @@ Here is a short description of the AltSettings capabilities:
277 - 16-bit depth, 8-48kHz sample mode 276 - 16-bit depth, 8-48kHz sample mode
278 - Synch playback (Do), audio format type III IEC1937_AC-3 277 - Synch playback (Do), audio format type III IEC1937_AC-3
279 278
280In order to ensure a correct intialization of the device, the driver 279In order to ensure a correct initialization of the device, the driver
281_must_know_ how the device will be used: 280_must_know_ how the device will be used:
282 * if DTS is choosen, only Interface 2 with AltSet nb.6 must be 281 * if DTS is chosen, only Interface 2 with AltSet nb.6 must be
283 registered 282 registered
284 * if 96KHz only AltSets nb.1 of each interface must be selected 283 * if 96KHz only AltSets nb.1 of each interface must be selected
285 * if samples are using 24bits/48KHz then AltSet 2 must me used if 284 * if samples are using 24bits/48KHz then AltSet 2 must me used if
@@ -290,7 +289,7 @@ _must_know_ how the device will be used:
290 is not connected 289 is not connected
291 290
292When device_setup is given as a parameter to the snd-usb-audio module, the 291When device_setup is given as a parameter to the snd-usb-audio module, the
293parse_audio_enpoint function uses a quirk called 292parse_audio_endpoints function uses a quirk called
294"audiophile_skip_setting_quirk" in order to prevent AltSettings not 293"audiophile_skip_setting_quirk" in order to prevent AltSettings not
295corresponding to device_setup from being registered in the driver. 294corresponding to device_setup from being registered in the driver.
296 295
@@ -317,9 +316,8 @@ However you may see the following warning message:
317using the "default" ALSA device. This is less efficient than it could be. 316using the "default" ALSA device. This is less efficient than it could be.
318Consider using a hardware device instead rather than using the plug layer." 317Consider using a hardware device instead rather than using the plug layer."
319 318
320
3213.2 - Patching alsa to use direct pcm device 3193.2 - Patching alsa to use direct pcm device
322------------------------------------------- 320--------------------------------------------
323A patch for Jack by Andreas Steinmetz adds support for Big Endian devices. 321A patch for Jack by Andreas Steinmetz adds support for Big Endian devices.
324However it has not been included in the CVS tree. 322However it has not been included in the CVS tree.
325 323
@@ -331,3 +329,32 @@ After having applied the patch you can run jackd with the following command
331line: 329line:
332 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1 330 % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
333 331
3323.2 - Getting 2 input and/or output interfaces in Jack
333------------------------------------------------------
334
335As you can see, starting the Jack server this way will only enable 1 stereo
336input (Di or Ai) and 1 stereo output (Ao or Do).
337
338This is due to the following restrictions:
339* Jack can only open one capture device and one playback device at a time
340* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
341 (and optionally hw:1,2)
342If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
343combine the Alsa devices into one logical "complex" device.
344
345If you want to give it a try, I recommend reading the information from
346this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
347It is related to another device (ice1712) but can be adapted to suit
348the Audiophile USB.
349
350Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
351* patching Jack with the previously mentioned "Big Endian" patch
352* patching Jackd with the MMAP_COMPLEX patch (see the ice1712 page)
353* patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
354* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
355 file
356* start jackd with this device
357
358I had no success in testing this for now, but this may be due to my OS
359configuration. If you have any success with this kind of setup, please
360drop me an email.
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 68eeebc17ff4..1faf76383bab 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -1172,7 +1172,7 @@
1172 } 1172 }
1173 1173
1174 /* PCI IDs */ 1174 /* PCI IDs */
1175 static struct pci_device_id snd_mychip_ids[] = { 1175 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1176 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1177 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1178 .... 1178 ....
@@ -1565,7 +1565,7 @@
1565 <informalexample> 1565 <informalexample>
1566 <programlisting> 1566 <programlisting>
1567<![CDATA[ 1567<![CDATA[
1568 static struct pci_device_id snd_mychip_ids[] = { 1568 static struct pci_device_id snd_mychip_ids[] __devinitdata = {
1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, 1569 { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR,
1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 1570 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
1571 .... 1571 ....
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx
new file mode 100644
index 000000000000..9c45f3df2e18
--- /dev/null
+++ b/Documentation/spi/pxa2xx
@@ -0,0 +1,234 @@
1PXA2xx SPI on SSP driver HOWTO
2===================================================
3This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx
4synchronous serial port into a SPI master controller
5(see Documentation/spi/spi_summary). The driver has the following features
6
7- Support for any PXA2xx SSP
8- SSP PIO and SSP DMA data transfers.
9- External and Internal (SSPFRM) chip selects.
10- Per slave device (chip) configuration.
11- Full suspend, freeze, resume support.
12
13The driver is built around a "spi_message" fifo serviced by workqueue and a
14tasklet. The workqueue, "pump_messages", drives message fifo and the tasklet
15(pump_transfer) is responsible for queuing SPI transactions and setting up and
16launching the dma/interrupt driven transfers.
17
18Declaring PXA2xx Master Controllers
19-----------------------------------
20Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a
21"platform device". The master configuration is passed to the driver via a table
22found in include/asm-arm/arch-pxa/pxa2xx_spi.h:
23
24struct pxa2xx_spi_master {
25 enum pxa_ssp_type ssp_type;
26 u32 clock_enable;
27 u16 num_chipselect;
28 u8 enable_dma;
29};
30
31The "pxa2xx_spi_master.ssp_type" field must have a value between 1 and 3 and
32informs the driver which features a particular SSP supports.
33
34The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the
35corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See
36the "PXA2xx Developer Manual" section "Clocks and Power Management".
37
38The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of
39slave device (chips) attached to this SPI master.
40
41The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should
42be used. This caused the driver to acquire two DMA channels: rx_channel and
43tx_channel. The rx_channel has a higher DMA service priority the tx_channel.
44See the "PXA2xx Developer Manual" section "DMA Controller".
45
46NSSP MASTER SAMPLE
47------------------
48Below is a sample configuration using the PXA255 NSSP.
49
50static struct resource pxa_spi_nssp_resources[] = {
51 [0] = {
52 .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */
53 .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */
54 .flags = IORESOURCE_MEM,
55 },
56 [1] = {
57 .start = IRQ_NSSP, /* NSSP IRQ */
58 .end = IRQ_NSSP,
59 .flags = IORESOURCE_IRQ,
60 },
61};
62
63static struct pxa2xx_spi_master pxa_nssp_master_info = {
64 .ssp_type = PXA25x_NSSP, /* Type of SSP */
65 .clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */
66 .num_chipselect = 1, /* Matches the number of chips attached to NSSP */
67 .enable_dma = 1, /* Enables NSSP DMA */
68};
69
70static struct platform_device pxa_spi_nssp = {
71 .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */
72 .id = 2, /* Bus number, MUST MATCH SSP number 1..n */
73 .resource = pxa_spi_nssp_resources,
74 .num_resources = ARRAY_SIZE(pxa_spi_nssp_resources),
75 .dev = {
76 .platform_data = &pxa_nssp_master_info, /* Passed to driver */
77 },
78};
79
80static struct platform_device *devices[] __initdata = {
81 &pxa_spi_nssp,
82};
83
84static void __init board_init(void)
85{
86 (void)platform_add_device(devices, ARRAY_SIZE(devices));
87}
88
89Declaring Slave Devices
90-----------------------
91Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c
92using the "spi_board_info" structure found in "linux/spi/spi.h". See
93"Documentation/spi/spi_summary" for additional information.
94
95Each slave device attached to the PXA must provide slave specific configuration
96information via the structure "pxa2xx_spi_chip" found in
97"include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver
98will uses the configuration whenever the driver communicates with the slave
99device.
100
101struct pxa2xx_spi_chip {
102 u8 tx_threshold;
103 u8 rx_threshold;
104 u8 dma_burst_size;
105 u32 timeout_microsecs;
106 u8 enable_loopback;
107 void (*cs_control)(u32 command);
108};
109
110The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are
111used to configure the SSP hardware fifo. These fields are critical to the
112performance of pxa2xx_spi driver and misconfiguration will result in rx
113fifo overruns (especially in PIO mode transfers). Good default values are
114
115 .tx_threshold = 12,
116 .rx_threshold = 4,
117
118The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA
119engine and is related the "spi_device.bits_per_word" field. Read and understand
120the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers
121to determine the correct value. An SSP configured for byte-wide transfers would
122use a value of 8.
123
124The "pxa2xx_spi_chip.timeout_microsecs" fields is used to efficiently handle
125trailing bytes in the SSP receiver fifo. The correct value for this field is
126dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific
127slave device. Please note the the PXA2xx SSP 1 does not support trailing byte
128timeouts and must busy-wait any trailing bytes.
129
130The "pxa2xx_spi_chip.enable_loopback" field is used to place the SSP porting
131into internal loopback mode. In this mode the SSP controller internally
132connects the SSPTX pin the the SSPRX pin. This is useful for initial setup
133testing.
134
135The "pxa2xx_spi_chip.cs_control" field is used to point to a board specific
136function for asserting/deasserting a slave device chip select. If the field is
137NULL, the pxa2xx_spi master controller driver assumes that the SSP port is
138configured to use SSPFRM instead.
139
140NSSP SALVE SAMPLE
141-----------------
142The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the
143"spi_board_info.controller_data" field. Below is a sample configuration using
144the PXA255 NSSP.
145
146/* Chip Select control for the CS8415A SPI slave device */
147static void cs8415a_cs_control(u32 command)
148{
149 if (command & PXA2XX_CS_ASSERT)
150 GPCR(2) = GPIO_bit(2);
151 else
152 GPSR(2) = GPIO_bit(2);
153}
154
155/* Chip Select control for the CS8405A SPI slave device */
156static void cs8405a_cs_control(u32 command)
157{
158 if (command & PXA2XX_CS_ASSERT)
159 GPCR(3) = GPIO_bit(3);
160 else
161 GPSR(3) = GPIO_bit(3);
162}
163
164static struct pxa2xx_spi_chip cs8415a_chip_info = {
165 .tx_threshold = 12, /* SSP hardward FIFO threshold */
166 .rx_threshold = 4, /* SSP hardward FIFO threshold */
167 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */
168 .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */
169 .cs_control = cs8415a_cs_control, /* Use external chip select */
170};
171
172static struct pxa2xx_spi_chip cs8405a_chip_info = {
173 .tx_threshold = 12, /* SSP hardward FIFO threshold */
174 .rx_threshold = 4, /* SSP hardward FIFO threshold */
175 .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */
176 .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */
177 .cs_control = cs8405a_cs_control, /* Use external chip select */
178};
179
180static struct spi_board_info streetracer_spi_board_info[] __initdata = {
181 {
182 .modalias = "cs8415a", /* Name of spi_driver for this device */
183 .max_speed_hz = 3686400, /* Run SSP as fast a possbile */
184 .bus_num = 2, /* Framework bus number */
185 .chip_select = 0, /* Framework chip select */
186 .platform_data = NULL; /* No spi_driver specific config */
187 .controller_data = &cs8415a_chip_info, /* Master chip config */
188 .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
189 },
190 {
191 .modalias = "cs8405a", /* Name of spi_driver for this device */
192 .max_speed_hz = 3686400, /* Run SSP as fast a possbile */
193 .bus_num = 2, /* Framework bus number */
194 .chip_select = 1, /* Framework chip select */
195 .controller_data = &cs8405a_chip_info, /* Master chip config */
196 .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */
197 },
198};
199
200static void __init streetracer_init(void)
201{
202 spi_register_board_info(streetracer_spi_board_info,
203 ARRAY_SIZE(streetracer_spi_board_info));
204}
205
206
207DMA and PIO I/O Support
208-----------------------
209The pxa2xx_spi driver support both DMA and interrupt driven PIO message
210transfers. The driver defaults to PIO mode and DMA transfers must enabled by
211setting the "enable_dma" flag in the "pxa2xx_spi_master" structure and and
212ensuring that the "pxa2xx_spi_chip.dma_burst_size" field is non-zero. The DMA
213mode support both coherent and stream based DMA mappings.
214
215The following logic is used to determine the type of I/O to be used on
216a per "spi_transfer" basis:
217
218if !enable_dma or dma_burst_size == 0 then
219 always use PIO transfers
220
221if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then
222 use coherent DMA mode
223
224if rx_buf and tx_buf are aligned on 8 byte boundary then
225 use streaming DMA mode
226
227otherwise
228 use PIO transfer
229
230THANKS TO
231---------
232
233David Brownell and others for mentoring the development of this driver.
234
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary
index a5ffba33a351..068732d32276 100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
@@ -414,7 +414,33 @@ to get the driver-private data allocated for that device.
414The driver will initialize the fields of that spi_master, including the 414The driver will initialize the fields of that spi_master, including the
415bus number (maybe the same as the platform device ID) and three methods 415bus number (maybe the same as the platform device ID) and three methods
416used to interact with the SPI core and SPI protocol drivers. It will 416used to interact with the SPI core and SPI protocol drivers. It will
417also initialize its own internal state. 417also initialize its own internal state. (See below about bus numbering
418and those methods.)
419
420After you initialize the spi_master, then use spi_register_master() to
421publish it to the rest of the system. At that time, device nodes for
422the controller and any predeclared spi devices will be made available,
423and the driver model core will take care of binding them to drivers.
424
425If you need to remove your SPI controller driver, spi_unregister_master()
426will reverse the effect of spi_register_master().
427
428
429BUS NUMBERING
430
431Bus numbering is important, since that's how Linux identifies a given
432SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On
433SOC systems, the bus numbers should match the numbers defined by the chip
434manufacturer. For example, hardware controller SPI2 would be bus number 2,
435and spi_board_info for devices connected to it would use that number.
436
437If you don't have such hardware-assigned bus number, and for some reason
438you can't just assign them, then provide a negative bus number. That will
439then be replaced by a dynamically assigned number. You'd then need to treat
440this as a non-static configuration (see above).
441
442
443SPI MASTER METHODS
418 444
419 master->setup(struct spi_device *spi) 445 master->setup(struct spi_device *spi)
420 This sets up the device clock rate, SPI mode, and word sizes. 446 This sets up the device clock rate, SPI mode, and word sizes.
@@ -431,6 +457,9 @@ also initialize its own internal state.
431 state it dynamically associates with that device. If you do that, 457 state it dynamically associates with that device. If you do that,
432 be sure to provide the cleanup() method to free that state. 458 be sure to provide the cleanup() method to free that state.
433 459
460
461SPI MESSAGE QUEUE
462
434The bulk of the driver will be managing the I/O queue fed by transfer(). 463The bulk of the driver will be managing the I/O queue fed by transfer().
435 464
436That queue could be purely conceptual. For example, a driver used only 465That queue could be purely conceptual. For example, a driver used only
@@ -440,6 +469,9 @@ But the queue will probably be very real, using message->queue, PIO,
440often DMA (especially if the root filesystem is in SPI flash), and 469often DMA (especially if the root filesystem is in SPI flash), and
441execution contexts like IRQ handlers, tasklets, or workqueues (such 470execution contexts like IRQ handlers, tasklets, or workqueues (such
442as keventd). Your driver can be as fancy, or as simple, as you need. 471as keventd). Your driver can be as fancy, or as simple, as you need.
472Such a transfer() method would normally just add the message to a
473queue, and then start some asynchronous transfer engine (unless it's
474already running).
443 475
444 476
445THANKS TO 477THANKS TO
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index 2803f63c1a27..687104bfd09a 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -32,7 +32,16 @@ The output of "cat /proc/meminfo" will have lines like:
32..... 32.....
33HugePages_Total: xxx 33HugePages_Total: xxx
34HugePages_Free: yyy 34HugePages_Free: yyy
35Hugepagesize: zzz KB 35HugePages_Rsvd: www
36Hugepagesize: zzz kB
37
38where:
39HugePages_Total is the size of the pool of hugepages.
40HugePages_Free is the number of hugepages in the pool that are not yet
41allocated.
42HugePages_Rsvd is short for "reserved," and is the number of hugepages
43for which a commitment to allocate from the pool has been made, but no
44allocation has yet been made. It's vaguely analogous to overcommit.
36 45
37/proc/filesystems should also show a filesystem of type "hugetlbfs" configured 46/proc/filesystems should also show a filesystem of type "hugetlbfs" configured
38in the kernel. 47in the kernel.
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt
index c5beb548cfc4..21ed51173662 100644
--- a/Documentation/watchdog/watchdog-api.txt
+++ b/Documentation/watchdog/watchdog-api.txt
@@ -36,6 +36,9 @@ timeout or margin. The simplest way to ping the watchdog is to write
36some data to the device. So a very simple watchdog daemon would look 36some data to the device. So a very simple watchdog daemon would look
37like this: 37like this:
38 38
39#include <stdlib.h>
40#include <fcntl.h>
41
39int main(int argc, const char *argv[]) { 42int main(int argc, const char *argv[]) {
40 int fd=open("/dev/watchdog",O_WRONLY); 43 int fd=open("/dev/watchdog",O_WRONLY);
41 if (fd==-1) { 44 if (fd==-1) {