GitHub/LineageOS/android_kernel_motorola_exynos9610.git
17 years ago[IPSEC]: Lock state when copying non-atomic fields to user-space
Herbert Xu [Tue, 9 Oct 2007 20:31:47 +0000 (13:31 -0700)]
[IPSEC]: Lock state when copying non-atomic fields to user-space

This patch adds locking so that when we're copying non-atomic fields such as
life-time or coaddr to user-space we don't get a partial result.

For af_key I've changed every instance of pfkey_xfrm_state2msg apart from
expiration notification to include the keys and life-times.  This is in-line
with XFRM behaviour.

The actual cases affected are:

* pfkey_getspi: No change as we don't have any keys to copy.
* key_notify_sa:
+ ADD/UPD: This wouldn't work otherwise.
+ DEL: It can't hurt.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[XFRM] user: Move attribute copying code into copy_to_user_state_extra
Herbert Xu [Tue, 9 Oct 2007 20:30:57 +0000 (13:30 -0700)]
[XFRM] user: Move attribute copying code into copy_to_user_state_extra

Here's a good example of code duplication leading to code rot.  The
notification patch did its own netlink message creation for xfrm states.
It duplicated code that was already in dump_one_state.  Guess what, the
next time (and the time after) when someone updated dump_one_state the
notification path got zilch.

This patch moves that code from dump_one_state to copy_to_user_state_extra
and uses it in xfrm_notify_sa too.  Unfortunately whoever updates this
still needs to update xfrm_sa_len since the notification path wants to
know the exact size for allocation.

At least I've added a comment saying so and if someone still forgest, we'll
have a WARN_ON telling us so.

I also changed the security size calculation to use xfrm_user_sec_ctx since
that's what we actually put into the skb.  However it makes no practical
difference since it has the same size as xfrm_sec_ctx.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Move common code into xfrm_alloc_spi
Herbert Xu [Tue, 9 Oct 2007 20:29:52 +0000 (13:29 -0700)]
[IPSEC]: Move common code into xfrm_alloc_spi

This patch moves some common code that conceptually belongs to the xfrm core
from af_key/xfrm_user into xfrm_alloc_spi.

In particular, the spin lock on the state is now taken inside xfrm_alloc_spi.
Previously it also protected the construction of the response PF_KEY/XFRM
messages to user-space.  This is inconsistent as other identical constructions
are not protected by the state lock.  This is bad because they in fact should
be protected but only in certain spots (so as not to hold the lock for too
long which may cause packet drops).

The SPI byte order conversion has also been moved.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Remove gratuitous km wake-up events on ACQUIRE
Herbert Xu [Tue, 9 Oct 2007 20:27:27 +0000 (13:27 -0700)]
[IPSEC]: Remove gratuitous km wake-up events on ACQUIRE

There is no point in waking people up when creating/updating larval states
because they'll just go back to sleep again as larval states by definition
cannot be found by xfrm_state_find.

We should only wake them up when the larvals mature or die.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Store IPv6 nh pointer in mac_header on output
Herbert Xu [Tue, 9 Oct 2007 20:25:59 +0000 (13:25 -0700)]
[IPSEC]: Store IPv6 nh pointer in mac_header on output

Current the x->mode->output functions store the IPv6 nh pointer in the
skb network header.  This is inconvenient because the network header then
has to be fixed up before the packet can leave the IPsec stack.  The mac
header field is unused on output so we can use that to store this instead.

This patch does that and removes the network header fix-up in xfrm_output.

It also uses ipv6_hdr where appropriate in the x->type->output functions.

There is also a minor clean-up in esp4 to make it use the same code as
esp6 to help any subsequent effort to merge the two.

Lastly it kills two redundant skb_set_* statements in BEET that were
simply copied over from transport mode.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Remove bogus ref count in xfrm_secpath_reject
Herbert Xu [Tue, 9 Oct 2007 20:24:07 +0000 (13:24 -0700)]
[IPSEC]: Remove bogus ref count in xfrm_secpath_reject

Constructs of the form

xfrm_state_hold(x);
foo(x);
xfrm_state_put(x);

tend to be broken because foo is either synchronous where this is totally
unnecessary or if foo is asynchronous then the reference count is in the
wrong spot.

In the case of xfrm_secpath_reject, the function is synchronous and therefore
we should just kill the reference count.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETNS]: Don't memset() netns to zero manually
Pavel Emelyanov [Tue, 9 Oct 2007 20:02:17 +0000 (13:02 -0700)]
[NETNS]: Don't memset() netns to zero manually

The newly created net namespace is set to 0 with memset()
in setup_net(). The setup_net() is also called for the
init_net_ns(), which is zeroed naturally as a global var.

So remove this memset and allocate new nets with the
kmem_cache_zalloc().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPv6]: use container_of() macro in fib6_clean_node()
Benjamin Thery [Tue, 9 Oct 2007 03:39:36 +0000 (20:39 -0700)]
[IPv6]: use container_of() macro in fib6_clean_node()

In ip6_fib.c, fib6_clean_node() casts a fib6_walker_t pointer to
a fib6_cleaner_t pointer assuming a struct fib6_walker_t (field 'w')
is the first field in struct fib6_walker_t.

To prevent any future problems that may occur if one day a field
is inadvertently inserted before the 'w' field in struct fib6_cleaner_t,
(and to improve readability), this patch uses the container_of() macro.

Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NETNS]: Move some code into __init section when CONFIG_NET_NS=n
Pavel Emelyanov [Tue, 9 Oct 2007 03:38:39 +0000 (20:38 -0700)]
[NETNS]: Move some code into __init section when CONFIG_NET_NS=n

