OSDN Git Service

uclinux-h8/linux.git
6 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 30 May 2018 19:24:44 +0000 (22:24 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 4.18. Major changes:

ath10k

* add memory dump support for QCA9888 and QCA99X0

* add support to configure channel dwell time

* support new DFS host confirmation feature in the firmware

ath

* update various regulatory mappings

wcn36xx

* various fixes to improve reliability

* add Factory Test Mode support

6 years agoqtnfmac: fix invalid STA state on EAPOL failure
Sergey Matyukevich [Tue, 29 May 2018 12:00:05 +0000 (15:00 +0300)]
qtnfmac: fix invalid STA state on EAPOL failure

Driver switches vif sta_state into QTNF_STA_CONNECTING when cfg80211
core initiates connect procedure. Further this state is changed either
to QTNF_STA_CONNECTED or to QTNF_STA_DISCONNECTED by BSS_JOIN and
BSS_LEAVE events from firmware. However it is possible that no such
events will be sent by firmware, e.g. if EAPOL timed out.

In this case vif sta_mode will remain in QTNF_STA_CONNECTING state and
all subsequent connection attempts will fail with -EBUSY error code.
Fix this by perfroming STA state transition from QTNF_STA_CONNECTING
to QTNF_STA_DISCONNECTED in cfg80211 disconnect callback.
No need to rely upon firmware events in this case.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: cancel scan on disconnect
Andrey Shevchenko [Tue, 29 May 2018 12:00:04 +0000 (15:00 +0300)]
qtnfmac: cancel scan on disconnect

Cancel scan operation on STA disconnect.

Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: fix bg_scan_period parameter processing
Andrey Shevchenko [Tue, 29 May 2018 12:00:03 +0000 (15:00 +0300)]
qtnfmac: fix bg_scan_period parameter processing

Do not process bg_scan_period parameter in qtnfmac driver.
Pass correct values as is. In the case of invalid values
pass default value. Leave further processing to firmware.

Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: fix firmware command error path
Dmitry Lebed [Tue, 29 May 2018 12:00:02 +0000 (15:00 +0300)]
qtnfmac: fix firmware command error path

Free command skb if bus state is not QTNF_FW_STATE_ACTIVE.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: improve control path timeout handling
Dmitry Lebed [Tue, 29 May 2018 12:00:01 +0000 (15:00 +0300)]
qtnfmac: improve control path timeout handling

Control path will not be operational after firmware failure. Change bus
state to QTNF_FW_STATE_EP_DEAD after the control path timeout.
Don't wait for timeout if control path is already dead.

Signed-off-by: Dmitry Lebed <dlebed@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: cleanup wdev structure between its uses
Sergey Matyukevich [Tue, 29 May 2018 12:00:00 +0000 (15:00 +0300)]
qtnfmac: cleanup wdev structure between its uses

Driver uses statically allocated wdev structures for each virtual
interface. However wdev structure is not properly cleaned up between
its uses. As a result, various bugs appear when userspace tools
like hostapd were not gracefully stopped.

In particular, this commit fixes the following issue:
- start hostapd with more than 2 mBSS
- kill hostapd using SIGKILL
- start again hostapd with more than 2 mBSS
However only two mBSS entities will be started: primary
and the last BSS listed in hostapd config.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: decode error codes from firmware replies
Igor Mitsyanko [Tue, 29 May 2018 11:59:59 +0000 (14:59 +0300)]
qtnfmac: decode error codes from firmware replies

Introduce a function that will map an error code reported in reply
to a firmware command, into one of standard errno codes.
Use additional error codes to improve error reporting
for MAC address changes.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: simplify notation
Sergey Matyukevich [Tue, 29 May 2018 11:59:58 +0000 (14:59 +0300)]
qtnfmac: simplify notation

Shorten line lengths using a more compact notation to access mac info.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: remove unused function declarations
Andrey Shevchenko [Tue, 29 May 2018 11:59:57 +0000 (14:59 +0300)]
qtnfmac: remove unused function declarations

Functions qtnf_cmd_resp_parse and qtnf_cmd_resp_check have
been removed. Remove their declarations as well.

Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoMerge tag 'iwlwifi-next-for-kalle-2018-05-30' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 30 May 2018 19:16:43 +0000 (22:16 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2018-05-30' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

Final batch of iwlwifi patches for 4.18

* Some bugzilla fixes;
* Some kernel warning fixes;
* Fix for an (ETSI) WMM limits bug;
* Fix for a Bluetooth coexistence problem on 9000 devices;
* Fix for an interoperability bug related to block-ack sessions;

6 years agoiwlwifi: fix non_shared_ant for 9000 devices
Erel Geron [Mon, 28 May 2018 14:09:30 +0000 (17:09 +0300)]
iwlwifi: fix non_shared_ant for 9000 devices

The non-shared antenna was wrong for 9000 device series.  Fix it to
ANT_B for correct antenna preference by coex in MVM driver.

Fixes: 89374fe60bfb ("iwlwifi: Add new PCI IDs for 9260 and 5165 series")
Signed-off-by: Erel Geron <erelx.geron@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: fix race in queue notification wait
Johannes Berg [Tue, 22 May 2018 13:08:32 +0000 (15:08 +0200)]
iwlwifi: mvm: fix race in queue notification wait

Initially in this code, the race didn't matter since it didn't
do anything. Latest with the commit I marked this as fixing it
started to matter as something got done here that needed other
data that got freed as soon as the queue notification wait was
returning.

In the scenario we saw, apparently the IWL_MVM_RXQ_NOTIF_DEL_BA
event was sent to all queues, but processing the last event we
returned from iwl_mvm_sync_rx_queues_internal() and then from
iwl_mvm_free_reorder() and continued some processing before
wl_mvm_del_ba() was even invoked on the other CPU. Thus, when
the latter finally ran, it found that mvm->baid_map[baid] was
no longer valid.

Correct the race by moving the counter decrement and wake_up()
to be done only after all the per-event processing completed.
Note that in the commit I marked as being fixed the wake_up()
didn't exist yet (and the code was otherwise problematic) but
this particular problem already existed in a way.

Fixes: b915c10174fb ("iwlwifi: mvm: add reorder buffer per queue")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: honor the max_amsdu_subframes limit
Emmanuel Grumbach [Thu, 17 May 2018 07:44:20 +0000 (10:44 +0300)]
iwlwifi: mvm: honor the max_amsdu_subframes limit

A peer can limit the number of subframes it can handle in a
single A-MSDU.  Honor this limit.

Note that the smallest limit is 8, and we are very unlikely to reach
that limit. So this isn't really a big deal.

Fixes: a6d5e32f247c ("iwlwifi: mvm: send large SKBs to the transport")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: open BA session only when sta is authorized
Gregory Greenman [Tue, 24 Apr 2018 03:26:41 +0000 (06:26 +0300)]
iwlwifi: mvm: open BA session only when sta is authorized

Currently, a BA session is opened when the tx traffic exceeds
10 frames per second. As a result of inter-op problems with some
APs, add a condition to open BA session only when station is
already authorized.

Fixes: 482e48440a0e ("iwlwifi: mvm: change open and close criteria of a BA session")
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: remove division by size of sizeof(struct ieee80211_wmm_rule)
Colin Ian King [Wed, 11 Apr 2018 13:05:33 +0000 (14:05 +0100)]
iwlwifi: mvm: remove division by size of sizeof(struct ieee80211_wmm_rule)

The subtraction of two struct ieee80211_wmm_rule pointers leaves a result
that is automatically scaled down by the size of the size of pointed-to
type, hence the division by sizeof(struct ieee80211_wmm_rule) is
bogus and should be removed.

Detected by CoverityScan, CID#1467777 ("Extra sizeof expression")

Fixes: 77e30e10ee28 ("iwlwifi: mvm: query regdb for wmm rule if needed")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: pcie: fix race in Rx buffer allocator
Shaul Triebitz [Thu, 22 Mar 2018 12:14:45 +0000 (14:14 +0200)]
iwlwifi: pcie: fix race in Rx buffer allocator

Make sure the rx_allocator worker is canceled before running the
rx_init routine.  rx_init frees and re-allocates all rxb's pages.  The
rx_allocator worker also allocates pages for the used rxb's.  Running
rx_init and rx_allocator simultaniously causes a kernel panic.  Fix
that by canceling the work in rx_init.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: fix TSO with highly fragmented SKBs
Emmanuel Grumbach [Sun, 8 Apr 2018 09:33:31 +0000 (12:33 +0300)]
iwlwifi: mvm: fix TSO with highly fragmented SKBs

Our hardware has a limited amount of buffer descriptors
for each Tx packet. Because of that, there is a short
piece of code that makes sure that that we don't push too
many subframes in an A-MSDU because of subframes needs 2
buffer descriptors. This code also takes into account the
number of fragment of the skb since we also need a buffer
descriptor for each fragment in the skb.

This piece of code though didn't check that the resulting
number of subframes wasn't 0.

A user reported that using NFS client, he could get skbs
that are so fragmented that the code mentioned above
returned 0 for the number of subframes making
skb_gso_segment fail and subconsequently iwlwifi would WARN.

Fix this by make sure that num_subframes is at least 1.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=199209

Fixes: a6d5e32f247c ("iwlwifi: mvm: send large SKBs to the transport")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlmvm: tdls: Check TDLS channel switch support
Aviya Erenfeld [Mon, 26 Mar 2018 11:35:32 +0000 (14:35 +0300)]
iwlmvm: tdls: Check TDLS channel switch support

Some versions of the FW don't support channel switch in TDLS.
Add a condition that checks it.

Fixes: 307e47235a10 ("iwlwifi: mvm: configure TDLS peers to FW")
Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: mvm: drop UNKNOWN security type frames
Sara Sharon [Mon, 26 Mar 2018 10:07:03 +0000 (13:07 +0300)]
iwlwifi: mvm: drop UNKNOWN security type frames

In some cases we may get from FW errored frames with
UNKNOWN security type.

This may happen in unsecured aggregation flow, where
the first packet had a CRC error in the WEP bit, which
was followed by a failure to decrypt and was dropped.

The next frames in the aggregation "inherit" the bad metadata
of the first packet.

Make sure to drop such frames since RADA and other offloads
will not operate correctly which may have unexpected results.

In case of AP it also causes to TX AMSDU frames to the peers,
resulting with assert 0x104B.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agoiwlwifi: add csr configuration for 6300 devices
Golan Ben Ami [Mon, 28 May 2018 09:15:44 +0000 (12:15 +0300)]
iwlwifi: add csr configuration for 6300 devices

Recently we have switched the csr addresses and values configuration
from a single configuration to all devices to a per-device configuration.
Doing that, the configuration for 6300 devices wasn't set.
This missing definition introduced a kernel panic once trying to access
the csr's.

Add the missing 6300 csr configuration.

While at it, add a checker that the csr values were indeed
configured, and bail out more gracefully if not.

Fixes: a8cbb46f831d ("iwlwifi: allow different csr flags for different device families")
Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
6 years agortlwifi: remove duplicate code
Gustavo A. R. Silva [Thu, 24 May 2018 18:54:50 +0000 (13:54 -0500)]
rtlwifi: remove duplicate code

Remove and refactor some code in order to avoid having identical code
for different branches.

Notice that the logic has been there since 2014.

Addresses-Coverity-ID: 1426199 ("Identical code for different branches")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: reserve passive scan time for radar channel
Xinming Hu [Tue, 29 May 2018 01:42:09 +0000 (09:42 +0800)]
mwifiex: reserve passive scan time for radar channel

Active scan is not allowed on radar channel, instead
using passvie scan with more time.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: increase log level for internal scan fail result
Xinming Hu [Tue, 29 May 2018 01:42:08 +0000 (09:42 +0800)]
mwifiex: increase log level for internal scan fail result

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: mark expected switch fall-throughs
Gustavo A. R. Silva [Fri, 25 May 2018 21:38:54 +0000 (16:38 -0500)]
mwifiex: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: skip sending GT_REKEY_OFFLOAD_CFG if firmware has no support
Ganapathi Bhat [Fri, 25 May 2018 20:39:22 +0000 (02:09 +0530)]
mwifiex: skip sending GT_REKEY_OFFLOAD_CFG if firmware has no support

If firmware does not support embedded supplicant, then it in turn
will not support GT rekey offloading. If this is the case, then
driver must not advertise WOWLAN flags related to GTK rekey and
it must also skip sending the GT_REKEY_OFFLOAD_CFG command.

Signed-off-by: Shrenik Shikhare <shrenik@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: handle race during mwifiex_usb_disconnect
Ganapathi Bhat [Thu, 24 May 2018 13:48:27 +0000 (19:18 +0530)]
mwifiex: handle race during mwifiex_usb_disconnect

Race condition is observed during rmmod of mwifiex_usb:

1. The rmmod thread will call mwifiex_usb_disconnect(), download
   SHUTDOWN command and do wait_event_interruptible_timeout(),
   waiting for response.

2. The main thread will handle the response and will do a
   wake_up_interruptible(), unblocking rmmod thread.

3. On getting unblocked, rmmod thread  will make rx_cmd.urb = NULL in
   mwifiex_usb_free().

4. The main thread will try to resubmit rx_cmd.urb in
   mwifiex_usb_submit_rx_urb(), which is NULL.

To fix, wait for main thread to complete before calling
mwifiex_usb_free().

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agomwifiex: avoid exporting mwifiex_send_cmd
Ganapathi Bhat [Thu, 24 May 2018 11:06:28 +0000 (16:36 +0530)]
mwifiex: avoid exporting mwifiex_send_cmd

This is a follow-up patch for commit 21c5c83ce833
("mwifiex: support sysfs initiated device coredump").

Let us avoid exporting mwifiex_send_cmd and instead use a utility
function mwifiex_fw_dump_event to achive the work.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agorsi: fix spelling mistake "Uknown" -> "Unknown"
Colin Ian King [Sat, 26 May 2018 15:00:19 +0000 (16:00 +0100)]
rsi: fix spelling mistake "Uknown" -> "Unknown"

Trivial fix to spelling mistake in rsi_dbg message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowlcore: sdio: check for valid platform device data before suspend
Eyal Reizer [Mon, 28 May 2018 08:36:42 +0000 (11:36 +0300)]
wlcore: sdio: check for valid platform device data before suspend

the wl pointer can be null In case only wlcore_sdio is probed while
no WiLink module is successfully probed, as in the case of mounting a
wl12xx module while using a device tree file configured with wl18xx
related settings.
In this case the system was crashing in wl1271_suspend() as platform
device data is not set.
Make sure wl the pointer is valid before using it.

Signed-off-by: Eyal Reizer <eyalr@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoatmel: Add missing call to pci_disable_device()
YueHaibing [Wed, 23 May 2018 10:34:45 +0000 (18:34 +0800)]
atmel: Add missing call to pci_disable_device()

add pci_disable_device in error handling while init_atmel_card failed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: fix btmpinfo timeout while processing C2H_BT_INFO
Ping-Ke Shih [Fri, 18 May 2018 09:30:07 +0000 (17:30 +0800)]
rtlwifi: fix btmpinfo timeout while processing C2H_BT_INFO

In former patch, I enqueu all C2H commands and processed by a workqueue.
In case C2H_BT_INFO will issue a H2C command to set BT reg, and wait for
a C2H ack. But it is totally impossible that C2H workqueue waits for a
C2H command, so kernel log warn
rtlwifi: :<0> btmpinfo wait (req_num=0) timeout

Since the C2H ack command C2H_BT_MP can be safely processed in interrupt
context, add a fast command path to deal with the command.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: access skb->data to get C2H data by macro
Ping-Ke Shih [Fri, 18 May 2018 09:30:06 +0000 (17:30 +0800)]
rtlwifi: access skb->data to get C2H data by macro

The format of C2H data is ID(1 byte) + Length(1 byte) + value, and it is
more readable to use macros to access C2H data.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: use sk_buff to queue C2H commands
Ping-Ke Shih [Fri, 18 May 2018 09:30:05 +0000 (17:30 +0800)]
rtlwifi: use sk_buff to queue C2H commands

We use 'struct rtl_c2hcmd' to store C2H commands originally, and the code
is slightly complex to enqueue and dequeue and also wastes time to
allocate and memcpy data. Since C2H commands are asynchronous events,
they can be processed in work queue, so RX ISR enqueues C2H result in
removal of rtl_c2h_packet_handler().

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove hal_op c2h_content_parsing
Ping-Ke Shih [Fri, 18 May 2018 09:30:04 +0000 (17:30 +0800)]
rtlwifi: remove hal_op c2h_content_parsing

Similar to rx_command_packet, we can call rtl_c2h_content_parsing so the
hal_op isn't necessary.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove hal_op rx_command_packet
Ping-Ke Shih [Fri, 18 May 2018 09:30:03 +0000 (17:30 +0800)]
rtlwifi: remove hal_op rx_command_packet

Because the hal_op rx_command_packet does C2H handler if rx packet type
is C2H, and the handler have been moved to base.c so we can call the
handler directly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove duplicate C2H handler
Ping-Ke Shih [Fri, 18 May 2018 09:30:02 +0000 (17:30 +0800)]
rtlwifi: remove duplicate C2H handler

Merge duplicate C2H handler and implement the handler in base.c.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: Add hal_op c2h_ra_report_handler for special process
Ping-Ke Shih [Fri, 18 May 2018 09:30:01 +0000 (17:30 +0800)]
rtlwifi: Add hal_op c2h_ra_report_handler for special process

We're going to merge C2H handler into one, but one special case is to
handle RA_REPORT that implements in individual IC folder. So this commit
adds a hal_op for caller in common code.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove dummy hal_op rx_command_packet from rtl8188ee and rtl8723ae
Ping-Ke Shih [Fri, 18 May 2018 09:30:00 +0000 (17:30 +0800)]
rtlwifi: remove dummy hal_op rx_command_packet from rtl8188ee and rtl8723ae

The caller of hal_op rx_command_packet will assert function pointer
before calling, so we can remove dummy functions safely.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove unused fw C2H command ID
Ping-Ke Shih [Fri, 18 May 2018 09:29:59 +0000 (17:29 +0800)]
rtlwifi: remove unused fw C2H command ID

The IDs are defined by driver and map to the fw C2H IDs, but they aren't
used now result in removal.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove duplicate C2H definition
Ping-Ke Shih [Fri, 18 May 2018 09:29:58 +0000 (17:29 +0800)]
rtlwifi: remove duplicate C2H definition

Move C2H definition to wifi.h, because the definitions of 8192ee, 8723be
and 8821ae are the same.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: rename register-based C2H command IDs to V0
Ping-Ke Shih [Fri, 18 May 2018 09:29:57 +0000 (17:29 +0800)]
rtlwifi: rename register-based C2H command IDs to V0

Current chips use packet-based C2H commands whose IDs differ from old
ones, so this commit simply gives C2H_V0_ as prefix of command IDs.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove duplicate rx_packet_type definition
Ping-Ke Shih [Fri, 18 May 2018 09:29:56 +0000 (17:29 +0800)]
rtlwifi: remove duplicate rx_packet_type definition

Move duplicate definitions from def.h of ic folder to wifi.h

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: remove CONNECTION_MONITOR flag
Ping-Ke Shih [Fri, 18 May 2018 09:29:55 +0000 (17:29 +0800)]
rtlwifi: remove CONNECTION_MONITOR flag

To use keep-alive mechanism in mac80211 stack, since driver supports
reporting accurate nullfunc frame tx ack now.

Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agortlwifi: support accurate nullfunc frame tx ack report
Tzu-En Huang [Fri, 18 May 2018 09:29:54 +0000 (17:29 +0800)]
rtlwifi: support accurate nullfunc frame tx ack report

In order to realize the keep-alive mechanism in mac80211 stack, reporting
accurate tx ack status for nullfunc frame is added in this commit.

If current frame is nullfunc frame, we ask firmware to report by filling
TX report bit in TX descriptor. After this frame DMA done, TX interrupt is
triggered but TX status is unknown at this moment, so enqueue this skb
into tx_report->queue. Finally, C2H report will be received if the frame
is transmitted successfully or retried over, and then we report to mac80211
with IEEE80211_TX_STAT_ACK flag only if it's successful. Otherwise, if
failure or timeout (one second), we report to mac80211 without this flag.

Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowlcore: sdio: Fix flakey SDIO runtime PM handling
Tony Lindgren [Thu, 17 May 2018 18:29:50 +0000 (11:29 -0700)]
wlcore: sdio: Fix flakey SDIO runtime PM handling

We can have pm_runtime_get_sync() return 1, and we can have
pm_runtime_put_sync() return -EBUSY. See rpm_suspend() and
rpm_resume() for more information.

Fix the issue by returning 0 from wl12xx_sdio_power_on() on success.
And use pm_runtime_put() instead of pm_runtime_put_sync() for
wl12xx_sdio_power_off(), then the MMC subsystem will idle the bus
when suitable.

Otherwise wlcore can sometimes get confused and may report bogus
errors and WLAN connection can fail.

Note that while wlcore checks the return value for wl1271_power_on(),
the return value is ignored for wl1271_power_off(). Let's fix them
both though to avoid further confusion in the future.

Fixes: 60f36637bbbd ("wlcore: sdio: allow pm to handle sdio power")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: Add support for Factory Test Mode (FTM)
Eyal Ilsar [Tue, 22 May 2018 19:02:56 +0000 (22:02 +0300)]
wcn36xx: Add support for Factory Test Mode (FTM)

Introduce infrastructure for supporting Factory Test Mode (FTM) of the
wireless LAN subsystem. In order for the user space to access the
firmware in test mode the relevant netlink channel needs to be exposed
from the kernel driver.

The above is achieved as follows:
1) Register wcn36xx driver to testmode callback from netlink
2) Add testmode callback implementation to handle incoming FTM commands
3) Add FTM command packet structure
4) Add handling for GET_BUILD_RELEASE_NUMBER (msgid=0x32A2)
5) Add generic handling for all PTT_MSG packets

Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
Signed-off-by: Ramon Fried <ramon.fried@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath10k: DFS Host Confirmation
Sriram R [Tue, 15 May 2018 09:09:49 +0000 (14:39 +0530)]
ath10k: DFS Host Confirmation

