diff options
55 files changed, 286 insertions, 687 deletions
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index 02e56d447a8f..c485ee028bd9 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX | |||
@@ -84,9 +84,6 @@ policy-routing.txt | |||
84 | - IP policy-based routing | 84 | - IP policy-based routing |
85 | ray_cs.txt | 85 | ray_cs.txt |
86 | - Raylink Wireless LAN card driver info. | 86 | - Raylink Wireless LAN card driver info. |
87 | sk98lin.txt | ||
88 | - Marvell Yukon Chipset / SysKonnect SK-98xx compliant Gigabit | ||
89 | Ethernet Adapter family driver info | ||
90 | skfp.txt | 87 | skfp.txt |
91 | - SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info. | 88 | - SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info. |
92 | smc9.txt | 89 | smc9.txt |
diff --git a/Documentation/networking/sk98lin.txt b/Documentation/networking/sk98lin.txt deleted file mode 100644 index 8590a954df1d..000000000000 --- a/Documentation/networking/sk98lin.txt +++ /dev/null | |||
@@ -1,568 +0,0 @@ | |||
1 | (C)Copyright 1999-2004 Marvell(R). | ||
2 | All rights reserved | ||
3 | =========================================================================== | ||
4 | |||
5 | sk98lin.txt created 13-Feb-2004 | ||
6 | |||
7 | Readme File for sk98lin v6.23 | ||
8 | Marvell Yukon/SysKonnect SK-98xx Gigabit Ethernet Adapter family driver for LINUX | ||
9 | |||
10 | This file contains | ||
11 | 1 Overview | ||
12 | 2 Required Files | ||
13 | 3 Installation | ||
14 | 3.1 Driver Installation | ||
15 | 3.2 Inclusion of adapter at system start | ||
16 | 4 Driver Parameters | ||
17 | 4.1 Per-Port Parameters | ||
18 | 4.2 Adapter Parameters | ||
19 | 5 Large Frame Support | ||
20 | 6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad) | ||
21 | 7 Troubleshooting | ||
22 | |||
23 | =========================================================================== | ||
24 | |||
25 | |||
26 | 1 Overview | ||
27 | =========== | ||
28 | |||
29 | The sk98lin driver supports the Marvell Yukon and SysKonnect | ||
30 | SK-98xx/SK-95xx compliant Gigabit Ethernet Adapter on Linux. It has | ||
31 | been tested with Linux on Intel/x86 machines. | ||
32 | *** | ||
33 | |||
34 | |||
35 | 2 Required Files | ||
36 | ================= | ||
37 | |||
38 | The linux kernel source. | ||
39 | No additional files required. | ||
40 | *** | ||
41 | |||
42 | |||
43 | 3 Installation | ||
44 | =============== | ||
45 | |||
46 | It is recommended to download the latest version of the driver from the | ||
47 | SysKonnect web site www.syskonnect.com. If you have downloaded the latest | ||
48 | driver, the Linux kernel has to be patched before the driver can be | ||
49 | installed. For details on how to patch a Linux kernel, refer to the | ||
50 | patch.txt file. | ||
51 | |||
52 | 3.1 Driver Installation | ||
53 | ------------------------ | ||
54 | |||
55 | The following steps describe the actions that are required to install | ||
56 | the driver and to start it manually. These steps should be carried | ||
57 | out for the initial driver setup. Once confirmed to be ok, they can | ||
58 | be included in the system start. | ||
59 | |||
60 | NOTE 1: To perform the following tasks you need 'root' access. | ||
61 | |||
62 | NOTE 2: In case of problems, please read the section "Troubleshooting" | ||
63 | below. | ||
64 | |||
65 | The driver can either be integrated into the kernel or it can be compiled | ||
66 | as a module. Select the appropriate option during the kernel | ||
67 | configuration. | ||
68 | |||
69 | Compile/use the driver as a module | ||
70 | ---------------------------------- | ||
71 | To compile the driver, go to the directory /usr/src/linux and | ||
72 | execute the command "make menuconfig" or "make xconfig" and proceed as | ||
73 | follows: | ||
74 | |||
75 | To integrate the driver permanently into the kernel, proceed as follows: | ||
76 | |||
77 | 1. Select the menu "Network device support" and then "Ethernet(1000Mbit)" | ||
78 | 2. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support" | ||
79 | with (*) | ||
80 | 3. Build a new kernel when the configuration of the above options is | ||
81 | finished. | ||
82 | 4. Install the new kernel. | ||
83 | 5. Reboot your system. | ||
84 | |||
85 | To use the driver as a module, proceed as follows: | ||
86 | |||
87 | 1. Enable 'loadable module support' in the kernel. | ||
88 | 2. For automatic driver start, enable the 'Kernel module loader'. | ||
89 | 3. Select the menu "Network device support" and then "Ethernet(1000Mbit)" | ||
90 | 4. Mark "Marvell Yukon Chipset / SysKonnect SK-98xx family support" | ||
91 | with (M) | ||
92 | 5. Execute the command "make modules". | ||
93 | 6. Execute the command "make modules_install". | ||
94 | The appropriate modules will be installed. | ||
95 | 7. Reboot your system. | ||
96 | |||
97 | |||
98 | Load the module manually | ||
99 | ------------------------ | ||
100 | To load the module manually, proceed as follows: | ||
101 | |||
102 | 1. Enter "modprobe sk98lin". | ||
103 | 2. If a Marvell Yukon or SysKonnect SK-98xx adapter is installed in | ||
104 | your computer and you have a /proc file system, execute the command: | ||
105 | "ls /proc/net/sk98lin/" | ||
106 | This should produce an output containing a line with the following | ||
107 | format: | ||
108 | eth0 eth1 ... | ||
109 | which indicates that your adapter has been found and initialized. | ||
110 | |||
111 | NOTE 1: If you have more than one Marvell Yukon or SysKonnect SK-98xx | ||
112 | adapter installed, the adapters will be listed as 'eth0', | ||
113 | 'eth1', 'eth2', etc. | ||
114 | For each adapter, repeat steps 3 and 4 below. | ||
115 | |||
116 | NOTE 2: If you have other Ethernet adapters installed, your Marvell | ||
117 | Yukon or SysKonnect SK-98xx adapter will be mapped to the | ||
118 | next available number, e.g. 'eth1'. The mapping is executed | ||
119 | automatically. | ||
120 | The module installation message (displayed either in a system | ||
121 | log file or on the console) prints a line for each adapter | ||
122 | found containing the corresponding 'ethX'. | ||
123 | |||
124 | 3. Select an IP address and assign it to the respective adapter by | ||
125 | entering: | ||
126 | ifconfig eth0 <ip-address> | ||
127 | With this command, the adapter is connected to the Ethernet. | ||
128 | |||
129 | SK-98xx Gigabit Ethernet Server Adapters: The yellow LED on the adapter | ||
130 | is now active, the link status LED of the primary port is active and | ||
131 | the link status LED of the secondary port (on dual port adapters) is | ||
132 | blinking (if the ports are connected to a switch or hub). | ||
133 | SK-98xx V2.0 Gigabit Ethernet Adapters: The link status LED is active. | ||
134 | In addition, you will receive a status message on the console stating | ||
135 | "ethX: network connection up using port Y" and showing the selected | ||
136 | connection parameters (x stands for the ethernet device number | ||
137 | (0,1,2, etc), y stands for the port name (A or B)). | ||
138 | |||
139 | NOTE: If you are in doubt about IP addresses, ask your network | ||
140 | administrator for assistance. | ||
141 | |||
142 | 4. Your adapter should now be fully operational. | ||
143 | Use 'ping <otherstation>' to verify the connection to other computers | ||
144 | on your network. | ||
145 | 5. To check the adapter configuration view /proc/net/sk98lin/[devicename]. | ||
146 | For example by executing: | ||
147 | "cat /proc/net/sk98lin/eth0" | ||
148 | |||
149 | Unload the module | ||
150 | ----------------- | ||
151 | To stop and unload the driver modules, proceed as follows: | ||
152 | |||
153 | 1. Execute the command "ifconfig eth0 down". | ||
154 | 2. Execute the command "rmmod sk98lin". | ||
155 | |||
156 | 3.2 Inclusion of adapter at system start | ||
157 | ----------------------------------------- | ||
158 | |||
159 | Since a large number of different Linux distributions are | ||
160 | available, we are unable to describe a general installation procedure | ||
161 | for the driver module. | ||
162 | Because the driver is now integrated in the kernel, installation should | ||
163 | be easy, using the standard mechanism of your distribution. | ||
164 | Refer to the distribution's manual for installation of ethernet adapters. | ||
165 | |||
166 | *** | ||
167 | |||
168 | 4 Driver Parameters | ||
169 | ==================== | ||
170 | |||
171 | Parameters can be set at the command line after the module has been | ||
172 | loaded with the command 'modprobe'. | ||
173 | In some distributions, the configuration tools are able to pass parameters | ||
174 | to the driver module. | ||
175 | |||
176 | If you use the kernel module loader, you can set driver parameters | ||
177 | in the file /etc/modprobe.conf (or /etc/modules.conf in 2.4 or earlier). | ||
178 | To set the driver parameters in this file, proceed as follows: | ||
179 | |||
180 | 1. Insert a line of the form : | ||
181 | options sk98lin ... | ||
182 | For "...", the same syntax is required as described for the command | ||
183 | line parameters of modprobe below. | ||
184 | 2. To activate the new parameters, either reboot your computer | ||
185 | or | ||
186 | unload and reload the driver. | ||
187 | The syntax of the driver parameters is: | ||
188 | |||
189 | modprobe sk98lin parameter=value1[,value2[,value3...]] | ||
190 | |||
191 | where value1 refers to the first adapter, value2 to the second etc. | ||
192 | |||
193 | NOTE: All parameters are case sensitive. Write them exactly as shown | ||
194 | below. | ||
195 | |||
196 | Example: | ||
197 | Suppose you have two adapters. You want to set auto-negotiation | ||
198 | on the first adapter to ON and on the second adapter to OFF. | ||
199 | You also want to set DuplexCapabilities on the first adapter | ||
200 | to FULL, and on the second adapter to HALF. | ||
201 | Then, you must enter: | ||
202 | |||
203 | modprobe sk98lin AutoNeg_A=On,Off DupCap_A=Full,Half | ||
204 | |||
205 | NOTE: The number of adapters that can be configured this way is | ||
206 | limited in the driver (file skge.c, constant SK_MAX_CARD_PARAM). | ||
207 | The current limit is 16. If you happen to install | ||
208 | more adapters, adjust this and recompile. | ||
209 | |||
210 | |||
211 | 4.1 Per-Port Parameters | ||
212 | ------------------------ | ||
213 | |||
214 | These settings are available for each port on the adapter. | ||
215 | In the following description, '?' stands for the port for | ||
216 | which you set the parameter (A or B). | ||
217 | |||
218 | Speed | ||
219 | ----- | ||
220 | Parameter: Speed_? | ||
221 | Values: 10, 100, 1000, Auto | ||
222 | Default: Auto | ||
223 | |||
224 | This parameter is used to set the speed capabilities. It is only valid | ||
225 | for the SK-98xx V2.0 copper adapters. | ||
226 | Usually, the speed is negotiated between the two ports during link | ||
227 | establishment. If this fails, a port can be forced to a specific setting | ||
228 | with this parameter. | ||
229 | |||
230 | Auto-Negotiation | ||
231 | ---------------- | ||
232 | Parameter: AutoNeg_? | ||
233 | Values: On, Off, Sense | ||
234 | Default: On | ||
235 | |||
236 | The "Sense"-mode automatically detects whether the link partner supports | ||
237 | auto-negotiation or not. | ||
238 | |||
239 | Duplex Capabilities | ||
240 | ------------------- | ||
241 | Parameter: DupCap_? | ||
242 | Values: Half, Full, Both | ||
243 | Default: Both | ||
244 | |||
245 | This parameters is only relevant if auto-negotiation for this port is | ||
246 | not set to "Sense". If auto-negotiation is set to "On", all three values | ||
247 | are possible. If it is set to "Off", only "Full" and "Half" are allowed. | ||
248 | This parameter is useful if your link partner does not support all | ||
249 | possible combinations. | ||
250 | |||
251 | Flow Control | ||
252 | ------------ | ||
253 | Parameter: FlowCtrl_? | ||
254 | Values: Sym, SymOrRem, LocSend, None | ||
255 | Default: SymOrRem | ||
256 | |||
257 | This parameter can be used to set the flow control capabilities the | ||
258 | port reports during auto-negotiation. It can be set for each port | ||
259 | individually. | ||
260 | Possible modes: | ||
261 | -- Sym = Symmetric: both link partners are allowed to send | ||
262 | PAUSE frames | ||
263 | -- SymOrRem = SymmetricOrRemote: both or only remote partner | ||
264 | are allowed to send PAUSE frames | ||
265 | -- LocSend = LocalSend: only local link partner is allowed | ||
266 | to send PAUSE frames | ||
267 | -- None = no link partner is allowed to send PAUSE frames | ||
268 | |||
269 | NOTE: This parameter is ignored if auto-negotiation is set to "Off". | ||
270 | |||
271 | Role in Master-Slave-Negotiation (1000Base-T only) | ||
272 | -------------------------------------------------- | ||
273 | Parameter: Role_? | ||
274 | Values: Auto, Master, Slave | ||
275 | Default: Auto | ||
276 | |||
277 | This parameter is only valid for the SK-9821 and SK-9822 adapters. | ||
278 | For two 1000Base-T ports to communicate, one must take the role of the | ||
279 | master (providing timing information), while the other must be the | ||
280 | slave. Usually, this is negotiated between the two ports during link | ||
281 | establishment. If this fails, a port can be forced to a specific setting | ||
282 | with this parameter. | ||
283 | |||
284 | |||
285 | 4.2 Adapter Parameters | ||
286 | ----------------------- | ||
287 | |||
288 | Connection Type (SK-98xx V2.0 copper adapters only) | ||
289 | --------------- | ||
290 | Parameter: ConType | ||
291 | Values: Auto, 100FD, 100HD, 10FD, 10HD | ||
292 | Default: Auto | ||
293 | |||
294 | The parameter 'ConType' is a combination of all five per-port parameters | ||
295 | within one single parameter. This simplifies the configuration of both ports | ||
296 | of an adapter card! The different values of this variable reflect the most | ||
297 | meaningful combinations of port parameters. | ||
298 | |||
299 | The following table shows the values of 'ConType' and the corresponding | ||
300 | combinations of the per-port parameters: | ||
301 | |||
302 | ConType | DupCap AutoNeg FlowCtrl Role Speed | ||
303 | ----------+------------------------------------------------------ | ||
304 | Auto | Both On SymOrRem Auto Auto | ||
305 | 100FD | Full Off None Auto (ignored) 100 | ||
306 | 100HD | Half Off None Auto (ignored) 100 | ||
307 | 10FD | Full Off None Auto (ignored) 10 | ||
308 | 10HD | Half Off None Auto (ignored) 10 | ||
309 | |||
310 | Stating any other port parameter together with this 'ConType' variable | ||
311 | will result in a merged configuration of those settings. This due to | ||
312 | the fact, that the per-port parameters (e.g. Speed_? ) have a higher | ||
313 | priority than the combined variable 'ConType'. | ||
314 | |||
315 | NOTE: This parameter is always used on both ports of the adapter card. | ||
316 | |||
317 | Interrupt Moderation | ||
318 | -------------------- | ||
319 | Parameter: Moderation | ||
320 | Values: None, Static, Dynamic | ||
321 | Default: None | ||
322 | |||
323 | Interrupt moderation is employed to limit the maximum number of interrupts | ||
324 | the driver has to serve. That is, one or more interrupts (which indicate any | ||
325 | transmit or receive packet to be processed) are queued until the driver | ||
326 | processes them. When queued interrupts are to be served, is determined by the | ||
327 | 'IntsPerSec' parameter, which is explained later below. | ||
328 | |||
329 | Possible modes: | ||
330 | |||
331 | -- None - No interrupt moderation is applied on the adapter card. | ||
332 | Therefore, each transmit or receive interrupt is served immediately | ||
333 | as soon as it appears on the interrupt line of the adapter card. | ||
334 | |||
335 | -- Static - Interrupt moderation is applied on the adapter card. | ||
336 | All transmit and receive interrupts are queued until a complete | ||
337 | moderation interval ends. If such a moderation interval ends, all | ||
338 | queued interrupts are processed in one big bunch without any delay. | ||
339 | The term 'static' reflects the fact, that interrupt moderation is | ||
340 | always enabled, regardless how much network load is currently | ||
341 | passing via a particular interface. In addition, the duration of | ||
342 | the moderation interval has a fixed length that never changes while | ||
343 | the driver is operational. | ||
344 | |||
345 | -- Dynamic - Interrupt moderation might be applied on the adapter card, | ||
346 | depending on the load of the system. If the driver detects that the | ||
347 | system load is too high, the driver tries to shield the system against | ||
348 | too much network load by enabling interrupt moderation. If - at a later | ||
349 | time - the CPU utilization decreases again (or if the network load is | ||
350 | negligible) the interrupt moderation will automatically be disabled. | ||
351 | |||
352 | Interrupt moderation should be used when the driver has to handle one or more | ||
353 | interfaces with a high network load, which - as a consequence - leads also to a | ||
354 | high CPU utilization. When moderation is applied in such high network load | ||
355 | situations, CPU load might be reduced by 20-30%. | ||
356 | |||
357 | NOTE: The drawback of using interrupt moderation is an increase of the round- | ||
358 | trip-time (RTT), due to the queueing and serving of interrupts at dedicated | ||
359 | moderation times. | ||
360 | |||
361 | Interrupts per second | ||
362 | --------------------- | ||
363 | Parameter: IntsPerSec | ||
364 | Values: 30...40000 (interrupts per second) | ||
365 | Default: 2000 | ||
366 | |||
367 | This parameter is only used if either static or dynamic interrupt moderation | ||
368 | is used on a network adapter card. Using this parameter if no moderation is | ||
369 | applied will lead to no action performed. | ||
370 | |||
371 | This parameter determines the length of any interrupt moderation interval. | ||
372 | Assuming that static interrupt moderation is to be used, an 'IntsPerSec' | ||
373 | parameter value of 2000 will lead to an interrupt moderation interval of | ||
374 | 500 microseconds. | ||
375 | |||
376 | NOTE: The duration of the moderation interval is to be chosen with care. | ||
377 | At first glance, selecting a very long duration (e.g. only 100 interrupts per | ||
378 | second) seems to be meaningful, but the increase of packet-processing delay | ||
379 | is tremendous. On the other hand, selecting a very short moderation time might | ||
380 | compensate the use of any moderation being applied. | ||
381 | |||
382 | |||
383 | Preferred Port | ||
384 | -------------- | ||
385 | Parameter: PrefPort | ||
386 | Values: A, B | ||
387 | Default: A | ||
388 | |||
389 | This is used to force the preferred port to A or B (on dual-port network | ||
390 | adapters). The preferred port is the one that is used if both are detected | ||
391 | as fully functional. | ||
392 | |||
393 | RLMT Mode (Redundant Link Management Technology) | ||
394 | ------------------------------------------------ | ||
395 | Parameter: RlmtMode | ||
396 | Values: CheckLinkState,CheckLocalPort, CheckSeg, DualNet | ||
397 | Default: CheckLinkState | ||
398 | |||
399 | RLMT monitors the status of the port. If the link of the active port | ||
400 | fails, RLMT switches immediately to the standby link. The virtual link is | ||
401 | maintained as long as at least one 'physical' link is up. | ||
402 | |||
403 | Possible modes: | ||
404 | |||
405 | -- CheckLinkState - Check link state only: RLMT uses the link state | ||
406 | reported by the adapter hardware for each individual port to | ||
407 | determine whether a port can be used for all network traffic or | ||
408 | not. | ||
409 | |||
410 | -- CheckLocalPort - In this mode, RLMT monitors the network path | ||
411 | between the two ports of an adapter by regularly exchanging packets | ||
412 | between them. This mode requires a network configuration in which | ||
413 | the two ports are able to "see" each other (i.e. there must not be | ||
414 | any router between the ports). | ||
415 | |||
416 | -- CheckSeg - Check local port and segmentation: This mode supports the | ||
417 | same functions as the CheckLocalPort mode and additionally checks | ||
418 | network segmentation between the ports. Therefore, this mode is only | ||
419 | to be used if Gigabit Ethernet switches are installed on the network | ||
420 | that have been configured to use the Spanning Tree protocol. | ||
421 | |||
422 | -- DualNet - In this mode, ports A and B are used as separate devices. | ||
423 | If you have a dual port adapter, port A will be configured as eth0 | ||
424 | and port B as eth1. Both ports can be used independently with | ||
425 | distinct IP addresses. The preferred port setting is not used. | ||
426 | RLMT is turned off. | ||
427 | |||
428 | NOTE: RLMT modes CLP and CLPSS are designed to operate in configurations | ||
429 | where a network path between the ports on one adapter exists. | ||
430 | Moreover, they are not designed to work where adapters are connected | ||
431 | back-to-back. | ||
432 | *** | ||
433 | |||
434 | |||
435 | 5 Large Frame Support | ||
436 | ====================== | ||
437 | |||
438 | The driver supports large frames (also called jumbo frames). Using large | ||
439 | frames can result in an improved throughput if transferring large amounts | ||
440 | of data. | ||
441 | To enable large frames, set the MTU (maximum transfer unit) of the | ||
442 | interface to the desired value (up to 9000), execute the following | ||
443 | command: | ||
444 | ifconfig eth0 mtu 9000 | ||
445 | This will only work if you have two adapters connected back-to-back | ||
446 | or if you use a switch that supports large frames. When using a switch, | ||
447 | it should be configured to allow large frames and auto-negotiation should | ||
448 | be set to OFF. The setting must be configured on all adapters that can be | ||
449 | reached by the large frames. If one adapter is not set to receive large | ||
450 | frames, it will simply drop them. | ||
451 | |||
452 | You can switch back to the standard ethernet frame size by executing the | ||
453 | following command: | ||
454 | ifconfig eth0 mtu 1500 | ||
455 | |||
456 | To permanently configure this setting, add a script with the 'ifconfig' | ||
457 | line to the system startup sequence (named something like "S99sk98lin" | ||
458 | in /etc/rc.d/rc2.d). | ||
459 | *** | ||
460 | |||
461 | |||
462 | 6 VLAN and Link Aggregation Support (IEEE 802.1, 802.1q, 802.3ad) | ||
463 | ================================================================== | ||
464 | |||
465 | The Marvell Yukon/SysKonnect Linux drivers are able to support VLAN and | ||
466 | Link Aggregation according to IEEE standards 802.1, 802.1q, and 802.3ad. | ||
467 | These features are only available after installation of open source | ||
468 | modules available on the Internet: | ||
469 | For VLAN go to: http://www.candelatech.com/~greear/vlan.html | ||
470 | For Link Aggregation go to: http://www.st.rim.or.jp/~yumo | ||
471 | |||
472 | NOTE: SysKonnect GmbH does not offer any support for these open source | ||
473 | modules and does not take the responsibility for any kind of | ||
474 | failures or problems arising in connection with these modules. | ||
475 | |||
476 | NOTE: Configuring Link Aggregation on a SysKonnect dual link adapter may | ||
477 | cause problems when unloading the driver. | ||
478 | |||
479 | |||
480 | 7 Troubleshooting | ||
481 | ================== | ||
482 | |||
483 | If any problems occur during the installation process, check the | ||
484 | following list: | ||
485 | |||
486 | |||
487 | Problem: The SK-98xx adapter cannot be found by the driver. | ||
488 | Solution: In /proc/pci search for the following entry: | ||
489 | 'Ethernet controller: SysKonnect SK-98xx ...' | ||
490 | If this entry exists, the SK-98xx or SK-98xx V2.0 adapter has | ||
491 | been found by the system and should be operational. | ||
492 | If this entry does not exist or if the file '/proc/pci' is not | ||
493 | found, there may be a hardware problem or the PCI support may | ||
494 | not be enabled in your kernel. | ||
495 | The adapter can be checked using the diagnostics program which | ||
496 | is available on the SysKonnect web site: | ||
497 | www.syskonnect.com | ||
498 | |||
499 | Some COMPAQ machines have problems dealing with PCI under Linux. | ||
500 | This problem is described in the 'PCI howto' document | ||
501 | (included in some distributions or available from the | ||
502 | web, e.g. at 'www.linux.org'). | ||
503 | |||
504 | |||
505 | Problem: Programs such as 'ifconfig' or 'route' cannot be found or the | ||
506 | error message 'Operation not permitted' is displayed. | ||
507 | Reason: You are not logged in as user 'root'. | ||
508 | Solution: Logout and login as 'root' or change to 'root' via 'su'. | ||
509 | |||
510 | |||
511 | Problem: Upon use of the command 'ping <address>' the message | ||
512 | "ping: sendto: Network is unreachable" is displayed. | ||
513 | Reason: Your route is not set correctly. | ||
514 | Solution: If you are using RedHat, you probably forgot to set up the | ||
515 | route in the 'network configuration'. | ||
516 | Check the existing routes with the 'route' command and check | ||
517 | if an entry for 'eth0' exists, and if so, if it is set correctly. | ||
518 | |||
519 | |||
520 | Problem: The driver can be started, the adapter is connected to the | ||
521 | network, but you cannot receive or transmit any packets; | ||
522 | e.g. 'ping' does not work. | ||
523 | Reason: There is an incorrect route in your routing table. | ||
524 | Solution: Check the routing table with the command 'route' and read the | ||
525 | manual help pages dealing with routes (enter 'man route'). | ||
526 | |||
527 | NOTE: Although the 2.2.x kernel versions generate the routing entry | ||
528 | automatically, problems of this kind may occur here as well. We've | ||
529 | come across a situation in which the driver started correctly at | ||
530 | system start, but after the driver has been removed and reloaded, | ||
531 | the route of the adapter's network pointed to the 'dummy0'device | ||
532 | and had to be corrected manually. | ||
533 | |||
534 | |||
535 | Problem: Your computer should act as a router between multiple | ||
536 | IP subnetworks (using multiple adapters), but computers in | ||
537 | other subnetworks cannot be reached. | ||
538 | Reason: Either the router's kernel is not configured for IP forwarding | ||
539 | or the routing table and gateway configuration of at least one | ||
540 | computer is not working. | ||
541 | |||
542 | Problem: Upon driver start, the following error message is displayed: | ||
543 | "eth0: -- ERROR -- | ||
544 | Class: internal Software error | ||
545 | Nr: 0xcc | ||
546 | Msg: SkGeInitPort() cannot init running ports" | ||
547 | Reason: You are using a driver compiled for single processor machines | ||
548 | on a multiprocessor machine with SMP (Symmetric MultiProcessor) | ||
549 | kernel. | ||
550 | Solution: Configure your kernel appropriately and recompile the kernel or | ||
551 | the modules. | ||
552 | |||
553 | |||
554 | |||
555 | If your problem is not listed here, please contact SysKonnect's technical | ||
556 | support for help (linux@syskonnect.de). | ||
557 | When contacting our technical support, please ensure that the following | ||
558 | information is available: | ||
559 | - System Manufacturer and HW Informations (CPU, Memory... ) | ||
560 | - PCI-Boards in your system | ||
561 | - Distribution | ||
562 | - Kernel version | ||
563 | - Driver version | ||
564 | *** | ||
565 | |||
566 | |||
567 | |||
568 | ***End of Readme File*** | ||
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 47c57a4294b7..98099f526d82 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
@@ -978,6 +978,7 @@ static int fs_open(struct atm_vcc *atm_vcc) | |||
978 | /* Docs are vague about this atm_hdr field. By the way, the FS | 978 | /* Docs are vague about this atm_hdr field. By the way, the FS |
979 | * chip makes odd errors if lower bits are set.... -- REW */ | 979 | * chip makes odd errors if lower bits are set.... -- REW */ |
980 | tc->atm_hdr = (vpi << 20) | (vci << 4); | 980 | tc->atm_hdr = (vpi << 20) | (vci << 4); |
981 | tmc0 = 0; | ||
981 | { | 982 | { |
982 | int pcr = atm_pcr_goal (txtp); | 983 | int pcr = atm_pcr_goal (txtp); |
983 | 984 | ||
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 2e3395b7e8c1..ffc4a5a41946 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -3000,8 +3000,7 @@ he_proc_read(struct atm_dev *dev, loff_t *pos, char *page) | |||
3000 | 3000 | ||
3001 | /* eeprom routines -- see 4.7 */ | 3001 | /* eeprom routines -- see 4.7 */ |
3002 | 3002 | ||
3003 | u8 | 3003 | static u8 read_prom_byte(struct he_dev *he_dev, int addr) |
3004 | read_prom_byte(struct he_dev *he_dev, int addr) | ||
3005 | { | 3004 | { |
3006 | u32 val = 0, tmp_read = 0; | 3005 | u32 val = 0, tmp_read = 0; |
3007 | int i, j = 0; | 3006 | int i, j = 0; |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index b967919fb7e2..28d77b5195de 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -2016,8 +2016,7 @@ idt77252_send_skb(struct atm_vcc *vcc, struct sk_buff *skb, int oam) | |||
2016 | return 0; | 2016 | return 0; |
2017 | } | 2017 | } |
2018 | 2018 | ||
2019 | int | 2019 | static int idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb) |
2020 | idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb) | ||
2021 | { | 2020 | { |
2022 | return idt77252_send_skb(vcc, skb, 0); | 2021 | return idt77252_send_skb(vcc, skb, 0); |
2023 | } | 2022 | } |
@@ -3072,8 +3071,7 @@ idt77252_dev_open(struct idt77252_dev *card) | |||
3072 | return 0; | 3071 | return 0; |
3073 | } | 3072 | } |
3074 | 3073 | ||
3075 | void | 3074 | static void idt77252_dev_close(struct atm_dev *dev) |
3076 | idt77252_dev_close(struct atm_dev *dev) | ||
3077 | { | 3075 | { |
3078 | struct idt77252_dev *card = dev->dev_data; | 3076 | struct idt77252_dev *card = dev->dev_data; |
3079 | u32 conf; | 3077 | u32 conf; |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index ef52452640e0..670c093ed25f 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -958,6 +958,7 @@ static void ia_suni_pm7345_init (IADEV *iadev) | |||
958 | 958 | ||
959 | /***************************** IA_LIB END *****************************/ | 959 | /***************************** IA_LIB END *****************************/ |
960 | 960 | ||
961 | #ifdef CONFIG_ATM_IA_DEBUG | ||
961 | static int tcnter = 0; | 962 | static int tcnter = 0; |
962 | static void xdump( u_char* cp, int length, char* prefix ) | 963 | static void xdump( u_char* cp, int length, char* prefix ) |
963 | { | 964 | { |
@@ -992,6 +993,7 @@ static void xdump( u_char* cp, int length, char* prefix ) | |||
992 | } | 993 | } |
993 | 994 | ||
994 | } /* close xdump(... */ | 995 | } /* close xdump(... */ |
996 | #endif /* CONFIG_ATM_IA_DEBUG */ | ||
995 | 997 | ||
996 | 998 | ||
997 | static struct atm_dev *ia_boards = NULL; | 999 | static struct atm_dev *ia_boards = NULL; |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 95d1b61342ec..da30a31e66f9 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2555,7 +2555,7 @@ config NIU | |||
2555 | 2555 | ||
2556 | config PASEMI_MAC | 2556 | config PASEMI_MAC |
2557 | tristate "PA Semi 1/10Gbit MAC" | 2557 | tristate "PA Semi 1/10Gbit MAC" |
2558 | depends on PPC64 && PCI | 2558 | depends on PPC_PASEMI && PCI |
2559 | select PHYLIB | 2559 | select PHYLIB |
2560 | select INET_LRO | 2560 | select INET_LRO |
2561 | help | 2561 | help |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index c993a32b3f50..26b2dd5016cd 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -575,7 +575,6 @@ adjust_head: | |||
575 | static int bf537mac_hard_start_xmit(struct sk_buff *skb, | 575 | static int bf537mac_hard_start_xmit(struct sk_buff *skb, |
576 | struct net_device *dev) | 576 | struct net_device *dev) |
577 | { | 577 | { |
578 | struct bf537mac_local *lp = netdev_priv(dev); | ||
579 | unsigned int data; | 578 | unsigned int data; |
580 | 579 | ||
581 | current_tx_ptr->skb = skb; | 580 | current_tx_ptr->skb = skb; |
@@ -634,7 +633,6 @@ out: | |||
634 | static void bf537mac_rx(struct net_device *dev) | 633 | static void bf537mac_rx(struct net_device *dev) |
635 | { | 634 | { |
636 | struct sk_buff *skb, *new_skb; | 635 | struct sk_buff *skb, *new_skb; |
637 | struct bf537mac_local *lp = netdev_priv(dev); | ||
638 | unsigned short len; | 636 | unsigned short len; |
639 | 637 | ||
640 | /* allocate a new skb for next time receive */ | 638 | /* allocate a new skb for next time receive */ |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 90a1f31e8e63..979c2d05ff9c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -341,6 +341,7 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
341 | 341 | ||
342 | if (command[0] == '-') { | 342 | if (command[0] == '-') { |
343 | dev = NULL; | 343 | dev = NULL; |
344 | original_mtu = 0; | ||
344 | bond_for_each_slave(bond, slave, i) | 345 | bond_for_each_slave(bond, slave, i) |
345 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { | 346 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { |
346 | dev = slave->dev; | 347 | dev = slave->dev; |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 0272afbdff37..4708a1631925 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1854,6 +1854,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1854 | struct ring_desc* start_tx; | 1854 | struct ring_desc* start_tx; |
1855 | struct ring_desc* prev_tx; | 1855 | struct ring_desc* prev_tx; |
1856 | struct nv_skb_map* prev_tx_ctx; | 1856 | struct nv_skb_map* prev_tx_ctx; |
1857 | unsigned long flags; | ||
1857 | 1858 | ||
1858 | /* add fragments to entries count */ | 1859 | /* add fragments to entries count */ |
1859 | for (i = 0; i < fragments; i++) { | 1860 | for (i = 0; i < fragments; i++) { |
@@ -1863,10 +1864,10 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1863 | 1864 | ||
1864 | empty_slots = nv_get_empty_tx_slots(np); | 1865 | empty_slots = nv_get_empty_tx_slots(np); |
1865 | if (unlikely(empty_slots <= entries)) { | 1866 | if (unlikely(empty_slots <= entries)) { |
1866 | spin_lock_irq(&np->lock); | 1867 | spin_lock_irqsave(&np->lock, flags); |
1867 | netif_stop_queue(dev); | 1868 | netif_stop_queue(dev); |
1868 | np->tx_stop = 1; | 1869 | np->tx_stop = 1; |
1869 | spin_unlock_irq(&np->lock); | 1870 | spin_unlock_irqrestore(&np->lock, flags); |
1870 | return NETDEV_TX_BUSY; | 1871 | return NETDEV_TX_BUSY; |
1871 | } | 1872 | } |
1872 | 1873 | ||
@@ -1929,13 +1930,13 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1929 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? | 1930 | tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? |
1930 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; | 1931 | NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; |
1931 | 1932 | ||
1932 | spin_lock_irq(&np->lock); | 1933 | spin_lock_irqsave(&np->lock, flags); |
1933 | 1934 | ||
1934 | /* set tx flags */ | 1935 | /* set tx flags */ |
1935 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); | 1936 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); |
1936 | np->put_tx.orig = put_tx; | 1937 | np->put_tx.orig = put_tx; |
1937 | 1938 | ||
1938 | spin_unlock_irq(&np->lock); | 1939 | spin_unlock_irqrestore(&np->lock, flags); |
1939 | 1940 | ||
1940 | dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", | 1941 | dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", |
1941 | dev->name, entries, tx_flags_extra); | 1942 | dev->name, entries, tx_flags_extra); |
@@ -1971,6 +1972,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
1971 | struct ring_desc_ex* prev_tx; | 1972 | struct ring_desc_ex* prev_tx; |
1972 | struct nv_skb_map* prev_tx_ctx; | 1973 | struct nv_skb_map* prev_tx_ctx; |
1973 | struct nv_skb_map* start_tx_ctx; | 1974 | struct nv_skb_map* start_tx_ctx; |
1975 | unsigned long flags; | ||
1974 | 1976 | ||
1975 | /* add fragments to entries count */ | 1977 | /* add fragments to entries count */ |
1976 | for (i = 0; i < fragments; i++) { | 1978 | for (i = 0; i < fragments; i++) { |
@@ -1980,10 +1982,10 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
1980 | 1982 | ||
1981 | empty_slots = nv_get_empty_tx_slots(np); | 1983 | empty_slots = nv_get_empty_tx_slots(np); |
1982 | if (unlikely(empty_slots <= entries)) { | 1984 | if (unlikely(empty_slots <= entries)) { |
1983 | spin_lock_irq(&np->lock); | 1985 | spin_lock_irqsave(&np->lock, flags); |
1984 | netif_stop_queue(dev); | 1986 | netif_stop_queue(dev); |
1985 | np->tx_stop = 1; | 1987 | np->tx_stop = 1; |
1986 | spin_unlock_irq(&np->lock); | 1988 | spin_unlock_irqrestore(&np->lock, flags); |
1987 | return NETDEV_TX_BUSY; | 1989 | return NETDEV_TX_BUSY; |
1988 | } | 1990 | } |
1989 | 1991 | ||
@@ -2059,7 +2061,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2059 | start_tx->txvlan = 0; | 2061 | start_tx->txvlan = 0; |
2060 | } | 2062 | } |
2061 | 2063 | ||
2062 | spin_lock_irq(&np->lock); | 2064 | spin_lock_irqsave(&np->lock, flags); |
2063 | 2065 | ||
2064 | if (np->tx_limit) { | 2066 | if (np->tx_limit) { |
2065 | /* Limit the number of outstanding tx. Setup all fragments, but | 2067 | /* Limit the number of outstanding tx. Setup all fragments, but |
@@ -2085,7 +2087,7 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2085 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); | 2087 | start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); |
2086 | np->put_tx.ex = put_tx; | 2088 | np->put_tx.ex = put_tx; |
2087 | 2089 | ||
2088 | spin_unlock_irq(&np->lock); | 2090 | spin_unlock_irqrestore(&np->lock, flags); |
2089 | 2091 | ||
2090 | dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", | 2092 | dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", |
2091 | dev->name, entries, tx_flags_extra); | 2093 | dev->name, entries, tx_flags_extra); |
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 0789802d59ed..378a23963495 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -1242,8 +1242,8 @@ static int emac_close(struct net_device *ndev) | |||
1242 | static inline u16 emac_tx_csum(struct emac_instance *dev, | 1242 | static inline u16 emac_tx_csum(struct emac_instance *dev, |
1243 | struct sk_buff *skb) | 1243 | struct sk_buff *skb) |
1244 | { | 1244 | { |
1245 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH && | 1245 | if (emac_has_feature(dev, EMAC_FTR_HAS_TAH) && |
1246 | skb->ip_summed == CHECKSUM_PARTIAL)) { | 1246 | (skb->ip_summed == CHECKSUM_PARTIAL)) { |
1247 | ++dev->stats.tx_packets_csum; | 1247 | ++dev->stats.tx_packets_csum; |
1248 | return EMAC_TX_CTRL_TAH_CSUM; | 1248 | return EMAC_TX_CTRL_TAH_CSUM; |
1249 | } | 1249 | } |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 268a288e0457..dcbe01b0ca0d 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -86,7 +86,7 @@ | |||
86 | #include "s2io.h" | 86 | #include "s2io.h" |
87 | #include "s2io-regs.h" | 87 | #include "s2io-regs.h" |
88 | 88 | ||
89 | #define DRV_VERSION "2.0.26.19" | 89 | #define DRV_VERSION "2.0.26.20" |
90 | 90 | ||
91 | /* S2io Driver name & version. */ | 91 | /* S2io Driver name & version. */ |
92 | static char s2io_driver_name[] = "Neterion"; | 92 | static char s2io_driver_name[] = "Neterion"; |
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 206918bad539..da2206f6021d 100644 --- a/drivers/net/tulip/eeprom.c +++ b/drivers/net/tulip/eeprom.c | |||
@@ -343,6 +343,12 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l | |||
343 | void __iomem *ee_addr = tp->base_addr + CSR9; | 343 | void __iomem *ee_addr = tp->base_addr + CSR9; |
344 | int read_cmd = location | (EE_READ_CMD << addr_len); | 344 | int read_cmd = location | (EE_READ_CMD << addr_len); |
345 | 345 | ||
346 | /* If location is past the end of what we can address, don't | ||
347 | * read some other location (ie truncate). Just return zero. | ||
348 | */ | ||
349 | if (location > (1 << addr_len) - 1) | ||
350 | return 0; | ||
351 | |||
346 | iowrite32(EE_ENB & ~EE_CS, ee_addr); | 352 | iowrite32(EE_ENB & ~EE_CS, ee_addr); |
347 | iowrite32(EE_ENB, ee_addr); | 353 | iowrite32(EE_ENB, ee_addr); |
348 | 354 | ||
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index ed600bf56e78..82f404b76d81 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1437,6 +1437,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1437 | EEPROM. | 1437 | EEPROM. |
1438 | */ | 1438 | */ |
1439 | ee_data = tp->eeprom; | 1439 | ee_data = tp->eeprom; |
1440 | memset(ee_data, 0, sizeof(tp->eeprom)); | ||
1440 | sum = 0; | 1441 | sum = 0; |
1441 | if (chip_idx == LC82C168) { | 1442 | if (chip_idx == LC82C168) { |
1442 | for (i = 0; i < 3; i++) { | 1443 | for (i = 0; i < 3; i++) { |
@@ -1458,8 +1459,12 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1458 | /* A serial EEPROM interface, we read now and sort it out later. */ | 1459 | /* A serial EEPROM interface, we read now and sort it out later. */ |
1459 | int sa_offset = 0; | 1460 | int sa_offset = 0; |
1460 | int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6; | 1461 | int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6; |
1462 | int ee_max_addr = ((1 << ee_addr_size) - 1) * sizeof(u16); | ||
1461 | 1463 | ||
1462 | for (i = 0; i < sizeof(tp->eeprom); i+=2) { | 1464 | if (ee_max_addr > sizeof(tp->eeprom)) |
1465 | ee_max_addr = sizeof(tp->eeprom); | ||
1466 | |||
1467 | for (i = 0; i < ee_max_addr ; i += sizeof(u16)) { | ||
1463 | u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size); | 1468 | u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size); |
1464 | ee_data[i] = data & 0xff; | 1469 | ee_data[i] = data & 0xff; |
1465 | ee_data[i + 1] = data >> 8; | 1470 | ee_data[i + 1] = data >> 8; |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index a12c9c41b217..0604f3faf043 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -129,7 +129,7 @@ config USB_USBNET | |||
129 | 129 | ||
130 | config USB_NET_AX8817X | 130 | config USB_NET_AX8817X |
131 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" | 131 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" |
132 | depends on USB_USBNET && NET_ETHERNET | 132 | depends on USB_USBNET |
133 | select CRC32 | 133 | select CRC32 |
134 | default y | 134 | default y |
135 | help | 135 | help |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 2968bb342ea3..f7319d326912 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -354,7 +354,7 @@ static void dm9601_set_multicast(struct net_device *net) | |||
354 | struct dev_mc_list *mc_list = net->mc_list; | 354 | struct dev_mc_list *mc_list = net->mc_list; |
355 | int i; | 355 | int i; |
356 | 356 | ||
357 | for (i = 0; i < net->mc_count; i++) { | 357 | for (i = 0; i < net->mc_count; i++, mc_list = mc_list->next) { |
358 | u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; | 358 | u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; |
359 | hashes[crc >> 3] |= 1 << (crc & 0x7); | 359 | hashes[crc >> 3] |= 1 << (crc & 0x7); |
360 | } | 360 | } |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index d1ed68a11e70..b588c890ea70 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -1128,12 +1128,8 @@ pegasus_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
1128 | { | 1128 | { |
1129 | pegasus_t *pegasus; | 1129 | pegasus_t *pegasus; |
1130 | 1130 | ||
1131 | if (in_atomic()) | ||
1132 | return 0; | ||
1133 | |||
1134 | pegasus = netdev_priv(dev); | 1131 | pegasus = netdev_priv(dev); |
1135 | mii_ethtool_gset(&pegasus->mii, ecmd); | 1132 | mii_ethtool_gset(&pegasus->mii, ecmd); |
1136 | |||
1137 | return 0; | 1133 | return 0; |
1138 | } | 1134 | } |
1139 | 1135 | ||
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 629c909e05f9..b5860b97a93e 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -58,7 +58,7 @@ struct lapbethdev { | |||
58 | struct net_device_stats stats; /* some statistics */ | 58 | struct net_device_stats stats; /* some statistics */ |
59 | }; | 59 | }; |
60 | 60 | ||
61 | static struct list_head lapbeth_devices = LIST_HEAD_INIT(lapbeth_devices); | 61 | static LIST_HEAD(lapbeth_devices); |
62 | 62 | ||
63 | /* ------------------------------------------------------------------------ */ | 63 | /* ------------------------------------------------------------------------ */ |
64 | 64 | ||
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 8a9776b52daf..70db0570adc5 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -574,6 +574,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring, | |||
574 | } | 574 | } |
575 | 575 | ||
576 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { | 576 | if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { |
577 | b43err(ring->dev->wl, "RX DMA buffer allocation failed\n"); | ||
577 | dev_kfree_skb_any(skb); | 578 | dev_kfree_skb_any(skb); |
578 | return -EIO; | 579 | return -EIO; |
579 | } | 580 | } |
@@ -829,8 +830,12 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
829 | DMA_TO_DEVICE); | 830 | DMA_TO_DEVICE); |
830 | 831 | ||
831 | if (b43_dma_mapping_error(ring, dma_test, | 832 | if (b43_dma_mapping_error(ring, dma_test, |
832 | b43_txhdr_size(dev), 1)) | 833 | b43_txhdr_size(dev), 1)) { |
834 | |||
835 | b43err(dev->wl, | ||
836 | "TXHDR DMA allocation failed\n"); | ||
833 | goto err_kfree_txhdr_cache; | 837 | goto err_kfree_txhdr_cache; |
838 | } | ||
834 | } | 839 | } |
835 | 840 | ||
836 | dma_unmap_single(dev->dev->dev, | 841 | dma_unmap_single(dev->dev->dev, |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index b79a6bd5396d..371e4a119511 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -91,6 +91,8 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
91 | 91 | ||
92 | dev->conf.ConfigBase = parse.config.base; | 92 | dev->conf.ConfigBase = parse.config.base; |
93 | dev->conf.Present = parse.config.rmask[0]; | 93 | dev->conf.Present = parse.config.rmask[0]; |
94 | dev->conf.Attributes = CONF_ENABLE_IRQ; | ||
95 | dev->conf.IntType = INT_MEMORY_AND_IO; | ||
94 | 96 | ||
95 | dev->io.BasePort2 = 0; | 97 | dev->io.BasePort2 = 0; |
96 | dev->io.NumPorts2 = 0; | 98 | dev->io.NumPorts2 = 0; |
@@ -112,8 +114,8 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
112 | if (res != CS_SUCCESS) | 114 | if (res != CS_SUCCESS) |
113 | goto err_disable; | 115 | goto err_disable; |
114 | 116 | ||
115 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; | 117 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
116 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; | 118 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID; |
117 | dev->irq.Handler = NULL; /* The handler is registered later. */ | 119 | dev->irq.Handler = NULL; /* The handler is registered later. */ |
118 | dev->irq.Instance = NULL; | 120 | dev->irq.Instance = NULL; |
119 | res = pcmcia_request_irq(dev, &dev->irq); | 121 | res = pcmcia_request_irq(dev, &dev->irq); |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index d17746582160..53afebac7146 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -677,9 +677,7 @@ sbi_get_int_status_exit: | |||
677 | 677 | ||
678 | /* Card has a command result for us */ | 678 | /* Card has a command result for us */ |
679 | if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) { | 679 | if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) { |
680 | spin_lock(&priv->driver_lock); | ||
681 | ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len); | 680 | ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len); |
682 | spin_unlock(&priv->driver_lock); | ||
683 | if (ret < 0) | 681 | if (ret < 0) |
684 | lbs_pr_err("could not receive cmd from card\n"); | 682 | lbs_pr_err("could not receive cmd from card\n"); |
685 | } | 683 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 62b58a6261fe..50ea7bd0c922 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -1252,11 +1252,20 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state) | |||
1252 | 1252 | ||
1253 | exit: | 1253 | exit: |
1254 | /* | 1254 | /* |
1255 | * Set device mode to sleep for power management. | 1255 | * Set device mode to sleep for power management, |
1256 | * on some hardware this call seems to consistently fail. | ||
1257 | * From the specifications it is hard to tell why it fails, | ||
1258 | * and if this is a "bad thing". | ||
1259 | * Overall it is safe to just ignore the failure and | ||
1260 | * continue suspending. The only downside is that the | ||
1261 | * device will not be in optimal power save mode, but with | ||
1262 | * the radio and the other components already disabled the | ||
1263 | * device is as good as disabled. | ||
1256 | */ | 1264 | */ |
1257 | retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); | 1265 | retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); |
1258 | if (retval) | 1266 | if (retval) |
1259 | return retval; | 1267 | WARNING(rt2x00dev, "Device failed to enter sleep state, " |
1268 | "continue suspending.\n"); | ||
1260 | 1269 | ||
1261 | return 0; | 1270 | return 0; |
1262 | } | 1271 | } |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 993758f924be..c36c76caf20b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1105,12 +1105,14 @@ static inline int netif_is_multiqueue(const struct net_device *dev) | |||
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | /* Use this variant when it is known for sure that it | 1107 | /* Use this variant when it is known for sure that it |
1108 | * is executing from interrupt context. | 1108 | * is executing from hardware interrupt context or with hardware interrupts |
1109 | * disabled. | ||
1109 | */ | 1110 | */ |
1110 | extern void dev_kfree_skb_irq(struct sk_buff *skb); | 1111 | extern void dev_kfree_skb_irq(struct sk_buff *skb); |
1111 | 1112 | ||
1112 | /* Use this variant in places where it could be invoked | 1113 | /* Use this variant in places where it could be invoked |
1113 | * either from interrupt or non-interrupt context. | 1114 | * from either hardware interrupt or other context, with hardware interrupts |
1115 | * either disabled or enabled. | ||
1114 | */ | 1116 | */ |
1115 | extern void dev_kfree_skb_any(struct sk_buff *skb); | 1117 | extern void dev_kfree_skb_any(struct sk_buff *skb); |
1116 | 1118 | ||
diff --git a/include/net/llc.h b/include/net/llc.h index f5024583fc8b..7940da1606e7 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -65,7 +65,6 @@ struct llc_sap { | |||
65 | 65 | ||
66 | extern struct list_head llc_sap_list; | 66 | extern struct list_head llc_sap_list; |
67 | extern rwlock_t llc_sap_list_lock; | 67 | extern rwlock_t llc_sap_list_lock; |
68 | extern unsigned char llc_station_mac_sa[ETH_ALEN]; | ||
69 | 68 | ||
70 | extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, | 69 | extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, |
71 | struct packet_type *pt, struct net_device *orig_dev); | 70 | struct packet_type *pt, struct net_device *orig_dev); |
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h index 4a8f58b17e43..75b8e2968c9b 100644 --- a/include/net/llc_pdu.h +++ b/include/net/llc_pdu.h | |||
@@ -381,7 +381,7 @@ static inline void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, | |||
381 | xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */ | 381 | xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */ |
382 | xid_info->type = svcs_supported; | 382 | xid_info->type = svcs_supported; |
383 | xid_info->rw = rx_window << 1; /* size of receive window */ | 383 | xid_info->rw = rx_window << 1; /* size of receive window */ |
384 | skb_put(skb, 3); | 384 | skb_put(skb, sizeof(struct llc_xid_info)); |
385 | } | 385 | } |
386 | 386 | ||
387 | /** | 387 | /** |
@@ -406,7 +406,7 @@ static inline void llc_pdu_init_as_xid_rsp(struct sk_buff *skb, | |||
406 | xid_info->fmt_id = LLC_XID_FMT_ID; | 406 | xid_info->fmt_id = LLC_XID_FMT_ID; |
407 | xid_info->type = svcs_supported; | 407 | xid_info->type = svcs_supported; |
408 | xid_info->rw = rx_window << 1; | 408 | xid_info->rw = rx_window << 1; |
409 | skb_put(skb, 3); | 409 | skb_put(skb, sizeof(struct llc_xid_info)); |
410 | } | 410 | } |
411 | 411 | ||
412 | /* LLC Type 2 FRMR response information field format */ | 412 | /* LLC Type 2 FRMR response information field format */ |
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index 2c56dbece729..ed25bec2f648 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h | |||
@@ -1,5 +1,8 @@ | |||
1 | #ifndef LLC_SAP_H | 1 | #ifndef LLC_SAP_H |
2 | #define LLC_SAP_H | 2 | #define LLC_SAP_H |
3 | |||
4 | #include <asm/types.h> | ||
5 | |||
3 | /* | 6 | /* |
4 | * Copyright (c) 1997 by Procom Technology,Inc. | 7 | * Copyright (c) 1997 by Procom Technology,Inc. |
5 | * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 8 | * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
@@ -19,8 +22,8 @@ struct sock; | |||
19 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); | 22 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); |
20 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, | 23 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, |
21 | unsigned char prim); | 24 | unsigned char prim); |
22 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, | 25 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, |
23 | struct net_device *dev); | 26 | u8 type, u32 data_size); |
24 | 27 | ||
25 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, | 28 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, |
26 | struct sk_buff *skb, | 29 | struct sk_buff *skb, |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 694be86e4490..5975ec3be7f3 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -384,17 +384,35 @@ static void vlan_sync_address(struct net_device *dev, | |||
384 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); | 384 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); |
385 | } | 385 | } |
386 | 386 | ||
387 | static void __vlan_device_event(struct net_device *dev, unsigned long event) | ||
388 | { | ||
389 | switch (event) { | ||
390 | case NETDEV_CHANGENAME: | ||
391 | vlan_proc_rem_dev(dev); | ||
392 | if (vlan_proc_add_dev(dev) < 0) | ||
393 | pr_warning("8021q: failed to change proc name for %s\n", | ||
394 | dev->name); | ||
395 | break; | ||
396 | } | ||
397 | } | ||
398 | |||
387 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, | 399 | static int vlan_device_event(struct notifier_block *unused, unsigned long event, |
388 | void *ptr) | 400 | void *ptr) |
389 | { | 401 | { |
390 | struct net_device *dev = ptr; | 402 | struct net_device *dev = ptr; |
391 | struct vlan_group *grp = __vlan_find_group(dev->ifindex); | 403 | struct vlan_group *grp; |
392 | int i, flgs; | 404 | int i, flgs; |
393 | struct net_device *vlandev; | 405 | struct net_device *vlandev; |
394 | 406 | ||
395 | if (dev_net(dev) != &init_net) | 407 | if (dev_net(dev) != &init_net) |
396 | return NOTIFY_DONE; | 408 | return NOTIFY_DONE; |
397 | 409 | ||
410 | if (is_vlan_dev(dev)) { | ||
411 | __vlan_device_event(dev, event); | ||
412 | goto out; | ||
413 | } | ||
414 | |||
415 | grp = __vlan_find_group(dev->ifindex); | ||
398 | if (!grp) | 416 | if (!grp) |
399 | goto out; | 417 | goto out; |
400 | 418 | ||
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 73efcc715ccb..51271aea402b 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
@@ -45,4 +45,9 @@ void vlan_netlink_fini(void); | |||
45 | 45 | ||
46 | extern struct rtnl_link_ops vlan_link_ops; | 46 | extern struct rtnl_link_ops vlan_link_ops; |
47 | 47 | ||
48 | static inline int is_vlan_dev(struct net_device *dev) | ||
49 | { | ||
50 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
51 | } | ||
52 | |||
48 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ | 53 | #endif /* !(__BEN_VLAN_802_1Q_INC__) */ |
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 3b8657a0b837..24cd96ee8109 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -210,11 +210,6 @@ int vlan_proc_rem_dev(struct net_device *vlandev) | |||
210 | * The following few functions build the content of /proc/net/vlan/config | 210 | * The following few functions build the content of /proc/net/vlan/config |
211 | */ | 211 | */ |
212 | 212 | ||
213 | static inline int is_vlan_dev(struct net_device *dev) | ||
214 | { | ||
215 | return dev->priv_flags & IFF_802_1Q_VLAN; | ||
216 | } | ||
217 | |||
218 | /* start read of /proc/net/vlan/config */ | 213 | /* start read of /proc/net/vlan/config */ |
219 | static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) | 214 | static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) |
220 | __acquires(dev_base_lock) | 215 | __acquires(dev_base_lock) |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 1220d8a41eb5..d366423c8392 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -53,6 +53,30 @@ | |||
53 | /* Bluetooth sockets */ | 53 | /* Bluetooth sockets */ |
54 | #define BT_MAX_PROTO 8 | 54 | #define BT_MAX_PROTO 8 |
55 | static struct net_proto_family *bt_proto[BT_MAX_PROTO]; | 55 | static struct net_proto_family *bt_proto[BT_MAX_PROTO]; |
56 | |||
57 | static struct lock_class_key bt_slock_key[BT_MAX_PROTO]; | ||
58 | static struct lock_class_key bt_lock_key[BT_MAX_PROTO]; | ||
59 | static const char *bt_key_strings[BT_MAX_PROTO] = { | ||
60 | "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP", | ||
61 | "sk_lock-AF_BLUETOOTH-BTPROTO_HCI", | ||
62 | "sk_lock-AF_BLUETOOTH-BTPROTO_SCO", | ||
63 | "sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM", | ||
64 | "sk_lock-AF_BLUETOOTH-BTPROTO_BNEP", | ||
65 | "sk_lock-AF_BLUETOOTH-BTPROTO_CMTP", | ||
66 | "sk_lock-AF_BLUETOOTH-BTPROTO_HIDP", | ||
67 | "sk_lock-AF_BLUETOOTH-BTPROTO_AVDTP", | ||
68 | }; | ||
69 | |||
70 | static const char *bt_slock_key_strings[BT_MAX_PROTO] = { | ||
71 | "slock-AF_BLUETOOTH-BTPROTO_L2CAP", | ||
72 | "slock-AF_BLUETOOTH-BTPROTO_HCI", | ||
73 | "slock-AF_BLUETOOTH-BTPROTO_SCO", | ||
74 | "slock-AF_BLUETOOTH-BTPROTO_RFCOMM", | ||
75 | "slock-AF_BLUETOOTH-BTPROTO_BNEP", | ||
76 | "slock-AF_BLUETOOTH-BTPROTO_CMTP", | ||
77 | "slock-AF_BLUETOOTH-BTPROTO_HIDP", | ||
78 | "slock-AF_BLUETOOTH-BTPROTO_AVDTP", | ||
79 | }; | ||
56 | static DEFINE_RWLOCK(bt_proto_lock); | 80 | static DEFINE_RWLOCK(bt_proto_lock); |
57 | 81 | ||
58 | int bt_sock_register(int proto, struct net_proto_family *ops) | 82 | int bt_sock_register(int proto, struct net_proto_family *ops) |
@@ -95,6 +119,21 @@ int bt_sock_unregister(int proto) | |||
95 | } | 119 | } |
96 | EXPORT_SYMBOL(bt_sock_unregister); | 120 | EXPORT_SYMBOL(bt_sock_unregister); |
97 | 121 | ||
122 | static void bt_reclassify_sock_lock(struct socket *sock, int proto) | ||
123 | { | ||
124 | struct sock *sk = sock->sk; | ||
125 | |||
126 | if (!sk) | ||
127 | return; | ||
128 | BUG_ON(sock_owned_by_user(sk)); | ||
129 | |||
130 | sock_lock_init_class_and_name(sk, | ||
131 | bt_slock_key_strings[proto], | ||
132 | &bt_slock_key[proto], | ||
133 | bt_key_strings[proto], | ||
134 | &bt_lock_key[proto]); | ||
135 | } | ||
136 | |||
98 | static int bt_sock_create(struct net *net, struct socket *sock, int proto) | 137 | static int bt_sock_create(struct net *net, struct socket *sock, int proto) |
99 | { | 138 | { |
100 | int err; | 139 | int err; |
@@ -117,6 +156,7 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto) | |||
117 | 156 | ||
118 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { | 157 | if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { |
119 | err = bt_proto[proto]->create(net, sock, proto); | 158 | err = bt_proto[proto]->create(net, sock, proto); |
159 | bt_reclassify_sock_lock(sock, proto); | ||
120 | module_put(bt_proto[proto]->owner); | 160 | module_put(bt_proto[proto]->owner); |
121 | } | 161 | } |
122 | 162 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index b5d4019d3572..1d36c093523b 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -84,7 +84,7 @@ static struct hci_sec_filter hci_sec_filter = { | |||
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct bt_sock_list hci_sk_list = { | 86 | static struct bt_sock_list hci_sk_list = { |
87 | .lock = RW_LOCK_UNLOCKED | 87 | .lock = __RW_LOCK_UNLOCKED(hci_sk_list.lock) |
88 | }; | 88 | }; |
89 | 89 | ||
90 | /* Send frame to RAW socket */ | 90 | /* Send frame to RAW socket */ |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 6b995ac832f5..a4849f2c1d81 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -62,7 +62,7 @@ static u32 l2cap_feat_mask = 0x0000; | |||
62 | static const struct proto_ops l2cap_sock_ops; | 62 | static const struct proto_ops l2cap_sock_ops; |
63 | 63 | ||
64 | static struct bt_sock_list l2cap_sk_list = { | 64 | static struct bt_sock_list l2cap_sk_list = { |
65 | .lock = RW_LOCK_UNLOCKED | 65 | .lock = __RW_LOCK_UNLOCKED(l2cap_sk_list.lock) |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static void __l2cap_sock_close(struct sock *sk, int reason); | 68 | static void __l2cap_sock_close(struct sock *sk, int reason); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 0c2c93735e93..eb62558e9b09 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -423,8 +423,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
423 | 423 | ||
424 | rfcomm_dlc_lock(d); | 424 | rfcomm_dlc_lock(d); |
425 | d->state = BT_CLOSED; | 425 | d->state = BT_CLOSED; |
426 | d->state_change(d, err); | ||
427 | rfcomm_dlc_unlock(d); | 426 | rfcomm_dlc_unlock(d); |
427 | d->state_change(d, err); | ||
428 | 428 | ||
429 | skb_queue_purge(&d->tx_queue); | 429 | skb_queue_purge(&d->tx_queue); |
430 | rfcomm_dlc_unlink(d); | 430 | rfcomm_dlc_unlink(d); |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index c103fa02893b..5083adcbfae5 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -60,7 +60,7 @@ | |||
60 | static const struct proto_ops rfcomm_sock_ops; | 60 | static const struct proto_ops rfcomm_sock_ops; |
61 | 61 | ||
62 | static struct bt_sock_list rfcomm_sk_list = { | 62 | static struct bt_sock_list rfcomm_sk_list = { |
63 | .lock = RW_LOCK_UNLOCKED | 63 | .lock = __RW_LOCK_UNLOCKED(rfcomm_sk_list.lock) |
64 | }; | 64 | }; |
65 | 65 | ||
66 | static void rfcomm_sock_close(struct sock *sk); | 66 | static void rfcomm_sock_close(struct sock *sk); |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index e4c779bb8d76..c3f749abb2d0 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -570,12 +570,7 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) | |||
570 | return; | 570 | return; |
571 | 571 | ||
572 | rfcomm_dev_del(dev); | 572 | rfcomm_dev_del(dev); |
573 | /* We have to drop DLC lock here, otherwise | ||
574 | rfcomm_dev_put() will dead lock if it's | ||
575 | the last reference. */ | ||
576 | rfcomm_dlc_unlock(dlc); | ||
577 | rfcomm_dev_put(dev); | 573 | rfcomm_dev_put(dev); |
578 | rfcomm_dlc_lock(dlc); | ||
579 | } | 574 | } |
580 | } else | 575 | } else |
581 | tty_hangup(dev->tty); | 576 | tty_hangup(dev->tty); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 2a5953b4405d..b0d487e2db20 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -58,7 +58,7 @@ | |||
58 | static const struct proto_ops sco_sock_ops; | 58 | static const struct proto_ops sco_sock_ops; |
59 | 59 | ||
60 | static struct bt_sock_list sco_sk_list = { | 60 | static struct bt_sock_list sco_sk_list = { |
61 | .lock = RW_LOCK_UNLOCKED | 61 | .lock = __RW_LOCK_UNLOCKED(sco_sk_list.lock) |
62 | }; | 62 | }; |
63 | 63 | ||
64 | static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent); | 64 | static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent); |
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index 93170bfcc22e..4ed429bd5951 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c | |||
@@ -86,7 +86,10 @@ EXPORT_SYMBOL(inet_frags_fini); | |||
86 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) | 86 | void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) |
87 | { | 87 | { |
88 | nf->low_thresh = 0; | 88 | nf->low_thresh = 0; |
89 | |||
90 | local_bh_disable(); | ||
89 | inet_frag_evictor(nf, f); | 91 | inet_frag_evictor(nf, f); |
92 | local_bh_enable(); | ||
90 | } | 93 | } |
91 | EXPORT_SYMBOL(inet_frags_exit_net); | 94 | EXPORT_SYMBOL(inet_frags_exit_net); |
92 | 95 | ||
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 9d6d3befd854..4813c39b438b 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
@@ -85,7 +85,7 @@ int ip_forward(struct sk_buff *skb) | |||
85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) | 85 | if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) |
86 | goto sr_failed; | 86 | goto sr_failed; |
87 | 87 | ||
88 | if (unlikely(skb->len > dst_mtu(&rt->u.dst) && | 88 | if (unlikely(skb->len > dst_mtu(&rt->u.dst) && !skb_is_gso(skb) && |
89 | (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { | 89 | (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { |
90 | IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); | 90 | IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); |
91 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, | 91 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 03bd70697481..7b7fcacec4a0 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1551,14 +1551,14 @@ static void *udp_seq_start(struct seq_file *seq, loff_t *pos) | |||
1551 | __acquires(udp_hash_lock) | 1551 | __acquires(udp_hash_lock) |
1552 | { | 1552 | { |
1553 | read_lock(&udp_hash_lock); | 1553 | read_lock(&udp_hash_lock); |
1554 | return *pos ? udp_get_idx(seq, *pos-1) : (void *)1; | 1554 | return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 1557 | static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
1558 | { | 1558 | { |
1559 | struct sock *sk; | 1559 | struct sock *sk; |
1560 | 1560 | ||
1561 | if (v == (void *)1) | 1561 | if (v == SEQ_START_TOKEN) |
1562 | sk = udp_get_idx(seq, 0); | 1562 | sk = udp_get_idx(seq, 0); |
1563 | else | 1563 | else |
1564 | sk = udp_get_next(seq, v); | 1564 | sk = udp_get_next(seq, v); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5ab9973571ef..87f688857ade 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -776,6 +776,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, struct inet6_ifaddr *i | |||
776 | struct inet6_dev *idev = ifp->idev; | 776 | struct inet6_dev *idev = ifp->idev; |
777 | struct in6_addr addr, *tmpaddr; | 777 | struct in6_addr addr, *tmpaddr; |
778 | unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp; | 778 | unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp; |
779 | unsigned long regen_advance; | ||
779 | int tmp_plen; | 780 | int tmp_plen; |
780 | int ret = 0; | 781 | int ret = 0; |
781 | int max_addresses; | 782 | int max_addresses; |
@@ -836,8 +837,23 @@ retry: | |||
836 | tmp_tstamp = ifp->tstamp; | 837 | tmp_tstamp = ifp->tstamp; |
837 | spin_unlock_bh(&ifp->lock); | 838 | spin_unlock_bh(&ifp->lock); |
838 | 839 | ||
840 | regen_advance = idev->cnf.regen_max_retry * | ||
841 | idev->cnf.dad_transmits * | ||
842 | idev->nd_parms->retrans_time / HZ; | ||
839 | write_unlock(&idev->lock); | 843 | write_unlock(&idev->lock); |
840 | 844 | ||
845 | /* A temporary address is created only if this calculated Preferred | ||
846 | * Lifetime is greater than REGEN_ADVANCE time units. In particular, | ||
847 | * an implementation must not create a temporary address with a zero | ||
848 | * Preferred Lifetime. | ||
849 | */ | ||
850 | if (tmp_prefered_lft <= regen_advance) { | ||
851 | in6_ifa_put(ifp); | ||
852 | in6_dev_put(idev); | ||
853 | ret = -1; | ||
854 | goto out; | ||
855 | } | ||
856 | |||
841 | addr_flags = IFA_F_TEMPORARY; | 857 | addr_flags = IFA_F_TEMPORARY; |
842 | /* set in addrconf_prefix_rcv() */ | 858 | /* set in addrconf_prefix_rcv() */ |
843 | if (ifp->flags & IFA_F_OPTIMISTIC) | 859 | if (ifp->flags & IFA_F_OPTIMISTIC) |
@@ -1834,6 +1850,9 @@ ok: | |||
1834 | * lifetimes of an existing temporary address | 1850 | * lifetimes of an existing temporary address |
1835 | * when processing a Prefix Information Option. | 1851 | * when processing a Prefix Information Option. |
1836 | */ | 1852 | */ |
1853 | if (ifp != ift->ifpub) | ||
1854 | continue; | ||
1855 | |||
1837 | spin_lock(&ift->lock); | 1856 | spin_lock(&ift->lock); |
1838 | flags = ift->flags; | 1857 | flags = ift->flags; |
1839 | if (ift->valid_lft > valid_lft && | 1858 | if (ift->valid_lft > valid_lft && |
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 63309d10df3a..227ce3d2339d 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -440,10 +440,10 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info, | |||
440 | } | 440 | } |
441 | 441 | ||
442 | if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) | 442 | if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) |
443 | goto out; | 443 | goto out_dst_release; |
444 | 444 | ||
445 | if (ip6_dst_lookup(sk, &dst2, &fl)) | 445 | if (ip6_dst_lookup(sk, &dst2, &fl)) |
446 | goto out; | 446 | goto out_dst_release; |
447 | 447 | ||
448 | err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); | 448 | err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); |
449 | if (err == -ENOENT) { | 449 | if (err == -ENOENT) { |
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 7e36269826ba..43a617e2268b 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c | |||
@@ -234,8 +234,7 @@ int ip6_mc_input(struct sk_buff *skb) | |||
234 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS); | 234 | IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS); |
235 | 235 | ||
236 | hdr = ipv6_hdr(skb); | 236 | hdr = ipv6_hdr(skb); |
237 | deliver = unlikely(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || | 237 | deliver = ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); |
238 | ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); | ||
239 | 238 | ||
240 | /* | 239 | /* |
241 | * IPv6 multicast router mode isnt currently supported. | 240 | * IPv6 multicast router mode isnt currently supported. |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index ad8066200f9d..9e5f305b2022 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -171,7 +171,9 @@ static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq) | |||
171 | 171 | ||
172 | static void nf_ct_frag6_evictor(void) | 172 | static void nf_ct_frag6_evictor(void) |
173 | { | 173 | { |
174 | local_bh_disable(); | ||
174 | inet_frag_evictor(&nf_init_frags, &nf_frags); | 175 | inet_frag_evictor(&nf_init_frags, &nf_frags); |
176 | local_bh_enable(); | ||
175 | } | 177 | } |
176 | 178 | ||
177 | static void nf_ct_frag6_expire(unsigned long data) | 179 | static void nf_ct_frag6_expire(unsigned long data) |
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index f93b57618582..97101dcde4c0 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -155,6 +155,9 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol) | |||
155 | struct sock *sk; | 155 | struct sock *sk; |
156 | int rc = -ESOCKTNOSUPPORT; | 156 | int rc = -ESOCKTNOSUPPORT; |
157 | 157 | ||
158 | if (!capable(CAP_NET_RAW)) | ||
159 | return -EPERM; | ||
160 | |||
158 | if (net != &init_net) | 161 | if (net != &init_net) |
159 | return -EAFNOSUPPORT; | 162 | return -EAFNOSUPPORT; |
160 | 163 | ||
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c index f728ffe288aa..019c780512e8 100644 --- a/net/llc/llc_c_ac.c +++ b/net/llc/llc_c_ac.c | |||
@@ -198,7 +198,7 @@ int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
198 | { | 198 | { |
199 | int rc = -ENOBUFS; | 199 | int rc = -ENOBUFS; |
200 | struct llc_sock *llc = llc_sk(sk); | 200 | struct llc_sock *llc = llc_sk(sk); |
201 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 201 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
202 | 202 | ||
203 | if (nskb) { | 203 | if (nskb) { |
204 | struct llc_sap *sap = llc->sap; | 204 | struct llc_sap *sap = llc->sap; |
@@ -223,7 +223,7 @@ int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
223 | { | 223 | { |
224 | int rc = -ENOBUFS; | 224 | int rc = -ENOBUFS; |
225 | struct llc_sock *llc = llc_sk(sk); | 225 | struct llc_sock *llc = llc_sk(sk); |
226 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 226 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
227 | 227 | ||
228 | if (nskb) { | 228 | if (nskb) { |
229 | struct llc_sap *sap = llc->sap; | 229 | struct llc_sap *sap = llc->sap; |
@@ -249,7 +249,7 @@ int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
249 | { | 249 | { |
250 | int rc = -ENOBUFS; | 250 | int rc = -ENOBUFS; |
251 | struct llc_sock *llc = llc_sk(sk); | 251 | struct llc_sock *llc = llc_sk(sk); |
252 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 252 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
253 | 253 | ||
254 | if (nskb) { | 254 | if (nskb) { |
255 | struct llc_sap *sap = llc->sap; | 255 | struct llc_sap *sap = llc->sap; |
@@ -282,7 +282,8 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb) | |||
282 | llc_pdu_decode_pf_bit(skb, &f_bit); | 282 | llc_pdu_decode_pf_bit(skb, &f_bit); |
283 | else | 283 | else |
284 | f_bit = 0; | 284 | f_bit = 0; |
285 | nskb = llc_alloc_frame(sk, llc->dev); | 285 | nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
286 | sizeof(struct llc_frmr_info)); | ||
286 | if (nskb) { | 287 | if (nskb) { |
287 | struct llc_sap *sap = llc->sap; | 288 | struct llc_sap *sap = llc->sap; |
288 | 289 | ||
@@ -306,7 +307,8 @@ int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb) | |||
306 | { | 307 | { |
307 | int rc = -ENOBUFS; | 308 | int rc = -ENOBUFS; |
308 | struct llc_sock *llc = llc_sk(sk); | 309 | struct llc_sock *llc = llc_sk(sk); |
309 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 310 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
311 | sizeof(struct llc_frmr_info)); | ||
310 | 312 | ||
311 | if (nskb) { | 313 | if (nskb) { |
312 | struct llc_sap *sap = llc->sap; | 314 | struct llc_sap *sap = llc->sap; |
@@ -336,7 +338,8 @@ int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
336 | struct llc_sock *llc = llc_sk(sk); | 338 | struct llc_sock *llc = llc_sk(sk); |
337 | 339 | ||
338 | llc_pdu_decode_pf_bit(skb, &f_bit); | 340 | llc_pdu_decode_pf_bit(skb, &f_bit); |
339 | nskb = llc_alloc_frame(sk, llc->dev); | 341 | nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, |
342 | sizeof(struct llc_frmr_info)); | ||
340 | if (nskb) { | 343 | if (nskb) { |
341 | struct llc_sap *sap = llc->sap; | 344 | struct llc_sap *sap = llc->sap; |
342 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); | 345 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); |
@@ -424,7 +427,7 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk, | |||
424 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); | 427 | struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); |
425 | int rc = -ENOBUFS; | 428 | int rc = -ENOBUFS; |
426 | struct llc_sock *llc = llc_sk(sk); | 429 | struct llc_sock *llc = llc_sk(sk); |
427 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 430 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
428 | 431 | ||
429 | if (nskb) { | 432 | if (nskb) { |
430 | struct llc_sap *sap = llc->sap; | 433 | struct llc_sap *sap = llc->sap; |
@@ -459,7 +462,7 @@ int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
459 | { | 462 | { |
460 | int rc = -ENOBUFS; | 463 | int rc = -ENOBUFS; |
461 | struct llc_sock *llc = llc_sk(sk); | 464 | struct llc_sock *llc = llc_sk(sk); |
462 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 465 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
463 | 466 | ||
464 | if (nskb) { | 467 | if (nskb) { |
465 | struct llc_sap *sap = llc->sap; | 468 | struct llc_sap *sap = llc->sap; |
@@ -483,7 +486,7 @@ int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
483 | { | 486 | { |
484 | int rc = -ENOBUFS; | 487 | int rc = -ENOBUFS; |
485 | struct llc_sock *llc = llc_sk(sk); | 488 | struct llc_sock *llc = llc_sk(sk); |
486 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 489 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
487 | 490 | ||
488 | if (nskb) { | 491 | if (nskb) { |
489 | struct llc_sap *sap = llc->sap; | 492 | struct llc_sap *sap = llc->sap; |
@@ -507,7 +510,7 @@ int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
507 | { | 510 | { |
508 | int rc = -ENOBUFS; | 511 | int rc = -ENOBUFS; |
509 | struct llc_sock *llc = llc_sk(sk); | 512 | struct llc_sock *llc = llc_sk(sk); |
510 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 513 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
511 | 514 | ||
512 | if (nskb) { | 515 | if (nskb) { |
513 | struct llc_sap *sap = llc->sap; | 516 | struct llc_sap *sap = llc->sap; |
@@ -531,7 +534,7 @@ int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
531 | { | 534 | { |
532 | int rc = -ENOBUFS; | 535 | int rc = -ENOBUFS; |
533 | struct llc_sock *llc = llc_sk(sk); | 536 | struct llc_sock *llc = llc_sk(sk); |
534 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 537 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
535 | 538 | ||
536 | if (nskb) { | 539 | if (nskb) { |
537 | struct llc_sap *sap = llc->sap; | 540 | struct llc_sap *sap = llc->sap; |
@@ -555,7 +558,7 @@ int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
555 | { | 558 | { |
556 | int rc = -ENOBUFS; | 559 | int rc = -ENOBUFS; |
557 | struct llc_sock *llc = llc_sk(sk); | 560 | struct llc_sock *llc = llc_sk(sk); |
558 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 561 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
559 | 562 | ||
560 | if (nskb) { | 563 | if (nskb) { |
561 | struct llc_sap *sap = llc->sap; | 564 | struct llc_sap *sap = llc->sap; |
@@ -579,7 +582,7 @@ int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
579 | { | 582 | { |
580 | int rc = -ENOBUFS; | 583 | int rc = -ENOBUFS; |
581 | struct llc_sock *llc = llc_sk(sk); | 584 | struct llc_sock *llc = llc_sk(sk); |
582 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 585 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
583 | 586 | ||
584 | if (nskb) { | 587 | if (nskb) { |
585 | struct llc_sap *sap = llc->sap; | 588 | struct llc_sap *sap = llc->sap; |
@@ -615,7 +618,7 @@ int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
615 | { | 618 | { |
616 | int rc = -ENOBUFS; | 619 | int rc = -ENOBUFS; |
617 | struct llc_sock *llc = llc_sk(sk); | 620 | struct llc_sock *llc = llc_sk(sk); |
618 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 621 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
619 | 622 | ||
620 | if (nskb) { | 623 | if (nskb) { |
621 | struct llc_sap *sap = llc->sap; | 624 | struct llc_sap *sap = llc->sap; |
@@ -639,7 +642,7 @@ int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) | |||
639 | { | 642 | { |
640 | int rc = -ENOBUFS; | 643 | int rc = -ENOBUFS; |
641 | struct llc_sock *llc = llc_sk(sk); | 644 | struct llc_sock *llc = llc_sk(sk); |
642 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 645 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
643 | 646 | ||
644 | if (nskb) { | 647 | if (nskb) { |
645 | struct llc_sap *sap = llc->sap; | 648 | struct llc_sap *sap = llc->sap; |
@@ -663,7 +666,7 @@ int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
663 | { | 666 | { |
664 | int rc = -ENOBUFS; | 667 | int rc = -ENOBUFS; |
665 | struct llc_sock *llc = llc_sk(sk); | 668 | struct llc_sock *llc = llc_sk(sk); |
666 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 669 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
667 | 670 | ||
668 | if (nskb) { | 671 | if (nskb) { |
669 | struct llc_sap *sap = llc->sap; | 672 | struct llc_sap *sap = llc->sap; |
@@ -688,7 +691,7 @@ int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb) | |||
688 | { | 691 | { |
689 | int rc = -ENOBUFS; | 692 | int rc = -ENOBUFS; |
690 | struct llc_sock *llc = llc_sk(sk); | 693 | struct llc_sock *llc = llc_sk(sk); |
691 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 694 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
692 | 695 | ||
693 | if (nskb) { | 696 | if (nskb) { |
694 | struct llc_sap *sap = llc->sap; | 697 | struct llc_sap *sap = llc->sap; |
@@ -712,7 +715,7 @@ int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
712 | { | 715 | { |
713 | int rc = -ENOBUFS; | 716 | int rc = -ENOBUFS; |
714 | struct llc_sock *llc = llc_sk(sk); | 717 | struct llc_sock *llc = llc_sk(sk); |
715 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 718 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
716 | 719 | ||
717 | if (nskb) { | 720 | if (nskb) { |
718 | struct llc_sap *sap = llc->sap; | 721 | struct llc_sap *sap = llc->sap; |
@@ -736,7 +739,7 @@ int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) | |||
736 | { | 739 | { |
737 | int rc = -ENOBUFS; | 740 | int rc = -ENOBUFS; |
738 | struct llc_sock *llc = llc_sk(sk); | 741 | struct llc_sock *llc = llc_sk(sk); |
739 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 742 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
740 | 743 | ||
741 | if (nskb) { | 744 | if (nskb) { |
742 | struct llc_sap *sap = llc->sap; | 745 | struct llc_sap *sap = llc->sap; |
@@ -770,7 +773,7 @@ int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb) | |||
770 | { | 773 | { |
771 | int rc = -ENOBUFS; | 774 | int rc = -ENOBUFS; |
772 | struct llc_sock *llc = llc_sk(sk); | 775 | struct llc_sock *llc = llc_sk(sk); |
773 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 776 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
774 | 777 | ||
775 | if (nskb) { | 778 | if (nskb) { |
776 | struct llc_sap *sap = llc->sap; | 779 | struct llc_sap *sap = llc->sap; |
@@ -799,7 +802,7 @@ int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb) | |||
799 | u8 f_bit; | 802 | u8 f_bit; |
800 | int rc = -ENOBUFS; | 803 | int rc = -ENOBUFS; |
801 | struct llc_sock *llc = llc_sk(sk); | 804 | struct llc_sock *llc = llc_sk(sk); |
802 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 805 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); |
803 | 806 | ||
804 | llc_pdu_decode_pf_bit(skb, &f_bit); | 807 | llc_pdu_decode_pf_bit(skb, &f_bit); |
805 | if (nskb) { | 808 | if (nskb) { |
@@ -956,7 +959,7 @@ static int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, | |||
956 | { | 959 | { |
957 | int rc = -ENOBUFS; | 960 | int rc = -ENOBUFS; |
958 | struct llc_sock *llc = llc_sk(sk); | 961 | struct llc_sock *llc = llc_sk(sk); |
959 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); | 962 | struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); |
960 | 963 | ||
961 | if (nskb) { | 964 | if (nskb) { |
962 | struct llc_sap *sap = llc->sap; | 965 | struct llc_sap *sap = llc->sap; |
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c index 248b5903bb13..50d5b10e23a2 100644 --- a/net/llc/llc_core.c +++ b/net/llc/llc_core.c | |||
@@ -25,8 +25,6 @@ | |||
25 | LIST_HEAD(llc_sap_list); | 25 | LIST_HEAD(llc_sap_list); |
26 | DEFINE_RWLOCK(llc_sap_list_lock); | 26 | DEFINE_RWLOCK(llc_sap_list_lock); |
27 | 27 | ||
28 | unsigned char llc_station_mac_sa[ETH_ALEN]; | ||
29 | |||
30 | /** | 28 | /** |
31 | * llc_sap_alloc - allocates and initializes sap. | 29 | * llc_sap_alloc - allocates and initializes sap. |
32 | * | 30 | * |
@@ -37,8 +35,8 @@ static struct llc_sap *llc_sap_alloc(void) | |||
37 | struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); | 35 | struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); |
38 | 36 | ||
39 | if (sap) { | 37 | if (sap) { |
38 | /* sap->laddr.mac - leave as a null, it's filled by bind */ | ||
40 | sap->state = LLC_SAP_STATE_ACTIVE; | 39 | sap->state = LLC_SAP_STATE_ACTIVE; |
41 | memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN); | ||
42 | rwlock_init(&sap->sk_list.lock); | 40 | rwlock_init(&sap->sk_list.lock); |
43 | atomic_set(&sap->refcnt, 1); | 41 | atomic_set(&sap->refcnt, 1); |
44 | } | 42 | } |
@@ -167,10 +165,6 @@ static int __init llc_init(void) | |||
167 | if (dev != NULL) | 165 | if (dev != NULL) |
168 | dev = next_net_device(dev); | 166 | dev = next_net_device(dev); |
169 | 167 | ||
170 | if (dev != NULL) | ||
171 | memcpy(llc_station_mac_sa, dev->dev_addr, ETH_ALEN); | ||
172 | else | ||
173 | memset(llc_station_mac_sa, 0, ETH_ALEN); | ||
174 | dev_add_pack(&llc_packet_type); | 168 | dev_add_pack(&llc_packet_type); |
175 | dev_add_pack(&llc_tr_packet_type); | 169 | dev_add_pack(&llc_tr_packet_type); |
176 | return 0; | 170 | return 0; |
@@ -185,7 +179,6 @@ static void __exit llc_exit(void) | |||
185 | module_init(llc_init); | 179 | module_init(llc_init); |
186 | module_exit(llc_exit); | 180 | module_exit(llc_exit); |
187 | 181 | ||
188 | EXPORT_SYMBOL(llc_station_mac_sa); | ||
189 | EXPORT_SYMBOL(llc_sap_list); | 182 | EXPORT_SYMBOL(llc_sap_list); |
190 | EXPORT_SYMBOL(llc_sap_list_lock); | 183 | EXPORT_SYMBOL(llc_sap_list_lock); |
191 | EXPORT_SYMBOL(llc_sap_find); | 184 | EXPORT_SYMBOL(llc_sap_find); |
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c index a69c5c427fe3..1c45f172991e 100644 --- a/net/llc/llc_input.c +++ b/net/llc/llc_input.c | |||
@@ -117,8 +117,12 @@ static inline int llc_fixup_skb(struct sk_buff *skb) | |||
117 | skb_pull(skb, llc_len); | 117 | skb_pull(skb, llc_len); |
118 | if (skb->protocol == htons(ETH_P_802_2)) { | 118 | if (skb->protocol == htons(ETH_P_802_2)) { |
119 | __be16 pdulen = eth_hdr(skb)->h_proto; | 119 | __be16 pdulen = eth_hdr(skb)->h_proto; |
120 | u16 data_size = ntohs(pdulen) - llc_len; | 120 | s32 data_size = ntohs(pdulen) - llc_len; |
121 | 121 | ||
122 | if (data_size < 0 || | ||
123 | ((skb_tail_pointer(skb) - | ||
124 | (u8 *)pdu) - llc_len) < data_size) | ||
125 | return 0; | ||
122 | if (unlikely(pskb_trim_rcsum(skb, data_size))) | 126 | if (unlikely(pskb_trim_rcsum(skb, data_size))) |
123 | return 0; | 127 | return 0; |
124 | } | 128 | } |
diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c index fa8324396db3..2e6cb79196bb 100644 --- a/net/llc/llc_pdu.c +++ b/net/llc/llc_pdu.c | |||
@@ -241,7 +241,7 @@ void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, struct llc_pdu_sn *prev_pdu, | |||
241 | FRMR_INFO_SET_PDU_INFO_2LONG_IND(frmr_info, vzyxw); | 241 | FRMR_INFO_SET_PDU_INFO_2LONG_IND(frmr_info, vzyxw); |
242 | FRMR_INFO_SET_PDU_INVALID_Nr_IND(frmr_info, vzyxw); | 242 | FRMR_INFO_SET_PDU_INVALID_Nr_IND(frmr_info, vzyxw); |
243 | FRMR_INFO_SET_PDU_INVALID_Ns_IND(frmr_info, vzyxw); | 243 | FRMR_INFO_SET_PDU_INVALID_Ns_IND(frmr_info, vzyxw); |
244 | skb_put(skb, 5); | 244 | skb_put(skb, sizeof(struct llc_frmr_info)); |
245 | } | 245 | } |
246 | 246 | ||
247 | /** | 247 | /** |
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c index ac3d93b210d2..a94bd56bcac6 100644 --- a/net/llc/llc_s_ac.c +++ b/net/llc/llc_s_ac.c | |||
@@ -103,7 +103,8 @@ int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb) | |||
103 | llc_pdu_decode_sa(skb, mac_da); | 103 | llc_pdu_decode_sa(skb, mac_da); |
104 | llc_pdu_decode_da(skb, mac_sa); | 104 | llc_pdu_decode_da(skb, mac_sa); |
105 | llc_pdu_decode_ssap(skb, &dsap); | 105 | llc_pdu_decode_ssap(skb, &dsap); |
106 | nskb = llc_alloc_frame(NULL, skb->dev); | 106 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
107 | sizeof(struct llc_xid_info)); | ||
107 | if (!nskb) | 108 | if (!nskb) |
108 | goto out; | 109 | goto out; |
109 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, | 110 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, |
@@ -144,11 +145,15 @@ int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb) | |||
144 | u8 mac_da[ETH_ALEN], mac_sa[ETH_ALEN], dsap; | 145 | u8 mac_da[ETH_ALEN], mac_sa[ETH_ALEN], dsap; |
145 | struct sk_buff *nskb; | 146 | struct sk_buff *nskb; |
146 | int rc = 1; | 147 | int rc = 1; |
148 | u32 data_size; | ||
147 | 149 | ||
148 | llc_pdu_decode_sa(skb, mac_da); | 150 | llc_pdu_decode_sa(skb, mac_da); |
149 | llc_pdu_decode_da(skb, mac_sa); | 151 | llc_pdu_decode_da(skb, mac_sa); |
150 | llc_pdu_decode_ssap(skb, &dsap); | 152 | llc_pdu_decode_ssap(skb, &dsap); |
151 | nskb = llc_alloc_frame(NULL, skb->dev); | 153 | |
154 | /* The test request command is type U (llc_len = 3) */ | ||
155 | data_size = ntohs(eth_hdr(skb)->h_proto) - 3; | ||
156 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); | ||
152 | if (!nskb) | 157 | if (!nskb) |
153 | goto out; | 158 | goto out; |
154 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, | 159 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, |
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c index 2525165e2e8f..e2ddde755019 100644 --- a/net/llc/llc_sap.c +++ b/net/llc/llc_sap.c | |||
@@ -24,20 +24,41 @@ | |||
24 | #include <net/tcp_states.h> | 24 | #include <net/tcp_states.h> |
25 | #include <linux/llc.h> | 25 | #include <linux/llc.h> |
26 | 26 | ||
27 | static int llc_mac_header_len(unsigned short devtype) | ||
28 | { | ||
29 | switch (devtype) { | ||
30 | case ARPHRD_ETHER: | ||
31 | case ARPHRD_LOOPBACK: | ||
32 | return sizeof(struct ethhdr); | ||
33 | #ifdef CONFIG_TR | ||
34 | case ARPHRD_IEEE802_TR: | ||
35 | return sizeof(struct trh_hdr); | ||
36 | #endif | ||
37 | } | ||
38 | return 0; | ||
39 | } | ||
40 | |||
27 | /** | 41 | /** |
28 | * llc_alloc_frame - allocates sk_buff for frame | 42 | * llc_alloc_frame - allocates sk_buff for frame |
29 | * @dev: network device this skb will be sent over | 43 | * @dev: network device this skb will be sent over |
44 | * @type: pdu type to allocate | ||
45 | * @data_size: data size to allocate | ||
30 | * | 46 | * |
31 | * Allocates an sk_buff for frame and initializes sk_buff fields. | 47 | * Allocates an sk_buff for frame and initializes sk_buff fields. |
32 | * Returns allocated skb or %NULL when out of memory. | 48 | * Returns allocated skb or %NULL when out of memory. |
33 | */ | 49 | */ |
34 | struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev) | 50 | struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, |
51 | u8 type, u32 data_size) | ||
35 | { | 52 | { |
36 | struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC); | 53 | int hlen = type == LLC_PDU_TYPE_U ? 3 : 4; |
54 | struct sk_buff *skb; | ||
55 | |||
56 | hlen += llc_mac_header_len(dev->type); | ||
57 | skb = alloc_skb(hlen + data_size, GFP_ATOMIC); | ||
37 | 58 | ||
38 | if (skb) { | 59 | if (skb) { |
39 | skb_reset_mac_header(skb); | 60 | skb_reset_mac_header(skb); |
40 | skb_reserve(skb, 50); | 61 | skb_reserve(skb, hlen); |
41 | skb_reset_network_header(skb); | 62 | skb_reset_network_header(skb); |
42 | skb_reset_transport_header(skb); | 63 | skb_reset_transport_header(skb); |
43 | skb->protocol = htons(ETH_P_802_2); | 64 | skb->protocol = htons(ETH_P_802_2); |
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c index 6f2ea2090322..83da13339490 100644 --- a/net/llc/llc_station.c +++ b/net/llc/llc_station.c | |||
@@ -253,13 +253,14 @@ static int llc_station_ac_inc_xid_r_cnt_by_1(struct sk_buff *skb) | |||
253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) | 253 | static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) |
254 | { | 254 | { |
255 | int rc = 1; | 255 | int rc = 1; |
256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 256 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
257 | sizeof(struct llc_xid_info)); | ||
257 | 258 | ||
258 | if (!nskb) | 259 | if (!nskb) |
259 | goto out; | 260 | goto out; |
260 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); | 261 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); |
261 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); | 262 | llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127); |
262 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa); | 263 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, skb->dev->dev_addr); |
263 | if (unlikely(rc)) | 264 | if (unlikely(rc)) |
264 | goto free; | 265 | goto free; |
265 | llc_station_send_pdu(nskb); | 266 | llc_station_send_pdu(nskb); |
@@ -274,7 +275,8 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
274 | { | 275 | { |
275 | u8 mac_da[ETH_ALEN], dsap; | 276 | u8 mac_da[ETH_ALEN], dsap; |
276 | int rc = 1; | 277 | int rc = 1; |
277 | struct sk_buff* nskb = llc_alloc_frame(NULL, skb->dev); | 278 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, |
279 | sizeof(struct llc_xid_info)); | ||
278 | 280 | ||
279 | if (!nskb) | 281 | if (!nskb) |
280 | goto out; | 282 | goto out; |
@@ -283,7 +285,7 @@ static int llc_station_ac_send_xid_r(struct sk_buff *skb) | |||
283 | llc_pdu_decode_ssap(skb, &dsap); | 285 | llc_pdu_decode_ssap(skb, &dsap); |
284 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 286 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
285 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); | 287 | llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); |
286 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 288 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
287 | if (unlikely(rc)) | 289 | if (unlikely(rc)) |
288 | goto free; | 290 | goto free; |
289 | llc_station_send_pdu(nskb); | 291 | llc_station_send_pdu(nskb); |
@@ -298,7 +300,12 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
298 | { | 300 | { |
299 | u8 mac_da[ETH_ALEN], dsap; | 301 | u8 mac_da[ETH_ALEN], dsap; |
300 | int rc = 1; | 302 | int rc = 1; |
301 | struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); | 303 | u32 data_size; |
304 | struct sk_buff *nskb; | ||
305 | |||
306 | /* The test request command is type U (llc_len = 3) */ | ||
307 | data_size = ntohs(eth_hdr(skb)->h_proto) - 3; | ||
308 | nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); | ||
302 | 309 | ||
303 | if (!nskb) | 310 | if (!nskb) |
304 | goto out; | 311 | goto out; |
@@ -307,7 +314,7 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb) | |||
307 | llc_pdu_decode_ssap(skb, &dsap); | 314 | llc_pdu_decode_ssap(skb, &dsap); |
308 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); | 315 | llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); |
309 | llc_pdu_init_as_test_rsp(nskb, skb); | 316 | llc_pdu_init_as_test_rsp(nskb, skb); |
310 | rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); | 317 | rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); |
311 | if (unlikely(rc)) | 318 | if (unlikely(rc)) |
312 | goto free; | 319 | goto free; |
313 | llc_station_send_pdu(nskb); | 320 | llc_station_send_pdu(nskb); |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 5ee431b6256c..aaa5480e204a 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -375,6 +375,18 @@ static int ieee80211_open(struct net_device *dev) | |||
375 | if (need_hw_reconfig) | 375 | if (need_hw_reconfig) |
376 | ieee80211_hw_config(local); | 376 | ieee80211_hw_config(local); |
377 | 377 | ||
378 | /* | ||
379 | * ieee80211_sta_work is disabled while network interface | ||
380 | * is down. Therefore, some configuration changes may not | ||
381 | * yet be effective. Trigger execution of ieee80211_sta_work | ||
382 | * to fix this. | ||
383 | */ | ||
384 | if(sdata->vif.type == IEEE80211_IF_TYPE_STA || | ||
385 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | ||
386 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | ||
387 | queue_work(local->hw.workqueue, &ifsta->work); | ||
388 | } | ||
389 | |||
378 | netif_start_queue(dev); | 390 | netif_start_queue(dev); |
379 | 391 | ||
380 | return 0; | 392 | return 0; |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 110eaf3ab58c..c20ef89acad6 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -360,7 +360,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
360 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; | 360 | struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; |
361 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 361 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
362 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; | 362 | bool use_protection = (erp_value & WLAN_ERP_USE_PROTECTION) != 0; |
363 | bool preamble_mode = (erp_value & WLAN_ERP_BARKER_PREAMBLE) != 0; | 363 | bool use_short_preamble = (erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0; |
364 | DECLARE_MAC_BUF(mac); | 364 | DECLARE_MAC_BUF(mac); |
365 | u32 changed = 0; | 365 | u32 changed = 0; |
366 | 366 | ||
@@ -376,16 +376,15 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
376 | changed |= BSS_CHANGED_ERP_CTS_PROT; | 376 | changed |= BSS_CHANGED_ERP_CTS_PROT; |
377 | } | 377 | } |
378 | 378 | ||
379 | if (preamble_mode != bss_conf->use_short_preamble) { | 379 | if (use_short_preamble != bss_conf->use_short_preamble) { |
380 | if (net_ratelimit()) { | 380 | if (net_ratelimit()) { |
381 | printk(KERN_DEBUG "%s: switched to %s barker preamble" | 381 | printk(KERN_DEBUG "%s: switched to %s barker preamble" |
382 | " (BSSID=%s)\n", | 382 | " (BSSID=%s)\n", |
383 | sdata->dev->name, | 383 | sdata->dev->name, |
384 | (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? | 384 | use_short_preamble ? "short" : "long", |
385 | "short" : "long", | ||
386 | print_mac(mac, ifsta->bssid)); | 385 | print_mac(mac, ifsta->bssid)); |
387 | } | 386 | } |
388 | bss_conf->use_short_preamble = preamble_mode; | 387 | bss_conf->use_short_preamble = use_short_preamble; |
389 | changed |= BSS_CHANGED_ERP_PREAMBLE; | 388 | changed |= BSS_CHANGED_ERP_PREAMBLE; |
390 | } | 389 | } |
391 | 390 | ||
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 92d85c38e4d2..d1ff3f885c5d 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -598,17 +598,24 @@ static int rose_release(struct socket *sock) | |||
598 | 598 | ||
599 | if (sk == NULL) return 0; | 599 | if (sk == NULL) return 0; |
600 | 600 | ||
601 | sock_hold(sk); | ||
602 | sock_orphan(sk); | ||
603 | lock_sock(sk); | ||
601 | rose = rose_sk(sk); | 604 | rose = rose_sk(sk); |
602 | 605 | ||
603 | switch (rose->state) { | 606 | switch (rose->state) { |
604 | case ROSE_STATE_0: | 607 | case ROSE_STATE_0: |
608 | release_sock(sk); | ||
605 | rose_disconnect(sk, 0, -1, -1); | 609 | rose_disconnect(sk, 0, -1, -1); |
610 | lock_sock(sk); | ||
606 | rose_destroy_socket(sk); | 611 | rose_destroy_socket(sk); |
607 | break; | 612 | break; |
608 | 613 | ||
609 | case ROSE_STATE_2: | 614 | case ROSE_STATE_2: |
610 | rose->neighbour->use--; | 615 | rose->neighbour->use--; |
616 | release_sock(sk); | ||
611 | rose_disconnect(sk, 0, -1, -1); | 617 | rose_disconnect(sk, 0, -1, -1); |
618 | lock_sock(sk); | ||
612 | rose_destroy_socket(sk); | 619 | rose_destroy_socket(sk); |
613 | break; | 620 | break; |
614 | 621 | ||
@@ -633,6 +640,8 @@ static int rose_release(struct socket *sock) | |||
633 | } | 640 | } |
634 | 641 | ||
635 | sock->sk = NULL; | 642 | sock->sk = NULL; |
643 | release_sock(sk); | ||
644 | sock_put(sk); | ||
636 | 645 | ||
637 | return 0; | 646 | return 0; |
638 | } | 647 | } |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 10b5c0887fff..b741618e4d54 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -184,10 +184,22 @@ static inline int qdisc_restart(struct net_device *dev) | |||
184 | 184 | ||
185 | void __qdisc_run(struct net_device *dev) | 185 | void __qdisc_run(struct net_device *dev) |
186 | { | 186 | { |
187 | do { | 187 | unsigned long start_time = jiffies; |
188 | if (!qdisc_restart(dev)) | 188 | |
189 | while (qdisc_restart(dev)) { | ||
190 | if (netif_queue_stopped(dev)) | ||
191 | break; | ||
192 | |||
193 | /* | ||
194 | * Postpone processing if | ||
195 | * 1. another process needs the CPU; | ||
196 | * 2. we've been doing it for too long. | ||
197 | */ | ||
198 | if (need_resched() || jiffies != start_time) { | ||
199 | netif_schedule(dev); | ||
189 | break; | 200 | break; |
190 | } while (!netif_queue_stopped(dev)); | 201 | } |
202 | } | ||
191 | 203 | ||
192 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); | 204 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); |
193 | } | 205 | } |