With the net namespaces many code leaved the __init section,
thus making the kernel occupy more memory than it did before.
Since we have a config option that prohibits the namespace
creation, the functions that initialize/finalize some netns
stuff are simply not needed and can be freed after the boot.

Currently, this is almost not noticeable, since few calls
are no longer in __init, but when the namespaces will be
merged it will be possible to free more code. I propose to
use the __net_init, __net_exit and __net_initdata "attributes"
for functions/variables that are not used if the CONFIG_NET_NS
is not set to save more space in memory.

The exiting functions cannot just reside in the __exit section,
as noticed by David, since the init section will have
references on it and the compilation will fail due to modpost
checks. These references can exist, since the init namespace
never dies and the exit callbacks are never called. So I
introduce the __exit_refok attribute just like it is already
done with the __init_refok.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ISDN]: Change I4L to use alloc_netdev().
Karsten Keil [Tue, 9 Oct 2007 03:37:11 +0000 (20:37 -0700)]
[ISDN]: Change I4L to use alloc_netdev().

Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[8021Q]: transfer dev_id from real device
Ursula Braun [Tue, 9 Oct 2007 03:28:47 +0000 (20:28 -0700)]
[8021Q]: transfer dev_id from real device

A net_device struct provides field dev_id. It is used for
unique ipv6 generation in case of shared network cards
(as for the OSA network cards of IBM System z).
If VLAN devices are built on top of such shared network cards,
this dev_id information needs to be transferred to the VLAN device.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Move RO-specific output code into xfrm6_mode_ro.c
Herbert Xu [Tue, 9 Oct 2007 00:27:19 +0000 (17:27 -0700)]
[IPSEC]: Move RO-specific output code into xfrm6_mode_ro.c

The lastused update check in xfrm_output can be done just as well in
the mode output function which is specific to RO.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Unexport xfrm_replay_notify
Herbert Xu [Tue, 9 Oct 2007 00:26:34 +0000 (17:26 -0700)]
[IPSEC]: Unexport xfrm_replay_notify

Now that the only callers of xfrm_replay_notify are in xfrm, we can remove
the export.

This patch also removes xfrm_aevent_doreplay since it's now called in just
one spot.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Move output replay code into xfrm_output
Herbert Xu [Tue, 9 Oct 2007 00:25:53 +0000 (17:25 -0700)]
[IPSEC]: Move output replay code into xfrm_output

The replay counter is one of only two remaining things in the output code
that requires a lock on the xfrm state (the other being the crypto).  This
patch moves it into the generic xfrm_output so we can remove the lock from
the transforms themselves.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Move xfrm_state_check into xfrm_output.c
Herbert Xu [Tue, 9 Oct 2007 00:25:08 +0000 (17:25 -0700)]
[IPSEC]: Move xfrm_state_check into xfrm_output.c

The functions xfrm_state_check and xfrm_state_check_space are only used by
the output code in xfrm_output.c so we can move them over.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC]: Move common output code to xfrm_output
Herbert Xu [Tue, 9 Oct 2007 00:16:30 +0000 (17:16 -0700)]
[IPSEC]: Move common output code to xfrm_output

Most of the code in xfrm4_output_one and xfrm6_output_one are identical so
this patch moves them into a common xfrm_output function which will live
in net/xfrm.

In fact this would seem to fix a bug as on IPv4 we never reset the network
header after a transform which may upset netfilter later on.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC] ah: Remove keys from ah_data structure
Herbert Xu [Tue, 9 Oct 2007 00:14:34 +0000 (17:14 -0700)]
[IPSEC] ah: Remove keys from ah_data structure

The keys are only used during initialisation so we don't need to carry them
in esp_data.  Since we don't have to allocate them again, there is no need
to place a limit on the authentication key length anymore.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IPSEC] esp: Remove keys from esp_data structure
Herbert Xu [Tue, 9 Oct 2007 00:13:44 +0000 (17:13 -0700)]
[IPSEC] esp: Remove keys from esp_data structure

The keys are only used during initialisation so we don't need to carry them
in esp_data.  Since we don't have to allocate them again, there is no need
to place a limit on the authentication key length anymore.

This patch also kills the unused auth.icv member.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AF_IUCV]: postpone receival of iucv-packets
Ursula Braun [Mon, 8 Oct 2007 09:03:31 +0000 (02:03 -0700)]
[AF_IUCV]: postpone receival of iucv-packets

AF_IUCV socket programs may waste Linux storage, because af_iucv
allocates an skb whenever posted by the receive callback routine and
receives the message immediately.
Message receival is now postponed if data from previous callbacks has
not yet been transferred to the receiving socket program. Instead a
message handle is saved in a message queue as a reminder. Once
messages could be given to the receiving socket program, there is
an additional checking for entries in the message queue, followed
by skb allocation and message receival if applicable.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[AF_IUCV]: remove static declarations from header file.
Heiko Carstens [Mon, 8 Oct 2007 09:02:52 +0000 (02:02 -0700)]
[AF_IUCV]: remove static declarations from header file.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: Fix ethtool autonegotiate flags.
Andy Gospodarek [Mon, 8 Oct 2007 08:08:47 +0000 (01:08 -0700)]
[TG3]: Fix ethtool autonegotiate flags.

I recently noticed that when calling:

# ethtool -s eth0 autoneg on

on a 5722 (though I'm sure it's not specific to that card) that
subsequent checks of the cards status looked like this:

# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: No        <---- This seems odd?!?
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: yes

I noticed that the following commit:

