]> git.karo-electronics.de Git - mv-sheeva.git/log
mv-sheeva.git
15 years agorndis_wlan: stop workers on rndis_wlan_stop() and restore on rndis_wlan_reset()
Jussi Kivilinna [Thu, 30 Jul 2009 16:41:26 +0000 (19:41 +0300)]
rndis_wlan: stop workers on rndis_wlan_stop() and restore on rndis_wlan_reset()

Driver doesn't need to poll statistics/link status when stopped.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agousbnet: allow "minidriver" to prevent urb unlinking on usbnet_stop
Jussi Kivilinna [Thu, 30 Jul 2009 16:41:20 +0000 (19:41 +0300)]
usbnet: allow "minidriver" to prevent urb unlinking on usbnet_stop

rndis_wlan devices freeze after running usbnet_stop several times. It appears
that firmware freezes in state where it does not respond to any RNDIS commands
and device have to be physically unplugged/replugged. This patch lets
minidrivers to disable unlink_urbs on usbnet_stop through new info flag.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix NETDEV_UNREGISTER notifier
Johannes Berg [Thu, 30 Jul 2009 12:04:01 +0000 (14:04 +0200)]
cfg80211: fix NETDEV_UNREGISTER notifier

It's possible to get the NETDEV_UNREGISTER callback multiple
times (see net/core/dev.c:netdev_wait_allrefs) and this will
completely mess up our cleanup code. To avoid that, clean up
only when the interface is still on the wiphy interface list
from which it's removed on the first NETDEV_UNREGISTER call.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: don't export symbols not needed in other modules
Johannes Berg [Thu, 30 Jul 2009 09:58:16 +0000 (11:58 +0200)]
iwlwifi: don't export symbols not needed in other modules

Even with the split into iwlcore/agn/3945 not all symbols
that cross file boundaries are needed in other modules, a
few are only used within iwlcore, for example.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: redefine usage of the mac80211 workqueue
Luis R. Rodriguez [Thu, 30 Jul 2009 00:08:07 +0000 (20:08 -0400)]
mac80211: redefine usage of the mac80211 workqueue

The mac80211 workqueue exists to enable mac80211 and drivers
to queue their own work on a single threaded workqueue. mac80211
takes care to flush the workqueue during suspend but we never
really had requirements on drivers for how they should use
the workqueue in consideration for suspend.

We extend mac80211 to document how the mac80211 workqueue should
be used, how it should not be used and finally move raw access to
the workqueue to mac80211 only. Drivers and mac80211 use helpers
to queue work onto the mac80211 workqueue:

  * ieee80211_queue_work()
  * ieee80211_queue_delayed_work()

These helpers will now warn if mac80211 already completed its
suspend cycle and someone is trying to queue work. mac80211
flushes the mac80211 workqueue prior to suspend a few times,
but we haven't taken the care to ensure drivers won't add more
work after suspend. To help with this we add a warning when
someone tries to add work and mac80211 already completed the
suspend cycle.

Drivers should ensure they cancel any work or delayed work
in the mac80211 stop() callback.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoat76c50x-usb: remove unneeded flush_workqueue() at usb disconnect
Luis R. Rodriguez [Wed, 29 Jul 2009 21:20:41 +0000 (14:20 -0700)]
at76c50x-usb: remove unneeded flush_workqueue() at usb disconnect

This driver only uses the mac80211 workqueue and mac80211 requires us to
cancel all work at driver stop. Since we now have the cancels in the right
places at stop() we really don't need to flush the mac80211 workqueue so
remove it.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: fix CAB queue operation
Bob Copeland [Wed, 29 Jul 2009 21:32:28 +0000 (17:32 -0400)]
ath5k: fix CAB queue operation

We need to process tx descriptors for all queues (currently main tx
queue and cabq) which may have triggered the TX completion interrupt.
Otherwise, the queues can get stuck after sending a few frames.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoorinoco: enable cfg80211 "set_channel" operation
Holger Schurig [Tue, 28 Jul 2009 14:34:26 +0000 (16:34 +0200)]
orinoco: enable cfg80211 "set_channel" operation

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: remove EXPERIMENTAL marker
Luis R. Rodriguez [Mon, 27 Jul 2009 23:52:10 +0000 (16:52 -0700)]
ar9170: remove EXPERIMENTAL marker

Cc: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43: Work around mac80211 race condition
Larry Finger [Wed, 29 Jul 2009 15:54:06 +0000 (10:54 -0500)]
b43: Work around mac80211 race condition

As shown in http://thread.gmane.org/gmane.linux.kernel.wireless.general/36497,
mac80211 has a bug that allows a call to the TX routine after the queues have
been stopped. This situation will only occur under extreme stress. Although
b43 does not crash when this condition occurs, it does generate a WARN_ON and
also logs a queue overrun message. This patch recognizes b43 is not at fault
and logs a message only when the most verbose debugging mode is enabled. In
the unlikely event that the queue is not stopped when the DMA queue becomes
full, then a warning is issued.

