platform/kernel/linux-rpi3.git
7 years agoiwlwifi: document transmit buffer bits better
Johannes Berg [Thu, 4 May 2017 09:01:32 +0000 (11:01 +0200)]
iwlwifi: document transmit buffer bits better

Properly document the transmit buffer bits using an enum and
kernel-doc documentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: add documentation for enum iwl_debug_cmds
Johannes Berg [Thu, 4 May 2017 08:00:03 +0000 (10:00 +0200)]
iwlwifi: mvm: add documentation for enum iwl_debug_cmds

Add kernel-doc documentation for enum iwl_debug_cmds, linking the
structures used by the commands.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: disentangle union in TX status struct
Johannes Berg [Wed, 3 May 2017 19:56:04 +0000 (21:56 +0200)]
iwlwifi: mvm: disentangle union in TX status struct

This improves documentation, since kernel-doc can't deal with the
union well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: fix fw monitor 7000 HW recollecting
Liad Kaufman [Wed, 3 May 2017 15:47:46 +0000 (18:47 +0300)]
iwlwifi: mvm: fix fw monitor 7000 HW recollecting

To stop and start the FW monitor in the 7000 HW
family we need to use a different bit, otherwise
after stopping it for the first time - it won't
get restarted. Use the correct bitmask.

Note: This fix is only for DRAM collection mode.
      For other modes, an additional fix will be
      needed.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: docs: fix enum link, provide TX response link
Johannes Berg [Tue, 2 May 2017 11:01:49 +0000 (13:01 +0200)]
iwlwifi: mvm: docs: fix enum link, provide TX response link

Fix the enum link by adding the missing & and provide the link
to the TX response documentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: fix command completion name debug
Johannes Berg [Wed, 3 May 2017 10:16:48 +0000 (12:16 +0200)]
iwlwifi: pcie: fix command completion name debug

When the command name is printed on command completion, the wrong
group is used, leading to the wrong name being printed. Fix this
by using the group ID without inappropriately mangling it through
iwl_cmd_groupid() - it's already a u8. Also, while at it, use it
from the same place as the command ID, everything else is just
confusing.

Fixes: ab02165ccec4 ("iwlwifi: add wide firmware command infrastructure for TX")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fix TX tracing for non-linear SKBs
Johannes Berg [Wed, 3 May 2017 11:04:40 +0000 (13:04 +0200)]
iwlwifi: fix TX tracing for non-linear SKBs

When sending non-linear SKBs that should be included in the regular
TX tracing completely (and not be pushed into the tx_data tracing),
the (tracing) code didn't correctly take the fact that they were
non-linear into account and added only the skb head portion.

This probably never really triggered, since those frames we want
traced fully are most likely linear anyway, but the code gets easier
to understand and we lose an argument to the tracing function, so
overall fixing this is better.

