safe/jmp/linux-2.6
15 years agoipv4: Fix oops with FIB_TRIE
Robert Olsson [Thu, 21 May 2009 22:20:59 +0000 (15:20 -0700)]
ipv4: Fix oops with FIB_TRIE

It seems we can fix this by disabling preemption while we re-balance the
trie. This is with the CONFIG_CLASSIC_RCU. It's been stress-tested at high
loads continuesly taking a full BGP table up/down via iproute -batch.

Note. fib_trie is not updated for CONFIG_PREEMPT_RCU

Reported-by: Andrei Popa
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaf_packet: Teach to listen for multiple unicast addresses.
Eric W. Biederman [Tue, 19 May 2009 18:27:17 +0000 (18:27 +0000)]
af_packet: Teach to listen for multiple unicast addresses.

The the PACKET_ADD_MEMBERSHIP and the PACKET_DROP_MEMBERSHIP setsockopt
calls for af_packet already has all of the infrastructure needed to subscribe
to multiple mac addresses.  All that is missing is a flag to say that
the address we want to listen on is a unicast address.

So introduce PACKET_MR_UNICAST and wire it up to dev_unicast_add and
dev_unicast_delete.

Additionally I noticed that errors from dev_mc_add were not propagated
from packet_dev_mc so fix that.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: simplify net_ns_init
Stephen Hemminger [Thu, 21 May 2009 22:10:31 +0000 (15:10 -0700)]
netns: simplify net_ns_init

The net_ns_init code can be simplified. No need to save error code
if it is only going to panic if it is set 4 lines later.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetns: remove leftover debugging message
Stephen Hemminger [Thu, 21 May 2009 22:10:05 +0000 (15:10 -0700)]
netns: remove leftover debugging message

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopktgen: do not access flows[] beyond its length
Florian Westphal [Thu, 21 May 2009 22:07:12 +0000 (15:07 -0700)]
pktgen: do not access flows[] beyond its length

typo -- pkt_dev->nflows is for stats only, the number of concurrent
flows is stored in cflows.

Reported-By: Vladimir Ivashchenko <hazard@francoudi.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogigaset: beyond ARRAY_SIZE of iwb->data
Roel Kluin [Thu, 21 May 2009 22:04:15 +0000 (15:04 -0700)]
gigaset: beyond ARRAY_SIZE of iwb->data

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb: set phy's mdio dev before the phy init sequence
Divy Le Ray [Wed, 20 May 2009 15:56:12 +0000 (15:56 +0000)]
cxgb: set phy's mdio dev before the phy init sequence

mdio's dev field needs to be set before mdio ops occur.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: set phy's mdio dev before the phy init sequence
Divy Le Ray [Wed, 20 May 2009 15:56:02 +0000 (15:56 +0000)]
cxgb3: set phy's mdio dev before the phy init sequence

mdio's dev field needs to be set before mdio ops occur.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: Use generic XENPAK LASI register definitions
Ben Hutchings [Tue, 19 May 2009 13:22:30 +0000 (13:22 +0000)]
cxgb3: Use generic XENPAK LASI register definitions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agochelsio: Use generic XENPAK LASI register definitions
Ben Hutchings [Tue, 19 May 2009 13:21:07 +0000 (13:21 +0000)]
chelsio: Use generic XENPAK LASI register definitions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoIPv6: set RTPROT_KERNEL to initial route
Jean-Mickael Guerin [Thu, 21 May 2009 00:38:59 +0000 (17:38 -0700)]
IPv6: set RTPROT_KERNEL to initial route

The use of unspecified protocol in IPv6 initial route prevents quagga to
install IPv6 default route:
# show ipv6 route
S   ::/0 [1/0] via fe80::1, eth1_0
K>* ::/0 is directly connected, lo, rej
C>* ::1/128 is directly connected, lo
C>* fe80::/64 is directly connected, eth1_0

# ip -6 route
fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
hoplimit -1
ff00::/8 dev eth1_0  metric 256  mtu 1500 advmss 1440 hoplimit -1
unreachable default dev lo  proto none  metric -1  error -101 hoplimit 255

The attached patch ensures RTPROT_KERNEL to the default initial route
and fixes the problem for quagga.
This is similar to "ipv6: protocol for address routes"
f410a1fba7afa79d2992620e874a343fdba28332.

# show ipv6 route
S>* ::/0 [1/0] via fe80::1, eth1_0
C>* ::1/128 is directly connected, lo
C>* fe80::/64 is directly connected, eth1_0

# ip -6 route
fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
hoplimit -1
fe80::/64 dev eth1_0  proto kernel  metric 256  mtu 1500 advmss 1440
hoplimit -1
ff00::/8 dev eth1_0  metric 256  mtu 1500 advmss 1440 hoplimit -1
default via fe80::1 dev eth1_0  proto zebra  metric 1024  mtu 1500
advmss 1440 hoplimit -1
unreachable default dev lo  proto kernel  metric -1  error -101 hoplimit 255

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqeth: Clear SBALF15 in any case for output buffers.
Klaus-Dieter Wacket [Tue, 19 May 2009 21:38:41 +0000 (21:38 +0000)]
qeth: Clear SBALF15 in any case for output buffers.

Function qeth_clear_output_buffer for HiperSockets may not clear
all 16 SBALEs, but only the used ones. The error flag in SBALF15
has to be cleared in any case.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqeth: omit upstream checksumming for HiperSockets
Ursula Braun [Tue, 19 May 2009 21:38:40 +0000 (21:38 +0000)]
qeth: omit upstream checksumming for HiperSockets

For HiperSocket devices receive-path checksumming is not required.
Thus NO_CHECKSUMMING is used as default for HiperSocket interfaces.
For layer3 devices configured with NO_CHECKSUMMING received skbs
should have set their ip_summed field to CHECKSUM_UNNECESSARY.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqeth: support z/VM VSWITCH Port Isolation
Ursula Braun [Tue, 19 May 2009 21:38:39 +0000 (21:38 +0000)]
qeth: support z/VM VSWITCH Port Isolation

