linux-2.6
15 years agobonding: fix style issues
Stephen Hemminger [Fri, 12 Jun 2009 19:02:48 +0000 (19:02 +0000)] 
bonding: fix style issues

Resolve some of the complaints from checkpatch, and remove "magic emacs format"
comments, and useless MODULE_SUPPORTED_DEVICE(). But should not
change actual code.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: fix destructor
Stephen Hemminger [Fri, 12 Jun 2009 19:02:47 +0000 (19:02 +0000)] 
bonding: fix destructor

It is not safe to use a network device destructor that is a function in
the module, since it can be called after module is unloaded if sysfs
handle is open.

When eventually using netlink, the device cleanup code needs to be done
via uninit function.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: remove bonding read/write semaphore
Stephen Hemminger [Fri, 12 Jun 2009 19:02:46 +0000 (19:02 +0000)] 
bonding: remove bonding read/write semaphore

The whole read/write semaphore locking can be removed. It doesn't add any
protection that isn't already done by using the RTNL mutex properly.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: initialize before registration
Stephen Hemminger [Fri, 12 Jun 2009 19:02:45 +0000 (19:02 +0000)] 
bonding: initialize before registration

Avoid a unnecessary carrier state transistion that happens when device
is registered.
Lockdep works better if initialization is done before registration as well.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: bond_create always called with default parameters
Stephen Hemminger [Fri, 12 Jun 2009 19:02:44 +0000 (19:02 +0000)] 
bonding: bond_create always called with default parameters

bond_create() is always called with same parameters so move the argument
down.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/irda-2.6
David S. Miller [Sun, 14 Jun 2009 00:08:11 +0000 (17:08 -0700)] 
Merge branch 'for-next' of git://git./linux/kernel/git/sameo/irda-2.6