Fixes: 206eea783385 ("iwlwifi: pcie: support frag SKBs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: simplify data tracepoint
Johannes Berg [Wed, 3 May 2017 10:53:22 +0000 (12:53 +0200)]
iwlwifi: simplify data tracepoint

There's no need to calculate the data_len outside of the tracepoint,
since it's always skb->len - hdr_len, which are both available inside.
Simplify the callers and move the calculation in.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: better link scan notification results length
Johannes Berg [Wed, 26 Apr 2017 11:34:29 +0000 (13:34 +0200)]
iwlwifi: mvm: better link scan notification results length

Show the name of the member (scanned_channels) that provides the
length with some better markup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: use kstrtou32_from_user()
Johannes Berg [Tue, 25 Apr 2017 09:37:40 +0000 (11:37 +0200)]
iwlwifi: pcie: use kstrtou32_from_user()

Use kstrtou32_from_user() in debugfs instead of open-coding it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: support aggregations on A000 HW
Liad Kaufman [Wed, 5 Apr 2017 13:25:11 +0000 (16:25 +0300)]
iwlwifi: mvm: support aggregations on A000 HW

On A000 HW, the SCD rdptr has only 8 bits allocated
for it, thus when checking if a queue is full, or
when checking if the SSN is equal to the TID's
next_reclaimed, A000 HW should trim the SSN.

Fix this by "normalizing" the SSN to wrap around
0xFF when comparing to the next_reclaimed on A000
HW.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: document status bits
Johannes Berg [Tue, 25 Apr 2017 10:50:32 +0000 (12:50 +0200)]
iwlwifi: mvm: document status bits

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: remove pointless debugfs parsing for csr file
Johannes Berg [Tue, 25 Apr 2017 09:38:29 +0000 (11:38 +0200)]
iwlwifi: pcie: remove pointless debugfs parsing for csr file

We don't actually care about the value at all, just making sure
that we can successfully parse a single integer value, but that's
entirely pointless - remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: don't report RF-kill enabled while shutting down
Johannes Berg [Tue, 25 Apr 2017 11:41:20 +0000 (13:41 +0200)]
iwlwifi: pcie: don't report RF-kill enabled while shutting down

When toggling the RF-kill pin quickly in succession, the driver can
get rather confused because it might be in the process of shutting
down, expecting all commands to go through quickly due to rfkill,
but the transport already thinks the device is accessible again,
even though it previously shut it down. This leads to bugs, and I
even observed a kernel panic.

Avoid this by making the PCIe code only report that the radio is
enabled again after the higher layers actually decided to shut it
off.

This also pulls out this common RF-kill checking code into a common
function called by both transport generations and also moves it to
the direct method - in the internal helper we don't really care
about the RF-kill status anymore since we won't report it up until
the stop anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: don't warn in queue sync on RF-kill
Johannes Berg [Tue, 25 Apr 2017 08:21:18 +0000 (10:21 +0200)]
iwlwifi: mvm: don't warn in queue sync on RF-kill

If we happen to be in or get into the queue sync when RF-kill
is asserted, we return from there and warn since there are
still queue sync notifications outstanding. These can't ever
come though, because we're in RF-kill, so don't WARN then.

While at it, also move the warning to the appropriate place,
if the request is not synchronous then we shouldn't warn, but
currently always will.

To make it fast, also trigger the waitq when on rfkill assert.

Fixes: 0636b938214c ("iwlwifi: mvm: implement driver RX queues sync command")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: add fake RF-kill to debugfs
Johannes Berg [Tue, 25 Apr 2017 07:58:25 +0000 (09:58 +0200)]
iwlwifi: pcie: add fake RF-kill to debugfs

In order to debug "hardware" RF-kill flows, add a low-level hook to
allow changing the "hardware" RF-kill from debugfs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: pull out common rfkill IRQ handling code
Johannes Berg [Tue, 25 Apr 2017 07:55:36 +0000 (09:55 +0200)]
iwlwifi: pcie: pull out common rfkill IRQ handling code

There's no point in duplicating exactly the same code here
for legacy and MSI-X interrupts, so pull it out into a new
function to call in both places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: rs: add logs for the wrong antenna case
Gregory Greenman [Mon, 24 Apr 2017 06:24:37 +0000 (09:24 +0300)]
iwlwifi: mvm: rs: add logs for the wrong antenna case

In case that rate's antenna is wrong at the init stage, it's
very hard to say what went wrong. Add debug data to the already
existing WARN_ON_ONCE.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: make iwl_mvm_update_mcc() easier to follow
Johannes Berg [Wed, 19 Apr 2017 08:17:57 +0000 (10:17 +0200)]
iwlwifi: mvm: make iwl_mvm_update_mcc() easier to follow

Some static checkers (e.g. smatch) complain about the logic, saying that
resp_cp might be leaked. Clearly that isn't true, but making the logic
easier to follow does not result in any significant code changes and makes
the code more readable by moving the NULL check closer to its source.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: change the firmware name loading
Mordechai Goodstein [Thu, 30 Mar 2017 11:43:15 +0000 (14:43 +0300)]
iwlwifi: mvm: change the firmware name loading

The firmware moved the development from a0 MAC to z0.
z0 is using the same RFID and device ID as a0 so we only
need to switch the name.

Signed-off-by: Mordechai Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: support D0I3_END_CMD at the start of resume
Luca Coelho [Wed, 12 Apr 2017 13:33:41 +0000 (16:33 +0300)]
iwlwifi: mvm: support D0I3_END_CMD at the start of resume

New FW versions require the D0I3_END_CMD to be sent as the first
command to the FW in the resume flow.  If the TLV is set, send that
command first, otherwise keep the original behavior (i.e. send last).

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: make D0I3_END_CMD sync during system resume
Luca Coelho [Wed, 12 Apr 2017 09:42:12 +0000 (12:42 +0300)]
iwlwifi: mvm: make D0I3_END_CMD sync during system resume

There is no need to send D0I3_END_CMD as ASYNC during the system
resume flow.  Additionally, the other flags used are meaningless in
this case (they were just copied from the runtime resume flow), so
remove them all.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: track and report IBSS manager status to mac80211
Johannes Berg [Thu, 20 Apr 2017 08:29:03 +0000 (10:29 +0200)]
iwlwifi: mvm: track and report IBSS manager status to mac80211

Shaul reported that when iwlmvm was sending beacons, it didn't properly
also take ownership of the probe responses. This is because the whole
mac80211 callback (tx_last_beacon) wasn't implemented. Fix that to make
IBSS discovery work better.

Reported-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: use bitfield.h for some registers
Johannes Berg [Thu, 9 Mar 2017 10:22:54 +0000 (11:22 +0100)]
iwlwifi: use bitfield.h for some registers

Letting the preprocessor/compiler generate the shift/mask by itself
is a win for readability, so use bitfield.h for some registers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: use scnprintf() instead of snprintf()
Johannes Berg [Wed, 19 Apr 2017 07:58:50 +0000 (09:58 +0200)]
iwlwifi: mvm: use scnprintf() instead of snprintf()

It's safer to use scnprintf() here because the buffer might
be too short for the full format strings. In most cases
this isn't true because of external limits on the values.

In one case, this fixes a stack data leak.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: avoid variable shadowing
Johannes Berg [Wed, 19 Apr 2017 09:14:28 +0000 (11:14 +0200)]
iwlwifi: mvm: avoid variable shadowing

Avoid one kind of symbol shadowing another in iwl_mvm_flush_sta()
by renaming the function parameter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: fix TVQM queue ID range check
Johannes Berg [Wed, 19 Apr 2017 08:29:06 +0000 (10:29 +0200)]
iwlwifi: pcie: fix TVQM queue ID range check

The queue ID should never be 512 either, so correct the check
to be >= instead of just >.

Fixes: 310181ec34e2 ("iwlwifi: move to TVQM mode")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove pointless num_stored condition
Johannes Berg [Wed, 19 Apr 2017 07:45:18 +0000 (09:45 +0200)]
iwlwifi: mvm: remove pointless num_stored condition

Since we exit if buf->num_stored is 0, there's no need to
check it again later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: avoid unnecessary cache trashing in Tx path
Emmanuel Grumbach [Thu, 30 Mar 2017 20:08:03 +0000 (23:08 +0300)]
iwlwifi: mvm: avoid unnecessary cache trashing in Tx path

When sending a Tx Command with a Tx packet, we allocate the
Tx command separately from the payload of the packet.
The WiFi MAC header is then copied into the buffer that was
allocated for the Tx Command. This means that this buffer
needs to be big enough to contain both. This is why it is
allocated with iwl_trans_alloc_tx_cmd which returns a
pointer to a newly allocated not zeroed struct
iwl_device_cmd.

The Tx command has a few bit fields and hence it needs to
be zeroed, but all the rest of the buffer doesn't need to
be zeroed since it will either be memcopy'ed with the MAC
header, or not even sent to the device.
This means that we don't need to zero all the
iwl_device_cmd structure, but rather only the size of
the iwl_tx_cmd structure.

Since sizeof(iwl_tx_cmd) - sizeof(iwl_tx_cmd) is about
260 bytes, this can avoid touching 4 cache lines for each
packet.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: Enable security on new TX API
David Spinadel [Thu, 30 Mar 2017 16:43:53 +0000 (19:43 +0300)]
iwlwifi: mvm: Enable security on new TX API

Install GTKs on AP side for new TX API.
Don't add IV space, it's added by the HW.

While at that fix GCMP abnd GCMP-256 GTK installation
which work similarly to the new TX API.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: disable dbg data collect when fw isn't alive
Liad Kaufman [Thu, 23 Mar 2017 09:08:59 +0000 (11:08 +0200)]
iwlwifi: mvm: disable dbg data collect when fw isn't alive

If FW isn't alive, trying to collect debug data will
result in errors both in driver and in the collected
data, so just warn and leave the collecting function
in this case.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: remove resp_pkt NULL checks
Johannes Berg [Mon, 10 Apr 2017 08:32:58 +0000 (10:32 +0200)]
iwlwifi: remove resp_pkt NULL checks

Contrary to what some of the comments say, if rfkill was
asserted the transport will return -ERFKILL instead of
success, if CMD_WANT_SKB was set, so it's not necessary
to check cmd.resp_pkt for being NULL if the return code
was success.

Validate that this is true in iwl_trans_send_cmd().

Most of the other code modifications were done with the
following spatch:
    @@
    struct iwl_host_cmd cmd;
    identifier pkt;
    @@
    <...
    (
    pkt = cmd.resp_pkt;
    ...
    -if (!pkt) { ... }
    |
    pkt = cmd.resp_pkt;
    ...
    -if (WARN_ON(!pkt)) { ... }
    |
    -if (!cmd.resp_pkt) { ... }
    )
    ...>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove txq EMPTYING_DELBA state for DQA
Liad Kaufman [Wed, 5 Apr 2017 07:35:18 +0000 (10:35 +0300)]
iwlwifi: mvm: remove txq EMPTYING_DELBA state for DQA

In DQA mode, there is no need to wait for the TXQ to
clear out after getting a DELBA, since traffic can
continue running on the queue.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Thu, 22 Jun 2017 13:29:52 +0000 (16:29 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 4.13. Major changes:

wil6210

* add low level RF sector interface via nl80211 vendor commands

* add module parameter ftm_mode to load separate firmware for factory
  testing

* support devices with different PCIe bar size

* add support for PCIe D3hot in system suspend

* remove ioctl interface which should not be in a wireless driver

ath10k

* go back to using dma_alloc_coherent() for firmware scratch memory

* add per chain RSSI reporting

7 years agobrcmfmac: initialize oob irq data before request_irq()
Michał Mirosław [Tue, 13 Jun 2017 16:02:03 +0000 (18:02 +0200)]
brcmfmac: initialize oob irq data before request_irq()

This fixes spin-forever in irq handler when IRQ is already asserted
at request_irq() time.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoexist control to enter/leave LPS
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:49 +0000 (11:12 -0500)]
rtlwifi: btcoexist control to enter/leave LPS

To yield better user experience, have btcoex control LPS's parameters.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: add btc_is_bt_lps_on() for btcoexist
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:48 +0000 (11:12 -0500)]
rtlwifi: add btc_is_bt_lps_on() for btcoexist