z/VM Virtual Switch Port Isolation allows guests on a VLAN UNAWARE
virtual switch to be isolated from other guests on the VSWITCH.
(See z/VM Apars VM64281 and VM64463).
The Linux qeth driver is affected, because it has to handle new
error codes introduced with the z/VM VSWITCH Port Isolation support.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoctcm: avoid crash in ctcm_remove_device
Ursula Braun [Tue, 19 May 2009 21:38:38 +0000 (21:38 +0000)]
ctcm: avoid crash in ctcm_remove_device

Channels are already removed when setting a ctcm-device offline.
Thus ctcm_remove_device must not refer to channel information.
Solution: delete channel information from the trace call in
ctcm_remove_device.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoqeth: avoid crash after detach of replugged device
Ursula Braun [Tue, 19 May 2009 21:38:37 +0000 (21:38 +0000)]
qeth: avoid crash after detach of replugged device

If a qeth device is plugged off, setting the device online stops in
state HARDSETUP and a failure is reported to the base cio-layer
causing halt/clear to be invoked. Replugging the device again triggers
a qeth recovery without notification of the cio-layer. If a device
is ungrouped in this state, the qeth set_offline function is not
invoked, because the corresponding ccwgroup device is not in state
ONLINE. Then incoming traffic is still handled by the qdio layer
resulting in a crash in qeth_l<x>_qdio_input_handler, because (part
of) the qeth data structures for this device are already removed.
Solution: After replugging the device qeth recovery should lead to a
working net device. Thus a "LAN offline" result when setting a qeth
device online must not report a failure to the base cio-layer.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 21 May 2009 00:31:25 +0000 (17:31 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

15 years agonet: Remove unused parameter from fill method in fib_rules_ops.
Rami Rosen [Thu, 21 May 2009 00:26:23 +0000 (17:26 -0700)]
net: Remove unused parameter from fill method in fib_rules_ops.

The netlink message header (struct nlmsghdr) is an unused parameter in
fill method of fib_rules_ops struct.  This patch removes this
parameter from this method and fixes the places where this method is
called.

(include/net/fib_rules.h)

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix rtable leak in net/ipv4/route.c
Eric Dumazet [Tue, 19 May 2009 20:14:28 +0000 (20:14 +0000)]
net: fix rtable leak in net/ipv4/route.c

Alexander V. Lukyanov found a regression in 2.6.29 and made a complete
analysis found in http://bugzilla.kernel.org/show_bug.cgi?id=13339
Quoted here because its a perfect one :

begin_of_quotation
 2.6.29 patch has introduced flexible route cache rebuilding. Unfortunately the
 patch has at least one critical flaw, and another problem.

 rt_intern_hash calculates rthi pointer, which is later used for new entry
 insertion. The same loop calculates cand pointer which is used to clean the
 list. If the pointers are the same, rtable leak occurs, as first the cand is
 removed then the new entry is appended to it.

 This leak leads to unregister_netdevice problem (usage count > 0).

 Another problem of the patch is that it tries to insert the entries in certain
 order, to facilitate counting of entries distinct by all but QoS parameters.
 Unfortunately, referencing an existing rtable entry moves it to list beginning,
 to speed up further lookups, so the carefully built order is destroyed.

 For the first problem the simplest patch it to set rthi=0 when rthi==cand, but
 it will also destroy the ordering.
end_of_quotation

Problematic commit is 1080d709fb9d8cd4392f93476ee46a9d6ea05a5b
(net: implement emergency route cache rebulds when gc_elasticity is exceeded)

Trying to keep dst_entries ordered is too complex and breaks the fact that
order should depend on the frequency of use for garbage collection.

A possible fix is to make rt_intern_hash() simpler, and only makes
rt_check_expire() a litle bit smarter, being able to cope with an arbitrary
entries order. The added loop is running on cache hot data, while cpu
is prefetching next object, so should be unnoticied.

Reported-and-analyzed-by: Alexander V. Lukyanov <lav@yar.ru>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix length computation in rt_check_expire()
Eric Dumazet [Tue, 19 May 2009 18:54:22 +0000 (18:54 +0000)]
net: fix length computation in rt_check_expire()

rt_check_expire() computes average and standard deviation of chain lengths,
but not correclty reset length to 0 at beginning of each chain.
This probably gives overflows for sum2 (and sum) on loaded machines instead
of meaningful results.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosyscall: Sort out syscall_restart name clash.
Eric W. Biederman [Wed, 20 May 2009 22:52:40 +0000 (15:52 -0700)]
syscall: Sort out syscall_restart name clash.

Stephen Rothwell <sfr@canb.auug.org.au> writes:

> Today's linux-next build of at least some av32 and arm configs failed like this:
>
> arch/avr32/kernel/signal.c:216: error: conflicting types for 'restart_syscall'
> include/linux/sched.h:2184: error: previous definition of 'restart_syscall' was here
>
> Caused by commit 690cc3ffe33ac4a2857583c22d4c6244ae11684d ("syscall:
> Implement a convinience function restart_syscall") from the net tree.

Grrr. Some days it feels like all of the good names are already taken.

Let's just rename the two static users in arm and avr32 to get this
sorted out.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomac80211: fix managed mode BSSID handling
Johannes Berg [Thu, 14 May 2009 11:10:14 +0000 (13:10 +0200)]
mac80211: fix managed mode BSSID handling

Currently, we will ask the driver to configure right away
when somebody changes the desired BSSID. That's totally
strange because then we will configure the driver without
even knowing whether the BSS exists. Change this to only
configure the BSSID when associated, and configure a zero
BSSID when not associated.

As a side effect, this fixes an issue with the iwlwifi
driver which doesn't implement sta_notify properly and
uses the BSSID instead and gets very confused if the
BSSID is cleared before we disassociate, which results
in the warning Marcel posted [1] and iwlwifi bug 1995 [2].

[1] http://thread.gmane.org/gmane.linux.kernel.wireless.general/32598
[2] http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1995

Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: warn when wiphy_apply_custom_regulatory() does nothing
Luis R. Rodriguez [Tue, 19 May 2009 21:49:47 +0000 (17:49 -0400)]
cfg80211: warn when wiphy_apply_custom_regulatory() does nothing

Device drivers using wiphy_apply_custom_regulatory() want some
regulatory settings applied to their wiphy, if no bands were
configured on the wiphy then something went wrong.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: set max default eirp to 20 dBm
Luis R. Rodriguez [Tue, 19 May 2009 21:49:46 +0000 (17:49 -0400)]
ath9k: set max default eirp to 20 dBm

This is always discarded anyway but lets just set this to our
safest lowest.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix parameter confusion when finding IBSS
Johannes Berg [Wed, 20 May 2009 07:05:10 +0000 (09:05 +0200)]
mac80211: fix parameter confusion when finding IBSS

When I fixed the crypto bit I must have done the negative
test only -- it is quite clearly impossible to find _any_
IBSS to join with the parameters put the wrong way around.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: fix custom regulatory call position
Luis R. Rodriguez [Tue, 19 May 2009 22:27:11 +0000 (18:27 -0400)]
ath9k: fix custom regulatory call position

ath_regd_init() needs to be called with the wiphy already
properly set with the bands. Without this the custom regulatory
settings were not taking effect, and the device would get
the default channel settings from ath9k_[25]ghz_chantable.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: don't try to do anything on unchanged genIE
Johannes Berg [Tue, 19 May 2009 20:16:25 +0000 (22:16 +0200)]
mac80211: don't try to do anything on unchanged genIE

When the genIE hasn't changed there's no reason to kick
the state machine since it won't be able to do anything
new -- doing this decreases the useless work we do for
reassociating because if we do kick the state machine
it will try to find a usable BSS but there might not be
one because wpa_supplicant will only change the BSSID
a little later.

In a sense this is a workaround for userspace behaviour,
but on the other hand userspace cannot really keep track
of what the kernel currently has for genIE since any
process could have changed that while wpa_supplicant
wasn't looking.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agort73usb: fix for master mode
Alexandre Becholey [Tue, 19 May 2009 15:52:56 +0000 (17:52 +0200)]
rt73usb: fix for master mode

Report status unknown as if there were successfully transmitted.
This will avoid hostapd to disassociate because it doesn't understand what a status unknown is.

Signed-off-by: Alexandre Becholey <alexandre.becholey@epfl.ch>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Do not override AID in the duration field
Jouni Malinen [Tue, 19 May 2009 16:25:58 +0000 (19:25 +0300)]
mac80211: Do not override AID in the duration field

When updating the duration field for TX frames, skip the update for
PS-Poll frames that use this field for other purposes (AID).

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: PS processing for every Beacon with our AID in TIM
Jouni Malinen [Tue, 19 May 2009 14:01:43 +0000 (17:01 +0300)]
mac80211: PS processing for every Beacon with our AID in TIM

If the AP includes our AID in the TIM IE, we need to process the
Beacon frame as far as PS is concerned (send PS-Poll or nullfunc data
with PM=0). The previous code skipped this in cases where the CRC
value did not change and it would not change if the AP continues
including our AID in the TIM..

There is no need to count the crc32 value for directed_tim with this
change, so we can remove that part. In order not to change the order
of operations (i.e., update WMM parameters prior to sending PS-Poll),
the CRC match is checked twice as only after the PS processing step,
the rest of the function is skipped if nothing changed in the Beacon.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Set PM field in frame control when in PS mode
Jouni Malinen [Tue, 19 May 2009 14:01:42 +0000 (17:01 +0300)]
ath9k: Set PM field in frame control when in PS mode

mac80211 does not set PM field for normal data frames, so we need to
update that based on the current PS mode when using PS-Poll
(timeout=0) power save mode.

This allows the AP to remain in sync with our PS state. However, there
is still a potential race condition between PS state changes when
multiple TX queues are used and nullfunc and PS-Poll frames use
different queue. That corner case may need to be handled separately by
changing which queue is used either in ath9k or mac80211.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Wake up for RX filter changes
Jouni Malinen [Tue, 19 May 2009 14:01:41 +0000 (17:01 +0300)]
ath9k: Wake up for RX filter changes

We must make sure the chip is awake when changing the RX filter
parameters. This could have caused problems, e.g., when changing the
interface to promiscuous mode while in sleep mode.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Use TSFOOR interrupt to trigger TSF sync with next Beacon
Jouni Malinen [Tue, 19 May 2009 14:01:40 +0000 (17:01 +0300)]
ath9k: Use TSFOOR interrupt to trigger TSF sync with next Beacon

If the chip complains about TSF sync, make sure we remain awake to
sync with the next Beacon frame. In theory, this should not be needed
since we are currently trying to receive all Beacon frames, anyway,
better have this code ready should we ever change that.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Do not try to calibrate radio when in sleep mode
Jouni Malinen [Tue, 19 May 2009 14:01:39 +0000 (17:01 +0300)]
ath9k: Do not try to calibrate radio when in sleep mode

When the chip is in sleep mode, there is no point trying to calibrate
the radio since it will just results in incorrect values being read
from registers and other potential issues. In addition, if we actually
start processing calibrate, do not allow the chip to be put into sleep
until we have completed the calibration step.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Wake up for TX in mac80211 timeout=0 sleep mode
Jouni Malinen [Tue, 19 May 2009 14:01:38 +0000 (17:01 +0300)]
ath9k: Wake up for TX in mac80211 timeout=0 sleep mode

When using timeout=0 (PS-Poll) with mac80211, the driver will need to
wake up for TX requests and remain awake until the TX has been
completed (ACK received or timeout) or until the buffer frame(s) have
been received (in case the TX is for a PS-Poll frame).

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix kernel-doc
Johannes Berg [Tue, 19 May 2009 08:39:34 +0000 (10:39 +0200)]
mac80211: fix kernel-doc

Moving information from config_interface to bss_info_changed
removed struct ieee80211_if_conf which the documentation still
refers to, additionally there's one kernel-doc description too
much and one other missing, fix all this.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agort2x00: Add USB ID for rt2800usb
Ivo van Doorn [Tue, 19 May 2009 05:26:04 +0000 (07:26 +0200)]
rt2x00: Add USB ID for rt2800usb

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix compile error with CONFIG_CFG80211_DEBUGFS
Pavel Roskin [Tue, 19 May 2009 01:43:52 +0000 (21:43 -0400)]
cfg80211: fix compile error with CONFIG_CFG80211_DEBUGFS

If CONFIG_CFG80211_DEBUGFS is enabled and CONFIG_MAC80211_DEBUGFS is
not, compilation fails in net/wireless/debugfs.c:

net/wireless/debugfs.c: In function 'cfg80211_debugfs_drv_add':
net/wireless/debugfs.c:117: error: 'struct cfg80211_registered_device'
has no member named 'debugfs'

The debugfs filed is needed if and only if CONFIG_CFG80211_DEBUGFS is
enabled, so use that instead of CONFIG_MAC80211_DEBUGFS.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: avoid and warn on potential infinite loop
Bob Copeland [Wed, 20 May 2009 03:37:31 +0000 (23:37 -0400)]
ath5k: avoid and warn on potential infinite loop

If we are trying to interpolate a curve with slope == 0, the return
value will always be the y-coordinate.  In this code we are looping
until we reach a minimum y-coordinate on a line, which in the 0-slope
case can never happen, thus the loop never terminates.

The PCDAC steps come from the EEPROM and should never be equal, but
we should gracefully handle that case, so warn and bail out.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix in nl80211_set_reg()
Luis R. Rodriguez [Wed, 13 May 2009 21:04:41 +0000 (17:04 -0400)]
cfg80211: fix in nl80211_set_reg()

There is a race on access to last_request and its alpha2
through reg_is_valid_request() and us possibly processing
first another regulatory request on another CPU. We avoid
this improbably race by locking with the cfg80211_mutex as
we should have done in the first place. While at it add
the assert on locking on reg_is_valid_request().

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: cleanup return calls on nl80211_set_reg()
Luis R. Rodriguez [Wed, 13 May 2009 21:04:40 +0000 (17:04 -0400)]
cfg80211: cleanup return calls on nl80211_set_reg()

This has no functional change, but it will make the race
fix easier to spot in my next patch.

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES
Luis R. Rodriguez [Wed, 13 May 2009 21:04:39 +0000 (17:04 -0400)]
cfg80211: return immediately if num reg rules > NL80211_MAX_SUPP_REG_RULES

This has no functional change except we save a kfree(rd) and
allows us to clean this code up a bit after this. We do
avoid an unnecessary kfree(NULL) but calling that was OK too.

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: fix to set dev->broadcast correctly
Wei Yongjun [Wed, 13 May 2009 01:47:38 +0000 (09:47 +0800)]
wireless: fix to set dev->broadcast correctly

This patch fix to set dev->broadcast correctly, since
dev->broadcast is defined as:
  unsigned char broadcast[MAX_ADDR_LEN];

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoStaging: agnx: switch config_interface to bss_info_changed
Alexander Beregalov [Tue, 12 May 2009 11:23:13 +0000 (15:23 +0400)]
Staging: agnx: switch config_interface to bss_info_changed

Fix this build error:
drivers/staging/agnx/pci.c: In function 'agnx_config_interface':
drivers/staging/agnx/pci.c:315: error: dereferencing pointer to incomplete type
..
drivers/staging/agnx/pci.c:424: error: unknown field 'config_interface' specified in initializer

config_interface was removed in 2d0ddec5b2b
("mac80211: unify config_interface and bss_info_changed")

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Move PS wakeup/restore calls from isr to tasklet
Vasanthakumar Thiagarajan [Fri, 15 May 2009 06:47:16 +0000 (02:47 -0400)]
ath9k: Move PS wakeup/restore calls from isr to tasklet

We do not need to do this in ath_isr() and it looks like the modified
version ends up being more stable as far as being able receive beacon
frames is concerned. Furthermore, this reduces need to move between
AWAKE and NETWORK SLEEP states when processing some unrelated
interrupts.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: allow wext to remove keys that don't exist
Johannes Berg [Mon, 18 May 2009 17:56:36 +0000 (19:56 +0200)]
cfg80211: allow wext to remove keys that don't exist

Some applications using wireless extensions expect to be able to
remove a key that doesn't exist. One example is wpa_supplicant
which doesn't actually change behaviour when running into an
error while trying to do that, but it prints an error message
which users interpret as wpa_supplicant having problems.

The safe thing to do is not change the behaviour of wireless
extensions any more, so when the driver reports -ENOENT let
the wext bridge code return success to userspace. To guarantee
this, also document that drivers should return -ENOENT when the
key doesn't exist.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211_hwsim: Group radios
Daniel Wagner [Mon, 18 May 2009 17:49:25 +0000 (19:49 +0200)]
mac80211_hwsim: Group radios

Currently all radios receive all traffic on the simulated air
if they are tuned to the same channel. This patch introduces
the concept of grouping, which allows to assign a radio to
certain group. Only radios in the same group can 'see' each other.

Each bit in /debug/ieee80211/phy*/hwsim/group
represents one group. By default all radios belong to the same group "1",
e.g. bit 1 is set. Additionally a radio can belong to several groups.

Signed-off-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: update beacons in AP mode
Bob Copeland [Mon, 18 May 2009 14:59:52 +0000 (10:59 -0400)]
ath5k: update beacons in AP mode

ath5k only generated the beacon when bss_info_changed() was called,
but for AP mode this is not enough, because the TIM IE would never
get updated and consequently PS mode clients wouldn't know about
buffered frames.  Instead, get a new beacon on every SWBA interrupt.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: drop test for FW_STATE_RESET in p54spi_work
Max Filippov [Mon, 18 May 2009 17:28:55 +0000 (21:28 +0400)]
p54spi: drop test for FW_STATE_RESET in p54spi_work

Drop test for FW_STATE_RESET in p54spi_work as fw_state
is never assigned this value.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43/legacy: fix beacon change processing
Johannes Berg [Mon, 18 May 2009 08:53:18 +0000 (10:53 +0200)]
b43/legacy: fix beacon change processing

Process beacon change even if the BSSID doesn't
change at the same time. Also fix what I think
is a small locking error in b43legacy, there's
a spin_unlock_irqrestore that looks out of place.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: use firmware/DMA bug workaround that work under hight load in p54spi_rx
Max Filippov [Sun, 17 May 2009 23:02:35 +0000 (03:02 +0400)]
p54spi: use firmware/DMA bug workaround that work under hight load in p54spi_rx

Under high load first data word, read after available data size
is sometimes lost in p54spi_rx. It seems to depend on frequency
of interrupts and latency of data read request relatively to
'data available' interrupt. The worst consequence of this bug
is loss of packet transmission acknowledgement, which in turn
causes overflow of tx queues and permanent link loss.

Read data size and first data word in one SPI transaction.
No packets from LMAC should have length less than 1 word,
so this shouldn't interfere with the next read transaction.

Also call p54spi_sleep if p54spi_wake succeeded.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: always call p54spi_sleep in p54spi_tx_frame if p54spi_wakeup succeeded
Max Filippov [Sun, 17 May 2009 23:02:34 +0000 (03:02 +0400)]
p54spi: always call p54spi_sleep in p54spi_tx_frame if p54spi_wakeup succeeded

Put chip into sleep state, once it's been awaken.
Also, propagate error code to the caller.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: return status of p54spi_wakeup
Max Filippov [Sun, 17 May 2009 23:02:33 +0000 (03:02 +0400)]
p54spi: return status of p54spi_wakeup

Return whether wakeup operation succeeded.
Make use of this return value.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: cosmetic fixes: use even byte count in SPI write; drop unused interrupt statu...
Max Filippov [Sun, 17 May 2009 23:02:32 +0000 (03:02 +0400)]
p54spi: cosmetic fixes: use even byte count in SPI write; drop unused interrupt status read

When SPI write of odd length is requested, p54spi_write splits it
into two parts: one for all data, except the last byte, and one
for last byte and padding byte. Unfortunately, the length of
first part is not amended. It works because all meaningful bytes
have proper value and the last byte of odd length SPI write
transaction is ignored.

p54spi_work has dummy HOST_INTERRUPTS register read at the end.
Drop it, as its result is not used and it has no side effects.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agop54spi: fix incorrect access sequence to DMA_WRITE_CTRL in p54spi_spi_write_dma
Max Filippov [Sun, 17 May 2009 23:02:31 +0000 (03:02 +0400)]
p54spi: fix incorrect access sequence to DMA_WRITE_CTRL in p54spi_spi_write_dma

Host is not allowed to modify DMA_WRITE_CTRL register
if bit HOST_ALLOWED in it is not set. Wait for HOST_ALLOWED first.

Also get rid of timeout in p54spi_wait_bit as it's been playing
a role of workaround for such an incorrect register access.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agodrivers/net: use dev_get_drvdata
Julia Lawall [Sun, 17 May 2009 09:28:42 +0000 (11:28 +0200)]
drivers/net: use dev_get_drvdata

Eliminate direct accesses to the driver_data field.
cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015

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

// <smpl>
@@
struct device *dev;
expression E;
type T;
@@

- dev->driver_data = (T)E
+ dev_set_drvdata(dev, E)

@@
struct device *dev;
type T;
@@

- (T)dev->driver_data
+ dev_get_drvdata(dev)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: mark wiphy->privid as pointer to const
David Kilroy [Sat, 16 May 2009 22:13:47 +0000 (23:13 +0100)]
cfg80211: mark wiphy->privid as pointer to const

This allows drivers to use a const pointer as the privid without a cast.

Signed-off-by: David Kilroy <kilroyd@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: mark ops as pointer to const
David Kilroy [Sat, 16 May 2009 22:13:46 +0000 (23:13 +0100)]
cfg80211: mark ops as pointer to const

This allows drivers to mark their cfg80211_ops tables const.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop iwl3945_tid_data
Tomas Winkler [Fri, 15 May 2009 23:13:44 +0000 (16:13 -0700)]
iwlwifi: drop iwl3945_tid_data

This patch is one of the incremental steps for unifying iwl_station_entry
for all HWs, i.e. removing of iwl3945_station_entry
This patch drops iwl3945_tid_data and use iwl_tid_data instead.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: drop struct iwl3945_hw_key
Tomas Winkler [Fri, 15 May 2009 23:13:43 +0000 (16:13 -0700)]
iwlwifi: drop struct iwl3945_hw_key

This patch replaces struct iwl3945_hw_key by struct iwl_hw_key.
It's not used directly with any host command therefore removal is trivial

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agob43legacy: Remove unnecessary MMIO in interrupt hotpath
Stefano Brivio [Fri, 15 May 2009 20:39:20 +0000 (15:39 -0500)]
b43legacy: Remove unnecessary MMIO in interrupt hotpath

This removes unnecessary MMIO accesses in the interrupt hotpath. The
patch by Michael Buesch for b43 has been ported to b43legacy.

Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: cleanup beacon parameters configuration
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:22 +0000 (18:59 +0530)]
ath9k: cleanup beacon parameters configuration

This patch configures the beacon timers with beacon interval
and beacon period passed through vif.bss_conf. Also cache the
currecnt beacon configuration which will be used to configure
the beacon timers when the driver triggers it after reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Remove unused parameters which are passed to ath_beacon_config_X()
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:21 +0000 (18:59 +0530)]
ath9k: Remove unused parameters which are passed to ath_beacon_config_X()

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Print hw reset failure status as signed int
Vasanthakumar Thiagarajan [Fri, 15 May 2009 13:29:20 +0000 (18:59 +0530)]
ath9k: Print hw reset failure status as signed int

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: cancel/restart all timers across suspend/resume
Johannes Berg [Sun, 17 May 2009 09:40:42 +0000 (11:40 +0200)]
mac80211: cancel/restart all timers across suspend/resume