commit 3600d918d870456ea8e7bb9d47f327de5c20f3d6
Author: Michael Chan <mchan@broadcom.com>
Date:   Thu Dec 7 00:21:48 2006 -0800

    [TG3]: Allow partial speed advertisement.

    Honor the advertisement bitmask from ethtool.  We used to always
    advertise the full capability when autoneg was set to on.

changed things around so that ethtool speed settings were strictly
followed.  Unfortunately ethtool doesn't seem to set ADVERTISED_Autoneg
in the advertising field (and maybe it shouldn't have to).  I'd vote
that it should be fixed there, but it should also be added here just in
case someone using ethtool ioctls in their own application gets what
they want.

Adding that flag in tg3_set_settings seemed like the most logical place
since the driver works fine on boot.  This is just an issue when
re-enabling autonegotiation, so we should probably nip it there.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[IRDA]: Oops fix for ksdazzle
Alex Villacís Lasso [Mon, 8 Oct 2007 08:07:28 +0000 (01:07 -0700)]
[IRDA]: Oops fix for ksdazzle

This fixes a kernel oops triggered by the ksdazzle SIR driver.
We need more space for input frames, and 2048 should be plenty of it.

Signed-off-by: Alex Villacís Lasso <a_villacis@palosanto.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: split dev_ifsioc() according to locking
Jeff Garzik [Mon, 8 Oct 2007 07:06:32 +0000 (00:06 -0700)]
[NET]: split dev_ifsioc() according to locking

This always bugged me: dev_ioctl() called dev_ifsioc() either inside
read_lock(dev_base_lock) or rtnl_lock(), depending on the ioctl being
executed.

This change moves the ioctls executed inside dev_base_lock to a new
function, dev_ifsioc_locked().  Now the locking context is completely
clear to the reader.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[NET]: sparse warning fixes
Stephen Hemminger [Tue, 9 Oct 2007 08:59:42 +0000 (01:59 -0700)]
[NET]: sparse warning fixes

Fix a bunch of sparse warnings. Mostly about 0 used as
NULL pointer, and shadowed variable declarations.
One notable case was that hash size should have been unsigned.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: "Annotate" another fackets_out state reset
Ilpo Järvinen [Mon, 8 Oct 2007 06:37:55 +0000 (23:37 -0700)]
[TCP]: "Annotate" another fackets_out state reset

This should no longer be necessary because fackets_out is
accurate. It indicates bugs elsewhere, thus report it.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Comment fastpath_cnt_hint off-by-one trap
Ilpo Järvinen [Mon, 8 Oct 2007 06:37:25 +0000 (23:37 -0700)]
[TCP]: Comment fastpath_cnt_hint off-by-one trap

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TCP]: Fix two off-by-one errors in fackets_out adjusting logic
Ilpo Järvinen [Mon, 8 Oct 2007 06:36:41 +0000 (23:36 -0700)]
[TCP]: Fix two off-by-one errors in fackets_out adjusting logic

1) Passing wrong skb to tcp_adjust_fackets_out could corrupt
fastpath_cnt_hint as tcp_skb_pcount(next_skb) is not included
to it if hint points exactly to the next_skb (it's lagging
behind, see sacktag).

2) When fastpath_skb_hint is put backwards to avoid dangling
skb reference, the skb's pcount must also be removed from count
(not included like above).

Reported by Cedric Le Goater <legoater@free.fr>

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: Update version to 3.82.
Michael Chan [Mon, 8 Oct 2007 06:29:06 +0000 (23:29 -0700)]
[TG3]: Update version to 3.82.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: Add 5784 and 5764 support.
Matt Carlson [Mon, 8 Oct 2007 06:28:35 +0000 (23:28 -0700)]
[TG3]: Add 5784 and 5764 support.

This patch adds the support for 5784 and 5764 devices.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: ASIC decoding and basic CPMU support.
Matt Carlson [Mon, 8 Oct 2007 06:28:17 +0000 (23:28 -0700)]
[TG3]: ASIC decoding and basic CPMU support.

Newer products change the way the ASIC revision is obtained.  This patch
implements how the driver will extract the revision number.

This patch also adds preliminary CPMU support.  CPMU stands for Central
Power Management Unit.  The CPMU's role is to put the chip into lower
power states when the operating conditions allow it.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[TG3]: Walk PCI capability lists.
Matt Carlson [Mon, 8 Oct 2007 06:27:28 +0000 (23:27 -0700)]
[TG3]: Walk PCI capability lists.

Newer tg3 devices shuffle around the registers in PCI configuration
space.  This patch changes the way the driver accesses the PCI
capabilities registers.  Hardcoded register locations are replaced with
offsets from pci_find_capability() return values.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoe1000e: Fix ethtool register test code
Auke Kok [Thu, 4 Oct 2007 22:00:08 +0000 (15:00 -0700)]
e1000e: Fix ethtool register test code

A merge/cleanup code accidentally dropped 8254x code in and removed
8257x code here. Undo this mistake and use the pci-e relevant register
test similar as to what is in e1000.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoe1000e: fix debugging printout code
Auke Kok [Thu, 4 Oct 2007 18:38:43 +0000 (11:38 -0700)]
e1000e: fix debugging printout code

A small bug crawled in the -DDEBUG enabled code. Fix this to
properly call the backreference device name.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoqeth: discard inbound packets with unknown header id
Ursula Braun [Fri, 5 Oct 2007 14:45:48 +0000 (16:45 +0200)]
qeth: discard inbound packets with unknown header id

Debugging statements are added for inbound packets with unknown
header id. Those packets are discarded and no longer processed as
osn-packets.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agolcs: Channel errors drive lcs_recovery which leads to kernel panic.
Klaus D. Wacker [Fri, 5 Oct 2007 14:45:47 +0000 (16:45 +0200)]
lcs: Channel errors drive lcs_recovery which leads to kernel panic.