If LPS is controlled by btcoex, this function tell driver LPS is on or off.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: Add rx ampdu cfg for btcoexist.
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:47 +0000 (11:12 -0500)]
rtlwifi: Add rx ampdu cfg for btcoexist.

If RX ampdu is too long, BT will have less time.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: Add btcoex record_pwr_mode
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:46 +0000 (11:12 -0500)]
rtlwifi: Add btcoex record_pwr_mode

Add btcoex record pwr mode to control LPS's parameters and share time
with BT.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: Revise special packet notification to be readable format.
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:45 +0000 (11:12 -0500)]
rtlwifi: Revise special packet notification to be readable format.

We extend types of special packets to a enumeration from boolean value.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: Add TX report and disable key to force wait until report acked.
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:44 +0000 (11:12 -0500)]
rtlwifi: Add TX report and disable key to force wait until report acked.

When using EAPOL to do a PTK rekey, there is a possible race condition.
When msg 3/4 is received, the supplicant will send msg 4/4 and install
the new key immediately; however, the driver must make sure that msg 4/4
is sent before installing the new key. We use TX report to ensure it is
sent.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: extend debug_comp to u64
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:43 +0000 (11:12 -0500)]
rtlwifi: extend debug_comp to u64

The number of debugging conditions now exceeds the capabilities of a
32-bit word.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: Correct power save capability while init mac80211
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:42 +0000 (11:12 -0500)]
rtlwifi: Correct power save capability while init mac80211

Since the driver itself will enter power saving mode dynamically
according to the traffic, we set hw capability SUPPORTS_PS and
SUPPORTS_DYNAMIC_PS in case of fwctrl_lps.

The process IEEE80211_CONF_CHANGE_PS in op_config is used by
SW-LPS only, so we add constraints to avoid errors.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: vincent_fann <vincent_fann@realtek.com>
Signed-off-by: shaofu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: rtl8723be: fix ant_sel not work
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:41 +0000 (11:12 -0500)]
rtlwifi: btcoex: rtl8723be: fix ant_sel not work

To make ant_sel work, we should call power_on_setting to set antenna
correctly.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: set correct interface type and parameter.
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:40 +0000 (11:12 -0500)]
rtlwifi: btcoex: set correct interface type and parameter.

This commit fixies two problems. The first one is interface types
(e.g. PCI) that are used to switch antenna, and the second is to add
wifi_only parameter to give correct state.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: call bind to setup btcoex
Ping-Ke Shih [Sun, 18 Jun 2017 16:12:39 +0000 (11:12 -0500)]
rtlwifi: btcoex: call bind to setup btcoex

New btcoex add a function 'bind' to connect adapter, so we should call
it during initializing.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: add tx frame for common device configuration
Prameela Rani Garnepudi [Fri, 16 Jun 2017 14:42:05 +0000 (20:12 +0530)]
rsi: add tx frame for common device configuration

After successful loading of firmware, a CARD READY indication is
received by host. Common device configuration parameters are sent
to the device after this. It includes information like device
operating mode (Wi-Fi alone or BT coex), power save related
parameters, GPIO information etc. As device supports BT coex,
this frame is send in COEX queue initially. Based on the operating
mode, CARD READY indication is received from each protocol module
in firmware i.e. WLAN, BT.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: configure new boot parameters to device
Prameela Rani Garnepudi [Fri, 16 Jun 2017 14:35:40 +0000 (20:05 +0530)]
rsi: configure new boot parameters to device

Boot parameters are changed in new firmware. Also three
new sdio sleep parameters are added for ultra low power
save.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: receive path enhancement for RS9113
Prameela Rani Garnepudi [Fri, 16 Jun 2017 14:35:39 +0000 (20:05 +0530)]
rsi: receive path enhancement for RS9113

RS9113 chipset supports Coex feature. Initial frame exchanges during
device initialization happens on coex queue. This patch adds the
handling for coex queue.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: Register interrupt handler before firmware load
Prameela Rani Garnepudi [Fri, 16 Jun 2017 14:35:38 +0000 (20:05 +0530)]
rsi: Register interrupt handler before firmware load

Before firmware load, sometimes false interrupts are received.
System hang is observed if interrupt handler is not registered
to receive these interrupts. Hence interrupt handler registration
is moved before firmware load. We will drop these false interrupts
as these are not from the device.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: use enum for FSM states
Amitkumar Karwar [Fri, 16 Jun 2017 14:35:37 +0000 (20:05 +0530)]
rsi: use enum for FSM states

Currently macros are used for FSM states. We will replace
it with enum so that new state can be added easily without
worrying about macro value.

Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: add usb RS9113 chipset support
Prameela Rani Garnepudi [Fri, 16 Jun 2017 14:35:36 +0000 (20:05 +0530)]
rsi: add usb RS9113 chipset support

usb device id and vendor id for RS9113 chipset are included.
So it can be used through usb interface.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: debugfs: remove redunant check of mwifiex_dfs_dir
Shawn Lin [Thu, 15 Jun 2017 08:59:25 +0000 (16:59 +0800)]
mwifiex: debugfs: remove redunant check of mwifiex_dfs_dir

debugfs_remove already check mwifiex_dfs_dir, so remove it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: fixes the unexpected be printed log by default
Caesar Wang [Wed, 14 Jun 2017 11:06:56 +0000 (19:06 +0800)]
mwifiex: fixes the unexpected be printed log by default

This patch uses WARN level is not printed by default.

In some cases, some boards have always met the unused log be printed as
follows.
...
[23193.523182] mwifiex_pcie 0000:01:00.0: mwifiex_get_cfp:
cannot find cfp by band 2    & channel=13 freq=0
[23378.633684] mwifiex_pcie 0000:01:00.0: mwifiex_get_cfp:
cannot find cfp by band 2    & channel=13 freq=0

Due to we used the wifi default area was US and didn't support 12~14
channels. As Frequencies:
* 2412 MHz [1] (30.0 dBm)
* 2417 MHz [2] (30.0 dBm)
* 2422 MHz [3] (30.0 dBm)
* 2427 MHz [4] (30.0 dBm)
* 2432 MHz [5] (30.0 dBm)
* 2437 MHz [6] (30.0 dBm)
* 2442 MHz [7] (30.0 dBm)
* 2447 MHz [8] (30.0 dBm)
* 2452 MHz [9] (30.0 dBm)
* 2457 MHz [10] (30.0 dBm)
* 2462 MHz [11] (30.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)

Also, as the commit 1b499cb72f26b
("mwifiex: disable channel filtering feature in firmware"), it proved to
be a feature to get better scan result from overlapping channel.

Even there could be AP from overlapping channel (might be 12/13/14
in this case), it will be filtered depend on reg domain rules.
e.g:
...
if (ch->flags & IEEE80211_CHAN_DISABLED)
        continue;

So it should not been an ERROR, use the WARN level to instead it for now.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Acked-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: fix REG_USTIME_TSF register definition
Kevin Lo [Fri, 19 May 2017 15:02:40 +0000 (23:02 +0800)]
rtlwifi: fix REG_USTIME_TSF register definition

The REG_USTIME_TSF (US Time Tuning for TSF) definition of Realtek chips
should be 0x55C.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agobrcmfmac: Use separate firmware for revision 0 of the brcm43430 chip
Hans de Goede [Fri, 16 Jun 2017 13:14:49 +0000 (15:14 +0200)]
brcmfmac: Use separate firmware for revision 0 of the brcm43430 chip

The brcm43430 chip needs different firmware files for chip revision 0
and 1. The file currently in linux-firmware is for revision 1 only.

This commit makes brcmfmac request brcmfmac43430a0-sdio.bin instead
of brcmfmac43430-sdio.bin for revision 0 chips.

Note that the behavior for revision 1 chips is not changed, ideally those
would load brcmfmac43430a1-sdio.bin, but that will break existing setups.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agowil6210: remove ioctl interface
Maya Erez [Fri, 16 Jun 2017 07:38:05 +0000 (10:38 +0300)]
wil6210: remove ioctl interface

Wireless drivers should not be using ioctl interface,
hence remove this interface for wil6210 driver.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agowil6210: add support for PCIe D3hot in system suspend
Maya Erez [Fri, 16 Jun 2017 07:38:04 +0000 (10:38 +0300)]
wil6210: add support for PCIe D3hot in system suspend

In order to preserve the connection in suspend/resume flow,
wil6210 host allows going to PCIe D3hot state in suspend,
instead of performing a full wil6210 device reset. This
requires the platform ability to initiate wakeup in case of
RX data. To check that, a new platform API is added.
In addition, add cfg80211 suspend/resume callbacks
implementation.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agowil6210: prevent platform callbacks after uninit
Dedy Lansky [Fri, 16 Jun 2017 07:38:03 +0000 (10:38 +0300)]
wil6210: prevent platform callbacks after uninit

After calling platform_ops.uninit() it is still possible to invoke
platform callbacks.
To prevent this, zero platform_ops right after invoking uninit.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: set rxnss_override for QCA9888
Sven Eckelmann [Fri, 16 Jun 2017 07:37:46 +0000 (10:37 +0300)]
ath10k: set rxnss_override for QCA9888

QCA9888 supports VHT80 with 2x2. But it only support 1x1 with VHT160 or
VHT80+80. Inform userspace and the the QCA firmware about that limitation
whenever VHT80+80 or VHT160 is configured.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
[kvalo@qca.qualcomm.com: use hw_params]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: configure rxnss_override for QCA9984
Ben Greear [Fri, 16 Jun 2017 07:37:45 +0000 (10:37 +0300)]
ath10k: configure rxnss_override for QCA9984

QCA9984 hardware can do 4x4 at 80Mhz, but only 2x2 at 160Mhz.

First, report this to user-space by setting the max-tx-speed
and max-rx-speed vht capabilities.

Second, if the peer rx-speed is configured, and if we
are in 160 or 80+80 mode, and the peer rx-speed matches
the max speed for 2x2 or 1x1 at 160Mhz (long guard interval),
then use that info to set the peer_bw_rxnss_override appropriately.

Without this, a 9984 firmware will not use 2x2 ratesets when
transmitting to peer (it will be stuck at 1x1), because
the firmware would not have configured the rxnss_override.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[sven.eckelmann@openmesh.com: rebase, cleanup, drop 160Mhz workaround cleanup]
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
[kvalo@qca.qualcomm.com: use hw_params, rename the title]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: use complete VHT chan width for 160MHz workaround
Ben Greear [Fri, 16 Jun 2017 07:37:44 +0000 (10:37 +0300)]
ath10k: use complete VHT chan width for 160MHz workaround

The ath10k firmware doesn't announce its VHT channel width capabilities in
the vht_cap information from the "service ready event" arguments. The
driver must therefore check whether the 160MHz short GI bit is set and
whether the driver still doesn't set the bits for the 160/80+80 MHz
capabilities.

The two bits for the channel width are a two bit integer and not two
separate bits which cannot be parsed without the knowledge of the other
bit. Using IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (b10..) as a
mask for this task doesn't make any sense. The correct mask for the VHT
channel width should be used instead to make this check more readable.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[sven.eckelmann@openmesh.com: separate 160Mhz workaround cleanup, add commit
 message]
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath6kl: fix spelling mistake: "Indicat" -> "Indicate"
Colin Ian King [Sun, 4 Jun 2017 16:36:08 +0000 (17:36 +0100)]
ath6kl: fix spelling mistake: "Indicat" -> "Indicate"

Trivial fix to spelling mistake in ath6kl_dbg debug message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Steve deRosier <derosier@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: add per chain RSSI reporting
Norik Dzhandzhapanyan [Mon, 12 Jun 2017 15:03:34 +0000 (18:03 +0300)]
ath10k: add per chain RSSI reporting

Report per chain RSSI to mac80211.

Signed-off-by: Norik Dzhandzhapanyan <norikd@gmail.com>
[kvalo@qca.qualcomm.com: fix conflicts and style]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: define structures for CE ctrl/misc register
Sarada Prasanna Garnayak [Tue, 6 Jun 2017 09:05:41 +0000 (14:35 +0530)]
ath10k: define structures for CE ctrl/misc register

Define structures for the copy engine ctrl/misc registers,
that includes CE CMD halt, watermark source, watermark destination,
host IE ring, source, destination and dmax ring.

This adds support to avoid the conditional compilation,
code optimization and dynamic configuration of the copy engine
register map for respective hardware bus interface.

Signed-off-by: Sarada Prasanna Garnayak <c_sgarna@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agowlcore: spi: remove unnecessary variable
Gustavo A. R. Silva [Fri, 9 Jun 2017 03:24:30 +0000 (22:24 -0500)]
wlcore: spi: remove unnecessary variable

Remove unnecessary variable and refactor the code.

Addresses-Coverity-ID: 1365000
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agowlcore: add wl1285 compatible
Sebastian Reichel [Thu, 8 Jun 2017 20:50:00 +0000 (22:50 +0200)]
wlcore: add wl1285 compatible

Motorola Droid 4 uses a WL 1285C. With differences between
chips not being public let's add explicit binding for wl1285
instead of relying on wl1283 being very similar.

Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: Replace semaphore async_sem with mutex
Binoy Jayan [Thu, 8 Jun 2017 10:03:03 +0000 (15:33 +0530)]
mwifiex: Replace semaphore async_sem with mutex

The semaphore 'async_sem' is used as a simple mutex, so
it should be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: let btcoex get wifi rssi and link status
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:59 +0000 (10:29 -0500)]
rtlwifi: btcoex: let btcoex get wifi rssi and link status

Instead of rssi status, the btcoex also needs to get the link status of
the wifi. In addition, some of the rssi status can be merged into link
status.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: remove unused display functions
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:58 +0000 (10:29 -0500)]
rtlwifi: btcoex: remove unused display functions

These display functions are useless and will not be called in the
future.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: bind BT coex information with wifi driver
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:57 +0000 (10:29 -0500)]
rtlwifi: btcoex: bind BT coex information with wifi driver

When initializing, gather BT information in struct btcoexist and
provide them to wifi driver.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: hook external functions for newer chips
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:56 +0000 (10:29 -0500)]
rtlwifi: btcoex: hook external functions for newer chips

Hook the external functions for newer ICs such as 8821a and 8192e.

Rename ex_halbtc8192e2ant_halt_notify to ex_btc8192e2ant_halt_notify.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: add settings before the hardware is ready
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:55 +0000 (10:29 -0500)]
rtlwifi: btcoex: add settings before the hardware is ready

When the hardware is turned on and in the initialization stage, the PTA
circuit is unstable. Hence we need to force some hardware settings to
make sure the PTA circuit work correctly, otherwise it may affect the
user's experience.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: hook external PnP notify by chip for wifi driver
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:54 +0000 (10:29 -0500)]
rtlwifi: btcoex: hook external PnP notify by chip for wifi driver

Hook the chip-specific PnP notify functions for the wifi driver to
notify btcoexistence.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: settings before firmware is downloaded
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:53 +0000 (10:29 -0500)]
rtlwifi: btcoex: settings before firmware is downloaded

The btcoex is sometimes unstable because there are some unexpected
behaviors before the firmware has been downloaded successfully.

Therefore we force the antenna path settings to avoid this, then let the
firmware control the btcoexistence when the firmware is ready.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: rename ex_halbtc*ant to ex_btc*ant
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:52 +0000 (10:29 -0500)]
rtlwifi: btcoex: rename ex_halbtc*ant to ex_btc*ant

These external functions are for BT-coexistence, so remove the "hal"
prefix for consistancy.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: add macros to check chip type
Yan-Hsuan Chuang [Mon, 5 Jun 2017 15:29:51 +0000 (10:29 -0500)]
rtlwifi: btcoex: add macros to check chip type

For some external functions that have hardware dependency, we need to
know the type of the hardware before invoking them.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: check band before allocating cmd_skb to avoid resource leak
Colin Ian King [Fri, 2 Jun 2017 15:40:45 +0000 (16:40 +0100)]
qtnfmac: check band before allocating cmd_skb to avoid resource leak

The current code allocates cmd_skb and then will leak this if band->band
is an illegal value. It is simpler to sanity check the band first before
allocating cmd_skb so that we don't have to free cmd_skb if an invalid
band occurs.

Detected by CoverityScan, CID#1437561 ("Resource Leak")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: make function mwifiex_ret_pkt_aggr_ctrl static
Colin Ian King [Fri, 2 Jun 2017 08:56:39 +0000 (09:56 +0100)]
mwifiex: make function mwifiex_ret_pkt_aggr_ctrl static

function mwifiex_ret_pkt_aggr_ctrl can be made static as it does not
need to be in global scope.

Cleans up sparse warning: "symbol 'mwifiex_ret_pkt_aggr_ctrl' was not
declared. Should it be static?"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agobrcmfmac: Fix glom_skb leak in brcmf_sdiod_recv_chain
Peter S. Housel [Mon, 12 Jun 2017 10:46:22 +0000 (11:46 +0100)]
brcmfmac: Fix glom_skb leak in brcmf_sdiod_recv_chain

An earlier change to this function (3bdae810721b) fixed a leak in the
case of an unsuccessful call to brcmf_sdiod_buffrw(). However, the
glom_skb buffer, used for emulating a scattering read, is never used
or referenced after its contents are copied into the destination
buffers, and therefore always needs to be freed by the end of the
function.

Fixes: 3bdae810721b ("brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain")
Fixes: a413e39a38573 ("brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support")
Cc: stable@vger.kernel.org # 4.9.x-
Signed-off-by: Peter S. Housel <housel@acm.org>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agobrcmfmac: Fix grammar issue in error message
Martin Michlmayr [Sat, 10 Jun 2017 09:40:04 +0000 (11:40 +0200)]
brcmfmac: Fix grammar issue in error message

Fix grammar issue in error message about ISO3166.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agobrcmfmac: add scheduled scan support for specified BSSIDs
Arend Van Spriel [Fri, 9 Jun 2017 11:19:22 +0000 (12:19 +0100)]
brcmfmac: add scheduled scan support for specified BSSIDs