In the 10.4-3.6 firmware branch there's a new DFS Host confirmation
feature which is advertised using WMI_SERVICE_HOST_DFS_CHECK_SUPPORT flag.

This new features enables the ath10k host to send information to the
firmware on the specifications of detected radar type. This allows the
firmware to validate if the host's radar pattern detector unit is
operational and check if the radar information shared by host matches
the radar pulses sent as phy error events from firmware. If the check
fails the firmware won't allow use of DFS channels on AP mode when using
FCC regulatory region.

Hence this patch is mandatory when using a firmware from 10.4-3.6 branch.
Else, DFS channels on FCC regions cannot be used.

Supported Chipsets : QCA9984/QCA9888/QCA4019
Firmware Version : 10.4-3.6-00104

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: add support to get the detected radar specifications
Sriram R [Tue, 15 May 2018 09:09:48 +0000 (14:39 +0530)]
ath: add support to get the detected radar specifications

This enables ath10k/ath9k drivers to collect the specifications of the
radar type once it is detected by the dfs pattern detector unit.
Usage of the collected info is specific to driver implementation.
For example, collected radar info could be used by the host driver
to send to co-processors for additional processing/validation.

Note: 'radar_detector_specs' data containing the specifications of
different radar types which was private within dfs_pattern_detector/
dfs_pri_detector is now shared with drivers as well for making use
of this information.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: improve debug and error messages for SMD
Daniel Mack [Wed, 23 May 2018 08:15:03 +0000 (11:15 +0300)]
wcn36xx: improve debug and error messages for SMD

