]> bbs.cooldavid.org Git - net-next-2.6.git/log
net-next-2.6.git
13 years agoiwlagn: keep track fail tx reason counter
Wey-Yi Guy [Sun, 5 Sep 2010 17:49:41 +0000 (10:49 -0700)]
iwlagn: keep track fail tx reason counter

If uCode fail to transmit frame, it will send reply tx back
to driver with failure status; keep the counters of each failure
cases for debugging.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: add bt_status_read for 5150
Wey-Yi Guy [Sun, 5 Sep 2010 17:49:38 +0000 (10:49 -0700)]
iwlagn: add bt_status_read for 5150

Include bt_status_read function pointer for 5150 device

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
Eric Dumazet [Fri, 17 Sep 2010 18:56:18 +0000 (11:56 -0700)]
ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum

To be able to switch on GRO on a device, ethtool_set_gro() checks this
device provides a get_rx_csum() method.

Some devices dont provide this method, while they do support RX
checksumming.

This patch allows bonding to support GRO :

ethtool -K bond0 gro on

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: update version 5.0.10
Amit Kumar Salecha [Thu, 16 Sep 2010 19:14:43 +0000 (19:14 +0000)]
qlcnic: update version 5.0.10

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: remove fw version check
Amit Kumar Salecha [Thu, 16 Sep 2010 19:14:42 +0000 (19:14 +0000)]
qlcnic: remove fw version check

Don't compare flash and file fw version. Allow to load
old fw from file than flashed fw.
If file fw is present, don't skip fw re-intialization.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: vlan lro support
Amit Kumar Salecha [Thu, 16 Sep 2010 19:14:41 +0000 (19:14 +0000)]
qlcnic: vlan lro support

LRO + GRO + vlan rx accleration support, performance increases
around 20% and cpu utilization reduces around 70% on vlan interface.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: vlan gro support
Amit Kumar Salecha [Thu, 16 Sep 2010 19:14:40 +0000 (19:14 +0000)]
qlcnic: vlan gro support

GRO support + vlan rx accleration, boost around 9%
performance and reduces 25% of cpu utilization on vlan
interface.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: support vlan rx accleration
Amit Kumar Salecha [Thu, 16 Sep 2010 19:14:39 +0000 (19:14 +0000)]
qlcnic: support vlan rx accleration

Implemented vlan rx accleration in driver.
This helps in increasing significant performance and
reduces cpu utilization with GRO and LRO.

Eric Dumazet:
"Its a bit strange you use dev_kfree_skb_any(skb) here."
"We run in NAPI mode, so you can use dev_kfree_skb()."
Amit:
Done. Using dev_kfree_skb();

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/tulip/de4x5.c: fix union member name in DE4X5_GET_REG ioctl
Dan Rosenberg [Fri, 17 Sep 2010 05:34:26 +0000 (22:34 -0700)]
drivers/net/tulip/de4x5.c: fix union member name in DE4X5_GET_REG ioctl

This was previously reported as a security issue due to leakage of
uninitialized stack memory.  Jeff Mahoney pointed out that this is
incorrect since the copied data is from a union (rather than a struct).
Therefore, this patch is only under consideration for the sake of
correctness, and is not security relevant.

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: shrinks struct net_device
Eric Dumazet [Thu, 16 Sep 2010 02:58:13 +0000 (02:58 +0000)]
net: shrinks struct net_device

commit ab95bfe01 (net: replace hooks in __netif_receive_skb) added
rx_handler at wrong place, between two cache line aligned objects,
creating a big hole (a full cache line)

Move rx_handler and rx_handler_data before rx_queue, filling existing
hole.

Move master field in the cache line(s) used in receive path.

This saves 64 bytes (or L1_CACHE_BYTES), and avoids two possible
cache misses in receive path.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoip6tnl: get rid of ip6_tnl_lock
Eric Dumazet [Wed, 15 Sep 2010 20:25:34 +0000 (20:25 +0000)]
ip6tnl: get rid of ip6_tnl_lock

As RTNL is held while doing tunnels inserts and deletes, we can remove
ip6_tnl_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: include inetdevice.h for rcu_dereference_raw api change
Stephen Rothwell [Fri, 17 Sep 2010 04:39:16 +0000 (21:39 -0700)]
net: include inetdevice.h for rcu_dereference_raw api change

rcu_dereference_raw() now needs to know the type of its argument.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoath9k: fix regression which disabled ps on ath9k
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:36 +0000 (15:12 -0400)]
ath9k: fix regression which disabled ps on ath9k

The patch titled "ath9k: Add new file init.c" shuffled some code
around but in dong so for some reason also removed the revision
check for disablign power save. Add this revision check again
so we can get power save re-enabled again by default on cards
newer than AR5416 and AR5418.

$ git describe --contains 556242049cc3992d0ee625e9f15c4b00ea4baac8
v2.6.34-rc1~233^2~49^2~343

This patch has fixes for stable kernels [2.6.34+].

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix regression which prevents chip sleep after CAB data
Senthil Balasubramanian [Thu, 16 Sep 2010 19:12:35 +0000 (15:12 -0400)]
ath9k: fix regression which prevents chip sleep after CAB data

The patch:

commit 293dc5dfdbcc16cde06e40a688394cc8ab083e48
Author: Gabor Juhos <juhosg@openwrt.org>
Date:   Fri Jun 19 12:17:48 2009 +0200

    ath9k: remove ath_rx_ps_back_to_sleep helper

    This helper only clears the SC_OP_WAIT_FOR_{BEACON,CAB} flags.
    Remove it and clear these flags directly in the approptiate
    places instead.

    Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
introduced a regression which forgot to lift the beacon flag
after we received all broadcast and multicast data. This meant
we never went to sleep consuming about ~650mW on idle. This pretty
much broke power save completely.

This patch has fixes for stable kernels [2.6.32+].

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Sameer Nanda <snanda@google.com>
Cc: Gabor Juhos <juhosg@openwrt.org>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: send last 3/5 probe requests as unicast
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:34 +0000 (15:12 -0400)]
mac80211: send last 3/5 probe requests as unicast

Some buggy APs do not respond to unicast probe requests
or send unicast probe requests very delayed so in the
worst case we should try to send broadcast probe requests,
otherwise we can get disconnected from these APs.

Even if drivers do not have filters to disregard probe
responses from foreign APs mac80211 will only process
probe responses from our associated AP for re-arming
connection monitoring.

We need to do this since the beacon monitor does not
push back the connection monitor by design so even if we
are getting beacons from these type of APs our connection
monitor currently relies heavily on the way the probe
requests are received on the AP. An example of an AP
affected by this is the Nexus One, but this has also been
observed with random APs.

We can probably optimize this later by using null funcs
instead of probe requests.

For more details refer to:

http://code.google.com/p/chromium-os/issues/detail?id=5715

This patch has fixes for stable kernels [2.6.35+].

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: disable beacon monitor while going offchannel
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:33 +0000 (15:12 -0400)]
mac80211: disable beacon monitor while going offchannel

The beacon monitor should be disabled when going off channel
to prevent spurious warnings and triggering connection
deterioration work such as sending probe requests. Re-enable
the beacon monitor once we come back to the home channel.

This patch has fixes for stable kernels [2.6.34+].

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: make the beacon monitor available externally
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:32 +0000 (15:12 -0400)]
mac80211: make the beacon monitor available externally

This will be used by other components next. The beacon
monitor was added as of 2.6.34 so these fixes are applicable
only to kernels >= 2.6.34.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: reset connection idle when going offchannel
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:31 +0000 (15:12 -0400)]
mac80211: reset connection idle when going offchannel

When we go offchannel mac80211 currently leaves alive the
connection idle monitor. This should be instead postponed
until we come back to our home channel, otherwise by the
time we get back to the home channel we could be triggering
unecesary probe requests. For APs that do not respond to
unicast probe requests (Nexus One is a simple example) this
means we essentially get disconnected after the probes
fails.

This patch has stable fixes for kernels [2.6.35+]

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: reset probe send counter upon connection timer reset
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:30 +0000 (15:12 -0400)]
mac80211: reset probe send counter upon connection timer reset

Upon beacon loss we send probe requests after 30 seconds of idle
time and we wait for each probe response 1/2 second. We send a
total of 3 probe requests before giving up on the AP. In the case
that we reset the connection idle monitor we should reset the probe
requests count to 0. Right now this won't help in any way but
the next patch will.

This patch has fixes for stable kernel [2.6.35+].

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add helper for reseting the connection monitor
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:29 +0000 (15:12 -0400)]
mac80211: add helper for reseting the connection monitor

This will be used in another place later. The connection
monitor was added as of 2.6.35 so these fixes will be
applicable to >= 2.6.35.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix enabling ANI / tx monitor after bg scan
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:28 +0000 (15:12 -0400)]
ath9k: fix enabling ANI / tx monitor after bg scan

ath9k's entire logic with SC_OP_SCANNING is incorrect due to the
way mac80211 currently implements the scan complete callback and
we handle it in ath9k. This patch removes the flag completely in
preference for the SC_OP_OFFCHANNEL which is really what we wanted.

The scanning flag was used to ensure we reset ANI to the old values
when we go back to the home channel, but if we are offchannel we
use some defaults. The flag was also used to re-enable the TX monitor.

Without this patch we simply never re-enabled ANI and the TX monitor
after going offchannel. This means that after one background
scan we are prone to noise issues and if we had a TX hang we would
not recover. To get this to work properly we must enable ANI after
we have configured the beacon timers, otherwise hardware acts really
oddly.

This patch has stable fixes which apply down to [2.6.36+], there
*may* be a to fix this on older kernels but requires a bit of
work since this patch relies on the new mac80211 flag
IEEE80211_CONF_OFFCHANNEL which was introduced as of 2.6.36.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix regression on beacon loss after bgscan
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:27 +0000 (15:12 -0400)]
ath9k: fix regression on beacon loss after bgscan

When we return to the home channel we were never reseting our beacon
timers, this was casued by the fact that the scanning flag was still
on even after we returned to our home channel. There are also other
reasons why we would get a reset and if we are not off channel
we always need to resynch our beacon timers, because a reset will
clear them.

This bug is a regression introduced on 2.6.36. The order of the
changes are as follows:

5ee08656 - Sat Jul 31 - ath9k: prevent calibration during off-channel activity
a0daa0e7 - Tue Jul 27 - Revert "mac80211: fix sw scan bracketing"
543708be - Fri Jun 18 - mac80211: fix sw scan bracketing

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains 5ee0865615f65f84e6ee9174771a6716c29e08e1
v2.6.36-rc1~43^2~34^2~22

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains a0daa0e7592ada797d6835f11529097aabc27ad2
v2.6.36-rc1~571^2~64^2~13

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains 543708be320d7df692d24b349ca01a947b340764
v2.6.36-rc1~571^2~107^2~187

