Arend van Spriel [Sat, 10 Aug 2013 10:27:19 +0000 (12:27 +0200)]
brcmfmac: use irq safe spinlock in brcmf_sdbrcm_txdata()
Firmware-signalling needs transmit to firmware to be atomic and
uses a spinlock with irq disabled. Therefor, brcmf_sdbrcm_txdata()
should not use spin_unlock_bh() as it would enable the interrupts.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 15 Aug 2013 19:55:10 +0000 (15:55 -0400)]
Merge tag 'nfc-next-3.12-1' of git://git./linux/kernel/git/sameo/nfc-next
Samuel Ortiz <sameo@linux.intel.com> says:
"This is the first NFC pull request for the 3.12 release.
With this one we have:
- A few pn533 improvements and minor fixes. Testing our pn533 driver
against Google's NCI stack triggered a few issues that we fixed now.
We also added Tx fragmentation support to this driver.
- More NFC secure element handling. We added a GET_SE netlink command
for getting all the discovered secure elements, and we defined 2
additional secure element netlink event (transaction and connectivity).
We also fixed a couple of typos and copy-paste bugs from the secure
element handling code.
- Firmware download support for the pn544 driver. This chipset can enter a
special mode where it's waiting for firmware blobs to replace the
already flashed one. We now support that mode."
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 15 Aug 2013 19:54:06 +0000 (15:54 -0400)]
Merge branch 'for-linville' of git://github.com/kvalo/ath
Arron Wang [Tue, 30 Jul 2013 12:40:05 +0000 (14:40 +0200)]
NFC: Update secure element state
The secure element state was not updated from the enable/disable ops,
leaving the SE state to disabled for ever.
Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Arron Wang [Tue, 30 Jul 2013 12:35:35 +0000 (14:35 +0200)]
NFC: Fix secure element state check
Another typo from the initial commit where we check for the secure
element type field instead of its state when enabling or disabling it.
Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Dan Carpenter [Mon, 17 Jun 2013 22:48:26 +0000 (01:48 +0300)]
NFC: hci: Fix enable/disable confusion
There is a cut and paste bug so we enable a second time instead of
disabling.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Eric Lapuyade [Fri, 19 Jul 2013 12:59:45 +0000 (14:59 +0200)]
NFC: pn544: i2c: Add firmware download implementation for pn544
The pn544 can enter a firmware update mode where firmware blobs can be
pushed through the i2c line and flashed on the target.
A special command allows to verify that blobs are correctly flashed and
this is what we do for every downloaded firmware blob.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Eric Lapuyade [Fri, 19 Jul 2013 12:58:39 +0000 (14:58 +0200)]
NFC: pn544: Add firmware operations hci ops
The firmware operation callback is passed by the physical layer to the
hci driver during probe. All the driver does is to store it and call it
when the fw_upload hci ops is invoked.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Eric Lapuyade [Fri, 19 Jul 2013 12:57:55 +0000 (14:57 +0200)]
NFC: netlink: Add result of firmware operation to completion event
Result is added as an NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS attribute
containing the standard errno positive value of the completion result.
This event will be sent when the firmare download operation is done and
will contain the operation result.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Eric Lapuyade [Fri, 19 Jul 2013 12:57:13 +0000 (14:57 +0200)]
NFC: pn544: i2c: Add firmware download mode power-on support
This is in preparation for pn544-i2c firmware download feature, where we
need to know if we're in regular or firmware upload mode.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Eric Lapuyade [Fri, 19 Jul 2013 12:56:08 +0000 (14:56 +0200)]
NFC: Move nfc_fw_download_done() definition from private to public
This API must be called by NFC drivers, and its prototype was
incorrectly placed.
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 3 Jul 2013 13:14:17 +0000 (15:14 +0200)]
NFC: pn533: Add some polling entropy
By not always starting the polling loop from the same modulation, we
avoid entering infinite loops where devices exporting 2 targets (on 2
different modulations) get the same target activated over and over.
If this target is not readable (e.g. a wallet emulating a tag), we will
stay in an error loop for ever.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 3 Jul 2013 12:50:36 +0000 (14:50 +0200)]
NFC: pn533: Add delay between each poll frame
It seems that some pn533 firmwares go belly up when being asked to send
poll frames too frequently. Adding a 10ms delay between each of them
calm the chip down and prevent it from crashing.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 24 Jul 2013 16:10:50 +0000 (18:10 +0200)]
NFC: Add a GET_SE netlink API
In order to fetch the discovered secure elements from an NFC controller,
we need to send a netlink command that will dump the list of available
SEs from NFC.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 24 Jul 2013 12:49:22 +0000 (14:49 +0200)]
NFC: Fix SE discovery failure warning condition
This is a typo coming from the initial implementation. se_discover fails
when it returns something different than zero and we should only display
a warning in that case.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Olivier Guiter [Thu, 13 Jun 2013 13:43:29 +0000 (13:43 +0000)]
NFC: pn533: Store the correct frame size (normal vs ext)
The extended information frame are sent by PN533 to exchange frames
larger than 255 bytes. These extended frame are very close from the
standard ones except for the header size length. On each incoming
frame, we set the correct header length, and we do that only for the
standard pn533 chipsets as the acr122 does not seem to support extended
frames properly.
Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Olivier Guiter [Thu, 13 Jun 2013 13:43:28 +0000 (13:43 +0000)]
NFC: pn533: Split large Tx frames in chunks
On sending large frames (size > 262), we split it in multiple chunks and
send them asynchronously with MI bit.
Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Olivier Guiter [Thu, 13 Jun 2013 13:43:27 +0000 (15:43 +0200)]
NFC: pn533: Add extended information frame decoding support
Extended Information frames are slightly different from standard frames
as they can (theorically) handle datas up tu 64kB. PN533 firmware only
supports packet data up to 265 (incl. TFI byte)
This kind of frame are used when the pn533 wants to exchange more than
255 bytes, and this patch handles the reception of such frames.
Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Mon, 1 Jul 2013 15:26:58 +0000 (17:26 +0200)]
NFC: pn533: Enable AUTO RFCA
The AUTO RFCA bit forbids the pn533 chipset to turn its radio on
whenever an external field is present.
Without this bit set, some devices seems to get over flood by the
pn533 rf field and thus become hardly detectable.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Mon, 1 Jul 2013 08:58:12 +0000 (10:58 +0200)]
NFC: pn533: Unconditionaly select the highest p2p bit rate
p2p devices must be able to support 424 kbps, so we should always select
that bitrate in initiator mode.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Fri, 28 Jun 2013 13:43:19 +0000 (15:43 +0200)]
NFC: pn533: Request System code from SENSF_REQ
Some devices are getting confused when not being asked for their system
code with type F.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 26 Jun 2013 16:16:21 +0000 (18:16 +0200)]
NFC: pn533: Fix the pn533 polling loop
By turning the radio off after each failed polling try, we dramatically
improve the pn533 polling loop efficiency.
Without this fix, all Android phones running the broadcom NFC stack are
almost never detected.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Wed, 26 Jun 2013 15:53:09 +0000 (17:53 +0200)]
NFC: pn533: Fix hardware busy loop when establishing the LLCP link
By using the standard setting for the regular pn533 dongles, we no
longer wait for ever for an ATR_RES. Without this, a failing ATR_REQ
will put the hardware into a busy loop, constantly waiting for an
ATR_RES.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Tue, 25 Jun 2013 14:22:08 +0000 (16:22 +0200)]
NFC: Define secure element connectivity and transaction events
The SE_CONNECTIVITY event is for an SE to request connection to e.g. a
modem. The SE_TRANSACTION one is sent when an application running on a
specific SE wants to notify the host CPU about the end of a transaction.
Those events respectively map to the EVT_CONNECTIVITY and the
EVT_TRANSACTION HCI events.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Tue, 25 Jun 2013 10:42:54 +0000 (12:42 +0200)]
NFC: Document secure element addition/removal netlink events
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Mon, 24 Jun 2013 12:39:35 +0000 (14:39 +0200)]
MAINTAINERS: Change the NFC subsystem status to Supported
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Thierry Escande [Mon, 24 Jun 2013 10:02:28 +0000 (12:02 +0200)]
NFC: Fix missing static declarations
This patch fixes 3 sparse warnings:
nfcsim.c:63:25: sparse: symbol 'wq' was not declared.
nfcsim.c:484:12: sparse: symbol 'nfcsim_init' was not declared.
nfcsim.c:525:13: sparse: symbol 'nfcsim_exit' was not declared.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Bing Zhao [Sat, 10 Aug 2013 04:09:06 +0000 (21:09 -0700)]
mwifiex: fix build error when CONFIG_PM is not set
config: make ARCH=m68k allmodconfig
All error/warnings:
drivers/net/wireless/mwifiex/cfg80211.c: In function
'mwifiex_fill_coalesce_rule_info':
>> drivers/net/wireless/mwifiex/cfg80211.c:2493:3: error: implicit
declaration of function 'mwifiex_is_pattern_supported'
[-Werror=implicit-function-declaration]
drivers/net/wireless/mwifiex/cfg80211.c: At top level:
drivers/net/wireless/mwifiex/cfg80211.c:2537:12: warning:
'mwifiex_cfg80211_set_coalesce' defined but not used
[-Wunused-function]
cc1: some warnings being treated as errors
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 7 Aug 2013 07:24:30 +0000 (12:54 +0530)]
ath9k: Run the LNA combining algorithm properly
The LNA combining algorithm has to be run for cards
that support the required diversity features, make
sure that that correct conditions are met before
enabing this algorithm.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 7 Aug 2013 06:59:27 +0000 (12:29 +0530)]
ath9k: Fix BTCOEX usage for RX diversity
BTCOEX has to be *disabled* for WLAN RX diversity to
work on combo cards.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:13 +0000 (14:18 +0200)]
ath9k: use software queueing for multicast traffic
Create a per-vif dummy node entry for keeping the multicast software
queues. This helps in setups with a lot of mulitcast traffic that could
otherwise potentially drown out unicast traffic to stations.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:12 +0000 (14:18 +0200)]
ath9k: improve tx scheduling fairness
Instead of trying to schedule the same TID multiple times in a loop,
iterate over other TIDs/stations first.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:11 +0000 (14:18 +0200)]
ath9k: use software queues for un-aggregated data packets
This is a first step for improving fairness between legacy and 802.11n
traffic, and it should also improve reliability of resets and channel
changes by keeping the hardware queue depth very short.
When an aggregation session is torn down, all packets in the retry queue
will be removed from the BAW and freed.
For all subframes that have not been transmitted yet, the A-MPDU flag
will be cleared, and a sequence number allocated. This ensures that the
next A-MPDU session will get the correct initial sequence number.
This happens both on aggregation session start and stop.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:10 +0000 (14:18 +0200)]
ath9k: always clear ps filter bit on new assoc
Otherwise in some cases, EAPOL frames might be filtered during the
initial handshake, causing delays and assoc failures.
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:09 +0000 (14:18 +0200)]
ath9k: fix clearing expired A-MPDU subframes in tx completion
When the tid aggregation state has been marked as inactive, free
completed tx packets immediately. When a new aggregation session has not
been initialized yet, the BAW checks do not recognize it as expired.
Might fix potential stalls in setting up a new aggregation session.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:08 +0000 (14:18 +0200)]
ath9k: prepare queueing code for handling unaggregated traffic
- Allow ath_tx_get_tid_subframe to return non-AMPDU subframes.
- Reset the tid paused state on aggregation stop
- Initialize software queues even when HT is not supported
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:07 +0000 (14:18 +0200)]
ath9k: fix block ack window tracking check
When a packet has been tracked as part of the BlockAck window and added
to the hardware queue, it can end up back in the TID queue again with
fi->retries still set to 0 (e.g. if the frame was filtered). Keep an
extra bit for the BAW tracking status to fix this corner case.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:06 +0000 (14:18 +0200)]
ath9k: simplify ath_tx_form_aggr
The check for ATH_AMPDU_SUBFRAME_DEFAULT is unnecessary, since it's set
to half the maximum BlockAck Window size, which is already the maximum
value that h_baw could possibly have. Also remove unnecessary variables.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:05 +0000 (14:18 +0200)]
ath9k: add CAB queue info to debugfs
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:04 +0000 (14:18 +0200)]
ath9k: add function for getting the tx tid for a packet
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:03 +0000 (14:18 +0200)]
ath9k: split tid retry packets into a separate queue
Improves packet retry order and helps with further tx queueing
improvements.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 6 Aug 2013 12:18:02 +0000 (14:18 +0200)]
ath9k: add utility functions for accessing tid queues
Useful for further fixes / cleanups
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 6 Aug 2013 09:13:19 +0000 (11:13 +0200)]
brcmfmac: use CFG80211_TESTMODE_CMD
This is essentially the same, but written shorter.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jingoo Han [Tue, 6 Aug 2013 08:36:03 +0000 (17:36 +0900)]
net: wireless: rt2x00: Staticize rt2x00queue_pause_queue_nocheck()
rt2x00queue_pause_queue_nocheck()is used only in this file.
Fix the following sparse warning:
drivers/net/wireless/rt2x00/rt2x00queue.c:939:6: warning: symbol 'rt2x00queue_pause_queue_nocheck' was not declared. Should it be
static?
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Tue, 6 Aug 2013 07:14:15 +0000 (12:44 +0530)]
ath9k: Fix build failure
Make sure that CONFIG_ATH9K_BTCOEX_SUPPORT is used for
the WLAN/BT RX diversity hooks.
Reported by the kernel build testing backend.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 6 Aug 2013 01:52:00 +0000 (18:52 -0700)]
mwifiex: add packet coalesce support
Coalesce filters are configured in firmware based on settings
received from cfg80211.
Packet type which is required by firmware is determined based on
provided patterns in a rule:
Unicast: if pattern '01' with offset 0 is found
Multicast: if pattern '33:33' or '01:00:5e' with offset 0 is found
Broadcast: if pattern 'ff:ff:ff:ff' with offset 0 is found
Some example coalesce configuration files:
1) Coalesce Rx data packets from 192.168.0.88
mac address of our device is 00:50:43:21:53:7A
Source IP address offset comes out as 52 after following
calculations:
32 bytes of HW 802.11 header + 8 bytes LLC +
12 bytes in IPV4 header till source IP address
Destination mac is at offset 6 in HW header.
delay=100
condition=1
patterns=01,6+00:50:43:22,10+53:7A,52+c0:a8:00:58
2) Coalesce all broadcast and multicast packets(Multiple packet
types are not allowed in a single rule. Hence created separate
rules)
delay=400
condition=1
patterns=33:33
delay=400
condition=1
patterns=ff:ff:ff:ff
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 6 Aug 2013 01:51:59 +0000 (18:51 -0700)]
mwifiex: increase max supported pattern offset
The offset number is increased to accomodate requests from
user to match more fields in a Rx packet.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 6 Aug 2013 01:51:58 +0000 (18:51 -0700)]
mwifiex: modify mwifiex_is_pattern_supported() routine
It is modified so that it can be reused for coalesce feature.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Tue, 6 Aug 2013 01:51:57 +0000 (18:51 -0700)]
mwifiex: rename mef macros
Their names were generic. We need to define similar macros
for coalesce feature. Hence they are renamed here.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Fri, 9 Aug 2013 19:08:10 +0000 (15:08 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next
John W. Linville [Fri, 9 Aug 2013 19:07:23 +0000 (15:07 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next
John W. Linville [Fri, 9 Aug 2013 19:06:28 +0000 (15:06 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless
Mohammed Shafi Shajakhan [Mon, 5 Aug 2013 04:49:22 +0000 (10:19 +0530)]
ath6kl: Fix invalid pointer access on fuzz testing with AP mode
In our Fuz testing, reference client corrupts the dest mac to "00:00:00:00:00:00"
in the WPA2 handshake no 2. During driver init the sta_list entries mac
addresses are by default "00:00:00:00:00:00". Driver returns an invalid
pointer (conn) and the drver shall crash, if rxtids (aggr_conn)
skb queues are accessed, since they would not be initialized.
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Vasanthakumar Thiagarajan [Thu, 20 Jun 2013 07:17:20 +0000 (12:47 +0530)]
ath6kl: Fix race in heart beat polling
Make sure to cancel heart beat timer before
freeing wmi to avoid potential NULL pointer
dereference.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Bartosz Markowski [Fri, 2 Aug 2013 07:58:49 +0000 (09:58 +0200)]
ath10k: add SoC power save option to PCI features map
Unify the PCI options location.
By default the SoC PS option is disabled to boost the
performance and due to poor stability on early HW revisions.
In future we can remove the module parameter and turn on/off
the PS for given hardware.
This change also makes the pci module parameter for SoC PS static.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Eliad Peller [Tue, 16 Jul 2013 15:07:20 +0000 (18:07 +0300)]
iwlwifi: mvm: use designated initialization for some arrays
rs_ht_to_legacy and ant_toggle_lookup are arrays that
represent some state-machine. initialize them explicitly
with designated initialization to make them more clear
and avoid errors.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Eliad Peller [Tue, 16 Jul 2013 14:50:17 +0000 (17:50 +0300)]
iwlwifi: mvm: add some missing cleanups in iwl_mvm_mac_add_interface
iwl_mvm_mac_add_interface() didn't clean up beacon filtering
configuration and ctxt allocation in some error cases.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 2 Aug 2013 08:51:22 +0000 (10:51 +0200)]
iwlwifi: remove transport suspend/resume indirection
There's no reason for the transport to call itself through
indirect function pointers, inline the (little) code there
is and remove the indirection completely.
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Eliad Peller [Tue, 16 Jul 2013 14:53:43 +0000 (17:53 +0300)]
iwlwifi: pcie: some little cleanups
do some little cleanups in tx.c - eliminate duplicate checks,
use locally cached fields and predefined macros.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Eliad Peller [Tue, 16 Jul 2013 14:33:26 +0000 (17:33 +0300)]
iwlwifi: fix some documentation typos
Fix some typos.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 25 Jul 2013 20:36:27 +0000 (22:36 +0200)]
iwlwifi: mvm: small cleanups in quota management code
Use a C99 initializer to clear the command and move the lockdep
assertion before the restart check. Since this causes problems
with the BUILD_BUG_ON() with some compilers, change that a bit.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Avri Altman [Thu, 1 Aug 2013 04:19:27 +0000 (07:19 +0300)]
iwlwifi: mvm: fix signal reporting for < 3 antennas
When fewer than three antennas are connected (as is
always the case for the current devices), the signal
strength reporting was wrong; fix it.
Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Eyal Shapira [Sun, 28 Jul 2013 23:02:44 +0000 (23:02 +0000)]
iwlwifi: mvm: remove traffic load monitoring in rs
The traffic load monitoring isn't used anymore to decide whether
a Tx aggregation on a specific TID should be started.
No point in collecting these statistics. Remove the relevant code.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 30 Jul 2013 18:10:46 +0000 (20:10 +0200)]
iwlwifi: pcie: fix resume when no opmode is present
If no opmode is present during suspend/resume (i.e. if
the iwldvm or iwlmvm isn't loaded) the driver crashes
during resume, trying to call the rfkill notification.
Avoid that, and also don't enable the rfkill interrupt
in this case (to avoid crashing trying to handle the
interrupt later.)
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Matti Gottlieb [Tue, 30 Jul 2013 12:29:37 +0000 (15:29 +0300)]
iwlwifi: mvm: Add RX statistics debugfs entry
Add a debugfs entry for the RX statistics received from
the firmware.
Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Sujith Manoharan [Mon, 5 Aug 2013 09:38:28 +0000 (15:08 +0530)]
ath9k: Add more PCI IDs for WB225 cards
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 5 Aug 2013 09:38:27 +0000 (15:08 +0530)]
ath9k: Fix antenna control init for AR9485
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Mon, 5 Aug 2013 09:38:26 +0000 (15:08 +0530)]
ath9k: Remove ath_ant_comb_update()
During a HW reset, the diversity config is programmed
in the set_board_values() eeprom callback, there is no
need to do it again by calling ath_ant_comb_update().
Fixed antenna support is not fully handled for 1-stream
cards, it can be done later.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Alexey Khoroshilov [Mon, 5 Aug 2013 03:18:28 +0000 (07:18 +0400)]
hostap: do not return positive number on failure path in prism2_open()
prism2_open() as an .ndo_open handler should not return positive numbers
in case of failure, but it does return 1 in a couple of places.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:52:02 +0000 (14:22 +0530)]
ath9k: Support ANT diversity for WB225
WB225 based cards like CUS198 and CUS230 support
both fast antenna diversity and LNA combining. Add support
for this and also program the SWCOM register with the
correct "ant_ctrl_comm2g_switch_enable" value.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:52:01 +0000 (14:22 +0530)]
ath9k: Set SWCOM value for CUS198
CUS198/CUS230 cards require a custom value to be
programmed into the SWCOM register. Assign this during
init time.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:52:00 +0000 (14:22 +0530)]
ath9k: Remove "shared_chain_lnadiv"
This variable is redundant since we can use
common->bt_ant_diversity to determine if diversity
has to be enabled/disabled.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:59 +0000 (14:21 +0530)]
ath9k: Program HW for WB195 diversity
The MC_GAIN_CTL/CCK_DETECT registers have to be programmed
with the correct configuration values if WLAN/BT RX diversity
is enabled. Add this and also take care of the BTCOEX mode
when fast diversity is enabled/disabled.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:58 +0000 (14:21 +0530)]
ath9k: Enable WLAN/BT Ant Diversity for WB225/WB195
A custom solution for Asus is WB195 based and supports
WLAN/BT Rx diversity. Identify this card and set the
capability.
CUS198/CUS230, which are based on WB225 also support
WLAN/BT Rx diversity.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:57 +0000 (14:21 +0530)]
ath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv
Use "ath9k_hw_set_bt_ant_diversity" instead.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:56 +0000 (14:21 +0530)]
ath9k: Add a HW capability for WLAN/BT RX diversity
Make use of this capability to restrict the usage of the
debugfs file and modparam using which this feature can
be enabled.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:55 +0000 (14:21 +0530)]
ath9k: Cleanup WLAN/BT RX diversity
For single-chain WLAN+BT cards, the BT antenna can be used for
WLAN RX when the BT interface is disabled. Rename the modparam
"antenna_diversity" to "bt_ant_diversity" to clarify this.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:54 +0000 (14:21 +0530)]
ath9k: Fix antenna diversity for CUS198
CUS198/CUS230 need a few tweaks in the antenna diversity
algorithm to accomodate RSSI variation. Add a couple
of knobs to control low RSSI threshold and fast antenna
diversity bias values.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:53 +0000 (14:21 +0530)]
ath9k: Print LNA combining mode during init
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Sun, 4 Aug 2013 08:51:52 +0000 (14:21 +0530)]
ath9k: Add information about antenna diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Solomon Peachy [Fri, 2 Aug 2013 23:57:40 +0000 (19:57 -0400)]
cw1200: Fix spurious BUG_ON() trigger when starting AP mode.
There's an underlying race condition with the unjoin_work() call that is
sometimes triggered depending on scheduling order and the phase of the
moon. This doesn't fix the race condition, but it does remove the
ill-advised BUG_ON() call in an easily-recoverable situation.
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michal Kazior [Fri, 2 Aug 2013 07:15:47 +0000 (09:15 +0200)]
ath10k: fix device teardown
This fixes interrupt-related issue when no
interfaces were running thus the device was
considered powered down.
The power_down() function isn't really powering
down the device. It simply assumed it won't
interrupt. This wasn't true in some cases and
could lead to paging failures upon FW indication
interrupt (i.e. FW crash) because some structures
aren't allocated in that device state.
One reason for that was that ar_pci->started
wasn't reset. The other is interrupts should've
been masked when teardown starts.
The patch reorganized interrupt setup and makes
sure ar_pci->started is reset accordingly.
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
John W. Linville [Fri, 2 Aug 2013 19:40:11 +0000 (15:40 -0400)]
Merge tag 'for-linville-
20130730' of git://github.com/kvalo/ath6kl
John W. Linville [Fri, 2 Aug 2013 19:37:34 +0000 (15:37 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next
John W. Linville [Fri, 2 Aug 2013 18:54:19 +0000 (14:54 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211
Stanislaw Gruszka [Thu, 1 Aug 2013 10:07:55 +0000 (12:07 +0200)]
iwl4965: reset firmware after rfkill off
Using rfkill switch can make firmware unstable, what cause various
Microcode errors and kernel warnings. Reseting firmware just after
rfkill off (radio on) helped with that.
Resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=977053
Reported-and-tested-by: Justin Pearce <whitefox@guardianfox.net>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Stanislaw Gruszka [Thu, 1 Aug 2013 10:07:13 +0000 (12:07 +0200)]
iwl4965: set power mode early
If device was put into a sleep and system was restarted or module
reloaded, we have to wake device up before sending other commands.
Otherwise it will fail to start with Microcode error.
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Michal Kazior [Wed, 31 Jul 2013 08:55:15 +0000 (10:55 +0200)]
ath10k: fix failpath in MSI-X setup
pci_disable_msi() must be called if the initial
request_irq() fails.
Also add a warning message so it's possible to
distinguish request_irq() failure and
pci_enable_msi() failure.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:55:14 +0000 (10:55 +0200)]
ath10k: zero arvif memory on add_interface()
The private memory area in vif provided by
mac80211 isn't guaranteed to be zeroed.
This patch should fix issues when switching
between STA and AP interface types.
The tim_bitmap could become polluted by STA bssid
field (since it's a union), wep_keys array
could also become polluted with invalid pointers
and probably much more.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:55:13 +0000 (10:55 +0200)]
ath10k: advertise more conservative intf combinations
Apparently the available firmware has a limit of
handling 7 APs, 3 GOs or 8 STAs. This is based on
empirical tests and it is still possible some
combinations may crash the firmware.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:55:12 +0000 (10:55 +0200)]
ath10k: make sure to use passive scan when n_ssids is 0
Normally user specifies broadcast ssid for
scanning. If the user wants to do a passive scan
it does not pass any ssids.
The patch makes sure we ath10k tells firmware to
not send anything at all in case it decides no
ssids equals broadcast ssid.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:55:11 +0000 (10:55 +0200)]
ath10k: prevent using invalid ringbuffer indexes
If the device is removed and hotplug fails
ioread32() will return 0xFFFFFFFF. In that case
reading ringbuffer during device bringup led to
out-of-bounds addressing of a ringbuffer array
that in turn led to a paging failure.
This could be reproduced by the following:
* boot without acpi/prevent hotplug from working
* insert and manually detect (pci rescan) the device
* remove the device physically
* load ath10k driver
* kernel crashed
Ringbuffer index reading is now protected by using
an appropriate mask to prevent addressing an
invalid array index.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:32:40 +0000 (10:32 +0200)]
ath10k: implement get_survey()
This implements a limited subset of what can be
reported in the survey dump.
This can be used for assessing approximate channel
load, e.g. for automatic channel selection.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:47:57 +0000 (10:47 +0200)]
ath10k: implement tx checksum offloading
HW supports L3/L4 tx checksum offloading.
This should reduce CPU load and improve
performance on slow host machines.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Wed, 31 Jul 2013 08:47:56 +0000 (10:47 +0200)]
ath10k: implement rx checksum offloading
HW supports L3/L4 rx checksum offloading.
This should reduce CPU load and improve
performance on slow host machines.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Sujith Manoharan [Thu, 1 Aug 2013 15:27:06 +0000 (20:57 +0530)]
ath9k: Add statistics for antenna diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Thu, 1 Aug 2013 06:23:23 +0000 (11:53 +0530)]
ath9k: Use a subroutine to calculate ALT ratio
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Thu, 1 Aug 2013 06:23:22 +0000 (11:53 +0530)]
ath9k: Simplify checks in quick_scan
There is a function to do a ratio comparison for ALT,
so make use of it.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Thu, 1 Aug 2013 06:23:21 +0000 (11:53 +0530)]
ath9k: Use a helper function for checking LNA options
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Thu, 1 Aug 2013 06:23:20 +0000 (11:53 +0530)]
ath9k: Use a subroutine to try LNA switch
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>