Eliad Peller [Wed, 27 Jun 2012 11:18:22 +0000 (14:18 +0300)]
mac80211: flush queues before deauth/disassoc
On deauth/disassoc we tear down all BA sessions. These
DELBA packets are sent on the appropriate TID, while
deauth/disassoc is always sent on VO. This sometimes
ends with the DELBA being sent after the deauth was
already sent.
Fix it by flushing all the pending frames before
sending deauth/disassoc.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 28 Jun 2012 08:33:25 +0000 (10:33 +0200)]
mac80211: don't expose ieee80211_add_srates_ie()
This and ieee80211_add_ext_srates_ie() aren't
exported, so can't be used by drivers anyway,
but there's also no reason that they should be
so make them private to mac80211 and use sdata
instead of vif arguments.
Acked-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 27 Jun 2012 07:23:48 +0000 (09:23 +0200)]
cfg80211: don't allow WoWLAN support without CONFIG_PM
When CONFIG_PM is disabled, no device can possibly
support WoWLAN since it can't go to sleep to start
with. Due to this, mac80211 had even rejected the
hardware registration. By making all the code and
data for WoWLAN depend on CONFIG_PM we can promote
this runtime error to a compile-time error.
Add #ifdef around all WoWLAN code to remove it in
systems that don't need it as they never suspend.
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 21 Jun 2012 20:30:52 +0000 (22:30 +0200)]
mac80211: make __ieee80211_recalc_idle static
Since it's not called from any file outside where
it's defined, the function can be static if moved
up in the file before the callers.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 19 Jun 2012 13:54:05 +0000 (15:54 +0200)]
mac80211: make ieee80211_check_concurrent_iface netdev-independent
ieee80211_check_concurrent_iface() need not use the
netdev. Remove the use of the netdev here to prepare
the function for P2P device addition.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 19 Jun 2012 14:16:22 +0000 (16:16 +0200)]
mac80211: remove unused function
Remove the unused function is_ieee80211_device().
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Thomas Pedersen [Thu, 21 Jun 2012 18:09:54 +0000 (11:09 -0700)]
nl80211: specify RSSI threshold in scheduled scan
Support configuring an RSSI threshold in dBm (s32) when requesting
scheduled scan, below which a BSS won't be reported by the cfg80211
driver.
Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 25 Jun 2012 12:46:44 +0000 (14:46 +0200)]
mac80211_hwsim: fix smatch/sparse complaints
The code is fine in both cases as-is, but we can
write it slightly differently to fix smatch/sparse
complaints:
* compare the skb pointer (which we use as a cookie)
by casting the skb to unsigned long rather than the
cookie to a pointer (fixes "different address spaces")
* when transmitting, data->channel must be assigned,
don't check it (fixes "dereferenced before check")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 11:36:25 +0000 (13:36 +0200)]
mac80211: trace debug messages
It can be very useful to have all debug messages
available when debugging, but hard to correlate
between different sources, so add a trace event
for all mac80211 debug messages.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 10:55:52 +0000 (12:55 +0200)]
mac80211: rename driver-trace file
This file will contain more soon, so
rename it to just trace.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 09:29:50 +0000 (11:29 +0200)]
mac80211: clean up debugging
There are a few things that make the logging and
debugging in mac80211 less useful than it should
be right now:
* a lot of messages should be pr_info, not pr_debug
* wholesale use of pr_debug makes it require *both*
Kconfig and dynamic configuration
* there are still a lot of ifdefs
* the style is very inconsistent, sometimes the
sdata->name is printed in front
Clean up everything, introducing new macros and
separating out the station MLME debugging into
a new Kconfig symbol.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 10:48:38 +0000 (12:48 +0200)]
mac80211: pass sdata to some RX functions
For better debugging, we would like to have
the sdata pointer available later, so pass
it into these functions.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 09:37:03 +0000 (11:37 +0200)]
mac80211: two small verbose debug cleanups
Two instances of CONFIG_MAC80211_VERBOSE_DEBUG
should be different, fix them.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 22 Jun 2012 09:26:47 +0000 (11:26 +0200)]
mac80211: remove TKIP debug
The TKIP code hasn't been changed in a very long
time, so it seems unlikely that anyone really has
a need for the TKIP debug code. Remove it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Avinash Patil [Thu, 21 Jun 2012 00:59:01 +0000 (17:59 -0700)]
ieee80211: more OUI type definitions for WLAN_OUI_MICROSOFT
WMM and WPS
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Victor Goldenshtein [Thu, 21 Jun 2012 07:56:46 +0000 (10:56 +0300)]
mac80211: add command to get current rssi
Get current rssi (in dBm) from the driver/FW.
Instead of reporting the signal received in the last
rx packet, which might be inaccurate if rx traffic is
low and beacon filtering is enabled, get the signal
from the driver/FW.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 20 Jun 2012 18:11:33 +0000 (20:11 +0200)]
mac80211: fix double-start of remain-on-channel
When a remain-on-channel item is deleted, we remove it
from the list and then start the next item. However,
if it wasn't actually the first item then calling
ieee80211_start_next_roc() is wrong as it will start
the first item -- even if that was already started.
Fix the two places that do this and add a warning to
prevent the problem from reoccurring.
Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Will Hawkins [Tue, 19 Jun 2012 21:59:14 +0000 (17:59 -0400)]
mac80211: Allow userspace to register for auth frames in IBSS
Set the necessary flags to allow user space applications
to register for authentication frames on IBSS interfaces.
This is useful for situations where userspace applications
want to control key negotiation between stations.
Signed-off-by: Will Hawkins <hawkinsw@opentechinstitute.org>
[reword commit message a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Will Hawkins [Tue, 19 Jun 2012 21:59:13 +0000 (17:59 -0400)]
mac80211: send auth in IBSS only if userspace isn't handling it
Check the auth frame registration count before sending
"open system" authentication messages when a new station
registers on a particular IBSS network. This stops us
from sending out multiple authentication messages with
different authentication algorithms.
Signed-off-by: Will Hawkins <hawkinsw@opentechinstitute.org>
[reword commit message a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Will Hawkins [Wed, 20 Jun 2012 15:51:14 +0000 (11:51 -0400)]
mac80211: Track auth frame registrations on IBSS ifaces
Track userspace registrations for authentication
frames received on an IBSS interface. This field
will be used to decide whether or not to send
"open system" authentication frames when a new
station joins an adhoc network.
Signed-off-by: Will Hawkins <hawkinsw@opentechinstitute.org>
[redesign the code flow a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Eyal Shapira [Wed, 20 Jun 2012 10:10:14 +0000 (13:10 +0300)]
mac80211: fix cleanup if driver suspend callback fails
In case the driver suspend callback fails, mac80211 is left
with stopped queues which prevents any further traffic as well
as all STAs are left marked with WLAN_STA_BLOCK_BA which will
cause any further ADDBA requests to be declined. Fix it by
undoing both before returning from __iee80211_suspend.
Reported-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Yoni Divinsky [Wed, 20 Jun 2012 12:39:13 +0000 (15:39 +0300)]
mac80211: save wmm_acm per sdata
Save and configure the wmm_acm per sdata, rather than
per hardware.
If wmm_acm is saved per hardware when running two
interfaces simultaneously on the same hardware one
interface's wmm policy will be affected by the other
interface.
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luciano Coelho [Wed, 20 Jun 2012 14:23:24 +0000 (17:23 +0300)]
mac80211: use the correct capability info in ieee80211_set_associated()
If an AP is beaconing with different capabilities than the one we get
in the associate response, we were still using the capabilities
received in the beacons. One example is when the AP is beaconing with
the short slot bit set to zero and then we try to connect to it with
long slot. In this case, we would keep using long slot until the next
beacon was received.
Fix this by using the correct capability value when calling
ieee80211_handle_bss_capability(). We were using cbss->capability,
but we should use the bss_conf->assoc_capability instead.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Felix Fietkau [Tue, 19 Jun 2012 00:50:57 +0000 (02:50 +0200)]
cfg80211: fix regression in multi-vif AP start
Commit "cfg80211: provide channel to start_ap function" assumes that the
channel is always passed to the NL80211_CMD_START_AP command, however
in case of multi-BSSID, hostapd only passes the channel for the first vif.
This makes starting beaconing on secondary vifs fail with -EINVAL.
Fix this by storing the channel provided to .start_ap in wdev->preset_chan
and picking the first AP vif's channel for secondary vifs if not provided.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 15 Jun 2012 12:23:16 +0000 (14:23 +0200)]
nl80211: use __cfg80211_rdev_from_attrs for testmode
To fix the testmode cross-namespace access problem,
use __cfg80211_rdev_from_attrs() to get the device
instead of open-coding similar functionality.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 15 Jun 2012 12:18:32 +0000 (14:18 +0200)]
nl80211: change __cfg80211_rdev_from_info
Change the function to __cfg80211_rdev_from_attrs
to take attributes instead of the info struct to
make it usable from dump callbacks for testmode.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 15 Jun 2012 12:14:22 +0000 (14:14 +0200)]
nl80211: fix netns separation
There are currently a few ways to "escape"
the network namespace and access a wiphy
that belongs to another namespace. Add a
netns argument to the relevant functions
to fix this.
One remaining issue with testmode will be
fixed in a follow-up patch.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 15 Jun 2012 12:09:58 +0000 (14:09 +0200)]
nl80211: refactor __cfg80211_rdev_from_info
Refactor the function to make it easier to
extend.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 15 Jun 2012 11:32:49 +0000 (13:32 +0200)]
cfg80211: make some functions static
Some of the functions to retrieve a device can
be static as they're used only in nl80211.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luciano Coelho [Mon, 18 Jun 2012 12:52:51 +0000 (15:52 +0300)]
mac80211: initialize sta pointer to avoid false-positive warning
Some compilers (eg. gcc 4.4.1 for ARM) report a false positive warning
in mlme.c:
net/mac80211/mlme.c: In function 'ieee80211_prep_connection':
net/mac80211/mlme.c:3035: warning: 'sta' may be used uninitialized in this function
This is a false positive because the place where 'sta' is used is
inside an if with the same condition of where it is set:
[...]
if (!have_sta) {
sta = sta_info_alloc(sdata, cbss->bssid, GFP_KERNEL);
if (!sta)
return -ENOMEM;
}
[...]
if (!have_sta) {
[...]
sta->sta.supp_rates[cbss->channel->band] = rates;
[...]
For some reason the compiler doesn't understand this and warns.
While this is not a problem in the code itself, we can avoid polluting
the build logs with false positives by setting sta to NULL on
declaration and checking for sta instead of !have_sta in the second if.
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Rajkumar Manoharan [Mon, 18 Jun 2012 13:33:52 +0000 (19:03 +0530)]
mac80211: cleanup offchannel_ps_enable argument
The 'tell_ap' argument is always true. So that remove it
and simplify the function.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Fri, 15 Jun 2012 02:20:02 +0000 (10:20 +0800)]
mac80211: fix and improve mesh RANN processing
This patch fixes the problem of dropping RANN element if the TTL
is 1. If the received RANN element TTL is 1 or greater than 1, the
RANN is processed. However, forwarding of received RANN element
with TTL 1 or less is prohibited according to the standard. This
is previously reported by Monthadar Al Jaberi.
Besides, this patch also avoid the processing of unicast PREQ
generation if the RANN element does not meet the acceptance
criteria mentioned in Sec. 13.10.12.4.2 of IEEE Std. 802.11-2012.
Reported-by: Monthadar Al Jaberi <monthadar@gmail.com>
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Arik Nemtsov [Mon, 18 Jun 2012 07:43:50 +0000 (10:43 +0300)]
mac80211: set only VO as a U-APSD enabled AC
Some APs experience problems when working with U-APSD. Decrease the
probability of that happening by using legacy mode for all ACs but VO.
The AP that caused us troubles was a Cisco 4410N. It ignores our
setting, and always treats non-VO ACs as legacy.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Arik Nemtsov [Wed, 6 Jun 2012 08:25:02 +0000 (11:25 +0300)]
mac80211: stop Rx during HW reconfig
While HW reconfig is in progress, drop all incoming Rx. This prevents
incoming packets from changing the internal state of the driver or
calling callbacks of the low level driver while it is in inconsistent
state.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Thu, 14 Jun 2012 16:23:53 +0000 (00:23 +0800)]
mac80211: fix the assignment of mesh element TTL
This patch fixes the wrong assignment of mesh element TTL.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:10 +0000 (02:06 +0800)]
{nl,cfg,mac}80211: implement dot11MeshHWMPconfirmationInterval
As defined in section 13.10.9.3 Case D (802.11-2012), this
control variable is used to limit the mesh STA to send only
one PREQ to a root mesh STA within this interval of time
(in TUs). The default value for this variable is set to
2000 TUs. However, for current implementation, the maximum
configurable of dot11MeshHWMPconfirmationInterval is
restricted by dot11MeshHWMPactivePathTimeout.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[line-break commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:09 +0000 (02:06 +0800)]
mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
mesh_path_root_timer is invoked once the dot11MeshHWMPRootMode
is larger than 1. This patch also adds the backward compatible
to the previous setting on dot11MeshHWMPRootMode. If the user
configures as follow, it will still trigger the proactive RANN
with Gate Announcement.
iw mesh0 set mesh_param mesh_hwmp_rootmode 1
iw mesh0 set mesh_param mesh_gate_announcements 1
similar to the following setting:
iw mesh0 set mesh_param mesh_hwmp_rootmode 4
iw mesh0 set mesh_param mesh_gate_announcements 1
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[line-break commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Sat, 16 Jun 2012 18:27:40 +0000 (02:27 +0800)]
mac80211: implement the proactive PREP generation
Generate the proactive PREP element in Proactive PREQ mode as
defined in Sec. 13.10.10.3 (Case D) of IEEE Std. 802.11-2012.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:07 +0000 (02:06 +0800)]
mac80211: implement the proactive PREQ generation
Generate the proactive PREQ element as defined in
Sec. 13.10.9.3 (Case C) of IEEE Std. 802.11-2012
based on the selection of dot11MeshHWMPRootMode as follow:
dot11MeshHWMPRootMode (2) is proactivePREQnoPREP
dot11MeshHWMPRootMode (3) is proactivePREQwithPREP
The proactive PREQ is generated based on the interval
defined by dot11MeshHWMProotInterval.
With this change, proactive RANN element is now generated
if the dot11MeshHWMPRootMode is set to (4) instead of (1).
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[line-break commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:06 +0000 (02:06 +0800)]
{nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout
Add the mesh configuration parameters dot11MeshHWMProotInterval
and dot11MeshHWMPactivePathToRootTimeout to be used by
proactive PREQ mechanism.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[line-break commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 13 Jun 2012 09:17:14 +0000 (11:17 +0200)]
cfg80211/nl80211: fix kernel-doc
Add missing entries to nl80211.h and fix
the kernel-doc notation in cfg80211.h.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Wed, 13 Jun 2012 09:17:11 +0000 (11:17 +0200)]
nl80211: fix sched scan match attribute name
It should be NL80211_SCHED_SCAN_MATCH_ATTR_SSID as
documented, not NL80211_ATTR_SCHED_SCAN_MATCH_SSID.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Pontus Fuchs [Tue, 12 Jun 2012 12:13:19 +0000 (14:13 +0200)]
mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
If you add a monitor interface in parallel to a normal interface
mac80211 will let you to change the channel type on the monitor
interface even if you are connected. Add an explicit check to
disallow this.
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
[fix typo in commit log, use sdata instead of netdev]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 11 Jun 2012 15:09:41 +0000 (17:09 +0200)]
mac80211: allow cancelling dependent ROCs
In my redesign of remain-on-channel I forgot
that an item could be cancelled when it's a
dependent item that is part of another item.
Allow cancelling such items by removing them
from the dependents list.
Note that when we cancel the main item, all
its dependents are also cancelled. It would
be possible to not do that, but would need
tricks to promote an item from dependent to
top-level and is tricky in the HW ROC case.
Reported-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Avinash Patil [Tue, 12 Jun 2012 01:14:16 +0000 (18:14 -0700)]
ieee80211: definitions for Microsoft Vendor OUI and WPA OUI type
Reference: http://standards.ieee.org/develop/regauth/oui/oui.txt
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 11 Jun 2012 09:34:18 +0000 (11:34 +0200)]
mac80211: remove unneeded ieee80211_run_deferred_scan()
Ilan pointed out to me that ieee80211_start_next_roc()
already calls ieee80211_run_deferred_scan() if the list
of ROC items is empty, so there's no need to call it
again after calling ieee80211_start_next_roc().
Reported-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Mon, 11 Jun 2012 03:59:36 +0000 (11:59 +0800)]
{nl,cfg,mac}80211: fix the coding style related to mesh parameters
fix the coding style related to mesh parameters, especially the indentation,
as pointed out by Johannes Berg.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Chun-Yeow Yeoh [Mon, 11 Jun 2012 03:59:10 +0000 (11:59 +0800)]
cfg80211: add missing kernel-doc for mesh configuration structure
Add the missing kernel-doc for mesh configuration parameters as pointed
out by Johannes Berg.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Javier Cardona [Fri, 8 Jun 2012 20:30:25 +0000 (13:30 -0700)]
mac80211: Rename stainfo variable for the more common sta
Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Jason Abele <jason@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Javier Cardona [Fri, 8 Jun 2012 20:30:24 +0000 (13:30 -0700)]
mac80211: Remove unused variable
Signed-off-by: Javier Cardona <javier@cozybit.com>
Reviewed-by: Jason Abele <jason@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
John W. Linville [Fri, 8 Jun 2012 18:24:53 +0000 (14:24 -0400)]
wl18xx: avoid some -Wformat warnings
CC drivers/net/wireless/ti/wl18xx/main.o
drivers/net/wireless/ti/wl18xx/main.c: In function ‘wl18xx_conf_init’:
drivers/net/wireless/ti/wl18xx/main.c:1024:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
drivers/net/wireless/ti/wl18xx/main.c:1024:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luciano Coelho [Fri, 8 Jun 2012 13:43:19 +0000 (16:43 +0300)]
Merge branch 'wl12xx-next' into for-linville
Arik Nemtsov [Tue, 29 May 2012 15:38:05 +0000 (18:38 +0300)]
wlcore/wl12xx/wl18xx: make NVS file optional for wl18xx
Don't spew errors when we can't find the NVS file in wlcore. Instead
fail the wl12xx boot HW op if the NVS isn't found.
Take this opportunity to remove some dead code from register_hw()
which looks for the NVS again needlessly.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Arik Nemtsov [Tue, 29 May 2012 09:44:12 +0000 (12:44 +0300)]
wl18xx: clean up phy module parameters
Give all wl18xx phy module paramters -1 as a default value, indicating
the paramter was not set. Add previous default values to the default
18xx priv conf structure.
Remove the board_type field from wl18xx priv. The field with the same
name inside the phy conf is good enough for our purposes.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Arik Nemtsov [Tue, 29 May 2012 09:40:50 +0000 (12:40 +0300)]
wl18xx: align wl18xx_conf_phy with FW variant and remove it
wl18xx_conf_phy represents part of the FW native wl18xx_mac_and_phy_params
structure. Remove it and replace the phy part of the wl18xx conf with the
FW bound structure. This allows us to set/override all members.
Increment the wlconf version to ensure compatibility with the new
structure
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Tue, 22 May 2012 09:34:10 +0000 (12:34 +0300)]
wl18xx: update fw statistics
Aligned to the struct in FW 8.2.0.0.91 and updated the debugfs entries
accordingly.
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Arik Nemtsov [Wed, 23 May 2012 05:39:43 +0000 (08:39 +0300)]
wl18xx: allow FW-log by default for PG2.0
This is supported by new FW versions (.88+).
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:28 +0000 (23:39 +0300)]
wl18xx: read configuration structure from a binary file
Instead of using the hardcoded configuration structure, try to read it
from a "firmware" file called wl18xx-conf.bin. If the file doesn't
exist, fall back to the hardcoded version. If the file exists but is
illegal, bail out.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:27 +0000 (23:39 +0300)]
wlcore/wl18xx: export conf struct in a debugfs file
Add conf file header structure, magic and version values and export
the entire conf struct in debugfs.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:26 +0000 (23:39 +0300)]
wlcore/wl18xx: the conf structs must be packed so they can be exported
Since we are now going to export the conf structure and read it from a
file, it should be packed to avoid surprises with padding bytes.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:25 +0000 (23:39 +0300)]
wlcore: use u8 instead of enum for bcn_filt_mode
Since we will export the conf structure as a file, we need to use well
defined types. Instead of using enum, whose size may vary, use u8 for
bcn_filt_mode instead.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:24 +0000 (23:39 +0300)]
wlcore/wl18xx/wl12xx: use u8 instead of bool for host_fast_wakeup_support
The conf structure is going to be exported to a file, so we should use
only well defined types. bool is not well defined and may vary from
platform to platform, so change the host_fast_wakeup_support type to
u8 instead.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:23 +0000 (23:39 +0300)]
wlcore: export raw binary with the FW statistics in debugfs
Instead of parsing all the binary data returned by the firmware, we
should simply export the binary and let the userspace do the parsing.
This commit adds a new file to debugfs to do that.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Luciano Coelho [Thu, 7 Jun 2012 20:39:22 +0000 (23:39 +0300)]
wl18xx: add support to clear FW statistics
This patch calls ACX_CLEAR_STATISTICS to clear the firmware
statistics. The trigger is a new debugfs file called
clear_fw_statistics in the fw_stats directory.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Eyal Shapira [Thu, 7 Jun 2012 20:39:21 +0000 (23:39 +0300)]
wlcore: add debugfs control over rx interrupt pacing
Add control over several conf fields which combined
control the rx interrupt pacing mechanism, that is avoiding
getting an interrupt following a single frame rx but instead
have the FW trigger the interrupt only after a certain
amount of frames received or a timeout.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Eyal Shapira [Thu, 7 Jun 2012 20:39:20 +0000 (23:39 +0300)]
wlcore: add support macros to easily add conf debugfs entries
The current debugfs code contains too much code duplication
of bolierplate code. Add some macro magic to avoid this and
enable adding new debugfs entries by using just a few lines.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Grant Erickson [Fri, 1 Jun 2012 16:19:01 +0000 (09:19 -0700)]
wl12xx: Add support for an external 26 MHz crystal source
Add support for an external 26 MHz crystal source.
[Changed wl->ref_clock to priv->ref_clock -- Luca.]
Signed-off-by: Grant Erickson <marathon96@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Sun, 13 May 2012 11:53:40 +0000 (14:53 +0300)]
wl18xx: pad only last frame in aggregration buffer for PG2
In PG2 only the last frame in the aggregate buffer should be
aligned to the sdio block size. This frame's header msb should be
set to 0, while in all the previous frames in the aggregation
buffer, this bit should be set to 1.
[Add a HW op for setting the frame ctrl bit only for 18xx. Other minor
cleanups - Arik]
[Make the pre_pkt_send operation optional -- Luca]
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Mon, 23 Apr 2012 14:35:25 +0000 (17:35 +0300)]
wl18xx: PG2.0 HW Watch dog interrupt support
In PG2, the HW watchdog interrupt occupies bit0 of the event vector, and
the SW watchdog is relocated to bit9. We perform the relocation
globally, as there's only one watchdog bit on previous platforms (bit0).
[Only mask in the new bit9 for platforms supporting it. This avoids
spurious events on other platforms - Arik]
Signed-off-by: Orit Brayer <orit@ti.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Mon, 23 Apr 2012 13:49:19 +0000 (16:49 +0300)]
wl18xx: FW/PHY arguments added for PG2
PG2 requires 4 new parameters that to be passed to the PHY.
Use the actual PHY initialization struct size for the mem size of the
PHY_INIT section, to account for additions in params.
[Make sure PG1 still gets the original struct - Arik]
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Sun, 22 Apr 2012 17:45:52 +0000 (20:45 +0300)]
wl18xx: support PG2 version of the chip
PG2 has a unique chip id. It supports similar HW quirks.
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Ido Reis [Sun, 13 May 2012 12:27:17 +0000 (15:27 +0300)]
wl18xx: fix PHY_INIT addresses mem size
was hardcoded 252, now uses the parameters struct size.
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Johannes Berg [Tue, 5 Jun 2012 12:28:42 +0000 (14:28 +0200)]
mac80211: unify SW/offload remain-on-channel
Redesign all the off-channel code, getting rid of
the generic off-channel work concept, replacing
it with a simple remain-on-channel list.
This fixes a number of small issues with the ROC
implementation:
* offloaded remain-on-channel couldn't be queued,
now we can queue it as well, if needed
* in iwlwifi (the only user) offloaded ROC is
mutually exclusive with scanning, use the new
queue to handle that case -- I expect that it
will later depend on a HW flag
The bigger issue though is that there's a bad bug
in the current implementation: if we get a mgmt
TX request while HW roc is active, and this new
request has a wait time, we actually schedule a
software ROC instead since we can't guarantee the
existing offloaded ROC will still be that long.
To fix this, the queuing mechanism was needed.
The queuing mechanism for offloaded ROC isn't yet
optimal, ideally we should add API to have the HW
extend the ROC if needed. We could add that later
but for now use a software implementation.
Overall, this unifies the behaviour between the
offloaded and software-implemented case as much
as possible.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 5 Jun 2012 12:28:40 +0000 (14:28 +0200)]
mac80211: do remain-on-channel while idle
The IDLE handling in HW off-channel is broken right
now since we turn off IDLE only when the off-channel
period already started. Therefore, all drivers that
use it today (only iwlwifi!) must support off-channel
while idle, so playing with idle isn't needed at all.
Off-channel in general, since it's no longer used for
authentication/association, shouldn't affect PS, so
also remove that logic.
Also document a small caveat for reporting TX status
from off-channel frames in HW remain-on-channel.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 5 Jun 2012 12:21:14 +0000 (14:21 +0200)]
wireless: update wireless URLs
The preferred URL is http://wireless.kernel.org/
rather than http://linuxwireless.org/, update all
URLs to point there.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:54:13 +0000 (20:24 +0530)]
ath9k: Resync beacons properly
After a chip reset, the beacon timers have to re-programmed
correctly for a station in associated state. Use the PS flags
to ensure that this is done after a TSF sync happens, otherwise
the driver ends up using incorrect values for TBTT/DTIM in
powersave mode.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:54:07 +0000 (20:24 +0530)]
ath9k: Fix powersave locking
The 'ps_flags' is used/accessed in a variety of contexts
and requires proper locking. Use 'sc_pm_lock' appropriately.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:54:01 +0000 (20:24 +0530)]
ath9k: Handle fatal interrupts properly
When a fatal interrupt is received or it is detected that the baseband
has hung, the chip has to be reset immediately. Otherwise, we end up
processing spurious interrupts. Ensure that we bail out properly in
the ISR when the reset work hasn't completed yet.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:53:55 +0000 (20:23 +0530)]
ath9k: Use atomic operations
The 'sc_flags' variable is being used in a number of places
with no locking whatsoever. This patch converts the usage
of sc_flags to atomic ops.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:53:49 +0000 (20:23 +0530)]
ath9k: Move LNA code to antenna.c
And use a helper function to setup antennae after a reset.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:53:43 +0000 (20:23 +0530)]
ath9k: Fix work handling
* Currently, there is no synchronization between the reset
work and the tx-poll work. Fix this and make sure that we
bail out properly if a reset work is in progress.
* Cleanup the PLL WAR and enable it for AR9340 too and
use a helper for restarting work/timers after a reset.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 14:53:37 +0000 (20:23 +0530)]
ath9k: Group link monitoring logic
Add link.c and move all the link/connection monitoring
code to it.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:52 +0000 (16:28 +0530)]
ath9k: improve BT FTP/PAN performance
When BT FTP/PAN transmits while WLAN is idle, the one of 9462 chain
often picks up BT's tx signal and starts receiving. If the current
weight is set to be higher than BT tx, BT tx will be aborted and this
also degrades BT performance. Hence lower WLAN rx priority in this
case only when there are no WLAN traffic.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:47 +0000 (16:28 +0530)]
ath9k_hw: fix power state for MCI
Program MCI related power registers only if MCI interrupts
are enabled. This could help to reduce power consumptions when
WLAN alone is enabled in BT coex chips.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:41 +0000 (16:28 +0530)]
ath: do not update cycle counters with sleep mode
When the chip is waking up from sleep state, the cycle counters
might have incorrect readings. So it is better not to update those
readings with software counters.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:36 +0000 (16:28 +0530)]
ath9k: BT coex performance tuning for AR9462
Use smaller aggregation limit and increasing aggregation threshold
for osla that could improve wlan performance when there is HID profile.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:31 +0000 (16:28 +0530)]
ath9k_hw: fix BT RF performance
When software rfkill is triggered, before put the chip in reset
state, give LNA and SPDT control to BT to make sure BT can have
good RF performance.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:25 +0000 (16:28 +0530)]
ath9k_hw: configure ar9462 switching regulator
Enable WLAN and BT mode for switching regulator discontinuous
orverride for AR9462 chips.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:20 +0000 (16:28 +0530)]
ath9k_hw: program BT to control SPDT
program BT to control SPDT everytime while loading switch table
from eeprom.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:14 +0000 (16:28 +0530)]
ath9k_hw: fix IQ calibration chain index
The chain index to perform IQ calibration is counted to number of valid
tx chains and then used for indexing chain specific registers. If the
chainmask is set to 0x2 (i.e chain 1 only), still it accesses chain 0
registers for chain 1. So use real chain index instead sequential one.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:08 +0000 (16:28 +0530)]
ath9k: cleanup MCI indentation
Fix bad indentation & if nesting to lose about two levels
of unnecessary indentation.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rajkumar Manoharan [Mon, 4 Jun 2012 10:58:03 +0000 (16:28 +0530)]
ath9k_hw: update ar9462 initval table to fix rx
The wrong ADC sample phase that happen between awake and
network/full sleep will lead to improper rx noisefloor
calibration.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:58 +0000 (16:27 +0530)]
ath9k: Use separate operational flags for BTCOEX
Also, use atomic operations to check the flags.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:52 +0000 (16:27 +0530)]
ath9k: Remove SC_OP_OFFCHANNEL
mac80211's IEEE80211_CONF_OFFCHANNEL can be used directly
to track offchannel state. Also pass the correct boolean
value to ath9k_hw_startpcureceive().
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:47 +0000 (16:27 +0530)]
ath9k_hw: Fix variable usage
Exposed by sparse:
ar9003_mci.c:1134:31: warning: Using plain integer as NULL pointer
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:41 +0000 (16:27 +0530)]
ath9k: Add MCI interrupt to debugfs statistics
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:36 +0000 (16:27 +0530)]
ath9k_hw: Cleanup power mode API
The 'setChip' variable is unused, remove it and
simplify the functions.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:30 +0000 (16:27 +0530)]
ath9k_hw: Fix MCI usage
MCI has to be handled only when BTCOEX is actually enabled.
Check for this condition before calling MCI related functions
from various reset/calibration call-sites.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:25 +0000 (16:27 +0530)]
ath9k_hw: Fix AR_RTC_KEEP_AWAKE usage
The default value that is being programmed to AR_RTC_KEEP_AWAKE
is 0x2, there is no need to program it manually in various
functions.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 4 Jun 2012 10:57:19 +0000 (16:27 +0530)]
ath9k: Setup MCI interrupts properly
MCI interrupts have to be enabled only when BTCOEX is
actually in use.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>