So 5ee08656 would have worked if a0daa0e7 was not committed but
it was so this means 5ee08656 was broken since it assumed that
when we were in the channel change routine the scan flag would
be lifted. As it turns out the scan flag will be set when we
are already on the home channel.

For more details refer to:

http://code.google.com/p/chromium-os/issues/detail?id=5715

These issues will need to be considered for our solution on
reshifting the scan complete callback location on mac80211 on
current development kernel work.

This patch has stable fixes which apply down to [2.6.36+]

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix power save race conditions
Luis R. Rodriguez [Thu, 16 Sep 2010 19:12:26 +0000 (15:12 -0400)]
ath9k: fix power save race conditions

ath9k has a race on putting the chip into network sleep and
having registers read from hardware. The race occurs because
although ath9k_ps_restore() locks its own callers it makes use
of some variables which get altered in the driver at different
code paths. The variables are the ps_enabled and ps_flags.

This is easily reprodicible in large network environments when
roaming with the wpa_supplicant simple bgscan. You'd get some
0xdeadbeef read out on certain registers such as:

ath: timeout (100000 us) on reg 0x806c: 0xdeadbeef & 0x01f00000 != 0x00000000
ath: RX failed to go idle in 10 ms RXSM=0xdeadbeef

ath: timeout (100000 us) on reg 0x7000: 0xdeadbeef & 0x00000003 != 0x00000000
ath: Chip reset failed

The fix is to protect the ath9k_config(hw, IEEE80211_CONF_CHANGE_PS)
calls with a spin_lock_irqsave() which will disable contendors for
these variables from interrupt context, timers, re-entry from mac80211
on the same callback, and most importantly from ath9k_ps_restore()
which is the only call which will put the device into network sleep.

There are quite a few threads and bug reports on these a few of them are:

https://bugs.launchpad.net/ubuntu/karmic/+source/linux/+bug/407040
http://code.google.com/p/chromium-os/issues/detail?id=5709
http://code.google.com/p/chromium-os/issues/detail?id=5943

Stable fixes apply to [2.6.32+]

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix register read through bulk pipe
Rajkumar Manoharan [Thu, 16 Sep 2010 14:26:55 +0000 (19:56 +0530)]
ath9k_htc: Fix register read through bulk pipe

To optimize register read/write operations, the HTC firmwares were patched
to change EP3 and EP4 pipe types from Interrupt to Bulk. So register writes
are submitted as bulk urbs, but register reads are not. Also changing the
register read endpoint pipe as bulk type when URBs are filled improves the
register reads considerably which results in reduced scan time and CPU
utilization.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add p2p device type support
Johannes Berg [Thu, 16 Sep 2010 12:58:23 +0000 (14:58 +0200)]
mac80211: add p2p device type support

When a driver advertises p2p device support,
mac80211 will handle it, but internally it will
rewrite the interface type to STA/AP rather than
P2P-STA/GO since otherwise a lot of paths need
to be touched that are otherwise identical. A
p2p boolean tells drivers whether or not a given
interface will be used for p2p or not.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/nl80211: introduce p2p device types
Johannes Berg [Thu, 16 Sep 2010 12:58:22 +0000 (14:58 +0200)]
cfg80211/nl80211: introduce p2p device types

This adds P2P-STA and P2P-GO as device types so
we can distinguish between those and normal STA
or AP (respectively) type interfaces.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: remove warning in ath9k_hw_def_get_num_ant_config
Rajkumar Manoharan [Thu, 16 Sep 2010 06:10:06 +0000 (11:40 +0530)]
ath9k_hw: remove warning in ath9k_hw_def_get_num_ant_config

This patch fixes following warning

drivers/net/wireless/ath/ath9k/eeprom_def.c: In function 'ath9k_hw_def_get_num_ant_config'
drivers/net/wireless/ath/ath9k/eeprom_def.c:1425:47: warning: comparison
between 'enum ath9k_hal_freq_band' and 'enum ieee80211_band'

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: correct sparse warnings
John W. Linville [Wed, 15 Sep 2010 19:40:12 +0000 (15:40 -0400)]
libertas: correct sparse warnings

  CHECK   drivers/net/wireless/libertas/cfg.c
drivers/net/wireless/libertas/cfg.c:493:19: warning: cast to restricted __le16
  CHECK   drivers/net/wireless/libertas/mesh.c
drivers/net/wireless/libertas/mesh.c:577:16: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/mesh.c:577:16:    expected restricted __le32 [addressable] [assigned] [usertype] id
drivers/net/wireless/libertas/mesh.c:577:16:    got bool

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: make ath_ant_div_conf_fast_divbias static
John W. Linville [Wed, 15 Sep 2010 19:26:13 +0000 (15:26 -0400)]
ath9k: make ath_ant_div_conf_fast_divbias static

  CHECK   drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/ath9k/recv.c:1341:6: warning: symbol 'ath_ant_div_conf_fast_divbias' was not declared. Should it be static?

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: fix sparse warning about wrong enum for band parameter
John W. Linville [Wed, 15 Sep 2010 19:16:22 +0000 (15:16 -0400)]
iwlwifi: fix sparse warning about wrong enum for band parameter

drivers/net/wireless/iwlwifi/iwl-scan.c:386:27: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:386:27:     int enum nl80211_band  versus
drivers/net/wireless/iwlwifi/iwl-scan.c:386:27:     int enum ieee80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57:     int enum ieee80211_band  versus
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57:     int enum nl80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53:     int enum ieee80211_band  versus
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53:     int enum nl80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72:     int enum ieee80211_band  versus
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72:     int enum nl80211_band

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: set running state earlier
Johannes Berg [Wed, 15 Sep 2010 13:13:13 +0000 (15:13 +0200)]
mac80211: set running state earlier

When an interface is brought up, the recent changes
to allow changing type-while-up only set the running
bit after everything was done. This broke a number
of things, including idle calculation for monitor
interfaces, and it also broke WDS station insertion
(although nobody noticed yet).

Thus, change the code to set the running bit earlier,
but keep it after the driver's add_interface was
called because otherwise drivers may iterate over
interfaces they haven't fully set up yet.

Reported-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: use lockdep_assert_held
Johannes Berg [Wed, 15 Sep 2010 11:28:15 +0000 (13:28 +0200)]
cfg80211/mac80211: use lockdep_assert_held

Instead of using a WARN_ON(!mutex_is_locked())
use lockdep_assert_held() which compiles away
completely when lockdep isn't enabled, and
also is a more accurate assertion since it
checks that the current thread is holding the
mutex.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use correct station flags lock
Johannes Berg [Tue, 14 Sep 2010 20:06:53 +0000 (22:06 +0200)]
mac80211: use correct station flags lock

This code is modifying the station flags, and
as such should hold the flags lock so it can
do so atomically vs. other flags modifications
and readers. This issue was introduced when
this code was added in eccb8e8f, as it used
the wrong lock (thus not fixing the race that
was previously documented in a comment.)

Cc: stable@kernel.org [2.6.31+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Print rxfilter in debugfs.
Ben Greear [Tue, 14 Sep 2010 19:46:04 +0000 (12:46 -0700)]
ath9k: Print rxfilter in debugfs.

Print raw and decoded rxfilter in debufs 'wiphy' file.

Also, move variable-length printouts to bottom of file to
make bounds checking easier.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: calcrxfilter should take multiple VIFs into account.
Ben Greear [Tue, 14 Sep 2010 19:00:22 +0000 (12:00 -0700)]
ath9k: calcrxfilter should take multiple VIFs into account.

When there is more than one VIF, listen for all beacons
and ensure ATH9K_RX_FILTER_MCAST_BCAST_ALL is set.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Use common ath key management functions
Bruno Randolf [Wed, 8 Sep 2010 07:05:04 +0000 (16:05 +0900)]
ath9k: Use common ath key management functions

Use key management functions which have been moved to ath/key.c and remove
ath9k copies of these functions and other now unused definitions.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use common crypt capabilities flags
Bruno Randolf [Wed, 8 Sep 2010 07:04:59 +0000 (16:04 +0900)]
ath5k: Use common crypt capabilities flags

Replace ah_aes_support and ah_combined_mic with common ath_crypt_caps
ATH_CRYPT_CAP_CIPHER_AESCCM and ATH_CRYPT_CAP_MIC_COMBINED.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath/ath9k: Replace common->splitmic with a flag
Bruno Randolf [Wed, 8 Sep 2010 07:04:54 +0000 (16:04 +0900)]
ath/ath9k: Replace common->splitmic with a flag

Replace common->splitmic with ATH_CRYPT_CAP_MIC_COMBINED flag.

splitmic has to be used when the ATH_CRYPT_CAP_MIC_COMBINED capability flag is
not set.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Remove old ath5k key handling functions
Bruno Randolf [Wed, 8 Sep 2010 07:04:49 +0000 (16:04 +0900)]
ath5k: Remove old ath5k key handling functions

Remove the old ath5k key handling functions, since we now use the key
management in ath common.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use common ath key management functions
Bruno Randolf [Wed, 8 Sep 2010 07:04:43 +0000 (16:04 +0900)]
ath5k: Use common ath key management functions

Use common ath key management functions in ath5k. This fixes problems with HW
encryption in AP mode, which was broken in the ath5k implementation.

Before (with the ath5k implementation) only one client could connect to the AP
using HW encryption and WPA. When a second client connected, the first client
was not able to send/receive any more packets. Because of the problems with HW
encryption, software encryption was always used in AP mode, which resulted in a
high CPU load (and/or low thruput) on embedded devices. Instead of trying to
fix the implementation in ath5k it makes more sense to share the code with
ath9k.

This also enables HW encryption for AP mode again.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath: Copy key cache management functions from ath9k to ath
Bruno Randolf [Wed, 8 Sep 2010 07:04:38 +0000 (16:04 +0900)]
ath: Copy key cache management functions from ath9k to ath

Copied the key cache management functions from ath9k (common.c and hw.c) to
ath/key.c so we can use them from ath5k, later.

Minor changes have been made:
 - renamed ath9k_* to ath_*
 - replaced ah->caps.keycache_size with common->keymax
 - removed ATH9K_IS_MIC_ENABLED since it is always true.
 - the AR_PCU_MIC_NEW_LOC_ENA flag is replaced with (splitmic == 0).

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath: Copy cryptographic capability flags into ath
Bruno Randolf [Wed, 8 Sep 2010 07:04:33 +0000 (16:04 +0900)]
ath: Copy cryptographic capability flags into ath

This will be used later in this patch series.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoinclude/net/cfg80211.h: wiphy_<level> messages use dev_printk
Joe Perches [Fri, 20 Aug 2010 22:13:59 +0000 (15:13 -0700)]
include/net/cfg80211.h: wiphy_<level> messages use dev_printk

The output becomes:

[   41.261941] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet: enable GRO by default for vlan devices
Brandon Philips [Wed, 15 Sep 2010 09:24:24 +0000 (09:24 +0000)]
net: enable GRO by default for vlan devices

Currently vlan devices don't have GRO by default as none of the Ethernet
drivers add NETIF_F_GRO to their vlan_features.

As GRO is a software feature add GRO to dev->vlan_features in
register_netdevice() and let vlan_dev_init() take care that it gets
enabled only when dev->features has NETIF_F_GRO too.

Signed-off-by: Brandon Philips <bphilips@suse.de>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoehea: Remove a silly return
Breno Leitao [Wed, 15 Sep 2010 17:54:22 +0000 (17:54 +0000)]
ehea: Remove a silly return

This patch removes the unconditional return in the end of the
function check_sqs()

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosky2: enable GRO by default
stephen hemminger [Wed, 15 Sep 2010 17:22:17 +0000 (17:22 +0000)]
sky2: enable GRO by default

The driver has supported GRO for a while, but it was not enabled
by default.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: ip_ptr cleanups
Eric Dumazet [Wed, 15 Sep 2010 04:04:31 +0000 (04:04 +0000)]
ipv4: ip_ptr cleanups

dev->ip_ptr is protected by rtnl and rcu.

Yet some places dont use appropriate primitives and/or locking rules.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agophonet: Fix build warning.
David S. Miller [Thu, 16 Sep 2010 04:34:41 +0000 (21:34 -0700)]
phonet: Fix build warning.

net/phonet/socket.c: In function ‘pn_res_seq_show’:
net/phonet/socket.c:726: warning: format ‘%02X’ expects type ‘unsigned int’, but argument 3 has type ‘long int’

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: resource routing documentation
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:30:15 +0000 (12:30 +0000)]
Phonet: resource routing documentation

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: list subscribed resources via proc_fs
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:30:14 +0000 (12:30 +0000)]
Phonet: list subscribed resources via proc_fs

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: look up the resource routing table when forwarding
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:30:13 +0000 (12:30 +0000)]
Phonet: look up the resource routing table when forwarding

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: hook resource routing to userspace via ioctl()'s
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:30:12 +0000 (12:30 +0000)]
Phonet: hook resource routing to userspace via ioctl()'s

I wish we could use something cleaner, such as bind(). But that would
not work since resource subscription is orthogonal/in addition to the
normal object ID allocated via bind(). This is similar to multicasting
which also uses ioctl()'s.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: resource routing backend
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:30:11 +0000 (12:30 +0000)]
Phonet: resource routing backend

When both destination device and object are nul, Phonet routes the
packet according to the resource field. In fact, this is the most
common pattern when sending Phonet "request" packets. In this case,
the packet is delivered to whichever endpoint (socket) has
registered the resource.

This adds a new table so that Linux processes can register their
Phonet sockets to Phonet resources, if they have adequate privileges.

(Namespace support is not implemented at the moment.)

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoPhonet: remove dangling pipe if an endpoint is closed early
Rémi Denis-Courmont [Wed, 15 Sep 2010 12:19:53 +0000 (12:19 +0000)]
Phonet: remove dangling pipe if an endpoint is closed early

Closing a pipe endpoint is not normally allowed by the Phonet pipe,
other than as a side after-effect of removing the pipe between two
endpoints. But there is no way to prevent Linux userspace processes
from being killed or suffering from bugs, so this can still happen.
We might as well forcefully close Phonet pipe endpoints then.

The cellular modem supports only a few existing pipes at a time. So we
really should not leak them. This change instructs the modem to destroy
the pipe if either of the pipe's endpoint (Linux socket) is closed too
early.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/net-next-2.6
David S. Miller [Thu, 16 Sep 2010 03:21:48 +0000 (20:21 -0700)]
Merge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/net-next-2.6

13 years agomisdn: kill big kernel lock
Arnd Bergmann [Tue, 14 Sep 2010 09:35:05 +0000 (09:35 +0000)]
misdn: kill big kernel lock

The use of the big kernel lock in misdn is completely
bogus, so let's just remove it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoi4l: kill big kernel lock
Arnd Bergmann [Tue, 14 Sep 2010 09:35:04 +0000 (09:35 +0000)]
i4l: kill big kernel lock

The isdn4linux driver uses the big kernel lock only
to serialize access to a few fields in its own
modem_info structure.

The easiest replacement is a driver-wide mutex.
More fine-grained locking would be more appropriate
here, but likely harder to implement.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoirda/irnet: use noop_llseek
Arnd Bergmann [Tue, 14 Sep 2010 10:22:36 +0000 (10:22 +0000)]
irda/irnet: use noop_llseek

There may be applications trying to seek
on the irnet character device, so we should
use noop_llseek to avoid returning an error
when the default llseek changes to no_llseek.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosit: get rid of ipip6_lock
Eric Dumazet [Wed, 15 Sep 2010 11:35:10 +0000 (11:35 +0000)]
sit: get rid of ipip6_lock

As RTNL is held while doing tunnels inserts and deletes, we can remove
ipip6_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogre: get rid of ipgre_lock
Eric Dumazet [Wed, 15 Sep 2010 11:07:53 +0000 (11:07 +0000)]
gre: get rid of ipgre_lock

As RTNL is held while doing tunnels inserts and deletes, we can remove
ipgre_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipip: get rid of ipip_lock
Eric Dumazet [Wed, 15 Sep 2010 11:07:24 +0000 (11:07 +0000)]
ipip: get rid of ipip_lock

As RTNL is held while doing tunnels inserts and deletes, we can remove
ipip_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add rtnl_dereference()
Eric Dumazet [Wed, 15 Sep 2010 11:07:15 +0000 (11:07 +0000)]
net: add rtnl_dereference()