During testing of this patch with one output stream running repeated tcpperf
writes and a second running a flood ping, this routine was entered with
the DMA ring stopped about once per hour. The condition where the DMA queue is
full but the ring has not been stopped has never been seen by me.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: update PCU opmode whenever a new interface is added
Bob Copeland [Wed, 29 Jul 2009 14:29:03 +0000 (10:29 -0400)]
ath5k: update PCU opmode whenever a new interface is added

Previously, we would store the operating mode at interface up time,
but only update the PCU registers when the next reset happened.
The result is that if beacon configuration (ops->bss_info_changed)
happens before ops->config, we will program the wrong things into
the timer registers.  Consequently, beacons won't work in AP mode
until after a reset (channel change, scan etc.).

This is fragile anyway so just program the opmode as soon as
mac80211 gives it to us.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix sparse warnings/errors
Johannes Berg [Wed, 29 Jul 2009 13:46:21 +0000 (15:46 +0200)]
mac80211: fix sparse warnings/errors

sparse complains about a shadowed variable, which
we can just rename, and lots of stuff if the API
tracer is enabled, so kick out the tracer code in
a sparse run -- the macros just confuse it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Remove unused ath9k_hw_intrget()
Vasanthakumar Thiagarajan [Wed, 29 Jul 2009 09:35:23 +0000 (15:05 +0530)]
ath9k: Remove unused ath9k_hw_intrget()

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Maintain monotonicity of PER while going across different phy
Vasanthakumar Thiagarajan [Wed, 29 Jul 2009 09:35:22 +0000 (15:05 +0530)]
ath9k: Maintain monotonicity of PER while going across different phy

Monotonicity of packet error rate should be kept when moving
from one phy to another (legacy to ht, ht single stream to dual,
etc). Current code skips updating per for other phys.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Update rate control for 11NA HT40 mode
Vasanthakumar Thiagarajan [Wed, 29 Jul 2009 09:35:21 +0000 (15:05 +0530)]
ath9k: Update rate control for 11NA HT40 mode

Now the lowest rate in 11na ht40 mode is 13.5Mbps this shortens the
range when compared to 11na ht20 mode where the lowest rate is 6.5Mbps.
To improve the range, make 6.5Mbps as the lowest rate in 11na ht40 mode,
this improves the range by approximately 2dB. 11ng ht40 does not have
this issue as it also has basic rates (1, 2, 5.5 and 11).

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: keep track of current_bss for userspace SME
Johannes Berg [Wed, 29 Jul 2009 09:23:49 +0000 (11:23 +0200)]
cfg80211: keep track of current_bss for userspace SME

When a userspace SME is active, we're currently not
keeping track of the BSS properly for reporting the
current link and for internal use. Additionally, it
looks like there is a possible BSS leak in that the
BSS never gets removed from auth_bsses[]. To fix it,
pass the BSS struct to __cfg80211_connect_result in
this case.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable beacons before removing the associated interface
Bob Copeland [Wed, 29 Jul 2009 08:13:03 +0000 (10:13 +0200)]
mac80211: disable beacons before removing the associated interface

When downing interfaces, it's a good idea to tell the driver to
stop sending beacons; that way the driver doesn't need special
code in ops->remove_interface() when it should already handle the
case in bss_info_changed().

This fixes a potential crash with at least ath5k since the vif
pointer will be nullified while beacon interrupts are still active.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agort2x00: Fix build error when crypto support is disabled
Ivo van Doorn [Tue, 28 Jul 2009 16:58:54 +0000 (18:58 +0200)]
rt2x00: Fix build error when crypto support is disabled

When only rt2400pci or rt2500pci is compiled without any of the other
rt2x00 modules, then CONFIG_RT2X00_LIB_CRYPTO will not be enabled.

However rt2x00mac_set_tim() implemented within #ifdef CONFIG_RT2X00_LIB_CRYPTO
statements while the declaration is placed outside the definition. This results in linking
errors as reporte by Ken.

rt2x00_set_tim() has nothing to do with crypto, and thus should be moved outside
of the #ifdef statements.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agort2x00: move experimental on kconfig only to rt2800usb
Luis R. Rodriguez [Tue, 28 Jul 2009 15:03:42 +0000 (08:03 -0700)]
rt2x00: move experimental on kconfig only to rt2800usb

These drivers have been around for a while, if there are issues
they should be reported. rt2800usb is still a bit flaky though.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: use menuconfig for WLAN_PRE80211 and WLAN_80211
Luis R. Rodriguez [Mon, 27 Jul 2009 23:56:15 +0000 (16:56 -0700)]
wireless: use menuconfig for WLAN_PRE80211 and WLAN_80211

