Javier Cardona [Mon, 8 Aug 2011 23:30:50 +0000 (16:30 -0700)]
mac80211: fix erroneous clearing of MESH_PATH_SN_VALID flag
When a PREQ or PREP is received from an intermediate node, it contains
useful information for path selection but it doesn't include the
originator's sequence number. Therefore, when updating the mesh path
to that intermediate node, we should not set the MESH_PATH_SN_VALID
flag. BUT, if the flag is set, it should not be unset as we might have
received a valid sequence number for that intermediate node in the past.
This issue was reported, fixed and tested by Ya Bo (游波) and Pedro
Larbig (ASPj).
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Eliad Peller [Mon, 8 Aug 2011 13:50:22 +0000 (16:50 +0300)]
mac80211: clear sta.drv_priv on reconfiguration
drivers might assume sta.drv_priv is clear while
the sta is added, so clear it on reconfinguration.
Signed-off-by: Eliad Peller <eliad@wizery.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Mon, 8 Aug 2011 09:11:52 +0000 (12:11 +0300)]
cfg80211/nl80211: Send AssocReq IEs to user space in AP mode
When user space SME/MLME (e.g., hostapd) is not used in AP mode, the
IEs from the (Re)Association Request frame that was processed in
firmware need to be made available for user space (e.g., RSN IE for
hostapd). Allow this to be done with cfg80211_new_sta().
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Mon, 8 Aug 2011 09:10:30 +0000 (12:10 +0300)]
nl80211: Indicate driver-based offchannel TX on mgmt_tx_cancel_wait
Drivers that support frame transmission with mgmt_tx() may not support
driver-based offchannel TX. Use mgmt_tx_cancel_wait instead of mgmt_tx
when figuring out whether to indicate support for this with
NL80211_ATTR_OFFCHANNEL_TX_OK.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Sat, 6 Aug 2011 20:07:00 +0000 (23:07 +0300)]
mac80211_hwsim: Fix RX status reporting for HT
RX_FLAG_HT must be included when reporting MCS rates. Without
this, mac80211 ended up dropping any frame sent at MCS index 12
or higher and that resulted in oddly random looking errors in
mac80211_hwsim tests.
Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Wed, 10 Aug 2011 06:49:12 +0000 (09:49 +0300)]
ath6kl: fix function name conflicts with ath9k
Stephen reported that compilation fails if both ath6kl and ath9k are
compiled in:
drivers/net/wireless/ath/ath6kl/built-in.o: In function `htc_start':
(.opd+0x600): multiple definition of `htc_start'
drivers/net/wireless/ath/ath9k/built-in.o:(.opd+0x3e40): first defined here
drivers/net/wireless/ath/ath6kl/built-in.o: In function `.htc_stop':
(.text+0x7b40): multiple definition of `.htc_stop'
drivers/net/wireless/ath/ath9k/built-in.o:(.text+0x67b34): first defined he=
re
drivers/net/wireless/ath/ath6kl/built-in.o: In function `.htc_start':
(.text+0x7d18): multiple definition of `.htc_start'
drivers/net/wireless/ath/ath9k/built-in.o:(.text+0x67ba0): first defined he=
re
drivers/net/wireless/ath/ath6kl/built-in.o: In function `htc_stop':
(.opd+0x5e8): multiple definition of `htc_stop'
drivers/net/wireless/ath/ath9k/built-in.o:(.opd+0x3e28): first defined here
To fix this add ath6kl prefix to all public functions in htc.c.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Larry Finger [Sat, 30 Jul 2011 16:30:27 +0000 (11:30 -0500)]
b43: Remove EXPERIMENTAL designation from LP PHY selection
Since kernel 3.0, the problems with controlling b43 devices that have
low-power (LP) PHYs have been fixed and the EXPERIMENTAL designation
can be fixed.
This patch also fixes a typo as the device supports 802.11b communications.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Sat, 6 Aug 2011 11:13:48 +0000 (13:13 +0200)]
rt2x00: Fix PCI interrupt processing race on SMP systems
When toggle_irq is called for PCI devices to disable device interrupts
it used tasklet_disable to wait for a possibly running tasklet to finish.
However, on SMP systems the tasklet might still be scheduled on another CPU.
Instead, use tasklet_kill to ensure that all scheduled tasklets are finished
before returning from toggle_irq.
Furthermore, it was possible that a tasklet reenabled its interrupt even
though interrupts have been disabled already. Fix this by checking the
DEVICE_STATE_ENABLED_RADIO flag before reenabling single interrupts
during tasklet processing.
While at it also enable/kill the TBTT and PRETBTT tasklets in the
toggle_irq callback and only use tasklet_kill in stop_queue to wait
for a currently scheduled beacon update before returning.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Sat, 6 Aug 2011 10:55:18 +0000 (05:55 -0500)]
rtlwifi: Eliminate raw reads and writes from PCIe portion
The PCIe driver used raw reads and writes on the PCIe hardware.
As all of these are only affecting the configuration space, all of
then can be converted to pci_{read,write}_config_XX calls.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Use atomic reference count for interrupt ops
Let us enable/disable interrupts based on reference count.
By doing this we can ensure that interrupts are never be
enabled in the middle of tasklet processing. Instead of
addressing corner cases like "ath9k: avoid enabling interrupts
while processing rx", this approach handles it in generic manner.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Spur frequency was incorrectly computed with 10Mhz offset
which could cause the filter would not notch out the spur
and also this could improve rx sensitivity in HT40.
Cc: Madhan Jaganathan <madhanj@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: do not enable interrupt on set interrupt mask
At preset set_interrupt also enables interrupt after changing
mask. This is not necessary in all cases and also sometime it
breaks the assumption that interrupt was disabled. So let us
enable the interrupt explicity if it was disabled earlier.
This could also avoid unnecessary register ops and also helps
the follow up patch to have global ref count for interrupts ops.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Drake [Mon, 1 Aug 2011 15:43:13 +0000 (16:43 +0100)]
libertas: disable functionality when interface is down
Modify the driver so that it does not function when the interface is
down, in preparation for runtime power management.
No commands can be run while the interface is down, so the ndo_dev_stop
routine now directly does all necessary work (including asking the device
to disconnect from the network and disabling multicast functionality)
directly.
power_save and power_restore hooks are added meaning that card drivers
can take steps to turn the device off when the interface is down.
The MAC address can now only be changed when all interfaces are down;
the new address will be programmed when an interface gets brought up.
This matches mac80211 behaviour.
Also, some small cleanups/simplifications were made in the surrounding
device handling logic.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 1 Aug 2011 09:32:53 +0000 (11:32 +0200)]
mac80211: Don't use EAPOL frames for rate sampling
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 1 Aug 2011 09:32:52 +0000 (11:32 +0200)]
mac80211: Fill in skb->protocol information for injected frames
Some drivers (ath9k for example) are using skb->protocol to treat EAPOL
frames somehow special (disallow aggregation for example).
When running in AP mode hostapd injects the EAPOL frames through a
monitor interface and thus skb->protocol isn't set at all. Hence, if the
injected frame is a data frame and carries a rfc1042 headaer update the
skb->protocol field accordingly.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Raja Mani [Thu, 4 Aug 2011 13:56:29 +0000 (19:26 +0530)]
ath6kl: Fix crash during the connection process
Sometimes, the network manager is failing to connect to the AP due
to the below kernel crash message. The reason behind this,
after issuing the connect command to the chip, the chip is sending
disconnect event and then immediately one connect event to the host
in some random cases.
The host driver resets all states (including cfg80211 state machine)
when it receives disconnect event from the chip. But, still the host
driver reports the next received connect event to cfg80211, at that time
cfg80211 SME state would have been in IDLE state, which was causing
the below kernel crash.
Now, host driver's sme state machine is checked every time before
delivering connect event to cfg80211
Kalle Valo [Thu, 21 Jul 2011 07:54:26 +0000 (10:54 +0300)]
ath6kl: change aggreation timeout message from an error to a debug message
When I connect to my Linksys WT610N AP supporting 11n I see a lot of
aggreation timeout errors:
[ 408.885053] ath6kl: aggr timeout (st 3109 end 3140)
[ 463.872108] ath6kl: aggr timeout (st 3671 end 3702)
[ 495.010060] ath6kl: aggr timeout (st 3983 end 4014)
[ 503.604047] ath6kl: aggr timeout (st 4065 end 0)
[ 518.963047] ath6kl: aggr timeout (st 141 end 172)
[ 525.014066] ath6kl: aggr timeout (st 205 end 236)
[ 573.957051] ath6kl: aggr timeout (st 701 end 732)
[ 585.019067] ath6kl: aggr timeout (st 816 end 847)
But still the connection seems to work. To not clutter the logs change
the error message to a debug message. But add a fixme comment so that
this will be investigated.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle Valo [Thu, 21 Jul 2011 07:22:50 +0000 (10:22 +0300)]
ath6kl: fix crash when interface is closed but scan is ongoing
When ath6kl module was removed while a scan was ongoing the driver would
crash in ath6kl_cfg80211_scan_complete_event().
Fix the function not to iterate nodes when the scan is aborted. The nodes
are already freed when the module is being unloaded. This patch removes the
null check entirely as the wmi structure is not accessed anymore during
module unload.
Also fix a bug where the status was checked as a bitfield with '&' operator.
But it's not a bitfield, just a regular error code.
This is a port of my patch from ath6kl staging with the same title.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle Valo [Thu, 21 Jul 2011 07:04:54 +0000 (10:04 +0300)]
ath6kl: fix atomicity in ath6kl_cfg80211_scan_node()
ath6kl_cfg80211_scan_node() was calling cfg80211_inform_bss_frame()
with CFP_KERNEL but the function is executed with a spin lock taken.
This is wrong and the function must use GFP_ATOMIC instead.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle Valo [Thu, 21 Jul 2011 06:40:00 +0000 (09:40 +0300)]
ath6kl: don't force foreground scan when connected
In my setup data transfer stalls when there's data transmission during
scan. After some testing I found out that using background scan
when connected to makes the problem go away. This is more like
a workaround than a proper fix, but as the stall is so severe the
workaround is justified.
With a dual band card this increases scan time when connected from
1.9s to 4.4s. When not connected the scan time is not affected and
is the same 1.9s.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
After over 1100 (!) patches we have now reached a state where I would
like to start discussing about pushing the driver to the wireless
trees and replacing the staging driver.
The driver is now a lot smaller and looks like a proper Linux driver.
The size of the driver (measured with simple wc -l) dropped from 49
kLOC to 18 kLOC and the number of the .c and .h files dropped from 107
to 22. Most importantly the number of subdirectories reduced from 26
to zero :)
There are two remaining checkpatch warnings in the driver which we
decided to omit for now:
drivers/net/wireless/ath/ath6kl/debug.c:31:
WARNING: printk() should include KERN_ facility level
drivers/net/wireless/ath/ath6kl/sdio.c:527:
WARNING: msleep < 20ms can sleep for up to 20ms;
see Documentation/timers/timers-howto.txt
The driver has endian annotations for all the hardware specific
structures and there are no sparse errors. Unfortunately I don't have
any big endian hardware to test that right now.
We have been testing the driver both on x86 and arm platforms. The
code is also compiled with sparc and parisc cross compilers.
Notable missing features compared to the current staging driver are:
o HCI over SDIO support
o nl80211 testmode
o firmware logging
o suspend support
Testmode, firmware logging and suspend support will be added soon. HCI
over SDIO support will be more difficult as the HCI driver needs to
share code with the wifi driver. This is something we need to research
more.
Also I want to point out the changes I did for signed endian support.
As I wasn't able to find any support for signed endian annotations I
decided to follow what NTFS has done and added my own. Grep for sle16
and sle32, especially from wmi.h.
Various people have been working on the cleanup, the hall of
fame based on number of patches is:
543 Vasanthakumar Thiagarajan
403 Raja Mani
252 Kalle Valo
16 Vivek Natarajan
12 Suraj Sumangala
3 Joe Perches
2 Jouni Malinen
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Suraj Sumangala <surajs@qca.qualcomm.com> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Felix Fietkau [Thu, 28 Jul 2011 12:08:56 +0000 (14:08 +0200)]
ath9k_hw: calculate a much better approximation of channel noise
Currently ath9k presents the internal calibrated noise floor as channel
noise measurement, however this results in highly chip specific values
that are only useful as relative measurements but do not resemble any
real channel noise values.
In order to give a much better approximation of the real channel noise,
add the difference between the measured noise floor and the nominal
chip specific noise floor to the default minimum channel noise value,
which is currently used to calculate the signal strength from the RSSI
value. This may not be 100% accurate, but it's much better than what's
there before.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211/mesh: make the preq queue lock consistent
Make mesh_preq_queue_lock locking consistent with mesh_queue_preq() using
spin_lock_bh().
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Drake [Wed, 27 Jul 2011 16:19:00 +0000 (17:19 +0100)]
libertas_usb: program OLPC EC wakeup mask for wake-on-WLAN
OLPC power management code has recently gone upstream. This piece
completes the puzzle for libertas_usb, which now programs the OLPC EC
for wlan wakeups when they have been requested.
Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Tue, 26 Jul 2011 22:52:41 +0000 (18:52 -0400)]
hostap_cs: support cards with "Version 01.02" as third product ID
Cards with numeric ID 0x0156:0x0002 and third ID "Version 01.02" can be
assumed to have Intersil firmware. Cards with Agere firmware use
"Version 01.01".
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Tue, 26 Jul 2011 22:52:35 +0000 (18:52 -0400)]
pcmcia: add PCMCIA_DEVICE_MANF_CARD_PROD_ID3
This is needed to match wireless cards with Intersil firmware that have
ID 0x0156:0x0002 and the third ID "Version 01.02". Such cards are
currently matched by orinoco_cs, which doesn't support WPA. They should
be matched by hostap_cs.
The first and the second product ID vary widely, so there are few users
with some particular IDs. Of those, very few can submit a patch for
hostap_cs or write a useful bugreport. It's still important to support
their hardware properly.
With PCMCIA_DEVICE_MANF_CARD_PROD_ID3, it should be possible to cover
the remaining Intersil based designs that kept the numeric ID and the
"version" of the reference design.
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Tue, 26 Jul 2011 15:36:48 +0000 (11:36 -0400)]
b43legacy: report core number
Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Fri, 5 Aug 2011 09:46:19 +0000 (11:46 +0200)]
mac80211: Don't use a buf_size=0 in ADDBA requests
According to 802.11-2007, 7.3.1.14 it is compliant to use a buf_size of
0 in ADDBA requests. But some devices (AVM Fritz Stick N) arn't able to
handle that correctly and will reply with an ADDBA reponse with a
buf_size of 0 which in turn will disallow BA sessions for these
devices.
To work around this problem, initialize hw.max_tx_aggregation_subframes
to the maximum AMPDU buffer size 0x40.
Using 0 as default for the bufsize was introduced in commit 5dd36bc933e8be84f8369ac64505a2938f9ce036 (mac80211: allow advertising
correct maximum aggregate size).
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>