diff options
Diffstat (limited to 'Documentation')
51 files changed, 2853 insertions, 1001 deletions
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/dontdiff b/Documentation/dontdiff index 63c2d0c55aa2..64e9f6c4826b 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -55,8 +55,8 @@ aic7*seq.h* | |||
55 | aicasm | 55 | aicasm |
56 | aicdb.h* | 56 | aicdb.h* |
57 | asm | 57 | asm |
58 | asm-offsets.* | 58 | asm-offsets.h |
59 | asm_offsets.* | 59 | asm_offsets.h |
60 | autoconf.h* | 60 | autoconf.h* |
61 | bbootsect | 61 | bbootsect |
62 | bin2c | 62 | bin2c |
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 5163b85308f5..6c8d8f27db34 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -182,7 +182,7 @@ For example, you can do something like the following. | |||
182 | 182 | ||
183 | ... | 183 | ... |
184 | 184 | ||
185 | devres_close_group(dev, my_midlayer_something); | 185 | devres_close_group(dev, my_midlayer_create_something); |
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 19b4c96b2a49..5f96cb33743e 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)() |
@@ -105,13 +117,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
105 | 117 | ||
106 | --------------------------- | 118 | --------------------------- |
107 | 119 | ||
108 | What: pci_module_init(driver) | ||
109 | When: January 2007 | ||
110 | Why: Is replaced by pci_register_driver(pci_driver). | ||
111 | Who: Richard Knutsson <ricknu-0@student.ltu.se> and Greg Kroah-Hartman <gregkh@suse.de> | ||
112 | |||
113 | --------------------------- | ||
114 | |||
115 | What: Usage of invalid timevals in setitimer | 120 | What: Usage of invalid timevals in setitimer |
116 | When: March 2007 | 121 | When: March 2007 |
117 | Why: POSIX requires to validate timevals in the setitimer call. This | 122 | Why: POSIX requires to validate timevals in the setitimer call. This |
@@ -134,15 +139,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com> | |||
134 | 139 | ||
135 | --------------------------- | 140 | --------------------------- |
136 | 141 | ||
137 | What: mount/umount uevents | ||
138 | When: February 2007 | ||
139 | Why: These events are not correct, and do not properly let userspace know | ||
140 | when a file system has been mounted or unmounted. Userspace should | ||
141 | poll the /proc/mounts file instead to detect this properly. | ||
142 | Who: Greg Kroah-Hartman <gregkh@suse.de> | ||
143 | |||
144 | --------------------------- | ||
145 | |||
146 | What: USB driver API moves to EXPORT_SYMBOL_GPL | 142 | What: USB driver API moves to EXPORT_SYMBOL_GPL |
147 | When: February 2008 | 143 | When: February 2008 |
148 | Files: include/linux/usb.h, drivers/usb/core/driver.c | 144 | Files: include/linux/usb.h, drivers/usb/core/driver.c |
@@ -187,18 +183,10 @@ Who: Jean Delvare <khali@linux-fr.org> | |||
187 | 183 | ||
188 | --------------------------- | 184 | --------------------------- |
189 | 185 | ||
190 | What: i2c_adapter.dev | 186 | What: i2c_adapter.list |
191 | i2c_adapter.list | ||
192 | When: July 2007 | 187 | When: July 2007 |
193 | Why: Superfluous, given i2c_adapter.class_dev: | 188 | Why: Superfluous, this list duplicates the one maintained by the driver |
194 | * The "dev" was a stand-in for the physical device node that legacy | 189 | core. |
195 | drivers would not have; but now it's almost always present. Any | ||
196 | remaining legacy drivers must upgrade (they now trigger warnings). | ||
197 | * The "list" duplicates class device children. | ||
198 | The delay in removing this is so upgraded lm_sensors and libsensors | ||
199 | can get deployed. (Removal causes minor changes in the sysfs layout, | ||
200 | notably the location of the adapter type name and parenting the i2c | ||
201 | client hardware directly from their controller.) | ||
202 | Who: Jean Delvare <khali@linux-fr.org>, | 190 | Who: Jean Delvare <khali@linux-fr.org>, |
203 | David Brownell <dbrownell@users.sourceforge.net> | 191 | David Brownell <dbrownell@users.sourceforge.net> |
204 | 192 | ||
@@ -211,15 +199,6 @@ Who: Adrian Bunk <bunk@stusta.de> | |||
211 | 199 | ||
212 | --------------------------- | 200 | --------------------------- |
213 | 201 | ||
214 | What: IPv4 only connection tracking/NAT/helpers | ||
215 | When: 2.6.22 | ||
216 | Why: The new layer 3 independant connection tracking replaces the old | ||
217 | IPv4 only version. After some stabilization of the new code the | ||
218 | old one will be removed. | ||
219 | Who: Patrick McHardy <kaber@trash.net> | ||
220 | |||
221 | --------------------------- | ||
222 | |||
223 | What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver | 202 | What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver |
224 | When: December 2006 | 203 | When: December 2006 |
225 | Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are | 204 | Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are |
@@ -294,18 +273,6 @@ Who: Richard Purdie <rpurdie@rpsys.net> | |||
294 | 273 | ||
295 | --------------------------- | 274 | --------------------------- |
296 | 275 | ||
297 | What: Wireless extensions over netlink (CONFIG_NET_WIRELESS_RTNETLINK) | ||
298 | When: with the merge of wireless-dev, 2.6.22 or later | ||
299 | Why: The option/code is | ||
300 | * not enabled on most kernels | ||
301 | * not required by any userspace tools (except an experimental one, | ||
302 | and even there only for some parts, others use ioctl) | ||
303 | * pointless since wext is no longer evolving and the ioctl | ||
304 | interface needs to be kept | ||
305 | Who: Johannes Berg <johannes@sipsolutions.net> | ||
306 | |||
307 | --------------------------- | ||
308 | |||
309 | What: i8xx_tco watchdog driver | 276 | What: i8xx_tco watchdog driver |
310 | When: in 2.6.22 | 277 | When: in 2.6.22 |
311 | Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt | 278 | Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt |
@@ -313,3 +280,46 @@ Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt | |||
313 | Who: Wim Van Sebroeck <wim@iguana.be> | 280 | Who: Wim Van Sebroeck <wim@iguana.be> |
314 | 281 | ||
315 | --------------------------- | 282 | --------------------------- |
283 | |||
284 | What: Multipath cached routing support in ipv4 | ||
285 | When: in 2.6.23 | ||
286 | Why: Code was merged, then submitter immediately disappeared leaving | ||
287 | us with no maintainer and lots of bugs. The code should not have | ||
288 | been merged in the first place, and many aspects of it's | ||
289 | implementation are blocking more critical core networking | ||
290 | development. It's marked EXPERIMENTAL and no distribution | ||
291 | enables it because it cause obscure crashes due to unfixable bugs | ||
292 | (interfaces don't return errors so memory allocation can't be | ||
293 | handled, calling contexts of these interfaces make handling | ||
294 | errors impossible too because they get called after we've | ||
295 | totally commited to creating a route object, for example). | ||
296 | This problem has existed for years and no forward progress | ||
297 | has ever been made, and nobody steps up to try and salvage | ||
298 | this code, so we're going to finally just get rid of it. | ||
299 | Who: David S. Miller <davem@davemloft.net> | ||
300 | |||
301 | --------------------------- | ||
302 | |||
303 | What: read_dev_chars(), read_conf_data{,_lpm}() (s390 common I/O layer) | ||
304 | When: December 2007 | ||
305 | Why: These functions are a leftover from 2.4 times. They have several | ||
306 | problems: | ||
307 | - Duplication of checks that are done in the device driver's | ||
308 | interrupt handler | ||
309 | - common I/O layer can't do device specific error recovery | ||
310 | - device driver can't be notified for conditions happening during | ||
311 | execution of the function | ||
312 | Device drivers should issue the read device characteristics and read | ||
313 | configuration data ccws and do the appropriate error handling | ||
314 | themselves. | ||
315 | Who: Cornelia Huck <cornelia.huck@de.ibm.com> | ||
316 | |||
317 | --------------------------- | ||
318 | |||
319 | What: i2c-ixp2000, i2c-ixp4xx and scx200_i2c drivers | ||
320 | When: September 2007 | ||
321 | Why: Obsolete. The new i2c-gpio driver replaces all hardware-specific | ||
322 | I2C-over-GPIO drivers. | ||
323 | Who: Jean Delvare <khali@linux-fr.org> | ||
324 | |||
325 | --------------------------- | ||
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/i2c/busses/i2c-nforce2 b/Documentation/i2c/busses/i2c-nforce2 index 7f61fbc03f7f..fae3495bcbaf 100644 --- a/Documentation/i2c/busses/i2c-nforce2 +++ b/Documentation/i2c/busses/i2c-nforce2 | |||
@@ -9,6 +9,8 @@ Supported adapters: | |||
9 | * nForce4 MCP-04 10de:0034 | 9 | * nForce4 MCP-04 10de:0034 |
10 | * nForce4 MCP51 10de:0264 | 10 | * nForce4 MCP51 10de:0264 |
11 | * nForce4 MCP55 10de:0368 | 11 | * nForce4 MCP55 10de:0368 |
12 | * nForce4 MCP61 10de:03EB | ||
13 | * nForce4 MCP65 10de:0446 | ||
12 | 14 | ||
13 | Datasheet: not publicly available, but seems to be similar to the | 15 | Datasheet: not publicly available, but seems to be similar to the |
14 | AMD-8111 SMBus 2.0 adapter. | 16 | AMD-8111 SMBus 2.0 adapter. |
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index ca272b263a92..7bf82c08f6ca 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -1,4 +1,4 @@ | |||
1 | Revision 6, 2005-11-20 | 1 | Revision 7, 2007-04-19 |
2 | Jean Delvare <khali@linux-fr.org> | 2 | Jean Delvare <khali@linux-fr.org> |
3 | Greg KH <greg@kroah.com> | 3 | Greg KH <greg@kroah.com> |
4 | 4 | ||
@@ -20,6 +20,10 @@ yours for best results. | |||
20 | 20 | ||
21 | Technical changes: | 21 | Technical changes: |
22 | 22 | ||
23 | * [Driver type] Any driver that was relying on i2c-isa has to be | ||
24 | converted to a proper isa, platform or pci driver. This is not | ||
25 | covered by this guide. | ||
26 | |||
23 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. | 27 | * [Includes] Get rid of "version.h" and <linux/i2c-proc.h>. |
24 | Includes typically look like that: | 28 | Includes typically look like that: |
25 | #include <linux/module.h> | 29 | #include <linux/module.h> |
@@ -27,12 +31,10 @@ Technical changes: | |||
27 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
28 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
29 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
30 | #include <linux/i2c-isa.h> /* for ISA drivers */ | ||
31 | #include <linux/hwmon.h> /* for hardware monitoring drivers */ | 34 | #include <linux/hwmon.h> /* for hardware monitoring drivers */ |
32 | #include <linux/hwmon-sysfs.h> | 35 | #include <linux/hwmon-sysfs.h> |
33 | #include <linux/hwmon-vid.h> /* if you need VRM support */ | 36 | #include <linux/hwmon-vid.h> /* if you need VRM support */ |
34 | #include <linux/err.h> /* for class registration */ | 37 | #include <linux/err.h> /* for class registration */ |
35 | #include <asm/io.h> /* if you have I/O operations */ | ||
36 | Please respect this inclusion order. Some extra headers may be | 38 | Please respect this inclusion order. Some extra headers may be |
37 | required for a given driver (e.g. "lm75.h"). | 39 | required for a given driver (e.g. "lm75.h"). |
38 | 40 | ||
@@ -69,20 +71,16 @@ Technical changes: | |||
69 | sensors mailing list <lm-sensors@lm-sensors.org> by providing a | 71 | sensors mailing list <lm-sensors@lm-sensors.org> by providing a |
70 | patch to the Documentation/hwmon/sysfs-interface file. | 72 | patch to the Documentation/hwmon/sysfs-interface file. |
71 | 73 | ||
72 | * [Attach] For I2C drivers, the attach function should make sure | 74 | * [Attach] The attach function should make sure that the adapter's |
73 | that the adapter's class has I2C_CLASS_HWMON (or whatever class is | 75 | class has I2C_CLASS_HWMON (or whatever class is suitable for your |
74 | suitable for your driver), using the following construct: | 76 | driver), using the following construct: |
75 | if (!(adapter->class & I2C_CLASS_HWMON)) | 77 | if (!(adapter->class & I2C_CLASS_HWMON)) |
76 | return 0; | 78 | return 0; |
77 | ISA-only drivers of course don't need this. | ||
78 | Call i2c_probe() instead of i2c_detect(). | 79 | Call i2c_probe() instead of i2c_detect(). |
79 | 80 | ||
80 | * [Detect] As mentioned earlier, the flags parameter is gone. | 81 | * [Detect] As mentioned earlier, the flags parameter is gone. |
81 | The type_name and client_name strings are replaced by a single | 82 | The type_name and client_name strings are replaced by a single |
82 | name string, which will be filled with a lowercase, short string. | 83 | name string, which will be filled with a lowercase, short string. |
83 | In i2c-only drivers, drop the i2c_is_isa_adapter check, it's | ||
84 | useless. Same for isa-only drivers, as the test would always be | ||
85 | true. Only hybrid drivers (which are quite rare) still need it. | ||
86 | The labels used for error paths are reduced to the number needed. | 84 | The labels used for error paths are reduced to the number needed. |
87 | It is advised that the labels are given descriptive names such as | 85 | It is advised that the labels are given descriptive names such as |
88 | exit and exit_free. Don't forget to properly set err before | 86 | exit and exit_free. Don't forget to properly set err before |
diff --git a/Documentation/i2c/summary b/Documentation/i2c/summary index 41dde8776791..aea60bf7e8f0 100644 --- a/Documentation/i2c/summary +++ b/Documentation/i2c/summary | |||
@@ -4,17 +4,23 @@ I2C and SMBus | |||
4 | ============= | 4 | ============= |
5 | 5 | ||
6 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a | 6 | I2C (pronounce: I squared C) is a protocol developed by Philips. It is a |
7 | slow two-wire protocol (10-400 kHz), but it suffices for many types of | 7 | slow two-wire protocol (variable speed, up to 400 kHz), with a high speed |
8 | devices. | 8 | extension (3.4 MHz). It provides an inexpensive bus for connecting many |
9 | types of devices with infrequent or low bandwidth communications needs. | ||
10 | I2C is widely used with embedded systems. Some systems use variants that | ||
11 | don't meet branding requirements, and so are not advertised as being I2C. | ||
9 | 12 | ||
10 | SMBus (System Management Bus) is a subset of the I2C protocol. Many | 13 | SMBus (System Management Bus) is based on the I2C protocol, and is mostly |
11 | modern mainboards have a System Management Bus. There are a lot of | 14 | a subset of I2C protocols and signaling. Many I2C devices will work on an |
12 | devices which can be connected to a SMBus; the most notable are modern | 15 | SMBus, but some SMBus protocols add semantics beyond what is required to |
13 | memory chips with EEPROM memories and chips for hardware monitoring. | 16 | achieve I2C branding. Modern PC mainboards rely on SMBus. The most common |
17 | devices connected through SMBus are RAM modules configured using I2C EEPROMs, | ||
18 | and hardware monitoring chips. | ||
14 | 19 | ||
15 | Because the SMBus is just a special case of the generalized I2C bus, we | 20 | Because the SMBus is mostly a subset of the generalized I2C bus, we can |
16 | can simulate the SMBus protocol on plain I2C busses. The reverse is | 21 | use its protocols on many I2C systems. However, there are systems that don't |
17 | regretfully impossible. | 22 | meet both SMBus and I2C electrical constraints; and others which can't |
23 | implement all the common SMBus protocol semantics or messages. | ||
18 | 24 | ||
19 | 25 | ||
20 | Terminology | 26 | Terminology |
@@ -29,6 +35,7 @@ When we talk about I2C, we use the following terms: | |||
29 | An Algorithm driver contains general code that can be used for a whole class | 35 | An Algorithm driver contains general code that can be used for a whole class |
30 | of I2C adapters. Each specific adapter driver depends on one algorithm | 36 | of I2C adapters. Each specific adapter driver depends on one algorithm |
31 | driver. | 37 | driver. |
38 | |||
32 | A Driver driver (yes, this sounds ridiculous, sorry) contains the general | 39 | A Driver driver (yes, this sounds ridiculous, sorry) contains the general |
33 | code to access some type of device. Each detected device gets its own | 40 | code to access some type of device. Each detected device gets its own |
34 | data in the Client structure. Usually, Driver and Client are more closely | 41 | data in the Client structure. Usually, Driver and Client are more closely |
@@ -40,6 +47,10 @@ a separate Adapter and Algorithm driver), and drivers for your I2C devices | |||
40 | in this package. See the lm_sensors project http://www.lm-sensors.nu | 47 | in this package. See the lm_sensors project http://www.lm-sensors.nu |
41 | for device drivers. | 48 | for device drivers. |
42 | 49 | ||
50 | At this time, Linux only operates I2C (or SMBus) in master mode; you can't | ||
51 | use these APIs to make a Linux system behave as a slave/device, either to | ||
52 | speak a custom protocol or to emulate some other device. | ||
53 | |||
43 | 54 | ||
44 | Included Bus Drivers | 55 | Included Bus Drivers |
45 | ==================== | 56 | ==================== |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index fbcff96f4ca1..3d8d36b0ad12 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -1,5 +1,5 @@ | |||
1 | This is a small guide for those who want to write kernel drivers for I2C | 1 | This is a small guide for those who want to write kernel drivers for I2C |
2 | or SMBus devices. | 2 | or SMBus devices, using Linux as the protocol host/master (not slave). |
3 | 3 | ||
4 | To set up a driver, you need to do several things. Some are optional, and | 4 | To set up a driver, you need to do several things. Some are optional, and |
5 | some things can be done slightly or completely different. Use this as a | 5 | some things can be done slightly or completely different. Use this as a |
@@ -29,8 +29,16 @@ static struct i2c_driver foo_driver = { | |||
29 | .driver = { | 29 | .driver = { |
30 | .name = "foo", | 30 | .name = "foo", |
31 | }, | 31 | }, |
32 | |||
33 | /* iff driver uses driver model ("new style") binding model: */ | ||
34 | .probe = foo_probe, | ||
35 | .remove = foo_remove, | ||
36 | |||
37 | /* else, driver uses "legacy" binding model: */ | ||
32 | .attach_adapter = foo_attach_adapter, | 38 | .attach_adapter = foo_attach_adapter, |
33 | .detach_client = foo_detach_client, | 39 | .detach_client = foo_detach_client, |
40 | |||
41 | /* these may be used regardless of the driver binding model */ | ||
34 | .shutdown = foo_shutdown, /* optional */ | 42 | .shutdown = foo_shutdown, /* optional */ |
35 | .suspend = foo_suspend, /* optional */ | 43 | .suspend = foo_suspend, /* optional */ |
36 | .resume = foo_resume, /* optional */ | 44 | .resume = foo_resume, /* optional */ |
@@ -40,7 +48,8 @@ static struct i2c_driver foo_driver = { | |||
40 | The name field is the driver name, and must not contain spaces. It | 48 | The name field is the driver name, and must not contain spaces. It |
41 | should match the module name (if the driver can be compiled as a module), | 49 | should match the module name (if the driver can be compiled as a module), |
42 | although you can use MODULE_ALIAS (passing "foo" in this example) to add | 50 | although you can use MODULE_ALIAS (passing "foo" in this example) to add |
43 | another name for the module. | 51 | another name for the module. If the driver name doesn't match the module |
52 | name, the module won't be automatically loaded (hotplug/coldplug). | ||
44 | 53 | ||
45 | All other fields are for call-back functions which will be explained | 54 | All other fields are for call-back functions which will be explained |
46 | below. | 55 | below. |
@@ -65,16 +74,13 @@ An example structure is below. | |||
65 | 74 | ||
66 | struct foo_data { | 75 | struct foo_data { |
67 | struct i2c_client client; | 76 | struct i2c_client client; |
68 | struct semaphore lock; /* For ISA access in `sensors' drivers. */ | ||
69 | int sysctl_id; /* To keep the /proc directory entry for | ||
70 | `sensors' drivers. */ | ||
71 | enum chips type; /* To keep the chips type for `sensors' drivers. */ | 77 | enum chips type; /* To keep the chips type for `sensors' drivers. */ |
72 | 78 | ||
73 | /* Because the i2c bus is slow, it is often useful to cache the read | 79 | /* Because the i2c bus is slow, it is often useful to cache the read |
74 | information of a chip for some time (for example, 1 or 2 seconds). | 80 | information of a chip for some time (for example, 1 or 2 seconds). |
75 | It depends of course on the device whether this is really worthwhile | 81 | It depends of course on the device whether this is really worthwhile |
76 | or even sensible. */ | 82 | or even sensible. */ |
77 | struct semaphore update_lock; /* When we are reading lots of information, | 83 | struct mutex update_lock; /* When we are reading lots of information, |
78 | another process should not update the | 84 | another process should not update the |
79 | below information */ | 85 | below information */ |
80 | char valid; /* != 0 if the following fields are valid. */ | 86 | char valid; /* != 0 if the following fields are valid. */ |
@@ -95,8 +101,7 @@ some obscure clients). But we need generic reading and writing routines. | |||
95 | I have found it useful to define foo_read and foo_write function for this. | 101 | I have found it useful to define foo_read and foo_write function for this. |
96 | For some cases, it will be easier to call the i2c functions directly, | 102 | For some cases, it will be easier to call the i2c functions directly, |
97 | but many chips have some kind of register-value idea that can easily | 103 | but many chips have some kind of register-value idea that can easily |
98 | be encapsulated. Also, some chips have both ISA and I2C interfaces, and | 104 | be encapsulated. |
99 | it useful to abstract from this (only for `sensors' drivers). | ||
100 | 105 | ||
101 | The below functions are simple examples, and should not be copied | 106 | The below functions are simple examples, and should not be copied |
102 | literally. | 107 | literally. |
@@ -119,28 +124,101 @@ literally. | |||
119 | return i2c_smbus_write_word_data(client,reg,value); | 124 | return i2c_smbus_write_word_data(client,reg,value); |
120 | } | 125 | } |
121 | 126 | ||
122 | For sensors code, you may have to cope with ISA registers too. Something | ||
123 | like the below often works. Note the locking! | ||
124 | |||
125 | int foo_read_value(struct i2c_client *client, u8 reg) | ||
126 | { | ||
127 | int res; | ||
128 | if (i2c_is_isa_client(client)) { | ||
129 | down(&(((struct foo_data *) (client->data)) -> lock)); | ||
130 | outb_p(reg,client->addr + FOO_ADDR_REG_OFFSET); | ||
131 | res = inb_p(client->addr + FOO_DATA_REG_OFFSET); | ||
132 | up(&(((struct foo_data *) (client->data)) -> lock)); | ||
133 | return res; | ||
134 | } else | ||
135 | return i2c_smbus_read_byte_data(client,reg); | ||
136 | } | ||
137 | |||
138 | Writing is done the same way. | ||
139 | |||
140 | 127 | ||
141 | Probing and attaching | 128 | Probing and attaching |
142 | ===================== | 129 | ===================== |
143 | 130 | ||
131 | The Linux I2C stack was originally written to support access to hardware | ||
132 | monitoring chips on PC motherboards, and thus it embeds some assumptions | ||
133 | that are more appropriate to SMBus (and PCs) than to I2C. One of these | ||
134 | assumptions is that most adapters and devices drivers support the SMBUS_QUICK | ||
135 | protocol to probe device presence. Another is that devices and their drivers | ||
136 | can be sufficiently configured using only such probe primitives. | ||
137 | |||
138 | As Linux and its I2C stack became more widely used in embedded systems | ||
139 | and complex components such as DVB adapters, those assumptions became more | ||
140 | problematic. Drivers for I2C devices that issue interrupts need more (and | ||
141 | different) configuration information, as do drivers handling chip variants | ||
142 | that can't be distinguished by protocol probing, or which need some board | ||
143 | specific information to operate correctly. | ||
144 | |||
145 | Accordingly, the I2C stack now has two models for associating I2C devices | ||
146 | with their drivers: the original "legacy" model, and a newer one that's | ||
147 | fully compatible with the Linux 2.6 driver model. These models do not mix, | ||
148 | since the "legacy" model requires drivers to create "i2c_client" device | ||
149 | objects after SMBus style probing, while the Linux driver model expects | ||
150 | drivers to be given such device objects in their probe() routines. | ||
151 | |||
152 | |||
153 | Standard Driver Model Binding ("New Style") | ||
154 | ------------------------------------------- | ||
155 | |||
156 | System infrastructure, typically board-specific initialization code or | ||
157 | boot firmware, reports what I2C devices exist. For example, there may be | ||
158 | a table, in the kernel or from the boot loader, identifying I2C devices | ||
159 | and linking them to board-specific configuration information about IRQs | ||
160 | and other wiring artifacts, chip type, and so on. That could be used to | ||
161 | create i2c_client objects for each I2C device. | ||
162 | |||
163 | I2C device drivers using this binding model work just like any other | ||
164 | kind of driver in Linux: they provide a probe() method to bind to | ||
165 | those devices, and a remove() method to unbind. | ||
166 | |||
167 | static int foo_probe(struct i2c_client *client); | ||
168 | static int foo_remove(struct i2c_client *client); | ||
169 | |||
170 | Remember that the i2c_driver does not create those client handles. The | ||
171 | handle may be used during foo_probe(). If foo_probe() reports success | ||
172 | (zero not a negative status code) it may save the handle and use it until | ||
173 | foo_remove() returns. That binding model is used by most Linux drivers. | ||
174 | |||
175 | Drivers match devices when i2c_client.driver_name and the driver name are | ||
176 | the same; this approach is used in several other busses that don't have | ||
177 | device typing support in the hardware. The driver and module name should | ||
178 | match, so hotplug/coldplug mechanisms will modprobe the driver. | ||
179 | |||
180 | |||
181 | Device Creation (Standard driver model) | ||
182 | --------------------------------------- | ||
183 | |||
184 | If you know for a fact that an I2C device is connected to a given I2C bus, | ||
185 | you can instantiate that device by simply filling an i2c_board_info | ||
186 | structure with the device address and driver name, and calling | ||
187 | i2c_new_device(). This will create the device, then the driver core will | ||
188 | take care of finding the right driver and will call its probe() method. | ||
189 | If a driver supports different device types, you can specify the type you | ||
190 | want using the type field. You can also specify an IRQ and platform data | ||
191 | if needed. | ||
192 | |||
193 | Sometimes you know that a device is connected to a given I2C bus, but you | ||
194 | don't know the exact address it uses. This happens on TV adapters for | ||
195 | example, where the same driver supports dozens of slightly different | ||
196 | models, and I2C device addresses change from one model to the next. In | ||
197 | that case, you can use the i2c_new_probed_device() variant, which is | ||
198 | similar to i2c_new_device(), except that it takes an additional list of | ||
199 | possible I2C addresses to probe. A device is created for the first | ||
200 | responsive address in the list. If you expect more than one device to be | ||
201 | present in the address range, simply call i2c_new_probed_device() that | ||
202 | many times. | ||
203 | |||
204 | The call to i2c_new_device() or i2c_new_probed_device() typically happens | ||
205 | in the I2C bus driver. You may want to save the returned i2c_client | ||
206 | reference for later use. | ||
207 | |||
208 | |||
209 | Device Deletion (Standard driver model) | ||
210 | --------------------------------------- | ||
211 | |||
212 | Each I2C device which has been created using i2c_new_device() or | ||
213 | i2c_new_probed_device() can be unregistered by calling | ||
214 | i2c_unregister_device(). If you don't call it explicitly, it will be | ||
215 | called automatically before the underlying I2C bus itself is removed, as a | ||
216 | device can't survive its parent in the device driver model. | ||
217 | |||
218 | |||
219 | Legacy Driver Binding Model | ||
220 | --------------------------- | ||
221 | |||
144 | Most i2c devices can be present on several i2c addresses; for some this | 222 | Most i2c devices can be present on several i2c addresses; for some this |
145 | is determined in hardware (by soldering some chip pins to Vcc or Ground), | 223 | is determined in hardware (by soldering some chip pins to Vcc or Ground), |
146 | for others this can be changed in software (by writing to specific client | 224 | for others this can be changed in software (by writing to specific client |
@@ -157,13 +235,9 @@ detection algorithm. | |||
157 | You do not have to use this parameter interface; but don't try to use | 235 | You do not have to use this parameter interface; but don't try to use |
158 | function i2c_probe() if you don't. | 236 | function i2c_probe() if you don't. |
159 | 237 | ||
160 | NOTE: If you want to write a `sensors' driver, the interface is slightly | ||
161 | different! See below. | ||
162 | |||
163 | 238 | ||
164 | 239 | Probing classes (Legacy model) | |
165 | Probing classes | 240 | ------------------------------ |
166 | --------------- | ||
167 | 241 | ||
168 | All parameters are given as lists of unsigned 16-bit integers. Lists are | 242 | All parameters are given as lists of unsigned 16-bit integers. Lists are |
169 | terminated by I2C_CLIENT_END. | 243 | terminated by I2C_CLIENT_END. |
@@ -210,8 +284,8 @@ Note that you *have* to call the defined variable `normal_i2c', | |||
210 | without any prefix! | 284 | without any prefix! |
211 | 285 | ||
212 | 286 | ||
213 | Attaching to an adapter | 287 | Attaching to an adapter (Legacy model) |
214 | ----------------------- | 288 | -------------------------------------- |
215 | 289 | ||
216 | Whenever a new adapter is inserted, or for all adapters if the driver is | 290 | Whenever a new adapter is inserted, or for all adapters if the driver is |
217 | being registered, the callback attach_adapter() is called. Now is the | 291 | being registered, the callback attach_adapter() is called. Now is the |
@@ -237,17 +311,13 @@ them (unless a `force' parameter was used). In addition, addresses that | |||
237 | are already in use (by some other registered client) are skipped. | 311 | are already in use (by some other registered client) are skipped. |
238 | 312 | ||
239 | 313 | ||
240 | The detect client function | 314 | The detect client function (Legacy model) |
241 | -------------------------- | 315 | ----------------------------------------- |
242 | 316 | ||
243 | The detect client function is called by i2c_probe. The `kind' parameter | 317 | The detect client function is called by i2c_probe. The `kind' parameter |
244 | contains -1 for a probed detection, 0 for a forced detection, or a positive | 318 | contains -1 for a probed detection, 0 for a forced detection, or a positive |
245 | number for a forced detection with a chip type forced. | 319 | number for a forced detection with a chip type forced. |
246 | 320 | ||
247 | Below, some things are only needed if this is a `sensors' driver. Those | ||
248 | parts are between /* SENSORS ONLY START */ and /* SENSORS ONLY END */ | ||
249 | markers. | ||
250 | |||
251 | Returning an error different from -ENODEV in a detect function will cause | 321 | Returning an error different from -ENODEV in a detect function will cause |
252 | the detection to stop: other addresses and adapters won't be scanned. | 322 | the detection to stop: other addresses and adapters won't be scanned. |
253 | This should only be done on fatal or internal errors, such as a memory | 323 | This should only be done on fatal or internal errors, such as a memory |
@@ -256,64 +326,20 @@ shortage or i2c_attach_client failing. | |||
256 | For now, you can ignore the `flags' parameter. It is there for future use. | 326 | For now, you can ignore the `flags' parameter. It is there for future use. |
257 | 327 | ||
258 | int foo_detect_client(struct i2c_adapter *adapter, int address, | 328 | int foo_detect_client(struct i2c_adapter *adapter, int address, |
259 | unsigned short flags, int kind) | 329 | int kind) |
260 | { | 330 | { |
261 | int err = 0; | 331 | int err = 0; |
262 | int i; | 332 | int i; |
263 | struct i2c_client *new_client; | 333 | struct i2c_client *client; |
264 | struct foo_data *data; | 334 | struct foo_data *data; |
265 | const char *client_name = ""; /* For non-`sensors' drivers, put the real | 335 | const char *name = ""; |
266 | name here! */ | ||
267 | 336 | ||
268 | /* Let's see whether this adapter can support what we need. | 337 | /* Let's see whether this adapter can support what we need. |
269 | Please substitute the things you need here! | 338 | Please substitute the things you need here! */ |
270 | For `sensors' drivers, add `! is_isa &&' to the if statement */ | ||
271 | if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA | | 339 | if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA | |
272 | I2C_FUNC_SMBUS_WRITE_BYTE)) | 340 | I2C_FUNC_SMBUS_WRITE_BYTE)) |
273 | goto ERROR0; | 341 | goto ERROR0; |
274 | 342 | ||
275 | /* SENSORS ONLY START */ | ||
276 | const char *type_name = ""; | ||
277 | int is_isa = i2c_is_isa_adapter(adapter); | ||
278 | |||
279 | /* Do this only if the chip can additionally be found on the ISA bus | ||
280 | (hybrid chip). */ | ||
281 | |||
282 | if (is_isa) { | ||
283 | |||
284 | /* Discard immediately if this ISA range is already used */ | ||
285 | /* FIXME: never use check_region(), only request_region() */ | ||
286 | if (check_region(address,FOO_EXTENT)) | ||
287 | goto ERROR0; | ||
288 | |||
289 | /* Probe whether there is anything on this address. | ||
290 | Some example code is below, but you will have to adapt this | ||
291 | for your own driver */ | ||
292 | |||
293 | if (kind < 0) /* Only if no force parameter was used */ { | ||
294 | /* We may need long timeouts at least for some chips. */ | ||
295 | #define REALLY_SLOW_IO | ||
296 | i = inb_p(address + 1); | ||
297 | if (inb_p(address + 2) != i) | ||
298 | goto ERROR0; | ||
299 | if (inb_p(address + 3) != i) | ||
300 | goto ERROR0; | ||
301 | if (inb_p(address + 7) != i) | ||
302 | goto ERROR0; | ||
303 | #undef REALLY_SLOW_IO | ||
304 | |||
305 | /* Let's just hope nothing breaks here */ | ||
306 | i = inb_p(address + 5) & 0x7f; | ||
307 | outb_p(~i & 0x7f,address+5); | ||
308 | if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) { | ||
309 | outb_p(i,address+5); | ||
310 | return 0; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | |||
315 | /* SENSORS ONLY END */ | ||
316 | |||
317 | /* OK. For now, we presume we have a valid client. We now create the | 343 | /* OK. For now, we presume we have a valid client. We now create the |
318 | client structure, even though we cannot fill it completely yet. | 344 | client structure, even though we cannot fill it completely yet. |
319 | But it allows us to access several i2c functions safely */ | 345 | But it allows us to access several i2c functions safely */ |
@@ -323,13 +349,12 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
323 | goto ERROR0; | 349 | goto ERROR0; |
324 | } | 350 | } |
325 | 351 | ||
326 | new_client = &data->client; | 352 | client = &data->client; |
327 | i2c_set_clientdata(new_client, data); | 353 | i2c_set_clientdata(client, data); |
328 | 354 | ||
329 | new_client->addr = address; | 355 | client->addr = address; |
330 | new_client->adapter = adapter; | 356 | client->adapter = adapter; |
331 | new_client->driver = &foo_driver; | 357 | client->driver = &foo_driver; |
332 | new_client->flags = 0; | ||
333 | 358 | ||
334 | /* Now, we do the remaining detection. If no `force' parameter is used. */ | 359 | /* Now, we do the remaining detection. If no `force' parameter is used. */ |
335 | 360 | ||
@@ -337,19 +362,17 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
337 | parameter was used. */ | 362 | parameter was used. */ |
338 | if (kind < 0) { | 363 | if (kind < 0) { |
339 | /* The below is of course bogus */ | 364 | /* The below is of course bogus */ |
340 | if (foo_read(new_client,FOO_REG_GENERIC) != FOO_GENERIC_VALUE) | 365 | if (foo_read(client, FOO_REG_GENERIC) != FOO_GENERIC_VALUE) |
341 | goto ERROR1; | 366 | goto ERROR1; |
342 | } | 367 | } |
343 | 368 | ||
344 | /* SENSORS ONLY START */ | ||
345 | |||
346 | /* Next, specific detection. This is especially important for `sensors' | 369 | /* Next, specific detection. This is especially important for `sensors' |
347 | devices. */ | 370 | devices. */ |
348 | 371 | ||
349 | /* Determine the chip type. Not needed if a `force_CHIPTYPE' parameter | 372 | /* Determine the chip type. Not needed if a `force_CHIPTYPE' parameter |
350 | was used. */ | 373 | was used. */ |
351 | if (kind <= 0) { | 374 | if (kind <= 0) { |
352 | i = foo_read(new_client,FOO_REG_CHIPTYPE); | 375 | i = foo_read(client, FOO_REG_CHIPTYPE); |
353 | if (i == FOO_TYPE_1) | 376 | if (i == FOO_TYPE_1) |
354 | kind = chip1; /* As defined in the enum */ | 377 | kind = chip1; /* As defined in the enum */ |
355 | else if (i == FOO_TYPE_2) | 378 | else if (i == FOO_TYPE_2) |
@@ -363,63 +386,31 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
363 | 386 | ||
364 | /* Now set the type and chip names */ | 387 | /* Now set the type and chip names */ |
365 | if (kind == chip1) { | 388 | if (kind == chip1) { |
366 | type_name = "chip1"; /* For /proc entry */ | 389 | name = "chip1"; |
367 | client_name = "CHIP 1"; | ||
368 | } else if (kind == chip2) { | 390 | } else if (kind == chip2) { |
369 | type_name = "chip2"; /* For /proc entry */ | 391 | name = "chip2"; |
370 | client_name = "CHIP 2"; | ||
371 | } | 392 | } |
372 | 393 | ||
373 | /* Reserve the ISA region */ | ||
374 | if (is_isa) | ||
375 | request_region(address,FOO_EXTENT,type_name); | ||
376 | |||
377 | /* SENSORS ONLY END */ | ||
378 | |||
379 | /* Fill in the remaining client fields. */ | 394 | /* Fill in the remaining client fields. */ |
380 | strcpy(new_client->name,client_name); | 395 | strlcpy(client->name, name, I2C_NAME_SIZE); |
381 | |||
382 | /* SENSORS ONLY BEGIN */ | ||
383 | data->type = kind; | 396 | data->type = kind; |
384 | /* SENSORS ONLY END */ | 397 | mutex_init(&data->update_lock); /* Only if you use this field */ |
385 | |||
386 | data->valid = 0; /* Only if you use this field */ | ||
387 | init_MUTEX(&data->update_lock); /* Only if you use this field */ | ||
388 | 398 | ||
389 | /* Any other initializations in data must be done here too. */ | 399 | /* Any other initializations in data must be done here too. */ |
390 | 400 | ||
391 | /* Tell the i2c layer a new client has arrived */ | ||
392 | if ((err = i2c_attach_client(new_client))) | ||
393 | goto ERROR3; | ||
394 | |||
395 | /* SENSORS ONLY BEGIN */ | ||
396 | /* Register a new directory entry with module sensors. See below for | ||
397 | the `template' structure. */ | ||
398 | if ((i = i2c_register_entry(new_client, type_name, | ||
399 | foo_dir_table_template,THIS_MODULE)) < 0) { | ||
400 | err = i; | ||
401 | goto ERROR4; | ||
402 | } | ||
403 | data->sysctl_id = i; | ||
404 | |||
405 | /* SENSORS ONLY END */ | ||
406 | |||
407 | /* This function can write default values to the client registers, if | 401 | /* This function can write default values to the client registers, if |
408 | needed. */ | 402 | needed. */ |
409 | foo_init_client(new_client); | 403 | foo_init_client(client); |
404 | |||
405 | /* Tell the i2c layer a new client has arrived */ | ||
406 | if ((err = i2c_attach_client(client))) | ||
407 | goto ERROR1; | ||
408 | |||
410 | return 0; | 409 | return 0; |
411 | 410 | ||
412 | /* OK, this is not exactly good programming practice, usually. But it is | 411 | /* OK, this is not exactly good programming practice, usually. But it is |
413 | very code-efficient in this case. */ | 412 | very code-efficient in this case. */ |
414 | 413 | ||
415 | ERROR4: | ||
416 | i2c_detach_client(new_client); | ||
417 | ERROR3: | ||
418 | ERROR2: | ||
419 | /* SENSORS ONLY START */ | ||
420 | if (is_isa) | ||
421 | release_region(address,FOO_EXTENT); | ||
422 | /* SENSORS ONLY END */ | ||
423 | ERROR1: | 414 | ERROR1: |
424 | kfree(data); | 415 | kfree(data); |
425 | ERROR0: | 416 | ERROR0: |
@@ -427,8 +418,8 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
427 | } | 418 | } |
428 | 419 | ||
429 | 420 | ||
430 | Removing the client | 421 | Removing the client (Legacy model) |
431 | =================== | 422 | ================================== |
432 | 423 | ||
433 | The detach_client call back function is called when a client should be | 424 | The detach_client call back function is called when a client should be |
434 | removed. It may actually fail, but only when panicking. This code is | 425 | removed. It may actually fail, but only when panicking. This code is |
@@ -436,22 +427,12 @@ much simpler than the attachment code, fortunately! | |||
436 | 427 | ||
437 | int foo_detach_client(struct i2c_client *client) | 428 | int foo_detach_client(struct i2c_client *client) |
438 | { | 429 | { |
439 | int err,i; | 430 | int err; |
440 | |||
441 | /* SENSORS ONLY START */ | ||
442 | /* Deregister with the `i2c-proc' module. */ | ||
443 | i2c_deregister_entry(((struct lm78_data *)(client->data))->sysctl_id); | ||
444 | /* SENSORS ONLY END */ | ||
445 | 431 | ||
446 | /* Try to detach the client from i2c space */ | 432 | /* Try to detach the client from i2c space */ |
447 | if ((err = i2c_detach_client(client))) | 433 | if ((err = i2c_detach_client(client))) |
448 | return err; | 434 | return err; |
449 | 435 | ||
450 | /* HYBRID SENSORS CHIP ONLY START */ | ||
451 | if i2c_is_isa_client(client) | ||
452 | release_region(client->addr,LM78_EXTENT); | ||
453 | /* HYBRID SENSORS CHIP ONLY END */ | ||
454 | |||
455 | kfree(i2c_get_clientdata(client)); | 436 | kfree(i2c_get_clientdata(client)); |
456 | return 0; | 437 | return 0; |
457 | } | 438 | } |
@@ -464,45 +445,34 @@ When the kernel is booted, or when your foo driver module is inserted, | |||
464 | you have to do some initializing. Fortunately, just attaching (registering) | 445 | you have to do some initializing. Fortunately, just attaching (registering) |
465 | the driver module is usually enough. | 446 | the driver module is usually enough. |
466 | 447 | ||
467 | /* Keep track of how far we got in the initialization process. If several | ||
468 | things have to initialized, and we fail halfway, only those things | ||
469 | have to be cleaned up! */ | ||
470 | static int __initdata foo_initialized = 0; | ||
471 | |||
472 | static int __init foo_init(void) | 448 | static int __init foo_init(void) |
473 | { | 449 | { |
474 | int res; | 450 | int res; |
475 | printk("foo version %s (%s)\n",FOO_VERSION,FOO_DATE); | ||
476 | 451 | ||
477 | if ((res = i2c_add_driver(&foo_driver))) { | 452 | if ((res = i2c_add_driver(&foo_driver))) { |
478 | printk("foo: Driver registration failed, module not inserted.\n"); | 453 | printk("foo: Driver registration failed, module not inserted.\n"); |
479 | foo_cleanup(); | ||
480 | return res; | 454 | return res; |
481 | } | 455 | } |
482 | foo_initialized ++; | ||
483 | return 0; | 456 | return 0; |
484 | } | 457 | } |
485 | 458 | ||
486 | void foo_cleanup(void) | 459 | static void __exit foo_cleanup(void) |
487 | { | 460 | { |
488 | if (foo_initialized == 1) { | 461 | i2c_del_driver(&foo_driver); |
489 | if ((res = i2c_del_driver(&foo_driver))) { | ||
490 | printk("foo: Driver registration failed, module not removed.\n"); | ||
491 | return; | ||
492 | } | ||
493 | foo_initialized --; | ||
494 | } | ||
495 | } | 462 | } |
496 | 463 | ||
497 | /* Substitute your own name and email address */ | 464 | /* Substitute your own name and email address */ |
498 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | 465 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" |
499 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | 466 | MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); |
500 | 467 | ||
468 | /* a few non-GPL license types are also allowed */ | ||
469 | MODULE_LICENSE("GPL"); | ||
470 | |||
501 | module_init(foo_init); | 471 | module_init(foo_init); |
502 | module_exit(foo_cleanup); | 472 | module_exit(foo_cleanup); |
503 | 473 | ||
504 | Note that some functions are marked by `__init', and some data structures | 474 | Note that some functions are marked by `__init', and some data structures |
505 | by `__init_data'. Hose functions and structures can be removed after | 475 | by `__initdata'. These functions and structures can be removed after |
506 | kernel booting (or module loading) is completed. | 476 | kernel booting (or module loading) is completed. |
507 | 477 | ||
508 | 478 | ||
@@ -632,110 +602,7 @@ General purpose routines | |||
632 | Below all general purpose routines are listed, that were not mentioned | 602 | Below all general purpose routines are listed, that were not mentioned |
633 | before. | 603 | before. |
634 | 604 | ||
635 | /* This call returns a unique low identifier for each registered adapter, | 605 | /* This call returns a unique low identifier for each registered adapter. |
636 | * or -1 if the adapter was not registered. | ||
637 | */ | 606 | */ |
638 | extern int i2c_adapter_id(struct i2c_adapter *adap); | 607 | extern int i2c_adapter_id(struct i2c_adapter *adap); |
639 | 608 | ||
640 | |||
641 | The sensors sysctl/proc interface | ||
642 | ================================= | ||
643 | |||
644 | This section only applies if you write `sensors' drivers. | ||
645 | |||
646 | Each sensors driver creates a directory in /proc/sys/dev/sensors for each | ||
647 | registered client. The directory is called something like foo-i2c-4-65. | ||
648 | The sensors module helps you to do this as easily as possible. | ||
649 | |||
650 | The template | ||
651 | ------------ | ||
652 | |||
653 | You will need to define a ctl_table template. This template will automatically | ||
654 | be copied to a newly allocated structure and filled in where necessary when | ||
655 | you call sensors_register_entry. | ||
656 | |||
657 | First, I will give an example definition. | ||
658 | static ctl_table foo_dir_table_template[] = { | ||
659 | { FOO_SYSCTL_FUNC1, "func1", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
660 | &i2c_sysctl_real,NULL,&foo_func }, | ||
661 | { FOO_SYSCTL_FUNC2, "func2", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
662 | &i2c_sysctl_real,NULL,&foo_func }, | ||
663 | { FOO_SYSCTL_DATA, "data", NULL, 0, 0644, NULL, &i2c_proc_real, | ||
664 | &i2c_sysctl_real,NULL,&foo_data }, | ||
665 | { 0 } | ||
666 | }; | ||
667 | |||
668 | In the above example, three entries are defined. They can either be | ||
669 | accessed through the /proc interface, in the /proc/sys/dev/sensors/* | ||
670 | directories, as files named func1, func2 and data, or alternatively | ||
671 | through the sysctl interface, in the appropriate table, with identifiers | ||
672 | FOO_SYSCTL_FUNC1, FOO_SYSCTL_FUNC2 and FOO_SYSCTL_DATA. | ||
673 | |||
674 | The third, sixth and ninth parameters should always be NULL, and the | ||
675 | fourth should always be 0. The fifth is the mode of the /proc file; | ||
676 | 0644 is safe, as the file will be owned by root:root. | ||
677 | |||
678 | The seventh and eighth parameters should be &i2c_proc_real and | ||
679 | &i2c_sysctl_real if you want to export lists of reals (scaled | ||
680 | integers). You can also use your own function for them, as usual. | ||
681 | Finally, the last parameter is the call-back to gather the data | ||
682 | (see below) if you use the *_proc_real functions. | ||
683 | |||
684 | |||
685 | Gathering the data | ||
686 | ------------------ | ||
687 | |||
688 | The call back functions (foo_func and foo_data in the above example) | ||
689 | can be called in several ways; the operation parameter determines | ||
690 | what should be done: | ||
691 | |||
692 | * If operation == SENSORS_PROC_REAL_INFO, you must return the | ||
693 | magnitude (scaling) in nrels_mag; | ||
694 | * If operation == SENSORS_PROC_REAL_READ, you must read information | ||
695 | from the chip and return it in results. The number of integers | ||
696 | to display should be put in nrels_mag; | ||
697 | * If operation == SENSORS_PROC_REAL_WRITE, you must write the | ||
698 | supplied information to the chip. nrels_mag will contain the number | ||
699 | of integers, results the integers themselves. | ||
700 | |||
701 | The *_proc_real functions will display the elements as reals for the | ||
702 | /proc interface. If you set the magnitude to 2, and supply 345 for | ||
703 | SENSORS_PROC_REAL_READ, it would display 3.45; and if the user would | ||
704 | write 45.6 to the /proc file, it would be returned as 4560 for | ||
705 | SENSORS_PROC_REAL_WRITE. A magnitude may even be negative! | ||
706 | |||
707 | An example function: | ||
708 | |||
709 | /* FOO_FROM_REG and FOO_TO_REG translate between scaled values and | ||
710 | register values. Note the use of the read cache. */ | ||
711 | void foo_in(struct i2c_client *client, int operation, int ctl_name, | ||
712 | int *nrels_mag, long *results) | ||
713 | { | ||
714 | struct foo_data *data = client->data; | ||
715 | int nr = ctl_name - FOO_SYSCTL_FUNC1; /* reduce to 0 upwards */ | ||
716 | |||
717 | if (operation == SENSORS_PROC_REAL_INFO) | ||
718 | *nrels_mag = 2; | ||
719 | else if (operation == SENSORS_PROC_REAL_READ) { | ||
720 | /* Update the readings cache (if necessary) */ | ||
721 | foo_update_client(client); | ||
722 | /* Get the readings from the cache */ | ||
723 | results[0] = FOO_FROM_REG(data->foo_func_base[nr]); | ||
724 | results[1] = FOO_FROM_REG(data->foo_func_more[nr]); | ||
725 | results[2] = FOO_FROM_REG(data->foo_func_readonly[nr]); | ||
726 | *nrels_mag = 2; | ||
727 | } else if (operation == SENSORS_PROC_REAL_WRITE) { | ||
728 | if (*nrels_mag >= 1) { | ||
729 | /* Update the cache */ | ||
730 | data->foo_base[nr] = FOO_TO_REG(results[0]); | ||
731 | /* Update the chip */ | ||
732 | foo_write_value(client,FOO_REG_FUNC_BASE(nr),data->foo_base[nr]); | ||
733 | } | ||
734 | if (*nrels_mag >= 2) { | ||
735 | /* Update the cache */ | ||
736 | data->foo_more[nr] = FOO_TO_REG(results[1]); | ||
737 | /* Update the chip */ | ||
738 | foo_write_value(client,FOO_REG_FUNC_MORE(nr),data->foo_more[nr]); | ||
739 | } | ||
740 | } | ||
741 | } | ||
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 38fe1f03fb14..6498666ea330 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt | |||
@@ -2,7 +2,7 @@ | |||
2 | ---------------------------- | 2 | ---------------------------- |
3 | 3 | ||
4 | H. Peter Anvin <hpa@zytor.com> | 4 | H. Peter Anvin <hpa@zytor.com> |
5 | Last update 2007-01-26 | 5 | Last update 2007-03-06 |
6 | 6 | ||
7 | On the i386 platform, the Linux kernel uses a rather complicated boot | 7 | On the i386 platform, the Linux kernel uses a rather complicated boot |
8 | convention. This has evolved partially due to historical aspects, as | 8 | convention. This has evolved partially due to historical aspects, as |
@@ -35,9 +35,13 @@ Protocol 2.03: (Kernel 2.4.18-pre1) Explicitly makes the highest possible | |||
35 | initrd address available to the bootloader. | 35 | initrd address available to the bootloader. |
36 | 36 | ||
37 | Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes. | 37 | Protocol 2.04: (Kernel 2.6.14) Extend the syssize field to four bytes. |
38 | |||
38 | Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. | 39 | Protocol 2.05: (Kernel 2.6.20) Make protected mode kernel relocatable. |
39 | Introduce relocatable_kernel and kernel_alignment fields. | 40 | Introduce relocatable_kernel and kernel_alignment fields. |
40 | 41 | ||
42 | Protocol 2.06: (Kernel 2.6.22) Added a field that contains the size of | ||
43 | the boot command line | ||
44 | |||
41 | 45 | ||
42 | **** MEMORY LAYOUT | 46 | **** MEMORY LAYOUT |
43 | 47 | ||
@@ -133,6 +137,8 @@ Offset Proto Name Meaning | |||
133 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address | 137 | 022C/4 2.03+ initrd_addr_max Highest legal initrd address |
134 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel | 138 | 0230/4 2.05+ kernel_alignment Physical addr alignment required for kernel |
135 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not | 139 | 0234/1 2.05+ relocatable_kernel Whether kernel is relocatable or not |
140 | 0235/3 N/A pad2 Unused | ||
141 | 0238/4 2.06+ cmdline_size Maximum size of the kernel command line | ||
136 | 142 | ||
137 | (1) For backwards compatibility, if the setup_sects field contains 0, the | 143 | (1) For backwards compatibility, if the setup_sects field contains 0, the |
138 | real value is 4. | 144 | real value is 4. |
@@ -233,6 +239,12 @@ filled out, however: | |||
233 | if your ramdisk is exactly 131072 bytes long and this field is | 239 | if your ramdisk is exactly 131072 bytes long and this field is |
234 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) | 240 | 0x37FFFFFF, you can start your ramdisk at 0x37FE0000.) |
235 | 241 | ||
242 | cmdline_size: | ||
243 | The maximum size of the command line without the terminating | ||
244 | zero. This means that the command line can contain at most | ||
245 | cmdline_size characters. With protocol version 2.05 and | ||
246 | earlier, the maximum size was 255. | ||
247 | |||
236 | 248 | ||
237 | **** THE KERNEL COMMAND LINE | 249 | **** THE KERNEL COMMAND LINE |
238 | 250 | ||
@@ -241,11 +253,10 @@ loader to communicate with the kernel. Some of its options are also | |||
241 | relevant to the boot loader itself, see "special command line options" | 253 | relevant to the boot loader itself, see "special command line options" |
242 | below. | 254 | below. |
243 | 255 | ||
244 | The kernel command line is a null-terminated string currently up to | 256 | The kernel command line is a null-terminated string. The maximum |
245 | 255 characters long, plus the final null. A string that is too long | 257 | length can be retrieved from the field cmdline_size. Before protocol |
246 | will be automatically truncated by the kernel, a boot loader may allow | 258 | version 2.06, the maximum was 255 characters. A string that is too |
247 | a longer command line to be passed to permit future kernels to extend | 259 | long will be automatically truncated by the kernel. |
248 | this limit. | ||
249 | 260 | ||
250 | If the boot protocol version is 2.02 or later, the address of the | 261 | If the boot protocol version is 2.02 or later, the address of the |
251 | kernel command line is given by the header field cmd_line_ptr (see | 262 | kernel command line is given by the header field cmd_line_ptr (see |
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/input/input-programming.txt b/Documentation/input/input-programming.txt index 180e0689676c..d9d523099bb7 100644 --- a/Documentation/input/input-programming.txt +++ b/Documentation/input/input-programming.txt | |||
@@ -1,5 +1,3 @@ | |||
1 | $Id: input-programming.txt,v 1.4 2001/05/04 09:47:14 vojtech Exp $ | ||
2 | |||
3 | Programming input drivers | 1 | Programming input drivers |
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~ | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 | 3 | ||
@@ -20,28 +18,51 @@ pressed or released a BUTTON_IRQ happens. The driver could look like: | |||
20 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
21 | #include <asm/io.h> | 19 | #include <asm/io.h> |
22 | 20 | ||
21 | static struct input_dev *button_dev; | ||
22 | |||
23 | static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) | 23 | static void button_interrupt(int irq, void *dummy, struct pt_regs *fp) |
24 | { | 24 | { |
25 | input_report_key(&button_dev, BTN_1, inb(BUTTON_PORT) & 1); | 25 | input_report_key(button_dev, BTN_1, inb(BUTTON_PORT) & 1); |
26 | input_sync(&button_dev); | 26 | input_sync(button_dev); |
27 | } | 27 | } |
28 | 28 | ||
29 | static int __init button_init(void) | 29 | static int __init button_init(void) |
30 | { | 30 | { |
31 | int error; | ||
32 | |||
31 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { | 33 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { |
32 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); | 34 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); |
33 | return -EBUSY; | 35 | return -EBUSY; |
34 | } | 36 | } |
35 | 37 | ||
36 | button_dev.evbit[0] = BIT(EV_KEY); | 38 | button_dev = input_allocate_device(); |
37 | button_dev.keybit[LONG(BTN_0)] = BIT(BTN_0); | 39 | if (!button_dev) { |
38 | 40 | printk(KERN_ERR "button.c: Not enough memory\n"); | |
39 | input_register_device(&button_dev); | 41 | error = -ENOMEM; |
42 | goto err_free_irq; | ||
43 | } | ||
44 | |||
45 | button_dev->evbit[0] = BIT(EV_KEY); | ||
46 | button_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); | ||
47 | |||
48 | error = input_register_device(button_dev); | ||
49 | if (error) { | ||
50 | printk(KERN_ERR "button.c: Failed to register device\n"); | ||
51 | goto err_free_dev; | ||
52 | } | ||
53 | |||
54 | return 0; | ||
55 | |||
56 | err_free_dev: | ||
57 | input_free_device(button_dev); | ||
58 | err_free_irq: | ||
59 | free_irq(BUTTON_IRQ, button_interrupt); | ||
60 | return error; | ||
40 | } | 61 | } |
41 | 62 | ||
42 | static void __exit button_exit(void) | 63 | static void __exit button_exit(void) |
43 | { | 64 | { |
44 | input_unregister_device(&button_dev); | 65 | input_unregister_device(button_dev); |
45 | free_irq(BUTTON_IRQ, button_interrupt); | 66 | free_irq(BUTTON_IRQ, button_interrupt); |
46 | } | 67 | } |
47 | 68 | ||
@@ -58,17 +79,18 @@ In the _init function, which is called either upon module load or when | |||
58 | booting the kernel, it grabs the required resources (it should also check | 79 | booting the kernel, it grabs the required resources (it should also check |
59 | for the presence of the device). | 80 | for the presence of the device). |
60 | 81 | ||
61 | Then it sets the input bitfields. This way the device driver tells the other | 82 | Then it allocates a new input device structure with input_aloocate_device() |
83 | and sets up input bitfields. This way the device driver tells the other | ||
62 | parts of the input systems what it is - what events can be generated or | 84 | parts of the input systems what it is - what events can be generated or |
63 | accepted by this input device. Our example device can only generate EV_KEY type | 85 | accepted by this input device. Our example device can only generate EV_KEY |
64 | events, and from those only BTN_0 event code. Thus we only set these two | 86 | type events, and from those only BTN_0 event code. Thus we only set these |
65 | bits. We could have used | 87 | two bits. We could have used |
66 | 88 | ||
67 | set_bit(EV_KEY, button_dev.evbit); | 89 | set_bit(EV_KEY, button_dev.evbit); |
68 | set_bit(BTN_0, button_dev.keybit); | 90 | set_bit(BTN_0, button_dev.keybit); |
69 | 91 | ||
70 | as well, but with more than single bits the first approach tends to be | 92 | as well, but with more than single bits the first approach tends to be |
71 | shorter. | 93 | shorter. |
72 | 94 | ||
73 | Then the example driver registers the input device structure by calling | 95 | Then the example driver registers the input device structure by calling |
74 | 96 | ||
@@ -76,16 +98,15 @@ Then the example driver registers the input device structure by calling | |||
76 | 98 | ||
77 | This adds the button_dev structure to linked lists of the input driver and | 99 | This adds the button_dev structure to linked lists of the input driver and |
78 | calls device handler modules _connect functions to tell them a new input | 100 | calls device handler modules _connect functions to tell them a new input |
79 | device has appeared. Because the _connect functions may call kmalloc(, | 101 | device has appeared. input_register_device() may sleep and therefore must |
80 | GFP_KERNEL), which can sleep, input_register_device() must not be called | 102 | not be called from an interrupt or with a spinlock held. |
81 | from an interrupt or with a spinlock held. | ||
82 | 103 | ||
83 | While in use, the only used function of the driver is | 104 | While in use, the only used function of the driver is |
84 | 105 | ||
85 | button_interrupt() | 106 | button_interrupt() |
86 | 107 | ||
87 | which upon every interrupt from the button checks its state and reports it | 108 | which upon every interrupt from the button checks its state and reports it |
88 | via the | 109 | via the |
89 | 110 | ||
90 | input_report_key() | 111 | input_report_key() |
91 | 112 | ||
@@ -113,16 +134,10 @@ can use the open and close callback to know when it can stop polling or | |||
113 | release the interrupt and when it must resume polling or grab the interrupt | 134 | release the interrupt and when it must resume polling or grab the interrupt |
114 | again. To do that, we would add this to our example driver: | 135 | again. To do that, we would add this to our example driver: |
115 | 136 | ||
116 | int button_used = 0; | ||
117 | |||
118 | static int button_open(struct input_dev *dev) | 137 | static int button_open(struct input_dev *dev) |
119 | { | 138 | { |
120 | if (button_used++) | ||
121 | return 0; | ||
122 | |||
123 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { | 139 | if (request_irq(BUTTON_IRQ, button_interrupt, 0, "button", NULL)) { |
124 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); | 140 | printk(KERN_ERR "button.c: Can't allocate irq %d\n", button_irq); |
125 | button_used--; | ||
126 | return -EBUSY; | 141 | return -EBUSY; |
127 | } | 142 | } |
128 | 143 | ||
@@ -131,20 +146,21 @@ static int button_open(struct input_dev *dev) | |||
131 | 146 | ||
132 | static void button_close(struct input_dev *dev) | 147 | static void button_close(struct input_dev *dev) |
133 | { | 148 | { |
134 | if (!--button_used) | 149 | free_irq(IRQ_AMIGA_VERTB, button_interrupt); |
135 | free_irq(IRQ_AMIGA_VERTB, button_interrupt); | ||
136 | } | 150 | } |
137 | 151 | ||
138 | static int __init button_init(void) | 152 | static int __init button_init(void) |
139 | { | 153 | { |
140 | ... | 154 | ... |
141 | button_dev.open = button_open; | 155 | button_dev->open = button_open; |
142 | button_dev.close = button_close; | 156 | button_dev->close = button_close; |
143 | ... | 157 | ... |
144 | } | 158 | } |
145 | 159 | ||
146 | Note the button_used variable - we have to track how many times the open | 160 | Note that input core keeps track of number of users for the device and |
147 | function was called to know when exactly our device stops being used. | 161 | makes sure that dev->open() is called only when the first user connects |
162 | to the device and that dev->close() is called when the very last user | ||
163 | disconnects. Calls to both callbacks are serialized. | ||
148 | 164 | ||
149 | The open() callback should return a 0 in case of success or any nonzero value | 165 | The open() callback should return a 0 in case of success or any nonzero value |
150 | in case of failure. The close() callback (which is void) must always succeed. | 166 | in case of failure. The close() callback (which is void) must always succeed. |
@@ -175,7 +191,7 @@ set the corresponding bits and call the | |||
175 | 191 | ||
176 | input_report_rel(struct input_dev *dev, int code, int value) | 192 | input_report_rel(struct input_dev *dev, int code, int value) |
177 | 193 | ||
178 | function. Events are generated only for nonzero value. | 194 | function. Events are generated only for nonzero value. |
179 | 195 | ||
180 | However EV_ABS requires a little special care. Before calling | 196 | However EV_ABS requires a little special care. Before calling |
181 | input_register_device, you have to fill additional fields in the input_dev | 197 | input_register_device, you have to fill additional fields in the input_dev |
@@ -187,6 +203,10 @@ the ABS_X axis: | |||
187 | button_dev.absfuzz[ABS_X] = 4; | 203 | button_dev.absfuzz[ABS_X] = 4; |
188 | button_dev.absflat[ABS_X] = 8; | 204 | button_dev.absflat[ABS_X] = 8; |
189 | 205 | ||
206 | Or, you can just say: | ||
207 | |||
208 | input_set_abs_params(button_dev, ABS_X, 0, 255, 4, 8); | ||
209 | |||
190 | This setting would be appropriate for a joystick X axis, with the minimum of | 210 | This setting would be appropriate for a joystick X axis, with the minimum of |
191 | 0, maximum of 255 (which the joystick *must* be able to reach, no problem if | 211 | 0, maximum of 255 (which the joystick *must* be able to reach, no problem if |
192 | it sometimes reports more, but it must be able to always reach the min and | 212 | it sometimes reports more, but it must be able to always reach the min and |
@@ -197,14 +217,7 @@ If you don't need absfuzz and absflat, you can set them to zero, which mean | |||
197 | that the thing is precise and always returns to exactly the center position | 217 | that the thing is precise and always returns to exactly the center position |
198 | (if it has any). | 218 | (if it has any). |
199 | 219 | ||
200 | 1.4 The void *private field | 220 | 1.4 NBITS(), LONG(), BIT() |
201 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
202 | |||
203 | This field in the input structure can be used to point to any private data | ||
204 | structures in the input device driver, in case the driver handles more than | ||
205 | one device. You'll need it in the open and close callbacks. | ||
206 | |||
207 | 1.5 NBITS(), LONG(), BIT() | ||
208 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | 221 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
209 | 222 | ||
210 | These three macros from input.h help some bitfield computations: | 223 | These three macros from input.h help some bitfield computations: |
@@ -213,13 +226,9 @@ These three macros from input.h help some bitfield computations: | |||
213 | LONG(x) - returns the index in the array in longs for bit x | 226 | LONG(x) - returns the index in the array in longs for bit x |
214 | BIT(x) - returns the index in a long for bit x | 227 | BIT(x) - returns the index in a long for bit x |
215 | 228 | ||
216 | 1.6 The number, id* and name fields | 229 | 1.5 The id* and name fields |
217 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 230 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
218 | 231 | ||
219 | The dev->number is assigned by the input system to the input device when it | ||
220 | is registered. It has no use except for identifying the device to the user | ||
221 | in system messages. | ||
222 | |||
223 | The dev->name should be set before registering the input device by the input | 232 | The dev->name should be set before registering the input device by the input |
224 | device driver. It's a string like 'Generic button device' containing a | 233 | device driver. It's a string like 'Generic button device' containing a |
225 | user friendly name of the device. | 234 | user friendly name of the device. |
@@ -234,15 +243,25 @@ driver. | |||
234 | 243 | ||
235 | The id and name fields can be passed to userland via the evdev interface. | 244 | The id and name fields can be passed to userland via the evdev interface. |
236 | 245 | ||
237 | 1.7 The keycode, keycodemax, keycodesize fields | 246 | 1.6 The keycode, keycodemax, keycodesize fields |
238 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 247 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
239 | 248 | ||
240 | These two fields will be used for any input devices that report their data | 249 | These three fields should be used by input devices that have dense keymaps. |
241 | as scancodes. If not all scancodes can be known by autodetection, they may | 250 | The keycode is an array used to map from scancodes to input system keycodes. |
242 | need to be set by userland utilities. The keycode array then is an array | 251 | The keycode max should contain the size of the array and keycodesize the |
243 | used to map from scancodes to input system keycodes. The keycode max will | 252 | size of each entry in it (in bytes). |
244 | contain the size of the array and keycodesize the size of each entry in it | 253 | |
245 | (in bytes). | 254 | Userspace can query and alter current scancode to keycode mappings using |
255 | EVIOCGKEYCODE and EVIOCSKEYCODE ioctls on corresponding evdev interface. | ||
256 | When a device has all 3 aforementioned fields filled in, the driver may | ||
257 | rely on kernel's default implementation of setting and querying keycode | ||
258 | mappings. | ||
259 | |||
260 | 1.7 dev->getkeycode() and dev->setkeycode() | ||
261 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
262 | getkeycode() and setkeycode() callbacks allow drivers to override default | ||
263 | keycode/keycodesize/keycodemax mapping mechanism provided by input core | ||
264 | and implement sparse keycode maps. | ||
246 | 265 | ||
247 | 1.8 Key autorepeat | 266 | 1.8 Key autorepeat |
248 | ~~~~~~~~~~~~~~~~~~ | 267 | ~~~~~~~~~~~~~~~~~~ |
@@ -266,7 +285,7 @@ direction - from the system to the input device driver. If your input device | |||
266 | driver can handle these events, it has to set the respective bits in evbit, | 285 | driver can handle these events, it has to set the respective bits in evbit, |
267 | *and* also the callback routine: | 286 | *and* also the callback routine: |
268 | 287 | ||
269 | button_dev.event = button_event; | 288 | button_dev->event = button_event; |
270 | 289 | ||
271 | int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 290 | int button_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
272 | { | 291 | { |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 12533a958c51..38d7db3262c7 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -64,6 +64,7 @@ parameter is applicable: | |||
64 | GENERIC_TIME The generic timeofday code is enabled. | 64 | GENERIC_TIME The generic timeofday code is enabled. |
65 | NFS Appropriate NFS support is enabled. | 65 | NFS Appropriate NFS support is enabled. |
66 | OSS OSS sound support is enabled. | 66 | OSS OSS sound support is enabled. |
67 | PV_OPS A paravirtualized kernel | ||
67 | PARIDE The ParIDE subsystem is enabled. | 68 | PARIDE The ParIDE subsystem is enabled. |
68 | PARISC The PA-RISC architecture is enabled. | 69 | PARISC The PA-RISC architecture is enabled. |
69 | PCI PCI bus support is enabled. | 70 | PCI PCI bus support is enabled. |
@@ -181,19 +182,41 @@ and is between 256 and 4096 characters. It is defined in the file | |||
181 | that require a timer override, but don't have | 182 | that require a timer override, but don't have |
182 | HPET | 183 | HPET |
183 | 184 | ||
184 | acpi_dbg_layer= [HW,ACPI] | 185 | acpi.debug_layer= [HW,ACPI] |
185 | Format: <int> | 186 | Format: <int> |
186 | Each bit of the <int> indicates an ACPI debug layer, | 187 | Each bit of the <int> indicates an ACPI debug layer, |
187 | 1: enable, 0: disable. It is useful for boot time | 188 | 1: enable, 0: disable. It is useful for boot time |
188 | debugging. After system has booted up, it can be set | 189 | debugging. After system has booted up, it can be set |
189 | via /proc/acpi/debug_layer. | 190 | via /sys/module/acpi/parameters/debug_layer. |
190 | 191 | CONFIG_ACPI_DEBUG must be enabled for this to produce any output. | |
191 | acpi_dbg_level= [HW,ACPI] | 192 | Available bits (add the numbers together) to enable debug output |
193 | for specific parts of the ACPI subsystem: | ||
194 | 0x01 utilities 0x02 hardware 0x04 events 0x08 tables | ||
195 | 0x10 namespace 0x20 parser 0x40 dispatcher | ||
196 | 0x80 executer 0x100 resources 0x200 acpica debugger | ||
197 | 0x400 os services 0x800 acpica disassembler. | ||
198 | The number can be in decimal or prefixed with 0x in hex. | ||
199 | Warning: Many of these options can produce a lot of | ||
200 | output and make your system unusable. Be very careful. | ||
201 | |||
202 | acpi.debug_level= [HW,ACPI] | ||
192 | Format: <int> | 203 | Format: <int> |
193 | Each bit of the <int> indicates an ACPI debug level, | 204 | Each bit of the <int> indicates an ACPI debug level, |
194 | 1: enable, 0: disable. It is useful for boot time | 205 | 1: enable, 0: disable. It is useful for boot time |
195 | debugging. After system has booted up, it can be set | 206 | debugging. After system has booted up, it can be set |
196 | via /proc/acpi/debug_level. | 207 | via /sys/module/acpi/parameters/debug_level. |
208 | CONFIG_ACPI_DEBUG must be enabled for this to produce any output. | ||
209 | Available bits (add the numbers together) to enable different | ||
210 | debug output levels of the ACPI subsystem: | ||
211 | 0x01 error 0x02 warn 0x04 init 0x08 debug object | ||
212 | 0x10 info 0x20 init names 0x40 parse 0x80 load | ||
213 | 0x100 dispatch 0x200 execute 0x400 names 0x800 operation region | ||
214 | 0x1000 bfield 0x2000 tables 0x4000 values 0x8000 objects | ||
215 | 0x10000 resources 0x20000 user requests 0x40000 package. | ||
216 | The number can be in decimal or prefixed with 0x in hex. | ||
217 | Warning: Many of these options can produce a lot of | ||
218 | output and make your system unusable. Be very careful. | ||
219 | |||
197 | 220 | ||
198 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT | 221 | acpi_fake_ecdt [HW,ACPI] Workaround failure due to BIOS lacking ECDT |
199 | 222 | ||
@@ -673,8 +696,15 @@ and is between 256 and 4096 characters. It is defined in the file | |||
673 | idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed | 696 | idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed |
674 | See Documentation/ide.txt. | 697 | See Documentation/ide.txt. |
675 | 698 | ||
676 | idle= [HW] | 699 | idle= [X86] |
677 | Format: idle=poll or idle=halt | 700 | Format: idle=poll or idle=mwait |
701 | Poll forces a polling idle loop that can slightly improves the performance | ||
702 | of waking up a idle CPU, but will use a lot of power and make the system | ||
703 | run hot. Not recommended. | ||
704 | idle=mwait. On systems which support MONITOR/MWAIT but the kernel chose | ||
705 | to not use it because it doesn't save as much power as a normal idle | ||
706 | loop use the MONITOR/MWAIT idle loop anyways. Performance should be the same | ||
707 | as idle=poll. | ||
678 | 708 | ||
679 | ignore_loglevel [KNL] | 709 | ignore_loglevel [KNL] |
680 | Ignore loglevel setting - this will print /all/ | 710 | Ignore loglevel setting - this will print /all/ |
@@ -1135,6 +1165,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1135 | 1165 | ||
1136 | nomce [IA-32] Machine Check Exception | 1166 | nomce [IA-32] Machine Check Exception |
1137 | 1167 | ||
1168 | noreplace-paravirt [IA-32,PV_OPS] Don't patch paravirt_ops | ||
1169 | |||
1170 | noreplace-smp [IA-32,SMP] Don't replace SMP instructions | ||
1171 | with UP alternatives | ||
1172 | |||
1138 | noresidual [PPC] Don't use residual data on PReP machines. | 1173 | noresidual [PPC] Don't use residual data on PReP machines. |
1139 | 1174 | ||
1140 | noresume [SWSUSP] Disables resume and restores original swap | 1175 | noresume [SWSUSP] Disables resume and restores original swap |
@@ -1540,6 +1575,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1540 | smart2= [HW] | 1575 | smart2= [HW] |
1541 | Format: <io1>[,<io2>[,...,<io8>]] | 1576 | Format: <io1>[,<io2>[,...,<io8>]] |
1542 | 1577 | ||
1578 | smp-alt-once [IA-32,SMP] On a hotplug CPU system, only | ||
1579 | attempt to substitute SMP alternatives once at boot. | ||
1580 | |||
1543 | snd-ad1816a= [HW,ALSA] | 1581 | snd-ad1816a= [HW,ALSA] |
1544 | 1582 | ||
1545 | snd-ad1848= [HW,ALSA] | 1583 | snd-ad1848= [HW,ALSA] |
@@ -1792,12 +1830,13 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1792 | for newly-detected USB devices (default 2). This | 1830 | for newly-detected USB devices (default 2). This |
1793 | is the time required before an idle device will be | 1831 | is the time required before an idle device will be |
1794 | autosuspended. Devices for which the delay is set | 1832 | autosuspended. Devices for which the delay is set |
1795 | to 0 won't be autosuspended at all. | 1833 | to a negative value won't be autosuspended at all. |
1796 | 1834 | ||
1797 | usbhid.mousepoll= | 1835 | usbhid.mousepoll= |
1798 | [USBHID] The interval which mice are to be polled at. | 1836 | [USBHID] The interval which mice are to be polled at. |
1799 | 1837 | ||
1800 | vdso= [IA-32,SH] | 1838 | vdso= [IA-32,SH] |
1839 | vdso=2: enable compat VDSO (default with COMPAT_VDSO) | ||
1801 | vdso=1: enable VDSO (default) | 1840 | vdso=1: enable VDSO (default) |
1802 | vdso=0: disable VDSO mapping | 1841 | vdso=0: disable VDSO mapping |
1803 | 1842 | ||
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/pci.txt b/Documentation/pci.txt index cdf2f3c0ab14..e2c9d0a0c43d 100644 --- a/Documentation/pci.txt +++ b/Documentation/pci.txt | |||
@@ -124,10 +124,6 @@ initialization with a pointer to a structure describing the driver | |||
124 | 124 | ||
125 | err_handler See Documentation/pci-error-recovery.txt | 125 | err_handler See Documentation/pci-error-recovery.txt |
126 | 126 | ||
127 | multithread_probe Enable multi-threaded probe/scan. Driver must | ||
128 | provide its own locking/syncronization for init | ||
129 | operations if this is enabled. | ||
130 | |||
131 | 127 | ||
132 | The ID table is an array of struct pci_device_id entries ending with an | 128 | The ID table is an array of struct pci_device_id entries ending with an |
133 | all-zero entry. Each entry consists of: | 129 | all-zero entry. Each entry consists of: |
@@ -163,9 +159,9 @@ echo "vendor device subvendor subdevice class class_mask driver_data" > \ | |||
163 | /sys/bus/pci/drivers/{driver}/new_id | 159 | /sys/bus/pci/drivers/{driver}/new_id |
164 | 160 | ||
165 | All fields are passed in as hexadecimal values (no leading 0x). | 161 | All fields are passed in as hexadecimal values (no leading 0x). |
166 | Users need pass only as many fields as necessary: | 162 | The vendor and device fields are mandatory, the others are optional. Users |
167 | o vendor, device, subvendor, and subdevice fields default | 163 | need pass only as many optional fields as necessary: |
168 | to PCI_ANY_ID (FFFFFFFF), | 164 | o subvendor and subdevice fields default to PCI_ANY_ID (FFFFFFFF) |
169 | o class and classmask fields default to 0 | 165 | o class and classmask fields default to 0 |
170 | o driver_data defaults to 0UL. | 166 | o driver_data defaults to 0UL. |
171 | 167 | ||
@@ -549,8 +545,6 @@ pci_find_slot() Find pci_dev corresponding to given bus and | |||
549 | pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3) | 545 | pci_set_power_state() Set PCI Power Management state (0=D0 ... 3=D3) |
550 | pci_find_capability() Find specified capability in device's capability | 546 | pci_find_capability() Find specified capability in device's capability |
551 | list. | 547 | list. |
552 | pci_module_init() Inline helper function for ensuring correct | ||
553 | pci_driver initialization and error handling. | ||
554 | pci_resource_start() Returns bus start address for a given PCI region | 548 | pci_resource_start() Returns bus start address for a given PCI region |
555 | pci_resource_end() Returns bus end address for a given PCI region | 549 | pci_resource_end() Returns bus end address for a given PCI region |
556 | pci_resource_len() Returns the byte length of a PCI region | 550 | pci_resource_len() Returns the byte length of a PCI region |
diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index 74311d7e0f3c..8c5b41bf3f36 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt | |||
@@ -18,17 +18,10 @@ states. | |||
18 | 18 | ||
19 | 19 | ||
20 | /sys/power/disk controls the operating mode of the suspend-to-disk | 20 | /sys/power/disk controls the operating mode of the suspend-to-disk |
21 | mechanism. Suspend-to-disk can be handled in several ways. The | 21 | mechanism. Suspend-to-disk can be handled in several ways. We have a |
22 | greatest distinction is who writes memory to disk - the firmware or | 22 | few options for putting the system to sleep - using the platform driver |
23 | the kernel. If the firmware does it, we assume that it also handles | 23 | (e.g. ACPI or other pm_ops), powering off the system or rebooting the |
24 | suspending the system. | 24 | system (for testing). |
25 | |||
26 | If the kernel does it, then we have three options for putting the system | ||
27 | to sleep - using the platform driver (e.g. ACPI or other PM | ||
28 | registers), powering off the system or rebooting the system (for | ||
29 | testing). The system will support either 'firmware' or 'platform', and | ||
30 | that is known a priori. But, the user may choose 'shutdown' or | ||
31 | 'reboot' as alternatives. | ||
32 | 25 | ||
33 | Additionally, /sys/power/disk can be used to turn on one of the two testing | 26 | Additionally, /sys/power/disk can be used to turn on one of the two testing |
34 | modes of the suspend-to-disk mechanism: 'testproc' or 'test'. If the | 27 | modes of the suspend-to-disk mechanism: 'testproc' or 'test'. If the |
@@ -44,16 +37,12 @@ is being slow and which device drivers are misbehaving. | |||
44 | Reading from this file will display what the mode is currently set | 37 | Reading from this file will display what the mode is currently set |
45 | to. Writing to this file will accept one of | 38 | to. Writing to this file will accept one of |
46 | 39 | ||
47 | 'firmware' | 40 | 'platform' (only if the platform supports it) |
48 | 'platform' | ||
49 | 'shutdown' | 41 | 'shutdown' |
50 | 'reboot' | 42 | 'reboot' |
51 | 'testproc' | 43 | 'testproc' |
52 | 'test' | 44 | 'test' |
53 | 45 | ||
54 | It will only change to 'firmware' or 'platform' if the system supports | ||
55 | it. | ||
56 | |||
57 | /sys/power/image_size controls the size of the image created by | 46 | /sys/power/image_size controls the size of the image created by |
58 | the suspend-to-disk mechanism. It can be written a string | 47 | the suspend-to-disk mechanism. It can be written a string |
59 | representing a non-negative integer that will be used as an upper | 48 | representing a non-negative integer that will be used as an upper |
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt index b6a3cbf7e846..e00b099a4b86 100644 --- a/Documentation/power/pci.txt +++ b/Documentation/power/pci.txt | |||
@@ -203,7 +203,7 @@ resume | |||
203 | 203 | ||
204 | Usage: | 204 | Usage: |
205 | 205 | ||
206 | if (dev->driver && dev->driver->suspend) | 206 | if (dev->driver && dev->driver->resume) |
207 | dev->driver->resume(dev) | 207 | dev->driver->resume(dev) |
208 | 208 | ||
209 | The resume callback may be called from any power state, and is always meant to | 209 | The resume callback may be called from any power state, and is always meant to |
diff --git a/Documentation/power/states.txt b/Documentation/power/states.txt index 0931a330d362..34800cc521bf 100644 --- a/Documentation/power/states.txt +++ b/Documentation/power/states.txt | |||
@@ -62,17 +62,18 @@ setup via another operating system for it to use. Despite the | |||
62 | inconvenience, this method requires minimal work by the kernel, since | 62 | inconvenience, this method requires minimal work by the kernel, since |
63 | the firmware will also handle restoring memory contents on resume. | 63 | the firmware will also handle restoring memory contents on resume. |
64 | 64 | ||
65 | If the kernel is responsible for persistently saving state, a mechanism | 65 | For suspend-to-disk, a mechanism called swsusp called 'swsusp' (Swap |
66 | called 'swsusp' (Swap Suspend) is used to write memory contents to | 66 | Suspend) is used to write memory contents to free swap space. |
67 | free swap space. swsusp has some restrictive requirements, but should | 67 | swsusp has some restrictive requirements, but should work in most |
68 | work in most cases. Some, albeit outdated, documentation can be found | 68 | cases. Some, albeit outdated, documentation can be found in |
69 | in Documentation/power/swsusp.txt. | 69 | Documentation/power/swsusp.txt. Alternatively, userspace can do most |
70 | of the actual suspend to disk work, see userland-swsusp.txt. | ||
70 | 71 | ||
71 | Once memory state is written to disk, the system may either enter a | 72 | Once memory state is written to disk, the system may either enter a |
72 | low-power state (like ACPI S4), or it may simply power down. Powering | 73 | low-power state (like ACPI S4), or it may simply power down. Powering |
73 | down offers greater savings, and allows this mechanism to work on any | 74 | down offers greater savings, and allows this mechanism to work on any |
74 | system. However, entering a real low-power state allows the user to | 75 | system. However, entering a real low-power state allows the user to |
75 | trigger wake up events (e.g. pressing a key or opening a laptop lid). | 76 | trigger wake up events (e.g. pressing a key or opening a laptop lid). |
76 | 77 | ||
77 | A transition from Suspend-to-Disk to the On state should take about 30 | 78 | A transition from Suspend-to-Disk to the On state should take about 30 |
78 | seconds, though it's typically a bit more with the current | 79 | seconds, though it's typically a bit more with the current |
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index 0761ff6c57ed..c55bd5079b90 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -156,8 +156,7 @@ instead set the PF_NOFREEZE process flag when creating the thread (and | |||
156 | be very careful). | 156 | be very careful). |
157 | 157 | ||
158 | 158 | ||
159 | Q: What is the difference between "platform", "shutdown" and | 159 | Q: What is the difference between "platform" and "shutdown"? |
160 | "firmware" in /sys/power/disk? | ||
161 | 160 | ||
162 | A: | 161 | A: |
163 | 162 | ||
@@ -166,11 +165,8 @@ shutdown: save state in linux, then tell bios to powerdown | |||
166 | platform: save state in linux, then tell bios to powerdown and blink | 165 | platform: save state in linux, then tell bios to powerdown and blink |
167 | "suspended led" | 166 | "suspended led" |
168 | 167 | ||
169 | firmware: tell bios to save state itself [needs BIOS-specific suspend | 168 | "platform" is actually right thing to do where supported, but |
170 | partition, and has very little to do with swsusp] | 169 | "shutdown" is most reliable (except on ACPI systems). |
171 | |||
172 | "platform" is actually right thing to do, but "shutdown" is most | ||
173 | reliable. | ||
174 | 170 | ||
175 | Q: I do not understand why you have such strong objections to idea of | 171 | Q: I do not understand why you have such strong objections to idea of |
176 | selective suspend. | 172 | selective suspend. |
@@ -388,8 +384,8 @@ while the system is asleep, maintaining the connection, using true sleep | |||
388 | modes like "suspend-to-RAM" or "standby". (Don't write "disk" to the | 384 | modes like "suspend-to-RAM" or "standby". (Don't write "disk" to the |
389 | /sys/power/state file; write "standby" or "mem".) We've not seen any | 385 | /sys/power/state file; write "standby" or "mem".) We've not seen any |
390 | hardware that can use these modes through software suspend, although in | 386 | hardware that can use these modes through software suspend, although in |
391 | theory some systems might support "platform" or "firmware" modes that | 387 | theory some systems might support "platform" modes that won't break the |
392 | won't break the USB connections. | 388 | USB connections. |
393 | 389 | ||
394 | Remember that it's always a bad idea to unplug a disk drive containing a | 390 | Remember that it's always a bad idea to unplug a disk drive containing a |
395 | mounted filesystem. That's true even when your system is asleep! The | 391 | mounted filesystem. That's true even when your system is asleep! The |
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/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt index dc8e44fc650f..2368e7e4a8cf 100644 --- a/Documentation/scsi/aacraid.txt +++ b/Documentation/scsi/aacraid.txt | |||
@@ -37,7 +37,11 @@ Supported Cards/Chipsets | |||
37 | 9005:0286:9005:029d Adaptec 2420SA (Intruder HP release) | 37 | 9005:0286:9005:029d Adaptec 2420SA (Intruder HP release) |
38 | 9005:0286:9005:02ac Adaptec 1800 (Typhoon44) | 38 | 9005:0286:9005:02ac Adaptec 1800 (Typhoon44) |
39 | 9005:0285:9005:02b5 Adaptec 5445 (Voodoo44) | 39 | 9005:0285:9005:02b5 Adaptec 5445 (Voodoo44) |
40 | 9005:0285:15d9:02b5 SMC AOC-USAS-S4i | ||
41 | 9005:0285:15d9:02c9 SMC AOC-USAS-S4iR | ||
40 | 9005:0285:9005:02b6 Adaptec 5805 (Voodoo80) | 42 | 9005:0285:9005:02b6 Adaptec 5805 (Voodoo80) |
43 | 9005:0285:15d9:02b6 SMC AOC-USAS-S8i | ||
44 | 9005:0285:15d9:02ca SMC AOC-USAS-S8iR | ||
41 | 9005:0285:9005:02b7 Adaptec 5085 (Voodoo08) | 45 | 9005:0285:9005:02b7 Adaptec 5085 (Voodoo08) |
42 | 9005:0285:9005:02bb Adaptec 3405 (Marauder40LP) | 46 | 9005:0285:9005:02bb Adaptec 3405 (Marauder40LP) |
43 | 9005:0285:9005:02bc Adaptec 3805 (Marauder80LP) | 47 | 9005:0285:9005:02bc Adaptec 3805 (Marauder80LP) |
@@ -93,6 +97,9 @@ Supported Cards/Chipsets | |||
93 | 9005:0286:9005:02ae (Aurora Lite ARK) | 97 | 9005:0286:9005:02ae (Aurora Lite ARK) |
94 | 9005:0285:9005:02b0 (Sunrise Lake ARK) | 98 | 9005:0285:9005:02b0 (Sunrise Lake ARK) |
95 | 9005:0285:9005:02b1 Adaptec (Voodoo 8 internal 8 external) | 99 | 9005:0285:9005:02b1 Adaptec (Voodoo 8 internal 8 external) |
100 | 9005:0285:108e:7aac SUN STK RAID REM (Voodoo44 Coyote) | ||
101 | 9005:0285:108e:0286 SUN SG-XPCIESAS-R-IN (Cougar) | ||
102 | 9005:0285:108e:0287 SUN SG-XPCIESAS-R-EX (Prometheus) | ||
96 | 103 | ||
97 | People | 104 | People |
98 | ------------------------- | 105 | ------------------------- |
diff --git a/Documentation/scsi/ncr53c8xx.txt b/Documentation/scsi/ncr53c8xx.txt index caf10b155185..88ef88b949f7 100644 --- a/Documentation/scsi/ncr53c8xx.txt +++ b/Documentation/scsi/ncr53c8xx.txt | |||
@@ -562,11 +562,6 @@ if only one has a flaw for some SCSI feature, you can disable the | |||
562 | support by the driver of this feature at linux start-up and enable | 562 | support by the driver of this feature at linux start-up and enable |
563 | this feature after boot-up only for devices that support it safely. | 563 | this feature after boot-up only for devices that support it safely. |
564 | 564 | ||
565 | CONFIG_SCSI_NCR53C8XX_PROFILE_SUPPORT (default answer: n) | ||
566 | This option must be set for profiling information to be gathered | ||
567 | and printed out through the proc file system. This features may | ||
568 | impact performances. | ||
569 | |||
570 | CONFIG_SCSI_NCR53C8XX_IOMAPPED (default answer: n) | 565 | CONFIG_SCSI_NCR53C8XX_IOMAPPED (default answer: n) |
571 | Answer "y" if you suspect your mother board to not allow memory mapped I/O. | 566 | Answer "y" if you suspect your mother board to not allow memory mapped I/O. |
572 | May slow down performance a little. This option is required by | 567 | May slow down performance a little. This option is required by |
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/usb-serial.txt b/Documentation/usb/usb-serial.txt index d61f6e7865de..b18e86a22506 100644 --- a/Documentation/usb/usb-serial.txt +++ b/Documentation/usb/usb-serial.txt | |||
@@ -42,7 +42,7 @@ ConnectTech WhiteHEAT 4 port converter | |||
42 | http://www.connecttech.com | 42 | http://www.connecttech.com |
43 | 43 | ||
44 | For any questions or problems with this driver, please contact | 44 | For any questions or problems with this driver, please contact |
45 | Stuart MacDonald at stuartm@connecttech.com | 45 | Connect Tech's Support Department at support@connecttech.com |
46 | 46 | ||
47 | 47 | ||
48 | HandSpring Visor, Palm USB, and Clié USB driver | 48 | HandSpring Visor, Palm USB, and Clié USB driver |
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..6177d881983f 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -149,7 +149,19 @@ NUMA | |||
149 | 149 | ||
150 | numa=noacpi Don't parse the SRAT table for NUMA setup | 150 | numa=noacpi Don't parse the SRAT table for NUMA setup |
151 | 151 | ||
152 | numa=fake=X Fake X nodes and ignore NUMA setup of the actual machine. | 152 | numa=fake=CMDLINE |
153 | If a number, fakes CMDLINE nodes and ignores NUMA setup of the | ||
154 | actual machine. Otherwise, system memory is configured | ||
155 | depending on the sizes and coefficients listed. For example: | ||
156 | numa=fake=2*512,1024,4*256,*128 | ||
157 | gives two 512M nodes, a 1024M node, four 256M nodes, and the | ||
158 | rest split into 128M chunks. If the last character of CMDLINE | ||
159 | is a *, the remaining memory is divided up equally among its | ||
160 | coefficient: | ||
161 | numa=fake=2*512,2* | ||
162 | gives two 512M nodes and the rest split into two nodes. | ||
163 | Otherwise, the remaining system RAM is allocated to an | ||
164 | additional node. | ||
153 | 165 | ||
154 | numa=hotadd=percent | 166 | numa=hotadd=percent |
155 | Only allow hotadd memory to preallocate page structures upto | 167 | Only allow hotadd memory to preallocate page structures upto |
@@ -293,7 +305,3 @@ Debugging | |||
293 | stuck (default) | 305 | stuck (default) |
294 | 306 | ||
295 | Miscellaneous | 307 | 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. | ||
diff --git a/Documentation/x86_64/fake-numa-for-cpusets b/Documentation/x86_64/fake-numa-for-cpusets new file mode 100644 index 000000000000..d1a985c5b00a --- /dev/null +++ b/Documentation/x86_64/fake-numa-for-cpusets | |||
@@ -0,0 +1,66 @@ | |||
1 | Using numa=fake and CPUSets for Resource Management | ||
2 | Written by David Rientjes <rientjes@cs.washington.edu> | ||
3 | |||
4 | This document describes how the numa=fake x86_64 command-line option can be used | ||
5 | in conjunction with cpusets for coarse memory management. Using this feature, | ||
6 | you can create fake NUMA nodes that represent contiguous chunks of memory and | ||
7 | assign them to cpusets and their attached tasks. This is a way of limiting the | ||
8 | amount of system memory that are available to a certain class of tasks. | ||
9 | |||
10 | For more information on the features of cpusets, see Documentation/cpusets.txt. | ||
11 | There are a number of different configurations you can use for your needs. For | ||
12 | more information on the numa=fake command line option and its various ways of | ||
13 | configuring fake nodes, see Documentation/x86_64/boot-options.txt. | ||
14 | |||
15 | For the purposes of this introduction, we'll assume a very primitive NUMA | ||
16 | emulation setup of "numa=fake=4*512,". This will split our system memory into | ||
17 | four equal chunks of 512M each that we can now use to assign to cpusets. As | ||
18 | you become more familiar with using this combination for resource control, | ||
19 | you'll determine a better setup to minimize the number of nodes you have to deal | ||
20 | with. | ||
21 | |||
22 | A machine may be split as follows with "numa=fake=4*512," as reported by dmesg: | ||
23 | |||
24 | Faking node 0 at 0000000000000000-0000000020000000 (512MB) | ||
25 | Faking node 1 at 0000000020000000-0000000040000000 (512MB) | ||
26 | Faking node 2 at 0000000040000000-0000000060000000 (512MB) | ||
27 | Faking node 3 at 0000000060000000-0000000080000000 (512MB) | ||
28 | ... | ||
29 | On node 0 totalpages: 130975 | ||
30 | On node 1 totalpages: 131072 | ||
31 | On node 2 totalpages: 131072 | ||
32 | On node 3 totalpages: 131072 | ||
33 | |||
34 | Now following the instructions for mounting the cpusets filesystem from | ||
35 | Documentation/cpusets.txt, you can assign fake nodes (i.e. contiguous memory | ||
36 | address spaces) to individual cpusets: | ||
37 | |||
38 | [root@xroads /]# mkdir exampleset | ||
39 | [root@xroads /]# mount -t cpuset none exampleset | ||
40 | [root@xroads /]# mkdir exampleset/ddset | ||
41 | [root@xroads /]# cd exampleset/ddset | ||
42 | [root@xroads /exampleset/ddset]# echo 0-1 > cpus | ||
43 | [root@xroads /exampleset/ddset]# echo 0-1 > mems | ||
44 | |||
45 | Now this cpuset, 'ddset', will only allowed access to fake nodes 0 and 1 for | ||
46 | memory allocations (1G). | ||
47 | |||
48 | You can now assign tasks to these cpusets to limit the memory resources | ||
49 | available to them according to the fake nodes assigned as mems: | ||
50 | |||
51 | [root@xroads /exampleset/ddset]# echo $$ > tasks | ||
52 | [root@xroads /exampleset/ddset]# dd if=/dev/zero of=tmp bs=1024 count=1G | ||
53 | [1] 13425 | ||
54 | |||
55 | Notice the difference between the system memory usage as reported by | ||
56 | /proc/meminfo between the restricted cpuset case above and the unrestricted | ||
57 | case (i.e. running the same 'dd' command without assigning it to a fake NUMA | ||
58 | cpuset): | ||
59 | Unrestricted Restricted | ||
60 | MemTotal: 3091900 kB 3091900 kB | ||
61 | MemFree: 42113 kB 1513236 kB | ||
62 | |||
63 | This allows for coarse memory management for the tasks you assign to particular | ||
64 | cpusets. Since cpusets can form a hierarchy, you can create some pretty | ||
65 | interesting combinations of use-cases for various classes of tasks for your | ||
66 | memory management needs. | ||
diff --git a/Documentation/x86_64/machinecheck b/Documentation/x86_64/machinecheck index 068a6d9904b9..feaeaf6f6e4d 100644 --- a/Documentation/x86_64/machinecheck +++ b/Documentation/x86_64/machinecheck | |||
@@ -36,7 +36,12 @@ between all CPUs. | |||
36 | 36 | ||
37 | check_interval | 37 | check_interval |
38 | How often to poll for corrected machine check errors, in seconds | 38 | How often to poll for corrected machine check errors, in seconds |
39 | (Note output is hexademical). Default 5 minutes. | 39 | (Note output is hexademical). Default 5 minutes. When the poller |
40 | finds MCEs it triggers an exponential speedup (poll more often) on | ||
41 | the polling interval. When the poller stops finding MCEs, it | ||
42 | triggers an exponential backoff (poll less often) on the polling | ||
43 | interval. The check_interval variable is both the initial and | ||
44 | maximum polling interval. | ||
40 | 45 | ||
41 | tolerant | 46 | tolerant |
42 | Tolerance level. When a machine check exception occurs for a non | 47 | Tolerance level. When a machine check exception occurs for a non |