platform/adaptation/renesas_rcar/renesas_kernel.git
16 years agoiwlwifi: move HW device registration
Ron Rindjunsky [Tue, 15 Apr 2008 23:01:41 +0000 (16:01 -0700)]
iwlwifi: move HW device registration

This patch moves the HW device registration from the iwl-4965.c file, which
implies a HW specific support, to a more general location.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: move the creation of LQ host command to iwlcore
Tomas Winkler [Tue, 15 Apr 2008 23:01:40 +0000 (16:01 -0700)]
iwlwifi: move the creation of LQ host command to iwlcore

This patch moves creation of LQ host command to iwlcore
from previous location in rate scaling.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: support different num of tx and rx antennas
Tomas Winkler [Tue, 15 Apr 2008 23:01:39 +0000 (16:01 -0700)]
iwlwifi: support different num of tx and rx antennas

This patch adds infrastructure for supporting different
number of tx and rx antennas

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: hw_setting cleanup
Tomas Winkler [Tue, 15 Apr 2008 23:01:38 +0000 (16:01 -0700)]
iwlwifi: hw_setting cleanup

1. This patch renames hw_setting to hw_params
2. Align names of the structure and variables
3. set_hw_params is called from libs_ops

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: remove the statistics work
Emmanuel Grumbach [Tue, 15 Apr 2008 23:01:37 +0000 (16:01 -0700)]
iwlwifi: remove the statistics work

This patch does 3 things

1) It removes the statistics work. The request statistics command is
sent in ASYNC mode in this flow, the mutex is uneeded, so the request
statistics function can't go to sleep. No need for a workqueue anymore.

2) iwl4965_send_statistics_request has been renamed to
iwl_send_statistics_request and moved to iwl-core.c

3) A request for statistics is sent in alive_notify, the makes the uCode
sends statistics notification periodically starting from association.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43: Add fastpath to b43_mac_suspend()
Michael Buesch [Tue, 15 Apr 2008 19:13:36 +0000 (21:13 +0200)]
b43: Add fastpath to b43_mac_suspend()

This adds a fastpath for the common workloads to the
MAC suspend flushing.
In common workloads the FIFO flush will take between 100 and
200 microseconds. So we want to avoid calling msleep() in the
common case, as it will waste over 800 microseconds + scheduler
overhead.

This fastpath will hit in workloads where only small chunks
of data are transmitted (downloading a file) or when a TX rate bigger
or equal to 24MBit/s is used when transmitting lots of stuff (iperf).
So in the commonly used workloads it will basically always hit.

In case the fastpath is not hit, there's no real performance or latency
disadvantage from that.

And yes, I measured this. So this is not one of these
bad Programmer Likeliness Assumptions that are always wrong. ;)

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: move shared pointers to iwl_priv
Tomas Winkler [Tue, 15 Apr 2008 04:16:14 +0000 (21:16 -0700)]
iwlwifi: move shared pointers to iwl_priv

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: perform bss_info_changed post association work right away
Reinette Chatre [Tue, 15 Apr 2008 04:16:13 +0000 (21:16 -0700)]
iwlwifi: perform bss_info_changed post association work right away

Do not use workqueue for bss_info_changed post association work.
When driver is notified of association the upper layer will be notified
right after that the association is complete. Doing the post association
work in a workqueue introduces a race condition where the upper layer may
want to make use of the association, but it is not yet complete.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: make Makefile more concise
Reinette Chatre [Tue, 15 Apr 2008 04:16:12 +0000 (21:16 -0700)]
iwlwifi: make Makefile more concise

Also change CONFIG_IWLCORE_RFKILL to CONFIG_IWLWIFI_RFKILL to
be more consistent with other config variables.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwl4965: make iwl4965_send_rxon_assoc asynchronous
Reinette Chatre [Tue, 15 Apr 2008 04:16:11 +0000 (21:16 -0700)]
iwl4965: make iwl4965_send_rxon_assoc asynchronous

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: Fix byte count table for fragmented packets
Tomas Winkler [Tue, 15 Apr 2008 04:16:10 +0000 (21:16 -0700)]
iwlwifi: Fix byte count table for fragmented packets

This patch fix byte count table update. Table must be updated for each
fragment

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: moves security functions to iwl-sta.c
Emmanuel Grumbach [Tue, 15 Apr 2008 04:16:09 +0000 (21:16 -0700)]
iwlwifi: moves security functions to iwl-sta.c