This should make it very clear which are pre-802.11 or not

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: remove EXPERIMENTAL marker
Luis R. Rodriguez [Mon, 27 Jul 2009 23:52:09 +0000 (16:52 -0700)]
ath5k: remove EXPERIMENTAL marker

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath: use menuconfig to put ath stuff in its own page
Luis R. Rodriguez [Mon, 27 Jul 2009 23:52:08 +0000 (16:52 -0700)]
ath: use menuconfig to put ath stuff in its own page

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath: simplify kconfig dependency and add documentation
Luis R. Rodriguez [Mon, 27 Jul 2009 23:52:07 +0000 (16:52 -0700)]
ath: simplify kconfig dependency and add documentation

Make atheros wireless drivers visible when you select
"Atheros wirless drivers". Adds links to ath.ko page,
and Atheros drivers page on the wiki.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath: depend on cfg80211
Luis R. Rodriguez [Mon, 27 Jul 2009 23:52:06 +0000 (16:52 -0700)]
ath: depend on cfg80211

The ath.ko module itself depends on cfg80211

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: remove extra return on wireless_nlevent_init()
Luis R. Rodriguez [Mon, 27 Jul 2009 23:10:22 +0000 (16:10 -0700)]
wext: remove extra return on wireless_nlevent_init()

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: remove unneeded flush_workqueue()
Luis R. Rodriguez [Mon, 27 Jul 2009 19:51:37 +0000 (12:51 -0700)]
ar9170: remove unneeded flush_workqueue()

cancel_delayed_work_sync() and cancel_work_sync() are already being
used therefore already waiting for all pending work by the driver
to have been completed, no need to flush the mac80211 workqueue.

Cc: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoat76c50x-usb: cancel scan work at stop callback
Luis R. Rodriguez [Mon, 27 Jul 2009 18:56:24 +0000 (11:56 -0700)]
at76c50x-usb: cancel scan work at stop callback

This should fix suspend as mac80211 expects all work queued
to the mac80211 workqueue to be canceled at driver stop().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar76c50x-usb: cancel promisc work during mac80211 stop
Luis R. Rodriguez [Mon, 27 Jul 2009 18:56:23 +0000 (11:56 -0700)]
ar76c50x-usb: cancel promisc work during mac80211 stop

We weren't ever cancelling this.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move workqueue cancels to stop callback
Luis R. Rodriguez [Mon, 27 Jul 2009 18:53:04 +0000 (11:53 -0700)]
ath9k: move workqueue cancels to stop callback

We should be cancelling our work at the stop callback since
we are borrowing the mac80211 workqueue for our work. As it
stands mac80211 expects this for suspend purposes.

The ath9k specific virtual wiphy stuff need only be
cancelled only when the we have no secondary virtual wiphys.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: move cancel_delayed_work_sync() out of ath_deinit_leds()
Luis R. Rodriguez [Mon, 27 Jul 2009 18:53:03 +0000 (11:53 -0700)]
ath9k: move cancel_delayed_work_sync() out of ath_deinit_leds()

We do this as we'll be moving the cancel elsewhere later.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: re-order cancelling of work on mac80211 workqueue
Luis R. Rodriguez [Mon, 27 Jul 2009 18:53:02 +0000 (11:53 -0700)]
ath9k: re-order cancelling of work on mac80211 workqueue

ath9k uses the mac80211 workqueue for 4 different types of work:

 * Led blink work
 * TX hang monitoring work
 * internal wiphy schedular work
 * channel change work done for internal wiphy schedular

Since the internal wiphy schedular can end up kicking off some
channel channel change work we should first cancel the wiphy
schedular work and then the channel change work.

The TX hang work can be cancelled second since we're going down
anyway.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: disable software retry for now
Johannes Berg [Mon, 27 Jul 2009 18:28:40 +0000 (20:28 +0200)]
mac80211: disable software retry for now

Pavel Roskin reported a problem that seems to be due to
software retry of already transmitted frames. It turns
out that we've never done that correctly, but due to
some recent changes it now crashes in the TX code. I've
added a comment in the patch that explains the problem
better and also points to possible solutions -- which
I can't implement right now.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoneigh: Convert garbage collection from softirq to workqueue
Eric Dumazet [Thu, 30 Jul 2009 03:15:07 +0000 (03:15 +0000)]
neigh: Convert garbage collection from softirq to workqueue

Current neigh_periodic_timer() function is fired by timer IRQ, and
scans one hash bucket each round (very litle work in fact)

As we are supposed to scan whole hash table in 15 seconds, this means
neigh_periodic_timer() can be fired very often. (depending on the number
of concurrent hash entries we stored in this table)

Converting this to a workqueue permits scanning whole table, minimizing
icache pollution, and firing this work every 15 seconds, independantly
of hash table size.

This 15 seconds delay is not a hard number, as work is a deferrable one.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoIPVS: use pr_err and friends instead of IP_VS_ERR and friends
Hannes Eder [Sun, 2 Aug 2009 11:05:41 +0000 (11:05 +0000)]
IPVS: use pr_err and friends instead of IP_VS_ERR and friends

Since pr_err and friends are used instead of printk there is no point
in keeping IP_VS_ERR and friends.  Furthermore make use of '__func__'
instead of hard coded function names.

Signed-off-by: Hannes Eder <heder@google.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc95xx: remove EEPROM loaded check
Steve Glendinning [Tue, 28 Jul 2009 02:37:58 +0000 (02:37 +0000)]
smsc95xx: remove EEPROM loaded check

The eeprom read & write commands currently check the E2P_CMD_LOADED_ bit is
set before allowing any operations.  This prevents any reading or writing
unless a correctly programmed EEPROM is installed.

This patch removes the check, so it is possible to program blank EEPROMS
via ethtool.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoinet6: functions shadow global variable
Gerrit Renker [Tue, 28 Jul 2009 09:48:07 +0000 (09:48 +0000)]
inet6: functions shadow global variable

This renames away a variable clash:
 * ipv6_table[] is declared as a static global table;
 * ipv6_sysctl_net_init() uses ipv6_table to refer/destroy dynamic memory;
 * ipv6_sysctl_net_exit() also uses ipv6_table for the same purpose;
 * both the two last functions call kfree() on ipv6_table.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/atm: Use DIV_ROUND_CLOSEST
Julia Lawall [Sat, 1 Aug 2009 22:48:45 +0000 (22:48 +0000)]
drivers/atm: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
but is perhaps more readable.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression x,__divisor;
@@

- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrivers/net: Use DIV_ROUND_CLOSEST
Julia Lawall [Sat, 1 Aug 2009 09:51:06 +0000 (09:51 +0000)]
drivers/net: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d
but is perhaps more readable.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression x,__divisor;
@@

- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: fix Gen2 pci default settings
Divy Le Ray [Thu, 30 Jul 2009 21:23:39 +0000 (21:23 +0000)]
cxgb3: fix Gen2 pci default settings

Modify control register settings to accommodate the bridge's max read
requset size.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: fix EDC filename string
Divy Le Ray [Thu, 30 Jul 2009 21:23:34 +0000 (21:23 +0000)]
cxgb3: fix EDC filename string

Fix a cut'n paste error in the AEL2020 twinax EDC file name

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovxge: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:14:03 +0000 (09:14 +0000)]
vxge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for vxge.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agos2io: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:56 +0000 (09:13 +0000)]
s2io: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for s2io.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqlge: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:48 +0000 (09:13 +0000)]
qlge: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for qlge.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgb: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:40 +0000 (09:13 +0000)]
ixgb: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for ixgb.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigbvf: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:33 +0000 (09:13 +0000)]
igbvf: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for igbvf.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:25 +0000 (09:13 +0000)]
bnx2x: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for bnx2x.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:18 +0000 (09:13 +0000)]
bnx2: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for bnx2.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl1e: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:10 +0000 (09:13 +0000)]
atl1e: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for atl1e.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl1c: return PCI_ERS_RESULT_DISCONNECT on permanent failure
Dean Nelson [Fri, 31 Jul 2009 09:13:02 +0000 (09:13 +0000)]
atl1c: return PCI_ERS_RESULT_DISCONNECT on permanent failure

PCI drivers that implement the struct pci_error_handlers' error_detected
callback should return PCI_ERS_RESULT_DISCONNECT if the state passed in is
pci_channel_io_perm_failure. This patch fixes the issue for atl1c.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: delete unnecessary code from be_cmd_POST()
Sathya Perla [Mon, 27 Jul 2009 22:53:30 +0000 (22:53 +0000)]
be2net: delete unnecessary code from be_cmd_POST()

When the driver loads the POST stage of the card is expected to be
POST_STAGE_ARMFW_RDY.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: some name changes for consistency
Sathya Perla [Mon, 27 Jul 2009 22:53:10 +0000 (22:53 +0000)]
be2net: some name changes for consistency

be_mbox_db_ring() has been changed to be_mbox_notify() (to be consistent with
be_mcc_notify()) and struct be_mcc_cq_entry changed to be_mcc_compl
to be consistent with rx/tx_compl.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: replace some printks with dev_err()/dev_warn()
Sathya Perla [Mon, 27 Jul 2009 22:52:56 +0000 (22:52 +0000)]
be2net: replace some printks with dev_err()/dev_warn()

And get rid of some unnecessary printks.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: remove pci_func field from be_adapter struct
Sathya Perla [Mon, 27 Jul 2009 22:52:23 +0000 (22:52 +0000)]
be2net: remove pci_func field from be_adapter struct

pci function is available as PCI_FUNC(pdev->devfn); no need for a
separate field.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobe2net: get rid of be_ctrl_info struct/abstraction
Sathya Perla [Mon, 27 Jul 2009 22:52:03 +0000 (22:52 +0000)]
be2net: get rid of be_ctrl_info struct/abstraction

Currently only the be_ctrl_info struct ptr (instead of adapter) is
 passed to all the routines in be_cmds.c. Instead pass be_adapter
ptr to allow access to all its fields. Merge the contents of struct be_ctrl_info
into be_adapter. The resulting code is simpler.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
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 [Fri, 31 Jul 2009 02:26:55 +0000 (19:26 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 31 Jul 2009 02:22:43 +0000 (19:22 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-3945.h
drivers/net/wireless/iwlwifi/iwl-tx.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

15 years agoixgbe: Fix RSC completion delay causing Rx interrupts to stop
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:26:00 +0000 (12:26 +0000)]
ixgbe: Fix RSC completion delay causing Rx interrupts to stop

When a user disables interrupt throttling with ethtool on 82599 devices,
the interrupt timer may not be re-enabled if hardware RSC is running.  The
RSC completions in hardware don't complete before the next ITR event tries
to fire, so the ITR timer never gets re-armed.  This patch increases the
amount of time between interrupts when throttling is disabled (rx-usecs =
0) when the hardware RSC deature is enabled.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Fix usage of second flags bitmap when using LRO/RSC
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:25:28 +0000 (12:25 +0000)]
ixgbe: Fix usage of second flags bitmap when using LRO/RSC

A second set of feature flag bits was added, and the hardware RSC engine
flags were moved there.  However, the code itself didn't make the move
completely to use the new bitmap.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Acked-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Fix netpoll to be properly multiqueue aware
Peter P Waskiewicz Jr [Thu, 30 Jul 2009 12:25:09 +0000 (12:25 +0000)]
ixgbe: Fix netpoll to be properly multiqueue aware

Our ndo_poll_controller callback is broken for anything but non-multiqueue
setups.  This fixes that issue.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxfrm: select sane defaults for xfrm[4|6] gc_thresh
Neil Horman [Fri, 31 Jul 2009 01:52:15 +0000 (18:52 -0700)]
xfrm: select sane defaults for xfrm[4|6] gc_thresh

Choose saner defaults for xfrm[4|6] gc_thresh values on init

Currently, the xfrm[4|6] code has hard-coded initial gc_thresh values
(set to 1024).  Given that the ipv4 and ipv6 routing caches are sized
dynamically at boot time, the static selections can be non-sensical.
This patch dynamically selects an appropriate gc threshold based on
the corresponding main routing table size, using the assumption that
we should in the worst case be able to handle as many connections as
the routing table can.

For ipv4, the maximum route cache size is 16 * the number of hash
buckets in the route cache.  Given that xfrm4 starts garbage
collection at the gc_thresh and prevents new allocations at 2 *
gc_thresh, we set gc_thresh to half the maximum route cache size.

For ipv6, its a bit trickier.  there is no maximum route cache size,
but the ipv6 dst_ops gc_thresh is statically set to 1024.  It seems
sane to select a simmilar gc_thresh for the xfrm6 code that is half
the number of hash buckets in the v6 route cache times 16 (like the v4
code does).

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoIPVS: use pr_fmt
Hannes Eder [Thu, 30 Jul 2009 21:29:44 +0000 (14:29 -0700)]
IPVS: use pr_fmt

While being at it cleanup whitespace.

Signed-off-by: Hannes Eder <heder@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogianfar: fix coalescing setup in ethtool support
Jiajun Wu [Thu, 30 Jul 2009 21:20:42 +0000 (14:20 -0700)]
gianfar: fix coalescing setup in ethtool support

Parameter order for using mk_ic_value(count, time) was reversed,
the patch fixes this.

Signed-off-by: Jiajun Wu <b06378@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopppoe: fix /proc/net/pppoe
Eric Dumazet [Tue, 28 Jul 2009 23:43:08 +0000 (23:43 +0000)]
pppoe: fix /proc/net/pppoe

If a socket is hashed in last slot of pppoe hash table (PPPOE_HASH_SIZE-1)
we report it many times (up to filling seq buffer)
(Only the last socket of last slot)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoeexpress: Read buffer overflow
roel kluin [Wed, 29 Jul 2009 03:18:56 +0000 (03:18 +0000)]
eexpress: Read buffer overflow

start_code is 69 words, but the code always writes a multiple of 16 words,
so the last 11 words written are outside the array.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: ARP neigh procfs buffer overflow
roel kluin [Wed, 29 Jul 2009 23:46:59 +0000 (23:46 +0000)]
ipv4: ARP neigh procfs buffer overflow

If arp_format_neigh_entry() can be called with n->dev->addr_len == 0, then a
write to hbuffer[-1] occurs.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago3c515: Write outside array bounds
roel kluin [Thu, 30 Jul 2009 00:26:32 +0000 (00:26 +0000)]
3c515: Write outside array bounds

if dev_alloc_skb() fails on the first iteration, a write to
cp->rx_ring[-1] occurs.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: allow creating vlan when real device is not up
Stephen Hemminger [Thu, 30 Jul 2009 20:16:45 +0000 (13:16 -0700)]
vlan: allow creating vlan when real device is not up

There is no reason for the arbitrary restriction that device must be
up to create a vlan. This patch was added to Vyatta kernel to resolve startup
ordering issues where vlan's are created but real device was disabled.

Note: the vlan already correctly inherits the operstate from real device; so
if vlan is created and real device is marked down, the vlan is marked
down.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodocbook: fix printk of ip address
Tobias Klauser [Thu, 30 Jul 2009 20:10:50 +0000 (13:10 -0700)]
docbook: fix printk of ip address

Use the %pI4 format string instead of %d.%d.%d.%d and NIPQUAD.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Version 1.48.114-1
Eilon Greenstein [Wed, 29 Jul 2009 00:20:11 +0000 (00:20 +0000)]
bnx2x: Version 1.48.114-1

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: WoL only with current MAC address
Eilon Greenstein [Wed, 29 Jul 2009 00:20:10 +0000 (00:20 +0000)]
bnx2x: WoL only with current MAC address

In some cases with 57711E, depending on the functions unload sequence, other
functions MAC address could have been used to wake the system as well. Make sure
to block all but the current function if WoL is required by changing the mode
to single function WoL.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Self-test kills management traffic
Eilon Greenstein [Wed, 29 Jul 2009 00:20:08 +0000 (00:20 +0000)]
bnx2x: Self-test kills management traffic

Self test used to play with the management FIFO possibly while management was
running...

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Receive traffic that maches management filtering rules
Eilon Greenstein [Wed, 29 Jul 2009 00:20:04 +0000 (00:20 +0000)]
bnx2x: Receive traffic that maches management filtering rules

Due to lack of configuration, if the BMC configures the chip to pass all
broadcast/multicast traffic to it, the host will not receive it. On top of
fixing it, also make sure that in promiscuous mode, the host will receive the
management traffic as well.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoiscsi: Use GFP_ATOMIC in iscsi_offload_mesg().
Michael Chan [Wed, 29 Jul 2009 08:49:52 +0000 (08:49 +0000)]
iscsi: Use GFP_ATOMIC in iscsi_offload_mesg().

Changing to GFP_ATOMIC because the only caller in cnic/bnx2i may
be calling this function while holding spin_lock.

This problem was discovered by Mike Christie.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet/netlabel: Add kmalloc NULL tests
Julia Lawall [Thu, 30 Jul 2009 04:38:19 +0000 (04:38 +0000)]
net/netlabel: Add kmalloc NULL tests

The test on map4 should be a test on map6.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression *x;
identifier f;
constant char *C;
@@

x = \(kmalloc\|kcalloc\|kzalloc\)(...);
... when != x == NULL
    when != x != NULL
    when != (x || ...)
(
kfree(x)
|
f(...,C,...,x,...)
|
*f(...,x,...)
|
*x->f
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Paul Moore <paul.moore@hp.com>
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, 30 Jul 2009 17:35:45 +0000 (10:35 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

15 years agonetxen: fix CONFIG_INET=n build
Dhananjay Phadke [Tue, 28 Jul 2009 09:10:03 +0000 (09:10 +0000)]
netxen: fix CONFIG_INET=n build

Wrap dest IP hashing code with #ifdef CONFIG_INET,
this feature makes no sense without INET, but other
driver can still work.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoiwlwifi: debugFs to enable/disable HT40 support
Wey-Yi Guy [Mon, 27 Jul 2009 20:50:15 +0000 (13:50 -0700)]
iwlwifi: debugFs to enable/disable HT40 support

Add debugfs file to enable/disable HT40(40MHz) channel support.
By default, 40MHz is supported if AP can support the function.

By echo "1" to "disable_ht40" file, iwlwifi driver will disable the
40MHz support and only allow 20MHz channel.

Because the information exchange happen during association time,
so enable/disable ht40 channel only can be performed when it is not
associated with AP.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: remove unused ATH_PCI_VERSION
Luis R. Rodriguez [Mon, 27 Jul 2009 15:30:00 +0000 (08:30 -0700)]
ath9k: remove unused ATH_PCI_VERSION

Our version goes by the kernel release.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: self-contained wext handling where possible
Johannes Berg [Mon, 27 Jul 2009 10:01:53 +0000 (12:01 +0200)]
cfg80211: self-contained wext handling where possible

Finally! This is what you've all been waiting for!

This patch makes cfg80211 take care of wext emulation
_completely_ by itself, drivers that don't need things
cfg80211 doesn't do yet don't even need to be aware of
wireless extensions.
This means we can also clean up mac80211's and iwm's
Kconfig and make it possible to build them w/o wext
now!

RIP wext.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: combine IWESSID handlers
Johannes Berg [Mon, 27 Jul 2009 10:01:52 +0000 (12:01 +0200)]
cfg80211: combine IWESSID handlers

Since we now have handlers IWESSID for all modes, we can
combine them into one.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: combine IWAP handlers
Johannes Berg [Mon, 27 Jul 2009 10:01:51 +0000 (12:01 +0200)]
cfg80211: combine IWAP handlers

Since we now have IWAP handlers for all modes, we can
combine them into one.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: combine iwfreq implementations
Johannes Berg [Mon, 27 Jul 2009 10:01:50 +0000 (12:01 +0200)]
cfg80211: combine iwfreq implementations

Until now we implemented iwfreq for managed mode, we
needed to keep the implementations separate, but now
that we have all versions implemented we can combine
them and export just one handler.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: verify info->control.vif is not NULL
Johannes Berg [Mon, 27 Jul 2009 08:33:31 +0000 (10:33 +0200)]
mac80211: verify info->control.vif is not NULL

When enqueuing packets on the internal packet queue, we
need to ensure that we have a valid vif pointer since
that is required since the net namespace work. Add some
assertions to verify this, but also don't crash is for
some reason we don't end up with a vif pointer -- warn
and drop the packet in all these cases.

Since this code touches a number of hotpaths, it is
intended to be temporary, or maybe configurable in the
future, at least the bit that is in the path that gets
hit for every packet, ieee80211_tx_pending().

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix disassoc while not associated
Johannes Berg [Mon, 27 Jul 2009 08:22:28 +0000 (10:22 +0200)]
cfg80211: fix disassoc while not associated

When trying to disassociate while not associated,
the kernel would crash rather than refusing the
operation, fix this;

Reported-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Add debug counters for TX
Sujith [Mon, 27 Jul 2009 06:38:16 +0000 (12:08 +0530)]
ath9k: Add debug counters for TX

Location: ath9k/phy#/xmit

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix an oops in ieee80211_scan_state_set_channel
Helmut Schaa [Sat, 25 Jul 2009 15:25:51 +0000 (17:25 +0200)]
mac80211: fix an oops in ieee80211_scan_state_set_channel

Fix an oops in ieee80211_scan_state_set_channel which was triggered
if the last scanned channel was skipped (for example due to regulatory
restrictions) by returning to the decision state after each skipped
channel.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: add missing parameter clearing
Johannes Berg [Sat, 25 Jul 2009 14:54:36 +0000 (16:54 +0200)]
nl80211: add missing parameter clearing

Jouni and Maxim reported an oops when using wpa_supplicant -Dnl80211,
which seems to be due to random data being contained in the crypto
settings for the assoc() command. This seems to be due to the missing
memset here, so add it -- it's certainly missing but I'm not 100%
certain that it will fix the problem.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: get rid of unnecessary setpower calls
Gabor Juhos [Fri, 24 Jul 2009 15:27:22 +0000 (17:27 +0200)]
ath9k: get rid of unnecessary setpower calls

We are using setpower routines regardless of the current power mode.
Don't bother the hardware, if it is not necessary.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: fix race with IEEE80211_CONF_PS checks
Gabor Juhos [Fri, 24 Jul 2009 15:27:21 +0000 (17:27 +0200)]
ath9k: fix race with IEEE80211_CONF_PS checks

There is a small window where the mac80211 changes the IEEE80211_CONF_PS
flag, and then informs the driver about the change. We have a race
condition if we are checking the flag in the same time. Avoid it by
introducing a local variable, and using that instead of checking the
IEEE80211_CONF_PS flag directly.

This fix the problem reported by Luis:
http://article.gmane.org/gmane.linux.kernel.wireless.general/34363

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoar9170: fix build error when !CONFIG_AR9170_LEDS
Alexander Beregalov [Fri, 24 Jul 2009 07:55:44 +0000 (11:55 +0400)]
ar9170: fix build error when !CONFIG_AR9170_LEDS

Fix this build error when CONFIG_AR9170_LEDS is not set
drivers/net/wireless/ath/ar9170/main.c:1296: error: 'struct ar9170' has
no member named 'led_work'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoray_cs: remove bogus NULL check at head of ray_get_wireless_stats
John W. Linville [Mon, 27 Jul 2009 14:56:41 +0000 (10:56 -0400)]
ray_cs: remove bogus NULL check at head of ray_get_wireless_stats

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Martin Ettl <ettl.martin@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix receiving deauth
Johannes Berg [Sat, 25 Jul 2009 09:58:36 +0000 (11:58 +0200)]
mac80211: fix receiving deauth

Marcel reported a warning, which quite obviously comes
from an oversight in the code handling deauth frames,
and which resulted in multiple follow-up warnings due
to this missing handling. This patch adds the missing
deauth handling (telling cfg80211 about it) and also
removes the follow-up warnings since they could happen
due to races even if nothing is wrong. I've explained
the races in the comments.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Tested-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix circular lock dependency (1)
Johannes Berg [Sat, 25 Jul 2009 08:54:13 +0000 (10:54 +0200)]
cfg80211: fix circular lock dependency (1)

Luis reported this lockdep complaint, that he had also
reported earlier but when trying to analyse I had been
locking at the wrong code, and never saw the problem:

(slightly abridged)
=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.31-rc4-wl #6
-------------------------------------------------------
wpa_supplicant/3799 is trying to acquire lock:
 (cfg80211_mutex){+.+.+.}, at: [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]

but task is already holding lock:
 (rtnl_mutex){+.+.+.}, at: [<ffffffff81400ff2>] rtnl_lock+0x12/0x20

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.+.}:
       [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
       [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
       [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
       [<ffffffff81400ff2>] rtnl_lock+0x12/0x20
       [<ffffffffa009f6a5>] nl80211_send_reg_change_event+0x1f5/0x2a0 [cfg80211]
       [<ffffffffa009529e>] set_regdom+0x28e/0x4c0 [cfg80211]

-> #0 (cfg80211_mutex){+.+.+.}:
       [<ffffffff8108587b>] __lock_acquire+0xe3b/0x12b0
       [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
       [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
       [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]
       [<ffffffffa009813f>] get_rdev_dev_by_info_ifindex+0x6f/0xa0 [cfg80211]
       [<ffffffffa009b12b>] nl80211_set_interface+0x3b/0x260 [cfg80211]

When looking at the correct code, the problem is quite
obvious. I'm not entirely sure which code paths lead
here, so until I can analyse it better let's just use
RCU to avoid the problem.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlagn: fix sparse warning when compiling without debug
Reinette Chatre [Fri, 24 Jul 2009 18:13:13 +0000 (11:13 -0700)]
iwlagn: fix sparse warning when compiling without debug

C [M]  drivers/net/wireless/iwlwifi/iwl-core.o
drivers/net/wireless/iwlwifi/iwl-core.c:1341: warning:
‘iwl_dump_nic_error_log’ defined but not used

Reported-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlagn: fix null pointer access during ucode load on 1000
Reinette Chatre [Fri, 24 Jul 2009 18:13:12 +0000 (11:13 -0700)]
iwlagn: fix null pointer access during ucode load on 1000

Commit "iwlwifi: Handle new firmware file with ucode build number
in header" introduced new ucode header parsing routines, but
neglected to initialize these routines for 1000. The system thus goes
into infinite loop trying to load ucode, failing every time with a null
pointer exception as it tries to parse the header.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix suspend
Johannes Berg [Tue, 28 Jul 2009 16:10:17 +0000 (18:10 +0200)]
mac80211: fix suspend

Jan reported that his b43-based laptop hangs during suspend.
The problem turned out to be mac80211 asking the driver to
stop the hardware before removing interfaces, and interface
removal caused b43 to touch the hardware (while down, which
causes the hang).

This patch fixes mac80211 to do reorder these operations to
have them in the correct order -- first remove interfaces
and then stop the hardware. Some more code is necessary to
be able to do so in a race-free manner, in particular it is
necessary to not process frames received during quiescing.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13337.

Reported-by: Jan Scholz <scholz@fias.uni-frankfurt.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: Read buffer overflow
Roel Kluin [Tue, 28 Jul 2009 10:05:00 +0000 (12:05 +0200)]
libertas: Read buffer overflow

Several arrays were read before checking whether the index was within
bounds. ARRAY_SIZE() should be used to determine the size of arrays.

rates->rates has an arraysize of 1, so calling get_common_rates()
with a rates_size of MAX_RATES (14) was causing reads out of bounds.

tmp_size can increment at most to (ARRAY_SIZE(lbs_bg_rates) - 1) *
(*rates_size - 1), so that should be the number of elements of tmp[].

A goto can be eliminated: ret was already set upon its declaration.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agolibertas: Read outside array bounds
Roel Kluin [Tue, 28 Jul 2009 07:59:47 +0000 (09:59 +0200)]
libertas: Read outside array bounds

reads bss->rates[j] before checking bounds of index, and should use
ARRAY_SIZE to determine the size of the array.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoip: fix logic of reverse path filter sysctl
Stephen Hemminger [Tue, 28 Jul 2009 01:39:45 +0000 (18:39 -0700)]
ip: fix logic of reverse path filter sysctl

Even though reverse path filter was changed from simple boolean to
trinary control, the loose mode only works if both all and device are
configured because of this logic error.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoiwlwifi: fix LED config option
Pavel Machek [Fri, 24 Jul 2009 18:13:10 +0000 (11:13 -0700)]
iwlwifi: fix LED config option

IWLWIFI_LEDS option should certainly have help comment, and should
default to y.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>