When the lcs irq routine detects channel failures it drives device recovery.
After this event the device is no longer usable for shutdown requests,
because the lcs_irq routine may get wrong channel status information.
In such a case the lcs_irq routine marks the channel in 'error' state.
The channel state comes back to 'running' after restarting the channels.

Signed-off-by: Klaus D. Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoqeth: avoid duplicate deletion of multicast addresses
Ursula Braun [Fri, 5 Oct 2007 14:45:46 +0000 (16:45 +0200)]
qeth: avoid duplicate deletion of multicast addresses

if qeth_set_multicast_list() is performed on 2 CPUs in parallel,
card->ip_list may end corrupted.
Solution: In function __qeth_delete_all_mc()
          remove card->ip_list entry before invoking
          qeth_deregister_addr_entry(). Thus a 2nd invocation of
          qeth_set_multicast_list() cannot try to remove the
          same entry twice.

Signed-off-by Ursula Braun <braunu@de.ibm.com>

Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoqeth: EDDP does not work on large MTUs
Frank Blaschka [Fri, 5 Oct 2007 14:45:45 +0000 (16:45 +0200)]
qeth: EDDP does not work on large MTUs

Fix filling the qdio buffers in EDDP mode.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoqeth: HiperSockets layer-3 interface drop non IPv4 or non IPv6 packets
Klaus D. Wacker [Fri, 5 Oct 2007 14:45:44 +0000 (16:45 +0200)]
qeth: HiperSockets layer-3 interface drop non IPv4 or non IPv6 packets

HiperSockets infrastructure (layer-3 mode) supports only IPv4 or
IPv6 packets. Sending other packet types disturbs TCP/IP on z/VM,
which issues messages about invalid packets.
Qeth send routine will detect packet type on sending over a
HiperSockets interface (in layer-3 mode) and drop non IP packets.
The error and drop count of the interface is incremented.

Signed-off-by: Klaus D. Wacker <kdwacker@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years ago[NIU]: Add Sun Neptune ethernet driver.
David S. Miller [Tue, 9 Oct 2007 08:54:01 +0000 (01:54 -0700)]
[NIU]: Add Sun Neptune ethernet driver.

With cleanup suggestions and bugs spotted by Stephen Hemminger,
Ingo Oeser, Matheos Worku, and Oliver Hartkopp.

Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Twice the wrong reset code in receiving connection-Requests
Gerrit Renker [Thu, 4 Oct 2007 21:52:28 +0000 (14:52 -0700)]
[DCCP]: Twice the wrong reset code in receiving connection-Requests

This fixes two bugs in processing of connection-Requests in
v{4,6}_conn_request:

 1. Due to using the variable `reset_code', the Reset code generated
    internally by dccp_parse_options() is overwritten with the
    initialised value ("Too Busy") of reset_code, which is not what is
    intended.

 2. When receiving a connection-Request on a multicast or broadcast
    address, no Reset should be generated, to avoid storms of such
    packets. Instead of jumping to the `drop' label, the
    v{4,6}_conn_request functions now return 0. Below is why in my
    understanding this is correct:

    When the conn_request function returns < 0, then the caller,
    dccp_rcv_state_process(), returns 1. In all instances where
    dccp_rcv_state_process is called (dccp_v4_do_rcv, dccp_v6_do_rcv,
    and dccp_child_process), a return value of != 0 from
    dccp_rcv_state_process() means that a Reset is generated.

    If on the other hand the conn_request function returns 0, the
    packet is discarded and no Reset is generated.

Note: There may be a related problem when sending the Response, due to
the following.

if (dccp_v6_send_response(sk, req, NULL))
goto drop_and_free;
/* ... */
drop_and_free:
return -1;

In this case, if send_response fails due to transmission errors, the
next thing that is generated is a Reset with a code "Too Busy". I
haven't been able to conjure up such a condition, but it might be good
to change the behaviour here also (not done by this patch).

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Correct documentation
Gerrit Renker [Thu, 4 Oct 2007 21:50:57 +0000 (14:50 -0700)]
[DCCP]: Correct documentation

This corrects erroneous documentation of the socket API.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Wrong format in printk
Gerrit Renker [Thu, 4 Oct 2007 21:44:01 +0000 (14:44 -0700)]
[DCCP]: Wrong format in printk

The elapsed time uses u32, but printk was using %d, not %u.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
17 years ago[DCCP]: Tidy-up -- minisock initialisation
Gerrit Renker [Thu, 4 Oct 2007 21:43:42 +0000 (14:43 -0700)]
[DCCP]: Tidy-up -- minisock initialisation

This

 * removes a declaration of a non-existent function
   __dccp_minisock_init;

 * shifts the initialisation function dccp_minisock_init() from
   options.c to minisocks.c, where it is more naturally expected to
   be.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[CCID2]: Sequence number wraparound issues
Gerrit Renker [Thu, 4 Oct 2007 21:43:09 +0000 (14:43 -0700)]
[CCID2]: Sequence number wraparound issues

This replaces several uses of standard arithmetic with the DCCP
sequence number arithmetic functions. The problem here is that the
sequence number wrap-around was not taken into consideration.

 * Condition "seqp->ccid2s_seq <= prev->ccid2s_seq" has been replaced
   by

    dccp_delta_seqno(seqp->ccid2s_seq, prev->ccid2s_seq) >= 0

   since if seqp is `before' prev, then the delta_seqno() is positive.

 * The test whether sequence numbers `a' and `b' are consecutive has
   the form

    dccp_delta_seqno(a, b) == 1

 * Increment of ccid2hctx_rpseq could be done using dccp_inc_seqno(),
   but since here the incremented ccid2hctx_rpseq == seqno, used
   assignment instead.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[CCID2]: Remove redundant case block