We sometime want to dereference an rcu protected pointer while
holding RTNL. Use a macro to hide all lockdep details.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Remove unimplemented flow specification types
Ben Hutchings [Tue, 14 Sep 2010 09:13:08 +0000 (09:13 +0000)]
ethtool: Remove unimplemented flow specification types

struct ethtool_rawip4_spec and struct ethtool_ether_spec are neither
commented nor used by any driver, so remove them.  Adjust padding in
the user-visible unions that included these structures.

Fix references to struct ethtool_rawip4_spec in
ethtool_get_rx_ntuple(), which should use struct ethtool_usrip4_spec.

struct ethtool_usrip4_spec cannot hold IPv6 host addresses and there
is no separate structure that can, so remove ETH_RX_NFC_IP6 and the
reference to it in niu.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Complete kernel-doc comments for RX flow filter and hash control
Ben Hutchings [Tue, 14 Sep 2010 09:10:03 +0000 (09:10 +0000)]
ethtool: Complete kernel-doc comments for RX flow filter and hash control

There are now several interfaces within the ethtool API for getting
and setting RX flow filtering and hashing behaviour, most of which are
poorly documented.  This adds kernel-doc comments for all these
interfaces, based on the existing incomplete comments and on the
initial implementations.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: phy tmp variable roundup
Matt Carlson [Wed, 15 Sep 2010 09:00:01 +0000 (09:00 +0000)]
tg3: phy tmp variable roundup

The tg3's phy routines define temporary variables in many locations
within the same routine.  This patch unifies all temporary variables
into one location.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Dynamically allocate VPD data memory
Matt Carlson [Wed, 15 Sep 2010 09:00:00 +0000 (09:00 +0000)]
tg3: Dynamically allocate VPD data memory

This patch eases stack pressure by dynamically allocating the memory
used to temporarily store VPD data.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Use skb_is_gso_v6()
Matt Carlson [Wed, 15 Sep 2010 08:59:59 +0000 (08:59 +0000)]
tg3: Use skb_is_gso_v6()

This patch converts the driver to prefer the skb_is_gso_v6() helper over
the explicit inlined version.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Move producer ring struct to tg3_napi
Matt Carlson [Wed, 15 Sep 2010 08:59:58 +0000 (08:59 +0000)]
tg3: Move producer ring struct to tg3_napi

Now that each NAPI instance has its own producer ring, it no longer
makes sense to keep the producer ring structure external.  This patch
migrates the producer ring struct to tg3_napi and pivots the code to the
new implementation.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Clarify semantics of TG3_IRQ_MAX_VECS
Matt Carlson [Wed, 15 Sep 2010 08:59:57 +0000 (08:59 +0000)]
tg3: Clarify semantics of TG3_IRQ_MAX_VECS

TG3_IRQ_MAX_VECS should be seen as the maximum number of vectors that
any device could be expected to use.  tp->irq_max represents the maximum
number of vectors the current device can use.  This patch clarifies the
semantics of the code to match the above description.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Unlock 5717 B0+ support
Matt Carlson [Wed, 15 Sep 2010 08:59:56 +0000 (08:59 +0000)]
tg3: Unlock 5717 B0+ support

This patch adjusts the driver to use the tg3_start_xmit_dma_bug()
transmit routine for all revisions of 5717 asic rev devices and then
allows the driver to attach to B0 and later devices.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Don't send APE events for NCSI firmware
Matt Carlson [Wed, 15 Sep 2010 08:59:55 +0000 (08:59 +0000)]
tg3: Don't send APE events for NCSI firmware

NCSI firmware does not accept APE events.  It relies on a "driver state"
location in shared memory to tell it what the driver's current state is.

This patch pivots the code to use the new driver state scheme.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Disable TSS
Matt Carlson [Wed, 15 Sep 2010 08:59:54 +0000 (08:59 +0000)]
tg3: Disable TSS

It was recently discovered that enabling TSS can lockup the device.
This patch disables the feature until a suitable workaround can be
found.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Fix read DMA FIFO overruns on recent devices
Matt Carlson [Wed, 15 Sep 2010 08:59:53 +0000 (08:59 +0000)]
tg3: Fix read DMA FIFO overruns on recent devices

Earlier versions of tg3 devices had a problem where the read DMA FIFO
could be overrun in certain edge conditions.  The fix was to limit the
number of rx BDs the hardware would fetch at a time.  For later devices
(5761, 5784 and later ASIC revs), there is a hardware fix that must be
enabled to fix the same problem.  This patch adds that hardware fix.

There is a gap in the ASIC revision lineage where neither fix is
applied.  This is intentional as these ASIC revisions are not afflicted
by the bug.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-3: Simplify and consolidate tx_parse_options
Gerrit Renker [Tue, 14 Sep 2010 18:21:29 +0000 (20:21 +0200)]
dccp ccid-3: Simplify and consolidate tx_parse_options

This simplifies and consolidates the TX option-parsing code:

 1. The Loss Intervals option is not currently used, so dead code related to
    this option is removed. I am aware of no plans to support the option, but
    if someone wants to implement it (e.g. for inter-op tests), it is better
    to start afresh than having to also update currently unused code.

 2. The Loss Event and Receive Rate options have a lot of code in common (both
    are 32 bit, both have same length etc.), so this is consolidated.

 3. The test against GSR is not necessary, because
    - on first loading CCID3, ccid_new() zeroes out all fields in the socket;
    - ccid3_hc_tx_packet_recv() treats 0 and ~0U equivalently, due to