15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
David S. Miller [Sat, 13 Jun 2009 23:43:28 +0000 (16:43 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-next-2.6

15 years agox_tables: Convert printk to pr_err
Joe Perches [Sat, 13 Jun 2009 10:32:39 +0000 (12:32 +0200)] 
x_tables: Convert printk to pr_err

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonetfilter: conntrack: optional reliable conntrack event delivery
Pablo Neira Ayuso [Sat, 13 Jun 2009 10:30:52 +0000 (12:30 +0200)] 
netfilter: conntrack: optional reliable conntrack event delivery

This patch improves ctnetlink event reliability if one broadcast
listener has set the NETLINK_BROADCAST_ERROR socket option.

The logic is the following: if an event delivery fails, we keep
the undelivered events in the missed event cache. Once the next
packet arrives, we add the new events (if any) to the missed
events in the cache and we try a new delivery, and so on. Thus,
if ctnetlink fails to deliver an event, we try to deliver them
once we see a new packet. Therefore, we may lose state
transitions but the userspace process gets in sync at some point.

At worst case, if no events were delivered to userspace, we make
sure that destroy events are successfully delivered. Basically,
if ctnetlink fails to deliver the destroy event, we remove the
conntrack entry from the hashes and we insert them in the dying
list, which contains inactive entries. Then, the conntrack timer
is added with an extra grace timeout of random32() % 15 seconds
to trigger the event again (this grace timeout is tunable via
/proc). The use of a limited random timeout value allows
distributing the "destroy" resends, thus, avoiding accumulating
lots "destroy" events at the same time. Event delivery may
re-order but we can identify them by means of the tuple plus
the conntrack ID.

The maximum number of conntrack entries (active or inactive) is
still handled by nf_conntrack_max. Thus, we may start dropping
packets at some point if we accumulate a lot of inactive conntrack
entries that did not successfully report the destroy event to
userspace.

During my stress tests consisting of setting a very small buffer
of 2048 bytes for conntrackd and the NETLINK_BROADCAST_ERROR socket
flag, and generating lots of very small connections, I noticed
very few destroy entries on the fly waiting to be resend.

A simple way to test this patch consist of creating a lot of
entries, set a very small Netlink buffer in conntrackd (+ a patch
which is not in the git tree to set the BROADCAST_ERROR flag)
and invoke `conntrack -F'.

For expectations, no changes are introduced in this patch.
Currently, event delivery is only done for new expectations (no
events from expectation expiration, removal and confirmation).
In that case, they need a per-expectation event cache to implement
the same idea that is exposed in this patch.

This patch can be useful to provide reliable flow-accouting. We
still have to add a new conntrack extension to store the creation
and destroy time.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agolist_nulls: add hlist_nulls_add_head and hlist_nulls_del
Pablo Neira Ayuso [Sat, 13 Jun 2009 10:28:57 +0000 (12:28 +0200)] 
list_nulls: add hlist_nulls_add_head and hlist_nulls_del

This patch adds the hlist_nulls_add_head() function which is
based on hlist_nulls_add_head_rcu() but without the use of
rcu_assign_pointer(). It also adds hlist_nulls_del which is
exactly the same like hlist_nulls_del_rcu().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonetfilter: conntrack: move helper destruction to nf_ct_helper_destroy()
Pablo Neira Ayuso [Sat, 13 Jun 2009 10:28:22 +0000 (12:28 +0200)] 
netfilter: conntrack: move helper destruction to nf_ct_helper_destroy()

This patch moves the helper destruction to a function that lives
in nf_conntrack_helper.c. This new function is used in the patch
to add ctnetlink reliable event delivery.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonetfilter: conntrack: move event caching to conntrack extension infrastructure
Pablo Neira Ayuso [Sat, 13 Jun 2009 10:26:29 +0000 (12:26 +0200)] 
netfilter: conntrack: move event caching to conntrack extension infrastructure

This patch reworks the per-cpu event caching to use the conntrack
extension infrastructure.

The main drawback is that we consume more memory per conntrack
if event delivery is enabled. This patch is required by the
reliable event delivery that follows to this patch.

BTW, this patch allows you to enable/disable event delivery via
/proc/sys/net/netfilter/nf_conntrack_events in runtime, although
you can still disable event caching as compilation option.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonetfilter: nf_conntrack: use mod_timer_pending() for conntrack refresh
Patrick McHardy [Sat, 13 Jun 2009 10:21:49 +0000 (12:21 +0200)] 
netfilter: nf_conntrack: use mod_timer_pending() for conntrack refresh

Use mod_timer_pending() instead of atomic sequence of del_timer()/
add_timer(). mod_timer_pending() does not rearm an inactive timer,
so we don't need the conntrack lock anymore to make sure we don't
accidentally rearm a timer of a conntrack which is in the process
of being destroyed.

With this change, we don't need to take the global lock anymore at all,
counter updates can be performed under the per-conntrack lock.

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonetfilter: nf_log: fix sleeping function called from invalid context
Patrick McHardy [Sat, 13 Jun 2009 10:21:10 +0000 (12:21 +0200)] 
netfilter: nf_log: fix sleeping function called from invalid context

Fix regression introduced by 17625274 "netfilter: sysctl support of
logger choice":

BUG: sleeping function called from invalid context at /mnt/s390test/linux-2.6-tip/arch/s390/include/asm/uaccess.h:234
in_atomic(): 1, irqs_disabled(): 0, pid: 3245, name: sysctl
CPU: 1 Not tainted 2.6.30-rc8-tipjun10-02053-g39ae214 #1
Process sysctl (pid: 3245, task: 000000007f675da0, ksp: 000000007eb17cf0)
0000000000000000 000000007eb17be8 0000000000000002 0000000000000000
       000000007eb17c88 000000007eb17c00 000000007eb17c00 0000000000048156
       00000000003e2de8 000000007f676118 000000007eb17f10 0000000000000000
       0000000000000000 000000007eb17be8 000000000000000d 000000007eb17c58
       00000000003e2050 000000000001635c 000000007eb17be8 000000007eb17c30
Call Trace:
(Ý<00000000000162e6>¨ show_trace+0x13a/0x148)
 Ý<00000000000349ea>¨ __might_sleep+0x13a/0x164
 Ý<0000000000050300>¨ proc_dostring+0x134/0x22c
 Ý<0000000000312b70>¨ nf_log_proc_dostring+0xfc/0x188
 Ý<0000000000136f5e>¨ proc_sys_call_handler+0xf6/0x118
 Ý<0000000000136fda>¨ proc_sys_read+0x26/0x34
 Ý<00000000000d6e9c>¨ vfs_read+0xac/0x158
 Ý<00000000000d703e>¨ SyS_read+0x56/0x88
 Ý<0000000000027f42>¨ sysc_noemu+0x10/0x16

Use the nf_log_mutex instead of RCU to fix this.

Reported-and-tested-by: Maran Pakkirisamy <maranpsamy@in.ibm.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agonet: use symbolic values for ndo_start_xmit() return codes
Patrick McHardy [Fri, 12 Jun 2009 06:22:29 +0000 (06:22 +0000)] 
net: use symbolic values for ndo_start_xmit() return codes

Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively.

0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases
where its in direct proximity to one of the other values.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 8)
Patrick McHardy [Fri, 12 Jun 2009 06:14:36 +0000 (06:14 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 8)

Fix up USB drivers that return an errno value (result of usb_submit_urb())
to qdisc_restart(), causing qdisc_restart() to print a warning and requeue/
retransmit the skb.

- hso: skb is freed: use after free
- at76_usb: skb is freed: use after free

Compile tested only.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 7)
Patrick McHardy [Fri, 12 Jun 2009 05:34:37 +0000 (05:34 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 7)

Fix up ATM drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- lec: condition can only be remedied by userspace, until that retransmissions

Compile tested only.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 6)
Patrick McHardy [Fri, 12 Jun 2009 05:20:01 +0000 (05:20 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 6)

Fix up hamradio drivers that return an errno value to dev_queue_xmit(), causing
it to print a warning an free the skb.

- bpqether: skb is freed: use after free

Compile tested only.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 5)
Patrick McHardy [Fri, 12 Jun 2009 05:13:07 +0000 (05:13 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 5)

Fix up s390 drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- claw: impossible condition, simply remove it

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 4)
Patrick McHardy [Fri, 12 Jun 2009 04:37:34 +0000 (04:37 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 4)

Fix up WAN drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- cycx_x25: intention appears to be to requeue the skb

Does not compile cleanly for me even without this patch, so untested.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 3)
Patrick McHardy [Fri, 12 Jun 2009 04:08:02 +0000 (04:08 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 3)

net: fix network drivers ndo_start_xmit() return values (part 3)

Fix up wireless drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- airo: transmission not implemented for chip, intention is to free and abort
- ipw2200: transmission not implemented for promiscous mode, intention is to
           drop
- prism54: intention is to drop
- wl3501_cs: intention appears to be to drop
- zd1201: error counter indicates intention is to drop

All drivers compile tested.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network drivers ndo_start_xmit() return values (part 2)
Patrick McHardy [Fri, 12 Jun 2009 03:17:19 +0000 (03:17 +0000)] 
net: fix network drivers ndo_start_xmit() return values (part 2)

Fix up IRDA drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning an requeue/retransmit the skb.

- donauboe: intention appears to be to have the skb retransmitted without
            error message
- irda-usb: intention is to drop silently according to comment
- kingsub-sir: skb is freed: use after free
- ks959-sir: skb is freed: use after free
- ksdazzle-sir: skb is freed: use after free
- mcs7880: skb is freed: use after free

All but donauboe compile tested.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix network driver ndo_start_xmit() return values (part 1)
Patrick McHardy [Fri, 12 Jun 2009 03:00:35 +0000 (03:00 +0000)] 
net: fix network driver ndo_start_xmit() return values (part 1)

Fix up drivers that return an errno value to qdisc_restart(), causing
qdisc_restart() to print a warning and requeue/retransmit the skb.

- xpnet: memory allocation error, intention is to drop
- ethoc: oversized packet, packet must be dropped
- ibmlana: skb freed: use after free
- rrunner: skb freed: use after free

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoirda: add git tree to MAINTAINERS file
Samuel Ortiz [Fri, 5 Jun 2009 14:12:00 +0000 (16:12 +0200)] 
irda: add git tree to MAINTAINERS file

We now have an IrDA git tree on kernel.org:
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/irda-2.6.git

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
15 years agoirda: smsc wait count reaches -1
Roel Kluin [Fri, 5 Jun 2009 10:54:44 +0000 (12:54 +0200)] 
irda: smsc wait count reaches -1

The sir retries count reaches -1 rather than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 years agoirda: new Blackfin on-chip SIR IrDA driver
Graff Yang [Tue, 12 May 2009 20:47:54 +0000 (13:47 -0700)] 
irda: new Blackfin on-chip SIR IrDA driver

Signed-off-by: Graff Yang <graff.yang@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15 years agobridge: Simplify interface for ATM LANE
Michał Mirosław [Fri, 5 Jun 2009 05:35:28 +0000 (05:35 +0000)] 
bridge: Simplify interface for ATM LANE

This patch changes FDB entry check for ATM LANE bridge integration.
There's no point in holding a FDB entry around SKB building.

br_fdb_get()/br_fdb_put() pair are changed into single br_fdb_test_addr()
hook that checks if the addr has FDB entry pointing to other port
to the one the request arrived on.

FDB entry refcounting is removed as it's not used anywhere else.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago[PATCH] net core: Some interface flags not returned by SIOCGIFFLAGS
John Dykstra [Fri, 12 Jun 2009 03:57:21 +0000 (20:57 -0700)] 
[PATCH] net core: Some interface flags not returned by SIOCGIFFLAGS

Commit b00055aacdb172c05067612278ba27265fcd05ce " [NET] core: add
RFC2863 operstate" defined new interface flag values.  Its
documentation specified that these flags could be accessed from user
space via SIOCGIFFLAGS.  However, this does not work because the new
flags do not fit in that ioctl's argument width.

Change the documentation to match the code's behavior.  Also change
the source to explicitly show the truncation.  This _should_ have no
effect on executable code, and did not with gcc 4.2.4 generating x86
code.

A new ioctl could be defined to return all interface flags to user
space.  However, since this has been broken for three years with no
one complaining, there doesn't seem much need.  They are still
accessible via netlink.

Reported-by: "Fredrik Arnerup" <fredrik.arnerup@edgeware.tv>
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovirtio_net: Fix IP alignment on non-mergeable RX path
Herbert Xu [Fri, 12 Jun 2009 03:55:17 +0000 (20:55 -0700)] 
virtio_net: Fix IP alignment on non-mergeable RX path

We need to enforce the IP alignment on the non-mergeable RX path just
like the other RX path.  Not doing so results in misaligned IP
headers.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
David S. Miller [Fri, 12 Jun 2009 03:00:44 +0000 (20:00 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-next-2.6

15 years agonet: ntohs() misuse
Eric Dumazet [Fri, 12 Jun 2009 00:23:24 +0000 (17:23 -0700)] 
net: ntohs() misuse

Some drivers incorrectly use ntohs() instead of htons()

A cleanup as htons() returns same result than ntohs(),
but better to use the proper one.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'linux-2.6.31.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky...
David S. Miller [Fri, 12 Jun 2009 00:11:33 +0000 (17:11 -0700)] 
Merge branch 'linux-2.6.31.y' of git://git./linux/kernel/git/inaky/wimax

15 years agonetfilter: ip_tables: fix build error
Patrick McHardy [Thu, 11 Jun 2009 23:53:09 +0000 (01:53 +0200)] 
netfilter: ip_tables: fix build error

Fix build error introduced by commit bb70dfa5 (netfilter: xtables:
consolidate comefrom debug cast access):

net/ipv4/netfilter/ip_tables.c: In function 'ipt_do_table':
net/ipv4/netfilter/ip_tables.c:421: error: 'comefrom' undeclared (first use in this function)
net/ipv4/netfilter/ip_tables.c:421: error: (Each undeclared identifier is reported only once
net/ipv4/netfilter/ip_tables.c:421: error: for each function it appears in.)

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agowimax: fix gcc warnings in sh4 when calling BUG()
Inaky Perez-Gonzalez [Thu, 11 Jun 2009 18:13:41 +0000 (11:13 -0700)] 
wimax: fix gcc warnings in sh4 when calling BUG()

SH4's BUG() seems to confuse the compiler as it is considered to
return; thus, some functions would trigger usage of uninitialized
variables or non-void functions returning void.

Work around by initializing/returning.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax: fix warning caused by not checking retval of rfkill_set_hw_state()
Inaky Perez-Gonzalez [Thu, 11 Jun 2009 18:12:48 +0000 (11:12 -0700)] 
wimax: fix warning caused by not checking retval of rfkill_set_hw_state()

Caused by an API update. The return value can be safely ignored, as
there is notthing we can do with it.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agomISDN: cleanup mISDNhw.h
Karsten Keil [Thu, 11 Jun 2009 13:52:10 +0000 (15:52 +0200)] 
mISDN: cleanup mISDNhw.h

Remove unused stuff.

Signed-off-by: Karsten Keil <keil@b1-systems.de>
15 years agomISDN: Do not disable IRQ in ph_data_ind()
Karsten Keil [Tue, 9 Jun 2009 12:38:39 +0000 (14:38 +0200)] 
mISDN: Do not disable IRQ in ph_data_ind()

This fix triggering the WARN_ON_ONCE(in_irq() || irqs_disabled()); in
local_bh_enable().

Here is no need to grab this lock, this was wrong at all and may
cause a deadlock and access to freed memory, since on a TEI remove
the current listelement can be deleted under us. So this is clearly
a case for list_for_each_entry_safe.

Signed-off-by: Karsten Keil <keil@b1-systems.de>
15 years agodrivers/isdn/i4l/isdn_tty.c: fix check for array overindexing
Roel Kluin [Wed, 10 Jun 2009 19:52:44 +0000 (12:52 -0700)] 
drivers/isdn/i4l/isdn_tty.c: fix check for array overindexing

The check for overindexing of dev->mdm.info[] has an off-by-one.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Karsten Keil <keil@b1-systems.de>
15 years agomISDN: Free hfcpci IRQ if init was not successful
Andreas Mohr [Tue, 2 Jun 2009 16:15:12 +0000 (18:15 +0200)] 
mISDN: Free hfcpci IRQ if init was not successful

If we get no interrupts for after 3 resets we need to unregister
the interrupt function, which is already done outside the loop.

Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
15 years agomISDN: Fix overlapping data access
Karsten Keil [Tue, 2 Jun 2009 13:37:37 +0000 (15:37 +0200)] 
mISDN: Fix overlapping data access

Remove code rewriting a buffer by itself.
This fix bug 12970 on bugzilla.kernel.org.

Signed-off-by: Karsten Keil <keil@b1-systems.de>
15 years agoISDN:Fix DMA alloc for hfcpci
Karsten Keil [Tue, 2 Jun 2009 12:57:35 +0000 (14:57 +0200)] 
ISDN:Fix DMA alloc for hfcpci

Replace wrong code with correct DMA API functions.

Signed-off-by: Karsten Keil <keil@b1-systems.de>
15 years agonetfilter: nf_ct_tcp: fix up build after merge
Patrick McHardy [Thu, 11 Jun 2009 14:16:09 +0000 (16:16 +0200)] 
netfilter: nf_ct_tcp: fix up build after merge

Replace the last occurence of tcp_lock by the per-conntrack lock.

Signed-off-by: Patrick McHardy <kaber@trash.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net...
Patrick McHardy [Thu, 11 Jun 2009 14:00:49 +0000 (16:00 +0200)] 
Merge branch 'master' of git://git./linux/kernel/git/davem/net-next-2.6

15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
David S. Miller [Thu, 11 Jun 2009 12:47:43 +0000 (05:47 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/holtmann/bluetooth-next-2.6

15 years agobonding: fix multiple module load problem
Stephen Hemminger [Thu, 11 Jun 2009 12:46:04 +0000 (05:46 -0700)] 
bonding: fix multiple module load problem

Some users still load bond module multiple times to create bonding
devices.  This accidentally was broken by a later patch about
the time sysfs was fixed.  According to Jay, it was broken
by:
   commit b8a9787eddb0e4665f31dd1d64584732b2b5d051
   Author: Jay Vosburgh <fubar@us.ibm.com>
   Date:   Fri Jun 13 18:12:04 2008 -0700

     bonding: Allow setting max_bonds to zero

Note: sysfs and procfs still produce WARN() messages when this is done
so the sysfs method is the recommended API.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoneigh: fix state transition INCOMPLETE->FAILED via Netlink request
Timo Teras [Thu, 11 Jun 2009 11:16:28 +0000 (04:16 -0700)] 
neigh: fix state transition INCOMPLETE->FAILED via Netlink request

The current code errors out the INCOMPLETE neigh entry skb queue only from
the timer if maximum probes have been attempted and there has been no reply.
This also causes the transtion to FAILED state.

However, the neigh entry can be also updated via Netlink to inform that the
address is unavailable.  Currently, neigh_update() just stops the timers and
leaves the pending skb's unreleased. This results that the clean up code in
the timer callback is never called, preventing also proper garbage collection.

This fixes neigh_update() to process the pending skb queue immediately if
INCOMPLETE -> FAILED state transtion occurs due to a Netlink request.

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agowimax/i2400m: use -EL3RST to indicate device reset instead of -ERESTARTSYS
Cindy H Kao [Thu, 11 Jun 2009 00:06:19 +0000 (17:06 -0700)] 
wimax/i2400m: use -EL3RST to indicate device reset instead of -ERESTARTSYS

When the i2400m device resets, the driver code will force some
functions to return a -ERESTARTSYS error code, which can is used by
the caller to determine which recovery actions to take.

However, in certain situations the only thing that can be done is to
bubble up said error code to user space, for handling.

However, -ERESTARSYS was a poor choice, as it is supposed to be used
by the kernel only.

As such, replace -ERESTARTSYS with -EL3RST; as well, in
i2400m_msg_to_dev(), when the device is in boot mode (following a
recent reset), return -EL3RST instead of -ENODEV (meaning the device
is in bootrom mode after a reset, not that the device was
disconnected, and thus, normal commands cannot be executed).

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
15 years agowimax/i2400m: when bootstrap fails, reinitialize the bootrom
Cindy H Kao [Wed, 10 Jun 2009 23:52:10 +0000 (16:52 -0700)] 
wimax/i2400m: when bootstrap fails, reinitialize the bootrom

When a device reset happens during firmware load [in
i2400m_dev_bootstrap()], __i2400m_dev_start() will retry a number of
times. However, for those retries to be able to accomplish anything,
the device's bootrom has to be reinitialized.

Thus, on the retry path, pass the I2400M_MAC_REINIT to the firmware
load code.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
15 years agowimax/i2400m/sdio: Move all the RX code to a unified, IRQ based receive routine
Inaky Perez-Gonzalez [Thu, 7 May 2009 08:02:39 +0000 (01:02 -0700)] 
wimax/i2400m/sdio: Move all the RX code to a unified, IRQ based receive routine

The current SDIO code was working in polling mode for boot-mode
(firmware load) mode. This was causing issues on some hardware.

Moved all the RX code to use a unified IRQ handler that based on the
type of data the device is sending can discriminate and decide which
is the right destination.

As well, all the reads from the device are made to be at least the
block size (256); the driver will ignore the rest when not needed.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: don't reset device when bootrom init retries are exceeded
Inaky Perez-Gonzalez [Fri, 5 Jun 2009 01:31:26 +0000 (09:31 +0800)] 
wimax/i2400m: don't reset device when bootrom init retries are exceeded

When i2400m_bootrom_init() fails to put the device into a state of
being ready to accept firmware, the driver was currently trying to
reset it if it failed to do so. This is not too useful; as part of
trying to put the device in the right state a few resets have already
been tried.

At this point, things are probably fried out and an extra reset might
do more harm than good (for example causing reseting of other
functions in the same composite device).

So it is left up to the callers to determine the error path to take
(at the end this is always i2400m_setup(), who depending on how many
retries are left, might give up on the device).

From a fix by Cindy H. Kao.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m/sdio: Add device specific poke table.
Dirk Brandewie [Thu, 21 May 2009 18:56:35 +0000 (11:56 -0700)] 
wimax/i2400m/sdio: Add device specific poke table.

Add a poke table for the SDIO device (as it is different than USB).

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
15 years agowimax/i2400m: move boot time poke table out of common driver
Dirk Brandewie [Thu, 21 May 2009 18:56:34 +0000 (11:56 -0700)] 
wimax/i2400m: move boot time poke table out of common driver

This change moves the table of "pokes" performed on the device at boot
time to the bus specific portion of the driver.

Different models of the i2400m device supported by this driver require
different poke tables, thus having a single table that works for all
is impossible. For that, the table is moved to the bus-specific
driver, who can decide which table to use based on the specifics of
the device and point the generic driver to it.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
15 years agowimax/i2400m: Allow bus-specific driver to specify retry count
Inaky Perez-Gonzalez [Wed, 3 Jun 2009 08:13:14 +0000 (16:13 +0800)] 
wimax/i2400m: Allow bus-specific driver to specify retry count

The code that sets up the i2400m (firmware load and general driver
setup after it) includes a couple of retry loops.

The SDIO device sometimes can get in more complicated corners than the
USB one (due to its interaction with other SDIO functions), that
require trying a few more times.

To solve that, without having a failing USB device taking longer to be
considered dead, allow the retry counts to be specified by the
bus-specific driver, which the general driver takes as a parameter.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: if a device reboot happens during probe, handle it
Inaky Perez-Gonzalez [Wed, 3 Jun 2009 01:45:55 +0000 (09:45 +0800)] 
wimax/i2400m: if a device reboot happens during probe, handle it

When a device reboot happens when we are under probe, with init_mutex
taken, make sure we can recover. Have dev_reset_handle set boot mode
and i2400m_msg_to_dev() will see it and fail gracefully instead of
timing out.

Found and diagnosed by Cindy H. Kao.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: fix oops when the TX FIFO fills up due to a missing check
Inaky Perez-Gonzalez [Wed, 27 May 2009 08:04:40 +0000 (01:04 -0700)] 
wimax/i2400m: fix oops when the TX FIFO fills up due to a missing check

When the TX FIFO filled up and i2400m_tx_new() failed to allocate a
new TX message header, a missing check for said condition was causing a
kernel oops when trying to dereference a NULL i2400m->tx_msg pointer.

Found and diagnosed by Cindy H. Kao.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: don't reset device on i2400m_dev_shutdown()
Inaky Perez-Gonzalez [Fri, 22 May 2009 02:46:45 +0000 (19:46 -0700)] 
wimax/i2400m: don't reset device on i2400m_dev_shutdown()

i2400m_dev_shutdown() tried to reset the device to put it in a known
state before shutting down.

But that turned out to be pointless. We reach this case in two paths:

 1 - when the device resets, to clean up state
 2 - when the driver is unloaded, for the same

however, in both cases it is pointless; in (1) the device is already
reset, why do it again? in (2) we can't -- the USB stack, for example,
doesn't allow communicating with the device when the driver is being
unbound and if the device is disconnected, the device is gone already.

So just remove it. Leave the function as a placeholder for future
cleanups that will be done from data allocated by the driver during
device operation.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: fix panic due to missed corner cases on tail_room calculation
Inaky Perez-Gonzalez [Thu, 21 May 2009 00:40:35 +0000 (17:40 -0700)] 
wimax/i2400m: fix panic due to missed corner cases on tail_room calculation

i2400m_tx_skip_tail() needs to handle the special case of being called
when the tail room that is left over in the FIFO is zero.

This happens when a TX message header was opened at the very end of
the FIFO (without payloads). The i2400m_tx_close() code already marked
said TX message (header) to be skipped and this function should be
doing nothing.

It is called anyway because it is part of a common "corner case" path
handling which takes care of more cases than only this one.

The tail room computation was also improved to take care of the case
when tx_in is at the end of the buffer boundary; tail_room has to be
modded (%) to the buffer size. To do that in a single well-documented
place, __i2400m_tx_tail_room() is introduced and used.

Treat i2400m->tx_in == 0 as a corner case and handle it accordingly.

Found and diagnosed by Cindy H. Kao.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: fix panic/warnings caused by missed check on empty TX message
Inaky Perez-Gonzalez [Thu, 21 May 2009 00:16:05 +0000 (17:16 -0700)] 
wimax/i2400m: fix panic/warnings caused by missed check on empty TX message

In some situations, when a new TX message header is started, there
might be no space for data payloads. In this case the message is left
with zero payloads and the i2400m_tx_close() function has just to mark
it as "to skip". If it tries to go ahead it will overwrite things
because there is no space to add padding as defined by the
bus-specific layer. This can cause buffer overruns and in some stress
cases, panics.

Found and diagnosed by Cindy H. Kao.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: rename misleading I2400M_PL_PAD to I2400M_PL_ALIGN
Inaky Perez-Gonzalez [Wed, 20 May 2009 23:53:30 +0000 (16:53 -0700)] 
wimax/i2400m: rename misleading I2400M_PL_PAD to I2400M_PL_ALIGN

The constant is being use as an alignment factor, not as a padding
factor; made reading/reviewing the code quite confusing.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m/sdio: Implement I2400M_RT_BUS reset type
Dirk Brandewie [Tue, 12 May 2009 14:54:00 +0000 (07:54 -0700)] 
wimax/i2400m/sdio: Implement I2400M_RT_BUS reset type

This reset type causes the WiMAX function to be disabled and
re-enabled, which will force the WiMAX device to reset and enter boot
mode.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
15 years agowimax/i2400m: Change d_printf() level for secure boot messages
Dirk Brandewie [Tue, 12 May 2009 13:22:27 +0000 (06:22 -0700)] 
wimax/i2400m: Change d_printf() level for secure boot messages

Changing debug level of print out to support validation engineers
getting the messages they need.

Signed-off-by: <dirk.j.brandewie@intel.com>
15 years agowimax/i2400m: i2400m_schedule_work() doesn't need i2400m->work_queue
Inaky Perez-Gonzalez [Fri, 8 May 2009 19:46:26 +0000 (12:46 -0700)] 
wimax/i2400m: i2400m_schedule_work() doesn't need i2400m->work_queue

By mistake, the BUG_ON() check was left in there and it will fail when
called if i2400m->work_queue is still not setup.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: i2400m's work queue should be initialized before RX support
Inaky Perez-Gonzalez [Fri, 8 May 2009 20:02:41 +0000 (13:02 -0700)] 
wimax/i2400m: i2400m's work queue should be initialized before RX support

RX support is the only user of the work-queue, to process
reports/notifications from the device. Thus, it needs the work queue
to be initialized first.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: don't call netif_start_queue() in _tx_msg_sent()
Inaky Perez-Gonzalez [Fri, 8 May 2009 15:58:51 +0000 (08:58 -0700)] 
wimax/i2400m: don't call netif_start_queue() in _tx_msg_sent()

Reported and fixed by Cindy H Kao.

When the device is stopped __i2400m_dev_stop() stops the network
queue.

However, when this is done in the middle of heavy network operation,
when the bus-specific subdriver is still wrapping up and it reports a
sent TX transaction with _tx_msg_sent() right after the device was
stopped, the queue was being started again, which was causing a stream
of oopsen and finally a panic.

In any case, said call has no place there. It's a left over from an
early implementation that was discarded later on.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agowimax/i2400m: introduce module parameter to disable entering power save
Inaky Perez-Gonzalez [Thu, 7 May 2009 17:27:42 +0000 (10:27 -0700)] 
wimax/i2400m: introduce module parameter to disable entering power save

The i2400m driver waits for the device to report being ready for
entering power save before asking it to do so. This module parameter
allows control of said operation; if disabled, the driver won't ask
the device to enter power save mode.

This is useful in setups where power saving is not so important or
when the overhead imposed by network reentry after power save is not
acceptable; by combining this with parameter 'idle_mode_disabled', the
driver will always maintain both the connection and the device in
active state.

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
15 years agonet: No more expensive sock_hold()/sock_put() on each tx
Eric Dumazet [Thu, 11 Jun 2009 09:55:43 +0000 (02:55 -0700)] 
net: No more expensive sock_hold()/sock_put() on each tx

One of the problem with sock memory accounting is it uses
a pair of sock_hold()/sock_put() for each transmitted packet.

This slows down bidirectional flows because the receive path
also needs to take a refcount on socket and might use a different
cpu than transmit path or transmit completion path. So these
two atomic operations also trigger cache line bounces.

We can see this in tx or tx/rx workloads (media gateways for example),
where sock_wfree() can be in top five functions in profiles.

We use this sock_hold()/sock_put() so that sock freeing
is delayed until all tx packets are completed.

As we also update sk_wmem_alloc, we could offset sk_wmem_alloc
by one unit at init time, until sk_free() is called.
Once sk_free() is called, we atomic_dec_and_test(sk_wmem_alloc)
to decrement initial offset and atomicaly check if any packets
are in flight.

skb_set_owner_w() doesnt call sock_hold() anymore

sock_wfree() doesnt call sock_put() anymore, but check if sk_wmem_alloc
reached 0 to perform the final freeing.

Drawback is that a skb->truesize error could lead to unfreeable sockets, or
even worse, prematurely calling __sk_free() on a live socket.

Nice speedups on SMP. tbench for example, going from 2691 MB/s to 2711 MB/s
on my 8 cpu dev machine, even if tbench was not really hitting sk_refcnt
contention point. 5 % speedup on a UDP transmit workload (depends
on number of flows), lowering TX completion cpu usage.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: No need to check vfree() pointer.
Figo.zhang [Thu, 11 Jun 2009 09:49:10 +0000 (02:49 -0700)] 
netxen: No need to check vfree() pointer.

vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Fix be_tx_q_clean() being called on freed queues
Sathya Perla [Wed, 10 Jun 2009 02:23:50 +0000 (02:23 +0000)] 
be2net: Fix be_tx_q_clean() being called on freed queues

In the tx queue destroy path, be_tx_q_clean() is currently called after the tx queues are freed; it must be called before.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Fix early reset of rx-completion
Sathya Perla [Wed, 10 Jun 2009 02:23:28 +0000 (02:23 +0000)] 
be2net: Fix early reset of rx-completion

be_rx_compl_get() must not reset(via the valid word) the rx_compl as the rx_compl is not processed yet; it must be reset after it is processed.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Fix rx stats updation in non-lro path
Sathya Perla [Wed, 10 Jun 2009 02:21:56 +0000 (02:21 +0000)] 
be2net: Fix rx stats updation in non-lro path

rx stats are not getting updated when an rx_compl with only one frag is rcvd in non-lro path.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: fix netdev stats rx_errors and rx_dropped
Sathya Perla [Wed, 10 Jun 2009 02:21:16 +0000 (02:21 +0000)] 
be2net: fix netdev stats rx_errors and rx_dropped

Fix netdev stat rx_errors to cover length related errors and checksum errors and rx_dropped to the pkts dropped due to lack of buffers

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: Use cancel_delayed_work_sync instead of cancel_delayed_work()
Sathya Perla [Wed, 10 Jun 2009 02:18:35 +0000 (02:18 +0000)] 
be2net: Use cancel_delayed_work_sync instead of cancel_delayed_work()

Use cancel_delayed_work_sycn instead of cancel_delayed_work() to reliably kill be_worker() as it rearms itself.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotehuti: No need check vfree() pointer.
Figo.zhang [Wed, 10 Jun 2009 04:18:38 +0000 (04:18 +0000)] 
tehuti: No need check vfree() pointer.

vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovxge: No need for check vfree() pointer.
Figo.zhang [Wed, 10 Jun 2009 04:21:55 +0000 (04:21 +0000)] 
vxge: No need for check vfree() pointer.

vfree() does its own 'NULL' check, so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: remove __GFP_NOFAIL usage
Divy Le Ray [Tue, 9 Jun 2009 23:25:21 +0000 (23:25 +0000)] 
cxgb3: remove __GFP_NOFAIL usage

Pre-allocate a skb at init time to be used for control messages to the HW
if skb allocation fails.

Tolerate failures to send messages initializing some memories at the cost of
parity error detection for these memories.
Retry sending connection id release messages if both alloc_skb(GFP_ATOMIC)
and alloc_skb(GFP_KERNEL) fail.
Do not bring the interface up if messages binding queue set to port fail to
be sent.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor8169: use dev_kfree_skb() instead of dev_kfree_skb_irq()
Eric Dumazet [Tue, 9 Jun 2009 22:55:53 +0000 (22:55 +0000)] 
r8169: use dev_kfree_skb() instead of dev_kfree_skb_irq()

rtl8169_tx_interrupt() is used from NAPI context, it can
directly free skbs. dev_kfree_skb_irq() is a leftover from
pre-NAPI times of this driver.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Expose 100/1000BASE-T MDI-X status via ethtool
Ben Hutchings [Wed, 10 Jun 2009 05:30:05 +0000 (05:30 +0000)] 
sfc: Expose 100/1000BASE-T MDI-X status via ethtool

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomdio: Expose 10GBASE-T MDI-X status via ethtool
Ben Hutchings [Wed, 10 Jun 2009 05:28:04 +0000 (05:28 +0000)] 
mdio: Expose 10GBASE-T MDI-X status via ethtool

This is available in a standard MDIO register in 10GBASE-T PHYs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Allow RX buf rings to be > than 4096 bytes.
Ron Mercer [Wed, 10 Jun 2009 15:49:34 +0000 (15:49 +0000)] 
qlge: Allow RX buf rings to be > than 4096 bytes.

RX buffer rings can be comprised of non-contiguous fixed
size chunks of memory. The ring is given to the hardware
as a pointer to a location that stores the location of
the queue.  If the queue is greater than 4096 bytes then
the hardware gets a list of said pointers.
This patch addes the necessary logic to generate the list if
the queue size exceeds 4096.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: Relax alignment on TX harware queue.
Ron Mercer [Wed, 10 Jun 2009 15:49:33 +0000 (15:49 +0000)] 
qlge: Relax alignment on TX harware queue.

The alignment was on size of queue boundary, but the hardware
only requires 4-byte alignment.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl1c: WAKE_MCAST tested twice, not WAKE_UCAST
Roel Kluin [Wed, 10 Jun 2009 09:55:03 +0000 (09:55 +0000)] 
atl1c: WAKE_MCAST tested twice, not WAKE_UCAST

The WAKE_MCAST bit is tested twice, the first should be WAKE_UCAST.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Jie Yang <jie.yang@atheros.com>
Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <csnook@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agode2104x: support for systems lacking cache coherence
Risto Suominen [Wed, 10 Jun 2009 09:55:00 +0000 (09:55 +0000)] 
de2104x: support for systems lacking cache coherence

Add a configurable Descriptor Skip Length for systems that lack cache
coherence.

(akpm: I think this should be done as a module parameter, not a
compile-tinme option)

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
Cc: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net/macvlan.c: fix cloning of tagged VLAN interfaces
sg.tweak@gmail.com [Wed, 10 Jun 2009 09:55:02 +0000 (09:55 +0000)] 
drivers/net/macvlan.c: fix cloning of tagged VLAN interfaces

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13348

akpm: the reporter disappeared, so I typed it in again.

It is not possible to make clone of tagged VLAN interface to be used as
mac-based vlan interfave.

How reproducible:
Use any 802.1q tagged vlan interface, e.g. eth2.700 and clone it:

  ip link add link eth2.700 address 00:04:75:cb:38:09 macvlan0 type macvlan
  ip link set dev macvlan0 up
  ip addr add 10.195.1.1/24 dev macvlan0

So far, so good. Now try to ping anything via macvlan0:

  ping 10.195.1.2

Actual results:
For every attempted packet tx kernel writes to console:

------------[ cut here ]------------
WARNING: at net/8021q/vlan_dev.c:254 vlan_dev_hard_header+0x36/0x126 [8021q]()
Hardware name: M22ES
Modules linked in: arptable_filter arp_tables bridge veth macvlan arc4 ecb
ppp_mppe ppp_async crc_ccitt ppp_generic slhc autofs4 sunrpc 8021q garp stp
ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_tcpudp
x_tables dm_mirror dm_region_hash dm_log dm_multipath dm_mod sbs sbshc lp
floppy snd_intel8x0 joydev snd_seq_dummy snd_intel8x0m snd_ac97_codec
ide_cd_mod ac97_bus snd_seq_oss cdrom snd_seq_midi_event serio_raw snd_seq
snd_seq_device snd_pcm_oss snd_mixer_oss parport_pc snd_pcm parport battery
8139cp snd_timer i2c_sis96x ac button snd rtc_cmos rtc_core 8139too soundcore
rtc_lib mii i2c_core pcspkr snd_page_alloc pata_sis libata sd_mod scsi_mod ext3
jbd ehci_hcd ohci_hcd uhci_hcd [last unloaded: ip_tables]
Pid: 0, comm: swapper Tainted: G        W  2.6.29.3 #1
Call Trace:
 [<c0425f48>] warn_slowpath+0x60/0x9f
 [<c0425f6f>] warn_slowpath+0x87/0x9f
 [<dffb850d>] vlan_dev_hard_header+0x0/0x126 [8021q]
 [<dffb8543>] vlan_dev_hard_header+0x36/0x126 [8021q]
 [<dffb850d>] vlan_dev_hard_header+0x0/0x126 [8021q]
 [<df83155d>] macvlan_hard_header+0x3c/0x47 [macvlan]
 [<df831521>] macvlan_hard_header+0x0/0x47 [macvlan]
 [<c062bf3f>] arp_create+0xef/0x1ff
 [<c062c08c>] arp_send+0x3d/0x54
 [<c062c916>] arp_solicit+0x16c/0x177
 [<c05fadd2>] neigh_timer_handler+0x227/0x269
 [<c05fabab>] neigh_timer_handler+0x0/0x269
 [<c042ce4d>] run_timer_softirq+0xf0/0x141
 [<c0429e5a>] __do_softirq+0x76/0xf8
 [<c0429de4>] __do_softirq+0x0/0xf8
 <IRQ>  [<c044fb67>] handle_level_irq+0x0/0xad
 [<c0429db7>] irq_exit+0x35/0x62
 [<c04046bb>] do_IRQ+0xdf/0xf4
 [<c04035a7>] common_interrupt+0x27/0x2c
 [<c04079c5>] default_idle+0x2a/0x3d
 [<c0401bb6>] cpu_idle+0x57/0x70

Macvlan driver always uses standard ethernet header length for all types
of interface to which it is linked.  This patch fixes this problem.

Reported-by: <sg.tweak@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe100: add non-MII PHY support
Andreas Mohr [Wed, 10 Jun 2009 09:55:04 +0000 (09:55 +0000)] 
e100: add non-MII PHY support

Restore support for cards with MII-lacking PHYs as compared to removed
pre-2.6.29 eepro100 driver: use full low-level MII I/O access abstraction
by providing clean PHY-specific mdio_ctrl() functions for either standard
MII-compliant cards, slightly special ones or non-MII PHY ones.

We now have another netdev_priv member for mdio_ctrl(), thus we have some
array indirection, but we save some additional opcodes for specific
phy_82552_v handling in the common case.

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Andreas Mohr <andi@lisas.de>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoieee802154: Use '%Zu' printf format for size_t.
David S. Miller [Thu, 11 Jun 2009 09:10:19 +0000 (02:10 -0700)] 
ieee802154: Use '%Zu' printf format for size_t.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 11 Jun 2009 06:41:43 +0000 (23:41 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6

15 years agocfg80211: fix rfkill locking problem
Johannes Berg [Wed, 10 Jun 2009 14:50:29 +0000 (16:50 +0200)] 
cfg80211: fix rfkill locking problem

rfkill currently requires a global lock within the
rfkill_register() function, and holds that lock over
calls to the set_block() methods. This means that we
cannot hold a lock around rfkill_register() that we
also require in set_block(), directly or indirectly.
Fix cfg80211 to register rfkill outside the block
locked by its global lock. Much of what cfg80211 does
in the locked block doesn't need to be locked anyway.

Reported-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable PS while probing AP
Johannes Berg [Wed, 10 Jun 2009 13:16:52 +0000 (15:16 +0200)] 
mac80211: disable PS while probing AP

When associated, but probing the AP because we detected
beacon loss, we need to disable powersave to be able to
receive the probe response. Change the code to do that by
checking whether we're trying to probe when determining
the possibility of going into PS, and recalculate the PS
ability at the necessary spots.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable moving between PS modes during scan
Luis R. Rodriguez [Wed, 10 Jun 2009 13:16:15 +0000 (15:16 +0200)] 
mac80211: disable moving between PS modes during scan

We don't want to trigger moving between PS mode during scan,
because then we will sometimes end up sending nullfunc frames
during scan. We're supposed to only send one prior to scan
and after scan.

This fixes an oops which occured due to an assert in ath9k:

http://marc.info/?l=linux-wireless&m=124277331319024

The assert was happening because the rate control algorithm
figures it should find at least one valid dual stream or
single stream rate. Since we allow mac80211 to send nullfunc
frames during scan and dynamic PS was enabled at times we ended
up trying to send nullfunc frames for the target sta on the
wrong band for which we have no valid rate to communicate with
it. This breaks the assumptions in rate control.

We determine we also need to disable moving between PS modes
when not associated so lets just add that now as well, and we
should not have a ps_sdata when that interface cannot actually
go into PS because it's not associated.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: minor rfkill cleanup
Bob Copeland [Wed, 10 Jun 2009 03:43:11 +0000 (23:43 -0400)] 
ath5k: minor rfkill cleanup

Always enable rfkill since the ifdefs in the code is not really worth
the Kconfig option.  Also fix a few code style things, and remove the
usage of the ah_gpio[] array so we can remove it later.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: clean up return value of __ieee80211_parse_tx_radiotap
Johannes Berg [Tue, 9 Jun 2009 17:48:25 +0000 (19:48 +0200)] 
mac80211: clean up return value of __ieee80211_parse_tx_radiotap

The return type has more than two values, but it can validly
only ever return TX_DROP and TX_CONTINUE, so use a bool
instead of ieee80211_tx_result.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: don't use master netdev name
Johannes Berg [Tue, 9 Jun 2009 14:18:32 +0000 (16:18 +0200)] 
mac80211: don't use master netdev name

Always use the wiphy name instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix tx stuck when connected to aggr disabled HT AP
Vasanthakumar Thiagarajan [Tue, 9 Jun 2009 09:58:21 +0000 (15:28 +0530)] 
ath9k: Fix tx stuck when connected to aggr disabled HT AP

This patch along with my previous patch in mac80211 "Fix the
way ADDBA count..", fixes hang in tx when connected to an HT
AP which rejects/times out on addba req.

AGGR_ADDBA_PROGRESS should be cleared in aggr state when addba
negotiation is terminated due to either addba response is timed out
or addba is denied by the AP. With out clearing this bit,
all frames are queued onto s/w queue for getting tx'd as aggr and
will never be scheduled onto hw queue.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Fix the way ADDBA request count being modified
Vasanthakumar Thiagarajan [Tue, 9 Jun 2009 08:41:46 +0000 (14:11 +0530)] 
mac80211: Fix the way ADDBA request count being modified

addba_req_num[tid] is supposed to have the count of consecutive
addba request attempts on 'tid' which failed. This count is checked
against a retry threshold (3 times) before starting the addba negotiation.
This patch fixes the way this addba count is incremented/reset and thereby
avoids indefinite addba attempts.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix for duplicate response for driver reg request
Luis R. Rodriguez [Tue, 9 Jun 2009 01:54:37 +0000 (18:54 -0700)] 
cfg80211: fix for duplicate response for driver reg request

As Pavel puts userspace can be stupid and should not
cause kernel crashes. In this case Pavel was able to
find a crash here but unable to reproduce. Either way
lets deal with this.

This should fix:

------------[ cut here ]------------
kernel BUG at /home/proski/src/linux-2.6/net/wireless/reg.c:2132!
Oops: Exception in kernel mode, sig: 5 [#1]
PowerMac
Modules linked in: ath5k ath [last unloaded: scsi_wait_scan]
NIP: c02f3eac LR: c02f3d08 CTR: 00000000
REGS: ef107aa0 TRAP: 0700   Not tainted  (2.6.30-rc8-wl)
MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 88002442  XER: 20000000
TASK = ef84acb0[834] 'crda' THREAD: ef106000
GPR00: ef953840 ef107b50 ef84acb0 ef1380bc 00000006 c035a5c8 ef107b90 c035a5c8
GPR08: 00080005 efb68980 c0445628 ef130004 28002422 10019ce0 10012d3c 00000001
GPR16: 1070b2ac 00000005 48023558 1070b380 4802304c 00000000 ef107ddc c035a5c8
GPR24: ef107b78 c0443350 ef8bcb00 00000005 ef138080 c04a6a70 c04a0000 ef8bcb00
NIP [c02f3eac] set_regdom+0x4c4/0x4ec
LR [c02f3d08] set_regdom+0x320/0x4ec
Call Trace:
[ef107b50] [c02f3d08] set_regdom+0x320/0x4ec (unreliable)
[ef107b70] [c02f9d10] nl80211_set_reg+0x140/0x2d0
[ef107bc0] [c02aa2b8] genl_rcv_msg+0x204/0x228
[ef107c10] [c02a97cc] netlink_rcv_skb+0xe8/0x10c
[ef107c30] [c02aa094] genl_rcv+0x3c/0x5c
[ef107c40] [c02a9050] netlink_unicast+0x308/0x36c
[ef107c80] [c02a92bc] netlink_sendmsg+0x208/0x2f0
[ef107cd0] [c0282048] sock_sendmsg+0xac/0xe4
[ef107db0] [c02822b4] sys_sendmsg+0x234/0x2d8
[ef107f00] [c0283a88] sys_socketcall+0x108/0x258
[ef107f40] [c0012790] ret_from_syscall+0x0/0x38

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Add fw capabilities
Michael Buesch [Mon, 8 Jun 2009 19:04:57 +0000 (21:04 +0200)] 
b43: Add fw capabilities

Add automagic feature flags, so the firmware can tell the driver
about supported features and the driver can switch features on/off as
needed.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: don't impose global states on resume (just restore the previous states)
Alan Jenkins [Mon, 8 Jun 2009 12:12:23 +0000 (13:12 +0100)] 
rfkill: don't impose global states on resume (just restore the previous states)

Once rfkill-input is disabled, the "global" states will only be used as
default initial states.

Since the states will always be the same after resume, we shouldn't
generate events on resume.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agosony-laptop: no need to unblock rfkill on load
Alan Jenkins [Mon, 8 Jun 2009 10:31:11 +0000 (11:31 +0100)] 
sony-laptop: no need to unblock rfkill on load

The re-written rfkill core ensures rfkill devices are initialized to
the system default state.  The core calls set_block after registration
so the driver shouldn't need to.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorfkill: remove set_global_sw_state
Alan Jenkins [Mon, 8 Jun 2009 12:27:27 +0000 (13:27 +0100)] 
rfkill: remove set_global_sw_state

rfkill_set_global_sw_state() (previously rfkill_set_default()) will no
longer be exported by the rewritten rfkill core.

Instead, platform drivers which can provide persistent soft-rfkill state
across power-down/reboot should indicate their initial state by calling
rfkill_set_sw_state() before registration.  Otherwise, they will be
initialized to a default value during registration by a set_block call.

We remove existing calls to rfkill_set_sw_state() which happen before
registration, since these had no effect in the old model.  If these
drivers do have persistent state, the calls can be put back (subject
to testing :-).  This affects hp-wmi and acer-wmi.

Drivers with persistent state will affect the global state only if
rfkill-input is enabled.  This is required, otherwise booting with
wireless soft-blocked and pressing the wireless-toggle key once would
have no apparent effect.  This special case will be removed in future
along with rfkill-input, in favour of a more flexible userspace daemon
(see Documentation/feature-removal-schedule.txt).

Now rfkill_global_states[n].def is only used to preserve global states
over EPO, it is renamed to ".sav".

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: do not pass PS frames out of mac80211 again
Johannes Berg [Sun, 7 Jun 2009 19:58:37 +0000 (21:58 +0200)] 
mac80211: do not pass PS frames out of mac80211 again

In order to handle powersave frames properly we had needed
to pass these out to the device queues again, and introduce
the skb->requeue bit. This, however, also has unnecessary
overhead by needing to 'clean up' already tried frames, and
this clean-up code is also buggy when software encryption
is used.

Instead of sending the frames via the master netdev queue
again, simply put them into the pending queue. This also
fixes a problem where frames for that particular station
could be reordered when some were still on the software
queues and older ones are re-injected into the software
queue after them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>