This patch moves security related functions to iwl-sta.c.
Note that iwl4965_mac_update_tkip_key is still in iwl4965-base.c since it
is a mac80211 handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: maintain uCode key table state
Emmanuel Grumbach [Tue, 15 Apr 2008 04:16:08 +0000 (21:16 -0700)]
iwlwifi: maintain uCode key table state

This patch fix book keeping of key table in the driver
to be synchronized with uCode

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: add 1X HW WEP support
Emmanuel Grumbach [Tue, 15 Apr 2008 04:16:07 +0000 (21:16 -0700)]
iwlwifi: add 1X HW WEP support

This patch adds support for HW encryption/decryption in 1X WEP.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: default WEP HW encryption
Emmanuel Grumbach [Tue, 15 Apr 2008 04:16:06 +0000 (21:16 -0700)]
iwlwifi: default WEP HW encryption

This patch adds HW encryption support in default WEP mode.
When no key mapping key/pairwise key is used. The key is broadcast key
is used as default/global/static key.
This code assumes that group cast key is added after pairwise key.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: add default WEP key host command
Emmanuel Grumbach [Tue, 15 Apr 2008 04:16:05 +0000 (21:16 -0700)]
iwlwifi: add default WEP key host command

This patch adds declaration for static WEP host command. This command will
be used for default WEP group keys when no key mapping keys are used.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: replace sprintf with scnprintf for debugfs output
Abhijeet Kolekar [Tue, 15 Apr 2008 04:16:04 +0000 (21:16 -0700)]
iwlwifi: replace sprintf with scnprintf for debugfs output

The buffersize allocated is not accurate.
Writing to these buffers with scnprintf is safer.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoiwlwifi: generalize iwlwifi init flow
Tomas Winkler [Tue, 15 Apr 2008 04:16:03 +0000 (21:16 -0700)]
iwlwifi: generalize iwlwifi init flow

This patch creates handlers to support
iwlwifi init flow for multiple HWs

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: allow WDS mode
Johannes Berg [Mon, 14 Apr 2008 13:37:03 +0000 (15:37 +0200)]
mac80211: allow WDS mode

This allows creating interfaces in WDS mode or switching
existing ones into WDS mode (both via cfg80211 and wext.)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agob43legacy: fix TBTT and PU timings
Stefano Brivio [Sun, 13 Apr 2008 22:57:03 +0000 (00:57 +0200)]
b43legacy: fix TBTT and PU timings

This fixes some timings for pre-TBTT and synthetic PU.
The patch by Michael Buesch has been ported to b43legacy.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix key todo list order
Johannes Berg [Sun, 13 Apr 2008 08:43:50 +0000 (10:43 +0200)]
mac80211: fix key todo list order

When we add multiple todo entries, we rely on them being executed
mostly in the right order, especially when a key is being replaced.
But when a default key is replaced, the todo list order will differ
from the order when the key being replaced is not a default key, so
problems will happen. Hence, just move each todo item to the end of
the list when it is added so we can in the other code ensure that
hw accel for a key will be disabled before it is enabled for the
replacement.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix spinlock recursion
Johannes Berg [Fri, 11 Apr 2008 19:40:35 +0000 (21:40 +0200)]
mac80211: fix spinlock recursion

When STAs are expired, we need to hold the sta_lock. Using
the same lock for keys too would then mean we'd need another
key free function, and that'll just lead to confusion, so just
use a new spinlock for all key lists.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agoproc: switch /proc/driver/ray_cs/ray_cs to seq_file interface
Alexey Dobriyan [Thu, 10 Apr 2008 21:34:35 +0000 (14:34 -0700)]
proc: switch /proc/driver/ray_cs/ray_cs to seq_file interface

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: no BSS changes to driver from beacons processed during scanning
Reinette Chatre [Wed, 9 Apr 2008 23:56:15 +0000 (16:56 -0700)]
mac80211: no BSS changes to driver from beacons processed during scanning

There is no need to send BSS changes to driver from beacons processed
during scanning. We are more interested in beacons from an AP with which
we are associated - these will still be used to send updates to driver as
the beacons are received without scanning.

