platform/kernel/linux-rpi.git
5 years agoMerge tag 'iwlwifi-next-for-kalle-2019-02-20' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 20 Feb 2019 19:06:13 +0000 (21:06 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2019-02-20' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

Fifth batch of iwlwifi patches intended for v5.1

* Some small fixes and continued work on the new debugging
  infrastructure;
* Greg's debugfs clean-ups;
* Some janitorial patches from the community;
* Fix to one false-positive compiler warning;
* VHT extended NSS support;
* New PCI IDs for 9260 and 22000 series;
* Other general bugfixes and cleanups;

5 years agoiwlwifi: add new cards for 22000 and killer series and change the market name
Ihab Zhaika [Sun, 3 Feb 2019 16:54:01 +0000 (18:54 +0200)]
iwlwifi: add new cards for 22000 and killer series and change the market name

Add a few PCI ID'S for 22000 and killer series in addition to
chainging the marketing name.

Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: add new card for 9260 series
Ihab Zhaika [Mon, 4 Feb 2019 08:16:03 +0000 (10:16 +0200)]
iwlwifi: add new card for 9260 series

Add one PCI ID for 9260 series.

CC: <stable@vger.kernel.org> # 4.14+
Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: implement Rx fifos dump
Shahar S Matityahu [Sun, 27 Jan 2019 09:22:21 +0000 (11:22 +0200)]
iwlwifi: dbg_ini: implement Rx fifos dump

Implement Rx fifos dump in the new dump mechanism.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: implement Tx fifos dump
Shahar S Matityahu [Thu, 20 Dec 2018 12:54:58 +0000 (14:54 +0200)]
iwlwifi: dbg_ini: implement Tx fifos dump

Implement Tx fifos dump in the new dump mechanism.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: add region to fill_header handler
Shahar S Matityahu [Wed, 19 Dec 2018 12:47:36 +0000 (14:47 +0200)]
iwlwifi: dbg_ini: add region to fill_header handler

Add iwl_fw_ini_region_cfg region struct to fill_header handler of
iwl_dump_ini_mem_ops. it is needed for future support in fifos dumping.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: make fill_range handler accept generic range pointer
Shahar S Matityahu [Mon, 28 Jan 2019 09:03:45 +0000 (11:03 +0200)]
iwlwifi: dbg_ini: make fill_range handler accept generic range pointer

Make fill_range handler of iwl_dump_ini_mem_ops accept a generic range
pointer. It is needed for future support in fifos dumping.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: make memory dump get_size handler include headers
Shahar S Matityahu [Mon, 28 Jan 2019 09:02:30 +0000 (11:02 +0200)]
iwlwifi: dbg_ini: make memory dump get_size handler include headers

Make the get size handler of iwl_dump_ini_mem_ops include the total
size of the region. It is needed for fifos dumping.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: add print to iwl_dump_ini_mem in case of invalid range
Shahar S Matityahu [Sun, 27 Jan 2019 09:34:05 +0000 (11:34 +0200)]
iwlwifi: dbg_ini: add print to iwl_dump_ini_mem in case of invalid range

Add informative print in case the range is not available.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: fix infinite time ignore consecutive dumps
Shahar S Matityahu [Tue, 29 Jan 2019 07:51:44 +0000 (09:51 +0200)]
iwlwifi: dbg_ini: fix infinite time ignore consecutive dumps

The driver sets ignore_consec to -1 which is 0xffffffff in u32
so when iwl_fw_ini_trigger_on is called, it will always return false
and each trigger could be used only once.

Solve this by removing the assignment to -1.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: fe1b7d6c2888 ("iwlwifi: add support for triggering ini triggers")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: add some debug data to TX path
Sara Sharon [Mon, 28 Jan 2019 13:12:08 +0000 (15:12 +0200)]
iwlwifi: mvm: add some debug data to TX path

This helps debugging when things go wrong.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove redundant condition from prior alive dump flow
Shahar S Matityahu [Wed, 23 Jan 2019 09:31:58 +0000 (11:31 +0200)]
iwlwifi: remove redundant condition from prior alive dump flow

After the FW image was loaded for the first time,
fwrt->smem_cfg.num_lmacs value will no longer be zero since we don't
clean it when we stop the device. So if we load the image once and then
we fail on a consecutive attempt, the driver will abort any dumping.

Solve this by removing the condition. It is safe to remove since
when we do the actual dumping in iwl_fw_dbg_collect_sync we check
that STATUS_DEVICE_ENABLED bit is still active.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: implement VHT extended NSS support in rs.c
Johannes Berg [Thu, 24 Jan 2019 11:22:41 +0000 (12:22 +0100)]
iwlwifi: mvm: implement VHT extended NSS support in rs.c

For non-offloaded rate control, implement VHT extended NSS
support by just ignoring 160 MHz on transmit if the peer
doesn't support the full NSS (2). This is pretty unlikely
and gets us 160 MHz RX as well as TX in most cases, since
the typical case for this workaround is 4x4 AP only doing
2x2 on 160 MHz.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Allow retries for probe responses
Ilan Peer [Mon, 28 Jan 2019 11:32:52 +0000 (13:32 +0200)]
iwlwifi: mvm: Allow retries for probe responses

When hostapd sends a probe response, it does not request an
acknowledgment on the probe response. This setting is propagated
to the driver and FW from mac80211, and as a result probe responses
are transmitted only once without retries. In congested
environments, this reduces the likelihood for finding the AP.

To overcome this, enable acknowledgment and retries for probe
responses, even in case no acknowledgment is requested. In such
a case the retry limit is set to 3.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE
Johannes Berg [Tue, 29 Jan 2019 12:23:05 +0000 (13:23 +0100)]
iwlwifi: mvm: remove IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE

There's no point in this, we already do everything in a nested
fashion, and if we didn't we'd already crash in iwl_mvm_leds_exit()
etc. Just remove the bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Set TX_CMD_FLG_PROT_REQUIRE correctly
Andrei Otcheretianski [Tue, 29 Jan 2019 18:38:48 +0000 (20:38 +0200)]
iwlwifi: mvm: Set TX_CMD_FLG_PROT_REQUIRE correctly

Previously the protection flag wasn't set on multicast frames even if
the RA is unicast. Fix this by checking addr1 instead.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: support non-transmitting AP
Sara Sharon [Tue, 29 Jan 2019 09:53:03 +0000 (11:53 +0200)]
iwlwifi: mvm: support non-transmitting AP

Add an option to not send beacons and probe responses. This is
used for testing multiple-bssid.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: add read debugfs for he_sniffer_params
Liad Kaufman [Tue, 15 Jan 2019 11:38:30 +0000 (13:38 +0200)]
iwlwifi: mvm: add read debugfs for he_sniffer_params

Return the AID currently set when reading this debugfs entry.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: reject new beacons when in inject mode
Sara Sharon [Sun, 27 Jan 2019 09:24:30 +0000 (11:24 +0200)]
iwlwifi: mvm: reject new beacons when in inject mode

Verify we do not accept new beacon templates while beacon
injection is active.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: iwl-drv: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:22 +0000 (16:21 +0100)]
iwlwifi: iwl-drv: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: Intel Linux Wireless <linuxwifi@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: fw: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:21 +0000 (16:21 +0100)]
iwlwifi: fw: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: Intel Linux Wireless <linuxwifi@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dvm: no need to check return value of debugfs_create functions
Greg Kroah-Hartman [Tue, 22 Jan 2019 15:21:19 +0000 (16:21 +0100)]
iwlwifi: dvm: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: Intel Linux Wireless <linuxwifi@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT
Johannes Berg [Thu, 24 Jan 2019 10:14:13 +0000 (11:14 +0100)]
iwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT

We support this, so we should advertise it. In fact, if we don't,
mac80211 will do it for us (as we advertise SUPPORTS_VHT_EXT_NSS_BW
to it), but that requires a memory reallocation which is wasteful:

  ieee80211 phy0: copying sband (band 1) due to VHT EXT NSS BW flag

Set the flag here to avoid that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: fix error path in iwl_mvm_mac_setup_register()
Johannes Berg [Thu, 24 Jan 2019 12:26:28 +0000 (13:26 +0100)]
iwlwifi: mvm: fix error path in iwl_mvm_mac_setup_register()

The IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE bit shouldn't be set,
and realistically we should complete all setup before we call the
ieee80211_register_hw() function. Fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: nvm-parse: use struct_size() in kzalloc()
Gustavo A. R. Silva [Tue, 8 Jan 2019 17:55:19 +0000 (11:55 -0600)]
iwlwifi: nvm-parse: use struct_size() in kzalloc()

One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: eeprom-parse: use struct_size() in kzalloc()
Gustavo A. R. Silva [Tue, 8 Jan 2019 17:17:38 +0000 (11:17 -0600)]
iwlwifi: eeprom-parse: use struct_size() in kzalloc()

One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: fix false-positive maybe-uninitialized warning
Arnd Bergmann [Mon, 10 Dec 2018 20:39:06 +0000 (21:39 +0100)]
iwlwifi: fix false-positive maybe-uninitialized warning

With CONFIG_NO_AUTO_INLINE, we run into a silly warning when
gcc fails to remember that n_profiles is constant across
the function call to iwl_mvm_sar_set_profile:

drivers/net/wireless/intel/iwlwifi/mvm/fw.c: In function 'iwl_mvm_sar_get_ewrd_table':
drivers/net/wireless/intel/iwlwifi/mvm/fw.c:746:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Marking that function 'inline' avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Don't request HW restart if already requested
Ilan Peer [Sun, 20 Jan 2019 15:45:16 +0000 (17:45 +0200)]
iwlwifi: mvm: Don't request HW restart if already requested

In case mac80211 was requested to perform an HW restart, but the HW
restart has not started yet, there is no need to request another one.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: allocate rb_stts's for all queues in one place
Triebitz [Thu, 17 Jan 2019 12:27:20 +0000 (14:27 +0200)]
iwlwifi: pcie: allocate rb_stts's for all queues in one place

AX210 devices assume that the (DRAM) addresses of the rb_stts's for
the different queues are continuous.
So allocate the rb_stts's for all the Rx queues in one place.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 20 Feb 2019 18:01:27 +0000 (20:01 +0200)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 5.1. Major changes:

ath10k

* support WPA3 with WCN3990

* support for mac80211 airtime fairness based on transmit rate
  estimation, the firmware needs to support WMI_SERVICE_PEER_STATS to
  enable this

* report transmit airtime to mac80211 with firmwares having
  WMI_SERVICE_REPORT_AIRTIME feature, this to have more accurate
  airtime fairness based on real transmit time (instead of just
  estimated from transmit rate)

* support Fine Timing Measurement (FTM) responder role

* add dynamic VLAN support with firmware having
  WMI_SERVICE_PER_PACKET_SW_ENCRYPT

* switch to use SPDX license identifiers

5 years agolibertas_tf: get the MAC address before registering the device
Lubomir Rintel [Wed, 20 Feb 2019 10:58:40 +0000 (11:58 +0100)]
libertas_tf: get the MAC address before registering the device

The start() callback is too late for this: NetworkManager would already
have seen the hardware, thinking 00:00:00:00:00:00 is its permanent
address.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: don't defer firmware loading until start()
Lubomir Rintel [Wed, 20 Feb 2019 10:58:39 +0000 (11:58 +0100)]
libertas_tf: don't defer firmware loading until start()

In order to be able to get a MAC address before we register the device
with ieee80211 we'll need to load the firmware way earlier.

There seems to be one problem with this: the device seems to start
with radio enabled and starts sending in frames right after the firmware
load finishes. Disable the radio as soon as possible.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: move hardware callbacks to a separate structure
Lubomir Rintel [Wed, 20 Feb 2019 10:58:38 +0000 (11:58 +0100)]
libertas_tf: move hardware callbacks to a separate structure

We'll need to talk to the firmware to get a hardware address before
device is registered with ieee80211 subsystem at the end of
lbtf_add_card(). Hooking the callbacks after that is too late.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: add basic validation of shared RAM address
Rafał Miłecki [Wed, 20 Feb 2019 10:30:47 +0000 (11:30 +0100)]
brcmfmac: add basic validation of shared RAM address

While experimenting with firmware loading I ended up in a state of
firmware reporting shared RAM address 0x04000001. It was causing:
[   94.448015] Unable to handle kernel paging request at virtual address cd680001
due to reading out of the mapped memory.

This patch adds some basic validation to avoid kernel crashes due to the
unexpected firmware behavior.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192ce: fix typo, "PairwiseENcAlgorithm" -> "PairwiseEncAlgorithm"
Colin Ian King [Wed, 20 Feb 2019 09:27:27 +0000 (09:27 +0000)]
rtlwifi: rtl8192ce: fix typo, "PairwiseENcAlgorithm" -> "PairwiseEncAlgorithm"

There is an uppercase 'N' that should be a lowercase 'n', fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: use bphy_err() in all wiphy-related code
Rafał Miłecki [Tue, 19 Feb 2019 22:42:19 +0000 (23:42 +0100)]
brcmfmac: use bphy_err() in all wiphy-related code

This recently added macro provides more meaningful error messages thanks
to identifying a specific wiphy. It's especially important on systems
with few cards supported by the same (brcmfmac) driver.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: switch to use SPDX license identifiers
Kalle Valo [Tue, 19 Feb 2019 17:45:26 +0000 (19:45 +0200)]
ath10k: switch to use SPDX license identifiers

Use SPDX identifiers everywhere in ath10k.

Makefile was incorrectly marked in commit b24413180f56 ("License cleanup: add
SPDX GPL-2.0 license identifier to files with no license"), fix that as well.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoath10k: change 'unsigned long int' to 'unsigned long'
Kalle Valo [Tue, 19 Feb 2019 12:11:43 +0000 (14:11 +0200)]
ath10k: change 'unsigned long int' to 'unsigned long'

Fixes checkpatch warnings:

Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2800: comment and simplify AGC init for RT6352
Stanislaw Gruszka [Wed, 13 Feb 2019 10:09:16 +0000 (11:09 +0100)]
rt2800: comment and simplify AGC init for RT6352

We do not need separate lines for calculating register values.
Also add comment that value is different than in vendor driver.

Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2800: enable TX_PIN_CFG_RFRX_EN only for MT7620
Stanislaw Gruszka [Wed, 13 Feb 2019 10:09:15 +0000 (11:09 +0100)]
rt2800: enable TX_PIN_CFG_RFRX_EN only for MT7620

The TX_PIN_CFG_RFRX_EN bit was not set on other devices than MT7620,
restore old behavaviour since setting this bit maight not be
correct for older devices.

Fixes: 41977e86c984 ("rt2x00: add support for MT7620")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2800: enable TX_PIN_CFG_LNA_PE_ bits per band
Stanislaw Gruszka [Wed, 13 Feb 2019 10:09:14 +0000 (11:09 +0100)]
rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band

Do not enable TX_PIN_CFG_LNA_PE_A* bits for 2.4GHz band and
vice versa TX_PIN_CFG_LNA_PE_G* bits for 5GHz.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2x00: remove confusing AGC register
Tomislav Požega [Wed, 13 Feb 2019 10:09:13 +0000 (11:09 +0100)]
rt2x00: remove confusing AGC register

Register 66 was causing issues on RT6352 if set to the same value as
in MTK driver. With 1c reg value device was working fine in both HT20
and HT40 modes.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agort2x00: remove unneeded check
Tomislav Požega [Wed, 13 Feb 2019 10:09:12 +0000 (11:09 +0100)]
rt2x00: remove unneeded check

Remove band check from rf53xx channel config routine since all chips
using it are single band.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agocarl9170: clean up a clamp() call
Dan Carpenter [Mon, 18 Feb 2019 09:31:54 +0000 (12:31 +0300)]
carl9170: clean up a clamp() call

The parameter order for clamp is supposed to be clamp(value, low, high).
When we write it in this order it's equivalent to
min(head->plcp[3] & 0x7f, 75) which works in this context where the min
is zero.  But it's not a correct use of the API.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortl818x_pci: Remove set but not used variables 'io_addr, mem_addr'
YueHaibing [Mon, 18 Feb 2019 07:52:26 +0000 (07:52 +0000)]
rtl818x_pci: Remove set but not used variables 'io_addr, mem_addr'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c: In function 'rtl8180_probe':
drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c:1727:15: warning:
 variable 'io_addr' set but not used [-Wunused-but-set-variable]

drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c:1726:16: warning:
 variable 'mem_addr' set but not used [-Wunused-but-set-variable]

They're never used since introduction.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoorinoco : Replace function name in string with __func__
Keyur Patel [Sun, 17 Feb 2019 16:25:45 +0000 (11:25 -0500)]
orinoco : Replace function name in string with __func__

Replace hard coded function name with __func__, to
improve robustness and to conform to the Linux kernel coding
style. Issue found using checkpatch.

Signed-off-by: Keyur Patel <iamkeyur96@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomwifiex: don't advertise IBSS features without FW support
Brian Norris [Fri, 15 Feb 2019 00:31:29 +0000 (16:31 -0800)]
mwifiex: don't advertise IBSS features without FW support

As it is, doing something like

  # iw phy phy0 interface add foobar type ibss

on a firmware that doesn't have ad-hoc support just yields failures of
HostCmd_CMD_SET_BSS_MODE, which happened to return a '-1' error code
(-EPERM? not really right...) and sometimes may even crash the firmware
along the way.

Let's parse the firmware capability flag while registering the wiphy, so
we don't allow attempting IBSS at all, and we get a proper -EOPNOTSUPP
from nl80211 instead.

Fixes: e267e71e68ae ("mwifiex: Disable adhoc feature based on firmware capability")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agomwifiex: Fix NL80211_TX_POWER_LIMITED
Adrian Bunk [Wed, 13 Feb 2019 13:59:38 +0000 (15:59 +0200)]
mwifiex: Fix NL80211_TX_POWER_LIMITED

NL80211_TX_POWER_LIMITED was treated as NL80211_TX_POWER_AUTOMATIC,
which is the opposite of what should happen and can cause nasty
regulatory problems.

if/else converted to a switch without default to make gcc warn
on unhandled enum values.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: remove set but not used variable 'flags'
YueHaibing [Wed, 13 Feb 2019 01:49:17 +0000 (01:49 +0000)]
libertas_tf: remove set but not used variable 'flags'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/marvell/libertas_tf/main.c: In function 'lbtf_rx':
drivers/net/wireless/marvell/libertas_tf/main.c:554:15: warning:
 variable 'flags' set but not used [-Wunused-but-set-variable]

It never used and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: fix signal reporting
Lubomir Rintel [Sun, 10 Feb 2019 19:48:22 +0000 (20:48 +0100)]
libertas_tf: fix signal reporting

Instead of exposing the signal-to-noise ration, calculate the actual signal
level taking the noise floor into account.

Also, flip the SIGNAL_DBM bit on, so that mac80211 exposes the signal
level along with the station info in scan results. This fills
NetworkManager's "nmcli d wifi output" output with colors, bars and joy.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: move the banner to a more appropriate place
Lubomir Rintel [Sun, 10 Feb 2019 19:48:11 +0000 (20:48 +0100)]
libertas_tf: move the banner to a more appropriate place

Also, turn it to a dev_info() to make checkpatch.pl happy.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: don't set URB_ZERO_PACKET on IN USB transfer
Lubomir Rintel [Sun, 10 Feb 2019 19:47:49 +0000 (20:47 +0100)]
libertas_tf: don't set URB_ZERO_PACKET on IN USB transfer

It doesn't make sense and the USB core warns on each submit of such
URB, easily flooding the message buffer with tracebacks.

Analogous issue was fixed in regular libertas driver in commit 6528d8804780
("libertas: don't set URB_ZERO_PACKET on IN USB transfer").

Cc: stable@vger.kernel.org
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agolibertas_tf: lower the debug level of command trace
Lubomir Rintel [Sun, 10 Feb 2019 19:47:35 +0000 (20:47 +0100)]
libertas_tf: lower the debug level of command trace

Logging each and every command response is way too much for INFO level.
Silence this, unless CONFIG_LIBERTAS_THINFIRM_DEBUG has been enabled.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agorsi: remove set but not used variables 'info, vif'
YueHaibing [Mon, 18 Feb 2019 07:51:56 +0000 (07:51 +0000)]
rsi: remove set but not used variables 'info, vif'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/rsi/rsi_91x_main.c: In function 'rsi_prepare_skb':
drivers/net/wireless/rsi/rsi_91x_main.c:127:24: warning:
 variable 'vif' set but not used [-Wunused-but-set-variable]

drivers/net/wireless/rsi/rsi_91x_main.c:124:28: warning:
 variable 'info' set but not used [-Wunused-but-set-variable]

They're not used any more since 160ee2a11ce0 ("rsi: fill rx_params only once.")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agorsi: fix spelling mistakes
Siva Rebbagondla [Tue, 12 Feb 2019 11:28:34 +0000 (16:58 +0530)]
rsi: fix spelling mistakes

Trivial fixes to spelling mistakes in various files in rsi folder.

Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agorsi: fix a typo in a debug message
Dan Carpenter [Sat, 9 Feb 2019 09:00:09 +0000 (12:00 +0300)]
rsi: fix a typo in a debug message

There is a \b (backspace) character in the message that wasn't intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: remove set but not used variable 'old_state'
YueHaibing [Mon, 18 Feb 2019 08:08:46 +0000 (08:08 +0000)]
brcmfmac: remove set but not used variable 'old_state'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function 'brcmf_usb_state_change':
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:578:6: warning:
 variable 'old_state' set but not used [-Wunused-but-set-variable]

It's never used and can be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: rework bphy_err() to take struct brcmf_pub argument
Rafał Miłecki [Fri, 15 Feb 2019 14:45:54 +0000 (15:45 +0100)]
brcmfmac: rework bphy_err() to take struct brcmf_pub argument

This macro will be used in more places not just the cfg80211.c. It makes
sense to pass some common struct to it as "struct wiphy" is mostly
referenced in cfg80211 code only.

A very common one (used above the bus abstraction layer) is struct
brcmf_pub. Many functions already keep reference to it which will make
using bphy_err() simpler. It should also allow extending that macro's
logic if it's ever needed.

This improves code recently added in the commit 3ef005b82e2a ("brcmfmac:
add bphy_err() and use it in the cfg80211.c").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: support firmware reporting 160 MHz channels
Rafał Miłecki [Mon, 11 Feb 2019 22:04:54 +0000 (23:04 +0100)]
brcmfmac: support firmware reporting 160 MHz channels

So far 160 MHz channels were treated as 20 MHz ones which was breaking
support for 40/80 MHz due to the brcmf_construct_chaninfo() logic and
its assumptions.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: improve code handling bandwidth of firmware reported channels
Rafał Miłecki [Mon, 11 Feb 2019 22:04:53 +0000 (23:04 +0100)]
brcmfmac: improve code handling bandwidth of firmware reported channels

1) Use switch to simplify/improve the code & avoid some duplication
2) Add warning for unsupported values

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: print firmware reported ring status errors
Rafał Miłecki [Fri, 8 Feb 2019 14:24:39 +0000 (15:24 +0100)]
brcmfmac: print firmware reported ring status errors

Firmware is capable of reporting ring status. It's used e.g. to signal
some problem with a specific ring setup. This patch adds support for
printing ring & error number which may be useful for debugging setup
issues.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agobrcmfmac: use chipname in brcmf_fw_alloc_request() for error path as well
Arend van Spriel [Thu, 14 Feb 2019 12:43:52 +0000 (13:43 +0100)]
brcmfmac: use chipname in brcmf_fw_alloc_request() for error path as well

The local variable chipname is string representation of chip id and revision
which is printed in the good flow of brcmf_fw_alloc_request(). Also use it
for the error path, ie. for unknown/unsupported 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>
5 years agobrcmfmac: check and dump trap info during sdio probe
Arend van Spriel [Thu, 14 Feb 2019 12:43:51 +0000 (13:43 +0100)]
brcmfmac: check and dump trap info during sdio probe

When the firmware crashes during the probe sequence we provide little
information on what really failed. This patch checks the sdpcm shared
location and show the trap information if a firmware trap has happened.

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>
5 years agobrcmfmac: disable MBSS feature for bcm4330 device
Arend van Spriel [Thu, 14 Feb 2019 12:43:50 +0000 (13:43 +0100)]
brcmfmac: disable MBSS feature for bcm4330 device

The MBSS feature was already disabled for bcm43362 as it resulted in a
beacon with BRCM_TEST_SSID regardless user configuration in hostapd. Now
the same has been reported for bcm4330 so disable the feature for this
device as well.

Reported-by: Russell King <linux@armlinux.org.uk>
Tested-by: Christopher Martin <chrsmrtn@gmail.com>
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>
5 years agobrcmfmac: create debugfs files for bus-specific layer
Arend van Spriel [Thu, 14 Feb 2019 12:43:49 +0000 (13:43 +0100)]
brcmfmac: create debugfs files for bus-specific layer

Since we moved the drivers debugfs directory under ieee80211 debugfs the
debugfs entries need to be added after wiphy_register() has been called.
For most part that has been done accordingly, but for the debugfs entries
added by SDIO it was not and failed silently. This patch fixes that by
adding a bus-layer callback for it.

Fixes: 856d5a011c86 ("brcmfmac: allocate struct brcmf_pub instance using wiphy_new()")
Reported-by: Russel King <linux@armlinux.org.uk>
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>
5 years agobrcmfmac: add subtype check for event handling in data path
Arend van Spriel [Thu, 14 Feb 2019 12:43:48 +0000 (13:43 +0100)]
brcmfmac: add subtype check for event handling in data path

For USB there is no separate channel being used to pass events
from firmware to the host driver and as such are passed over the
data path. In order to detect mock event messages an additional
check is needed on event subtype. This check is added conditionally
using unlikely() keyword.

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>
5 years agobrcmfmac: assure SSID length from firmware is limited
Arend van Spriel [Thu, 14 Feb 2019 12:43:47 +0000 (13:43 +0100)]
brcmfmac: assure SSID length from firmware is limited

The SSID length as received from firmware should not exceed
IEEE80211_MAX_SSID_LEN as that would result in heap overflow.

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>
5 years agortlwifi: rtl8821ae: Remove CamelCase variables
Larry Finger [Thu, 14 Feb 2019 22:36:44 +0000 (16:36 -0600)]
rtlwifi: rtl8821ae: Remove CamelCase variables

If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

The following checkpatch exceptions are also fixed:

WARNING: line over 80 characters
#316: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c:1751:
+       SET_8821AE_H2CCMD_AOAC_RSVDPAGE_LOC_GTK_EXT_MEM(u1rsvdpageloc2, GTKEXT_PG);

CHECK: spaces preferred around that '+' (ctx:VxV)
#357: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:2591:
+                (eeaddr+1), hwinfo[eeaddr+1]);
                        ^

CHECK: spaces preferred around that '+' (ctx:VxV)
#357: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:2591:
+                (eeaddr+1), hwinfo[eeaddr+1]);
                                          ^

CHECK: spaces preferred around that '+' (ctx:VxV)
#358: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:2592:
+       if (0xFF == hwinfo[eeaddr+1])  /*YJ,add,120316*/
                                 ^

WARNING: Comparisons should place the constant on the right side of the test
#358: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:2592:
+       if (0xFF == hwinfo[eeaddr+1])  /*YJ,add,120316*/

CHECK: spaces preferred around that '&' (ctx:VxV)
#501: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c:2666:
+                               pwrinfo24g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr]&0xf0) >> 4;
                                                                                        ^
Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8723{be,ae}: Remove CamelCase variables
Larry Finger [Thu, 14 Feb 2019 22:36:43 +0000 (16:36 -0600)]
rtlwifi: rtl8723{be,ae}: Remove CamelCase variables

If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192se: Remove CamelCase variables
Larry Finger [Thu, 14 Feb 2019 22:36:42 +0000 (16:36 -0600)]
rtlwifi: rtl8192se: Remove CamelCase variables

If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8188de: Remove CamelCase variables
Larry Finger [Thu, 14 Feb 2019 22:36:41 +0000 (16:36 -0600)]
rtlwifi: rtl8188de: Remove CamelCase variables

If a macro is in CamelCase, it it converted to upper case. Variables
and routine names are converted to lower case.

The following checkpatch exceptions are also fixed:

CHECK: No space is necessary after a cast
#211: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:109:
+                                             (u8 *) (&rfstate));

CHECK: No space is necessary after a cast
#241: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c:277:
+                               ptmp_byte = (u8 *) (&regtoset) + index;

Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192{c,u}: Remove CamelCase variables
Larry Finger [Thu, 14 Feb 2019 22:36:40 +0000 (16:36 -0600)]
rtlwifi: rtl8192{c,u}: Remove CamelCase variables

This patch affects modules rtl8192ce, rtl8192cu, and rtl8192com.

The following checkpatch exceptions are also fixed:

CHECK: No space is necessary after a cast
#237: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c:90:
+                                                     (u8 *) (&rfstate));

CHECK: No space is necessary after a cast
#744: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c:329:
+                       pwr_val[i] = (u8) ((writeval & (0x7f <<

CHECK: No space is necessary after a cast
#784: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c:365:
+                                              (u8) writeval);

CHECK: spaces preferred around that '/' (ctx:VxV)
#963: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:513:
+               txqpageunit = txqpagenum/outepnum;
                                        ^

CHECK: Unnecessary parentheses around 'outepnum > 1'
#975: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:521:
+               if ((outepnum > 1) && (txqremaininpage))

CHECK: Alignment should match open parenthesis
#1059: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c:617:
+static void _rtl92cu_init_chipn_two_out_ep_priority(struct ieee80211_hw *hw,
                                                                bool wmm_enable,

ERROR: "foo * bar" should be "foo *bar"
#1940: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:591:
+void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc,

Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8188ee: Remove CamelCase variable
Larry Finger [Thu, 14 Feb 2019 22:36:39 +0000 (16:36 -0600)]
rtlwifi: rtl8188ee: Remove CamelCase variable

This driver contains one instance of a CamelCase variable, namely
IS_81xxC_VENDOR_UMC_A_CUT. This macro is never used, thus it is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: btcoexist: Remove CamelCase variable
Larry Finger [Thu, 14 Feb 2019 22:36:38 +0000 (16:36 -0600)]
rtlwifi: btcoexist: Remove CamelCase variable

File halbt_precomp.h contains the only CamelCase value, namely
GetDefaultAdapter, but that macro is never used, thus it is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: Remove CamelCase variables from base code
Larry Finger [Thu, 14 Feb 2019 22:36:37 +0000 (16:36 -0600)]
rtlwifi: Remove CamelCase variables from base code

There are a number of CamelCase variables remaining in the source
files of modules rtl_pci, rtl_usb, and rtlwifi.

The following checkpatch excettions are also fixed:

for_kalle1/0001-rtlwifi-Remove-CamelCase-variables-from-base-code.patch
-----------------------------------------------------------------------
CHECK: Unnecessary parentheses around 'rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
                             rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]'
#68: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:377:
+                       if ((rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
+                            rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]) ||
+                           (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
+                            rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
                                                                   1])) {

CHECK: Unnecessary parentheses around 'rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
                             rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
                                                                   1]'
#68: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:377:
+                       if ((rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i] !=
+                            rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i]) ||
+                           (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=
+                            rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base + i +
                                                                   1])) {

WARNING: line over 80 characters
#70: FILE: drivers/net/wireless/realtek/rtlwifi/efuse.c:379:
+                           (rtlefuse->efuse_map[EFUSE_INIT_MAP][base + i + 1] !=

CHECK: No space is necessary after a cast
#186: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c:396:
+       status->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#208: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c:335:
+       stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#243: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:301:
+       stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

CHECK: No space is necessary after a cast
#252: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c:368:
+       stats.rx_is40mhzpacket = (bool) GET_RX_DESC_BW(rxdesc);

CHECK: No space is necessary after a cast
#265: FILE: drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c:475:
+       stats->rx_is40mhzpacket = (bool) GET_RX_DESC_BW(pdesc);

WARNING: Unnecessary space before function pointer arguments
#455: FILE: drivers/net/wireless/realtek/rtlwifi/wifi.h:1462:
+       void (*writen_sync) (struct rtl_priv *rtlpriv, u32 addr, void *buf,

WARNING: Unnecessary space before function pointer arguments
#483: FILE: drivers/net/wireless/realtek/rtlwifi/wifi.h:2257:
+       void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pdesc,

Note that not all checkpatch exceptions are addressed. Those will be
handled in later patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8821ae: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:20 +0000 (13:59 -0600)]
rtlwifi: rtl8821ae: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8723_common: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:19 +0000 (13:59 -0600)]
rtlwifi: rtl8723_common: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8723be: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:18 +0000 (13:59 -0600)]
rtlwifi: rtl8723be: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8723ae: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:17 +0000 (13:59 -0600)]
rtlwifi: rtl8723ae: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192se: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:16 +0000 (13:59 -0600)]
rtlwifi: rtl8192se: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192ee: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:15 +0000 (13:59 -0600)]
rtlwifi: rtl8192ee: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192de: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:14 +0000 (13:59 -0600)]
rtlwifi: rtl8192de: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192cu: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:13 +0000 (13:59 -0600)]
rtlwifi: rtl8192cu: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192ce: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:12 +0000 (13:59 -0600)]
rtlwifi: rtl8192ce: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8192com: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:11 +0000 (13:59 -0600)]
rtlwifi: rtl8192com: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: rtl8188ee: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:10 +0000 (13:59 -0600)]
rtlwifi: rtl8188ee: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: btcoex: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:09 +0000 (13:59 -0600)]
rtlwifi: btcoex: Replace old-style license information

The old-style license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agortlwifi: Replace old-style license information
Larry Finger [Thu, 14 Feb 2019 19:59:08 +0000 (13:59 -0600)]
rtlwifi: Replace old-style license information

The traditional license information is replaced by the SPDX form. There
are no code changes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
5 years agoMerge tag 'mt76-for-kvalo-2019-02-18' of https://github.com/nbd168/wireless
Kalle Valo [Tue, 19 Feb 2019 14:40:56 +0000 (16:40 +0200)]
Merge tag 'mt76-for-kvalo-2019-02-18' of https://github.com/nbd168/wireless

mt76 patches for 5.1

* beacon support for USB devices (mesh+ad-hoc only)
* mt76x0 tx power fixes
* fixes for encryption, calibration and ED/CCA
* more code unification
* USB fixes
* fix for using the correct hweight8 function

5 years agomt76: mt76x2: simplify per-chain signal strength handling
Felix Fietkau [Mon, 18 Feb 2019 19:29:11 +0000 (20:29 +0100)]
mt76: mt76x2: simplify per-chain signal strength handling

There is no need to use a for loop here, supported chips can only support
up to 2 chains.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: fix resetting software IV flag on key delete
Felix Fietkau [Fri, 25 Jan 2019 17:00:11 +0000 (18:00 +0100)]
mt76: fix resetting software IV flag on key delete

It needs to be unset instead of set

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: fix corrupted software generated tx CCMP PN
Felix Fietkau [Fri, 25 Jan 2019 16:59:06 +0000 (17:59 +0100)]
mt76: fix corrupted software generated tx CCMP PN

Since ccmp_pn is u8 *, the second half needs to start at array index 4
instead of 0. Fixes a connection stall after a certain amount of traffic

Fixes: 23405236460b9 ("mt76: fix transmission of encrypted management frames")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: fix tx status timeout processing
Felix Fietkau [Fri, 25 Jan 2019 14:10:52 +0000 (15:10 +0100)]
mt76: fix tx status timeout processing

Remove bogus check for MT_PACKET_ID_NO_ACK in mt76_tx_status_skb_get, which
is already handled in callers and turns timeout calls into no-ops
Do not clean up pending status items on reordering of tx status information
if the timeout is not reached yet

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: Use the correct hweight8() function
Ben Hutchings [Tue, 12 Feb 2019 15:36:24 +0000 (15:36 +0000)]
mt76: Use the correct hweight8() function

mt76_init_stream_cap() and mt76_get_txpower() call __sw_hweight8()
directly, but that's only defined if CONFIG_GENERIC_HWEIGHT is
enabled.  The function that works on all architectures is hweight8().

Fixes: 551e1ef4d291 ("mt76: add mt76_init_stream_cap routine")
Fixes: 9313faacbb4e ("mt76: move mt76x02_get_txpower to mt76 core")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76x02u: remove bogus check and comment padding
Stanislaw Gruszka [Tue, 12 Feb 2019 09:24:42 +0000 (10:24 +0100)]
mt76x02u: remove bogus check and comment padding

In mt76x02u_skb_dma_info() pad is always non-zero. Patch removes
bogus check and add comments to the function.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: use dev_err_ratelimited instead of dev_err in mt76u_complete_rx
Lorenzo Bianconi [Mon, 11 Feb 2019 23:45:55 +0000 (00:45 +0100)]
mt76: usb: use dev_err_ratelimited instead of dev_err in mt76u_complete_rx

During device removal the driver can report multiple error messages.
Use dev_err_ratelimited instead of dev_err to display urb errors

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: introduce disable_usb_sg parameter
Lorenzo Bianconi [Tue, 12 Feb 2019 13:42:42 +0000 (14:42 +0100)]
mt76: usb: introduce disable_usb_sg parameter

Add disable_usb_sg module parameter to disable scatter-gather on demand

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: use a linear buffer for tx/rx datapath if sg is not supported
Lorenzo Bianconi [Tue, 12 Feb 2019 13:42:41 +0000 (14:42 +0100)]
mt76: usb: use a linear buffer for tx/rx datapath if sg is not supported

Use linear fragment and not a single usb scatter-gather buffer in mt76u
{tx,rx} datapath if the usb controller has sg data length constraints

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: do not use sg buffers for mcu messages
Lorenzo Bianconi [Tue, 12 Feb 2019 13:42:40 +0000 (14:42 +0100)]
mt76: usb: do not use sg buffers for mcu messages

Do not use scatter-gather buffers for mcu commands.
Introduce mt76u_buf_alloc and mt76u_buf_alloc_sg routines.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: move mt76u_check_sg in usb.c
Lorenzo Bianconi [Tue, 12 Feb 2019 13:42:39 +0000 (14:42 +0100)]
mt76: usb: move mt76u_check_sg in usb.c

Move mt76u_check_sg routine in usb.c and introduce sg_en variable
in mt76_usb in order to check if scatter-gather is supported by
mt76u layer

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>