Add a missing newline in wcn36xx_smd_send_and_wait() and also log the
command request and response type that was processed.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: simplify wcn36xx_smd_open()
Daniel Mack [Wed, 23 May 2018 08:14:59 +0000 (11:14 +0300)]
wcn36xx: simplify wcn36xx_smd_open()

Drop the extra warning about failed allocations, both the core and the
only caller of this function will warn loud enough in such cases.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: drain pending indicator messages on shutdown
Daniel Mack [Wed, 23 May 2018 08:14:55 +0000 (11:14 +0300)]
wcn36xx: drain pending indicator messages on shutdown

When the interface is shut down, wcn36xx_smd_close() potentially races
against the queue worker. Make sure to cancel the work, and then free all
the remnants in hal_ind_queue manually.

This is again just a theoretical issue, not something that was triggered in
the wild.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: set PREASSOC and IDLE stated when BSS info changes
Daniel Mack [Wed, 23 May 2018 08:14:50 +0000 (11:14 +0300)]
wcn36xx: set PREASSOC and IDLE stated when BSS info changes

When a BSSID is joined, set the link status to 'preassoc', and set it to
'idle' when the BSS is deleted.

This is what the downstream driver is doing, and it seems to improve the
reliability during connect/disconnect stress tests.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: consider CTRL_EOP bit when looking for valid descriptors
Daniel Mack [Wed, 23 May 2018 08:14:44 +0000 (11:14 +0300)]
wcn36xx: consider CTRL_EOP bit when looking for valid descriptors

