platform/kernel/linux-3.10.git
14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Mon, 9 Nov 2009 07:00:54 +0000 (23:00 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/can/usb/ems_usb.c

14 years agoxfrm: SAD entries do not expire correctly after suspend-resume
Yury Polyanskiy [Mon, 9 Nov 2009 04:58:41 +0000 (20:58 -0800)]
xfrm: SAD entries do not expire correctly after suspend-resume

  This fixes the following bug in the current implementation of
net/xfrm: SAD entries timeouts do not count the time spent by the machine
in the suspended state. This leads to the connectivity problems because
after resuming local machine thinks that the SAD entry is still valid, while
it has already been expired on the remote server.

  The cause of this is very simple: the timeouts in the net/xfrm are bound to
the old mod_timer() timers. This patch reassigns them to the
CLOCK_REALTIME hrtimer.

  I have been using this version of the patch for a few months on my
machines without any problems. Also run a few stress tests w/o any
issues.

  This version of the patch uses tasklet_hrtimer by Peter Zijlstra
(commit 9ba5f0).

  This patch is against 2.6.31.4. Please CC me.

Signed-off-by: Yury Polyanskiy <polyanskiy@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/compat_ioctl: support SIOCWANDEV
Arnd Bergmann [Mon, 9 Nov 2009 04:57:03 +0000 (20:57 -0800)]
net/compat_ioctl: support SIOCWANDEV

This adds compat_ioctl support for SIOCWANDEV, which has
always been missing.

The definition of struct compat_ifreq was missing an
ifru_settings fields that is needed to support SIOCWANDEV,
so add that and clean up the whitespace damage in the
struct definition.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet, compat_ioctl: fix SIOCGMII ioctls
Arnd Bergmann [Mon, 9 Nov 2009 04:56:21 +0000 (20:56 -0800)]
net, compat_ioctl: fix SIOCGMII ioctls

SIOCGMIIPHY and SIOCGMIIREG return data through ifreq,
so it needs to be converted on the way out as well.

SIOCGIFPFLAGS is unused, but has the same problem in theory.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: multicast RX should increment SNMP/sk_drops counter in allocation failures
Eric Dumazet [Sun, 8 Nov 2009 10:20:19 +0000 (10:20 +0000)]
udp: multicast RX should increment SNMP/sk_drops counter in allocation failures

When skb_clone() fails, we should increment sk_drops and SNMP counters.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv6: udp: Optimise multicast reception
Eric Dumazet [Sun, 8 Nov 2009 10:18:52 +0000 (10:18 +0000)]
ipv6: udp: Optimise multicast reception

IPV6 UDP multicast rx path is a bit complex and can hold a spinlock
for a long time.

Using a small (32 or 64 entries) stack of socket pointers can help
to perform expensive operations (skb_clone(), udp_queue_rcv_skb())
outside of the lock, in most cases.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: udp: Optimise multicast reception
Eric Dumazet [Sun, 8 Nov 2009 10:18:44 +0000 (10:18 +0000)]
ipv4: udp: Optimise multicast reception

UDP multicast rx path is a bit complex and can hold a spinlock
for a long time.

Using a small (32 or 64 entries) stack of socket pointers can help
to perform expensive operations (skb_clone(), udp_queue_rcv_skb())
outside of the lock, in most cases.

It's also a base for a future RCU conversion of multicast recption.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Lucian Adrian Grijincu <lgrijincu@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv6: udp: optimize unicast RX path
Eric Dumazet [Sun, 8 Nov 2009 10:18:30 +0000 (10:18 +0000)]
ipv6: udp: optimize unicast RX path

We first locate the (local port) hash chain head
If few sockets are in this chain, we proceed with previous lookup algo.

If too many sockets are listed, we take a look at the secondary
(port, address) hash chain.

We choose the shortest chain and proceed with a RCU lookup on the elected chain.

But, if we chose (port, address) chain, and fail to find a socket on given address,
 we must try another lookup on (port, in6addr_any) chain to find sockets not bound
to a particular IP.

-> No extra cost for typical setups, where the first lookup will probabbly
be performed.

RCU lookups everywhere, we dont acquire spinlock.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: udp: optimize unicast RX path
Eric Dumazet [Sun, 8 Nov 2009 10:18:11 +0000 (10:18 +0000)]
ipv4: udp: optimize unicast RX path

We first locate the (local port) hash chain head
If few sockets are in this chain, we proceed with previous lookup algo.

If too many sockets are listed, we take a look at the secondary
(port, address) hash chain we added in previous patch.

We choose the shortest chain and proceed with a RCU lookup on the elected chain.

But, if we chose (port, address) chain, and fail to find a socket on given address,
 we must try another lookup on (port, INADDR_ANY) chain to find socket not bound
to a particular IP.

-> No extra cost for typical setups, where the first lookup will probabbly
be performed.

RCU lookups everywhere, we dont acquire spinlock.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: secondary hash on (local port, local address)
Eric Dumazet [Sun, 8 Nov 2009 10:17:58 +0000 (10:17 +0000)]
udp: secondary hash on (local port, local address)

Extends udp_table to contain a secondary hash table.

socket anchor for this second hash is free, because UDP
doesnt use skc_bind_node : We define an union to hold
both skc_bind_node & a new hlist_nulls_node udp_portaddr_node

udp_lib_get_port() inserts sockets into second hash chain
(additional cost of one atomic op)

udp_lib_unhash() deletes socket from second hash chain
(additional cost of one atomic op)

Note : No spinlock lockdep annotation is needed, because
lock for the secondary hash chain is always get after
lock for primary hash chain.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: split sk_hash into two u16 hashes
Eric Dumazet [Sun, 8 Nov 2009 10:17:30 +0000 (10:17 +0000)]
udp: split sk_hash into two u16 hashes

Union sk_hash with two u16 hashes for udp (no extra memory taken)

One 16 bits hash on (local port) value (the previous udp 'hash')

One 16 bits hash on (local address, local port) values, initialized
but not yet used. This second hash is using jenkin hash for better
distribution.

Because the 'port' is xored later, a partial hash is performed
on local address + net_hash_mix(net)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoudp: add a counter into udp_hslot
Eric Dumazet [Sun, 8 Nov 2009 10:17:05 +0000 (10:17 +0000)]
udp: add a counter into udp_hslot

Adds a counter in udp_hslot to keep an accurate count
of sockets present in chain.

This will permit to upcoming UDP lookup algo to chose
the shortest chain when secondary hash is added.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/appletalk: using compat_ptr needs inclusion of linux/compat.h
Stephen Rothwell [Mon, 9 Nov 2009 04:41:03 +0000 (20:41 -0800)]
net/appletalk: using compat_ptr needs inclusion of linux/compat.h

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: Driver for the Microchip MCP251x SPI CAN controllers
Christian Pellegrin [Mon, 2 Nov 2009 23:07:00 +0000 (23:07 +0000)]
can: Driver for the Microchip MCP251x SPI CAN controllers

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Support specifying the network namespace upon device creation.
Eric W. Biederman [Sun, 8 Nov 2009 08:53:51 +0000 (00:53 -0800)]
net: Support specifying the network namespace upon device creation.

There is no good reason to not support userspace specifying the
network namespace during device creation, and it makes it easier
to create a network device and pass it to a child network namespace
with a well known name.

We have to be careful to ensure that the target network namespace
for the new device exists through the life of the call.  To keep
that logic clear I have factored out the network namespace grabbing
logic into rtnl_link_get_net.

In addtion we need to continue to pass the source network namespace
to the rtnl_link_ops.newlink method so that we can find the base
device source network namespace.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
14 years agonet/fsl_pq_mdio: add module license GPL
Sebastian Siewior [Fri, 6 Nov 2009 08:50:28 +0000 (08:50 +0000)]
net/fsl_pq_mdio: add module license GPL

or it will taint the kernel and fail to load becuase
of_address_to_resource() is GPL only.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()
Wolfgang Grandegger [Fri, 6 Nov 2009 23:53:13 +0000 (23:53 +0000)]
can: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()

On older kernels, e.g. 2.6.27, a WARN_ON dump in rtmsg_ifinfo()
is thrown when the CAN device is registered due to insufficient
skb space, as reported by various users. This patch adds the
rtnl_link_ops "get_size" to fix the problem. I think this patch
is required for more recent kernels as well, even if no WARN_ON
dumps are triggered. Maybe we also need "get_xstats_size" for
the CAN xstats.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoappletalk/ddp.c: Neaten checksum function
Joe Perches [Wed, 4 Nov 2009 10:26:13 +0000 (10:26 +0000)]
appletalk/ddp.c: Neaten checksum function

atalk_sum_partial can now use the rol16 function in bitops.h

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv6: avoid dev_hold()/dev_put() in rawv6_bind()
Eric Dumazet [Fri, 6 Nov 2009 07:01:17 +0000 (07:01 +0000)]
ipv6: avoid dev_hold()/dev_put() in rawv6_bind()

Using RCU helps not touching device refcount in rawv6_bind()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: Fix compiler and sparse warnings
Anton Vorontsov [Wed, 4 Nov 2009 12:53:00 +0000 (12:53 +0000)]
gianfar: Fix compiler and sparse warnings

commit fba4ed030cfae7efdb6b79a57b0c5a9d72c9de83 ("gianfar: Add Multiple
Queue Support") introduced the following warnings:

  CHECK   gianfar.c
gianfar.c:333:8: warning: incorrect type in assignment (different address spaces)
gianfar.c:333:8:    expected unsigned int [usertype] *baddr
gianfar.c:333:8:    got unsigned int [noderef] <asn:2>*<noident>
[... 67 lines skipped ...]
gianfar.c:2565:3: warning: incorrect type in argument 1 (different type sizes)
gianfar.c:2565:3:    expected unsigned long const *addr
gianfar.c:2565:3:    got unsigned int *<noident>
  CC      gianfar.o
gianfar.c: In function 'gfar_probe':
gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:985: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:993: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c: In function 'gfar_configure_coalescing':
gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:1680: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:1688: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c: In function 'gfar_poll':
gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:2565: warning: passing argument 1 of 'find_next_bit' from incompatible pointer type
gianfar.c:2566: warning: passing argument 2 of 'test_bit' from incompatible pointer type
gianfar.c:2585: warning: passing argument 2 of 'set_bit' from incompatible pointer type

Following warnings left unfixed (looks like sparse doesn't like
locks in loops, so __acquires/__releases() doesn't help):

gianfar.c:441:40: warning: context imbalance in 'lock_rx_qs': wrong count at exit
gianfar.c:441:40:    context '<noident>': wanted 0, got 1
gianfar.c:449:40: warning: context imbalance in 'lock_tx_qs': wrong count at exit
gianfar.c:449:40:    context '<noident>': wanted 0, got 1
gianfar.c:458:3: warning: context imbalance in 'unlock_rx_qs': __context__ statement expected different context
gianfar.c:458:3:    context '<noident>': wanted >= 0, got -1
gianfar.c:466:3: warning: context imbalance in 'unlock_tx_qs': __context__ statement expected different context
gianfar.c:466:3:    context '<noident>': wanted >= 0, got -1

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofsl_pq_mdio: Fix compiler/sparse warnings (part 2)
Anton Vorontsov [Wed, 4 Nov 2009 12:52:57 +0000 (12:52 +0000)]
fsl_pq_mdio: Fix compiler/sparse warnings (part 2)

This patch fixes following warnings:

fsl_pq_mdio.c:112:38: warning: cast adds address space to expression (<asn:2>)
fsl_pq_mdio.c:124:38: warning: cast adds address space to expression (<asn:2>)
fsl_pq_mdio.c:133:38: warning: cast adds address space to expression (<asn:2>)
fsl_pq_mdio.c:414:11: warning: cast adds address space to expression (<asn:2>)

Instead of adding __force all over the place, introduce convenient
fsl_pq_mdio_get_regs() call that does the ugly casting just once.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofsl_pq_mdio: Fix compiler/sparse warnings (part 1)
Anton Vorontsov [Wed, 4 Nov 2009 12:52:56 +0000 (12:52 +0000)]
fsl_pq_mdio: Fix compiler/sparse warnings (part 1)

commit 1d2397d742b7a2b39b2f09dd9da3b9d1463f55e9 ("fsl_pq_mdio: Add
Suport for etsec2.0 devices") introduced the following warnings:

  CHECK   fsl_pq_mdio.c
fsl_pq_mdio.c:287:22: warning: incorrect type in initializer (different base types)
fsl_pq_mdio.c:287:22:    expected unknown type 11 const *__mptr
fsl_pq_mdio.c:287:22:    got unsigned long long [unsigned] [assigned] [usertype] addr
fsl_pq_mdio.c:287:19: warning: incorrect type in assignment (different base types)
fsl_pq_mdio.c:287:19:    expected unsigned long long [unsigned] [usertype] ioremap_miimcfg
fsl_pq_mdio.c:287:19:    got struct fsl_pq_mdio *<noident>
  CC      fsl_pq_mdio.o
fsl_pq_mdio.c: In function 'fsl_pq_mdio_probe':
fsl_pq_mdio.c:287: warning: initialization makes pointer from integer without a cast
fsl_pq_mdio.c:287: warning: assignment makes integer from pointer without a cast

These warnings are not easy to fix without ugly __force casts. So,
instead of introducing the casts, rework the code to substitute an
offset from an already mapped area. This makes the code a lot simpler
and less duplicated.

Plus, from now on we don't actually map reserved registers on
non-etsec2.0 devices, so we have more chances to catch programming
errors.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: should not use __dev_get_by_index() without locks
Eric Dumazet [Fri, 6 Nov 2009 00:23:01 +0000 (00:23 +0000)]
can: should not use __dev_get_by_index() without locks

bcm_proc_getifname() is called with RTNL and dev_base_lock
not held. It calls __dev_get_by_index() without locks, and
this is illegal (might crash)

Close the race by holding dev_base_lock and copying dev->name
in the protected section.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agortnetlink: Cleanups
Eric Dumazet [Sat, 7 Nov 2009 09:26:17 +0000 (01:26 -0800)]
rtnetlink: Cleanups

Pure cleanups patch

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: kill proto_ops wrapper
Arnd Bergmann [Thu, 5 Nov 2009 04:37:30 +0000 (04:37 +0000)]
net: kill proto_ops wrapper

All users of wrapped proto_ops are now gone, so we can safely remove
the wrappers as well.

Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/x25: push BKL usage into x25_proto
Arnd Bergmann [Thu, 5 Nov 2009 04:37:29 +0000 (04:37 +0000)]
net/x25: push BKL usage into x25_proto

The x25 driver uses lock_kernel() implicitly through
its proto_ops wrapper. The makes the usage explicit
in order to get rid of that wrapper and to better document
the usage of the BKL.

The next step should be to get rid of the usage of the BKL
in x25 entirely, which requires understanding what data
structures need serialized accesses.

Cc: Henner Eisen <eis@baty.hanse.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: linux-x25@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/irda: push BKL into proto_ops
Arnd Bergmann [Fri, 6 Nov 2009 08:38:01 +0000 (00:38 -0800)]
net/irda: push BKL into proto_ops

The irda driver uses the BKL implicitly in its protocol
operations. Replace the wrapped proto_ops with explicit
lock_kernel() calls makes the usage more obvious and
shrinks the size of the object code.

The calls t lock_kernel() should eventually all be replaced
by other serialization methods, which requires finding out

The calls t lock_kernel() should eventually all be replaced
by other serialization methods, which requires finding out
which data actually needs protection.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/ipx: push down BKL into a ipx_dgram_ops
Arnd Bergmann [Thu, 5 Nov 2009 04:37:27 +0000 (04:37 +0000)]
net/ipx: push down BKL into a ipx_dgram_ops

Making the BKL usage explicit in ipx makes it more
obvious where it is used, reduces code size and helps
getting rid of the BKL in common code.

I did not analyse how to kill lock_kernel from ipx
entirely, this will involve either proving that it's not
needed, or replacing with a proper mutex or spinlock,
after finding out which data structures are protected
by the lock.

Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/appletalk: push down BKL into a atalk_dgram_ops
Arnd Bergmann [Thu, 5 Nov 2009 04:37:26 +0000 (04:37 +0000)]
net/appletalk: push down BKL into a atalk_dgram_ops

Making the BKL usage explicit in appletalk makes it more
obvious where it is used, reduces code size and helps
getting rid of the BKL in common code.

I did not analyse how to kill lock_kernel from appletalk
entirely, this will involve either proving that it's not
needed, or replacing with a proper mutex or spinlock,
after finding out which data structures are protected
by the lock.

Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoatl1c: change atl1c_buffer struct and restructure clean atl1c_buffer procedure
Jie Yang [Fri, 6 Nov 2009 08:32:05 +0000 (00:32 -0800)]
atl1c: change atl1c_buffer struct and restructure clean atl1c_buffer procedure

change atl1c_buffer struct, use "u16 flags" instead of "u16 state"
to store more infomation for atl1c_buffer, and restructure clean
atl1c_buffer procedure, add common api atl1c_clean_buffer.

Signed-off-by: Jie Yang <jie.yang@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Replace old style lock initializer
Thomas Gleixner [Sat, 7 Nov 2009 06:17:25 +0000 (22:17 -0800)]
net: Replace old style lock initializer

SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: compat: No need to define IFHWADDRLEN and IFNAMSIZ twice.
David S. Miller [Sat, 7 Nov 2009 04:46:52 +0000 (20:46 -0800)]
net: compat: No need to define IFHWADDRLEN and IFNAMSIZ twice.

It's defined colloqually in linux/if.h and linux/compat.h
includes that.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet, compat_ioctl: handle more ioctls correctly
Arnd Bergmann [Fri, 6 Nov 2009 08:09:09 +0000 (08:09 +0000)]
net, compat_ioctl: handle more ioctls correctly

The MII ioctls and SIOCSIFNAME need to go through ifsioc conversion,
which they never did so far. Some others are not implemented in the
native path, so we can just return -EINVAL directly.

Add IFSLAVE ioctls to the EINVAL list and move it to the end to
optimize the code path for the common case.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocompat: move sockios handling to net/socket.c
Arnd Bergmann [Sat, 7 Nov 2009 07:10:54 +0000 (23:10 -0800)]
compat: move sockios handling to net/socket.c

This removes the original socket compat_ioctl code
from fs/compat_ioctl.c and converts the code from the copy
in net/socket.c into a single function. We add a few cycles
of runtime to compat_sock_ioctl() with the long switch()
statement, but gain some cycles in return by simplifying
the call chain to get there.

Due to better inlining, save 1.5kb of object size in the
process, and enable further savings:

before:
   text    data     bss     dec     hex filename
  13540   18008    2080   33628    835c obj/fs/compat_ioctl.o
  14565     636      40   15241    3b89 obj/net/socket.o

after:
   text    data     bss     dec     hex filename
   8916   15176    2080   26172    663c obj/fs/compat_ioctl.o
  20725     636      40   21401    5399 obj/net/socket.o

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoappletalk: handle SIOCATALKDIFADDR compat ioctl
Arnd Bergmann [Fri, 6 Nov 2009 08:09:06 +0000 (08:09 +0000)]
appletalk: handle SIOCATALKDIFADDR compat ioctl

We must not have a compat ioctl handler for SIOCATALKDIFADDR
in common code, because the same number is used in other protocols
with different data structures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: copy socket ioctl code to net/socket.h
Arnd Bergmann [Sat, 7 Nov 2009 07:00:29 +0000 (23:00 -0800)]
net: copy socket ioctl code to net/socket.h

This makes an identical copy of the socket compat_ioctl code
from fs/compat_ioctl.c to net/socket.c, as a preparation
for moving the functionality in a way that can be easily
reviewed.

The code is hidden inside of #if 0 and gets activated in the
patch that will make it work.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet, compat_ioctl: handle socket ioctl abuses in tty drivers
Arnd Bergmann [Sat, 7 Nov 2009 06:51:16 +0000 (22:51 -0800)]
net, compat_ioctl: handle socket ioctl abuses in tty drivers

Slip and a few other drivers use the same ioctl numbers on
tty devices that are normally meant for sockets. This causes
problems with our compat_ioctl handling that tries to convert
the data structures in a different format.

Fortunately, these five drivers all use 32 bit compatible
data structures in the ioctl numbers, so we can just add
a trivial compat_ioctl conversion function to each of them.

SIOCSIFENCAP and SIOCGIFENCAP do not need to live in
fs/compat_ioctl.c after this any more, and they are not
used on any sockets.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/tun: handle compat_ioctl directly
Arnd Bergmann [Sat, 7 Nov 2009 06:52:32 +0000 (22:52 -0800)]
net/tun: handle compat_ioctl directly

The tun driver is the only code in the kernel that operates
on a character device with struct ifreq. Change the driver
to handle the conversion itself so we can contain the
remaining ifreq handling in the socket layer.

This also fixes a bug in the handling of invalid ioctl
numbers on an unbound tun device. The driver treats this
as a TUNSETIFF in native mode, but there is no way for
the generic compat_ioctl() function to emulate this
behaviour. Possibly the driver was only doing this
accidentally anyway, but if any code relies on this
misfeature, it now also works in compat mode.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocompat: add struct compat_ifreq etc to compat.h
Arnd Bergmann [Fri, 6 Nov 2009 08:09:03 +0000 (08:09 +0000)]
compat: add struct compat_ifreq etc to compat.h

In order to move socket ioctl conversion code into multiple
places in the socket code, we need a common defintion of
the data structures it uses.

Also change the name from ifreq32 to compat_ifreq to
follow the naming convention for compat.h

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agohisax: remove bad udelay call to fix build error on ARM
Martin Michlmayr [Fri, 6 Nov 2009 14:52:34 +0000 (14:52 +0000)]
hisax: remove bad udelay call to fix build error on ARM

The hisax ISDN driver fails to build on ARM with CONFIG_HISAX_ELSA:

| drivers/built-in.o: In function `modem_set_dial':
| drivers/isdn/hisax/elsa_ser.c:535: undefined reference to `__bad_udelay'
| drivers/isdn/hisax/elsa_ser.c:544: undefined reference to `__bad_udelay'
| drivers/built-in.o: In function `modem_set_init':
| drivers/isdn/hisax/elsa_ser.c:486: undefined reference to `__bad_udelay'
| [...]

According to the comment in arch/arm/include/asm/delay.h, __bad_udelay
is specifically designed on ARM to produce a build failure when udelay
is called with a value > 2000.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipip: Fix handling of DF packets when pmtudisc is OFF
Herbert Xu [Fri, 6 Nov 2009 10:37:41 +0000 (10:37 +0000)]
ipip: Fix handling of DF packets when pmtudisc is OFF

RFC 2003 requires the outer header to have DF set if DF is set
on the inner header, even when PMTU discovery is off for the
tunnel.  Our implementation does exactly that.

For this to work properly the IPIP gateway also needs to engate
in PMTU when the inner DF bit is set.  As otherwise the original
host would not be able to carry out its PMTU successfully since
part of the path is only visible to the gateway.

Unfortunately when the tunnel PMTU discovery setting is off, we
do not collect the necessary soft state, resulting in blackholes
when the original host tries to perform PMTU discovery.

This problem is not reproducible on the IPIP gateway itself as
the inner packet usually has skb->local_df set.  This is not
correctly cleared (an unrelated bug) when the packet passes
through the tunnel, which allows fragmentation to occur.  For
hosts behind the IPIP gateway it is readily visible with a simple
ping.

This patch fixes the problem by performing PMTU discovery for
all packets with the inner DF bit set, regardless of the PMTU
discovery setting on the tunnel itself.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Set PCIe reset type for EEH to fundamental.
Ron Mercer [Fri, 6 Nov 2009 07:44:58 +0000 (07:44 +0000)]
qlge: Set PCIe reset type for EEH to fundamental.

This device requires a fundamental reset when recovering from EEH.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlge: Fix early exit from mbox cmd complete wait.
Ron Mercer [Fri, 6 Nov 2009 07:44:57 +0000 (07:44 +0000)]
qlge: Fix early exit from mbox cmd complete wait.

This line was accidentally left out of the previous commit #
da03945140a035a2962f7f93e359085596f20499 ("qlge: Fix firmware mailbox
command timeout.").

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: fix traffic hangs on Tx with ioatdma loaded
Don Skidmore [Fri, 6 Nov 2009 12:56:20 +0000 (12:56 +0000)]
ixgbe: fix traffic hangs on Tx with ioatdma loaded

When ioatdma was loaded we we were unable to transmit traffic.  We weren't
using the correct registers in ixgbe_update_tx_dca for 82599 systems.
Likewise in ixgbe_configure_tx() we weren't disabling the arbiter before
modifying MTQC.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix checking TFCS register for TXOFF status when DCB is enabled
Yi Zou [Fri, 6 Nov 2009 12:56:00 +0000 (12:56 +0000)]
ixgbe: Fix checking TFCS register for TXOFF status when DCB is enabled

When DCB is enabled, the ixgbe_check_tx_hang() should check the corresponding
TC's TXOFF in TFCS based on the TC that the tx ring belongs to. Adds a
function to map from the tx_ring hw reg_idx to the correspodning TC and read
TFCS accordingly.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Fix gso_max_size for 82599 when DCB is enabled
Yi Zou [Fri, 6 Nov 2009 12:55:38 +0000 (12:55 +0000)]
ixgbe: Fix gso_max_size for 82599 when DCB is enabled

The 32k gso_max_size when DCB is enabled is for 82598 only, not for 82599.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agomacsonic: fix crash on PowerBook 520
Finn Thain [Tue, 3 Nov 2009 03:42:40 +0000 (03:42 +0000)]
macsonic: fix crash on PowerBook 520

No-one seems to know where the PowerBook 500 series store their ethernet
MAC addresses. So, rather than crash, use a MAC address from the SONIC
CAM. Failing that, generate a random one.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoNET: cassini, fix lock imbalance
Jiri Slaby [Thu, 5 Nov 2009 23:14:29 +0000 (23:14 +0000)]
NET: cassini, fix lock imbalance

Stanse found that one error path in cas_open omits to unlock pm_mutex.
Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoems_usb: Fix byte order issues on big endian machines
Sebastian Haas [Wed, 4 Nov 2009 05:48:33 +0000 (05:48 +0000)]
ems_usb: Fix byte order issues on big endian machines

CPC-USB is using a ARM7 core with little endian byte order. The "id" field
in can_msg needs byte order conversion from/to CPU byte order.

Signed-off-by: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Bug fix to send config commands to hardware after netdev_register
Ajit Khaparde [Fri, 6 Nov 2009 02:07:32 +0000 (02:07 +0000)]
be2net: Bug fix to send config commands to hardware after netdev_register

Sending config commands to be2 hardware before netdev_register is
completed, is sometimes causing the async link notification to arrive
even before the driver is ready to handle it. The commands for vlan
config and flow control settings can infact wait till be_open.
This patch takes care of that.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix to set proper flow control on resume
Ajit Khaparde [Fri, 6 Nov 2009 02:06:59 +0000 (02:06 +0000)]
be2net: fix to set proper flow control on resume

If be2 goes into suspend after a user changes the flow control settings,
we are not programming them back after resume. This patch takes care of it.
We now get the flow control settings before going to suspend mode and
then apply them during resume.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Sat, 7 Nov 2009 02:21:44 +0000 (18:21 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agonetfilter: xt_connlimit: fix regression caused by zero family value
Jan Engelhardt [Sat, 7 Nov 2009 02:08:32 +0000 (18:08 -0800)]
netfilter: xt_connlimit: fix regression caused by zero family value

Commit v2.6.28-rc1~717^2~109^2~2 was slightly incomplete; not all
instances of par->match->family were changed to par->family.

References: http://bugzilla.netfilter.org/show_bug.cgi?id=610
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan
David S. Miller [Sat, 7 Nov 2009 01:57:51 +0000 (17:57 -0800)]
Merge branch 'for-next' of git://git./linux/kernel/git/lowpan/lowpan

14 years agort2x00: Don't queue ieee80211 work after USB removal
Sean Cross [Thu, 5 Nov 2009 19:22:03 +0000 (20:22 +0100)]
rt2x00: Don't queue ieee80211 work after USB removal

This prevents the rt2x00 driver from queueing ieee80211 work after the Â 
USB card has been removed, preventing a kernel panic.

Signed-off-by: Sean Cross <sean@chumby.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoRevert "ipw2200: fix oops on missing firmware"
John W. Linville [Fri, 6 Nov 2009 17:58:20 +0000 (12:58 -0500)]
Revert "ipw2200: fix oops on missing firmware"

This reverts commit e6c5fc53d0f44a772398402ee8a1879818e42b4e.

Based on this regression report:

Date: Thu, 05 Nov 2009 15:59:16 +0100
From: Holger Schurig <holgerschurig@gmail.com>
To: linux-wireless@vger.kernel.org
Subject: BUG: oops when "rmmod ipw2200"

This happened on wireless-testing v2.6.32-rc6-41575-g5e68bfb. I
modprobed ipw2200, put it into monitor mode, used tshark a while to
monitor, then I stopped tshark, "ifconfig eth2 down" and finally
"rmmod ipw2200", and voila:

[  917.189620] ------------[ cut here ]------------
[  917.189717] kernel BUG at net/wireless/core.c:543!
[  917.189805] invalid opcode: 0000 [#1] PREEMPT SMP
[  917.190002] last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:02:0d.0/firmware/0000:02:0d.0/loading
[  917.190136] Modules linked in: lib80211_crypt_wep ipw2200(-) libipw lib80211 ath5k mac80211 ath cfg80211 psmouse uhci_hcd
[  917.190680]
[  917.190759] Pid: 1763, comm: rmmod Not tainted (2.6.32-rc6-wl #26) Amilo M1425
[  917.190886] EIP: 0060:[<f8accf34>] EFLAGS: 00010202 CPU: 0
[  917.190992] EIP is at wiphy_unregister+0xd3/0x175 [cfg80211]
[  917.191083] EAX: f601d4c4 EBX: 00000000 ECX: 00000000 EDX: f79e8600
[  917.191176] ESI: f601d400 EDI: f95b4350 EBP: f6009eb4 ESP: f6009e8c
[  917.191269]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[  917.191360] Process rmmod (pid: 1763, ti=f6008000 task=f79e8130 task.ti=f6008000)
[  917.191486] Stack:
[  917.191562]  f601d5a0 f601d484 f6460e98 f6009ea0 c01407ee f6009eb8 00000246 f64604c0
[  917.191916] <0> f6460e5c f95b4350 f6009ec0 f94fd030 f6460e98 f6009edc f95a9d4f f787bc00
[  917.192100] <0> f787bc58 f787bc00 f95b4350 f95b4350 f6009ee8 c0207fca f787bc58 f6009ef8
[  917.192100] Call Trace:
[  917.192100]  [<c01407ee>] ? trace_hardirqs_on+0xb/0xd
[  917.192100]  [<f94fd030>] ? unregister_ieee80211+0xe/0x27 [libipw]
[  917.192100]  [<f95a9d4f>] ? ipw_pci_remove+0x59/0x227 [ipw2200]
[  917.192100]  [<c0207fca>] ? pci_device_remove+0x19/0x39
[  917.192100]  [<c02b93a4>] ? __device_release_driver+0x59/0x9d
[  917.192100]  [<c02b944f>] ? driver_detach+0x67/0x85
[  917.192100]  [<c02b88d6>] ? bus_remove_driver+0x69/0x85
[  917.192100]  [<c02b9878>] ? driver_unregister+0x4d/0x54
[  917.192100]  [<c02081c3>] ? pci_unregister_driver+0x28/0x71
[  917.192100]  [<f95a9cf4>] ? ipw_exit+0x1c/0x1e [ipw2200]
[  917.192100]  [<c0148e2b>] ? sys_delete_module+0x192/0x1ef
[  917.192100]  [<c0162cdb>] ? remove_vma+0x52/0x58
[  917.192100]  [<c01028bb>] ? sysenter_exit+0xf/0x18
[  917.192100]  [<c0102888>] ? sysenter_do_call+0x12/0x36
[  917.192100] Code: 74 07 e8 81 bc 8c c7 eb c8 8d 55 e0 89 f8 e8 d6 6d 66 c7 8b 45 dc 31 d2 e8 81 cc 8c c7 8d 86 c4 00 00 00 39 86 c4 00 00 00 74 04 <0f> 0b eb fe 8b 45 dc 8d 5e 0c e8 5a cc 8c c7 8b 86 94 03 00 00
[  917.192100] EIP: [<f8accf34>] wiphy_unregister+0xd3/0x175 [cfg80211] SS:ESP 0068:f6009e8c
[  917.203718] ---[ end trace bcaaf449945a5100 ]---

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMerge branch 'linux-2.6.33.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
David S. Miller [Fri, 6 Nov 2009 13:01:54 +0000 (05:01 -0800)]
Merge branch 'linux-2.6.33.y' of git://git./linux/kernel/git/inaky/wimax

14 years agoieee802154: add support for creation/removal of logic interfaces
Dmitry Eremin-Solenikov [Thu, 5 Nov 2009 13:56:23 +0000 (16:56 +0300)]
ieee802154: add support for creation/removal of logic interfaces

Add support for two more NL802154 commands: ADD_IFACE and DEL_IFACE,
thus allowing creation and removal of logic WPAN interfaces on the top
of wpan-phy.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: add PHY_NAME to LIST_IFACE command results
Dmitry Eremin-Solenikov [Thu, 29 Oct 2009 13:28:52 +0000 (16:28 +0300)]
ieee802154: add PHY_NAME to LIST_IFACE command results

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: add two nl802154 helpers
Dmitry Eremin-Solenikov [Wed, 4 Nov 2009 15:05:38 +0000 (18:05 +0300)]
ieee802154: add two nl802154 helpers

Add two nl802154 helpers: one for starting a reply message, one for sending.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agofakehard: mlme_ops->get_phy implementation
Dmitry Eremin-Solenikov [Wed, 4 Nov 2009 14:53:40 +0000 (17:53 +0300)]
fakehard: mlme_ops->get_phy implementation

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: add an mlme_ops call to retrieve PHY object
Dmitry Eremin-Solenikov [Wed, 4 Nov 2009 14:53:23 +0000 (17:53 +0300)]
ieee802154: add an mlme_ops call to retrieve PHY object

ops->get_phy should increment reference to wpan-phy. As we return
the external structure, we should do refcounting correctly.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agofakehard: claim all 2.4 Ghz channels as supported
Dmitry Eremin-Solenikov [Tue, 22 Sep 2009 11:31:25 +0000 (15:31 +0400)]
fakehard: claim all 2.4 Ghz channels as supported

Make fakehard device claim all 2.4 Ghz channels from 802.15.4-2006,
802.15.4a-2007 as supported by the hw.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agofakehard: no need to export net_to_phy, make it static
Dmitry Eremin-Solenikov [Thu, 29 Oct 2009 13:32:46 +0000 (16:32 +0300)]
fakehard: no need to export net_to_phy, make it static

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: add LIST_PHY command support
Dmitry Eremin-Solenikov [Tue, 15 Sep 2009 13:04:44 +0000 (17:04 +0400)]
ieee802154: add LIST_PHY command support

Add nl802154 command to get information about PHY's present in
the system.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: split away MAC commands implementation
Dmitry Eremin-Solenikov [Mon, 14 Sep 2009 14:17:36 +0000 (18:17 +0400)]
ieee802154: split away MAC commands implementation

Move all mac-related stuff to separate file so that ieee802154/netlink.c
contains only generic code.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: merge nl802154 and wpan-class in single module
Dmitry Eremin-Solenikov [Thu, 10 Sep 2009 13:50:12 +0000 (17:50 +0400)]
ieee802154: merge nl802154 and wpan-class in single module

There is no real need to have ieee802154 interfaces separate
into several small modules, as neither of them has it's own use.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoieee802154: constify struct net_device in some operations
Dmitry Eremin-Solenikov [Fri, 2 Oct 2009 15:05:00 +0000 (19:05 +0400)]
ieee802154: constify struct net_device in some operations

Some of ieee802154 operations really shouldn't change passed net_device.
Constify passed argument.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: follow usual patter of devices registration
Dmitry Eremin-Solenikov [Mon, 28 Sep 2009 15:01:20 +0000 (19:01 +0400)]
wpan-phy: follow usual patter of devices registration

Follow the usual pattern of devices registration by adding new function
(wpan_phy_set_dev) that sets child->parent relationship and removing
parent argument from wpan_phy_register call.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: allow specifying a per-page channel mask
Dmitry Eremin-Solenikov [Tue, 22 Sep 2009 11:26:48 +0000 (15:26 +0400)]
wpan-phy: allow specifying a per-page channel mask

IEEE 802.15.4-2006 defines channel pages that hold channels (max 32 pages,
27 channels per page). Allow the driver to specify supported channels
on pages, other than the first one.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: use snprintf to limit the amount of chars written
Dmitry Eremin-Solenikov [Mon, 28 Sep 2009 14:58:32 +0000 (18:58 +0400)]
wpan-phy: use snprintf to limit the amount of chars written

Use snprintf to limit the amount of chars put in the buffer for attr -> show.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: init channel/page fields
Dmitry Eremin-Solenikov [Fri, 18 Sep 2009 12:35:06 +0000 (16:35 +0400)]
wpan-phy: init channel/page fields

Set page to zero (for compatibility w/ devices supporting only first page).
Also init channel by default to -1 to disallow transfers for non-initialised
devices.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: add wpan-phy iteration functions
Dmitry Eremin-Solenikov [Tue, 15 Sep 2009 12:57:04 +0000 (16:57 +0400)]
wpan-phy: add wpan-phy iteration functions

Add API to iterate over the wpan-phy instances.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agowpan-phy: add a helper to put the wpan_phy device
Dmitry Eremin-Solenikov [Mon, 14 Sep 2009 14:11:03 +0000 (18:11 +0400)]
wpan-phy: add a helper to put the wpan_phy device

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 6 Nov 2009 08:55:55 +0000 (00:55 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/usb/cdc_ether.c

All CDC ethernet devices of type USB_CLASS_COMM need to use
'&mbm_info'.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodecnet: netdevice refcount leak
Eric Dumazet [Fri, 6 Nov 2009 08:50:39 +0000 (00:50 -0800)]
decnet: netdevice refcount leak

While working on device refcount stuff, I found a device refcount leak
through DECNET.
This nasty bug can be used to hold refcounts on any !DECNET netdevice.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetfilter: nf_nat: fix NAT issue in 2.6.30.4+
Jozsef Kadlecsik [Fri, 6 Nov 2009 08:43:42 +0000 (00:43 -0800)]
netfilter: nf_nat: fix NAT issue in 2.6.30.4+

Vitezslav Samel discovered that since 2.6.30.4+ active FTP can not work
over NAT. The "cause" of the problem was a fix of unacknowledged data
detection with NAT (commit a3a9f79e361e864f0e9d75ebe2a0cb43d17c4272).
However, actually, that fix uncovered a long standing bug in TCP conntrack:
when NAT was enabled, we simply updated the max of the right edge of
the segments we have seen (td_end), by the offset NAT produced with
changing IP/port in the data. However, we did not update the other parameter
(td_maxend) which is affected by the NAT offset. Thus that could drift
away from the correct value and thus resulted breaking active FTP.

The patch below fixes the issue by *not* updating the conntrack parameters
from NAT, but instead taking into account the NAT offsets in conntrack in a
consistent way. (Updating from NAT would be more harder and expensive because
it'd need to re-calculate parameters we already calculated in conntrack.)

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: Fix CQE_STATUS_EXTD_SHIFT define
Sathya Perla [Fri, 6 Nov 2009 08:31:01 +0000 (00:31 -0800)]
be2net: Fix CQE_STATUS_EXTD_SHIFT define

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix build warning in sock_bindtodevice().
David S. Miller [Fri, 6 Nov 2009 06:37:11 +0000 (22:37 -0800)]
net: Fix build warning in sock_bindtodevice().

net/core/sock.c: In function 'sock_setsockopt':
net/core/sock.c:396: warning: 'index' may be used uninitialized in this function
net/core/sock.c:396: note: 'index' was declared here

GCC can't see that all paths initialize index, so just
set it to the default (0) and eliminate the specific
code block that handles the null device name string.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopktgen: tx_bytes might be slightly wrong
Eric Dumazet [Fri, 6 Nov 2009 05:04:32 +0000 (21:04 -0800)]
pktgen: tx_bytes might be slightly wrong

cur_pkt_size can be changed in proc fs while pktgen is running,
we better use a private field to get precise tx-bytes counter.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: sock_bindtodevice() RCU-ification
Eric Dumazet [Fri, 6 Nov 2009 05:03:39 +0000 (21:03 -0800)]
net: sock_bindtodevice() RCU-ification

Avoid dev_hold()/dev_put() in sock_bindtodevice()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoip_frag: dont touch device refcount
Eric Dumazet [Fri, 6 Nov 2009 04:59:47 +0000 (20:59 -0800)]
ip_frag: dont touch device refcount

When sending fragmentation expiration ICMP V4/V6 messages,
we can avoid touching device refcount, thanks to RCU

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet_cls: Use __dev_get_by_index()
Eric Dumazet [Fri, 6 Nov 2009 04:57:26 +0000 (20:57 -0800)]
net_cls: Use __dev_get_by_index()

We hold RTNL in tc_dump_tfilter(), we can avoid dev_hold()/dev_put()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosctp: ipv6: avoid touching device refcount
Eric Dumazet [Fri, 6 Nov 2009 04:56:46 +0000 (20:56 -0800)]
sctp: ipv6: avoid touching device refcount

Avoid touching device refcount in sctp/ipv6, thanks to RCU

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetlabel: remove dev_put() calls
Eric Dumazet [Fri, 6 Nov 2009 04:53:47 +0000 (20:53 -0800)]
netlabel: remove dev_put() calls

Use dev_get_by_name_rcu() to avoid dev_put() calls,
in sections already inside a rcu_read_lock()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: remove dev_put() in add_del_if()
Eric Dumazet [Fri, 6 Nov 2009 04:47:35 +0000 (20:47 -0800)]
bridge: remove dev_put() in add_del_if()

add_del_if() is called with RTNL, we can use __dev_get_by_index()
instead of [dev_get_by_index() + dev_put()]

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: check kern before calling security subsystem
Eric Paris [Fri, 6 Nov 2009 04:45:52 +0000 (20:45 -0800)]
net: check kern before calling security subsystem

Before calling capable(CAP_NET_RAW) check if this operations is on behalf
of the kernel or on behalf of userspace.  Do not do the security check if
it is on behalf of the kernel.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: pass kern to net_proto_family create function
Eric Paris [Fri, 6 Nov 2009 06:18:14 +0000 (22:18 -0800)]
net: pass kern to net_proto_family create function

The generic __sock_create function has a kern argument which allows the
security system to make decisions based on if a socket is being created by
the kernel or by userspace.  This patch passes that flag to the
net_proto_family specific create function, so it can do the same thing.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: drop capability from protocol definitions
Eric Paris [Fri, 6 Nov 2009 04:44:37 +0000 (20:44 -0800)]
net: drop capability from protocol definitions

struct can_proto had a capability field which wasn't ever used.  It is
dropped entirely.

struct inet_protosw had a capability field which can be more clearly
expressed in the code by just checking if sock->type = SOCK_RAW.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agorose: device refcount leak
Eric Dumazet [Fri, 6 Nov 2009 04:56:07 +0000 (20:56 -0800)]
rose: device refcount leak

While hunting dev_put() for net-next-2.6, I found a device refcount
leak in ROSE, ioctl(SIOCADDRT) error path.

Fix is to not touch device refcount, as we hold RTNL

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: prevent bridging wrong device
Stephen Hemminger [Fri, 6 Nov 2009 04:46:52 +0000 (20:46 -0800)]
bridge: prevent bridging wrong device

The bridge code assumes ethernet addressing, so be more strict in
the what is allowed. This showed up when GRE had a bug and was not
using correct address format.

Add some more comments for increased clarity.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: version 1.52.1-3
Yaniv Rosner [Fri, 6 Nov 2009 04:00:59 +0000 (20:00 -0800)]
bnx2x: version 1.52.1-3

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Fix register access timeout in 10M
Yaniv Rosner [Thu, 5 Nov 2009 17:18:32 +0000 (19:18 +0200)]
bnx2x: Fix register access timeout in 10M

In BCM8481 when link speed goes from 1G to 10M, driver received timeout
since the MAC clock hasn't synced yet with the new speed, so it is required
first to program the MAC with the new speed, and only then configure other
parameters

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Fix 10G mode in BCM8481/BCM84823
Yaniv Rosner [Thu, 5 Nov 2009 17:18:30 +0000 (19:18 +0200)]
bnx2x: Fix 10G mode in BCM8481/BCM84823

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Fix BCM8726 ROM load seq
Yaniv Rosner [Thu, 5 Nov 2009 17:18:26 +0000 (19:18 +0200)]
bnx2x: Fix BCM8726 ROM load seq

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Add support for BCM84823
Yaniv Rosner [Thu, 5 Nov 2009 17:18:23 +0000 (19:18 +0200)]
bnx2x: Add support for BCM84823

Add support for new phy type BCM84823 (Dual copper-port phy)

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Modify BCM8706 link init seq
Yaniv Rosner [Thu, 5 Nov 2009 17:18:21 +0000 (19:18 +0200)]
bnx2x: Modify BCM8706 link init seq

Modify BCM8706 link initialization sequence so that first it link up
between Serdes and BCM8706, and only then between BCM8706 to network

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Enable FC when parallel-detect is used
Yaniv Rosner [Thu, 5 Nov 2009 17:18:12 +0000 (19:18 +0200)]
bnx2x: Enable FC when parallel-detect is used

When parallel detect is used, flow-control is set to the
req_fc_auto_adv instead of none.

Motive: when 577xx is FC configuration is set to AUTO, while LP speed
is set to FORCE mode and FC to force RX/TX, link would come up using
parallel detect, and the FC will be set to NONE since FC capabilities
were not negotiated, although the LP is setting FC to force RX/TX.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Miscellaneous debug print and tabs
Yaniv Rosner [Thu, 5 Nov 2009 17:18:10 +0000 (19:18 +0200)]
bnx2x: Miscellaneous debug print and tabs

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Fix CL73 autoneg issues
Yaniv Rosner [Thu, 5 Nov 2009 17:18:07 +0000 (19:18 +0200)]
bnx2x: Fix CL73 autoneg issues

- Advertise 1G KX4 in CL73 when 1G speed capability is enabled
- Add flow-control negotiation over CL73
- External loopback test on Serdes should be done in FORCE mode, since in
CL73 it is unable to link up with the same core using AUTONEG
- Fix bnx2x_set_led function to support CL73 link leds

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>