This change·removes the requirement that bss_info_changed needs to be atomic.
The beacons received during scanning are processed from a tasklet, but if we
do not call bss_info_changed for these beacons there is no need for it to be
atomic. This function (bss_info_changed) is called either from workqueue or
ioctl in all other instances.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: un-garbage various command structs
Holger Schurig [Wed, 9 Apr 2008 08:23:31 +0000 (10:23 +0200)]
libertas: un-garbage various command structs

Some command structs contain reserved or unused fields, which the driver
send uninitialized down to the card.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agolibertas: convert libertas driver to use an event/cmdresp queue
Holger Schurig [Tue, 1 Apr 2008 12:50:43 +0000 (14:50 +0200)]
libertas: convert libertas driver to use an event/cmdresp queue

This patch (co-developed by Dan Williams and Holger Schurig) uses a kfifo
object for events and a swapping buffer scheme for the command response to
preserve the zero-copy semantics of the CF driver and keep memory usage low.
The main thread should only ever touch the buffer indexed by priv->resp_idx,
while the interface code is free to write to the second buffer, then swap
priv->resp_idx under the driver spinlock.  The firmware specs only permit
one in-flight command, so there will only ever be one command response to
process at a time.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: further RCU fixes
Johannes Berg [Thu, 10 Apr 2008 13:36:09 +0000 (15:36 +0200)]
mac80211: further RCU fixes

There were a few more instances of sta_info_get calls not being
protected by RCU, fix them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agort2x00: Only free skb when beacon_update fails
Ivo van Doorn [Wed, 9 Apr 2008 18:46:27 +0000 (20:46 +0200)]
rt2x00: Only free skb when beacon_update fails

In rt2x00lib_intf_scheduled_iter() we use the hw->beacon_update()
callback function. This means that it should behave similarly as mac80211
when that uses the function.

This means that the skb should only be freed when beacon_update() has failed,
otherwise the driver is the owner and is responsible for freeing the buffer.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomac80211: fix key hwaccel race
Johannes Berg [Wed, 9 Apr 2008 14:45:37 +0000 (16:45 +0200)]
mac80211: fix key hwaccel race

The previous key locking patch left a small race: it would be possible
to add a key and take the interface down before the key todo is run so
that hwaccel for that key is enabled on an interface that is down. Avoid
this by running the todo list when an interface is brought up or down.

This patch also fixes a small bug: before this change, a few functions
used the key list without the lock that protects it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agossb-pcicore: Remove b44 TPS flag workaround
Michael Buesch [Tue, 8 Apr 2008 08:31:22 +0000 (10:31 +0200)]
ssb-pcicore: Remove b44 TPS flag workaround

Now that we fixed the TPS flag assignment in commit
b63009b456c8d9abe684bdf8d4bd8f27eb040019
we don't need the workaround for the bcm44xx chip anymore.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years agomlme.c: fixup some merge damage
John W. Linville [Tue, 15 Apr 2008 18:09:27 +0000 (14:09 -0400)]
mlme.c: fixup some merge damage

This one got renamed, complicating the merge a bit...this should restore
it to its intended state.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
16 years ago[TCP]: Increase the max_burst threshold from 3 to tp->reordering.
John Heffner [Tue, 15 Apr 2008 22:26:39 +0000 (15:26 -0700)]
[TCP]: Increase the max_burst threshold from 3 to tp->reordering.

This change is necessary to allow cwnd to grow during persistent
reordering.  Cwnd moderation is applied when in the disorder state
and an ack that fills the hole comes in.  If the hole was greater
than 3 packets, but less than tp->reordering, cwnd will shrink when
it should not have.

Signed-off-by: John Heffner <jheffner@napa.(none)>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Do not allocate unneeded memory for dev->priv alignment.
Pavel Emelyanov [Wed, 16 Apr 2008 09:17:42 +0000 (02:17 -0700)]
[NET]: Do not allocate unneeded memory for dev->priv alignment.

The alloc_netdev_mq() tries to produce 32-bytes alignment for both
the net_device itself and its private data. The second alignment is
achieved by adding the NETDEV_ALIGN_CONST to the whole size of
the memory to be allocated.

However, for those devices that do not need the private area, this
addition just makes the net_device weight 1024 + 32 = 1068 bytes,
i.e. consume twice as much memory.

