Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/s2io.c

+286 -687
-3
Documentation/networking/00-INDEX
··· 84 84 - IP policy-based routing 85 85 ray_cs.txt 86 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 87 skfp.txt 91 88 - SysKonnect FDDI (SK-5xxx, Compaq Netelligent) driver info. 92 89 smc9.txt
-568
Documentation/networking/sk98lin.txt
··· 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***
+1
drivers/atm/firestream.c
··· 978 978 /* Docs are vague about this atm_hdr field. By the way, the FS 979 979 * chip makes odd errors if lower bits are set.... -- REW */ 980 980 tc->atm_hdr = (vpi << 20) | (vci << 4); 981 + tmc0 = 0; 981 982 { 982 983 int pcr = atm_pcr_goal (txtp); 983 984
+1 -2
drivers/atm/he.c
··· 3000 3000 3001 3001 /* eeprom routines -- see 4.7 */ 3002 3002 3003 - u8 3004 - read_prom_byte(struct he_dev *he_dev, int addr) 3003 + static u8 read_prom_byte(struct he_dev *he_dev, int addr) 3005 3004 { 3006 3005 u32 val = 0, tmp_read = 0; 3007 3006 int i, j = 0;
+2 -4
drivers/atm/idt77252.c
··· 2016 2016 return 0; 2017 2017 } 2018 2018 2019 - int 2020 - idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb) 2019 + static int idt77252_send(struct atm_vcc *vcc, struct sk_buff *skb) 2021 2020 { 2022 2021 return idt77252_send_skb(vcc, skb, 0); 2023 2022 } ··· 3071 3072 return 0; 3072 3073 } 3073 3074 3074 - void 3075 - idt77252_dev_close(struct atm_dev *dev) 3075 + static void idt77252_dev_close(struct atm_dev *dev) 3076 3076 { 3077 3077 struct idt77252_dev *card = dev->dev_data; 3078 3078 u32 conf;
+2
drivers/atm/iphase.c
··· 958 958 959 959 /***************************** IA_LIB END *****************************/ 960 960 961 + #ifdef CONFIG_ATM_IA_DEBUG 961 962 static int tcnter = 0; 962 963 static void xdump( u_char* cp, int length, char* prefix ) 963 964 { ··· 993 992 } 994 993 995 994 } /* close xdump(... */ 995 + #endif /* CONFIG_ATM_IA_DEBUG */ 996 996 997 997 998 998 static struct atm_dev *ia_boards = NULL;
+1 -1
drivers/net/Kconfig
··· 2555 2555 2556 2556 config PASEMI_MAC 2557 2557 tristate "PA Semi 1/10Gbit MAC" 2558 - depends on PPC64 && PCI 2558 + depends on PPC_PASEMI && PCI 2559 2559 select PHYLIB 2560 2560 select INET_LRO 2561 2561 help
-2
drivers/net/bfin_mac.c
··· 575 575 static int bf537mac_hard_start_xmit(struct sk_buff *skb, 576 576 struct net_device *dev) 577 577 { 578 - struct bf537mac_local *lp = netdev_priv(dev); 579 578 unsigned int data; 580 579 581 580 current_tx_ptr->skb = skb; ··· 633 634 static void bf537mac_rx(struct net_device *dev) 634 635 { 635 636 struct sk_buff *skb, *new_skb; 636 - struct bf537mac_local *lp = netdev_priv(dev); 637 637 unsigned short len; 638 638 639 639 /* allocate a new skb for next time receive */
+1
drivers/net/bonding/bond_sysfs.c
··· 341 341 342 342 if (command[0] == '-') { 343 343 dev = NULL; 344 + original_mtu = 0; 344 345 bond_for_each_slave(bond, slave, i) 345 346 if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) { 346 347 dev = slave->dev;
+10 -8
drivers/net/forcedeth.c
··· 1854 1854 struct ring_desc* start_tx; 1855 1855 struct ring_desc* prev_tx; 1856 1856 struct nv_skb_map* prev_tx_ctx; 1857 + unsigned long flags; 1857 1858 1858 1859 /* add fragments to entries count */ 1859 1860 for (i = 0; i < fragments; i++) { ··· 1864 1863 1865 1864 empty_slots = nv_get_empty_tx_slots(np); 1866 1865 if (unlikely(empty_slots <= entries)) { 1867 - spin_lock_irq(&np->lock); 1866 + spin_lock_irqsave(&np->lock, flags); 1868 1867 netif_stop_queue(dev); 1869 1868 np->tx_stop = 1; 1870 - spin_unlock_irq(&np->lock); 1869 + spin_unlock_irqrestore(&np->lock, flags); 1871 1870 return NETDEV_TX_BUSY; 1872 1871 } 1873 1872 ··· 1930 1929 tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ? 1931 1930 NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0; 1932 1931 1933 - spin_lock_irq(&np->lock); 1932 + spin_lock_irqsave(&np->lock, flags); 1934 1933 1935 1934 /* set tx flags */ 1936 1935 start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); 1937 1936 np->put_tx.orig = put_tx; 1938 1937 1939 - spin_unlock_irq(&np->lock); 1938 + spin_unlock_irqrestore(&np->lock, flags); 1940 1939 1941 1940 dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", 1942 1941 dev->name, entries, tx_flags_extra); ··· 1972 1971 struct ring_desc_ex* prev_tx; 1973 1972 struct nv_skb_map* prev_tx_ctx; 1974 1973 struct nv_skb_map* start_tx_ctx; 1974 + unsigned long flags; 1975 1975 1976 1976 /* add fragments to entries count */ 1977 1977 for (i = 0; i < fragments; i++) { ··· 1982 1980 1983 1981 empty_slots = nv_get_empty_tx_slots(np); 1984 1982 if (unlikely(empty_slots <= entries)) { 1985 - spin_lock_irq(&np->lock); 1983 + spin_lock_irqsave(&np->lock, flags); 1986 1984 netif_stop_queue(dev); 1987 1985 np->tx_stop = 1; 1988 - spin_unlock_irq(&np->lock); 1986 + spin_unlock_irqrestore(&np->lock, flags); 1989 1987 return NETDEV_TX_BUSY; 1990 1988 } 1991 1989 ··· 2061 2059 start_tx->txvlan = 0; 2062 2060 } 2063 2061 2064 - spin_lock_irq(&np->lock); 2062 + spin_lock_irqsave(&np->lock, flags); 2065 2063 2066 2064 if (np->tx_limit) { 2067 2065 /* Limit the number of outstanding tx. Setup all fragments, but ··· 2087 2085 start_tx->flaglen |= cpu_to_le32(tx_flags | tx_flags_extra); 2088 2086 np->put_tx.ex = put_tx; 2089 2087 2090 - spin_unlock_irq(&np->lock); 2088 + spin_unlock_irqrestore(&np->lock, flags); 2091 2089 2092 2090 dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", 2093 2091 dev->name, entries, tx_flags_extra);
+2 -2
drivers/net/ibm_newemac/core.c
··· 1242 1242 static inline u16 emac_tx_csum(struct emac_instance *dev, 1243 1243 struct sk_buff *skb) 1244 1244 { 1245 - if (emac_has_feature(dev, EMAC_FTR_HAS_TAH && 1246 - skb->ip_summed == CHECKSUM_PARTIAL)) { 1245 + if (emac_has_feature(dev, EMAC_FTR_HAS_TAH) && 1246 + (skb->ip_summed == CHECKSUM_PARTIAL)) { 1247 1247 ++dev->stats.tx_packets_csum; 1248 1248 return EMAC_TX_CTRL_TAH_CSUM; 1249 1249 }
+1 -1
drivers/net/s2io.c
··· 86 86 #include "s2io.h" 87 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 91 /* S2io Driver name & version. */ 92 92 static char s2io_driver_name[] = "Neterion";
+6
drivers/net/tulip/eeprom.c
··· 343 343 void __iomem *ee_addr = tp->base_addr + CSR9; 344 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 352 iowrite32(EE_ENB & ~EE_CS, ee_addr); 347 353 iowrite32(EE_ENB, ee_addr); 348 354
+6 -1
drivers/net/tulip/tulip_core.c
··· 1437 1437 EEPROM. 1438 1438 */ 1439 1439 ee_data = tp->eeprom; 1440 + memset(ee_data, 0, sizeof(tp->eeprom)); 1440 1441 sum = 0; 1441 1442 if (chip_idx == LC82C168) { 1442 1443 for (i = 0; i < 3; i++) { ··· 1459 1458 /* A serial EEPROM interface, we read now and sort it out later. */ 1460 1459 int sa_offset = 0; 1461 1460 int ee_addr_size = tulip_read_eeprom(dev, 0xff, 8) & 0x40000 ? 8 : 6; 1461 + int ee_max_addr = ((1 << ee_addr_size) - 1) * sizeof(u16); 1462 1462 1463 - for (i = 0; i < sizeof(tp->eeprom); i+=2) { 1463 + if (ee_max_addr > sizeof(tp->eeprom)) 1464 + ee_max_addr = sizeof(tp->eeprom); 1465 + 1466 + for (i = 0; i < ee_max_addr ; i += sizeof(u16)) { 1464 1467 u16 data = tulip_read_eeprom(dev, i/2, ee_addr_size); 1465 1468 ee_data[i] = data & 0xff; 1466 1469 ee_data[i + 1] = data >> 8;
+1 -1
drivers/net/usb/Kconfig
··· 129 129 130 130 config USB_NET_AX8817X 131 131 tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" 132 - depends on USB_USBNET && NET_ETHERNET 132 + depends on USB_USBNET 133 133 select CRC32 134 134 default y 135 135 help
+1 -1
drivers/net/usb/dm9601.c
··· 354 354 struct dev_mc_list *mc_list = net->mc_list; 355 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 358 u32 crc = ether_crc(ETH_ALEN, mc_list->dmi_addr) >> 26; 359 359 hashes[crc >> 3] |= 1 << (crc & 0x7); 360 360 }
-4
drivers/net/usb/pegasus.c
··· 1128 1128 { 1129 1129 pegasus_t *pegasus; 1130 1130 1131 - if (in_atomic()) 1132 - return 0; 1133 - 1134 1131 pegasus = netdev_priv(dev); 1135 1132 mii_ethtool_gset(&pegasus->mii, ecmd); 1136 - 1137 1133 return 0; 1138 1134 } 1139 1135
+1 -1
drivers/net/wan/lapbether.c
··· 58 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
+6 -1
drivers/net/wireless/b43/dma.c
··· 574 574 } 575 575 576 576 if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) { 577 + b43err(ring->dev->wl, "RX DMA buffer allocation failed\n"); 577 578 dev_kfree_skb_any(skb); 578 579 return -EIO; 579 580 } ··· 830 829 DMA_TO_DEVICE); 831 830 832 831 if (b43_dma_mapping_error(ring, dma_test, 833 - b43_txhdr_size(dev), 1)) 832 + b43_txhdr_size(dev), 1)) { 833 + 834 + b43err(dev->wl, 835 + "TXHDR DMA allocation failed\n"); 834 836 goto err_kfree_txhdr_cache; 837 + } 835 838 } 836 839 837 840 dma_unmap_single(dev->dev->dev,
+4 -2
drivers/net/wireless/b43/pcmcia.c
··· 91 91 92 92 dev->conf.ConfigBase = parse.config.base; 93 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 97 dev->io.BasePort2 = 0; 96 98 dev->io.NumPorts2 = 0; ··· 114 112 if (res != CS_SUCCESS) 115 113 goto err_disable; 116 114 117 - dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; 118 - dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; 115 + dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 116 + dev->irq.IRQInfo1 = IRQ_LEVEL_ID; 119 117 dev->irq.Handler = NULL; /* The handler is registered later. */ 120 118 dev->irq.Instance = NULL; 121 119 res = pcmcia_request_irq(dev, &dev->irq);
-2
drivers/net/wireless/libertas/if_cs.c
··· 677 677 678 678 /* Card has a command result for us */ 679 679 if (*ireg & IF_CS_C_S_CMD_UPLD_RDY) { 680 - spin_lock(&priv->driver_lock); 681 680 ret = if_cs_receive_cmdres(priv, priv->upld_buf, &priv->upld_len); 682 - spin_unlock(&priv->driver_lock); 683 681 if (ret < 0) 684 682 lbs_pr_err("could not receive cmd from card\n"); 685 683 }
+11 -2
drivers/net/wireless/rt2x00/rt2x00dev.c
··· 1252 1252 1253 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 1265 retval = rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_SLEEP); 1258 1266 if (retval) 1259 - return retval; 1267 + WARNING(rt2x00dev, "Device failed to enter sleep state, " 1268 + "continue suspending.\n"); 1260 1269 1261 1270 return 0; 1262 1271 }
+4 -2
include/linux/netdevice.h
··· 1105 1105 } 1106 1106 1107 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 1111 extern void dev_kfree_skb_irq(struct sk_buff *skb); 1111 1112 1112 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 1117 extern void dev_kfree_skb_any(struct sk_buff *skb); 1116 1118
-1
include/net/llc.h
··· 65 65 66 66 extern struct list_head llc_sap_list; 67 67 extern rwlock_t llc_sap_list_lock; 68 - extern unsigned char llc_station_mac_sa[ETH_ALEN]; 69 68 70 69 extern int llc_rcv(struct sk_buff *skb, struct net_device *dev, 71 70 struct packet_type *pt, struct net_device *orig_dev);
+2 -2
include/net/llc_pdu.h
··· 381 381 xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */ 382 382 xid_info->type = svcs_supported; 383 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 406 xid_info->fmt_id = LLC_XID_FMT_ID; 407 407 xid_info->type = svcs_supported; 408 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 412 /* LLC Type 2 FRMR response information field format */
+5 -2
include/net/llc_sap.h
··· 1 1 #ifndef LLC_SAP_H 2 2 #define LLC_SAP_H 3 + 4 + #include <asm/types.h> 5 + 3 6 /* 4 7 * Copyright (c) 1997 by Procom Technology,Inc. 5 8 * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br> ··· 22 19 extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); 23 20 extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, 24 21 unsigned char prim); 25 - extern struct sk_buff *llc_alloc_frame(struct sock *sk, 26 - struct net_device *dev); 22 + extern struct sk_buff *llc_alloc_frame(struct sock *sk, struct net_device *dev, 23 + u8 type, u32 data_size); 27 24 28 25 extern void llc_build_and_send_test_pkt(struct llc_sap *sap, 29 26 struct sk_buff *skb,
+19 -1
net/8021q/vlan.c
··· 384 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 399 static int vlan_device_event(struct notifier_block *unused, unsigned long event, 388 400 void *ptr) 389 401 { 390 402 struct net_device *dev = ptr; 391 - struct vlan_group *grp = __vlan_find_group(dev->ifindex); 403 + struct vlan_group *grp; 392 404 int i, flgs; 393 405 struct net_device *vlandev; 394 406 395 407 if (dev_net(dev) != &init_net) 396 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 416 if (!grp) 399 417 goto out; 400 418
+5
net/8021q/vlan.h
··· 45 45 46 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 53 #endif /* !(__BEN_VLAN_802_1Q_INC__) */
-5
net/8021q/vlanproc.c
··· 210 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 213 /* start read of /proc/net/vlan/config */ 219 214 static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) 220 215 __acquires(dev_base_lock)
+40
net/bluetooth/af_bluetooth.c
··· 53 53 /* Bluetooth sockets */ 54 54 #define BT_MAX_PROTO 8 55 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 80 static DEFINE_RWLOCK(bt_proto_lock); 57 81 58 82 int bt_sock_register(int proto, struct net_proto_family *ops) ··· 119 95 } 120 96 EXPORT_SYMBOL(bt_sock_unregister); 121 97 98 + static void bt_reclassify_sock_lock(struct socket *sock, int proto) 99 + { 100 + struct sock *sk = sock->sk; 101 + 102 + if (!sk) 103 + return; 104 + BUG_ON(sock_owned_by_user(sk)); 105 + 106 + sock_lock_init_class_and_name(sk, 107 + bt_slock_key_strings[proto], 108 + &bt_slock_key[proto], 109 + bt_key_strings[proto], 110 + &bt_lock_key[proto]); 111 + } 112 + 122 113 static int bt_sock_create(struct net *net, struct socket *sock, int proto) 123 114 { 124 115 int err; ··· 156 117 157 118 if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { 158 119 err = bt_proto[proto]->create(net, sock, proto); 120 + bt_reclassify_sock_lock(sock, proto); 159 121 module_put(bt_proto[proto]->owner); 160 122 } 161 123
+1 -1
net/bluetooth/hci_sock.c
··· 84 84 }; 85 85 86 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 90 /* Send frame to RAW socket */
+1 -1
net/bluetooth/l2cap.c
··· 62 62 static const struct proto_ops l2cap_sock_ops; 63 63 64 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 68 static void __l2cap_sock_close(struct sock *sk, int reason);
+1 -1
net/bluetooth/rfcomm/core.c
··· 423 423 424 424 rfcomm_dlc_lock(d); 425 425 d->state = BT_CLOSED; 426 - d->state_change(d, err); 427 426 rfcomm_dlc_unlock(d); 427 + d->state_change(d, err); 428 428 429 429 skb_queue_purge(&d->tx_queue); 430 430 rfcomm_dlc_unlink(d);
+1 -1
net/bluetooth/rfcomm/sock.c
··· 60 60 static const struct proto_ops rfcomm_sock_ops; 61 61 62 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 66 static void rfcomm_sock_close(struct sock *sk);
-5
net/bluetooth/rfcomm/tty.c
··· 570 570 return; 571 571 572 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 573 rfcomm_dev_put(dev); 578 - rfcomm_dlc_lock(dlc); 579 574 } 580 575 } else 581 576 tty_hangup(dev->tty);
+1 -1
net/bluetooth/sco.c
··· 58 58 static const struct proto_ops sco_sock_ops; 59 59 60 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 64 static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent);
+3
net/ipv4/inet_fragment.c
··· 86 86 void inet_frags_exit_net(struct netns_frags *nf, struct inet_frags *f) 87 87 { 88 88 nf->low_thresh = 0; 89 + 90 + local_bh_disable(); 89 91 inet_frag_evictor(nf, f); 92 + local_bh_enable(); 90 93 } 91 94 EXPORT_SYMBOL(inet_frags_exit_net); 92 95
+1 -1
net/ipv4/ip_forward.c
··· 85 85 if (opt->is_strictroute && rt->rt_dst != rt->rt_gateway) 86 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 89 (ip_hdr(skb)->frag_off & htons(IP_DF))) && !skb->local_df) { 90 90 IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); 91 91 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
+2 -2
net/ipv4/udp.c
··· 1551 1551 __acquires(udp_hash_lock) 1552 1552 { 1553 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 1557 static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) 1558 1558 { 1559 1559 struct sock *sk; 1560 1560 1561 - if (v == (void *)1) 1561 + if (v == SEQ_START_TOKEN) 1562 1562 sk = udp_get_idx(seq, 0); 1563 1563 else 1564 1564 sk = udp_get_next(seq, v);
+19
net/ipv6/addrconf.c
··· 776 776 struct inet6_dev *idev = ifp->idev; 777 777 struct in6_addr addr, *tmpaddr; 778 778 unsigned long tmp_prefered_lft, tmp_valid_lft, tmp_cstamp, tmp_tstamp; 779 + unsigned long regen_advance; 779 780 int tmp_plen; 780 781 int ret = 0; 781 782 int max_addresses; ··· 837 836 tmp_tstamp = ifp->tstamp; 838 837 spin_unlock_bh(&ifp->lock); 839 838 839 + regen_advance = idev->cnf.regen_max_retry * 840 + idev->cnf.dad_transmits * 841 + idev->nd_parms->retrans_time / HZ; 840 842 write_unlock(&idev->lock); 843 + 844 + /* A temporary address is created only if this calculated Preferred 845 + * Lifetime is greater than REGEN_ADVANCE time units. In particular, 846 + * an implementation must not create a temporary address with a zero 847 + * Preferred Lifetime. 848 + */ 849 + if (tmp_prefered_lft <= regen_advance) { 850 + in6_ifa_put(ifp); 851 + in6_dev_put(idev); 852 + ret = -1; 853 + goto out; 854 + } 841 855 842 856 addr_flags = IFA_F_TEMPORARY; 843 857 /* set in addrconf_prefix_rcv() */ ··· 1850 1834 * lifetimes of an existing temporary address 1851 1835 * when processing a Prefix Information Option. 1852 1836 */ 1837 + if (ifp != ift->ifpub) 1838 + continue; 1839 + 1853 1840 spin_lock(&ift->lock); 1854 1841 flags = ift->flags; 1855 1842 if (ift->valid_lft > valid_lft &&
+2 -2
net/ipv6/icmp.c
··· 440 440 } 441 441 442 442 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6)) 443 - goto out; 443 + goto out_dst_release; 444 444 445 445 if (ip6_dst_lookup(sk, &dst2, &fl)) 446 - goto out; 446 + goto out_dst_release; 447 447 448 448 err = xfrm_lookup(&dst2, &fl, sk, XFRM_LOOKUP_ICMP); 449 449 if (err == -ENOENT) {
+1 -2
net/ipv6/ip6_input.c
··· 234 234 IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS); 235 235 236 236 hdr = ipv6_hdr(skb); 237 - deliver = unlikely(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) || 238 - ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); 237 + deliver = ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL); 239 238 240 239 /* 241 240 * IPv6 multicast router mode isnt currently supported.
+2
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 171 171 172 172 static void nf_ct_frag6_evictor(void) 173 173 { 174 + local_bh_disable(); 174 175 inet_frag_evictor(&nf_init_frags, &nf_frags); 176 + local_bh_enable(); 175 177 } 176 178 177 179 static void nf_ct_frag6_expire(unsigned long data)
+3
net/llc/af_llc.c
··· 155 155 struct sock *sk; 156 156 int rc = -ESOCKTNOSUPPORT; 157 157 158 + if (!capable(CAP_NET_RAW)) 159 + return -EPERM; 160 + 158 161 if (net != &init_net) 159 162 return -EAFNOSUPPORT; 160 163
+25 -22
net/llc/llc_c_ac.c
··· 198 198 { 199 199 int rc = -ENOBUFS; 200 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 203 if (nskb) { 204 204 struct llc_sap *sap = llc->sap; ··· 223 223 { 224 224 int rc = -ENOBUFS; 225 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 228 if (nskb) { 229 229 struct llc_sap *sap = llc->sap; ··· 249 249 { 250 250 int rc = -ENOBUFS; 251 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 254 if (nskb) { 255 255 struct llc_sap *sap = llc->sap; ··· 282 282 llc_pdu_decode_pf_bit(skb, &f_bit); 283 283 else 284 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 287 if (nskb) { 287 288 struct llc_sap *sap = llc->sap; 288 289 ··· 307 306 { 308 307 int rc = -ENOBUFS; 309 308 struct llc_sock *llc = llc_sk(sk); 310 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 309 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 310 + sizeof(struct llc_frmr_info)); 311 311 312 312 if (nskb) { 313 313 struct llc_sap *sap = llc->sap; ··· 338 336 struct llc_sock *llc = llc_sk(sk); 339 337 340 338 llc_pdu_decode_pf_bit(skb, &f_bit); 341 - nskb = llc_alloc_frame(sk, llc->dev); 339 + nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 340 + sizeof(struct llc_frmr_info)); 342 341 if (nskb) { 343 342 struct llc_sap *sap = llc->sap; 344 343 struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); ··· 427 424 struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); 428 425 int rc = -ENOBUFS; 429 426 struct llc_sock *llc = llc_sk(sk); 430 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 427 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); 431 428 432 429 if (nskb) { 433 430 struct llc_sap *sap = llc->sap; ··· 462 459 { 463 460 int rc = -ENOBUFS; 464 461 struct llc_sock *llc = llc_sk(sk); 465 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 462 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 466 463 467 464 if (nskb) { 468 465 struct llc_sap *sap = llc->sap; ··· 486 483 { 487 484 int rc = -ENOBUFS; 488 485 struct llc_sock *llc = llc_sk(sk); 489 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 486 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 490 487 491 488 if (nskb) { 492 489 struct llc_sap *sap = llc->sap; ··· 510 507 { 511 508 int rc = -ENOBUFS; 512 509 struct llc_sock *llc = llc_sk(sk); 513 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 510 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 514 511 515 512 if (nskb) { 516 513 struct llc_sap *sap = llc->sap; ··· 534 531 { 535 532 int rc = -ENOBUFS; 536 533 struct llc_sock *llc = llc_sk(sk); 537 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 534 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 538 535 539 536 if (nskb) { 540 537 struct llc_sap *sap = llc->sap; ··· 558 555 { 559 556 int rc = -ENOBUFS; 560 557 struct llc_sock *llc = llc_sk(sk); 561 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 558 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 562 559 563 560 if (nskb) { 564 561 struct llc_sap *sap = llc->sap; ··· 582 579 { 583 580 int rc = -ENOBUFS; 584 581 struct llc_sock *llc = llc_sk(sk); 585 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 582 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 586 583 587 584 if (nskb) { 588 585 struct llc_sap *sap = llc->sap; ··· 618 615 { 619 616 int rc = -ENOBUFS; 620 617 struct llc_sock *llc = llc_sk(sk); 621 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 618 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 622 619 623 620 if (nskb) { 624 621 struct llc_sap *sap = llc->sap; ··· 642 639 { 643 640 int rc = -ENOBUFS; 644 641 struct llc_sock *llc = llc_sk(sk); 645 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 642 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 646 643 647 644 if (nskb) { 648 645 struct llc_sap *sap = llc->sap; ··· 666 663 { 667 664 int rc = -ENOBUFS; 668 665 struct llc_sock *llc = llc_sk(sk); 669 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 666 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 670 667 671 668 if (nskb) { 672 669 struct llc_sap *sap = llc->sap; ··· 691 688 { 692 689 int rc = -ENOBUFS; 693 690 struct llc_sock *llc = llc_sk(sk); 694 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 691 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 695 692 696 693 if (nskb) { 697 694 struct llc_sap *sap = llc->sap; ··· 715 712 { 716 713 int rc = -ENOBUFS; 717 714 struct llc_sock *llc = llc_sk(sk); 718 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 715 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 719 716 720 717 if (nskb) { 721 718 struct llc_sap *sap = llc->sap; ··· 739 736 { 740 737 int rc = -ENOBUFS; 741 738 struct llc_sock *llc = llc_sk(sk); 742 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 739 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 743 740 744 741 if (nskb) { 745 742 struct llc_sap *sap = llc->sap; ··· 773 770 { 774 771 int rc = -ENOBUFS; 775 772 struct llc_sock *llc = llc_sk(sk); 776 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 773 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); 777 774 778 775 if (nskb) { 779 776 struct llc_sap *sap = llc->sap; ··· 802 799 u8 f_bit; 803 800 int rc = -ENOBUFS; 804 801 struct llc_sock *llc = llc_sk(sk); 805 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 802 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_U, 0); 806 803 807 804 llc_pdu_decode_pf_bit(skb, &f_bit); 808 805 if (nskb) { ··· 959 956 { 960 957 int rc = -ENOBUFS; 961 958 struct llc_sock *llc = llc_sk(sk); 962 - struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev); 959 + struct sk_buff *nskb = llc_alloc_frame(sk, llc->dev, LLC_PDU_TYPE_S, 0); 963 960 964 961 if (nskb) { 965 962 struct llc_sap *sap = llc->sap;
+1 -8
net/llc/llc_core.c
··· 25 25 LIST_HEAD(llc_sap_list); 26 26 DEFINE_RWLOCK(llc_sap_list_lock); 27 27 28 - unsigned char llc_station_mac_sa[ETH_ALEN]; 29 - 30 28 /** 31 29 * llc_sap_alloc - allocates and initializes sap. 32 30 * ··· 35 37 struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); 36 38 37 39 if (sap) { 40 + /* sap->laddr.mac - leave as a null, it's filled by bind */ 38 41 sap->state = LLC_SAP_STATE_ACTIVE; 39 - memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN); 40 42 rwlock_init(&sap->sk_list.lock); 41 43 atomic_set(&sap->refcnt, 1); 42 44 } ··· 165 167 if (dev != NULL) 166 168 dev = next_net_device(dev); 167 169 168 - if (dev != NULL) 169 - memcpy(llc_station_mac_sa, dev->dev_addr, ETH_ALEN); 170 - else 171 - memset(llc_station_mac_sa, 0, ETH_ALEN); 172 170 dev_add_pack(&llc_packet_type); 173 171 dev_add_pack(&llc_tr_packet_type); 174 172 return 0; ··· 179 185 module_init(llc_init); 180 186 module_exit(llc_exit); 181 187 182 - EXPORT_SYMBOL(llc_station_mac_sa); 183 188 EXPORT_SYMBOL(llc_sap_list); 184 189 EXPORT_SYMBOL(llc_sap_list_lock); 185 190 EXPORT_SYMBOL(llc_sap_find);
+5 -1
net/llc/llc_input.c
··· 117 117 skb_pull(skb, llc_len); 118 118 if (skb->protocol == htons(ETH_P_802_2)) { 119 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 126 if (unlikely(pskb_trim_rcsum(skb, data_size))) 123 127 return 0; 124 128 }
+1 -1
net/llc/llc_pdu.c
··· 241 241 FRMR_INFO_SET_PDU_INFO_2LONG_IND(frmr_info, vzyxw); 242 242 FRMR_INFO_SET_PDU_INVALID_Nr_IND(frmr_info, vzyxw); 243 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 /**
+7 -2
net/llc/llc_s_ac.c
··· 103 103 llc_pdu_decode_sa(skb, mac_da); 104 104 llc_pdu_decode_da(skb, mac_sa); 105 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 108 if (!nskb) 108 109 goto out; 109 110 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, ··· 145 144 u8 mac_da[ETH_ALEN], mac_sa[ETH_ALEN], dsap; 146 145 struct sk_buff *nskb; 147 146 int rc = 1; 147 + u32 data_size; 148 148 149 149 llc_pdu_decode_sa(skb, mac_da); 150 150 llc_pdu_decode_da(skb, mac_sa); 151 151 llc_pdu_decode_ssap(skb, &dsap); 152 - nskb = llc_alloc_frame(NULL, skb->dev); 152 + 153 + /* The test request command is type U (llc_len = 3) */ 154 + data_size = ntohs(eth_hdr(skb)->h_proto) - 3; 155 + nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); 153 156 if (!nskb) 154 157 goto out; 155 158 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap,
+24 -3
net/llc/llc_sap.c
··· 24 24 #include <net/tcp_states.h> 25 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 42 * llc_alloc_frame - allocates sk_buff for frame 29 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 47 * Allocates an sk_buff for frame and initializes sk_buff fields. 32 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 59 if (skb) { 39 60 skb_reset_mac_header(skb); 40 - skb_reserve(skb, 50); 61 + skb_reserve(skb, hlen); 41 62 skb_reset_network_header(skb); 42 63 skb_reset_transport_header(skb); 43 64 skb->protocol = htons(ETH_P_802_2);
+13 -6
net/llc/llc_station.c
··· 253 253 static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb) 254 254 { 255 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 259 if (!nskb) 259 260 goto out; 260 261 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD); 261 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 264 if (unlikely(rc)) 264 265 goto free; 265 266 llc_station_send_pdu(nskb); ··· 275 274 { 276 275 u8 mac_da[ETH_ALEN], dsap; 277 276 int rc = 1; 278 - struct sk_buff* nskb = llc_alloc_frame(NULL, skb->dev); 277 + struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, 278 + sizeof(struct llc_xid_info)); 279 279 280 280 if (!nskb) 281 281 goto out; ··· 285 283 llc_pdu_decode_ssap(skb, &dsap); 286 284 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); 287 285 llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127); 288 - rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); 286 + rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); 289 287 if (unlikely(rc)) 290 288 goto free; 291 289 llc_station_send_pdu(nskb); ··· 300 298 { 301 299 u8 mac_da[ETH_ALEN], dsap; 302 300 int rc = 1; 303 - struct sk_buff *nskb = llc_alloc_frame(NULL, skb->dev); 301 + u32 data_size; 302 + struct sk_buff *nskb; 303 + 304 + /* The test request command is type U (llc_len = 3) */ 305 + data_size = ntohs(eth_hdr(skb)->h_proto) - 3; 306 + nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size); 304 307 305 308 if (!nskb) 306 309 goto out; ··· 314 307 llc_pdu_decode_ssap(skb, &dsap); 315 308 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP); 316 309 llc_pdu_init_as_test_rsp(nskb, skb); 317 - rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da); 310 + rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da); 318 311 if (unlikely(rc)) 319 312 goto free; 320 313 llc_station_send_pdu(nskb);
+12
net/mac80211/ieee80211.c
··· 375 375 if (need_hw_reconfig) 376 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 390 netif_start_queue(dev); 379 391 380 392 return 0;
+4 -5
net/mac80211/ieee80211_sta.c
··· 360 360 struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; 361 361 struct ieee80211_if_sta *ifsta = &sdata->u.sta; 362 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 364 DECLARE_MAC_BUF(mac); 365 365 u32 changed = 0; 366 366 ··· 376 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 380 if (net_ratelimit()) { 381 381 printk(KERN_DEBUG "%s: switched to %s barker preamble" 382 382 " (BSSID=%s)\n", 383 383 sdata->dev->name, 384 - (preamble_mode == WLAN_ERP_PREAMBLE_SHORT) ? 385 - "short" : "long", 384 + use_short_preamble ? "short" : "long", 386 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 388 changed |= BSS_CHANGED_ERP_PREAMBLE; 390 389 } 391 390
+9
net/rose/af_rose.c
··· 598 598 599 599 if (sk == NULL) return 0; 600 600 601 + sock_hold(sk); 602 + sock_orphan(sk); 603 + lock_sock(sk); 601 604 rose = rose_sk(sk); 602 605 603 606 switch (rose->state) { 604 607 case ROSE_STATE_0: 608 + release_sock(sk); 605 609 rose_disconnect(sk, 0, -1, -1); 610 + lock_sock(sk); 606 611 rose_destroy_socket(sk); 607 612 break; 608 613 609 614 case ROSE_STATE_2: 610 615 rose->neighbour->use--; 616 + release_sock(sk); 611 617 rose_disconnect(sk, 0, -1, -1); 618 + lock_sock(sk); 612 619 rose_destroy_socket(sk); 613 620 break; 614 621 ··· 640 633 } 641 634 642 635 sock->sk = NULL; 636 + release_sock(sk); 637 + sock_put(sk); 643 638 644 639 return 0; 645 640 }
+15 -3
net/sched/sch_generic.c
··· 184 184 185 185 void __qdisc_run(struct net_device *dev) 186 186 { 187 - do { 188 - if (!qdisc_restart(dev)) 187 + unsigned long start_time = jiffies; 188 + 189 + while (qdisc_restart(dev)) { 190 + if (netif_queue_stopped(dev)) 189 191 break; 190 - } while (!netif_queue_stopped(dev)); 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); 200 + break; 201 + } 202 + } 191 203 192 204 clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); 193 205 }