diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-05 10:55:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-05 10:55:07 -0400 |
commit | 7437e7d3672b6d23c08212c68752c9a9c25f8e9e (patch) | |
tree | 809507a1d8c1cadce9a7cab87970da95aa772d2d | |
parent | 38c9e91bc396672e9ea8013bad63ea4f59d9d31c (diff) | |
parent | 7cff0943a1104479fc9fc2d6ced24c02ba81e73e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
FEC: Fix kernel panic in fec_set_mac_address.
ipv6: Fix default multicast hops setting.
net: ep93xx_eth stops receiving packets
drivers/net/phy: micrel phy driver
dm9601: fix phy/eeprom write routine
ppp_generic: handle non-linear skbs when passing them to pppd
ppp_generic: pull 2 bytes so that PPP_PROTO(skb) is valid
net: fix compile error due to double return type in SOCK_DEBUG
net/usb: initiate sync sequence in sierra_net.c driver
net/usb: remove default in Kconfig for sierra_net driver
r8169: Fix rtl8169_rx_interrupt()
e1000e: Fix oops caused by ASPM patch.
net/sb1250: register mdio bus in probe
sctp: Fix skb_over_panic resulting from multiple invalid parameter errors (CVE-2010-1173) (v4)
p54pci: fix bugs in p54p_check_tx_ring
-rw-r--r-- | drivers/net/arm/ep93xx_eth.c | 10 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 3 | ||||
-rw-r--r-- | drivers/net/fec.c | 2 | ||||
-rw-r--r-- | drivers/net/phy/Kconfig | 5 | ||||
-rw-r--r-- | drivers/net/phy/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 104 | ||||
-rw-r--r-- | drivers/net/ppp_generic.c | 34 | ||||
-rw-r--r-- | drivers/net/r8169.c | 22 | ||||
-rw-r--r-- | drivers/net/sb1250-mac.c | 67 | ||||
-rw-r--r-- | drivers/net/usb/Kconfig | 1 | ||||
-rw-r--r-- | drivers/net/usb/dm9601.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/sierra_net.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54pci.c | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 1 | ||||
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | net/ipv6/af_inet6.c | 2 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 62 |
17 files changed, 256 insertions, 67 deletions
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 6995169d285a..cd17d09f385c 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -311,11 +311,6 @@ err: | |||
311 | processed++; | 311 | processed++; |
312 | } | 312 | } |
313 | 313 | ||
314 | if (processed) { | ||
315 | wrw(ep, REG_RXDENQ, processed); | ||
316 | wrw(ep, REG_RXSTSENQ, processed); | ||
317 | } | ||
318 | |||
319 | return processed; | 314 | return processed; |
320 | } | 315 | } |
321 | 316 | ||
@@ -350,6 +345,11 @@ poll_some_more: | |||
350 | goto poll_some_more; | 345 | goto poll_some_more; |
351 | } | 346 | } |
352 | 347 | ||
348 | if (rx) { | ||
349 | wrw(ep, REG_RXDENQ, rx); | ||
350 | wrw(ep, REG_RXSTSENQ, rx); | ||
351 | } | ||
352 | |||
353 | return rx; | 353 | return rx; |
354 | } | 354 | } |
355 | 355 | ||
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index fb8fc7d1b50d..dbf81788bb40 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -4633,6 +4633,9 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | |||
4633 | reg16 &= ~state; | 4633 | reg16 &= ~state; |
4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); | 4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); |
4635 | 4635 | ||
4636 | if (!pdev->bus->self) | ||
4637 | return; | ||
4638 | |||
4636 | pos = pci_pcie_cap(pdev->bus->self); | 4639 | pos = pci_pcie_cap(pdev->bus->self); |
4637 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); | 4640 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); |
4638 | reg16 &= ~state; | 4641 | reg16 &= ~state; |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 9f98c1c4a344..9b4e8f797a7a 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1653,7 +1653,7 @@ fec_set_mac_address(struct net_device *dev, void *p) | |||
1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), | 1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), |
1654 | fep->hwp + FEC_ADDR_LOW); | 1654 | fep->hwp + FEC_ADDR_LOW); |
1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), | 1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), |
1656 | fep + FEC_ADDR_HIGH); | 1656 | fep->hwp + FEC_ADDR_HIGH); |
1657 | return 0; | 1657 | return 0; |
1658 | } | 1658 | } |
1659 | 1659 | ||
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index fc5938ba3d78..a527e37728cd 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
@@ -88,6 +88,11 @@ config LSI_ET1011C_PHY | |||
88 | ---help--- | 88 | ---help--- |
89 | Supports the LSI ET1011C PHY. | 89 | Supports the LSI ET1011C PHY. |
90 | 90 | ||
91 | config MICREL_PHY | ||
92 | tristate "Driver for Micrel PHYs" | ||
93 | ---help--- | ||
94 | Supports the KSZ9021, VSC8201, KS8001 PHYs. | ||
95 | |||
91 | config FIXED_PHY | 96 | config FIXED_PHY |
92 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" | 97 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" |
93 | depends on PHYLIB=y | 98 | depends on PHYLIB=y |
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 1342585af381..13bebab65d02 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile | |||
@@ -20,4 +20,5 @@ obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o | |||
20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o | 20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o |
21 | obj-$(CONFIG_NATIONAL_PHY) += national.o | 21 | obj-$(CONFIG_NATIONAL_PHY) += national.o |
22 | obj-$(CONFIG_STE10XP) += ste10Xp.o | 22 | obj-$(CONFIG_STE10XP) += ste10Xp.o |
23 | obj-$(CONFIG_MICREL_PHY) += micrel.o | ||
23 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o | 24 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c new file mode 100644 index 000000000000..0cd80e4d71d9 --- /dev/null +++ b/drivers/net/phy/micrel.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * drivers/net/phy/micrel.c | ||
3 | * | ||
4 | * Driver for Micrel PHYs | ||
5 | * | ||
6 | * Author: David J. Choi | ||
7 | * | ||
8 | * Copyright (c) 2010 Micrel, Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | * | ||
15 | * Support : ksz9021 , vsc8201, ks8001 | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/phy.h> | ||
21 | |||
22 | #define PHY_ID_KSZ9021 0x00221611 | ||
23 | #define PHY_ID_VSC8201 0x000FC413 | ||
24 | #define PHY_ID_KS8001 0x0022161A | ||
25 | |||
26 | |||
27 | static int kszphy_config_init(struct phy_device *phydev) | ||
28 | { | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | |||
33 | static struct phy_driver ks8001_driver = { | ||
34 | .phy_id = PHY_ID_KS8001, | ||
35 | .phy_id_mask = 0x00fffff0, | ||
36 | .features = PHY_BASIC_FEATURES, | ||
37 | .flags = PHY_POLL, | ||
38 | .config_init = kszphy_config_init, | ||
39 | .config_aneg = genphy_config_aneg, | ||
40 | .read_status = genphy_read_status, | ||
41 | .driver = { .owner = THIS_MODULE,}, | ||
42 | }; | ||
43 | |||
44 | static struct phy_driver vsc8201_driver = { | ||
45 | .phy_id = PHY_ID_VSC8201, | ||
46 | .name = "Micrel VSC8201", | ||
47 | .phy_id_mask = 0x00fffff0, | ||
48 | .features = PHY_BASIC_FEATURES, | ||
49 | .flags = PHY_POLL, | ||
50 | .config_init = kszphy_config_init, | ||
51 | .config_aneg = genphy_config_aneg, | ||
52 | .read_status = genphy_read_status, | ||
53 | .driver = { .owner = THIS_MODULE,}, | ||
54 | }; | ||
55 | |||
56 | static struct phy_driver ksz9021_driver = { | ||
57 | .phy_id = PHY_ID_KSZ9021, | ||
58 | .phy_id_mask = 0x000fff10, | ||
59 | .name = "Micrel KSZ9021 Gigabit PHY", | ||
60 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause, | ||
61 | .flags = PHY_POLL, | ||
62 | .config_init = kszphy_config_init, | ||
63 | .config_aneg = genphy_config_aneg, | ||
64 | .read_status = genphy_read_status, | ||
65 | .driver = { .owner = THIS_MODULE, }, | ||
66 | }; | ||
67 | |||
68 | static int __init ksphy_init(void) | ||
69 | { | ||
70 | int ret; | ||
71 | |||
72 | ret = phy_driver_register(&ks8001_driver); | ||
73 | if (ret) | ||
74 | goto err1; | ||
75 | ret = phy_driver_register(&vsc8201_driver); | ||
76 | if (ret) | ||
77 | goto err2; | ||
78 | |||
79 | ret = phy_driver_register(&ksz9021_driver); | ||
80 | if (ret) | ||
81 | goto err3; | ||
82 | return 0; | ||
83 | |||
84 | err3: | ||
85 | phy_driver_unregister(&vsc8201_driver); | ||
86 | err2: | ||
87 | phy_driver_unregister(&ks8001_driver); | ||
88 | err1: | ||
89 | return ret; | ||
90 | } | ||
91 | |||
92 | static void __exit ksphy_exit(void) | ||
93 | { | ||
94 | phy_driver_unregister(&ks8001_driver); | ||
95 | phy_driver_unregister(&vsc8201_driver); | ||
96 | phy_driver_unregister(&ksz9021_driver); | ||
97 | } | ||
98 | |||
99 | module_init(ksphy_init); | ||
100 | module_exit(ksphy_exit); | ||
101 | |||
102 | MODULE_DESCRIPTION("Micrel PHY driver"); | ||
103 | MODULE_AUTHOR("David J. Choi"); | ||
104 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6e281bc825e5..8518a2e58e53 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -405,6 +405,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
405 | DECLARE_WAITQUEUE(wait, current); | 405 | DECLARE_WAITQUEUE(wait, current); |
406 | ssize_t ret; | 406 | ssize_t ret; |
407 | struct sk_buff *skb = NULL; | 407 | struct sk_buff *skb = NULL; |
408 | struct iovec iov; | ||
408 | 409 | ||
409 | ret = count; | 410 | ret = count; |
410 | 411 | ||
@@ -448,7 +449,9 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
448 | if (skb->len > count) | 449 | if (skb->len > count) |
449 | goto outf; | 450 | goto outf; |
450 | ret = -EFAULT; | 451 | ret = -EFAULT; |
451 | if (copy_to_user(buf, skb->data, skb->len)) | 452 | iov.iov_base = buf; |
453 | iov.iov_len = count; | ||
454 | if (skb_copy_datagram_iovec(skb, 0, &iov, skb->len)) | ||
452 | goto outf; | 455 | goto outf; |
453 | ret = skb->len; | 456 | ret = skb->len; |
454 | 457 | ||
@@ -1567,13 +1570,22 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
1567 | struct channel *pch = chan->ppp; | 1570 | struct channel *pch = chan->ppp; |
1568 | int proto; | 1571 | int proto; |
1569 | 1572 | ||
1570 | if (!pch || skb->len == 0) { | 1573 | if (!pch) { |
1571 | kfree_skb(skb); | 1574 | kfree_skb(skb); |
1572 | return; | 1575 | return; |
1573 | } | 1576 | } |
1574 | 1577 | ||
1575 | proto = PPP_PROTO(skb); | ||
1576 | read_lock_bh(&pch->upl); | 1578 | read_lock_bh(&pch->upl); |
1579 | if (!pskb_may_pull(skb, 2)) { | ||
1580 | kfree_skb(skb); | ||
1581 | if (pch->ppp) { | ||
1582 | ++pch->ppp->dev->stats.rx_length_errors; | ||
1583 | ppp_receive_error(pch->ppp); | ||
1584 | } | ||
1585 | goto done; | ||
1586 | } | ||
1587 | |||
1588 | proto = PPP_PROTO(skb); | ||
1577 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { | 1589 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { |
1578 | /* put it on the channel queue */ | 1590 | /* put it on the channel queue */ |
1579 | skb_queue_tail(&pch->file.rq, skb); | 1591 | skb_queue_tail(&pch->file.rq, skb); |
@@ -1585,6 +1597,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
1585 | } else { | 1597 | } else { |
1586 | ppp_do_recv(pch->ppp, skb, pch); | 1598 | ppp_do_recv(pch->ppp, skb, pch); |
1587 | } | 1599 | } |
1600 | |||
1601 | done: | ||
1588 | read_unlock_bh(&pch->upl); | 1602 | read_unlock_bh(&pch->upl); |
1589 | } | 1603 | } |
1590 | 1604 | ||
@@ -1617,7 +1631,8 @@ ppp_input_error(struct ppp_channel *chan, int code) | |||
1617 | static void | 1631 | static void |
1618 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | 1632 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) |
1619 | { | 1633 | { |
1620 | if (pskb_may_pull(skb, 2)) { | 1634 | /* note: a 0-length skb is used as an error indication */ |
1635 | if (skb->len > 0) { | ||
1621 | #ifdef CONFIG_PPP_MULTILINK | 1636 | #ifdef CONFIG_PPP_MULTILINK |
1622 | /* XXX do channel-level decompression here */ | 1637 | /* XXX do channel-level decompression here */ |
1623 | if (PPP_PROTO(skb) == PPP_MP) | 1638 | if (PPP_PROTO(skb) == PPP_MP) |
@@ -1625,15 +1640,10 @@ ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
1625 | else | 1640 | else |
1626 | #endif /* CONFIG_PPP_MULTILINK */ | 1641 | #endif /* CONFIG_PPP_MULTILINK */ |
1627 | ppp_receive_nonmp_frame(ppp, skb); | 1642 | ppp_receive_nonmp_frame(ppp, skb); |
1628 | return; | 1643 | } else { |
1644 | kfree_skb(skb); | ||
1645 | ppp_receive_error(ppp); | ||
1629 | } | 1646 | } |
1630 | |||
1631 | if (skb->len > 0) | ||
1632 | /* note: a 0-length skb is used as an error indication */ | ||
1633 | ++ppp->dev->stats.rx_length_errors; | ||
1634 | |||
1635 | kfree_skb(skb); | ||
1636 | ppp_receive_error(ppp); | ||
1637 | } | 1647 | } |
1638 | 1648 | ||
1639 | static void | 1649 | static void |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 4748c21eb72e..dd8106ff35aa 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1042,14 +1042,14 @@ static void rtl8169_vlan_rx_register(struct net_device *dev, | |||
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
1045 | struct sk_buff *skb) | 1045 | struct sk_buff *skb, int polling) |
1046 | { | 1046 | { |
1047 | u32 opts2 = le32_to_cpu(desc->opts2); | 1047 | u32 opts2 = le32_to_cpu(desc->opts2); |
1048 | struct vlan_group *vlgrp = tp->vlgrp; | 1048 | struct vlan_group *vlgrp = tp->vlgrp; |
1049 | int ret; | 1049 | int ret; |
1050 | 1050 | ||
1051 | if (vlgrp && (opts2 & RxVlanTag)) { | 1051 | if (vlgrp && (opts2 & RxVlanTag)) { |
1052 | vlan_hwaccel_receive_skb(skb, vlgrp, swab16(opts2 & 0xffff)); | 1052 | __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling); |
1053 | ret = 0; | 1053 | ret = 0; |
1054 | } else | 1054 | } else |
1055 | ret = -1; | 1055 | ret = -1; |
@@ -1066,7 +1066,7 @@ static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, | |||
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
1069 | struct sk_buff *skb) | 1069 | struct sk_buff *skb, int polling) |
1070 | { | 1070 | { |
1071 | return -1; | 1071 | return -1; |
1072 | } | 1072 | } |
@@ -4445,12 +4445,20 @@ out: | |||
4445 | return done; | 4445 | return done; |
4446 | } | 4446 | } |
4447 | 4447 | ||
4448 | /* | ||
4449 | * Warning : rtl8169_rx_interrupt() might be called : | ||
4450 | * 1) from NAPI (softirq) context | ||
4451 | * (polling = 1 : we should call netif_receive_skb()) | ||
4452 | * 2) from process context (rtl8169_reset_task()) | ||
4453 | * (polling = 0 : we must call netif_rx() instead) | ||
4454 | */ | ||
4448 | static int rtl8169_rx_interrupt(struct net_device *dev, | 4455 | static int rtl8169_rx_interrupt(struct net_device *dev, |
4449 | struct rtl8169_private *tp, | 4456 | struct rtl8169_private *tp, |
4450 | void __iomem *ioaddr, u32 budget) | 4457 | void __iomem *ioaddr, u32 budget) |
4451 | { | 4458 | { |
4452 | unsigned int cur_rx, rx_left; | 4459 | unsigned int cur_rx, rx_left; |
4453 | unsigned int delta, count; | 4460 | unsigned int delta, count; |
4461 | int polling = (budget != ~(u32)0) ? 1 : 0; | ||
4454 | 4462 | ||
4455 | cur_rx = tp->cur_rx; | 4463 | cur_rx = tp->cur_rx; |
4456 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; | 4464 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; |
@@ -4512,8 +4520,12 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
4512 | skb_put(skb, pkt_size); | 4520 | skb_put(skb, pkt_size); |
4513 | skb->protocol = eth_type_trans(skb, dev); | 4521 | skb->protocol = eth_type_trans(skb, dev); |
4514 | 4522 | ||
4515 | if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0) | 4523 | if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) { |
4516 | netif_receive_skb(skb); | 4524 | if (likely(polling)) |
4525 | netif_receive_skb(skb); | ||
4526 | else | ||
4527 | netif_rx(skb); | ||
4528 | } | ||
4517 | 4529 | ||
4518 | dev->stats.rx_bytes += pkt_size; | 4530 | dev->stats.rx_bytes += pkt_size; |
4519 | dev->stats.rx_packets++; | 4531 | dev->stats.rx_packets++; |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 9944e5d662c0..04efc0c1bda9 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -2353,17 +2353,36 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
2353 | 2353 | ||
2354 | sc->mii_bus = mdiobus_alloc(); | 2354 | sc->mii_bus = mdiobus_alloc(); |
2355 | if (sc->mii_bus == NULL) { | 2355 | if (sc->mii_bus == NULL) { |
2356 | sbmac_uninitctx(sc); | 2356 | err = -ENOMEM; |
2357 | return -ENOMEM; | 2357 | goto uninit_ctx; |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | sc->mii_bus->name = sbmac_mdio_string; | ||
2361 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
2362 | sc->mii_bus->priv = sc; | ||
2363 | sc->mii_bus->read = sbmac_mii_read; | ||
2364 | sc->mii_bus->write = sbmac_mii_write; | ||
2365 | sc->mii_bus->irq = sc->phy_irq; | ||
2366 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
2367 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
2368 | |||
2369 | sc->mii_bus->parent = &pldev->dev; | ||
2370 | /* | ||
2371 | * Probe PHY address | ||
2372 | */ | ||
2373 | err = mdiobus_register(sc->mii_bus); | ||
2374 | if (err) { | ||
2375 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
2376 | dev->name); | ||
2377 | goto free_mdio; | ||
2378 | } | ||
2379 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
2380 | |||
2360 | err = register_netdev(dev); | 2381 | err = register_netdev(dev); |
2361 | if (err) { | 2382 | if (err) { |
2362 | printk(KERN_ERR "%s.%d: unable to register netdev\n", | 2383 | printk(KERN_ERR "%s.%d: unable to register netdev\n", |
2363 | sbmac_string, idx); | 2384 | sbmac_string, idx); |
2364 | mdiobus_free(sc->mii_bus); | 2385 | goto unreg_mdio; |
2365 | sbmac_uninitctx(sc); | ||
2366 | return err; | ||
2367 | } | 2386 | } |
2368 | 2387 | ||
2369 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); | 2388 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); |
@@ -2379,19 +2398,15 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
2379 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", | 2398 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", |
2380 | dev->name, base, eaddr); | 2399 | dev->name, base, eaddr); |
2381 | 2400 | ||
2382 | sc->mii_bus->name = sbmac_mdio_string; | ||
2383 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
2384 | sc->mii_bus->priv = sc; | ||
2385 | sc->mii_bus->read = sbmac_mii_read; | ||
2386 | sc->mii_bus->write = sbmac_mii_write; | ||
2387 | sc->mii_bus->irq = sc->phy_irq; | ||
2388 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
2389 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
2390 | |||
2391 | sc->mii_bus->parent = &pldev->dev; | ||
2392 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
2393 | |||
2394 | return 0; | 2401 | return 0; |
2402 | unreg_mdio: | ||
2403 | mdiobus_unregister(sc->mii_bus); | ||
2404 | dev_set_drvdata(&pldev->dev, NULL); | ||
2405 | free_mdio: | ||
2406 | mdiobus_free(sc->mii_bus); | ||
2407 | uninit_ctx: | ||
2408 | sbmac_uninitctx(sc); | ||
2409 | return err; | ||
2395 | } | 2410 | } |
2396 | 2411 | ||
2397 | 2412 | ||
@@ -2417,16 +2432,6 @@ static int sbmac_open(struct net_device *dev) | |||
2417 | goto out_err; | 2432 | goto out_err; |
2418 | } | 2433 | } |
2419 | 2434 | ||
2420 | /* | ||
2421 | * Probe PHY address | ||
2422 | */ | ||
2423 | err = mdiobus_register(sc->mii_bus); | ||
2424 | if (err) { | ||
2425 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
2426 | dev->name); | ||
2427 | goto out_unirq; | ||
2428 | } | ||
2429 | |||
2430 | sc->sbm_speed = sbmac_speed_none; | 2435 | sc->sbm_speed = sbmac_speed_none; |
2431 | sc->sbm_duplex = sbmac_duplex_none; | 2436 | sc->sbm_duplex = sbmac_duplex_none; |
2432 | sc->sbm_fc = sbmac_fc_none; | 2437 | sc->sbm_fc = sbmac_fc_none; |
@@ -2457,11 +2462,7 @@ static int sbmac_open(struct net_device *dev) | |||
2457 | return 0; | 2462 | return 0; |
2458 | 2463 | ||
2459 | out_unregister: | 2464 | out_unregister: |
2460 | mdiobus_unregister(sc->mii_bus); | ||
2461 | |||
2462 | out_unirq: | ||
2463 | free_irq(dev->irq, dev); | 2465 | free_irq(dev->irq, dev); |
2464 | |||
2465 | out_err: | 2466 | out_err: |
2466 | return err; | 2467 | return err; |
2467 | } | 2468 | } |
@@ -2650,9 +2651,6 @@ static int sbmac_close(struct net_device *dev) | |||
2650 | 2651 | ||
2651 | phy_disconnect(sc->phy_dev); | 2652 | phy_disconnect(sc->phy_dev); |
2652 | sc->phy_dev = NULL; | 2653 | sc->phy_dev = NULL; |
2653 | |||
2654 | mdiobus_unregister(sc->mii_bus); | ||
2655 | |||
2656 | free_irq(dev->irq, dev); | 2654 | free_irq(dev->irq, dev); |
2657 | 2655 | ||
2658 | sbdma_emptyring(&(sc->sbm_txdma)); | 2656 | sbdma_emptyring(&(sc->sbm_txdma)); |
@@ -2760,6 +2758,7 @@ static int __exit sbmac_remove(struct platform_device *pldev) | |||
2760 | 2758 | ||
2761 | unregister_netdev(dev); | 2759 | unregister_netdev(dev); |
2762 | sbmac_uninitctx(sc); | 2760 | sbmac_uninitctx(sc); |
2761 | mdiobus_unregister(sc->mii_bus); | ||
2763 | mdiobus_free(sc->mii_bus); | 2762 | mdiobus_free(sc->mii_bus); |
2764 | iounmap(sc->sbm_base); | 2763 | iounmap(sc->sbm_base); |
2765 | free_netdev(dev); | 2764 | free_netdev(dev); |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 5d58abc224f4..d7b7018a1de1 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -400,7 +400,6 @@ config USB_IPHETH | |||
400 | config USB_SIERRA_NET | 400 | config USB_SIERRA_NET |
401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" | 401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" |
402 | depends on USB_USBNET | 402 | depends on USB_USBNET |
403 | default y | ||
404 | help | 403 | help |
405 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. | 404 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. |
406 | 405 | ||
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 04b281002a76..5dfed9297b22 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -240,7 +240,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu | |||
240 | goto out; | 240 | goto out; |
241 | 241 | ||
242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); | 242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); |
243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1c : 0x14); | 243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12); |
244 | 244 | ||
245 | for (i = 0; i < DM_TIMEOUT; i++) { | 245 | for (i = 0; i < DM_TIMEOUT; i++) { |
246 | u8 tmp; | 246 | u8 tmp; |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index a44f9e0ea098..f1942d69a0d5 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -789,6 +789,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
789 | /* prepare sync message from template */ | 789 | /* prepare sync message from template */ |
790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); | 790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); |
791 | 791 | ||
792 | /* initiate the sync sequence */ | ||
793 | sierra_net_dosync(dev); | ||
794 | |||
792 | return 0; | 795 | return 0; |
793 | } | 796 | } |
794 | 797 | ||
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 269fda362836..c24067f1a0cb 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -246,7 +246,7 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, | |||
246 | u32 idx, i; | 246 | u32 idx, i; |
247 | 247 | ||
248 | i = (*index) % ring_limit; | 248 | i = (*index) % ring_limit; |
249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[1]); | 249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[ring_index]); |
250 | idx %= ring_limit; | 250 | idx %= ring_limit; |
251 | 251 | ||
252 | while (i != idx) { | 252 | while (i != idx) { |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ff3017744711..597f8e27aaf6 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -778,6 +778,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, | |||
778 | struct iovec *data); | 778 | struct iovec *data); |
779 | void sctp_chunk_free(struct sctp_chunk *); | 779 | void sctp_chunk_free(struct sctp_chunk *); |
780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); | 780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); |
781 | void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); | ||
781 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, | 782 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, |
782 | const struct sctp_association *, | 783 | const struct sctp_association *, |
783 | struct sock *); | 784 | struct sock *); |
diff --git a/include/net/sock.h b/include/net/sock.h index b4603cd54fcd..1ad6435f252e 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -74,7 +74,7 @@ | |||
74 | printk(KERN_DEBUG msg); } while (0) | 74 | printk(KERN_DEBUG msg); } while (0) |
75 | #else | 75 | #else |
76 | /* Validate arguments and do nothing */ | 76 | /* Validate arguments and do nothing */ |
77 | static void inline int __attribute__ ((format (printf, 2, 3))) | 77 | static inline void __attribute__ ((format (printf, 2, 3))) |
78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) |
79 | { | 79 | { |
80 | } | 80 | } |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 3192aa02ba5d..3f9e86b15e0d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -200,7 +200,7 @@ lookup_protocol: | |||
200 | 200 | ||
201 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); | 201 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); |
202 | np->hop_limit = -1; | 202 | np->hop_limit = -1; |
203 | np->mcast_hops = -1; | 203 | np->mcast_hops = IPV6_DEFAULT_MCASTHOPS; |
204 | np->mc_loop = 1; | 204 | np->mc_loop = 1; |
205 | np->pmtudisc = IPV6_PMTUDISC_WANT; | 205 | np->pmtudisc = IPV6_PMTUDISC_WANT; |
206 | np->ipv6only = net->ipv6.sysctl.bindv6only; | 206 | np->ipv6only = net->ipv6.sysctl.bindv6only; |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 0fd5b4c88358..30c1767186b8 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -108,7 +108,7 @@ static const struct sctp_paramhdr prsctp_param = { | |||
108 | cpu_to_be16(sizeof(struct sctp_paramhdr)), | 108 | cpu_to_be16(sizeof(struct sctp_paramhdr)), |
109 | }; | 109 | }; |
110 | 110 | ||
111 | /* A helper to initialize to initialize an op error inside a | 111 | /* A helper to initialize an op error inside a |
112 | * provided chunk, as most cause codes will be embedded inside an | 112 | * provided chunk, as most cause codes will be embedded inside an |
113 | * abort chunk. | 113 | * abort chunk. |
114 | */ | 114 | */ |
@@ -125,6 +125,29 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, | |||
125 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); | 125 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); |
126 | } | 126 | } |
127 | 127 | ||
128 | /* A helper to initialize an op error inside a | ||
129 | * provided chunk, as most cause codes will be embedded inside an | ||
130 | * abort chunk. Differs from sctp_init_cause in that it won't oops | ||
131 | * if there isn't enough space in the op error chunk | ||
132 | */ | ||
133 | int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code, | ||
134 | size_t paylen) | ||
135 | { | ||
136 | sctp_errhdr_t err; | ||
137 | __u16 len; | ||
138 | |||
139 | /* Cause code constants are now defined in network order. */ | ||
140 | err.cause = cause_code; | ||
141 | len = sizeof(sctp_errhdr_t) + paylen; | ||
142 | err.length = htons(len); | ||
143 | |||
144 | if (skb_tailroom(chunk->skb) > len) | ||
145 | return -ENOSPC; | ||
146 | chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk, | ||
147 | sizeof(sctp_errhdr_t), | ||
148 | &err); | ||
149 | return 0; | ||
150 | } | ||
128 | /* 3.3.2 Initiation (INIT) (1) | 151 | /* 3.3.2 Initiation (INIT) (1) |
129 | * | 152 | * |
130 | * This chunk is used to initiate a SCTP association between two | 153 | * This chunk is used to initiate a SCTP association between two |
@@ -1132,6 +1155,24 @@ nodata: | |||
1132 | return retval; | 1155 | return retval; |
1133 | } | 1156 | } |
1134 | 1157 | ||
1158 | /* Create an Operation Error chunk of a fixed size, | ||
1159 | * specifically, max(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT) | ||
1160 | * This is a helper function to allocate an error chunk for | ||
1161 | * for those invalid parameter codes in which we may not want | ||
1162 | * to report all the errors, if the incomming chunk is large | ||
1163 | */ | ||
1164 | static inline struct sctp_chunk *sctp_make_op_error_fixed( | ||
1165 | const struct sctp_association *asoc, | ||
1166 | const struct sctp_chunk *chunk) | ||
1167 | { | ||
1168 | size_t size = asoc ? asoc->pathmtu : 0; | ||
1169 | |||
1170 | if (!size) | ||
1171 | size = SCTP_DEFAULT_MAXSEGMENT; | ||
1172 | |||
1173 | return sctp_make_op_error_space(asoc, chunk, size); | ||
1174 | } | ||
1175 | |||
1135 | /* Create an Operation Error chunk. */ | 1176 | /* Create an Operation Error chunk. */ |
1136 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, | 1177 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, |
1137 | const struct sctp_chunk *chunk, | 1178 | const struct sctp_chunk *chunk, |
@@ -1374,6 +1415,18 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data) | |||
1374 | return target; | 1415 | return target; |
1375 | } | 1416 | } |
1376 | 1417 | ||
1418 | /* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient | ||
1419 | * space in the chunk | ||
1420 | */ | ||
1421 | void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk, | ||
1422 | int len, const void *data) | ||
1423 | { | ||
1424 | if (skb_tailroom(chunk->skb) > len) | ||
1425 | return sctp_addto_chunk(chunk, len, data); | ||
1426 | else | ||
1427 | return NULL; | ||
1428 | } | ||
1429 | |||
1377 | /* Append bytes from user space to the end of a chunk. Will panic if | 1430 | /* Append bytes from user space to the end of a chunk. Will panic if |
1378 | * chunk is not big enough. | 1431 | * chunk is not big enough. |
1379 | * Returns a kernel err value. | 1432 | * Returns a kernel err value. |
@@ -1977,13 +2030,12 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, | |||
1977 | * returning multiple unknown parameters. | 2030 | * returning multiple unknown parameters. |
1978 | */ | 2031 | */ |
1979 | if (NULL == *errp) | 2032 | if (NULL == *errp) |
1980 | *errp = sctp_make_op_error_space(asoc, chunk, | 2033 | *errp = sctp_make_op_error_fixed(asoc, chunk); |
1981 | ntohs(chunk->chunk_hdr->length)); | ||
1982 | 2034 | ||
1983 | if (*errp) { | 2035 | if (*errp) { |
1984 | sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM, | 2036 | sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, |
1985 | WORD_ROUND(ntohs(param.p->length))); | 2037 | WORD_ROUND(ntohs(param.p->length))); |
1986 | sctp_addto_chunk(*errp, | 2038 | sctp_addto_chunk_fixed(*errp, |
1987 | WORD_ROUND(ntohs(param.p->length)), | 2039 | WORD_ROUND(ntohs(param.p->length)), |
1988 | param.v); | 2040 | param.v); |
1989 | } else { | 2041 | } else { |