We forgot to cancel all timers in mac80211 when suspending.
In particular we forgot to deal with some things that can
cause hardware reconfiguration -- while it is down.

While at it we go ahead and add a warning in ieee80211_sta_work()
if its run while the suspend->resume cycle is in effect. This
should not happen and if it does it would indicate there is
a bug lurking in either mac80211 or mac80211 drivers.

With this now wpa_supplicant doesn't blink when I go to suspend
and resume where as before there where issues with some timers
running during the suspend->resume cycle. This caused a lot of
incorrect assumptions and would at times bring back the device
in an incoherent, but mostly recoverable, state.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: move channel switch code
Johannes Berg [Fri, 15 May 2009 09:52:31 +0000 (11:52 +0200)]
mac80211: move channel switch code

The channel switch code is currently in the spectrum
management file, where arguably it belongs. However,
it is for managed mode only and uses the structures
for that mode only so having it in a more generic
file can be confusing. Additionally, my next patch
gets simpler with the code here.

When/if we ever implement this for IBSS or mesh then
we will need to rework the structures it uses anyway
at which point we could move the code back.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agonl80211: Validate NL80211_ATTR_KEY_SEQ length
Jouni Malinen [Fri, 15 May 2009 09:38:32 +0000 (12:38 +0300)]
nl80211: Validate NL80211_ATTR_KEY_SEQ length