pinv = opt_recv->ccid3or_loss_event_rate;
if (pinv == ~0U || pinv == 0)
hctx->p = 0;

    - as a result, the sequence number field is removed from opt_recv.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp ccid-3: remove buggy RTT-sampling history lookup
Gerrit Renker [Tue, 14 Sep 2010 18:18:00 +0000 (20:18 +0200)]
dccp ccid-3: remove buggy RTT-sampling history lookup

This removes the RTT-sampling function tfrc_tx_hist_rtt(), since

 1. it suffered from complex passing of return values (the return value both
    indicated successful lookup while the value doubled as RTT sample);

 2. when for some odd reason the sample value equalled 0, this triggered a bug
    warning about "bogus Ack", due to the ambiguity of the return value;

 3. on a passive host which has not sent anything the TX history is empty and
    thus will lead to unwanted "bogus Ack" warnings such as
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-28197148
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-26641606.

The fix is to replace the implicit encoding by performing the steps manually.

Furthermore, the "bogus Ack" warning has been removed, since it can actually be
triggered due to several reasons (network reordering, old packet, (3) above),
hence it is not very useful.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp ccid-3: A lower bound for the inter-packet scheduling algorithm
Gerrit Renker [Tue, 14 Sep 2010 18:16:59 +0000 (20:16 +0200)]
dccp ccid-3: A lower bound for the inter-packet scheduling algorithm

This fixes a subtle bug in the calculation of the inter-packet gap and shows
that t_delta, as it is currently used, is not needed.

The algorithm from RFC 5348, 8.3 below continually computes a send time t_nom,
which is initialised with the current time t_now; t_gran = 1E6 / HZ specifies
the scheduling granularity, s the packet size, and X the sending rate:

  t_distance = t_nom - t_now; // in microseconds
  t_delta    = min(t_ipi, t_gran) / 2; // `delta' parameter in microseconds

  if (t_distance >= t_delta) {
reschedule after (t_distance / 1000) milliseconds;
  } else {
   t_ipi  = s / X; // inter-packet interval in usec
t_nom += t_ipi; // compute the next send time
send packet now;
  }

Problem:
--------
Rescheduling requires a conversion into milliseconds (sk_reset_timer()). The
highest jiffy resolution with HZ=1000 is 1 millisecond, so using a higher
granularity does not make much sense here.

As a consequence, values of t_distance < 1000 are truncated to 0. This issue
has so far been resolved by using instead

  if (t_distance >= t_delta + 1000)
reschedule after (t_distance / 1000) milliseconds;

This is unnecessarily large, a lower bound is t_delta' = max(t_delta, 1000).
And it implies a further simplification:

 a) when HZ >= 500, then t_delta <= t_gran/2 = 10^6/(2*HZ) <= 1000, so that
    t_delta' = MAX(1000, t_delta) = 1000 (constant value);

 b) when HZ < 500, then t_delta = 1/2*MIN(rtt, t_ipi, t_gran) <= t_gran/2,
    so that 1000 <= t_delta' <= t_gran/2.

The maximum error of using a constant t_delta in (b) is less than half a jiffy.