Add support to handle scheduled scan request containing BSSID in
the matchsets. The firmware can send event upon finding BSSIDs and
SSIDs. To get these in one event the bit REPORT_SEPARATELY needed
to be removed from the flags in brcmf_pno_config().

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-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>
7 years agobrcmfmac: add mutex to protect pno requests
Arend Van Spriel [Fri, 9 Jun 2017 11:19:21 +0000 (12:19 +0100)]
brcmfmac: add mutex to protect pno requests

The request references kept in pno are accessed in user-space context
and in firmware event handler context. As such we need to protect it
with a lock. As both context allow sleep a mutex seems appropriate.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-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>
7 years agobrcmfmac: add support multi-scheduled scan
Arend Van Spriel [Fri, 9 Jun 2017 11:19:20 +0000 (12:19 +0100)]
brcmfmac: add support multi-scheduled scan

This change adds support for multi-scheduled scan in the driver. It
currently relies on g-scan support in firmware and will set struct
wiphy::max_sched_scan_reqs accordingly. This is limited to 16 concurrent
requests.

The firmware currently has a limit of 64 channels that can be configured
for all requests in total regardless whether there are duplicates. So if
a request uses 35 channels there are 29 channels left for another request.
When user-space does not specify any channels cfg80211 will add all
channels defined by the wiphy instance to the request, which makes
reaching the limit rather easy for dual-band devices.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-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>
7 years agoMerge tag 'iwlwifi-next-for-kalle-2017-06-06' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Mon, 12 Jun 2017 16:29:39 +0000 (19:29 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2017-06-06' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

First batch of iwlwifi driver patches 4.13

* Loads of FW API documentation improvements (for tools and htmldoc);
* Continued work for the new A000 family;
* Bumped the maximum supported FW API to 31;
* Improve the differentiation between 8000, 9000 and A000 families;
* A lot of fixes and cleanups here and there;

kvalo: There were conflicts iwl_mvm_stop_device() and
iwl_mvm_tcool_set_cur_state(). The former was easy but latter needed more
thought. Apparently the mutex was taken too late, so I fixed so that the mutex
is taken first and then check for iwl_mvm_firmware_running().

7 years agoMerge tag 'wireless-drivers-next-for-davem-2017-06-12' of git://git.kernel.org/pub...
David S. Miller [Mon, 12 Jun 2017 14:14:29 +0000 (10:14 -0400)]
Merge tag 'wireless-drivers-next-for-davem-2017-06-12' of git://git./linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 4.13

The first pull request for 4.13. We have a new driver qtnfmac, but
also rsi driver got a support for new firmware and supporting ath10k
SDIO devices was started.

Major changes:

ath10k

* add initial SDIO support (still work in progress)

rsi

* new loading for the new firmware version

rtlwifi

* final patches for the new btcoex support

rt2x00

* add device ID for Epson WN7512BEP

qtnfmac

* new driver for Quantenna QSR10G chipsets
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'udp-reduce-cache-pressure'
David S. Miller [Mon, 12 Jun 2017 14:01:30 +0000 (10:01 -0400)]
Merge branch 'udp-reduce-cache-pressure'

Paolo Abeni says:

====================
udp: reduce cache pressure

In the most common use case, many skb fields are not used by recvmsg(), and
the few ones actually accessed lays on cold cachelines, which leads to several
cache miss per packet.

This patch series attempts to reduce such misses with different strategies:
* caching the interesting fields in the scratched space
* avoid accessing at all uninteresting fields
* prefetching

Tested using the udp_sink program by Jesper[1] as the receiver, an h/w l4 rx
hash on the ingress nic, so that the number of ingress nic rx queues hit by the
udp traffic could be controlled via ethtool -L.

The udp_sink program was bound to the first idle cpu, to get more
stable numbers.

On a single numa node receiver:

nic rx queues           vanilla                 patched kernel      delta
1                       1850 kpps               1850 kpps           0%
2                       2370 kpps               2700 kpps           13.9%
16                      2000 kpps               2220 kpps           11%

[1] https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c

v1 -> v2:
  - replaced secpath_reset() with skb_release_head_state()
  - changed udp_dev_scratch fields types to u{32,16} variant,
    replaced bitfield with bool

v2 -> v3:
  - no changes, tested against apachebench for performances regression
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoudp: try to avoid 2 cache miss on dequeue
Paolo Abeni [Mon, 12 Jun 2017 09:23:43 +0000 (11:23 +0200)]
udp: try to avoid 2 cache miss on dequeue

when udp_recvmsg() is executed, on x86_64 and other archs, most skb
fields are on cold cachelines.
If the skb are linear and the kernel don't need to compute the udp
csum, only a handful of skb fields are required by udp_recvmsg().
Since we already use skb->dev_scratch to cache hot data, and
there are 32 bits unused on 64 bit archs, use such field to cache
as much data as we can, and try to prefetch on dequeue the relevant
fields that are left out.

This can save up to 2 cache miss per packet.

v1 -> v2:
  - changed udp_dev_scratch fields types to u{32,16} variant,
    replaced bitfiled with bool

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoudp: avoid a cache miss on dequeue
Paolo Abeni [Mon, 12 Jun 2017 09:23:42 +0000 (11:23 +0200)]
udp: avoid a cache miss on dequeue

Since UDP no more uses sk->destructor, we can clear completely
the skb head state before enqueuing. Amend and use
skb_release_head_state() for that.

All head states share a single cacheline, which is not
normally used/accesses on dequeue. We can avoid entirely accessing
such cacheline implementing and using in the UDP code a specialized
skb free helper which ignores the skb head state.

This saves a cacheline miss at skb deallocation time.

v1 -> v2:
  replaced secpath_reset() with skb_release_head_state()

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: factor out a helper to decrement the skb refcount
Paolo Abeni [Mon, 12 Jun 2017 09:23:41 +0000 (11:23 +0200)]
net: factor out a helper to decrement the skb refcount

The same code is replicated in 3 different places; move it to a
common helper.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosh_eth: add support for changing MTU
Niklas Söderlund [Mon, 12 Jun 2017 08:39:03 +0000 (10:39 +0200)]
sh_eth: add support for changing MTU

The hardware supports the MTU to be changed and the driver it self is
somewhat prepared to support this. This patch hooks up the callbacks to
be able to change the MTU from user-space.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf, arm64: take advantage of stack_depth tracking
Daniel Borkmann [Sun, 11 Jun 2017 01:55:27 +0000 (03:55 +0200)]
bpf, arm64: take advantage of stack_depth tracking

Make use of recently implemented stack_depth tracking for arm64 JIT,
so that stack usage can be reduced heavily for programs not using
tail calls at least.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge tag 'mlx5-updates-2017-06-11' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Sun, 11 Jun 2017 22:10:42 +0000 (18:10 -0400)]
Merge tag 'mlx5-updates-2017-06-11' of git://git./linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2017-06-11