Validate RSC (NL80211_ATTR_KEY_SEQ) length in nl80211/cfg80211 instead
of having to do this in all the drivers.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix PS mode operation to receive buffered broadcast/multicast frames
Jouni Malinen [Thu, 14 May 2009 18:28:48 +0000 (21:28 +0300)]
ath9k: Fix PS mode operation to receive buffered broadcast/multicast frames

The previous implementation was moving back to NETWORK SLEEP state
immediately after receiving a Beacon frame. This means that we are
unlikely to receive all the buffered broadcast/multicast frames that
would be sent after DTIM Beacon frames. Fix this by parsing the Beacon
frame and remaining awake, if needed, to receive the buffered
broadcast/multicast frames. The last buffered frame will trigger the
move back into NETWORK SLEEP state.

If the last broadcast/multicast frame is not received properly (or if
the AP fails to send it), the next Beacon frame will work as a backup
trigger for returning into NETWORK SLEEP.

A new debug type, PS (debug=0x800 module parameter), is added to make
it easier to debug potential power save issues in the
future. Currently, this is only used for the Beacon frame and buffered
broadcast/multicast receiving.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Clean up RX processing a bit
Jouni Malinen [Thu, 14 May 2009 18:28:47 +0000 (21:28 +0300)]
ath9k: Clean up RX processing a bit