Gerrit Renker [Thu, 4 Oct 2007 21:42:19 +0000 (14:42 -0700)]
[CCID2]: Remove redundant case block

skb's passed to ccid2_hc_tx_send_packet() are headerless, the packet
type is decided later, in dccp_write_xmit(). Therefore the first test
of the switch/case block is always true, the others are never reached.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[CCID2]: Remove redundant BUG_ON
Gerrit Renker [Thu, 4 Oct 2007 21:41:55 +0000 (14:41 -0700)]
[CCID2]: Remove redundant BUG_ON

This removes a test for `val < 1' which would only have been triggered
when val < 0, due to a preceding test for 0.  Fixed by using an
unsigned type for cwnd (as in TCP) instead.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[CCID2]: Remove ugly BUG_ON
Gerrit Renker [Thu, 4 Oct 2007 21:41:26 +0000 (14:41 -0700)]
[CCID2]: Remove ugly BUG_ON

This removes an ugly BUG_ON which has been pointed out by Arnaldo.

Instead of freezing up the machine, a `critical' message is now issued
to the system log.

There is potential of doing this more gracefully (eg. there are a few
internal variables which could be updated despite the lack of memory),
but that requires more complicated changes to the algorithm; thus a
`FIXME' has been added.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[CCID2]: Simplify interface
Gerrit Renker [Thu, 4 Oct 2007 21:41:00 +0000 (14:41 -0700)]
[CCID2]: Simplify interface

This patch simplifies the interface of ccid2_hc_tx_alloc_seq():

   * ccid2_hc_tx_alloc_seq() is always called with an argument of
     CCID2_SEQBUF_LEN;

   * other code - ccid2_hc_tx_check_sanity() - even depends on the
     assumption that ccid2_hc_tx_alloc_seq() has been called with this
     particular size;

   * passing the `gfp_t' argument to ccid2_hc_tx_alloc_seq() is
     redundant with gfp_any().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Update API documentation
Gerrit Renker [Thu, 4 Oct 2007 21:40:22 +0000 (14:40 -0700)]
[DCCP]: Update API documentation

This adds documentation on the use of service codes on client and
server.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Make all `debug' parameters bool
Gerrit Renker [Thu, 4 Oct 2007 21:39:53 +0000 (14:39 -0700)]
[DCCP]: Make all `debug' parameters bool

This just sets the parameter to bool, since debugging messages are
either on or off.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Add socket option to query the current MPS
Gerrit Renker [Thu, 4 Oct 2007 21:39:22 +0000 (14:39 -0700)]
[DCCP]: Add socket option to query the current MPS

This enables applications to query the current value of the Maximum
Packet Size via a socket option, suggested as a SHOULD in (RFC 4340,
p. 102).

