Johannes Berg [Wed, 3 Feb 2010 12:59:58 +0000 (13:59 +0100)]
mac80211: allow station add/remove to sleep
Many drivers would like to sleep during station
addition and removal, and currently have a high
complexity there from not being able to.
This introduces two new callbacks sta_add() and
sta_remove() that drivers can implement instead
of using sta_notify() and that can sleep, and
the new sta_add() callback is also allowed to
fail.
The reason we didn't do this previously is that
the IBSS code wants to insert stations from the
RX path, which is a tasklet, so cannot sleep.
This patch will keep the station allocation in
that path, but moves adding the station to the
driver out of line. Since the addition can now
fail, we can have IBSS peer structs the driver
rejected -- in that case we still talk to the
station but never tell the driver about it in
the control.sta pointer. If there will ever be
a driver that has a low limit on the number of
stations and that cannot talk to any stations
that are not known to it, we need to do come up
with a new strategy of handling larger IBSSs,
maybe quicker expiry or rejecting peers.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 3 Feb 2010 12:57:46 +0000 (13:57 +0100)]
mac80211: don't probe if we have probe response
We can now easily determine whether we already
have probe response information for the BSS we
are asked to connect to, in which case there's
little point in probing the BSS again.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 3 Feb 2010 09:24:30 +0000 (10:24 +0100)]
wireless: update radiotap parser
Upstream radiotap has adopted the namespace
proposal David Young made and I then took care
of, for which I had adapted the radiotap parser
as a library outside the kernel. This brings
the in-kernel parser up to speed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 3 Feb 2010 09:47:55 +0000 (10:47 +0100)]
mac80211_hwsim: add fake hw scan handler
For debugging hardware scan trigger/complete
functionality, it was useful to have code in
hwsim that pretends to do a hardware scan.
This code could be extended to actually do the
scan, but for now it was sufficient for me to
only pretend. Since hwsim was written to ease
debugging, it only makes sense to add it to it
permanently.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 3 Feb 2010 09:22:31 +0000 (10:22 +0100)]
mac80211: fix deferred hardware scan requests
Reinette found the reason for the warnings that
happened occasionally when a hw-offloaded scan
finished; her description of the problem:
mac80211 will defer the handling of scan requests if it is
busy with management work at the time. The scan requests
are deferred and run after the work has completed. When
this occurs there are currently two problems.
* The scan request for hardware scan is not fully populated
with the band and channels to scan not initialized.
* When the scan is queued the state is not correctly updated
to reflect that a scan is in progress. The problem here is
that when the driver completes the scan and calls
ieee80211_scan_completed() a warning will be triggered
since mac80211 was not aware that a scan was in progress.
The reason is that the queued scan work will start
the hw scan right away when the hw_scan_req struct
has already been allocated. However, in the first
pass it will not have been filled, which happens
at the same time as setting the bits. To fix this,
simply move the allocation after the pending work
test as well, so that the first iteration of the
scan work will call __ieee80211_start_scan() even
in the hardware scan case.
Bug-identified-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 5 Feb 2010 19:40:00 +0000 (11:40 -0800)]
iwlwifi: Fix to set correct ht configuration
iwl_set_rxon_ht() only get called in iwl_post_associate(); which cause
possible incorrect ht configuration. Adding the call in iwl_mac_config() if
IEEE80211_CONF_CHANGE_CHANNEL flag is set to re-configure and send rxon
command.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> CC: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: Fix probe request filtering in IBSS mode
We only reply to probe request if either the requested SSID is the
broadcast SSID or if the requested SSID matches our own SSID. This
latter case was not properly handled since we were replying to different
SSID with the same length as our own SSID.
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Wed, 3 Feb 2010 17:24:35 +0000 (18:24 +0100)]
ssb: Fix CONFIG_SSB_SDIOHOST typo
This fixes a CONFIG_SSB_SDIOHOST typo.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Reported-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de> Tested-By: Albert Herranz <albert_herranz@yahoo.es> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Tue, 2 Feb 2010 16:08:19 +0000 (10:08 -0600)]
b43: Fix throughput regression
Commit c7ab5ef9bcd281135c21b4732c9be779585181be entitled "b43: implement
short slot and basic rate handling" reduced the transmit throughput for
my BCM4311 device from 18 Mb/s to 0.7 Mb/s. The basic rate handling
portion is OK, the problem is in the short slot handling.
Prior to this change, the short slot enable/disable routines were never
called. Experimentation showed that the critical part was changing the
value at offset 0x0010 in the shared memory. This is supposed to contain
the 802.11 Slot Time in usec, but if it is changed from its initial value
of zero, performance is destroyed. On the other hand, changing the value
in the MMIO register corresponding to the Interframe Slot Time increased
performance from 18 to 22 Mb/s. A BCM4306/3 also shows dramatic
improvement of the transmit rate from 5.3 to 19.0 Mb/s.
Other changes in the patch include removal of the magic number for the
MMIO register, and allowing the slot time to be set for any PHY operating
in the 2.4 GHz band. Previously, the routine was executed only for G PHYs.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@kernel.org> [Any stable version back through 2.6.28] Signed-off-by: John W. Linville <linville@tuxdriver.com>
Some single chip family devices are sold in the market with
802.11n bonded out, these have no hardware capability for
802.11n but ath9k can still support them. These are called
AR2427.
Cc: stable@kernel.org Reported-by: Rolf Leggewie <bugzilla.kernel.org@rolf.leggewie.biz> Tested-by: Bernhard Reiter <ockham@raz.or.at> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Patch prevents call set_wep_key() with zero key length. That fix long
standing regression since commit c0380693520b1a1e4f756799a0edc379378b462a
"airo: clean up WEP key operations". Additionally print call trace when
someone will try to use improper parameters, and remove key.len = 0
assignment, because it is in not possible code path.
Reported-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu> Bisected-by: Chris Siebenmann <cks-rhbugzilla@cs.toronto.edu> Tested-by: Chris Siebenmann <cks@cs.toronto.edu> Cc: Dan Williams <dcbw@redhat.com> Cc: <stable@kernel.org> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Sun, 31 Jan 2010 02:37:24 +0000 (21:37 -0500)]
ath9k: fix access to freed data on unload
Calling ath_bus_cleanup() after ieee80211_free_hw() resulted in access
to common->bus_ops, which is already freed as part of the device data.
Remove the cleanup field in struct ath_bus_ops, as it was never used
properly. Remove ath_bus_cleanup(). Merge cleanup functions in place
of the ath_bus_cleanup() calls. Take care not to use any device data
after ieee80211_free_hw().
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 31 Jan 2010 22:25:24 +0000 (23:25 +0100)]
mac80211: fix sta lookup with AP VLAN interfaces and injected frames
When injecting frames, mac80211 currently looks for the first AP
interface that matches the source address of the injected frame.
This breaks when such a frame is directed at a STA that has been moved
to a VLAN. This patch fixes it by using sta_info_get_bss instead of
sta_info_get, which also finds stations belonging to a VLAN interface
of the same BSS as the AP interface.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When an injected frame gets buffered for a powersave STA or filtered
and retransmitted, mac80211 attempts to parse the radiotap header
again, which doesn't work because it's gone at that point.
This patch adds a new flag for checking the availability of a radiotap
header, so that it only attempts to parse it once, reusing the tx info
on the next call to ieee80211_tx().
This fixes severe issues with rekeying in AP mode.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 31 Jan 2010 20:50:12 +0000 (21:50 +0100)]
mac80211: fix sta lookup for received action frames on an AP VLAN
When looking for a matching interface, __ieee80211_rx_handle_packet
loops over all active interfaces, looking for matching stations.
Because AP VLAN interfaces are not processed as part of this loop, it
needs to use sta_info_get_bss instead of sta_info_get in order to find
a STA that has been moved to a VLAN.
This fixes issues with aggregation setup/teardown.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pavel Roskin [Sun, 31 Jan 2010 00:55:09 +0000 (19:55 -0500)]
mac80211: reduce stack usage in sta_ht_capa_read()
The maximal size of the "ht_capa" file is 430 bytes. In most cases,
it's much shorter. Use a 512 byte long buffer. 1024 bytes is too much
and causes a warning with CONFIG_FRAME_WARN=1024.
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This adds a new regulatory hint to be used when we know all
devices have been disconnected and idle. This can happen
when we suspend, for instance. When we disconnect we can
no longer assume the same regulatory rules learned from
a country IE or beacon hints are applicable so restore
regulatory settings to an initial state.
Since driver hints are cached on the wiphy that called
the hint, those hints are not reproduced onto cfg80211
as the wiphy will respect its own wiphy->regd regardless.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
cfg80211: avoid flushing the global workqueue for core reg hints
When cfg80211 starts it will send a core regulatory hint. This is
sent to the global workqueue but we force processing of it by
flushing the global workqueue. The flushing was done since
cfg80211 needs last_request to always be populated.
Avoid flushing the global workqueue by processing the work
required immediately instead of putting it into a linked
list and processing it after the flush.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Thu, 21 Jan 2010 19:52:28 +0000 (11:52 -0800)]
iwlwifi: iwl_power_update_mode always hold mutex
iwl_power_update_mode expects to be called with mutex held, for example to
protect priv->vif. Only one caller currently does not do this, fix this.
Also, add a comment to iwl_power_update_mode to indicate this requirement.
Johannes Berg [Thu, 21 Jan 2010 19:47:59 +0000 (11:47 -0800)]
iwlwifi: fix typo in IWL_CCK_RATES_MASK
Due to a typo, the variable contains OFDM
rates as well. The only user doesn't care,
so this change doesn't really do anything
but fix up my confusion.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 20 Jan 2010 19:21:06 +0000 (11:21 -0800)]
iwlwifi: fix locking in iwl_mac_add_interface
The corresponding iwl_mac_remove_interface only
acquires the mutex, leading me to believe that
the spinlock is not necessary. However, this
doesn't actually acquire the mutex around the
vif pointer check and assignment, fix that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Wey-Yi Guy [Wed, 20 Jan 2010 00:51:50 +0000 (16:51 -0800)]
iwlwifi: sysassert identifier change
Change in uCode to include a unique identifier as part of sysassert,
in order to tell the difference, add the "ADVANCED SYSASSERT" description
when dump nic error to indicate the difference.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Daniel Halperin [Tue, 19 Jan 2010 18:22:19 +0000 (10:22 -0800)]
iwlwifi: optimize power saving
In hostap AP mode, every time the client sends the AP
a packet the STA_NOTIFY_AWAKE code is sent from mac80211.
This results in a command being sent to the uCode even if
the client was not asleep.
The following simple patch has fixed the issue for me without any
degradation that I can find.
Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Vivek Natarajan [Fri, 29 Jan 2010 11:26:51 +0000 (16:56 +0530)]
ath9k: Handle full sleep in ps_restore.
IDLE PS (Full Sleep) doesn't work when ifconfig up
is done during Idle unassociated state.
Fix this by restoring FULL SLEEP in ps_restore if CONF_IDLE
is set.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hamish Guthrie [Thu, 28 Jan 2010 11:54:10 +0000 (12:54 +0100)]
ps3_gelic_wireless: fix directed ssid scan
If the association worker requests a directed ssid scan and a bss list
already exists, the directed scan is not done. This patch corrects this
and cleans up a few typos and debug messages.
Signed-off-by: Hamish Guthrie <hamish.guthrie@sonycom.com> Acked-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hamish Guthrie [Thu, 28 Jan 2010 11:54:09 +0000 (12:54 +0100)]
ps3_gelic_wireless: Remove PS3 gelic legacy wpa support
The current PS3 gelic wireless driver has support for wireless
extensions. The original PS3 gelic wireless driver exposed a
dedicated API for a dedicated wpa_supplicant driver. This old
API could be enabled with CONFIG_GELIC_WIRELESS_OLD_PSK_INTERFACE,
however, as this is not being used by any distros, and it is being
removed from the driver and from wpa_supplicant.
Signed-off-by: Hamish Guthrie <hamish.guthrie@sonycom.com> Acked-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Tue, 26 Jan 2010 23:45:28 +0000 (17:45 -0600)]
rtl8187: Add callback for get_tsf
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 26 Jan 2010 13:19:52 +0000 (14:19 +0100)]
mac80211: wait for beacon before enabling powersave
Because DTIM information is required for powersave
but is only conveyed in beacons, wait for a beacon
before enabling powersave, and change the way the
information is conveyed to the driver accordingly.
mwl8k doesn't currently seem to implement PS but
requires the DTIM period in a different way; after
talking to Lennert we agreed to just have mwl8k do
the parsing itself in the finalize_join work.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Tue, 26 Jan 2010 07:58:57 +0000 (15:58 +0800)]
mac80211: fix NULL pointer dereference when ftrace is enabled
I got below kernel oops when I try to bring down the network interface if
ftrace is enabled. The root cause is drv_ampdu_action() is passed with a
NULL ssn pointer in the BA session tear down case. We need to check and
avoid dereferencing it in trace entry assignment.
Cc: Johannes Berg <johannes@sipsolutions.net> Cc: stable@kernel.org Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 25 Jan 2010 18:07:39 +0000 (19:07 +0100)]
mac80211: fill jiffies/vif on filtered frames
Filtered frames not only need their control information
cleared to avoid wrong checks, but also need to have
jiffies and vif assigned so they can be processed or
expired.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Mon, 25 Jan 2010 18:00:00 +0000 (19:00 +0100)]
b43: update cordic code to match current specs
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Mon, 25 Jan 2010 12:36:36 +0000 (13:36 +0100)]
mac80211: track work started through callbacks
Currently, the remain_on_channel work callback needs
to track in its own data structure whether the work
was just started or not. By reordering some code this
becomes unnecessary, the generic wk->started variable
can still be 'false' on the first invocation and only
be 'true' on actual timeout invocations, so that the
extra variable can be removed.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
I inserted code testing the wrong flags field,
which means that the test is almost always true
(it's really testing for the peer's WMM support)
and thus the later parts of the stack assume hw
crypto will be done even if that's not true.
Obviously, that broke software crypto. Maxim
said so specifically, and Jochen probably uses
some cipher that iwl3945 doesn't support in
hardware, which might also explain that Maxim
reports that even hw crypto is broken.
Fix this to test the right flags field.
Reported-by: Maxim Levitsky <maximlevitsky@gmail.com> Reported-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 24 Jan 2010 19:44:35 +0000 (20:44 +0100)]
mac80211: fix WARN_ON in the new work code
ieee80211_work_rx_mgmt currently enqueues various management frames,
including deauth and disassoc frames, however the function
ieee80211_work_rx_queued_mgmt does not handle these, as they should
only occur if the AP is buggy. It does emit a WARN_ON when this happens
though, and several users have reported such instances.
Fix the WARN_ON by not queueing such frames in the first place.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Kalle Valo [Sun, 24 Jan 2010 12:55:12 +0000 (14:55 +0200)]
mac80211: fix update_tkip_key() documentation about the context
Johannes noticed that I had incorrectly documented the context of
update_tkip_key() driver operation. It must be atomic because all
RX code is run inside rcu critical section.
Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michael Buesch [Sun, 24 Jan 2010 12:13:32 +0000 (13:13 +0100)]
b43: Workaround circular locking in hw-tkip key update callback
The TKIP key update callback is called from the RX path, where the driver
mutex is already locked. This results in a circular locking bug.
Avoid this by removing the lock.
Johannes noted that there is a separate bug: The callback still breaks on SDIO
hardware, because SDIO hardware access needs to sleep, but we are not allowed
to sleep in the callback due to mac80211's RCU locking.
Signed-off-by: Michael Buesch <mb@bu3sch.de> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: kecsa@kutfo.hit.bme.hu Cc: Johannes Berg <johannes@sipsolutions.net> Cc: stable <stable@kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sun, 24 Jan 2010 02:26:11 +0000 (03:26 +0100)]
ath9k: improve max rate retry handling
ath9k currently forces hw->max_rate_tries to 4 to work around rate
control inefficiencies. This has some negative side effects, such as
rate_control_send_low also using a maximum of 4 tries, which could
negatively affect reliability of unicast management frames.
This patch pushes the retry limit to the rate control instead, and
allows it to use more tries on the last stage to prevent unnecessary
packet loss.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
triggered a bug in iwlwifi where HT parameters would not be correctly set in
some mac80211 pathways. The aggregation (and possibly other) station flags were
not being set, which limited the size of aggregation blocks and reduced
throughput at high rates.
>From Johannes:
"""
Due to Wey-Yi's patch to use the set-channel command when the channel changes
while associated, we don't get a full new RXON. Therefore, we don't re-set the
rxon-station either. However, under some circumstances that apparently have
gotten more likely mac80211 will first set up the BSS info, then add the
station and then switch to an HT channel type.
Therefore, the check for "priv->current_ht_config.is_ht" in
iwl_rxon_add_station() will hit false and not fill in the HT information.
However, that check can just be removed, which is the easiest fix for all this,
because the HT capa struct is always there, just could possibly have the
ht_supported member set to false.
"""
A sample good link in my 3x3 network improves by approximately 25% TCP
throughput. This fixes Bug 2144
(http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2144).
Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 22 Jan 2010 22:22:57 +0000 (14:22 -0800)]
iwlwifi: cleanup spectrum measurement command support
In iwlagn the support for spectrum measurement command has been
disabled since v2.6.29 without any requests for it. In addition to this
when this command is indeed enabled it has been found to trigger firmware
SYSASSERT on at least 4965 and 5100 hardware (see
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1952 ). Since then
this code has been bitrotting and cannot just be enabled without porting.
Remove support for spectrum measurement command from iwlagn. It can be
added back if there is a future need and the firmware problem it triggers
has been fixed. Support for the spectrim measurement notification remains
as it has been enabled all the time.
In addition to this remove the 3945 spectrum measurement command Kconfig
option and make this command always supported. The code added by this
enabling is minimal and only run when user triggers a spectrum measurement
request via sysfs.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:56 +0000 (14:22 -0800)]
iwlwifi: check endianness annotations by default
sparse won't check endianness annotations by
default, but iwlwifi is and should be clean
so we can make sparse check them on it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:55 +0000 (14:22 -0800)]
iwlwifi: fix sparse warning
sparse correctly warns about symbol not
being static, make static to shut it up.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:54 +0000 (14:22 -0800)]
iwlwifi: clean up debugfs code
The debugfs code can be made a whole lot more
efficient by using debugfs_remove_recursive(),
the large chunk of variables can completely go
away and by moving two variables we no longer
need to allocate an extra chunk of memory.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:53 +0000 (14:22 -0800)]
iwlwifi: reorder device setup
It is better to first notify cfg80211 about the hw
rfkill state (so the rfkill device that will be
registered won't have the wrong state while being
registered), and the power/tt variable init can
(and probably should) also be done first.
Also rename iwl_setup_mac to
iwl_mac_setup_register to better describe what it
really does.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:52 +0000 (14:22 -0800)]
iwlwifi: is no longer experimental
It really hasn't been for a long time, not sure
why this stuck around.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 22 Jan 2010 22:22:51 +0000 (14:22 -0800)]
iwlwifi: module parameter to enable/disable bt co-exist
Adding "bt_coex_active" module parameter for iwlcore to enable/disable
BT coexist; if bt_coex_active is true (default), uCode will do kill/defer
every time the priority line is asserted (BT is sending signals on the
priority line in the PCIx). By disable the bt_coex_active, uCode will
ignore the BT activity and perform the normal operation.
Users might experience transmit issue on some platform due to this
WiFi/BT co-exist problem. The possible symptoms are: NetworkManager and
other similar programs can scan and find all the available APs, but will
timeout and unable to associate with any of the APs; no out-going frames
can be found with wireless sniffer tools.
On those platforms, WiFi communication can be restored by set "bt_coex_active"
module parameter to "false"
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 22 Jan 2010 22:22:50 +0000 (14:22 -0800)]
iwlwifi: bit field description for BT Config command
Give better bit filed define and description for flag parameter
in REPLY_BT_CONFIG command:
flags:
bit 0 - 1: BT channel announcement enabled
0: disable
bit 1 - 1: priority of BT device enabled
0: disable
bit 2 - 1: BT 2 wire support enabled
0: disable
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 22 Jan 2010 22:22:49 +0000 (14:22 -0800)]
iwlwifi: make broadcast station addition generic
Add function pointer for broadcast station addition so that we can call it
in from iwlcore at a later time. We only distinguish between iwlagn and
iwl3945 broadcast station addition. For the iwl3945 station addition we add
that function to iwlcore since that is where most station functionality
resides, making it part of iwl3945 will require significant code
reorganization that will dilute station management functionality. This
seems to be an efficient solution.
It may seem as though we are removing error checking when adding the 3945
broadcast station but this error checking was never really necessary since
the function returns the station id and the broadcast station id is always
set.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 22 Jan 2010 22:22:48 +0000 (14:22 -0800)]
iwlwifi: cleanup station adding code
The work done when a station is added is very similar whether the station
is added synchronously or asynchronously. Centralize this work. At the same
time increase the status flags being checked for when the command returns
with accompanying debug messages. Also increase checking when setting the
"ucode active" state with accompanying debugging.
This work is done in preparation for station notification support.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
iwlwifi: Tune radio to prevent unexpected behavior
We have seen the throughput dropped due to external noisy environment
and the radio is out of tune. There are lot of plcp errors indicating
this condition. Eventually the station can get de-authenticated by the
Access Point. By resetting and tuning the radio, the plcp errors are
reduced or eliminated and the throughput starts to rise.
To prevent unexpected behavior such as drop in throughput or deauthentication,
- The change provides the driver feature to monitor and tune the radio base on
the statistics notification from the uCode.
- It also allows the setting of the plcp error rate threshold via
the plcp_delta under debugfs interface.
Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 22 Jan 2010 22:22:45 +0000 (14:22 -0800)]
iwlwifi: Logic to control how frequent radio should be reset if needed
Add additional logic for internal scan routine to control how
frequent this function should be performed.
The intent of this function is to reset/re-tune the radio and bring the
RF/PHY back to normal state, it does not make sense calling it too
frequent,
if reset the radio can not bring it back to normal state, it indicate
there are other reason to cause the radio not operate correctly.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Henry Zhangh [Fri, 22 Jan 2010 22:22:44 +0000 (14:22 -0800)]
iwlwifi: Fix A band scanning when associated
This patch allows A band to be scanned when driver is associated to AP.
Scan mechanism is that mac80211/cfg80211 requests driver to scan G band
first and then immediately to scan A band. Original code require
driver to wait for 2 seconds after any scan before another scan will be
performed. This caused driver to service G band scan request from
mac80211/cfg80211 but deny the A band scan request.
Signed-off-by: Henry Zhangh <hongx.c.zhang@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 22 Jan 2010 22:22:43 +0000 (14:22 -0800)]
iwlwifi: add function to reset/tune radio if needed
Adding "radio reset" function to help reset and stabilize the radio.
During normal operation, sometime for unknown reason, radio encounter
problem and can not recover by itself; the best way to
recover from it is to reset and re-tune the radio. Currently, there is
no RF reset command available, but since radio will get reset when
switching channel, use internal hw scan request to force radio
reset and get back to normal operation state.
The internal hw scan will only perform passive scan on the first
available channel (not the channel being used) in associated state. The
request should be ignored if already performing scan operation or STA is
not in associated state.
Also include an "internal_scan" debugfs file to help trigger the
internal scan from user mode.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 22 Jan 2010 22:22:42 +0000 (14:22 -0800)]
iwlwifi: configure missed beacon threshold
Add support to configure missed beacon threshold, by default, if receive
"missed beacon" notification from uCode and has more than 5 consecutive
beacon missed, then perform sensitivity calibration; with this change,
allow user to adjust the missed beacon threshold from debugfs in case
more sensitivity calibration required for better performance in noisy
environment
The default value (=5) should be good enough for the normal condition,
but for very noisy environment, more sensitivity calibration could help
improve the throughput, so by setting the missed beacon threshold to
lower number, user might experience better performance result.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
changed the hw attach code to fix up initialization values only for
dual band devices, however the commit message did not give a reason as
to why this would be useful or necessary.
According to tests by Jorge Boncompte, this breaks at least some
2GHz-only cards, so the code should be changed back to the
unconditional INI fixup.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Jorge Boncompte <jorge@dti2.net> Cc: stable@kernel.org Tested-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 22:22:34 +0000 (14:22 -0800)]
iwlwifi: fix pointer signedness warning
There are a few station addresses that are
char *, instead of the normal u8 *; gcc
gives pointer signedness warnings for some
of those, so use u8 * consistently.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This is a regression from patch "mac80211: move control.hw_key assignment".
Fix it as suggested by Johannes, adding an else statement to make sure
that tx->key is not accessed when it's null.
Compile-tested only.
Reported-by: Pavel Roskin <proski@gnu.org> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Kalle Valo <kalle.valo@iki.fi> Tested-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 22 Jan 2010 21:07:59 +0000 (22:07 +0100)]
mac80211: add missing key check
ieee80211_tx_h_select_key might decide that a frame
need not be encrypted at all, in which case it will
clear tx->key. In that case it may crash if a key
was previously selected, e.g. as the default key.
This is also due to my patch
"mac80211: move control.hw_key assignment".
Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 21 Jan 2010 23:36:39 +0000 (00:36 +0100)]
mac80211: fix rx data handling for non-data frames on multiple vifs
The loop that passes non-data frames to all relevant vifs inside the
__ieee80211_rx_handle_packet keeps a pointer to the previous sdata to
avoid having to make unnecessary copies of the frame it's handling.
This led to a bug that caused it to apply the ieee80211_rx_data state
to the wrong interface, thereby either missing the rx.sta pointer or
having it assigned where it shouldn't be.
This breaks (among other things) aggregation on some vifs, as action
frame exchages are dropped to the cooked monitor interface due to
rx->sta being NULL.
Fix this by restructuring the loop so that it prepares the rx data just
before making the skb copy and calling the rx handlers.
Cc: stable@kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath9k: Fix wifi disconnection when collocated bt scan is active
As all bt packets are priority traffic during bt scan, wifi
will get disconnected when bt scan lasts for few seconds. Fix
this by allocating 10% of bt period time (4.5ms) to wifi fully.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 21 Jan 2010 04:51:04 +0000 (23:51 -0500)]
ath5k: fix setup for CAB queue
The beacon sent gating doesn't seem to work with any combination
of flags. Thus, buffered frames tend to stay buffered forever,
using up tx descriptors.
Instead, use the DBA gating and hold transmission of the buffered
frames until 80% of the beacon interval has elapsed using the ready
time. This fixes the following error in AP mode:
ath5k phy0: no further txbuf available, dropping packet
Add a comment to acknowledge that this isn't the best solution.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bob Copeland [Thu, 21 Jan 2010 04:51:03 +0000 (23:51 -0500)]
ath5k: dont use external sleep clock in AP mode
When using the external sleep clock in AP mode, the
TSF increments too quickly, causing beacon interval
to be much lower than it is supposed to be, resulting
in lots of beacon-not-ready interrupts.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=14802.
Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>