In reap_tx_dxes(), when we iterate over the linked descriptors, only
consider such valid that have WCN36xx_DXE_CTRL_EOP set.

This is what the prima downstream driver is doing as well.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: only handle packets when ED or DONE bit is set
Daniel Mack [Wed, 23 May 2018 08:14:40 +0000 (11:14 +0300)]
wcn36xx: only handle packets when ED or DONE bit is set

On RX and TX interrupts, check for the WCN36XX_CH_STAT_INT_ED_MASK or
WCN36XX_CH_STAT_INT_DONE_MASK in the interrupt reason register, and
only handle packets when it is set. This way, reap_tx_dxes() is only
invoked when needed.

This brings the dequeing logic in line with what the prima downstream
driver is doing.

While at it, also log the interrupt reason.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: clear all masks in RX interrupt
Daniel Mack [Wed, 23 May 2018 08:14:35 +0000 (11:14 +0300)]
wcn36xx: clear all masks in RX interrupt

Like on the TX side, check for the interrupt reason when the RX interrupt
is latched and clear the ERR, DONE and ED masks.

This seems to help with connection timeouts and network stream
starvatations. And FWIW, the downstream driver does the same thing.

Note that in analogy to the TX side, WCN36XX_DXE_0_INT_CLR should be set to
WCN36XX_INT_MASK_CHAN_RX_{L,H} rather than WCN36XX_DXE_INT_CH{1,3}_MASK. It
did the right thing however, as the defines happen to have identical values.