Since loopback device is such (sizeof_priv == 0 for it), and each
net namespace creates one, this can save a noticeable amount of
memory for kernel with net namespaces turned on.

After this set the lo device is actually allocated from a size-1024
kmem cache on i386 box even with NETPOLL and WIRELESS_EXT turned on.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for network devices.
Denis V. Lunev [Wed, 16 Apr 2008 09:02:18 +0000 (02:02 -0700)]
[NETNS]: Add netns refcnt debug for network devices.

dev_set_net is called for
- just allocated devices
- devices moving from one namespace to another
release_net has proper check inside to distinguish these cases.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug to fib rules.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:56 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug to fib rules.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for dst ops.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:34 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug for dst ops.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for inet bind buckets.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:11 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug for inet bind buckets.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug into fib_info.
Denis V. Lunev [Wed, 16 Apr 2008 09:00:50 +0000 (02:00 -0700)]
[NETNS]: Add netns refcnt debug into fib_info.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for timewait buckets.
Denis V. Lunev [Wed, 16 Apr 2008 09:00:28 +0000 (02:00 -0700)]
[NETNS]: Add netns refcnt debug for timewait buckets.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for kernel sockets.
Denis V. Lunev [Wed, 16 Apr 2008 08:59:46 +0000 (01:59 -0700)]
[NETNS]: Add netns refcnt debug for kernel sockets.

Protocol control sockets and netlink kernel sockets should not prevent the
namespace stop request. They are initialized and disposed in a special way by
sk_change_net/sk_release_kernel.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Make netns refconting debug like a socket one.
Denis V. Lunev [Wed, 16 Apr 2008 08:58:04 +0000 (01:58 -0700)]
[NETNS]: Make netns refconting debug like a socket one.

Make release_net/hold_net noop for performance-hungry people. This is a debug
staff and should be used in the debug mode only.

Add check for net != NULL in hold/release calls. This will be required
later on.

[ Added minor simplifications suggested by Brian Haley. -DaveM ]

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:24:13 +0000 (01:24 -0700)]
[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.

And no need in some IPPROTO_XXX enabling, since ipv6 code
doesn't have any filtering.

So, just set proper net and mark device with NETNS_LOCAL.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Use proper net instead of init_net stubs.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:44 +0000 (01:23 -0700)]
[IP6TUNNEL]: Use proper net instead of init_net stubs.

All the ip_route_output_key(), dev_get_by_...() and ipv6_chk_addr()
calls are now stubbed with init_net.

Fortunately, all the places already have where to get the proper
net from.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:22 +0000 (01:23 -0700)]
[IP6TUNNEL]: Make tunnels hashes per-net.

Move hashes in the struct ip6_tnl_net, replace tnls_xxx[] with
ip6n->tnlx_xxx[] and handle init and exit appropriately.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:02 +0000 (01:23 -0700)]
[IP6TUNNEL]: Make the fallback tunnel device per-net.

All the code, that reference it already has the ip6_tnl_net pointer,
so s/ip6_fb_tnl_dev/ip6n->fb_tnl_dev/ and move creation/releasing
code into net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:43 +0000 (01:22 -0700)]
[IP6TUNNEL]: Use proper net in hash-lookup functions.

Calls to ip6_tnl_lookup were stubbed with init_net - give them
a proper one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Add (ip6_tnl_)net argument to some calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:23 +0000 (01:22 -0700)]
[IP6TUNNEL]: Add (ip6_tnl_)net argument to some calls.

Hashes and fallback device used in them will be per-net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Introduce empty ip6_tnl_net structure and net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:02 +0000 (01:22 -0700)]
[IP6TUNNEL]: Introduce empty ip6_tnl_net structure and net ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Allow for IPPROTO_IPV6 protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:17:39 +0000 (01:17 -0700)]
[SIT]: Allow for IPPROTO_IPV6 protocol in namespaces.

This makes sit-generated traffic enter the namespace.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Allow to create SIT tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:17:18 +0000 (01:17 -0700)]
[SIT]: Allow to create SIT tunnels in net namespaces.

Set proper net and mark a new device as NETNS_LOCAL before registering.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Use proper net in routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:58 +0000 (01:16 -0700)]
[SIT]: Use proper net in routing calls.