This socket option is useful to avoid the annoying bail-out via
`-EMSGSIZE'.  In particular, as fragmentation is not currently
supported (and its use is partly discouraged in RFC 4340).

With this option, it is possible to size buffers accordingly, e.g.

int buflen = dccp_get_cur_mps(sockfd);

/* or */
if (msgsize > dccp_get_cur_mps(sockfd))
die("message is too large for this path");

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[DCCP]: Wait for CCID
Gerrit Renker [Thu, 4 Oct 2007 21:38:49 +0000 (14:38 -0700)]
[DCCP]: Wait for CCID

This performs a minor optimisation: when ccid_hc_tx_send_packet
returns a value greater zero, then the same call previously was done
again at the begin of the while loop in dccp_wait_for_ccid.

This patch exploits the available information and schedule-timeouts
directly instead.

Documentation also added.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agopasemi_mac: enable iommu support
Olof Johansson [Wed, 3 Oct 2007 18:03:54 +0000 (13:03 -0500)]
pasemi_mac: enable iommu support

pasemi_mac: enable iommu support

Enable IOMMU support for pasemi_mac, but avoid using it on non-partitioned
systems for performance reasons.

The user can override this by selecting the PPC_PASEMI_IOMMU_DMA_FORCE
configuration option.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agodrivers/net/qla3xxx: trim trailing whitespace
Jeff Garzik [Wed, 3 Oct 2007 17:52:23 +0000 (13:52 -0400)]
drivers/net/qla3xxx: trim trailing whitespace

Also, hopefully, change the file permissions to 0644.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
17 years agoFix typo in new EMAC driver.
vbarshak@ru.mvista.com [Tue, 2 Oct 2007 12:01:07 +0000 (16:01 +0400)]
Fix typo in new EMAC driver.

Fix an obvious typo in emac_xmit_finish.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoipg.c doesn't compile with with CONFIG_HIGHMEM64G
trem [Tue, 2 Oct 2007 21:04:38 +0000 (14:04 -0700)]
ipg.c doesn't compile with with CONFIG_HIGHMEM64G

I've tried to compile 2.6.23-rc8-mm2, but it fails on ipg.c with the
error : ERROR: "__udivdi3" [drivers/net/ipg.ko] undefined!

I've instigated a bit, and I've found this code in ipg.c :

static void ipg_nic_txfree(struct net_device *dev)
{
       struct ipg_nic_private *sp = netdev_priv(dev);
       void __iomem *ioaddr = sp->ioaddr;
       const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) -
               (sp->txd_map / sizeof(struct ipg_tx)) - 1;
       unsigned int released, pending;

sp->txd_map is an u64
because :
dma_addr_t txd_map;

And in asm-i386/types.h, I see :
#ifdef CONFIG_HIGHMEM64G
typedef u64 dma_addr_t;
#else
typedef u32 dma_addr_t;
#endif
I my config, I use CONFIG_HIGHMEM64G

sizeof(struct ipg_tx) is an u32
So the div failed on i386 because of u64 / u32.

[akpm@linux-foundation.org: cleanups]
Cc: Sorbica Shieh <sorbica@icplus.com.tw>
Cc: Jesse Huang <jesse@icplus.com.tw>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: use buffer index pointer in clean_rx()
Olof Johansson [Tue, 2 Oct 2007 21:27:57 +0000 (16:27 -0500)]
pasemi_mac: use buffer index pointer in clean_rx()

pasemi_mac: use buffer index pointer in clean_rx()

Use the new features in B0 for buffer ring index on the receive side. This
means we no longer have to search in the ring for where the buffer
came from.

Also cleanup the RX cleaning side a little, while I was at it.

Note: Pre-B0 hardware is no longer supported, and needs a pile of other
workarounds that are not being submitted for mainline inclusion. So the
fact that this breaks old hardware is not a problem at this time.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: clear out old errors on interface open
Olof Johansson [Tue, 2 Oct 2007 21:27:39 +0000 (16:27 -0500)]
pasemi_mac: clear out old errors on interface open

pasemi_mac: clear out old errors on interface open

Clear out any pending errors when an interface is brought up. Since the bits
are sticky, they might be from interface shutdown time after firmware has
used it, etc.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: update todo list
Olof Johansson [Tue, 2 Oct 2007 21:27:28 +0000 (16:27 -0500)]
pasemi_mac: update todo list

pasemi_mac: update todo list

Remove some stale todo items that have been taken care of. Add a couple
of upcoming ones.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: further performance tweaks
Olof Johansson [Tue, 2 Oct 2007 21:27:15 +0000 (16:27 -0500)]
pasemi_mac: further performance tweaks

pasemi_mac: further performance tweaks

Misc driver tweaks for pasemi_mac:
* Increase ring size (really needed mostly on 10G)
* Take out an unneeded barrier
* Move around a few prefetches and reorder a few calls
* Don't try to clean on full tx buffer, just let things
  take their course and stop the queue directly
* Avoid filling on the same line as the interface is
  working on to reduce cache line bouncing
* Avoid unneeded clearing of software state (and make the
  interface shutdown code handle it)
* Fix up some of the tx ring wrap logic.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: add local skb alignment
Olof Johansson [Tue, 2 Oct 2007 21:26:53 +0000 (16:26 -0500)]
pasemi_mac: add local skb alignment

pasemi_mac: add local skb alignment

Add local SKB alignment to pasemi_mac, since ppc64 in general has it at 0
because of design flaws in some of the IBM server bridge chips. However,
for PWRficient doing the unaligned copies is more expensive than doing
unaligned DMA so make sure the data is aligned instead.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: workaround for erratum 5971
Olof Johansson [Tue, 2 Oct 2007 21:26:30 +0000 (16:26 -0500)]
pasemi_mac: workaround for erratum 5971

pasemi_mac: workaround for erratum 5971

Implement workarounds for erratum 5971, where L2 hints aren't considered
properly unless the way hint is enabled on the interface. Since L2 isn't
setup to dedicate a way to headers, we need to reset the packet count
by hand so it won't run out of credits.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: implement sg support
Olof Johansson [Tue, 2 Oct 2007 21:26:13 +0000 (16:26 -0500)]
pasemi_mac: implement sg support

pasemi_mac: implement sg support

Implement SG support for pasemi_mac

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: rework ring management
Olof Johansson [Tue, 2 Oct 2007 21:25:53 +0000 (16:25 -0500)]
pasemi_mac: rework ring management

pasemi_mac: rework ring management

Rework ring management, switching to an opaque ring format instead of
the struct-based descriptor+pointer setup, since it will be needed for
SG support.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: fix bug in receive buffer dma mapping
Olof Johansson [Tue, 2 Oct 2007 21:25:14 +0000 (16:25 -0500)]
pasemi_mac: fix bug in receive buffer dma mapping

pasemi_mac: fix bug in receive buffer dma mapping

skb->len isn't actually set to the size of the allocated skb, so don't
try to use it when figuring out how much to map.

(This hasn't surfaced as a real bug because we effectively disable
translation for the interface, but it still needs fixing for the future)

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agopasemi_mac: basic error checking
Olof Johansson [Tue, 2 Oct 2007 21:24:51 +0000 (16:24 -0500)]
pasemi_mac: basic error checking

pasemi_mac: basic error checking

Add some rudimentary error checking to pasemi_mac.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years ago[MAC80211]: Update beacon_update callback documentation
Michael Buesch [Tue, 2 Oct 2007 10:17:56 +0000 (12:17 +0200)]
[MAC80211]: Update beacon_update callback documentation

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: add sta_notify callback
Tomas Winkler [Sun, 30 Sep 2007 11:52:37 +0000 (13:52 +0200)]
[MAC80211]: add sta_notify callback

This patch adds sta_notify callback and removes sta_table_notification
which was not used by any driver.
sta_notify() is essential for drivers that keeps notion of station
internally and need to be notified about removal or addition of a station
to the (I)BSS or assocation to an AP.

This version adds interface id to the parameter list
as suggested by Johannes Berg

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: implement cfg80211's change_interface hook
Johannes Berg [Fri, 28 Sep 2007 19:52:27 +0000 (21:52 +0200)]
[MAC80211]: implement cfg80211's change_interface hook

This implements the cfg80211 change_interface hook that changes the
type of an interface and cleans up the code a bit.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: Add association LED trigger
Michael Buesch [Thu, 27 Sep 2007 13:10:44 +0000 (15:10 +0200)]
[MAC80211]: Add association LED trigger

Many devices have LEDs to indicate the link status.
Export this functionality to drivers.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: make userspace-mlme a per-interface setting
Johannes Berg [Wed, 26 Sep 2007 15:53:20 +0000 (17:53 +0200)]
[MAC80211]: make userspace-mlme a per-interface setting

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: improve radiotap injection
Johannes Berg [Wed, 26 Sep 2007 15:53:18 +0000 (17:53 +0200)]
[MAC80211]: improve radiotap injection

This improves radiotap injection by removing the shortcut over TX handlers
that led to BUGS when injecting frames without setting a rate and also
resulted in various other quirks. Now, TX handlers are run but some
information that was present in the radiotap header is used instead of
automatic settings.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Andy Green <andy@warmcat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
17 years ago[MAC80211]: remove ALG_NONE
Johannes Berg [Wed, 26 Sep 2007 15:53:17 +0000 (17:53 +0200)]
[MAC80211]: remove ALG_NONE

This "algorithm" is used only internally and is not useful.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: use RX_FLAG_DECRYPTED for sw decrypted as well
Johannes Berg [Wed, 26 Sep 2007 15:53:16 +0000 (17:53 +0200)]
[MAC80211]: use RX_FLAG_DECRYPTED for sw decrypted as well

This makes mac80211 set the RX_FLAG_DECRYPTED flag for frames
decrypted in software allowing us to handle some things more
uniformly.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: consolidate decryption more
Johannes Berg [Wed, 26 Sep 2007 15:53:15 +0000 (17:53 +0200)]
[MAC80211]: consolidate decryption more

Currently, we have three RX handlers doing the decryption.
This patch changes it to have only one handler doing
everything, thereby getting rid of many duplicate checks.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
--
 net/mac80211/rx.c |   46 ++++++++++++----------------------------------
 1 files changed, 12 insertions(+), 34 deletions(-)

17 years ago[MAC80211]: move sta_process rx handler later
Johannes Berg [Wed, 26 Sep 2007 15:53:14 +0000 (17:53 +0200)]
[MAC80211]: move sta_process rx handler later

This moves the sta_process RX handler to after decryption
so that frames that cannot be decrypted don't influence
statistics, it is likely that they were injected or something
else is totally wrong.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: remove management interface
Johannes Berg [Fri, 28 Sep 2007 12:02:09 +0000 (14:02 +0200)]
[MAC80211]: remove management interface

Removes the management interface since it is only required
for hostapd/userspace MLME, will not be in the final tree
at least in this form and hostapd/userspace MLME currently
do not work against this tree anyway.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: add "invalid" interface type
Johannes Berg [Fri, 28 Sep 2007 12:01:25 +0000 (14:01 +0200)]
[MAC80211]: add "invalid" interface type

Since I cannot convince the lazy driver authors (hello Michael)
to stop (ab)using the MGMT interface type internally in their
drivers, this patch introduces a new _INVALID type especially
for their use and changes all affected drivers to use it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[MAC80211]: Check open_count before calling config callback.
Michael Buesch [Mon, 24 Sep 2007 16:41:49 +0000 (18:41 +0200)]
[MAC80211]: Check open_count before calling config callback.

Also remove the check for ops->config!=NULL, as it can never be NULL.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[B43]: Rewrite pwork locking policy.
Michael Buesch [Fri, 28 Sep 2007 14:19:03 +0000 (16:19 +0200)]
[B43]: Rewrite pwork locking policy.

Implement much easier and more lightweight locking for
the periodic work.
This also removes the last big busywait loop and replaces it
by a sleeping loop.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[B43]: Use input-polldev for the rfkill switch
Michael Buesch [Fri, 28 Sep 2007 12:22:33 +0000 (14:22 +0200)]
[B43]: Use input-polldev for the rfkill switch

This removes the direct call to rfkill on an rfkill event
and replaces it with an input device. This way userspace is also
notified about the event.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[B43]: RF-kill support
Michael Buesch [Thu, 27 Sep 2007 19:35:34 +0000 (21:35 +0200)]
[B43]: RF-kill support

This adds full support for the RFKILL button and
the RFKILL LED trigger.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[B43]: LED triggers support
Michael Buesch [Thu, 27 Sep 2007 13:31:40 +0000 (15:31 +0200)]
[B43]: LED triggers support

Drive the LEDs through the generic LED triggers.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <larry.finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[RFKILL]: Add support for hardware-only rfkill buttons
Michael Buesch [Thu, 27 Sep 2007 19:34:23 +0000 (21:34 +0200)]
[RFKILL]: Add support for hardware-only rfkill buttons

Buttons that work directly on hardware cannot support
the "user_claim" functionality. Add a flag to signal
this and return -EOPNOTSUPP in this case.
b43 is such a device.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[RFKILL]: Add support for an rfkill LED.
Michael Buesch [Thu, 27 Sep 2007 19:33:12 +0000 (21:33 +0200)]
[RFKILL]: Add support for an rfkill LED.

This adds a LED trigger.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[ZD1211RW]: Removed zd_util.c and zd_util.h
Ulrich Kunitz [Tue, 2 Oct 2007 17:36:53 +0000 (18:36 +0100)]
[ZD1211RW]: Removed zd_util.c and zd_util.h

The kernel now provides a generic hexdump implementation should we need
it again, so we can remove it from zd1211rw. After removing that, only
one single-user function is left in zd_util. Move that to zd_mac and
remove zd_util.

Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[HOSTAP]: set netdev type before registering AP interface
Daniel Drake [Wed, 26 Sep 2007 20:45:24 +0000 (21:45 +0100)]
[HOSTAP]: set netdev type before registering AP interface

As detailed at https://bugs.gentoo.org/159646 hostap with hostapd confuses
udev by presenting 2 interfaces with the same MAC address. Also, at the time
of detection, the 'type' attribute is 1, identical to other hostap interfaces.

The AP interface is supposed to have type ARPHRD_IEEE80211 (801), but this is
not set until after registration.

Setting it before register_netdev() is called allows us to avoid this
confusion. We can do this by propogating the HOSTAP_INTERFACE type through
to hostap_setup_dev().

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Update version to 1.6.6.
Michael Chan [Tue, 2 Oct 2007 23:28:09 +0000 (16:28 -0700)]
[BNX2]: Update version to 1.6.6.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years ago[BNX2]: Optimize firmware loading.
Michael Chan [Tue, 2 Oct 2007 23:27:35 +0000 (16:27 -0700)]
[BNX2]: Optimize firmware loading.

This is a follow up to the patches from Denys Vlasenkos
<vda.linux@googlemail.com> to further optimize firmware loading.

1. In bnx2_init_cpus(), we allocate memory for decompression once
and use it repeatedly instead of doing this for every firmware image.

2. We eliminate the BSS and SBSS firmware sections in bnx2_fw*.h since
these are always zeros.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 years agoPCMCIA-NETDEV : add new id (axnet_cs, pcnet_cs)
Komuro [Sun, 30 Sep 2007 01:28:14 +0000 (10:28 +0900)]
PCMCIA-NETDEV : add new id (axnet_cs, pcnet_cs)

axnet_cs: Laneed LD-CDK/TX
pcnet_cs: LEMEL LM-N89TX PRO

Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agosmc91x Hitachi Solution Engine (SuperH) Support
Nobuhiro Iwamatsu [Wed, 19 Sep 2007 12:07:52 +0000 (21:07 +0900)]
smc91x Hitachi Solution Engine (SuperH) Support

Hi, all.

This patch supports Hitachi Solution Engine (SuperH) of smc91x.
Please apply this patch .

regards,
 Nobuhiro

--
Nobuhiro Iwamatsu
E-Mail : iwamatsu@nigauri.org
GPG ID : 3170EBE9

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agosmc911x irq sense request and MPR2 board support
Markus Brunner [Mon, 20 Aug 2007 06:36:50 +0000 (08:36 +0200)]
smc911x irq sense request and MPR2 board support

Hi,

this are the changes to the smc911x driver, which were necessary
to get it running on the Magic Panel R2 (smsc9115).
It is a SH3-DSP based board. The other patches are available on
the linuxsh-dev mailinglist.
http://marc.info/?l=linuxsh-dev&r=1&b=200708&w=2

It was necessary to set the irq sense to low level.
Therefor the SMC_IRQ_SENSE define was added.
How are the chances for inclusion in 2.6.24?

Signed-off by: Markus Brunner <super.firetwister@gmail.com>
Signed-off by: Mark Jonas <toertel@gmail.com>

Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoehea: DLPAR memory add fix
Jan-Bernd Themann [Mon, 1 Oct 2007 14:33:18 +0000 (16:33 +0200)]
ehea: DLPAR memory add fix

Due to stability issues in high load situations the HW queue handling
has to be changed. The HW queues are now stopped and restarted again instead
of destroying and allocating new HW queues.

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: sparse fixes
Scott Wood [Mon, 1 Oct 2007 19:20:58 +0000 (14:20 -0500)]
fs_enet: sparse fixes

Mostly a bunch of __iomem annotations.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: Convert mii-bitbang to use the generic bitbang MDIO code.
Scott Wood [Mon, 1 Oct 2007 19:20:57 +0000 (14:20 -0500)]
fs_enet: Convert mii-bitbang to use the generic bitbang MDIO code.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoGeneric bitbanged MDIO library
Scott Wood [Mon, 1 Oct 2007 19:20:56 +0000 (14:20 -0500)]
Generic bitbanged MDIO library

Previously, bitbanged MDIO was only supported in individual
hardware-specific drivers.  This code factors out the higher level
protocol implementation, reducing the hardware-specific portion to
functions setting direction, data, and clock.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.
Scott Wood [Tue, 2 Oct 2007 15:55:58 +0000 (10:55 -0500)]
fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.

The existing OF glue code was crufty and broken.  Rather than fix it, it
will be removed, and the ethernet driver now talks to the device tree
directly.

The old, non-CONFIG_PPC_CPM_NEW_BINDING code can go away once CPM
platforms are dropped from arch/ppc (which will hopefully be soon), and
existing arch/powerpc boards that I wasn't able to test on for this
patchset get converted (which should be even sooner).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: Align receive buffers.
Scott Wood [Mon, 1 Oct 2007 19:20:52 +0000 (14:20 -0500)]
fs_enet: Align receive buffers.

At least some hardware driven by this driver needs receive buffers
to be aligned on a 16-byte boundary.  This usually happens by chance,
but it breaks if slab debugging is enabled.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: mac-fcc: Eliminate __fcc-* macros.
Scott Wood [Mon, 1 Oct 2007 19:20:50 +0000 (14:20 -0500)]
fs_enet: mac-fcc: Eliminate __fcc-* macros.

These macros accomplish nothing other than defeating type checking.

This patch also fixes one instance of the wrong register size being
used that was revealed by enabling type checking.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agofs_enet: Include linux/string.h from linux/fs_enet_pd.h
Scott Wood [Mon, 1 Oct 2007 19:20:49 +0000 (14:20 -0500)]
fs_enet: Include linux/string.h from linux/fs_enet_pd.h

It is needed for strstr().

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>