This makes use of the local fc variable in bit more places and uses a
common helper macro. The part of RX process that delivers skb's to
mac80211 is moved to a separate function in preparation for future
changes that will need to do this from two places. The modifications
here should not result in any functional changes.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath9k: Fix a check for multicast address for virtual wiphy
Jouni Malinen [Thu, 14 May 2009 18:28:46 +0000 (21:28 +0300)]
ath9k: Fix a check for multicast address for virtual wiphy

The broadcast bit is in the first, not the last octet..

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Cancel pending probereq poll on beacon RX
Jouni Malinen [Thu, 14 May 2009 18:15:36 +0000 (21:15 +0300)]
mac80211: Cancel pending probereq poll on beacon RX

While the probe request poll is expected to work, it looks like it
does not always result in getting a response. The exact reason for
this is unclear, but anyway, if we do receive a Beacon frame from our
AP, there is no need to disconnect based on the probereq poll. This
seems to help keep the connection bit more stable in cases where
beacon loss is occurring semi-frequently.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agozd1211rw: Replace ZD_CS_MULTICAST with ZD_CS_NO_ACK
Gábor Stefanik [Thu, 14 May 2009 17:34:59 +0000 (17:34 +0000)]
zd1211rw: Replace ZD_CS_MULTICAST with ZD_CS_NO_ACK