I.e. replace init_net stubs in ip_route_output_key() calls.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:38 +0000 (01:16 -0700)]
[SIT]: Make tunnels hashes per-net.

Just move all the hashes on the sit_net structure and
patch the rest of the code appropriately.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Make the fallback tunnel device per-net
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:18 +0000 (01:16 -0700)]
[SIT]: Make the fallback tunnel device per-net

Allocate and register one in sit_init_net, use sitn->fb_tunnel_dev
over the code and unregister one in sit_exit_net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:59 +0000 (01:15 -0700)]
[SIT]: Use proper net in hash-lookup functions.

Replace introduced in the previous patch init_net stubs
with the proper net pointer.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Add net/sit_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:39 +0000 (01:15 -0700)]
[SIT]: Add net/sit_net argument to some functions.

... to make them prepared for future hashes and fallback device
move on the struct sit_net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Introduce empty struct sit_net and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:17 +0000 (01:15 -0700)]
[SIT]: Introduce empty struct sit_net and init/exit net ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Allow for IPPROTO_GRE protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:11:36 +0000 (01:11 -0700)]
[GRE]: Allow for IPPROTO_GRE protocol in namespaces.

This one was also disabled by default for sanity.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Allow to create IPGRE tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:11:13 +0000 (01:11 -0700)]
[GRE]: Allow to create IPGRE tunnels in net namespaces.

I.e. set the proper net and mark as NETNS_LOCAL.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Use proper net in routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:44 +0000 (01:10 -0700)]
[GRE]: Use proper net in routing calls.

As for the IPIP tunnel, there are some ip_route_output_key()
calls in there that require a proper net so give one to them.

And a proper net for the __get_dev_by_index hanging around.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:26 +0000 (01:10 -0700)]
[GRE]: Make tunnels hashes per-net.

Very similar to what was done for the IPIP code.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:05 +0000 (01:10 -0700)]
[GRE]: Make the fallback tunnel device per-net.

Everything is prepared for this change now. Create on in
init callback, use it over the code and destroy on net exit.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:09:44 +0000 (01:09 -0700)]
[GRE]: Use proper net in hash-lookup functions.

This is the part#2 of the patch #2 - get the proper net for
these functions. This change in a separate patch in order not
to get lost in a large previous patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Add net/gre_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:09:22 +0000 (01:09 -0700)]
[GRE]: Add net/gre_net argument to some functions.

The fallback device and hashes are to become per-net, but many
code doesn't have anything to get the struct net pointer from.

So pass the proper net there with an extra argument.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Introduce empty ipgre_net structure and net init/exit ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:08:53 +0000 (01:08 -0700)]
[GRE]: Introduce empty ipgre_net structure and net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Allow for IPPROTO_IPIP protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:06:56 +0000 (01:06 -0700)]
[IPIP]: Allow for IPPROTO_IPIP protocol in namespaces.

This one was disabled by default for sanity.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Allow to create IPIP tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:06:18 +0000 (01:06 -0700)]
[IPIP]: Allow to create IPIP tunnels in net namespaces.

Set the proper net before calling register_netdev and disable
the tunnel device netns changing.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Use proper net in (mostly) routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:57 +0000 (01:05 -0700)]
[IPIP]: Use proper net in (mostly) routing calls.

There are some ip_route_output_key() calls in there that require
a proper net so give one to them.

Besides - give a proper net to a single __get_dev_by_index call
in ipip_tunnel_bind_dev().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Make tunnels hashes per net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:32 +0000 (01:05 -0700)]
[IPIP]: Make tunnels hashes per net.

Either net or ipip_net already exists in all the required
places, so just use one.

Besides, tune net_init and net_exit calls to respectively
initialize the hashes and destroy devices.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:03 +0000 (01:05 -0700)]
[IPIP]: Use proper net in hash-lookup functions.

This is the part#2 of the previous patch - get the proper
net for these functions.

I make it in a separate patch, so that this change does not
get lost in a large previous patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Add net/ipip_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:04:35 +0000 (01:04 -0700)]
[IPIP]: Add net/ipip_net argument to some functions.

The hashes of tunnels will be per-net too, so prepare all the
functions that uses them for this change by adding an argument.

Use init_net temporarily in places, where the net does not exist
explicitly yet.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:04:13 +0000 (01:04 -0700)]
[IPIP]: Make the fallback tunnel device per-net.