This series provides updates to mlx5 header rewrite feature, from Or Gerlitz.
and three more small updates From maor and eran.

-------
Or says:

Packets belonging to flows which are different by matching may still need
to go through the same header re-writes (e.g set the current routing hop
MACs and issue TTL decrement).  To minimize the number of modify header
IDs, we add a cache for header re-write IDs which is keyed by the binary
chain of modify header actions.

The caching is supported for both eswitch and NIC use-cases, where the
actual conversion of the code to use caching comes in separate patches,
one per use-case.

Using a per field mask field, the TC pedit action supports modifying
partial fields. The last patch enables offloading that.
-------

From Maor, update flow table commands layout to the latest HW spec.
From Eran, ethtool connector type reporting updates.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: ethernet: ti: cpdma: do not enable host error misc irq
Grygorii Strashko [Thu, 8 Jun 2017 18:51:52 +0000 (13:51 -0500)]
net: ethernet: ti: cpdma: do not enable host error misc irq

CPSW driver does not handle this interrupt, so there are no reasons to enable
it in hardware.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: ethernet: ti: cpsw: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
Grygorii Strashko [Thu, 8 Jun 2017 18:51:31 +0000 (13:51 -0500)]
net: ethernet: ti: cpsw: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter

CPSW driver supports PTP v1 messages, but for unknown reasons this filter
is not advertised. As result,
./tools/testing/selftests/networking/timestamping/timestamping utility
can't be used for testing of CPSW RX timestamping with option
SOF_TIMESTAMPING_RX_HARDWARE, because it uses
HWTSTAMP_FILTER_PTP_V1_L4_SYNC filter.

Hence, fix it by advertising HWTSTAMP_FILTER_PTP_V1_L4_XXX filters
in CPSW driver.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'bpf-misc-updates'
David S. Miller [Sat, 10 Jun 2017 23:05:47 +0000 (19:05 -0400)]
Merge branch 'bpf-misc-updates'

Daniel Borkmann says:

====================
Misc BPF updates

This set contains a couple of misc updates: stack usage reduction
for perf_sample_data in tracing progs, reduction of stale data in
verifier on register state transitions that I still had in my queue
and few selftest improvements as well as bpf_set_hash() helper for
tc programs.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf: add bpf_set_hash helper for tc progs
Daniel Borkmann [Sat, 10 Jun 2017 22:50:47 +0000 (00:50 +0200)]
bpf: add bpf_set_hash helper for tc progs

Allow for tc BPF programs to set a skb->hash, apart from clearing
and triggering a recalc that we have right now. It allows for BPF
to implement a custom hashing routine for skb_get_hash().

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf: remove cg_skb_func_proto and use sk_filter_func_proto directly
Daniel Borkmann [Sat, 10 Jun 2017 22:50:46 +0000 (00:50 +0200)]
bpf: remove cg_skb_func_proto and use sk_filter_func_proto directly

Since cg_skb_func_proto() doesn't do anything else than just calling
into sk_filter_func_proto(), remove it and set sk_filter_func_proto()
directly for .get_func_proto callback.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf, tests: set rlimit also for test_align, so it doesn't fail
Daniel Borkmann [Sat, 10 Jun 2017 22:50:45 +0000 (00:50 +0200)]
bpf, tests: set rlimit also for test_align, so it doesn't fail

When running all the tests, through 'make run_tests', I had
test_align failing due to insufficient rlimit. Set it the same
way as all other test cases from BPF selftests do, so that
test case properly loads everything.

  [...]
  Summary: 7 PASSED, 1 FAILED
  selftests: test_progs [PASS]
  /home/foo/net-next/tools/testing/selftests/bpf
  Test   0: mov ... Failed to load program.
  FAIL
  Test   1: shift ... Failed to load program.
  FAIL
  Test   2: addsub ... Failed to load program.
  FAIL
  Test   3: mul ... Failed to load program.
  FAIL
  Test   4: unknown shift ... Failed to load program.
  FAIL
  Test   5: unknown mul ... Failed to load program.
  FAIL
  Test   6: packet const offset ... Failed to load program.
  FAIL
  Test   7: packet variable offset ... Failed to load program.
  FAIL
  Results: 0 pass 8 fail
  selftests: test_align [PASS]
  [...]

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf, tests: add a test for htab lookup + update traversal
Daniel Borkmann [Sat, 10 Jun 2017 22:50:44 +0000 (00:50 +0200)]
bpf, tests: add a test for htab lookup + update traversal

Add a test case to track behaviour when traversing and updating the
htab map. We recently used such traversal, so it's quite useful to
keep it as an example in selftests.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>