diff options
30 files changed, 321 insertions, 231 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 7f6c051cac65..0f6d13bd4688 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -532,13 +532,13 @@ L: netdev@vger.kernel.org | |||
532 | S: Maintained | 532 | S: Maintained |
533 | 533 | ||
534 | ASUS ACPI EXTRAS DRIVER | 534 | ASUS ACPI EXTRAS DRIVER |
535 | P: Corentin Chary | ||
536 | M: corentincj@iksaif.net | ||
535 | P: Karol Kozimor | 537 | P: Karol Kozimor |
536 | M: sziwan@users.sourceforge.net | 538 | M: sziwan@users.sourceforge.net |
537 | P: Julien Lerouge | ||
538 | M: julien.lerouge@free.fr | ||
539 | L: acpi4asus-user@lists.sourceforge.net | 539 | L: acpi4asus-user@lists.sourceforge.net |
540 | W: http://sourceforge.net/projects/acpi4asus | 540 | W: http://sourceforge.net/projects/acpi4asus |
541 | W: http://julien.lerouge.free.fr | 541 | W: http://xf.iksaif.net/acpi4asus |
542 | S: Maintained | 542 | S: Maintained |
543 | 543 | ||
544 | ATA OVER ETHERNET DRIVER | 544 | ATA OVER ETHERNET DRIVER |
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 094300b3a81f..cbcb2c27f48b 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -333,7 +333,7 @@ acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end) | |||
333 | /* | 333 | /* |
334 | * Parse Interrupt Source Override for the ACPI SCI | 334 | * Parse Interrupt Source Override for the ACPI SCI |
335 | */ | 335 | */ |
336 | static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | 336 | static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) |
337 | { | 337 | { |
338 | if (trigger == 0) /* compatible SCI trigger is level */ | 338 | if (trigger == 0) /* compatible SCI trigger is level */ |
339 | trigger = 3; | 339 | trigger = 3; |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 9c52d87d6f04..4144d5dd442e 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -424,7 +424,7 @@ static void acpi_ec_gpe_query(void *ec_cxt) | |||
424 | 424 | ||
425 | snprintf(object_name, 8, "_Q%2.2X", value); | 425 | snprintf(object_name, 8, "_Q%2.2X", value); |
426 | 426 | ||
427 | printk(KERN_INFO PREFIX "evaluating %s\n", object_name); | 427 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s", object_name)); |
428 | 428 | ||
429 | acpi_evaluate_object(ec->handle, object_name, NULL, NULL); | 429 | acpi_evaluate_object(ec->handle, object_name, NULL, NULL); |
430 | } | 430 | } |
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 96d4a0bb2203..ec796ad087df 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -6,13 +6,21 @@ menu "HID Devices" | |||
6 | 6 | ||
7 | config HID | 7 | config HID |
8 | tristate "Generic HID support" | 8 | tristate "Generic HID support" |
9 | depends on INPUT | ||
9 | default y | 10 | default y |
10 | ---help--- | 11 | ---help--- |
11 | Say Y here if you want generic HID support to connect keyboards, | 12 | A human interface device (HID) is a type of computer device that |
12 | mice, joysticks, graphic tablets, or any other HID based devices | 13 | interacts directly with and takes input from humans. The term "HID" |
13 | to your computer. You also need to select particular types of | 14 | most commonly used to refer to the USB-HID specification, but other |
14 | HID devices you want to compile support for, in the particular | 15 | devices (such as, but not strictly limited to, Bluetooth) are |
15 | driver menu (USB, Bluetooth) | 16 | designed using HID specification (this involves certain keyboards, |
17 | mice, tablets, etc). This option compiles into kernel the generic | ||
18 | HID layer code (parser, usages, etc.), which can then be used by | ||
19 | transport-specific HID implementation (like USB or Bluetooth). | ||
20 | |||
21 | For docs and specs, see http://www.usb.org/developers/hidpage/ | ||
22 | |||
23 | If unsure, say Y | ||
16 | 24 | ||
17 | endmenu | 25 | endmenu |
18 | 26 | ||
diff --git a/drivers/net/Space.c b/drivers/net/Space.c index 602ed31a5dd9..9305eb9b1b98 100644 --- a/drivers/net/Space.c +++ b/drivers/net/Space.c | |||
@@ -349,22 +349,11 @@ static void __init trif_probe2(int unit) | |||
349 | #endif | 349 | #endif |
350 | 350 | ||
351 | 351 | ||
352 | /* | ||
353 | * The loopback device is global so it can be directly referenced | ||
354 | * by the network code. Also, it must be first on device list. | ||
355 | */ | ||
356 | extern int loopback_init(void); | ||
357 | |||
358 | /* Statically configured drivers -- order matters here. */ | 352 | /* Statically configured drivers -- order matters here. */ |
359 | static int __init net_olddevs_init(void) | 353 | static int __init net_olddevs_init(void) |
360 | { | 354 | { |
361 | int num; | 355 | int num; |
362 | 356 | ||
363 | if (loopback_init()) { | ||
364 | printk(KERN_ERR "Network loopback device setup failed\n"); | ||
365 | } | ||
366 | |||
367 | |||
368 | #ifdef CONFIG_SBNI | 357 | #ifdef CONFIG_SBNI |
369 | for (num = 0; num < 8; ++num) | 358 | for (num = 0; num < 8; ++num) |
370 | sbni_probe(num); | 359 | sbni_probe(num); |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index c26a4b8e552a..ca2b21f9d444 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -154,8 +154,8 @@ static int ifb_xmit(struct sk_buff *skb, struct net_device *dev) | |||
154 | int ret = 0; | 154 | int ret = 0; |
155 | u32 from = G_TC_FROM(skb->tc_verd); | 155 | u32 from = G_TC_FROM(skb->tc_verd); |
156 | 156 | ||
157 | stats->tx_packets++; | 157 | stats->rx_packets++; |
158 | stats->tx_bytes+=skb->len; | 158 | stats->rx_bytes+=skb->len; |
159 | 159 | ||
160 | if (!from || !skb->input_dev) { | 160 | if (!from || !skb->input_dev) { |
161 | dropped: | 161 | dropped: |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 82c10dec1b5a..2b739fd584f1 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -229,9 +229,11 @@ struct net_device loopback_dev = { | |||
229 | }; | 229 | }; |
230 | 230 | ||
231 | /* Setup and register the loopback device. */ | 231 | /* Setup and register the loopback device. */ |
232 | int __init loopback_init(void) | 232 | static int __init loopback_init(void) |
233 | { | 233 | { |
234 | return register_netdev(&loopback_dev); | 234 | return register_netdev(&loopback_dev); |
235 | }; | 235 | }; |
236 | 236 | ||
237 | module_init(loopback_init); | ||
238 | |||
237 | EXPORT_SYMBOL(loopback_dev); | 239 | EXPORT_SYMBOL(loopback_dev); |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 785e4a535f9e..616be8d0fa85 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -90,7 +90,8 @@ | |||
90 | 90 | ||
91 | #define ADVERTISE_MASK (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | \ | 91 | #define ADVERTISE_MASK (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | \ |
92 | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | \ | 92 | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | \ |
93 | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full) | 93 | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full | \ |
94 | SUPPORTED_Pause | SUPPORTED_Autoneg) | ||
94 | 95 | ||
95 | #define DRV_NAME "sungem" | 96 | #define DRV_NAME "sungem" |
96 | #define DRV_VERSION "0.98" | 97 | #define DRV_VERSION "0.98" |
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index 49800b25907d..d21991ee88c4 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c | |||
@@ -3,10 +3,9 @@ | |||
3 | * | 3 | * |
4 | * This file could be shared with other drivers. | 4 | * This file could be shared with other drivers. |
5 | * | 5 | * |
6 | * (c) 2002, Benjamin Herrenscmidt (benh@kernel.crashing.org) | 6 | * (c) 2002-2007, Benjamin Herrenscmidt (benh@kernel.crashing.org) |
7 | * | 7 | * |
8 | * TODO: | 8 | * TODO: |
9 | * - Implement WOL | ||
10 | * - Add support for PHYs that provide an IRQ line | 9 | * - Add support for PHYs that provide an IRQ line |
11 | * - Eventually moved the entire polling state machine in | 10 | * - Eventually moved the entire polling state machine in |
12 | * there (out of the eth driver), so that it can easily be | 11 | * there (out of the eth driver), so that it can easily be |
@@ -152,6 +151,44 @@ static int bcm5221_suspend(struct mii_phy* phy) | |||
152 | return 0; | 151 | return 0; |
153 | } | 152 | } |
154 | 153 | ||
154 | static int bcm5241_init(struct mii_phy* phy) | ||
155 | { | ||
156 | u16 data; | ||
157 | |||
158 | data = phy_read(phy, MII_BCM5221_TEST); | ||
159 | phy_write(phy, MII_BCM5221_TEST, | ||
160 | data | MII_BCM5221_TEST_ENABLE_SHADOWS); | ||
161 | |||
162 | data = phy_read(phy, MII_BCM5221_SHDOW_AUX_STAT2); | ||
163 | phy_write(phy, MII_BCM5221_SHDOW_AUX_STAT2, | ||
164 | data | MII_BCM5221_SHDOW_AUX_STAT2_APD); | ||
165 | |||
166 | data = phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); | ||
167 | phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, | ||
168 | data & ~MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR); | ||
169 | |||
170 | data = phy_read(phy, MII_BCM5221_TEST); | ||
171 | phy_write(phy, MII_BCM5221_TEST, | ||
172 | data & ~MII_BCM5221_TEST_ENABLE_SHADOWS); | ||
173 | |||
174 | return 0; | ||
175 | } | ||
176 | |||
177 | static int bcm5241_suspend(struct mii_phy* phy) | ||
178 | { | ||
179 | u16 data; | ||
180 | |||
181 | data = phy_read(phy, MII_BCM5221_TEST); | ||
182 | phy_write(phy, MII_BCM5221_TEST, | ||
183 | data | MII_BCM5221_TEST_ENABLE_SHADOWS); | ||
184 | |||
185 | data = phy_read(phy, MII_BCM5221_SHDOW_AUX_MODE4); | ||
186 | phy_write(phy, MII_BCM5221_SHDOW_AUX_MODE4, | ||
187 | data | MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR); | ||
188 | |||
189 | return 0; | ||
190 | } | ||
191 | |||
155 | static int bcm5400_init(struct mii_phy* phy) | 192 | static int bcm5400_init(struct mii_phy* phy) |
156 | { | 193 | { |
157 | u16 data; | 194 | u16 data; |
@@ -373,6 +410,10 @@ static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) | |||
373 | adv |= ADVERTISE_100HALF; | 410 | adv |= ADVERTISE_100HALF; |
374 | if (advertise & ADVERTISED_100baseT_Full) | 411 | if (advertise & ADVERTISED_100baseT_Full) |
375 | adv |= ADVERTISE_100FULL; | 412 | adv |= ADVERTISE_100FULL; |
413 | if (advertise & ADVERTISED_Pause) | ||
414 | adv |= ADVERTISE_PAUSE_CAP; | ||
415 | if (advertise & ADVERTISED_Asym_Pause) | ||
416 | adv |= ADVERTISE_PAUSE_ASYM; | ||
376 | phy_write(phy, MII_ADVERTISE, adv); | 417 | phy_write(phy, MII_ADVERTISE, adv); |
377 | 418 | ||
378 | /* Setup 1000BT advertise */ | 419 | /* Setup 1000BT advertise */ |
@@ -436,12 +477,15 @@ static int bcm54xx_read_link(struct mii_phy *phy) | |||
436 | val = phy_read(phy, MII_BCM5400_AUXSTATUS); | 477 | val = phy_read(phy, MII_BCM5400_AUXSTATUS); |
437 | link_mode = ((val & MII_BCM5400_AUXSTATUS_LINKMODE_MASK) >> | 478 | link_mode = ((val & MII_BCM5400_AUXSTATUS_LINKMODE_MASK) >> |
438 | MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT); | 479 | MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT); |
439 | phy->duplex = phy_BCM5400_link_table[link_mode][0] ? DUPLEX_FULL : DUPLEX_HALF; | 480 | phy->duplex = phy_BCM5400_link_table[link_mode][0] ? |
481 | DUPLEX_FULL : DUPLEX_HALF; | ||
440 | phy->speed = phy_BCM5400_link_table[link_mode][2] ? | 482 | phy->speed = phy_BCM5400_link_table[link_mode][2] ? |
441 | SPEED_1000 : | 483 | SPEED_1000 : |
442 | (phy_BCM5400_link_table[link_mode][1] ? SPEED_100 : SPEED_10); | 484 | (phy_BCM5400_link_table[link_mode][1] ? |
485 | SPEED_100 : SPEED_10); | ||
443 | val = phy_read(phy, MII_LPA); | 486 | val = phy_read(phy, MII_LPA); |
444 | phy->pause = ((val & LPA_PAUSE) != 0); | 487 | phy->pause = (phy->duplex == DUPLEX_FULL) && |
488 | ((val & LPA_PAUSE) != 0); | ||
445 | } | 489 | } |
446 | /* On non-aneg, we assume what we put in BMCR is the speed, | 490 | /* On non-aneg, we assume what we put in BMCR is the speed, |
447 | * though magic-aneg shouldn't prevent this case from occurring | 491 | * though magic-aneg shouldn't prevent this case from occurring |
@@ -450,6 +494,28 @@ static int bcm54xx_read_link(struct mii_phy *phy) | |||
450 | return 0; | 494 | return 0; |
451 | } | 495 | } |
452 | 496 | ||
497 | static int marvell88e1111_init(struct mii_phy* phy) | ||
498 | { | ||
499 | u16 rev; | ||
500 | |||
501 | /* magic init sequence for rev 0 */ | ||
502 | rev = phy_read(phy, MII_PHYSID2) & 0x000f; | ||
503 | if (rev == 0) { | ||
504 | phy_write(phy, 0x1d, 0x000a); | ||
505 | phy_write(phy, 0x1e, 0x0821); | ||
506 | |||
507 | phy_write(phy, 0x1d, 0x0006); | ||
508 | phy_write(phy, 0x1e, 0x8600); | ||
509 | |||
510 | phy_write(phy, 0x1d, 0x000b); | ||
511 | phy_write(phy, 0x1e, 0x0100); | ||
512 | |||
513 | phy_write(phy, 0x1d, 0x0004); | ||
514 | phy_write(phy, 0x1e, 0x4850); | ||
515 | } | ||
516 | return 0; | ||
517 | } | ||
518 | |||
453 | static int marvell_setup_aneg(struct mii_phy *phy, u32 advertise) | 519 | static int marvell_setup_aneg(struct mii_phy *phy, u32 advertise) |
454 | { | 520 | { |
455 | u16 ctl, adv; | 521 | u16 ctl, adv; |
@@ -471,6 +537,10 @@ static int marvell_setup_aneg(struct mii_phy *phy, u32 advertise) | |||
471 | adv |= ADVERTISE_100HALF; | 537 | adv |= ADVERTISE_100HALF; |
472 | if (advertise & ADVERTISED_100baseT_Full) | 538 | if (advertise & ADVERTISED_100baseT_Full) |
473 | adv |= ADVERTISE_100FULL; | 539 | adv |= ADVERTISE_100FULL; |
540 | if (advertise & ADVERTISED_Pause) | ||
541 | adv |= ADVERTISE_PAUSE_CAP; | ||
542 | if (advertise & ADVERTISED_Asym_Pause) | ||
543 | adv |= ADVERTISE_PAUSE_ASYM; | ||
474 | phy_write(phy, MII_ADVERTISE, adv); | 544 | phy_write(phy, MII_ADVERTISE, adv); |
475 | 545 | ||
476 | /* Setup 1000BT advertise & enable crossover detect | 546 | /* Setup 1000BT advertise & enable crossover detect |
@@ -549,7 +619,7 @@ static int marvell_setup_forced(struct mii_phy *phy, int speed, int fd) | |||
549 | 619 | ||
550 | static int marvell_read_link(struct mii_phy *phy) | 620 | static int marvell_read_link(struct mii_phy *phy) |
551 | { | 621 | { |
552 | u16 status; | 622 | u16 status, pmask; |
553 | 623 | ||
554 | if (phy->autoneg) { | 624 | if (phy->autoneg) { |
555 | status = phy_read(phy, MII_M1011_PHY_SPEC_STATUS); | 625 | status = phy_read(phy, MII_M1011_PHY_SPEC_STATUS); |
@@ -565,7 +635,9 @@ static int marvell_read_link(struct mii_phy *phy) | |||
565 | phy->duplex = DUPLEX_FULL; | 635 | phy->duplex = DUPLEX_FULL; |
566 | else | 636 | else |
567 | phy->duplex = DUPLEX_HALF; | 637 | phy->duplex = DUPLEX_HALF; |
568 | phy->pause = 0; /* XXX Check against spec ! */ | 638 | pmask = MII_M1011_PHY_SPEC_STATUS_TX_PAUSE | |
639 | MII_M1011_PHY_SPEC_STATUS_RX_PAUSE; | ||
640 | phy->pause = (status & pmask) == pmask; | ||
569 | } | 641 | } |
570 | /* On non-aneg, we assume what we put in BMCR is the speed, | 642 | /* On non-aneg, we assume what we put in BMCR is the speed, |
571 | * though magic-aneg shouldn't prevent this case from occurring | 643 | * though magic-aneg shouldn't prevent this case from occurring |
@@ -595,6 +667,10 @@ static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) | |||
595 | adv |= ADVERTISE_100HALF; | 667 | adv |= ADVERTISE_100HALF; |
596 | if (advertise & ADVERTISED_100baseT_Full) | 668 | if (advertise & ADVERTISED_100baseT_Full) |
597 | adv |= ADVERTISE_100FULL; | 669 | adv |= ADVERTISE_100FULL; |
670 | if (advertise & ADVERTISED_Pause) | ||
671 | adv |= ADVERTISE_PAUSE_CAP; | ||
672 | if (advertise & ADVERTISED_Asym_Pause) | ||
673 | adv |= ADVERTISE_PAUSE_ASYM; | ||
598 | phy_write(phy, MII_ADVERTISE, adv); | 674 | phy_write(phy, MII_ADVERTISE, adv); |
599 | 675 | ||
600 | /* Start/Restart aneg */ | 676 | /* Start/Restart aneg */ |
@@ -666,7 +742,8 @@ static int genmii_read_link(struct mii_phy *phy) | |||
666 | phy->speed = SPEED_100; | 742 | phy->speed = SPEED_100; |
667 | else | 743 | else |
668 | phy->speed = SPEED_10; | 744 | phy->speed = SPEED_10; |
669 | phy->pause = 0; | 745 | phy->pause = (phy->duplex == DUPLEX_FULL) && |
746 | ((lpa & LPA_PAUSE) != 0); | ||
670 | } | 747 | } |
671 | /* On non-aneg, we assume what we put in BMCR is the speed, | 748 | /* On non-aneg, we assume what we put in BMCR is the speed, |
672 | * though magic-aneg shouldn't prevent this case from occurring | 749 | * though magic-aneg shouldn't prevent this case from occurring |
@@ -676,11 +753,19 @@ static int genmii_read_link(struct mii_phy *phy) | |||
676 | } | 753 | } |
677 | 754 | ||
678 | 755 | ||
679 | #define MII_BASIC_FEATURES (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | \ | 756 | #define MII_BASIC_FEATURES \ |
680 | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | \ | 757 | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | \ |
681 | SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII) | 758 | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | \ |
682 | #define MII_GBIT_FEATURES (MII_BASIC_FEATURES | \ | 759 | SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII | \ |
683 | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full) | 760 | SUPPORTED_Pause) |
761 | |||
762 | /* On gigabit capable PHYs, we advertise Pause support but not asym pause | ||
763 | * support for now as I'm not sure it's supported and Darwin doesn't do | ||
764 | * it neither. --BenH. | ||
765 | */ | ||
766 | #define MII_GBIT_FEATURES \ | ||
767 | (MII_BASIC_FEATURES | \ | ||
768 | SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full) | ||
684 | 769 | ||
685 | /* Broadcom BCM 5201 */ | 770 | /* Broadcom BCM 5201 */ |
686 | static struct mii_phy_ops bcm5201_phy_ops = { | 771 | static struct mii_phy_ops bcm5201_phy_ops = { |
@@ -720,6 +805,24 @@ static struct mii_phy_def bcm5221_phy_def = { | |||
720 | .ops = &bcm5221_phy_ops | 805 | .ops = &bcm5221_phy_ops |
721 | }; | 806 | }; |
722 | 807 | ||
808 | /* Broadcom BCM 5241 */ | ||
809 | static struct mii_phy_ops bcm5241_phy_ops = { | ||
810 | .suspend = bcm5241_suspend, | ||
811 | .init = bcm5241_init, | ||
812 | .setup_aneg = genmii_setup_aneg, | ||
813 | .setup_forced = genmii_setup_forced, | ||
814 | .poll_link = genmii_poll_link, | ||
815 | .read_link = genmii_read_link, | ||
816 | }; | ||
817 | static struct mii_phy_def bcm5241_phy_def = { | ||
818 | .phy_id = 0x0143bc30, | ||
819 | .phy_id_mask = 0xfffffff0, | ||
820 | .name = "BCM5241", | ||
821 | .features = MII_BASIC_FEATURES, | ||
822 | .magic_aneg = 1, | ||
823 | .ops = &bcm5241_phy_ops | ||
824 | }; | ||
825 | |||
723 | /* Broadcom BCM 5400 */ | 826 | /* Broadcom BCM 5400 */ |
724 | static struct mii_phy_ops bcm5400_phy_ops = { | 827 | static struct mii_phy_ops bcm5400_phy_ops = { |
725 | .init = bcm5400_init, | 828 | .init = bcm5400_init, |
@@ -854,11 +957,8 @@ static struct mii_phy_def bcm5462V_phy_def = { | |||
854 | .ops = &bcm5462V_phy_ops | 957 | .ops = &bcm5462V_phy_ops |
855 | }; | 958 | }; |
856 | 959 | ||
857 | /* Marvell 88E1101 (Apple seem to deal with 2 different revs, | 960 | /* Marvell 88E1101 amd 88E1111 */ |
858 | * I masked out the 8 last bits to get both, but some specs | 961 | static struct mii_phy_ops marvell88e1101_phy_ops = { |
859 | * would be useful here) --BenH. | ||
860 | */ | ||
861 | static struct mii_phy_ops marvell_phy_ops = { | ||
862 | .suspend = generic_suspend, | 962 | .suspend = generic_suspend, |
863 | .setup_aneg = marvell_setup_aneg, | 963 | .setup_aneg = marvell_setup_aneg, |
864 | .setup_forced = marvell_setup_forced, | 964 | .setup_forced = marvell_setup_forced, |
@@ -866,13 +966,41 @@ static struct mii_phy_ops marvell_phy_ops = { | |||
866 | .read_link = marvell_read_link | 966 | .read_link = marvell_read_link |
867 | }; | 967 | }; |
868 | 968 | ||
869 | static struct mii_phy_def marvell_phy_def = { | 969 | static struct mii_phy_ops marvell88e1111_phy_ops = { |
870 | .phy_id = 0x01410c00, | 970 | .init = marvell88e1111_init, |
871 | .phy_id_mask = 0xffffff00, | 971 | .suspend = generic_suspend, |
872 | .name = "Marvell 88E1101", | 972 | .setup_aneg = marvell_setup_aneg, |
973 | .setup_forced = marvell_setup_forced, | ||
974 | .poll_link = genmii_poll_link, | ||
975 | .read_link = marvell_read_link | ||
976 | }; | ||
977 | |||
978 | /* two revs in darwin for the 88e1101 ... I could use a datasheet | ||
979 | * to get the proper names... | ||
980 | */ | ||
981 | static struct mii_phy_def marvell88e1101v1_phy_def = { | ||
982 | .phy_id = 0x01410c20, | ||
983 | .phy_id_mask = 0xfffffff0, | ||
984 | .name = "Marvell 88E1101v1", | ||
985 | .features = MII_GBIT_FEATURES, | ||
986 | .magic_aneg = 1, | ||
987 | .ops = &marvell88e1101_phy_ops | ||
988 | }; | ||
989 | static struct mii_phy_def marvell88e1101v2_phy_def = { | ||
990 | .phy_id = 0x01410c60, | ||
991 | .phy_id_mask = 0xfffffff0, | ||
992 | .name = "Marvell 88E1101v2", | ||
993 | .features = MII_GBIT_FEATURES, | ||
994 | .magic_aneg = 1, | ||
995 | .ops = &marvell88e1101_phy_ops | ||
996 | }; | ||
997 | static struct mii_phy_def marvell88e1111_phy_def = { | ||
998 | .phy_id = 0x01410cc0, | ||
999 | .phy_id_mask = 0xfffffff0, | ||
1000 | .name = "Marvell 88E1111", | ||
873 | .features = MII_GBIT_FEATURES, | 1001 | .features = MII_GBIT_FEATURES, |
874 | .magic_aneg = 1, | 1002 | .magic_aneg = 1, |
875 | .ops = &marvell_phy_ops | 1003 | .ops = &marvell88e1111_phy_ops |
876 | }; | 1004 | }; |
877 | 1005 | ||
878 | /* Generic implementation for most 10/100 PHYs */ | 1006 | /* Generic implementation for most 10/100 PHYs */ |
@@ -895,6 +1023,7 @@ static struct mii_phy_def genmii_phy_def = { | |||
895 | static struct mii_phy_def* mii_phy_table[] = { | 1023 | static struct mii_phy_def* mii_phy_table[] = { |
896 | &bcm5201_phy_def, | 1024 | &bcm5201_phy_def, |
897 | &bcm5221_phy_def, | 1025 | &bcm5221_phy_def, |
1026 | &bcm5241_phy_def, | ||
898 | &bcm5400_phy_def, | 1027 | &bcm5400_phy_def, |
899 | &bcm5401_phy_def, | 1028 | &bcm5401_phy_def, |
900 | &bcm5411_phy_def, | 1029 | &bcm5411_phy_def, |
@@ -902,7 +1031,9 @@ static struct mii_phy_def* mii_phy_table[] = { | |||
902 | &bcm5421k2_phy_def, | 1031 | &bcm5421k2_phy_def, |
903 | &bcm5461_phy_def, | 1032 | &bcm5461_phy_def, |
904 | &bcm5462V_phy_def, | 1033 | &bcm5462V_phy_def, |
905 | &marvell_phy_def, | 1034 | &marvell88e1101v1_phy_def, |
1035 | &marvell88e1101v2_phy_def, | ||
1036 | &marvell88e1111_phy_def, | ||
906 | &genmii_phy_def, | 1037 | &genmii_phy_def, |
907 | NULL | 1038 | NULL |
908 | }; | 1039 | }; |
diff --git a/drivers/net/sungem_phy.h b/drivers/net/sungem_phy.h index 8ee1ca0471cf..1d70ba6f9f10 100644 --- a/drivers/net/sungem_phy.h +++ b/drivers/net/sungem_phy.h | |||
@@ -30,7 +30,7 @@ struct mii_phy_def | |||
30 | struct mii_phy | 30 | struct mii_phy |
31 | { | 31 | { |
32 | struct mii_phy_def* def; | 32 | struct mii_phy_def* def; |
33 | int advertising; | 33 | u32 advertising; |
34 | int mii_id; | 34 | int mii_id; |
35 | 35 | ||
36 | /* 1: autoneg enabled, 0: disabled */ | 36 | /* 1: autoneg enabled, 0: disabled */ |
@@ -85,6 +85,9 @@ extern int mii_phy_probe(struct mii_phy *phy, int mii_id); | |||
85 | #define MII_BCM5221_SHDOW_AUX_MODE4_IDDQMODE 0x0001 | 85 | #define MII_BCM5221_SHDOW_AUX_MODE4_IDDQMODE 0x0001 |
86 | #define MII_BCM5221_SHDOW_AUX_MODE4_CLKLOPWR 0x0004 | 86 | #define MII_BCM5221_SHDOW_AUX_MODE4_CLKLOPWR 0x0004 |
87 | 87 | ||
88 | /* MII BCM5241 Additional registers */ | ||
89 | #define MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR 0x0008 | ||
90 | |||
88 | /* MII BCM5400 1000-BASET Control register */ | 91 | /* MII BCM5400 1000-BASET Control register */ |
89 | #define MII_BCM5400_GB_CONTROL 0x09 | 92 | #define MII_BCM5400_GB_CONTROL 0x09 |
90 | #define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200 | 93 | #define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200 |
@@ -115,5 +118,7 @@ extern int mii_phy_probe(struct mii_phy *phy, int mii_id); | |||
115 | #define MII_M1011_PHY_SPEC_STATUS_SPD_MASK 0xc000 | 118 | #define MII_M1011_PHY_SPEC_STATUS_SPD_MASK 0xc000 |
116 | #define MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX 0x2000 | 119 | #define MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX 0x2000 |
117 | #define MII_M1011_PHY_SPEC_STATUS_RESOLVED 0x0800 | 120 | #define MII_M1011_PHY_SPEC_STATUS_RESOLVED 0x0800 |
121 | #define MII_M1011_PHY_SPEC_STATUS_TX_PAUSE 0x0008 | ||
122 | #define MII_M1011_PHY_SPEC_STATUS_RX_PAUSE 0x0004 | ||
118 | 123 | ||
119 | #endif /* __SUNGEM_PHY_H__ */ | 124 | #endif /* __SUNGEM_PHY_H__ */ |
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig index f877cd4f317a..258a5d09d3dc 100644 --- a/drivers/usb/input/Kconfig +++ b/drivers/usb/input/Kconfig | |||
@@ -12,10 +12,8 @@ config USB_HID | |||
12 | ---help--- | 12 | ---help--- |
13 | Say Y here if you want full HID support to connect USB keyboards, | 13 | Say Y here if you want full HID support to connect USB keyboards, |
14 | mice, joysticks, graphic tablets, or any other HID based devices | 14 | mice, joysticks, graphic tablets, or any other HID based devices |
15 | to your computer via USB. You also need to select HID Input layer | 15 | to your computer via USB, as well as Uninterruptible Power Supply |
16 | support (below) if you want to use keyboards, mice, joysticks and | 16 | (UPS) and monitor control devices. |
17 | the like ... as well as Uninterruptible Power Supply (UPS) and | ||
18 | monitor control devices. | ||
19 | 17 | ||
20 | You can't use this driver and the HIDBP (Boot Protocol) keyboard | 18 | You can't use this driver and the HIDBP (Boot Protocol) keyboard |
21 | and mouse drivers at the same time. More information is available: | 19 | and mouse drivers at the same time. More information is available: |
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 61587ca2cdbb..fde1d9518123 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -121,7 +121,7 @@ static int corgibl_probe(struct platform_device *pdev) | |||
121 | machinfo->limit_mask = -1; | 121 | machinfo->limit_mask = -1; |
122 | 122 | ||
123 | corgi_backlight_device = backlight_device_register ("corgi-bl", | 123 | corgi_backlight_device = backlight_device_register ("corgi-bl", |
124 | NULL, &corgibl_data); | 124 | &pdev->dev, NULL, &corgibl_data); |
125 | if (IS_ERR (corgi_backlight_device)) | 125 | if (IS_ERR (corgi_backlight_device)) |
126 | return PTR_ERR (corgi_backlight_device); | 126 | return PTR_ERR (corgi_backlight_device); |
127 | 127 | ||
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index 1c569fb543ae..c07d8207fb54 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -105,7 +105,7 @@ static struct backlight_properties hp680bl_data = { | |||
105 | static int __init hp680bl_probe(struct platform_device *dev) | 105 | static int __init hp680bl_probe(struct platform_device *dev) |
106 | { | 106 | { |
107 | hp680_backlight_device = backlight_device_register ("hp680-bl", | 107 | hp680_backlight_device = backlight_device_register ("hp680-bl", |
108 | NULL, &hp680bl_data); | 108 | &dev->dev, NULL, &hp680bl_data); |
109 | if (IS_ERR (hp680_backlight_device)) | 109 | if (IS_ERR (hp680_backlight_device)) |
110 | return PTR_ERR (hp680_backlight_device); | 110 | return PTR_ERR (hp680_backlight_device); |
111 | 111 | ||
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index 2d7905410b2a..fc812d96c31d 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -184,7 +184,7 @@ static int locomolcd_probe(struct locomo_dev *ldev) | |||
184 | 184 | ||
185 | local_irq_restore(flags); | 185 | local_irq_restore(flags); |
186 | 186 | ||
187 | locomolcd_bl_device = backlight_device_register("locomo-bl", NULL, &locomobl_data); | 187 | locomolcd_bl_device = backlight_device_register("locomo-bl", &ldev->dev, NULL, &locomobl_data); |
188 | 188 | ||
189 | if (IS_ERR (locomolcd_bl_device)) | 189 | if (IS_ERR (locomolcd_bl_device)) |
190 | return PTR_ERR (locomolcd_bl_device); | 190 | return PTR_ERR (locomolcd_bl_device); |
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 9e6c23c360b2..ebc1f697615a 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -105,7 +105,7 @@ | |||
105 | 105 | ||
106 | /* Maximum object reference count (detects object deletion issues) */ | 106 | /* Maximum object reference count (detects object deletion issues) */ |
107 | 107 | ||
108 | #define ACPI_MAX_REFERENCE_COUNT 0x800 | 108 | #define ACPI_MAX_REFERENCE_COUNT 0x1000 |
109 | 109 | ||
110 | /* Size of cached memory mapping for system memory operation region */ | 110 | /* Size of cached memory mapping for system memory operation region */ |
111 | 111 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index b7d8317f22ac..cd8fa0c858ae 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -242,7 +242,7 @@ extern int tcp_memory_pressure; | |||
242 | 242 | ||
243 | static inline int before(__u32 seq1, __u32 seq2) | 243 | static inline int before(__u32 seq1, __u32 seq2) |
244 | { | 244 | { |
245 | return (__s32)(seq2-seq1) > 0; | 245 | return (__s32)(seq1-seq2) < 0; |
246 | } | 246 | } |
247 | #define after(seq2, seq1) before(seq1, seq2) | 247 | #define after(seq2, seq1) before(seq1, seq2) |
248 | 248 | ||
diff --git a/include/net/x25.h b/include/net/x25.h index 0ad90ebcf86e..e47fe440d9d7 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -259,6 +259,7 @@ extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int | |||
259 | extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); | 259 | extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); |
260 | 260 | ||
261 | /* x25_timer.c */ | 261 | /* x25_timer.c */ |
262 | extern void x25_init_timers(struct sock *sk); | ||
262 | extern void x25_start_heartbeat(struct sock *); | 263 | extern void x25_start_heartbeat(struct sock *); |
263 | extern void x25_start_t2timer(struct sock *); | 264 | extern void x25_start_t2timer(struct sock *); |
264 | extern void x25_start_t21timer(struct sock *); | 265 | extern void x25_start_t21timer(struct sock *); |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index bee558a41800..6c84ccb8c9d7 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -610,7 +610,7 @@ ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo, | |||
610 | struct ebt_entry_target *t; | 610 | struct ebt_entry_target *t; |
611 | struct ebt_target *target; | 611 | struct ebt_target *target; |
612 | unsigned int i, j, hook = 0, hookmask = 0; | 612 | unsigned int i, j, hook = 0, hookmask = 0; |
613 | size_t gap = e->next_offset - e->target_offset; | 613 | size_t gap; |
614 | int ret; | 614 | int ret; |
615 | 615 | ||
616 | /* don't mess with the struct ebt_entries */ | 616 | /* don't mess with the struct ebt_entries */ |
@@ -660,6 +660,7 @@ ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo, | |||
660 | if (ret != 0) | 660 | if (ret != 0) |
661 | goto cleanup_watchers; | 661 | goto cleanup_watchers; |
662 | t = (struct ebt_entry_target *)(((char *)e) + e->target_offset); | 662 | t = (struct ebt_entry_target *)(((char *)e) + e->target_offset); |
663 | gap = e->next_offset - e->target_offset; | ||
663 | target = find_target_lock(t->u.name, &ret, &ebt_mutex); | 664 | target = find_target_lock(t->u.name, &ret, &ebt_mutex); |
664 | if (!target) | 665 | if (!target) |
665 | goto cleanup_watchers; | 666 | goto cleanup_watchers; |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 1897a3a385d8..04d4b93c68eb 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -148,6 +148,7 @@ | |||
148 | #include <linux/seq_file.h> | 148 | #include <linux/seq_file.h> |
149 | #include <linux/wait.h> | 149 | #include <linux/wait.h> |
150 | #include <linux/etherdevice.h> | 150 | #include <linux/etherdevice.h> |
151 | #include <linux/kthread.h> | ||
151 | #include <net/checksum.h> | 152 | #include <net/checksum.h> |
152 | #include <net/ipv6.h> | 153 | #include <net/ipv6.h> |
153 | #include <net/addrconf.h> | 154 | #include <net/addrconf.h> |
@@ -360,8 +361,7 @@ struct pktgen_thread { | |||
360 | spinlock_t if_lock; | 361 | spinlock_t if_lock; |
361 | struct list_head if_list; /* All device here */ | 362 | struct list_head if_list; /* All device here */ |
362 | struct list_head th_list; | 363 | struct list_head th_list; |
363 | int removed; | 364 | struct task_struct *tsk; |
364 | char name[32]; | ||
365 | char result[512]; | 365 | char result[512]; |
366 | u32 max_before_softirq; /* We'll call do_softirq to prevent starvation. */ | 366 | u32 max_before_softirq; /* We'll call do_softirq to prevent starvation. */ |
367 | 367 | ||
@@ -1689,7 +1689,7 @@ static int pktgen_thread_show(struct seq_file *seq, void *v) | |||
1689 | BUG_ON(!t); | 1689 | BUG_ON(!t); |
1690 | 1690 | ||
1691 | seq_printf(seq, "Name: %s max_before_softirq: %d\n", | 1691 | seq_printf(seq, "Name: %s max_before_softirq: %d\n", |
1692 | t->name, t->max_before_softirq); | 1692 | t->tsk->comm, t->max_before_softirq); |
1693 | 1693 | ||
1694 | seq_printf(seq, "Running: "); | 1694 | seq_printf(seq, "Running: "); |
1695 | 1695 | ||
@@ -3112,7 +3112,7 @@ static void pktgen_rem_thread(struct pktgen_thread *t) | |||
3112 | { | 3112 | { |
3113 | /* Remove from the thread list */ | 3113 | /* Remove from the thread list */ |
3114 | 3114 | ||
3115 | remove_proc_entry(t->name, pg_proc_dir); | 3115 | remove_proc_entry(t->tsk->comm, pg_proc_dir); |
3116 | 3116 | ||
3117 | mutex_lock(&pktgen_thread_lock); | 3117 | mutex_lock(&pktgen_thread_lock); |
3118 | 3118 | ||
@@ -3260,58 +3260,40 @@ out:; | |||
3260 | * Main loop of the thread goes here | 3260 | * Main loop of the thread goes here |
3261 | */ | 3261 | */ |
3262 | 3262 | ||
3263 | static void pktgen_thread_worker(struct pktgen_thread *t) | 3263 | static int pktgen_thread_worker(void *arg) |
3264 | { | 3264 | { |
3265 | DEFINE_WAIT(wait); | 3265 | DEFINE_WAIT(wait); |
3266 | struct pktgen_thread *t = arg; | ||
3266 | struct pktgen_dev *pkt_dev = NULL; | 3267 | struct pktgen_dev *pkt_dev = NULL; |
3267 | int cpu = t->cpu; | 3268 | int cpu = t->cpu; |
3268 | sigset_t tmpsig; | ||
3269 | u32 max_before_softirq; | 3269 | u32 max_before_softirq; |
3270 | u32 tx_since_softirq = 0; | 3270 | u32 tx_since_softirq = 0; |
3271 | 3271 | ||
3272 | daemonize("pktgen/%d", cpu); | 3272 | BUG_ON(smp_processor_id() != cpu); |
3273 | |||
3274 | /* Block all signals except SIGKILL, SIGSTOP and SIGTERM */ | ||
3275 | |||
3276 | spin_lock_irq(¤t->sighand->siglock); | ||
3277 | tmpsig = current->blocked; | ||
3278 | siginitsetinv(¤t->blocked, | ||
3279 | sigmask(SIGKILL) | sigmask(SIGSTOP) | sigmask(SIGTERM)); | ||
3280 | |||
3281 | recalc_sigpending(); | ||
3282 | spin_unlock_irq(¤t->sighand->siglock); | ||
3283 | |||
3284 | /* Migrate to the right CPU */ | ||
3285 | set_cpus_allowed(current, cpumask_of_cpu(cpu)); | ||
3286 | if (smp_processor_id() != cpu) | ||
3287 | BUG(); | ||
3288 | 3273 | ||
3289 | init_waitqueue_head(&t->queue); | 3274 | init_waitqueue_head(&t->queue); |
3290 | 3275 | ||
3291 | t->control &= ~(T_TERMINATE); | ||
3292 | t->control &= ~(T_RUN); | ||
3293 | t->control &= ~(T_STOP); | ||
3294 | t->control &= ~(T_REMDEVALL); | ||
3295 | t->control &= ~(T_REMDEV); | ||
3296 | |||
3297 | t->pid = current->pid; | 3276 | t->pid = current->pid; |
3298 | 3277 | ||
3299 | PG_DEBUG(printk("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid)); | 3278 | PG_DEBUG(printk("pktgen: starting pktgen/%d: pid=%d\n", cpu, current->pid)); |
3300 | 3279 | ||
3301 | max_before_softirq = t->max_before_softirq; | 3280 | max_before_softirq = t->max_before_softirq; |
3302 | 3281 | ||
3303 | __set_current_state(TASK_INTERRUPTIBLE); | 3282 | set_current_state(TASK_INTERRUPTIBLE); |
3304 | mb(); | ||
3305 | 3283 | ||
3306 | while (1) { | 3284 | while (!kthread_should_stop()) { |
3307 | 3285 | pkt_dev = next_to_run(t); | |
3308 | __set_current_state(TASK_RUNNING); | ||
3309 | 3286 | ||
3310 | /* | 3287 | if (!pkt_dev && |
3311 | * Get next dev to xmit -- if any. | 3288 | (t->control & (T_STOP | T_RUN | T_REMDEVALL | T_REMDEV)) |
3312 | */ | 3289 | == 0) { |
3290 | prepare_to_wait(&(t->queue), &wait, | ||
3291 | TASK_INTERRUPTIBLE); | ||
3292 | schedule_timeout(HZ / 10); | ||
3293 | finish_wait(&(t->queue), &wait); | ||
3294 | } | ||
3313 | 3295 | ||
3314 | pkt_dev = next_to_run(t); | 3296 | __set_current_state(TASK_RUNNING); |
3315 | 3297 | ||
3316 | if (pkt_dev) { | 3298 | if (pkt_dev) { |
3317 | 3299 | ||
@@ -3329,21 +3311,8 @@ static void pktgen_thread_worker(struct pktgen_thread *t) | |||
3329 | do_softirq(); | 3311 | do_softirq(); |
3330 | tx_since_softirq = 0; | 3312 | tx_since_softirq = 0; |
3331 | } | 3313 | } |
3332 | } else { | ||
3333 | prepare_to_wait(&(t->queue), &wait, TASK_INTERRUPTIBLE); | ||
3334 | schedule_timeout(HZ / 10); | ||
3335 | finish_wait(&(t->queue), &wait); | ||
3336 | } | 3314 | } |
3337 | 3315 | ||
3338 | /* | ||
3339 | * Back from sleep, either due to the timeout or signal. | ||
3340 | * We check if we have any "posted" work for us. | ||
3341 | */ | ||
3342 | |||
3343 | if (t->control & T_TERMINATE || signal_pending(current)) | ||
3344 | /* we received a request to terminate ourself */ | ||
3345 | break; | ||
3346 | |||
3347 | if (t->control & T_STOP) { | 3316 | if (t->control & T_STOP) { |
3348 | pktgen_stop(t); | 3317 | pktgen_stop(t); |
3349 | t->control &= ~(T_STOP); | 3318 | t->control &= ~(T_STOP); |
@@ -3364,20 +3333,19 @@ static void pktgen_thread_worker(struct pktgen_thread *t) | |||
3364 | t->control &= ~(T_REMDEV); | 3333 | t->control &= ~(T_REMDEV); |
3365 | } | 3334 | } |
3366 | 3335 | ||
3367 | if (need_resched()) | 3336 | set_current_state(TASK_INTERRUPTIBLE); |
3368 | schedule(); | ||
3369 | } | 3337 | } |
3370 | 3338 | ||
3371 | PG_DEBUG(printk("pktgen: %s stopping all device\n", t->name)); | 3339 | PG_DEBUG(printk("pktgen: %s stopping all device\n", t->tsk->comm)); |
3372 | pktgen_stop(t); | 3340 | pktgen_stop(t); |
3373 | 3341 | ||
3374 | PG_DEBUG(printk("pktgen: %s removing all device\n", t->name)); | 3342 | PG_DEBUG(printk("pktgen: %s removing all device\n", t->tsk->comm)); |
3375 | pktgen_rem_all_ifs(t); | 3343 | pktgen_rem_all_ifs(t); |
3376 | 3344 | ||
3377 | PG_DEBUG(printk("pktgen: %s removing thread.\n", t->name)); | 3345 | PG_DEBUG(printk("pktgen: %s removing thread.\n", t->tsk->comm)); |
3378 | pktgen_rem_thread(t); | 3346 | pktgen_rem_thread(t); |
3379 | 3347 | ||
3380 | t->removed = 1; | 3348 | return 0; |
3381 | } | 3349 | } |
3382 | 3350 | ||
3383 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, | 3351 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, |
@@ -3495,37 +3463,11 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3495 | return add_dev_to_thread(t, pkt_dev); | 3463 | return add_dev_to_thread(t, pkt_dev); |
3496 | } | 3464 | } |
3497 | 3465 | ||
3498 | static struct pktgen_thread *__init pktgen_find_thread(const char *name) | 3466 | static int __init pktgen_create_thread(int cpu) |
3499 | { | 3467 | { |
3500 | struct pktgen_thread *t; | 3468 | struct pktgen_thread *t; |
3501 | |||
3502 | mutex_lock(&pktgen_thread_lock); | ||
3503 | |||
3504 | list_for_each_entry(t, &pktgen_threads, th_list) | ||
3505 | if (strcmp(t->name, name) == 0) { | ||
3506 | mutex_unlock(&pktgen_thread_lock); | ||
3507 | return t; | ||
3508 | } | ||
3509 | |||
3510 | mutex_unlock(&pktgen_thread_lock); | ||
3511 | return NULL; | ||
3512 | } | ||
3513 | |||
3514 | static int __init pktgen_create_thread(const char *name, int cpu) | ||
3515 | { | ||
3516 | int err; | ||
3517 | struct pktgen_thread *t = NULL; | ||
3518 | struct proc_dir_entry *pe; | 3469 | struct proc_dir_entry *pe; |
3519 | 3470 | struct task_struct *p; | |
3520 | if (strlen(name) > 31) { | ||
3521 | printk("pktgen: ERROR: Thread name cannot be more than 31 characters.\n"); | ||
3522 | return -EINVAL; | ||
3523 | } | ||
3524 | |||
3525 | if (pktgen_find_thread(name)) { | ||
3526 | printk("pktgen: ERROR: thread: %s already exists\n", name); | ||
3527 | return -EINVAL; | ||
3528 | } | ||
3529 | 3471 | ||
3530 | t = kzalloc(sizeof(struct pktgen_thread), GFP_KERNEL); | 3472 | t = kzalloc(sizeof(struct pktgen_thread), GFP_KERNEL); |
3531 | if (!t) { | 3473 | if (!t) { |
@@ -3533,14 +3475,29 @@ static int __init pktgen_create_thread(const char *name, int cpu) | |||
3533 | return -ENOMEM; | 3475 | return -ENOMEM; |
3534 | } | 3476 | } |
3535 | 3477 | ||
3536 | strcpy(t->name, name); | ||
3537 | spin_lock_init(&t->if_lock); | 3478 | spin_lock_init(&t->if_lock); |
3538 | t->cpu = cpu; | 3479 | t->cpu = cpu; |
3539 | 3480 | ||
3540 | pe = create_proc_entry(t->name, 0600, pg_proc_dir); | 3481 | INIT_LIST_HEAD(&t->if_list); |
3482 | |||
3483 | list_add_tail(&t->th_list, &pktgen_threads); | ||
3484 | |||
3485 | p = kthread_create(pktgen_thread_worker, t, "kpktgend_%d", cpu); | ||
3486 | if (IS_ERR(p)) { | ||
3487 | printk("pktgen: kernel_thread() failed for cpu %d\n", t->cpu); | ||
3488 | list_del(&t->th_list); | ||
3489 | kfree(t); | ||
3490 | return PTR_ERR(p); | ||
3491 | } | ||
3492 | kthread_bind(p, cpu); | ||
3493 | t->tsk = p; | ||
3494 | |||
3495 | pe = create_proc_entry(t->tsk->comm, 0600, pg_proc_dir); | ||
3541 | if (!pe) { | 3496 | if (!pe) { |
3542 | printk("pktgen: cannot create %s/%s procfs entry.\n", | 3497 | printk("pktgen: cannot create %s/%s procfs entry.\n", |
3543 | PG_PROC_DIR, t->name); | 3498 | PG_PROC_DIR, t->tsk->comm); |
3499 | kthread_stop(p); | ||
3500 | list_del(&t->th_list); | ||
3544 | kfree(t); | 3501 | kfree(t); |
3545 | return -EINVAL; | 3502 | return -EINVAL; |
3546 | } | 3503 | } |
@@ -3548,21 +3505,7 @@ static int __init pktgen_create_thread(const char *name, int cpu) | |||
3548 | pe->proc_fops = &pktgen_thread_fops; | 3505 | pe->proc_fops = &pktgen_thread_fops; |
3549 | pe->data = t; | 3506 | pe->data = t; |
3550 | 3507 | ||
3551 | INIT_LIST_HEAD(&t->if_list); | 3508 | wake_up_process(p); |
3552 | |||
3553 | list_add_tail(&t->th_list, &pktgen_threads); | ||
3554 | |||
3555 | t->removed = 0; | ||
3556 | |||
3557 | err = kernel_thread((void *)pktgen_thread_worker, (void *)t, | ||
3558 | CLONE_FS | CLONE_FILES | CLONE_SIGHAND); | ||
3559 | if (err < 0) { | ||
3560 | printk("pktgen: kernel_thread() failed for cpu %d\n", t->cpu); | ||
3561 | remove_proc_entry(t->name, pg_proc_dir); | ||
3562 | list_del(&t->th_list); | ||
3563 | kfree(t); | ||
3564 | return err; | ||
3565 | } | ||
3566 | 3509 | ||
3567 | return 0; | 3510 | return 0; |
3568 | } | 3511 | } |
@@ -3643,10 +3586,8 @@ static int __init pg_init(void) | |||
3643 | 3586 | ||
3644 | for_each_online_cpu(cpu) { | 3587 | for_each_online_cpu(cpu) { |
3645 | int err; | 3588 | int err; |
3646 | char buf[30]; | ||
3647 | 3589 | ||
3648 | sprintf(buf, "kpktgend_%i", cpu); | 3590 | err = pktgen_create_thread(cpu); |
3649 | err = pktgen_create_thread(buf, cpu); | ||
3650 | if (err) | 3591 | if (err) |
3651 | printk("pktgen: WARNING: Cannot create thread for cpu %d (%d)\n", | 3592 | printk("pktgen: WARNING: Cannot create thread for cpu %d (%d)\n", |
3652 | cpu, err); | 3593 | cpu, err); |
@@ -3674,9 +3615,8 @@ static void __exit pg_cleanup(void) | |||
3674 | 3615 | ||
3675 | list_for_each_safe(q, n, &pktgen_threads) { | 3616 | list_for_each_safe(q, n, &pktgen_threads) { |
3676 | t = list_entry(q, struct pktgen_thread, th_list); | 3617 | t = list_entry(q, struct pktgen_thread, th_list); |
3677 | t->control |= (T_TERMINATE); | 3618 | kthread_stop(t->tsk); |
3678 | 3619 | kfree(t); | |
3679 | wait_event_interruptible_timeout(queue, (t->removed == 1), HZ); | ||
3680 | } | 3620 | } |
3681 | 3621 | ||
3682 | /* Un-register us from receiving netdevice events */ | 3622 | /* Un-register us from receiving netdevice events */ |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 84bed40273ad..25c8a42965df 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -165,9 +165,8 @@ struct in_device *inetdev_init(struct net_device *dev) | |||
165 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); | 165 | NET_IPV4_NEIGH, "ipv4", NULL, NULL); |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | /* Account for reference dev->ip_ptr */ | 168 | /* Account for reference dev->ip_ptr (below) */ |
169 | in_dev_hold(in_dev); | 169 | in_dev_hold(in_dev); |
170 | rcu_assign_pointer(dev->ip_ptr, in_dev); | ||
171 | 170 | ||
172 | #ifdef CONFIG_SYSCTL | 171 | #ifdef CONFIG_SYSCTL |
173 | devinet_sysctl_register(in_dev, &in_dev->cnf); | 172 | devinet_sysctl_register(in_dev, &in_dev->cnf); |
@@ -176,6 +175,8 @@ struct in_device *inetdev_init(struct net_device *dev) | |||
176 | if (dev->flags & IFF_UP) | 175 | if (dev->flags & IFF_UP) |
177 | ip_mc_up(in_dev); | 176 | ip_mc_up(in_dev); |
178 | out: | 177 | out: |
178 | /* we can receive as soon as ip_ptr is set -- do this last */ | ||
179 | rcu_assign_pointer(dev->ip_ptr, in_dev); | ||
179 | return in_dev; | 180 | return in_dev; |
180 | out_kfree: | 181 | out_kfree: |
181 | kfree(in_dev); | 182 | kfree(in_dev); |
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index a68966059b50..c47ce7076bd5 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
@@ -15,16 +15,19 @@ int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type) | |||
15 | struct flowi fl = {}; | 15 | struct flowi fl = {}; |
16 | struct dst_entry *odst; | 16 | struct dst_entry *odst; |
17 | unsigned int hh_len; | 17 | unsigned int hh_len; |
18 | unsigned int type; | ||
18 | 19 | ||
20 | type = inet_addr_type(iph->saddr); | ||
19 | if (addr_type == RTN_UNSPEC) | 21 | if (addr_type == RTN_UNSPEC) |
20 | addr_type = inet_addr_type(iph->saddr); | 22 | addr_type = type; |
21 | 23 | ||
22 | /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause | 24 | /* some non-standard hacks like ipt_REJECT.c:send_reset() can cause |
23 | * packets with foreign saddr to appear on the NF_IP_LOCAL_OUT hook. | 25 | * packets with foreign saddr to appear on the NF_IP_LOCAL_OUT hook. |
24 | */ | 26 | */ |
25 | if (addr_type == RTN_LOCAL) { | 27 | if (addr_type == RTN_LOCAL) { |
26 | fl.nl_u.ip4_u.daddr = iph->daddr; | 28 | fl.nl_u.ip4_u.daddr = iph->daddr; |
27 | fl.nl_u.ip4_u.saddr = iph->saddr; | 29 | if (type == RTN_LOCAL) |
30 | fl.nl_u.ip4_u.saddr = iph->saddr; | ||
28 | fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); | 31 | fl.nl_u.ip4_u.tos = RT_TOS(iph->tos); |
29 | fl.oif = (*pskb)->sk ? (*pskb)->sk->sk_bound_dev_if : 0; | 32 | fl.oif = (*pskb)->sk ? (*pskb)->sk->sk_bound_dev_if : 0; |
30 | fl.mark = (*pskb)->mark; | 33 | fl.mark = (*pskb)->mark; |
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig index f6026d4ac428..47bd3ad18b71 100644 --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig | |||
@@ -6,8 +6,8 @@ menu "IP: Netfilter Configuration" | |||
6 | depends on INET && NETFILTER | 6 | depends on INET && NETFILTER |
7 | 7 | ||
8 | config NF_CONNTRACK_IPV4 | 8 | config NF_CONNTRACK_IPV4 |
9 | tristate "IPv4 connection tracking support (required for NAT) (EXPERIMENTAL)" | 9 | tristate "IPv4 connection tracking support (required for NAT)" |
10 | depends on EXPERIMENTAL && NF_CONNTRACK | 10 | depends on NF_CONNTRACK |
11 | ---help--- | 11 | ---help--- |
12 | Connection tracking keeps a record of what packets have passed | 12 | Connection tracking keeps a record of what packets have passed |
13 | through your machine, in order to figure out how they are related | 13 | through your machine, in order to figure out how they are related |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 09696f16aa95..fc1f153c86ba 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -919,13 +919,13 @@ copy_entries_to_user(unsigned int total_size, | |||
919 | #ifdef CONFIG_COMPAT | 919 | #ifdef CONFIG_COMPAT |
920 | struct compat_delta { | 920 | struct compat_delta { |
921 | struct compat_delta *next; | 921 | struct compat_delta *next; |
922 | u_int16_t offset; | 922 | unsigned int offset; |
923 | short delta; | 923 | short delta; |
924 | }; | 924 | }; |
925 | 925 | ||
926 | static struct compat_delta *compat_offsets = NULL; | 926 | static struct compat_delta *compat_offsets = NULL; |
927 | 927 | ||
928 | static int compat_add_offset(u_int16_t offset, short delta) | 928 | static int compat_add_offset(unsigned int offset, short delta) |
929 | { | 929 | { |
930 | struct compat_delta *tmp; | 930 | struct compat_delta *tmp; |
931 | 931 | ||
@@ -957,7 +957,7 @@ static void compat_flush_offsets(void) | |||
957 | } | 957 | } |
958 | } | 958 | } |
959 | 959 | ||
960 | static short compat_calc_jump(u_int16_t offset) | 960 | static short compat_calc_jump(unsigned int offset) |
961 | { | 961 | { |
962 | struct compat_delta *tmp; | 962 | struct compat_delta *tmp; |
963 | short delta; | 963 | short delta; |
@@ -997,7 +997,7 @@ static int compat_calc_entry(struct ipt_entry *e, struct xt_table_info *info, | |||
997 | void *base, struct xt_table_info *newinfo) | 997 | void *base, struct xt_table_info *newinfo) |
998 | { | 998 | { |
999 | struct ipt_entry_target *t; | 999 | struct ipt_entry_target *t; |
1000 | u_int16_t entry_offset; | 1000 | unsigned int entry_offset; |
1001 | int off, i, ret; | 1001 | int off, i, ret; |
1002 | 1002 | ||
1003 | off = 0; | 1003 | off = 0; |
@@ -1467,7 +1467,7 @@ check_compat_entry_size_and_hooks(struct ipt_entry *e, | |||
1467 | { | 1467 | { |
1468 | struct ipt_entry_target *t; | 1468 | struct ipt_entry_target *t; |
1469 | struct ipt_target *target; | 1469 | struct ipt_target *target; |
1470 | u_int16_t entry_offset; | 1470 | unsigned int entry_offset; |
1471 | int ret, off, h, j; | 1471 | int ret, off, h, j; |
1472 | 1472 | ||
1473 | duprintf("check_compat_entry_size_and_hooks %p\n", e); | 1473 | duprintf("check_compat_entry_size_and_hooks %p\n", e); |
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c index 28b9233956b5..d669685afd04 100644 --- a/net/ipv4/netfilter/ipt_MASQUERADE.c +++ b/net/ipv4/netfilter/ipt_MASQUERADE.c | |||
@@ -127,10 +127,13 @@ masquerade_target(struct sk_buff **pskb, | |||
127 | static inline int | 127 | static inline int |
128 | device_cmp(struct ip_conntrack *i, void *ifindex) | 128 | device_cmp(struct ip_conntrack *i, void *ifindex) |
129 | { | 129 | { |
130 | int ret; | ||
130 | #ifdef CONFIG_NF_NAT_NEEDED | 131 | #ifdef CONFIG_NF_NAT_NEEDED |
131 | struct nf_conn_nat *nat = nfct_nat(i); | 132 | struct nf_conn_nat *nat = nfct_nat(i); |
133 | |||
134 | if (!nat) | ||
135 | return 0; | ||
132 | #endif | 136 | #endif |
133 | int ret; | ||
134 | 137 | ||
135 | read_lock_bh(&masq_lock); | 138 | read_lock_bh(&masq_lock); |
136 | #ifdef CONFIG_NF_NAT_NEEDED | 139 | #ifdef CONFIG_NF_NAT_NEEDED |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 9b0a90643151..171e5b55d7d6 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -413,8 +413,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
413 | if (netif_carrier_ok(dev)) | 413 | if (netif_carrier_ok(dev)) |
414 | ndev->if_flags |= IF_READY; | 414 | ndev->if_flags |= IF_READY; |
415 | 415 | ||
416 | /* protected by rtnl_lock */ | ||
417 | rcu_assign_pointer(dev->ip6_ptr, ndev); | ||
418 | 416 | ||
419 | ipv6_mc_init_dev(ndev); | 417 | ipv6_mc_init_dev(ndev); |
420 | ndev->tstamp = jiffies; | 418 | ndev->tstamp = jiffies; |
@@ -425,6 +423,8 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
425 | NULL); | 423 | NULL); |
426 | addrconf_sysctl_register(ndev, &ndev->cnf); | 424 | addrconf_sysctl_register(ndev, &ndev->cnf); |
427 | #endif | 425 | #endif |
426 | /* protected by rtnl_lock */ | ||
427 | rcu_assign_pointer(dev->ip6_ptr, ndev); | ||
428 | return ndev; | 428 | return ndev; |
429 | } | 429 | } |
430 | 430 | ||
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index 1b853c34d301..cd10e44db015 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
@@ -44,8 +44,7 @@ choice | |||
44 | depends on NF_CONNTRACK_ENABLED | 44 | depends on NF_CONNTRACK_ENABLED |
45 | 45 | ||
46 | config NF_CONNTRACK_SUPPORT | 46 | config NF_CONNTRACK_SUPPORT |
47 | bool "Layer 3 Independent Connection tracking (EXPERIMENTAL)" | 47 | bool "Layer 3 Independent Connection tracking" |
48 | depends on EXPERIMENTAL | ||
49 | help | 48 | help |
50 | Layer 3 independent connection tracking is experimental scheme | 49 | Layer 3 independent connection tracking is experimental scheme |
51 | which generalize ip_conntrack to support other layer 3 protocols. | 50 | which generalize ip_conntrack to support other layer 3 protocols. |
@@ -122,7 +121,7 @@ config NF_CONNTRACK_EVENTS | |||
122 | 121 | ||
123 | config NF_CT_PROTO_GRE | 122 | config NF_CT_PROTO_GRE |
124 | tristate | 123 | tristate |
125 | depends on EXPERIMENTAL && NF_CONNTRACK | 124 | depends on NF_CONNTRACK |
126 | 125 | ||
127 | config NF_CT_PROTO_SCTP | 126 | config NF_CT_PROTO_SCTP |
128 | tristate 'SCTP protocol connection tracking support (EXPERIMENTAL)' | 127 | tristate 'SCTP protocol connection tracking support (EXPERIMENTAL)' |
@@ -136,8 +135,8 @@ config NF_CT_PROTO_SCTP | |||
136 | Documentation/modules.txt. If unsure, say `N'. | 135 | Documentation/modules.txt. If unsure, say `N'. |
137 | 136 | ||
138 | config NF_CONNTRACK_AMANDA | 137 | config NF_CONNTRACK_AMANDA |
139 | tristate "Amanda backup protocol support (EXPERIMENTAL)" | 138 | tristate "Amanda backup protocol support" |
140 | depends on EXPERIMENTAL && NF_CONNTRACK | 139 | depends on NF_CONNTRACK |
141 | select TEXTSEARCH | 140 | select TEXTSEARCH |
142 | select TEXTSEARCH_KMP | 141 | select TEXTSEARCH_KMP |
143 | help | 142 | help |
@@ -151,8 +150,8 @@ config NF_CONNTRACK_AMANDA | |||
151 | To compile it as a module, choose M here. If unsure, say N. | 150 | To compile it as a module, choose M here. If unsure, say N. |
152 | 151 | ||
153 | config NF_CONNTRACK_FTP | 152 | config NF_CONNTRACK_FTP |
154 | tristate "FTP protocol support (EXPERIMENTAL)" | 153 | tristate "FTP protocol support" |
155 | depends on EXPERIMENTAL && NF_CONNTRACK | 154 | depends on NF_CONNTRACK |
156 | help | 155 | help |
157 | Tracking FTP connections is problematic: special helpers are | 156 | Tracking FTP connections is problematic: special helpers are |
158 | required for tracking them, and doing masquerading and other forms | 157 | required for tracking them, and doing masquerading and other forms |
@@ -184,8 +183,8 @@ config NF_CONNTRACK_H323 | |||
184 | To compile it as a module, choose M here. If unsure, say N. | 183 | To compile it as a module, choose M here. If unsure, say N. |
185 | 184 | ||
186 | config NF_CONNTRACK_IRC | 185 | config NF_CONNTRACK_IRC |
187 | tristate "IRC protocol support (EXPERIMENTAL)" | 186 | tristate "IRC protocol support" |
188 | depends on EXPERIMENTAL && NF_CONNTRACK | 187 | depends on NF_CONNTRACK |
189 | help | 188 | help |
190 | There is a commonly-used extension to IRC called | 189 | There is a commonly-used extension to IRC called |
191 | Direct Client-to-Client Protocol (DCC). This enables users to send | 190 | Direct Client-to-Client Protocol (DCC). This enables users to send |
@@ -218,8 +217,8 @@ config NF_CONNTRACK_NETBIOS_NS | |||
218 | To compile it as a module, choose M here. If unsure, say N. | 217 | To compile it as a module, choose M here. If unsure, say N. |
219 | 218 | ||
220 | config NF_CONNTRACK_PPTP | 219 | config NF_CONNTRACK_PPTP |
221 | tristate "PPtP protocol support (EXPERIMENTAL)" | 220 | tristate "PPtP protocol support" |
222 | depends on EXPERIMENTAL && NF_CONNTRACK | 221 | depends on NF_CONNTRACK |
223 | select NF_CT_PROTO_GRE | 222 | select NF_CT_PROTO_GRE |
224 | help | 223 | help |
225 | This module adds support for PPTP (Point to Point Tunnelling | 224 | This module adds support for PPTP (Point to Point Tunnelling |
@@ -249,8 +248,8 @@ config NF_CONNTRACK_SIP | |||
249 | To compile it as a module, choose M here. If unsure, say N. | 248 | To compile it as a module, choose M here. If unsure, say N. |
250 | 249 | ||
251 | config NF_CONNTRACK_TFTP | 250 | config NF_CONNTRACK_TFTP |
252 | tristate "TFTP protocol support (EXPERIMENTAL)" | 251 | tristate "TFTP protocol support" |
253 | depends on EXPERIMENTAL && NF_CONNTRACK | 252 | depends on NF_CONNTRACK |
254 | help | 253 | help |
255 | TFTP connection tracking helper, this is required depending | 254 | TFTP connection tracking helper, this is required depending |
256 | on how restrictive your ruleset is. | 255 | on how restrictive your ruleset is. |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index a5a6e192ac2d..f28bf69d3d42 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -745,7 +745,7 @@ static int __init xt_hashlimit_init(void) | |||
745 | } | 745 | } |
746 | hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", proc_net); | 746 | hashlimit_procdir6 = proc_mkdir("ip6t_hashlimit", proc_net); |
747 | if (!hashlimit_procdir6) { | 747 | if (!hashlimit_procdir6) { |
748 | printk(KERN_ERR "xt_hashlimit: tnable to create proc dir " | 748 | printk(KERN_ERR "xt_hashlimit: unable to create proc dir " |
749 | "entry\n"); | 749 | "entry\n"); |
750 | goto err4; | 750 | goto err4; |
751 | } | 751 | } |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 276131fe56dd..383dd4e82ee1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -472,8 +472,7 @@ static int netlink_release(struct socket *sock) | |||
472 | NETLINK_URELEASE, &n); | 472 | NETLINK_URELEASE, &n); |
473 | } | 473 | } |
474 | 474 | ||
475 | if (nlk->module) | 475 | module_put(nlk->module); |
476 | module_put(nlk->module); | ||
477 | 476 | ||
478 | netlink_table_grab(); | 477 | netlink_table_grab(); |
479 | if (nlk->flags & NETLINK_KERNEL_SOCKET) { | 478 | if (nlk->flags & NETLINK_KERNEL_SOCKET) { |
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 52a2726d327f..b5c80b189902 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -484,8 +484,6 @@ out: | |||
484 | return sk; | 484 | return sk; |
485 | } | 485 | } |
486 | 486 | ||
487 | void x25_init_timers(struct sock *sk); | ||
488 | |||
489 | static int x25_create(struct socket *sock, int protocol) | 487 | static int x25_create(struct socket *sock, int protocol) |
490 | { | 488 | { |
491 | struct sock *sk; | 489 | struct sock *sk; |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e5372b11fc8f..82f36d396fca 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -434,18 +434,19 @@ error_no_put: | |||
434 | return NULL; | 434 | return NULL; |
435 | } | 435 | } |
436 | 436 | ||
437 | static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 437 | static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, |
438 | struct rtattr **xfrma) | ||
438 | { | 439 | { |
439 | struct xfrm_usersa_info *p = NLMSG_DATA(nlh); | 440 | struct xfrm_usersa_info *p = NLMSG_DATA(nlh); |
440 | struct xfrm_state *x; | 441 | struct xfrm_state *x; |
441 | int err; | 442 | int err; |
442 | struct km_event c; | 443 | struct km_event c; |
443 | 444 | ||
444 | err = verify_newsa_info(p, (struct rtattr **)xfrma); | 445 | err = verify_newsa_info(p, xfrma); |
445 | if (err) | 446 | if (err) |
446 | return err; | 447 | return err; |
447 | 448 | ||
448 | x = xfrm_state_construct(p, (struct rtattr **)xfrma, &err); | 449 | x = xfrm_state_construct(p, xfrma, &err); |
449 | if (!x) | 450 | if (!x) |
450 | return err; | 451 | return err; |
451 | 452 | ||
@@ -507,14 +508,15 @@ static struct xfrm_state *xfrm_user_state_lookup(struct xfrm_usersa_id *p, | |||
507 | return x; | 508 | return x; |
508 | } | 509 | } |
509 | 510 | ||
510 | static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 511 | static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, |
512 | struct rtattr **xfrma) | ||
511 | { | 513 | { |
512 | struct xfrm_state *x; | 514 | struct xfrm_state *x; |
513 | int err = -ESRCH; | 515 | int err = -ESRCH; |
514 | struct km_event c; | 516 | struct km_event c; |
515 | struct xfrm_usersa_id *p = NLMSG_DATA(nlh); | 517 | struct xfrm_usersa_id *p = NLMSG_DATA(nlh); |
516 | 518 | ||
517 | x = xfrm_user_state_lookup(p, (struct rtattr **)xfrma, &err); | 519 | x = xfrm_user_state_lookup(p, xfrma, &err); |
518 | if (x == NULL) | 520 | if (x == NULL) |
519 | return err; | 521 | return err; |
520 | 522 | ||
@@ -672,14 +674,15 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, | |||
672 | return skb; | 674 | return skb; |
673 | } | 675 | } |
674 | 676 | ||
675 | static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 677 | static int xfrm_get_sa(struct sk_buff *skb, struct nlmsghdr *nlh, |
678 | struct rtattr **xfrma) | ||
676 | { | 679 | { |
677 | struct xfrm_usersa_id *p = NLMSG_DATA(nlh); | 680 | struct xfrm_usersa_id *p = NLMSG_DATA(nlh); |
678 | struct xfrm_state *x; | 681 | struct xfrm_state *x; |
679 | struct sk_buff *resp_skb; | 682 | struct sk_buff *resp_skb; |
680 | int err = -ESRCH; | 683 | int err = -ESRCH; |
681 | 684 | ||
682 | x = xfrm_user_state_lookup(p, (struct rtattr **)xfrma, &err); | 685 | x = xfrm_user_state_lookup(p, xfrma, &err); |
683 | if (x == NULL) | 686 | if (x == NULL) |
684 | goto out_noput; | 687 | goto out_noput; |
685 | 688 | ||
@@ -718,7 +721,8 @@ static int verify_userspi_info(struct xfrm_userspi_info *p) | |||
718 | return 0; | 721 | return 0; |
719 | } | 722 | } |
720 | 723 | ||
721 | static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 724 | static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh, |
725 | struct rtattr **xfrma) | ||
722 | { | 726 | { |
723 | struct xfrm_state *x; | 727 | struct xfrm_state *x; |
724 | struct xfrm_userspi_info *p; | 728 | struct xfrm_userspi_info *p; |
@@ -1013,7 +1017,8 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p, | |||
1013 | return NULL; | 1017 | return NULL; |
1014 | } | 1018 | } |
1015 | 1019 | ||
1016 | static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1020 | static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, |
1021 | struct rtattr **xfrma) | ||
1017 | { | 1022 | { |
1018 | struct xfrm_userpolicy_info *p = NLMSG_DATA(nlh); | 1023 | struct xfrm_userpolicy_info *p = NLMSG_DATA(nlh); |
1019 | struct xfrm_policy *xp; | 1024 | struct xfrm_policy *xp; |
@@ -1024,11 +1029,11 @@ static int xfrm_add_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr | |||
1024 | err = verify_newpolicy_info(p); | 1029 | err = verify_newpolicy_info(p); |
1025 | if (err) | 1030 | if (err) |
1026 | return err; | 1031 | return err; |
1027 | err = verify_sec_ctx_len((struct rtattr **)xfrma); | 1032 | err = verify_sec_ctx_len(xfrma); |
1028 | if (err) | 1033 | if (err) |
1029 | return err; | 1034 | return err; |
1030 | 1035 | ||
1031 | xp = xfrm_policy_construct(p, (struct rtattr **)xfrma, &err); | 1036 | xp = xfrm_policy_construct(p, xfrma, &err); |
1032 | if (!xp) | 1037 | if (!xp) |
1033 | return err; | 1038 | return err; |
1034 | 1039 | ||
@@ -1227,7 +1232,8 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, | |||
1227 | return skb; | 1232 | return skb; |
1228 | } | 1233 | } |
1229 | 1234 | ||
1230 | static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1235 | static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, |
1236 | struct rtattr **xfrma) | ||
1231 | { | 1237 | { |
1232 | struct xfrm_policy *xp; | 1238 | struct xfrm_policy *xp; |
1233 | struct xfrm_userpolicy_id *p; | 1239 | struct xfrm_userpolicy_id *p; |
@@ -1239,7 +1245,7 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr | |||
1239 | p = NLMSG_DATA(nlh); | 1245 | p = NLMSG_DATA(nlh); |
1240 | delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; | 1246 | delete = nlh->nlmsg_type == XFRM_MSG_DELPOLICY; |
1241 | 1247 | ||
1242 | err = copy_from_user_policy_type(&type, (struct rtattr **)xfrma); | 1248 | err = copy_from_user_policy_type(&type, xfrma); |
1243 | if (err) | 1249 | if (err) |
1244 | return err; | 1250 | return err; |
1245 | 1251 | ||
@@ -1250,11 +1256,10 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr | |||
1250 | if (p->index) | 1256 | if (p->index) |
1251 | xp = xfrm_policy_byid(type, p->dir, p->index, delete); | 1257 | xp = xfrm_policy_byid(type, p->dir, p->index, delete); |
1252 | else { | 1258 | else { |
1253 | struct rtattr **rtattrs = (struct rtattr **)xfrma; | 1259 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; |
1254 | struct rtattr *rt = rtattrs[XFRMA_SEC_CTX-1]; | ||
1255 | struct xfrm_policy tmp; | 1260 | struct xfrm_policy tmp; |
1256 | 1261 | ||
1257 | err = verify_sec_ctx_len(rtattrs); | 1262 | err = verify_sec_ctx_len(xfrma); |
1258 | if (err) | 1263 | if (err) |
1259 | return err; | 1264 | return err; |
1260 | 1265 | ||
@@ -1302,7 +1307,8 @@ out: | |||
1302 | return err; | 1307 | return err; |
1303 | } | 1308 | } |
1304 | 1309 | ||
1305 | static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1310 | static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, |
1311 | struct rtattr **xfrma) | ||
1306 | { | 1312 | { |
1307 | struct km_event c; | 1313 | struct km_event c; |
1308 | struct xfrm_usersa_flush *p = NLMSG_DATA(nlh); | 1314 | struct xfrm_usersa_flush *p = NLMSG_DATA(nlh); |
@@ -1367,7 +1373,8 @@ nlmsg_failure: | |||
1367 | return -1; | 1373 | return -1; |
1368 | } | 1374 | } |
1369 | 1375 | ||
1370 | static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1376 | static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, |
1377 | struct rtattr **xfrma) | ||
1371 | { | 1378 | { |
1372 | struct xfrm_state *x; | 1379 | struct xfrm_state *x; |
1373 | struct sk_buff *r_skb; | 1380 | struct sk_buff *r_skb; |
@@ -1415,7 +1422,8 @@ static int xfrm_get_ae(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | |||
1415 | return err; | 1422 | return err; |
1416 | } | 1423 | } |
1417 | 1424 | ||
1418 | static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1425 | static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, |
1426 | struct rtattr **xfrma) | ||
1419 | { | 1427 | { |
1420 | struct xfrm_state *x; | 1428 | struct xfrm_state *x; |
1421 | struct km_event c; | 1429 | struct km_event c; |
@@ -1439,7 +1447,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | |||
1439 | goto out; | 1447 | goto out; |
1440 | 1448 | ||
1441 | spin_lock_bh(&x->lock); | 1449 | spin_lock_bh(&x->lock); |
1442 | err = xfrm_update_ae_params(x,(struct rtattr **)xfrma); | 1450 | err = xfrm_update_ae_params(x, xfrma); |
1443 | spin_unlock_bh(&x->lock); | 1451 | spin_unlock_bh(&x->lock); |
1444 | if (err < 0) | 1452 | if (err < 0) |
1445 | goto out; | 1453 | goto out; |
@@ -1455,14 +1463,15 @@ out: | |||
1455 | return err; | 1463 | return err; |
1456 | } | 1464 | } |
1457 | 1465 | ||
1458 | static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1466 | static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, |
1467 | struct rtattr **xfrma) | ||
1459 | { | 1468 | { |
1460 | struct km_event c; | 1469 | struct km_event c; |
1461 | u8 type = XFRM_POLICY_TYPE_MAIN; | 1470 | u8 type = XFRM_POLICY_TYPE_MAIN; |
1462 | int err; | 1471 | int err; |
1463 | struct xfrm_audit audit_info; | 1472 | struct xfrm_audit audit_info; |
1464 | 1473 | ||
1465 | err = copy_from_user_policy_type(&type, (struct rtattr **)xfrma); | 1474 | err = copy_from_user_policy_type(&type, xfrma); |
1466 | if (err) | 1475 | if (err) |
1467 | return err; | 1476 | return err; |
1468 | 1477 | ||
@@ -1477,7 +1486,8 @@ static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **x | |||
1477 | return 0; | 1486 | return 0; |
1478 | } | 1487 | } |
1479 | 1488 | ||
1480 | static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1489 | static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, |
1490 | struct rtattr **xfrma) | ||
1481 | { | 1491 | { |
1482 | struct xfrm_policy *xp; | 1492 | struct xfrm_policy *xp; |
1483 | struct xfrm_user_polexpire *up = NLMSG_DATA(nlh); | 1493 | struct xfrm_user_polexpire *up = NLMSG_DATA(nlh); |
@@ -1485,18 +1495,17 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh, void * | |||
1485 | u8 type = XFRM_POLICY_TYPE_MAIN; | 1495 | u8 type = XFRM_POLICY_TYPE_MAIN; |
1486 | int err = -ENOENT; | 1496 | int err = -ENOENT; |
1487 | 1497 | ||
1488 | err = copy_from_user_policy_type(&type, (struct rtattr **)xfrma); | 1498 | err = copy_from_user_policy_type(&type, xfrma); |
1489 | if (err) | 1499 | if (err) |
1490 | return err; | 1500 | return err; |
1491 | 1501 | ||
1492 | if (p->index) | 1502 | if (p->index) |
1493 | xp = xfrm_policy_byid(type, p->dir, p->index, 0); | 1503 | xp = xfrm_policy_byid(type, p->dir, p->index, 0); |
1494 | else { | 1504 | else { |
1495 | struct rtattr **rtattrs = (struct rtattr **)xfrma; | 1505 | struct rtattr *rt = xfrma[XFRMA_SEC_CTX-1]; |
1496 | struct rtattr *rt = rtattrs[XFRMA_SEC_CTX-1]; | ||
1497 | struct xfrm_policy tmp; | 1506 | struct xfrm_policy tmp; |
1498 | 1507 | ||
1499 | err = verify_sec_ctx_len(rtattrs); | 1508 | err = verify_sec_ctx_len(xfrma); |
1500 | if (err) | 1509 | if (err) |
1501 | return err; | 1510 | return err; |
1502 | 1511 | ||
@@ -1537,7 +1546,8 @@ out: | |||
1537 | return err; | 1546 | return err; |
1538 | } | 1547 | } |
1539 | 1548 | ||
1540 | static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1549 | static int xfrm_add_sa_expire(struct sk_buff *skb, struct nlmsghdr *nlh, |
1550 | struct rtattr **xfrma) | ||
1541 | { | 1551 | { |
1542 | struct xfrm_state *x; | 1552 | struct xfrm_state *x; |
1543 | int err; | 1553 | int err; |
@@ -1568,7 +1578,8 @@ out: | |||
1568 | return err; | 1578 | return err; |
1569 | } | 1579 | } |
1570 | 1580 | ||
1571 | static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) | 1581 | static int xfrm_add_acquire(struct sk_buff *skb, struct nlmsghdr *nlh, |
1582 | struct rtattr **xfrma) | ||
1572 | { | 1583 | { |
1573 | struct xfrm_policy *xp; | 1584 | struct xfrm_policy *xp; |
1574 | struct xfrm_user_tmpl *ut; | 1585 | struct xfrm_user_tmpl *ut; |
@@ -1647,7 +1658,7 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = { | |||
1647 | #undef XMSGSIZE | 1658 | #undef XMSGSIZE |
1648 | 1659 | ||
1649 | static struct xfrm_link { | 1660 | static struct xfrm_link { |
1650 | int (*doit)(struct sk_buff *, struct nlmsghdr *, void **); | 1661 | int (*doit)(struct sk_buff *, struct nlmsghdr *, struct rtattr **); |
1651 | int (*dump)(struct sk_buff *, struct netlink_callback *); | 1662 | int (*dump)(struct sk_buff *, struct netlink_callback *); |
1652 | } xfrm_dispatch[XFRM_NR_MSGTYPES] = { | 1663 | } xfrm_dispatch[XFRM_NR_MSGTYPES] = { |
1653 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = { .doit = xfrm_add_sa }, | 1664 | [XFRM_MSG_NEWSA - XFRM_MSG_BASE] = { .doit = xfrm_add_sa }, |
@@ -1735,7 +1746,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *err | |||
1735 | 1746 | ||
1736 | if (link->doit == NULL) | 1747 | if (link->doit == NULL) |
1737 | goto err_einval; | 1748 | goto err_einval; |
1738 | *errp = link->doit(skb, nlh, (void **) &xfrma); | 1749 | *errp = link->doit(skb, nlh, xfrma); |
1739 | 1750 | ||
1740 | return *errp; | 1751 | return *errp; |
1741 | 1752 | ||