Create on in ipip_init_net(), use it all over the code (the
proper place to get the net from already exists) and destroy
in ipip_net_exit().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Introduce empty ipip_net structure and net init/exit ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:03:13 +0000 (01:03 -0700)]
[IPIP]: Introduce empty ipip_net structure and net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Handle vlan devices net namespace changing.
Pavel Emelyanov [Wed, 16 Apr 2008 07:57:01 +0000 (00:57 -0700)]
[VLAN]: Handle vlan devices net namespace changing.

When van device is moved to another namespace proc files,
related to this device, should also change one.

Use the netdev REGISTER and UNREGISTER event handlers for this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Allow vlan devices registration in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 07:55:06 +0000 (00:55 -0700)]
[VLAN]: Allow vlan devices registration in net namespaces.

This one is similar to what I've done for TUN - set the proper
net after device allocation and clean VLANs on net exit (use the
rtnl_kill_links helper finally).

Plus, drop explicit init_net usage and net != &init_net checks.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Make the vlan_name_type per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:54:39 +0000 (00:54 -0700)]
[VLAN]: Make the vlan_name_type per-net.

This includes moving one on the struct vlan_net and
s/vlan_name_type/vn->name_type/ over the code.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Make the /proc/net/vlan/conf file show per-net info.
Pavel Emelyanov [Wed, 16 Apr 2008 07:52:24 +0000 (00:52 -0700)]
[VLAN]: Make the /proc/net/vlan/conf file show per-net info.

It is created in a proper net, so make is show info, related
to this particular net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Create proc entries in the proper net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:51:51 +0000 (00:51 -0700)]
[VLAN]: Create proc entries in the proper net.

The proc_vlan_dir and proc_vlan_conf migrate on the struct
vlan_net and their creation uses the struct net.

The devices' entries use the corresponding device's net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Add a net argument to proc init and cleanup calls.
Pavel Emelyanov [Wed, 16 Apr 2008 07:51:12 +0000 (00:51 -0700)]
[VLAN]: Add a net argument to proc init and cleanup calls.

All proc files will be created in each net, so prepare them for
this change now, not to mess it with real creation patch.

The net != &init_net checks in them are for git-bisect sanity,
but I will drop them soon.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Introduce the vlan_net structure and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 07:49:09 +0000 (00:49 -0700)]
[VLAN]: Introduce the vlan_net structure and init/exit net ops.

Unlike TUN, it is empty from the very beginning, and will
be eventually populated later.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Tag vlan_group_device with net device, not ifindex.
Pavel Emelyanov [Wed, 16 Apr 2008 07:48:04 +0000 (00:48 -0700)]
[VLAN]: Tag vlan_group_device with net device, not ifindex.

Currently vlan group is searched using one key - the ifindex.
We'll have to lookup the vlan_group by two keys - ifindex and
net. Turning the vlan_group lookup key to struct net_device
pointer will make this process easier.

Besides, this will eliminate one more place in the networking,
that assumes that indexes are unique in the kernel.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RTNL]: Introduce the rtnl_kill_links helper.
Pavel Emelyanov [Wed, 16 Apr 2008 07:46:52 +0000 (00:46 -0700)]
[RTNL]: Introduce the rtnl_kill_links helper.

This one is responsible for calling ->dellink on each net
device found in net to help with vlan net_exit hook in the
nearest future.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.
Pavel Emelyanov [Wed, 16 Apr 2008 07:45:56 +0000 (00:45 -0700)]
[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.

Each potential list_del (happening from inside a ->dellink call)
is followed by goto restart, so there's no need in _safe iteration.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Allow to register tun devices in namespace.
Pavel Emelyanov [Wed, 16 Apr 2008 07:41:53 +0000 (00:41 -0700)]
[TUN]: Allow to register tun devices in namespace.

This is basically means that a net is set for a new device, but
actually also involves two more steps:

1. mark the tun device as "local", i.e. do not allow for it to
   move across namespaces.

This is done so, since tun device is most often associated to some
file (and thus to some process) and moving the device alone is not
valid while keeping the file and the process outside. The need in
ability to move a detached persistent device is to be investigated
later.

2. get the tun device's net when tun becomes attached and put one
   when it becomes detached.

This is needed to handle the case when a task owning the tun dies,
but a files lives for some more time - in this case we must not
allow for net to be freed, since its exit hook will spoil that file's
private data by unregistering the tun from under tun_chr_close.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Make the tun_dev_list per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:41:16 +0000 (00:41 -0700)]
[TUN]: Make the tun_dev_list per-net.