According to my tests, all that ZD_CS_MULTICAST does is to
disable retrying/waiting for an ACK. Reflect this by renaming
the bit to ZD_CS_NO_ACK and setting it based on
IEEE80211_TX_CTL_NO_ACK, instead of is_multicast_ether_addr.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: Initialize RX's last received sequence number
Senthil Balasubramanian [Thu, 14 May 2009 13:12:08 +0000 (18:42 +0530)]
mac80211: Initialize RX's last received sequence number

The STA may drop the very first frame if it happens to be a retried
frame. This is because we maintian the last received sequence number
per TID for QoS frames and it is initialized to zero through kzalloc
during sta_info_alloc and the sequence number of the very first date
frame received would be ZERO (as per IEEE 802.11-2007, 7.1.3.4.1).

If the frame dropped happens to be an EAP Request Identity(very first
frame from the AP), then wpa_supplicnat disconnects the STA and the
whole procedure starts again.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: add debugfs HT40 allow map
Luis R. Rodriguez [Sat, 2 May 2009 04:39:30 +0000 (00:39 -0400)]
cfg80211: add debugfs HT40 allow map

Here's a screenshot of what this looks like with ath9k:

mcgrof@pogo /debug/ieee80211/phy0 $ cat ht40allow_map
2412 HT40  +
2417 HT40  +
2422 HT40  +
2427 HT40  +
2432 HT40 -+
2437 HT40 -+
2442 HT40 -+
2447 HT40 -
2452 HT40 -
2457 HT40 -
2462 HT40 -
2467 Disabled
2472 Disabled
2484 Disabled
5180 HT40  +
5200 HT40 -+
5220 HT40 -+
5240 HT40 -+
5260 HT40 -+
5280 HT40 -+
5300 HT40 -+
5320 HT40 -
5500 HT40  +
5520 HT40 -+
5540 HT40 -+
5560 HT40 -+
5580 HT40 -+
5600 HT40 -+
5620 HT40 -+
5640 HT40 -+
5660 HT40 -+
5680 HT40 -+
5700 HT40 -
5745 HT40  +
5765 HT40 -+
5785 HT40 -+
5805 HT40 -+
5825 HT40 -

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211/cfg80211: move wiphy specific debugfs entries to cfg80211
Luis R. Rodriguez [Sat, 2 May 2009 04:37:21 +0000 (00:37 -0400)]
mac80211/cfg80211: move wiphy specific debugfs entries to cfg80211

This moves the cfg80211 specific stuff to new cfg80211 debugfs
entries. Non-mac80211 will also get these entries now. There were
only 4 which we take:

rts_threshold
fragmentation_threshold
short_retry_limit
long_retry_limit

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: check allowed channel type upon userspace requests
Luis R. Rodriguez [Sat, 2 May 2009 04:37:20 +0000 (00:37 -0400)]
cfg80211: check allowed channel type upon userspace requests

Thanks to nl80211 userspace can be very specific upon device
configuration. Before processing the request for the new HT40
channel types (HT40- or HT40+) we need to ensure we can use them
regulatory-wise. This wasn't required with wireless extensions as
specifying the channel type wasn't not available and configuration
was done towards the end implicitly upon association or reception
of beacons from the AP. For the new nl80211 we have to check this
when configuring the interfaces explicitly.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: check if HT40+/- is allowed before sending assoc
Luis R. Rodriguez [Sat, 2 May 2009 04:37:19 +0000 (00:37 -0400)]
mac80211: check if HT40+/- is allowed before sending assoc