Also, instead of determining register addresses and values inside
wcn36xx_rx_handle_packets(), pass them as arguments.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: don't disable RX IRQ from handler
Daniel Mack [Wed, 23 May 2018 08:14:30 +0000 (11:14 +0300)]
wcn36xx: don't disable RX IRQ from handler

There's no need to disable the IRQ from inside its handler.
Instead just grab the spinlock of the channel that is being processed.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: set DMA mask explicitly
Daniel Mack [Wed, 23 May 2018 08:14:26 +0000 (11:14 +0300)]
wcn36xx: set DMA mask explicitly

The device takes 32-bit addresses only, so inform the DMA API about it.
This is the default on msm8016, so that doesn't change anything, but
it's best practice to be explicit.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowcn36xx: fix buffer commit logic on TX path
Daniel Mack [Wed, 23 May 2018 08:14:22 +0000 (11:14 +0300)]
wcn36xx: fix buffer commit logic on TX path

When wcn36xx_dxe_tx_frame() is entered while the device is still processing
the queue asyncronously, we are racing against the firmware code with
updates to the buffer descriptors. Presumably, the firmware scans the ring
buffer that holds the descriptors and scans for a valid control descriptor,
and then assumes that the next descriptor contains the payload. If, however,
the control descriptor is marked valid, but the payload descriptor isn't,
the packet is not sent out.

Another issue with the current code is that is lacks memory barriers before
descriptors are marked valid. This is important because the CPU may reorder
writes to memory, even if it is allocated as coherent DMA area, and hence
the device may see incompletely written data.

To fix this, the code in wcn36xx_dxe_tx_frame() was restructured a bit so
that the payload descriptor is made valid before the control descriptor.
Memory barriers are added to ensure coherency of shared memory areas.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath10k: remove useless test before clk_disable_unprepare
YueHaibing [Wed, 23 May 2018 08:14:17 +0000 (11:14 +0300)]
ath10k: remove useless test before clk_disable_unprepare

clk_disable_unprepare() already checks that the clock pointer is valid.
No need to test it before calling it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Zimbabwe to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:14:11 +0000 (11:14 +0300)]
ath: Map Zimbabwe to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Ukraine to ETSI9_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:52 +0000 (11:13 +0300)]
ath: Map Ukraine to ETSI9_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Singapore to FCC3_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:43 +0000 (11:13 +0300)]
ath: Map Singapore to FCC3_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: ETSI -> FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Russia to ETSI8_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:30 +0000 (11:13 +0300)]
ath: Map Russia to ETSI8_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Romania to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:22 +0000 (11:13 +0300)]
ath: Map Romania to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Philippines to FCC3_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:15 +0000 (11:13 +0300)]
ath: Map Philippines to FCC3_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Peru to APL1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:13:08 +0000 (11:13 +0300)]
ath: Map Peru to APL1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map New Zealand to FCC3_ETSIC
Sven Eckelmann [Wed, 23 May 2018 08:13:05 +0000 (11:13 +0300)]
ath: Map New Zealand to FCC3_ETSIC

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Malasia to FCC1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:56 +0000 (11:12 +0300)]
ath: Map Malasia to FCC1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: ETSI -> FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Macedonia to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:50 +0000 (11:12 +0300)]
ath: Map Macedonia to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Isreal to ETSI3_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:32 +0000 (11:12 +0300)]
ath: Map Isreal to ETSI3_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Honduras to FCC3_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:17 +0000 (11:12 +0300)]
ath: Map Honduras to FCC3_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Czech to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:15 +0000 (11:12 +0300)]
ath: Map Czech to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Colombia to FCC1_FCCA
Sven Eckelmann [Wed, 23 May 2018 08:12:11 +0000 (11:12 +0300)]
ath: Map Colombia to FCC1_FCCA

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Bulgaria to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:05 +0000 (11:12 +0300)]
ath: Map Bulgaria to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Brunei Darussalam to APL6_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:12:01 +0000 (11:12 +0300)]
ath: Map Brunei Darussalam to APL6_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: FCC -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Bangladesh to APL1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:55 +0000 (11:11 +0300)]
ath: Map Bangladesh to APL1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Australia to FCC3_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:49 +0000 (11:11 +0300)]
ath: Map Australia to FCC3_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

This change itself doesn't change the selected CTL of this country and is
only required to stay in sync with the QCA mappings.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Algeria to APL13_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:45 +0000 (11:11 +0300)]
ath: Map Algeria to APL13_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Map Albania to ETSI1_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:36 +0000 (11:11 +0300)]
ath: Map Albania to ETSI1_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't correctly
mapped to the actual CTL entries in EEPROM then it could happen that the
device violates the regulations. But it can also happen that the device is
then not able to be used with its full txpower on all rates.

The CTL mappings for this regdomain code were now changed to:

* 2.4GHz: ETSI
* 5GHz: NO_CTL -> ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for FCC3_ETSIC
Sven Eckelmann [Wed, 23 May 2018 08:11:30 +0000 (11:11 +0300)]
ath: Add regulatory mapping for FCC3_ETSIC

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't available and
it is still programmed in the EEPROM then it will cause an error and stop
the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this regdomain code are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for ETSI9_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:24 +0000 (11:11 +0300)]
ath: Add regulatory mapping for ETSI9_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't available and
it is still programmed in the EEPROM then it will cause an error and stop
the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this regdomain code are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for ETSI8_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:18 +0000 (11:11 +0300)]
ath: Add regulatory mapping for ETSI8_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't available and
it is still programmed in the EEPROM then it will cause an error and stop
the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this regdomain code are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for APL13_WORLD
Sven Eckelmann [Wed, 23 May 2018 08:11:14 +0000 (11:11 +0300)]
ath: Add regulatory mapping for APL13_WORLD

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't available and
it is still programmed in the EEPROM then it will cause an error and stop
the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this regdomain code are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for APL2_FCCA
Sven Eckelmann [Wed, 23 May 2018 08:11:05 +0000 (11:11 +0300)]
ath: Add regulatory mapping for APL2_FCCA

