]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agomwifiex: disable channel filtering feature in firmware
Amitkumar Karwar [Mon, 25 Apr 2016 06:49:51 +0000 (23:49 -0700)]
mwifiex: disable channel filtering feature in firmware

As 2.4Ghz channels are overlapping, sometimes AP responds to
probe request even if it's operating on neighbouring channel.
Currently firmware drops those scan entries, as current channel
doesn't match with APs channel.

This patch enables MWIFIEX_DISABLE_CHAN_FILT flag in scan
command to disable the feature so that better scan results
will be received in 2.4Ghz band.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: avoid querying wakeup reason when wowlan is disabled
Amitkumar Karwar [Thu, 21 Apr 2016 15:07:56 +0000 (08:07 -0700)]
mwifiex: avoid querying wakeup reason when wowlan is disabled

In cfg80211 resume handler, we query wakeup reason from firmware and
report to cfg80211. if wowlan is disabled, connection is already
terminated during suspend. We don't need to query wakeup reason in this
case.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: report wowlan wakeup reasons correctly
Amitkumar Karwar [Thu, 21 Apr 2016 15:07:55 +0000 (08:07 -0700)]
mwifiex: report wowlan wakeup reasons correctly

It's been observed that wakeup on GTK rekey failure wasn't reported
to cfg80211. This patch corrects the check so that all valid wakeup
reasons are reported.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix coding style
Amitkumar Karwar [Thu, 21 Apr 2016 15:07:54 +0000 (08:07 -0700)]
mwifiex: fix coding style

Redundant space in case statement is removed.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: transmit packet stats incorrect.
Marty Faltesek [Wed, 20 Apr 2016 04:22:01 +0000 (00:22 -0400)]
mwifiex: transmit packet stats incorrect.

tx_packets counter is incremented for aggregated packets, when it had
already been incremented for the aggregated packet's constituent
parts. Removing the extra count.

Signed-off-by: Marty Faltesek <mfaltesek@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fw download does not release sdio bus during failure
Marty Faltesek [Wed, 20 Apr 2016 04:20:52 +0000 (00:20 -0400)]
mwifiex: fw download does not release sdio bus during failure

Signed-off-by: Marty Faltesek <mfaltesek@google.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: bridged packets cause wmm_tx_pending counter to go negative
Marty Faltesek [Wed, 20 Apr 2016 04:19:35 +0000 (00:19 -0400)]
mwifiex: bridged packets cause wmm_tx_pending counter to go negative

When a packet is queued from the bridge, wmm_tx_pending is not
incremented, but when the packet is dequeued the counter is decremented.

Signed-off-by: Marty Faltesek <mfaltesek@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoMerge ath-next from ath.git
Kalle Valo [Tue, 26 Apr 2016 11:13:59 +0000 (14:13 +0300)]
Merge ath-next from ath.git

ath.git patches for 4.7. Major changes:

ath10k

* implement set_tsf() for 10.2.4 branch
* remove rare MSI range support
* remove deprecated firmware API 1 support

ath9k

* add module parameter to invert LED polarity

wcn36xx

* fixes to get the driver properly working on Dragonboard 410c

8 years agoiwlwifi: fix fw version reading for DVM devices
Luca Coelho [Mon, 25 Apr 2016 17:02:09 +0000 (20:02 +0300)]
iwlwifi: fix fw version reading for DVM devices

