aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 23:39:59 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 23:39:59 -0400
commitd7fff6f4d1ed1bc31577df887fefcb1541923367 (patch)
treee2f37519c57efe20f47dc1df694af28d537f67b2
parent6df8cd3d4f921762504c4d1e7ed702b745702543 (diff)
parente51f802babc5e368c60fbfd08c6c11269c9253b0 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NET]: Add missing entries to family name tables [NET]: Make NETDEVICES depend on NET. [IPV6]: endianness bug in ip6_tunnel [IrDA]: TOSHIBA_FIR depends on virt_to_bus [IrDA]: EP7211 IR driver port to the latest SIR API [IrDA] Typo fix in irnetlink.c copyright [NET]: Fix loopback crashes when multiqueue is enabled. [IPV4]: Fix inetpeer gcc-4.2 warnings
-rw-r--r--drivers/net/Kconfig1
-rw-r--r--drivers/net/irda/Kconfig11
-rw-r--r--drivers/net/irda/Makefile1
-rw-r--r--drivers/net/irda/ep7211-sir.c89
-rw-r--r--include/linux/irda.h1
-rw-r--r--include/linux/netdevice.h2
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/sock.c3
-rw-r--r--net/ipv4/inetpeer.c4
-rw-r--r--net/ipv6/ip6_tunnel.c4
-rw-r--r--net/irda/irnetlink.c2
11 files changed, 112 insertions, 10 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 3073f679584b..f8a602caabcb 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -5,6 +5,7 @@
5 5
6menuconfig NETDEVICES 6menuconfig NETDEVICES
7 default y if UML 7 default y if UML
8 depends on NET
8 bool "Network device support" 9 bool "Network device support"
9 ---help--- 10 ---help---
10 You can say N here if you don't intend to connect your Linux box to 11 You can say N here if you don't intend to connect your Linux box to
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index 829da9a1d113..2098d0af8ff5 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -155,6 +155,15 @@ config KINGSUN_DONGLE
155 To compile it as a module, choose M here: the module will be called 155 To compile it as a module, choose M here: the module will be called
156 kingsun-sir. 156 kingsun-sir.
157 157
158config EP7211_DONGLE
159 tristate "EP7211 I/R support"
160 depends on IRTTY_SIR && ARCH_EP7211 && IRDA && EXPERIMENTAL
161 help
162 Say Y here if you want to build support for the Cirrus logic
163 EP7211 chipset's infrared module.
164
165
166
158comment "Old SIR device drivers" 167comment "Old SIR device drivers"
159 168
160config IRPORT_SIR 169config IRPORT_SIR
@@ -355,7 +364,7 @@ config WINBOND_FIR
355 364
356config TOSHIBA_FIR 365config TOSHIBA_FIR
357 tristate "Toshiba Type-O IR Port" 366 tristate "Toshiba Type-O IR Port"
358 depends on IRDA && PCI && !64BIT 367 depends on IRDA && PCI && !64BIT && VIRT_TO_BUS
359 help 368 help
360 Say Y here if you want to build support for the Toshiba Type-O IR 369 Say Y here if you want to build support for the Toshiba Type-O IR
361 and Donau oboe chipsets. These chipsets are used by the Toshiba 370 and Donau oboe chipsets. These chipsets are used by the Toshiba
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
index 233a2f923730..2808ef5c7b79 100644
--- a/drivers/net/irda/Makefile
+++ b/drivers/net/irda/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_MCP2120_DONGLE) += mcp2120-sir.o
45obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o 45obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o
46obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o 46obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o
47obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o 47obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o
48obj-$(CONFIG_EP7211_DONGLE) += ep7211-sir.o
48obj-$(CONFIG_KINGSUN_DONGLE) += kingsun-sir.o 49obj-$(CONFIG_KINGSUN_DONGLE) += kingsun-sir.o
49 50
50# The SIR helper module 51# The SIR helper module
diff --git a/drivers/net/irda/ep7211-sir.c b/drivers/net/irda/ep7211-sir.c
new file mode 100644
index 000000000000..831572429bb9
--- /dev/null
+++ b/drivers/net/irda/ep7211-sir.c
@@ -0,0 +1,89 @@
1/*
2 * IR port driver for the Cirrus Logic EP7211 processor.
3 *
4 * Copyright 2001, Blue Mug Inc. All rights reserved.
5 * Copyright 2007, Samuel Ortiz <samuel@sortiz.org>
6 */
7#include <linux/module.h>
8#include <linux/delay.h>
9#include <linux/tty.h>
10#include <linux/init.h>
11#include <linux/spinlock.h>
12
13#include <net/irda/irda.h>
14#include <net/irda/irda_device.h>
15
16#include <asm/io.h>
17#include <asm/hardware.h>
18
19#include "sir-dev.h"
20
21#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */
22#define MAX_DELAY 10000 /* 1 ms */
23
24static int ep7211_open(struct sir_dev *dev);
25static int ep7211_close(struct sir_dev *dev);
26static int ep7211_change_speed(struct sir_dev *dev, unsigned speed);
27static int ep7211_reset(struct sir_dev *dev);
28
29static struct dongle_driver ep7211 = {
30 .owner = THIS_MODULE,
31 .driver_name = "EP7211 IR driver",
32 .type = IRDA_EP7211_DONGLE,
33 .open = ep7211_open,
34 .close = ep7211_close,
35 .reset = ep7211_reset,
36 .set_speed = ep7211_change_speed,
37};
38
39static int __init ep7211_sir_init(void)
40{
41 return irda_register_dongle(&ep7211);
42}
43
44static void __exit ep7211_sir_cleanup(void)
45{
46 irda_unregister_dongle(&ep7211);
47}
48
49static int ep7211_open(struct sir_dev *dev)
50{
51 unsigned int syscon;
52
53 /* Turn on the SIR encoder. */
54 syscon = clps_readl(SYSCON1);
55 syscon |= SYSCON1_SIREN;
56 clps_writel(syscon, SYSCON1);
57
58 return 0;
59}
60
61static int ep7211_close(struct sir_dev *dev)
62{
63 unsigned int syscon;
64
65 /* Turn off the SIR encoder. */
66 syscon = clps_readl(SYSCON1);
67 syscon &= ~SYSCON1_SIREN;
68 clps_writel(syscon, SYSCON1);
69
70 return 0;
71}
72
73static int ep7211_change_speed(struct sir_dev *dev, unsigned speed)
74{
75 return 0;
76}
77
78static int ep7211_reset(struct sir_dev *dev)
79{
80 return 0;
81}
82
83MODULE_AUTHOR("Samuel Ortiz <samuel@sortiz.org>");
84MODULE_DESCRIPTION("EP7211 IR dongle driver");
85MODULE_LICENSE("GPL");
86MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */
87
88module_init(ep7211_sir_init);
89module_exit(ep7211_sir_cleanup);
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 8e3735714c1c..28f88ecba344 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -77,6 +77,7 @@ typedef enum {
77 IRDA_ACT200L_DONGLE = 10, 77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11, 78 IRDA_MA600_DONGLE = 11,
79 IRDA_TOIM3232_DONGLE = 12, 79 IRDA_TOIM3232_DONGLE = 12,
80 IRDA_EP7211_DONGLE = 13,
80} IRDA_DONGLE; 81} IRDA_DONGLE;
81 82
82/* Protocol types to be used for SOCK_DGRAM */ 83/* Protocol types to be used for SOCK_DGRAM */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9820ca1e45e2..4a616d73cc25 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -575,7 +575,7 @@ struct net_device
575 575
576 /* The TX queue control structures */ 576 /* The TX queue control structures */
577 unsigned int egress_subqueue_count; 577 unsigned int egress_subqueue_count;
578 struct net_device_subqueue egress_subqueue[0]; 578 struct net_device_subqueue egress_subqueue[1];
579}; 579};
580#define to_net_dev(d) container_of(d, struct net_device, dev) 580#define to_net_dev(d) container_of(d, struct net_device, dev)
581 581
diff --git a/net/core/dev.c b/net/core/dev.c
index 38212c3f9971..ee4035571c21 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3624,7 +3624,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
3624 3624
3625 /* ensure 32-byte alignment of both the device and private area */ 3625 /* ensure 32-byte alignment of both the device and private area */
3626 alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST + 3626 alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST +
3627 (sizeof(struct net_device_subqueue) * queue_count)) & 3627 (sizeof(struct net_device_subqueue) * (queue_count - 1))) &
3628 ~NETDEV_ALIGN_CONST; 3628 ~NETDEV_ALIGN_CONST;
3629 alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; 3629 alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
3630 3630
@@ -3642,7 +3642,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
3642 dev->priv = ((char *)dev + 3642 dev->priv = ((char *)dev +
3643 ((sizeof(struct net_device) + 3643 ((sizeof(struct net_device) +
3644 (sizeof(struct net_device_subqueue) * 3644 (sizeof(struct net_device_subqueue) *
3645 queue_count) + NETDEV_ALIGN_CONST) 3645 (queue_count - 1)) + NETDEV_ALIGN_CONST)
3646 & ~NETDEV_ALIGN_CONST)); 3646 & ~NETDEV_ALIGN_CONST));
3647 } 3647 }
3648 3648
diff --git a/net/core/sock.c b/net/core/sock.c
index bd209c4477a9..cfed7d42c485 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -182,7 +182,8 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {
182 "clock-21" , "clock-AF_SNA" , "clock-AF_IRDA" , 182 "clock-21" , "clock-AF_SNA" , "clock-AF_IRDA" ,
183 "clock-AF_PPPOX" , "clock-AF_WANPIPE" , "clock-AF_LLC" , 183 "clock-AF_PPPOX" , "clock-AF_WANPIPE" , "clock-AF_LLC" ,
184 "clock-27" , "clock-28" , "clock-29" , 184 "clock-27" , "clock-28" , "clock-29" ,
185 "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_MAX" 185 "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" ,
186 "clock-AF_RXRPC" , "clock-AF_MAX"
186}; 187};
187#endif 188#endif
188 189
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 6cbce96a54ce..771031dfbd0f 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -158,7 +158,7 @@ static void unlink_from_unused(struct inet_peer *p)
158#define lookup(_daddr,_stack) \ 158#define lookup(_daddr,_stack) \
159({ \ 159({ \
160 struct inet_peer *u, **v; \ 160 struct inet_peer *u, **v; \
161 if (_stack) { \ 161 if (_stack != NULL) { \
162 stackptr = _stack; \ 162 stackptr = _stack; \
163 *stackptr++ = &peer_root; \ 163 *stackptr++ = &peer_root; \
164 } \ 164 } \
@@ -169,7 +169,7 @@ static void unlink_from_unused(struct inet_peer *p)
169 v = &u->avl_left; \ 169 v = &u->avl_left; \
170 else \ 170 else \
171 v = &u->avl_right; \ 171 v = &u->avl_right; \
172 if (_stack) \ 172 if (_stack != NULL) \
173 *stackptr++ = v; \ 173 *stackptr++ = v; \
174 u = *v; \ 174 u = *v; \
175 } \ 175 } \
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 281aee42d3f0..df30976f6dfd 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -962,8 +962,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
962 dsfield = ipv4_get_dsfield(iph); 962 dsfield = ipv4_get_dsfield(iph);
963 963
964 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)) 964 if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS))
965 fl.fl6_flowlabel |= ntohl(((__u32)iph->tos << IPV6_TCLASS_SHIFT) 965 fl.fl6_flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT)
966 & IPV6_TCLASS_MASK); 966 & IPV6_TCLASS_MASK;
967 967
968 err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu); 968 err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu);
969 if (err != 0) { 969 if (err != 0) {
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c
index db716580e1ae..694ea4d92fa8 100644
--- a/net/irda/irnetlink.c
+++ b/net/irda/irnetlink.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * IrDA netlink layer, for stack configuration. 2 * IrDA netlink layer, for stack configuration.
3 * 3 *
4 * Copyright (c) 2007 Samuel Ortiz <samuel@sortiz> 4 * Copyright (c) 2007 Samuel Ortiz <samuel@sortiz.org>
5 * 5 *
6 * Partly based on the 802.11 nelink implementation 6 * Partly based on the 802.11 nelink implementation
7 * (see net/wireless/nl80211.c) which is: 7 * (see net/wireless/nl80211.c) which is: