Marek Kwaczynski [Sat, 24 Jan 2015 10:14:53 +0000 (12:14 +0200)]
ath10k: fix pmf for wmi-tlv on qca6174
New wmi-tlv firmware uses HTT 3.0 protocol which
uses TX_FRM command for management frames (instead
of a dedicated command). To support PMF it is
necessary to provide explicit tailroom.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Marek Kwaczynski [Sat, 24 Jan 2015 10:14:53 +0000 (12:14 +0200)]
ath10k: remove sw encryption for pmf
Software encryption was never necessary.
Tested with fw 636 and fw 10.x.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:52 +0000 (12:14 +0200)]
ath10k: disable uapsd autotrigger
Only userspace can make an educated decision when
a trigger frame is required so make sure the
autotrigger service is disabled.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Janusz Dziedzic [Sat, 24 Jan 2015 10:14:52 +0000 (12:14 +0200)]
ath10k: implement uapsd autotrigger command
New wmi-tlv firmware for qca6174 has u-UAPSD
autotrigger service. If it is enabled firmware
generates trigger frames automatically as
configured.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:51 +0000 (12:14 +0200)]
ath10k: fix nullfunc workaround
The workaround couldn't work correctly because the
802.11 header wasn't properly stripped of QoS Data
bit so it wasn't recognized in the later parts of
tx path as NullFunc frame and ended up in HTT Tx
instead of HTT Mgmt Tx.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:51 +0000 (12:14 +0200)]
ath10k: fix dtim period with beacon templates
Firmware supporting beacon templates (i.e. wmi-tlv
for qca6174) doesn't implicitly take dtim period
from the template. Instead it requires vdev param
to be set accordingly.
This fixes dtim period being stuck at 3.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:49 +0000 (12:14 +0200)]
ath10k: add support for qca6174
The QCA6174 in combination with new wmi-tlv firmware is capable of
multi-channel, beamforming, tdls and other features.
This patch just makes it possible to boot these devices and do some basic stuff
like connect to an AP without encryption. Some things may not work or may be
unreliable. New features will be implemented later. This will be addressed
eventually with future patches.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:48 +0000 (12:14 +0200)]
ath10k: add support for qca6174 Rx descriptors
The QCA6174 chip has an extra 4 bytes in
rx_ppdu_end structure which is used in htt_rx_desc
and HTT Rx ring offset setup. This is necessary
for correct Rx for QCA6174 (otherwise Rx
descriptors are overwritten and corrupted).
This means QCA988X will have an extra 4 byte
padding in Rx descriptor layout which is harmless.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:48 +0000 (12:14 +0200)]
ath10k: reset chip before reading chip_id in probe
There are some very rare cases with some hardware
configuration that the device doesn't init quickly
enough in which case reading chip_id yielded 0.
This caused driver to subsequently fail to setup
the device.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Sat, 24 Jan 2015 10:14:48 +0000 (12:14 +0200)]
ath10k: implement rx reorder support
New firmware and firmware (qca6174 hw3.0+ and fw
266+) are capable of full aggregation rx
reordering. If it's enabled then Rx is handled via
a new, separate htt event.
The rx ring behaviour is changed a little to
support the new rx scheme. These changes shouldn't
affect qca988x performance.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
John W. Linville [Mon, 12 Jan 2015 21:07:02 +0000 (16:07 -0500)]
ath10k: document switch case fall-through in __ath10k_scan_finish
Add a comment for indicating that the ATH10K_SCAN_RUNNING case falls
through to the ATH10K_SCAN_ABORTING case in __ath10k_scan_finish. This
will document that the lack of a break is intentional.
Michal Kazior [Mon, 12 Jan 2015 14:29:37 +0000 (15:29 +0100)]
ath10k: prevent fw reg dump spam
Originally the explicit fw register dump was added
to wait_for_target_init because interrupts are
masked early during power_up.
Due to some changes in power_up/reset sequences
sometimes when fw crashed ath10k would print the
dump more than once via hif_stop -> warm_reset ->
wait_for_target_init, possibly with different
values each.
Prevent this by doing the explicit fw register
dump only during power_up instead of
wait_for_target_init.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
The duty cycle (% of quiet duration) is used to put the device
in quiet mode for the given period. Currently the quiet duration
is wrongly calculated which results in not enabling quiet mode.
Fix the calculation as below
duration = (period * duty cycle) / 100
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 13 Jan 2015 14:30:12 +0000 (16:30 +0200)]
ath10k: implement support for ap beacon offloading
New firmware revisions support beacon and probe
response templates instead. This means SWBA events
are no longer delivered for these firmware
revisions.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
When replenishing Rx buffers driver updates the address of the
buffer and the index of rx buffer in rx ring to the firmware.
Change in order by CPU can cause rx ring corruption. Add memory
barrier before updating rx buffer index to guarantee the order.
This could fix some instances of rx ring corruption due to done
bit in rx attention flag not set.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
wait_for_completion_timeout does not return negative values so the tests
for <= 0 are not needed and the case differentiation in the error handling
path unnecessary.
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Thu, 8 Jan 2015 10:36:56 +0000 (11:36 +0100)]
ath10k: fill max_num_vdevs for wmi-tlv
Recent commit 30c78167bc6536d9074aa79385a575596343bf69 ("ath10k:
set max_num_vdevs based on wmi op version")
skipped wmi-tlv case and left max_num_vdevs reset.
Make sure it is properly set.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Add per station debugfs files when a station is added to mac80211's
station list. This helps to group peer specific debugfs entries
altogether. Right now this callback adds support to test aggregation
procedures (addba/addba_resp/delba) manually.
To enable automatic aggregation in target,
echo 0 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/aggr_mode
For manual mode,
echo 1 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
stations/XX:XX:XX:XX:XX:XX/aggr_mode
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Sujith Manoharan [Mon, 12 Jan 2015 10:30:02 +0000 (12:30 +0200)]
ath10k: Enable RX batching
This feature allows the FW to batch RX indications,
reducing the rate of host interrupt generation, which
in turn reduces CPU load. Currently, this is enabled
only for the 10.2 firmware.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Sujith Manoharan [Mon, 12 Jan 2015 10:30:02 +0000 (12:30 +0200)]
ath10k: Fix DMA burst size
A value of zero indicates that 128B is the maximum
DMA request size for read/writes. But PCI cards based
on AR9880 can support 256B, so enable this for
the 10.2 firmware.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Larry Finger [Tue, 6 Jan 2015 15:58:06 +0000 (09:58 -0600)]
rtlwifi: rtl8192c-common: Convert driver to use common DM table initialization
These changes convert both rtl8192ce and rtl8192cu to use the new routine.
Some additional definitions are needed in the core, thus several of the
headers for other drivers are affected, but no other executable code is
changed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Tue, 6 Jan 2015 15:58:04 +0000 (09:58 -0600)]
rtlwifi: Create new routine to initialize the DM tables
Each of the drivers contains a routine that initializes the dm_digtable
member of the driver's private area. As a first step toward reducing the
size of the drivers, a copy of this driver is created in rtlwifi, and the
definitions of the parameters are moved there.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Ram Amrani [Mon, 29 Dec 2014 06:24:04 +0000 (08:24 +0200)]
wlcore: add ability to reduce FW interrupts during suspend
Add the ability to mask FW interrupts on RX BA activity, PSM
entry/exit and fast-link notifications. This is used when the host
is suspended in order to decrease redundant wake ups.
Signed-off-by: Ram Amrani <ramrani@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chen Gang [Wed, 24 Dec 2014 15:08:44 +0000 (23:08 +0800)]
wil6210: use 'uint64_t' instead of 'cycles_t' to avoid warnings
do_div() checks the type strictly. 'cycles_t' may be 32-bit under quite
a few architectures (parisc, arm, avr32 ...). So use 'uint64_t' instead
of, the related warning (with allmodconfig under parisc):
CC [M] drivers/net/wireless/ath/wil6210/debugfs.o
In file included from arch/parisc/include/generated/asm/div64.h:1:0,
from include/linux/kernel.h:124,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
drivers/net/wireless/ath/wil6210/debugfs.c: In function ‘wil_vring_debugfs_show’:
include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
do_div(idle, total);
^
In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from ./include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/asm-generic/div64.h:44:18: warning: right shift count >= width of type [-Wshift-count-overflow]
if (likely(((n) >> 32) == 0)) { \
^
include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
# define likely(x) __builtin_expect(!!(x), 1)
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
do_div(idle, total);
^
In file included from arch/parisc/include/generated/asm/div64.h:1:0,
from include/linux/kernel.h:124,
from include/linux/list.h:8,
from include/linux/module.h:9,
from drivers/net/wireless/ath/wil6210/debugfs.c:17:
include/asm-generic/div64.h:48:22: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [-Wincompatible-pointer-types]
__rem = __div64_32(&(n), __base); \
^
drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
do_div(idle, total);
^
include/asm-generic/div64.h:35:17: note: expected ‘uint64_t * {aka long long unsigned int *}’ but argument is of type ‘cycles_t * {aka long unsigned int *}’
extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
^
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Wed, 31 Dec 2014 10:36:44 +0000 (02:36 -0800)]
mwifiex: Increase priority of firmware download message
When driver is loaded, it is important to know if FW was already
active or it is freshly downloaded. This patch increases the
priority of these messages.
Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Marc Yang [Wed, 31 Dec 2014 10:36:40 +0000 (02:36 -0800)]
mwifiex: increase delay during card reset
200ms is the requirement to allow VDD1.1 and VDD1.8 to
drop to have proper reset.
Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Marc Yang [Wed, 31 Dec 2014 10:36:39 +0000 (02:36 -0800)]
mwifiex: Adjust calling place of mwifiex_terminate_workqueue
Workqueue needs to be flushed early when removing card, otherwise
soft lockup issue may happen because main_process is triggered by
interrupt while card is being removed.
Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Avinash Patil [Fri, 26 Dec 2014 11:02:34 +0000 (03:02 -0800)]
mwifiex: get supported BA stream info from FW
This patch adds support to get number of BA streams
supported information from FW. Some newer chips(e.g. 8897 series)
support 4 BA streams for TX; so driver should not disallow BA stream
setup just after 2 streams have been established.
Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Fri, 26 Dec 2014 11:02:32 +0000 (03:02 -0800)]
mwifiex: do not send key material cmd when delete wep key
This patch fixes memory corruption reported by community developer.
"Memory corruption occurs in mwifiex_ret_802_11_key_material_v1()
when a short command response is received without a key length
causing non initialised memory to be interpreted as the key
length resulting in a memcpy() overwriting the part of the
driver's private data structure beyond the key area."
For v1 key material API firmwares, there is no need to send
command to delete WEP key. WEP encryption/decryption is controlled
by mac_control command.
This patch avoids sending key material command in del_key case.
Reported-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend van Spriel [Tue, 23 Dec 2014 18:04:23 +0000 (19:04 +0100)]
brcmfmac: Add support for bcm43340/1 wireless chipsets
This patch adds support for the bcm43340 and bcm43341 wireless
chipsets. These two chipsets are identical from wireless parts
perspective. As such they use the same firmware image.
Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Rob Herring <rob.herring@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
[arend@broadcom.com: squash to single commit, remove 43341 chipid] Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Avinash Patil [Tue, 23 Dec 2014 13:44:12 +0000 (19:14 +0530)]
mwifiex: module parameter for deep sleep configuration
This patch adds module parameter for auto deepsleep configuration.
By default, module_param is 0 and auto deep sleep is enabled.
If mwifiex driver is loaded with disable_auto_ds=1, deep sleep
configuration would not be downloaded to FW and FW would not enter
deepsleep upon initializing.
Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Tue, 23 Dec 2014 13:44:11 +0000 (19:14 +0530)]
mwifiex: save sdio register values before firmware dump
This patch saves sdio registers value before firmware dump,
this can be used to find out reason for FW dump.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Tue, 23 Dec 2014 13:44:10 +0000 (19:14 +0530)]
mwifiex: save driver information to file when firmware dump
This patch adds support to dump driver information to a file
when firmware dump happens. This information can be used to
root casue FW crash.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Tue, 23 Dec 2014 13:44:09 +0000 (19:14 +0530)]
mwifiex: move debug_data dump function to common utililty file
mwifiex_debug_info also need be save to file when firmware dump happens.
Move its dump implementation function to commmon utilility file, thus it
can be reused in firmware dump function.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Tue, 23 Dec 2014 13:44:08 +0000 (19:14 +0530)]
mwifiex: move pm_wakeup_card_complete definition to usb.c
Move mwifiex_pm_wakeup_card_complete handler to source file.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>