Remove the static tun_dev_list and replace its occurrences in
driver with per-net one.

It is used in two places - in tun_set_iff and tun_cleanup. In
the first case it's legal to use current net_ns. In the cleanup
call - move the loop, that unregisters all devices in net exit
hook.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Introduce the tun_net structure and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 07:40:46 +0000 (00:40 -0700)]
[TUN]: Introduce the tun_net structure and init/exit net ops.

This is the first step in making tuntap devices work in net
namespaces. The structure mentioned is pointed by generic
net pointer with tun_net_id id, and tun driver fills one on
its load. It will contain only the tun devices list.

So declare this structure and introduce net init and exit hooks.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Remove superflushious skb == write_queue_tail() check
Ilpo Järvinen [Wed, 16 Apr 2008 03:36:55 +0000 (20:36 -0700)]
[TCP]: Remove superflushious skb == write_queue_tail() check

Needed can only be more strict than what was checked by the
earlier common case check for non-tail skbs, thus
cwnd_len <= needed will never match in that case anyway.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ETHTOOL]: Add support for large eeproms
Mandeep Singh Baines [Wed, 16 Apr 2008 02:24:17 +0000 (19:24 -0700)]
[ETHTOOL]: Add support for large eeproms

Currently, it is not possible to read/write to an eeprom larger than
128k in size because the buffer used for temporarily storing the
eeprom contents is allocated using kmalloc. kmalloc can only allocate
a maximum of 128k depending on architecture.

Modified ethtool_get/set_eeprom to only allocate a page of memory and
then copy the eeprom a page at a time.

Updated original patch as per suggestions from Joe Perches.

Signed-off-by: Mandeep Singh Baines <msb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoCAN: use hrtimers in can-bcm protocol
Oliver Hartkopp [Wed, 16 Apr 2008 02:29:14 +0000 (19:29 -0700)]
CAN: use hrtimers in can-bcm protocol

Make use of hrtimers to support high resolution capabilities, when
provided by the system clocksource.

The conversion to hrtimers additionally discovered and solved an
unlikely race condition that has been reproduced under (unrealistic)
massive receive load, which can only be produced on vcan software devices.

[ Fix printf format warnings on 64-bit -DaveM ]

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Enhance validation of format on incoming messages
Allan Stephens [Wed, 16 Apr 2008 02:04:54 +0000 (19:04 -0700)]
[TIPC]: Enhance validation of format on incoming messages

This patch ensures that TIPC properly handles incoming messages
that have incorrect or unexpected formats.  Most significantly,
it now ensures that each sl_buff has at least as much data as
the message header indicates it should, and that the entire
message header is stored contiguously; this prevents TIPC from
accidentally accessing memory that is not part of the sk_buff.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Force linearization of non-linear sk_buffs
Allan Stephens [Wed, 16 Apr 2008 02:03:23 +0000 (19:03 -0700)]
[TIPC]: Force linearization of non-linear sk_buffs

This patch allows TIPC to process incoming messages that are
stored in a fragmented sk_buff, by forcing the linearization
of any such messages it receives.

Note: This is an interim solution to allow TIPC to operate with
Ethernet devices that generate non-linear buffers (such as the
gianfar driver), until such time as the rest of TIPC is enhanced
to handle sk_buffs with multiple data areas.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Use fast buffer cloning to improve performance
Allan Stephens [Wed, 16 Apr 2008 02:02:30 +0000 (19:02 -0700)]
[TIPC]: Use fast buffer cloning to improve performance

This patch causes TIPC to allocate fast clonable sk_buffs,
rather than standard ones.  This speeds up the cloning
operation done by the link code each time a message is sent
off-node.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Remove redundant NULL check when discarding buffers
Allan Stephens [Wed, 16 Apr 2008 02:01:43 +0000 (19:01 -0700)]
[TIPC]: Remove redundant NULL check when discarding buffers

This patch eliminates a null pointer check when discarding a
TIPC message buffer, since kfree_skb() already handles this
situation.

