Peter Oh [Mon, 13 Apr 2015 18:01:20 +0000 (11:01 -0700)]
ath10k: use MAC clock rate same as FW uses for survey accuracy
WLAN survey data provides several informative values on each channels
such as noise, active time, transmit time, and etc.
Regarding the channel activity time data, it is reported from firmware
in different form which is number of cycles instead of time itself.
Hence host driver converts it to time unit by dividing it by clock rate
that is used at baseband MAC.
Using difference clock rate from that actual HW is using will result in
inaccurate survey data. For instance, channel active time can be reported
with bigger than 150ms even though we set Dwell time to 150ms.
Therefore set the clock rate to 88000 (88 MHz) which is ath10k baseband
MAC is using.
Signed-off-by: Peter Oh <poh@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Janusz Dziedzic [Fri, 10 Apr 2015 13:23:23 +0000 (13:23 +0000)]
ath10k: enable ibss-rsn
With latest additions to the driver it seems
viable to enable support for IBSS-RSN.
It seems to work on QCA988X and 999.999.0.636 but
is a bit slow to exchange RSN keys for some
reason. This may be a firmware quirk or ath10k is
missing something. Nevertheless it makes sense to
finally enable IBSS-RSN in ath10k even if somewhat
handicapped.
QCA6174 firmware doesn't seem to be able to Tx
EAPOL frames at all now (they get stuck in hw
queues for some reason) so it never gets to set
the keys in driver. It's fairly safe to assume that
once this is fixed IBSS-RSN will work with QCA6174
firmware without any additional changes. Hence no
special handling for advertising
IEEE80211_HW_SUPPORTS_PER_STA_GTK and
WIPHY_FLAG_IBSS_RSN is done now.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Fri, 10 Apr 2015 13:23:21 +0000 (13:23 +0000)]
ath10k: fix multiple key static wep with ibss
Apparently firmware requires both pairwise and
groupwise keys to be installed per-peer for static
WEP in IBSS. This wasn't necessary for AP mode
(and installing both doesn't seem to break AP
mode thus there's no special handling).
Also there seems to be some kind of issue with
mapping tx/rx keys in firmware properly which
resulted in wrong keys being used and broken
communication between devices.
It can be argued the vdev param part is more of a
workaround than a real fix. However I couldn't
figure out how to fix this differently. It works
and isn't super ugly.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Fri, 10 Apr 2015 13:23:20 +0000 (13:23 +0000)]
ath10k: don't use reassoc flag
Firmware actually re-creates peer entry when
reassoc flag is set. This is undesired and could
cause trouble with IBSS crypto-wise. This is also
important for upcomming bitrate mask improvement.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Fri, 10 Apr 2015 13:02:28 +0000 (13:02 +0000)]
ath10k: add extra check for frame tracing
Frames are logged via tracing in two slices:
header and payload, separately. This is done for
performance reasons when one wants to, e.g.
analyse metadata only of frames only.
If for some reason device delivered a frame buffer
which was sized below what 802.11 header implied
tracing logic would blow doing an invalid memory
accesses.
I've hit this problem when running IBSS on QCA988X
with 999.999.0.636 and tracing at the same time.
Fixes: 5ce8e7fdcc7a ("ath10k: handle ieee80211 header and payload tracing separately") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Fri, 10 Apr 2015 13:01:27 +0000 (13:01 +0000)]
ath10k: fix error handling in pci_probe
If chip_id wasn't recognized clean up code wasn't
executed properly. It would skip freeing memory
causing a leak and irqs causing possibly MSI
warning splats later or even kernel crashes.
Fixes: 1a7fecb766c8 ("ath10k: reset chip before reading chip_id in probe") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Peter Oh [Tue, 31 Mar 2015 23:44:43 +0000 (16:44 -0700)]
ath: lower JP W53 band DFS detection threshold around 30%
Japan's W53 band requires 50% data traffic during its DFS test,
but WLAN baseband used by ath9k and ath10k is not able to achieve
current threshold rate, 50%, under the data traffic rate.
In other words, HW occasionally fails detecting radar pulses,
so that SW cannot get enough radar reports to achieve the rate.
Signed-off-by: Peter Oh <poh@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Peter Oh [Tue, 31 Mar 2015 23:44:42 +0000 (16:44 -0700)]
ath: define JP DFS patterns separated from FCC
Separate Japan's DFS pattern from FCC to control PPB threshold.
Currently all the radar detectors use the same threshold rate at
50%, but it's not able to achieve if data traffic rate is higher
than 40% because WLAN baseband used by ath9k and ath10k often fails
detecting radar pulses, so that SW cannot get enough radar reports
to achieve the rate.
Since Japan's W53 band requires 50% data traffic during its DFS
test we need to apply different threshold rate than others on it.
Hence define its own pattern to give flexibility to threshold rate.
Signed-off-by: Peter Oh <poh@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 31 Mar 2015 11:03:48 +0000 (11:03 +0000)]
ath10k: use scan burst for hw roc
This improves chances of getting onto a foreign
channel and thus makes P2P a bit more reliable.
Without scan burst it was possible for firmware to
not switch to foreign channel resulting in "failed
to switch to channel for roc scan" warning. This
would also effectively fail some offchan tx
requests and lead to P2P find/connect taking
longer. This could be observed when other vifs
were running/busy, e.g. with P2P GO.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 31 Mar 2015 11:03:47 +0000 (11:03 +0000)]
ath10k: fix hw roc expiration
It is not guaranteed firmware will switch to
foreign channel immediately after starting scan
sequence. To account for that don't use duration
parameter for scan time. Instead request insanely
long scan and use timeout worker to cancel it from
driver.
This should improve P2P reliability a bit.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Peter Oh [Thu, 9 Apr 2015 15:50:10 +0000 (18:50 +0300)]
ath: support new FCC DFS Radar Type 1
Add support for new FCC DFS rules released on August 14, 2014.
FCC has added a new radar type named Radar Type 1 and original
Radar Type 1 is renamed to Radar Type 0 in consequence.
During the certificate test, Type 1 PRI values are randomly selected
within the range of 518 and 3066 and we divide it to 3 groups based on
practical test result data collected for more than a year.
For about Radar type ID, it does nothing to functionalities.
In other words, even if we re-order the IDs, DFS detection will
work as well, but we give the ID with matching to FCC doc.
By adding this support, the drivers using this DFS function are
able to support both of old and new FCC DFS rules simultaneously
without any other changes.
Signed-off-by: Peter Oh <poh@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Yanbo Li [Wed, 1 Apr 2015 19:53:21 +0000 (22:53 +0300)]
ath10k: change the fw stats access mask
This fix the regerssion introduced after "ath10k_wmi_requests_stats()
call to use more stat bits", both the 10.2.X FW and community FW 10.1.X
will return time out when access the fw_stats with the STAT_VDEV and
STAT_PDEV. Add the condition to use different fw_stats mask for different
FW versions.
Fixes: 7777d8c7ef6f ("ath10k: implement fw stats for wmi-tlv") Signed-off-by: Yanbo Li <yanbol@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 1 Apr 2015 19:53:20 +0000 (22:53 +0300)]
ath10k: fix static wep with more than 1 key in client mode
The default keyidx callback may be called after
more than 1 key is installed. This led to only 1
WEP key being reinstalled only. This caused Rxed
traffic encrypted with other WEP keys to be
dropped in client mode.
Tested-by: Bartosz Markowski <bartosz.markowski@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 1 Apr 2015 19:53:19 +0000 (22:53 +0300)]
ath10k: fix arvif->wep_keys clearing
The variable should be cleared regardless of
whether there's a peer associated with the key or
not.
This fixes case when user first associates with 2
WEP keys and then disconnects and connects with 1
WEP key. This resulted in WEP key count being 2 in
the driver leading to default keyidx fixup
failure.
Tested-by: Bartosz Markowski <bartosz.markowski@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Janusz Dziedzic [Wed, 1 Apr 2015 19:53:18 +0000 (22:53 +0300)]
ath10k: disable burst mode
Firmwares that indicate BURST_SERVICE as enabled
could overwrite some wmm parameters (eg. txop).
This could lead IOT and balancing issues.
Hence disable this by default.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 24 Mar 2015 13:14:03 +0000 (13:14 +0000)]
ath10k: fix IBSS scanning on wmi-tlv and qca6174
WLAN.RM.2.0-00073 firmware requires self-peer to
be created prior to issuing scan command. Without
this wmi-tlv with qca6174 firmware crashes after
submitting a scan request.
Creating the peer as soon as add_interface()
shouldn't be a problem.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 31 Mar 2015 10:49:20 +0000 (10:49 +0000)]
ath10k: clean up set_bitrate_mask handling
The code was a bit convoluted. Clean it up and
prepare for future changes.
While at it this fixes incorrect verification of
'single nss' case when ss2 rates were missing
while ss1 and ss3 were requested resulting in
nss=3 being set:
Michal Kazior [Tue, 31 Mar 2015 10:26:26 +0000 (10:26 +0000)]
ath10k: allocate fw resources for iface combinations
The number of 3 vdevs wasn't enough to handle the
worst case for interface combinations in practice.
wpa_supplicant may need up to 4 vifs to have 2
vifs actually connected, i.e. p2pdev + client + 2x
p2p (either p2p client or p2p go).
This fixes worst case warning:
Free vdev map is empty, no more interfaces allowed.
This keeps the ability to associate 32 stations in
AP mode at the cost of not being able to guarantee
that under all circumstances, i.e. some
combinations may consume additional fw peer
entries for internal purposes leaving less
resource for stations in AP mode.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 24 Mar 2015 12:40:17 +0000 (12:40 +0000)]
ath10k: don't call quiet mode if it's not implemented
qca6174 and wmi-tlv doesn't have quiet mode
implemented. Don't even attempt to call it. This
fixes a warning when bringing first interface up:
failed to set quiet mode period 100 duarion 0 enabled 0 ret -95
Fixes: 8515b5c79a54 ("ath10k: configure thermal throttle while powering up") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 24 Mar 2015 12:38:11 +0000 (12:38 +0000)]
ath10k: fix survey reporting
Number of channels is stored in a separate macro
in a header file and channel list is constructed
independently. The macro is used to define survey
array.
This fixes a recent regression introduced after
adding support for 144 channel. The regression
would lead to a warning and incomplete survey data
on channel 165:
chan info: invalid frequency 5825 (idx 38 out of bounds)
Also make sure to enforce the sizes and avoid this
kind of problem in the future.
Fixes: 4a7898fed5f3 ("ath10k: enable channel 144 on 5GHz band") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: harmonize error case handling in ath10k_core_start
All of the bringup/init functions called in ath10k_core_start return 0
on success and != 0 on failure. ath10k_wmi_wait_for_service_ready(),
ath10k_wmi_wait_for_unified_ready() and their call sites were adjusted
to fit this model.
The return type of wait_for_completion_timeout is unsigned long not int so
ath10k_wmi_wait_for_service_ready() and ath10k_wmi_wait_for_unified_ready()
were fixed up accordingly.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: debug: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
An appropriately named unsigned long is added and the assignments fixed up.
Missing spaces 1*HZ -> 1 * HZ were also added along the way.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: mac: match wait_for_completion_timeout return type
Return type of wait_for_completion_timeout is unsigned long not int.
An appropriately named unsigned long is added, respectively 'ret'
renamed, and the assignments fixed up.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 30 Mar 2015 06:51:57 +0000 (09:51 +0300)]
ath10k: fix aid setup in station mode
While debugging something else I noticed AID was
set to 0. This could lead to powersave issues in
station mode. Maybe this isn't really necessary
but set it properly just to be sure.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 30 Mar 2015 06:51:56 +0000 (09:51 +0300)]
ath10k: deduplicate bitrate to rate idx conversion
It's possible to derive rate index from bitrate
without any additional mapping structures/logic.
This should have little to none impact on
performance since this is only done for management
frames and the previous approach wasn't
particularly optimized.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Marek Puzyniak [Mon, 30 Mar 2015 06:51:53 +0000 (09:51 +0300)]
ath10k: introduce basic tdls functionality
This patch introduces tdls without tdls peer uapsd and tdls channel switching.
Transmitting tdls data frames works only for ethernet type frames, that's why
data addressed to tdls sta is in ethernet format.
This patch depends on commit c23e31cf7b55 ("mac80211: initialize rate control
earlier for tdls station").
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Marek Puzyniak [Mon, 30 Mar 2015 06:51:52 +0000 (09:51 +0300)]
ath10k: update station counting
Currently station counting functions
(inc_num_stations/dec_num_stations) does not handle
tdls type of stations. Tdls station should be counted
because it consumes peer in firmware. Only not tdls
stations are excluded from this counting.
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Marek Puzyniak [Mon, 30 Mar 2015 06:51:52 +0000 (09:51 +0300)]
ath10k: make peer type configurable
Peer type was hardcoded to default value.
For future implementation it is required
to make is configurable.
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 30 Mar 2015 06:51:51 +0000 (09:51 +0300)]
ath10k: unify tx mode and dispatch
There are a few different tx paths depending on
firmware and frame itself.
Creating a uniform decision will make it possible
to switch between different txmode easier, both
for testing and for future features as well.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 30 Mar 2015 06:51:51 +0000 (09:51 +0300)]
ath10k: clear htt.freq
If htt.freq isn't cleared and contains garbage fw
may discard tx packets. Prevent this from
happening by clearing htt.freq properly.
Possible manifestation of the problem could be not
being able to send auth request/response frames on
firmware with HTT >= 3.4 (when freq param was
introduced), e.g. on qca6174.
Fixes: 8d6d36243610 ("ath10k: fix offchan reliability") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle Valo [Mon, 30 Mar 2015 11:14:28 +0000 (14:14 +0300)]
ath10k: fix HTT op backwards compatibility for QCA6174
Commit 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION") broke QCA6174
receive side as the HTT ids from ATH10K_FW_HTT_OP_VERSION_MAIN don't have
HTT_TLV_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND set. Fix this by adding a backwards
compatibility code which sets HTT op version if it's not set by the firmware
image.
Fixes: 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION") Reported-by: Michal Kazior <michal.kazior@tieto.com> Tested-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Kalle Valo [Wed, 25 Mar 2015 11:12:42 +0000 (13:12 +0200)]
ath10k: bump up FW API to 5
Firmware 10.2.4.48-3 now supports management frames over HTT feature and has
ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX. But as 10.2.4 branch has conflicting HTT ids
patch "ath10k: add ATH10K_FW_IE_HTT_OP_VERSION" is needed to fix the issue.
Older ath10k versions don't have support that support and to maintain backwards
compatibility we need bump up the FW API to 5 not break older versions.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Target to host HTT messages are conflicting between 10.x and other
firmware revisions. By maintaining separate HTT T2H tables for each
firmware revisions (main, 10x and tlv) similar to WMI abstraction,
solves the conflicts. Add ATH10K_FW_IE_HTT_OP_VERSION so that the firmware can
advertise the HTT interface to ath10k.
This fix is needed to get management frames over HTT (ie.
ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX disabled) working with 10.2.4.48-2 firmware.
Otherwise there will be unknown htt events and nothing works:
[30087.438343] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30087.448691] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30149.032974] ath10k_pci 0000:02:00.0: htt event (19) not handled
If the firmware does not have ATH10K_FW_IE_HTT_OP_VERSION use the main HTT
interface. That way old firmware images will still work.
Cc: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: enable Adaptive Noise Immunity (ANI) by default
ANI helps to improve connectvity and performance in a noisy environment.
Enabling this feature would help the user experience a better and stable
wireless connection in a noisy environmnet. This feature is currently not
enabled for ath10k. Enable this feature by default.
Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: move driver state check before setting throttle
Since thermal daemon is unaware of the device state, it might
try to adjust the throttle state when the device is powered down.
So the driver caches the value and will configure it while
powering up the target. The cached value will be programed later
once the device is brought up. In such case, returning error
status is confusing and misleading the user application. Hence
moving the driver state check before sending wmi command to target.
Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Allow driver to cache the throttle state when the devie is not
yet started. Configure the cached throttle state while powering
up the device. Since thermal daemon is unaware of the up/down cycle,
it assumes that device is throttled.
Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: do not restrict thermal throttling to ap mode
Recently thermal mitigation is validated in station mode as well.
Hence allowing thermal throttling for all interfaces. This enables
user to validate thermal mitigation with different modes.
Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: fix interpretation of cooling device state
Setting the sysfs attribute ends up configuring the duty cycle,
but the interface through which the attribute is exposed
(cooling_device) is for setting the throttle/cooling state. This
is confusing the user. Hence renaming the cooling device interfaces
for better readability.
Cc: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add debugfs entry to configure quiet period
Add support to configure quiet period (in milliseconds) via debugfs.
This is useful to experiment different quiet period values along with
different throttle ratio.
Since the station kickout threshold is also counting software
reries (Default sw count in firmware is 16), increasing the threshold
to try with atleast 20 data frames before kicking out the station.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
By default rts protection is enabled in firmware for the second
rateset. Currently ath10k selects RTS profile (only for software
retries), when legacy stations are associated or asked by mac80211.
On congested environment, when AP is running in HT/VHT mode and
there are no legacy clients associated, this will impact the
robustness. Also enabling RTS protection only for second rateset will
not impact performance on clear environment. Fix that.
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Johannes Berg [Fri, 20 Mar 2015 13:18:27 +0000 (14:18 +0100)]
mac80211: avoid duplicate TX path station lookup
Instead of looking up the destination station twice in the TX path
(first to build the header, and then for control processing), save
it when building the header and use it later in the TX path.
To avoid having to look up the station in the many callers, allow
those to pass %NULL which keeps the existing lookup.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 20 Mar 2015 15:01:52 +0000 (16:01 +0100)]
mac80211: mesh: avoid pointless station lookup
In ieee80211_build_hdr(), the station is looked up to build the
header correctly (QoS field) and to check for authorization. For
mesh, authorization isn't checked here, and QoS capability is
mandatory, so the station lookup can be avoided.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 20 Mar 2015 13:05:02 +0000 (14:05 +0100)]
mac80211: drop 4-addr VLAN frames earlier if not connected
If there's no station on the 4-addr VLAN interface, then frames
cannot be transmitted. Drop such frames earlier, before setting
up all the information for them.
We should keep the old check though since that code might be used
for other internally-generated frames.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 20 Mar 2015 12:29:29 +0000 (13:29 +0100)]
mac80211: don't look up destination station twice
There's no need to look up the destination station twice while
building the 802.11 header for a given frame if the frame will
actually be transmitted to the station we initially looked up.
This happens for 4-addr VLAN interfaces and TDLS connections, which
both directly send the frame to the station they looked up, though
in the case of TDLS some station conditions need to be checked.
To avoid that, add a variable indicating that we've looked up the
station that the frame is going to be transmitted to, and avoid the
lookup/flag checking if it already has been done.
In the TDLS case, also move the authorized/wme_sta flag assignment
to the correct place, i.e. only when that station is really used.
Before this change, the new lookup should always have succeeded so
that the potentially erroneous data would be overwritten.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 20 Mar 2015 10:37:36 +0000 (11:37 +0100)]
mac80211: remove drop_unencrypted code
This mechanism was historic, and only ever used by IBSS, which
also doesn't need to have it as it properly manages station's
802.1X PAE state (or, with WEP, always has a key.)
Remove the mechanism to clean up the code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Michal Kazior [Wed, 11 Mar 2015 13:37:11 +0000 (14:37 +0100)]
ath10k: protect driver from unsolicited htc ep0 events
Some firmware revisions (tested with qca6174
rm2.0-00088) deliver unsolicited unknown (kind of
garbled) HTC ep0 event to host in some cases.
This issue was mainly observed with both qca988x
and qca6174 being installed on a single host
system. During driver probing if qca6174 booting
sequences were somehow deferred (e.g. by qca988x
implicitly making some resources busy presumably)
the unsolicited event would came around 1s after
ATH10K_HTC_MSG_READY_ID was delivered to host for
qca6174.
The unsolicited event would confuse driver and
cause HTT initialization (and subsequently
driver probing) to fail.
Make the ep0 event processing more robust. The
event will still be caught but instead will
only generate a warning now.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 11 Mar 2015 13:25:26 +0000 (14:25 +0100)]
ath10k: strip qos data bit always
NativeWifi tx mode expects QoS Data frames to be
delivered as Data frames with QoS part (e.g. tid)
being delievered out-of-band in fw tx command.
The QoS bit wasn't stripped before submitting to
firmware.
Stripping fixes two known problems:
* qca6174 IOT with some APs, e.g.
Cisco AIR-AP 1252 (which would crash after
ath10k association). Some ath9k APs would
crash as well.
* sniffing own tx frames via radiotap because,
e.g. wireshark was seeing QoS bit set but
since QoS Control was stripped in ath10k it
would parse beginning of LLC/SNAP
>From debugability point of view this removes the
ability to distinguish QoS from non-QoS frames
when sniffing own tx via radiotap. On the other
hand frames can be now parsed correctly without
special software modification.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Cedric Izoard [Tue, 17 Mar 2015 10:47:33 +0000 (10:47 +0000)]
mac80211: Get IV len from key conf and not cipher scheme
When a key is installed using a cipher scheme, set a new
internal key flag (KEY_FLAG_CIPHER_SCHEME) on it, to allow
distinguishing such keys more easily.
In particular, use this flag on the TX path instead of
testing the sta->cipher_scheme pointer, as the station is
NULL for broad-/multicast message, and use the key's iv_len
instead of the cipher scheme information.
Felix Fietkau [Fri, 13 Mar 2015 09:54:44 +0000 (10:54 +0100)]
mac80211: minstrel_ht: fix rounding issue in MCS duration calculation
On very high MCS bitrates, the calculated duration of rates that are
next to each other can be very imprecise, due to the small packet size
used as reference (1200 bytes).
This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the
same throughput when the probability is also the same. This leads to a
bad rate selection for such rates.
Fix this issue by introducing an average A-MPDU size factor into the
calculation.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ben [Thu, 12 Mar 2015 13:37:34 +0000 (09:37 -0400)]
cfg80211: Process all pending regulatory requests/hints
It is possible that there are several regulatory requests
pending, but the processing of the last one does not call
CRDA, and thus the other requests are not handled.
Fix this by rescheduling the work until all requests have
been processed.
Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com> Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Marek Puzyniak [Sun, 8 Mar 2015 16:04:22 +0000 (18:04 +0200)]
mac80211: initialize rate control earlier for tdls station
Currently when TDLS station in driver goes from authenticated
to associated state it can not use rate control parameters
because rate control is not initialized yet. Some drivers
require parameters already initialized by rate control when
entering associated state. It can be done by initializing
rate control after station transition to associated state but
before notifying driver about that.
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
[fix comment to say 'associated' instead of 'authorized'] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Michal Kazior [Tue, 10 Mar 2015 14:22:01 +0000 (16:22 +0200)]
ath10k: add hw connection monitor support
Some firmware revisions (e.g. qca6174 with fw73)
don't deliver beacons to host reliably. This
causes random disconnects even in perfect
conditions. This is most visible with
multi-channel operation.
All available firmware revisions seem to support
beacon miss offloading so there shouldn't be any
problems.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 9 Mar 2015 13:24:17 +0000 (14:24 +0100)]
ath10k: fix WPA crypto
Commit 370e567363e6 ("ath10k: fix broken traffic for 802.1x in client mode")
introduced a regression on WPA crypto. All keys were treated as if they were
WEP which resulted in WPA being incorrectly installed to fw/hw and subsequently
no traffic.
Reported-by: Marek Puzyniak <marek.puzyniak@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 9 Mar 2015 13:20:55 +0000 (14:20 +0100)]
ath10k: fix CAC regression
Commit 548462133d98 ("ath10k: fix interrupt storm") introduced a
regression. The condition responsible for bringing up monitor vdev was broken
and it was never started for CAC so effectivelly CAC would not detect radar
pulses.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 2 Mar 2015 12:22:14 +0000 (13:22 +0100)]
ath10k: save/restore pci config space properly
The check was't really necessary and couldn't even
work to begin with because pci_restore_state()
restores only first 64 bytes of PCI configuration
space.
Actually the PCI subsystem takes care of this so
there's no need for explicit calls to save PCI
state in ath10k.
This is necessary for future WoWLAN support.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 2 Mar 2015 12:22:13 +0000 (13:22 +0100)]
ath10k: fix some pci wake/sleep issues
In some cases the device ends up sleeping while
ath10k didn't expect it to leading to reading
garbage from registers, e.g. when shared irqs are
used and the driver is in powered down state.
This effectively makes the device remain awake all
the time even when all interfaces are down.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>