In commit 97f95c93c8ed ("iwlwifi: remove support for fw older than
-16.ucode") we accidentally changed the fw version reading code for
DVM devices.  The code intended to remove the old fw version API,
because all MVM firmwares version 16 and above that we support don't
use it anymore.  But DVM devices still use the old FW API.

Fix that by bringing the code back in.

Reported-by: Pat Erley <pat-lkml@erley.org>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
Fixes: 97f95c93c8ed ("iwlwifi: remove support for fw older than-16.ucode")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agort2800lib: enable MFP if hw crypt is disabled
Chun-Yeow Yeoh [Wed, 20 Apr 2016 16:41:34 +0000 (00:41 +0800)]
rt2800lib: enable MFP if hw crypt is disabled

If rt2800usb is loaded with nohwcrypt=1, mac80211 takes
care of the crypto with software encryption/decryption
and thus, MFP can be used.

Tested for secured mesh using ath9k_htc and ath9k.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: testing the wrong variable in brcmf_rx_hdrpull()
Dan Carpenter [Tue, 19 Apr 2016 14:25:43 +0000 (07:25 -0700)]
brcmfmac: testing the wrong variable in brcmf_rx_hdrpull()

Smatch complains about this code:

    drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c:335 brcmf_rx_hdrpull()
    error: we previously assumed '*ifp' could be null (see line 333)

The problem is that we recently changed these from "ifp" to "*ifp" but
there was one that we didn't update.

-       if (ret || !ifp || !ifp->ndev) {
+       if (ret || !(*ifp) || !(*ifp)->ndev) {
                if (ret != -ENODATA && ifp)
                                       ^^^
-                       ifp->stats.rx_errors++;
+                       (*ifp)->stats.rx_errors++;

I have updated it to *ifp as well.  We always call this function is a
non-NULL "ifp" pointer, btw.

Fixes: c462ebcdfe42 ('brcmfmac: create common function for handling brcmf_proto_hdrpull()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix loop timeout in mwifiex_prog_fw_w_helper()
Dan Carpenter [Tue, 19 Apr 2016 14:23:44 +0000 (07:23 -0700)]
mwifiex: fix loop timeout in mwifiex_prog_fw_w_helper()

USB8XXX_FW_MAX_RETRY is 3.  We were using a post-op loop
"while (retries--) {" but then the lines after that assume the loop
exits with retries set to zero.

I've fixed this by changing to a pre-op loop.  I started with retries
set to 4 instead of 3 so that we still go through the loop the same
number of times.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: missing error code on allocation failure
Dan Carpenter [Tue, 19 Apr 2016 14:21:58 +0000 (07:21 -0700)]
mwifiex: missing error code on allocation failure

We accidentally return success instead of -ENOMEM.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_reg
Jes Sorensen [Mon, 18 Apr 2016 15:49:36 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_reg

There is nothing 8723au specific about rtl8723au_iqk_phy_iq_bb_reg so
rename the array to rtl8xxxu_iqk_phy_iq_bb_reg.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723bu_simularity_compare()
Jes Sorensen [Mon, 18 Apr 2016 15:49:35 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723bu_simularity_compare()

This renames rtl8723bu_simularity_compare() to
rtl8xxxu_gen2_simularity_compare() to reflect it is used for all gen2
parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723b_channel_to_group()
Jes Sorensen [Mon, 18 Apr 2016 15:49:34 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723b_channel_to_group()

This renames rtl8723b_channel_to_group() to
rtl8xxxu_gen2_channel_to_group() to reflect it is used by all
currently supported gen2 parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723a_mac_init_table to rtl8xxxu_gen1_mac_init_table
Jes Sorensen [Mon, 18 Apr 2016 15:49:33 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723a_mac_init_table to rtl8xxxu_gen1_mac_init_table

All currently supported gen1 parts use the same mac_init_table, so
rename it to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()
Jes Sorensen [Mon, 18 Apr 2016 15:49:32 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()

All gen1 parts use the same enable_rf() function, so rename it to
reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723a_set_tx_power() to rtl8xxxu_gen1_set_tx_power()
Jes Sorensen [Mon, 18 Apr 2016 15:49:31 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723a_set_tx_power() to rtl8xxxu_gen1_set_tx_power()

All gen1 parts use the same interface for setting TX power, so rename
the function to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_init_phy_bb() to rtl8xxxu_gen1_init_phy_bb()
Jes Sorensen [Mon, 18 Apr 2016 15:49:30 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_init_phy_bb() to rtl8xxxu_gen1_init_phy_bb()

All gen1 parts use the same init_phy_bb() function, so rename it to
reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_phy_iq_calibrate() to rtl8xxxu_gen1_phy_iq_calibrate()
Jes Sorensen [Mon, 18 Apr 2016 15:49:29 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_phy_iq_calibrate() to rtl8xxxu_gen1_phy_iq_calibrate()

All supported gen1 parts use the same phy_iq_calibrate() function
(unlike their gen2 counterparts). Rename the function to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_update_rate_mask() to rtl8xxxu_update_rate_mask()
Jes Sorensen [Mon, 18 Apr 2016 15:49:28 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_update_rate_mask() to rtl8xxxu_update_rate_mask()

All currently supported gen1 parts use the same function for updating
the rate mask, so rename it to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_config_channel() to rtl8xxxu_gen1_config_channel()
Jes Sorensen [Mon, 18 Apr 2016 15:49:27 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_config_channel() to rtl8xxxu_gen1_config_channel()

All supported gen1 parts use the same config_channel() function, so
rename it to reflect this.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()
Jes Sorensen [Mon, 18 Apr 2016 15:49:26 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()

All currently supported gen1 parts use the same disable_rf() routine,
so rename the function to reflect that.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()
Jes Sorensen [Mon, 18 Apr 2016 15:49:25 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()

At least for now, all gen2 parts use the same disable_rf() function

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723bu_config_channel() to rtl8xxxu_gen2_config_channel()
Jes Sorensen [Mon, 18 Apr 2016 15:49:24 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723bu_config_channel() to rtl8xxxu_gen2_config_channel()

Rename the function to indicate it is applicable to most/all gen2
parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723au_report_connect() to rtl8xxxu_gen1_report_connect()
Jes Sorensen [Mon, 18 Apr 2016 15:49:23 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723au_report_connect() to rtl8xxxu_gen1_report_connect()

Rename the function to reflect it is for all/most gen1 parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723bu_report_connect() to rtl8xxxu_gen2_report_connect()
Jes Sorensen [Mon, 18 Apr 2016 15:49:22 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723bu_report_connect() to rtl8xxxu_gen2_report_connect()

Make the name reflect this is for most/all gen2 parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename rtl8723bu_update_rate_mask() to rtl8xxxu_gen2_update_rate_mask()
Jes Sorensen [Mon, 18 Apr 2016 15:49:21 +0000 (11:49 -0400)]
rtl8xxxu: Rename rtl8723bu_update_rate_mask() to rtl8xxxu_gen2_update_rate_mask()

Update the name of rtl8723bu_update_rate_mask() to make it reflect
it's applicable for all/most gen2 N parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: stop background scan when net device closed
Xinming Hu [Mon, 18 Apr 2016 13:42:55 +0000 (06:42 -0700)]
mwifiex: stop background scan when net device closed

Transmit data path should not touch background scan. We will stop
background scan when net device is closed.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add platform specific wakeup interrupt support
Xinming Hu [Mon, 18 Apr 2016 12:22:23 +0000 (05:22 -0700)]
mwifiex: add platform specific wakeup interrupt support

On some arm-based platforms, we need to configure platform specific
parameters by device tree node and also define our node as a child
node of parent SDIO host controller.
This patch parses these parameters from device tree. It includes
calibration data dowoload to firmware, wakeup pin configured to firmware,
and soc specific wake up gpio, which will be set as wakeup interrupt pin.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agodt: bindings: add MARVELL's sd8xxx wireless device
Xinming Hu [Mon, 18 Apr 2016 12:22:22 +0000 (05:22 -0700)]
dt: bindings: add MARVELL's sd8xxx wireless device

Add device tree binding documentation for MARVELL's sd8xxx
(sd8897 and sd8997) wlan chip.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmf: Fix null pointer exception in bcdc_hdrpull
Per Forlin [Sun, 17 Apr 2016 13:25:03 +0000 (15:25 +0200)]
brcmf: Fix null pointer exception in bcdc_hdrpull

In fwsignal.c: brcmf_fws_commit_skb()
...
if (rc < 0) {
  entry->transit_count--;
    if (entry->suppressed)
      entry->suppr_transit_count--;
      (void)brcmf_proto_hdrpull(fws->drvr, false, skb, NULL);
                                                     ^^^^^^^
    goto rollback;
}
...

The call to hdrpull will trigger a null pointer exception
unless a null check is made in the method implementation.

Signed-off-by: Per Forlin <per.forlin@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: add support for nl80211 BSS_SELECT feature
Arend van Spriel [Sun, 17 Apr 2016 14:44:58 +0000 (16:44 +0200)]
brcmfmac: add support for nl80211 BSS_SELECT feature

Announce support for nl80211 feature BSS_SELECT and process
BSS selection behaviour provided in .connect() callback.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Lei Zhang <leizh@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8821ae: Make sure loop counter is signed on all architectures
David Müller [Fri, 15 Apr 2016 06:50:25 +0000 (08:50 +0200)]
rtlwifi: rtl8821ae: Make sure loop counter is signed on all architectures

The for-loop condition does not work correctly on architectures where
"char" is unsigned. Fix it by using an "int", which may also result in
more efficient code.

Signed-off-by: David Müller <d.mueller@elsoft.ch>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoprism54: isl_38xx: Replace 'struct timeval'
Tina Ruchandani [Wed, 13 Apr 2016 06:09:16 +0000 (23:09 -0700)]
prism54: isl_38xx: Replace 'struct timeval'

'struct timeval' uses a 32-bit seconds field which will overflow in
year 2038 and beyond. This patch is part of a larger effort to remove
all instances of 'struct timeval' from the kernel and replace them
with 64-bit timekeeping variables.
The patch also fixes the debug printf specifier to avoid the
seconds value being truncated.
The patch was build-tested / debugged by removing the
"if VERBOSE > SHOW_ERROR_MESSAGES" guards.

Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl818x_pci: Fix a memory leak in rtl8180_init_rx_ring
Jia-Ju Bai [Fri, 18 Mar 2016 02:27:09 +0000 (13:27 +1100)]
rtl818x_pci: Fix a memory leak in rtl8180_init_rx_ring

When dev_alloc_skb or pci_dma_mapping_error in rtl8180_init_rx_ring fails,
the memory allocated by pci_zalloc_consistent is not freed.

This patch fixes the bug by adding pci_free_consistent
in error handling code.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: Fill in capability list
Bjorn Andersson [Tue, 19 Apr 2016 05:00:56 +0000 (22:00 -0700)]
wcn36xx: Fill in capability list

Fill in the capability list with more values from the downstream driver.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Correct remove bss key response encoding
Bjorn Andersson [Tue, 19 Apr 2016 05:00:55 +0000 (22:00 -0700)]
wcn36xx: Correct remove bss key response encoding

The WCN36XX_HAL_RMV_BSSKEY_RSP carries a single u32 with "status", so we
can use the standard status check function for decoding the result.

This is the last user of the v2 status checker, so remove the struct and
helper function.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Delete BSS before idling link
Bjorn Andersson [Tue, 19 Apr 2016 05:00:54 +0000 (22:00 -0700)]
wcn36xx: Delete BSS before idling link

When disabling the beacon we must delete the bss before idling the link.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Use correct command struct for EXIT_BMPS_REQ
Pontus Fuchs [Tue, 19 Apr 2016 05:00:53 +0000 (22:00 -0700)]
wcn36xx: Use correct command struct for EXIT_BMPS_REQ

EXIT_BMPS_REQ was using the command struct for ENTER_BMPS_REQ. I
spotted this when looking at command dumps.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Implement multicast filtering
Pontus Fuchs [Tue, 19 Apr 2016 05:00:52 +0000 (22:00 -0700)]
wcn36xx: Implement multicast filtering

Pass the multicast list to FW.

This patch also adds a way to build the smd command in place. This is
needed because the MC list command is too big for the stack.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
[bjorn: dropped FIF_PROMISC_IN_BSS usage]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Track association state
Pontus Fuchs [Tue, 19 Apr 2016 05:00:51 +0000 (22:00 -0700)]
wcn36xx: Track association state

Knowing the association state is needed for mc filtering.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Clear encrypt_type when deleting bss key
Pontus Fuchs [Tue, 19 Apr 2016 05:00:50 +0000 (22:00 -0700)]
wcn36xx: Clear encrypt_type when deleting bss key

This fixes a problem connecting to an open network after being
connected to an encrypted network.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Use allocated self sta index instead of hard coded
Pontus Fuchs [Tue, 19 Apr 2016 05:00:49 +0000 (22:00 -0700)]
wcn36xx: Use allocated self sta index instead of hard coded

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Copy all members in config_sta v1 conversion
Pontus Fuchs [Tue, 19 Apr 2016 05:00:48 +0000 (22:00 -0700)]
wcn36xx: Copy all members in config_sta v1 conversion

When converting to version 1 of the config_sta struct not all
members where copied. This fixes the problem of multicast frames
not being delivered on an encrypted network.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Parse trigger_ba response properly
Pontus Fuchs [Tue, 19 Apr 2016 05:00:47 +0000 (22:00 -0700)]
wcn36xx: Parse trigger_ba response properly

This message does not follow the canonical format and needs it's own
parser.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Remove sta pointer in private vif struct
Pontus Fuchs [Tue, 19 Apr 2016 05:00:46 +0000 (22:00 -0700)]
wcn36xx: Remove sta pointer in private vif struct

This does not work with multiple sta's in a vif.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Fetch private sta data from sta entry instead of from vif
Pontus Fuchs [Tue, 19 Apr 2016 05:00:45 +0000 (22:00 -0700)]
wcn36xx: Fetch private sta data from sta entry instead of from vif

For consistency with other code.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Add helper macros to cast sta to priv
Pontus Fuchs [Tue, 19 Apr 2016 05:00:44 +0000 (22:00 -0700)]
wcn36xx: Add helper macros to cast sta to priv

While poking at this I also change two related things. I rename one
variable to make the names consistent. I also move one assignment of
priv_sta to the declaration to save a few lines.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Use define for invalid index and fix typo
Pontus Fuchs [Tue, 19 Apr 2016 05:00:43 +0000 (22:00 -0700)]
wcn36xx: Use define for invalid index and fix typo

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Use consistent name for private vif
Pontus Fuchs [Tue, 19 Apr 2016 05:00:42 +0000 (22:00 -0700)]
wcn36xx: Use consistent name for private vif

Some code used priv_vif and some used vif_priv. Convert all to vif_priv
for consistency.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Add helper macros to cast vif to private vif and vice versa
Pontus Fuchs [Tue, 19 Apr 2016 05:00:41 +0000 (22:00 -0700)]
wcn36xx: Add helper macros to cast vif to private vif and vice versa

Makes the code a little easier to read.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Pad TIM PVM if needed
Pontus Fuchs [Tue, 19 Apr 2016 05:00:40 +0000 (22:00 -0700)]
wcn36xx: Pad TIM PVM if needed

The wcn36xx FW expects a fixed size TIM PVM in the beacon template. If
supplied with a shorter than expected PVM it will overwrite the IE
following the TIM.

Squashed with fix from Jason Mobarak <jam@cozybit.com>:
Patch "wcn36xx: Pad TIM PVM if needed" has caused a regression in mesh
beaconing.  The field tim_off is always 0 for mesh mode, and thus
pvm_len (referring to the TIM length field) and pad are both incorrectly
calculated.  Thus, msg_body.beacon_length is incorrectly calculated for
mesh mode. Fix this.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Jason Mobarak <jam@cozybit.com>
[bjorn: squashed in Jason's fixup]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowcn36xx: Clean up wcn36xx_smd_send_beacon
Pontus Fuchs [Tue, 19 Apr 2016 05:00:39 +0000 (22:00 -0700)]
wcn36xx: Clean up wcn36xx_smd_send_beacon

Needed for coming improvements. No functional changes.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
[bjorn: restored BEACON_TEMPLATE_SIZE define to 0x180]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards.
Vittorio Gambaletta (VittGam) [Mon, 11 Apr 2016 02:48:55 +0000 (04:48 +0200)]
ath9k: Fix LED polarity for some Mini PCI AR9220 MB92 cards.

The Wistron DNMA-92 and Compex WLM200NX have inverted LED polarity
(active high instead of active low).

The same PCI Subsystem ID is used by both cards, which are based on
the same Atheros MB92 design.

Cc: <linux-wireless@vger.kernel.org>
Cc: <ath9k-devel@qca.qualcomm.com>
Cc: <ath9k-devel@lists.ath9k.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: Add a module parameter to invert LED polarity.
Vittorio Gambaletta (VittGam) [Mon, 11 Apr 2016 02:48:54 +0000 (04:48 +0200)]
ath9k: Add a module parameter to invert LED polarity.

The LED can be active high instead of active low on some hardware.

Add the led_active_high module parameter. It defaults to -1 to obey
platform data as before.

Setting the parameter to 1 or 0 will force the LED respectively
active high or active low.

Cc: <linux-wireless@vger.kernel.org>
Cc: <ath9k-devel@qca.qualcomm.com>
Cc: <ath9k-devel@lists.ath9k.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agortl8xxxu: hide unused tables
Arnd Bergmann [Mon, 18 Apr 2016 21:59:31 +0000 (23:59 +0200)]
rtl8xxxu: hide unused tables

The references to some arrays in the rtl8xxxu driver were moved inside
of an #ifdef, but the symbols remain outside, resulting in build warnings:

rtl8xxxu/rtl8xxxu.c:1506:33: error: 'rtl8188ru_radioa_1t_highpa_table' defined but not used
rtl8xxxu/rtl8xxxu.c:1431:33: error: 'rtl8192cu_radioa_1t_init_table' defined but not used
rtl8xxxu/rtl8xxxu.c:1407:33: error: 'rtl8192cu_radiob_2t_init_table' defined but not used
rtl8xxxu/rtl8xxxu.c:1332:33: error: 'rtl8192cu_radioa_2t_init_table' defined but not used
rtl8xxxu/rtl8xxxu.c:239:35: error: 'rtl8192c_power_base' defined but not used
rtl8xxxu/rtl8xxxu.c:217:35: error: 'rtl8188r_power_base' defined but not used

This adds an extra #ifdef around them to shut up the warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2fc0b8e5a17d ("rtl8xxxu: Add TX power base values for gen1 parts")
Fixes: 4062b8ffec36 ("rtl8xxxu: Move PHY RF init into device specific functions")
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath10k: remove enum ath10k_swap_code_seg_bin_type
Kalle Valo [Wed, 20 Apr 2016 16:46:16 +0000 (19:46 +0300)]
ath10k: remove enum ath10k_swap_code_seg_bin_type

It's not needed for anything so just get rid of it.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: switch testmode to use ath10k_core_fetch_firmware_api_n()
Kalle Valo [Wed, 20 Apr 2016 16:46:01 +0000 (19:46 +0300)]
ath10k: switch testmode to use ath10k_core_fetch_firmware_api_n()

Now that all firmware-N.bin related are within struct ath10k_fw_file we can
switch to use ath10k_core_fetch_firmware_api_n() and delete almost identical
ath10k_tm_fetch_utf_firmware_api_2().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: move htt_op_version to struct ath10k_fw_file
Kalle Valo [Wed, 20 Apr 2016 16:45:47 +0000 (19:45 +0300)]
ath10k: move htt_op_version to struct ath10k_fw_file

Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: move wmi_op_version to struct ath10k_fw_file
Kalle Valo [Wed, 20 Apr 2016 16:45:33 +0000 (19:45 +0300)]
ath10k: move wmi_op_version to struct ath10k_fw_file

Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: move fw_features to struct ath10k_fw_file
Kalle Valo [Wed, 20 Apr 2016 16:45:18 +0000 (19:45 +0300)]
ath10k: move fw_features to struct ath10k_fw_file

Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: move fw_version inside struct ath10k_fw_file
Kalle Valo [Wed, 20 Apr 2016 16:45:05 +0000 (19:45 +0300)]
ath10k: move fw_version inside struct ath10k_fw_file

Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: refactor firmware images to struct ath10k_fw_components
Kalle Valo [Wed, 20 Apr 2016 16:44:51 +0000 (19:44 +0300)]
ath10k: refactor firmware images to struct ath10k_fw_components

To make it easier to share ath10k_core_fetch_board_data_api_n() with testmode.c
refactor all firmware components to struct ath10k_fw_components. This structure
will hold firmware related files, for example firmware-N.bin and board-N.bin.

For firmware-N.bin create a new struct ath10k_fw_file which contains the actual
firmware image as well as the parsed data from the image.

Modify ath10k_core_start() to take struct ath10k_fw_components() as an argument
which makes it possible in following patches to drop some ugly hacks from
testmode.c.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: remove deprecated firmware API 1 support
Kalle Valo [Wed, 20 Apr 2016 16:44:36 +0000 (19:44 +0300)]
ath10k: remove deprecated firmware API 1 support

This has ben deprecated years ago, I haven't heard anyone using it since and
most likely it won't even work anymore. So just remove all of it.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: remove duplicate assignment of variable ah
Colin Ian King [Sun, 10 Apr 2016 11:25:31 +0000 (12:25 +0100)]
ath9k: remove duplicate assignment of variable ah

ah is written twice with the same value, remove one of the
redundant assignments to ah.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: interpret requested txpower in EIRP domain
Zefir Kurtisi [Fri, 1 Apr 2016 09:37:08 +0000 (11:37 +0200)]
ath9k: interpret requested txpower in EIRP domain

Tx power limitations at upper layers are interpreted in
the EIRP domain. When the user requests a given maximum
txpower, e.g. with: 'iw phy0 set txpower fixed 1500',
he expects the EIRP to be at or below 15dBm.

In ath9k_hw_apply_txpower(), the interpretation is
different: the antenna-gain is capped against the
current txpower limit in the regulatory, but not
against the user set value. It ensures that the
resulting EIRP is below the limit defined by the
active countrycode, but not below the value the
user requested.

In a scenario like e.g.
 a) antenna_gain=6
 b) countrycode limits to eirp=18
 c) user set txpower=15
this will cause a setting for AR_PHY_POWER_TX_RATE
regs resulting in an EIRP > 15.

This patch ensures that antenna-gain is considered
whenever the txpower limit is adjusted and with that
the user set limits are kept.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k_htc: Replace a variable initialisation by an assignment in ath9k_htc_set_channel()
Markus Elfring [Fri, 1 Jan 2016 18:09:32 +0000 (19:09 +0100)]
ath9k_htc: Replace a variable initialisation by an assignment in ath9k_htc_set_channel()

Replace an explicit initialisation for one local variable at the beginning
by a conditional assignment.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: add dynamic tx mode switch config support for qca4019
Raja Mani [Tue, 12 Apr 2016 14:45:53 +0000 (20:15 +0530)]
ath10k: add dynamic tx mode switch config support for qca4019

push-pull mode needs certain amount the host driver involvement for
managing queues in the host memory and packet delivery to firmware.
qca4019 wifi firmware has an option to stay in push mode for less
number of active traffic flow and then switch to push-pull mode when
the active traffic flow goes beyond the certain limit.

The advantage of staying in push mode for less active traffic is, the
host cpu consumption is reduced. qca4019 firmware supports this
flexibility of the mode switch. It takes the host driver interest
(LOW_PERF/HIGH_PERF) via WMI_EXT_RESOURCE_CFG_CMDID,

 LOW_PERF  - fw would stay in push mode and switch to push-pull
               based on demand.
 HIGH_PERF - fw would stay in push-pull mode from the boot.

To make this configuration generic, new WMI services
WMI_SERVICE_TX_MODE_PUSH_ONLY, WMI_SERVICE_TX_MODE_PUSH_PULL,
WMI_SERVICE_TX_MODE_DYNAMIC are introduced to take dynamic tx mode
switch support availability in firmware.
Based on WMI_SERVICE_TX_MODE_DYNAMIC, LOW_PERF or HIGHT_PERF is
configured to the firmware.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Tamizh chelvam <c_traja@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: add some sanity checks to peer_map_event() functions
Dan Carpenter [Mon, 11 Apr 2016 08:15:20 +0000 (11:15 +0300)]
ath10k: add some sanity checks to peer_map_event() functions

Smatch complains that since "ev->peer_id" comes from skb->data that
means we can't trust it and have to do a bounds check on it to prevent
an array overflow.

Fixes: 6942726f7f7b ('ath10k: add fast peer_map lookup')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix rx_channel during hw reconfigure
Rajkumar Manoharan [Thu, 7 Apr 2016 06:41:54 +0000 (12:11 +0530)]
ath10k: fix rx_channel during hw reconfigure

Upon firmware assert, restart work will be triggered so that mac80211
will reconfigure the driver. An issue is reported that after restart
work, survey dump data do not contain in-use (SURVEY_INFO_IN_USE) info
for operating channel. During reconfigure, since mac80211 already has
valid channel context for given radio, channel context iteration return
num_chanctx > 0. Hence rx_channel is always NULL. Fix this by assigning
channel context to rx_channel when driver restart is in progress.

Cc: stable@vger.kernel.org
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix return value for btcoex and peer stats debugfs
Mohammed Shafi Shajakhan [Tue, 5 Apr 2016 15:28:26 +0000 (20:58 +0530)]
ath10k: fix return value for btcoex and peer stats debugfs

Return value is incorrect for btcoex and peer stats debugfs
'write' entries if the user provides a value that matches with
the already available debugfs entry, this results in the debugfs
entry getting stuck and the operation has to be terminated manually.
Fix this by returning the appropriate return 'count' as we do it for
other debugfs entries like pktlog etc.

Fixes: cc61a1bbbc0e ("ath10k: enable debugfs provision to enable Peer Stats feature")
Fixes: c28e6f06ff40 ("ath10k: fix sanity check on enabling btcoex via debugfs")
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agortl8xxxu: MAINTAINERS: Update to point to the active devel branch
Jes Sorensen [Thu, 14 Apr 2016 20:37:21 +0000 (16:37 -0400)]
rtl8xxxu: MAINTAINERS: Update to point to the active devel branch

Update the MAINTAINERS info to reflect active development of the
rtl8xxxu driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Pause TX before calling disable_rf()
Jes Sorensen [Thu, 14 Apr 2016 20:37:20 +0000 (16:37 -0400)]
rtl8xxxu: Pause TX before calling disable_rf()

All the disable_rf() functions were setting REG_TXPAUSE to 0xff to
stop transmission. Do it centrally before calling disable_rf()
instead.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Implement rtl8192e_enable_rf()
Jes Sorensen [Thu, 14 Apr 2016 20:37:19 +0000 (16:37 -0400)]
rtl8xxxu: Implement rtl8192e_enable_rf()

This implements an 8192eu specific enable_rf() function. The 8192eu is
not a combo device, so no need for doing the BT specific bits needed
by the 8723bu.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Fix OOPS if user tries to add device via /sys
Jes Sorensen [Thu, 14 Apr 2016 20:37:18 +0000 (16:37 -0400)]
rtl8xxxu: Fix OOPS if user tries to add device via /sys

This driver relies on driver_info in struct usb_device_id, so allowing
adding a device via /sys/bus/usb/drivers/rtl8xxxu/new_id will cause a
NULL pointer dereference.

Set .no_dynamic_id = 1 to disable hot add of USB IDs.

Reported-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Fix 8188RU support
Jes Sorensen [Thu, 14 Apr 2016 20:37:17 +0000 (16:37 -0400)]
rtl8xxxu: Fix 8188RU support

The 8188RU does not like PAPE to be enabled, while all the other gen1
parts seem to require it.

This makes the RTL8188RU able to associate for me.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Add TX power base values for gen1 parts
Jes Sorensen [Thu, 14 Apr 2016 20:37:16 +0000 (16:37 -0400)]
rtl8xxxu: Add TX power base values for gen1 parts

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Set register 0xfe10 on rtl8192cu based parts
Jes Sorensen [Thu, 14 Apr 2016 20:37:15 +0000 (16:37 -0400)]
rtl8xxxu: Set register 0xfe10 on rtl8192cu based parts

This register is undocumented in the vendor code, but it is set
unconditionally for all 8192cu/8188cu/8188ru parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Update copyright statement to include 2016
Jes Sorensen [Thu, 14 Apr 2016 20:37:14 +0000 (16:37 -0400)]
rtl8xxxu: Update copyright statement to include 2016

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Unregister from mac80211 before shutting down the device
Jes Sorensen [Thu, 14 Apr 2016 20:37:13 +0000 (16:37 -0400)]
rtl8xxxu: Unregister from mac80211 before shutting down the device

This fixes a long standing bug where mac80211 would send disconnect
packets to the device, after we had shut down the device.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Match 8723bu power down sequence to vendor driver
Jes Sorensen [Thu, 14 Apr 2016 20:37:12 +0000 (16:37 -0400)]
rtl8xxxu: Match 8723bu power down sequence to vendor driver

In particular set APS_FSMCO_WLON_RESET in the right register, and do
not overwrite too much of REG_CR.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Use rtl_chip == RTL8188R to identify high PA parts
Jes Sorensen [Thu, 14 Apr 2016 20:37:11 +0000 (16:37 -0400)]
rtl8xxxu: Use rtl_chip == RTL8188R to identify high PA parts

This is simpler than checking for RTL8188C && hi_pa.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Apply 8188RU workaround for UMC B cut parts correctly
Jes Sorensen [Thu, 14 Apr 2016 20:37:10 +0000 (16:37 -0400)]
rtl8xxxu: Apply 8188RU workaround for UMC B cut parts correctly

This patch was being missed since rtl_chip will never match RTL8188C
if hi_pa is true.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: For devices with external PA (8188RU), limit CCK TX power
Jes Sorensen [Thu, 14 Apr 2016 20:37:09 +0000 (16:37 -0400)]
rtl8xxxu: For devices with external PA (8188RU), limit CCK TX power

Per the vendor driver, devices with an external PA needs limiting it's
TX power to 0x20.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Move PHY RF init into device specific functions
Jes Sorensen [Thu, 14 Apr 2016 20:37:08 +0000 (16:37 -0400)]
rtl8xxxu: Move PHY RF init into device specific functions

Load the RF table in init_phy_rf(), which allows for applying device
specific RF hacks in the same place. Getting rid of more ugly if ()
clutter.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: fix uninitialized return value in ret
Colin Ian King [Thu, 14 Apr 2016 20:37:07 +0000 (16:37 -0400)]
rtl8xxxu: fix uninitialized return value in ret

several functions are not initializing a return status in ret
resulting in garbage to be returned instead of 0 for success.
Currently, the calls to these functions are not checking the
return, however, it seems prudent to return the correct status
in case they are to be checked at a later date.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Mark 0x050d:0x1004 as tested
Jes Sorensen [Thu, 14 Apr 2016 20:37:06 +0000 (16:37 -0400)]
rtl8xxxu: Mark 0x050d:0x1004 as tested

This dongle was tested successfully by Andrea Merello

Reported-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoRe-enable 8192eu support
Jes Sorensen [Thu, 14 Apr 2016 18:59:07 +0000 (14:59 -0400)]
Re-enable 8192eu support

Revert "rtl8xxxu: Temporarily disable 8192eu device init"

This reverts commit ccfe1e85322090649d2fae599e55300c1512bf15.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: 8192eu Fix bug in LDPC RX hang fix
Jes Sorensen [Thu, 14 Apr 2016 18:59:06 +0000 (14:59 -0400)]
rtl8xxxu: 8192eu Fix bug in LDPC RX hang fix

Write the adjusted value back to the correct register

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Remove unneeded 8192eu hack
Jes Sorensen [Thu, 14 Apr 2016 18:59:05 +0000 (14:59 -0400)]
rtl8xxxu: Remove unneeded 8192eu hack

This removes an unneeded hack for 8192eu, and allows for initializing
REG_FPGA0_XAB_RF_SW_CTRL at the same point as it is done for all other
parts.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Split USB quirks into gen1 and gen2 quirks
Jes Sorensen [Thu, 14 Apr 2016 18:59:04 +0000 (14:59 -0400)]
rtl8xxxu: Split USB quirks into gen1 and gen2 quirks

This removes a bunch of if () spaghetti and re-applies the USB bus
quirks for 8188/8192 that had gotten lost.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Make PBP tuning a fileops parameter
Jes Sorensen [Thu, 14 Apr 2016 18:59:03 +0000 (14:59 -0400)]
rtl8xxxu: Make PBP tuning a fileops parameter

Rather than scattering the code with #ifdefs, use the fileops
structure to hold device specific PBP values.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Do not backup RF_MODE_AG when it's never being used
Jes Sorensen [Thu, 14 Apr 2016 18:59:02 +0000 (14:59 -0400)]
rtl8xxxu: Do not backup RF_MODE_AG when it's never being used

This was expired by the vendor driver, but we never ended up using the
backed up value.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Store device specific TRXFF boundary in the fileops
Jes Sorensen [Thu, 14 Apr 2016 18:59:01 +0000 (14:59 -0400)]
rtl8xxxu: Store device specific TRXFF boundary in the fileops

This removes another case of ugly if () clutter

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: REG_LDOA15_CTRL is only used on gen1 parts
Jes Sorensen [Thu, 14 Apr 2016 18:59:00 +0000 (14:59 -0400)]
rtl8xxxu: REG_LDOA15_CTRL is only used on gen1 parts

Move setting it to rtl8723au_init_phy_bb()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Move loading of AGC table to device specific function
Jes Sorensen [Thu, 14 Apr 2016 18:58:59 +0000 (14:58 -0400)]
rtl8xxxu: Move loading of AGC table to device specific function

This moves the loading of the AGC table into init_phy_bb() and reduces
the if() clutter.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Load AGC table before patching for 1T2R parts
Jes Sorensen [Thu, 14 Apr 2016 18:58:58 +0000 (14:58 -0400)]
rtl8xxxu: Load AGC table before patching for 1T2R parts

This should get the order right and avoid patching something that is
later overwritten.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Split rtl8xxxu_init_phy_bb() into device specific functions
Jes Sorensen [Thu, 14 Apr 2016 18:58:57 +0000 (14:58 -0400)]
rtl8xxxu: Split rtl8xxxu_init_phy_bb() into device specific functions

This reduces the if () clutter. Longer term it probably makes sense to
split this between gen1 (8723au/8188cu/8192cu) and gen2
(8192eu/8723bu) devices.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>