Acknowledgements to Florian Westphal (fw@strlen.de> for
suggesting this enhancement.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: The generic per-net pointers.
Pavel Emelyanov [Tue, 15 Apr 2008 07:36:08 +0000 (00:36 -0700)]
[NETNS]: The generic per-net pointers.

Add the elastic array of void * pointer to the struct net.
The access rules are simple:

 1. register the ops with register_pernet_gen_device to get
    the id of your private pointer
 2. call net_assign_generic() to put the private data on the
    struct net (most preferably this should be done in the
    ->init callback of the ops registered)
 3. do not store any private reference on the net_generic array;
 4. do not change this pointer while the net is alive;
 5. use the net_generic() to get the pointer.

When adding a new pointer, I copy the old array, replace it
with a new one and schedule the old for kfree after an RCU
grace period.

Since the net_generic explores the net->gen array inside rcu
read section and once set the net->gen->ptr[x] pointer never
changes, this grants us a safe access to generic pointers.

Quoting Paul: "... RCU is protecting -only- the net_generic
structure that net_generic() is traversing, and the [pointer]
returned by net_generic() is protected by a reference counter
in the upper-level struct net."

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: The net-subsys IDs generator.
Pavel Emelyanov [Tue, 15 Apr 2008 07:35:23 +0000 (00:35 -0700)]
[NETNS]: The net-subsys IDs generator.

To make some per-net generic pointers, we need some way to address
them, i.e. - IDs. This is simple IDA-based IDs generator for pernet
subsystems.

Addressing questions about potential checkpoint/restart problems:
these IDs are "lite-offsets" within the net structure and are by no
means supposed to be exported to the userspace.

Since it will be used in the nearest future by devices only (tun,
vlan, tunnels, bridge, etc), I make it resemble the functionality
of register_pernet_device().

The new ids is stored in the *id pointer _before_ calling the init
callback to make this id available in this callback.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ISDN] include/linux/isdn.h: remove dead code
Adrian Bunk [Tue, 15 Apr 2008 07:30:16 +0000 (00:30 -0700)]
[ISDN] include/linux/isdn.h: remove dead code

This patch remove the usage of a nonexisting kconfig variable.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IRDA]: Remove irlan_eth_send_gratuitous_arp()
Adrian Bunk [Tue, 15 Apr 2008 07:29:24 +0000 (00:29 -0700)]
[IRDA]: Remove irlan_eth_send_gratuitous_arp()

Even kernel 2.2.26 (sic) already contains the
  #undef CONFIG_IRLAN_SEND_GRATUITOUS_ARP
with the comment "but for some reason the machine crashes if you use DHCP".

Either someone finally looks into this or it's simply time to remove
this dead code.

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[WANPIPE]: Forgotten bits of Sangoma drivers removal.
Adrian Bunk [Tue, 15 Apr 2008 07:27:58 +0000 (00:27 -0700)]
[WANPIPE]: Forgotten bits of Sangoma drivers removal.

Robert P. J. Day spotted that my removal of the Sangoma drivers missed
a few bits.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Overhaul of socket locking logic
Allan Stephens [Tue, 15 Apr 2008 07:22:02 +0000 (00:22 -0700)]
[TIPC]: Overhaul of socket locking logic

This patch modifies TIPC's socket code to follow the same approach
used by other protocols.  This change eliminates the need for a
mutex in the TIPC-specific portion of the socket protocol data
structure -- in its place, the standard Linux socket backlog queue
and associated locking routines are utilized.  These changes fix
a long-standing receive queue bug on SMP systems, and also enable
individual read and write threads to utilize a socket without
unnecessarily interfering with each other.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Cosmetic changes to TIPC connect() code
Allan Stephens [Tue, 15 Apr 2008 07:20:37 +0000 (00:20 -0700)]
[TIPC]: Cosmetic changes to TIPC connect() code

This patch fixes TIPC's connect routine to conform to Linux
kernel style norms of indentation, line length, etc.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TIPC]: Add error check to detect non-blocking form of connect()
Allan Stephens [Tue, 15 Apr 2008 07:16:19 +0000 (00:16 -0700)]
[TIPC]: Add error check to detect non-blocking form of connect()

This patch causes TIPC to return an error indication if the non-
blocking form of connect() is requested (which TIPC does not yet
support).

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>