Fix:
----
The patch replaces t_delta with a constant, whose value depends on CONFIG_HZ,
changing the above algorithm to:

  if (t_distance >= t_delta')
reschedule after (t_distance / 1000) milliseconds;

where t_delta' = 10^6/(2*HZ) if HZ < 500, and t_delta' = 1000 otherwise.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agoX.25 remove bkl in connect
andrew hendry [Tue, 14 Sep 2010 13:32:03 +0000 (13:32 +0000)]
X.25 remove bkl in connect

Connect already has socket locking.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX.25 remove bkl in accept
Andrew Hendry [Wed, 15 Sep 2010 03:38:54 +0000 (20:38 -0700)]
X.25 remove bkl in accept

Accept already has socket locking.

[ Extend socket locking over TCP_LISTEN state test. -DaveM ]

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX.25 remove bkl in bind
andrew hendry [Tue, 14 Sep 2010 13:31:38 +0000 (13:31 +0000)]
X.25 remove bkl in bind

Accept updates socket values in 3 lines so wrapped with lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX.25 remove bkl in listen
andrew hendry [Tue, 14 Sep 2010 13:31:16 +0000 (13:31 +0000)]
X.25 remove bkl in listen

Listen updates socket values and needs lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/irda: Use static const char * const where possible
Joe Perches [Mon, 13 Sep 2010 18:24:01 +0000 (18:24 +0000)]
net/irda: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/wireless: Use static const char * const where possible
Joe Perches [Mon, 13 Sep 2010 18:23:55 +0000 (18:23 +0000)]
drivers/net/wireless: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/pcmcia: Use static const char * const where possible
Joe Perches [Mon, 13 Sep 2010 18:23:54 +0000 (18:23 +0000)]
drivers/net/pcmcia: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net: Use static const char * const where possible
Joe Perches [Mon, 13 Sep 2010 18:23:53 +0000 (18:23 +0000)]
drivers/net: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/isdn: Use static const char * const where possible
Joe Perches [Mon, 13 Sep 2010 18:23:52 +0000 (18:23 +0000)]
drivers/isdn: Use static const char * const where possible

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoe1000e: Simplify MSI interrupt testing
Jean Delvare [Sun, 12 Sep 2010 22:45:39 +0000 (22:45 +0000)]
e1000e: Simplify MSI interrupt testing

The code is quite convoluted, simplify it. This also avoids calling
e1000_request_irq() without testing the value it returned, which was
bad.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agowl1271: remove warnings in wl1271_sdio_set_power
John W. Linville [Tue, 14 Sep 2010 20:26:44 +0000 (16:26 -0400)]
wl1271: remove warnings in wl1271_sdio_set_power

These were introduced in "wl1271: sdio: claim host only when doing IO"

drivers/net/wireless/wl12xx/wl1271_sdio.c: In function ‘wl1271_sdio_set_power’:
drivers/net/wireless/wl12xx/wl1271_sdio.c:193: warning: ‘return’ with a value, in function returning void
drivers/net/wireless/wl12xx/wl1271_sdio.c:195: warning: ‘return’ with a value, in function returning void
drivers/net/wireless/wl12xx/wl1271_sdio.c:186: warning: unused variable ‘func’

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: match only assigned bss in sta_info_get_bss
Johannes Berg [Tue, 14 Sep 2010 19:34:14 +0000 (21:34 +0200)]
mac80211: match only assigned bss in sta_info_get_bss

sta_info_get_bss() is used to match STA pointers
for VLAN/AP interfaces, but if the same station
is also added to multiple other interfaces it
will erroneously match because both pointers are
NULL, fix this by ignoring NULL pointers here.

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: remove useless hw capability flags
Felix Fietkau [Tue, 14 Sep 2010 18:22:44 +0000 (20:22 +0200)]
ath9k_hw: remove useless hw capability flags

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: handle rx key miss
Felix Fietkau [Tue, 14 Sep 2010 16:38:26 +0000 (18:38 +0200)]
ath9k_hw: handle rx key miss

If AR_KeyMiss is set in the rx descriptor and AR_RxFrameOK is unset,
the hardware could not locate a valid key during a decryption attempt.

In this case, the frame must not be reported as decrypted, otherwise
mac80211 sees only random garbage.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add a note about iterating interfaces during add_interface()
Felix Fietkau [Tue, 14 Sep 2010 16:37:20 +0000 (18:37 +0200)]
mac80211: add a note about iterating interfaces during add_interface()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix BSSID mask calculation
Felix Fietkau [Tue, 14 Sep 2010 16:37:19 +0000 (18:37 +0200)]
ath9k: fix BSSID mask calculation

At the time the .add_interface driver op is called, the interface has not
been marked as running yet, so ieee80211_iterate_active_interfaces will
not pass it to the iterator function.
Because of this, the calculated BSSID mask is wrong, which breaks multi-BSS
operation.

Additionally, the current way of comparing all addresses against each other
is pointless, as the hardware only uses the hardware MAC address and the BSSID
mask for matching the destination address, so all the address array
reallocation is completely unnecessary.

This patch simplifies the logic by setting the initial mask bytes to 0xff
and removing all bits in the iterator call that don't match the hardware MAC
address. It also calls the iterator for the vif that was passed to
add_interface()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix CPU usage issue during scan period
Rajkumar Manoharan [Tue, 14 Sep 2010 09:05:55 +0000 (14:35 +0530)]
ath9k_htc: Fix CPU usage issue during scan period

The CPU consumption during the scan period is high, since
the register write go over Interrupt endpoint. On downloading
the firmware to the target, the USB descriptors are
'patched' to change the type of the endpoints from Interrupt
to Bulk.

With this fix, the CPU usage during a scan run comes down to
acceptable levels.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix memory leak on WMI event handler
Rajkumar Manoharan [Tue, 14 Sep 2010 07:37:28 +0000 (13:07 +0530)]
ath9k_htc: Fix memory leak on WMI event handler

ath9k_wmi_ctrl_rx is racy with ath9k_wmi_tasklet on event notification
due to which the wmi_skb may be overwritten which leads to memory leak.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: apply settings when finishing scan
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:45 +0000 (14:46 +0200)]
iwlwifi: apply settings when finishing scan

Even is someone else complete scanning in mac80211, apply rxon and
tx power settings if gets scan complete notification from hardware.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: use IWL_DEBUG_SCAN for debug scanning
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:44 +0000 (14:46 +0200)]
iwlwifi: use IWL_DEBUG_SCAN for debug scanning

Replace IWL_DEBUG_{INFO,HC,RC} to IWL_DEBUG_SCAN in iwl-scan.c file. Add
some more IWL_DEBUG_SCAN messages. This will allow to fully debug
scanning using only IWL_DL_SCAN flag.

Also start one message sentence with capital letter, since that
convention in iwl-scan.c file.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: cleanup scan initiate check
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:43 +0000 (14:46 +0200)]
iwlwifi: cleanup scan initiate check

Remove redundant checks and use iwl_is_ready_rf().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: wait for scan work complete before restarting hw
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:42 +0000 (14:46 +0200)]
mac80211: wait for scan work complete before restarting hw

This is needed to avoid warning in ieee80211_restart_hw about hardware
scan in progress.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: do not force complete scan too early
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:41 +0000 (14:46 +0200)]
iwlwifi: do not force complete scan too early

Currently we force scan complete at the end of iwl_scan_cancel_timeout
function. This cause race condition when we can get a new scan request
from mac80211 and complete it by iwl_bg_complete from older scan. Change
code to force scan complete only when really needed: device goes down,
interface is removed or scan timeout occurs.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: assure we complete scan in scan_abort and scan_check works
Stanislaw Gruszka [Mon, 13 Sep 2010 12:46:40 +0000 (14:46 +0200)]
iwlwifi: assure we complete scan in scan_abort and scan_check works

Assure we complete scan in mac80211 when we abort scanning (scan_abort
work) or scan timeout occurs (scan_check work). Currently
iwl_scan_cancel_timeout() procedure force scan finish in mac80211
at the end of timeout loop, so we can use it in proper work functions.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>