diff options
author | Patrick McHardy <kaber@trash.net> | 2010-04-20 10:02:01 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-04-20 10:02:01 -0400 |
commit | 62910554656cdcd6b6f84a5154c4155aae4ca231 (patch) | |
tree | dcf14004f6fd2ef7154362ff948bfeba0f3ea92d /Documentation | |
parent | 22265a5c3c103cf8c50be62e6c90d045eb649e6d (diff) | |
parent | ab9304717f7624c41927f442e6b6d418b2d8b3e4 (diff) |
Merge branch 'master' of /repos/git/net-next-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
net/ipv6/netfilter/ip6t_REJECT.c
net/netfilter/xt_limit.c
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'Documentation')
30 files changed, 1431 insertions, 144 deletions
diff --git a/Documentation/ABI/obsolete/sysfs-class-rfkill b/Documentation/ABI/obsolete/sysfs-class-rfkill new file mode 100644 index 000000000000..4201d5b05515 --- /dev/null +++ b/Documentation/ABI/obsolete/sysfs-class-rfkill | |||
@@ -0,0 +1,29 @@ | |||
1 | rfkill - radio frequency (RF) connector kill switch support | ||
2 | |||
3 | For details to this subsystem look at Documentation/rfkill.txt. | ||
4 | |||
5 | What: /sys/class/rfkill/rfkill[0-9]+/state | ||
6 | Date: 09-Jul-2007 | ||
7 | KernelVersion v2.6.22 | ||
8 | Contact: linux-wireless@vger.kernel.org | ||
9 | Description: Current state of the transmitter. | ||
10 | This file is deprecated and sheduled to be removed in 2014, | ||
11 | because its not possible to express the 'soft and hard block' | ||
12 | state of the rfkill driver. | ||
13 | Values: A numeric value. | ||
14 | 0: RFKILL_STATE_SOFT_BLOCKED | ||
15 | transmitter is turned off by software | ||
16 | 1: RFKILL_STATE_UNBLOCKED | ||
17 | transmitter is (potentially) active | ||
18 | 2: RFKILL_STATE_HARD_BLOCKED | ||
19 | transmitter is forced off by something outside of | ||
20 | the driver's control. | ||
21 | |||
22 | What: /sys/class/rfkill/rfkill[0-9]+/claim | ||
23 | Date: 09-Jul-2007 | ||
24 | KernelVersion v2.6.22 | ||
25 | Contact: linux-wireless@vger.kernel.org | ||
26 | Description: This file is deprecated because there no longer is a way to | ||
27 | claim just control over a single rfkill instance. | ||
28 | This file is scheduled to be removed in 2012. | ||
29 | Values: 0: Kernel handles events | ||
diff --git a/Documentation/ABI/stable/sysfs-class-rfkill b/Documentation/ABI/stable/sysfs-class-rfkill new file mode 100644 index 000000000000..097f522c33bb --- /dev/null +++ b/Documentation/ABI/stable/sysfs-class-rfkill | |||
@@ -0,0 +1,67 @@ | |||
1 | rfkill - radio frequency (RF) connector kill switch support | ||
2 | |||
3 | For details to this subsystem look at Documentation/rfkill.txt. | ||
4 | |||
5 | For the deprecated /sys/class/rfkill/*/state and | ||
6 | /sys/class/rfkill/*/claim knobs of this interface look in | ||
7 | Documentation/ABI/obsolete/sysfs-class-rfkill. | ||
8 | |||
9 | What: /sys/class/rfkill | ||
10 | Date: 09-Jul-2007 | ||
11 | KernelVersion: v2.6.22 | ||
12 | Contact: linux-wireless@vger.kernel.org, | ||
13 | Description: The rfkill class subsystem folder. | ||
14 | Each registered rfkill driver is represented by an rfkillX | ||
15 | subfolder (X being an integer > 0). | ||
16 | |||
17 | |||
18 | What: /sys/class/rfkill/rfkill[0-9]+/name | ||
19 | Date: 09-Jul-2007 | ||
20 | KernelVersion v2.6.22 | ||
21 | Contact: linux-wireless@vger.kernel.org | ||
22 | Description: Name assigned by driver to this key (interface or driver name). | ||
23 | Values: arbitrary string. | ||
24 | |||
25 | |||
26 | What: /sys/class/rfkill/rfkill[0-9]+/type | ||
27 | Date: 09-Jul-2007 | ||
28 | KernelVersion v2.6.22 | ||
29 | Contact: linux-wireless@vger.kernel.org | ||
30 | Description: Driver type string ("wlan", "bluetooth", etc). | ||
31 | Values: See include/linux/rfkill.h. | ||
32 | |||
33 | |||
34 | What: /sys/class/rfkill/rfkill[0-9]+/persistent | ||
35 | Date: 09-Jul-2007 | ||
36 | KernelVersion v2.6.22 | ||
37 | Contact: linux-wireless@vger.kernel.org | ||
38 | Description: Whether the soft blocked state is initialised from non-volatile | ||
39 | storage at startup. | ||
40 | Values: A numeric value. | ||
41 | 0: false | ||
42 | 1: true | ||
43 | |||
44 | |||
45 | What: /sys/class/rfkill/rfkill[0-9]+/hard | ||
46 | Date: 12-March-2010 | ||
47 | KernelVersion v2.6.34 | ||
48 | Contact: linux-wireless@vger.kernel.org | ||
49 | Description: Current hardblock state. This file is read only. | ||
50 | Values: A numeric value. | ||
51 | 0: inactive | ||
52 | The transmitter is (potentially) active. | ||
53 | 1: active | ||
54 | The transmitter is forced off by something outside of | ||
55 | the driver's control. | ||
56 | |||
57 | |||
58 | What: /sys/class/rfkill/rfkill[0-9]+/soft | ||
59 | Date: 12-March-2010 | ||
60 | KernelVersion v2.6.34 | ||
61 | Contact: linux-wireless@vger.kernel.org | ||
62 | Description: Current softblock state. This file is read and write. | ||
63 | Values: A numeric value. | ||
64 | 0: inactive | ||
65 | The transmitter is (potentially) active. | ||
66 | 1: active | ||
67 | The transmitter is turned off by software. | ||
diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index a986e9bbba3d..bcebb9eaedce 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb | |||
@@ -160,7 +160,7 @@ Description: | |||
160 | match the driver to the device. For example: | 160 | match the driver to the device. For example: |
161 | # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id | 161 | # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id |
162 | 162 | ||
163 | What: /sys/bus/usb/device/.../avoid_reset | 163 | What: /sys/bus/usb/device/.../avoid_reset_quirk |
164 | Date: December 2009 | 164 | Date: December 2009 |
165 | Contact: Oliver Neukum <oliver@neukum.org> | 165 | Contact: Oliver Neukum <oliver@neukum.org> |
166 | Description: | 166 | Description: |
diff --git a/Documentation/PCI/PCI-DMA-mapping.txt b/Documentation/DMA-API-HOWTO.txt index 52618ab069ad..52618ab069ad 100644 --- a/Documentation/PCI/PCI-DMA-mapping.txt +++ b/Documentation/DMA-API-HOWTO.txt | |||
diff --git a/Documentation/DocBook/tracepoint.tmpl b/Documentation/DocBook/tracepoint.tmpl index 8bca1d5cec09..e8473eae2a20 100644 --- a/Documentation/DocBook/tracepoint.tmpl +++ b/Documentation/DocBook/tracepoint.tmpl | |||
@@ -16,6 +16,15 @@ | |||
16 | </address> | 16 | </address> |
17 | </affiliation> | 17 | </affiliation> |
18 | </author> | 18 | </author> |
19 | <author> | ||
20 | <firstname>William</firstname> | ||
21 | <surname>Cohen</surname> | ||
22 | <affiliation> | ||
23 | <address> | ||
24 | <email>wcohen@redhat.com</email> | ||
25 | </address> | ||
26 | </affiliation> | ||
27 | </author> | ||
19 | </authorgroup> | 28 | </authorgroup> |
20 | 29 | ||
21 | <legalnotice> | 30 | <legalnotice> |
@@ -91,4 +100,8 @@ | |||
91 | !Iinclude/trace/events/signal.h | 100 | !Iinclude/trace/events/signal.h |
92 | </chapter> | 101 | </chapter> |
93 | 102 | ||
103 | <chapter id="block"> | ||
104 | <title>Block IO</title> | ||
105 | !Iinclude/trace/events/block.h | ||
106 | </chapter> | ||
94 | </book> | 107 | </book> |
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt index 6fab97ea7e6b..508b5b2b0289 100644 --- a/Documentation/block/biodoc.txt +++ b/Documentation/block/biodoc.txt | |||
@@ -1162,8 +1162,8 @@ where a driver received a request ala this before: | |||
1162 | 1162 | ||
1163 | As mentioned, there is no virtual mapping of a bio. For DMA, this is | 1163 | As mentioned, there is no virtual mapping of a bio. For DMA, this is |
1164 | not a problem as the driver probably never will need a virtual mapping. | 1164 | not a problem as the driver probably never will need a virtual mapping. |
1165 | Instead it needs a bus mapping (pci_map_page for a single segment or | 1165 | Instead it needs a bus mapping (dma_map_page for a single segment or |
1166 | use blk_rq_map_sg for scatter gather) to be able to ship it to the driver. For | 1166 | use dma_map_sg for scatter gather) to be able to ship it to the driver. For |
1167 | PIO drivers (or drivers that need to revert to PIO transfer once in a | 1167 | PIO drivers (or drivers that need to revert to PIO transfer once in a |
1168 | while (IDE for example)), where the CPU is doing the actual data | 1168 | while (IDE for example)), where the CPU is doing the actual data |
1169 | transfer a virtual mapping is needed. If the driver supports highmem I/O, | 1169 | transfer a virtual mapping is needed. If the driver supports highmem I/O, |
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index f8bc802d70b9..3a6aecd078ba 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -340,7 +340,7 @@ Note: | |||
340 | 5.3 swappiness | 340 | 5.3 swappiness |
341 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. | 341 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. |
342 | 342 | ||
343 | Following cgroups' swapiness can't be changed. | 343 | Following cgroups' swappiness can't be changed. |
344 | - root cgroup (uses /proc/sys/vm/swappiness). | 344 | - root cgroup (uses /proc/sys/vm/swappiness). |
345 | - a cgroup which uses hierarchy and it has child cgroup. | 345 | - a cgroup which uses hierarchy and it has child cgroup. |
346 | - a cgroup which uses hierarchy and not the root of hierarchy. | 346 | - a cgroup which uses hierarchy and not the root of hierarchy. |
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt new file mode 100644 index 000000000000..8117e5bf6065 --- /dev/null +++ b/Documentation/circular-buffers.txt | |||
@@ -0,0 +1,234 @@ | |||
1 | ================ | ||
2 | CIRCULAR BUFFERS | ||
3 | ================ | ||
4 | |||
5 | By: David Howells <dhowells@redhat.com> | ||
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
7 | |||
8 | |||
9 | Linux provides a number of features that can be used to implement circular | ||
10 | buffering. There are two sets of such features: | ||
11 | |||
12 | (1) Convenience functions for determining information about power-of-2 sized | ||
13 | buffers. | ||
14 | |||
15 | (2) Memory barriers for when the producer and the consumer of objects in the | ||
16 | buffer don't want to share a lock. | ||
17 | |||
18 | To use these facilities, as discussed below, there needs to be just one | ||
19 | producer and just one consumer. It is possible to handle multiple producers by | ||
20 | serialising them, and to handle multiple consumers by serialising them. | ||
21 | |||
22 | |||
23 | Contents: | ||
24 | |||
25 | (*) What is a circular buffer? | ||
26 | |||
27 | (*) Measuring power-of-2 buffers. | ||
28 | |||
29 | (*) Using memory barriers with circular buffers. | ||
30 | - The producer. | ||
31 | - The consumer. | ||
32 | |||
33 | |||
34 | ========================== | ||
35 | WHAT IS A CIRCULAR BUFFER? | ||
36 | ========================== | ||
37 | |||
38 | First of all, what is a circular buffer? A circular buffer is a buffer of | ||
39 | fixed, finite size into which there are two indices: | ||
40 | |||
41 | (1) A 'head' index - the point at which the producer inserts items into the | ||
42 | buffer. | ||
43 | |||
44 | (2) A 'tail' index - the point at which the consumer finds the next item in | ||
45 | the buffer. | ||
46 | |||
47 | Typically when the tail pointer is equal to the head pointer, the buffer is | ||
48 | empty; and the buffer is full when the head pointer is one less than the tail | ||
49 | pointer. | ||
50 | |||
51 | The head index is incremented when items are added, and the tail index when | ||
52 | items are removed. The tail index should never jump the head index, and both | ||
53 | indices should be wrapped to 0 when they reach the end of the buffer, thus | ||
54 | allowing an infinite amount of data to flow through the buffer. | ||
55 | |||
56 | Typically, items will all be of the same unit size, but this isn't strictly | ||
57 | required to use the techniques below. The indices can be increased by more | ||
58 | than 1 if multiple items or variable-sized items are to be included in the | ||
59 | buffer, provided that neither index overtakes the other. The implementer must | ||
60 | be careful, however, as a region more than one unit in size may wrap the end of | ||
61 | the buffer and be broken into two segments. | ||
62 | |||
63 | |||
64 | ============================ | ||
65 | MEASURING POWER-OF-2 BUFFERS | ||
66 | ============================ | ||
67 | |||
68 | Calculation of the occupancy or the remaining capacity of an arbitrarily sized | ||
69 | circular buffer would normally be a slow operation, requiring the use of a | ||
70 | modulus (divide) instruction. However, if the buffer is of a power-of-2 size, | ||
71 | then a much quicker bitwise-AND instruction can be used instead. | ||
72 | |||
73 | Linux provides a set of macros for handling power-of-2 circular buffers. These | ||
74 | can be made use of by: | ||
75 | |||
76 | #include <linux/circ_buf.h> | ||
77 | |||
78 | The macros are: | ||
79 | |||
80 | (*) Measure the remaining capacity of a buffer: | ||
81 | |||
82 | CIRC_SPACE(head_index, tail_index, buffer_size); | ||
83 | |||
84 | This returns the amount of space left in the buffer[1] into which items | ||
85 | can be inserted. | ||
86 | |||
87 | |||
88 | (*) Measure the maximum consecutive immediate space in a buffer: | ||
89 | |||
90 | CIRC_SPACE_TO_END(head_index, tail_index, buffer_size); | ||
91 | |||
92 | This returns the amount of consecutive space left in the buffer[1] into | ||
93 | which items can be immediately inserted without having to wrap back to the | ||
94 | beginning of the buffer. | ||
95 | |||
96 | |||
97 | (*) Measure the occupancy of a buffer: | ||
98 | |||
99 | CIRC_CNT(head_index, tail_index, buffer_size); | ||
100 | |||
101 | This returns the number of items currently occupying a buffer[2]. | ||
102 | |||
103 | |||
104 | (*) Measure the non-wrapping occupancy of a buffer: | ||
105 | |||
106 | CIRC_CNT_TO_END(head_index, tail_index, buffer_size); | ||
107 | |||
108 | This returns the number of consecutive items[2] that can be extracted from | ||
109 | the buffer without having to wrap back to the beginning of the buffer. | ||
110 | |||
111 | |||
112 | Each of these macros will nominally return a value between 0 and buffer_size-1, | ||
113 | however: | ||
114 | |||
115 | [1] CIRC_SPACE*() are intended to be used in the producer. To the producer | ||
116 | they will return a lower bound as the producer controls the head index, | ||
117 | but the consumer may still be depleting the buffer on another CPU and | ||
118 | moving the tail index. | ||
119 | |||
120 | To the consumer it will show an upper bound as the producer may be busy | ||
121 | depleting the space. | ||
122 | |||
123 | [2] CIRC_CNT*() are intended to be used in the consumer. To the consumer they | ||
124 | will return a lower bound as the consumer controls the tail index, but the | ||
125 | producer may still be filling the buffer on another CPU and moving the | ||
126 | head index. | ||
127 | |||
128 | To the producer it will show an upper bound as the consumer may be busy | ||
129 | emptying the buffer. | ||
130 | |||
131 | [3] To a third party, the order in which the writes to the indices by the | ||
132 | producer and consumer become visible cannot be guaranteed as they are | ||
133 | independent and may be made on different CPUs - so the result in such a | ||
134 | situation will merely be a guess, and may even be negative. | ||
135 | |||
136 | |||
137 | =========================================== | ||
138 | USING MEMORY BARRIERS WITH CIRCULAR BUFFERS | ||
139 | =========================================== | ||
140 | |||
141 | By using memory barriers in conjunction with circular buffers, you can avoid | ||
142 | the need to: | ||
143 | |||
144 | (1) use a single lock to govern access to both ends of the buffer, thus | ||
145 | allowing the buffer to be filled and emptied at the same time; and | ||
146 | |||
147 | (2) use atomic counter operations. | ||
148 | |||
149 | There are two sides to this: the producer that fills the buffer, and the | ||
150 | consumer that empties it. Only one thing should be filling a buffer at any one | ||
151 | time, and only one thing should be emptying a buffer at any one time, but the | ||
152 | two sides can operate simultaneously. | ||
153 | |||
154 | |||
155 | THE PRODUCER | ||
156 | ------------ | ||
157 | |||
158 | The producer will look something like this: | ||
159 | |||
160 | spin_lock(&producer_lock); | ||
161 | |||
162 | unsigned long head = buffer->head; | ||
163 | unsigned long tail = ACCESS_ONCE(buffer->tail); | ||
164 | |||
165 | if (CIRC_SPACE(head, tail, buffer->size) >= 1) { | ||
166 | /* insert one item into the buffer */ | ||
167 | struct item *item = buffer[head]; | ||
168 | |||
169 | produce_item(item); | ||
170 | |||
171 | smp_wmb(); /* commit the item before incrementing the head */ | ||
172 | |||
173 | buffer->head = (head + 1) & (buffer->size - 1); | ||
174 | |||
175 | /* wake_up() will make sure that the head is committed before | ||
176 | * waking anyone up */ | ||
177 | wake_up(consumer); | ||
178 | } | ||
179 | |||
180 | spin_unlock(&producer_lock); | ||
181 | |||
182 | This will instruct the CPU that the contents of the new item must be written | ||
183 | before the head index makes it available to the consumer and then instructs the | ||
184 | CPU that the revised head index must be written before the consumer is woken. | ||
185 | |||
186 | Note that wake_up() doesn't have to be the exact mechanism used, but whatever | ||
187 | is used must guarantee a (write) memory barrier between the update of the head | ||
188 | index and the change of state of the consumer, if a change of state occurs. | ||
189 | |||
190 | |||
191 | THE CONSUMER | ||
192 | ------------ | ||
193 | |||
194 | The consumer will look something like this: | ||
195 | |||
196 | spin_lock(&consumer_lock); | ||
197 | |||
198 | unsigned long head = ACCESS_ONCE(buffer->head); | ||
199 | unsigned long tail = buffer->tail; | ||
200 | |||
201 | if (CIRC_CNT(head, tail, buffer->size) >= 1) { | ||
202 | /* read index before reading contents at that index */ | ||
203 | smp_read_barrier_depends(); | ||
204 | |||
205 | /* extract one item from the buffer */ | ||
206 | struct item *item = buffer[tail]; | ||
207 | |||
208 | consume_item(item); | ||
209 | |||
210 | smp_mb(); /* finish reading descriptor before incrementing tail */ | ||
211 | |||
212 | buffer->tail = (tail + 1) & (buffer->size - 1); | ||
213 | } | ||
214 | |||
215 | spin_unlock(&consumer_lock); | ||
216 | |||
217 | This will instruct the CPU to make sure the index is up to date before reading | ||
218 | the new item, and then it shall make sure the CPU has finished reading the item | ||
219 | before it writes the new tail pointer, which will erase the item. | ||
220 | |||
221 | |||
222 | Note the use of ACCESS_ONCE() in both algorithms to read the opposition index. | ||
223 | This prevents the compiler from discarding and reloading its cached value - | ||
224 | which some compilers will do across smp_read_barrier_depends(). This isn't | ||
225 | strictly needed if you can be sure that the opposition index will _only_ be | ||
226 | used the once. | ||
227 | |||
228 | |||
229 | =============== | ||
230 | FURTHER READING | ||
231 | =============== | ||
232 | |||
233 | See also Documentation/memory-barriers.txt for a description of Linux's memory | ||
234 | barrier facilities. | ||
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c index b07add3467f1..7764594778d4 100644 --- a/Documentation/connector/cn_test.c +++ b/Documentation/connector/cn_test.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
27 | #include <linux/skbuff.h> | 27 | #include <linux/skbuff.h> |
28 | #include <linux/slab.h> | ||
28 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
29 | 30 | ||
30 | #include <linux/connector.h> | 31 | #include <linux/connector.h> |
diff --git a/Documentation/fb/imacfb.txt b/Documentation/fb/efifb.txt index 316ec9bb7deb..a59916c29b33 100644 --- a/Documentation/fb/imacfb.txt +++ b/Documentation/fb/efifb.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | What is imacfb? | 2 | What is efifb? |
3 | =============== | 3 | =============== |
4 | 4 | ||
5 | This is a generic EFI platform driver for Intel based Apple computers. | 5 | This is a generic EFI platform driver for Intel based Apple computers. |
6 | Imacfb is only for EFI booted Intel Macs. | 6 | efifb is only for EFI booted Intel Macs. |
7 | 7 | ||
8 | Supported Hardware | 8 | Supported Hardware |
9 | ================== | 9 | ================== |
@@ -16,16 +16,16 @@ MacMini | |||
16 | How to use it? | 16 | How to use it? |
17 | ============== | 17 | ============== |
18 | 18 | ||
19 | Imacfb does not have any kind of autodetection of your machine. | 19 | efifb does not have any kind of autodetection of your machine. |
20 | You have to add the following kernel parameters in your elilo.conf: | 20 | You have to add the following kernel parameters in your elilo.conf: |
21 | Macbook : | 21 | Macbook : |
22 | video=imacfb:macbook | 22 | video=efifb:macbook |
23 | MacMini : | 23 | MacMini : |
24 | video=imacfb:mini | 24 | video=efifb:mini |
25 | Macbook Pro 15", iMac 17" : | 25 | Macbook Pro 15", iMac 17" : |
26 | video=imacfb:i17 | 26 | video=efifb:i17 |
27 | Macbook Pro 17", iMac 20" : | 27 | Macbook Pro 17", iMac 20" : |
28 | video=imacfb:i20 | 28 | video=efifb:i20 |
29 | 29 | ||
30 | -- | 30 | -- |
31 | Edgar Hucek <gimli@dark-green.com> | 31 | Edgar Hucek <gimli@dark-green.com> |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index ea227e3f528b..a1c6e9277986 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -533,6 +533,24 @@ Who: Eric Miao <eric.y.miao@gmail.com> | |||
533 | 533 | ||
534 | ---------------------------- | 534 | ---------------------------- |
535 | 535 | ||
536 | What: sysfs-class-rfkill state file | ||
537 | When: Feb 2014 | ||
538 | Files: net/rfkill/core.c | ||
539 | Why: Documented as obsolete since Feb 2010. This file is limited to 3 | ||
540 | states while the rfkill drivers can have 4 states. | ||
541 | Who: anybody or Florian Mickler <florian@mickler.org> | ||
542 | |||
543 | ---------------------------- | ||
544 | |||
545 | What: sysfs-class-rfkill claim file | ||
546 | When: Feb 2012 | ||
547 | Files: net/rfkill/core.c | ||
548 | Why: It is not possible to claim an rfkill driver since 2007. This is | ||
549 | Documented as obsolete since Feb 2010. | ||
550 | Who: anybody or Florian Mickler <florian@mickler.org> | ||
551 | |||
552 | ---------------------------- | ||
553 | |||
536 | What: capifs | 554 | What: capifs |
537 | When: February 2011 | 555 | When: February 2011 |
538 | Files: drivers/isdn/capi/capifs.* | 556 | Files: drivers/isdn/capi/capifs.* |
@@ -580,6 +598,27 @@ Why: Useful in 2003, implementation is a hack. | |||
580 | Seen as doing more harm than good. | 598 | Seen as doing more harm than good. |
581 | Who: Len Brown <len.brown@intel.com> | 599 | Who: Len Brown <len.brown@intel.com> |
582 | 600 | ||
601 | ---------------------------- | ||
602 | |||
603 | What: iwlwifi 50XX module parameters | ||
604 | When: 2.6.40 | ||
605 | Why: The "..50" modules parameters were used to configure 5000 series and | ||
606 | up devices; different set of module parameters also available for 4965 | ||
607 | with same functionalities. Consolidate both set into single place | ||
608 | in drivers/net/wireless/iwlwifi/iwl-agn.c | ||
609 | |||
610 | Who: Wey-Yi Guy <wey-yi.w.guy@intel.com> | ||
611 | |||
612 | ---------------------------- | ||
613 | |||
614 | What: iwl4965 alias support | ||
615 | When: 2.6.40 | ||
616 | Why: Internal alias support has been present in module-init-tools for some | ||
617 | time, the MODULE_ALIAS("iwl4965") boilerplate aliases can be removed | ||
618 | with no impact. | ||
619 | |||
620 | Who: Wey-Yi Guy <wey-yi.w.guy@intel.com> | ||
621 | |||
583 | --------------------------- | 622 | --------------------------- |
584 | 623 | ||
585 | What: xt_NOTRACK | 624 | What: xt_NOTRACK |
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX index 3bae418c6ad3..4303614b5add 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX | |||
@@ -16,6 +16,8 @@ befs.txt | |||
16 | - information about the BeOS filesystem for Linux. | 16 | - information about the BeOS filesystem for Linux. |
17 | bfs.txt | 17 | bfs.txt |
18 | - info for the SCO UnixWare Boot Filesystem (BFS). | 18 | - info for the SCO UnixWare Boot Filesystem (BFS). |
19 | ceph.txt | ||
20 | - info for the Ceph Distributed File System | ||
19 | cifs.txt | 21 | cifs.txt |
20 | - description of the CIFS filesystem. | 22 | - description of the CIFS filesystem. |
21 | coda.txt | 23 | coda.txt |
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt index 57e0b80a5274..c0236e753bc8 100644 --- a/Documentation/filesystems/9p.txt +++ b/Documentation/filesystems/9p.txt | |||
@@ -37,6 +37,15 @@ For Plan 9 From User Space applications (http://swtch.com/plan9) | |||
37 | 37 | ||
38 | mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER | 38 | mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER |
39 | 39 | ||
40 | For server running on QEMU host with virtio transport: | ||
41 | |||
42 | mount -t 9p -o trans=virtio <mount_tag> /mnt/9 | ||
43 | |||
44 | where mount_tag is the tag associated by the server to each of the exported | ||
45 | mount points. Each 9P export is seen by the client as a virtio device with an | ||
46 | associated "mount_tag" property. Available mount tags can be | ||
47 | seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files. | ||
48 | |||
40 | OPTIONS | 49 | OPTIONS |
41 | ======= | 50 | ======= |
42 | 51 | ||
@@ -47,7 +56,7 @@ OPTIONS | |||
47 | fd - used passed file descriptors for connection | 56 | fd - used passed file descriptors for connection |
48 | (see rfdno and wfdno) | 57 | (see rfdno and wfdno) |
49 | virtio - connect to the next virtio channel available | 58 | virtio - connect to the next virtio channel available |
50 | (from lguest or KVM with trans_virtio module) | 59 | (from QEMU with trans_virtio module) |
51 | rdma - connect to a specified RDMA channel | 60 | rdma - connect to a specified RDMA channel |
52 | 61 | ||
53 | uname=name user name to attempt mount as on the remote server. The | 62 | uname=name user name to attempt mount as on the remote server. The |
@@ -85,7 +94,12 @@ OPTIONS | |||
85 | 94 | ||
86 | port=n port to connect to on the remote server | 95 | port=n port to connect to on the remote server |
87 | 96 | ||
88 | noextend force legacy mode (no 9p2000.u semantics) | 97 | noextend force legacy mode (no 9p2000.u or 9p2000.L semantics) |
98 | |||
99 | version=name Select 9P protocol version. Valid options are: | ||
100 | 9p2000 - Legacy mode (same as noextend) | ||
101 | 9p2000.u - Use 9P2000.u protocol | ||
102 | 9p2000.L - Use 9P2000.L protocol | ||
89 | 103 | ||
90 | dfltuid attempt to mount as a particular uid | 104 | dfltuid attempt to mount as a particular uid |
91 | 105 | ||
diff --git a/Documentation/filesystems/ceph.txt b/Documentation/filesystems/ceph.txt new file mode 100644 index 000000000000..0660c9f5deef --- /dev/null +++ b/Documentation/filesystems/ceph.txt | |||
@@ -0,0 +1,140 @@ | |||
1 | Ceph Distributed File System | ||
2 | ============================ | ||
3 | |||
4 | Ceph is a distributed network file system designed to provide good | ||
5 | performance, reliability, and scalability. | ||
6 | |||
7 | Basic features include: | ||
8 | |||
9 | * POSIX semantics | ||
10 | * Seamless scaling from 1 to many thousands of nodes | ||
11 | * High availability and reliability. No single point of failure. | ||
12 | * N-way replication of data across storage nodes | ||
13 | * Fast recovery from node failures | ||
14 | * Automatic rebalancing of data on node addition/removal | ||
15 | * Easy deployment: most FS components are userspace daemons | ||
16 | |||
17 | Also, | ||
18 | * Flexible snapshots (on any directory) | ||
19 | * Recursive accounting (nested files, directories, bytes) | ||
20 | |||
21 | In contrast to cluster filesystems like GFS, OCFS2, and GPFS that rely | ||
22 | on symmetric access by all clients to shared block devices, Ceph | ||
23 | separates data and metadata management into independent server | ||
24 | clusters, similar to Lustre. Unlike Lustre, however, metadata and | ||
25 | storage nodes run entirely as user space daemons. Storage nodes | ||
26 | utilize btrfs to store data objects, leveraging its advanced features | ||
27 | (checksumming, metadata replication, etc.). File data is striped | ||
28 | across storage nodes in large chunks to distribute workload and | ||
29 | facilitate high throughputs. When storage nodes fail, data is | ||
30 | re-replicated in a distributed fashion by the storage nodes themselves | ||
31 | (with some minimal coordination from a cluster monitor), making the | ||
32 | system extremely efficient and scalable. | ||
33 | |||
34 | Metadata servers effectively form a large, consistent, distributed | ||
35 | in-memory cache above the file namespace that is extremely scalable, | ||
36 | dynamically redistributes metadata in response to workload changes, | ||
37 | and can tolerate arbitrary (well, non-Byzantine) node failures. The | ||
38 | metadata server takes a somewhat unconventional approach to metadata | ||
39 | storage to significantly improve performance for common workloads. In | ||
40 | particular, inodes with only a single link are embedded in | ||
41 | directories, allowing entire directories of dentries and inodes to be | ||
42 | loaded into its cache with a single I/O operation. The contents of | ||
43 | extremely large directories can be fragmented and managed by | ||
44 | independent metadata servers, allowing scalable concurrent access. | ||
45 | |||
46 | The system offers automatic data rebalancing/migration when scaling | ||
47 | from a small cluster of just a few nodes to many hundreds, without | ||
48 | requiring an administrator carve the data set into static volumes or | ||
49 | go through the tedious process of migrating data between servers. | ||
50 | When the file system approaches full, new nodes can be easily added | ||
51 | and things will "just work." | ||
52 | |||
53 | Ceph includes flexible snapshot mechanism that allows a user to create | ||
54 | a snapshot on any subdirectory (and its nested contents) in the | ||
55 | system. Snapshot creation and deletion are as simple as 'mkdir | ||
56 | .snap/foo' and 'rmdir .snap/foo'. | ||
57 | |||
58 | Ceph also provides some recursive accounting on directories for nested | ||
59 | files and bytes. That is, a 'getfattr -d foo' on any directory in the | ||
60 | system will reveal the total number of nested regular files and | ||
61 | subdirectories, and a summation of all nested file sizes. This makes | ||
62 | the identification of large disk space consumers relatively quick, as | ||
63 | no 'du' or similar recursive scan of the file system is required. | ||
64 | |||
65 | |||
66 | Mount Syntax | ||
67 | ============ | ||
68 | |||
69 | The basic mount syntax is: | ||
70 | |||
71 | # mount -t ceph monip[:port][,monip2[:port]...]:/[subdir] mnt | ||
72 | |||
73 | You only need to specify a single monitor, as the client will get the | ||
74 | full list when it connects. (However, if the monitor you specify | ||
75 | happens to be down, the mount won't succeed.) The port can be left | ||
76 | off if the monitor is using the default. So if the monitor is at | ||
77 | 1.2.3.4, | ||
78 | |||
79 | # mount -t ceph 1.2.3.4:/ /mnt/ceph | ||
80 | |||
81 | is sufficient. If /sbin/mount.ceph is installed, a hostname can be | ||
82 | used instead of an IP address. | ||
83 | |||
84 | |||
85 | |||
86 | Mount Options | ||
87 | ============= | ||
88 | |||
89 | ip=A.B.C.D[:N] | ||
90 | Specify the IP and/or port the client should bind to locally. | ||
91 | There is normally not much reason to do this. If the IP is not | ||
92 | specified, the client's IP address is determined by looking at the | ||
93 | address it's connection to the monitor originates from. | ||
94 | |||
95 | wsize=X | ||
96 | Specify the maximum write size in bytes. By default there is no | ||
97 | maximum. Ceph will normally size writes based on the file stripe | ||
98 | size. | ||
99 | |||
100 | rsize=X | ||
101 | Specify the maximum readahead. | ||
102 | |||
103 | mount_timeout=X | ||
104 | Specify the timeout value for mount (in seconds), in the case | ||
105 | of a non-responsive Ceph file system. The default is 30 | ||
106 | seconds. | ||
107 | |||
108 | rbytes | ||
109 | When stat() is called on a directory, set st_size to 'rbytes', | ||
110 | the summation of file sizes over all files nested beneath that | ||
111 | directory. This is the default. | ||
112 | |||
113 | norbytes | ||
114 | When stat() is called on a directory, set st_size to the | ||
115 | number of entries in that directory. | ||
116 | |||
117 | nocrc | ||
118 | Disable CRC32C calculation for data writes. If set, the storage node | ||
119 | must rely on TCP's error correction to detect data corruption | ||
120 | in the data payload. | ||
121 | |||
122 | noasyncreaddir | ||
123 | Disable client's use its local cache to satisfy readdir | ||
124 | requests. (This does not change correctness; the client uses | ||
125 | cached metadata only when a lease or capability ensures it is | ||
126 | valid.) | ||
127 | |||
128 | |||
129 | More Information | ||
130 | ================ | ||
131 | |||
132 | For more information on Ceph, see the home page at | ||
133 | http://ceph.newdream.net/ | ||
134 | |||
135 | The Linux kernel client source tree is available at | ||
136 | git://ceph.newdream.net/git/ceph-client.git | ||
137 | git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git | ||
138 | |||
139 | and the source for the full system is at | ||
140 | git://ceph.newdream.net/git/ceph.git | ||
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt index 3015da0c6b2a..fe09a2cb1858 100644 --- a/Documentation/filesystems/tmpfs.txt +++ b/Documentation/filesystems/tmpfs.txt | |||
@@ -82,11 +82,13 @@ tmpfs has a mount option to set the NUMA memory allocation policy for | |||
82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be | 82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be |
83 | adjusted on the fly via 'mount -o remount ...' | 83 | adjusted on the fly via 'mount -o remount ...' |
84 | 84 | ||
85 | mpol=default prefers to allocate memory from the local node | 85 | mpol=default use the process allocation policy |
86 | (see set_mempolicy(2)) | ||
86 | mpol=prefer:Node prefers to allocate memory from the given Node | 87 | mpol=prefer:Node prefers to allocate memory from the given Node |
87 | mpol=bind:NodeList allocates memory only from nodes in NodeList | 88 | mpol=bind:NodeList allocates memory only from nodes in NodeList |
88 | mpol=interleave prefers to allocate from each node in turn | 89 | mpol=interleave prefers to allocate from each node in turn |
89 | mpol=interleave:NodeList allocates from each node of NodeList in turn | 90 | mpol=interleave:NodeList allocates from each node of NodeList in turn |
91 | mpol=local prefers to allocate memory from the local node | ||
90 | 92 | ||
91 | NodeList format is a comma-separated list of decimal numbers and ranges, | 93 | NodeList format is a comma-separated list of decimal numbers and ranges, |
92 | a range being two hyphen-separated decimal numbers, the smallest and | 94 | a range being two hyphen-separated decimal numbers, the smallest and |
@@ -134,3 +136,5 @@ Author: | |||
134 | Christoph Rohland <cr@sap.com>, 1.12.01 | 136 | Christoph Rohland <cr@sap.com>, 1.12.01 |
135 | Updated: | 137 | Updated: |
136 | Hugh Dickins, 4 June 2007 | 138 | Hugh Dickins, 4 June 2007 |
139 | Updated: | ||
140 | KOSAKI Motohiro, 16 Mar 2010 | ||
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index 35c9b51d20ea..dd5806f4fcc4 100644 --- a/Documentation/ioctl/ioctl-number.txt +++ b/Documentation/ioctl/ioctl-number.txt | |||
@@ -291,6 +291,7 @@ Code Seq#(hex) Include File Comments | |||
291 | 0x92 00-0F drivers/usb/mon/mon_bin.c | 291 | 0x92 00-0F drivers/usb/mon/mon_bin.c |
292 | 0x93 60-7F linux/auto_fs.h | 292 | 0x93 60-7F linux/auto_fs.h |
293 | 0x94 all fs/btrfs/ioctl.h | 293 | 0x94 all fs/btrfs/ioctl.h |
294 | 0x97 00-7F fs/ceph/ioctl.h Ceph file system | ||
294 | 0x99 00-0F 537-Addinboard driver | 295 | 0x99 00-0F 537-Addinboard driver |
295 | <mailto:buk@buks.ipn.de> | 296 | <mailto:buk@buks.ipn.de> |
296 | 0xA0 all linux/sdp/sdp.h Industrial Device Project | 297 | 0xA0 all linux/sdp/sdp.h Industrial Device Project |
diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt index bdb13817e1e9..3ab2472509cb 100644 --- a/Documentation/kobject.txt +++ b/Documentation/kobject.txt | |||
@@ -59,37 +59,56 @@ nice to have in other objects. The C language does not allow for the | |||
59 | direct expression of inheritance, so other techniques - such as structure | 59 | direct expression of inheritance, so other techniques - such as structure |
60 | embedding - must be used. | 60 | embedding - must be used. |
61 | 61 | ||
62 | So, for example, the UIO code has a structure that defines the memory | 62 | (As an aside, for those familiar with the kernel linked list implementation, |
63 | region associated with a uio device: | 63 | this is analogous as to how "list_head" structs are rarely useful on |
64 | their own, but are invariably found embedded in the larger objects of | ||
65 | interest.) | ||
64 | 66 | ||
65 | struct uio_mem { | 67 | So, for example, the UIO code in drivers/uio/uio.c has a structure that |
68 | defines the memory region associated with a uio device: | ||
69 | |||
70 | struct uio_map { | ||
66 | struct kobject kobj; | 71 | struct kobject kobj; |
67 | unsigned long addr; | 72 | struct uio_mem *mem; |
68 | unsigned long size; | 73 | }; |
69 | int memtype; | ||
70 | void __iomem *internal_addr; | ||
71 | }; | ||
72 | 74 | ||
73 | If you have a struct uio_mem structure, finding its embedded kobject is | 75 | If you have a struct uio_map structure, finding its embedded kobject is |
74 | just a matter of using the kobj member. Code that works with kobjects will | 76 | just a matter of using the kobj member. Code that works with kobjects will |
75 | often have the opposite problem, however: given a struct kobject pointer, | 77 | often have the opposite problem, however: given a struct kobject pointer, |
76 | what is the pointer to the containing structure? You must avoid tricks | 78 | what is the pointer to the containing structure? You must avoid tricks |
77 | (such as assuming that the kobject is at the beginning of the structure) | 79 | (such as assuming that the kobject is at the beginning of the structure) |
78 | and, instead, use the container_of() macro, found in <linux/kernel.h>: | 80 | and, instead, use the container_of() macro, found in <linux/kernel.h>: |
79 | 81 | ||
80 | container_of(pointer, type, member) | 82 | container_of(pointer, type, member) |
83 | |||
84 | where: | ||
85 | |||
86 | * "pointer" is the pointer to the embedded kobject, | ||
87 | * "type" is the type of the containing structure, and | ||
88 | * "member" is the name of the structure field to which "pointer" points. | ||
89 | |||
90 | The return value from container_of() is a pointer to the corresponding | ||
91 | container type. So, for example, a pointer "kp" to a struct kobject | ||
92 | embedded *within* a struct uio_map could be converted to a pointer to the | ||
93 | *containing* uio_map structure with: | ||
94 | |||
95 | struct uio_map *u_map = container_of(kp, struct uio_map, kobj); | ||
96 | |||
97 | For convenience, programmers often define a simple macro for "back-casting" | ||
98 | kobject pointers to the containing type. Exactly this happens in the | ||
99 | earlier drivers/uio/uio.c, as you can see here: | ||
100 | |||
101 | struct uio_map { | ||
102 | struct kobject kobj; | ||
103 | struct uio_mem *mem; | ||
104 | }; | ||
81 | 105 | ||
82 | where pointer is the pointer to the embedded kobject, type is the type of | 106 | #define to_map(map) container_of(map, struct uio_map, kobj) |
83 | the containing structure, and member is the name of the structure field to | ||
84 | which pointer points. The return value from container_of() is a pointer to | ||
85 | the given type. So, for example, a pointer "kp" to a struct kobject | ||
86 | embedded within a struct uio_mem could be converted to a pointer to the | ||
87 | containing uio_mem structure with: | ||
88 | 107 | ||
89 | struct uio_mem *u_mem = container_of(kp, struct uio_mem, kobj); | 108 | where the macro argument "map" is a pointer to the struct kobject in |
109 | question. That macro is subsequently invoked with: | ||
90 | 110 | ||
91 | Programmers often define a simple macro for "back-casting" kobject pointers | 111 | struct uio_map *map = to_map(kobj); |
92 | to the containing type. | ||
93 | 112 | ||
94 | 113 | ||
95 | Initialization of kobjects | 114 | Initialization of kobjects |
@@ -387,4 +406,5 @@ called, and the objects in the former circle release each other. | |||
387 | Example code to copy from | 406 | Example code to copy from |
388 | 407 | ||
389 | For a more complete example of using ksets and kobjects properly, see the | 408 | For a more complete example of using ksets and kobjects properly, see the |
390 | sample/kobject/kset-example.c code. | 409 | example programs samples/kobject/{kobject-example.c,kset-example.c}, |
410 | which will be built as loadable modules if you select CONFIG_SAMPLE_KOBJECT. | ||
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 7f5809eddee6..631ad2f1b229 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -3,6 +3,7 @@ | |||
3 | ============================ | 3 | ============================ |
4 | 4 | ||
5 | By: David Howells <dhowells@redhat.com> | 5 | By: David Howells <dhowells@redhat.com> |
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
6 | 7 | ||
7 | Contents: | 8 | Contents: |
8 | 9 | ||
@@ -60,6 +61,10 @@ Contents: | |||
60 | 61 | ||
61 | - And then there's the Alpha. | 62 | - And then there's the Alpha. |
62 | 63 | ||
64 | (*) Example uses. | ||
65 | |||
66 | - Circular buffers. | ||
67 | |||
63 | (*) References. | 68 | (*) References. |
64 | 69 | ||
65 | 70 | ||
@@ -2226,6 +2231,21 @@ The Alpha defines the Linux kernel's memory barrier model. | |||
2226 | See the subsection on "Cache Coherency" above. | 2231 | See the subsection on "Cache Coherency" above. |
2227 | 2232 | ||
2228 | 2233 | ||
2234 | ============ | ||
2235 | EXAMPLE USES | ||
2236 | ============ | ||
2237 | |||
2238 | CIRCULAR BUFFERS | ||
2239 | ---------------- | ||
2240 | |||
2241 | Memory barriers can be used to implement circular buffering without the need | ||
2242 | of a lock to serialise the producer with the consumer. See: | ||
2243 | |||
2244 | Documentation/circular-buffers.txt | ||
2245 | |||
2246 | for details. | ||
2247 | |||
2248 | |||
2229 | ========== | 2249 | ========== |
2230 | REFERENCES | 2250 | REFERENCES |
2231 | ========== | 2251 | ========== |
diff --git a/Documentation/networking/caif/Linux-CAIF.txt b/Documentation/networking/caif/Linux-CAIF.txt new file mode 100644 index 000000000000..7fe7a9a33a4f --- /dev/null +++ b/Documentation/networking/caif/Linux-CAIF.txt | |||
@@ -0,0 +1,212 @@ | |||
1 | Linux CAIF | ||
2 | =========== | ||
3 | copyright (C) ST-Ericsson AB 2010 | ||
4 | Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
5 | License terms: GNU General Public License (GPL) version 2 | ||
6 | |||
7 | |||
8 | Introduction | ||
9 | ------------ | ||
10 | CAIF is a MUX protocol used by ST-Ericsson cellular modems for | ||
11 | communication between Modem and host. The host processes can open virtual AT | ||
12 | channels, initiate GPRS Data connections, Video channels and Utility Channels. | ||
13 | The Utility Channels are general purpose pipes between modem and host. | ||
14 | |||
15 | ST-Ericsson modems support a number of transports between modem | ||
16 | and host. Currently, UART and Loopback are available for Linux. | ||
17 | |||
18 | |||
19 | Architecture: | ||
20 | ------------ | ||
21 | The implementation of CAIF is divided into: | ||
22 | * CAIF Socket Layer, Kernel API, and Net Device. | ||
23 | * CAIF Core Protocol Implementation | ||
24 | * CAIF Link Layer, implemented as NET devices. | ||
25 | |||
26 | |||
27 | RTNL | ||
28 | ! | ||
29 | ! +------+ +------+ +------+ | ||
30 | ! +------+! +------+! +------+! | ||
31 | ! ! Sock !! !Kernel!! ! Net !! | ||
32 | ! ! API !+ ! API !+ ! Dev !+ <- CAIF Client APIs | ||
33 | ! +------+ +------! +------+ | ||
34 | ! ! ! ! | ||
35 | ! +----------!----------+ | ||
36 | ! +------+ <- CAIF Protocol Implementation | ||
37 | +-------> ! CAIF ! | ||
38 | ! Core ! | ||
39 | +------+ | ||
40 | +--------!--------+ | ||
41 | ! ! | ||
42 | +------+ +-----+ | ||
43 | ! ! ! TTY ! <- Link Layer (Net Devices) | ||
44 | +------+ +-----+ | ||
45 | |||
46 | |||
47 | Using the Kernel API | ||
48 | ---------------------- | ||
49 | The Kernel API is used for accessing CAIF channels from the | ||
50 | kernel. | ||
51 | The user of the API has to implement two callbacks for receive | ||
52 | and control. | ||
53 | The receive callback gives a CAIF packet as a SKB. The control | ||
54 | callback will | ||
55 | notify of channel initialization complete, and flow-on/flow- | ||
56 | off. | ||
57 | |||
58 | |||
59 | struct caif_device caif_dev = { | ||
60 | .caif_config = { | ||
61 | .name = "MYDEV" | ||
62 | .type = CAIF_CHTY_AT | ||
63 | } | ||
64 | .receive_cb = my_receive, | ||
65 | .control_cb = my_control, | ||
66 | }; | ||
67 | caif_add_device(&caif_dev); | ||
68 | caif_transmit(&caif_dev, skb); | ||
69 | |||
70 | See the caif_kernel.h for details about the CAIF kernel API. | ||
71 | |||
72 | |||
73 | I M P L E M E N T A T I O N | ||
74 | =========================== | ||
75 | =========================== | ||
76 | |||
77 | CAIF Core Protocol Layer | ||
78 | ========================================= | ||
79 | |||
80 | CAIF Core layer implements the CAIF protocol as defined by ST-Ericsson. | ||
81 | It implements the CAIF protocol stack in a layered approach, where | ||
82 | each layer described in the specification is implemented as a separate layer. | ||
83 | The architecture is inspired by the design patterns "Protocol Layer" and | ||
84 | "Protocol Packet". | ||
85 | |||
86 | == CAIF structure == | ||
87 | The Core CAIF implementation contains: | ||
88 | - Simple implementation of CAIF. | ||
89 | - Layered architecture (a la Streams), each layer in the CAIF | ||
90 | specification is implemented in a separate c-file. | ||
91 | - Clients must implement PHY layer to access physical HW | ||
92 | with receive and transmit functions. | ||
93 | - Clients must call configuration function to add PHY layer. | ||
94 | - Clients must implement CAIF layer to consume/produce | ||
95 | CAIF payload with receive and transmit functions. | ||
96 | - Clients must call configuration function to add and connect the | ||
97 | Client layer. | ||
98 | - When receiving / transmitting CAIF Packets (cfpkt), ownership is passed | ||
99 | to the called function (except for framing layers' receive functions | ||
100 | or if a transmit function returns an error, in which case the caller | ||
101 | must free the packet). | ||
102 | |||
103 | Layered Architecture | ||
104 | -------------------- | ||
105 | The CAIF protocol can be divided into two parts: Support functions and Protocol | ||
106 | Implementation. The support functions include: | ||
107 | |||
108 | - CFPKT CAIF Packet. Implementation of CAIF Protocol Packet. The | ||
109 | CAIF Packet has functions for creating, destroying and adding content | ||
110 | and for adding/extracting header and trailers to protocol packets. | ||
111 | |||
112 | - CFLST CAIF list implementation. | ||
113 | |||
114 | - CFGLUE CAIF Glue. Contains OS Specifics, such as memory | ||
115 | allocation, endianness, etc. | ||
116 | |||
117 | The CAIF Protocol implementation contains: | ||
118 | |||
119 | - CFCNFG CAIF Configuration layer. Configures the CAIF Protocol | ||
120 | Stack and provides a Client interface for adding Link-Layer and | ||
121 | Driver interfaces on top of the CAIF Stack. | ||
122 | |||
123 | - CFCTRL CAIF Control layer. Encodes and Decodes control messages | ||
124 | such as enumeration and channel setup. Also matches request and | ||
125 | response messages. | ||
126 | |||
127 | - CFSERVL General CAIF Service Layer functionality; handles flow | ||
128 | control and remote shutdown requests. | ||
129 | |||
130 | - CFVEI CAIF VEI layer. Handles CAIF AT Channels on VEI (Virtual | ||
131 | External Interface). This layer encodes/decodes VEI frames. | ||
132 | |||
133 | - CFDGML CAIF Datagram layer. Handles CAIF Datagram layer (IP | ||
134 | traffic), encodes/decodes Datagram frames. | ||
135 | |||
136 | - CFMUX CAIF Mux layer. Handles multiplexing between multiple | ||
137 | physical bearers and multiple channels such as VEI, Datagram, etc. | ||
138 | The MUX keeps track of the existing CAIF Channels and | ||
139 | Physical Instances and selects the apropriate instance based | ||
140 | on Channel-Id and Physical-ID. | ||
141 | |||
142 | - CFFRML CAIF Framing layer. Handles Framing i.e. Frame length | ||
143 | and frame checksum. | ||
144 | |||
145 | - CFSERL CAIF Serial layer. Handles concatenation/split of frames | ||
146 | into CAIF Frames with correct length. | ||
147 | |||
148 | |||
149 | |||
150 | +---------+ | ||
151 | | Config | | ||
152 | | CFCNFG | | ||
153 | +---------+ | ||
154 | ! | ||
155 | +---------+ +---------+ +---------+ | ||
156 | | AT | | Control | | Datagram| | ||
157 | | CFVEIL | | CFCTRL | | CFDGML | | ||
158 | +---------+ +---------+ +---------+ | ||
159 | \_____________!______________/ | ||
160 | ! | ||
161 | +---------+ | ||
162 | | MUX | | ||
163 | | | | ||
164 | +---------+ | ||
165 | _____!_____ | ||
166 | / \ | ||
167 | +---------+ +---------+ | ||
168 | | CFFRML | | CFFRML | | ||
169 | | Framing | | Framing | | ||
170 | +---------+ +---------+ | ||
171 | ! ! | ||
172 | +---------+ +---------+ | ||
173 | | | | Serial | | ||
174 | | | | CFSERL | | ||
175 | +---------+ +---------+ | ||
176 | |||
177 | |||
178 | In this layered approach the following "rules" apply. | ||
179 | - All layers embed the same structure "struct cflayer" | ||
180 | - A layer does not depend on any other layer's private data. | ||
181 | - Layers are stacked by setting the pointers | ||
182 | layer->up , layer->dn | ||
183 | - In order to send data upwards, each layer should do | ||
184 | layer->up->receive(layer->up, packet); | ||
185 | - In order to send data downwards, each layer should do | ||
186 | layer->dn->transmit(layer->dn, packet); | ||
187 | |||
188 | |||
189 | Linux Driver Implementation | ||
190 | =========================== | ||
191 | |||
192 | Linux GPRS Net Device and CAIF socket are implemented on top of the | ||
193 | CAIF Core protocol. The Net device and CAIF socket have an instance of | ||
194 | 'struct cflayer', just like the CAIF Core protocol stack. | ||
195 | Net device and Socket implement the 'receive()' function defined by | ||
196 | 'struct cflayer', just like the rest of the CAIF stack. In this way, transmit and | ||
197 | receive of packets is handled as by the rest of the layers: the 'dn->transmit()' | ||
198 | function is called in order to transmit data. | ||
199 | |||
200 | The layer on top of the CAIF Core implementation is | ||
201 | sometimes referred to as the "Client layer". | ||
202 | |||
203 | |||
204 | Configuration of Link Layer | ||
205 | --------------------------- | ||
206 | The Link Layer is implemented as Linux net devices (struct net_device). | ||
207 | Payload handling and registration is done using standard Linux mechanisms. | ||
208 | |||
209 | The CAIF Protocol relies on a loss-less link layer without implementing | ||
210 | retransmission. This implies that packet drops must not happen. | ||
211 | Therefore a flow-control mechanism is implemented where the physical | ||
212 | interface can initiate flow stop for all CAIF Channels. | ||
diff --git a/Documentation/networking/caif/README b/Documentation/networking/caif/README new file mode 100644 index 000000000000..757ccfaa1385 --- /dev/null +++ b/Documentation/networking/caif/README | |||
@@ -0,0 +1,109 @@ | |||
1 | Copyright (C) ST-Ericsson AB 2010 | ||
2 | Author: Sjur Brendeland/ sjur.brandeland@stericsson.com | ||
3 | License terms: GNU General Public License (GPL) version 2 | ||
4 | --------------------------------------------------------- | ||
5 | |||
6 | === Start === | ||
7 | If you have compiled CAIF for modules do: | ||
8 | |||
9 | $modprobe crc_ccitt | ||
10 | $modprobe caif | ||
11 | $modprobe caif_socket | ||
12 | $modprobe chnl_net | ||
13 | |||
14 | |||
15 | === Preparing the setup with a STE modem === | ||
16 | |||
17 | If you are working on integration of CAIF you should make sure | ||
18 | that the kernel is built with module support. | ||
19 | |||
20 | There are some things that need to be tweaked to get the host TTY correctly | ||
21 | set up to talk to the modem. | ||
22 | Since the CAIF stack is running in the kernel and we want to use the existing | ||
23 | TTY, we are installing our physical serial driver as a line discipline above | ||
24 | the TTY device. | ||
25 | |||
26 | To achieve this we need to install the N_CAIF ldisc from user space. | ||
27 | The benefit is that we can hook up to any TTY. | ||
28 | |||
29 | The use of Start-of-frame-extension (STX) must also be set as | ||
30 | module parameter "ser_use_stx". | ||
31 | |||
32 | Normally Frame Checksum is always used on UART, but this is also provided as a | ||
33 | module parameter "ser_use_fcs". | ||
34 | |||
35 | $ modprobe caif_serial ser_ttyname=/dev/ttyS0 ser_use_stx=yes | ||
36 | $ ifconfig caif_ttyS0 up | ||
37 | |||
38 | PLEASE NOTE: There is a limitation in Android shell. | ||
39 | It only accepts one argument to insmod/modprobe! | ||
40 | |||
41 | === Trouble shooting === | ||
42 | |||
43 | There are debugfs parameters provided for serial communication. | ||
44 | /sys/kernel/debug/caif_serial/<tty-name>/ | ||
45 | |||
46 | * ser_state: Prints the bit-mask status where | ||
47 | - 0x02 means SENDING, this is a transient state. | ||
48 | - 0x10 means FLOW_OFF_SENT, i.e. the previous frame has not been sent | ||
49 | and is blocking further send operation. Flow OFF has been propagated | ||
50 | to all CAIF Channels using this TTY. | ||
51 | |||
52 | * tty_status: Prints the bit-mask tty status information | ||
53 | - 0x01 - tty->warned is on. | ||
54 | - 0x02 - tty->low_latency is on. | ||
55 | - 0x04 - tty->packed is on. | ||
56 | - 0x08 - tty->flow_stopped is on. | ||
57 | - 0x10 - tty->hw_stopped is on. | ||
58 | - 0x20 - tty->stopped is on. | ||
59 | |||
60 | * last_tx_msg: Binary blob Prints the last transmitted frame. | ||
61 | This can be printed with | ||
62 | $od --format=x1 /sys/kernel/debug/caif_serial/<tty>/last_rx_msg. | ||
63 | The first two tx messages sent look like this. Note: The initial | ||
64 | byte 02 is start of frame extension (STX) used for re-syncing | ||
65 | upon errors. | ||
66 | |||
67 | - Enumeration: | ||
68 | 0000000 02 05 00 00 03 01 d2 02 | ||
69 | | | | | | | | ||
70 | STX(1) | | | | | ||
71 | Length(2)| | | | ||
72 | Control Channel(1) | ||
73 | Command:Enumeration(1) | ||
74 | Link-ID(1) | ||
75 | Checksum(2) | ||
76 | - Channel Setup: | ||
77 | 0000000 02 07 00 00 00 21 a1 00 48 df | ||
78 | | | | | | | | | | ||
79 | STX(1) | | | | | | | ||
80 | Length(2)| | | | | | ||
81 | Control Channel(1) | ||
82 | Command:Channel Setup(1) | ||
83 | Channel Type(1) | ||
84 | Priority and Link-ID(1) | ||
85 | Endpoint(1) | ||
86 | Checksum(2) | ||
87 | |||
88 | * last_rx_msg: Prints the last transmitted frame. | ||
89 | The RX messages for LinkSetup look almost identical but they have the | ||
90 | bit 0x20 set in the command bit, and Channel Setup has added one byte | ||
91 | before Checksum containing Channel ID. | ||
92 | NOTE: Several CAIF Messages might be concatenated. The maximum debug | ||
93 | buffer size is 128 bytes. | ||
94 | |||
95 | == Error Scenarios: | ||
96 | - last_tx_msg contains channel setup message and last_rx_msg is empty -> | ||
97 | The host seems to be able to send over the UART, at least the CAIF ldisc get | ||
98 | notified that sending is completed. | ||
99 | |||
100 | - last_tx_msg contains enumeration message and last_rx_msg is empty -> | ||
101 | The host is not able to send the message from UART, the tty has not been | ||
102 | able to complete the transmit operation. | ||
103 | |||
104 | - if /sys/kernel/debug/caif_serial/<tty>/tty_status is non-zero there | ||
105 | might be problems transmitting over UART. | ||
106 | E.g. host and modem wiring is not correct you will typically see | ||
107 | tty_status = 0x10 (hw_stopped) and ser_state = 0x10 (FLOW_OFF_SENT). | ||
108 | You will probably see the enumeration message in last_tx_message | ||
109 | and empty last_rx_message. | ||
diff --git a/Documentation/networking/l2tp.txt b/Documentation/networking/l2tp.txt index 63214b280e00..e7bf3979facb 100644 --- a/Documentation/networking/l2tp.txt +++ b/Documentation/networking/l2tp.txt | |||
@@ -1,44 +1,95 @@ | |||
1 | This brief document describes how to use the kernel's PPPoL2TP driver | 1 | This document describes how to use the kernel's L2TP drivers to |
2 | to provide L2TP functionality. L2TP is a protocol that tunnels one or | 2 | provide L2TP functionality. L2TP is a protocol that tunnels one or |
3 | more PPP sessions over a UDP tunnel. It is commonly used for VPNs | 3 | more sessions over an IP tunnel. It is commonly used for VPNs |
4 | (L2TP/IPSec) and by ISPs to tunnel subscriber PPP sessions over an IP | 4 | (L2TP/IPSec) and by ISPs to tunnel subscriber PPP sessions over an IP |
5 | network infrastructure. | 5 | network infrastructure. With L2TPv3, it is also useful as a Layer-2 |
6 | tunneling infrastructure. | ||
7 | |||
8 | Features | ||
9 | ======== | ||
10 | |||
11 | L2TPv2 (PPP over L2TP (UDP tunnels)). | ||
12 | L2TPv3 ethernet pseudowires. | ||
13 | L2TPv3 PPP pseudowires. | ||
14 | L2TPv3 IP encapsulation. | ||
15 | Netlink sockets for L2TPv3 configuration management. | ||
16 | |||
17 | History | ||
18 | ======= | ||
19 | |||
20 | The original pppol2tp driver was introduced in 2.6.23 and provided | ||
21 | L2TPv2 functionality (rfc2661). L2TPv2 is used to tunnel one or more PPP | ||
22 | sessions over a UDP tunnel. | ||
23 | |||
24 | L2TPv3 (rfc3931) changes the protocol to allow different frame types | ||
25 | to be passed over an L2TP tunnel by moving the PPP-specific parts of | ||
26 | the protocol out of the core L2TP packet headers. Each frame type is | ||
27 | known as a pseudowire type. Ethernet, PPP, HDLC, Frame Relay and ATM | ||
28 | pseudowires for L2TP are defined in separate RFC standards. Another | ||
29 | change for L2TPv3 is that it can be carried directly over IP with no | ||
30 | UDP header (UDP is optional). It is also possible to create static | ||
31 | unmanaged L2TPv3 tunnels manually without a control protocol | ||
32 | (userspace daemon) to manage them. | ||
33 | |||
34 | To support L2TPv3, the original pppol2tp driver was split up to | ||
35 | separate the L2TP and PPP functionality. Existing L2TPv2 userspace | ||
36 | apps should be unaffected as the original pppol2tp sockets API is | ||
37 | retained. L2TPv3, however, uses netlink to manage L2TPv3 tunnels and | ||
38 | sessions. | ||
6 | 39 | ||
7 | Design | 40 | Design |
8 | ====== | 41 | ====== |
9 | 42 | ||
10 | The PPPoL2TP driver, drivers/net/pppol2tp.c, provides a mechanism by | 43 | The L2TP protocol separates control and data frames. The L2TP kernel |
11 | which PPP frames carried through an L2TP session are passed through | 44 | drivers handle only L2TP data frames; control frames are always |
12 | the kernel's PPP subsystem. The standard PPP daemon, pppd, handles all | 45 | handled by userspace. L2TP control frames carry messages between L2TP |
13 | PPP interaction with the peer. PPP network interfaces are created for | 46 | clients/servers and are used to setup / teardown tunnels and |
14 | each local PPP endpoint. | 47 | sessions. An L2TP client or server is implemented in userspace. |
15 | 48 | ||
16 | The L2TP protocol http://www.faqs.org/rfcs/rfc2661.html defines L2TP | 49 | Each L2TP tunnel is implemented using a UDP or L2TPIP socket; L2TPIP |
17 | control and data frames. L2TP control frames carry messages between | 50 | provides L2TPv3 IP encapsulation (no UDP) and is implemented using a |
18 | L2TP clients/servers and are used to setup / teardown tunnels and | 51 | new l2tpip socket family. The tunnel socket is typically created by |
19 | sessions. An L2TP client or server is implemented in userspace and | 52 | userspace, though for unmanaged L2TPv3 tunnels, the socket can also be |
20 | will use a regular UDP socket per tunnel. L2TP data frames carry PPP | 53 | created by the kernel. Each L2TP session (pseudowire) gets a network |
21 | frames, which may be PPP control or PPP data. The kernel's PPP | 54 | interface instance. In the case of PPP, these interfaces are created |
55 | indirectly by pppd using a pppol2tp socket. In the case of ethernet, | ||
56 | the netdevice is created upon a netlink request to create an L2TPv3 | ||
57 | ethernet pseudowire. | ||
58 | |||
59 | For PPP, the PPPoL2TP driver, net/l2tp/l2tp_ppp.c, provides a | ||
60 | mechanism by which PPP frames carried through an L2TP session are | ||
61 | passed through the kernel's PPP subsystem. The standard PPP daemon, | ||
62 | pppd, handles all PPP interaction with the peer. PPP network | ||
63 | interfaces are created for each local PPP endpoint. The kernel's PPP | ||
22 | subsystem arranges for PPP control frames to be delivered to pppd, | 64 | subsystem arranges for PPP control frames to be delivered to pppd, |
23 | while data frames are forwarded as usual. | 65 | while data frames are forwarded as usual. |
24 | 66 | ||
67 | For ethernet, the L2TPETH driver, net/l2tp/l2tp_eth.c, implements a | ||
68 | netdevice driver, managing virtual ethernet devices, one per | ||
69 | pseudowire. These interfaces can be managed using standard Linux tools | ||
70 | such as "ip" and "ifconfig". If only IP frames are passed over the | ||
71 | tunnel, the interface can be given an IP addresses of itself and its | ||
72 | peer. If non-IP frames are to be passed over the tunnel, the interface | ||
73 | can be added to a bridge using brctl. All L2TP datapath protocol | ||
74 | functions are handled by the L2TP core driver. | ||
75 | |||
25 | Each tunnel and session within a tunnel is assigned a unique tunnel_id | 76 | Each tunnel and session within a tunnel is assigned a unique tunnel_id |
26 | and session_id. These ids are carried in the L2TP header of every | 77 | and session_id. These ids are carried in the L2TP header of every |
27 | control and data packet. The pppol2tp driver uses them to lookup | 78 | control and data packet. (Actually, in L2TPv3, the tunnel_id isn't |
28 | internal tunnel and/or session contexts. Zero tunnel / session ids are | 79 | present in data frames - it is inferred from the IP connection on |
29 | treated specially - zero ids are never assigned to tunnels or sessions | 80 | which the packet was received.) The L2TP driver uses the ids to lookup |
30 | in the network. In the driver, the tunnel context keeps a pointer to | 81 | internal tunnel and/or session contexts to determine how to handle the |
31 | the tunnel UDP socket. The session context keeps a pointer to the | 82 | packet. Zero tunnel / session ids are treated specially - zero ids are |
32 | PPPoL2TP socket, as well as other data that lets the driver interface | 83 | never assigned to tunnels or sessions in the network. In the driver, |
33 | to the kernel PPP subsystem. | 84 | the tunnel context keeps a reference to the tunnel UDP or L2TPIP |
34 | 85 | socket. The session context holds data that lets the driver interface | |
35 | Note that the pppol2tp kernel driver handles only L2TP data frames; | 86 | to the kernel's network frame type subsystems, i.e. PPP, ethernet. |
36 | L2TP control frames are simply passed up to userspace in the UDP | 87 | |
37 | tunnel socket. The kernel handles all datapath aspects of the | 88 | Userspace Programming |
38 | protocol, including data packet resequencing (if enabled). | 89 | ===================== |
39 | 90 | ||
40 | There are a number of requirements on the userspace L2TP daemon in | 91 | For L2TPv2, there are a number of requirements on the userspace L2TP |
41 | order to use the pppol2tp driver. | 92 | daemon in order to use the pppol2tp driver. |
42 | 93 | ||
43 | 1. Use a UDP socket per tunnel. | 94 | 1. Use a UDP socket per tunnel. |
44 | 95 | ||
@@ -86,6 +137,35 @@ In addition to the standard PPP ioctls, a PPPIOCGL2TPSTATS is provided | |||
86 | to retrieve tunnel and session statistics from the kernel using the | 137 | to retrieve tunnel and session statistics from the kernel using the |
87 | PPPoX socket of the appropriate tunnel or session. | 138 | PPPoX socket of the appropriate tunnel or session. |
88 | 139 | ||
140 | For L2TPv3, userspace must use the netlink API defined in | ||
141 | include/linux/l2tp.h to manage tunnel and session contexts. The | ||
142 | general procedure to create a new L2TP tunnel with one session is:- | ||
143 | |||
144 | 1. Open a GENL socket using L2TP_GENL_NAME for configuring the kernel | ||
145 | using netlink. | ||
146 | |||
147 | 2. Create a UDP or L2TPIP socket for the tunnel. | ||
148 | |||
149 | 3. Create a new L2TP tunnel using a L2TP_CMD_TUNNEL_CREATE | ||
150 | request. Set attributes according to desired tunnel parameters, | ||
151 | referencing the UDP or L2TPIP socket created in the previous step. | ||
152 | |||
153 | 4. Create a new L2TP session in the tunnel using a | ||
154 | L2TP_CMD_SESSION_CREATE request. | ||
155 | |||
156 | The tunnel and all of its sessions are closed when the tunnel socket | ||
157 | is closed. The netlink API may also be used to delete sessions and | ||
158 | tunnels. Configuration and status info may be set or read using netlink. | ||
159 | |||
160 | The L2TP driver also supports static (unmanaged) L2TPv3 tunnels. These | ||
161 | are where there is no L2TP control message exchange with the peer to | ||
162 | setup the tunnel; the tunnel is configured manually at each end of the | ||
163 | tunnel. There is no need for an L2TP userspace application in this | ||
164 | case -- the tunnel socket is created by the kernel and configured | ||
165 | using parameters sent in the L2TP_CMD_TUNNEL_CREATE netlink | ||
166 | request. The "ip" utility of iproute2 has commands for managing static | ||
167 | L2TPv3 tunnels; do "ip l2tp help" for more information. | ||
168 | |||
89 | Debugging | 169 | Debugging |
90 | ========= | 170 | ========= |
91 | 171 | ||
@@ -102,6 +182,69 @@ PPPOL2TP_MSG_CONTROL userspace - kernel interface | |||
102 | PPPOL2TP_MSG_SEQ sequence numbers handling | 182 | PPPOL2TP_MSG_SEQ sequence numbers handling |
103 | PPPOL2TP_MSG_DATA data packets | 183 | PPPOL2TP_MSG_DATA data packets |
104 | 184 | ||
185 | If enabled, files under a l2tp debugfs directory can be used to dump | ||
186 | kernel state about L2TP tunnels and sessions. To access it, the | ||
187 | debugfs filesystem must first be mounted. | ||
188 | |||
189 | # mount -t debugfs debugfs /debug | ||
190 | |||
191 | Files under the l2tp directory can then be accessed. | ||
192 | |||
193 | # cat /debug/l2tp/tunnels | ||
194 | |||
195 | The debugfs files should not be used by applications to obtain L2TP | ||
196 | state information because the file format is subject to change. It is | ||
197 | implemented to provide extra debug information to help diagnose | ||
198 | problems.) Users should use the netlink API. | ||
199 | |||
200 | /proc/net/pppol2tp is also provided for backwards compaibility with | ||
201 | the original pppol2tp driver. It lists information about L2TPv2 | ||
202 | tunnels and sessions only. Its use is discouraged. | ||
203 | |||
204 | Unmanaged L2TPv3 Tunnels | ||
205 | ======================== | ||
206 | |||
207 | Some commercial L2TP products support unmanaged L2TPv3 ethernet | ||
208 | tunnels, where there is no L2TP control protocol; tunnels are | ||
209 | configured at each side manually. New commands are available in | ||
210 | iproute2's ip utility to support this. | ||
211 | |||
212 | To create an L2TPv3 ethernet pseudowire between local host 192.168.1.1 | ||
213 | and peer 192.168.1.2, using IP addresses 10.5.1.1 and 10.5.1.2 for the | ||
214 | tunnel endpoints:- | ||
215 | |||
216 | # modprobe l2tp_eth | ||
217 | # modprobe l2tp_netlink | ||
218 | |||
219 | # ip l2tp add tunnel tunnel_id 1 peer_tunnel_id 1 udp_sport 5000 \ | ||
220 | udp_dport 5000 encap udp local 192.168.1.1 remote 192.168.1.2 | ||
221 | # ip l2tp add session tunnel_id 1 session_id 1 peer_session_id 1 | ||
222 | # ifconfig -a | ||
223 | # ip addr add 10.5.1.2/32 peer 10.5.1.1/32 dev l2tpeth0 | ||
224 | # ifconfig l2tpeth0 up | ||
225 | |||
226 | Choose IP addresses to be the address of a local IP interface and that | ||
227 | of the remote system. The IP addresses of the l2tpeth0 interface can be | ||
228 | anything suitable. | ||
229 | |||
230 | Repeat the above at the peer, with ports, tunnel/session ids and IP | ||
231 | addresses reversed. The tunnel and session IDs can be any non-zero | ||
232 | 32-bit number, but the values must be reversed at the peer. | ||
233 | |||
234 | Host 1 Host2 | ||
235 | udp_sport=5000 udp_sport=5001 | ||
236 | udp_dport=5001 udp_dport=5000 | ||
237 | tunnel_id=42 tunnel_id=45 | ||
238 | peer_tunnel_id=45 peer_tunnel_id=42 | ||
239 | session_id=128 session_id=5196755 | ||
240 | peer_session_id=5196755 peer_session_id=128 | ||
241 | |||
242 | When done at both ends of the tunnel, it should be possible to send | ||
243 | data over the network. e.g. | ||
244 | |||
245 | # ping 10.5.1.1 | ||
246 | |||
247 | |||
105 | Sample Userspace Code | 248 | Sample Userspace Code |
106 | ===================== | 249 | ===================== |
107 | 250 | ||
@@ -158,12 +301,48 @@ Sample Userspace Code | |||
158 | } | 301 | } |
159 | return 0; | 302 | return 0; |
160 | 303 | ||
304 | Internal Implementation | ||
305 | ======================= | ||
306 | |||
307 | The driver keeps a struct l2tp_tunnel context per L2TP tunnel and a | ||
308 | struct l2tp_session context for each session. The l2tp_tunnel is | ||
309 | always associated with a UDP or L2TP/IP socket and keeps a list of | ||
310 | sessions in the tunnel. The l2tp_session context keeps kernel state | ||
311 | about the session. It has private data which is used for data specific | ||
312 | to the session type. With L2TPv2, the session always carried PPP | ||
313 | traffic. With L2TPv3, the session can also carry ethernet frames | ||
314 | (ethernet pseudowire) or other data types such as ATM, HDLC or Frame | ||
315 | Relay. | ||
316 | |||
317 | When a tunnel is first opened, the reference count on the socket is | ||
318 | increased using sock_hold(). This ensures that the kernel socket | ||
319 | cannot be removed while L2TP's data structures reference it. | ||
320 | |||
321 | Some L2TP sessions also have a socket (PPP pseudowires) while others | ||
322 | do not (ethernet pseudowires). We can't use the socket reference count | ||
323 | as the reference count for session contexts. The L2TP implementation | ||
324 | therefore has its own internal reference counts on the session | ||
325 | contexts. | ||
326 | |||
327 | To Do | ||
328 | ===== | ||
329 | |||
330 | Add L2TP tunnel switching support. This would route tunneled traffic | ||
331 | from one L2TP tunnel into another. Specified in | ||
332 | http://tools.ietf.org/html/draft-ietf-l2tpext-tunnel-switching-08 | ||
333 | |||
334 | Add L2TPv3 VLAN pseudowire support. | ||
335 | |||
336 | Add L2TPv3 IP pseudowire support. | ||
337 | |||
338 | Add L2TPv3 ATM pseudowire support. | ||
339 | |||
161 | Miscellaneous | 340 | Miscellaneous |
162 | ============ | 341 | ============= |
163 | 342 | ||
164 | The PPPoL2TP driver was developed as part of the OpenL2TP project by | 343 | The L2TP drivers were developed as part of the OpenL2TP project by |
165 | Katalix Systems Ltd. OpenL2TP is a full-featured L2TP client / server, | 344 | Katalix Systems Ltd. OpenL2TP is a full-featured L2TP client / server, |
166 | designed from the ground up to have the L2TP datapath in the | 345 | designed from the ground up to have the L2TP datapath in the |
167 | kernel. The project also implemented the pppol2tp plugin for pppd | 346 | kernel. The project also implemented the pppol2tp plugin for pppd |
168 | which allows pppd to use the kernel driver. Details can be found at | 347 | which allows pppd to use the kernel driver. Details can be found at |
169 | http://openl2tp.sourceforge.net. | 348 | http://www.openl2tp.org. |
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt new file mode 100644 index 000000000000..7ee770b5ef5f --- /dev/null +++ b/Documentation/networking/stmmac.txt | |||
@@ -0,0 +1,143 @@ | |||
1 | STMicroelectronics 10/100/1000 Synopsys Ethernet driver | ||
2 | |||
3 | Copyright (C) 2007-2010 STMicroelectronics Ltd | ||
4 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | ||
5 | |||
6 | This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers | ||
7 | (Synopsys IP blocks); it has been fully tested on STLinux platforms. | ||
8 | |||
9 | Currently this network device driver is for all STM embedded MAC/GMAC | ||
10 | (7xxx SoCs). | ||
11 | |||
12 | DWC Ether MAC 10/100/1000 Universal version 3.41a and DWC Ether MAC 10/100 | ||
13 | Universal version 4.0 have been used for developing the first code | ||
14 | implementation. | ||
15 | |||
16 | Please, for more information also visit: www.stlinux.com | ||
17 | |||
18 | 1) Kernel Configuration | ||
19 | The kernel configuration option is STMMAC_ETH: | ||
20 | Device Drivers ---> Network device support ---> Ethernet (1000 Mbit) ---> | ||
21 | STMicroelectronics 10/100/1000 Ethernet driver (STMMAC_ETH) | ||
22 | |||
23 | 2) Driver parameters list: | ||
24 | debug: message level (0: no output, 16: all); | ||
25 | phyaddr: to manually provide the physical address to the PHY device; | ||
26 | dma_rxsize: DMA rx ring size; | ||
27 | dma_txsize: DMA tx ring size; | ||
28 | buf_sz: DMA buffer size; | ||
29 | tc: control the HW FIFO threshold; | ||
30 | tx_coe: Enable/Disable Tx Checksum Offload engine; | ||
31 | watchdog: transmit timeout (in milliseconds); | ||
32 | flow_ctrl: Flow control ability [on/off]; | ||
33 | pause: Flow Control Pause Time; | ||
34 | tmrate: timer period (only if timer optimisation is configured). | ||
35 | |||
36 | 3) Command line options | ||
37 | Driver parameters can be also passed in command line by using: | ||
38 | stmmaceth=dma_rxsize:128,dma_txsize:512 | ||
39 | |||
40 | 4) Driver information and notes | ||
41 | |||
42 | 4.1) Transmit process | ||
43 | The xmit method is invoked when the kernel needs to transmit a packet; it sets | ||
44 | the descriptors in the ring and informs the DMA engine that there is a packet | ||
45 | ready to be transmitted. | ||
46 | Once the controller has finished transmitting the packet, an interrupt is | ||
47 | triggered; So the driver will be able to release the socket buffers. | ||
48 | By default, the driver sets the NETIF_F_SG bit in the features field of the | ||
49 | net_device structure enabling the scatter/gather feature. | ||
50 | |||
51 | 4.2) Receive process | ||
52 | When one or more packets are received, an interrupt happens. The interrupts | ||
53 | are not queued so the driver has to scan all the descriptors in the ring during | ||
54 | the receive process. | ||
55 | This is based on NAPI so the interrupt handler signals only if there is work to be | ||
56 | done, and it exits. | ||
57 | Then the poll method will be scheduled at some future point. | ||
58 | The incoming packets are stored, by the DMA, in a list of pre-allocated socket | ||
59 | buffers in order to avoid the memcpy (Zero-copy). | ||
60 | |||
61 | 4.3) Timer-Driver Interrupt | ||
62 | Instead of having the device that asynchronously notifies the frame receptions, the | ||
63 | driver configures a timer to generate an interrupt at regular intervals. | ||
64 | Based on the granularity of the timer, the frames that are received by the device | ||
65 | will experience different levels of latency. Some NICs have dedicated timer | ||
66 | device to perform this task. STMMAC can use either the RTC device or the TMU | ||
67 | channel 2 on STLinux platforms. | ||
68 | The timers frequency can be passed to the driver as parameter; when change it, | ||
69 | take care of both hardware capability and network stability/performance impact. | ||
70 | Several performance tests on STM platforms showed this optimisation allows to spare | ||
71 | the CPU while having the maximum throughput. | ||
72 | |||
73 | 4.4) WOL | ||
74 | Wake up on Lan feature through Magic Frame is only supported for the GMAC | ||
75 | core. | ||
76 | |||
77 | 4.5) DMA descriptors | ||
78 | Driver handles both normal and enhanced descriptors. The latter has been only | ||
79 | tested on DWC Ether MAC 10/100/1000 Universal version 3.41a. | ||
80 | |||
81 | 4.6) Ethtool support | ||
82 | Ethtool is supported. Driver statistics and internal errors can be taken using: | ||
83 | ethtool -S ethX command. It is possible to dump registers etc. | ||
84 | |||
85 | 4.7) Jumbo and Segmentation Offloading | ||
86 | Jumbo frames are supported and tested for the GMAC. | ||
87 | The GSO has been also added but it's performed in software. | ||
88 | LRO is not supported. | ||
89 | |||
90 | 4.8) Physical | ||
91 | The driver is compatible with PAL to work with PHY and GPHY devices. | ||
92 | |||
93 | 4.9) Platform information | ||
94 | Several information came from the platform; please refer to the | ||
95 | driver's Header file in include/linux directory. | ||
96 | |||
97 | struct plat_stmmacenet_data { | ||
98 | int bus_id; | ||
99 | int pbl; | ||
100 | int has_gmac; | ||
101 | void (*fix_mac_speed)(void *priv, unsigned int speed); | ||
102 | void (*bus_setup)(unsigned long ioaddr); | ||
103 | #ifdef CONFIG_STM_DRIVERS | ||
104 | struct stm_pad_config *pad_config; | ||
105 | #endif | ||
106 | void *bsp_priv; | ||
107 | }; | ||
108 | |||
109 | Where: | ||
110 | - pbl (Programmable Burst Length) is maximum number of | ||
111 | beats to be transferred in one DMA transaction. | ||
112 | GMAC also enables the 4xPBL by default. | ||
113 | - fix_mac_speed and bus_setup are used to configure internal target | ||
114 | registers (on STM platforms); | ||
115 | - has_gmac: GMAC core is on board (get it at run-time in the next step); | ||
116 | - bus_id: bus identifier. | ||
117 | |||
118 | struct plat_stmmacphy_data { | ||
119 | int bus_id; | ||
120 | int phy_addr; | ||
121 | unsigned int phy_mask; | ||
122 | int interface; | ||
123 | int (*phy_reset)(void *priv); | ||
124 | void *priv; | ||
125 | }; | ||
126 | |||
127 | Where: | ||
128 | - bus_id: bus identifier; | ||
129 | - phy_addr: physical address used for the attached phy device; | ||
130 | set it to -1 to get it at run-time; | ||
131 | - interface: physical MII interface mode; | ||
132 | - phy_reset: hook to reset HW function. | ||
133 | |||
134 | TODO: | ||
135 | - Continue to make the driver more generic and suitable for other Synopsys | ||
136 | Ethernet controllers used on other architectures (i.e. ARM). | ||
137 | - 10G controllers are not supported. | ||
138 | - MAC uses Normal descriptors and GMAC uses enhanced ones. | ||
139 | This is a limit that should be reviewed. MAC could want to | ||
140 | use the enhanced structure. | ||
141 | - Checksumming: Rx/Tx csum is done in HW in case of GMAC only. | ||
142 | - Review the timer optimisation code to use an embedded device that seems to be | ||
143 | available in new chip generations. | ||
diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt index 0e58b4539176..e8c8f4f06c67 100644 --- a/Documentation/networking/timestamping.txt +++ b/Documentation/networking/timestamping.txt | |||
@@ -41,11 +41,12 @@ SOF_TIMESTAMPING_SOFTWARE: return system time stamp generated in | |||
41 | SOF_TIMESTAMPING_TX/RX determine how time stamps are generated. | 41 | SOF_TIMESTAMPING_TX/RX determine how time stamps are generated. |
42 | SOF_TIMESTAMPING_RAW/SYS determine how they are reported in the | 42 | SOF_TIMESTAMPING_RAW/SYS determine how they are reported in the |
43 | following control message: | 43 | following control message: |
44 | struct scm_timestamping { | 44 | |
45 | struct timespec systime; | 45 | struct scm_timestamping { |
46 | struct timespec hwtimetrans; | 46 | struct timespec systime; |
47 | struct timespec hwtimeraw; | 47 | struct timespec hwtimetrans; |
48 | }; | 48 | struct timespec hwtimeraw; |
49 | }; | ||
49 | 50 | ||
50 | recvmsg() can be used to get this control message for regular incoming | 51 | recvmsg() can be used to get this control message for regular incoming |
51 | packets. For send time stamps the outgoing packet is looped back to | 52 | packets. For send time stamps the outgoing packet is looped back to |
@@ -87,12 +88,13 @@ by the network device and will be empty without that support. | |||
87 | SIOCSHWTSTAMP: | 88 | SIOCSHWTSTAMP: |
88 | 89 | ||
89 | Hardware time stamping must also be initialized for each device driver | 90 | Hardware time stamping must also be initialized for each device driver |
90 | that is expected to do hardware time stamping. The parameter is: | 91 | that is expected to do hardware time stamping. The parameter is defined in |
92 | /include/linux/net_tstamp.h as: | ||
91 | 93 | ||
92 | struct hwtstamp_config { | 94 | struct hwtstamp_config { |
93 | int flags; /* no flags defined right now, must be zero */ | 95 | int flags; /* no flags defined right now, must be zero */ |
94 | int tx_type; /* HWTSTAMP_TX_* */ | 96 | int tx_type; /* HWTSTAMP_TX_* */ |
95 | int rx_filter; /* HWTSTAMP_FILTER_* */ | 97 | int rx_filter; /* HWTSTAMP_FILTER_* */ |
96 | }; | 98 | }; |
97 | 99 | ||
98 | Desired behavior is passed into the kernel and to a specific device by | 100 | Desired behavior is passed into the kernel and to a specific device by |
@@ -139,42 +141,56 @@ enum { | |||
139 | /* time stamp any incoming packet */ | 141 | /* time stamp any incoming packet */ |
140 | HWTSTAMP_FILTER_ALL, | 142 | HWTSTAMP_FILTER_ALL, |
141 | 143 | ||
142 | /* return value: time stamp all packets requested plus some others */ | 144 | /* return value: time stamp all packets requested plus some others */ |
143 | HWTSTAMP_FILTER_SOME, | 145 | HWTSTAMP_FILTER_SOME, |
144 | 146 | ||
145 | /* PTP v1, UDP, any kind of event packet */ | 147 | /* PTP v1, UDP, any kind of event packet */ |
146 | HWTSTAMP_FILTER_PTP_V1_L4_EVENT, | 148 | HWTSTAMP_FILTER_PTP_V1_L4_EVENT, |
147 | 149 | ||
148 | ... | 150 | /* for the complete list of values, please check |
151 | * the include file /include/linux/net_tstamp.h | ||
152 | */ | ||
149 | }; | 153 | }; |
150 | 154 | ||
151 | 155 | ||
152 | DEVICE IMPLEMENTATION | 156 | DEVICE IMPLEMENTATION |
153 | 157 | ||
154 | A driver which supports hardware time stamping must support the | 158 | A driver which supports hardware time stamping must support the |
155 | SIOCSHWTSTAMP ioctl. Time stamps for received packets must be stored | 159 | SIOCSHWTSTAMP ioctl and update the supplied struct hwtstamp_config with |
156 | in the skb with skb_hwtstamp_set(). | 160 | the actual values as described in the section on SIOCSHWTSTAMP. |
161 | |||
162 | Time stamps for received packets must be stored in the skb. To get a pointer | ||
163 | to the shared time stamp structure of the skb call skb_hwtstamps(). Then | ||
164 | set the time stamps in the structure: | ||
165 | |||
166 | struct skb_shared_hwtstamps { | ||
167 | /* hardware time stamp transformed into duration | ||
168 | * since arbitrary point in time | ||
169 | */ | ||
170 | ktime_t hwtstamp; | ||
171 | ktime_t syststamp; /* hwtstamp transformed to system time base */ | ||
172 | }; | ||
157 | 173 | ||
158 | Time stamps for outgoing packets are to be generated as follows: | 174 | Time stamps for outgoing packets are to be generated as follows: |
159 | - In hard_start_xmit(), check if skb_hwtstamp_check_tx_hardware() | 175 | - In hard_start_xmit(), check if skb_tx(skb)->hardware is set no-zero. |
160 | returns non-zero. If yes, then the driver is expected | 176 | If yes, then the driver is expected to do hardware time stamping. |
161 | to do hardware time stamping. | ||
162 | - If this is possible for the skb and requested, then declare | 177 | - If this is possible for the skb and requested, then declare |
163 | that the driver is doing the time stamping by calling | 178 | that the driver is doing the time stamping by setting the field |
164 | skb_hwtstamp_tx_in_progress(). A driver not supporting | 179 | skb_tx(skb)->in_progress non-zero. You might want to keep a pointer |
165 | hardware time stamping doesn't do that. A driver must never | 180 | to the associated skb for the next step and not free the skb. A driver |
166 | touch sk_buff::tstamp! It is used to store how time stamping | 181 | not supporting hardware time stamping doesn't do that. A driver must |
167 | for an outgoing packets is to be done. | 182 | never touch sk_buff::tstamp! It is used to store software generated |
183 | time stamps by the network subsystem. | ||
168 | - As soon as the driver has sent the packet and/or obtained a | 184 | - As soon as the driver has sent the packet and/or obtained a |
169 | hardware time stamp for it, it passes the time stamp back by | 185 | hardware time stamp for it, it passes the time stamp back by |
170 | calling skb_hwtstamp_tx() with the original skb, the raw | 186 | calling skb_hwtstamp_tx() with the original skb, the raw |
171 | hardware time stamp and a handle to the device (necessary | 187 | hardware time stamp. skb_hwtstamp_tx() clones the original skb and |
172 | to convert the hardware time stamp to system time). If obtaining | 188 | adds the timestamps, therefore the original skb has to be freed now. |
173 | the hardware time stamp somehow fails, then the driver should | 189 | If obtaining the hardware time stamp somehow fails, then the driver |
174 | not fall back to software time stamping. The rationale is that | 190 | should not fall back to software time stamping. The rationale is that |
175 | this would occur at a later time in the processing pipeline | 191 | this would occur at a later time in the processing pipeline than other |
176 | than other software time stamping and therefore could lead | 192 | software time stamping and therefore could lead to unexpected deltas |
177 | to unexpected deltas between time stamps. | 193 | between time stamps. |
178 | - If the driver did not call skb_hwtstamp_tx_in_progress(), then | 194 | - If the driver did not call set skb_tx(skb)->in_progress, then |
179 | dev_hard_start_xmit() checks whether software time stamping | 195 | dev_hard_start_xmit() checks whether software time stamping |
180 | is wanted as fallback and potentially generates the time stamp. | 196 | is wanted as fallback and potentially generates the time stamp. |
diff --git a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt index 6e37be1eeb2d..4f8930263dd9 100644 --- a/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt +++ b/Documentation/powerpc/dts-bindings/fsl/cpm_qe/qe.txt | |||
@@ -21,6 +21,15 @@ Required properties: | |||
21 | - fsl,qe-num-snums: define how many serial number(SNUM) the QE can use for the | 21 | - fsl,qe-num-snums: define how many serial number(SNUM) the QE can use for the |
22 | threads. | 22 | threads. |
23 | 23 | ||
24 | Optional properties: | ||
25 | - fsl,firmware-phandle: | ||
26 | Usage: required only if there is no fsl,qe-firmware child node | ||
27 | Value type: <phandle> | ||
28 | Definition: Points to a firmware node (see "QE Firmware Node" below) | ||
29 | that contains the firmware that should be uploaded for this QE. | ||
30 | The compatible property for the firmware node should say, | ||
31 | "fsl,qe-firmware". | ||
32 | |||
24 | Recommended properties | 33 | Recommended properties |
25 | - brg-frequency : the internal clock source frequency for baud-rate | 34 | - brg-frequency : the internal clock source frequency for baud-rate |
26 | generators in Hz. | 35 | generators in Hz. |
@@ -59,3 +68,48 @@ Example: | |||
59 | reg = <0 c000>; | 68 | reg = <0 c000>; |
60 | }; | 69 | }; |
61 | }; | 70 | }; |
71 | |||
72 | * QE Firmware Node | ||
73 | |||
74 | This node defines a firmware binary that is embedded in the device tree, for | ||
75 | the purpose of passing the firmware from bootloader to the kernel, or from | ||
76 | the hypervisor to the guest. | ||
77 | |||
78 | The firmware node itself contains the firmware binary contents, a compatible | ||
79 | property, and any firmware-specific properties. The node should be placed | ||
80 | inside a QE node that needs it. Doing so eliminates the need for a | ||
81 | fsl,firmware-phandle property. Other QE nodes that need the same firmware | ||
82 | should define an fsl,firmware-phandle property that points to the firmware node | ||
83 | in the first QE node. | ||
84 | |||
85 | The fsl,firmware property can be specified in the DTS (possibly using incbin) | ||
86 | or can be inserted by the boot loader at boot time. | ||
87 | |||
88 | Required properties: | ||
89 | - compatible | ||
90 | Usage: required | ||
91 | Value type: <string> | ||
92 | Definition: A standard property. Specify a string that indicates what | ||
93 | kind of firmware it is. For QE, this should be "fsl,qe-firmware". | ||
94 | |||
95 | - fsl,firmware | ||
96 | Usage: required | ||
97 | Value type: <prop-encoded-array>, encoded as an array of bytes | ||
98 | Definition: A standard property. This property contains the firmware | ||
99 | binary "blob". | ||
100 | |||
101 | Example: | ||
102 | qe1@e0080000 { | ||
103 | compatible = "fsl,qe"; | ||
104 | qe_firmware:qe-firmware { | ||
105 | compatible = "fsl,qe-firmware"; | ||
106 | fsl,firmware = [0x70 0xcd 0x00 0x00 0x01 0x46 0x45 ...]; | ||
107 | }; | ||
108 | ... | ||
109 | }; | ||
110 | |||
111 | qe2@e0090000 { | ||
112 | compatible = "fsl,qe"; | ||
113 | fsl,firmware-phandle = <&qe_firmware>; | ||
114 | ... | ||
115 | }; | ||
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index b4860509c319..83668e5dd17f 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -99,37 +99,15 @@ system. Also, it is possible to switch all rfkill drivers (or all drivers of | |||
99 | a specified type) into a state which also updates the default state for | 99 | a specified type) into a state which also updates the default state for |
100 | hotplugged devices. | 100 | hotplugged devices. |
101 | 101 | ||
102 | After an application opens /dev/rfkill, it can read the current state of | 102 | After an application opens /dev/rfkill, it can read the current state of all |
103 | all devices, and afterwards can poll the descriptor for hotplug or state | 103 | devices. Changes can be either obtained by either polling the descriptor for |
104 | change events. | 104 | hotplug or state change events or by listening for uevents emitted by the |
105 | 105 | rfkill core framework. | |
106 | Applications must ignore operations (the "op" field) they do not handle, | 106 | |
107 | this allows the API to be extended in the future. | 107 | Additionally, each rfkill device is registered in sysfs and emits uevents. |
108 | 108 | ||
109 | Additionally, each rfkill device is registered in sysfs and there has the | 109 | rfkill devices issue uevents (with an action of "change"), with the following |
110 | following attributes: | 110 | environment variables set: |
111 | |||
112 | name: Name assigned by driver to this key (interface or driver name). | ||
113 | type: Driver type string ("wlan", "bluetooth", etc). | ||
114 | persistent: Whether the soft blocked state is initialised from | ||
115 | non-volatile storage at startup. | ||
116 | state: Current state of the transmitter | ||
117 | 0: RFKILL_STATE_SOFT_BLOCKED | ||
118 | transmitter is turned off by software | ||
119 | 1: RFKILL_STATE_UNBLOCKED | ||
120 | transmitter is (potentially) active | ||
121 | 2: RFKILL_STATE_HARD_BLOCKED | ||
122 | transmitter is forced off by something outside of | ||
123 | the driver's control. | ||
124 | This file is deprecated because it can only properly show | ||
125 | three of the four possible states, soft-and-hard-blocked is | ||
126 | missing. | ||
127 | claim: 0: Kernel handles events | ||
128 | This file is deprecated because there no longer is a way to | ||
129 | claim just control over a single rfkill instance. | ||
130 | |||
131 | rfkill devices also issue uevents (with an action of "change"), with the | ||
132 | following environment variables set: | ||
133 | 111 | ||
134 | RFKILL_NAME | 112 | RFKILL_NAME |
135 | RFKILL_STATE | 113 | RFKILL_STATE |
@@ -137,3 +115,7 @@ RFKILL_TYPE | |||
137 | 115 | ||
138 | The contents of these variables corresponds to the "name", "state" and | 116 | The contents of these variables corresponds to the "name", "state" and |
139 | "type" sysfs files explained above. | 117 | "type" sysfs files explained above. |
118 | |||
119 | |||
120 | For further details consult Documentation/ABI/stable/dev-rfkill and | ||
121 | Documentation/ABI/stable/sysfs-class-rfkill. | ||
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index f4dd3bf99d12..98d14cb8a85d 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -119,10 +119,18 @@ the codec slots 0 and 1 no matter what the hardware reports. | |||
119 | 119 | ||
120 | Interrupt Handling | 120 | Interrupt Handling |
121 | ~~~~~~~~~~~~~~~~~~ | 121 | ~~~~~~~~~~~~~~~~~~ |
122 | In rare but some cases, the interrupt isn't properly handled as | 122 | HD-audio driver uses MSI as default (if available) since 2.6.33 |
123 | default. You would notice this by the DMA transfer error reported by | 123 | kernel as MSI works better on some machines, and in general, it's |
124 | ALSA PCM core, for example. Using MSI might help in such a case. | 124 | better for performance. However, Nvidia controllers showed bad |
125 | Pass `enable_msi=1` option for enabling MSI. | 125 | regressions with MSI (especially in a combination with AMD chipset), |
126 | thus we disabled MSI for them. | ||
127 | |||
128 | There seem also still other devices that don't work with MSI. If you | ||
129 | see a regression wrt the sound quality (stuttering, etc) or a lock-up | ||
130 | in the recent kernel, try to pass `enable_msi=0` option to disable | ||
131 | MSI. If it works, you can add the known bad device to the blacklist | ||
132 | defined in hda_intel.c. In such a case, please report and give the | ||
133 | patch back to the upstream developer. | ||
126 | 134 | ||
127 | 135 | ||
128 | HD-AUDIO CODEC | 136 | HD-AUDIO CODEC |
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index 991c26a6ef64..db0cb228d64a 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt | |||
@@ -63,9 +63,9 @@ way to perform a busy wait is: | |||
63 | cpu_relax(); | 63 | cpu_relax(); |
64 | 64 | ||
65 | The cpu_relax() call can lower CPU power consumption or yield to a | 65 | The cpu_relax() call can lower CPU power consumption or yield to a |
66 | hyperthreaded twin processor; it also happens to serve as a memory barrier, | 66 | hyperthreaded twin processor; it also happens to serve as a compiler |
67 | so, once again, volatile is unnecessary. Of course, busy-waiting is | 67 | barrier, so, once again, volatile is unnecessary. Of course, busy- |
68 | generally an anti-social act to begin with. | 68 | waiting is generally an anti-social act to begin with. |
69 | 69 | ||
70 | There are still a few rare situations where volatile makes sense in the | 70 | There are still a few rare situations where volatile makes sense in the |
71 | kernel: | 71 | kernel: |
diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c index 4cf72f3fa8e9..ba45803a2216 100644 --- a/Documentation/watchdog/src/watchdog-simple.c +++ b/Documentation/watchdog/src/watchdog-simple.c | |||
@@ -17,9 +17,6 @@ int main(void) | |||
17 | ret = -1; | 17 | ret = -1; |
18 | break; | 18 | break; |
19 | } | 19 | } |
20 | ret = fsync(fd); | ||
21 | if (ret) | ||
22 | break; | ||
23 | sleep(10); | 20 | sleep(10); |
24 | } | 21 | } |
25 | close(fd); | 22 | close(fd); |
diff --git a/Documentation/watchdog/src/watchdog-test.c b/Documentation/watchdog/src/watchdog-test.c index a750532ffcf8..63fdc34ceb98 100644 --- a/Documentation/watchdog/src/watchdog-test.c +++ b/Documentation/watchdog/src/watchdog-test.c | |||
@@ -31,6 +31,8 @@ static void keep_alive(void) | |||
31 | */ | 31 | */ |
32 | int main(int argc, char *argv[]) | 32 | int main(int argc, char *argv[]) |
33 | { | 33 | { |
34 | int flags; | ||
35 | |||
34 | fd = open("/dev/watchdog", O_WRONLY); | 36 | fd = open("/dev/watchdog", O_WRONLY); |
35 | 37 | ||
36 | if (fd == -1) { | 38 | if (fd == -1) { |
@@ -41,12 +43,14 @@ int main(int argc, char *argv[]) | |||
41 | 43 | ||
42 | if (argc > 1) { | 44 | if (argc > 1) { |
43 | if (!strncasecmp(argv[1], "-d", 2)) { | 45 | if (!strncasecmp(argv[1], "-d", 2)) { |
44 | ioctl(fd, WDIOC_SETOPTIONS, WDIOS_DISABLECARD); | 46 | flags = WDIOS_DISABLECARD; |
47 | ioctl(fd, WDIOC_SETOPTIONS, &flags); | ||
45 | fprintf(stderr, "Watchdog card disabled.\n"); | 48 | fprintf(stderr, "Watchdog card disabled.\n"); |
46 | fflush(stderr); | 49 | fflush(stderr); |
47 | exit(0); | 50 | exit(0); |
48 | } else if (!strncasecmp(argv[1], "-e", 2)) { | 51 | } else if (!strncasecmp(argv[1], "-e", 2)) { |
49 | ioctl(fd, WDIOC_SETOPTIONS, WDIOS_ENABLECARD); | 52 | flags = WDIOS_ENABLECARD; |
53 | ioctl(fd, WDIOC_SETOPTIONS, &flags); | ||
50 | fprintf(stderr, "Watchdog card enabled.\n"); | 54 | fprintf(stderr, "Watchdog card enabled.\n"); |
51 | fflush(stderr); | 55 | fflush(stderr); |
52 | exit(0); | 56 | exit(0); |
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt index 4cc4ba9d7150..eb7132ed8bbc 100644 --- a/Documentation/watchdog/watchdog-api.txt +++ b/Documentation/watchdog/watchdog-api.txt | |||
@@ -222,11 +222,10 @@ returned value is the temperature in degrees fahrenheit. | |||
222 | ioctl(fd, WDIOC_GETTEMP, &temperature); | 222 | ioctl(fd, WDIOC_GETTEMP, &temperature); |
223 | 223 | ||
224 | Finally the SETOPTIONS ioctl can be used to control some aspects of | 224 | Finally the SETOPTIONS ioctl can be used to control some aspects of |
225 | the cards operation; right now the pcwd driver is the only one | 225 | the cards operation. |
226 | supporting this ioctl. | ||
227 | 226 | ||
228 | int options = 0; | 227 | int options = 0; |
229 | ioctl(fd, WDIOC_SETOPTIONS, options); | 228 | ioctl(fd, WDIOC_SETOPTIONS, &options); |
230 | 229 | ||
231 | The following options are available: | 230 | The following options are available: |
232 | 231 | ||