diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-22 07:39:59 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-22 07:39:59 +0400 |
commit | d7fff6f4d1ed1bc31577df887fefcb1541923367 (patch) | |
tree | e2f37519c57efe20f47dc1df694af28d537f67b2 | |
parent | 6df8cd3d4f921762504c4d1e7ed702b745702543 (diff) | |
parent | e51f802babc5e368c60fbfd08c6c11269c9253b0 (diff) | |
download | linux-d7fff6f4d1ed1bc31577df887fefcb1541923367.tar.xz |
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/Kconfig | 1 | ||||
-rw-r--r-- | drivers/net/irda/Kconfig | 11 | ||||
-rw-r--r-- | drivers/net/irda/Makefile | 1 | ||||
-rw-r--r-- | drivers/net/irda/ep7211-sir.c | 89 | ||||
-rw-r--r-- | include/linux/irda.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 2 | ||||
-rw-r--r-- | net/core/dev.c | 4 | ||||
-rw-r--r-- | net/core/sock.c | 3 | ||||
-rw-r--r-- | net/ipv4/inetpeer.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 4 | ||||
-rw-r--r-- | net/irda/irnetlink.c | 2 |
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 @@ menuconfig NETDEVICES default y if UML + depends on NET bool "Network device support" ---help--- 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 To compile it as a module, choose M here: the module will be called kingsun-sir. +config EP7211_DONGLE + tristate "EP7211 I/R support" + depends on IRTTY_SIR && ARCH_EP7211 && IRDA && EXPERIMENTAL + help + Say Y here if you want to build support for the Cirrus logic + EP7211 chipset's infrared module. + + + comment "Old SIR device drivers" config IRPORT_SIR @@ -355,7 +364,7 @@ config WINBOND_FIR config TOSHIBA_FIR tristate "Toshiba Type-O IR Port" - depends on IRDA && PCI && !64BIT + depends on IRDA && PCI && !64BIT && VIRT_TO_BUS help Say Y here if you want to build support for the Toshiba Type-O IR 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 obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o +obj-$(CONFIG_EP7211_DONGLE) += ep7211-sir.o obj-$(CONFIG_KINGSUN_DONGLE) += kingsun-sir.o # 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 @@ +/* + * IR port driver for the Cirrus Logic EP7211 processor. + * + * Copyright 2001, Blue Mug Inc. All rights reserved. + * Copyright 2007, Samuel Ortiz <samuel@sortiz.org> + */ +#include <linux/module.h> +#include <linux/delay.h> +#include <linux/tty.h> +#include <linux/init.h> +#include <linux/spinlock.h> + +#include <net/irda/irda.h> +#include <net/irda/irda_device.h> + +#include <asm/io.h> +#include <asm/hardware.h> + +#include "sir-dev.h" + +#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */ +#define MAX_DELAY 10000 /* 1 ms */ + +static int ep7211_open(struct sir_dev *dev); +static int ep7211_close(struct sir_dev *dev); +static int ep7211_change_speed(struct sir_dev *dev, unsigned speed); +static int ep7211_reset(struct sir_dev *dev); + +static struct dongle_driver ep7211 = { + .owner = THIS_MODULE, + .driver_name = "EP7211 IR driver", + .type = IRDA_EP7211_DONGLE, + .open = ep7211_open, + .close = ep7211_close, + .reset = ep7211_reset, + .set_speed = ep7211_change_speed, +}; + +static int __init ep7211_sir_init(void) +{ + return irda_register_dongle(&ep7211); +} + +static void __exit ep7211_sir_cleanup(void) +{ + irda_unregister_dongle(&ep7211); +} + +static int ep7211_open(struct sir_dev *dev) +{ + unsigned int syscon; + + /* Turn on the SIR encoder. */ + syscon = clps_readl(SYSCON1); + syscon |= SYSCON1_SIREN; + clps_writel(syscon, SYSCON1); + + return 0; +} + +static int ep7211_close(struct sir_dev *dev) +{ + unsigned int syscon; + + /* Turn off the SIR encoder. */ + syscon = clps_readl(SYSCON1); + syscon &= ~SYSCON1_SIREN; + clps_writel(syscon, SYSCON1); + + return 0; +} + +static int ep7211_change_speed(struct sir_dev *dev, unsigned speed) +{ + return 0; +} + +static int ep7211_reset(struct sir_dev *dev) +{ + return 0; +} + +MODULE_AUTHOR("Samuel Ortiz <samuel@sortiz.org>"); +MODULE_DESCRIPTION("EP7211 IR dongle driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */ + +module_init(ep7211_sir_init); +module_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 { IRDA_ACT200L_DONGLE = 10, IRDA_MA600_DONGLE = 11, IRDA_TOIM3232_DONGLE = 12, + IRDA_EP7211_DONGLE = 13, } IRDA_DONGLE; /* 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 /* The TX queue control structures */ unsigned int egress_subqueue_count; - struct net_device_subqueue egress_subqueue[0]; + struct net_device_subqueue egress_subqueue[1]; }; #define to_net_dev(d) container_of(d, struct net_device, dev) 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, /* ensure 32-byte alignment of both the device and private area */ alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST + - (sizeof(struct net_device_subqueue) * queue_count)) & + (sizeof(struct net_device_subqueue) * (queue_count - 1))) & ~NETDEV_ALIGN_CONST; alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; @@ -3642,7 +3642,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, dev->priv = ((char *)dev + ((sizeof(struct net_device) + (sizeof(struct net_device_subqueue) * - queue_count) + NETDEV_ALIGN_CONST) + (queue_count - 1)) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST)); } 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] = { "clock-21" , "clock-AF_SNA" , "clock-AF_IRDA" , "clock-AF_PPPOX" , "clock-AF_WANPIPE" , "clock-AF_LLC" , "clock-27" , "clock-28" , "clock-29" , - "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_MAX" + "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , + "clock-AF_RXRPC" , "clock-AF_MAX" }; #endif 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) #define lookup(_daddr,_stack) \ ({ \ struct inet_peer *u, **v; \ - if (_stack) { \ + if (_stack != NULL) { \ stackptr = _stack; \ *stackptr++ = &peer_root; \ } \ @@ -169,7 +169,7 @@ static void unlink_from_unused(struct inet_peer *p) v = &u->avl_left; \ else \ v = &u->avl_right; \ - if (_stack) \ + if (_stack != NULL) \ *stackptr++ = v; \ u = *v; \ } \ 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) dsfield = ipv4_get_dsfield(iph); if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)) - fl.fl6_flowlabel |= ntohl(((__u32)iph->tos << IPV6_TCLASS_SHIFT) - & IPV6_TCLASS_MASK); + fl.fl6_flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT) + & IPV6_TCLASS_MASK; err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu); 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 @@ /* * IrDA netlink layer, for stack configuration. * - * Copyright (c) 2007 Samuel Ortiz <samuel@sortiz> + * Copyright (c) 2007 Samuel Ortiz <samuel@sortiz.org> * * Partly based on the 802.11 nelink implementation * (see net/wireless/nl80211.c) which is: |