aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-12 16:08:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-12 16:08:09 -0400
commit609eb39c8d8a8d2930780428f6cbe2f63eb84734 (patch)
tree0cf74a0e6e64531b31c5a1c9d45fbcb88f5e4d1f
parent123d43acd2e55cd7db792d17c7e906db42cada42 (diff)
parent22626216c46f2ec86287e75ea86dd9ac3df54265 (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: (47 commits) [SCTP]: Fix local_addr deletions during list traversals. net: fix build with CONFIG_NET=n [TCP]: Prevent sending past receiver window with TSO (at last skb) rt2x00: Add new D-Link USB ID rt2x00: never disable multicast because it disables broadcast too libertas: fix the 'compare command with itself' properly drivers/net/Kconfig: fix whitespace for GELIC_WIRELESS entry [NETFILTER]: nf_queue: don't return error when unregistering a non-existant handler [NETFILTER]: nfnetlink_queue: fix EPERM when binding/unbinding and instance 0 exists [NETFILTER]: nfnetlink_log: fix EPERM when binding/unbinding and instance 0 exists [NETFILTER]: nf_conntrack: replace horrible hack with ksize() [NETFILTER]: nf_conntrack: add \n to "expectation table full" message [NETFILTER]: xt_time: fix failure to match on Sundays [NETFILTER]: nfnetlink_log: fix computation of netlink skb size [NETFILTER]: nfnetlink_queue: fix computation of allocated size for netlink skb. [NETFILTER]: nfnetlink: fix ifdef in nfnetlink_compat.h [NET]: include <linux/types.h> into linux/ethtool.h for __u* typedef [NET]: Make /proc/net a symlink on /proc/self/net (v3) RxRPC: fix rxrpc_recvmsg()'s returning of msg_name net/enc28j60: oops fix ...
-rw-r--r--MAINTAINERS32
-rw-r--r--drivers/atm/firestream.c4
-rw-r--r--drivers/atm/fore200e.c4
-rw-r--r--drivers/atm/idt77252.c12
-rw-r--r--drivers/bluetooth/hci_usb.c3
-rw-r--r--drivers/isdn/i4l/isdn_common.c4
-rw-r--r--drivers/isdn/i4l/isdn_v110.c2
-rw-r--r--drivers/net/Kconfig20
-rw-r--r--drivers/net/ac3200.c7
-rw-r--r--drivers/net/apne.c7
-rw-r--r--drivers/net/appletalk/ltpc.c3
-rw-r--r--drivers/net/arcnet/capmode.c6
-rw-r--r--drivers/net/atarilance.c5
-rw-r--r--drivers/net/e100.c29
-rw-r--r--drivers/net/enc28j60.c3
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/mv643xx_eth.c1
-rw-r--r--drivers/net/pcmcia/axnet_cs.c2
-rw-r--r--drivers/net/phy/Kconfig1
-rw-r--r--drivers/net/phy/davicom.c17
-rw-r--r--drivers/net/pppol2tp.c69
-rw-r--r--drivers/net/s2io.c2
-rw-r--r--drivers/net/tulip/de2104x.c3
-rw-r--r--drivers/net/wan/sbni.c2
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c5
-rw-r--r--fs/proc/base.c3
-rw-r--r--fs/proc/generic.c26
-rw-r--r--fs/proc/internal.h7
-rw-r--r--fs/proc/proc_net.c117
-rw-r--r--include/linux/ethtool.h1
-rw-r--r--include/linux/netfilter/nfnetlink_compat.h2
-rw-r--r--include/linux/proc_fs.h3
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/irda/irttp.h6
-rw-r--r--include/net/net_namespace.h1
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h1
-rw-r--r--net/bluetooth/bnep/bnep.h2
-rw-r--r--net/bluetooth/bnep/sock.c4
-rw-r--r--net/bluetooth/hci_core.c4
-rw-r--r--net/bluetooth/hci_sock.c4
-rw-r--r--net/ipv4/tcp_output.c12
-rw-r--r--net/netfilter/nf_conntrack_expect.c2
-rw-r--r--net/netfilter/nf_conntrack_extend.c19
-rw-r--r--net/netfilter/nf_queue.c2
-rw-r--r--net/netfilter/nfnetlink_log.c32
-rw-r--r--net/netfilter/nfnetlink_queue.c17
-rw-r--r--net/netfilter/xt_time.c7
-rw-r--r--net/rxrpc/ar-recvmsg.c3
-rw-r--r--net/sctp/bind_addr.c4
-rw-r--r--net/sctp/ipv6.c4
-rw-r--r--net/sctp/protocol.c4
-rw-r--r--net/sctp/sm_make_chunk.c8
-rw-r--r--net/sctp/socket.c73
55 files changed, 364 insertions, 257 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 25f450fe1059..0f95a4a787a6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2052,43 +2052,19 @@ M: kernel@wantstofly.org
2052L: netdev@vger.kernel.org 2052L: netdev@vger.kernel.org
2053S: Maintained 2053S: Maintained
2054 2054
2055INTEL PRO/100 ETHERNET SUPPORT 2055INTEL ETHERNET DRIVERS (e100/e1000/e1000e/igb/ixgb/ixgbe)
2056P: Auke Kok 2056P: Auke Kok
2057M: auke-jan.h.kok@intel.com 2057M: auke-jan.h.kok@intel.com
2058P: Jesse Brandeburg 2058P: Jesse Brandeburg
2059M: jesse.brandeburg@intel.com 2059M: jesse.brandeburg@intel.com
2060P: Jeff Kirsher 2060P: Jeff Kirsher
2061M: jeffrey.t.kirsher@intel.com 2061M: jeffrey.t.kirsher@intel.com
2062P: Bruce Allan
2063M: bruce.w.allan@intel.com
2062P: John Ronciak 2064P: John Ronciak
2063M: john.ronciak@intel.com 2065M: john.ronciak@intel.com
2064L: e1000-devel@lists.sourceforge.net 2066L: e1000-devel@lists.sourceforge.net
2065W: http://sourceforge.net/projects/e1000/ 2067W: http://e1000.sourceforge.net/
2066S: Supported
2067
2068INTEL PRO/1000 GIGABIT ETHERNET SUPPORT
2069P: Auke Kok
2070M: auke-jan.h.kok@intel.com
2071P: Jesse Brandeburg
2072M: jesse.brandeburg@intel.com
2073P: Jeff Kirsher
2074M: jeffrey.t.kirsher@intel.com
2075P: John Ronciak
2076M: john.ronciak@intel.com
2077L: e1000-devel@lists.sourceforge.net
2078W: http://sourceforge.net/projects/e1000/
2079S: Supported
2080
2081INTEL PRO/10GbE SUPPORT
2082P: Ayyappan Veeraiyan
2083M: ayyappan.veeraiyan@intel.com
2084P: Auke Kok
2085M: auke-jan.h.kok@intel.com
2086P: Jesse Brandeburg
2087M: jesse.brandeburg@intel.com
2088P: John Ronciak
2089M: john.ronciak@intel.com
2090L: e1000-devel@lists.sourceforge.net
2091W: http://sourceforge.net/projects/e1000/
2092S: Supported 2068S: Supported
2093 2069
2094INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT 2070INTEL PRO/WIRELESS 2100 NETWORK CONNECTION SUPPORT
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index c662d686154a..47c57a4294b7 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -331,8 +331,8 @@ module_param(fs_keystream, int, 0);
331#define FS_DEBUG_QSIZE 0x00001000 331#define FS_DEBUG_QSIZE 0x00001000
332 332
333 333
334#define func_enter() fs_dprintk (FS_DEBUG_FLOW, "fs: enter %s\n", __FUNCTION__) 334#define func_enter() fs_dprintk(FS_DEBUG_FLOW, "fs: enter %s\n", __func__)
335#define func_exit() fs_dprintk (FS_DEBUG_FLOW, "fs: exit %s\n", __FUNCTION__) 335#define func_exit() fs_dprintk(FS_DEBUG_FLOW, "fs: exit %s\n", __func__)
336 336
337 337
338static struct fs_dev *fs_boards = NULL; 338static struct fs_dev *fs_boards = NULL;
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index f97e050338f0..9427a61f62b0 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -95,8 +95,8 @@
95#if 1 95#if 1
96#define ASSERT(expr) if (!(expr)) { \ 96#define ASSERT(expr) if (!(expr)) { \
97 printk(FORE200E "assertion failed! %s[%d]: %s\n", \ 97 printk(FORE200E "assertion failed! %s[%d]: %s\n", \
98 __FUNCTION__, __LINE__, #expr); \ 98 __func__, __LINE__, #expr); \
99 panic(FORE200E "%s", __FUNCTION__); \ 99 panic(FORE200E "%s", __func__); \
100 } 100 }
101#else 101#else
102#define ASSERT(expr) do {} while (0) 102#define ASSERT(expr) do {} while (0)
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index eee54c0cde68..b967919fb7e2 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -555,7 +555,7 @@ idt77252_tx_dump(struct idt77252_dev *card)
555 struct vc_map *vc; 555 struct vc_map *vc;
556 int i; 556 int i;
557 557
558 printk("%s\n", __FUNCTION__); 558 printk("%s\n", __func__);
559 for (i = 0; i < card->tct_size; i++) { 559 for (i = 0; i < card->tct_size; i++) {
560 vc = card->vcs[i]; 560 vc = card->vcs[i];
561 if (!vc) 561 if (!vc)
@@ -1035,7 +1035,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1035 skb = sb_pool_skb(card, le32_to_cpu(rsqe->word_2)); 1035 skb = sb_pool_skb(card, le32_to_cpu(rsqe->word_2));
1036 if (skb == NULL) { 1036 if (skb == NULL) {
1037 printk("%s: NULL skb in %s, rsqe: %08x %08x %08x %08x\n", 1037 printk("%s: NULL skb in %s, rsqe: %08x %08x %08x %08x\n",
1038 card->name, __FUNCTION__, 1038 card->name, __func__,
1039 le32_to_cpu(rsqe->word_1), le32_to_cpu(rsqe->word_2), 1039 le32_to_cpu(rsqe->word_1), le32_to_cpu(rsqe->word_2),
1040 le32_to_cpu(rsqe->word_3), le32_to_cpu(rsqe->word_4)); 1040 le32_to_cpu(rsqe->word_3), le32_to_cpu(rsqe->word_4));
1041 return; 1041 return;
@@ -1873,7 +1873,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1873 return; 1873 return;
1874 1874
1875 if (sb_pool_add(card, skb, queue)) { 1875 if (sb_pool_add(card, skb, queue)) {
1876 printk("%s: SB POOL full\n", __FUNCTION__); 1876 printk("%s: SB POOL full\n", __func__);
1877 goto outfree; 1877 goto outfree;
1878 } 1878 }
1879 1879
@@ -1883,7 +1883,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1883 IDT77252_PRV_PADDR(skb) = paddr; 1883 IDT77252_PRV_PADDR(skb) = paddr;
1884 1884
1885 if (push_rx_skb(card, skb, queue)) { 1885 if (push_rx_skb(card, skb, queue)) {
1886 printk("%s: FB QUEUE full\n", __FUNCTION__); 1886 printk("%s: FB QUEUE full\n", __func__);
1887 goto outunmap; 1887 goto outunmap;
1888 } 1888 }
1889 } 1889 }
@@ -3821,12 +3821,12 @@ static int __init idt77252_init(void)
3821{ 3821{
3822 struct sk_buff *skb; 3822 struct sk_buff *skb;
3823 3823
3824 printk("%s: at %p\n", __FUNCTION__, idt77252_init); 3824 printk("%s: at %p\n", __func__, idt77252_init);
3825 3825
3826 if (sizeof(skb->cb) < sizeof(struct atm_skb_data) + 3826 if (sizeof(skb->cb) < sizeof(struct atm_skb_data) +
3827 sizeof(struct idt77252_skb_prv)) { 3827 sizeof(struct idt77252_skb_prv)) {
3828 printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n", 3828 printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n",
3829 __FUNCTION__, (unsigned long) sizeof(skb->cb), 3829 __func__, (unsigned long) sizeof(skb->cb),
3830 (unsigned long) sizeof(struct atm_skb_data) + 3830 (unsigned long) sizeof(struct atm_skb_data) +
3831 sizeof(struct idt77252_skb_prv)); 3831 sizeof(struct idt77252_skb_prv));
3832 return -EIO; 3832 return -EIO;
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index f16c94cbf488..8b884f87d8b7 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -149,6 +149,9 @@ static struct usb_device_id blacklist_ids[] = {
149 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC }, 149 { USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
150 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC }, 150 { USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
151 151
152 /* CONWISE Technology based adapters with buggy SCO support */
153 { USB_DEVICE(0x0e5e, 0x6622), .driver_info = HCI_BROKEN_ISOC },
154
152 /* Belkin F8T012 and F8T013 devices */ 155 /* Belkin F8T012 and F8T013 devices */
153 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 156 { USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
154 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 157 { USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 9cef6fcf587b..d4ad6992f776 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -981,13 +981,13 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
981} 981}
982 982
983 983
984static __inline int 984static inline int
985isdn_minor2drv(int minor) 985isdn_minor2drv(int minor)
986{ 986{
987 return (dev->drvmap[minor]); 987 return (dev->drvmap[minor]);
988} 988}
989 989
990static __inline int 990static inline int
991isdn_minor2chan(int minor) 991isdn_minor2chan(int minor)
992{ 992{
993 return (dev->chanmap[minor]); 993 return (dev->chanmap[minor]);
diff --git a/drivers/isdn/i4l/isdn_v110.c b/drivers/isdn/i4l/isdn_v110.c
index 5484d3c38a57..c5d02b6aafab 100644
--- a/drivers/isdn/i4l/isdn_v110.c
+++ b/drivers/isdn/i4l/isdn_v110.c
@@ -62,7 +62,7 @@ static unsigned char V110_OffMatrix_38400[] =
62 * and to 67452301 when keylen = 2. This is necessary because ordering on 62 * and to 67452301 when keylen = 2. This is necessary because ordering on
63 * the isdn line is the other way. 63 * the isdn line is the other way.
64 */ 64 */
65static __inline unsigned char 65static inline unsigned char
66FlipBits(unsigned char c, int keylen) 66FlipBits(unsigned char c, int keylen)
67{ 67{
68 unsigned char b = c; 68 unsigned char b = c;
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a0f0e605d630..fe7b5ec09708 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2366,15 +2366,15 @@ config GELIC_NET
2366 module will be called ps3_gelic. 2366 module will be called ps3_gelic.
2367 2367
2368config GELIC_WIRELESS 2368config GELIC_WIRELESS
2369 bool "PS3 Wireless support" 2369 bool "PS3 Wireless support"
2370 depends on GELIC_NET 2370 depends on GELIC_NET
2371 select WIRELESS_EXT 2371 select WIRELESS_EXT
2372 help 2372 help
2373 This option adds the support for the wireless feature of PS3. 2373 This option adds the support for the wireless feature of PS3.
2374 If you have the wireless-less model of PS3 or have no plan to 2374 If you have the wireless-less model of PS3 or have no plan to
2375 use wireless feature, disabling this option saves memory. As 2375 use wireless feature, disabling this option saves memory. As
2376 the driver automatically distinguishes the models, you can 2376 the driver automatically distinguishes the models, you can
2377 safely enable this option even if you have a wireless-less model. 2377 safely enable this option even if you have a wireless-less model.
2378 2378
2379config GIANFAR 2379config GIANFAR
2380 tristate "Gianfar Ethernet" 2380 tristate "Gianfar Ethernet"
@@ -2519,7 +2519,7 @@ config CHELSIO_T3
2519 2519
2520config EHEA 2520config EHEA
2521 tristate "eHEA Ethernet support" 2521 tristate "eHEA Ethernet support"
2522 depends on IBMEBUS && INET 2522 depends on IBMEBUS && INET && SPARSEMEM
2523 select INET_LRO 2523 select INET_LRO
2524 ---help--- 2524 ---help---
2525 This driver supports the IBM pSeries eHEA ethernet adapter. 2525 This driver supports the IBM pSeries eHEA ethernet adapter.
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index 5136d94923aa..b1448637107f 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -369,7 +369,7 @@ MODULE_PARM_DESC(mem, "Memory base address(es)");
369MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver"); 369MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver");
370MODULE_LICENSE("GPL"); 370MODULE_LICENSE("GPL");
371 371
372int __init init_module(void) 372static int __init ac3200_module_init(void)
373{ 373{
374 struct net_device *dev; 374 struct net_device *dev;
375 int this_dev, found = 0; 375 int this_dev, found = 0;
@@ -404,8 +404,7 @@ static void cleanup_card(struct net_device *dev)
404 iounmap(ei_status.mem); 404 iounmap(ei_status.mem);
405} 405}
406 406
407void __exit 407static void __exit ac3200_module_exit(void)
408cleanup_module(void)
409{ 408{
410 int this_dev; 409 int this_dev;
411 410
@@ -418,4 +417,6 @@ cleanup_module(void)
418 } 417 }
419 } 418 }
420} 419}
420module_init(ac3200_module_init);
421module_exit(ac3200_module_exit);
421#endif /* MODULE */ 422#endif /* MODULE */
diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index c12cbdf368b1..47a8275d3962 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -569,7 +569,7 @@ static irqreturn_t apne_interrupt(int irq, void *dev_id)
569#ifdef MODULE 569#ifdef MODULE
570static struct net_device *apne_dev; 570static struct net_device *apne_dev;
571 571
572int __init init_module(void) 572static int __init apne_module_init(void)
573{ 573{
574 apne_dev = apne_probe(-1); 574 apne_dev = apne_probe(-1);
575 if (IS_ERR(apne_dev)) 575 if (IS_ERR(apne_dev))
@@ -577,7 +577,7 @@ int __init init_module(void)
577 return 0; 577 return 0;
578} 578}
579 579
580void __exit cleanup_module(void) 580static void __exit apne_module_exit(void)
581{ 581{
582 unregister_netdev(apne_dev); 582 unregister_netdev(apne_dev);
583 583
@@ -591,7 +591,8 @@ void __exit cleanup_module(void)
591 591
592 free_netdev(apne_dev); 592 free_netdev(apne_dev);
593} 593}
594 594module_init(apne_module_init);
595module_exit(apne_module_exit);
595#endif 596#endif
596 597
597static int init_pcmcia(void) 598static int init_pcmcia(void)
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 6ab2c2d4d673..fef5560bc7a2 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -1252,7 +1252,7 @@ module_param(irq, int, 0);
1252module_param(dma, int, 0); 1252module_param(dma, int, 0);
1253 1253
1254 1254
1255int __init init_module(void) 1255static int __init ltpc_module_init(void)
1256{ 1256{
1257 if(io == 0) 1257 if(io == 0)
1258 printk(KERN_NOTICE 1258 printk(KERN_NOTICE
@@ -1263,6 +1263,7 @@ int __init init_module(void)
1263 return PTR_ERR(dev_ltpc); 1263 return PTR_ERR(dev_ltpc);
1264 return 0; 1264 return 0;
1265} 1265}
1266module_init(ltpc_module_init);
1266#endif 1267#endif
1267 1268
1268static void __exit ltpc_cleanup(void) 1269static void __exit ltpc_cleanup(void)
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index cc4610db6395..02cb8f1c1148 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -80,17 +80,19 @@ void arcnet_cap_init(void)
80 80
81#ifdef MODULE 81#ifdef MODULE
82 82
83int __init init_module(void) 83static int __init capmode_module_init(void)
84{ 84{
85 printk(VERSION); 85 printk(VERSION);
86 arcnet_cap_init(); 86 arcnet_cap_init();
87 return 0; 87 return 0;
88} 88}
89 89
90void cleanup_module(void) 90static void __exit capmode_module_exit(void)
91{ 91{
92 arcnet_unregister_proto(&capmode_proto); 92 arcnet_unregister_proto(&capmode_proto);
93} 93}
94module_init(capmode_module_init);
95module_exit(capmode_module_exit);
94 96
95MODULE_LICENSE("GPL"); 97MODULE_LICENSE("GPL");
96#endif /* MODULE */ 98#endif /* MODULE */
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index b74dbeef8050..13c293b286de 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -336,8 +336,6 @@ struct lance_addr {
336 336
337/***************************** Prototypes *****************************/ 337/***************************** Prototypes *****************************/
338 338
339static int addr_accessible( volatile void *regp, int wordflag, int
340 writeflag );
341static unsigned long lance_probe1( struct net_device *dev, struct lance_addr 339static unsigned long lance_probe1( struct net_device *dev, struct lance_addr
342 *init_rec ); 340 *init_rec );
343static int lance_open( struct net_device *dev ); 341static int lance_open( struct net_device *dev );
@@ -406,7 +404,8 @@ struct net_device * __init atarilance_probe(int unit)
406 404
407/* Derived from hwreg_present() in atari/config.c: */ 405/* Derived from hwreg_present() in atari/config.c: */
408 406
409static int __init addr_accessible( volatile void *regp, int wordflag, int writeflag ) 407static noinline int __init addr_accessible(volatile void *regp, int wordflag,
408 int writeflag)
410{ 409{
411 int ret; 410 int ret;
412 long flags; 411 long flags;
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 36ba6dc96acc..cdf3090a1885 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2782,16 +2782,13 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2782 } 2782 }
2783} 2783}
2784 2784
2785#ifdef CONFIG_PM
2786static int e100_suspend(struct pci_dev *pdev, pm_message_t state) 2785static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2787{ 2786{
2788 struct net_device *netdev = pci_get_drvdata(pdev); 2787 struct net_device *netdev = pci_get_drvdata(pdev);
2789 struct nic *nic = netdev_priv(netdev); 2788 struct nic *nic = netdev_priv(netdev);
2790 2789
2791 if (netif_running(netdev)) 2790 if (netif_running(netdev))
2792 napi_disable(&nic->napi); 2791 e100_down(nic);
2793 del_timer_sync(&nic->watchdog);
2794 netif_carrier_off(nic->netdev);
2795 netif_device_detach(netdev); 2792 netif_device_detach(netdev);
2796 2793
2797 pci_save_state(pdev); 2794 pci_save_state(pdev);
@@ -2804,14 +2801,13 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2804 pci_enable_wake(pdev, PCI_D3cold, 0); 2801 pci_enable_wake(pdev, PCI_D3cold, 0);
2805 } 2802 }
2806 2803
2807 free_irq(pdev->irq, netdev);
2808
2809 pci_disable_device(pdev); 2804 pci_disable_device(pdev);
2810 pci_set_power_state(pdev, PCI_D3hot); 2805 pci_set_power_state(pdev, PCI_D3hot);
2811 2806
2812 return 0; 2807 return 0;
2813} 2808}
2814 2809
2810#ifdef CONFIG_PM
2815static int e100_resume(struct pci_dev *pdev) 2811static int e100_resume(struct pci_dev *pdev)
2816{ 2812{
2817 struct net_device *netdev = pci_get_drvdata(pdev); 2813 struct net_device *netdev = pci_get_drvdata(pdev);
@@ -2832,26 +2828,7 @@ static int e100_resume(struct pci_dev *pdev)
2832 2828
2833static void e100_shutdown(struct pci_dev *pdev) 2829static void e100_shutdown(struct pci_dev *pdev)
2834{ 2830{
2835 struct net_device *netdev = pci_get_drvdata(pdev); 2831 e100_suspend(pdev, PMSG_SUSPEND);
2836 struct nic *nic = netdev_priv(netdev);
2837
2838 if (netif_running(netdev))
2839 napi_disable(&nic->napi);
2840 del_timer_sync(&nic->watchdog);
2841 netif_carrier_off(nic->netdev);
2842
2843 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2844 pci_enable_wake(pdev, PCI_D3hot, 1);
2845 pci_enable_wake(pdev, PCI_D3cold, 1);
2846 } else {
2847 pci_enable_wake(pdev, PCI_D3hot, 0);
2848 pci_enable_wake(pdev, PCI_D3cold, 0);
2849 }
2850
2851 free_irq(pdev->irq, netdev);
2852
2853 pci_disable_device(pdev);
2854 pci_set_power_state(pdev, PCI_D3hot);
2855} 2832}
2856 2833
2857/* ------------------ PCI Error Recovery infrastructure -------------- */ 2834/* ------------------ PCI Error Recovery infrastructure -------------- */
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 0809a6a5a286..46a90e9ec563 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -900,7 +900,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
900 if (RSV_GETBIT(rxstat, RSV_LENCHECKERR)) 900 if (RSV_GETBIT(rxstat, RSV_LENCHECKERR))
901 ndev->stats.rx_frame_errors++; 901 ndev->stats.rx_frame_errors++;
902 } else { 902 } else {
903 skb = dev_alloc_skb(len); 903 skb = dev_alloc_skb(len + NET_IP_ALIGN);
904 if (!skb) { 904 if (!skb) {
905 if (netif_msg_rx_err(priv)) 905 if (netif_msg_rx_err(priv))
906 dev_err(&ndev->dev, 906 dev_err(&ndev->dev,
@@ -908,6 +908,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
908 ndev->stats.rx_dropped++; 908 ndev->stats.rx_dropped++;
909 } else { 909 } else {
910 skb->dev = ndev; 910 skb->dev = ndev;
911 skb_reserve(skb, NET_IP_ALIGN);
911 /* copy the packet from the receive buffer */ 912 /* copy the packet from the receive buffer */
912 enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv), 913 enc28j60_mem_read(priv, priv->next_pk_ptr + sizeof(rsv),
913 len, skb_put(skb, len)); 914 len, skb_put(skb, len));
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 23d0a4afe0e1..c2095ce531c9 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2133,7 +2133,7 @@ static void ixgbe_watchdog(unsigned long data)
2133 (link_speed == IXGBE_LINK_SPEED_10GB_FULL ? 2133 (link_speed == IXGBE_LINK_SPEED_10GB_FULL ?
2134 "10 Gbps" : 2134 "10 Gbps" :
2135 (link_speed == IXGBE_LINK_SPEED_1GB_FULL ? 2135 (link_speed == IXGBE_LINK_SPEED_1GB_FULL ?
2136 "1 Gpbs" : "unknown speed")), 2136 "1 Gbps" : "unknown speed")),
2137 ((FLOW_RX && FLOW_TX) ? "RX/TX" : 2137 ((FLOW_RX && FLOW_TX) ? "RX/TX" :
2138 (FLOW_RX ? "RX" : 2138 (FLOW_RX ? "RX" :
2139 (FLOW_TX ? "TX" : "None")))); 2139 (FLOW_TX ? "TX" : "None"))));
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index b528ce77c406..771139e283af 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2104,6 +2104,7 @@ MODULE_LICENSE("GPL");
2104MODULE_AUTHOR( "Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani" 2104MODULE_AUTHOR( "Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani"
2105 " and Dale Farnsworth"); 2105 " and Dale Farnsworth");
2106MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX"); 2106MODULE_DESCRIPTION("Ethernet driver for Marvell MV643XX");
2107MODULE_ALIAS("platform:mv643xx_eth");
2107 2108
2108/* 2109/*
2109 * The second part is the low level driver of the gigE ethernet ports. 2110 * The second part is the low level driver of the gigE ethernet ports.
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index e8a63e483a2b..ce95c5d168fe 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1268,7 +1268,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1268 } 1268 }
1269 } 1269 }
1270 1270
1271 if (interrupts && ei_debug) 1271 if (interrupts && ei_debug > 3)
1272 { 1272 {
1273 handled = 1; 1273 handled = 1;
1274 if (nr_serviced >= MAX_SERVICE) 1274 if (nr_serviced >= MAX_SERVICE)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f4ca0591231d..3ac8529bb92c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -67,6 +67,7 @@ config REALTEK_PHY
67 67
68config FIXED_PHY 68config FIXED_PHY
69 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" 69 bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
70 depends on PHYLIB=y
70 ---help--- 71 ---help---
71 Adds the platform "fixed" MDIO Bus to cover the boards that use 72 Adds the platform "fixed" MDIO Bus to cover the boards that use
72 PHYs that are not connected to the real MDIO bus. 73 PHYs that are not connected to the real MDIO bus.
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 7ed632db00d7..d926168bc780 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -37,6 +37,7 @@
37 37
38#define MII_DM9161_SCR 0x10 38#define MII_DM9161_SCR 0x10
39#define MII_DM9161_SCR_INIT 0x0610 39#define MII_DM9161_SCR_INIT 0x0610
40#define MII_DM9161_SCR_RMII 0x0100
40 41
41/* DM9161 Interrupt Register */ 42/* DM9161 Interrupt Register */
42#define MII_DM9161_INTR 0x15 43#define MII_DM9161_INTR 0x15
@@ -103,7 +104,7 @@ static int dm9161_config_aneg(struct phy_device *phydev)
103 104
104static int dm9161_config_init(struct phy_device *phydev) 105static int dm9161_config_init(struct phy_device *phydev)
105{ 106{
106 int err; 107 int err, temp;
107 108
108 /* Isolate the PHY */ 109 /* Isolate the PHY */
109 err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE); 110 err = phy_write(phydev, MII_BMCR, BMCR_ISOLATE);
@@ -111,9 +112,19 @@ static int dm9161_config_init(struct phy_device *phydev)
111 if (err < 0) 112 if (err < 0)
112 return err; 113 return err;
113 114
114 /* Do not bypass the scrambler/descrambler */ 115 switch (phydev->interface) {
115 err = phy_write(phydev, MII_DM9161_SCR, MII_DM9161_SCR_INIT); 116 case PHY_INTERFACE_MODE_MII:
117 temp = MII_DM9161_SCR_INIT;
118 break;
119 case PHY_INTERFACE_MODE_RMII:
120 temp = MII_DM9161_SCR_INIT | MII_DM9161_SCR_RMII;
121 break;
122 default:
123 return -EINVAL;
124 }
116 125
126 /* Do not bypass the scrambler/descrambler */
127 err = phy_write(phydev, MII_DM9161_SCR, temp);
117 if (err < 0) 128 if (err < 0)
118 return err; 129 return err;
119 130
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index 86e5dba079fe..3d10ca050b79 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -302,14 +302,14 @@ pppol2tp_session_find(struct pppol2tp_tunnel *tunnel, u16 session_id)
302 struct pppol2tp_session *session; 302 struct pppol2tp_session *session;
303 struct hlist_node *walk; 303 struct hlist_node *walk;
304 304
305 read_lock(&tunnel->hlist_lock); 305 read_lock_bh(&tunnel->hlist_lock);
306 hlist_for_each_entry(session, walk, session_list, hlist) { 306 hlist_for_each_entry(session, walk, session_list, hlist) {
307 if (session->tunnel_addr.s_session == session_id) { 307 if (session->tunnel_addr.s_session == session_id) {
308 read_unlock(&tunnel->hlist_lock); 308 read_unlock_bh(&tunnel->hlist_lock);
309 return session; 309 return session;
310 } 310 }
311 } 311 }
312 read_unlock(&tunnel->hlist_lock); 312 read_unlock_bh(&tunnel->hlist_lock);
313 313
314 return NULL; 314 return NULL;
315} 315}
@@ -320,14 +320,14 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
320{ 320{
321 struct pppol2tp_tunnel *tunnel = NULL; 321 struct pppol2tp_tunnel *tunnel = NULL;
322 322
323 read_lock(&pppol2tp_tunnel_list_lock); 323 read_lock_bh(&pppol2tp_tunnel_list_lock);
324 list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) { 324 list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) {
325 if (tunnel->stats.tunnel_id == tunnel_id) { 325 if (tunnel->stats.tunnel_id == tunnel_id) {
326 read_unlock(&pppol2tp_tunnel_list_lock); 326 read_unlock_bh(&pppol2tp_tunnel_list_lock);
327 return tunnel; 327 return tunnel;
328 } 328 }
329 } 329 }
330 read_unlock(&pppol2tp_tunnel_list_lock); 330 read_unlock_bh(&pppol2tp_tunnel_list_lock);
331 331
332 return NULL; 332 return NULL;
333} 333}
@@ -342,10 +342,11 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
342static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb) 342static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb)
343{ 343{
344 struct sk_buff *skbp; 344 struct sk_buff *skbp;
345 struct sk_buff *tmp;
345 u16 ns = PPPOL2TP_SKB_CB(skb)->ns; 346 u16 ns = PPPOL2TP_SKB_CB(skb)->ns;
346 347
347 spin_lock(&session->reorder_q.lock); 348 spin_lock_bh(&session->reorder_q.lock);
348 skb_queue_walk(&session->reorder_q, skbp) { 349 skb_queue_walk_safe(&session->reorder_q, skbp, tmp) {
349 if (PPPOL2TP_SKB_CB(skbp)->ns > ns) { 350 if (PPPOL2TP_SKB_CB(skbp)->ns > ns) {
350 __skb_insert(skb, skbp->prev, skbp, &session->reorder_q); 351 __skb_insert(skb, skbp->prev, skbp, &session->reorder_q);
351 PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG, 352 PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG,
@@ -360,7 +361,7 @@ static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_
360 __skb_queue_tail(&session->reorder_q, skb); 361 __skb_queue_tail(&session->reorder_q, skb);
361 362
362out: 363out:
363 spin_unlock(&session->reorder_q.lock); 364 spin_unlock_bh(&session->reorder_q.lock);
364} 365}
365 366
366/* Dequeue a single skb. 367/* Dequeue a single skb.
@@ -371,10 +372,9 @@ static void pppol2tp_recv_dequeue_skb(struct pppol2tp_session *session, struct s
371 int length = PPPOL2TP_SKB_CB(skb)->length; 372 int length = PPPOL2TP_SKB_CB(skb)->length;
372 struct sock *session_sock = NULL; 373 struct sock *session_sock = NULL;
373 374
374 /* We're about to requeue the skb, so unlink it and return resources 375 /* We're about to requeue the skb, so return resources
375 * to its current owner (a socket receive buffer). 376 * to its current owner (a socket receive buffer).
376 */ 377 */
377 skb_unlink(skb, &session->reorder_q);
378 skb_orphan(skb); 378 skb_orphan(skb);
379 379
380 tunnel->stats.rx_packets++; 380 tunnel->stats.rx_packets++;
@@ -442,7 +442,7 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
442 * expect to send up next, dequeue it and any other 442 * expect to send up next, dequeue it and any other
443 * in-sequence packets behind it. 443 * in-sequence packets behind it.
444 */ 444 */
445 spin_lock(&session->reorder_q.lock); 445 spin_lock_bh(&session->reorder_q.lock);
446 skb_queue_walk_safe(&session->reorder_q, skb, tmp) { 446 skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
447 if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) { 447 if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) {
448 session->stats.rx_seq_discards++; 448 session->stats.rx_seq_discards++;
@@ -470,13 +470,18 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
470 goto out; 470 goto out;
471 } 471 }
472 } 472 }
473 spin_unlock(&session->reorder_q.lock); 473 __skb_unlink(skb, &session->reorder_q);
474
475 /* Process the skb. We release the queue lock while we
476 * do so to let other contexts process the queue.
477 */
478 spin_unlock_bh(&session->reorder_q.lock);
474 pppol2tp_recv_dequeue_skb(session, skb); 479 pppol2tp_recv_dequeue_skb(session, skb);
475 spin_lock(&session->reorder_q.lock); 480 spin_lock_bh(&session->reorder_q.lock);
476 } 481 }
477 482
478out: 483out:
479 spin_unlock(&session->reorder_q.lock); 484 spin_unlock_bh(&session->reorder_q.lock);
480} 485}
481 486
482/* Internal receive frame. Do the real work of receiving an L2TP data frame 487/* Internal receive frame. Do the real work of receiving an L2TP data frame
@@ -1059,7 +1064,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1059 1064
1060 /* Get routing info from the tunnel socket */ 1065 /* Get routing info from the tunnel socket */
1061 dst_release(skb->dst); 1066 dst_release(skb->dst);
1062 skb->dst = sk_dst_get(sk_tun); 1067 skb->dst = dst_clone(__sk_dst_get(sk_tun));
1063 skb_orphan(skb); 1068 skb_orphan(skb);
1064 skb->sk = sk_tun; 1069 skb->sk = sk_tun;
1065 1070
@@ -1107,7 +1112,7 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
1107 PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO, 1112 PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO,
1108 "%s: closing all sessions...\n", tunnel->name); 1113 "%s: closing all sessions...\n", tunnel->name);
1109 1114
1110 write_lock(&tunnel->hlist_lock); 1115 write_lock_bh(&tunnel->hlist_lock);
1111 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) { 1116 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) {
1112again: 1117again:
1113 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { 1118 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
@@ -1129,7 +1134,7 @@ again:
1129 * disappear as we're jumping between locks. 1134 * disappear as we're jumping between locks.
1130 */ 1135 */
1131 sock_hold(sk); 1136 sock_hold(sk);
1132 write_unlock(&tunnel->hlist_lock); 1137 write_unlock_bh(&tunnel->hlist_lock);
1133 lock_sock(sk); 1138 lock_sock(sk);
1134 1139
1135 if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { 1140 if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
@@ -1154,11 +1159,11 @@ again:
1154 * list so we are guaranteed to make forward 1159 * list so we are guaranteed to make forward
1155 * progress. 1160 * progress.
1156 */ 1161 */
1157 write_lock(&tunnel->hlist_lock); 1162 write_lock_bh(&tunnel->hlist_lock);
1158 goto again; 1163 goto again;
1159 } 1164 }
1160 } 1165 }
1161 write_unlock(&tunnel->hlist_lock); 1166 write_unlock_bh(&tunnel->hlist_lock);
1162} 1167}
1163 1168
1164/* Really kill the tunnel. 1169/* Really kill the tunnel.
@@ -1167,9 +1172,9 @@ again:
1167static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel) 1172static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel)
1168{ 1173{
1169 /* Remove from socket list */ 1174 /* Remove from socket list */
1170 write_lock(&pppol2tp_tunnel_list_lock); 1175 write_lock_bh(&pppol2tp_tunnel_list_lock);
1171 list_del_init(&tunnel->list); 1176 list_del_init(&tunnel->list);
1172 write_unlock(&pppol2tp_tunnel_list_lock); 1177 write_unlock_bh(&pppol2tp_tunnel_list_lock);
1173 1178
1174 atomic_dec(&pppol2tp_tunnel_count); 1179 atomic_dec(&pppol2tp_tunnel_count);
1175 kfree(tunnel); 1180 kfree(tunnel);
@@ -1245,9 +1250,9 @@ static void pppol2tp_session_destruct(struct sock *sk)
1245 /* Delete the session socket from the 1250 /* Delete the session socket from the
1246 * hash 1251 * hash
1247 */ 1252 */
1248 write_lock(&tunnel->hlist_lock); 1253 write_lock_bh(&tunnel->hlist_lock);
1249 hlist_del_init(&session->hlist); 1254 hlist_del_init(&session->hlist);
1250 write_unlock(&tunnel->hlist_lock); 1255 write_unlock_bh(&tunnel->hlist_lock);
1251 1256
1252 atomic_dec(&pppol2tp_session_count); 1257 atomic_dec(&pppol2tp_session_count);
1253 } 1258 }
@@ -1392,9 +1397,9 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id,
1392 1397
1393 /* Add tunnel to our list */ 1398 /* Add tunnel to our list */
1394 INIT_LIST_HEAD(&tunnel->list); 1399 INIT_LIST_HEAD(&tunnel->list);
1395 write_lock(&pppol2tp_tunnel_list_lock); 1400 write_lock_bh(&pppol2tp_tunnel_list_lock);
1396 list_add(&tunnel->list, &pppol2tp_tunnel_list); 1401 list_add(&tunnel->list, &pppol2tp_tunnel_list);
1397 write_unlock(&pppol2tp_tunnel_list_lock); 1402 write_unlock_bh(&pppol2tp_tunnel_list_lock);
1398 atomic_inc(&pppol2tp_tunnel_count); 1403 atomic_inc(&pppol2tp_tunnel_count);
1399 1404
1400 /* Bump the reference count. The tunnel context is deleted 1405 /* Bump the reference count. The tunnel context is deleted
@@ -1599,11 +1604,11 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
1599 sk->sk_user_data = session; 1604 sk->sk_user_data = session;
1600 1605
1601 /* Add session to the tunnel's hash list */ 1606 /* Add session to the tunnel's hash list */
1602 write_lock(&tunnel->hlist_lock); 1607 write_lock_bh(&tunnel->hlist_lock);
1603 hlist_add_head(&session->hlist, 1608 hlist_add_head(&session->hlist,
1604 pppol2tp_session_id_hash(tunnel, 1609 pppol2tp_session_id_hash(tunnel,
1605 session->tunnel_addr.s_session)); 1610 session->tunnel_addr.s_session));
1606 write_unlock(&tunnel->hlist_lock); 1611 write_unlock_bh(&tunnel->hlist_lock);
1607 1612
1608 atomic_inc(&pppol2tp_session_count); 1613 atomic_inc(&pppol2tp_session_count);
1609 1614
@@ -2205,7 +2210,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
2205 int next = 0; 2210 int next = 0;
2206 int i; 2211 int i;
2207 2212
2208 read_lock(&tunnel->hlist_lock); 2213 read_lock_bh(&tunnel->hlist_lock);
2209 for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) { 2214 for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) {
2210 hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) { 2215 hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) {
2211 if (curr == NULL) { 2216 if (curr == NULL) {
@@ -2223,7 +2228,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
2223 } 2228 }
2224 } 2229 }
2225out: 2230out:
2226 read_unlock(&tunnel->hlist_lock); 2231 read_unlock_bh(&tunnel->hlist_lock);
2227 if (!found) 2232 if (!found)
2228 session = NULL; 2233 session = NULL;
2229 2234
@@ -2234,13 +2239,13 @@ static struct pppol2tp_tunnel *next_tunnel(struct pppol2tp_tunnel *curr)
2234{ 2239{
2235 struct pppol2tp_tunnel *tunnel = NULL; 2240 struct pppol2tp_tunnel *tunnel = NULL;
2236 2241
2237 read_lock(&pppol2tp_tunnel_list_lock); 2242 read_lock_bh(&pppol2tp_tunnel_list_lock);
2238 if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) { 2243 if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) {
2239 goto out; 2244 goto out;
2240 } 2245 }
2241 tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list); 2246 tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list);
2242out: 2247out:
2243 read_unlock(&pppol2tp_tunnel_list_lock); 2248 read_unlock_bh(&pppol2tp_tunnel_list_lock);
2244 2249
2245 return tunnel; 2250 return tunnel;
2246} 2251}
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 6179a0a2032c..c72787adeba3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -1088,7 +1088,7 @@ static int s2io_print_pci_mode(struct s2io_nic *nic)
1088 * '-1' on failure 1088 * '-1' on failure
1089 */ 1089 */
1090 1090
1091int init_tti(struct s2io_nic *nic, int link) 1091static int init_tti(struct s2io_nic *nic, int link)
1092{ 1092{
1093 struct XENA_dev_config __iomem *bar0 = nic->bar0; 1093 struct XENA_dev_config __iomem *bar0 = nic->bar0;
1094 register u64 val64 = 0; 1094 register u64 val64 = 0;
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 77d9dd7ea34f..567c62757e9d 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -910,7 +910,8 @@ static void de_set_media (struct de_private *de)
910 unsigned media = de->media_type; 910 unsigned media = de->media_type;
911 u32 macmode = dr32(MacMode); 911 u32 macmode = dr32(MacMode);
912 912
913 BUG_ON(de_is_running(de)); 913 if (de_is_running(de))
914 printk(KERN_WARNING "%s: chip is running while changing media!\n", de->dev->name);
914 915
915 if (de->de21040) 916 if (de->de21040)
916 dw32(CSR11, FULL_DUPLEX_MAGIC); 917 dw32(CSR11, FULL_DUPLEX_MAGIC);
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 15d5c58e57bc..e59255a155a9 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -751,7 +751,7 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
751} 751}
752 752
753 753
754static __inline void 754static inline void
755send_complete( struct net_local *nl ) 755send_complete( struct net_local *nl )
756{ 756{
757#ifdef CONFIG_SBNI_MULTILINE 757#ifdef CONFIG_SBNI_MULTILINE
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index bdc6a1cc2103..f0ef7081bdeb 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -578,7 +578,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
578 goto done; 578 goto done;
579 } 579 }
580 if (respcmd != CMD_RET(curcmd) && 580 if (respcmd != CMD_RET(curcmd) &&
581 respcmd != CMD_802_11_ASSOCIATE && curcmd != CMD_RET_802_11_ASSOCIATE) { 581 respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
582 lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd); 582 lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd);
583 spin_unlock_irqrestore(&priv->driver_lock, flags); 583 spin_unlock_irqrestore(&priv->driver_lock, flags);
584 ret = -1; 584 ret = -1;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e808db98f2f5..93ea212fedd5 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2302,9 +2302,9 @@ static void rt61pci_configure_filter(struct ieee80211_hw *hw,
2302 * Apply some rules to the filters: 2302 * Apply some rules to the filters:
2303 * - Some filters imply different filters to be set. 2303 * - Some filters imply different filters to be set.
2304 * - Some things we can't filter out at all. 2304 * - Some things we can't filter out at all.
2305 * - Multicast filter seems to kill broadcast traffic so never use it.
2305 */ 2306 */
2306 if (mc_count) 2307 *total_flags |= FIF_ALLMULTI;
2307 *total_flags |= FIF_ALLMULTI;
2308 if (*total_flags & FIF_OTHER_BSS || 2308 if (*total_flags & FIF_OTHER_BSS ||
2309 *total_flags & FIF_PROMISC_IN_BSS) 2309 *total_flags & FIF_PROMISC_IN_BSS)
2310 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; 2310 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4fac2d414d84..8103d41a1543 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1869,9 +1869,9 @@ static void rt73usb_configure_filter(struct ieee80211_hw *hw,
1869 * Apply some rules to the filters: 1869 * Apply some rules to the filters:
1870 * - Some filters imply different filters to be set. 1870 * - Some filters imply different filters to be set.
1871 * - Some things we can't filter out at all. 1871 * - Some things we can't filter out at all.
1872 * - Multicast filter seems to kill broadcast traffic so never use it.
1872 */ 1873 */
1873 if (mc_count) 1874 *total_flags |= FIF_ALLMULTI;
1874 *total_flags |= FIF_ALLMULTI;
1875 if (*total_flags & FIF_OTHER_BSS || 1875 if (*total_flags & FIF_OTHER_BSS ||
1876 *total_flags & FIF_PROMISC_IN_BSS) 1876 *total_flags & FIF_PROMISC_IN_BSS)
1877 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS; 1877 *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
@@ -2098,6 +2098,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2098 /* D-Link */ 2098 /* D-Link */
2099 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2099 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) },
2100 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2100 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
2101 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
2101 /* Gemtek */ 2102 /* Gemtek */
2102 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, 2103 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },
2103 /* Gigabyte */ 2104 /* Gigabyte */
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 91a1bd67ac1d..9a4da0aae02e 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2269,6 +2269,9 @@ static const struct pid_entry tgid_base_stuff[] = {
2269 DIR("task", S_IRUGO|S_IXUGO, task), 2269 DIR("task", S_IRUGO|S_IXUGO, task),
2270 DIR("fd", S_IRUSR|S_IXUSR, fd), 2270 DIR("fd", S_IRUSR|S_IXUSR, fd),
2271 DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), 2271 DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo),
2272#ifdef CONFIG_NET
2273 DIR("net", S_IRUGO|S_IXUSR, net),
2274#endif
2272 REG("environ", S_IRUSR, environ), 2275 REG("environ", S_IRUSR, environ),
2273 INF("auxv", S_IRUSR, pid_auxv), 2276 INF("auxv", S_IRUSR, pid_auxv),
2274 ONE("status", S_IRUGO, pid_status), 2277 ONE("status", S_IRUGO, pid_status),
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 68971e66cd41..a36ad3c75cf4 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -377,15 +377,14 @@ static struct dentry_operations proc_dentry_operations =
377 * Don't create negative dentries here, return -ENOENT by hand 377 * Don't create negative dentries here, return -ENOENT by hand
378 * instead. 378 * instead.
379 */ 379 */
380struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) 380struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
381 struct dentry *dentry)
381{ 382{
382 struct inode *inode = NULL; 383 struct inode *inode = NULL;
383 struct proc_dir_entry * de;
384 int error = -ENOENT; 384 int error = -ENOENT;
385 385
386 lock_kernel(); 386 lock_kernel();
387 spin_lock(&proc_subdir_lock); 387 spin_lock(&proc_subdir_lock);
388 de = PDE(dir);
389 if (de) { 388 if (de) {
390 for (de = de->subdir; de ; de = de->next) { 389 for (de = de->subdir; de ; de = de->next) {
391 if (de->namelen != dentry->d_name.len) 390 if (de->namelen != dentry->d_name.len)
@@ -393,8 +392,6 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam
393 if (!memcmp(dentry->d_name.name, de->name, de->namelen)) { 392 if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
394 unsigned int ino; 393 unsigned int ino;
395 394
396 if (de->shadow_proc)
397 de = de->shadow_proc(current, de);
398 ino = de->low_ino; 395 ino = de->low_ino;
399 de_get(de); 396 de_get(de);
400 spin_unlock(&proc_subdir_lock); 397 spin_unlock(&proc_subdir_lock);
@@ -417,6 +414,12 @@ out_unlock:
417 return ERR_PTR(error); 414 return ERR_PTR(error);
418} 415}
419 416
417struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry,
418 struct nameidata *nd)
419{
420 return proc_lookup_de(PDE(dir), dir, dentry);
421}
422
420/* 423/*
421 * This returns non-zero if at EOF, so that the /proc 424 * This returns non-zero if at EOF, so that the /proc
422 * root directory can use this and check if it should 425 * root directory can use this and check if it should
@@ -426,10 +429,9 @@ out_unlock:
426 * value of the readdir() call, as long as it's non-negative 429 * value of the readdir() call, as long as it's non-negative
427 * for success.. 430 * for success..
428 */ 431 */
429int proc_readdir(struct file * filp, 432int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent,
430 void * dirent, filldir_t filldir) 433 filldir_t filldir)
431{ 434{
432 struct proc_dir_entry * de;
433 unsigned int ino; 435 unsigned int ino;
434 int i; 436 int i;
435 struct inode *inode = filp->f_path.dentry->d_inode; 437 struct inode *inode = filp->f_path.dentry->d_inode;
@@ -438,7 +440,6 @@ int proc_readdir(struct file * filp,
438 lock_kernel(); 440 lock_kernel();
439 441
440 ino = inode->i_ino; 442 ino = inode->i_ino;
441 de = PDE(inode);
442 if (!de) { 443 if (!de) {
443 ret = -EINVAL; 444 ret = -EINVAL;
444 goto out; 445 goto out;
@@ -499,6 +500,13 @@ out: unlock_kernel();
499 return ret; 500 return ret;
500} 501}
501 502
503int proc_readdir(struct file *filp, void *dirent, filldir_t filldir)
504{
505 struct inode *inode = filp->f_path.dentry->d_inode;
506
507 return proc_readdir_de(PDE(inode), filp, dirent, filldir);
508}
509
502/* 510/*
503 * These are the generic /proc directory operations. They 511 * These are the generic /proc directory operations. They
504 * use the in-memory "struct proc_dir_entry" tree to parse 512 * use the in-memory "struct proc_dir_entry" tree to parse
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 1c81c8f1aeed..bc72f5c8c47d 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -64,6 +64,8 @@ extern const struct file_operations proc_numa_maps_operations;
64extern const struct file_operations proc_smaps_operations; 64extern const struct file_operations proc_smaps_operations;
65extern const struct file_operations proc_clear_refs_operations; 65extern const struct file_operations proc_clear_refs_operations;
66extern const struct file_operations proc_pagemap_operations; 66extern const struct file_operations proc_pagemap_operations;
67extern const struct file_operations proc_net_operations;
68extern const struct inode_operations proc_net_inode_operations;
67 69
68void free_proc_entry(struct proc_dir_entry *de); 70void free_proc_entry(struct proc_dir_entry *de);
69 71
@@ -83,3 +85,8 @@ static inline int proc_fd(struct inode *inode)
83{ 85{
84 return PROC_I(inode)->fd; 86 return PROC_I(inode)->fd;
85} 87}
88
89struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *ino,
90 struct dentry *dentry);
91int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent,
92 filldir_t filldir);
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 14e9b5aaf863..4caa5f774fb7 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -63,6 +63,82 @@ int seq_release_net(struct inode *ino, struct file *f)
63} 63}
64EXPORT_SYMBOL_GPL(seq_release_net); 64EXPORT_SYMBOL_GPL(seq_release_net);
65 65
66static struct net *get_proc_task_net(struct inode *dir)
67{
68 struct task_struct *task;
69 struct nsproxy *ns;
70 struct net *net = NULL;
71
72 rcu_read_lock();
73 task = pid_task(proc_pid(dir), PIDTYPE_PID);
74 if (task != NULL) {
75 ns = task_nsproxy(task);
76 if (ns != NULL)
77 net = get_net(ns->net_ns);
78 }
79 rcu_read_unlock();
80
81 return net;
82}
83
84static struct dentry *proc_tgid_net_lookup(struct inode *dir,
85 struct dentry *dentry, struct nameidata *nd)
86{
87 struct dentry *de;
88 struct net *net;
89
90 de = ERR_PTR(-ENOENT);
91 net = get_proc_task_net(dir);
92 if (net != NULL) {
93 de = proc_lookup_de(net->proc_net, dir, dentry);
94 put_net(net);
95 }
96 return de;
97}
98
99static int proc_tgid_net_getattr(struct vfsmount *mnt, struct dentry *dentry,
100 struct kstat *stat)
101{
102 struct inode *inode = dentry->d_inode;
103 struct net *net;
104
105 net = get_proc_task_net(inode);
106
107 generic_fillattr(inode, stat);
108
109 if (net != NULL) {
110 stat->nlink = net->proc_net->nlink;
111 put_net(net);
112 }
113
114 return 0;
115}
116
117const struct inode_operations proc_net_inode_operations = {
118 .lookup = proc_tgid_net_lookup,
119 .getattr = proc_tgid_net_getattr,
120};
121
122static int proc_tgid_net_readdir(struct file *filp, void *dirent,
123 filldir_t filldir)
124{
125 int ret;
126 struct net *net;
127
128 ret = -EINVAL;
129 net = get_proc_task_net(filp->f_path.dentry->d_inode);
130 if (net != NULL) {
131 ret = proc_readdir_de(net->proc_net, filp, dirent, filldir);
132 put_net(net);
133 }
134 return ret;
135}
136
137const struct file_operations proc_net_operations = {
138 .read = generic_read_dir,
139 .readdir = proc_tgid_net_readdir,
140};
141
66 142
67struct proc_dir_entry *proc_net_fops_create(struct net *net, 143struct proc_dir_entry *proc_net_fops_create(struct net *net,
68 const char *name, mode_t mode, const struct file_operations *fops) 144 const char *name, mode_t mode, const struct file_operations *fops)
@@ -83,14 +159,6 @@ struct net *get_proc_net(const struct inode *inode)
83} 159}
84EXPORT_SYMBOL_GPL(get_proc_net); 160EXPORT_SYMBOL_GPL(get_proc_net);
85 161
86static struct proc_dir_entry *shadow_pde;
87
88static struct proc_dir_entry *proc_net_shadow(struct task_struct *task,
89 struct proc_dir_entry *de)
90{
91 return task->nsproxy->net_ns->proc_net;
92}
93
94struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 162struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
95 struct proc_dir_entry *parent) 163 struct proc_dir_entry *parent)
96{ 164{
@@ -104,45 +172,39 @@ EXPORT_SYMBOL_GPL(proc_net_mkdir);
104 172
105static __net_init int proc_net_ns_init(struct net *net) 173static __net_init int proc_net_ns_init(struct net *net)
106{ 174{
107 struct proc_dir_entry *root, *netd, *net_statd; 175 struct proc_dir_entry *netd, *net_statd;
108 int err; 176 int err;
109 177
110 err = -ENOMEM; 178 err = -ENOMEM;
111 root = kzalloc(sizeof(*root), GFP_KERNEL); 179 netd = kzalloc(sizeof(*netd), GFP_KERNEL);
112 if (!root) 180 if (!netd)
113 goto out; 181 goto out;
114 182
115 err = -EEXIST; 183 netd->data = net;
116 netd = proc_net_mkdir(net, "net", root); 184 netd->nlink = 2;
117 if (!netd) 185 netd->name = "net";
118 goto free_root; 186 netd->namelen = 3;
187 netd->parent = &proc_root;
119 188
120 err = -EEXIST; 189 err = -EEXIST;
121 net_statd = proc_net_mkdir(net, "stat", netd); 190 net_statd = proc_net_mkdir(net, "stat", netd);
122 if (!net_statd) 191 if (!net_statd)
123 goto free_net; 192 goto free_net;
124 193
125 root->data = net;
126
127 net->proc_net_root = root;
128 net->proc_net = netd; 194 net->proc_net = netd;
129 net->proc_net_stat = net_statd; 195 net->proc_net_stat = net_statd;
130 err = 0; 196 return 0;
131 197
198free_net:
199 kfree(netd);
132out: 200out:
133 return err; 201 return err;
134free_net:
135 remove_proc_entry("net", root);
136free_root:
137 kfree(root);
138 goto out;
139} 202}
140 203
141static __net_exit void proc_net_ns_exit(struct net *net) 204static __net_exit void proc_net_ns_exit(struct net *net)
142{ 205{
143 remove_proc_entry("stat", net->proc_net); 206 remove_proc_entry("stat", net->proc_net);
144 remove_proc_entry("net", net->proc_net_root); 207 kfree(net->proc_net);
145 kfree(net->proc_net_root);
146} 208}
147 209
148static struct pernet_operations __net_initdata proc_net_ns_ops = { 210static struct pernet_operations __net_initdata proc_net_ns_ops = {
@@ -152,8 +214,7 @@ static struct pernet_operations __net_initdata proc_net_ns_ops = {
152 214
153int __init proc_net_init(void) 215int __init proc_net_init(void)
154{ 216{
155 shadow_pde = proc_mkdir("net", NULL); 217 proc_symlink("net", NULL, "self/net");
156 shadow_pde->shadow_proc = proc_net_shadow;
157 218
158 return register_pernet_subsys(&proc_net_ns_ops); 219 return register_pernet_subsys(&proc_net_ns_ops);
159} 220}
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index fcbe8b640ffb..c8d216357865 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -12,6 +12,7 @@
12#ifndef _LINUX_ETHTOOL_H 12#ifndef _LINUX_ETHTOOL_H
13#define _LINUX_ETHTOOL_H 13#define _LINUX_ETHTOOL_H
14 14
15#include <linux/types.h>
15 16
16/* This should work for both 32 and 64 bit userland. */ 17/* This should work for both 32 and 64 bit userland. */
17struct ethtool_cmd { 18struct ethtool_cmd {
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h
index 02a42d875cf7..e1451760c9cd 100644
--- a/include/linux/netfilter/nfnetlink_compat.h
+++ b/include/linux/netfilter/nfnetlink_compat.h
@@ -1,6 +1,6 @@
1#ifndef _NFNETLINK_COMPAT_H 1#ifndef _NFNETLINK_COMPAT_H
2#define _NFNETLINK_COMPAT_H 2#define _NFNETLINK_COMPAT_H
3#ifndef __KERNEL 3#ifndef __KERNEL__
4/* Old nfnetlink macros for userspace */ 4/* Old nfnetlink macros for userspace */
5 5
6/* nfnetlink groups: Up to 32 maximum */ 6/* nfnetlink groups: Up to 32 maximum */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index d9a9e718ad19..9b6c935f69cf 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -50,8 +50,6 @@ typedef int (read_proc_t)(char *page, char **start, off_t off,
50typedef int (write_proc_t)(struct file *file, const char __user *buffer, 50typedef int (write_proc_t)(struct file *file, const char __user *buffer,
51 unsigned long count, void *data); 51 unsigned long count, void *data);
52typedef int (get_info_t)(char *, char **, off_t, int); 52typedef int (get_info_t)(char *, char **, off_t, int);
53typedef struct proc_dir_entry *(shadow_proc_t)(struct task_struct *task,
54 struct proc_dir_entry *pde);
55 53
56struct proc_dir_entry { 54struct proc_dir_entry {
57 unsigned int low_ino; 55 unsigned int low_ino;
@@ -82,7 +80,6 @@ struct proc_dir_entry {
82 int pde_users; /* number of callers into module in progress */ 80 int pde_users; /* number of callers into module in progress */
83 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ 81 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
84 struct completion *pde_unload_completion; 82 struct completion *pde_unload_completion;
85 shadow_proc_t *shadow_proc;
86}; 83};
87 84
88struct kcore_list { 85struct kcore_list {
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 771d17783c18..750648df13f4 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -170,7 +170,7 @@ static inline int skb_frags_no(struct sk_buff *skb)
170int bt_err(__u16 code); 170int bt_err(__u16 code);
171 171
172extern int hci_sock_init(void); 172extern int hci_sock_init(void);
173extern int hci_sock_cleanup(void); 173extern void hci_sock_cleanup(void);
174 174
175extern int bt_sysfs_init(void); 175extern int bt_sysfs_init(void);
176extern void bt_sysfs_cleanup(void); 176extern void bt_sysfs_cleanup(void);
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index 32c385dd9e06..0788c23d2828 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -169,17 +169,17 @@ int irttp_disconnect_request(struct tsap_cb *self, struct sk_buff *skb,
169void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow); 169void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow);
170struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance); 170struct tsap_cb *irttp_dup(struct tsap_cb *self, void *instance);
171 171
172static __inline __u32 irttp_get_saddr(struct tsap_cb *self) 172static inline __u32 irttp_get_saddr(struct tsap_cb *self)
173{ 173{
174 return irlmp_get_saddr(self->lsap); 174 return irlmp_get_saddr(self->lsap);
175} 175}
176 176
177static __inline __u32 irttp_get_daddr(struct tsap_cb *self) 177static inline __u32 irttp_get_daddr(struct tsap_cb *self)
178{ 178{
179 return irlmp_get_daddr(self->lsap); 179 return irlmp_get_daddr(self->lsap);
180} 180}
181 181
182static __inline __u32 irttp_get_max_seg_size(struct tsap_cb *self) 182static inline __u32 irttp_get_max_seg_size(struct tsap_cb *self)
183{ 183{
184 return self->max_seg_size; 184 return self->max_seg_size;
185} 185}
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 28738b7d53eb..923f2b8b9096 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -31,7 +31,6 @@ struct net {
31 31
32 struct proc_dir_entry *proc_net; 32 struct proc_dir_entry *proc_net;
33 struct proc_dir_entry *proc_net_stat; 33 struct proc_dir_entry *proc_net_stat;
34 struct proc_dir_entry *proc_net_root;
35 34
36 struct list_head sysctl_table_headers; 35 struct list_head sysctl_table_headers;
37 36
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 49aac6323fbe..f736e842977f 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -17,7 +17,6 @@ enum nf_ct_ext_id
17struct nf_ct_ext { 17struct nf_ct_ext {
18 u8 offset[NF_CT_EXT_NUM]; 18 u8 offset[NF_CT_EXT_NUM];
19 u8 len; 19 u8 len;
20 u8 real_len;
21 char data[0]; 20 char data[0];
22}; 21};
23 22
diff --git a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
index a2992280c3d1..e69244dd8de8 100644
--- a/net/bluetooth/bnep/bnep.h
+++ b/net/bluetooth/bnep/bnep.h
@@ -174,7 +174,7 @@ struct bnep_session {
174 174
175void bnep_net_setup(struct net_device *dev); 175void bnep_net_setup(struct net_device *dev);
176int bnep_sock_init(void); 176int bnep_sock_init(void);
177int bnep_sock_cleanup(void); 177void bnep_sock_cleanup(void);
178 178
179static inline int bnep_mc_hash(__u8 *addr) 179static inline int bnep_mc_hash(__u8 *addr)
180{ 180{
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 81065e548a1f..201e5b1ce473 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -257,12 +257,10 @@ error:
257 return err; 257 return err;
258} 258}
259 259
260int __exit bnep_sock_cleanup(void) 260void __exit bnep_sock_cleanup(void)
261{ 261{
262 if (bt_sock_unregister(BTPROTO_BNEP) < 0) 262 if (bt_sock_unregister(BTPROTO_BNEP) < 0)
263 BT_ERR("Can't unregister BNEP socket"); 263 BT_ERR("Can't unregister BNEP socket");
264 264
265 proto_unregister(&bnep_proto); 265 proto_unregister(&bnep_proto);
266
267 return 0;
268} 266}
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 930b58e7149a..aec6929f5c16 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -902,8 +902,6 @@ int hci_unregister_dev(struct hci_dev *hdev)
902 902
903 BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type); 903 BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
904 904
905 hci_unregister_sysfs(hdev);
906
907 write_lock_bh(&hci_dev_list_lock); 905 write_lock_bh(&hci_dev_list_lock);
908 list_del(&hdev->list); 906 list_del(&hdev->list);
909 write_unlock_bh(&hci_dev_list_lock); 907 write_unlock_bh(&hci_dev_list_lock);
@@ -915,6 +913,8 @@ int hci_unregister_dev(struct hci_dev *hdev)
915 913
916 hci_notify(hdev, HCI_DEV_UNREG); 914 hci_notify(hdev, HCI_DEV_UNREG);
917 915
916 hci_unregister_sysfs(hdev);
917
918 __hci_dev_put(hdev); 918 __hci_dev_put(hdev);
919 919
920 return 0; 920 return 0;
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 14991323c273..b5d4019d3572 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -734,7 +734,7 @@ error:
734 return err; 734 return err;
735} 735}
736 736
737int __exit hci_sock_cleanup(void) 737void __exit hci_sock_cleanup(void)
738{ 738{
739 if (bt_sock_unregister(BTPROTO_HCI) < 0) 739 if (bt_sock_unregister(BTPROTO_HCI) < 0)
740 BT_ERR("HCI socket unregistration failed"); 740 BT_ERR("HCI socket unregistration failed");
@@ -742,6 +742,4 @@ int __exit hci_sock_cleanup(void)
742 hci_unregister_notifier(&hci_sock_nblock); 742 hci_unregister_notifier(&hci_sock_nblock);
743 743
744 proto_unregister(&hci_sk_proto); 744 proto_unregister(&hci_sk_proto);
745
746 return 0;
747} 745}
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ed750f9ceb07..01578f544ad6 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1035,6 +1035,13 @@ static void tcp_cwnd_validate(struct sock *sk)
1035 * introducing MSS oddities to segment boundaries. In rare cases where 1035 * introducing MSS oddities to segment boundaries. In rare cases where
1036 * mss_now != mss_cache, we will request caller to create a small skb 1036 * mss_now != mss_cache, we will request caller to create a small skb
1037 * per input skb which could be mostly avoided here (if desired). 1037 * per input skb which could be mostly avoided here (if desired).
1038 *
1039 * We explicitly want to create a request for splitting write queue tail
1040 * to a small skb for Nagle purposes while avoiding unnecessary modulos,
1041 * thus all the complexity (cwnd_len is always MSS multiple which we
1042 * return whenever allowed by the other factors). Basically we need the
1043 * modulo only when the receiver window alone is the limiting factor or
1044 * when we would be allowed to send the split-due-to-Nagle skb fully.
1038 */ 1045 */
1039static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, 1046static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb,
1040 unsigned int mss_now, unsigned int cwnd) 1047 unsigned int mss_now, unsigned int cwnd)
@@ -1048,10 +1055,11 @@ static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb,
1048 if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk))) 1055 if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk)))
1049 return cwnd_len; 1056 return cwnd_len;
1050 1057
1051 if (skb == tcp_write_queue_tail(sk) && cwnd_len <= skb->len) 1058 needed = min(skb->len, window);
1059
1060 if (skb == tcp_write_queue_tail(sk) && cwnd_len <= needed)
1052 return cwnd_len; 1061 return cwnd_len;
1053 1062
1054 needed = min(skb->len, window);
1055 return needed - needed % mss_now; 1063 return needed - needed % mss_now;
1056} 1064}
1057 1065
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index e06bf0028bb1..684ec9c1ad38 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -381,7 +381,7 @@ int nf_ct_expect_related(struct nf_conntrack_expect *expect)
381 if (nf_ct_expect_count >= nf_ct_expect_max) { 381 if (nf_ct_expect_count >= nf_ct_expect_max) {
382 if (net_ratelimit()) 382 if (net_ratelimit())
383 printk(KERN_WARNING 383 printk(KERN_WARNING
384 "nf_conntrack: expectation table full"); 384 "nf_conntrack: expectation table full\n");
385 ret = -EMFILE; 385 ret = -EMFILE;
386 goto out; 386 goto out;
387 } 387 }
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index 8b9be1e978cd..2bd9963b5b3e 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -19,14 +19,6 @@
19static struct nf_ct_ext_type *nf_ct_ext_types[NF_CT_EXT_NUM]; 19static struct nf_ct_ext_type *nf_ct_ext_types[NF_CT_EXT_NUM];
20static DEFINE_MUTEX(nf_ct_ext_type_mutex); 20static DEFINE_MUTEX(nf_ct_ext_type_mutex);
21 21
22/* Horrible trick to figure out smallest amount worth kmallocing. */
23#define CACHE(x) (x) + 0 *
24enum {
25 NF_CT_EXT_MIN_SIZE =
26#include <linux/kmalloc_sizes.h>
27 1 };
28#undef CACHE
29
30void __nf_ct_ext_destroy(struct nf_conn *ct) 22void __nf_ct_ext_destroy(struct nf_conn *ct)
31{ 23{
32 unsigned int i; 24 unsigned int i;
@@ -53,7 +45,7 @@ EXPORT_SYMBOL(__nf_ct_ext_destroy);
53static void * 45static void *
54nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp) 46nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp)
55{ 47{
56 unsigned int off, len, real_len; 48 unsigned int off, len;
57 struct nf_ct_ext_type *t; 49 struct nf_ct_ext_type *t;
58 50
59 rcu_read_lock(); 51 rcu_read_lock();
@@ -61,16 +53,14 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp)
61 BUG_ON(t == NULL); 53 BUG_ON(t == NULL);
62 off = ALIGN(sizeof(struct nf_ct_ext), t->align); 54 off = ALIGN(sizeof(struct nf_ct_ext), t->align);
63 len = off + t->len; 55 len = off + t->len;
64 real_len = t->alloc_size;
65 rcu_read_unlock(); 56 rcu_read_unlock();
66 57
67 *ext = kzalloc(real_len, gfp); 58 *ext = kzalloc(t->alloc_size, gfp);
68 if (!*ext) 59 if (!*ext)
69 return NULL; 60 return NULL;
70 61
71 (*ext)->offset[id] = off; 62 (*ext)->offset[id] = off;
72 (*ext)->len = len; 63 (*ext)->len = len;
73 (*ext)->real_len = real_len;
74 64
75 return (void *)(*ext) + off; 65 return (void *)(*ext) + off;
76} 66}
@@ -95,7 +85,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
95 newlen = newoff + t->len; 85 newlen = newoff + t->len;
96 rcu_read_unlock(); 86 rcu_read_unlock();
97 87
98 if (newlen >= ct->ext->real_len) { 88 if (newlen >= ksize(ct->ext)) {
99 new = kmalloc(newlen, gfp); 89 new = kmalloc(newlen, gfp);
100 if (!new) 90 if (!new)
101 return NULL; 91 return NULL;
@@ -114,7 +104,6 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
114 rcu_read_unlock(); 104 rcu_read_unlock();
115 } 105 }
116 kfree(ct->ext); 106 kfree(ct->ext);
117 new->real_len = newlen;
118 ct->ext = new; 107 ct->ext = new;
119 } 108 }
120 109
@@ -156,8 +145,6 @@ static void update_alloc_size(struct nf_ct_ext_type *type)
156 t1->alloc_size = ALIGN(t1->alloc_size, t2->align) 145 t1->alloc_size = ALIGN(t1->alloc_size, t2->align)
157 + t2->len; 146 + t2->len;
158 } 147 }
159 if (t1->alloc_size < NF_CT_EXT_MIN_SIZE)
160 t1->alloc_size = NF_CT_EXT_MIN_SIZE;
161 } 148 }
162} 149}
163 150
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index bfc2928c1912..ddc80ea114cd 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -51,7 +51,7 @@ int nf_unregister_queue_handler(int pf, const struct nf_queue_handler *qh)
51 return -EINVAL; 51 return -EINVAL;
52 52
53 mutex_lock(&queue_handler_mutex); 53 mutex_lock(&queue_handler_mutex);
54 if (queue_handler[pf] != qh) { 54 if (queue_handler[pf] && queue_handler[pf] != qh) {
55 mutex_unlock(&queue_handler_mutex); 55 mutex_unlock(&queue_handler_mutex);
56 return -EINVAL; 56 return -EINVAL;
57 } 57 }
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 7efa40d47393..bf3f19b21fe4 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -556,7 +556,7 @@ nfulnl_log_packet(unsigned int pf,
556 /* FIXME: do we want to make the size calculation conditional based on 556 /* FIXME: do we want to make the size calculation conditional based on
557 * what is actually present? way more branches and checks, but more 557 * what is actually present? way more branches and checks, but more
558 * memory efficient... */ 558 * memory efficient... */
559 size = NLMSG_ALIGN(sizeof(struct nfgenmsg)) 559 size = NLMSG_SPACE(sizeof(struct nfgenmsg))
560 + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr)) 560 + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
561 + nla_total_size(sizeof(u_int32_t)) /* ifindex */ 561 + nla_total_size(sizeof(u_int32_t)) /* ifindex */
562 + nla_total_size(sizeof(u_int32_t)) /* ifindex */ 562 + nla_total_size(sizeof(u_int32_t)) /* ifindex */
@@ -702,20 +702,30 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
702 struct nfgenmsg *nfmsg = NLMSG_DATA(nlh); 702 struct nfgenmsg *nfmsg = NLMSG_DATA(nlh);
703 u_int16_t group_num = ntohs(nfmsg->res_id); 703 u_int16_t group_num = ntohs(nfmsg->res_id);
704 struct nfulnl_instance *inst; 704 struct nfulnl_instance *inst;
705 struct nfulnl_msg_config_cmd *cmd = NULL;
705 int ret = 0; 706 int ret = 0;
706 707
708 if (nfula[NFULA_CFG_CMD]) {
709 u_int8_t pf = nfmsg->nfgen_family;
710 cmd = nla_data(nfula[NFULA_CFG_CMD]);
711
712 /* Commands without queue context */
713 switch (cmd->command) {
714 case NFULNL_CFG_CMD_PF_BIND:
715 return nf_log_register(pf, &nfulnl_logger);
716 case NFULNL_CFG_CMD_PF_UNBIND:
717 nf_log_unregister_pf(pf);
718 return 0;
719 }
720 }
721
707 inst = instance_lookup_get(group_num); 722 inst = instance_lookup_get(group_num);
708 if (inst && inst->peer_pid != NETLINK_CB(skb).pid) { 723 if (inst && inst->peer_pid != NETLINK_CB(skb).pid) {
709 ret = -EPERM; 724 ret = -EPERM;
710 goto out_put; 725 goto out_put;
711 } 726 }
712 727
713 if (nfula[NFULA_CFG_CMD]) { 728 if (cmd != NULL) {
714 u_int8_t pf = nfmsg->nfgen_family;
715 struct nfulnl_msg_config_cmd *cmd;
716
717 cmd = nla_data(nfula[NFULA_CFG_CMD]);
718
719 switch (cmd->command) { 729 switch (cmd->command) {
720 case NFULNL_CFG_CMD_BIND: 730 case NFULNL_CFG_CMD_BIND:
721 if (inst) { 731 if (inst) {
@@ -738,14 +748,6 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
738 748
739 instance_destroy(inst); 749 instance_destroy(inst);
740 goto out; 750 goto out;
741 case NFULNL_CFG_CMD_PF_BIND:
742 ret = nf_log_register(pf, &nfulnl_logger);
743 break;
744 case NFULNL_CFG_CMD_PF_UNBIND:
745 /* This is a bug and a feature. We cannot unregister
746 * other handlers, like nfnetlink_inst can */
747 nf_log_unregister_pf(pf);
748 break;
749 default: 751 default:
750 ret = -ENOTSUPP; 752 ret = -ENOTSUPP;
751 break; 753 break;
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 0043d3a9f87e..012cb6910820 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -224,7 +224,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
224 struct net_device *indev; 224 struct net_device *indev;
225 struct net_device *outdev; 225 struct net_device *outdev;
226 226
227 size = NLMSG_ALIGN(sizeof(struct nfgenmsg)) 227 size = NLMSG_SPACE(sizeof(struct nfgenmsg))
228 + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr)) 228 + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
229 + nla_total_size(sizeof(u_int32_t)) /* ifindex */ 229 + nla_total_size(sizeof(u_int32_t)) /* ifindex */
230 + nla_total_size(sizeof(u_int32_t)) /* ifindex */ 230 + nla_total_size(sizeof(u_int32_t)) /* ifindex */
@@ -703,19 +703,12 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
703 /* Commands without queue context - might sleep */ 703 /* Commands without queue context - might sleep */
704 switch (cmd->command) { 704 switch (cmd->command) {
705 case NFQNL_CFG_CMD_PF_BIND: 705 case NFQNL_CFG_CMD_PF_BIND:
706 ret = nf_register_queue_handler(ntohs(cmd->pf), 706 return nf_register_queue_handler(ntohs(cmd->pf),
707 &nfqh); 707 &nfqh);
708 break;
709 case NFQNL_CFG_CMD_PF_UNBIND: 708 case NFQNL_CFG_CMD_PF_UNBIND:
710 ret = nf_unregister_queue_handler(ntohs(cmd->pf), 709 return nf_unregister_queue_handler(ntohs(cmd->pf),
711 &nfqh); 710 &nfqh);
712 break;
713 default:
714 break;
715 } 711 }
716
717 if (ret < 0)
718 return ret;
719 } 712 }
720 713
721 rcu_read_lock(); 714 rcu_read_lock();
diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c
index e9a8794bc3ab..9fa2e0824708 100644
--- a/net/netfilter/xt_time.c
+++ b/net/netfilter/xt_time.c
@@ -95,8 +95,11 @@ static inline void localtime_2(struct xtm *r, time_t time)
95 */ 95 */
96 r->dse = time / 86400; 96 r->dse = time / 86400;
97 97
98 /* 1970-01-01 (w=0) was a Thursday (4). */ 98 /*
99 r->weekday = (4 + r->dse) % 7; 99 * 1970-01-01 (w=0) was a Thursday (4).
100 * -1 and +1 map Sunday properly onto 7.
101 */
102 r->weekday = (4 + r->dse - 1) % 7 + 1;
100} 103}
101 104
102static void localtime_3(struct xtm *r, time_t time) 105static void localtime_3(struct xtm *r, time_t time)
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index f19121d4795b..a39bf97f8830 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -143,7 +143,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
143 /* copy the peer address and timestamp */ 143 /* copy the peer address and timestamp */
144 if (!continue_call) { 144 if (!continue_call) {
145 if (msg->msg_name && msg->msg_namelen > 0) 145 if (msg->msg_name && msg->msg_namelen > 0)
146 memcpy(&msg->msg_name, &call->conn->trans->peer->srx, 146 memcpy(msg->msg_name,
147 &call->conn->trans->peer->srx,
147 sizeof(call->conn->trans->peer->srx)); 148 sizeof(call->conn->trans->peer->srx));
148 sock_recv_timestamp(msg, &rx->sk, skb); 149 sock_recv_timestamp(msg, &rx->sk, skb);
149 } 150 }
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index a27511ebc4cb..ceefda025e2d 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -209,6 +209,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
209int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr) 209int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
210{ 210{
211 struct sctp_sockaddr_entry *addr, *temp; 211 struct sctp_sockaddr_entry *addr, *temp;
212 int found = 0;
212 213
213 /* We hold the socket lock when calling this function, 214 /* We hold the socket lock when calling this function,
214 * and that acts as a writer synchronizing lock. 215 * and that acts as a writer synchronizing lock.
@@ -216,13 +217,14 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
216 list_for_each_entry_safe(addr, temp, &bp->address_list, list) { 217 list_for_each_entry_safe(addr, temp, &bp->address_list, list) {
217 if (sctp_cmp_addr_exact(&addr->a, del_addr)) { 218 if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
218 /* Found the exact match. */ 219 /* Found the exact match. */
220 found = 1;
219 addr->valid = 0; 221 addr->valid = 0;
220 list_del_rcu(&addr->list); 222 list_del_rcu(&addr->list);
221 break; 223 break;
222 } 224 }
223 } 225 }
224 226
225 if (addr && !addr->valid) { 227 if (found) {
226 call_rcu(&addr->rcu, sctp_local_addr_free); 228 call_rcu(&addr->rcu, sctp_local_addr_free);
227 SCTP_DBG_OBJCNT_DEC(addr); 229 SCTP_DBG_OBJCNT_DEC(addr);
228 return 0; 230 return 0;
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 87f940587d5f..9aa0733aee87 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -89,6 +89,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
89 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr; 89 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
90 struct sctp_sockaddr_entry *addr = NULL; 90 struct sctp_sockaddr_entry *addr = NULL;
91 struct sctp_sockaddr_entry *temp; 91 struct sctp_sockaddr_entry *temp;
92 int found = 0;
92 93
93 switch (ev) { 94 switch (ev) {
94 case NETDEV_UP: 95 case NETDEV_UP:
@@ -111,13 +112,14 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
111 &sctp_local_addr_list, list) { 112 &sctp_local_addr_list, list) {
112 if (ipv6_addr_equal(&addr->a.v6.sin6_addr, 113 if (ipv6_addr_equal(&addr->a.v6.sin6_addr,
113 &ifa->addr)) { 114 &ifa->addr)) {
115 found = 1;
114 addr->valid = 0; 116 addr->valid = 0;
115 list_del_rcu(&addr->list); 117 list_del_rcu(&addr->list);
116 break; 118 break;
117 } 119 }
118 } 120 }
119 spin_unlock_bh(&sctp_local_addr_lock); 121 spin_unlock_bh(&sctp_local_addr_lock);
120 if (addr && !addr->valid) 122 if (found)
121 call_rcu(&addr->rcu, sctp_local_addr_free); 123 call_rcu(&addr->rcu, sctp_local_addr_free);
122 break; 124 break;
123 } 125 }
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 688546dccd82..ad0a4069b95b 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -628,6 +628,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
628 struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; 628 struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
629 struct sctp_sockaddr_entry *addr = NULL; 629 struct sctp_sockaddr_entry *addr = NULL;
630 struct sctp_sockaddr_entry *temp; 630 struct sctp_sockaddr_entry *temp;
631 int found = 0;
631 632
632 switch (ev) { 633 switch (ev) {
633 case NETDEV_UP: 634 case NETDEV_UP:
@@ -647,13 +648,14 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
647 list_for_each_entry_safe(addr, temp, 648 list_for_each_entry_safe(addr, temp,
648 &sctp_local_addr_list, list) { 649 &sctp_local_addr_list, list) {
649 if (addr->a.v4.sin_addr.s_addr == ifa->ifa_local) { 650 if (addr->a.v4.sin_addr.s_addr == ifa->ifa_local) {
651 found = 1;
650 addr->valid = 0; 652 addr->valid = 0;
651 list_del_rcu(&addr->list); 653 list_del_rcu(&addr->list);
652 break; 654 break;
653 } 655 }
654 } 656 }
655 spin_unlock_bh(&sctp_local_addr_lock); 657 spin_unlock_bh(&sctp_local_addr_lock);
656 if (addr && !addr->valid) 658 if (found)
657 call_rcu(&addr->rcu, sctp_local_addr_free); 659 call_rcu(&addr->rcu, sctp_local_addr_free);
658 break; 660 break;
659 } 661 }
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index e45be4e3f80d..578630e8e00d 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2375,6 +2375,14 @@ static int sctp_process_param(struct sctp_association *asoc,
2375 asoc->peer.ipv4_address = 0; 2375 asoc->peer.ipv4_address = 0;
2376 asoc->peer.ipv6_address = 0; 2376 asoc->peer.ipv6_address = 0;
2377 2377
2378 /* Assume that peer supports the address family
2379 * by which it sends a packet.
2380 */
2381 if (peer_addr->sa.sa_family == AF_INET6)
2382 asoc->peer.ipv6_address = 1;
2383 else if (peer_addr->sa.sa_family == AF_INET)
2384 asoc->peer.ipv4_address = 1;
2385
2378 /* Cycle through address types; avoid divide by 0. */ 2386 /* Cycle through address types; avoid divide by 0. */
2379 sat = ntohs(param.p->length) - sizeof(sctp_paramhdr_t); 2387 sat = ntohs(param.p->length) - sizeof(sctp_paramhdr_t);
2380 if (sat) 2388 if (sat)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 939892691a26..d994d822900d 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2933,17 +2933,39 @@ static int sctp_setsockopt_maxburst(struct sock *sk,
2933 char __user *optval, 2933 char __user *optval,
2934 int optlen) 2934 int optlen)
2935{ 2935{
2936 struct sctp_assoc_value params;
2937 struct sctp_sock *sp;
2938 struct sctp_association *asoc;
2936 int val; 2939 int val;
2940 int assoc_id = 0;
2937 2941
2938 if (optlen != sizeof(int)) 2942 if (optlen < sizeof(int))
2939 return -EINVAL; 2943 return -EINVAL;
2940 if (get_user(val, (int __user *)optval))
2941 return -EFAULT;
2942 2944
2943 if (val < 0) 2945 if (optlen == sizeof(int)) {
2946 printk(KERN_WARNING
2947 "SCTP: Use of int in max_burst socket option deprecated\n");
2948 printk(KERN_WARNING
2949 "SCTP: Use struct sctp_assoc_value instead\n");
2950 if (copy_from_user(&val, optval, optlen))
2951 return -EFAULT;
2952 } else if (optlen == sizeof(struct sctp_assoc_value)) {
2953 if (copy_from_user(&params, optval, optlen))
2954 return -EFAULT;
2955 val = params.assoc_value;
2956 assoc_id = params.assoc_id;
2957 } else
2944 return -EINVAL; 2958 return -EINVAL;
2945 2959
2946 sctp_sk(sk)->max_burst = val; 2960 sp = sctp_sk(sk);
2961
2962 if (assoc_id != 0) {
2963 asoc = sctp_id2assoc(sk, assoc_id);
2964 if (!asoc)
2965 return -EINVAL;
2966 asoc->max_burst = val;
2967 } else
2968 sp->max_burst = val;
2947 2969
2948 return 0; 2970 return 0;
2949} 2971}
@@ -5005,20 +5027,45 @@ static int sctp_getsockopt_maxburst(struct sock *sk, int len,
5005 char __user *optval, 5027 char __user *optval,
5006 int __user *optlen) 5028 int __user *optlen)
5007{ 5029{
5008 int val; 5030 struct sctp_assoc_value params;
5031 struct sctp_sock *sp;
5032 struct sctp_association *asoc;
5009 5033
5010 if (len < sizeof(int)) 5034 if (len < sizeof(int))
5011 return -EINVAL; 5035 return -EINVAL;
5012 5036
5013 len = sizeof(int); 5037 if (len == sizeof(int)) {
5038 printk(KERN_WARNING
5039 "SCTP: Use of int in max_burst socket option deprecated\n");
5040 printk(KERN_WARNING
5041 "SCTP: Use struct sctp_assoc_value instead\n");
5042 params.assoc_id = 0;
5043 } else if (len == sizeof (struct sctp_assoc_value)) {
5044 if (copy_from_user(&params, optval, len))
5045 return -EFAULT;
5046 } else
5047 return -EINVAL;
5014 5048
5015 val = sctp_sk(sk)->max_burst; 5049 sp = sctp_sk(sk);
5016 if (put_user(len, optlen)) 5050
5017 return -EFAULT; 5051 if (params.assoc_id != 0) {
5018 if (copy_to_user(optval, &val, len)) 5052 asoc = sctp_id2assoc(sk, params.assoc_id);
5019 return -EFAULT; 5053 if (!asoc)
5054 return -EINVAL;
5055 params.assoc_value = asoc->max_burst;
5056 } else
5057 params.assoc_value = sp->max_burst;
5058
5059 if (len == sizeof(int)) {
5060 if (copy_to_user(optval, &params.assoc_value, len))
5061 return -EFAULT;
5062 } else {
5063 if (copy_to_user(optval, &params, len))
5064 return -EFAULT;
5065 }
5066
5067 return 0;
5020 5068
5021 return -ENOTSUPP;
5022} 5069}
5023 5070
5024static int sctp_getsockopt_hmac_ident(struct sock *sk, int len, 5071static int sctp_getsockopt_hmac_ident(struct sock *sk, int len,