We weren't checking this at all.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+
Luis R. Rodriguez [Sat, 2 May 2009 04:37:18 +0000 (00:37 -0400)]
wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+

This is more consistent with our nl80211 naming convention
for HT40-/+.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: Process regulatory max bandwidth checks for HT40
Luis R. Rodriguez [Sat, 2 May 2009 04:37:17 +0000 (00:37 -0400)]
cfg80211: Process regulatory max bandwidth checks for HT40

We are not correctly listening to the regulatory max bandwidth
settings. To actually make use of it we need to redesign things
a bit. This patch does the work for that. We do this to so we
can obey to regulatory rules accordingly for use of HT40.

We end up dealing with HT40 by having two passes for each channel.

The first check will see if a 20 MHz channel fits into the channel's
center freq on a given frequency range. We check for a 20 MHz
banwidth channel as that is the maximum an individual channel
will use, at least for now. The first pass will go ahead and
check if the regulatory rule for that given center of frequency
allows 40 MHz bandwidths and we use this to determine whether
or not the channel supports HT40 or not. So to support HT40 you'll
need at a regulatory rule that allows you to use 40 MHz channels
but you're channel must also be enabled and support 20 MHz by itself.

The second pass is done after we do the regulatory checks over
an device's supported channel list. On each channel we'll check
if the control channel and the extension both:

 o exist
 o are enabled
 o regulatory allows 40 MHz bandwidth on its frequency range

This work allows allows us to idependently check for HT40- and
HT40+.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: beyond ARRAY_SIZE of intf->crypto_stats
Roel Kluin [Wed, 20 May 2009 00:12:56 +0000 (02:12 +0200)]
wireless: beyond ARRAY_SIZE of intf->crypto_stats

Do not go beyond ARRAY_SIZE of intf->crypto_stats

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: update 5000 ucode support to version 2 of API
Jay Sternberg [Tue, 19 May 2009 21:56:36 +0000 (14:56 -0700)]
iwlwifi: update 5000 ucode support to version 2 of API

enable iwl driver to support 5000 ucode having version 2 of API

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agocfg80211: fix race between core hint and driver's custom apply
Luis R. Rodriguez [Wed, 13 May 2009 21:04:42 +0000 (17:04 -0400)]
cfg80211: fix race between core hint and driver's custom apply

Its possible for cfg80211 to have scheduled the work and for
the global workqueue to not have kicked in prior to a cfg80211
driver's regulatory hint or wiphy_apply_custom_regulatory().

Although this is very unlikely its possible and should fix
this race. When this race would happen you are expected to have
hit a null pointer dereference panic.

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoairo: fix airo_get_encode{,ext} buffer overflow like I mean it...
John W. Linville [Wed, 20 May 2009 14:51:41 +0000 (10:51 -0400)]
airo: fix airo_get_encode{,ext} buffer overflow like I mean it...

"airo: airo_get_encode{,ext} potential buffer overflow" was actually a
no-op, due to an unrecognized type overflow in an assignment.  Oddly,
gcc only seems to tell me about it when using -Wextra...grrr...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: fix interpolation with equal power levels
Fabio Rossi [Wed, 1 Apr 2009 18:37:50 +0000 (20:37 +0200)]
ath5k: fix interpolation with equal power levels

When the EEPROM contains weird values for the power levels we have to
fix the interpolation process.

Signed-off-by: Fabio Rossi <rossi.f@inwind.it>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: do not cancel delayed work inside spin_lock_irqsave
Reinette Chatre [Fri, 15 May 2009 23:13:46 +0000 (16:13 -0700)]
iwlwifi: do not cancel delayed work inside spin_lock_irqsave

Calling cancel_delayed_work() from inside
spin_lock_irqsave, introduces a potential deadlock.

As explained by Johannes Berg <johannes@sipsolutions.net>

A - lock
T - timer

phase                   CPU 1           CPU 2
---------------------------------------------

some place that calls
cancel_timer_sync()
(which is the | code)
                                        lock-irq(A)
|                                       "lock-irq"(T)
|                                       "unlock"(T)
|                                       wait(T)
                                        unlock(A)

timer softirq
                        "lock"(T)
                        run(T)
                        "unlock"(T)

irq handler
          lock(A)
          unlock(A)

Now all that again, interleaved, leading to deadlock:

                                        lock-irq(A)
                        "lock"(T)
                         run(T)
IRQ during or maybe
before run(T) -->        lock(A)
                                        "lock-irq"(T)
                                        wait(T)

We fix this by moving the call to cancel_delayed_work() into workqueue.
There are cases where the work may not actually be queued or running
at the time we are trying to cancel it, but cancel_delayed_work() is
able to deal with this.

Also cleanup iwl_set_mode related to this call. This function
(iwl_set_mode) is only called when bringing interface up and there will
thus not be any scanning done. No need to try to cancel scanning.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13224, which was also
reported at http://marc.info/?l=linux-wireless&m=124081921903223&w=2 .

Tested-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: fix exp off-by-one when computing OFDM delta slope
Forrest Zhang [Wed, 13 May 2009 15:14:39 +0000 (11:14 -0400)]
ath5k: fix exp off-by-one when computing OFDM delta slope

Commit e8f055f0c3b ("ath5k: Update reset code") subtly changed the
code that computes floating point values for the PHY3_TIMING register
such that the exponent is off by a decimal point, which can cause
problems with OFDM channel operation.

get_bitmask_order() actually returns the highest bit set plus one,
whereas the previous code wanted the highest bit set.  Instead, use
ilog2 which is what this code is really calculating.  Also check
coef_scaled to handle the (invalid) case where we need log2(0).

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowext: verify buffer size for SIOCSIWENCODEEXT
Johannes Berg [Wed, 13 May 2009 10:04:30 +0000 (12:04 +0200)]
wext: verify buffer size for SIOCSIWENCODEEXT

Another design flaw in wireless extensions (is anybody
surprised?) in the way it handles the iw_encode_ext
structure: The structure is part of the 'extra' memory
but contains the key length explicitly, instead of it
just being the length of the extra buffer - size of
the struct and using the explicit key length only for
the get operation (which only writes it).

