diff options
Diffstat (limited to 'Documentation')
37 files changed, 3541 insertions, 590 deletions
diff --git a/Documentation/ABI/obsolete/dv1394 b/Documentation/ABI/obsolete/dv1394 new file mode 100644 index 000000000000..2ee36864ca10 --- /dev/null +++ b/Documentation/ABI/obsolete/dv1394 | |||
@@ -0,0 +1,9 @@ | |||
1 | What: dv1394 (a.k.a. "OHCI-DV I/O support" for FireWire) | ||
2 | Contact: linux1394-devel@lists.sourceforge.net | ||
3 | Description: | ||
4 | New application development should use raw1394 + userspace libraries | ||
5 | instead, notably libiec61883 which is functionally equivalent. | ||
6 | |||
7 | Users: | ||
8 | ffmpeg/libavformat (used by a variety of media players) | ||
9 | dvgrab v1.x (replaced by dvgrab2 on top of raw1394 and resp. libraries) | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb new file mode 100644 index 000000000000..f9937add033d --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -0,0 +1,41 @@ | |||
1 | What: /sys/bus/usb/devices/.../power/autosuspend | ||
2 | Date: March 2007 | ||
3 | KernelVersion: 2.6.21 | ||
4 | Contact: Alan Stern <stern@rowland.harvard.edu> | ||
5 | Description: | ||
6 | Each USB device directory will contain a file named | ||
7 | power/autosuspend. This file holds the time (in seconds) | ||
8 | the device must be idle before it will be autosuspended. | ||
9 | 0 means the device will be autosuspended as soon as | ||
10 | possible. Negative values will prevent the device from | ||
11 | being autosuspended at all, and writing a negative value | ||
12 | will resume the device if it is already suspended. | ||
13 | |||
14 | The autosuspend delay for newly-created devices is set to | ||
15 | the value of the usbcore.autosuspend module parameter. | ||
16 | |||
17 | What: /sys/bus/usb/devices/.../power/level | ||
18 | Date: March 2007 | ||
19 | KernelVersion: 2.6.21 | ||
20 | Contact: Alan Stern <stern@rowland.harvard.edu> | ||
21 | Description: | ||
22 | Each USB device directory will contain a file named | ||
23 | power/level. This file holds a power-level setting for | ||
24 | the device, one of "on", "auto", or "suspend". | ||
25 | |||
26 | "on" means that the device is not allowed to autosuspend, | ||
27 | although normal suspends for system sleep will still | ||
28 | be honored. "auto" means the device will autosuspend | ||
29 | and autoresume in the usual manner, according to the | ||
30 | capabilities of its driver. "suspend" means the device | ||
31 | is forced into a suspended state and it will not autoresume | ||
32 | in response to I/O requests. However remote-wakeup requests | ||
33 | from the device may still be enabled (the remote-wakeup | ||
34 | setting is controlled separately by the power/wakeup | ||
35 | attribute). | ||
36 | |||
37 | During normal use, devices should be left in the "auto" | ||
38 | level. The other levels are meant for administrative uses. | ||
39 | If you want to suspend a device immediately but leave it | ||
40 | free to wake up in response to I/O requests, you should | ||
41 | write "0" to power/autosuspend. | ||
diff --git a/Documentation/DocBook/kernel-api.tmpl b/Documentation/DocBook/kernel-api.tmpl index 0bb90237e230..b61dfc79e1b8 100644 --- a/Documentation/DocBook/kernel-api.tmpl +++ b/Documentation/DocBook/kernel-api.tmpl | |||
@@ -236,6 +236,12 @@ X!Ilib/string.c | |||
236 | !Enet/core/dev.c | 236 | !Enet/core/dev.c |
237 | !Enet/ethernet/eth.c | 237 | !Enet/ethernet/eth.c |
238 | !Iinclude/linux/etherdevice.h | 238 | !Iinclude/linux/etherdevice.h |
239 | !Edrivers/net/phy/phy.c | ||
240 | !Idrivers/net/phy/phy.c | ||
241 | !Edrivers/net/phy/phy_device.c | ||
242 | !Idrivers/net/phy/phy_device.c | ||
243 | !Edrivers/net/phy/mdio_bus.c | ||
244 | !Idrivers/net/phy/mdio_bus.c | ||
239 | <!-- FIXME: Removed for now since no structured comments in source | 245 | <!-- FIXME: Removed for now since no structured comments in source |
240 | X!Enet/core/wireless.c | 246 | X!Enet/core/wireless.c |
241 | --> | 247 | --> |
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index 842f0d1ab216..f2c0a6842930 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt | |||
@@ -557,6 +557,9 @@ Set some flags: | |||
557 | Add some cpus: | 557 | Add some cpus: |
558 | # /bin/echo 0-7 > cpus | 558 | # /bin/echo 0-7 > cpus |
559 | 559 | ||
560 | Add some mems: | ||
561 | # /bin/echo 0-7 > mems | ||
562 | |||
560 | Now attach your shell to this cpuset: | 563 | Now attach your shell to this cpuset: |
561 | # /bin/echo $$ > tasks | 564 | # /bin/echo $$ > tasks |
562 | 565 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 0bc8b0b2e103..5c88ba1ea262 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -6,6 +6,18 @@ be removed from this file. | |||
6 | 6 | ||
7 | --------------------------- | 7 | --------------------------- |
8 | 8 | ||
9 | What: V4L2 VIDIOC_G_MPEGCOMP and VIDIOC_S_MPEGCOMP | ||
10 | When: October 2007 | ||
11 | Why: Broken attempt to set MPEG compression parameters. These ioctls are | ||
12 | not able to implement the wide variety of parameters that can be set | ||
13 | by hardware MPEG encoders. A new MPEG control mechanism was created | ||
14 | in kernel 2.6.18 that replaces these ioctls. See the V4L2 specification | ||
15 | (section 1.9: Extended controls) for more information on this topic. | ||
16 | Who: Hans Verkuil <hverkuil@xs4all.nl> and | ||
17 | Mauro Carvalho Chehab <mchehab@infradead.org> | ||
18 | |||
19 | --------------------------- | ||
20 | |||
9 | What: /sys/devices/.../power/state | 21 | What: /sys/devices/.../power/state |
10 | dev->power.power_state | 22 | dev->power.power_state |
11 | dpm_runtime_{suspend,resume)() | 23 | dpm_runtime_{suspend,resume)() |
@@ -39,17 +51,6 @@ Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de> | |||
39 | 51 | ||
40 | --------------------------- | 52 | --------------------------- |
41 | 53 | ||
42 | What: dv1394 driver (CONFIG_IEEE1394_DV1394) | ||
43 | When: June 2007 | ||
44 | Why: Replaced by raw1394 + userspace libraries, notably libiec61883. This | ||
45 | shift of application support has been indicated on www.linux1394.org | ||
46 | and developers' mailinglists for quite some time. Major applications | ||
47 | have been converted, with the exception of ffmpeg and hence xine. | ||
48 | Piped output of dvgrab2 is a partial equivalent to dv1394. | ||
49 | Who: Dan Dennedy <dan@dennedy.org>, Stefan Richter <stefanr@s5r6.in-berlin.de> | ||
50 | |||
51 | --------------------------- | ||
52 | |||
53 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 54 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
54 | When: December 2006 | 55 | When: December 2006 |
55 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 | 56 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 |
@@ -145,15 +146,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com> | |||
145 | 146 | ||
146 | --------------------------- | 147 | --------------------------- |
147 | 148 | ||
148 | What: mount/umount uevents | ||
149 | When: February 2007 | ||
150 | Why: These events are not correct, and do not properly let userspace know | ||
151 | when a file system has been mounted or unmounted. Userspace should | ||
152 | poll the /proc/mounts file instead to detect this properly. | ||
153 | Who: Greg Kroah-Hartman <gregkh@suse.de> | ||
154 | |||
155 | --------------------------- | ||
156 | |||
157 | What: USB driver API moves to EXPORT_SYMBOL_GPL | 149 | What: USB driver API moves to EXPORT_SYMBOL_GPL |
158 | When: February 2008 | 150 | When: February 2008 |
159 | Files: include/linux/usb.h, drivers/usb/core/driver.c | 151 | Files: include/linux/usb.h, drivers/usb/core/driver.c |
@@ -222,15 +214,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
222 | 214 | ||
223 | --------------------------- | 215 | --------------------------- |
224 | 216 | ||
225 | What: IPv4 only connection tracking/NAT/helpers | ||
226 | When: 2.6.22 | ||
227 | Why: The new layer 3 independant connection tracking replaces the old | ||
228 | IPv4 only version. After some stabilization of the new code the | ||
229 | old one will be removed. | ||
230 | Who: Patrick McHardy <kaber@trash.net> | ||
231 | |||
232 | --------------------------- | ||
233 | |||
234 | What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver | 217 | What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver |
235 | When: December 2006 | 218 | When: December 2006 |
236 | Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are | 219 | Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are |
@@ -305,18 +288,6 @@ Who: Richard Purdie <rpurdie@rpsys.net> | |||
305 | 288 | ||
306 | --------------------------- | 289 | --------------------------- |
307 | 290 | ||
308 | What: Wireless extensions over netlink (CONFIG_NET_WIRELESS_RTNETLINK) | ||
309 | When: with the merge of wireless-dev, 2.6.22 or later | ||
310 | Why: The option/code is | ||
311 | * not enabled on most kernels | ||
312 | * not required by any userspace tools (except an experimental one, | ||
313 | and even there only for some parts, others use ioctl) | ||
314 | * pointless since wext is no longer evolving and the ioctl | ||
315 | interface needs to be kept | ||
316 | Who: Johannes Berg <johannes@sipsolutions.net> | ||
317 | |||
318 | --------------------------- | ||
319 | |||
320 | What: i8xx_tco watchdog driver | 291 | What: i8xx_tco watchdog driver |
321 | When: in 2.6.22 | 292 | When: in 2.6.22 |
322 | Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt | 293 | Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt |
@@ -324,3 +295,22 @@ Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt | |||
324 | Who: Wim Van Sebroeck <wim@iguana.be> | 295 | Who: Wim Van Sebroeck <wim@iguana.be> |
325 | 296 | ||
326 | --------------------------- | 297 | --------------------------- |
298 | |||
299 | What: Multipath cached routing support in ipv4 | ||
300 | When: in 2.6.23 | ||
301 | Why: Code was merged, then submitter immediately disappeared leaving | ||
302 | us with no maintainer and lots of bugs. The code should not have | ||
303 | been merged in the first place, and many aspects of it's | ||
304 | implementation are blocking more critical core networking | ||
305 | development. It's marked EXPERIMENTAL and no distribution | ||
306 | enables it because it cause obscure crashes due to unfixable bugs | ||
307 | (interfaces don't return errors so memory allocation can't be | ||
308 | handled, calling contexts of these interfaces make handling | ||
309 | errors impossible too because they get called after we've | ||
310 | totally commited to creating a route object, for example). | ||
311 | This problem has existed for years and no forward progress | ||
312 | has ever been made, and nobody steps up to try and salvage | ||
313 | this code, so we're going to finally just get rid of it. | ||
314 | Who: David S. Miller <davem@davemloft.net> | ||
315 | |||
316 | --------------------------- | ||
diff --git a/Documentation/filesystems/afs.txt b/Documentation/filesystems/afs.txt index 2f4237dfb8c7..12ad6c7f4e50 100644 --- a/Documentation/filesystems/afs.txt +++ b/Documentation/filesystems/afs.txt | |||
@@ -1,31 +1,82 @@ | |||
1 | ==================== | ||
1 | kAFS: AFS FILESYSTEM | 2 | kAFS: AFS FILESYSTEM |
2 | ==================== | 3 | ==================== |
3 | 4 | ||
4 | ABOUT | 5 | Contents: |
5 | ===== | 6 | |
7 | - Overview. | ||
8 | - Usage. | ||
9 | - Mountpoints. | ||
10 | - Proc filesystem. | ||
11 | - The cell database. | ||
12 | - Security. | ||
13 | - Examples. | ||
14 | |||
15 | |||
16 | ======== | ||
17 | OVERVIEW | ||
18 | ======== | ||
6 | 19 | ||
7 | This filesystem provides a fairly simple AFS filesystem driver. It is under | 20 | This filesystem provides a fairly simple secure AFS filesystem driver. It is |
8 | development and only provides very basic facilities. It does not yet support | 21 | under development and does not yet provide the full feature set. The features |
9 | the following AFS features: | 22 | it does support include: |
10 | 23 | ||
11 | (*) Write support. | 24 | (*) Security (currently only AFS kaserver and KerberosIV tickets). |
12 | (*) Communications security. | ||
13 | (*) Local caching. | ||
14 | (*) pioctl() system call. | ||
15 | (*) Automatic mounting of embedded mountpoints. | ||
16 | 25 | ||
26 | (*) File reading. | ||
17 | 27 | ||
28 | (*) Automounting. | ||
29 | |||
30 | It does not yet support the following AFS features: | ||
31 | |||
32 | (*) Write support. | ||
33 | |||
34 | (*) Local caching. | ||
35 | |||
36 | (*) pioctl() system call. | ||
37 | |||
38 | |||
39 | =========== | ||
40 | COMPILATION | ||
41 | =========== | ||
42 | |||
43 | The filesystem should be enabled by turning on the kernel configuration | ||
44 | options: | ||
45 | |||
46 | CONFIG_AF_RXRPC - The RxRPC protocol transport | ||
47 | CONFIG_RXKAD - The RxRPC Kerberos security handler | ||
48 | CONFIG_AFS - The AFS filesystem | ||
49 | |||
50 | Additionally, the following can be turned on to aid debugging: | ||
51 | |||
52 | CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled | ||
53 | CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled | ||
54 | |||
55 | They permit the debugging messages to be turned on dynamically by manipulating | ||
56 | the masks in the following files: | ||
57 | |||
58 | /sys/module/af_rxrpc/parameters/debug | ||
59 | /sys/module/afs/parameters/debug | ||
60 | |||
61 | |||
62 | ===== | ||
18 | USAGE | 63 | USAGE |
19 | ===== | 64 | ===== |
20 | 65 | ||
21 | When inserting the driver modules the root cell must be specified along with a | 66 | When inserting the driver modules the root cell must be specified along with a |
22 | list of volume location server IP addresses: | 67 | list of volume location server IP addresses: |
23 | 68 | ||
24 | insmod rxrpc.o | 69 | insmod af_rxrpc.o |
70 | insmod rxkad.o | ||
25 | insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91 | 71 | insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91 |
26 | 72 | ||
27 | The first module is a driver for the RxRPC remote operation protocol, and the | 73 | The first module is the AF_RXRPC network protocol driver. This provides the |
28 | second is the actual filesystem driver for the AFS filesystem. | 74 | RxRPC remote operation protocol and may also be accessed from userspace. See: |
75 | |||
76 | Documentation/networking/rxrpc.txt | ||
77 | |||
78 | The second module is the kerberos RxRPC security driver, and the third module | ||
79 | is the actual filesystem driver for the AFS filesystem. | ||
29 | 80 | ||
30 | Once the module has been loaded, more modules can be added by the following | 81 | Once the module has been loaded, more modules can be added by the following |
31 | procedure: | 82 | procedure: |
@@ -33,7 +84,7 @@ procedure: | |||
33 | echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells | 84 | echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells |
34 | 85 | ||
35 | Where the parameters to the "add" command are the name of a cell and a list of | 86 | Where the parameters to the "add" command are the name of a cell and a list of |
36 | volume location servers within that cell. | 87 | volume location servers within that cell, with the latter separated by colons. |
37 | 88 | ||
38 | Filesystems can be mounted anywhere by commands similar to the following: | 89 | Filesystems can be mounted anywhere by commands similar to the following: |
39 | 90 | ||
@@ -42,11 +93,6 @@ Filesystems can be mounted anywhere by commands similar to the following: | |||
42 | mount -t afs "#root.afs." /afs | 93 | mount -t afs "#root.afs." /afs |
43 | mount -t afs "#root.cell." /afs/cambridge | 94 | mount -t afs "#root.cell." /afs/cambridge |
44 | 95 | ||
45 | NB: When using this on Linux 2.4, the mount command has to be different, | ||
46 | since the filesystem doesn't have access to the device name argument: | ||
47 | |||
48 | mount -t afs none /afs -ovol="#root.afs." | ||
49 | |||
50 | Where the initial character is either a hash or a percent symbol depending on | 96 | Where the initial character is either a hash or a percent symbol depending on |
51 | whether you definitely want a R/W volume (hash) or whether you'd prefer a R/O | 97 | whether you definitely want a R/W volume (hash) or whether you'd prefer a R/O |
52 | volume, but are willing to use a R/W volume instead (percent). | 98 | volume, but are willing to use a R/W volume instead (percent). |
@@ -60,55 +106,66 @@ named volume will be looked up in the cell specified during insmod. | |||
60 | Additional cells can be added through /proc (see later section). | 106 | Additional cells can be added through /proc (see later section). |
61 | 107 | ||
62 | 108 | ||
109 | =========== | ||
63 | MOUNTPOINTS | 110 | MOUNTPOINTS |
64 | =========== | 111 | =========== |
65 | 112 | ||
66 | AFS has a concept of mountpoints. These are specially formatted symbolic links | 113 | AFS has a concept of mountpoints. In AFS terms, these are specially formatted |
67 | (of the same form as the "device name" passed to mount). kAFS presents these | 114 | symbolic links (of the same form as the "device name" passed to mount). kAFS |
68 | to the user as directories that have special properties: | 115 | presents these to the user as directories that have a follow-link capability |
116 | (ie: symbolic link semantics). If anyone attempts to access them, they will | ||
117 | automatically cause the target volume to be mounted (if possible) on that site. | ||
69 | 118 | ||
70 | (*) They cannot be listed. Running a program like "ls" on them will incur an | 119 | Automatically mounted filesystems will be automatically unmounted approximately |
71 | EREMOTE error (Object is remote). | 120 | twenty minutes after they were last used. Alternatively they can be unmounted |
121 | directly with the umount() system call. | ||
72 | 122 | ||
73 | (*) Other objects can't be looked up inside of them. This also incurs an | 123 | Manually unmounting an AFS volume will cause any idle submounts upon it to be |
74 | EREMOTE error. | 124 | culled first. If all are culled, then the requested volume will also be |
125 | unmounted, otherwise error EBUSY will be returned. | ||
75 | 126 | ||
76 | (*) They can be queried with the readlink() system call, which will return | 127 | This can be used by the administrator to attempt to unmount the whole AFS tree |
77 | the name of the mountpoint to which they point. The "readlink" program | 128 | mounted on /afs in one go by doing: |
78 | will also work. | ||
79 | 129 | ||
80 | (*) They can be mounted on (which symbolic links can't). | 130 | umount /afs |
81 | 131 | ||
82 | 132 | ||
133 | =============== | ||
83 | PROC FILESYSTEM | 134 | PROC FILESYSTEM |
84 | =============== | 135 | =============== |
85 | 136 | ||
86 | The rxrpc module creates a number of files in various places in the /proc | ||
87 | filesystem: | ||
88 | |||
89 | (*) Firstly, some information files are made available in a directory called | ||
90 | "/proc/net/rxrpc/". These list the extant transport endpoint, peer, | ||
91 | connection and call records. | ||
92 | |||
93 | (*) Secondly, some control files are made available in a directory called | ||
94 | "/proc/sys/rxrpc/". Currently, all these files can be used for is to | ||
95 | turn on various levels of tracing. | ||
96 | |||
97 | The AFS modules creates a "/proc/fs/afs/" directory and populates it: | 137 | The AFS modules creates a "/proc/fs/afs/" directory and populates it: |
98 | 138 | ||
99 | (*) A "cells" file that lists cells currently known to the afs module. | 139 | (*) A "cells" file that lists cells currently known to the afs module and |
140 | their usage counts: | ||
141 | |||
142 | [root@andromeda ~]# cat /proc/fs/afs/cells | ||
143 | USE NAME | ||
144 | 3 cambridge.redhat.com | ||
100 | 145 | ||
101 | (*) A directory per cell that contains files that list volume location | 146 | (*) A directory per cell that contains files that list volume location |
102 | servers, volumes, and active servers known within that cell. | 147 | servers, volumes, and active servers known within that cell. |
103 | 148 | ||
149 | [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers | ||
150 | USE ADDR STATE | ||
151 | 4 172.16.18.91 0 | ||
152 | [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers | ||
153 | ADDRESS | ||
154 | 172.16.18.91 | ||
155 | [root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes | ||
156 | USE STT VLID[0] VLID[1] VLID[2] NAME | ||
157 | 1 Val 20000000 20000001 20000002 root.afs | ||
104 | 158 | ||
159 | |||
160 | ================= | ||
105 | THE CELL DATABASE | 161 | THE CELL DATABASE |
106 | ================= | 162 | ================= |
107 | 163 | ||
108 | The filesystem maintains an internal database of all the cells it knows and | 164 | The filesystem maintains an internal database of all the cells it knows and the |
109 | the IP addresses of the volume location servers for those cells. The cell to | 165 | IP addresses of the volume location servers for those cells. The cell to which |
110 | which the computer belongs is added to the database when insmod is performed | 166 | the system belongs is added to the database when insmod is performed by the |
111 | by the "rootcell=" argument. | 167 | "rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on |
168 | the kernel command line. | ||
112 | 169 | ||
113 | Further cells can be added by commands similar to the following: | 170 | Further cells can be added by commands similar to the following: |
114 | 171 | ||
@@ -118,20 +175,65 @@ Further cells can be added by commands similar to the following: | |||
118 | No other cell database operations are available at this time. | 175 | No other cell database operations are available at this time. |
119 | 176 | ||
120 | 177 | ||
178 | ======== | ||
179 | SECURITY | ||
180 | ======== | ||
181 | |||
182 | Secure operations are initiated by acquiring a key using the klog program. A | ||
183 | very primitive klog program is available at: | ||
184 | |||
185 | http://people.redhat.com/~dhowells/rxrpc/klog.c | ||
186 | |||
187 | This should be compiled by: | ||
188 | |||
189 | make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils" | ||
190 | |||
191 | And then run as: | ||
192 | |||
193 | ./klog | ||
194 | |||
195 | Assuming it's successful, this adds a key of type RxRPC, named for the service | ||
196 | and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or | ||
197 | by cat'ing /proc/keys: | ||
198 | |||
199 | [root@andromeda ~]# keyctl show | ||
200 | Session Keyring | ||
201 | -3 --alswrv 0 0 keyring: _ses.3268 | ||
202 | 2 --alswrv 0 0 \_ keyring: _uid.0 | ||
203 | 111416553 --als--v 0 0 \_ rxrpc: afs@CAMBRIDGE.REDHAT.COM | ||
204 | |||
205 | Currently the username, realm, password and proposed ticket lifetime are | ||
206 | compiled in to the program. | ||
207 | |||
208 | It is not required to acquire a key before using AFS facilities, but if one is | ||
209 | not acquired then all operations will be governed by the anonymous user parts | ||
210 | of the ACLs. | ||
211 | |||
212 | If a key is acquired, then all AFS operations, including mounts and automounts, | ||
213 | made by a possessor of that key will be secured with that key. | ||
214 | |||
215 | If a file is opened with a particular key and then the file descriptor is | ||
216 | passed to a process that doesn't have that key (perhaps over an AF_UNIX | ||
217 | socket), then the operations on the file will be made with key that was used to | ||
218 | open the file. | ||
219 | |||
220 | |||
221 | ======== | ||
121 | EXAMPLES | 222 | EXAMPLES |
122 | ======== | 223 | ======== |
123 | 224 | ||
124 | Here's what I use to test this. Some of the names and IP addresses are local | 225 | Here's what I use to test this. Some of the names and IP addresses are local |
125 | to my internal DNS. My "root.afs" partition has a mount point within it for | 226 | to my internal DNS. My "root.afs" partition has a mount point within it for |
126 | some public volumes volumes. | 227 | some public volumes volumes. |
127 | 228 | ||
128 | insmod -S /tmp/rxrpc.o | 229 | insmod /tmp/rxrpc.o |
129 | insmod -S /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91 | 230 | insmod /tmp/rxkad.o |
231 | insmod /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.91 | ||
130 | 232 | ||
131 | mount -t afs \%root.afs. /afs | 233 | mount -t afs \%root.afs. /afs |
132 | mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/ | 234 | mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/ |
133 | 235 | ||
134 | echo add grand.central.org 18.7.14.88:128.2.191.224 > /proc/fs/afs/cells | 236 | echo add grand.central.org 18.7.14.88:128.2.191.224 > /proc/fs/afs/cells |
135 | mount -t afs "#grand.central.org:root.cell." /afs/grand.central.org/ | 237 | mount -t afs "#grand.central.org:root.cell." /afs/grand.central.org/ |
136 | mount -t afs "#grand.central.org:root.archive." /afs/grand.central.org/archive | 238 | mount -t afs "#grand.central.org:root.archive." /afs/grand.central.org/archive |
137 | mount -t afs "#grand.central.org:root.contrib." /afs/grand.central.org/contrib | 239 | mount -t afs "#grand.central.org:root.contrib." /afs/grand.central.org/contrib |
@@ -141,15 +243,7 @@ mount -t afs "#grand.central.org:root.service." /afs/grand.central.org/service | |||
141 | mount -t afs "#grand.central.org:root.software." /afs/grand.central.org/software | 243 | mount -t afs "#grand.central.org:root.software." /afs/grand.central.org/software |
142 | mount -t afs "#grand.central.org:root.user." /afs/grand.central.org/user | 244 | mount -t afs "#grand.central.org:root.user." /afs/grand.central.org/user |
143 | 245 | ||
144 | umount /afs/grand.central.org/user | ||
145 | umount /afs/grand.central.org/software | ||
146 | umount /afs/grand.central.org/service | ||
147 | umount /afs/grand.central.org/project | ||
148 | umount /afs/grand.central.org/doc | ||
149 | umount /afs/grand.central.org/contrib | ||
150 | umount /afs/grand.central.org/archive | ||
151 | umount /afs/grand.central.org | ||
152 | umount /afs/cambridge.redhat.com | ||
153 | umount /afs | 246 | umount /afs |
154 | rmmod kafs | 247 | rmmod kafs |
248 | rmmod rxkad | ||
155 | rmmod rxrpc | 249 | rmmod rxrpc |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 5484ab5efd4f..7aaf09b86a55 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -1421,6 +1421,15 @@ fewer messages that will be written. Message_burst controls when messages will | |||
1421 | be dropped. The default settings limit warning messages to one every five | 1421 | be dropped. The default settings limit warning messages to one every five |
1422 | seconds. | 1422 | seconds. |
1423 | 1423 | ||
1424 | warnings | ||
1425 | -------- | ||
1426 | |||
1427 | This controls console messages from the networking stack that can occur because | ||
1428 | of problems on the network like duplicate address or bad checksums. Normally, | ||
1429 | this should be enabled, but if the problem persists the messages can be | ||
1430 | disabled. | ||
1431 | |||
1432 | |||
1424 | netdev_max_backlog | 1433 | netdev_max_backlog |
1425 | ------------------ | 1434 | ------------------ |
1426 | 1435 | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 989f1130f4f3..f8528db967fa 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -27,7 +27,7 @@ The exact capabilities of GPIOs vary between systems. Common options: | |||
27 | - Output values are writable (high=1, low=0). Some chips also have | 27 | - Output values are writable (high=1, low=0). Some chips also have |
28 | options about how that value is driven, so that for example only one | 28 | options about how that value is driven, so that for example only one |
29 | value might be driven ... supporting "wire-OR" and similar schemes | 29 | value might be driven ... supporting "wire-OR" and similar schemes |
30 | for the other value. | 30 | for the other value (notably, "open drain" signaling). |
31 | 31 | ||
32 | - Input values are likewise readable (1, 0). Some chips support readback | 32 | - Input values are likewise readable (1, 0). Some chips support readback |
33 | of pins configured as "output", which is very useful in such "wire-OR" | 33 | of pins configured as "output", which is very useful in such "wire-OR" |
@@ -247,6 +247,35 @@ with gpio_get_value(), for example to initialize or update driver state | |||
247 | when the IRQ is edge-triggered. | 247 | when the IRQ is edge-triggered. |
248 | 248 | ||
249 | 249 | ||
250 | Emulating Open Drain Signals | ||
251 | ---------------------------- | ||
252 | Sometimes shared signals need to use "open drain" signaling, where only the | ||
253 | low signal level is actually driven. (That term applies to CMOS transistors; | ||
254 | "open collector" is used for TTL.) A pullup resistor causes the high signal | ||
255 | level. This is sometimes called a "wire-AND"; or more practically, from the | ||
256 | negative logic (low=true) perspective this is a "wire-OR". | ||
257 | |||
258 | One common example of an open drain signal is a shared active-low IRQ line. | ||
259 | Also, bidirectional data bus signals sometimes use open drain signals. | ||
260 | |||
261 | Some GPIO controllers directly support open drain outputs; many don't. When | ||
262 | you need open drain signaling but your hardware doesn't directly support it, | ||
263 | there's a common idiom you can use to emulate it with any GPIO pin that can | ||
264 | be used as either an input or an output: | ||
265 | |||
266 | LOW: gpio_direction_output(gpio, 0) ... this drives the signal | ||
267 | and overrides the pullup. | ||
268 | |||
269 | HIGH: gpio_direction_input(gpio) ... this turns off the output, | ||
270 | so the pullup (or some other device) controls the signal. | ||
271 | |||
272 | If you are "driving" the signal high but gpio_get_value(gpio) reports a low | ||
273 | value (after the appropriate rise time passes), you know some other component | ||
274 | is driving the shared signal low. That's not necessarily an error. As one | ||
275 | common example, that's how I2C clocks are stretched: a slave that needs a | ||
276 | slower clock delays the rising edge of SCK, and the I2C master adjusts its | ||
277 | signaling rate accordingly. | ||
278 | |||
250 | 279 | ||
251 | What do these conventions omit? | 280 | What do these conventions omit? |
252 | =============================== | 281 | =============================== |
diff --git a/Documentation/ia64/err_inject.txt b/Documentation/ia64/err_inject.txt new file mode 100644 index 000000000000..6449a7090dbb --- /dev/null +++ b/Documentation/ia64/err_inject.txt | |||
@@ -0,0 +1,1068 @@ | |||
1 | |||
2 | IPF Machine Check (MC) error inject tool | ||
3 | ======================================== | ||
4 | |||
5 | IPF Machine Check (MC) error inject tool is used to inject MC | ||
6 | errors from Linux. The tool is a test bed for IPF MC work flow including | ||
7 | hardware correctable error handling, OS recoverable error handling, MC | ||
8 | event logging, etc. | ||
9 | |||
10 | The tool includes two parts: a kernel driver and a user application | ||
11 | sample. The driver provides interface to PAL to inject error | ||
12 | and query error injection capabilities. The driver code is in | ||
13 | arch/ia64/kernel/err_inject.c. The application sample (shown below) | ||
14 | provides a combination of various errors and calls the driver's interface | ||
15 | (sysfs interface) to inject errors or query error injection capabilities. | ||
16 | |||
17 | The tool can be used to test Intel IPF machine MC handling capabilities. | ||
18 | It's especially useful for people who can not access hardware MC injection | ||
19 | tool to inject error. It's also very useful to integrate with other | ||
20 | software test suits to do stressful testing on IPF. | ||
21 | |||
22 | Below is a sample application as part of the whole tool. The sample | ||
23 | can be used as a working test tool. Or it can be expanded to include | ||
24 | more features. It also can be a integrated into a libary or other user | ||
25 | application to have more thorough test. | ||
26 | |||
27 | The sample application takes err.conf as error configuation input. Gcc | ||
28 | compiles the code. After you install err_inject driver, you can run | ||
29 | this sample application to inject errors. | ||
30 | |||
31 | Errata: Itanium 2 Processors Specification Update lists some errata against | ||
32 | the pal_mc_error_inject PAL procedure. The following err.conf has been tested | ||
33 | on latest Montecito PAL. | ||
34 | |||
35 | err.conf: | ||
36 | |||
37 | #This is configuration file for err_inject_tool. | ||
38 | #The format of the each line is: | ||
39 | #cpu, loop, interval, err_type_info, err_struct_info, err_data_buffer | ||
40 | #where | ||
41 | # cpu: logical cpu number the error will be inject in. | ||
42 | # loop: times the error will be injected. | ||
43 | # interval: In second. every so often one error is injected. | ||
44 | # err_type_info, err_struct_info: PAL parameters. | ||
45 | # | ||
46 | #Note: All values are hex w/o or w/ 0x prefix. | ||
47 | |||
48 | |||
49 | #On cpu2, inject only total 0x10 errors, interval 5 seconds | ||
50 | #corrected, data cache, hier-2, physical addr(assigned by tool code). | ||
51 | #working on Montecito latest PAL. | ||
52 | 2, 10, 5, 4101, 95 | ||
53 | |||
54 | #On cpu4, inject and consume total 0x10 errors, interval 5 seconds | ||
55 | #corrected, data cache, hier-2, physical addr(assigned by tool code). | ||
56 | #working on Montecito latest PAL. | ||
57 | 4, 10, 5, 4109, 95 | ||
58 | |||
59 | #On cpu15, inject and consume total 0x10 errors, interval 5 seconds | ||
60 | #recoverable, DTR0, hier-2. | ||
61 | #working on Montecito latest PAL. | ||
62 | 0xf, 0x10, 5, 4249, 15 | ||
63 | |||
64 | The sample application source code: | ||
65 | |||
66 | err_injection_tool.c: | ||
67 | |||
68 | /* | ||
69 | * This program is free software; you can redistribute it and/or modify | ||
70 | * it under the terms of the GNU General Public License as published by | ||
71 | * the Free Software Foundation; either version 2 of the License, or | ||
72 | * (at your option) any later version. | ||
73 | * | ||
74 | * This program is distributed in the hope that it will be useful, but | ||
75 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
76 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
77 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
78 | * details. | ||
79 | * | ||
80 | * You should have received a copy of the GNU General Public License | ||
81 | * along with this program; if not, write to the Free Software | ||
82 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
83 | * | ||
84 | * Copyright (C) 2006 Intel Co | ||
85 | * Fenghua Yu <fenghua.yu@intel.com> | ||
86 | * | ||
87 | */ | ||
88 | #include <sys/types.h> | ||
89 | #include <sys/stat.h> | ||
90 | #include <fcntl.h> | ||
91 | #include <stdio.h> | ||
92 | #include <sched.h> | ||
93 | #include <unistd.h> | ||
94 | #include <stdlib.h> | ||
95 | #include <stdarg.h> | ||
96 | #include <string.h> | ||
97 | #include <errno.h> | ||
98 | #include <time.h> | ||
99 | #include <sys/ipc.h> | ||
100 | #include <sys/sem.h> | ||
101 | #include <sys/wait.h> | ||
102 | #include <sys/mman.h> | ||
103 | #include <sys/shm.h> | ||
104 | |||
105 | #define MAX_FN_SIZE 256 | ||
106 | #define MAX_BUF_SIZE 256 | ||
107 | #define DATA_BUF_SIZE 256 | ||
108 | #define NR_CPUS 512 | ||
109 | #define MAX_TASK_NUM 2048 | ||
110 | #define MIN_INTERVAL 5 // seconds | ||
111 | #define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte. | ||
112 | #define PARA_FIELD_NUM 5 | ||
113 | #define MASK_SIZE (NR_CPUS/64) | ||
114 | #define PATH_FORMAT "/sys/devices/system/cpu/cpu%d/err_inject/" | ||
115 | |||
116 | int sched_setaffinity(pid_t pid, unsigned int len, unsigned long *mask); | ||
117 | |||
118 | int verbose; | ||
119 | #define vbprintf if (verbose) printf | ||
120 | |||
121 | int log_info(int cpu, const char *fmt, ...) | ||
122 | { | ||
123 | FILE *log; | ||
124 | char fn[MAX_FN_SIZE]; | ||
125 | char buf[MAX_BUF_SIZE]; | ||
126 | va_list args; | ||
127 | |||
128 | sprintf(fn, "%d.log", cpu); | ||
129 | log=fopen(fn, "a+"); | ||
130 | if (log==NULL) { | ||
131 | perror("Error open:"); | ||
132 | return -1; | ||
133 | } | ||
134 | |||
135 | va_start(args, fmt); | ||
136 | vprintf(fmt, args); | ||
137 | memset(buf, 0, MAX_BUF_SIZE); | ||
138 | vsprintf(buf, fmt, args); | ||
139 | va_end(args); | ||
140 | |||
141 | fwrite(buf, sizeof(buf), 1, log); | ||
142 | fclose(log); | ||
143 | |||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | typedef unsigned long u64; | ||
148 | typedef unsigned int u32; | ||
149 | |||
150 | typedef union err_type_info_u { | ||
151 | struct { | ||
152 | u64 mode : 3, /* 0-2 */ | ||
153 | err_inj : 3, /* 3-5 */ | ||
154 | err_sev : 2, /* 6-7 */ | ||
155 | err_struct : 5, /* 8-12 */ | ||
156 | struct_hier : 3, /* 13-15 */ | ||
157 | reserved : 48; /* 16-63 */ | ||
158 | } err_type_info_u; | ||
159 | u64 err_type_info; | ||
160 | } err_type_info_t; | ||
161 | |||
162 | typedef union err_struct_info_u { | ||
163 | struct { | ||
164 | u64 siv : 1, /* 0 */ | ||
165 | c_t : 2, /* 1-2 */ | ||
166 | cl_p : 3, /* 3-5 */ | ||
167 | cl_id : 3, /* 6-8 */ | ||
168 | cl_dp : 1, /* 9 */ | ||
169 | reserved1 : 22, /* 10-31 */ | ||
170 | tiv : 1, /* 32 */ | ||
171 | trigger : 4, /* 33-36 */ | ||
172 | trigger_pl : 3, /* 37-39 */ | ||
173 | reserved2 : 24; /* 40-63 */ | ||
174 | } err_struct_info_cache; | ||
175 | struct { | ||
176 | u64 siv : 1, /* 0 */ | ||
177 | tt : 2, /* 1-2 */ | ||
178 | tc_tr : 2, /* 3-4 */ | ||
179 | tr_slot : 8, /* 5-12 */ | ||
180 | reserved1 : 19, /* 13-31 */ | ||
181 | tiv : 1, /* 32 */ | ||
182 | trigger : 4, /* 33-36 */ | ||
183 | trigger_pl : 3, /* 37-39 */ | ||
184 | reserved2 : 24; /* 40-63 */ | ||
185 | } err_struct_info_tlb; | ||
186 | struct { | ||
187 | u64 siv : 1, /* 0 */ | ||
188 | regfile_id : 4, /* 1-4 */ | ||
189 | reg_num : 7, /* 5-11 */ | ||
190 | reserved1 : 20, /* 12-31 */ | ||
191 | tiv : 1, /* 32 */ | ||
192 | trigger : 4, /* 33-36 */ | ||
193 | trigger_pl : 3, /* 37-39 */ | ||
194 | reserved2 : 24; /* 40-63 */ | ||
195 | } err_struct_info_register; | ||
196 | struct { | ||
197 | u64 reserved; | ||
198 | } err_struct_info_bus_processor_interconnect; | ||
199 | u64 err_struct_info; | ||
200 | } err_struct_info_t; | ||
201 | |||
202 | typedef union err_data_buffer_u { | ||
203 | struct { | ||
204 | u64 trigger_addr; /* 0-63 */ | ||
205 | u64 inj_addr; /* 64-127 */ | ||
206 | u64 way : 5, /* 128-132 */ | ||
207 | index : 20, /* 133-152 */ | ||
208 | : 39; /* 153-191 */ | ||
209 | } err_data_buffer_cache; | ||
210 | struct { | ||
211 | u64 trigger_addr; /* 0-63 */ | ||
212 | u64 inj_addr; /* 64-127 */ | ||
213 | u64 way : 5, /* 128-132 */ | ||
214 | index : 20, /* 133-152 */ | ||
215 | reserved : 39; /* 153-191 */ | ||
216 | } err_data_buffer_tlb; | ||
217 | struct { | ||
218 | u64 trigger_addr; /* 0-63 */ | ||
219 | } err_data_buffer_register; | ||
220 | struct { | ||
221 | u64 reserved; /* 0-63 */ | ||
222 | } err_data_buffer_bus_processor_interconnect; | ||
223 | u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; | ||
224 | } err_data_buffer_t; | ||
225 | |||
226 | typedef union capabilities_u { | ||
227 | struct { | ||
228 | u64 i : 1, | ||
229 | d : 1, | ||
230 | rv : 1, | ||
231 | tag : 1, | ||
232 | data : 1, | ||
233 | mesi : 1, | ||
234 | dp : 1, | ||
235 | reserved1 : 3, | ||
236 | pa : 1, | ||
237 | va : 1, | ||
238 | wi : 1, | ||
239 | reserved2 : 20, | ||
240 | trigger : 1, | ||
241 | trigger_pl : 1, | ||
242 | reserved3 : 30; | ||
243 | } capabilities_cache; | ||
244 | struct { | ||
245 | u64 d : 1, | ||
246 | i : 1, | ||
247 | rv : 1, | ||
248 | tc : 1, | ||
249 | tr : 1, | ||
250 | reserved1 : 27, | ||
251 | trigger : 1, | ||
252 | trigger_pl : 1, | ||
253 | reserved2 : 30; | ||
254 | } capabilities_tlb; | ||
255 | struct { | ||
256 | u64 gr_b0 : 1, | ||
257 | gr_b1 : 1, | ||
258 | fr : 1, | ||
259 | br : 1, | ||
260 | pr : 1, | ||
261 | ar : 1, | ||
262 | cr : 1, | ||
263 | rr : 1, | ||
264 | pkr : 1, | ||
265 | dbr : 1, | ||
266 | ibr : 1, | ||
267 | pmc : 1, | ||
268 | pmd : 1, | ||
269 | reserved1 : 3, | ||
270 | regnum : 1, | ||
271 | reserved2 : 15, | ||
272 | trigger : 1, | ||
273 | trigger_pl : 1, | ||
274 | reserved3 : 30; | ||
275 | } capabilities_register; | ||
276 | struct { | ||
277 | u64 reserved; | ||
278 | } capabilities_bus_processor_interconnect; | ||
279 | } capabilities_t; | ||
280 | |||
281 | typedef struct resources_s { | ||
282 | u64 ibr0 : 1, | ||
283 | ibr2 : 1, | ||
284 | ibr4 : 1, | ||
285 | ibr6 : 1, | ||
286 | dbr0 : 1, | ||
287 | dbr2 : 1, | ||
288 | dbr4 : 1, | ||
289 | dbr6 : 1, | ||
290 | reserved : 48; | ||
291 | } resources_t; | ||
292 | |||
293 | |||
294 | long get_page_size(void) | ||
295 | { | ||
296 | long page_size=sysconf(_SC_PAGESIZE); | ||
297 | return page_size; | ||
298 | } | ||
299 | |||
300 | #define PAGE_SIZE (get_page_size()==-1?0x4000:get_page_size()) | ||
301 | #define SHM_SIZE (2*PAGE_SIZE*NR_CPUS) | ||
302 | #define SHM_VA 0x2000000100000000 | ||
303 | |||
304 | int shmid; | ||
305 | void *shmaddr; | ||
306 | |||
307 | int create_shm(void) | ||
308 | { | ||
309 | key_t key; | ||
310 | char fn[MAX_FN_SIZE]; | ||
311 | |||
312 | /* cpu0 is always existing */ | ||
313 | sprintf(fn, PATH_FORMAT, 0); | ||
314 | if ((key = ftok(fn, 's')) == -1) { | ||
315 | perror("ftok"); | ||
316 | return -1; | ||
317 | } | ||
318 | |||
319 | shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT); | ||
320 | if (shmid == -1) { | ||
321 | if (errno==EEXIST) { | ||
322 | shmid = shmget(key, SHM_SIZE, 0); | ||
323 | if (shmid == -1) { | ||
324 | perror("shmget"); | ||
325 | return -1; | ||
326 | } | ||
327 | } | ||
328 | else { | ||
329 | perror("shmget"); | ||
330 | return -1; | ||
331 | } | ||
332 | } | ||
333 | vbprintf("shmid=%d", shmid); | ||
334 | |||
335 | /* connect to the segment: */ | ||
336 | shmaddr = shmat(shmid, (void *)SHM_VA, 0); | ||
337 | if (shmaddr == (void*)-1) { | ||
338 | perror("shmat"); | ||
339 | return -1; | ||
340 | } | ||
341 | |||
342 | memset(shmaddr, 0, SHM_SIZE); | ||
343 | mlock(shmaddr, SHM_SIZE); | ||
344 | |||
345 | return 0; | ||
346 | } | ||
347 | |||
348 | int free_shm() | ||
349 | { | ||
350 | munlock(shmaddr, SHM_SIZE); | ||
351 | shmdt(shmaddr); | ||
352 | semctl(shmid, 0, IPC_RMID); | ||
353 | |||
354 | return 0; | ||
355 | } | ||
356 | |||
357 | #ifdef _SEM_SEMUN_UNDEFINED | ||
358 | union semun | ||
359 | { | ||
360 | int val; | ||
361 | struct semid_ds *buf; | ||
362 | unsigned short int *array; | ||
363 | struct seminfo *__buf; | ||
364 | }; | ||
365 | #endif | ||
366 | |||
367 | u32 mode=1; /* 1: physical mode; 2: virtual mode. */ | ||
368 | int one_lock=1; | ||
369 | key_t key[NR_CPUS]; | ||
370 | int semid[NR_CPUS]; | ||
371 | |||
372 | int create_sem(int cpu) | ||
373 | { | ||
374 | union semun arg; | ||
375 | char fn[MAX_FN_SIZE]; | ||
376 | int sid; | ||
377 | |||
378 | sprintf(fn, PATH_FORMAT, cpu); | ||
379 | sprintf(fn, "%s/%s", fn, "err_type_info"); | ||
380 | if ((key[cpu] = ftok(fn, 'e')) == -1) { | ||
381 | perror("ftok"); | ||
382 | return -1; | ||
383 | } | ||
384 | |||
385 | if (semid[cpu]!=0) | ||
386 | return 0; | ||
387 | |||
388 | /* clear old semaphore */ | ||
389 | if ((sid = semget(key[cpu], 1, 0)) != -1) | ||
390 | semctl(sid, 0, IPC_RMID); | ||
391 | |||
392 | /* get one semaphore */ | ||
393 | if ((semid[cpu] = semget(key[cpu], 1, IPC_CREAT | IPC_EXCL)) == -1) { | ||
394 | perror("semget"); | ||
395 | printf("Please remove semaphore with key=0x%lx, then run the tool.\n", | ||
396 | (u64)key[cpu]); | ||
397 | return -1; | ||
398 | } | ||
399 | |||
400 | vbprintf("semid[%d]=0x%lx, key[%d]=%lx\n",cpu,(u64)semid[cpu],cpu, | ||
401 | (u64)key[cpu]); | ||
402 | /* initialize the semaphore to 1: */ | ||
403 | arg.val = 1; | ||
404 | if (semctl(semid[cpu], 0, SETVAL, arg) == -1) { | ||
405 | perror("semctl"); | ||
406 | return -1; | ||
407 | } | ||
408 | |||
409 | return 0; | ||
410 | } | ||
411 | |||
412 | static int lock(int cpu) | ||
413 | { | ||
414 | struct sembuf lock; | ||
415 | |||
416 | lock.sem_num = cpu; | ||
417 | lock.sem_op = 1; | ||
418 | semop(semid[cpu], &lock, 1); | ||
419 | |||
420 | return 0; | ||
421 | } | ||
422 | |||
423 | static int unlock(int cpu) | ||
424 | { | ||
425 | struct sembuf unlock; | ||
426 | |||
427 | unlock.sem_num = cpu; | ||
428 | unlock.sem_op = -1; | ||
429 | semop(semid[cpu], &unlock, 1); | ||
430 | |||
431 | return 0; | ||
432 | } | ||
433 | |||
434 | void free_sem(int cpu) | ||
435 | { | ||
436 | semctl(semid[cpu], 0, IPC_RMID); | ||
437 | } | ||
438 | |||
439 | int wr_multi(char *fn, unsigned long *data, int size) | ||
440 | { | ||
441 | int fd; | ||
442 | char buf[MAX_BUF_SIZE]; | ||
443 | int ret; | ||
444 | |||
445 | if (size==1) | ||
446 | sprintf(buf, "%lx", *data); | ||
447 | else if (size==3) | ||
448 | sprintf(buf, "%lx,%lx,%lx", data[0], data[1], data[2]); | ||
449 | else { | ||
450 | fprintf(stderr,"write to file with wrong size!\n"); | ||
451 | return -1; | ||
452 | } | ||
453 | |||
454 | fd=open(fn, O_RDWR); | ||
455 | if (!fd) { | ||
456 | perror("Error:"); | ||
457 | return -1; | ||
458 | } | ||
459 | ret=write(fd, buf, sizeof(buf)); | ||
460 | close(fd); | ||
461 | return ret; | ||
462 | } | ||
463 | |||
464 | int wr(char *fn, unsigned long data) | ||
465 | { | ||
466 | return wr_multi(fn, &data, 1); | ||
467 | } | ||
468 | |||
469 | int rd(char *fn, unsigned long *data) | ||
470 | { | ||
471 | int fd; | ||
472 | char buf[MAX_BUF_SIZE]; | ||
473 | |||
474 | fd=open(fn, O_RDONLY); | ||
475 | if (fd<0) { | ||
476 | perror("Error:"); | ||
477 | return -1; | ||
478 | } | ||
479 | read(fd, buf, MAX_BUF_SIZE); | ||
480 | *data=strtoul(buf, NULL, 16); | ||
481 | close(fd); | ||
482 | return 0; | ||
483 | } | ||
484 | |||
485 | int rd_status(char *path, int *status) | ||
486 | { | ||
487 | char fn[MAX_FN_SIZE]; | ||
488 | sprintf(fn, "%s/status", path); | ||
489 | if (rd(fn, (u64*)status)<0) { | ||
490 | perror("status reading error.\n"); | ||
491 | return -1; | ||
492 | } | ||
493 | |||
494 | return 0; | ||
495 | } | ||
496 | |||
497 | int rd_capabilities(char *path, u64 *capabilities) | ||
498 | { | ||
499 | char fn[MAX_FN_SIZE]; | ||
500 | sprintf(fn, "%s/capabilities", path); | ||
501 | if (rd(fn, capabilities)<0) { | ||
502 | perror("capabilities reading error.\n"); | ||
503 | return -1; | ||
504 | } | ||
505 | |||
506 | return 0; | ||
507 | } | ||
508 | |||
509 | int rd_all(char *path) | ||
510 | { | ||
511 | unsigned long err_type_info, err_struct_info, err_data_buffer; | ||
512 | int status; | ||
513 | unsigned long capabilities, resources; | ||
514 | char fn[MAX_FN_SIZE]; | ||
515 | |||
516 | sprintf(fn, "%s/err_type_info", path); | ||
517 | if (rd(fn, &err_type_info)<0) { | ||
518 | perror("err_type_info reading error.\n"); | ||
519 | return -1; | ||
520 | } | ||
521 | printf("err_type_info=%lx\n", err_type_info); | ||
522 | |||
523 | sprintf(fn, "%s/err_struct_info", path); | ||
524 | if (rd(fn, &err_struct_info)<0) { | ||
525 | perror("err_struct_info reading error.\n"); | ||
526 | return -1; | ||
527 | } | ||
528 | printf("err_struct_info=%lx\n", err_struct_info); | ||
529 | |||
530 | sprintf(fn, "%s/err_data_buffer", path); | ||
531 | if (rd(fn, &err_data_buffer)<0) { | ||
532 | perror("err_data_buffer reading error.\n"); | ||
533 | return -1; | ||
534 | } | ||
535 | printf("err_data_buffer=%lx\n", err_data_buffer); | ||
536 | |||
537 | sprintf(fn, "%s/status", path); | ||
538 | if (rd("status", (u64*)&status)<0) { | ||
539 | perror("status reading error.\n"); | ||
540 | return -1; | ||
541 | } | ||
542 | printf("status=%d\n", status); | ||
543 | |||
544 | sprintf(fn, "%s/capabilities", path); | ||
545 | if (rd(fn,&capabilities)<0) { | ||
546 | perror("capabilities reading error.\n"); | ||
547 | return -1; | ||
548 | } | ||
549 | printf("capabilities=%lx\n", capabilities); | ||
550 | |||
551 | sprintf(fn, "%s/resources", path); | ||
552 | if (rd(fn, &resources)<0) { | ||
553 | perror("resources reading error.\n"); | ||
554 | return -1; | ||
555 | } | ||
556 | printf("resources=%lx\n", resources); | ||
557 | |||
558 | return 0; | ||
559 | } | ||
560 | |||
561 | int query_capabilities(char *path, err_type_info_t err_type_info, | ||
562 | u64 *capabilities) | ||
563 | { | ||
564 | char fn[MAX_FN_SIZE]; | ||
565 | err_struct_info_t err_struct_info; | ||
566 | err_data_buffer_t err_data_buffer; | ||
567 | |||
568 | err_struct_info.err_struct_info=0; | ||
569 | memset(err_data_buffer.err_data_buffer, -1, ERR_DATA_BUFFER_SIZE*8); | ||
570 | |||
571 | sprintf(fn, "%s/err_type_info", path); | ||
572 | wr(fn, err_type_info.err_type_info); | ||
573 | sprintf(fn, "%s/err_struct_info", path); | ||
574 | wr(fn, 0x0); | ||
575 | sprintf(fn, "%s/err_data_buffer", path); | ||
576 | wr_multi(fn, err_data_buffer.err_data_buffer, ERR_DATA_BUFFER_SIZE); | ||
577 | |||
578 | // Fire pal_mc_error_inject procedure. | ||
579 | sprintf(fn, "%s/call_start", path); | ||
580 | wr(fn, mode); | ||
581 | |||
582 | if (rd_capabilities(path, capabilities)<0) | ||
583 | return -1; | ||
584 | |||
585 | return 0; | ||
586 | } | ||
587 | |||
588 | int query_all_capabilities() | ||
589 | { | ||
590 | int status; | ||
591 | err_type_info_t err_type_info; | ||
592 | int err_sev, err_struct, struct_hier; | ||
593 | int cap=0; | ||
594 | u64 capabilities; | ||
595 | char path[MAX_FN_SIZE]; | ||
596 | |||
597 | err_type_info.err_type_info=0; // Initial | ||
598 | err_type_info.err_type_info_u.mode=0; // Query mode; | ||
599 | err_type_info.err_type_info_u.err_inj=0; | ||
600 | |||
601 | printf("All capabilities implemented in pal_mc_error_inject:\n"); | ||
602 | sprintf(path, PATH_FORMAT ,0); | ||
603 | for (err_sev=0;err_sev<3;err_sev++) | ||
604 | for (err_struct=0;err_struct<5;err_struct++) | ||
605 | for (struct_hier=0;struct_hier<5;struct_hier++) | ||
606 | { | ||
607 | status=-1; | ||
608 | capabilities=0; | ||
609 | err_type_info.err_type_info_u.err_sev=err_sev; | ||
610 | err_type_info.err_type_info_u.err_struct=err_struct; | ||
611 | err_type_info.err_type_info_u.struct_hier=struct_hier; | ||
612 | |||
613 | if (query_capabilities(path, err_type_info, &capabilities)<0) | ||
614 | continue; | ||
615 | |||
616 | if (rd_status(path, &status)<0) | ||
617 | continue; | ||
618 | |||
619 | if (status==0) { | ||
620 | cap=1; | ||
621 | printf("For err_sev=%d, err_struct=%d, struct_hier=%d: ", | ||
622 | err_sev, err_struct, struct_hier); | ||
623 | printf("capabilities 0x%lx\n", capabilities); | ||
624 | } | ||
625 | } | ||
626 | if (!cap) { | ||
627 | printf("No capabilities supported.\n"); | ||
628 | return 0; | ||
629 | } | ||
630 | |||
631 | return 0; | ||
632 | } | ||
633 | |||
634 | int err_inject(int cpu, char *path, err_type_info_t err_type_info, | ||
635 | err_struct_info_t err_struct_info, | ||
636 | err_data_buffer_t err_data_buffer) | ||
637 | { | ||
638 | int status; | ||
639 | char fn[MAX_FN_SIZE]; | ||
640 | |||
641 | log_info(cpu, "err_type_info=%lx, err_struct_info=%lx, ", | ||
642 | err_type_info.err_type_info, | ||
643 | err_struct_info.err_struct_info); | ||
644 | log_info(cpu,"err_data_buffer=[%lx,%lx,%lx]\n", | ||
645 | err_data_buffer.err_data_buffer[0], | ||
646 | err_data_buffer.err_data_buffer[1], | ||
647 | err_data_buffer.err_data_buffer[2]); | ||
648 | sprintf(fn, "%s/err_type_info", path); | ||
649 | wr(fn, err_type_info.err_type_info); | ||
650 | sprintf(fn, "%s/err_struct_info", path); | ||
651 | wr(fn, err_struct_info.err_struct_info); | ||
652 | sprintf(fn, "%s/err_data_buffer", path); | ||
653 | wr_multi(fn, err_data_buffer.err_data_buffer, ERR_DATA_BUFFER_SIZE); | ||
654 | |||
655 | // Fire pal_mc_error_inject procedure. | ||
656 | sprintf(fn, "%s/call_start", path); | ||
657 | wr(fn,mode); | ||
658 | |||
659 | if (rd_status(path, &status)<0) { | ||
660 | vbprintf("fail: read status\n"); | ||
661 | return -100; | ||
662 | } | ||
663 | |||
664 | if (status!=0) { | ||
665 | log_info(cpu, "fail: status=%d\n", status); | ||
666 | return status; | ||
667 | } | ||
668 | |||
669 | return status; | ||
670 | } | ||
671 | |||
672 | static int construct_data_buf(char *path, err_type_info_t err_type_info, | ||
673 | err_struct_info_t err_struct_info, | ||
674 | err_data_buffer_t *err_data_buffer, | ||
675 | void *va1) | ||
676 | { | ||
677 | char fn[MAX_FN_SIZE]; | ||
678 | u64 virt_addr=0, phys_addr=0; | ||
679 | |||
680 | vbprintf("va1=%lx\n", (u64)va1); | ||
681 | memset(&err_data_buffer->err_data_buffer_cache, 0, ERR_DATA_BUFFER_SIZE*8); | ||
682 | |||
683 | switch (err_type_info.err_type_info_u.err_struct) { | ||
684 | case 1: // Cache | ||
685 | switch (err_struct_info.err_struct_info_cache.cl_id) { | ||
686 | case 1: //Virtual addr | ||
687 | err_data_buffer->err_data_buffer_cache.inj_addr=(u64)va1; | ||
688 | break; | ||
689 | case 2: //Phys addr | ||
690 | sprintf(fn, "%s/virtual_to_phys", path); | ||
691 | virt_addr=(u64)va1; | ||
692 | if (wr(fn,virt_addr)<0) | ||
693 | return -1; | ||
694 | rd(fn, &phys_addr); | ||
695 | err_data_buffer->err_data_buffer_cache.inj_addr=phys_addr; | ||
696 | break; | ||
697 | default: | ||
698 | printf("Not supported cl_id\n"); | ||
699 | break; | ||
700 | } | ||
701 | break; | ||
702 | case 2: // TLB | ||
703 | break; | ||
704 | case 3: // Register file | ||
705 | break; | ||
706 | case 4: // Bus/system interconnect | ||
707 | default: | ||
708 | printf("Not supported err_struct\n"); | ||
709 | break; | ||
710 | } | ||
711 | |||
712 | return 0; | ||
713 | } | ||
714 | |||
715 | typedef struct { | ||
716 | u64 cpu; | ||
717 | u64 loop; | ||
718 | u64 interval; | ||
719 | u64 err_type_info; | ||
720 | u64 err_struct_info; | ||
721 | u64 err_data_buffer[ERR_DATA_BUFFER_SIZE]; | ||
722 | } parameters_t; | ||
723 | |||
724 | parameters_t line_para; | ||
725 | int para; | ||
726 | |||
727 | static int empty_data_buffer(u64 *err_data_buffer) | ||
728 | { | ||
729 | int empty=1; | ||
730 | int i; | ||
731 | |||
732 | for (i=0;i<ERR_DATA_BUFFER_SIZE; i++) | ||
733 | if (err_data_buffer[i]!=-1) | ||
734 | empty=0; | ||
735 | |||
736 | return empty; | ||
737 | } | ||
738 | |||
739 | int err_inj() | ||
740 | { | ||
741 | err_type_info_t err_type_info; | ||
742 | err_struct_info_t err_struct_info; | ||
743 | err_data_buffer_t err_data_buffer; | ||
744 | int count; | ||
745 | FILE *fp; | ||
746 | unsigned long cpu, loop, interval, err_type_info_conf, err_struct_info_conf; | ||
747 | u64 err_data_buffer_conf[ERR_DATA_BUFFER_SIZE]; | ||
748 | int num; | ||
749 | int i; | ||
750 | char path[MAX_FN_SIZE]; | ||
751 | parameters_t parameters[MAX_TASK_NUM]={}; | ||
752 | pid_t child_pid[MAX_TASK_NUM]; | ||
753 | time_t current_time; | ||
754 | int status; | ||
755 | |||
756 | if (!para) { | ||
757 | fp=fopen("err.conf", "r"); | ||
758 | if (fp==NULL) { | ||
759 | perror("Error open err.conf"); | ||
760 | return -1; | ||
761 | } | ||
762 | |||
763 | num=0; | ||
764 | while (!feof(fp)) { | ||
765 | char buf[256]; | ||
766 | memset(buf,0,256); | ||
767 | fgets(buf, 256, fp); | ||
768 | count=sscanf(buf, "%lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx\n", | ||
769 | &cpu, &loop, &interval,&err_type_info_conf, | ||
770 | &err_struct_info_conf, | ||
771 | &err_data_buffer_conf[0], | ||
772 | &err_data_buffer_conf[1], | ||
773 | &err_data_buffer_conf[2]); | ||
774 | if (count!=PARA_FIELD_NUM+3) { | ||
775 | err_data_buffer_conf[0]=-1; | ||
776 | err_data_buffer_conf[1]=-1; | ||
777 | err_data_buffer_conf[2]=-1; | ||
778 | count=sscanf(buf, "%lx, %lx, %lx, %lx, %lx\n", | ||
779 | &cpu, &loop, &interval,&err_type_info_conf, | ||
780 | &err_struct_info_conf); | ||
781 | if (count!=PARA_FIELD_NUM) | ||
782 | continue; | ||
783 | } | ||
784 | |||
785 | parameters[num].cpu=cpu; | ||
786 | parameters[num].loop=loop; | ||
787 | parameters[num].interval= interval>MIN_INTERVAL | ||
788 | ?interval:MIN_INTERVAL; | ||
789 | parameters[num].err_type_info=err_type_info_conf; | ||
790 | parameters[num].err_struct_info=err_struct_info_conf; | ||
791 | memcpy(parameters[num++].err_data_buffer, | ||
792 | err_data_buffer_conf,ERR_DATA_BUFFER_SIZE*8) ; | ||
793 | |||
794 | if (num>=MAX_TASK_NUM) | ||
795 | break; | ||
796 | } | ||
797 | } | ||
798 | else { | ||
799 | parameters[0].cpu=line_para.cpu; | ||
800 | parameters[0].loop=line_para.loop; | ||
801 | parameters[0].interval= line_para.interval>MIN_INTERVAL | ||
802 | ?line_para.interval:MIN_INTERVAL; | ||
803 | parameters[0].err_type_info=line_para.err_type_info; | ||
804 | parameters[0].err_struct_info=line_para.err_struct_info; | ||
805 | memcpy(parameters[0].err_data_buffer, | ||
806 | line_para.err_data_buffer,ERR_DATA_BUFFER_SIZE*8) ; | ||
807 | |||
808 | num=1; | ||
809 | } | ||
810 | |||
811 | /* Create semaphore: If one_lock, one semaphore for all processors. | ||
812 | Otherwise, one sempaphore for each processor. */ | ||
813 | if (one_lock) { | ||
814 | if (create_sem(0)) { | ||
815 | printf("Can not create semaphore...exit\n"); | ||
816 | free_sem(0); | ||
817 | return -1; | ||
818 | } | ||
819 | } | ||
820 | else { | ||
821 | for (i=0;i<num;i++) { | ||
822 | if (create_sem(parameters[i].cpu)) { | ||
823 | printf("Can not create semaphore for cpu%d...exit\n",i); | ||
824 | free_sem(parameters[num].cpu); | ||
825 | return -1; | ||
826 | } | ||
827 | } | ||
828 | } | ||
829 | |||
830 | /* Create a shm segment which will be used to inject/consume errors on.*/ | ||
831 | if (create_shm()==-1) { | ||
832 | printf("Error to create shm...exit\n"); | ||
833 | return -1; | ||
834 | } | ||
835 | |||
836 | for (i=0;i<num;i++) { | ||
837 | pid_t pid; | ||
838 | |||
839 | current_time=time(NULL); | ||
840 | log_info(parameters[i].cpu, "\nBegine at %s", ctime(¤t_time)); | ||
841 | log_info(parameters[i].cpu, "Configurations:\n"); | ||
842 | log_info(parameters[i].cpu,"On cpu%ld: loop=%lx, interval=%lx(s)", | ||
843 | parameters[i].cpu, | ||
844 | parameters[i].loop, | ||
845 | parameters[i].interval); | ||
846 | log_info(parameters[i].cpu," err_type_info=%lx,err_struct_info=%lx\n", | ||
847 | parameters[i].err_type_info, | ||
848 | parameters[i].err_struct_info); | ||
849 | |||
850 | sprintf(path, PATH_FORMAT, (int)parameters[i].cpu); | ||
851 | err_type_info.err_type_info=parameters[i].err_type_info; | ||
852 | err_struct_info.err_struct_info=parameters[i].err_struct_info; | ||
853 | memcpy(err_data_buffer.err_data_buffer, | ||
854 | parameters[i].err_data_buffer, | ||
855 | ERR_DATA_BUFFER_SIZE*8); | ||
856 | |||
857 | pid=fork(); | ||
858 | if (pid==0) { | ||
859 | unsigned long mask[MASK_SIZE]; | ||
860 | int j, k; | ||
861 | |||
862 | void *va1, *va2; | ||
863 | |||
864 | /* Allocate two memory areas va1 and va2 in shm */ | ||
865 | va1=shmaddr+parameters[i].cpu*PAGE_SIZE; | ||
866 | va2=shmaddr+parameters[i].cpu*PAGE_SIZE+PAGE_SIZE; | ||
867 | |||
868 | vbprintf("va1=%lx, va2=%lx\n", (u64)va1, (u64)va2); | ||
869 | memset(va1, 0x1, PAGE_SIZE); | ||
870 | memset(va2, 0x2, PAGE_SIZE); | ||
871 | |||
872 | if (empty_data_buffer(err_data_buffer.err_data_buffer)) | ||
873 | /* If not specified yet, construct data buffer | ||
874 | * with va1 | ||
875 | */ | ||
876 | construct_data_buf(path, err_type_info, | ||
877 | err_struct_info, &err_data_buffer,va1); | ||
878 | |||
879 | for (j=0;j<MASK_SIZE;j++) | ||
880 | mask[j]=0; | ||
881 | |||
882 | cpu=parameters[i].cpu; | ||
883 | k = cpu%64; | ||
884 | j = cpu/64; | ||
885 | mask[j]=1<<k; | ||
886 | |||
887 | if (sched_setaffinity(0, MASK_SIZE*8, mask)==-1) { | ||
888 | perror("Error sched_setaffinity:"); | ||
889 | return -1; | ||
890 | } | ||
891 | |||
892 | for (j=0; j<parameters[i].loop; j++) { | ||
893 | log_info(parameters[i].cpu,"Injection "); | ||
894 | log_info(parameters[i].cpu,"on cpu%ld: #%d/%ld ", | ||
895 | |||
896 | parameters[i].cpu,j+1, parameters[i].loop); | ||
897 | |||
898 | /* Hold the lock */ | ||
899 | if (one_lock) | ||
900 | lock(0); | ||
901 | else | ||
902 | /* Hold lock on this cpu */ | ||
903 | lock(parameters[i].cpu); | ||
904 | |||
905 | if ((status=err_inject(parameters[i].cpu, | ||
906 | path, err_type_info, | ||
907 | err_struct_info, err_data_buffer)) | ||
908 | ==0) { | ||
909 | /* consume the error for "inject only"*/ | ||
910 | memcpy(va2, va1, PAGE_SIZE); | ||
911 | memcpy(va1, va2, PAGE_SIZE); | ||
912 | log_info(parameters[i].cpu, | ||
913 | "successful\n"); | ||
914 | } | ||
915 | else { | ||
916 | log_info(parameters[i].cpu,"fail:"); | ||
917 | log_info(parameters[i].cpu, | ||
918 | "status=%d\n", status); | ||
919 | unlock(parameters[i].cpu); | ||
920 | break; | ||
921 | } | ||
922 | if (one_lock) | ||
923 | /* Release the lock */ | ||
924 | unlock(0); | ||
925 | /* Release lock on this cpu */ | ||
926 | else | ||
927 | unlock(parameters[i].cpu); | ||
928 | |||
929 | if (j < parameters[i].loop-1) | ||
930 | sleep(parameters[i].interval); | ||
931 | } | ||
932 | current_time=time(NULL); | ||
933 | log_info(parameters[i].cpu, "Done at %s", ctime(¤t_time)); | ||
934 | return 0; | ||
935 | } | ||
936 | else if (pid<0) { | ||
937 | perror("Error fork:"); | ||
938 | continue; | ||
939 | } | ||
940 | child_pid[i]=pid; | ||
941 | } | ||
942 | for (i=0;i<num;i++) | ||
943 | waitpid(child_pid[i], NULL, 0); | ||
944 | |||
945 | if (one_lock) | ||
946 | free_sem(0); | ||
947 | else | ||
948 | for (i=0;i<num;i++) | ||
949 | free_sem(parameters[i].cpu); | ||
950 | |||
951 | printf("All done.\n"); | ||
952 | |||
953 | return 0; | ||
954 | } | ||
955 | |||
956 | void help() | ||
957 | { | ||
958 | printf("err_inject_tool:\n"); | ||
959 | printf("\t-q: query all capabilities. default: off\n"); | ||
960 | printf("\t-m: procedure mode. 1: physical 2: virtual. default: 1\n"); | ||
961 | printf("\t-i: inject errors. default: off\n"); | ||
962 | printf("\t-l: one lock per cpu. default: one lock for all\n"); | ||
963 | printf("\t-e: error parameters:\n"); | ||
964 | printf("\t\tcpu,loop,interval,err_type_info,err_struct_info[,err_data_buffer[0],err_data_buffer[1],err_data_buffer[2]]\n"); | ||
965 | printf("\t\t cpu: logical cpu number the error will be inject in.\n"); | ||
966 | printf("\t\t loop: times the error will be injected.\n"); | ||
967 | printf("\t\t interval: In second. every so often one error is injected.\n"); | ||
968 | printf("\t\t err_type_info, err_struct_info: PAL parameters.\n"); | ||
969 | printf("\t\t err_data_buffer: PAL parameter. Optional. If not present,\n"); | ||
970 | printf("\t\t it's constructed by tool automatically. Be\n"); | ||
971 | printf("\t\t careful to provide err_data_buffer and make\n"); | ||
972 | printf("\t\t sure it's working with the environment.\n"); | ||
973 | printf("\t Note:no space between error parameters.\n"); | ||
974 | printf("\t default: Take error parameters from err.conf instead of command line.\n"); | ||
975 | printf("\t-v: verbose. default: off\n"); | ||
976 | printf("\t-h: help\n\n"); | ||
977 | printf("The tool will take err.conf file as "); | ||
978 | printf("input to inject single or multiple errors "); | ||
979 | printf("on one or multiple cpus in parallel.\n"); | ||
980 | } | ||
981 | |||
982 | int main(int argc, char **argv) | ||
983 | { | ||
984 | char c; | ||
985 | int do_err_inj=0; | ||
986 | int do_query_all=0; | ||
987 | int count; | ||
988 | u32 m; | ||
989 | |||
990 | /* Default one lock for all cpu's */ | ||
991 | one_lock=1; | ||
992 | while ((c = getopt(argc, argv, "m:iqvhle:")) != EOF) | ||
993 | switch (c) { | ||
994 | case 'm': /* Procedure mode. 1: phys 2: virt */ | ||
995 | count=sscanf(optarg, "%x", &m); | ||
996 | if (count!=1 || (m!=1 && m!=2)) { | ||
997 | printf("Wrong mode number.\n"); | ||
998 | help(); | ||
999 | return -1; | ||
1000 | } | ||
1001 | mode=m; | ||
1002 | break; | ||
1003 | case 'i': /* Inject errors */ | ||
1004 | do_err_inj=1; | ||
1005 | break; | ||
1006 | case 'q': /* Query */ | ||
1007 | do_query_all=1; | ||
1008 | break; | ||
1009 | case 'v': /* Verbose */ | ||
1010 | verbose=1; | ||
1011 | break; | ||
1012 | case 'l': /* One lock per cpu */ | ||
1013 | one_lock=0; | ||
1014 | break; | ||
1015 | case 'e': /* error arguments */ | ||
1016 | /* Take parameters: | ||
1017 | * #cpu, loop, interval, err_type_info, err_struct_info[, err_data_buffer] | ||
1018 | * err_data_buffer is optional. Recommend not to specify | ||
1019 | * err_data_buffer. Better to use tool to generate it. | ||
1020 | */ | ||
1021 | count=sscanf(optarg, | ||
1022 | "%lx, %lx, %lx, %lx, %lx, %lx, %lx, %lx\n", | ||
1023 | &line_para.cpu, | ||
1024 | &line_para.loop, | ||
1025 | &line_para.interval, | ||
1026 | &line_para.err_type_info, | ||
1027 | &line_para.err_struct_info, | ||
1028 | &line_para.err_data_buffer[0], | ||
1029 | &line_para.err_data_buffer[1], | ||
1030 | &line_para.err_data_buffer[2]); | ||
1031 | if (count!=PARA_FIELD_NUM+3) { | ||
1032 | line_para.err_data_buffer[0]=-1, | ||
1033 | line_para.err_data_buffer[1]=-1, | ||
1034 | line_para.err_data_buffer[2]=-1; | ||
1035 | count=sscanf(optarg, "%lx, %lx, %lx, %lx, %lx\n", | ||
1036 | &line_para.cpu, | ||
1037 | &line_para.loop, | ||
1038 | &line_para.interval, | ||
1039 | &line_para.err_type_info, | ||
1040 | &line_para.err_struct_info); | ||
1041 | if (count!=PARA_FIELD_NUM) { | ||
1042 | printf("Wrong error arguments.\n"); | ||
1043 | help(); | ||
1044 | return -1; | ||
1045 | } | ||
1046 | } | ||
1047 | para=1; | ||
1048 | break; | ||
1049 | continue; | ||
1050 | break; | ||
1051 | case 'h': | ||
1052 | help(); | ||
1053 | return 0; | ||
1054 | default: | ||
1055 | break; | ||
1056 | } | ||
1057 | |||
1058 | if (do_query_all) | ||
1059 | query_all_capabilities(); | ||
1060 | if (do_err_inj) | ||
1061 | err_inj(); | ||
1062 | |||
1063 | if (!do_query_all && !do_err_inj) | ||
1064 | help(); | ||
1065 | |||
1066 | return 0; | ||
1067 | } | ||
1068 | |||
diff --git a/Documentation/infiniband/user_mad.txt b/Documentation/infiniband/user_mad.txt index 750fe5e80ebc..8ec54b974b67 100644 --- a/Documentation/infiniband/user_mad.txt +++ b/Documentation/infiniband/user_mad.txt | |||
@@ -91,6 +91,14 @@ Sending MADs | |||
91 | if (ret != sizeof *mad + mad_length) | 91 | if (ret != sizeof *mad + mad_length) |
92 | perror("write"); | 92 | perror("write"); |
93 | 93 | ||
94 | Transaction IDs | ||
95 | |||
96 | Users of the umad devices can use the lower 32 bits of the | ||
97 | transaction ID field (that is, the least significant half of the | ||
98 | field in network byte order) in MADs being sent to match | ||
99 | request/response pairs. The upper 32 bits are reserved for use by | ||
100 | the kernel and will be overwritten before a MAD is sent. | ||
101 | |||
94 | Setting IsSM Capability Bit | 102 | Setting IsSM Capability Bit |
95 | 103 | ||
96 | To set the IsSM capability bit for a port, simply open the | 104 | To set the IsSM capability bit for a port, simply open the |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index ef2ffded1392..84c3bd05c639 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -142,7 +142,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
142 | Format: <int> | 142 | Format: <int> |
143 | 2: use 2nd APIC table, if available | 143 | 2: use 2nd APIC table, if available |
144 | 1,0: use 1st APIC table | 144 | 1,0: use 1st APIC table |
145 | default: 2 | 145 | default: 0 |
146 | 146 | ||
147 | acpi_sleep= [HW,ACPI] Sleep options | 147 | acpi_sleep= [HW,ACPI] Sleep options |
148 | Format: { s3_bios, s3_mode } | 148 | Format: { s3_bios, s3_mode } |
@@ -181,19 +181,41 @@ and is between 256 and 4096 characters. It is defined in the file | |||
181 | that require a timer override, but don't have | 181 | that require a timer override, but don't have |
182 | HPET | 182 | HPET |
183 | 183 | ||
184 | acpi_dbg_layer= [HW,ACPI] | 184 | acpi.debug_layer= [HW,ACPI] |
185 | Format: <int> | 185 | Format: <int> |
186 | Each bit of the <int> indicates an ACPI debug layer, | 186 | Each bit of the <int> indicates an ACPI debug layer, |
187 | 1: enable, 0: disable. It is useful for boot time | 187 | 1: enable, 0: disable. It is useful for boot time |
188 | debugging. After system has booted up, it can be set | 188 | debugging. After system has booted up, it can be set |
189 | via /proc/acpi/debug_layer. | 189 | via /sys/module/acpi/parameters/debug_layer. |
190 | 190 | CONFIG_ACPI_DEBUG must be enabled for this to produce any output. | |
191 | acpi_dbg_level= [HW,ACPI] | 191 | Available bits (add the numbers together) to enable debug output |
192 | for specific parts of the ACPI subsystem: | ||
193 | 0x01 utilities 0x02 hardware 0x04 events 0x08 tables | ||
194 | 0x10 namespace 0x20 parser 0x40 dispatcher | ||
195 | 0x80 executer 0x100 resources 0x200 acpica debugger | ||
196 | 0x400 os services 0x800 acpica disassembler. | ||
197 | The number can be in decimal or prefixed with 0x in hex. | ||
198 | Warning: Many of these options can produce a lot of | ||
199 | output and make your system unusable. Be very careful. | ||
200 | |||
201 | acpi.debug_level= [HW,ACPI] | ||
192 | Format: <int> | 202 | Format: <int> |
193 | Each bit of the <int> indicates an ACPI debug level, | 203 | Each bit of the <int> indicates an ACPI debug level, |
194 | 1: enable, 0: disable. It is useful for boot time | 204 | 1: enable, 0: disable. It is useful for boot time |
195 | debugging. After system has booted up, it can be set | 205 | debugging. After system has booted up, it can be set |
196 | via /proc/acpi/debug_level. | 206 | via /sys/module/acpi/parameters/debug_level. |
207 | CONFIG_ACPI_DEBUG must be enabled for this to produce any output. | ||
208 | Available bits (add the numbers together) to enable different | ||
209 | debug output levels of the ACPI subsystem: | ||
210 | 0x01 error 0x02 warn 0x04 init 0x08 debug object | ||
211 | 0x10 info 0x20 init names 0x40 parse 0x80 load | ||
212 | 0x100 dispatch 0x200 execute 0x400 names 0x800 operation region | ||
213 | 0x1000 bfield 0x2000 tables 0x4000 values 0x8000 objects | ||
214 | 0x10000 resources 0x20000 user requests 0x40000 package. | ||
215 | The number can be in decimal or prefixed with 0x in hex. | ||
216 | Warning: Many of these options can produce a lot of | ||
217 | output and make your system unusable. Be very careful. | ||
218 | |||
197 | 219 | ||
198 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT | 220 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT |
199 | 221 | ||
@@ -1792,7 +1814,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1792 | for newly-detected USB devices (default 2). This | 1814 | for newly-detected USB devices (default 2). This |
1793 | is the time required before an idle device will be | 1815 | is the time required before an idle device will be |
1794 | autosuspended. Devices for which the delay is set | 1816 | autosuspended. Devices for which the delay is set |
1795 | to 0 won't be autosuspended at all. | 1817 | to a negative value won't be autosuspended at all. |
1796 | 1818 | ||
1797 | usbhid.mousepoll= | 1819 | usbhid.mousepoll= |
1798 | [USBHID] The interval which mice are to be polled at. | 1820 | [USBHID] The interval which mice are to be polled at. |
diff --git a/Documentation/keys.txt b/Documentation/keys.txt index 60c665d9cfaa..81d9aa097298 100644 --- a/Documentation/keys.txt +++ b/Documentation/keys.txt | |||
@@ -859,6 +859,18 @@ payload contents" for more information. | |||
859 | void unregister_key_type(struct key_type *type); | 859 | void unregister_key_type(struct key_type *type); |
860 | 860 | ||
861 | 861 | ||
862 | Under some circumstances, it may be desirable to desirable to deal with a | ||
863 | bundle of keys. The facility provides access to the keyring type for managing | ||
864 | such a bundle: | ||
865 | |||
866 | struct key_type key_type_keyring; | ||
867 | |||
868 | This can be used with a function such as request_key() to find a specific | ||
869 | keyring in a process's keyrings. A keyring thus found can then be searched | ||
870 | with keyring_search(). Note that it is not possible to use request_key() to | ||
871 | search a specific keyring, so using keyrings in this way is of limited utility. | ||
872 | |||
873 | |||
862 | =================================== | 874 | =================================== |
863 | NOTES ON ACCESSING PAYLOAD CONTENTS | 875 | NOTES ON ACCESSING PAYLOAD CONTENTS |
864 | =================================== | 876 | =================================== |
diff --git a/Documentation/networking/bcm43xx.txt b/Documentation/networking/bcm43xx.txt index 28541d2bee1e..a136721499bf 100644 --- a/Documentation/networking/bcm43xx.txt +++ b/Documentation/networking/bcm43xx.txt | |||
@@ -2,35 +2,88 @@ | |||
2 | BCM43xx Linux Driver Project | 2 | BCM43xx Linux Driver Project |
3 | ============================ | 3 | ============================ |
4 | 4 | ||
5 | About this software | 5 | Introduction |
6 | ------------------- | 6 | ------------ |
7 | 7 | ||
8 | The goal of this project is to develop a linux driver for Broadcom | 8 | Many of the wireless devices found in modern notebook computers are |
9 | BCM43xx chips, based on the specification at | 9 | based on the wireless chips produced by Broadcom. These devices have |
10 | http://bcm-specs.sipsolutions.net/ | 10 | been a problem for Linux users as there is no open-source driver |
11 | available. In addition, Broadcom has not released specifications | ||
12 | for the device, and driver availability has been limited to the | ||
13 | binary-only form used in the GPL versions of AP hardware such as the | ||
14 | Linksys WRT54G, and the Windows and OS X drivers. Before this project | ||
15 | began, the only way to use these devices were to use the Windows or | ||
16 | OS X drivers with either the Linuxant or ndiswrapper modules. There | ||
17 | is a strong penalty if this method is used as loading the binary-only | ||
18 | module "taints" the kernel, and no kernel developer will help diagnose | ||
19 | any kernel problems. | ||
11 | 20 | ||
12 | The project page is http://bcm43xx.berlios.de/ | 21 | Development |
22 | ----------- | ||
13 | 23 | ||
24 | This driver has been developed using | ||
25 | a clean-room technique that is described at | ||
26 | http://bcm-specs.sipsolutions.net/ReverseEngineeringProcess. For legal | ||
27 | reasons, none of the clean-room crew works on the on the Linux driver, | ||
28 | and none of the Linux developers sees anything but the specifications, | ||
29 | which are the ultimate product of the reverse-engineering group. | ||
14 | 30 | ||
15 | Requirements | 31 | Software |
16 | ------------ | 32 | -------- |
33 | |||
34 | Since the release of the 2.6.17 kernel, the bcm43xx driver has been | ||
35 | distributed with the kernel source, and is prebuilt in most, if not | ||
36 | all, distributions. There is, however, additional software that is | ||
37 | required. The firmware used by the chip is the intellectual property | ||
38 | of Broadcom and they have not given the bcm43xx team redistribution | ||
39 | rights to this firmware. Since we cannot legally redistribute | ||
40 | the firwmare we cannot include it with the driver. Furthermore, it | ||
41 | cannot be placed in the downloadable archives of any distributing | ||
42 | organization; therefore, the user is responsible for obtaining the | ||
43 | firmware and placing it in the appropriate location so that the driver | ||
44 | can find it when initializing. | ||
45 | |||
46 | To help with this process, the bcm43xx developers provide a separate | ||
47 | program named bcm43xx-fwcutter to "cut" the firmware out of a | ||
48 | Windows or OS X driver and write the extracted files to the proper | ||
49 | location. This program is usually provided with the distribution; | ||
50 | however, it may be downloaded from | ||
51 | |||
52 | http://developer.berlios.de/project/showfiles.php?group_id=4547 | ||
17 | 53 | ||
18 | 1) Linux Kernel 2.6.16 or later | 54 | The firmware is available in two versions. V3 firmware is used with |
19 | http://www.kernel.org/ | 55 | the in-kernel bcm43xx driver that uses a software MAC layer called |
56 | SoftMAC, and will have a microcode revision of 0x127 or smaller. The | ||
57 | V4 firmware is used by an out-of-kernel driver employing a variation of | ||
58 | the Devicescape MAC layer known as d80211. Once bcm43xx-d80211 reaches | ||
59 | a satisfactory level of development, it will replace bcm43xx-softmac | ||
60 | in the kernel as it is much more flexible and powerful. | ||
20 | 61 | ||
21 | You may want to configure your kernel with: | 62 | A source for the latest V3 firmware is |
22 | 63 | ||
23 | CONFIG_DEBUG_FS (optional): | 64 | http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o |
24 | -> Kernel hacking | ||
25 | -> Debug Filesystem | ||
26 | 65 | ||
27 | 2) SoftMAC IEEE 802.11 Networking Stack extension and patched ieee80211 | 66 | Once this file is downloaded, the command |
28 | modules: | 67 | 'bcm43xx-fwcutter -w <dir> <filename>' |
29 | http://softmac.sipsolutions.net/ | 68 | will extract the microcode and write it to directory |
69 | <dir>. The correct directory will depend on your distribution; | ||
70 | however, most use '/lib/firmware'. Once this step is completed, | ||
71 | the bcm3xx driver should load when the system is booted. To see | ||
72 | any messages relating to the driver, issue the command 'dmesg | | ||
73 | grep bcm43xx' from a terminal window. If there are any problems, | ||
74 | please send that output to Bcm43xx-dev@lists.berlios.de. | ||
30 | 75 | ||
31 | 3) Firmware Files | 76 | Although the driver has been in-kernel since 2.6.17, the earliest |
77 | version is quite limited in its capability. Patches that include | ||
78 | all features of later versions are available for the stable kernel | ||
79 | versions from 2.6.18. These will be needed if you use a BCM4318, | ||
80 | or a PCI Express version (BCM4311 and BCM4312). In addition, if you | ||
81 | have an early BCM4306 and more than 1 GB RAM, your kernel will need | ||
82 | to be patched. These patches, which are being updated regularly, | ||
83 | are available at ftp://lwfinger.dynalias.org/patches. Look for | ||
84 | combined_2.6.YY.patch. Of course you will need kernel source downloaded | ||
85 | from kernel.org, or the source from your distribution. | ||
32 | 86 | ||
33 | Please try fwcutter. Fwcutter can extract the firmware from various | 87 | If you build your own kernel, please enable CONFIG_BCM43XX_DEBUG |
34 | binary driver files. It supports driver files from Windows, MacOS and | 88 | and CONFIG_IEEE80211_SOFTMAC_DEBUG. The log information provided is |
35 | Linux. You can get fwcutter from http://bcm43xx.berlios.de/. | 89 | essential for solving any problems. |
36 | Also, fwcutter comes with a README file for further instructions. | ||
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index de809e58092f..1da566630831 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -920,40 +920,9 @@ options, you may wish to use the "max_bonds" module parameter, | |||
920 | documented above. | 920 | documented above. |
921 | 921 | ||
922 | To create multiple bonding devices with differing options, it | 922 | To create multiple bonding devices with differing options, it |
923 | is necessary to load the bonding driver multiple times. Note that | 923 | is necessary to use bonding parameters exported by sysfs, documented |
924 | current versions of the sysconfig network initialization scripts | 924 | in the section below. |
925 | handle this automatically; if your distro uses these scripts, no | ||
926 | special action is needed. See the section Configuring Bonding | ||
927 | Devices, above, if you're not sure about your network initialization | ||
928 | scripts. | ||
929 | |||
930 | To load multiple instances of the module, it is necessary to | ||
931 | specify a different name for each instance (the module loading system | ||
932 | requires that every loaded module, even multiple instances of the same | ||
933 | module, have a unique name). This is accomplished by supplying | ||
934 | multiple sets of bonding options in /etc/modprobe.conf, for example: | ||
935 | |||
936 | alias bond0 bonding | ||
937 | options bond0 -o bond0 mode=balance-rr miimon=100 | ||
938 | |||
939 | alias bond1 bonding | ||
940 | options bond1 -o bond1 mode=balance-alb miimon=50 | ||
941 | |||
942 | will load the bonding module two times. The first instance is | ||
943 | named "bond0" and creates the bond0 device in balance-rr mode with an | ||
944 | miimon of 100. The second instance is named "bond1" and creates the | ||
945 | bond1 device in balance-alb mode with an miimon of 50. | ||
946 | |||
947 | In some circumstances (typically with older distributions), | ||
948 | the above does not work, and the second bonding instance never sees | ||
949 | its options. In that case, the second options line can be substituted | ||
950 | as follows: | ||
951 | |||
952 | install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \ | ||
953 | mode=balance-alb miimon=50 | ||
954 | 925 | ||
955 | This may be repeated any number of times, specifying a new and | ||
956 | unique name in place of bond1 for each subsequent instance. | ||
957 | 926 | ||
958 | 3.4 Configuring Bonding Manually via Sysfs | 927 | 3.4 Configuring Bonding Manually via Sysfs |
959 | ------------------------------------------ | 928 | ------------------------------------------ |
diff --git a/Documentation/networking/dccp.txt b/Documentation/networking/dccp.txt index 387482e46c47..4504cc59e405 100644 --- a/Documentation/networking/dccp.txt +++ b/Documentation/networking/dccp.txt | |||
@@ -57,6 +57,16 @@ DCCP_SOCKOPT_SEND_CSCOV is for the receiver and has a different meaning: it | |||
57 | coverage value are also acceptable. The higher the number, the more | 57 | coverage value are also acceptable. The higher the number, the more |
58 | restrictive this setting (see [RFC 4340, sec. 9.2.1]). | 58 | restrictive this setting (see [RFC 4340, sec. 9.2.1]). |
59 | 59 | ||
60 | The following two options apply to CCID 3 exclusively and are getsockopt()-only. | ||
61 | In either case, a TFRC info struct (defined in <linux/tfrc.h>) is returned. | ||
62 | DCCP_SOCKOPT_CCID_RX_INFO | ||
63 | Returns a `struct tfrc_rx_info' in optval; the buffer for optval and | ||
64 | optlen must be set to at least sizeof(struct tfrc_rx_info). | ||
65 | DCCP_SOCKOPT_CCID_TX_INFO | ||
66 | Returns a `struct tfrc_tx_info' in optval; the buffer for optval and | ||
67 | optlen must be set to at least sizeof(struct tfrc_tx_info). | ||
68 | |||
69 | |||
60 | Sysctl variables | 70 | Sysctl variables |
61 | ================ | 71 | ================ |
62 | Several DCCP default parameters can be managed by the following sysctls | 72 | Several DCCP default parameters can be managed by the following sysctls |
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index d3aae1f9b4c1..af6a63ab9026 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -179,11 +179,31 @@ tcp_fin_timeout - INTEGER | |||
179 | because they eat maximum 1.5K of memory, but they tend | 179 | because they eat maximum 1.5K of memory, but they tend |
180 | to live longer. Cf. tcp_max_orphans. | 180 | to live longer. Cf. tcp_max_orphans. |
181 | 181 | ||
182 | tcp_frto - BOOLEAN | 182 | tcp_frto - INTEGER |
183 | Enables F-RTO, an enhanced recovery algorithm for TCP retransmission | 183 | Enables F-RTO, an enhanced recovery algorithm for TCP retransmission |
184 | timeouts. It is particularly beneficial in wireless environments | 184 | timeouts. It is particularly beneficial in wireless environments |
185 | where packet loss is typically due to random radio interference | 185 | where packet loss is typically due to random radio interference |
186 | rather than intermediate router congestion. | 186 | rather than intermediate router congestion. If set to 1, basic |
187 | version is enabled. 2 enables SACK enhanced F-RTO, which is | ||
188 | EXPERIMENTAL. The basic version can be used also when SACK is | ||
189 | enabled for a flow through tcp_sack sysctl. | ||
190 | |||
191 | tcp_frto_response - INTEGER | ||
192 | When F-RTO has detected that a TCP retransmission timeout was | ||
193 | spurious (i.e, the timeout would have been avoided had TCP set a | ||
194 | longer retransmission timeout), TCP has several options what to do | ||
195 | next. Possible values are: | ||
196 | 0 Rate halving based; a smooth and conservative response, | ||
197 | results in halved cwnd and ssthresh after one RTT | ||
198 | 1 Very conservative response; not recommended because even | ||
199 | though being valid, it interacts poorly with the rest of | ||
200 | Linux TCP, halves cwnd and ssthresh immediately | ||
201 | 2 Aggressive response; undoes congestion control measures | ||
202 | that are now known to be unnecessary (ignoring the | ||
203 | possibility of a lost retransmission that would require | ||
204 | TCP to be more cautious), cwnd and ssthresh are restored | ||
205 | to the values prior timeout | ||
206 | Default: 0 (rate halving based) | ||
187 | 207 | ||
188 | tcp_keepalive_time - INTEGER | 208 | tcp_keepalive_time - INTEGER |
189 | How often TCP sends out keepalive messages when keepalive is enabled. | 209 | How often TCP sends out keepalive messages when keepalive is enabled. |
@@ -851,6 +871,15 @@ accept_redirects - BOOLEAN | |||
851 | Functional default: enabled if local forwarding is disabled. | 871 | Functional default: enabled if local forwarding is disabled. |
852 | disabled if local forwarding is enabled. | 872 | disabled if local forwarding is enabled. |
853 | 873 | ||
874 | accept_source_route - INTEGER | ||
875 | Accept source routing (routing extension header). | ||
876 | |||
877 | > 0: Accept routing header. | ||
878 | = 0: Accept only routing header type 2. | ||
879 | < 0: Do not accept routing header. | ||
880 | |||
881 | Default: 0 | ||
882 | |||
854 | autoconf - BOOLEAN | 883 | autoconf - BOOLEAN |
855 | Autoconfigure addresses using Prefix Information in Router | 884 | Autoconfigure addresses using Prefix Information in Router |
856 | Advertisements. | 885 | Advertisements. |
@@ -986,7 +1015,12 @@ bridge-nf-call-ip6tables - BOOLEAN | |||
986 | Default: 1 | 1015 | Default: 1 |
987 | 1016 | ||
988 | bridge-nf-filter-vlan-tagged - BOOLEAN | 1017 | bridge-nf-filter-vlan-tagged - BOOLEAN |
989 | 1 : pass bridged vlan-tagged ARP/IP traffic to arptables/iptables. | 1018 | 1 : pass bridged vlan-tagged ARP/IP/IPv6 traffic to {arp,ip,ip6}tables. |
1019 | 0 : disable this. | ||
1020 | Default: 1 | ||
1021 | |||
1022 | bridge-nf-filter-pppoe-tagged - BOOLEAN | ||
1023 | 1 : pass bridged pppoe-tagged IP/IPv6 traffic to {ip,ip6}tables. | ||
990 | 0 : disable this. | 1024 | 0 : disable this. |
991 | Default: 1 | 1025 | Default: 1 |
992 | 1026 | ||
diff --git a/Documentation/networking/rxrpc.txt b/Documentation/networking/rxrpc.txt new file mode 100644 index 000000000000..cae231b1c134 --- /dev/null +++ b/Documentation/networking/rxrpc.txt | |||
@@ -0,0 +1,859 @@ | |||
1 | ====================== | ||
2 | RxRPC NETWORK PROTOCOL | ||
3 | ====================== | ||
4 | |||
5 | The RxRPC protocol driver provides a reliable two-phase transport on top of UDP | ||
6 | that can be used to perform RxRPC remote operations. This is done over sockets | ||
7 | of AF_RXRPC family, using sendmsg() and recvmsg() with control data to send and | ||
8 | receive data, aborts and errors. | ||
9 | |||
10 | Contents of this document: | ||
11 | |||
12 | (*) Overview. | ||
13 | |||
14 | (*) RxRPC protocol summary. | ||
15 | |||
16 | (*) AF_RXRPC driver model. | ||
17 | |||
18 | (*) Control messages. | ||
19 | |||
20 | (*) Socket options. | ||
21 | |||
22 | (*) Security. | ||
23 | |||
24 | (*) Example client usage. | ||
25 | |||
26 | (*) Example server usage. | ||
27 | |||
28 | (*) AF_RXRPC kernel interface. | ||
29 | |||
30 | |||
31 | ======== | ||
32 | OVERVIEW | ||
33 | ======== | ||
34 | |||
35 | RxRPC is a two-layer protocol. There is a session layer which provides | ||
36 | reliable virtual connections using UDP over IPv4 (or IPv6) as the transport | ||
37 | layer, but implements a real network protocol; and there's the presentation | ||
38 | layer which renders structured data to binary blobs and back again using XDR | ||
39 | (as does SunRPC): | ||
40 | |||
41 | +-------------+ | ||
42 | | Application | | ||
43 | +-------------+ | ||
44 | | XDR | Presentation | ||
45 | +-------------+ | ||
46 | | RxRPC | Session | ||
47 | +-------------+ | ||
48 | | UDP | Transport | ||
49 | +-------------+ | ||
50 | |||
51 | |||
52 | AF_RXRPC provides: | ||
53 | |||
54 | (1) Part of an RxRPC facility for both kernel and userspace applications by | ||
55 | making the session part of it a Linux network protocol (AF_RXRPC). | ||
56 | |||
57 | (2) A two-phase protocol. The client transmits a blob (the request) and then | ||
58 | receives a blob (the reply), and the server receives the request and then | ||
59 | transmits the reply. | ||
60 | |||
61 | (3) Retention of the reusable bits of the transport system set up for one call | ||
62 | to speed up subsequent calls. | ||
63 | |||
64 | (4) A secure protocol, using the Linux kernel's key retention facility to | ||
65 | manage security on the client end. The server end must of necessity be | ||
66 | more active in security negotiations. | ||
67 | |||
68 | AF_RXRPC does not provide XDR marshalling/presentation facilities. That is | ||
69 | left to the application. AF_RXRPC only deals in blobs. Even the operation ID | ||
70 | is just the first four bytes of the request blob, and as such is beyond the | ||
71 | kernel's interest. | ||
72 | |||
73 | |||
74 | Sockets of AF_RXRPC family are: | ||
75 | |||
76 | (1) created as type SOCK_DGRAM; | ||
77 | |||
78 | (2) provided with a protocol of the type of underlying transport they're going | ||
79 | to use - currently only PF_INET is supported. | ||
80 | |||
81 | |||
82 | The Andrew File System (AFS) is an example of an application that uses this and | ||
83 | that has both kernel (filesystem) and userspace (utility) components. | ||
84 | |||
85 | |||
86 | ====================== | ||
87 | RXRPC PROTOCOL SUMMARY | ||
88 | ====================== | ||
89 | |||
90 | An overview of the RxRPC protocol: | ||
91 | |||
92 | (*) RxRPC sits on top of another networking protocol (UDP is the only option | ||
93 | currently), and uses this to provide network transport. UDP ports, for | ||
94 | example, provide transport endpoints. | ||
95 | |||
96 | (*) RxRPC supports multiple virtual "connections" from any given transport | ||
97 | endpoint, thus allowing the endpoints to be shared, even to the same | ||
98 | remote endpoint. | ||
99 | |||
100 | (*) Each connection goes to a particular "service". A connection may not go | ||
101 | to multiple services. A service may be considered the RxRPC equivalent of | ||
102 | a port number. AF_RXRPC permits multiple services to share an endpoint. | ||
103 | |||
104 | (*) Client-originating packets are marked, thus a transport endpoint can be | ||
105 | shared between client and server connections (connections have a | ||
106 | direction). | ||
107 | |||
108 | (*) Up to a billion connections may be supported concurrently between one | ||
109 | local transport endpoint and one service on one remote endpoint. An RxRPC | ||
110 | connection is described by seven numbers: | ||
111 | |||
112 | Local address } | ||
113 | Local port } Transport (UDP) address | ||
114 | Remote address } | ||
115 | Remote port } | ||
116 | Direction | ||
117 | Connection ID | ||
118 | Service ID | ||
119 | |||
120 | (*) Each RxRPC operation is a "call". A connection may make up to four | ||
121 | billion calls, but only up to four calls may be in progress on a | ||
122 | connection at any one time. | ||
123 | |||
124 | (*) Calls are two-phase and asymmetric: the client sends its request data, | ||
125 | which the service receives; then the service transmits the reply data | ||
126 | which the client receives. | ||
127 | |||
128 | (*) The data blobs are of indefinite size, the end of a phase is marked with a | ||
129 | flag in the packet. The number of packets of data making up one blob may | ||
130 | not exceed 4 billion, however, as this would cause the sequence number to | ||
131 | wrap. | ||
132 | |||
133 | (*) The first four bytes of the request data are the service operation ID. | ||
134 | |||
135 | (*) Security is negotiated on a per-connection basis. The connection is | ||
136 | initiated by the first data packet on it arriving. If security is | ||
137 | requested, the server then issues a "challenge" and then the client | ||
138 | replies with a "response". If the response is successful, the security is | ||
139 | set for the lifetime of that connection, and all subsequent calls made | ||
140 | upon it use that same security. In the event that the server lets a | ||
141 | connection lapse before the client, the security will be renegotiated if | ||
142 | the client uses the connection again. | ||
143 | |||
144 | (*) Calls use ACK packets to handle reliability. Data packets are also | ||
145 | explicitly sequenced per call. | ||
146 | |||
147 | (*) There are two types of positive acknowledgement: hard-ACKs and soft-ACKs. | ||
148 | A hard-ACK indicates to the far side that all the data received to a point | ||
149 | has been received and processed; a soft-ACK indicates that the data has | ||
150 | been received but may yet be discarded and re-requested. The sender may | ||
151 | not discard any transmittable packets until they've been hard-ACK'd. | ||
152 | |||
153 | (*) Reception of a reply data packet implicitly hard-ACK's all the data | ||
154 | packets that make up the request. | ||
155 | |||
156 | (*) An call is complete when the request has been sent, the reply has been | ||
157 | received and the final hard-ACK on the last packet of the reply has | ||
158 | reached the server. | ||
159 | |||
160 | (*) An call may be aborted by either end at any time up to its completion. | ||
161 | |||
162 | |||
163 | ===================== | ||
164 | AF_RXRPC DRIVER MODEL | ||
165 | ===================== | ||
166 | |||
167 | About the AF_RXRPC driver: | ||
168 | |||
169 | (*) The AF_RXRPC protocol transparently uses internal sockets of the transport | ||
170 | protocol to represent transport endpoints. | ||
171 | |||
172 | (*) AF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC | ||
173 | connections are handled transparently. One client socket may be used to | ||
174 | make multiple simultaneous calls to the same service. One server socket | ||
175 | may handle calls from many clients. | ||
176 | |||
177 | (*) Additional parallel client connections will be initiated to support extra | ||
178 | concurrent calls, up to a tunable limit. | ||
179 | |||
180 | (*) Each connection is retained for a certain amount of time [tunable] after | ||
181 | the last call currently using it has completed in case a new call is made | ||
182 | that could reuse it. | ||
183 | |||
184 | (*) Each internal UDP socket is retained [tunable] for a certain amount of | ||
185 | time [tunable] after the last connection using it discarded, in case a new | ||
186 | connection is made that could use it. | ||
187 | |||
188 | (*) A client-side connection is only shared between calls if they have have | ||
189 | the same key struct describing their security (and assuming the calls | ||
190 | would otherwise share the connection). Non-secured calls would also be | ||
191 | able to share connections with each other. | ||
192 | |||
193 | (*) A server-side connection is shared if the client says it is. | ||
194 | |||
195 | (*) ACK'ing is handled by the protocol driver automatically, including ping | ||
196 | replying. | ||
197 | |||
198 | (*) SO_KEEPALIVE automatically pings the other side to keep the connection | ||
199 | alive [TODO]. | ||
200 | |||
201 | (*) If an ICMP error is received, all calls affected by that error will be | ||
202 | aborted with an appropriate network error passed through recvmsg(). | ||
203 | |||
204 | |||
205 | Interaction with the user of the RxRPC socket: | ||
206 | |||
207 | (*) A socket is made into a server socket by binding an address with a | ||
208 | non-zero service ID. | ||
209 | |||
210 | (*) In the client, sending a request is achieved with one or more sendmsgs, | ||
211 | followed by the reply being received with one or more recvmsgs. | ||
212 | |||
213 | (*) The first sendmsg for a request to be sent from a client contains a tag to | ||
214 | be used in all other sendmsgs or recvmsgs associated with that call. The | ||
215 | tag is carried in the control data. | ||
216 | |||
217 | (*) connect() is used to supply a default destination address for a client | ||
218 | socket. This may be overridden by supplying an alternate address to the | ||
219 | first sendmsg() of a call (struct msghdr::msg_name). | ||
220 | |||
221 | (*) If connect() is called on an unbound client, a random local port will | ||
222 | bound before the operation takes place. | ||
223 | |||
224 | (*) A server socket may also be used to make client calls. To do this, the | ||
225 | first sendmsg() of the call must specify the target address. The server's | ||
226 | transport endpoint is used to send the packets. | ||
227 | |||
228 | (*) Once the application has received the last message associated with a call, | ||
229 | the tag is guaranteed not to be seen again, and so it can be used to pin | ||
230 | client resources. A new call can then be initiated with the same tag | ||
231 | without fear of interference. | ||
232 | |||
233 | (*) In the server, a request is received with one or more recvmsgs, then the | ||
234 | the reply is transmitted with one or more sendmsgs, and then the final ACK | ||
235 | is received with a last recvmsg. | ||
236 | |||
237 | (*) When sending data for a call, sendmsg is given MSG_MORE if there's more | ||
238 | data to come on that call. | ||
239 | |||
240 | (*) When receiving data for a call, recvmsg flags MSG_MORE if there's more | ||
241 | data to come for that call. | ||
242 | |||
243 | (*) When receiving data or messages for a call, MSG_EOR is flagged by recvmsg | ||
244 | to indicate the terminal message for that call. | ||
245 | |||
246 | (*) A call may be aborted by adding an abort control message to the control | ||
247 | data. Issuing an abort terminates the kernel's use of that call's tag. | ||
248 | Any messages waiting in the receive queue for that call will be discarded. | ||
249 | |||
250 | (*) Aborts, busy notifications and challenge packets are delivered by recvmsg, | ||
251 | and control data messages will be set to indicate the context. Receiving | ||
252 | an abort or a busy message terminates the kernel's use of that call's tag. | ||
253 | |||
254 | (*) The control data part of the msghdr struct is used for a number of things: | ||
255 | |||
256 | (*) The tag of the intended or affected call. | ||
257 | |||
258 | (*) Sending or receiving errors, aborts and busy notifications. | ||
259 | |||
260 | (*) Notifications of incoming calls. | ||
261 | |||
262 | (*) Sending debug requests and receiving debug replies [TODO]. | ||
263 | |||
264 | (*) When the kernel has received and set up an incoming call, it sends a | ||
265 | message to server application to let it know there's a new call awaiting | ||
266 | its acceptance [recvmsg reports a special control message]. The server | ||
267 | application then uses sendmsg to assign a tag to the new call. Once that | ||
268 | is done, the first part of the request data will be delivered by recvmsg. | ||
269 | |||
270 | (*) The server application has to provide the server socket with a keyring of | ||
271 | secret keys corresponding to the security types it permits. When a secure | ||
272 | connection is being set up, the kernel looks up the appropriate secret key | ||
273 | in the keyring and then sends a challenge packet to the client and | ||
274 | receives a response packet. The kernel then checks the authorisation of | ||
275 | the packet and either aborts the connection or sets up the security. | ||
276 | |||
277 | (*) The name of the key a client will use to secure its communications is | ||
278 | nominated by a socket option. | ||
279 | |||
280 | |||
281 | Notes on recvmsg: | ||
282 | |||
283 | (*) If there's a sequence of data messages belonging to a particular call on | ||
284 | the receive queue, then recvmsg will keep working through them until: | ||
285 | |||
286 | (a) it meets the end of that call's received data, | ||
287 | |||
288 | (b) it meets a non-data message, | ||
289 | |||
290 | (c) it meets a message belonging to a different call, or | ||
291 | |||
292 | (d) it fills the user buffer. | ||
293 | |||
294 | If recvmsg is called in blocking mode, it will keep sleeping, awaiting the | ||
295 | reception of further data, until one of the above four conditions is met. | ||
296 | |||
297 | (2) MSG_PEEK operates similarly, but will return immediately if it has put any | ||
298 | data in the buffer rather than sleeping until it can fill the buffer. | ||
299 | |||
300 | (3) If a data message is only partially consumed in filling a user buffer, | ||
301 | then the remainder of that message will be left on the front of the queue | ||
302 | for the next taker. MSG_TRUNC will never be flagged. | ||
303 | |||
304 | (4) If there is more data to be had on a call (it hasn't copied the last byte | ||
305 | of the last data message in that phase yet), then MSG_MORE will be | ||
306 | flagged. | ||
307 | |||
308 | |||
309 | ================ | ||
310 | CONTROL MESSAGES | ||
311 | ================ | ||
312 | |||
313 | AF_RXRPC makes use of control messages in sendmsg() and recvmsg() to multiplex | ||
314 | calls, to invoke certain actions and to report certain conditions. These are: | ||
315 | |||
316 | MESSAGE ID SRT DATA MEANING | ||
317 | ======================= === =========== =============================== | ||
318 | RXRPC_USER_CALL_ID sr- User ID App's call specifier | ||
319 | RXRPC_ABORT srt Abort code Abort code to issue/received | ||
320 | RXRPC_ACK -rt n/a Final ACK received | ||
321 | RXRPC_NET_ERROR -rt error num Network error on call | ||
322 | RXRPC_BUSY -rt n/a Call rejected (server busy) | ||
323 | RXRPC_LOCAL_ERROR -rt error num Local error encountered | ||
324 | RXRPC_NEW_CALL -r- n/a New call received | ||
325 | RXRPC_ACCEPT s-- n/a Accept new call | ||
326 | |||
327 | (SRT = usable in Sendmsg / delivered by Recvmsg / Terminal message) | ||
328 | |||
329 | (*) RXRPC_USER_CALL_ID | ||
330 | |||
331 | This is used to indicate the application's call ID. It's an unsigned long | ||
332 | that the app specifies in the client by attaching it to the first data | ||
333 | message or in the server by passing it in association with an RXRPC_ACCEPT | ||
334 | message. recvmsg() passes it in conjunction with all messages except | ||
335 | those of the RXRPC_NEW_CALL message. | ||
336 | |||
337 | (*) RXRPC_ABORT | ||
338 | |||
339 | This is can be used by an application to abort a call by passing it to | ||
340 | sendmsg, or it can be delivered by recvmsg to indicate a remote abort was | ||
341 | received. Either way, it must be associated with an RXRPC_USER_CALL_ID to | ||
342 | specify the call affected. If an abort is being sent, then error EBADSLT | ||
343 | will be returned if there is no call with that user ID. | ||
344 | |||
345 | (*) RXRPC_ACK | ||
346 | |||
347 | This is delivered to a server application to indicate that the final ACK | ||
348 | of a call was received from the client. It will be associated with an | ||
349 | RXRPC_USER_CALL_ID to indicate the call that's now complete. | ||
350 | |||
351 | (*) RXRPC_NET_ERROR | ||
352 | |||
353 | This is delivered to an application to indicate that an ICMP error message | ||
354 | was encountered in the process of trying to talk to the peer. An | ||
355 | errno-class integer value will be included in the control message data | ||
356 | indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call | ||
357 | affected. | ||
358 | |||
359 | (*) RXRPC_BUSY | ||
360 | |||
361 | This is delivered to a client application to indicate that a call was | ||
362 | rejected by the server due to the server being busy. It will be | ||
363 | associated with an RXRPC_USER_CALL_ID to indicate the rejected call. | ||
364 | |||
365 | (*) RXRPC_LOCAL_ERROR | ||
366 | |||
367 | This is delivered to an application to indicate that a local error was | ||
368 | encountered and that a call has been aborted because of it. An | ||
369 | errno-class integer value will be included in the control message data | ||
370 | indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call | ||
371 | affected. | ||
372 | |||
373 | (*) RXRPC_NEW_CALL | ||
374 | |||
375 | This is delivered to indicate to a server application that a new call has | ||
376 | arrived and is awaiting acceptance. No user ID is associated with this, | ||
377 | as a user ID must subsequently be assigned by doing an RXRPC_ACCEPT. | ||
378 | |||
379 | (*) RXRPC_ACCEPT | ||
380 | |||
381 | This is used by a server application to attempt to accept a call and | ||
382 | assign it a user ID. It should be associated with an RXRPC_USER_CALL_ID | ||
383 | to indicate the user ID to be assigned. If there is no call to be | ||
384 | accepted (it may have timed out, been aborted, etc.), then sendmsg will | ||
385 | return error ENODATA. If the user ID is already in use by another call, | ||
386 | then error EBADSLT will be returned. | ||
387 | |||
388 | |||
389 | ============== | ||
390 | SOCKET OPTIONS | ||
391 | ============== | ||
392 | |||
393 | AF_RXRPC sockets support a few socket options at the SOL_RXRPC level: | ||
394 | |||
395 | (*) RXRPC_SECURITY_KEY | ||
396 | |||
397 | This is used to specify the description of the key to be used. The key is | ||
398 | extracted from the calling process's keyrings with request_key() and | ||
399 | should be of "rxrpc" type. | ||
400 | |||
401 | The optval pointer points to the description string, and optlen indicates | ||
402 | how long the string is, without the NUL terminator. | ||
403 | |||
404 | (*) RXRPC_SECURITY_KEYRING | ||
405 | |||
406 | Similar to above but specifies a keyring of server secret keys to use (key | ||
407 | type "keyring"). See the "Security" section. | ||
408 | |||
409 | (*) RXRPC_EXCLUSIVE_CONNECTION | ||
410 | |||
411 | This is used to request that new connections should be used for each call | ||
412 | made subsequently on this socket. optval should be NULL and optlen 0. | ||
413 | |||
414 | (*) RXRPC_MIN_SECURITY_LEVEL | ||
415 | |||
416 | This is used to specify the minimum security level required for calls on | ||
417 | this socket. optval must point to an int containing one of the following | ||
418 | values: | ||
419 | |||
420 | (a) RXRPC_SECURITY_PLAIN | ||
421 | |||
422 | Encrypted checksum only. | ||
423 | |||
424 | (b) RXRPC_SECURITY_AUTH | ||
425 | |||
426 | Encrypted checksum plus packet padded and first eight bytes of packet | ||
427 | encrypted - which includes the actual packet length. | ||
428 | |||
429 | (c) RXRPC_SECURITY_ENCRYPTED | ||
430 | |||
431 | Encrypted checksum plus entire packet padded and encrypted, including | ||
432 | actual packet length. | ||
433 | |||
434 | |||
435 | ======== | ||
436 | SECURITY | ||
437 | ======== | ||
438 | |||
439 | Currently, only the kerberos 4 equivalent protocol has been implemented | ||
440 | (security index 2 - rxkad). This requires the rxkad module to be loaded and, | ||
441 | on the client, tickets of the appropriate type to be obtained from the AFS | ||
442 | kaserver or the kerberos server and installed as "rxrpc" type keys. This is | ||
443 | normally done using the klog program. An example simple klog program can be | ||
444 | found at: | ||
445 | |||
446 | http://people.redhat.com/~dhowells/rxrpc/klog.c | ||
447 | |||
448 | The payload provided to add_key() on the client should be of the following | ||
449 | form: | ||
450 | |||
451 | struct rxrpc_key_sec2_v1 { | ||
452 | uint16_t security_index; /* 2 */ | ||
453 | uint16_t ticket_length; /* length of ticket[] */ | ||
454 | uint32_t expiry; /* time at which expires */ | ||
455 | uint8_t kvno; /* key version number */ | ||
456 | uint8_t __pad[3]; | ||
457 | uint8_t session_key[8]; /* DES session key */ | ||
458 | uint8_t ticket[0]; /* the encrypted ticket */ | ||
459 | }; | ||
460 | |||
461 | Where the ticket blob is just appended to the above structure. | ||
462 | |||
463 | |||
464 | For the server, keys of type "rxrpc_s" must be made available to the server. | ||
465 | They have a description of "<serviceID>:<securityIndex>" (eg: "52:2" for an | ||
466 | rxkad key for the AFS VL service). When such a key is created, it should be | ||
467 | given the server's secret key as the instantiation data (see the example | ||
468 | below). | ||
469 | |||
470 | add_key("rxrpc_s", "52:2", secret_key, 8, keyring); | ||
471 | |||
472 | A keyring is passed to the server socket by naming it in a sockopt. The server | ||
473 | socket then looks the server secret keys up in this keyring when secure | ||
474 | incoming connections are made. This can be seen in an example program that can | ||
475 | be found at: | ||
476 | |||
477 | http://people.redhat.com/~dhowells/rxrpc/listen.c | ||
478 | |||
479 | |||
480 | ==================== | ||
481 | EXAMPLE CLIENT USAGE | ||
482 | ==================== | ||
483 | |||
484 | A client would issue an operation by: | ||
485 | |||
486 | (1) An RxRPC socket is set up by: | ||
487 | |||
488 | client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); | ||
489 | |||
490 | Where the third parameter indicates the protocol family of the transport | ||
491 | socket used - usually IPv4 but it can also be IPv6 [TODO]. | ||
492 | |||
493 | (2) A local address can optionally be bound: | ||
494 | |||
495 | struct sockaddr_rxrpc srx = { | ||
496 | .srx_family = AF_RXRPC, | ||
497 | .srx_service = 0, /* we're a client */ | ||
498 | .transport_type = SOCK_DGRAM, /* type of transport socket */ | ||
499 | .transport.sin_family = AF_INET, | ||
500 | .transport.sin_port = htons(7000), /* AFS callback */ | ||
501 | .transport.sin_address = 0, /* all local interfaces */ | ||
502 | }; | ||
503 | bind(client, &srx, sizeof(srx)); | ||
504 | |||
505 | This specifies the local UDP port to be used. If not given, a random | ||
506 | non-privileged port will be used. A UDP port may be shared between | ||
507 | several unrelated RxRPC sockets. Security is handled on a basis of | ||
508 | per-RxRPC virtual connection. | ||
509 | |||
510 | (3) The security is set: | ||
511 | |||
512 | const char *key = "AFS:cambridge.redhat.com"; | ||
513 | setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key)); | ||
514 | |||
515 | This issues a request_key() to get the key representing the security | ||
516 | context. The minimum security level can be set: | ||
517 | |||
518 | unsigned int sec = RXRPC_SECURITY_ENCRYPTED; | ||
519 | setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, | ||
520 | &sec, sizeof(sec)); | ||
521 | |||
522 | (4) The server to be contacted can then be specified (alternatively this can | ||
523 | be done through sendmsg): | ||
524 | |||
525 | struct sockaddr_rxrpc srx = { | ||
526 | .srx_family = AF_RXRPC, | ||
527 | .srx_service = VL_SERVICE_ID, | ||
528 | .transport_type = SOCK_DGRAM, /* type of transport socket */ | ||
529 | .transport.sin_family = AF_INET, | ||
530 | .transport.sin_port = htons(7005), /* AFS volume manager */ | ||
531 | .transport.sin_address = ..., | ||
532 | }; | ||
533 | connect(client, &srx, sizeof(srx)); | ||
534 | |||
535 | (5) The request data should then be posted to the server socket using a series | ||
536 | of sendmsg() calls, each with the following control message attached: | ||
537 | |||
538 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
539 | |||
540 | MSG_MORE should be set in msghdr::msg_flags on all but the last part of | ||
541 | the request. Multiple requests may be made simultaneously. | ||
542 | |||
543 | If a call is intended to go to a destination other then the default | ||
544 | specified through connect(), then msghdr::msg_name should be set on the | ||
545 | first request message of that call. | ||
546 | |||
547 | (6) The reply data will then be posted to the server socket for recvmsg() to | ||
548 | pick up. MSG_MORE will be flagged by recvmsg() if there's more reply data | ||
549 | for a particular call to be read. MSG_EOR will be set on the terminal | ||
550 | read for a call. | ||
551 | |||
552 | All data will be delivered with the following control message attached: | ||
553 | |||
554 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
555 | |||
556 | If an abort or error occurred, this will be returned in the control data | ||
557 | buffer instead, and MSG_EOR will be flagged to indicate the end of that | ||
558 | call. | ||
559 | |||
560 | |||
561 | ==================== | ||
562 | EXAMPLE SERVER USAGE | ||
563 | ==================== | ||
564 | |||
565 | A server would be set up to accept operations in the following manner: | ||
566 | |||
567 | (1) An RxRPC socket is created by: | ||
568 | |||
569 | server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); | ||
570 | |||
571 | Where the third parameter indicates the address type of the transport | ||
572 | socket used - usually IPv4. | ||
573 | |||
574 | (2) Security is set up if desired by giving the socket a keyring with server | ||
575 | secret keys in it: | ||
576 | |||
577 | keyring = add_key("keyring", "AFSkeys", NULL, 0, | ||
578 | KEY_SPEC_PROCESS_KEYRING); | ||
579 | |||
580 | const char secret_key[8] = { | ||
581 | 0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 }; | ||
582 | add_key("rxrpc_s", "52:2", secret_key, 8, keyring); | ||
583 | |||
584 | setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7); | ||
585 | |||
586 | The keyring can be manipulated after it has been given to the socket. This | ||
587 | permits the server to add more keys, replace keys, etc. whilst it is live. | ||
588 | |||
589 | (2) A local address must then be bound: | ||
590 | |||
591 | struct sockaddr_rxrpc srx = { | ||
592 | .srx_family = AF_RXRPC, | ||
593 | .srx_service = VL_SERVICE_ID, /* RxRPC service ID */ | ||
594 | .transport_type = SOCK_DGRAM, /* type of transport socket */ | ||
595 | .transport.sin_family = AF_INET, | ||
596 | .transport.sin_port = htons(7000), /* AFS callback */ | ||
597 | .transport.sin_address = 0, /* all local interfaces */ | ||
598 | }; | ||
599 | bind(server, &srx, sizeof(srx)); | ||
600 | |||
601 | (3) The server is then set to listen out for incoming calls: | ||
602 | |||
603 | listen(server, 100); | ||
604 | |||
605 | (4) The kernel notifies the server of pending incoming connections by sending | ||
606 | it a message for each. This is received with recvmsg() on the server | ||
607 | socket. It has no data, and has a single dataless control message | ||
608 | attached: | ||
609 | |||
610 | RXRPC_NEW_CALL | ||
611 | |||
612 | The address that can be passed back by recvmsg() at this point should be | ||
613 | ignored since the call for which the message was posted may have gone by | ||
614 | the time it is accepted - in which case the first call still on the queue | ||
615 | will be accepted. | ||
616 | |||
617 | (5) The server then accepts the new call by issuing a sendmsg() with two | ||
618 | pieces of control data and no actual data: | ||
619 | |||
620 | RXRPC_ACCEPT - indicate connection acceptance | ||
621 | RXRPC_USER_CALL_ID - specify user ID for this call | ||
622 | |||
623 | (6) The first request data packet will then be posted to the server socket for | ||
624 | recvmsg() to pick up. At that point, the RxRPC address for the call can | ||
625 | be read from the address fields in the msghdr struct. | ||
626 | |||
627 | Subsequent request data will be posted to the server socket for recvmsg() | ||
628 | to collect as it arrives. All but the last piece of the request data will | ||
629 | be delivered with MSG_MORE flagged. | ||
630 | |||
631 | All data will be delivered with the following control message attached: | ||
632 | |||
633 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
634 | |||
635 | (8) The reply data should then be posted to the server socket using a series | ||
636 | of sendmsg() calls, each with the following control messages attached: | ||
637 | |||
638 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
639 | |||
640 | MSG_MORE should be set in msghdr::msg_flags on all but the last message | ||
641 | for a particular call. | ||
642 | |||
643 | (9) The final ACK from the client will be posted for retrieval by recvmsg() | ||
644 | when it is received. It will take the form of a dataless message with two | ||
645 | control messages attached: | ||
646 | |||
647 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
648 | RXRPC_ACK - indicates final ACK (no data) | ||
649 | |||
650 | MSG_EOR will be flagged to indicate that this is the final message for | ||
651 | this call. | ||
652 | |||
653 | (10) Up to the point the final packet of reply data is sent, the call can be | ||
654 | aborted by calling sendmsg() with a dataless message with the following | ||
655 | control messages attached: | ||
656 | |||
657 | RXRPC_USER_CALL_ID - specifies the user ID for this call | ||
658 | RXRPC_ABORT - indicates abort code (4 byte data) | ||
659 | |||
660 | Any packets waiting in the socket's receive queue will be discarded if | ||
661 | this is issued. | ||
662 | |||
663 | Note that all the communications for a particular service take place through | ||
664 | the one server socket, using control messages on sendmsg() and recvmsg() to | ||
665 | determine the call affected. | ||
666 | |||
667 | |||
668 | ========================= | ||
669 | AF_RXRPC KERNEL INTERFACE | ||
670 | ========================= | ||
671 | |||
672 | The AF_RXRPC module also provides an interface for use by in-kernel utilities | ||
673 | such as the AFS filesystem. This permits such a utility to: | ||
674 | |||
675 | (1) Use different keys directly on individual client calls on one socket | ||
676 | rather than having to open a whole slew of sockets, one for each key it | ||
677 | might want to use. | ||
678 | |||
679 | (2) Avoid having RxRPC call request_key() at the point of issue of a call or | ||
680 | opening of a socket. Instead the utility is responsible for requesting a | ||
681 | key at the appropriate point. AFS, for instance, would do this during VFS | ||
682 | operations such as open() or unlink(). The key is then handed through | ||
683 | when the call is initiated. | ||
684 | |||
685 | (3) Request the use of something other than GFP_KERNEL to allocate memory. | ||
686 | |||
687 | (4) Avoid the overhead of using the recvmsg() call. RxRPC messages can be | ||
688 | intercepted before they get put into the socket Rx queue and the socket | ||
689 | buffers manipulated directly. | ||
690 | |||
691 | To use the RxRPC facility, a kernel utility must still open an AF_RXRPC socket, | ||
692 | bind an addess as appropriate and listen if it's to be a server socket, but | ||
693 | then it passes this to the kernel interface functions. | ||
694 | |||
695 | The kernel interface functions are as follows: | ||
696 | |||
697 | (*) Begin a new client call. | ||
698 | |||
699 | struct rxrpc_call * | ||
700 | rxrpc_kernel_begin_call(struct socket *sock, | ||
701 | struct sockaddr_rxrpc *srx, | ||
702 | struct key *key, | ||
703 | unsigned long user_call_ID, | ||
704 | gfp_t gfp); | ||
705 | |||
706 | This allocates the infrastructure to make a new RxRPC call and assigns | ||
707 | call and connection numbers. The call will be made on the UDP port that | ||
708 | the socket is bound to. The call will go to the destination address of a | ||
709 | connected client socket unless an alternative is supplied (srx is | ||
710 | non-NULL). | ||
711 | |||
712 | If a key is supplied then this will be used to secure the call instead of | ||
713 | the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls | ||
714 | secured in this way will still share connections if at all possible. | ||
715 | |||
716 | The user_call_ID is equivalent to that supplied to sendmsg() in the | ||
717 | control data buffer. It is entirely feasible to use this to point to a | ||
718 | kernel data structure. | ||
719 | |||
720 | If this function is successful, an opaque reference to the RxRPC call is | ||
721 | returned. The caller now holds a reference on this and it must be | ||
722 | properly ended. | ||
723 | |||
724 | (*) End a client call. | ||
725 | |||
726 | void rxrpc_kernel_end_call(struct rxrpc_call *call); | ||
727 | |||
728 | This is used to end a previously begun call. The user_call_ID is expunged | ||
729 | from AF_RXRPC's knowledge and will not be seen again in association with | ||
730 | the specified call. | ||
731 | |||
732 | (*) Send data through a call. | ||
733 | |||
734 | int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg, | ||
735 | size_t len); | ||
736 | |||
737 | This is used to supply either the request part of a client call or the | ||
738 | reply part of a server call. msg.msg_iovlen and msg.msg_iov specify the | ||
739 | data buffers to be used. msg_iov may not be NULL and must point | ||
740 | exclusively to in-kernel virtual addresses. msg.msg_flags may be given | ||
741 | MSG_MORE if there will be subsequent data sends for this call. | ||
742 | |||
743 | The msg must not specify a destination address, control data or any flags | ||
744 | other than MSG_MORE. len is the total amount of data to transmit. | ||
745 | |||
746 | (*) Abort a call. | ||
747 | |||
748 | void rxrpc_kernel_abort_call(struct rxrpc_call *call, u32 abort_code); | ||
749 | |||
750 | This is used to abort a call if it's still in an abortable state. The | ||
751 | abort code specified will be placed in the ABORT message sent. | ||
752 | |||
753 | (*) Intercept received RxRPC messages. | ||
754 | |||
755 | typedef void (*rxrpc_interceptor_t)(struct sock *sk, | ||
756 | unsigned long user_call_ID, | ||
757 | struct sk_buff *skb); | ||
758 | |||
759 | void | ||
760 | rxrpc_kernel_intercept_rx_messages(struct socket *sock, | ||
761 | rxrpc_interceptor_t interceptor); | ||
762 | |||
763 | This installs an interceptor function on the specified AF_RXRPC socket. | ||
764 | All messages that would otherwise wind up in the socket's Rx queue are | ||
765 | then diverted to this function. Note that care must be taken to process | ||
766 | the messages in the right order to maintain DATA message sequentiality. | ||
767 | |||
768 | The interceptor function itself is provided with the address of the socket | ||
769 | and handling the incoming message, the ID assigned by the kernel utility | ||
770 | to the call and the socket buffer containing the message. | ||
771 | |||
772 | The skb->mark field indicates the type of message: | ||
773 | |||
774 | MARK MEANING | ||
775 | =============================== ======================================= | ||
776 | RXRPC_SKB_MARK_DATA Data message | ||
777 | RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call | ||
778 | RXRPC_SKB_MARK_BUSY Client call rejected as server busy | ||
779 | RXRPC_SKB_MARK_REMOTE_ABORT Call aborted by peer | ||
780 | RXRPC_SKB_MARK_NET_ERROR Network error detected | ||
781 | RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered | ||
782 | RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance | ||
783 | |||
784 | The remote abort message can be probed with rxrpc_kernel_get_abort_code(). | ||
785 | The two error messages can be probed with rxrpc_kernel_get_error_number(). | ||
786 | A new call can be accepted with rxrpc_kernel_accept_call(). | ||
787 | |||
788 | Data messages can have their contents extracted with the usual bunch of | ||
789 | socket buffer manipulation functions. A data message can be determined to | ||
790 | be the last one in a sequence with rxrpc_kernel_is_data_last(). When a | ||
791 | data message has been used up, rxrpc_kernel_data_delivered() should be | ||
792 | called on it.. | ||
793 | |||
794 | Non-data messages should be handled to rxrpc_kernel_free_skb() to dispose | ||
795 | of. It is possible to get extra refs on all types of message for later | ||
796 | freeing, but this may pin the state of a call until the message is finally | ||
797 | freed. | ||
798 | |||
799 | (*) Accept an incoming call. | ||
800 | |||
801 | struct rxrpc_call * | ||
802 | rxrpc_kernel_accept_call(struct socket *sock, | ||
803 | unsigned long user_call_ID); | ||
804 | |||
805 | This is used to accept an incoming call and to assign it a call ID. This | ||
806 | function is similar to rxrpc_kernel_begin_call() and calls accepted must | ||
807 | be ended in the same way. | ||
808 | |||
809 | If this function is successful, an opaque reference to the RxRPC call is | ||
810 | returned. The caller now holds a reference on this and it must be | ||
811 | properly ended. | ||
812 | |||
813 | (*) Reject an incoming call. | ||
814 | |||
815 | int rxrpc_kernel_reject_call(struct socket *sock); | ||
816 | |||
817 | This is used to reject the first incoming call on the socket's queue with | ||
818 | a BUSY message. -ENODATA is returned if there were no incoming calls. | ||
819 | Other errors may be returned if the call had been aborted (-ECONNABORTED) | ||
820 | or had timed out (-ETIME). | ||
821 | |||
822 | (*) Record the delivery of a data message and free it. | ||
823 | |||
824 | void rxrpc_kernel_data_delivered(struct sk_buff *skb); | ||
825 | |||
826 | This is used to record a data message as having been delivered and to | ||
827 | update the ACK state for the call. The socket buffer will be freed. | ||
828 | |||
829 | (*) Free a message. | ||
830 | |||
831 | void rxrpc_kernel_free_skb(struct sk_buff *skb); | ||
832 | |||
833 | This is used to free a non-DATA socket buffer intercepted from an AF_RXRPC | ||
834 | socket. | ||
835 | |||
836 | (*) Determine if a data message is the last one on a call. | ||
837 | |||
838 | bool rxrpc_kernel_is_data_last(struct sk_buff *skb); | ||
839 | |||
840 | This is used to determine if a socket buffer holds the last data message | ||
841 | to be received for a call (true will be returned if it does, false | ||
842 | if not). | ||
843 | |||
844 | The data message will be part of the reply on a client call and the | ||
845 | request on an incoming call. In the latter case there will be more | ||
846 | messages, but in the former case there will not. | ||
847 | |||
848 | (*) Get the abort code from an abort message. | ||
849 | |||
850 | u32 rxrpc_kernel_get_abort_code(struct sk_buff *skb); | ||
851 | |||
852 | This is used to extract the abort code from a remote abort message. | ||
853 | |||
854 | (*) Get the error number from a local or network error message. | ||
855 | |||
856 | int rxrpc_kernel_get_error_number(struct sk_buff *skb); | ||
857 | |||
858 | This is used to extract the error number from a message indicating either | ||
859 | a local error occurred or a network error occurred. | ||
diff --git a/Documentation/networking/wan-router.txt b/Documentation/networking/wan-router.txt index 653978dcea7f..07dd6d9930a1 100644 --- a/Documentation/networking/wan-router.txt +++ b/Documentation/networking/wan-router.txt | |||
@@ -250,7 +250,6 @@ PRODUCT COMPONENTS AND RELATED FILES | |||
250 | sdladrv.h SDLA support module API definitions | 250 | sdladrv.h SDLA support module API definitions |
251 | sdlasfm.h SDLA firmware module definitions | 251 | sdlasfm.h SDLA firmware module definitions |
252 | if_wanpipe.h WANPIPE Socket definitions | 252 | if_wanpipe.h WANPIPE Socket definitions |
253 | if_wanpipe_common.h WANPIPE Socket/Driver common definitions. | ||
254 | sdlapci.h WANPIPE PCI definitions | 253 | sdlapci.h WANPIPE PCI definitions |
255 | 254 | ||
256 | 255 | ||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index b41397d6430a..033a3f3b3ab7 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -39,7 +39,7 @@ | |||
39 | and property data. The old style variable | 39 | and property data. The old style variable |
40 | alignment would make it impossible to do | 40 | alignment would make it impossible to do |
41 | "simple" insertion of properties using | 41 | "simple" insertion of properties using |
42 | memove (thanks Milton for | 42 | memmove (thanks Milton for |
43 | noticing). Updated kernel patch as well | 43 | noticing). Updated kernel patch as well |
44 | - Correct a few more alignment constraints | 44 | - Correct a few more alignment constraints |
45 | - Add a chapter about the device-tree | 45 | - Add a chapter about the device-tree |
@@ -55,7 +55,7 @@ | |||
55 | 55 | ||
56 | ToDo: | 56 | ToDo: |
57 | - Add some definitions of interrupt tree (simple/complex) | 57 | - Add some definitions of interrupt tree (simple/complex) |
58 | - Add some definitions for pci host bridges | 58 | - Add some definitions for PCI host bridges |
59 | - Add some common address format examples | 59 | - Add some common address format examples |
60 | - Add definitions for standard properties and "compatible" | 60 | - Add definitions for standard properties and "compatible" |
61 | names for cells that are not already defined by the existing | 61 | names for cells that are not already defined by the existing |
@@ -114,7 +114,7 @@ it with special cases. | |||
114 | forth words isn't required), you can enter the kernel with: | 114 | forth words isn't required), you can enter the kernel with: |
115 | 115 | ||
116 | r5 : OF callback pointer as defined by IEEE 1275 | 116 | r5 : OF callback pointer as defined by IEEE 1275 |
117 | bindings to powerpc. Only the 32 bit client interface | 117 | bindings to powerpc. Only the 32-bit client interface |
118 | is currently supported | 118 | is currently supported |
119 | 119 | ||
120 | r3, r4 : address & length of an initrd if any or 0 | 120 | r3, r4 : address & length of an initrd if any or 0 |
@@ -194,7 +194,7 @@ it with special cases. | |||
194 | for this is to keep kernels on embedded systems small and efficient; | 194 | for this is to keep kernels on embedded systems small and efficient; |
195 | part of this is due to the fact the code is already that way. In the | 195 | part of this is due to the fact the code is already that way. In the |
196 | future, a kernel may support multiple platforms, but only if the | 196 | future, a kernel may support multiple platforms, but only if the |
197 | platforms feature the same core architectire. A single kernel build | 197 | platforms feature the same core architecture. A single kernel build |
198 | cannot support both configurations with Book E and configurations | 198 | cannot support both configurations with Book E and configurations |
199 | with classic Powerpc architectures. | 199 | with classic Powerpc architectures. |
200 | 200 | ||
@@ -215,7 +215,7 @@ of the boot sequences.... someone speak up if this is wrong! | |||
215 | enable another config option to select the specific board | 215 | enable another config option to select the specific board |
216 | supported. | 216 | supported. |
217 | 217 | ||
218 | NOTE: If ben doesn't merge the setup files, may need to change this to | 218 | NOTE: If Ben doesn't merge the setup files, may need to change this to |
219 | point to setup_32.c | 219 | point to setup_32.c |
220 | 220 | ||
221 | 221 | ||
@@ -256,7 +256,7 @@ struct boot_param_header { | |||
256 | u32 off_dt_struct; /* offset to structure */ | 256 | u32 off_dt_struct; /* offset to structure */ |
257 | u32 off_dt_strings; /* offset to strings */ | 257 | u32 off_dt_strings; /* offset to strings */ |
258 | u32 off_mem_rsvmap; /* offset to memory reserve map | 258 | u32 off_mem_rsvmap; /* offset to memory reserve map |
259 | */ | 259 | */ |
260 | u32 version; /* format version */ | 260 | u32 version; /* format version */ |
261 | u32 last_comp_version; /* last compatible version */ | 261 | u32 last_comp_version; /* last compatible version */ |
262 | 262 | ||
@@ -265,6 +265,9 @@ struct boot_param_header { | |||
265 | booting on */ | 265 | booting on */ |
266 | /* version 3 fields below */ | 266 | /* version 3 fields below */ |
267 | u32 size_dt_strings; /* size of the strings block */ | 267 | u32 size_dt_strings; /* size of the strings block */ |
268 | |||
269 | /* version 17 fields below */ | ||
270 | u32 size_dt_struct; /* size of the DT structure block */ | ||
268 | }; | 271 | }; |
269 | 272 | ||
270 | Along with the constants: | 273 | Along with the constants: |
@@ -273,7 +276,7 @@ struct boot_param_header { | |||
273 | #define OF_DT_HEADER 0xd00dfeed /* 4: version, | 276 | #define OF_DT_HEADER 0xd00dfeed /* 4: version, |
274 | 4: total size */ | 277 | 4: total size */ |
275 | #define OF_DT_BEGIN_NODE 0x1 /* Start node: full name | 278 | #define OF_DT_BEGIN_NODE 0x1 /* Start node: full name |
276 | */ | 279 | */ |
277 | #define OF_DT_END_NODE 0x2 /* End node */ | 280 | #define OF_DT_END_NODE 0x2 /* End node */ |
278 | #define OF_DT_PROP 0x3 /* Property: name off, | 281 | #define OF_DT_PROP 0x3 /* Property: name off, |
279 | size, content */ | 282 | size, content */ |
@@ -310,9 +313,8 @@ struct boot_param_header { | |||
310 | - off_mem_rsvmap | 313 | - off_mem_rsvmap |
311 | 314 | ||
312 | This is an offset from the beginning of the header to the start | 315 | This is an offset from the beginning of the header to the start |
313 | of the reserved memory map. This map is a list of pairs of 64 | 316 | of the reserved memory map. This map is a list of pairs of 64- |
314 | bit integers. Each pair is a physical address and a size. The | 317 | bit integers. Each pair is a physical address and a size. The |
315 | |||
316 | list is terminated by an entry of size 0. This map provides the | 318 | list is terminated by an entry of size 0. This map provides the |
317 | kernel with a list of physical memory areas that are "reserved" | 319 | kernel with a list of physical memory areas that are "reserved" |
318 | and thus not to be used for memory allocations, especially during | 320 | and thus not to be used for memory allocations, especially during |
@@ -325,7 +327,7 @@ struct boot_param_header { | |||
325 | contain _at least_ this DT block itself (header,total_size). If | 327 | contain _at least_ this DT block itself (header,total_size). If |
326 | you are passing an initrd to the kernel, you should reserve it as | 328 | you are passing an initrd to the kernel, you should reserve it as |
327 | well. You do not need to reserve the kernel image itself. The map | 329 | well. You do not need to reserve the kernel image itself. The map |
328 | should be 64 bit aligned. | 330 | should be 64-bit aligned. |
329 | 331 | ||
330 | - version | 332 | - version |
331 | 333 | ||
@@ -335,10 +337,13 @@ struct boot_param_header { | |||
335 | to reallocate it easily at boot and free up the unused flattened | 337 | to reallocate it easily at boot and free up the unused flattened |
336 | structure after expansion. Version 16 introduces a new more | 338 | structure after expansion. Version 16 introduces a new more |
337 | "compact" format for the tree itself that is however not backward | 339 | "compact" format for the tree itself that is however not backward |
338 | compatible. You should always generate a structure of the highest | 340 | compatible. Version 17 adds an additional field, size_dt_struct, |
339 | version defined at the time of your implementation. Currently | 341 | allowing it to be reallocated or moved more easily (this is |
340 | that is version 16, unless you explicitly aim at being backward | 342 | particularly useful for bootloaders which need to make |
341 | compatible. | 343 | adjustments to a device tree based on probed information). You |
344 | should always generate a structure of the highest version defined | ||
345 | at the time of your implementation. Currently that is version 17, | ||
346 | unless you explicitly aim at being backward compatible. | ||
342 | 347 | ||
343 | - last_comp_version | 348 | - last_comp_version |
344 | 349 | ||
@@ -347,7 +352,7 @@ struct boot_param_header { | |||
347 | is backward compatible with version 1 (that is, a kernel build | 352 | is backward compatible with version 1 (that is, a kernel build |
348 | for version 1 will be able to boot with a version 2 format). You | 353 | for version 1 will be able to boot with a version 2 format). You |
349 | should put a 1 in this field if you generate a device tree of | 354 | should put a 1 in this field if you generate a device tree of |
350 | version 1 to 3, or 0x10 if you generate a tree of version 0x10 | 355 | version 1 to 3, or 16 if you generate a tree of version 16 or 17 |
351 | using the new unit name format. | 356 | using the new unit name format. |
352 | 357 | ||
353 | - boot_cpuid_phys | 358 | - boot_cpuid_phys |
@@ -360,6 +365,17 @@ struct boot_param_header { | |||
360 | point (see further chapters for more informations on the required | 365 | point (see further chapters for more informations on the required |
361 | device-tree contents) | 366 | device-tree contents) |
362 | 367 | ||
368 | - size_dt_strings | ||
369 | |||
370 | This field only exists on version 3 and later headers. It | ||
371 | gives the size of the "strings" section of the device tree (which | ||
372 | starts at the offset given by off_dt_strings). | ||
373 | |||
374 | - size_dt_struct | ||
375 | |||
376 | This field only exists on version 17 and later headers. It gives | ||
377 | the size of the "structure" section of the device tree (which | ||
378 | starts at the offset given by off_dt_struct). | ||
363 | 379 | ||
364 | So the typical layout of a DT block (though the various parts don't | 380 | So the typical layout of a DT block (though the various parts don't |
365 | need to be in that order) looks like this (addresses go from top to | 381 | need to be in that order) looks like this (addresses go from top to |
@@ -417,7 +433,7 @@ root node who has no parent. | |||
417 | A node has 2 names. The actual node name is generally contained in a | 433 | A node has 2 names. The actual node name is generally contained in a |
418 | property of type "name" in the node property list whose value is a | 434 | property of type "name" in the node property list whose value is a |
419 | zero terminated string and is mandatory for version 1 to 3 of the | 435 | zero terminated string and is mandatory for version 1 to 3 of the |
420 | format definition (as it is in Open Firmware). Version 0x10 makes it | 436 | format definition (as it is in Open Firmware). Version 16 makes it |
421 | optional as it can generate it from the unit name defined below. | 437 | optional as it can generate it from the unit name defined below. |
422 | 438 | ||
423 | There is also a "unit name" that is used to differentiate nodes with | 439 | There is also a "unit name" that is used to differentiate nodes with |
@@ -461,7 +477,7 @@ referencing another node via "phandle" is when laying out the | |||
461 | interrupt tree which will be described in a further version of this | 477 | interrupt tree which will be described in a further version of this |
462 | document. | 478 | document. |
463 | 479 | ||
464 | This "linux, phandle" property is a 32 bit value that uniquely | 480 | This "linux, phandle" property is a 32-bit value that uniquely |
465 | identifies a node. You are free to use whatever values or system of | 481 | identifies a node. You are free to use whatever values or system of |
466 | values, internal pointers, or whatever to generate these, the only | 482 | values, internal pointers, or whatever to generate these, the only |
467 | requirement is that every node for which you provide that property has | 483 | requirement is that every node for which you provide that property has |
@@ -471,7 +487,7 @@ Here is an example of a simple device-tree. In this example, an "o" | |||
471 | designates a node followed by the node unit name. Properties are | 487 | designates a node followed by the node unit name. Properties are |
472 | presented with their name followed by their content. "content" | 488 | presented with their name followed by their content. "content" |
473 | represents an ASCII string (zero terminated) value, while <content> | 489 | represents an ASCII string (zero terminated) value, while <content> |
474 | represents a 32 bit hexadecimal value. The various nodes in this | 490 | represents a 32-bit hexadecimal value. The various nodes in this |
475 | example will be discussed in a later chapter. At this point, it is | 491 | example will be discussed in a later chapter. At this point, it is |
476 | only meant to give you a idea of what a device-tree looks like. I have | 492 | only meant to give you a idea of what a device-tree looks like. I have |
477 | purposefully kept the "name" and "linux,phandle" properties which | 493 | purposefully kept the "name" and "linux,phandle" properties which |
@@ -543,15 +559,15 @@ Here's the basic structure of a single node: | |||
543 | * [align gap to next 4 bytes boundary] | 559 | * [align gap to next 4 bytes boundary] |
544 | * for each property: | 560 | * for each property: |
545 | * token OF_DT_PROP (that is 0x00000003) | 561 | * token OF_DT_PROP (that is 0x00000003) |
546 | * 32 bit value of property value size in bytes (or 0 of no | 562 | * 32-bit value of property value size in bytes (or 0 if no |
547 | * value) | 563 | value) |
548 | * 32 bit value of offset in string block of property name | 564 | * 32-bit value of offset in string block of property name |
549 | * property value data if any | 565 | * property value data if any |
550 | * [align gap to next 4 bytes boundary] | 566 | * [align gap to next 4 bytes boundary] |
551 | * [child nodes if any] | 567 | * [child nodes if any] |
552 | * token OF_DT_END_NODE (that is 0x00000002) | 568 | * token OF_DT_END_NODE (that is 0x00000002) |
553 | 569 | ||
554 | So the node content can be summarised as a start token, a full path, | 570 | So the node content can be summarized as a start token, a full path, |
555 | a list of properties, a list of child nodes, and an end token. Every | 571 | a list of properties, a list of child nodes, and an end token. Every |
556 | child node is a full node structure itself as defined above. | 572 | child node is a full node structure itself as defined above. |
557 | 573 | ||
@@ -583,7 +599,7 @@ provide those properties yourself. | |||
583 | ---------------------------------------------- | 599 | ---------------------------------------------- |
584 | 600 | ||
585 | The general rule is documented in the various Open Firmware | 601 | The general rule is documented in the various Open Firmware |
586 | documentations. If you chose to describe a bus with the device-tree | 602 | documentations. If you choose to describe a bus with the device-tree |
587 | and there exist an OF bus binding, then you should follow the | 603 | and there exist an OF bus binding, then you should follow the |
588 | specification. However, the kernel does not require every single | 604 | specification. However, the kernel does not require every single |
589 | device or bus to be described by the device tree. | 605 | device or bus to be described by the device tree. |
@@ -596,9 +612,9 @@ those properties defining addresses format for devices directly mapped | |||
596 | on the processor bus. | 612 | on the processor bus. |
597 | 613 | ||
598 | Those 2 properties define 'cells' for representing an address and a | 614 | Those 2 properties define 'cells' for representing an address and a |
599 | size. A "cell" is a 32 bit number. For example, if both contain 2 | 615 | size. A "cell" is a 32-bit number. For example, if both contain 2 |
600 | like the example tree given above, then an address and a size are both | 616 | like the example tree given above, then an address and a size are both |
601 | composed of 2 cells, and each is a 64 bit number (cells are | 617 | composed of 2 cells, and each is a 64-bit number (cells are |
602 | concatenated and expected to be in big endian format). Another example | 618 | concatenated and expected to be in big endian format). Another example |
603 | is the way Apple firmware defines them, with 2 cells for an address | 619 | is the way Apple firmware defines them, with 2 cells for an address |
604 | and one cell for a size. Most 32-bit implementations should define | 620 | and one cell for a size. Most 32-bit implementations should define |
@@ -632,7 +648,7 @@ prom_parse.c file of the recent kernels for your bus type. | |||
632 | 648 | ||
633 | The "reg" property only defines addresses and sizes (if #size-cells | 649 | The "reg" property only defines addresses and sizes (if #size-cells |
634 | is non-0) within a given bus. In order to translate addresses upward | 650 | is non-0) within a given bus. In order to translate addresses upward |
635 | (that is into parent bus addresses, and possibly into cpu physical | 651 | (that is into parent bus addresses, and possibly into CPU physical |
636 | addresses), all busses must contain a "ranges" property. If the | 652 | addresses), all busses must contain a "ranges" property. If the |
637 | "ranges" property is missing at a given level, it's assumed that | 653 | "ranges" property is missing at a given level, it's assumed that |
638 | translation isn't possible. The format of the "ranges" property for a | 654 | translation isn't possible. The format of the "ranges" property for a |
@@ -648,9 +664,9 @@ example, for a PCI host controller, that would be a CPU address. For a | |||
648 | PCI<->ISA bridge, that would be a PCI address. It defines the base | 664 | PCI<->ISA bridge, that would be a PCI address. It defines the base |
649 | address in the parent bus where the beginning of that range is mapped. | 665 | address in the parent bus where the beginning of that range is mapped. |
650 | 666 | ||
651 | For a new 64 bit powerpc board, I recommend either the 2/2 format or | 667 | For a new 64-bit powerpc board, I recommend either the 2/2 format or |
652 | Apple's 2/1 format which is slightly more compact since sizes usually | 668 | Apple's 2/1 format which is slightly more compact since sizes usually |
653 | fit in a single 32 bit word. New 32 bit powerpc boards should use a | 669 | fit in a single 32-bit word. New 32-bit powerpc boards should use a |
654 | 1/1 format, unless the processor supports physical addresses greater | 670 | 1/1 format, unless the processor supports physical addresses greater |
655 | than 32-bits, in which case a 2/1 format is recommended. | 671 | than 32-bits, in which case a 2/1 format is recommended. |
656 | 672 | ||
@@ -764,7 +780,7 @@ address which can extend beyond that limit. | |||
764 | Required properties: | 780 | Required properties: |
765 | 781 | ||
766 | - device_type : has to be "cpu" | 782 | - device_type : has to be "cpu" |
767 | - reg : This is the physical cpu number, it's a single 32 bit cell | 783 | - reg : This is the physical CPU number, it's a single 32-bit cell |
768 | and is also used as-is as the unit number for constructing the | 784 | and is also used as-is as the unit number for constructing the |
769 | unit name in the full path. For example, with 2 CPUs, you would | 785 | unit name in the full path. For example, with 2 CPUs, you would |
770 | have the full path: | 786 | have the full path: |
@@ -785,7 +801,7 @@ address which can extend beyond that limit. | |||
785 | the kernel timebase/decrementer calibration based on this | 801 | the kernel timebase/decrementer calibration based on this |
786 | value. | 802 | value. |
787 | - clock-frequency : a cell indicating the CPU core clock frequency | 803 | - clock-frequency : a cell indicating the CPU core clock frequency |
788 | in Hz. A new property will be defined for 64 bit values, but if | 804 | in Hz. A new property will be defined for 64-bit values, but if |
789 | your frequency is < 4Ghz, one cell is enough. Here as well as | 805 | your frequency is < 4Ghz, one cell is enough. Here as well as |
790 | for the above, the common code doesn't use that property, but | 806 | for the above, the common code doesn't use that property, but |
791 | you are welcome to re-use the pSeries or Maple one. A future | 807 | you are welcome to re-use the pSeries or Maple one. A future |
@@ -832,8 +848,7 @@ address which can extend beyond that limit. | |||
832 | 848 | ||
833 | This node is a bit "special". Normally, that's where open firmware | 849 | This node is a bit "special". Normally, that's where open firmware |
834 | puts some variable environment information, like the arguments, or | 850 | puts some variable environment information, like the arguments, or |
835 | phandle pointers to nodes like the main interrupt controller, or the | 851 | the default input/output devices. |
836 | default input/output devices. | ||
837 | 852 | ||
838 | This specification makes a few of these mandatory, but also defines | 853 | This specification makes a few of these mandatory, but also defines |
839 | some linux-specific properties that would be normally constructed by | 854 | some linux-specific properties that would be normally constructed by |
@@ -853,14 +868,14 @@ address which can extend beyond that limit. | |||
853 | that the kernel tries to find out the default console and has | 868 | that the kernel tries to find out the default console and has |
854 | knowledge of various types like 8250 serial ports. You may want | 869 | knowledge of various types like 8250 serial ports. You may want |
855 | to extend this function to add your own. | 870 | to extend this function to add your own. |
856 | - interrupt-controller : This is one cell containing a phandle | ||
857 | value that matches the "linux,phandle" property of your main | ||
858 | interrupt controller node. May be used for interrupt routing. | ||
859 | |||
860 | 871 | ||
861 | Note that u-boot creates and fills in the chosen node for platforms | 872 | Note that u-boot creates and fills in the chosen node for platforms |
862 | that use it. | 873 | that use it. |
863 | 874 | ||
875 | (Note: a practice that is now obsolete was to include a property | ||
876 | under /chosen called interrupt-controller which had a phandle value | ||
877 | that pointed to the main interrupt controller) | ||
878 | |||
864 | f) the /soc<SOCname> node | 879 | f) the /soc<SOCname> node |
865 | 880 | ||
866 | This node is used to represent a system-on-a-chip (SOC) and must be | 881 | This node is used to represent a system-on-a-chip (SOC) and must be |
@@ -908,8 +923,7 @@ address which can extend beyond that limit. | |||
908 | The SOC node may contain child nodes for each SOC device that the | 923 | The SOC node may contain child nodes for each SOC device that the |
909 | platform uses. Nodes should not be created for devices which exist | 924 | platform uses. Nodes should not be created for devices which exist |
910 | on the SOC but are not used by a particular platform. See chapter VI | 925 | on the SOC but are not used by a particular platform. See chapter VI |
911 | for more information on how to specify devices that are part of an | 926 | for more information on how to specify devices that are part of a SOC. |
912 | SOC. | ||
913 | 927 | ||
914 | Example SOC node for the MPC8540: | 928 | Example SOC node for the MPC8540: |
915 | 929 | ||
@@ -972,7 +986,7 @@ The syntax of the dtc tool is | |||
972 | [-o output-filename] [-V output_version] input_filename | 986 | [-o output-filename] [-V output_version] input_filename |
973 | 987 | ||
974 | 988 | ||
975 | The "output_version" defines what versio of the "blob" format will be | 989 | The "output_version" defines what version of the "blob" format will be |
976 | generated. Supported versions are 1,2,3 and 16. The default is | 990 | generated. Supported versions are 1,2,3 and 16. The default is |
977 | currently version 3 but that may change in the future to version 16. | 991 | currently version 3 but that may change in the future to version 16. |
978 | 992 | ||
@@ -994,12 +1008,12 @@ supported currently at the toplevel. | |||
994 | */ | 1008 | */ |
995 | 1009 | ||
996 | property2 = <1234abcd>; /* define a property containing a | 1010 | property2 = <1234abcd>; /* define a property containing a |
997 | * numerical 32 bits value (hexadecimal) | 1011 | * numerical 32-bit value (hexadecimal) |
998 | */ | 1012 | */ |
999 | 1013 | ||
1000 | property3 = <12345678 12345678 deadbeef>; | 1014 | property3 = <12345678 12345678 deadbeef>; |
1001 | /* define a property containing 3 | 1015 | /* define a property containing 3 |
1002 | * numerical 32 bits values (cells) in | 1016 | * numerical 32-bit values (cells) in |
1003 | * hexadecimal | 1017 | * hexadecimal |
1004 | */ | 1018 | */ |
1005 | property4 = [0a 0b 0c 0d de ea ad be ef]; | 1019 | property4 = [0a 0b 0c 0d de ea ad be ef]; |
@@ -1068,7 +1082,7 @@ while all this has been defined and implemented. | |||
1068 | its usage in early_init_devtree(), and the corresponding various | 1082 | its usage in early_init_devtree(), and the corresponding various |
1069 | early_init_dt_scan_*() callbacks. That code can be re-used in a | 1083 | early_init_dt_scan_*() callbacks. That code can be re-used in a |
1070 | GPL bootloader, and as the author of that code, I would be happy | 1084 | GPL bootloader, and as the author of that code, I would be happy |
1071 | to discuss possible free licencing to any vendor who wishes to | 1085 | to discuss possible free licensing to any vendor who wishes to |
1072 | integrate all or part of this code into a non-GPL bootloader. | 1086 | integrate all or part of this code into a non-GPL bootloader. |
1073 | 1087 | ||
1074 | 1088 | ||
@@ -1077,7 +1091,7 @@ VI - System-on-a-chip devices and nodes | |||
1077 | ======================================= | 1091 | ======================================= |
1078 | 1092 | ||
1079 | Many companies are now starting to develop system-on-a-chip | 1093 | Many companies are now starting to develop system-on-a-chip |
1080 | processors, where the processor core (cpu) and many peripheral devices | 1094 | processors, where the processor core (CPU) and many peripheral devices |
1081 | exist on a single piece of silicon. For these SOCs, an SOC node | 1095 | exist on a single piece of silicon. For these SOCs, an SOC node |
1082 | should be used that defines child nodes for the devices that make | 1096 | should be used that defines child nodes for the devices that make |
1083 | up the SOC. While platforms are not required to use this model in | 1097 | up the SOC. While platforms are not required to use this model in |
@@ -1109,42 +1123,7 @@ See appendix A for an example partial SOC node definition for the | |||
1109 | MPC8540. | 1123 | MPC8540. |
1110 | 1124 | ||
1111 | 1125 | ||
1112 | 2) Specifying interrupt information for SOC devices | 1126 | 2) Representing devices without a current OF specification |
1113 | --------------------------------------------------- | ||
1114 | |||
1115 | Each device that is part of an SOC and which generates interrupts | ||
1116 | should have the following properties: | ||
1117 | |||
1118 | - interrupt-parent : contains the phandle of the interrupt | ||
1119 | controller which handles interrupts for this device | ||
1120 | - interrupts : a list of tuples representing the interrupt | ||
1121 | number and the interrupt sense and level for each interrupt | ||
1122 | for this device. | ||
1123 | |||
1124 | This information is used by the kernel to build the interrupt table | ||
1125 | for the interrupt controllers in the system. | ||
1126 | |||
1127 | Sense and level information should be encoded as follows: | ||
1128 | |||
1129 | Devices connected to openPIC-compatible controllers should encode | ||
1130 | sense and polarity as follows: | ||
1131 | |||
1132 | 0 = low to high edge sensitive type enabled | ||
1133 | 1 = active low level sensitive type enabled | ||
1134 | 2 = active high level sensitive type enabled | ||
1135 | 3 = high to low edge sensitive type enabled | ||
1136 | |||
1137 | ISA PIC interrupt controllers should adhere to the ISA PIC | ||
1138 | encodings listed below: | ||
1139 | |||
1140 | 0 = active low level sensitive type enabled | ||
1141 | 1 = active high level sensitive type enabled | ||
1142 | 2 = high to low edge sensitive type enabled | ||
1143 | 3 = low to high edge sensitive type enabled | ||
1144 | |||
1145 | |||
1146 | |||
1147 | 3) Representing devices without a current OF specification | ||
1148 | ---------------------------------------------------------- | 1127 | ---------------------------------------------------------- |
1149 | 1128 | ||
1150 | Currently, there are many devices on SOCs that do not have a standard | 1129 | Currently, there are many devices on SOCs that do not have a standard |
@@ -1201,6 +1180,13 @@ platforms are moved over to use the flattened-device-tree model. | |||
1201 | - phy-handle : The phandle for the PHY connected to this ethernet | 1180 | - phy-handle : The phandle for the PHY connected to this ethernet |
1202 | controller. | 1181 | controller. |
1203 | 1182 | ||
1183 | Recommended properties: | ||
1184 | |||
1185 | - linux,network-index : This is the intended "index" of this | ||
1186 | network device. This is used by the bootwrapper to interpret | ||
1187 | MAC addresses passed by the firmware when no information other | ||
1188 | than indices is available to associate an address with a device. | ||
1189 | |||
1204 | Example: | 1190 | Example: |
1205 | 1191 | ||
1206 | ethernet@24000 { | 1192 | ethernet@24000 { |
@@ -1312,10 +1298,10 @@ platforms are moved over to use the flattened-device-tree model. | |||
1312 | and additions : | 1298 | and additions : |
1313 | 1299 | ||
1314 | Required properties : | 1300 | Required properties : |
1315 | - compatible : Should be "fsl-usb2-mph" for multi port host usb | 1301 | - compatible : Should be "fsl-usb2-mph" for multi port host USB |
1316 | controllers, or "fsl-usb2-dr" for dual role usb controllers | 1302 | controllers, or "fsl-usb2-dr" for dual role USB controllers |
1317 | - phy_type : For multi port host usb controllers, should be one of | 1303 | - phy_type : For multi port host USB controllers, should be one of |
1318 | "ulpi", or "serial". For dual role usb controllers, should be | 1304 | "ulpi", or "serial". For dual role USB controllers, should be |
1319 | one of "ulpi", "utmi", "utmi_wide", or "serial". | 1305 | one of "ulpi", "utmi", "utmi_wide", or "serial". |
1320 | - reg : Offset and length of the register set for the device | 1306 | - reg : Offset and length of the register set for the device |
1321 | - port0 : boolean; if defined, indicates port0 is connected for | 1307 | - port0 : boolean; if defined, indicates port0 is connected for |
@@ -1339,7 +1325,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1339 | - interrupt-parent : the phandle for the interrupt controller that | 1325 | - interrupt-parent : the phandle for the interrupt controller that |
1340 | services interrupts for this device. | 1326 | services interrupts for this device. |
1341 | 1327 | ||
1342 | Example multi port host usb controller device node : | 1328 | Example multi port host USB controller device node : |
1343 | usb@22000 { | 1329 | usb@22000 { |
1344 | device_type = "usb"; | 1330 | device_type = "usb"; |
1345 | compatible = "fsl-usb2-mph"; | 1331 | compatible = "fsl-usb2-mph"; |
@@ -1353,7 +1339,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1353 | port1; | 1339 | port1; |
1354 | }; | 1340 | }; |
1355 | 1341 | ||
1356 | Example dual role usb controller device node : | 1342 | Example dual role USB controller device node : |
1357 | usb@23000 { | 1343 | usb@23000 { |
1358 | device_type = "usb"; | 1344 | device_type = "usb"; |
1359 | compatible = "fsl-usb2-dr"; | 1345 | compatible = "fsl-usb2-dr"; |
@@ -1387,7 +1373,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1387 | - channel-fifo-len : An integer representing the number of | 1373 | - channel-fifo-len : An integer representing the number of |
1388 | descriptor pointers each channel fetch fifo can hold. | 1374 | descriptor pointers each channel fetch fifo can hold. |
1389 | - exec-units-mask : The bitmask representing what execution units | 1375 | - exec-units-mask : The bitmask representing what execution units |
1390 | (EUs) are available. It's a single 32 bit cell. EU information | 1376 | (EUs) are available. It's a single 32-bit cell. EU information |
1391 | should be encoded following the SEC's Descriptor Header Dword | 1377 | should be encoded following the SEC's Descriptor Header Dword |
1392 | EU_SEL0 field documentation, i.e. as follows: | 1378 | EU_SEL0 field documentation, i.e. as follows: |
1393 | 1379 | ||
@@ -1403,7 +1389,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1403 | bits 8 through 31 are reserved for future SEC EUs. | 1389 | bits 8 through 31 are reserved for future SEC EUs. |
1404 | 1390 | ||
1405 | - descriptor-types-mask : The bitmask representing what descriptors | 1391 | - descriptor-types-mask : The bitmask representing what descriptors |
1406 | are available. It's a single 32 bit cell. Descriptor type | 1392 | are available. It's a single 32-bit cell. Descriptor type |
1407 | information should be encoded following the SEC's Descriptor | 1393 | information should be encoded following the SEC's Descriptor |
1408 | Header Dword DESC_TYPE field documentation, i.e. as follows: | 1394 | Header Dword DESC_TYPE field documentation, i.e. as follows: |
1409 | 1395 | ||
@@ -1492,7 +1478,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1492 | Required properties: | 1478 | Required properties: |
1493 | - device_type : should be "spi". | 1479 | - device_type : should be "spi". |
1494 | - compatible : should be "fsl_spi". | 1480 | - compatible : should be "fsl_spi". |
1495 | - mode : the spi operation mode, it can be "cpu" or "qe". | 1481 | - mode : the SPI operation mode, it can be "cpu" or "qe". |
1496 | - reg : Offset and length of the register set for the device | 1482 | - reg : Offset and length of the register set for the device |
1497 | - interrupts : <a b> where a is the interrupt number and b is a | 1483 | - interrupts : <a b> where a is the interrupt number and b is a |
1498 | field that represents an encoding of the sense and level | 1484 | field that represents an encoding of the sense and level |
@@ -1569,6 +1555,12 @@ platforms are moved over to use the flattened-device-tree model. | |||
1569 | - mac-address : list of bytes representing the ethernet address. | 1555 | - mac-address : list of bytes representing the ethernet address. |
1570 | - phy-handle : The phandle for the PHY connected to this controller. | 1556 | - phy-handle : The phandle for the PHY connected to this controller. |
1571 | 1557 | ||
1558 | Recommended properties: | ||
1559 | - linux,network-index : This is the intended "index" of this | ||
1560 | network device. This is used by the bootwrapper to interpret | ||
1561 | MAC addresses passed by the firmware when no information other | ||
1562 | than indices is available to associate an address with a device. | ||
1563 | |||
1572 | Example: | 1564 | Example: |
1573 | ucc@2000 { | 1565 | ucc@2000 { |
1574 | device_type = "network"; | 1566 | device_type = "network"; |
@@ -1712,7 +1704,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1712 | - partitions : Several pairs of 32-bit values where the first value is | 1704 | - partitions : Several pairs of 32-bit values where the first value is |
1713 | partition's offset from the start of the device and the second one is | 1705 | partition's offset from the start of the device and the second one is |
1714 | partition size in bytes with LSB used to signify a read only | 1706 | partition size in bytes with LSB used to signify a read only |
1715 | partition (so, the parition size should always be an even number). | 1707 | partition (so, the partition size should always be an even number). |
1716 | - partition-names : The list of concatenated zero terminated strings | 1708 | - partition-names : The list of concatenated zero terminated strings |
1717 | representing the partition names. | 1709 | representing the partition names. |
1718 | - probe-type : The type of probe which should be done for the chip | 1710 | - probe-type : The type of probe which should be done for the chip |
@@ -1733,6 +1725,92 @@ platforms are moved over to use the flattened-device-tree model. | |||
1733 | 1725 | ||
1734 | More devices will be defined as this spec matures. | 1726 | More devices will be defined as this spec matures. |
1735 | 1727 | ||
1728 | VII - Specifying interrupt information for devices | ||
1729 | =================================================== | ||
1730 | |||
1731 | The device tree represents the busses and devices of a hardware | ||
1732 | system in a form similar to the physical bus topology of the | ||
1733 | hardware. | ||
1734 | |||
1735 | In addition, a logical 'interrupt tree' exists which represents the | ||
1736 | hierarchy and routing of interrupts in the hardware. | ||
1737 | |||
1738 | The interrupt tree model is fully described in the | ||
1739 | document "Open Firmware Recommended Practice: Interrupt | ||
1740 | Mapping Version 0.9". The document is available at: | ||
1741 | <http://playground.sun.com/1275/practice>. | ||
1742 | |||
1743 | 1) interrupts property | ||
1744 | ---------------------- | ||
1745 | |||
1746 | Devices that generate interrupts to a single interrupt controller | ||
1747 | should use the conventional OF representation described in the | ||
1748 | OF interrupt mapping documentation. | ||
1749 | |||
1750 | Each device which generates interrupts must have an 'interrupt' | ||
1751 | property. The interrupt property value is an arbitrary number of | ||
1752 | of 'interrupt specifier' values which describe the interrupt or | ||
1753 | interrupts for the device. | ||
1754 | |||
1755 | The encoding of an interrupt specifier is determined by the | ||
1756 | interrupt domain in which the device is located in the | ||
1757 | interrupt tree. The root of an interrupt domain specifies in | ||
1758 | its #interrupt-cells property the number of 32-bit cells | ||
1759 | required to encode an interrupt specifier. See the OF interrupt | ||
1760 | mapping documentation for a detailed description of domains. | ||
1761 | |||
1762 | For example, the binding for the OpenPIC interrupt controller | ||
1763 | specifies an #interrupt-cells value of 2 to encode the interrupt | ||
1764 | number and level/sense information. All interrupt children in an | ||
1765 | OpenPIC interrupt domain use 2 cells per interrupt in their interrupts | ||
1766 | property. | ||
1767 | |||
1768 | The PCI bus binding specifies a #interrupt-cell value of 1 to encode | ||
1769 | which interrupt pin (INTA,INTB,INTC,INTD) is used. | ||
1770 | |||
1771 | 2) interrupt-parent property | ||
1772 | ---------------------------- | ||
1773 | |||
1774 | The interrupt-parent property is specified to define an explicit | ||
1775 | link between a device node and its interrupt parent in | ||
1776 | the interrupt tree. The value of interrupt-parent is the | ||
1777 | phandle of the parent node. | ||
1778 | |||
1779 | If the interrupt-parent property is not defined for a node, it's | ||
1780 | interrupt parent is assumed to be an ancestor in the node's | ||
1781 | _device tree_ hierarchy. | ||
1782 | |||
1783 | 3) OpenPIC Interrupt Controllers | ||
1784 | -------------------------------- | ||
1785 | |||
1786 | OpenPIC interrupt controllers require 2 cells to encode | ||
1787 | interrupt information. The first cell defines the interrupt | ||
1788 | number. The second cell defines the sense and level | ||
1789 | information. | ||
1790 | |||
1791 | Sense and level information should be encoded as follows: | ||
1792 | |||
1793 | 0 = low to high edge sensitive type enabled | ||
1794 | 1 = active low level sensitive type enabled | ||
1795 | 2 = active high level sensitive type enabled | ||
1796 | 3 = high to low edge sensitive type enabled | ||
1797 | |||
1798 | 4) ISA Interrupt Controllers | ||
1799 | ---------------------------- | ||
1800 | |||
1801 | ISA PIC interrupt controllers require 2 cells to encode | ||
1802 | interrupt information. The first cell defines the interrupt | ||
1803 | number. The second cell defines the sense and level | ||
1804 | information. | ||
1805 | |||
1806 | ISA PIC interrupt controllers should adhere to the ISA PIC | ||
1807 | encodings listed below: | ||
1808 | |||
1809 | 0 = active low level sensitive type enabled | ||
1810 | 1 = active high level sensitive type enabled | ||
1811 | 2 = high to low edge sensitive type enabled | ||
1812 | 3 = low to high edge sensitive type enabled | ||
1813 | |||
1736 | 1814 | ||
1737 | Appendix A - Sample SOC node for MPC8540 | 1815 | Appendix A - Sample SOC node for MPC8540 |
1738 | ======================================== | 1816 | ======================================== |
diff --git a/Documentation/s390/crypto/crypto-API.txt b/Documentation/s390/crypto/crypto-API.txt deleted file mode 100644 index 71ae6ca9f2c2..000000000000 --- a/Documentation/s390/crypto/crypto-API.txt +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | crypto-API support for z990 Message Security Assist (MSA) instructions | ||
2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3 | |||
4 | AUTHOR: Thomas Spatzier (tspat@de.ibm.com) | ||
5 | |||
6 | |||
7 | 1. Introduction crypto-API | ||
8 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
9 | See Documentation/crypto/api-intro.txt for an introduction/description of the | ||
10 | kernel crypto API. | ||
11 | According to api-intro.txt support for z990 crypto instructions has been added | ||
12 | in the algorithm api layer of the crypto API. Several files containing z990 | ||
13 | optimized implementations of crypto algorithms are placed in the | ||
14 | arch/s390/crypto directory. | ||
15 | |||
16 | |||
17 | 2. Probing for availability of MSA | ||
18 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
19 | It should be possible to use Kernels with the z990 crypto implementations both | ||
20 | on machines with MSA available and on those without MSA (pre z990 or z990 | ||
21 | without MSA). Therefore a simple probing mechanism has been implemented: | ||
22 | In the init function of each crypto module the availability of MSA and of the | ||
23 | respective crypto algorithm in particular will be tested. If the algorithm is | ||
24 | available the module will load and register its algorithm with the crypto API. | ||
25 | |||
26 | If the respective crypto algorithm is not available, the init function will | ||
27 | return -ENOSYS. In that case a fallback to the standard software implementation | ||
28 | of the crypto algorithm must be taken ( -> the standard crypto modules are | ||
29 | also built when compiling the kernel). | ||
30 | |||
31 | |||
32 | 3. Ensuring z990 crypto module preference | ||
33 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
34 | If z990 crypto instructions are available the optimized modules should be | ||
35 | preferred instead of standard modules. | ||
36 | |||
37 | 3.1. compiled-in modules | ||
38 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
39 | For compiled-in modules it has to be ensured that the z990 modules are linked | ||
40 | before the standard crypto modules. Then, on system startup the init functions | ||
41 | of z990 crypto modules will be called first and query for availability of z990 | ||
42 | crypto instructions. If instruction is available, the z990 module will register | ||
43 | its crypto algorithm implementation -> the load of the standard module will fail | ||
44 | since the algorithm is already registered. | ||
45 | If z990 crypto instruction is not available the load of the z990 module will | ||
46 | fail -> the standard module will load and register its algorithm. | ||
47 | |||
48 | 3.2. dynamic modules | ||
49 | ~~~~~~~~~~~~~~~~~~~~ | ||
50 | A system administrator has to take care of giving preference to z990 crypto | ||
51 | modules. If MSA is available appropriate lines have to be added to | ||
52 | /etc/modprobe.conf. | ||
53 | |||
54 | Example: z990 crypto instruction for SHA1 algorithm is available | ||
55 | |||
56 | add the following line to /etc/modprobe.conf (assuming the | ||
57 | z990 crypto modules for SHA1 is called sha1_z990): | ||
58 | |||
59 | alias sha1 sha1_z990 | ||
60 | |||
61 | -> when the sha1 algorithm is requested through the crypto API | ||
62 | (which has a module autoloader) the z990 module will be loaded. | ||
63 | |||
64 | TBD: a userspace module probing mechanism | ||
65 | something like 'probe sha1 sha1_z990 sha1' in modprobe.conf | ||
66 | -> try module sha1_z990, if it fails to load standard module sha1 | ||
67 | the 'probe' statement is currently not supported in modprobe.conf | ||
68 | |||
69 | |||
70 | 4. Currently implemented z990 crypto algorithms | ||
71 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
72 | The following crypto algorithms with z990 MSA support are currently implemented. | ||
73 | The name of each algorithm under which it is registered in crypto API and the | ||
74 | name of the respective module is given in square brackets. | ||
75 | |||
76 | - SHA1 Digest Algorithm [sha1 -> sha1_z990] | ||
77 | - DES Encrypt/Decrypt Algorithm (64bit key) [des -> des_z990] | ||
78 | - Triple DES Encrypt/Decrypt Algorithm (128bit key) [des3_ede128 -> des_z990] | ||
79 | - Triple DES Encrypt/Decrypt Algorithm (192bit key) [des3_ede -> des_z990] | ||
80 | |||
81 | In order to load, for example, the sha1_z990 module when the sha1 algorithm is | ||
82 | requested (see 3.2.) add 'alias sha1 sha1_z990' to /etc/modprobe.conf. | ||
83 | |||
diff --git a/Documentation/s390/zfcpdump.txt b/Documentation/s390/zfcpdump.txt new file mode 100644 index 000000000000..cf45d27c4608 --- /dev/null +++ b/Documentation/s390/zfcpdump.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | s390 SCSI dump tool (zfcpdump) | ||
2 | |||
3 | System z machines (z900 or higher) provide hardware support for creating system | ||
4 | dumps on SCSI disks. The dump process is initiated by booting a dump tool, which | ||
5 | has to create a dump of the current (probably crashed) Linux image. In order to | ||
6 | not overwrite memory of the crashed Linux with data of the dump tool, the | ||
7 | hardware saves some memory plus the register sets of the boot cpu before the | ||
8 | dump tool is loaded. There exists an SCLP hardware interface to obtain the saved | ||
9 | memory afterwards. Currently 32 MB are saved. | ||
10 | |||
11 | This zfcpdump implementation consists of a Linux dump kernel together with | ||
12 | a userspace dump tool, which are loaded together into the saved memory region | ||
13 | below 32 MB. zfcpdump is installed on a SCSI disk using zipl (as contained in | ||
14 | the s390-tools package) to make the device bootable. The operator of a Linux | ||
15 | system can then trigger a SCSI dump by booting the SCSI disk, where zfcpdump | ||
16 | resides on. | ||
17 | |||
18 | The kernel part of zfcpdump is implemented as a debugfs file under "zcore/mem", | ||
19 | which exports memory and registers of the crashed Linux in an s390 | ||
20 | standalone dump format. It can be used in the same way as e.g. /dev/mem. The | ||
21 | dump format defines a 4K header followed by plain uncompressed memory. The | ||
22 | register sets are stored in the prefix pages of the respective cpus. To build a | ||
23 | dump enabled kernel with the zcore driver, the kernel config option | ||
24 | CONFIG_ZFCPDUMP has to be set. When reading from "zcore/mem", the part of | ||
25 | memory, which has been saved by hardware is read by the driver via the SCLP | ||
26 | hardware interface. The second part is just copied from the non overwritten real | ||
27 | memory. | ||
28 | |||
29 | The userspace application of zfcpdump can reside e.g. in an intitramfs or an | ||
30 | initrd. It reads from zcore/mem and writes the system dump to a file on a | ||
31 | SCSI disk. | ||
32 | |||
33 | To build a zfcpdump kernel use the following settings in your kernel | ||
34 | configuration: | ||
35 | * CONFIG_ZFCPDUMP=y | ||
36 | * Enable ZFCP driver | ||
37 | * Enable SCSI driver | ||
38 | * Enable ext2 and ext3 filesystems | ||
39 | * Disable as many features as possible to keep the kernel small. | ||
40 | E.g. network support is not needed at all. | ||
41 | |||
42 | To use the zfcpdump userspace application in an initramfs you have to do the | ||
43 | following: | ||
44 | |||
45 | * Copy the zfcpdump executable somewhere into your Linux tree. | ||
46 | E.g. to "arch/s390/boot/zfcpdump. If you do not want to include | ||
47 | shared libraries, compile the tool with the "-static" gcc option. | ||
48 | * If you want to include e2fsck, add it to your source tree, too. The zfcpdump | ||
49 | application attempts to start /sbin/e2fsck from the ramdisk. | ||
50 | * Use an initramfs config file like the following: | ||
51 | |||
52 | dir /dev 755 0 0 | ||
53 | nod /dev/console 644 0 0 c 5 1 | ||
54 | nod /dev/null 644 0 0 c 1 3 | ||
55 | nod /dev/sda1 644 0 0 b 8 1 | ||
56 | nod /dev/sda2 644 0 0 b 8 2 | ||
57 | nod /dev/sda3 644 0 0 b 8 3 | ||
58 | nod /dev/sda4 644 0 0 b 8 4 | ||
59 | nod /dev/sda5 644 0 0 b 8 5 | ||
60 | nod /dev/sda6 644 0 0 b 8 6 | ||
61 | nod /dev/sda7 644 0 0 b 8 7 | ||
62 | nod /dev/sda8 644 0 0 b 8 8 | ||
63 | nod /dev/sda9 644 0 0 b 8 9 | ||
64 | nod /dev/sda10 644 0 0 b 8 10 | ||
65 | nod /dev/sda11 644 0 0 b 8 11 | ||
66 | nod /dev/sda12 644 0 0 b 8 12 | ||
67 | nod /dev/sda13 644 0 0 b 8 13 | ||
68 | nod /dev/sda14 644 0 0 b 8 14 | ||
69 | nod /dev/sda15 644 0 0 b 8 15 | ||
70 | file /init arch/s390/boot/zfcpdump 755 0 0 | ||
71 | file /sbin/e2fsck arch/s390/boot/e2fsck 755 0 0 | ||
72 | dir /proc 755 0 0 | ||
73 | dir /sys 755 0 0 | ||
74 | dir /mnt 755 0 0 | ||
75 | dir /sbin 755 0 0 | ||
76 | |||
77 | * Issue "make image" to build the zfcpdump image with initramfs. | ||
78 | |||
79 | In a Linux distribution the zfcpdump enabled kernel image must be copied to | ||
80 | /usr/share/zfcpdump/zfcpdump.image, where the s390 zipl tool is looking for the | ||
81 | dump kernel when preparing a SCSI dump disk. | ||
82 | |||
83 | If you use a ramdisk copy it to "/usr/share/zfcpdump/zfcpdump.rd". | ||
84 | |||
85 | For more information on how to use zfcpdump refer to the s390 'Using the Dump | ||
86 | Tools book', which is available from | ||
87 | http://www.ibm.com/developerworks/linux/linux390. | ||
diff --git a/Documentation/sony-laptop.txt b/Documentation/sony-laptop.txt index dfd26df056f4..7a5c1a81905c 100644 --- a/Documentation/sony-laptop.txt +++ b/Documentation/sony-laptop.txt | |||
@@ -3,12 +3,18 @@ Sony Notebook Control Driver (SNC) Readme | |||
3 | Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net> | 3 | Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net> |
4 | Copyright (C) 2007 Mattia Dongili <malattia@linux.it> | 4 | Copyright (C) 2007 Mattia Dongili <malattia@linux.it> |
5 | 5 | ||
6 | This mini-driver drives the SNC device present in the ACPI BIOS of | 6 | This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the |
7 | the Sony Vaio laptops. | 7 | Sony Vaio laptops. This driver mixes both devices functions under the same |
8 | (hopefully consistent) interface. This also means that the sonypi driver is | ||
9 | obsoleted by sony-laptop now. | ||
8 | 10 | ||
9 | It gives access to some extra laptop functionalities. In its current | 11 | Fn keys (hotkeys): |
10 | form, this driver let the user set or query the screen brightness | 12 | ------------------ |
11 | through the backlight subsystem and remove/apply power to some devices. | 13 | Some models report hotkeys through the SNC or SPIC devices, such events are |
14 | reported both through the ACPI subsystem as acpi events and through the INPUT | ||
15 | subsystem. See the logs of acpid or /proc/acpi/event and | ||
16 | /proc/bus/input/devices to find out what those events are and which input | ||
17 | devices are created by the driver. | ||
12 | 18 | ||
13 | Backlight control: | 19 | Backlight control: |
14 | ------------------ | 20 | ------------------ |
@@ -39,6 +45,8 @@ The files are: | |||
39 | audiopower power on/off the internal sound card | 45 | audiopower power on/off the internal sound card |
40 | lanpower power on/off the internal ethernet card | 46 | lanpower power on/off the internal ethernet card |
41 | (only in debug mode) | 47 | (only in debug mode) |
48 | bluetoothpower power on/off the internal bluetooth device | ||
49 | fanspeed get/set the fan speed | ||
42 | 50 | ||
43 | Note that some files may be missing if they are not supported | 51 | Note that some files may be missing if they are not supported |
44 | by your particular laptop model. | 52 | by your particular laptop model. |
@@ -76,9 +84,9 @@ The sony-laptop driver creates, for some of those methods (the most | |||
76 | current ones found on several Vaio models), an entry under | 84 | current ones found on several Vaio models), an entry under |
77 | /sys/devices/platform/sony-laptop, just like the 'cdpower' one. | 85 | /sys/devices/platform/sony-laptop, just like the 'cdpower' one. |
78 | You can create other entries corresponding to your own laptop methods by | 86 | You can create other entries corresponding to your own laptop methods by |
79 | further editing the source (see the 'sony_acpi_values' table, and add a new | 87 | further editing the source (see the 'sony_nc_values' table, and add a new |
80 | entry to this table with your get/set method names using the | 88 | entry to this table with your get/set method names using the |
81 | HANDLE_NAMES macro). | 89 | SNC_HANDLE_NAMES macro). |
82 | 90 | ||
83 | Your mission, should you accept it, is to try finding out what | 91 | Your mission, should you accept it, is to try finding out what |
84 | those entries are for, by reading/writing random values from/to those | 92 | those entries are for, by reading/writing random values from/to those |
@@ -87,6 +95,9 @@ files and find out what is the impact on your laptop. | |||
87 | Should you find anything interesting, please report it back to me, | 95 | Should you find anything interesting, please report it back to me, |
88 | I will not disavow all knowledge of your actions :) | 96 | I will not disavow all knowledge of your actions :) |
89 | 97 | ||
98 | See also http://www.linux.it/~malattia/wiki/index.php/Sony_drivers for other | ||
99 | useful info. | ||
100 | |||
90 | Bugs/Limitations: | 101 | Bugs/Limitations: |
91 | ----------------- | 102 | ----------------- |
92 | 103 | ||
diff --git a/Documentation/ibm-acpi.txt b/Documentation/thinkpad-acpi.txt index 0132d363feb5..2d4803359a04 100644 --- a/Documentation/ibm-acpi.txt +++ b/Documentation/thinkpad-acpi.txt | |||
@@ -1,16 +1,22 @@ | |||
1 | IBM ThinkPad ACPI Extras Driver | 1 | ThinkPad ACPI Extras Driver |
2 | 2 | ||
3 | Version 0.12 | 3 | Version 0.14 |
4 | 17 August 2005 | 4 | April 21st, 2007 |
5 | 5 | ||
6 | Borislav Deianov <borislav@users.sf.net> | 6 | Borislav Deianov <borislav@users.sf.net> |
7 | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | ||
7 | http://ibm-acpi.sf.net/ | 8 | http://ibm-acpi.sf.net/ |
8 | 9 | ||
9 | 10 | ||
10 | This is a Linux ACPI driver for the IBM ThinkPad laptops. It supports | 11 | This is a Linux driver for the IBM and Lenovo ThinkPad laptops. It |
11 | various features of these laptops which are accessible through the | 12 | supports various features of these laptops which are accessible |
12 | ACPI framework but not otherwise supported by the generic Linux ACPI | 13 | through the ACPI and ACPI EC framework, but not otherwise fully |
13 | drivers. | 14 | supported by the generic Linux ACPI drivers. |
15 | |||
16 | This driver used to be named ibm-acpi until kernel 2.6.21 and release | ||
17 | 0.13-20070314. It used to be in the drivers/acpi tree, but it was | ||
18 | moved to the drivers/misc tree and renamed to thinkpad-acpi for kernel | ||
19 | 2.6.22, and release 0.14. | ||
14 | 20 | ||
15 | 21 | ||
16 | Status | 22 | Status |
@@ -21,7 +27,7 @@ detailed description): | |||
21 | 27 | ||
22 | - Fn key combinations | 28 | - Fn key combinations |
23 | - Bluetooth enable and disable | 29 | - Bluetooth enable and disable |
24 | - video output switching, expansion control | 30 | - video output switching, expansion control |
25 | - ThinkLight on and off | 31 | - ThinkLight on and off |
26 | - limited docking and undocking | 32 | - limited docking and undocking |
27 | - UltraBay eject | 33 | - UltraBay eject |
@@ -32,7 +38,7 @@ detailed description): | |||
32 | - Experimental: embedded controller register dump | 38 | - Experimental: embedded controller register dump |
33 | - LCD brightness control | 39 | - LCD brightness control |
34 | - Volume control | 40 | - Volume control |
35 | - Experimental: fan speed, fan enable/disable | 41 | - Fan control and monitoring: fan speed, fan enable/disable |
36 | - Experimental: WAN enable and disable | 42 | - Experimental: WAN enable and disable |
37 | 43 | ||
38 | A compatibility table by model and feature is maintained on the web | 44 | A compatibility table by model and feature is maintained on the web |
@@ -42,6 +48,8 @@ Please include the following information in your report: | |||
42 | 48 | ||
43 | - ThinkPad model name | 49 | - ThinkPad model name |
44 | - a copy of your DSDT, from /proc/acpi/dsdt | 50 | - a copy of your DSDT, from /proc/acpi/dsdt |
51 | - a copy of the output of dmidecode, with serial numbers | ||
52 | and UUIDs masked off | ||
45 | - which driver features work and which don't | 53 | - which driver features work and which don't |
46 | - the observed behavior of non-working features | 54 | - the observed behavior of non-working features |
47 | 55 | ||
@@ -52,25 +60,85 @@ Installation | |||
52 | ------------ | 60 | ------------ |
53 | 61 | ||
54 | If you are compiling this driver as included in the Linux kernel | 62 | If you are compiling this driver as included in the Linux kernel |
55 | sources, simply enable the CONFIG_ACPI_IBM option (Power Management / | 63 | sources, simply enable the CONFIG_THINKPAD_ACPI option, and optionally |
56 | ACPI / IBM ThinkPad Laptop Extras). | 64 | enable the CONFIG_THINKPAD_ACPI_BAY option if you want the |
65 | thinkpad-specific bay functionality. | ||
57 | 66 | ||
58 | Features | 67 | Features |
59 | -------- | 68 | -------- |
60 | 69 | ||
61 | The driver creates the /proc/acpi/ibm directory. There is a file under | 70 | The driver exports two different interfaces to userspace, which can be |
62 | that directory for each feature described below. Note that while the | 71 | used to access the features it provides. One is a legacy procfs-based |
63 | driver is still in the alpha stage, the exact proc file format and | 72 | interface, which will be removed at some time in the distant future. |
64 | commands supported by the various features is guaranteed to change | 73 | The other is a new sysfs-based interface which is not complete yet. |
65 | frequently. | ||
66 | 74 | ||
67 | Driver version -- /proc/acpi/ibm/driver | 75 | The procfs interface creates the /proc/acpi/ibm directory. There is a |
68 | --------------------------------------- | 76 | file under that directory for each feature it supports. The procfs |
77 | interface is mostly frozen, and will change very little if at all: it | ||
78 | will not be extended to add any new functionality in the driver, instead | ||
79 | all new functionality will be implemented on the sysfs interface. | ||
80 | |||
81 | The sysfs interface tries to blend in the generic Linux sysfs subsystems | ||
82 | and classes as much as possible. Since some of these subsystems are not | ||
83 | yet ready or stabilized, it is expected that this interface will change, | ||
84 | and any and all userspace programs must deal with it. | ||
85 | |||
86 | |||
87 | Notes about the sysfs interface: | ||
88 | |||
89 | Unlike what was done with the procfs interface, correctness when talking | ||
90 | to the sysfs interfaces will be enforced, as will correctness in the | ||
91 | thinkpad-acpi's implementation of sysfs interfaces. | ||
92 | |||
93 | Also, any bugs in the thinkpad-acpi sysfs driver code or in the | ||
94 | thinkpad-acpi's implementation of the sysfs interfaces will be fixed for | ||
95 | maximum correctness, even if that means changing an interface in | ||
96 | non-compatible ways. As these interfaces mature both in the kernel and | ||
97 | in thinkpad-acpi, such changes should become quite rare. | ||
98 | |||
99 | Applications interfacing to the thinkpad-acpi sysfs interfaces must | ||
100 | follow all sysfs guidelines and correctly process all errors (the sysfs | ||
101 | interface makes extensive use of errors). File descriptors and open / | ||
102 | close operations to the sysfs inodes must also be properly implemented. | ||
103 | |||
104 | The version of thinkpad-acpi's sysfs interface is exported by the driver | ||
105 | as a driver attribute (see below). | ||
106 | |||
107 | Sysfs driver attributes are on the driver's sysfs attribute space, | ||
108 | for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/. | ||
109 | |||
110 | Sysfs device attributes are on the driver's sysfs attribute space, | ||
111 | for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/. | ||
112 | |||
113 | Driver version | ||
114 | -------------- | ||
115 | |||
116 | procfs: /proc/acpi/ibm/driver | ||
117 | sysfs driver attribute: version | ||
69 | 118 | ||
70 | The driver name and version. No commands can be written to this file. | 119 | The driver name and version. No commands can be written to this file. |
71 | 120 | ||
72 | Hot keys -- /proc/acpi/ibm/hotkey | 121 | Sysfs interface version |
73 | --------------------------------- | 122 | ----------------------- |
123 | |||
124 | sysfs driver attribute: interface_version | ||
125 | |||
126 | Version of the thinkpad-acpi sysfs interface, as an unsigned long | ||
127 | (output in hex format: 0xAAAABBCC), where: | ||
128 | AAAA - major revision | ||
129 | BB - minor revision | ||
130 | CC - bugfix revision | ||
131 | |||
132 | The sysfs interface version changelog for the driver can be found at the | ||
133 | end of this document. Changes to the sysfs interface done by the kernel | ||
134 | subsystems are not documented here, nor are they tracked by this | ||
135 | attribute. | ||
136 | |||
137 | Hot keys | ||
138 | -------- | ||
139 | |||
140 | procfs: /proc/acpi/ibm/hotkey | ||
141 | sysfs device attribute: hotkey/* | ||
74 | 142 | ||
75 | Without this driver, only the Fn-F4 key (sleep button) generates an | 143 | Without this driver, only the Fn-F4 key (sleep button) generates an |
76 | ACPI event. With the driver loaded, the hotkey feature enabled and the | 144 | ACPI event. With the driver loaded, the hotkey feature enabled and the |
@@ -84,15 +152,6 @@ All labeled Fn-Fx key combinations generate distinct events. In | |||
84 | addition, the lid microswitch and some docking station buttons may | 152 | addition, the lid microswitch and some docking station buttons may |
85 | also generate such events. | 153 | also generate such events. |
86 | 154 | ||
87 | The following commands can be written to this file: | ||
88 | |||
89 | echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature | ||
90 | echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature | ||
91 | echo 0xffff > /proc/acpi/ibm/hotkey -- enable all possible hot keys | ||
92 | echo 0x0000 > /proc/acpi/ibm/hotkey -- disable all possible hot keys | ||
93 | ... any other 4-hex-digit mask ... | ||
94 | echo reset > /proc/acpi/ibm/hotkey -- restore the original mask | ||
95 | |||
96 | The bit mask allows some control over which hot keys generate ACPI | 155 | The bit mask allows some control over which hot keys generate ACPI |
97 | events. Not all bits in the mask can be modified. Not all bits that | 156 | events. Not all bits in the mask can be modified. Not all bits that |
98 | can be modified do anything. Not all hot keys can be individually | 157 | can be modified do anything. Not all hot keys can be individually |
@@ -124,15 +183,77 @@ buttons do not generate ACPI events even with this driver. They *can* | |||
124 | be used through the "ThinkPad Buttons" utility, see | 183 | be used through the "ThinkPad Buttons" utility, see |
125 | http://www.nongnu.org/tpb/ | 184 | http://www.nongnu.org/tpb/ |
126 | 185 | ||
127 | Bluetooth -- /proc/acpi/ibm/bluetooth | 186 | procfs notes: |
128 | ------------------------------------- | 187 | |
188 | The following commands can be written to the /proc/acpi/ibm/hotkey file: | ||
189 | |||
190 | echo enable > /proc/acpi/ibm/hotkey -- enable the hot keys feature | ||
191 | echo disable > /proc/acpi/ibm/hotkey -- disable the hot keys feature | ||
192 | echo 0xffff > /proc/acpi/ibm/hotkey -- enable all possible hot keys | ||
193 | echo 0x0000 > /proc/acpi/ibm/hotkey -- disable all possible hot keys | ||
194 | ... any other 4-hex-digit mask ... | ||
195 | echo reset > /proc/acpi/ibm/hotkey -- restore the original mask | ||
196 | |||
197 | sysfs notes: | ||
198 | |||
199 | The hot keys attributes are in a hotkey/ subdirectory off the | ||
200 | thinkpad device. | ||
201 | |||
202 | bios_enabled: | ||
203 | Returns the status of the hot keys feature when | ||
204 | thinkpad-acpi was loaded. Upon module unload, the hot | ||
205 | key feature status will be restored to this value. | ||
206 | |||
207 | 0: hot keys were disabled | ||
208 | 1: hot keys were enabled | ||
209 | |||
210 | bios_mask: | ||
211 | Returns the hot keys mask when thinkpad-acpi was loaded. | ||
212 | Upon module unload, the hot keys mask will be restored | ||
213 | to this value. | ||
214 | |||
215 | enable: | ||
216 | Enables/disables the hot keys feature, and reports | ||
217 | current status of the hot keys feature. | ||
218 | |||
219 | 0: disables the hot keys feature / feature disabled | ||
220 | 1: enables the hot keys feature / feature enabled | ||
221 | |||
222 | mask: | ||
223 | bit mask to enable ACPI event generation for each hot | ||
224 | key (see above). Returns the current status of the hot | ||
225 | keys mask, and allows one to modify it. | ||
226 | |||
129 | 227 | ||
130 | This feature shows the presence and current state of a Bluetooth | 228 | Bluetooth |
131 | device. If Bluetooth is installed, the following commands can be used: | 229 | --------- |
230 | |||
231 | procfs: /proc/acpi/ibm/bluetooth | ||
232 | sysfs device attribute: bluetooth/enable | ||
233 | |||
234 | This feature shows the presence and current state of a ThinkPad | ||
235 | Bluetooth device in the internal ThinkPad CDC slot. | ||
236 | |||
237 | Procfs notes: | ||
238 | |||
239 | If Bluetooth is installed, the following commands can be used: | ||
132 | 240 | ||
133 | echo enable > /proc/acpi/ibm/bluetooth | 241 | echo enable > /proc/acpi/ibm/bluetooth |
134 | echo disable > /proc/acpi/ibm/bluetooth | 242 | echo disable > /proc/acpi/ibm/bluetooth |
135 | 243 | ||
244 | Sysfs notes: | ||
245 | |||
246 | If the Bluetooth CDC card is installed, it can be enabled / | ||
247 | disabled through the "bluetooth/enable" thinkpad-acpi device | ||
248 | attribute, and its current status can also be queried. | ||
249 | |||
250 | enable: | ||
251 | 0: disables Bluetooth / Bluetooth is disabled | ||
252 | 1: enables Bluetooth / Bluetooth is enabled. | ||
253 | |||
254 | Note: this interface will be probably be superseeded by the | ||
255 | generic rfkill class. | ||
256 | |||
136 | Video output control -- /proc/acpi/ibm/video | 257 | Video output control -- /proc/acpi/ibm/video |
137 | -------------------------------------------- | 258 | -------------------------------------------- |
138 | 259 | ||
@@ -209,7 +330,7 @@ hot plugging of devices in the Linux ACPI framework. If the laptop was | |||
209 | booted while not in the dock, the following message is shown in the | 330 | booted while not in the dock, the following message is shown in the |
210 | logs: | 331 | logs: |
211 | 332 | ||
212 | Mar 17 01:42:34 aero kernel: ibm_acpi: dock device not present | 333 | Mar 17 01:42:34 aero kernel: thinkpad_acpi: dock device not present |
213 | 334 | ||
214 | In this case, no dock-related events are generated but the dock and | 335 | In this case, no dock-related events are generated but the dock and |
215 | undock commands described below still work. They can be executed | 336 | undock commands described below still work. They can be executed |
@@ -269,7 +390,7 @@ This is due to the current lack of support for hot plugging of devices | |||
269 | in the Linux ACPI framework. If the laptop was booted without the | 390 | in the Linux ACPI framework. If the laptop was booted without the |
270 | UltraBay, the following message is shown in the logs: | 391 | UltraBay, the following message is shown in the logs: |
271 | 392 | ||
272 | Mar 17 01:42:34 aero kernel: ibm_acpi: bay device not present | 393 | Mar 17 01:42:34 aero kernel: thinkpad_acpi: bay device not present |
273 | 394 | ||
274 | In this case, no bay-related events are generated but the eject | 395 | In this case, no bay-related events are generated but the eject |
275 | command described below still works. It can be executed manually or | 396 | command described below still works. It can be executed manually or |
@@ -313,23 +434,19 @@ supported. Use "eject2" instead of "eject" for the second bay. | |||
313 | Note: the UltraBay eject support on the 600e/x, A22p and A3x is | 434 | Note: the UltraBay eject support on the 600e/x, A22p and A3x is |
314 | EXPERIMENTAL and may not work as expected. USE WITH CAUTION! | 435 | EXPERIMENTAL and may not work as expected. USE WITH CAUTION! |
315 | 436 | ||
316 | CMOS control -- /proc/acpi/ibm/cmos | 437 | CMOS control |
317 | ----------------------------------- | 438 | ------------ |
439 | |||
440 | procfs: /proc/acpi/ibm/cmos | ||
441 | sysfs device attribute: cmos_command | ||
318 | 442 | ||
319 | This feature is used internally by the ACPI firmware to control the | 443 | This feature is used internally by the ACPI firmware to control the |
320 | ThinkLight on most newer ThinkPad models. It may also control LCD | 444 | ThinkLight on most newer ThinkPad models. It may also control LCD |
321 | brightness, sounds volume and more, but only on some models. | 445 | brightness, sounds volume and more, but only on some models. |
322 | 446 | ||
323 | The commands are non-negative integer numbers: | 447 | The range of valid cmos command numbers is 0 to 21, but not all have an |
324 | 448 | effect and the behavior varies from model to model. Here is the behavior | |
325 | echo 0 >/proc/acpi/ibm/cmos | 449 | on the X40 (tpb is the ThinkPad Buttons utility): |
326 | echo 1 >/proc/acpi/ibm/cmos | ||
327 | echo 2 >/proc/acpi/ibm/cmos | ||
328 | ... | ||
329 | |||
330 | The range of valid numbers is 0 to 21, but not all have an effect and | ||
331 | the behavior varies from model to model. Here is the behavior on the | ||
332 | X40 (tpb is the ThinkPad Buttons utility): | ||
333 | 450 | ||
334 | 0 - no effect but tpb reports "Volume down" | 451 | 0 - no effect but tpb reports "Volume down" |
335 | 1 - no effect but tpb reports "Volume up" | 452 | 1 - no effect but tpb reports "Volume up" |
@@ -342,6 +459,9 @@ X40 (tpb is the ThinkPad Buttons utility): | |||
342 | 13 - ThinkLight off | 459 | 13 - ThinkLight off |
343 | 14 - no effect but tpb reports ThinkLight status change | 460 | 14 - no effect but tpb reports ThinkLight status change |
344 | 461 | ||
462 | The cmos command interface is prone to firmware split-brain problems, as | ||
463 | in newer ThinkPads it is just a compatibility layer. | ||
464 | |||
345 | LED control -- /proc/acpi/ibm/led | 465 | LED control -- /proc/acpi/ibm/led |
346 | --------------------------------- | 466 | --------------------------------- |
347 | 467 | ||
@@ -393,17 +513,17 @@ X40: | |||
393 | 16 - one medium-pitched beep repeating constantly, stop with 17 | 513 | 16 - one medium-pitched beep repeating constantly, stop with 17 |
394 | 17 - stop 16 | 514 | 17 - stop 16 |
395 | 515 | ||
396 | Temperature sensors -- /proc/acpi/ibm/thermal | 516 | Temperature sensors |
397 | --------------------------------------------- | 517 | ------------------- |
518 | |||
519 | procfs: /proc/acpi/ibm/thermal | ||
520 | sysfs device attributes: (hwmon) temp*_input | ||
398 | 521 | ||
399 | Most ThinkPads include six or more separate temperature sensors but | 522 | Most ThinkPads include six or more separate temperature sensors but |
400 | only expose the CPU temperature through the standard ACPI methods. | 523 | only expose the CPU temperature through the standard ACPI methods. |
401 | This feature shows readings from up to eight different sensors on older | 524 | This feature shows readings from up to eight different sensors on older |
402 | ThinkPads, and it has experimental support for up to sixteen different | 525 | ThinkPads, and it has experimental support for up to sixteen different |
403 | sensors on newer ThinkPads. Readings from sensors that are not available | 526 | sensors on newer ThinkPads. |
404 | return -128. | ||
405 | |||
406 | No commands can be written to this file. | ||
407 | 527 | ||
408 | EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the | 528 | EXPERIMENTAL: The 16-sensors feature is marked EXPERIMENTAL because the |
409 | implementation directly accesses hardware registers and may not work as | 529 | implementation directly accesses hardware registers and may not work as |
@@ -460,6 +580,20 @@ The A31 has a very atypical layout for the thermal sensors | |||
460 | 8: Bay Battery: secondary sensor | 580 | 8: Bay Battery: secondary sensor |
461 | 581 | ||
462 | 582 | ||
583 | Procfs notes: | ||
584 | Readings from sensors that are not available return -128. | ||
585 | No commands can be written to this file. | ||
586 | |||
587 | Sysfs notes: | ||
588 | Sensors that are not available return the ENXIO error. This | ||
589 | status may change at runtime, as there are hotplug thermal | ||
590 | sensors, like those inside the batteries and docks. | ||
591 | |||
592 | thinkpad-acpi thermal sensors are reported through the hwmon | ||
593 | subsystem, and follow all of the hwmon guidelines at | ||
594 | Documentation/hwmon. | ||
595 | |||
596 | |||
463 | EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump | 597 | EXPERIMENTAL: Embedded controller register dump -- /proc/acpi/ibm/ecdump |
464 | ------------------------------------------------------------------------ | 598 | ------------------------------------------------------------------------ |
465 | 599 | ||
@@ -472,7 +606,7 @@ This feature dumps the values of 256 embedded controller | |||
472 | registers. Values which have changed since the last time the registers | 606 | registers. Values which have changed since the last time the registers |
473 | were dumped are marked with a star: | 607 | were dumped are marked with a star: |
474 | 608 | ||
475 | [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump | 609 | [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump |
476 | EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f | 610 | EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f |
477 | EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00 | 611 | EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00 |
478 | EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00 | 612 | EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00 |
@@ -503,7 +637,7 @@ vary. The second ensures that the fan-related values do vary, since | |||
503 | the fan speed fluctuates a bit. The third will (hopefully) mark the | 637 | the fan speed fluctuates a bit. The third will (hopefully) mark the |
504 | fan register with a star: | 638 | fan register with a star: |
505 | 639 | ||
506 | [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump | 640 | [root@x40 ibm-acpi]# cat /proc/acpi/ibm/ecdump |
507 | EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f | 641 | EC +00 +01 +02 +03 +04 +05 +06 +07 +08 +09 +0a +0b +0c +0d +0e +0f |
508 | EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00 | 642 | EC 0x00: a7 47 87 01 fe 96 00 08 01 00 cb 00 00 00 40 00 |
509 | EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00 | 643 | EC 0x10: 00 00 ff ff f4 3c 87 09 01 ff 42 01 ff ff 0d 00 |
@@ -533,19 +667,59 @@ registers contain the current battery capacity, etc. If you experiment | |||
533 | with this, do send me your results (including some complete dumps with | 667 | with this, do send me your results (including some complete dumps with |
534 | a description of the conditions when they were taken.) | 668 | a description of the conditions when they were taken.) |
535 | 669 | ||
536 | LCD brightness control -- /proc/acpi/ibm/brightness | 670 | LCD brightness control |
537 | --------------------------------------------------- | 671 | ---------------------- |
672 | |||
673 | procfs: /proc/acpi/ibm/brightness | ||
674 | sysfs backlight device "thinkpad_screen" | ||
538 | 675 | ||
539 | This feature allows software control of the LCD brightness on ThinkPad | 676 | This feature allows software control of the LCD brightness on ThinkPad |
540 | models which don't have a hardware brightness slider. The available | 677 | models which don't have a hardware brightness slider. |
541 | commands are: | 678 | |
679 | It has some limitations: the LCD backlight cannot be actually turned on or off | ||
680 | by this interface, and in many ThinkPad models, the "dim while on battery" | ||
681 | functionality will be enabled by the BIOS when this interface is used, and | ||
682 | cannot be controlled. | ||
683 | |||
684 | The backlight control has eight levels, ranging from 0 to 7. Some of the | ||
685 | levels may not be distinct. | ||
686 | |||
687 | Procfs notes: | ||
688 | |||
689 | The available commands are: | ||
542 | 690 | ||
543 | echo up >/proc/acpi/ibm/brightness | 691 | echo up >/proc/acpi/ibm/brightness |
544 | echo down >/proc/acpi/ibm/brightness | 692 | echo down >/proc/acpi/ibm/brightness |
545 | echo 'level <level>' >/proc/acpi/ibm/brightness | 693 | echo 'level <level>' >/proc/acpi/ibm/brightness |
546 | 694 | ||
547 | The <level> number range is 0 to 7, although not all of them may be | 695 | Sysfs notes: |
548 | distinct. The current brightness level is shown in the file. | 696 | |
697 | The interface is implemented through the backlight sysfs class, which is poorly | ||
698 | documented at this time. | ||
699 | |||
700 | Locate the thinkpad_screen device under /sys/class/backlight, and inside it | ||
701 | there will be the following attributes: | ||
702 | |||
703 | max_brightness: | ||
704 | Reads the maximum brightness the hardware can be set to. | ||
705 | The minimum is always zero. | ||
706 | |||
707 | actual_brightness: | ||
708 | Reads what brightness the screen is set to at this instant. | ||
709 | |||
710 | brightness: | ||
711 | Writes request the driver to change brightness to the given | ||
712 | value. Reads will tell you what brightness the driver is trying | ||
713 | to set the display to when "power" is set to zero and the display | ||
714 | has not been dimmed by a kernel power management event. | ||
715 | |||
716 | power: | ||
717 | power management mode, where 0 is "display on", and 1 to 3 will | ||
718 | dim the display backlight to brightness level 0 because | ||
719 | thinkpad-acpi cannot really turn the backlight off. Kernel | ||
720 | power management events can temporarily increase the current | ||
721 | power management level, i.e. they can dim the display. | ||
722 | |||
549 | 723 | ||
550 | Volume control -- /proc/acpi/ibm/volume | 724 | Volume control -- /proc/acpi/ibm/volume |
551 | --------------------------------------- | 725 | --------------------------------------- |
@@ -563,41 +737,42 @@ distinct. The unmute the volume after the mute command, use either the | |||
563 | up or down command (the level command will not unmute the volume). | 737 | up or down command (the level command will not unmute the volume). |
564 | The current volume level and mute state is shown in the file. | 738 | The current volume level and mute state is shown in the file. |
565 | 739 | ||
566 | EXPERIMENTAL: fan speed, fan enable/disable -- /proc/acpi/ibm/fan | 740 | Fan control and monitoring: fan speed, fan enable/disable |
567 | ----------------------------------------------------------------- | 741 | --------------------------------------------------------- |
568 | 742 | ||
569 | This feature is marked EXPERIMENTAL because the implementation | 743 | procfs: /proc/acpi/ibm/fan |
570 | directly accesses hardware registers and may not work as expected. USE | 744 | sysfs device attributes: (hwmon) fan_input, pwm1, pwm1_enable |
571 | WITH CAUTION! To use this feature, you need to supply the | 745 | |
572 | experimental=1 parameter when loading the module. | 746 | NOTE NOTE NOTE: fan control operations are disabled by default for |
747 | safety reasons. To enable them, the module parameter "fan_control=1" | ||
748 | must be given to thinkpad-acpi. | ||
573 | 749 | ||
574 | This feature attempts to show the current fan speed, control mode and | 750 | This feature attempts to show the current fan speed, control mode and |
575 | other fan data that might be available. The speed is read directly | 751 | other fan data that might be available. The speed is read directly |
576 | from the hardware registers of the embedded controller. This is known | 752 | from the hardware registers of the embedded controller. This is known |
577 | to work on later R, T and X series ThinkPads but may show a bogus | 753 | to work on later R, T, X and Z series ThinkPads but may show a bogus |
578 | value on other models. | 754 | value on other models. |
579 | 755 | ||
580 | Most ThinkPad fans work in "levels". Level 0 stops the fan. The higher | 756 | Fan levels: |
581 | the level, the higher the fan speed, although adjacent levels often map | ||
582 | to the same fan speed. 7 is the highest level, where the fan reaches | ||
583 | the maximum recommended speed. Level "auto" means the EC changes the | ||
584 | fan level according to some internal algorithm, usually based on | ||
585 | readings from the thermal sensors. Level "disengaged" means the EC | ||
586 | disables the speed-locked closed-loop fan control, and drives the fan as | ||
587 | fast as it can go, which might exceed hardware limits, so use this level | ||
588 | with caution. | ||
589 | 757 | ||
590 | The fan usually ramps up or down slowly from one speed to another, | 758 | Most ThinkPad fans work in "levels" at the firmware interface. Level 0 |
591 | and it is normal for the EC to take several seconds to react to fan | 759 | stops the fan. The higher the level, the higher the fan speed, although |
592 | commands. | 760 | adjacent levels often map to the same fan speed. 7 is the highest |
761 | level, where the fan reaches the maximum recommended speed. | ||
593 | 762 | ||
594 | The fan may be enabled or disabled with the following commands: | 763 | Level "auto" means the EC changes the fan level according to some |
764 | internal algorithm, usually based on readings from the thermal sensors. | ||
595 | 765 | ||
596 | echo enable >/proc/acpi/ibm/fan | 766 | There is also a "full-speed" level, also known as "disengaged" level. |
597 | echo disable >/proc/acpi/ibm/fan | 767 | In this level, the EC disables the speed-locked closed-loop fan control, |
768 | and drives the fan as fast as it can go, which might exceed hardware | ||
769 | limits, so use this level with caution. | ||
598 | 770 | ||
599 | Placing a fan on level 0 is the same as disabling it. Enabling a fan | 771 | The fan usually ramps up or down slowly from one speed to another, and |
600 | will try to place it in a safe level if it is too slow or disabled. | 772 | it is normal for the EC to take several seconds to react to fan |
773 | commands. The full-speed level may take up to two minutes to ramp up to | ||
774 | maximum speed, and in some ThinkPads, the tachometer readings go stale | ||
775 | while the EC is transitioning to the full-speed level. | ||
601 | 776 | ||
602 | WARNING WARNING WARNING: do not leave the fan disabled unless you are | 777 | WARNING WARNING WARNING: do not leave the fan disabled unless you are |
603 | monitoring all of the temperature sensor readings and you are ready to | 778 | monitoring all of the temperature sensor readings and you are ready to |
@@ -615,46 +790,146 @@ fan is turned off when the CPU temperature drops to 49 degrees and the | |||
615 | HDD temperature drops to 41 degrees. These thresholds cannot | 790 | HDD temperature drops to 41 degrees. These thresholds cannot |
616 | currently be controlled. | 791 | currently be controlled. |
617 | 792 | ||
793 | The ThinkPad's ACPI DSDT code will reprogram the fan on its own when | ||
794 | certain conditions are met. It will override any fan programming done | ||
795 | through thinkpad-acpi. | ||
796 | |||
797 | The thinkpad-acpi kernel driver can be programmed to revert the fan | ||
798 | level to a safe setting if userspace does not issue one of the procfs | ||
799 | fan commands: "enable", "disable", "level" or "watchdog", or if there | ||
800 | are no writes to pwm1_enable (or to pwm1 *if and only if* pwm1_enable is | ||
801 | set to 1, manual mode) within a configurable amount of time of up to | ||
802 | 120 seconds. This functionality is called fan safety watchdog. | ||
803 | |||
804 | Note that the watchdog timer stops after it enables the fan. It will be | ||
805 | rearmed again automatically (using the same interval) when one of the | ||
806 | above mentioned fan commands is received. The fan watchdog is, | ||
807 | therefore, not suitable to protect against fan mode changes made through | ||
808 | means other than the "enable", "disable", and "level" procfs fan | ||
809 | commands, or the hwmon fan control sysfs interface. | ||
810 | |||
811 | Procfs notes: | ||
812 | |||
813 | The fan may be enabled or disabled with the following commands: | ||
814 | |||
815 | echo enable >/proc/acpi/ibm/fan | ||
816 | echo disable >/proc/acpi/ibm/fan | ||
817 | |||
818 | Placing a fan on level 0 is the same as disabling it. Enabling a fan | ||
819 | will try to place it in a safe level if it is too slow or disabled. | ||
820 | |||
618 | The fan level can be controlled with the command: | 821 | The fan level can be controlled with the command: |
619 | 822 | ||
620 | echo 'level <level>' > /proc/acpi/ibm/thermal | 823 | echo 'level <level>' > /proc/acpi/ibm/fan |
621 | 824 | ||
622 | Where <level> is an integer from 0 to 7, or one of the words "auto" | 825 | Where <level> is an integer from 0 to 7, or one of the words "auto" or |
623 | or "disengaged" (without the quotes). Not all ThinkPads support the | 826 | "full-speed" (without the quotes). Not all ThinkPads support the "auto" |
624 | "auto" and "disengaged" levels. | 827 | and "full-speed" levels. The driver accepts "disengaged" as an alias for |
828 | "full-speed", and reports it as "disengaged" for backwards | ||
829 | compatibility. | ||
625 | 830 | ||
626 | On the X31 and X40 (and ONLY on those models), the fan speed can be | 831 | On the X31 and X40 (and ONLY on those models), the fan speed can be |
627 | controlled to a certain degree. Once the fan is running, it can be | 832 | controlled to a certain degree. Once the fan is running, it can be |
628 | forced to run faster or slower with the following command: | 833 | forced to run faster or slower with the following command: |
629 | 834 | ||
630 | echo 'speed <speed>' > /proc/acpi/ibm/thermal | 835 | echo 'speed <speed>' > /proc/acpi/ibm/fan |
631 | 836 | ||
632 | The sustainable range of fan speeds on the X40 appears to be from | 837 | The sustainable range of fan speeds on the X40 appears to be from about |
633 | about 3700 to about 7350. Values outside this range either do not have | 838 | 3700 to about 7350. Values outside this range either do not have any |
634 | any effect or the fan speed eventually settles somewhere in that | 839 | effect or the fan speed eventually settles somewhere in that range. The |
635 | range. The fan cannot be stopped or started with this command. | 840 | fan cannot be stopped or started with this command. This functionality |
841 | is incomplete, and not available through the sysfs interface. | ||
636 | 842 | ||
637 | The ThinkPad's ACPI DSDT code will reprogram the fan on its own when | 843 | To program the safety watchdog, use the "watchdog" command. |
638 | certain conditions are met. It will override any fan programming done | ||
639 | through ibm-acpi. | ||
640 | 844 | ||
641 | EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan | 845 | echo 'watchdog <interval in seconds>' > /proc/acpi/ibm/fan |
642 | --------------------------------------- | 846 | |
847 | If you want to disable the watchdog, use 0 as the interval. | ||
848 | |||
849 | Sysfs notes: | ||
850 | |||
851 | The sysfs interface follows the hwmon subsystem guidelines for the most | ||
852 | part, and the exception is the fan safety watchdog. | ||
853 | |||
854 | Writes to any of the sysfs attributes may return the EINVAL error if | ||
855 | that operation is not supported in a given ThinkPad or if the parameter | ||
856 | is out-of-bounds, and EPERM if it is forbidden. They may also return | ||
857 | EINTR (interrupted system call), and EIO (I/O error while trying to talk | ||
858 | to the firmware). | ||
859 | |||
860 | Features not yet implemented by the driver return ENOSYS. | ||
861 | |||
862 | hwmon device attribute pwm1_enable: | ||
863 | 0: PWM offline (fan is set to full-speed mode) | ||
864 | 1: Manual PWM control (use pwm1 to set fan level) | ||
865 | 2: Hardware PWM control (EC "auto" mode) | ||
866 | 3: reserved (Software PWM control, not implemented yet) | ||
867 | |||
868 | Modes 0 and 2 are not supported by all ThinkPads, and the | ||
869 | driver is not always able to detect this. If it does know a | ||
870 | mode is unsupported, it will return -EINVAL. | ||
871 | |||
872 | hwmon device attribute pwm1: | ||
873 | Fan level, scaled from the firmware values of 0-7 to the hwmon | ||
874 | scale of 0-255. 0 means fan stopped, 255 means highest normal | ||
875 | speed (level 7). | ||
876 | |||
877 | This attribute only commands the fan if pmw1_enable is set to 1 | ||
878 | (manual PWM control). | ||
879 | |||
880 | hwmon device attribute fan1_input: | ||
881 | Fan tachometer reading, in RPM. May go stale on certain | ||
882 | ThinkPads while the EC transitions the PWM to offline mode, | ||
883 | which can take up to two minutes. May return rubbish on older | ||
884 | ThinkPads. | ||
885 | |||
886 | driver attribute fan_watchdog: | ||
887 | Fan safety watchdog timer interval, in seconds. Minimum is | ||
888 | 1 second, maximum is 120 seconds. 0 disables the watchdog. | ||
889 | |||
890 | To stop the fan: set pwm1 to zero, and pwm1_enable to 1. | ||
891 | |||
892 | To start the fan in a safe mode: set pwm1_enable to 2. If that fails | ||
893 | with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255 | ||
894 | would be the safest choice, though). | ||
895 | |||
896 | |||
897 | EXPERIMENTAL: WAN | ||
898 | ----------------- | ||
899 | |||
900 | procfs: /proc/acpi/ibm/wan | ||
901 | sysfs device attribute: wwan/enable | ||
643 | 902 | ||
644 | This feature is marked EXPERIMENTAL because the implementation | 903 | This feature is marked EXPERIMENTAL because the implementation |
645 | directly accesses hardware registers and may not work as expected. USE | 904 | directly accesses hardware registers and may not work as expected. USE |
646 | WITH CAUTION! To use this feature, you need to supply the | 905 | WITH CAUTION! To use this feature, you need to supply the |
647 | experimental=1 parameter when loading the module. | 906 | experimental=1 parameter when loading the module. |
648 | 907 | ||
649 | This feature shows the presence and current state of a WAN (Sierra | 908 | This feature shows the presence and current state of a W-WAN (Sierra |
650 | Wireless EV-DO) device. If WAN is installed, the following commands can | 909 | Wireless EV-DO) device. |
651 | be used: | 910 | |
911 | It was tested on a Lenovo Thinkpad X60. It should probably work on other | ||
912 | Thinkpad models which come with this module installed. | ||
913 | |||
914 | Procfs notes: | ||
915 | |||
916 | If the W-WAN card is installed, the following commands can be used: | ||
652 | 917 | ||
653 | echo enable > /proc/acpi/ibm/wan | 918 | echo enable > /proc/acpi/ibm/wan |
654 | echo disable > /proc/acpi/ibm/wan | 919 | echo disable > /proc/acpi/ibm/wan |
655 | 920 | ||
656 | It was tested on a Lenovo Thinkpad X60. It should probably work on other | 921 | Sysfs notes: |
657 | Thinkpad models which come with this module installed. | 922 | |
923 | If the W-WAN card is installed, it can be enabled / | ||
924 | disabled through the "wwan/enable" thinkpad-acpi device | ||
925 | attribute, and its current status can also be queried. | ||
926 | |||
927 | enable: | ||
928 | 0: disables WWAN card / WWAN card is disabled | ||
929 | 1: enables WWAN card / WWAN card is enabled. | ||
930 | |||
931 | Note: this interface will be probably be superseeded by the | ||
932 | generic rfkill class. | ||
658 | 933 | ||
659 | Multiple Commands, Module Parameters | 934 | Multiple Commands, Module Parameters |
660 | ------------------------------------ | 935 | ------------------------------------ |
@@ -665,64 +940,42 @@ separating them with commas, for example: | |||
665 | echo enable,0xffff > /proc/acpi/ibm/hotkey | 940 | echo enable,0xffff > /proc/acpi/ibm/hotkey |
666 | echo lcd_disable,crt_enable > /proc/acpi/ibm/video | 941 | echo lcd_disable,crt_enable > /proc/acpi/ibm/video |
667 | 942 | ||
668 | Commands can also be specified when loading the ibm_acpi module, for | 943 | Commands can also be specified when loading the thinkpad-acpi module, |
669 | example: | 944 | for example: |
670 | 945 | ||
671 | modprobe ibm_acpi hotkey=enable,0xffff video=auto_disable | 946 | modprobe thinkpad_acpi hotkey=enable,0xffff video=auto_disable |
672 | 947 | ||
673 | The ibm-acpi kernel driver can be programmed to revert the fan level | 948 | Enabling debugging output |
674 | to a safe setting if userspace does not issue one of the fan commands: | 949 | ------------------------- |
675 | "enable", "disable", "level" or "watchdog" within a configurable | 950 | |
676 | ammount of time. To do this, use the "watchdog" command. | 951 | The module takes a debug paramater which can be used to selectively |
677 | 952 | enable various classes of debugging output, for example: | |
678 | echo 'watchdog <interval>' > /proc/acpi/ibm/fan | 953 | |
679 | 954 | modprobe ibm_acpi debug=0xffff | |
680 | Interval is the ammount of time in seconds to wait for one of the | 955 | |
681 | above mentioned fan commands before reseting the fan level to a safe | 956 | will enable all debugging output classes. It takes a bitmask, so |
682 | one. If set to zero, the watchdog is disabled (default). When the | 957 | to enable more than one output class, just add their values. |
683 | watchdog timer runs out, it does the exact equivalent of the "enable" | 958 | |
684 | fan command. | 959 | Debug bitmask Description |
685 | 960 | 0x0001 Initialization and probing | |
686 | Note that the watchdog timer stops after it enables the fan. It will | 961 | 0x0002 Removal |
687 | be rearmed again automatically (using the same interval) when one of | 962 | |
688 | the above mentioned fan commands is received. The fan watchdog is, | 963 | There is also a kernel build option to enable more debugging |
689 | therefore, not suitable to protect against fan mode changes made | 964 | information, which may be necessary to debug driver problems. |
690 | through means other than the "enable", "disable", and "level" fan | 965 | |
691 | commands. | 966 | The level of debugging information output by the driver can be changed |
692 | 967 | at runtime through sysfs, using the driver attribute debug_level. The | |
693 | 968 | attribute takes the same bitmask as the debug module parameter above. | |
694 | Example Configuration | 969 | |
695 | --------------------- | 970 | Force loading of module |
696 | 971 | ----------------------- | |
697 | The ACPI support in the kernel is intended to be used in conjunction | 972 | |
698 | with a user-space daemon, acpid. The configuration files for this | 973 | If thinkpad-acpi refuses to detect your ThinkPad, you can try to specify |
699 | daemon control what actions are taken in response to various ACPI | 974 | the module parameter force_load=1. Regardless of whether this works or |
700 | events. An example set of configuration files are included in the | 975 | not, please contact ibm-acpi-devel@lists.sourceforge.net with a report. |
701 | config/ directory of the tarball package available on the web | 976 | |
702 | site. Note that these are provided for illustration purposes only and | 977 | |
703 | may need to be adapted to your particular setup. | 978 | Sysfs interface changelog: |
704 | 979 | ||
705 | The following utility scripts are used by the example action | 980 | 0x000100: Initial sysfs support, as a single platform driver and |
706 | scripts (included with ibm-acpi for completeness): | 981 | device. |
707 | |||
708 | /usr/local/sbin/idectl -- from the hdparm source distribution, | ||
709 | see http://www.ibiblio.org/pub/Linux/system/hardware | ||
710 | /usr/local/sbin/laptop_mode -- from the Linux kernel source | ||
711 | distribution, see Documentation/laptop-mode.txt | ||
712 | /sbin/service -- comes with Redhat/Fedora distributions | ||
713 | /usr/sbin/hibernate -- from the Software Suspend 2 distribution, | ||
714 | see http://softwaresuspend.berlios.de/ | ||
715 | |||
716 | Toan T Nguyen <ntt@physics.ucla.edu> notes that Suse uses the | ||
717 | powersave program to suspend ('powersave --suspend-to-ram') or | ||
718 | hibernate ('powersave --suspend-to-disk'). This means that the | ||
719 | hibernate script is not needed on that distribution. | ||
720 | |||
721 | Henrik Brix Andersen <brix@gentoo.org> has written a Gentoo ACPI event | ||
722 | handler script for the X31. You can get the latest version from | ||
723 | http://dev.gentoo.org/~brix/files/x31.sh | ||
724 | |||
725 | David Schweikert <dws@ee.eth.ch> has written an alternative blank.sh | ||
726 | script which works on Debian systems. This scripts has now been | ||
727 | extended to also work on Fedora systems and included as the default | ||
728 | blank.sh in the distribution. | ||
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index 0f6808abd612..53ae866ae37b 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -16,7 +16,7 @@ situation as with tcpdump. | |||
16 | 16 | ||
17 | Unlike the packet socket, usbmon has an interface which provides traces | 17 | Unlike the packet socket, usbmon has an interface which provides traces |
18 | in a text format. This is used for two purposes. First, it serves as a | 18 | in a text format. This is used for two purposes. First, it serves as a |
19 | common trace exchange format for tools while most sophisticated formats | 19 | common trace exchange format for tools while more sophisticated formats |
20 | are finalized. Second, humans can read it in case tools are not available. | 20 | are finalized. Second, humans can read it in case tools are not available. |
21 | 21 | ||
22 | To collect a raw text trace, execute following steps. | 22 | To collect a raw text trace, execute following steps. |
@@ -34,7 +34,7 @@ if usbmon is built into the kernel. | |||
34 | Verify that bus sockets are present. | 34 | Verify that bus sockets are present. |
35 | 35 | ||
36 | # ls /sys/kernel/debug/usbmon | 36 | # ls /sys/kernel/debug/usbmon |
37 | 1s 1t 2s 2t 3s 3t 4s 4t | 37 | 1s 1t 1u 2s 2t 2u 3s 3t 3u 4s 4t 4u |
38 | # | 38 | # |
39 | 39 | ||
40 | 2. Find which bus connects to the desired device | 40 | 2. Find which bus connects to the desired device |
@@ -54,7 +54,7 @@ Bus=03 means it's bus 3. | |||
54 | 54 | ||
55 | 3. Start 'cat' | 55 | 3. Start 'cat' |
56 | 56 | ||
57 | # cat /sys/kernel/debug/usbmon/3t > /tmp/1.mon.out | 57 | # cat /sys/kernel/debug/usbmon/3u > /tmp/1.mon.out |
58 | 58 | ||
59 | This process will be reading until killed. Naturally, the output can be | 59 | This process will be reading until killed. Naturally, the output can be |
60 | redirected to a desirable location. This is preferred, because it is going | 60 | redirected to a desirable location. This is preferred, because it is going |
@@ -75,46 +75,80 @@ that the file size is not excessive for your favourite editor. | |||
75 | 75 | ||
76 | * Raw text data format | 76 | * Raw text data format |
77 | 77 | ||
78 | The '1t' type data consists of a stream of events, such as URB submission, | 78 | Two formats are supported currently: the original, or '1t' format, and |
79 | the '1u' format. The '1t' format is deprecated in kernel 2.6.21. The '1u' | ||
80 | format adds a few fields, such as ISO frame descriptors, interval, etc. | ||
81 | It produces slightly longer lines, but otherwise is a perfect superset | ||
82 | of '1t' format. | ||
83 | |||
84 | If it is desired to recognize one from the other in a program, look at the | ||
85 | "address" word (see below), where '1u' format adds a bus number. If 2 colons | ||
86 | are present, it's the '1t' format, otherwise '1u'. | ||
87 | |||
88 | Any text format data consists of a stream of events, such as URB submission, | ||
79 | URB callback, submission error. Every event is a text line, which consists | 89 | URB callback, submission error. Every event is a text line, which consists |
80 | of whitespace separated words. The number or position of words may depend | 90 | of whitespace separated words. The number or position of words may depend |
81 | on the event type, but there is a set of words, common for all types. | 91 | on the event type, but there is a set of words, common for all types. |
82 | 92 | ||
83 | Here is the list of words, from left to right: | 93 | Here is the list of words, from left to right: |
94 | |||
84 | - URB Tag. This is used to identify URBs is normally a kernel mode address | 95 | - URB Tag. This is used to identify URBs is normally a kernel mode address |
85 | of the URB structure in hexadecimal. | 96 | of the URB structure in hexadecimal. |
97 | |||
86 | - Timestamp in microseconds, a decimal number. The timestamp's resolution | 98 | - Timestamp in microseconds, a decimal number. The timestamp's resolution |
87 | depends on available clock, and so it can be much worse than a microsecond | 99 | depends on available clock, and so it can be much worse than a microsecond |
88 | (if the implementation uses jiffies, for example). | 100 | (if the implementation uses jiffies, for example). |
101 | |||
89 | - Event Type. This type refers to the format of the event, not URB type. | 102 | - Event Type. This type refers to the format of the event, not URB type. |
90 | Available types are: S - submission, C - callback, E - submission error. | 103 | Available types are: S - submission, C - callback, E - submission error. |
91 | - "Pipe". The pipe concept is deprecated. This is a composite word, used to | 104 | |
92 | be derived from information in pipes. It consists of three fields, separated | 105 | - "Address" word (formerly a "pipe"). It consists of four fields, separated by |
93 | by colons: URB type and direction, Device address, Endpoint number. | 106 | colons: URB type and direction, Bus number, Device address, Endpoint number. |
94 | Type and direction are encoded with two bytes in the following manner: | 107 | Type and direction are encoded with two bytes in the following manner: |
95 | Ci Co Control input and output | 108 | Ci Co Control input and output |
96 | Zi Zo Isochronous input and output | 109 | Zi Zo Isochronous input and output |
97 | Ii Io Interrupt input and output | 110 | Ii Io Interrupt input and output |
98 | Bi Bo Bulk input and output | 111 | Bi Bo Bulk input and output |
99 | Device address and Endpoint number are 3-digit and 2-digit (respectively) | 112 | Bus number, Device address, and Endpoint are decimal numbers, but they may |
100 | decimal numbers, with leading zeroes. | 113 | have leading zeros, for the sake of human readers. |
101 | - URB Status. In most cases, this field contains a number, sometimes negative, | 114 | |
102 | which represents a "status" field of the URB. This field makes no sense for | 115 | - URB Status word. This is either a letter, or several numbers separated |
103 | submissions, but is present anyway to help scripts with parsing. When an | 116 | by colons: URB status, interval, start frame, and error count. Unlike the |
104 | error occurs, the field contains the error code. In case of a submission of | 117 | "address" word, all fields save the status are optional. Interval is printed |
105 | a Control packet, this field contains a Setup Tag instead of an error code. | 118 | only for interrupt and isochronous URBs. Start frame is printed only for |
106 | It is easy to tell whether the Setup Tag is present because it is never a | 119 | isochronous URBs. Error count is printed only for isochronous callback |
107 | number. Thus if scripts find a number in this field, they proceed to read | 120 | events. |
108 | Data Length. If they find something else, like a letter, they read the setup | 121 | |
109 | packet before reading the Data Length. | 122 | The status field is a decimal number, sometimes negative, which represents |
123 | a "status" field of the URB. This field makes no sense for submissions, but | ||
124 | is present anyway to help scripts with parsing. When an error occurs, the | ||
125 | field contains the error code. | ||
126 | |||
127 | In case of a submission of a Control packet, this field contains a Setup Tag | ||
128 | instead of an group of numbers. It is easy to tell whether the Setup Tag is | ||
129 | present because it is never a number. Thus if scripts find a set of numbers | ||
130 | in this word, they proceed to read Data Length (except for isochronous URBs). | ||
131 | If they find something else, like a letter, they read the setup packet before | ||
132 | reading the Data Length or isochronous descriptors. | ||
133 | |||
110 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, | 134 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, |
111 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. | 135 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. |
112 | These words are safe to decode if Setup Tag was 's'. Otherwise, the setup | 136 | These words are safe to decode if Setup Tag was 's'. Otherwise, the setup |
113 | packet was present, but not captured, and the fields contain filler. | 137 | packet was present, but not captured, and the fields contain filler. |
138 | |||
139 | - Number of isochronous frame descriptors and descriptors themselves. | ||
140 | If an Isochronous transfer event has a set of descriptors, a total number | ||
141 | of them in an URB is printed first, then a word per descriptor, up to a | ||
142 | total of 5. The word consists of 3 colon-separated decimal numbers for | ||
143 | status, offset, and length respectively. For submissions, initial length | ||
144 | is reported. For callbacks, actual length is reported. | ||
145 | |||
114 | - Data Length. For submissions, this is the requested length. For callbacks, | 146 | - Data Length. For submissions, this is the requested length. For callbacks, |
115 | this is the actual length. | 147 | this is the actual length. |
148 | |||
116 | - Data tag. The usbmon may not always capture data, even if length is nonzero. | 149 | - Data tag. The usbmon may not always capture data, even if length is nonzero. |
117 | The data words are present only if this tag is '='. | 150 | The data words are present only if this tag is '='. |
151 | |||
118 | - Data words follow, in big endian hexadecimal format. Notice that they are | 152 | - Data words follow, in big endian hexadecimal format. Notice that they are |
119 | not machine words, but really just a byte stream split into words to make | 153 | not machine words, but really just a byte stream split into words to make |
120 | it easier to read. Thus, the last word may contain from one to four bytes. | 154 | it easier to read. Thus, the last word may contain from one to four bytes. |
@@ -153,20 +187,18 @@ class ParsedLine { | |||
153 | } | 187 | } |
154 | } | 188 | } |
155 | 189 | ||
156 | This format may be changed in the future. | ||
157 | |||
158 | Examples: | 190 | Examples: |
159 | 191 | ||
160 | An input control transfer to get a port status. | 192 | An input control transfer to get a port status. |
161 | 193 | ||
162 | d5ea89a0 3575914555 S Ci:001:00 s a3 00 0000 0003 0004 4 < | 194 | d5ea89a0 3575914555 S Ci:1:001:0 s a3 00 0000 0003 0004 4 < |
163 | d5ea89a0 3575914560 C Ci:001:00 0 4 = 01050000 | 195 | d5ea89a0 3575914560 C Ci:1:001:0 0 4 = 01050000 |
164 | 196 | ||
165 | An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper | 197 | An output bulk transfer to send a SCSI command 0x5E in a 31-byte Bulk wrapper |
166 | to a storage device at address 5: | 198 | to a storage device at address 5: |
167 | 199 | ||
168 | dd65f0e8 4128379752 S Bo:005:02 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000 | 200 | dd65f0e8 4128379752 S Bo:1:005:2 -115 31 = 55534243 5e000000 00000000 00000600 00000000 00000000 00000000 000000 |
169 | dd65f0e8 4128379808 C Bo:005:02 0 31 > | 201 | dd65f0e8 4128379808 C Bo:1:005:2 0 31 > |
170 | 202 | ||
171 | * Raw binary format and API | 203 | * Raw binary format and API |
172 | 204 | ||
diff --git a/Documentation/video4linux/CARDLIST.bttv b/Documentation/video4linux/CARDLIST.bttv index fc2fe9bc6713..b60639130a51 100644 --- a/Documentation/video4linux/CARDLIST.bttv +++ b/Documentation/video4linux/CARDLIST.bttv | |||
@@ -143,3 +143,5 @@ | |||
143 | 142 -> Sabrent TV-FM (bttv version) | 143 | 142 -> Sabrent TV-FM (bttv version) |
144 | 143 -> Hauppauge ImpactVCB (bt878) [0070:13eb] | 144 | 143 -> Hauppauge ImpactVCB (bt878) [0070:13eb] |
145 | 144 -> MagicTV | 145 | 144 -> MagicTV |
146 | 145 -> SSAI Security Video Interface [4149:5353] | ||
147 | 146 -> SSAI Ultrasound Video Interface [414a:5353] | ||
diff --git a/Documentation/video4linux/CARDLIST.cx88 b/Documentation/video4linux/CARDLIST.cx88 index 62e32b49cec9..60f838beb9c8 100644 --- a/Documentation/video4linux/CARDLIST.cx88 +++ b/Documentation/video4linux/CARDLIST.cx88 | |||
@@ -37,7 +37,7 @@ | |||
37 | 36 -> AVerTV 303 (M126) [1461:000a] | 37 | 36 -> AVerTV 303 (M126) [1461:000a] |
38 | 37 -> Hauppauge Nova-S-Plus DVB-S [0070:9201,0070:9202] | 38 | 37 -> Hauppauge Nova-S-Plus DVB-S [0070:9201,0070:9202] |
39 | 38 -> Hauppauge Nova-SE2 DVB-S [0070:9200] | 39 | 38 -> Hauppauge Nova-SE2 DVB-S [0070:9200] |
40 | 39 -> KWorld DVB-S 100 [17de:08b2] | 40 | 39 -> KWorld DVB-S 100 [17de:08b2,1421:0341] |
41 | 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402] | 41 | 40 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid [0070:9400,0070:9402] |
42 | 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] | 42 | 41 -> Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile) [0070:9800,0070:9802] |
43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019] | 43 | 42 -> digitalnow DNTV Live! DVB-T Pro [1822:0025,1822:0019] |
diff --git a/Documentation/video4linux/CARDLIST.ivtv b/Documentation/video4linux/CARDLIST.ivtv new file mode 100644 index 000000000000..ddd76a0eb100 --- /dev/null +++ b/Documentation/video4linux/CARDLIST.ivtv | |||
@@ -0,0 +1,18 @@ | |||
1 | 1 -> Hauppauge WinTV PVR-250 | ||
2 | 2 -> Hauppauge WinTV PVR-350 | ||
3 | 3 -> Hauppauge WinTV PVR-150 or PVR-500 | ||
4 | 4 -> AVerMedia M179 [1461:a3ce,1461:a3cf] | ||
5 | 5 -> Yuan MPG600/Kuroutoshikou iTVC16-STVLP [12ab:fff3,12ab:ffff] | ||
6 | 6 -> Yuan MPG160/Kuroutoshikou iTVC15-STVLP [12ab:0000,10fc:40a0] | ||
7 | 7 -> Yuan PG600/DiamondMM PVR-550 [ff92:0070,ffab:0600] | ||
8 | 8 -> Adaptec AVC-2410 [9005:0093] | ||
9 | 9 -> Adaptec AVC-2010 [9005:0092] | ||
10 | 10 -> NAGASE TRANSGEAR 5000TV [1461:bfff] | ||
11 | 11 -> AOpen VA2000MAX-STN6 [0000:ff5f] | ||
12 | 12 -> YUAN MPG600GR/Kuroutoshikou CX23416GYC-STVLP [12ab:0600,fbab:0600,1154:0523] | ||
13 | 13 -> I/O Data GV-MVP/RX [10fc:d01e,10fc:d038,10fc:d039] | ||
14 | 14 -> I/O Data GV-MVP/RX2E [10fc:d025] | ||
15 | 15 -> GOTVIEW PCI DVD (partial support only) [12ab:0600] | ||
16 | 16 -> GOTVIEW PCI DVD2 Deluxe [ffac:0600] | ||
17 | 17 -> Yuan MPC622 [ff01:d998] | ||
18 | 18 -> Digital Cowboy DCT-MTVP1 [1461:bfff] | ||
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index a12246a9bf23..d7bb2e2e4d9b 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -53,7 +53,7 @@ | |||
53 | 52 -> AverMedia AverTV/305 [1461:2108] | 53 | 52 -> AverMedia AverTV/305 [1461:2108] |
54 | 53 -> ASUS TV-FM 7135 [1043:4845] | 54 | 53 -> ASUS TV-FM 7135 [1043:4845] |
55 | 54 -> LifeView FlyTV Platinum FM / Gold [5168:0214,1489:0214,5168:0304] | 55 | 54 -> LifeView FlyTV Platinum FM / Gold [5168:0214,1489:0214,5168:0304] |
56 | 55 -> LifeView FlyDVB-T DUO [5168:0306] | 56 | 55 -> LifeView FlyDVB-T DUO / MSI TV@nywhere Duo [5168:0306,4E42:0306] |
57 | 56 -> Avermedia AVerTV 307 [1461:a70a] | 57 | 56 -> Avermedia AVerTV 307 [1461:a70a] |
58 | 57 -> Avermedia AVerTV GO 007 FM [1461:f31f] | 58 | 57 -> Avermedia AVerTV GO 007 FM [1461:f31f] |
59 | 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370] | 59 | 58 -> ADS Tech Instant TV (saa7135) [1421:0350,1421:0351,1421:0370,1421:1370] |
@@ -76,7 +76,7 @@ | |||
76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] | 76 | 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] |
77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] | 77 | 76 -> SKNet MonsterTV Mobile [1131:4ee9] |
78 | 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] | 78 | 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] |
79 | 78 -> ASUSTeK P7131 Dual [1043:4862,1043:4876] | 79 | 78 -> ASUSTeK P7131 Dual [1043:4862,1043:4857] |
80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) | 80 | 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) |
81 | 80 -> ASUS Digimatrix TV [1043:0210] | 81 | 80 -> ASUS Digimatrix TV [1043:0210] |
82 | 81 -> Philips Tiger reference design [1131:2018] | 82 | 81 -> Philips Tiger reference design [1131:2018] |
@@ -107,3 +107,7 @@ | |||
107 | 106 -> Encore ENLTV [1131:2342,1131:2341,3016:2344] | 107 | 106 -> Encore ENLTV [1131:2342,1131:2341,3016:2344] |
108 | 107 -> Encore ENLTV-FM [1131:230f] | 108 | 107 -> Encore ENLTV-FM [1131:230f] |
109 | 108 -> Terratec Cinergy HT PCI [153b:1175] | 109 | 108 -> Terratec Cinergy HT PCI [153b:1175] |
110 | 109 -> Philips Tiger - S Reference design | ||
111 | 110 -> Avermedia M102 [1461:f31e] | ||
112 | 111 -> ASUS P7131 4871 [1043:4871] | ||
113 | 112 -> ASUSTeK P7131 Hybrid [1043:4876] | ||
diff --git a/Documentation/video4linux/CARDLIST.usbvision b/Documentation/video4linux/CARDLIST.usbvision new file mode 100644 index 000000000000..3d6850ef0245 --- /dev/null +++ b/Documentation/video4linux/CARDLIST.usbvision | |||
@@ -0,0 +1,64 @@ | |||
1 | 0 -> Xanboo [0a6f:0400] | ||
2 | 1 -> Belkin USB VideoBus II Adapter [050d:0106] | ||
3 | 2 -> Belkin Components USB VideoBus [050d:0207] | ||
4 | 3 -> Belkin USB VideoBus II [050d:0208] | ||
5 | 4 -> echoFX InterView Lite [0571:0002] | ||
6 | 5 -> USBGear USBG-V1 resp. HAMA USB [0573:0003] | ||
7 | 6 -> D-Link V100 [0573:0400] | ||
8 | 7 -> X10 USB Camera [0573:2000] | ||
9 | 8 -> Hauppauge WinTV USB Live (PAL B/G) [0573:2d00] | ||
10 | 9 -> Hauppauge WinTV USB Live Pro (NTSC M/N) [0573:2d01] | ||
11 | 10 -> Zoran Co. PMD (Nogatech) AV-grabber Manhattan [0573:2101] | ||
12 | 11 -> Nogatech USB-TV (NTSC) FM [0573:4100] | ||
13 | 12 -> PNY USB-TV (NTSC) FM [0573:4110] | ||
14 | 13 -> PixelView PlayTv-USB PRO (PAL) FM [0573:4450] | ||
15 | 14 -> ZTV ZT-721 2.4GHz USB A/V Receiver [0573:4550] | ||
16 | 15 -> Hauppauge WinTV USB (NTSC M/N) [0573:4d00] | ||
17 | 16 -> Hauppauge WinTV USB (PAL B/G) [0573:4d01] | ||
18 | 17 -> Hauppauge WinTV USB (PAL I) [0573:4d02] | ||
19 | 18 -> Hauppauge WinTV USB (PAL/SECAM L) [0573:4d03] | ||
20 | 19 -> Hauppauge WinTV USB (PAL D/K) [0573:4d04] | ||
21 | 20 -> Hauppauge WinTV USB (NTSC FM) [0573:4d10] | ||
22 | 21 -> Hauppauge WinTV USB (PAL B/G FM) [0573:4d11] | ||
23 | 22 -> Hauppauge WinTV USB (PAL I FM) [0573:4d12] | ||
24 | 23 -> Hauppauge WinTV USB (PAL D/K FM) [0573:4d14] | ||
25 | 24 -> Hauppauge WinTV USB Pro (NTSC M/N) [0573:4d2a] | ||
26 | 25 -> Hauppauge WinTV USB Pro (NTSC M/N) V2 [0573:4d2b] | ||
27 | 26 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L) [0573:4d2c] | ||
28 | 27 -> Hauppauge WinTV USB Pro (NTSC M/N) V3 [0573:4d20] | ||
29 | 28 -> Hauppauge WinTV USB Pro (PAL B/G) [0573:4d21] | ||
30 | 29 -> Hauppauge WinTV USB Pro (PAL I) [0573:4d22] | ||
31 | 30 -> Hauppauge WinTV USB Pro (PAL/SECAM L) [0573:4d23] | ||
32 | 31 -> Hauppauge WinTV USB Pro (PAL D/K) [0573:4d24] | ||
33 | 32 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) [0573:4d25] | ||
34 | 33 -> Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2 [0573:4d26] | ||
35 | 34 -> Hauppauge WinTV USB Pro (PAL B/G) V2 [0573:4d27] | ||
36 | 35 -> Hauppauge WinTV USB Pro (PAL B/G,D/K) [0573:4d28] | ||
37 | 36 -> Hauppauge WinTV USB Pro (PAL I,D/K) [0573:4d29] | ||
38 | 37 -> Hauppauge WinTV USB Pro (NTSC M/N FM) [0573:4d30] | ||
39 | 38 -> Hauppauge WinTV USB Pro (PAL B/G FM) [0573:4d31] | ||
40 | 39 -> Hauppauge WinTV USB Pro (PAL I FM) [0573:4d32] | ||
41 | 40 -> Hauppauge WinTV USB Pro (PAL D/K FM) [0573:4d34] | ||
42 | 41 -> Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM) [0573:4d35] | ||
43 | 42 -> Hauppauge WinTV USB Pro (Temic PAL B/G FM) [0573:4d36] | ||
44 | 43 -> Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM) [0573:4d37] | ||
45 | 44 -> Hauppauge WinTV USB Pro (NTSC M/N FM) V2 [0573:4d38] | ||
46 | 45 -> Camtel Technology USB TV Genie Pro FM Model TVB330 [0768:0006] | ||
47 | 46 -> Digital Video Creator I [07d0:0001] | ||
48 | 47 -> Global Village GV-007 (NTSC) [07d0:0002] | ||
49 | 48 -> Dazzle Fusion Model DVC-50 Rev 1 (NTSC) [07d0:0003] | ||
50 | 49 -> Dazzle Fusion Model DVC-80 Rev 1 (PAL) [07d0:0004] | ||
51 | 50 -> Dazzle Fusion Model DVC-90 Rev 1 (SECAM) [07d0:0005] | ||
52 | 51 -> Eskape Labs MyTV2Go [07f8:9104] | ||
53 | 52 -> Pinnacle Studio PCTV USB (PAL) [2304:010d] | ||
54 | 53 -> Pinnacle Studio PCTV USB (SECAM) [2304:0109] | ||
55 | 54 -> Pinnacle Studio PCTV USB (PAL) FM [2304:0110] | ||
56 | 55 -> Miro PCTV USB [2304:0111] | ||
57 | 56 -> Pinnacle Studio PCTV USB (NTSC) FM [2304:0112] | ||
58 | 57 -> Pinnacle Studio PCTV USB (PAL) FM V2 [2304:0210] | ||
59 | 58 -> Pinnacle Studio PCTV USB (NTSC) FM V2 [2304:0212] | ||
60 | 59 -> Pinnacle Studio PCTV USB (PAL) FM V3 [2304:0214] | ||
61 | 60 -> Pinnacle Studio Linx Video input cable (NTSC) [2304:0300] | ||
62 | 61 -> Pinnacle Studio Linx Video input cable (PAL) [2304:0301] | ||
63 | 62 -> Pinnacle PCTV Bungee USB (PAL) FM [2304:0419] | ||
64 | 63 -> Hauppauge WinTv-USB [2400:4200] | ||
diff --git a/Documentation/video4linux/README.ivtv b/Documentation/video4linux/README.ivtv new file mode 100644 index 000000000000..73df22c40bfe --- /dev/null +++ b/Documentation/video4linux/README.ivtv | |||
@@ -0,0 +1,187 @@ | |||
1 | |||
2 | ivtv release notes | ||
3 | ================== | ||
4 | |||
5 | This is a v4l2 device driver for the Conexant cx23415/6 MPEG encoder/decoder. | ||
6 | The cx23415 can do both encoding and decoding, the cx23416 can only do MPEG | ||
7 | encoding. Currently the only card featuring full decoding support is the | ||
8 | Hauppauge PVR-350. | ||
9 | |||
10 | NOTE: this driver requires the latest encoder firmware (version 2.06.039, size | ||
11 | 376836 bytes). Get the firmware from here: | ||
12 | |||
13 | http://dl.ivtvdriver.org/ivtv/firmware/firmware.tar.gz | ||
14 | |||
15 | NOTE: 'normal' TV applications do not work with this driver, you need | ||
16 | an application that can handle MPEG input such as mplayer, xine, MythTV, | ||
17 | etc. | ||
18 | |||
19 | The primary goal of the IVTV project is to provide a "clean room" Linux | ||
20 | Open Source driver implementation for video capture cards based on the | ||
21 | iCompression iTVC15 or Conexant CX23415/CX23416 MPEG Codec. | ||
22 | |||
23 | Features: | ||
24 | * Hardware mpeg2 capture of broadcast video (and sound) via the tuner or | ||
25 | S-Video/Composite and audio line-in. | ||
26 | * Hardware mpeg2 capture of FM radio where hardware support exists | ||
27 | * Supports NTSC, PAL, SECAM with stereo sound | ||
28 | * Supports SAP and bilingual transmissions. | ||
29 | * Supports raw VBI (closed captions and teletext). | ||
30 | * Supports sliced VBI (closed captions and teletext) and is able to insert | ||
31 | this into the captured MPEG stream. | ||
32 | * Supports raw YUV and PCM input. | ||
33 | |||
34 | Additional features for the PVR-350 (CX23415 based): | ||
35 | * Provides hardware mpeg2 playback | ||
36 | * Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the | ||
37 | video signal) | ||
38 | * Provides a framebuffer (allowing X applications to appear on the video | ||
39 | device) (this framebuffer is not yet part of the kernel. In the meantime it | ||
40 | is available from www.ivtvdriver.org). | ||
41 | * Supports raw YUV output. | ||
42 | |||
43 | IMPORTANT: In case of problems first read this page: | ||
44 | http://www.ivtvdriver.org/index.php/Troubleshooting | ||
45 | |||
46 | See also: | ||
47 | |||
48 | Homepage + Wiki | ||
49 | http://www.ivtvdriver.org | ||
50 | |||
51 | IRC | ||
52 | irc://irc.freenode.net/ivtv-dev | ||
53 | |||
54 | ---------------------------------------------------------- | ||
55 | |||
56 | Devices | ||
57 | ======= | ||
58 | |||
59 | A maximum of 12 ivtv boards are allowed at the moment. | ||
60 | |||
61 | Cards that don't have a video output capability (i.e. non PVR350 cards) | ||
62 | lack the vbi8, vbi16, video16 and video48 devices. They also do not | ||
63 | support the framebuffer device /dev/fbx for OSD. | ||
64 | |||
65 | The radio0 device may or may not be present, depending on whether the | ||
66 | card has a radio tuner or not. | ||
67 | |||
68 | Here is a list of the base v4l devices: | ||
69 | crw-rw---- 1 root video 81, 0 Jun 19 22:22 /dev/video0 | ||
70 | crw-rw---- 1 root video 81, 16 Jun 19 22:22 /dev/video16 | ||
71 | crw-rw---- 1 root video 81, 24 Jun 19 22:22 /dev/video24 | ||
72 | crw-rw---- 1 root video 81, 32 Jun 19 22:22 /dev/video32 | ||
73 | crw-rw---- 1 root video 81, 48 Jun 19 22:22 /dev/video48 | ||
74 | crw-rw---- 1 root video 81, 64 Jun 19 22:22 /dev/radio0 | ||
75 | crw-rw---- 1 root video 81, 224 Jun 19 22:22 /dev/vbi0 | ||
76 | crw-rw---- 1 root video 81, 228 Jun 19 22:22 /dev/vbi8 | ||
77 | crw-rw---- 1 root video 81, 232 Jun 19 22:22 /dev/vbi16 | ||
78 | |||
79 | Base devices | ||
80 | ============ | ||
81 | |||
82 | For every extra card you have the numbers increased by one. For example, | ||
83 | /dev/video0 is listed as the 'base' encoding capture device so we have: | ||
84 | |||
85 | /dev/video0 is the encoding capture device for the first card (card 0) | ||
86 | /dev/video1 is the encoding capture device for the second card (card 1) | ||
87 | /dev/video2 is the encoding capture device for the third card (card 2) | ||
88 | |||
89 | Note that if the first card doesn't have a feature (eg no decoder, so no | ||
90 | video16, the second card will still use video17. The simple rule is 'add | ||
91 | the card number to the base device number'. If you have other capture | ||
92 | cards (e.g. WinTV PCI) that are detected first, then you have to tell | ||
93 | the ivtv module about it so that it will start counting at 1 (or 2, or | ||
94 | whatever). Otherwise the device numbers can get confusing. The ivtv | ||
95 | 'ivtv_first_minor' module option can be used for that. | ||
96 | |||
97 | |||
98 | /dev/video0 | ||
99 | The encoding capture device(s). | ||
100 | Read-only. | ||
101 | |||
102 | Reading from this device gets you the MPEG1/2 program stream. | ||
103 | Example: | ||
104 | |||
105 | cat /dev/video0 > my.mpg (you need to hit ctrl-c to exit) | ||
106 | |||
107 | |||
108 | /dev/video16 | ||
109 | The decoder output device(s) | ||
110 | Write-only. Only present if the MPEG decoder (i.e. CX23415) exists. | ||
111 | |||
112 | An mpeg2 stream sent to this device will appear on the selected video | ||
113 | display, audio will appear on the line-out/audio out. It is only | ||
114 | available for cards that support video out. Example: | ||
115 | |||
116 | cat my.mpg >/dev/video16 | ||
117 | |||
118 | |||
119 | /dev/video24 | ||
120 | The raw audio capture device(s). | ||
121 | Read-only | ||
122 | |||
123 | The raw audio PCM stereo stream from the currently selected | ||
124 | tuner or audio line-in. Reading from this device results in a raw | ||
125 | (signed 16 bit Little Endian, 48000 Hz, stereo pcm) capture. | ||
126 | This device only captures audio. This should be replaced by an ALSA | ||
127 | device in the future. | ||
128 | Note that there is no corresponding raw audio output device, this is | ||
129 | not supported in the decoder firmware. | ||
130 | |||
131 | |||
132 | /dev/video32 | ||
133 | The raw video capture device(s) | ||
134 | Read-only | ||
135 | |||
136 | The raw YUV video output from the current video input. The YUV format | ||
137 | is non-standard (V4L2_PIX_FMT_HM12). | ||
138 | |||
139 | Note that the YUV and PCM streams are not synchronized, so they are of | ||
140 | limited use. | ||
141 | |||
142 | |||
143 | /dev/video48 | ||
144 | The raw video display device(s) | ||
145 | Write-only. Only present if the MPEG decoder (i.e. CX23415) exists. | ||
146 | |||
147 | Writes a YUV stream to the decoder of the card. | ||
148 | |||
149 | |||
150 | /dev/radio0 | ||
151 | The radio tuner device(s) | ||
152 | Cannot be read or written. | ||
153 | |||
154 | Used to enable the radio tuner and tune to a frequency. You cannot | ||
155 | read or write audio streams with this device. Once you use this | ||
156 | device to tune the radio, use /dev/video24 to read the raw pcm stream | ||
157 | or /dev/video0 to get an mpeg2 stream with black video. | ||
158 | |||
159 | |||
160 | /dev/vbi0 | ||
161 | The 'vertical blank interval' (Teletext, CC, WSS etc) capture device(s) | ||
162 | Read-only | ||
163 | |||
164 | Captures the raw (or sliced) video data sent during the Vertical Blank | ||
165 | Interval. This data is used to encode teletext, closed captions, VPS, | ||
166 | widescreen signalling, electronic program guide information, and other | ||
167 | services. | ||
168 | |||
169 | |||
170 | /dev/vbi8 | ||
171 | Processed vbi feedback device(s) | ||
172 | Read-only. Only present if the MPEG decoder (i.e. CX23415) exists. | ||
173 | |||
174 | The sliced VBI data embedded in an MPEG stream is reproduced on this | ||
175 | device. So while playing back a recording on /dev/video16, you can | ||
176 | read the embedded VBI data from /dev/vbi8. | ||
177 | |||
178 | |||
179 | /dev/vbi16 | ||
180 | The vbi 'display' device(s) | ||
181 | Write-only. Only present if the MPEG decoder (i.e. CX23415) exists. | ||
182 | |||
183 | Can be used to send sliced VBI data to the video-out connector. | ||
184 | |||
185 | --------------------------------- | ||
186 | |||
187 | Hans Verkuil <hverkuil@xs4all.nl> | ||
diff --git a/Documentation/video4linux/cx2341x/fw-decoder-regs.txt b/Documentation/video4linux/cx2341x/fw-decoder-regs.txt index db2366c634e8..cf52c8f20b9e 100644 --- a/Documentation/video4linux/cx2341x/fw-decoder-regs.txt +++ b/Documentation/video4linux/cx2341x/fw-decoder-regs.txt | |||
@@ -624,11 +624,11 @@ out what values are bad when it hangs. | |||
624 | 2A00 | 624 | 2A00 |
625 | bits 0:2 | 625 | bits 0:2 |
626 | osd colour mode | 626 | osd colour mode |
627 | 000 = 8 bit indexed | ||
627 | 001 = 16 bit (565) | 628 | 001 = 16 bit (565) |
628 | 010 = 15 bit (555) | 629 | 010 = 15 bit (555) |
629 | 011 = 12 bit (444) | 630 | 011 = 12 bit (444) |
630 | 100 = 32 bit (8888) | 631 | 100 = 32 bit (8888) |
631 | 101 = 8 bit indexed | ||
632 | 632 | ||
633 | bits 4:5 | 633 | bits 4:5 |
634 | osd display bpp | 634 | osd display bpp |
@@ -676,9 +676,11 @@ out what values are bad when it hangs. | |||
676 | completely transparent. When using 565, 555 or 444 colour modes, the | 676 | completely transparent. When using 565, 555 or 444 colour modes, the |
677 | colour key is always 16 bits wide. The colour to key on is set in Reg 2A18. | 677 | colour key is always 16 bits wide. The colour to key on is set in Reg 2A18. |
678 | 678 | ||
679 | Local alpha is a per-pixel 256 step transparency, with 0 being transparent | 679 | Local alpha works differently depending on the colour mode. For 32bpp & 8 |
680 | and 255 being solid. This is only available in 32 bit & 8 bit indexed | 680 | bit indexed, local alpha is a per-pixel 256 step transparency, with 0 being |
681 | colour modes. | 681 | transparent and 255 being solid. For the 16bpp modes 555 & 444, the unused |
682 | bit(s) act as a simple transparency switch, with 0 being solid & 1 being | ||
683 | fully transparent. There is no local alpha support for 16bit 565. | ||
682 | 684 | ||
683 | Global alpha is a 256 step transparency that applies to the entire osd, | 685 | Global alpha is a 256 step transparency that applies to the entire osd, |
684 | with 0 being transparent & 255 being solid. | 686 | with 0 being transparent & 255 being solid. |
@@ -811,5 +813,5 @@ out what values are bad when it hangs. | |||
811 | 813 | ||
812 | -------------------------------------------------------------------------------- | 814 | -------------------------------------------------------------------------------- |
813 | 815 | ||
814 | v0.3 - 2 February 2007 - Ian Armstrong (ian@iarmst.demon.co.uk) | 816 | v0.4 - 12 March 2007 - Ian Armstrong (ian@iarmst.demon.co.uk) |
815 | 817 | ||
diff --git a/Documentation/video4linux/cx2341x/fw-encoder-api.txt b/Documentation/video4linux/cx2341x/fw-encoder-api.txt index 242104ce5b61..5dd3109a8b3f 100644 --- a/Documentation/video4linux/cx2341x/fw-encoder-api.txt +++ b/Documentation/video4linux/cx2341x/fw-encoder-api.txt | |||
@@ -663,12 +663,13 @@ Param[0] | |||
663 | 663 | ||
664 | ------------------------------------------------------------------------------- | 664 | ------------------------------------------------------------------------------- |
665 | 665 | ||
666 | Name CX2341X_ENC_UNKNOWN | 666 | Name CX2341X_ENC_SET_VERT_CROP_LINE |
667 | Enum 219/0xDB | 667 | Enum 219/0xDB |
668 | Description | 668 | Description |
669 | Unknown API, it's used by Hauppauge though. | 669 | Something to do with 'Vertical Crop Line' |
670 | Param[0] | 670 | Param[0] |
671 | 0 This is the value Hauppauge uses, Unknown what it means. | 671 | If saa7114 and raw VBI capture and 60 Hz, then set to 10001. |
672 | Else 0. | ||
672 | 673 | ||
673 | ------------------------------------------------------------------------------- | 674 | ------------------------------------------------------------------------------- |
674 | 675 | ||
@@ -682,11 +683,9 @@ Param[0] | |||
682 | Command number: | 683 | Command number: |
683 | 1=set initial SCR value when starting encoding (works). | 684 | 1=set initial SCR value when starting encoding (works). |
684 | 2=set quality mode (apparently some test setting). | 685 | 2=set quality mode (apparently some test setting). |
685 | 3=setup advanced VIM protection handling (supposedly only for the cx23416 | 686 | 3=setup advanced VIM protection handling. |
686 | for raw YUV). | 687 | Always 1 for the cx23416 and 0 for cx23415. |
687 | Actually it looks like this should be 0 for saa7114/5 based card and 1 | 688 | 4=generate DVD compatible PTS timestamps |
688 | for cx25840 based cards. | ||
689 | 4=generate artificial PTS timestamps | ||
690 | 5=USB flush mode | 689 | 5=USB flush mode |
691 | 6=something to do with the quantization matrix | 690 | 6=something to do with the quantization matrix |
692 | 7=set navigation pack insertion for DVD: adds 0xbf (private stream 2) | 691 | 7=set navigation pack insertion for DVD: adds 0xbf (private stream 2) |
@@ -698,7 +697,9 @@ Param[0] | |||
698 | 9=set history parameters of the video input module | 697 | 9=set history parameters of the video input module |
699 | 10=set input field order of VIM | 698 | 10=set input field order of VIM |
700 | 11=set quantization matrix | 699 | 11=set quantization matrix |
701 | 12=reset audio interface | 700 | 12=reset audio interface after channel change or input switch (has no argument). |
701 | Needed for the cx2584x, not needed for the mspx4xx, but it doesn't seem to | ||
702 | do any harm calling it regardless. | ||
702 | 13=set audio volume delay | 703 | 13=set audio volume delay |
703 | 14=set audio delay | 704 | 14=set audio delay |
704 | 705 | ||
diff --git a/Documentation/video4linux/cx2341x/fw-osd-api.txt b/Documentation/video4linux/cx2341x/fw-osd-api.txt index 0a602f3e601b..89c4601042c1 100644 --- a/Documentation/video4linux/cx2341x/fw-osd-api.txt +++ b/Documentation/video4linux/cx2341x/fw-osd-api.txt | |||
@@ -21,7 +21,11 @@ Enum 66/0x42 | |||
21 | Description | 21 | Description |
22 | Query OSD format | 22 | Query OSD format |
23 | Result[0] | 23 | Result[0] |
24 | 0=8bit index, 4=AlphaRGB 8:8:8:8 | 24 | 0=8bit index |
25 | 1=16bit RGB 5:6:5 | ||
26 | 2=16bit ARGB 1:5:5:5 | ||
27 | 3=16bit ARGB 1:4:4:4 | ||
28 | 4=32bit ARGB 8:8:8:8 | ||
25 | 29 | ||
26 | ------------------------------------------------------------------------------- | 30 | ------------------------------------------------------------------------------- |
27 | 31 | ||
@@ -30,7 +34,11 @@ Enum 67/0x43 | |||
30 | Description | 34 | Description |
31 | Assign pixel format | 35 | Assign pixel format |
32 | Param[0] | 36 | Param[0] |
33 | 0=8bit index, 4=AlphaRGB 8:8:8:8 | 37 | 0=8bit index |
38 | 1=16bit RGB 5:6:5 | ||
39 | 2=16bit ARGB 1:5:5:5 | ||
40 | 3=16bit ARGB 1:4:4:4 | ||
41 | 4=32bit ARGB 8:8:8:8 | ||
34 | 42 | ||
35 | ------------------------------------------------------------------------------- | 43 | ------------------------------------------------------------------------------- |
36 | 44 | ||
diff --git a/Documentation/video4linux/meye.txt b/Documentation/video4linux/meye.txt index ecb34160e61d..5e51c59bf2b0 100644 --- a/Documentation/video4linux/meye.txt +++ b/Documentation/video4linux/meye.txt | |||
@@ -5,10 +5,9 @@ Vaio Picturebook Motion Eye Camera Driver Readme | |||
5 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> | 5 | Copyright (C) 2000 Andrew Tridgell <tridge@samba.org> |
6 | 6 | ||
7 | This driver enable the use of video4linux compatible applications with the | 7 | This driver enable the use of video4linux compatible applications with the |
8 | Motion Eye camera. This driver requires the "Sony Vaio Programmable I/O | 8 | Motion Eye camera. This driver requires the "Sony Laptop Extras" driver (which |
9 | Control Device" driver (which can be found in the "Character drivers" | 9 | can be found in the "Misc devices" section of the kernel configuration utility) |
10 | section of the kernel configuration utility) to be compiled and installed | 10 | to be compiled and installed (using its "camera=1" parameter). |
11 | (using its "camera=1" parameter). | ||
12 | 11 | ||
13 | It can do at maximum 30 fps @ 320x240 or 15 fps @ 640x480. | 12 | It can do at maximum 30 fps @ 320x240 or 15 fps @ 640x480. |
14 | 13 | ||
diff --git a/Documentation/video4linux/sn9c102.txt b/Documentation/video4linux/sn9c102.txt index 2913da3d0878..5fe0ad7dfc20 100644 --- a/Documentation/video4linux/sn9c102.txt +++ b/Documentation/video4linux/sn9c102.txt | |||
@@ -25,7 +25,7 @@ Index | |||
25 | 25 | ||
26 | 1. Copyright | 26 | 1. Copyright |
27 | ============ | 27 | ============ |
28 | Copyright (C) 2004-2006 by Luca Risolia <luca.risolia@studio.unibo.it> | 28 | Copyright (C) 2004-2007 by Luca Risolia <luca.risolia@studio.unibo.it> |
29 | 29 | ||
30 | 30 | ||
31 | 2. Disclaimer | 31 | 2. Disclaimer |
@@ -216,10 +216,10 @@ Description: Debugging information level, from 0 to 3: | |||
216 | 1 = critical errors | 216 | 1 = critical errors |
217 | 2 = significant informations | 217 | 2 = significant informations |
218 | 3 = more verbose messages | 218 | 3 = more verbose messages |
219 | Level 3 is useful for testing only, when only one device | 219 | Level 3 is useful for testing only. It also shows some more |
220 | is used. It also shows some more informations about the | 220 | informations about the hardware being detected. |
221 | hardware being detected. This parameter can be changed at | 221 | This parameter can be changed at runtime thanks to the /sys |
222 | runtime thanks to the /sys filesystem interface. | 222 | filesystem interface. |
223 | Default: 2 | 223 | Default: 2 |
224 | ------------------------------------------------------------------------------- | 224 | ------------------------------------------------------------------------------- |
225 | 225 | ||
@@ -235,7 +235,7 @@ created in the /sys/class/video4linux/videoX directory. You can set the green | |||
235 | channel's gain by writing the desired value to it. The value may range from 0 | 235 | channel's gain by writing the desired value to it. The value may range from 0 |
236 | to 15 for the SN9C101 or SN9C102 bridges, from 0 to 127 for the SN9C103, | 236 | to 15 for the SN9C101 or SN9C102 bridges, from 0 to 127 for the SN9C103, |
237 | SN9C105 and SN9C120 bridges. | 237 | SN9C105 and SN9C120 bridges. |
238 | Similarly, only for the SN9C103, SN9C105 and SN9120 controllers, blue and red | 238 | Similarly, only for the SN9C103, SN9C105 and SN9C120 controllers, blue and red |
239 | gain control files are available in the same directory, for which accepted | 239 | gain control files are available in the same directory, for which accepted |
240 | values may range from 0 to 127. | 240 | values may range from 0 to 127. |
241 | 241 | ||
@@ -402,38 +402,49 @@ Vendor ID Product ID | |||
402 | 0x0c45 0x60bc | 402 | 0x0c45 0x60bc |
403 | 0x0c45 0x60be | 403 | 0x0c45 0x60be |
404 | 0x0c45 0x60c0 | 404 | 0x0c45 0x60c0 |
405 | 0x0c45 0x60c2 | ||
405 | 0x0c45 0x60c8 | 406 | 0x0c45 0x60c8 |
406 | 0x0c45 0x60cc | 407 | 0x0c45 0x60cc |
407 | 0x0c45 0x60ea | 408 | 0x0c45 0x60ea |
408 | 0x0c45 0x60ec | 409 | 0x0c45 0x60ec |
410 | 0x0c45 0x60ef | ||
409 | 0x0c45 0x60fa | 411 | 0x0c45 0x60fa |
410 | 0x0c45 0x60fb | 412 | 0x0c45 0x60fb |
411 | 0x0c45 0x60fc | 413 | 0x0c45 0x60fc |
412 | 0x0c45 0x60fe | 414 | 0x0c45 0x60fe |
415 | 0x0c45 0x6102 | ||
416 | 0x0c45 0x6108 | ||
417 | 0x0c45 0x610f | ||
413 | 0x0c45 0x6130 | 418 | 0x0c45 0x6130 |
419 | 0x0c45 0x6138 | ||
414 | 0x0c45 0x613a | 420 | 0x0c45 0x613a |
415 | 0x0c45 0x613b | 421 | 0x0c45 0x613b |
416 | 0x0c45 0x613c | 422 | 0x0c45 0x613c |
417 | 0x0c45 0x613e | 423 | 0x0c45 0x613e |
418 | 424 | ||
419 | The list above does not imply that all those devices work with this driver: up | 425 | The list above does not imply that all those devices work with this driver: up |
420 | until now only the ones that assemble the following image sensors are | 426 | until now only the ones that assemble the following pairs of SN9C1xx bridges |
421 | supported; kernel messages will always tell you whether this is the case (see | 427 | and image sensors are supported; kernel messages will always tell you whether |
422 | "Module loading" paragraph): | 428 | this is the case (see "Module loading" paragraph): |
423 | 429 | ||
424 | Model Manufacturer | 430 | Image sensor / SN9C1xx bridge | SN9C10[12] SN9C103 SN9C105 SN9C120 |
425 | ----- ------------ | 431 | ------------------------------------------------------------------------------- |
426 | HV7131D Hynix Semiconductor, Inc. | 432 | HV7131D Hynix Semiconductor | Yes No No No |
427 | MI-0343 Micron Technology, Inc. | 433 | HV7131R Hynix Semiconductor | No Yes Yes Yes |
428 | OV7630 OmniVision Technologies, Inc. | 434 | MI-0343 Micron Technology | Yes No No No |
429 | OV7660 OmniVision Technologies, Inc. | 435 | MI-0360 Micron Technology | No Yes No No |
430 | PAS106B PixArt Imaging, Inc. | 436 | OV7630 OmniVision Technologies | Yes Yes No No |
431 | PAS202BCA PixArt Imaging, Inc. | 437 | OV7660 OmniVision Technologies | No No Yes Yes |
432 | PAS202BCB PixArt Imaging, Inc. | 438 | PAS106B PixArt Imaging | Yes No No No |
433 | TAS5110C1B Taiwan Advanced Sensor Corporation | 439 | PAS202B PixArt Imaging | Yes Yes No No |
434 | TAS5130D1B Taiwan Advanced Sensor Corporation | 440 | TAS5110C1B Taiwan Advanced Sensor | Yes No No No |
435 | 441 | TAS5110D Taiwan Advanced Sensor | Yes No No No | |
436 | Some of the available control settings of each image sensor are supported | 442 | TAS5130D1B Taiwan Advanced Sensor | Yes No No No |
443 | |||
444 | "Yes" means that the pair is supported by the driver, while "No" means that the | ||
445 | pair does not exist or is not supported by the driver. | ||
446 | |||
447 | Only some of the available control settings of each image sensor are supported | ||
437 | through the V4L2 interface. | 448 | through the V4L2 interface. |
438 | 449 | ||
439 | Donations of new models for further testing and support would be much | 450 | Donations of new models for further testing and support would be much |
@@ -482,8 +493,8 @@ The SN9C1xx PC Camera Controllers can send images in two possible video | |||
482 | formats over the USB: either native "Sequential RGB Bayer" or compressed. | 493 | formats over the USB: either native "Sequential RGB Bayer" or compressed. |
483 | The compression is used to achieve high frame rates. With regard to the | 494 | The compression is used to achieve high frame rates. With regard to the |
484 | SN9C101, SN9C102 and SN9C103, the compression is based on the Huffman encoding | 495 | SN9C101, SN9C102 and SN9C103, the compression is based on the Huffman encoding |
485 | algorithm described below, while the SN9C105 and SN9C120 the compression is | 496 | algorithm described below, while with regard to the SN9C105 and SN9C120 the |
486 | based on the JPEG standard. | 497 | compression is based on the JPEG standard. |
487 | The current video format may be selected or queried from the user application | 498 | The current video format may be selected or queried from the user application |
488 | by calling the VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 | 499 | by calling the VIDIOC_S_FMT or VIDIOC_G_FMT ioctl's, as described in the V4L2 |
489 | API specifications. | 500 | API specifications. |
@@ -573,4 +584,5 @@ order): | |||
573 | - Mizuno Takafumi for the donation of a webcam; | 584 | - Mizuno Takafumi for the donation of a webcam; |
574 | - an "anonymous" donator (who didn't want his name to be revealed) for the | 585 | - an "anonymous" donator (who didn't want his name to be revealed) for the |
575 | donation of a webcam. | 586 | donation of a webcam. |
576 | - an anonymous donator for the donation of four webcams. | 587 | - an anonymous donator for the donation of four webcams and two boards with ten |
588 | image sensors. | ||
diff --git a/Documentation/video4linux/zr364xx.txt b/Documentation/video4linux/zr364xx.txt new file mode 100644 index 000000000000..c76992d0ff4d --- /dev/null +++ b/Documentation/video4linux/zr364xx.txt | |||
@@ -0,0 +1,65 @@ | |||
1 | Zoran 364xx based USB webcam module version 0.72 | ||
2 | site: http://royale.zerezo.com/zr364xx/ | ||
3 | mail: royale@zerezo.com | ||
4 | |||
5 | introduction: | ||
6 | This brings support under Linux for the Aiptek PocketDV 3300 in webcam mode. | ||
7 | If you just want to get on your PC the pictures and movies on the camera, you should use the usb-storage module instead. | ||
8 | The driver works with several other cameras in webcam mode (see the list below). | ||
9 | Maybe this code can work for other JPEG/USB cams based on the Coach chips from Zoran? | ||
10 | Possible chipsets are : ZR36430 (ZR36430BGC) and maybe ZR36431, ZR36440, ZR36442... | ||
11 | You can try the experience changing the vendor/product ID values (look at the source code). | ||
12 | You can get these values by looking at /var/log/messages when you plug your camera, or by typing : cat /proc/bus/usb/devices. | ||
13 | If you manage to use your cam with this code, you can send me a mail (royale@zerezo.com) with the name of your cam and a patch if needed. | ||
14 | This is a beta release of the driver. | ||
15 | Since version 0.70, this driver is only compatible with V4L2 API and 2.6.x kernels. | ||
16 | If you need V4L1 or 2.4x kernels support, please use an older version, but the code is not maintained anymore. | ||
17 | Good luck! | ||
18 | |||
19 | install: | ||
20 | In order to use this driver, you must compile it with your kernel. | ||
21 | Location: Device Drivers -> Multimedia devices -> Video For Linux -> Video Capture Adapters -> V4L USB devices | ||
22 | |||
23 | usage: | ||
24 | modprobe zr364xx debug=X mode=Y | ||
25 | - debug : set to 1 to enable verbose debug messages | ||
26 | - mode : 0 = 320x240, 1 = 160x120, 2 = 640x480 | ||
27 | You can then use the camera with V4L2 compatible applications, for example Ekiga. | ||
28 | To capture a single image, try this: dd if=/dev/video0 of=test.jpg bs=1 count=1 | ||
29 | |||
30 | links : | ||
31 | http://mxhaard.free.fr/ (support for many others cams including some Aiptek PocketDV) | ||
32 | http://www.harmwal.nl/pccam880/ (this project also supports cameras based on this chipset) | ||
33 | |||
34 | supported devices: | ||
35 | ------ ------- ----------- ----- | ||
36 | Vendor Product Distributor Model | ||
37 | ------ ------- ----------- ----- | ||
38 | 0x08ca 0x0109 Aiptek PocketDV 3300 | ||
39 | 0x08ca 0x0109 Maxell Maxcam PRO DV3 | ||
40 | 0x041e 0x4024 Creative PC-CAM 880 | ||
41 | 0x0d64 0x0108 Aiptek Fidelity 3200 | ||
42 | 0x0d64 0x0108 Praktica DCZ 1.3 S | ||
43 | 0x0d64 0x0108 Genius Digital Camera (?) | ||
44 | 0x0d64 0x0108 DXG Technology Fashion Cam | ||
45 | 0x0546 0x3187 Polaroid iON 230 | ||
46 | 0x0d64 0x3108 Praktica Exakta DC 2200 | ||
47 | 0x0d64 0x3108 Genius G-Shot D211 | ||
48 | 0x0595 0x4343 Concord Eye-Q Duo 1300 | ||
49 | 0x0595 0x4343 Concord Eye-Q Duo 2000 | ||
50 | 0x0595 0x4343 Fujifilm EX-10 | ||
51 | 0x0595 0x4343 Ricoh RDC-6000 | ||
52 | 0x0595 0x4343 Digitrex DSC 1300 | ||
53 | 0x0595 0x4343 Firstline FDC 2000 | ||
54 | 0x0bb0 0x500d Concord EyeQ Go Wireless | ||
55 | 0x0feb 0x2004 CRS Electronic 3.3 Digital Camera | ||
56 | 0x0feb 0x2004 Packard Bell DSC-300 | ||
57 | 0x055f 0xb500 Mustek MDC 3000 | ||
58 | 0x08ca 0x2062 Aiptek PocketDV 5700 | ||
59 | 0x052b 0x1a18 Chiphead Megapix V12 | ||
60 | 0x04c8 0x0729 Konica Revio 2 | ||
61 | 0x04f2 0xa208 Creative PC-CAM 850 | ||
62 | 0x0784 0x0040 Traveler Slimline X5 | ||
63 | 0x06d6 0x0034 Trust Powerc@m 750 | ||
64 | 0x0a17 0x0062 Pentax Optio 50L | ||
65 | |||
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 625a21db0c2a..85f51e5a749f 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -293,7 +293,3 @@ Debugging | |||
293 | stuck (default) | 293 | stuck (default) |
294 | 294 | ||
295 | Miscellaneous | 295 | Miscellaneous |
296 | |||
297 | noreplacement Don't replace instructions with more appropriate ones | ||
298 | for the CPU. This may be useful on asymmetric MP systems | ||
299 | where some CPUs have less capabilities than others. | ||