The regdomain code is used to select the correct the correct conformance
test limits (CTL) for a country. If the regdomain code isn't available and
it is still programmed in the EEPROM then it will cause an error and stop
the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this regdomain code are:

* 2.4GHz: FCC
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Uganda
Sven Eckelmann [Wed, 23 May 2018 08:10:54 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Uganda

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Tanzania
Sven Eckelmann [Wed, 23 May 2018 08:10:48 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Tanzania

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Serbia
Sven Eckelmann [Wed, 23 May 2018 08:10:43 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Serbia

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Paraguya
Sven Eckelmann [Wed, 23 May 2018 08:10:29 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Paraguya

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Nicaragua
Sven Eckelmann [Wed, 23 May 2018 08:10:26 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Nicaragua

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: FCC
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Montenegro
Sven Eckelmann [Wed, 23 May 2018 08:10:22 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Montenegro

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Mauritius
Sven Eckelmann [Wed, 23 May 2018 08:10:19 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Mauritius

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: ETSI

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Kenya
Sven Eckelmann [Wed, 23 May 2018 08:10:12 +0000 (11:10 +0300)]
ath: Add regulatory mapping for Kenya

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Bermuda
Sven Eckelmann [Wed, 23 May 2018 08:09:59 +0000 (11:09 +0300)]
ath: Add regulatory mapping for Bermuda

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: FCC
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath: Add regulatory mapping for Bahamas
Sven Eckelmann [Wed, 23 May 2018 08:09:53 +0000 (11:09 +0300)]
ath: Add regulatory mapping for Bahamas

The country code is used by the ath to detect the ISO 3166-1 alpha-2 name
and to select the correct conformance test limits (CTL) for a country. If
the country isn't available and it is still programmed in the EEPROM then
it will cause an error and stop the initialization with:

  Invalid EEPROM contents

The current CTL mappings for this country are:

* 2.4GHz: ETSI
* 5GHz: FCC

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath10k: add support to configure channel dwell time
Pradeep Kumar Chitrapu [Wed, 23 May 2018 08:09:09 +0000 (11:09 +0300)]
ath10k: add support to configure channel dwell time

Configure channel dwell time from duration of the scan request
received from mac80211 when the duration is non-zero. When the
scan request does not have duration value, use the default ones,
the current implementation.

Corresponding flag NL80211_EXT_FEATURE_SET_SCAN_DWELL is
advertized.

Supported Chipsets:
 -QCA988X/QCA9887 PCI
 -QCA99X0/QCA9984/QCA9888/QCA4019 PCI
 -QCA6174/QCA9377 PCI/USB/SDIO
 -WCN3990 SNOC

Tested on QCA9984 with firmware ver 10.4-3.6-0010

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoath10k: add memory dump support for QCA9888 and QCA99X0
Anilkumar Kolli [Wed, 23 May 2018 08:09:02 +0000 (11:09 +0300)]
ath10k: add memory dump support for QCA9888 and QCA99X0

This patch adds firmware crash memory dump support for QCA9888 and QCA99X0.

Tested on:

QCA9888 firmware 10.4-3.5.3-00053
QCA99X0 firmware 10.4.1.00030-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agobrcmfmac: trigger memory dump on SDIO firmware halt message
Franky Lin [Wed, 16 May 2018 12:12:03 +0000 (14:12 +0200)]
brcmfmac: trigger memory dump on SDIO firmware halt message

Attempt to dump dongle memory for debug upon receiving firmware halt
message through dongle to host mail box interrupt.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agobrcmfmac: trigger memory dump upon firmware halt signal
Franky Lin [Wed, 16 May 2018 12:12:02 +0000 (14:12 +0200)]
brcmfmac: trigger memory dump upon firmware halt signal

PCIe dongle firmware signals a halt/trap through mailbox interrupt.
Trigger a memory dump upon receiving such signal could help to provide
useful information for issue debug.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agobrcmfmac: validate user provided data for memdump before copying
Franky Lin [Wed, 16 May 2018 12:12:01 +0000 (14:12 +0200)]
brcmfmac: validate user provided data for memdump before copying

In patch "brcmfmac: add support for sysfs initiated coredump", a new
scenario of brcmf_debug_create_memdump was added in which the user of
the function might not necessarily provide prefix data. Hence the
function should not assume the data is always valid and should perform a
check before copying.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>