pandora-kernel.git
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Fri, 8 Oct 2010 19:39:28 +0000 (15:39 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/wireless/ipw2x00/ipw2200.c

13 years agoath9k_hw: Fix hw reset failure with HTC driver
Rajkumar Manoharan [Thu, 7 Oct 2010 15:28:39 +0000 (20:58 +0530)]
ath9k_hw: Fix hw reset failure with HTC driver

The following commit removed DISABLE_REGWRITE_BUFFER ops. The unnecessary
REGWRITE_BUFFER_FLUSH was not removed properly which is causing failure on
hw reset.

Author: Felix Fietkau <nbd@openwrt.org>
Date:   Tue Oct 5 12:03:42 2010 +0200

    ath9k_hw: clean up register write buffering

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: constify WDS address
Johannes Berg [Thu, 7 Oct 2010 11:11:09 +0000 (13:11 +0200)]
cfg80211: constify WDS address

There's no need for the WDS peer address
to not be const, so make it const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: use new genl helpers for WDS
Johannes Berg [Thu, 7 Oct 2010 11:10:30 +0000 (13:10 +0200)]
nl80211: use new genl helpers for WDS

Bill Jordan's patch to allow setting the WDS
peer crossed with my patch removing all the
boilerplate code in nl80211, and consequently
he didn't make use of it yet. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix sw scan locking
Johannes Berg [Thu, 7 Oct 2010 10:55:24 +0000 (12:55 +0200)]
mac80211: fix sw scan locking

The recent scan overhaul broke locking
because now we can jump to code that
attempts to unlock, while we don't have
the mutex held. Fix this by holding the
mutex around all the relevant code.

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Support FEM autodetection
Juuso Oikarinen [Thu, 7 Oct 2010 07:16:42 +0000 (10:16 +0300)]
wl1271: Support FEM autodetection

In the NVS/INI-parameters for the driver/firmware there is the FEM
(front end module) selection option, which may configure the hardware FEM
via autodetection or manual selection. So far, there has been support for
manual selection only.

Add support for FEM autodetection.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Thu, 7 Oct 2010 18:40:26 +0000 (14:40 -0400)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Thu, 7 Oct 2010 18:39:03 +0000 (14:39 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agoRevert "mac80211: use netif_receive_skb in ieee80211_tx_status callpath"
John W. Linville [Thu, 7 Oct 2010 15:35:40 +0000 (11:35 -0400)]
Revert "mac80211: use netif_receive_skb in ieee80211_tx_status callpath"

This reverts commit 5ed3bc7288487bd4f891f420a07319e0b538b4fe.

It turns-out that not all drivers are calling ieee80211_tx_status from a
compatible context.  Revert this for now and try again later...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoRevert "rtl8180: use NAPI for bottom-half processing"
John W. Linville [Thu, 7 Oct 2010 15:31:56 +0000 (11:31 -0400)]
Revert "rtl8180: use NAPI for bottom-half processing"

This reverts commit 030725d2c7c1fafec7ede618647bf30ed79601f0.

This commit relies on commit 5ed3bc7288487bd4f891f420a07319e0b538b4fe
("mac80211: use netif_receive_skb in ieee80211_tx_status callpath")
Unfortunately not all drivers are calling ieee80211_tx_status from a
compatible context, so that commit needs to be reverted in 2.6.36.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobonding: add Speed/Duplex information to /proc/net/bonding/bond
Krzysztof Oledzki [Thu, 30 Sep 2010 06:19:04 +0000 (06:19 +0000)]
bonding: add Speed/Duplex information to /proc/net/bonding/bond

Effect:
 Slave Interface: eth5
 MII Status: up
 Speed: 10000 Mbps
 Duplex: full
 Link Failure Count: 0
 Permanent HW addr: XX:XX:XX:XX:XX:XX
 Slave queue ID: 0

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoneigh: RCU conversion of struct neighbour
Eric Dumazet [Thu, 7 Oct 2010 00:49:21 +0000 (17:49 -0700)]
neigh: RCU conversion of struct neighbour

This is the second step for neighbour RCU conversion.

(first was commit d6bf7817 : RCU conversion of neigh hash table)

neigh_lookup() becomes lockless, but still take a reference on found
neighbour. (no more read_lock()/read_unlock() on tbl->lock)

struct neighbour gets an additional rcu_head field and is freed after an
RCU grace period.

Future work would need to eventually not take a reference on neighbour
for temporary dst (DST_NOCACHE), but this would need dst->_neighbour to
use a noref bit like we did for skb->_dst.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoiwlagn: add define for MODULE_FIRMWARE
Wey-Yi Guy [Wed, 6 Oct 2010 23:39:18 +0000 (16:39 -0700)]
iwlagn: add define for MODULE_FIRMWARE

Adding MODULE_FIRMWARE define for 130 series of devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: fix module firmware name for 130 series device
Wey-Yi Guy [Wed, 6 Oct 2010 23:39:17 +0000 (16:39 -0700)]
iwlagn: fix module firmware name for 130 series device

130 series device should use firmware name with 130 in it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agobonding: reread information about speed and duplex when interface goes up
Krzysztof Piotr Oledzki [Wed, 6 Oct 2010 21:28:22 +0000 (14:28 -0700)]
bonding: reread information about speed and duplex when interface goes up

When an interface was enslaved when it was down, bonding thinks
it has speed -1 even after it goes up. This leads into selecting
a wrong active interface in active/backup mode on mixed 10G/1G or
1G/100M environment.

before:
 bonding: bond0: link status definitely up for interface eth5, 100 Mbps full duplex.
 bonding: bond0: link status definitely up for interface eth0, 100 Mbps full duplex.

after:
 bonding: bond0: link status definitely up for interface eth5, 10000 Mbps full duplex.
 bonding: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: print information about speed and duplex seen by the driver
Krzysztof Piotr Oledzki [Wed, 6 Oct 2010 21:25:06 +0000 (14:25 -0700)]
bonding: print information about speed and duplex seen by the driver

before:
 bonding: bond0: link status definitely up for interface eth5
 bonding: bond0: link status definitely up for interface eth0

after:
 bonding: bond0: link status definitely up for interface eth5, 100 Mbps full duplex.
 bonding: bond0: link status definitely up for interface eth0, 100 Mbps full duplex.

Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: update version to 1.60.00-1
Dmitry Kravkov [Wed, 6 Oct 2010 03:35:11 +0000 (03:35 +0000)]
bnx2x: update version to 1.60.00-1

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: properly initialize FW stats
Dmitry Kravkov [Wed, 6 Oct 2010 03:35:03 +0000 (03:35 +0000)]
bnx2x: properly initialize FW stats

Client statistics need to be initialized to -1

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: code beautify
Dmitry Kravkov [Wed, 6 Oct 2010 03:34:21 +0000 (03:34 +0000)]
bnx2x: code beautify

This patch does not include any functional changes.
The changes are: empty lines, indentation and comments.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x, cnic: Fix SPQ return credit
Dmitry Kravkov [Wed, 6 Oct 2010 03:33:18 +0000 (03:33 +0000)]
bnx2x, cnic: Fix SPQ return credit

Return proper L2 and L5 SPQ (slow path queue) credits.  Previously, all
SPQ events were counted as L5 types.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: move msix table initialization to probe()
Dmitry Kravkov [Wed, 6 Oct 2010 03:32:10 +0000 (03:32 +0000)]
bnx2x: move msix table initialization to probe()

Decide which interrupt mode to use (MSI-X, MSI, INTa) only once in probe() and
initialize appropriate structures.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: use L1_CACHE_BYTES instead of magic number
Dmitry Kravkov [Wed, 6 Oct 2010 03:31:20 +0000 (03:31 +0000)]
bnx2x: use L1_CACHE_BYTES instead of magic number

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: use proper constants for dma_unmap* calls
Dmitry Kravkov [Wed, 6 Oct 2010 03:30:27 +0000 (03:30 +0000)]
bnx2x: use proper constants for dma_unmap* calls

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: remove unused fields in main driver structure
Dmitry Kravkov [Wed, 6 Oct 2010 03:29:41 +0000 (03:29 +0000)]
bnx2x: remove unused fields in main driver structure

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: remove unused parameter in reuse_rx_skb()
Dmitry Kravkov [Wed, 6 Oct 2010 03:29:05 +0000 (03:29 +0000)]
bnx2x: remove unused parameter in reuse_rx_skb()

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Add 57712 support
Dmitry Kravkov [Wed, 6 Oct 2010 03:28:26 +0000 (03:28 +0000)]
bnx2x: Add 57712 support

57712 HW supported with same set of features as for 57710/57711

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: change type of spq_left to atomic
Dmitry Kravkov [Wed, 6 Oct 2010 03:27:41 +0000 (03:27 +0000)]
bnx2x: change type of spq_left to atomic

The field is now accessed from different contexts.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: rename MF related fields
Dmitry Kravkov [Wed, 6 Oct 2010 03:26:40 +0000 (03:26 +0000)]
bnx2x: rename MF related fields

MF (multi-function) mode supported not only by 57711E (E1H) devices,
but also by coming 57712E, then we use more generic names.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: remove old FW files
Dmitry Kravkov [Wed, 6 Oct 2010 13:25:08 +0000 (15:25 +0200)]
bnx2x: remove old FW files

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x, cnic, bnx2i: use new FW/HSI
Dmitry Kravkov [Wed, 6 Oct 2010 03:23:26 +0000 (03:23 +0000)]
bnx2x, cnic, bnx2i: use new FW/HSI

This is the new FW HSI blob and the relevant definitions without logic changes.
It also included code adaptation for new HSI. New features are not enabled.

New FW/HSI includes:
- Support for 57712 HW
- Future support for VF (not used)
- Improvements in FW interrupts scheme
- FW FCoE hooks (stubs for future usage)

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: add 6.0.34 fw files
Dmitry Kravkov [Wed, 6 Oct 2010 21:10:08 +0000 (14:10 -0700)]
bnx2x: add 6.0.34 fw files

New firmware files for all bnx2x devices

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: create folder for bnx2x firmware files
Dmitry Kravkov [Wed, 6 Oct 2010 03:18:47 +0000 (03:18 +0000)]
bnx2x: create folder for bnx2x firmware files

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocnic: Fine-tune ring init code.
Michael Chan [Wed, 6 Oct 2010 03:17:22 +0000 (03:17 +0000)]
cnic: Fine-tune ring init code.

Initialize the rings only during cnic_uio_open() and shut them down
during cnic_uio_close().  Check for the new bit CNIC_LCL_FL_RINGS_INITED
before checking for ring interrupt.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocnic: Use pfid for internal memory offsets.
Michael Chan [Wed, 6 Oct 2010 03:16:06 +0000 (03:16 +0000)]
cnic: Use pfid for internal memory offsets.

The pfid (physical function ID) is the same as PCI function on production
devices.  The pfid for future devices will be different and will be used
for internal memory offsets.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocnic: Pass cp pointer to BNX2X_HW_CID.
Michael Chan [Wed, 6 Oct 2010 03:14:54 +0000 (03:14 +0000)]
cnic: Pass cp pointer to BNX2X_HW_CID.

Preparation work for upcoming firmware interface changes.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago[PATCH net-next] tg3: Set real_num_rx_queues for non-multiq devs
Matt Carlson [Wed, 6 Oct 2010 20:40:58 +0000 (13:40 -0700)]
[PATCH net-next] tg3: Set real_num_rx_queues for non-multiq devs

Commit 2ddaad397c47de012dfb956b0c05540da1a0dde5 entitled "tg3: Use
netif_set_real_num_{rx,tx}_queues()" added a new call to
netif_set_real_num_rx_queues in tg3_enable_msix().  This call also needs
to be added to the legacy path to correctly reflect the actual number of
rx queues.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomac80211: avoid uninitialized var warning in ieee80211_scan_cancel
John W. Linville [Wed, 6 Oct 2010 20:40:40 +0000 (16:40 -0400)]
mac80211: avoid uninitialized var warning in ieee80211_scan_cancel

net/mac80211/scan.c: In function ‘ieee80211_scan_cancel’:
net/mac80211/scan.c:794: warning: ‘finish’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: fix BSS double-unlinking
Johannes Berg [Wed, 6 Oct 2010 19:18:04 +0000 (21:18 +0200)]
cfg80211: fix BSS double-unlinking

When multiple interfaces are actively trying
to associate with the same BSS, they may both
find that the BSS isn't there and then try to
unlink it. This can cause errors since the
unlinking code can't currently deal with items
that have already been unlinked.

Normally this doesn't happen as most people
don't try to use multiple station interfaces
that associate at the same time too.

Fix this by using the list entry as a flag to
see if the item is still on a list.

Cc: stable@kernel.org
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Hun-Kyi Wynn <hkwynn@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211/mac80211: Add retry and failed transmission count to station info
Bruno Randolf [Wed, 6 Oct 2010 09:34:12 +0000 (18:34 +0900)]
nl80211/mac80211: Add retry and failed transmission count to station info

This information is already available in mac80211, we just need to export it
via cfg80211 and nl80211.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoRevert "iwlwifi: do not perferm force reset while doing scan"
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:13 +0000 (11:22 +0200)]
Revert "iwlwifi: do not perferm force reset while doing scan"

This reverts commit 7acc7c683a747689aaaaad4fce1683fc3f85e552. It was
applied to avoid possible warning in ieee80211_restart_hw, however
reason of the warning were races in mac80211, currently hopefully fixed.

Not reseting device when performing scan is bad for two reasons.

When forcing reset from iwl_check_stuck_queue(), in case of fail,
reset will be repeated until scan finish. But since firmware is in bad
shape, scan only finish after scan_check work (about 7s). So we will
delay the reset, what is not good behaviour.

When forcing reset from iwl_recover_from_statistics(), we will not
repeat the reset, so we will not perform reset at all when needed.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: compete scan to cfg80211 if deferred scan fail to start
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:12 +0000 (11:22 +0200)]
mac80211: compete scan to cfg80211 if deferred scan fail to start

We nulify local->scan_req on failure in __ieee80211_start_scan, so
__ieee80211_scan_completed will not call cfg80211_scan_done. Fix that.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: do not requeue scan work when not needed
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:11 +0000 (11:22 +0200)]
mac80211: do not requeue scan work when not needed

When performing hw scan and not abort it, __ieee80211_scan_completed()
is currently called from scan work, so does not need to reschedule work
to call drv_hw_scan().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: assure we also cancel deferred scan request
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:10 +0000 (11:22 +0200)]
mac80211: assure we also cancel deferred scan request

This is partial revert and fix for commit
85f72bc839705294b32b6c16b491c0422f0a71b3 "mac80211: only cancel
software-based scans on suspend"

When cfg80211 request the scan and mac80211 perform some management work,
we defer the scan request. We do not canceling such requests when calling
ieee80211_scan_cancel(), because of SCAN_SW_SCANNING bit check just
before the call. So fix that problem.

Another problem, which commit 85f72bc839705294b32b6c16b491c0422f0a71b3
tries to solve, is we can not cancel HW scan. Hence patch make
ieee80211_scan_cancel() ignore HW scan (see code comments). Keeping
local->mtx lock assures that the deferred scan will not become
"working" HW scan.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: keep lock when calling __ieee80211_scan_completed()
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:09 +0000 (11:22 +0200)]
mac80211: keep lock when calling __ieee80211_scan_completed()

We are taking local->mtx inside __ieee80211_scan_completed(), but just
before call to that function we drop the lock. Dropping/taking lock is not
good, because can lead to hard to understand race conditions.

Patch split scan_completed() code into two functions, first must be called
with local->mtx taken and second without it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: reduce number of __ieee80211_scan_completed calls
Stanislaw Gruszka [Wed, 6 Oct 2010 09:22:08 +0000 (11:22 +0200)]
mac80211: reduce number of __ieee80211_scan_completed calls

Use goto instruction to call __ieee80211_scan_completed only ones in
ieee80211_scan_work. This is prepare for the next patch.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: don't duplicate setting channel in shared memory
Rafał Miłecki [Wed, 6 Oct 2010 05:50:08 +0000 (07:50 +0200)]
b43: N-PHY: don't duplicate setting channel in shared memory

It's already set in PHY common code.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: define B43_SHM_SH_CHAN_40MHZ
Rafał Miłecki [Wed, 6 Oct 2010 05:50:07 +0000 (07:50 +0200)]
b43: define B43_SHM_SH_CHAN_40MHZ

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: N-PHY: simplify channel switching
Rafał Miłecki [Wed, 6 Oct 2010 05:50:06 +0000 (07:50 +0200)]
b43: N-PHY: simplify channel switching

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: fix error in generic netif_running check
Johannes Berg [Tue, 5 Oct 2010 19:34:11 +0000 (21:34 +0200)]
nl80211: fix error in generic netif_running check

Yikes! The error return keeps a netdev reference
and the rdev mutex locked, fix that!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: allow per-station GTKs
Johannes Berg [Tue, 5 Oct 2010 17:39:30 +0000 (19:39 +0200)]
cfg80211/mac80211: allow per-station GTKs

This adds API to allow adding per-station GTKs,
updates mac80211 to support it, and also allows
drivers to remove a key from hwaccel again when
this may be necessary due to multiple GTKs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: avoid transmitting delBA to old AP
Johannes Berg [Tue, 5 Oct 2010 17:37:40 +0000 (19:37 +0200)]
mac80211: avoid transmitting delBA to old AP

When roaming while we have active BA session,
we can end up transmitting delBA frames to
the old AP while we're already on the new AP's
channel, which can cause warnings.

Simply avoid sending those frames, but still
tear down the internal session state, since
they are not really necessary anyway as we
will implicitly disassociate when sending the
association to the new AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Introduce a wrapper for power save disable.
Senthil Balasubramanian [Tue, 5 Oct 2010 15:06:41 +0000 (20:36 +0530)]
ath9k: Introduce a wrapper for power save disable.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: remove unnecessary power save flags.
Senthil Balasubramanian [Tue, 5 Oct 2010 15:06:40 +0000 (20:36 +0530)]
ath9k: remove unnecessary power save flags.

drv_config callback is called only after the ack for the nullframe
is received and so driver need not do anything special for this.

So remove NULLFUNC_COMPLETED, PS_ENABLED flags and bf_isnullfunc
flags from ath9k as mac80211 already handles them properly.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: merge ath9k_hw_ani_monitor_old and ath9k_hw_ani_monitor_new
Felix Fietkau [Mon, 4 Oct 2010 18:09:50 +0000 (20:09 +0200)]
ath9k_hw: merge ath9k_hw_ani_monitor_old and ath9k_hw_ani_monitor_new

After the last rounds of cleanup, these functions are now functionally
equivalent and can thus be merged.
Also get rid of some excessive (and redundant) debug messages.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove function pointer abstraction for internal ANI ops
Felix Fietkau [Mon, 4 Oct 2010 18:09:49 +0000 (20:09 +0200)]
ath9k_hw: remove function pointer abstraction for internal ANI ops

The code gets more concise and readable when making the new ANI functions
fall back to the old ones if ANI v2 is disabled. This also makes further code
cleanup easier.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove code duplication in phy error counter handling
Felix Fietkau [Mon, 4 Oct 2010 18:09:48 +0000 (20:09 +0200)]
ath9k_hw: remove code duplication in phy error counter handling

Split out the PHY error counter update from ath9k_hw_ani_monitor_*, reuse
it in ath9k_hw_proc_mib_event (merged from ath9k_hw_proc_mib_event_old
and ath9k_hw_proc_mib_event_new).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: clean up ANI state handling
Felix Fietkau [Mon, 4 Oct 2010 18:09:47 +0000 (20:09 +0200)]
ath9k_hw: clean up ANI state handling

ANI state is kept per channel, so instead of keeping an array of ANI states
with an arbitrary size of 255, move the ANI state into the channel struct.

Move some config settings that are not per-channel out of
the per-channel struct to save some memory.

With those changes, ath9k_ani_restart_old and ath9k_ani_restart_new can
be merged into a single function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: add a helper function to check for the new ANI implementation
Felix Fietkau [Mon, 4 Oct 2010 18:09:46 +0000 (20:09 +0200)]
ath9k_hw: add a helper function to check for the new ANI implementation

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: clean up register write buffering
Felix Fietkau [Tue, 5 Oct 2010 10:03:42 +0000 (12:03 +0200)]
ath9k_hw: clean up register write buffering

Throughout the code, DISABLE_REGWRITE_BUFFER is always called right after
REGWRITE_BUFFER_FLUSH. Since that's unlikely to change any time soon, that
makes keeping those ops separate rather pointless, as it only increases
code size and line number counts.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: merge codepaths that access the cycle counter registers
Felix Fietkau [Sun, 3 Oct 2010 17:07:17 +0000 (19:07 +0200)]
ath9k_hw: merge codepaths that access the cycle counter registers

The cycle counters are used by ANI to determine the amount of time that the
radio spent not receiving or transmitting. They're also used for debugging
purposes if the baseband watchdog on AR9003 detects a lockup.
In the future, we want to use these counters to determine the medium utilization
and export this information via survey. For that, we need to make sure that
the counter is only accessed from one place, which also ensures that
wraparounds won't occur at inconvenient points in time.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: clean up calibration flags
Felix Fietkau [Sun, 3 Oct 2010 17:07:16 +0000 (19:07 +0200)]
ath9k_hw: clean up calibration flags

The calibration actual calibration flags are only used by the per chip family
source files, so it makes more sense to define them in those files instead
of globally. That way the code has to test for less flags.

Also instead of using a separate callback for testing whether a particular
calibration type is supported, simply adjust ah->supp_cals in the calibration
init which is called right after the hardware reset, before any of the
calibrations are run.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Wed, 6 Oct 2010 20:25:52 +0000 (16:25 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agoMerge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst...
David S. Miller [Wed, 6 Oct 2010 20:07:22 +0000 (13:07 -0700)]
Merge branch 'vhost-net-next' of git://git./linux/kernel/git/mst/vhost

13 years agomac80211: delete AddBA response timer
Johannes Berg [Tue, 5 Oct 2010 19:40:33 +0000 (21:40 +0200)]
mac80211: delete AddBA response timer

We never delete the addBA response timer, which
is typically fine, but if the station it belongs
to is deleted very quickly after starting the BA
session, before the peer had a chance to reply,
the timer may fire after the station struct has
been freed already. Therefore, we need to delete
the timer in a suitable spot -- best when the
session is being stopped (which will happen even
then) in which case the delete will be a no-op
most of the time.

I've reproduced the scenario and tested the fix.

This fixes the crash reported at
http://mid.gmane.org/4CAB6F96.6090701@candelatech.com

Cc: stable@kernel.org
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix regression in ANI listen time calculation
Felix Fietkau [Sun, 3 Oct 2010 17:07:19 +0000 (19:07 +0200)]
ath9k_hw: fix regression in ANI listen time calculation

  wireless-testing
  commit 37e5bf6535a4d697fb9fa6f268a8354a612cbc00
  Author: Luis R. Rodriguez <lrodriguez@atheros.com>
  Date:   Sat Jun 12 00:33:40 2010 -0400

    ath9k_hw: fix clock rate calculations for ANI

This commit accidentally broke clock rate calculation by doubling the
calculated clock rate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: define 130 series of WiFi/BT combo devices
Wey-Yi Guy [Wed, 6 Oct 2010 15:14:21 +0000 (08:14 -0700)]
iwlagn: define 130 series of WiFi/BT combo devices

add new structures and defines need to identify 130 devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: rename iwl5000_tx_resp
Wey-Yi Guy [Mon, 20 Sep 2010 16:12:33 +0000 (09:12 -0700)]
iwlagn: rename iwl5000_tx_resp

iwl5000_tx_resp really should be iwlagn_tx_resp, rename it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: remove uncorrect comments
Wey-Yi Guy [Mon, 20 Sep 2010 16:12:32 +0000 (09:12 -0700)]
iwlwifi: remove uncorrect comments

some structure belong to _agn devices, not just 5000. Fix it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: rename iwl5000_tx_power_dbm_cmd
Wey-Yi Guy [Mon, 20 Sep 2010 16:12:31 +0000 (09:12 -0700)]
iwlagn: rename iwl5000_tx_power_dbm_cmd

iwl5000_tx_power_dbm_cmd really should be iwlagn_tx_power_dbm_cmd,
so rename it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: reduce redundant parameter definitions
Wey-Yi Guy [Wed, 6 Oct 2010 15:10:00 +0000 (08:10 -0700)]
iwlagn: reduce redundant parameter definitions

move paramater definitions to a device paramater structure only
leaving the device name, which antennas are used and what firmware
file to use in the iwl_cfg structure.  this will not completely
remove the redundancies but greatly reduce them for devices that
only vary by name or antennas.  the parameters that are more
likely to change within a given device family are left in iwl_cfg.
also separate bt param structure added to help reduce more.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlwifi: schedule to deprecate software scan support
Wey-Yi Guy [Wed, 6 Oct 2010 14:42:43 +0000 (07:42 -0700)]
iwlwifi: schedule to deprecate software scan support

Hardware scan is the prefer method for all iwlwifi devices;
especially for dual-mode functions. Schedule to deprecate the
software scan support in kernel 2.6.40

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agobna: scope and dead code cleanup
Rasesh Mody [Tue, 5 Oct 2010 15:46:05 +0000 (15:46 +0000)]
bna: scope and dead code cleanup

As suggested by Stephen Hemminger:
1) Made functions and data structures static wherever possible.
2) Removed unused code.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: fix interrupt handling
Rasesh Mody [Tue, 5 Oct 2010 15:46:04 +0000 (15:46 +0000)]
bna: fix interrupt handling

This fix handles the case when IRQ handler is called (for shared IRQs)
even before the driver is ready to handle interrupts.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofib: RCU conversion of fib_lookup()
Eric Dumazet [Tue, 5 Oct 2010 10:41:36 +0000 (10:41 +0000)]
fib: RCU conversion of fib_lookup()

fib_lookup() converted to be called in RCU protected context, no
reference taken and released on a contended cache line (fib_clntref)

fib_table_lookup() and fib_semantic_match() get an additional parameter.

struct fib_info gets an rcu_head field, and is freed after an rcu grace
period.

Stress test :
(Sending 160.000.000 UDP frames on same neighbour,
IP route cache disabled, dual E5540 @2.53GHz,
32bit kernel, FIB_HASH) (about same results for FIB_TRIE)

Before patch :

real 1m31.199s
user 0m13.761s
sys 23m24.780s

After patch:

real 1m5.375s
user 0m14.997s
sys 15m50.115s

Before patch Profile :

13044.00 15.4% __ip_route_output_key vmlinux
 8438.00 10.0% dst_destroy           vmlinux
 5983.00  7.1% fib_semantic_match    vmlinux
 5410.00  6.4% fib_rules_lookup      vmlinux
 4803.00  5.7% neigh_lookup          vmlinux
 4420.00  5.2% _raw_spin_lock        vmlinux
 3883.00  4.6% rt_set_nexthop        vmlinux
 3261.00  3.9% _raw_read_lock        vmlinux
 2794.00  3.3% fib_table_lookup      vmlinux
 2374.00  2.8% neigh_resolve_output  vmlinux
 2153.00  2.5% dst_alloc             vmlinux
 1502.00  1.8% _raw_read_lock_bh     vmlinux
 1484.00  1.8% kmem_cache_alloc      vmlinux
 1407.00  1.7% eth_header            vmlinux
 1406.00  1.7% ipv4_dst_destroy      vmlinux
 1298.00  1.5% __copy_from_user_ll   vmlinux
 1174.00  1.4% dev_queue_xmit        vmlinux
 1000.00  1.2% ip_output             vmlinux

After patch Profile :

13712.00 15.8% dst_destroy             vmlinux
 8548.00  9.9% __ip_route_output_key   vmlinux
 7017.00  8.1% neigh_lookup            vmlinux
 4554.00  5.3% fib_semantic_match      vmlinux
 4067.00  4.7% _raw_read_lock          vmlinux
 3491.00  4.0% dst_alloc               vmlinux
 3186.00  3.7% neigh_resolve_output    vmlinux
 3103.00  3.6% fib_table_lookup        vmlinux
 2098.00  2.4% _raw_read_lock_bh       vmlinux
 2081.00  2.4% kmem_cache_alloc        vmlinux
 2013.00  2.3% _raw_spin_lock          vmlinux
 1763.00  2.0% __copy_from_user_ll     vmlinux
 1763.00  2.0% ip_output               vmlinux
 1761.00  2.0% ipv4_dst_destroy        vmlinux
 1631.00  1.9% eth_header              vmlinux
 1440.00  1.7% _raw_read_unlock_bh     vmlinux

Reference results, if IP route cache is enabled :

real 0m29.718s
user 0m10.845s
sys 7m37.341s

25213.00 29.5% __ip_route_output_key   vmlinux
 9011.00 10.5% dst_release             vmlinux
 4817.00  5.6% ip_push_pending_frames  vmlinux
 4232.00  5.0% ip_finish_output        vmlinux
 3940.00  4.6% udp_sendmsg             vmlinux
 3730.00  4.4% __copy_from_user_ll     vmlinux
 3716.00  4.4% ip_route_output_flow    vmlinux
 2451.00  2.9% __xfrm_lookup           vmlinux
 2221.00  2.6% ip_append_data          vmlinux
 1718.00  2.0% _raw_spin_lock_bh       vmlinux
 1655.00  1.9% __alloc_skb             vmlinux
 1572.00  1.8% sock_wfree              vmlinux
 1345.00  1.6% kfree                   vmlinux

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: add retransmit membership reports tunable
Flavio Leitner [Tue, 5 Oct 2010 14:23:59 +0000 (14:23 +0000)]
bonding: add retransmit membership reports tunable

Allow sysadmins to configure the number of multicast
membership report sent on a link failure event.

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: fix to rejoin multicast groups immediately
Flavio Leitner [Tue, 5 Oct 2010 14:23:58 +0000 (14:23 +0000)]
bonding: fix to rejoin multicast groups immediately

The IGMP specs states that if the system receives a
membership report, it shouldn't send another for the
next minute. However, if a link failure happens right
after that, the backup slave and the switch connected
to this slave will not know about the multicast and
the traffic will hang for about a minute.

This patch fixes it to rejoin multicast groups immediately
after a failover restoring the multicast traffic.

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: rejoin multicast groups on VLANs
Flavio Leitner [Tue, 5 Oct 2010 14:23:57 +0000 (14:23 +0000)]
bonding: rejoin multicast groups on VLANs

During a failover, the IGMP membership is sent to update
the switch restoring the traffic, but it misses groups added
to VLAN devices running on top of bonding devices.

This patch changes it to iterate over all VLAN devices
on top of it sending IGMP memberships too.

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoehea: converting msleeps to waitqueue on check_sqs() function
Breno Leitao [Tue, 5 Oct 2010 13:16:23 +0000 (13:16 +0000)]
ehea: converting msleeps to waitqueue on check_sqs() function

Removing the msleep() call in check_sqs() function, and replacing by a wait queue.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoehea: using wait queues instead of msleep on ehea_flush_sq
Breno Leitao [Tue, 5 Oct 2010 13:16:22 +0000 (13:16 +0000)]
ehea: using wait queues instead of msleep on ehea_flush_sq

This patch just remove a msleep loop and change to wait queue,
making the code cleaner.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbevf: declare functions as static
Emil Tantilov [Tue, 5 Oct 2010 13:11:30 +0000 (13:11 +0000)]
ixgbevf: declare functions as static

Following patch fixes warnings reported by `make namespacecheck`

Reported by Stephen Hemminger

CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Greg Rose <greg.v.rose@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoAF_UNIX: Implement SO_TIMESTAMP and SO_TIMETAMPNS on Unix sockets
Alban Crequy [Mon, 4 Oct 2010 08:48:28 +0000 (08:48 +0000)]
AF_UNIX: Implement SO_TIMESTAMP and SO_TIMETAMPNS on Unix sockets

Userspace applications can already request to receive timestamps with:
setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMP, ...)

Although setsockopt() returns zero (success), timestamps are not added to the
ancillary data. This patch fixes that on SOCK_DGRAM and SOCK_SEQPACKET Unix
sockets.

Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet neigh: RCU conversion of neigh hash table
Eric Dumazet [Mon, 4 Oct 2010 06:15:44 +0000 (06:15 +0000)]
net neigh: RCU conversion of neigh hash table

David

This is the first step for RCU conversion of neigh code.

Next patches will convert hash_buckets[] and "struct neighbour" to RCU
protected objects.

Thanks

[PATCH net-next] net neigh: RCU conversion of neigh hash table

Instead of storing hash_buckets, hash_mask and hash_rnd in "struct
neigh_table", a new structure is defined :

struct neigh_hash_table {
       struct neighbour        **hash_buckets;
       unsigned int            hash_mask;
       __u32                   hash_rnd;
       struct rcu_head         rcu;
};

And "struct neigh_table" has an RCU protected pointer to such a
neigh_hash_table.

This means the signature of (*hash)() function changed: We need to add a
third parameter with the actual hash_rnd value, since this is not
anymore a neigh_table field.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet neigh: neigh_delete() and neigh_add() changes
Eric Dumazet [Mon, 4 Oct 2010 04:27:36 +0000 (04:27 +0000)]
net neigh: neigh_delete() and neigh_add() changes

neigh_delete() and neigh_add() dont need to touch device refcount,
we hold RTNL when calling them, so device cannot disappear under us.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add a core netdev->rx_dropped counter
Eric Dumazet [Thu, 30 Sep 2010 21:06:55 +0000 (21:06 +0000)]
net: add a core netdev->rx_dropped counter

In various situations, a device provides a packet to our stack and we
drop it before it enters protocol stack :
- softnet backlog full (accounted in /proc/net/softnet_stat)
- bad vlan tag (not accounted)
- unknown/unregistered protocol (not accounted)

We can handle a per-device counter of such dropped frames at core level,
and automatically adds it to the device provided stats (rx_dropped), so
that standard tools can be used (ifconfig, ip link, cat /proc/net/dev)

This is a generalization of commit 8990f468a (net: rx_dropped
accounting), thus reverting it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'wireless-next' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Tue, 5 Oct 2010 17:50:27 +0000 (13:50 -0400)]
Merge branch 'wireless-next' of git://git./linux/kernel/git/luca/wl12xx

13 years agomac80211: fix channel assumption for association done work
Luis R. Rodriguez [Fri, 1 Oct 2010 21:05:19 +0000 (17:05 -0400)]
mac80211: fix channel assumption for association done work

Be consistent and use the wk->chan instead of the
local->hw.conf.channel for the association done work.
This prevents any possible races against channel changes
while we run this work.

In the case that the race did happen we would be initializing
the bit rates for the new AP under the assumption of a wrong
channel and in the worst case, wrong band. This could lead
to trying to assuming we could use CCK frames on 5 GHz, for
example.

This patch has a fix for kernels >= v2.6.34

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: fix remain-on-channel documentation
Johannes Berg [Tue, 5 Oct 2010 14:19:42 +0000 (16:19 +0200)]
nl80211: fix remain-on-channel documentation

The documentation for NL80211_CMD_REMAIN_ON_CHANNEL
isn't accurate, an interface index is required by
the command. Update it accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom
Gabor Juhos [Tue, 5 Oct 2010 09:32:17 +0000 (11:32 +0200)]
ath9k: get correct tx gain type in ath9k_hw_4k_get_eeprom

The base_eep_header_4k structure contains information that the
device supports high power tx gain table or not. However the
ath9k_hw_4k_get_eeprom function does not return that value when
it is called with EEP_TXGAIN_TYPE. This leads to that the tx gain
initialization will use the init values from the original tx gain
table even if the device inidicates that the high power table
should be used.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Shu Hwa Shen <shensh@zcomm.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Don't wake internal queues
Bruno Randolf [Tue, 5 Oct 2010 04:27:17 +0000 (13:27 +0900)]
ath5k: Don't wake internal queues

We should only wake up queues which mac80211 knows about (queues 0-3). We have
another internal queue ("CAB", queue number 6) which we use for power-saved
frames. When transmitted frames are processed from this queue, we have to make
sure we don't bother mac80211 with waking a queue it doesn't know about.

this fixes:

WARNING: at /home/br1/ath/wireless-testing/net/mac80211/util.c:275
  __ieee80211_wake_queue+0xd6/0xe0 [mac80211]()

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix deadlock with multiple interfaces
Johannes Berg [Tue, 5 Oct 2010 08:41:47 +0000 (10:41 +0200)]
mac80211: fix deadlock with multiple interfaces

The locking around ieee80211_recalc_smps is
buggy -- it cannot acquire another interface's
mutex while the iflist mutex is held because
another code path could be holding the iface
mutex and trying to acquire the iflist mutex.

But the locking is also unnecessary, we only
check "ifmgd->associated" as a bool, and don't
use the pointer (in check_mgd_smps).

Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: reduce dumping boilerplate
Johannes Berg [Mon, 4 Oct 2010 19:14:06 +0000 (21:14 +0200)]
nl80211: reduce dumping boilerplate

Consolidate boilerplate code needed for .dumpit
calls operating on netdevs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: use generic check for netif_running
Johannes Berg [Mon, 4 Oct 2010 19:14:05 +0000 (21:14 +0200)]
nl80211: use generic check for netif_running

Use a new flag that requires the netdev to be
UP and use it to check instead of coding the
check into all functions that require it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: use the new genetlink pre/post_doit hooks
Johannes Berg [Mon, 4 Oct 2010 19:36:35 +0000 (21:36 +0200)]
nl80211: use the new genetlink pre/post_doit hooks

This makes nl80211 use the new genetlink
pre_doit/post_doit hooks for locking and
checking the interface/wiphy index.

This significantly reduces the code size
and the likelihood of locking errors.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agogenetlink: introduce pre_doit/post_doit hooks
Johannes Berg [Mon, 4 Oct 2010 19:14:03 +0000 (21:14 +0200)]
genetlink: introduce pre_doit/post_doit hooks

Each family may have some amount of boilerplate
locking code that applies to most, or even all,
commands.

This allows a family to handle such things in
a more generic way, by allowing it to
 a) include private flags in each operation
 b) specify a pre_doit hook that is called,
    before an operation's doit() callback and
    may return an error directly,
 c) specify a post_doit hook that can undo
    locking or similar things done by pre_doit,
    and finally
 d) include two private pointers in each info
    struct passed between all these operations
    including doit(). (It's two because I'll
    need two in nl80211 -- can be extended.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoipw2200: check for allocation failures
Dan Carpenter [Mon, 4 Oct 2010 12:31:46 +0000 (14:31 +0200)]
ipw2200: check for allocation failures

If kzalloc() fails then return should return with -ENOMEM.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Add WME information element for IBSS
Bruno Randolf [Mon, 4 Oct 2010 02:17:30 +0000 (11:17 +0900)]
mac80211: Add WME information element for IBSS

Enable WME QoS in IBSS mode by adding a WME information element to beacons and
probe respones and by checking for it and marking stations as WME capable if it
is present.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Work around hw aggregation oddity in rt2800
Helmut Schaa [Sat, 2 Oct 2010 09:34:56 +0000 (11:34 +0200)]
rt2x00: Work around hw aggregation oddity in rt2800

If a frame is not meant to be sent as AMPDU or part of it the hw might
still decide to aggregate this frame if a previous frame started an
AMPDU. However, this will limit the usefulness of the reported tx rate
since the reported rate will be the one specified in the TXWI of the
first frame and thus it is not possible to reliably caculate the
number of retrys by substracting the reported tx rate from the tx rate
in the TXWI.

To fix this issue, only report the successful rate for frames that were
not meant to be aggregated but ended up in an aggregate.

Example:
Frame A (MCS7, AMPDU=1) B (MCS7, AMPDU=1) C (MCS12, AMDPU=0, PROBE_RATE)

Although frame C shoudn't be aggregated the hw might sill put it
into an AMPDU together with A and B. If the transmission succeeds the tx
status will contain MCS7 for all three frames. In that case we should
only report MCS7 as success rate and avoid reporting MCS12-MCS8 as
failed tx attempts as this will affect the future rate control
decisions.

This oddity might strike us in other scenarious as well but the most
common "wrong" report happened for frames used to probe a different tx
rate.

This improves the rate control decisions notable.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Improve cooperation between rt2800pci and minstrel
Helmut Schaa [Sat, 2 Oct 2010 09:34:26 +0000 (11:34 +0200)]
rt2x00: Improve cooperation between rt2800pci and minstrel

In order to lower the impact of probe rates don't send a frame as AMPDU
if the rate control algorithm sets IEEE80211_TX_CTL_RATE_CTRL_PROBE.
Otherwise a whole aggregate would be send with a probe rate which might
lead to numerous retries.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix oops caused by error path in rt2x00lib_start
Helmut Schaa [Sat, 2 Oct 2010 09:34:05 +0000 (11:34 +0200)]
rt2x00: Fix oops caused by error path in rt2x00lib_start

When rt2x00lib_enable_radio fails to enable the radio, rt2x00lib_start
will call rt2x00queue_uninitialize to uninitialize the queues. Since,
the queues are not initialized here but already in rt2x00lib_initialize
we shouldn't uninitialize the queues here. Otherwise, a consecutive call
to rt2x00lib_start will oops (see below) because it assumes the queues
are already initialized.

BUG: unable to handle kernel NULL pointer dereference at 00000010
IP: [<f8d2d901>] :rt2800pci:rt2800pci_clear_entry+0x1/0x40
*pde = 00000000
Oops: 0000 [#1] SMP
Modules linked in: ... rt2800pci ...

Pid: 5995, comm: hostapd Not tainted (2.6.27.8 #1)
EIP: 0060:[<f8d2d901>] EFLAGS: 00210246 CPU: 3
EIP is at rt2800pci_clear_entry+0x1/0x40 [rt2800pci]
EAX: 00000000 EBX: f698863c ECX: 00200296 EDX: f8d2dee0
ESI: f6988600 EDI: f5b6f000 EBP: 00000000 ESP: f6d75e4c
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process hostapd (pid: 5995, ti=f6d74000 task=f6ce2300 task.ti=f6d74000)
Stack: f698863c fa00eaec 00000000 f5b6f000 00000000 f7b67000 f5b6e280 fa00c629
      f5b6f000 00000000 fa00ca3d f7b67480 00000001 fa177d4c 01b6e890 f7b67000
      00000000 f7b67000 00000001 00001003 00001002 c066c366 f7b67000 c0668ad0
Call Trace:
 [<fa00eaec>] rt2x00queue_init_queues+0x5c/0x90 [rt2x00lib]
 [<fa00c629>] rt2x00lib_enable_radio+0x29/0xa0 [rt2x00lib]
 [<fa00ca3d>] rt2x00lib_start+0x5d/0xd0 [rt2x00lib]
 [<fa177d4c>] ieee80211_do_open+0x21c/0x510 [mac80211]
 [<c066c366>] dev_open+0x56/0xb0
 [<c0668ad0>] dev_set_rx_mode+0x20/0x40
 [<c066a67f>] dev_change_flags+0x7f/0x190
 [<c06b1495>] devinet_ioctl+0x515/0x690
 [<c0668d24>] __dev_get_by_name+0x74/0x90
 [<c065d3f0>] sock_ioctl+0xd0/0x240
 [<c065d320>] sock_ioctl+0x0/0x240
 [<c018179b>] vfs_ioctl+0x2b/0x90
 [<c0181a5b>] do_vfs_ioctl+0x25b/0x2a0
 [<c0181af6>] sys_ioctl+0x56/0x70
 [<c0103262>] syscall_call+0x7/0xb
 [<c0700000>] add_card+0xad0/0xba0
 =======================
Code: 83 78 08 0e 74 14 8b 02 8b 48 04 85 c9 0f 99 c0 0f b6 c0 c3 8d b6
      00 00 00 00 8b 02 8b 40 04 85 c0 0f 99 c0 0f b6 c0 c3 66 90 53 <8b>
      48 10 8b 58 08 8b 40 04 83 78 08 0e 74 15 8b 11 83 c2 04 8b
EIP: [<f8d2d901>] rt2800pci_clear_entry+0x1/0x40 [rt2800pci] SS:ESP 0068:f6d75e4c
---[ end trace cff9a5c094bb8837 ]---

Reported-by: Joshua Smith <jesmith@kaon.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Update comment about the AMPDU flag in the TXWI
Helmut Schaa [Sat, 2 Oct 2010 09:33:42 +0000 (11:33 +0200)]
rt2x00: Update comment about the AMPDU flag in the TXWI

During testing with AMPDUs it turned out that the rt2800 hw will aggregate
consecutive frames with the same RA and TID when the first frame in a
possible aggregate has set AMPDU=1 in the TXWI. If a following frame has
set AMPDU=0 in its TXWI it might sill end up in the aggregate of the
previous frame. Update the comment accordingly.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>