Therefore, we have this layout:

extra: +-------------------------+
       | struct iw_encode_ext  { |
       |     ...                 |
       |     u16 key_len;        |
       |     u8 key[0];          |
       | };                      |
       +-------------------------+
       | key material            |
       +-------------------------+

Now, all drivers I checked use ext->key_len without
checking that both key_len and the struct fit into the
extra buffer that has been copied from userspace. This
leads to a buffer overrun while reading that buffer,
depending on the driver it may be possible to specify
arbitrary key_len or it may need to be a proper length
for the key algorithm specified.

Thankfully, this is only exploitable by root, but root
can actually cause a segfault or use kernel memory as
a key (which you can even get back with siocgiwencode
or siocgiwencodeext from the key buffer).

Fix this by verifying that key_len fits into the buffer
along with struct iw_encode_ext.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoath5k: fix scanning in AR2424
Pavel Roskin [Fri, 27 Mar 2009 21:47:27 +0000 (17:47 -0400)]
ath5k: fix scanning in AR2424

AR5K_PHY_PLL_40MHZ_5413 should not be ORed with AR5K_PHY_MODE_RAD_RF5112
for 5 GHz channels.

The incorrect PLL value breaks scanning in the countries where 5 GHz
channels are allowed.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agosfc: Remove lro module parameter
Ben Hutchings [Tue, 19 May 2009 23:19:08 +0000 (16:19 -0700)]
sfc: Remove lro module parameter

GRO/LRO can be controlled through ethtool so this is unnecessary.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: stateless autoconf for isatap
Sascha Hlusiak [Tue, 19 May 2009 12:56:52 +0000 (12:56 +0000)]
sit: stateless autoconf for isatap

be sent periodically. The rs_delay can be speficied when adding the
PRL entry and defaults to 15 minutes.

The RS is sent from every link local adress that's assigned to the
tunnel interface. It's directed to the (guessed) linklocal address
of the router and is sent through the tunnel.

Better: send to ff02::2 encapsuled in unicast directed to router-v4.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoaddrconf: refuse isatap eui64 for INADDR_ANY
Sascha Hlusiak [Tue, 19 May 2009 12:56:51 +0000 (12:56 +0000)]
addrconf: refuse isatap eui64 for INADDR_ANY

A tunnel with no local ipv4 endpoint would otherwise use the
ISATAP linklocal address fe80::5efe:0:0, which is invalid. Rather not
add a linklocal address at all.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: ipip6_tunnel_del_prl: return err
Sascha Hlusiak [Tue, 19 May 2009 12:56:50 +0000 (12:56 +0000)]
sit: ipip6_tunnel_del_prl: return err

Typo. When deleting a PRL entry, return status to userspace
instead of success.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: strictly restrict incoming traffic to tunnel link device
Sascha Hlusiak [Tue, 19 May 2009 12:56:49 +0000 (12:56 +0000)]
sit: strictly restrict incoming traffic to tunnel link device

Check link device when looking up a tunnel. When a tunnel is
linked to a interface, traffic from a different interface must not
reach the tunnel.

This also allows creating of multiple tunnels with the same
endpoints, if the link device differs.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosit: Fail to create tunnel, if it already exists
Sascha Hlusiak [Tue, 19 May 2009 12:56:48 +0000 (12:56 +0000)]
sit: Fail to create tunnel, if it already exists

When locating the tunnel, do not continue if it is found. Otherwise
a different tunnel with similar configuration would be returned and
parts could be overwritten.

Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: teach ipconfig about the MTU option in DHCP
Chris Friesen [Tue, 19 May 2009 22:31:50 +0000 (15:31 -0700)]
ipv4: teach ipconfig about the MTU option in DHCP

The DHCP spec allows the server to specify the MTU.  This can be useful
for netbooting with UDP-based NFS-root on a network using jumbo frames.
This patch allows the kernel IP autoconfiguration to handle this option
correctly.

It would be possible to use initramfs and add a script to set the MTU,
but that seems like a complicated solution if no initramfs is otherwise
necessary, and would bloat the kernel image more than this code would.

This patch was originally submitted to LKML in 2003 by Hans-Peter Jansen.

Signed-off-by: Chris Friesen <cfriesen@nortel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: use NLMSG_DEFAULT_SIZE in nlmsg_new() allocations
Pablo Neira Ayuso [Tue, 19 May 2009 22:27:55 +0000 (15:27 -0700)]
net: use NLMSG_DEFAULT_SIZE in nlmsg_new() allocations

nlmsg_new() adds the size of the netlink header to the value
that has been passed as parameter. If NLMSG_GOODSIZE is selected,
we request an allocation of one memory page plus the size of the
header. Instead, NLMSG_DEFAULT_SIZE should be used since it
already substracts the size of the Netlink header.

I have the impression that the similar naming in both constant
is error prone when using it with nlmsg_new(). This is already
documented in include/net/netlink.h

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: update version to 1.5.0-1.415
Brice Goglin [Tue, 19 May 2009 10:16:11 +0000 (10:16 +0000)]
myri10ge: update version to 1.5.0-1.415

Update myri10ge driver version to 1.5.0-1.415.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomyri10ge: allow LRO to be enabled via ethtool
Brice Goglin [Tue, 19 May 2009 10:15:32 +0000 (10:15 +0000)]
myri10ge: allow LRO to be enabled via ethtool

Allow myri10ge LRO to be enabled/disabled via ethtool
(and by the stack for packet forwarding).

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosch_teql: Use net_device internal stats
Eric Dumazet [Tue, 19 May 2009 22:16:34 +0000 (15:16 -0700)]
sch_teql: Use net_device internal stats

We can slightly reduce size of teqlN structure, not duplicating stats
structure in teql_master but using stats field from net_device.stats
for tx_errors and from netdev_queue for tx_bytes/tx_packets/tx_dropped
values.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Cleanup feature setup code to make the code more readable
Jesse Brandeburg [Tue, 19 May 2009 09:19:11 +0000 (09:19 +0000)]
ixgbe: Cleanup feature setup code to make the code more readable

This is purely a cleanup patch.  This collapses some of the code required
when we configure our Tx and Rx feature sets, and makes the code more
readable and maintainable.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>