firefly-linux-kernel-4.4.55.git
11 years agoath9k: Update initvals for AR9565
Sujith Manoharan [Mon, 6 May 2013 04:39:33 +0000 (10:09 +0530)]
ath9k: Update initvals for AR9565

* Register Modification for xLNA board.
* TX gain table modification for zero calibration.
* AUX chain (LNA2) sensitivity enhancement
* Modify diversity bias default setting in INI.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix beacon reconfiguration
Sujith Manoharan [Mon, 6 May 2013 04:39:03 +0000 (10:09 +0530)]
ath9k: Fix beacon reconfiguration

When a reset or a channel-change happens, for managed mode,
the HW beacon timers have to be programmed after the TSF has
been synchronized. This is handled via the sync flags.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwl4965: workaround connection regression on passive channel
Stanislaw Gruszka [Tue, 7 May 2013 16:07:06 +0000 (18:07 +0200)]
iwl4965: workaround connection regression on passive channel

Jake reported that since commit 1672c0e31917f49d31d30d79067103432bc20cc7
"mac80211: start auth/assoc timeout on frame status", he is unable to
connect to his AP, which is configured to use passive channel.

After switch to passive channel 4965 firmware drops any TX packet until
it receives beacon. Before commit 1672c0e3 we waited on channel and
retransmit packet after 200ms, that makes we receive beacon on the
meantime and association process succeed. New mac80211 behaviour cause
that any ASSOC frame fail immediately on iwl4965 and we can not
associate.

This patch restore old mac80211 behaviour for iwl4965, by removing
IEEE80211_HW_REPORTS_TX_ACK_STATUS feature. This feature will be
added again to iwl4965 driver, when different, more complex
workaround for this firmware issue, will be added to the driver.

Cc: stable@vger.kernel.org # 3.9
Bisected-by: Jake Edge <jake@lwn.net>
Reported-and-tested-by: Jake Edge <jake@lwn.net>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoB43: Handle DMA RX descriptor underrun
Thommy Jakobsson [Tue, 23 Apr 2013 19:45:11 +0000 (21:45 +0200)]
B43: Handle DMA RX descriptor underrun

Add handling of rx descriptor underflow. This fixes a fault that could
happen on slow machines, where data is received faster than the CPU can
handle. In such a case the device will use up all rx descriptors and
refuse to send any more data before confirming that it is ok. This
patch enables necessary interrupt to discover such a situation and will
handle them by dropping everything in the ring buffer.

Reviewed-by: Michael Buesch <m@bues.ch>
Signed-off-by: Thommy Jakobsson <thommyj@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: do not reschedule tx_complete_work on stop
Stanislaw Gruszka [Thu, 2 May 2013 07:43:57 +0000 (09:43 +0200)]
ath5k: do not reschedule tx_complete_work on stop

This patch claim to fix "WARNING: at net/mac80211/util.c:599
ieee80211_can_queue_work.isra.7+0x30/0x40", which was reported at:

https://bugzilla.redhat.com/show_bug.cgi?id=922295

We use ATH_STAT_STARTED flag to disallow to perform
ath5k_tx_complete_poll_work() code, hence reschedule
ah->tx_complete_work, when we stop device. This flag was defined in
ath5k code, but it was not used.

I didn't get feedback if the fix works, so patch is compile only tested.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: fix key allocation error handling for powersave keys
Felix Fietkau [Sat, 27 Apr 2013 09:47:01 +0000 (11:47 +0200)]
ath9k: fix key allocation error handling for powersave keys

If no keycache slots are available, ath_key_config can return -ENOSPC.
If the key index is not checked for errors, it can lead to logspam that
looks like this: "ath: wiphy0: keyreset: keycache entry 228 out of range"
This can cause follow-up errors if the invalid keycache index gets
used for tx.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.10-4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 29 Apr 2013 19:08:47 +0000 (15:08 -0400)]
Merge tag 'nfc-next-3.10-4' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"With this one we have:

- One patch for moving the LLCP code into net/nfc.
  It fixes a build annoyance reported by Dave Miller caused by the fact
  that the LLCP code object targets are not in the same directory as the
  Makefile trying to build them is. It prevents us from doing e.g.

        make net/nfc/llcp/sock.o

  Moving the LLCP code into net/nfc and not making it optional anymore
  makes sense as LLCP is a fundamental piece of the NFC specifications
  and thus should be in the core NFC directory.

- One patch that fixes the missing dependency against RFKILL. Without it NFC
  fails to properly build when it's builtin and CONFIG_RFKILL=m."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: Add missing RFKILL dependency for Kconfig
Marcel Holtmann [Fri, 26 Apr 2013 23:02:46 +0000 (01:02 +0200)]
NFC: Add missing RFKILL dependency for Kconfig

Since the NFC subsystem gained RFKILL support, it needs to be able
to build properly with whatever option for RFKILL has been selected.

on i386:

net/built-in.o: In function `nfc_unregister_device':
(.text+0x6a36d): undefined reference to `rfkill_unregister'
net/built-in.o: In function `nfc_unregister_device':
(.text+0x6a378): undefined reference to `rfkill_destroy'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a493): undefined reference to `rfkill_alloc'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a4a4): undefined reference to `rfkill_register'
net/built-in.o: In function `nfc_register_device':
(.text+0x6a4b3): undefined reference to `rfkill_destroy'
net/built-in.o: In function `nfc_dev_up':
(.text+0x6a8e8): undefined reference to `rfkill_blocked'

when CONFIG_RFKILL=m but NFC is builtin.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agortlwifi: rtl8192cu: Fix false loss of AP indication
Larry Finger [Thu, 25 Apr 2013 14:50:28 +0000 (09:50 -0500)]
rtlwifi: rtl8192cu: Fix false loss of AP indication

A major change in the rtlwifi family recently added code to detect when
there is loss of AP signals. One critical statement needed for the USB
driver was missed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Fix merge issue
Piotr Haber [Thu, 25 Apr 2013 10:27:09 +0000 (12:27 +0200)]
brcmsmac: Fix merge issue

Commit 7088f4835aa353f7226e57e73fd9e6564a4dfb75
"Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless"
ramoved call to brcms_led_unregister in mac80211_if.c

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: implement ssb spuravoid for chipid BCM43222
Hauke Mehrtens [Wed, 24 Apr 2013 19:30:54 +0000 (21:30 +0200)]
ssb: implement ssb spuravoid for chipid BCM43222

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Correct pci_unmap_single's size
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:50 +0000 (16:49 -0700)]
mwifiex: Correct pci_unmap_single's size

There exist mismatch between the size used for pci_map and
pci_unmap on command skb. Correcting it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Do not kfree cmd buf while unregistering PCIe
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:49 +0000 (16:49 -0700)]
mwifiex: Do not kfree cmd buf while unregistering PCIe

All the command buffers are freed in mwifiex_free_cmd_buffer()
and hence there is no need to kfree the current command buffer
again. This might ends up freeing memory allocated by some other
kernel code.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Call pci_release_region after calling pci_disable_device
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:48 +0000 (16:49 -0700)]
mwifiex: Call pci_release_region after calling pci_disable_device

"drivers should call pci_release_region() AFTER
calling pci_disable_device()"

Please refer section 3.2 Request MMIO/IOP resources
in Documentation/PCI/pci.txt

Cc: <stable@vger.kernel.org> # 3.2+
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Use pci_release_region() instead of a pci_release_regions()
Yogesh Ashok Powar [Tue, 23 Apr 2013 23:49:47 +0000 (16:49 -0700)]
mwifiex: Use pci_release_region() instead of a pci_release_regions()

PCI regions are associated with the device using
pci_request_region() call. Hence use pci_release_region()
instead of pci_release_regions().

Cc: <stable@vger.kernel.org> # 3.2+
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 26 Apr 2013 12:37:39 +0000 (08:37 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Fri, 26 Apr 2013 12:36:00 +0000 (08:36 -0400)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth-next

11 years agoNFC: Move LLCP code to the NFC top level diirectory
Samuel Ortiz [Fri, 26 Apr 2013 09:49:40 +0000 (11:49 +0200)]
NFC: Move LLCP code to the NFC top level diirectory

And stop making it optional. LLCP is a fundamental part of the NFC
specifications and making it optional does not make much sense.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoBluetooth: btmrvl: report error if verify_fw_download times out
Andreas Fenkart [Mon, 22 Apr 2013 09:10:23 +0000 (11:10 +0200)]
Bluetooth: btmrvl: report error if verify_fw_download times out

FW does the synchronization of the different modules during init.
It will report different modules, that it is ready at different times.
The fw download 'winner' will be reported fw ready first. Without this
patch, btmrvl was already continuing before the FW told it too. Probably
on behalf of the 'winner' which then never sees FW ready and times out.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: btmrvl: release lock while waiting for fw download complete
Andreas Fenkart [Mon, 22 Apr 2013 09:10:22 +0000 (11:10 +0200)]
Bluetooth: btmrvl: release lock while waiting for fw download complete

If not winner, driver must release the sdio host lock, so the fw
download can progress. While holding the lock fw download is stalled
and the following error is produced:

[  235.746015] Bluetooth: FW failed to be active in time!
[  235.752799] Bluetooth: Downloading firmware failed!

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: btmrvl: use native helpers for debugfs
Andy Shevchenko [Tue, 23 Apr 2013 09:53:46 +0000 (12:53 +0300)]
Bluetooth: btmrvl: use native helpers for debugfs

Clean up the code by using native debugfs helpers, instead of implementing
them ourselves:

debugfs_create_u8()
debugfs_create_x16()
debugfs_create_file()
debugfs_remove_recursive()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove unneeded parameter from L2CAP ATT channel handling
Marcel Holtmann [Tue, 23 Apr 2013 07:59:00 +0000 (00:59 -0700)]
Bluetooth: Remove unneeded parameter from L2CAP ATT channel handling

The CID is fixed to L2CAP ATT channel and so there is no need to hand it
down to the handling function. Just use a constant instead.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: hci_get_cmd_complete() can be static
Fengguang Wu [Sat, 20 Apr 2013 13:24:31 +0000 (16:24 +0300)]
Bluetooth: hci_get_cmd_complete() can be static

There are new sparse warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
head:   a0b644b0385fa58ca578f6dce4473e8a8e6f6c38
commit: 75e84b7c522c6e07964cd1f5bf28535768a1e9fa Bluetooth: Add __hci_cmd_sync() helper function
date:   13 days ago

>> net/bluetooth/hci_core.c:82:16: sparse: symbol 'hci_get_cmd_complete' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add support for Intel Bluetooth device [8087:07dc]
Tedd Ho-Jeong An [Fri, 19 Apr 2013 16:57:43 +0000 (09:57 -0700)]
Bluetooth: Add support for Intel Bluetooth device [8087:07dc]

This patch adds support for Intel Bluetooth device by adding
btusb_setup_intel() routine that update the device with ROM patch.

T:  Bus=02 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=07dc Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix sending write_le_host_supporte for LE-only controllers
Johan Hedberg [Fri, 19 Apr 2013 15:35:21 +0000 (18:35 +0300)]
Bluetooth: Fix sending write_le_host_supporte for LE-only controllers

The Bluetooth Core Specification (4.0) defines the Write LE Host
Supported HCI command as only available for controllers supporting
BR/EDR. This is further reflected in the Read Local Extended Features
HCI command also not being available for LE-only controllers. In other
words, host-side LE support is implicit for single-mode LE controllers
and doesn't have explicit HCI-level enablement.

This patch ensures that the LE setting is always exposed as enabled
through mgmt and returns a "rejected" response if user space tries to
toggle the setting. The patch also ensures that Write LE Host Supported
is never sent for LE-only controllers.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agomwifiex: rework round robin scheduling of bss nodes.
Andreas Fenkart [Thu, 18 Apr 2013 23:34:12 +0000 (16:34 -0700)]
mwifiex: rework round robin scheduling of bss nodes.

Rotate bss prio list, so the bss next to the one served, will come first
in the list of bss' with equal priority. This way we pick bss nodes in a
round robin fashion. Using list rotation instead of a cur ptr simplifies
iteration to calling list_for_each_entry. List rotation is done via
list_move, where the head itself is temporarily removed and then
re-inserted after the bss just served.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: replace ra_list_curr by list rotation.
Andreas Fenkart [Thu, 18 Apr 2013 23:33:45 +0000 (16:33 -0700)]
mwifiex: replace ra_list_curr by list rotation.

After a packet is successfully transmitted, ra list is rotated, so the ra
next to the one transmitted, will be the first in the list. This way we
pick the ra' in a round robin fashion. This significantly simplifies
iteration in  mwifiex_wmm_get_highest_priolist_ptr to a call to
list_for_each_entry.
List rotation is done via list_move, where the head itself is temporarily
removed and then re-inserted after the item just transferred.

Signed-off-by: Andreas Fenkart <andreas.fenkart@streamunlimited.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add credit borrowing mechanism
Arend van Spriel [Tue, 23 Apr 2013 10:53:15 +0000 (12:53 +0200)]
brcmfmac: add credit borrowing mechanism

The firmware provides credits to the driver per WMM-AC. When
only AC_BE are to be transmitted to the firmware the driver
may use credits from other priorities to send AC_BE packets
towards the firmware.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: correct error handling in brcmf_fws_init()
Arend van Spriel [Tue, 23 Apr 2013 10:53:14 +0000 (12:53 +0200)]
brcmfmac: correct error handling in brcmf_fws_init()

In brcmf_fws_init() the error flows were not properly handled
and the caller ignored the return value. The only action that
is allowed to fail in brcmf_fws_init() is setting the tlv in
firmware as the feature is not supported on all devices.

Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: flush queue upon MACDESC_DEL firmware signal
Arend van Spriel [Tue, 23 Apr 2013 10:53:13 +0000 (12:53 +0200)]
brcmfmac: flush queue upon MACDESC_DEL firmware signal

When firmware signals the driver to remove a destination entry
it may have sk_buff packets queued for it. These should be freed.

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: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: support critical protocol API for DHCP
Piotr Haber [Tue, 23 Apr 2013 10:53:12 +0000 (12:53 +0200)]
brcmfmac: support critical protocol API for DHCP

Adds support for the critical protocol API provided by nl80211
which gives Wifi traffic priority over a Bluetooth (e)SCO connection
and disables scanning during DCHP negotiation.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: allow scanning to be suppressed in the driver
Arend van Spriel [Tue, 23 Apr 2013 10:53:11 +0000 (12:53 +0200)]
brcmfmac: allow scanning to be suppressed in the driver

During the DHCP protocol exchange it is benificial to suppress
scan requests which may decrease time to complete DHCP protocol.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agoath9k: Fix RX DMA mapping
Sujith Manoharan [Tue, 23 Apr 2013 06:52:19 +0000 (12:22 +0530)]
ath9k: Fix RX DMA mapping

After the commit "ath9k: improve dma map failure handling", the
wrong buffer was DMA-unmapped, introducing warnings like the one below.
This patch fixes the issue.

WARNING: at /home/sujith/dev/wireless-testing/lib/dma-debug.c:986 check_sync+0x4bc/0x580()
Hardware name: LIFEBOOK AH531
ath9k 0000:02:00.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x00000000d9012800] [size=48 bytes]
Pid: 86, comm: kworker/u:5 Tainted: G        W  O 3.9.0-rc8-wl-debug #106
Call Trace:
 [<ffffffff810410c0>] warn_slowpath_common+0x70/0xa0
 [<ffffffff8104113c>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffff8125432c>] check_sync+0x4bc/0x580
 [<ffffffff8109e5f7>] ? trace_hardirqs_on_caller+0xa7/0x190
 [<ffffffff8109e6ed>] ? trace_hardirqs_on+0xd/0x10
 [<ffffffff81254488>] debug_dma_sync_single_for_device+0x48/0x50
 [<ffffffffa0a53825>] ? ath9k_iowrite32+0x35/0x90 [ath9k]
 [<ffffffff812512f0>] ? swiotlb_tbl_sync_single+0x50/0x90
 [<ffffffff81251350>] ? swiotlb_sync_single+0x20/0x30
 [<ffffffff8125137f>] ? swiotlb_sync_single_for_device+0xf/0x20
 [<ffffffffa0a58baf>] ath_rx_edma_buf_link+0xef/0x140 [ath9k]
 [<ffffffffa0a58c4e>] ath_rx_addbuffer_edma+0x4e/0x90 [ath9k]
 [<ffffffffa0a59c51>] ath_startrecv+0xf1/0x120 [ath9k]
 [<ffffffffa0a550e0>] ath_complete_reset+0x20/0x130 [ath9k]
 [<ffffffffa0a5790d>] ath_reset_internal+0x10d/0x210 [ath9k]
 [<ffffffffa0a5878c>] ath9k_config+0x47c/0x7b0 [ath9k]
 [<ffffffffa06d4978>] ieee80211_hw_config+0x88/0x3f0 [mac80211]
 [<ffffffffa06d4a3f>] ? ieee80211_hw_config+0x14f/0x3f0 [mac80211]
 [<ffffffffa06dbed1>] __ieee80211_scan_completed+0xc1/0x440 [mac80211]
 [<ffffffffa06dd002>] ieee80211_scan_work+0x82/0x440 [mac80211]
 [<ffffffff810606a3>] process_one_work+0x1e3/0x530
 [<ffffffff81060641>] ? process_one_work+0x181/0x530
 [<ffffffff8106163f>] worker_thread+0x10f/0x3c0
 [<ffffffff81061530>] ? manage_workers+0x330/0x330
 [<ffffffff810665da>] kthread+0xea/0xf0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140
 [<ffffffff8146085c>] ret_from_fork+0x7c/0xb0
 [<ffffffff810664f0>] ? kthread_create_on_node+0x140/0x140

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Use lockless variants for the RX fifo queue
Sujith Manoharan [Tue, 23 Apr 2013 06:52:18 +0000 (12:22 +0530)]
ath9k: Use lockless variants for the RX fifo queue

The RX fifo can be accessed from the common tasklet or it can
be reaped/cleaned when RX is stopped, which is done when doing
a reset or channel change - this happens in process context.

Since it is ensured that there are no pending tasklets when
stopping RX and cleaning the FIFO, there is no need to use
SKB queue functions which take internal locks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Reduce deep indentation
Sujith Manoharan [Tue, 23 Apr 2013 06:52:17 +0000 (12:22 +0530)]
ath9k: Reduce deep indentation

The EDMA case is handled first, so the else condition
can be removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove unused argument "size"
Sujith Manoharan [Tue, 23 Apr 2013 06:52:16 +0000 (12:22 +0530)]
ath9k: Remove unused argument "size"

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: add support for the new rate control API
Felix Fietkau [Mon, 22 Apr 2013 21:11:44 +0000 (23:11 +0200)]
ath9k: add support for the new rate control API

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: merge ath_tx_start_dma into ath_tx_start
Felix Fietkau [Mon, 22 Apr 2013 21:11:43 +0000 (23:11 +0200)]
ath9k: merge ath_tx_start_dma into ath_tx_start

The split makes no sense and merging the functions makes further changes
easier to implement

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortl8192c:dm: Properly initialize local array and set value.
Han Shen [Mon, 22 Apr 2013 20:35:07 +0000 (13:35 -0700)]
rtl8192c:dm: Properly initialize local array and set value.

GCC 4.8 is spitting out uninitialized-variable warnings against
"drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".  This patch adds
initialization to the variable and properly sets its value.

Signed-off-by: Han Shen (shenhan@google.com)
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: apply coverage class on slottime too
Mathias Kretschmer [Mon, 22 Apr 2013 20:34:41 +0000 (22:34 +0200)]
ath9k: apply coverage class on slottime too

According to 802.11-2007 17.3.8.6 (slot time), the slot time should
be increased by 3 us * coverage class. The code only increased the
ack timeout, which is fixed by this patch.

We have noticed in our long shot scenario that we see less collisions
with this patch.

Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
[add standard reference and commit message]
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'master' of git://git.infradead.org/users/rafal/b43-next
John W. Linville [Tue, 23 Apr 2013 18:10:10 +0000 (14:10 -0400)]
Merge branch 'master' of git://git.infradead.org/users/rafal/b43-next

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Tue, 23 Apr 2013 18:09:39 +0000 (14:09 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c

11 years agob43: N-PHY: don't use deprecated b43_radio_foo16
Rafał Miłecki [Fri, 12 Apr 2013 15:58:13 +0000 (17:58 +0200)]
b43: N-PHY: don't use deprecated b43_radio_foo16

All radio ops are 16b (there is only 1 exception for reg 0x1), so we
deprecated b43_radio_read16 and b43_radio_write16 long time ago.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: clean init tables
Rafał Miłecki [Sun, 31 Mar 2013 18:00:45 +0000 (20:00 +0200)]
b43: N-PHY: clean init tables

Sort defines, use one macro for all revs, support for 5GHz when
uploading antenna table.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: move tables init function to tables file
Rafał Miłecki [Sat, 30 Mar 2013 23:40:21 +0000 (00:40 +0100)]
b43: N-PHY: move tables init function to tables file

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use defines for (re)storing VCM config
Rafał Miłecki [Sat, 30 Mar 2013 21:34:40 +0000 (22:34 +0100)]
b43: N-PHY: use defines for (re)storing VCM config

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use shortcut "ctl" in functions names
Rafał Miłecki [Sat, 30 Mar 2013 20:50:46 +0000 (21:50 +0100)]
b43: N-PHY: use shortcut "ctl" in functions names

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for INTC override function argument
Rafał Miłecki [Fri, 29 Mar 2013 10:37:02 +0000 (11:37 +0100)]
b43: N-PHY: use enum for INTC override function argument

Also make a function name shorter so we can easily fit 80 chars.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: define missing registers
Rafał Miłecki [Fri, 29 Mar 2013 10:13:40 +0000 (11:13 +0100)]
b43: N-PHY: define missing registers

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: use defines for board_type
Rafał Miłecki [Thu, 28 Mar 2013 21:25:38 +0000 (22:25 +0100)]
b43: use defines for board_type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-
Rafał Miłecki [Wed, 20 Mar 2013 18:13:47 +0000 (19:13 +0100)]
b43: N-PHY: fix "NB" RSSI calibration on PHYs rev2-

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RSSI type everywhere we use it
Rafał Miłecki [Wed, 20 Mar 2013 17:24:47 +0000 (18:24 +0100)]
b43: N-PHY: use enum for RSSI type everywhere we use it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: rename RSSI types to be shorter and more accurate
Rafał Miłecki [Wed, 20 Mar 2013 16:30:38 +0000 (17:30 +0100)]
b43: N-PHY: rename RSSI types to be shorter and more accurate

Thanks to Broadcom releasing some code we can use better names.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use more friendly variables names in RSSI code
Rafał Miłecki [Wed, 20 Mar 2013 16:26:03 +0000 (17:26 +0100)]
b43: N-PHY: use more friendly variables names in RSSI code

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: simplify conditions in RSSI offset scale function
Rafał Miłecki [Wed, 20 Mar 2013 15:57:04 +0000 (16:57 +0100)]
b43: N-PHY: simplify conditions in RSSI offset scale function

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: N-PHY: use enum for RAIL type
Rafał Miłecki [Wed, 20 Mar 2013 15:51:39 +0000 (16:51 +0100)]
b43: N-PHY: use enum for RAIL type

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: use enum for RSSI types
Rafał Miłecki [Tue, 19 Mar 2013 17:12:00 +0000 (18:12 +0100)]
b43: HT-PHY: use enum for RSSI types

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: store TX power state before disabling it
Rafał Miłecki [Sun, 17 Mar 2013 18:49:08 +0000 (19:49 +0100)]
b43: HT-PHY: store TX power state before disabling it

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: define regs for power estimation
Rafał Miłecki [Sun, 17 Mar 2013 18:08:15 +0000 (19:08 +0100)]
b43: HT-PHY: define regs for power estimation

In MMIO dumps of ndiswrapper there are following PHY ops:
phy_read(0x0118) -> 0x013d
phy_read(0x01ed) -> 0x993d
phy_read(0x0119) -> 0x012f
phy_read(0x01ee) -> 0x992f
phy_read(0x011a) -> 0x0139
phy_read(0x0969) -> 0x9939
It matches the code of wlc_phy_txpower_est_power_nphy (from brcm80211),
so we know the registers meaning.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: do some extra TSSI setup after configuring TX
Rafał Miłecki [Sat, 16 Mar 2013 22:57:10 +0000 (23:57 +0100)]
b43: HT-PHY: do some extra TSSI setup after configuring TX

After b43_phy_ht_tx_power_ctl_setup there are some extra radio ops:
 radio_read(0x08bf) -> 0x0001
radio_write(0x08bf) <- 0x0001
radio_write(0x0159) <- 0x0011
On N-PHY we write 0x11 to TSSI regs, so it's probably sth similar.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: finish calculating values for idle TSSI
Rafał Miłecki [Sat, 16 Mar 2013 22:47:29 +0000 (23:47 +0100)]
b43: HT-PHY: finish calculating values for idle TSSI

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: tables: don't duplicate core-generic regs
Rafał Miłecki [Sat, 16 Mar 2013 22:40:01 +0000 (23:40 +0100)]
b43: HT-PHY: tables: don't duplicate core-generic regs

Now when we know many radio regs at 0x000 are core-generic, I've noticed
we duplicate some values in the tables.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agob43: HT-PHY: rename defines addressing cores on the 2059 radio
Rafał Miłecki [Sat, 16 Mar 2013 22:24:21 +0000 (23:24 +0100)]
b43: HT-PHY: rename defines addressing cores on the 2059 radio

After comparing writes to registers at 0x000, 0x400 and 0x800 it seems
there are many very similar writes. So 0x000 offset is not for accessing
something totally different, but probably just the first out of three
cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 years agomwifiex: remove redundant initialization for bss_descriptor
Bing Zhao [Fri, 12 Apr 2013 17:34:18 +0000 (10:34 -0700)]
mwifiex: remove redundant initialization for bss_descriptor

Initialization of bss_descriptor is unnecessary as the entire
structure will be overwritten by a memcpy followed by.

Initialize disable_11ac flag properly by setting it to true in
mwifiex_fill_new_bss_desc().

Reported-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix use-after-free in beacon_ie processing
Bing Zhao [Fri, 12 Apr 2013 17:34:17 +0000 (10:34 -0700)]
mwifiex: fix use-after-free in beacon_ie processing

beacon_ie buffer is allocated in mwifiex_fill_new_bss_desc()
and the buffer pointer is saved in bss_desc->beacon_buf.
beacon_ie is freed before the function returns. However,
bss_desc->beacon_buf is still being accessed afterwards.

Fix it by freeing beacon_ie (bss_desc->beacon_buf) in
caller's scope.

Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: don't try to associate when bss_mode is not STA
Bing Zhao [Sat, 20 Apr 2013 04:00:44 +0000 (21:00 -0700)]
mwifiex: don't try to associate when bss_mode is not STA

We have blocked association attempts on interfaces configured in
AP and AD-HOC modes. P2P mode should be blocked too.

Furthermore, an error code must be returned if we are unable to
associate.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: make use of msecs_to_jiffies()
Bing Zhao [Sat, 20 Apr 2013 00:44:44 +0000 (17:44 -0700)]
mwifiex: make use of msecs_to_jiffies()

Use msecs_to_jiffies() wherever possible.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: correct bss_mode check while appending vht operation IE
Bing Zhao [Sat, 20 Apr 2013 00:44:43 +0000 (17:44 -0700)]
mwifiex: correct bss_mode check while appending vht operation IE

priv->bss_mode uses NL80211_IFTYPE_* definitions.
HostCmd_BSS_MODE_IBSS is used in ad-hoc start/join command between
driver and firmware.

Coincidentally both HostCmd_BSS_MODE_IBSS and NL80211_IFTYPE_STATION
are defined as 2. That explains why nobody complained.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init
Avinash Patil [Sat, 20 Apr 2013 00:44:42 +0000 (17:44 -0700)]
mwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init

There is a typo in mwifiex_cleanup_rxq_ring() which uses
PCI_DMA_TODEVICE while unmapping PCI memory.
We should actually use PCI_DMA_FROMDEVICE.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: configure p2p interface during initialization
Bing Zhao [Sat, 20 Apr 2013 00:44:41 +0000 (17:44 -0700)]
mwifiex: configure p2p interface during initialization

Send P2P_MODE_CFG cmd to firmware when p2p interface is created.
Without proper p2p configuration firmware may behave incorrectly
while handling commands sent through this interface.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Stone Piao <piaoyun@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: Start P2P devices in P2P mode
Paul Stewart [Fri, 19 Apr 2013 15:37:46 +0000 (08:37 -0700)]
mwifiex: Start P2P devices in P2P mode

p2p devices should identify themselves as such to userspace at
startup, so the connection manager can decide which interface
to start wpa_supplicant instances on.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: Use more current logging styles, shrink object size
Joe Perches [Fri, 19 Apr 2013 15:33:40 +0000 (08:33 -0700)]
rt2x00: Use more current logging styles, shrink object size

Reduce object space ~2% using more current logging styles.

Neaten and simplify logging macros.
Use wiphy_<level> where appropriate.
Coalesce formats.

Convert ERROR/WARNING/INFO macros to rt2x00_<level>
Convert EEPROM to rt2x00_eeprom_dbg
Convert PROBE_ERROR to rt2x00_probe_err
Convert DEBUG to rt2x00_dbg
Convert EEPROM to rt2x00_eeprom_dbg

$ size drivers/net/wireless/rt2x00/built-in.o*
   text    data     bss     dec     hex filename
 245639   71696   69584  386919   5e767 drivers/net/wireless/rt2x00/built-in.o.new
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.nodyndbg
 240609   70096   68944  379649   5cb01 drivers/net/wireless/rt2x00/built-in.o.new.no_rt2x00_debug
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old
 249198   70096   70352  389646   5f20e drivers/net/wireless/rt2x00/built-in.o.old.nodyndbg
 244222   70096   69712  384030   5dc1e drivers/net/wireless/rt2x00/built-in.o.old.no_rt2x00_debug

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early
Gabor Juhos [Fri, 19 Apr 2013 08:13:52 +0000 (10:13 +0200)]
rt2x00: rt2800lib: rename rt2800_init_bbb_early to rt2800_init_bbp_early

The function is used for BBP register initialization,
fix the typo in the function name to reflect that.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()
Wei Yongjun [Fri, 19 Apr 2013 02:14:31 +0000 (10:14 +0800)]
brcmfmac: fix potential NULL pointer dereference in brcmf_fws_flow_control_check()

The dereference to 'ifp' in debug code should be moved below the NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: more Rx descriptor accessor functions
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:53 +0000 (14:33 +0300)]
wil6210: more Rx descriptor accessor functions

Helpers to fetch various fields from the Rx descriptor

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Tx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:52 +0000 (14:33 +0300)]
wil6210: Use cached copy of Tx descriptor

Original Tx descriptor stored is in non-cached area for DMA;
copy it to the cached memory to speed-up access

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Tx init optimization
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:51 +0000 (14:33 +0300)]
wil6210: Tx init optimization

vring size is known from the beginning, fill it immediately
in the struct initializer
This is minor optimization that reduces code size.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: Use cached copy of Rx descriptor
Vladimir Kondratiev [Thu, 18 Apr 2013 11:33:50 +0000 (14:33 +0300)]
wil6210: Use cached copy of Rx descriptor

Rx descriptors stored in non-cacheable memory area for DMA.
Non-cacheable memory causes long access time from CPU.

Copy rx descriptor to the skb->cb, and use this copy.
It provides faster memory access, and will be usefull to keep
Rx information for later processing (BACK reorder)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: stop dequeue upon sk_buff commit failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:58 +0000 (21:25 +0200)]
brcmfmac: stop dequeue upon sk_buff commit failure

In the dequeue worker the function brcmf_commit_skb() is called.
However, instead of increment the credit count upon success it
should break the for loop upon failure. Otherwise, it will result
in an endless loop.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: change return type for brcmf_rollback_toq() to void
Arend van Spriel [Wed, 17 Apr 2013 19:25:57 +0000 (21:25 +0200)]
brcmfmac: change return type for brcmf_rollback_toq() to void

The function brcmf_rollback_toq() is already called in error path
and its result should not override the initial error value. As the
function releases the sk_buff there is no need to return anything
so change return type to void.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: finalize transmit upon any rollback failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:56 +0000 (21:25 +0200)]
brcmfmac: finalize transmit upon any rollback failure

All rollback failures should result in freeing of the sk_buff
by calling brcmf_txfinalize().

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: use lock in brcmf_fws_del_interface()
Arend van Spriel [Wed, 17 Apr 2013 19:25:55 +0000 (21:25 +0200)]
brcmfmac: use lock in brcmf_fws_del_interface()

When deleting an interface in firmware-signalling module it will
clear any destination descriptors. To avoid concurrency issues it
should take the lock using brcmf_fws_lock().

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: schedule dequeue upon firmware-signal reception
Arend van Spriel [Wed, 17 Apr 2013 19:25:54 +0000 (21:25 +0200)]
brcmfmac: schedule dequeue upon firmware-signal reception

Several firmware signals should be considered as opportunity to
send packets to the firmware. This patch adds conditional scheduling
of the dequeue worker thread while handling those signals.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmfmac: destination mac closed when interface is closed
Arend van Spriel [Wed, 17 Apr 2013 19:25:53 +0000 (21:25 +0200)]
brcmfmac: destination mac closed when interface is closed

Firmware signals a destination is closed as well as an interface. A
destination is associated with an interface. When an interface is
closed consequently the destination should be considered closed as
well.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agobrcmutil: simplify brcmu_pkt_free_skb()
Arend van Spriel [Wed, 17 Apr 2013 19:25:52 +0000 (21:25 +0200)]
brcmutil: simplify brcmu_pkt_free_skb()

The function brcmu_pkt_free_skb() use skb->destructor to decide
how the sk_buff should be freed. However, when running AP mode
with iptables configured this results in a kernel warning.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove error message upon allocation failure
Arend van Spriel [Wed, 17 Apr 2013 19:25:51 +0000 (21:25 +0200)]
brcmfmac: remove error message upon allocation failure

In function brcmf_add_if() an error message is printed
upon alloc_netdev() failure. The allocation failure itself
spews enough info in the log so remove the error message.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: check memory allocation in brcmf_add_if()
Arend van Spriel [Wed, 17 Apr 2013 19:25:50 +0000 (21:25 +0200)]
brcmfmac: check memory allocation in brcmf_add_if()

For P2P_DEVICE interface the struct brcmf_if instance is
allocated using kzalloc() which can fail. Add pointer
check and return -ENOMEM if it failed. Fixes the following
smatch error:

"drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c:770
brcmf_add_if()
  error: potential null dereference 'ifp'. (kzalloc returns null)"

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: reinitialize dequeue mask per node
Arend van Spriel [Wed, 17 Apr 2013 19:25:49 +0000 (21:25 +0200)]
brcmfmac: reinitialize dequeue mask per node

The mask was only initialized for the first node, but it should be
done for each node that is handled in the loop.

Reviewed-by: Hante Meuleman <meuleman@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>
11 years agort2800: nulify all last words of TXWI
Stanislaw Gruszka [Wed, 17 Apr 2013 12:30:48 +0000 (14:30 +0200)]
rt2800: nulify all last words of TXWI

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: provide separate information about TXWI & RXWI sizes
Stanislaw Gruszka [Wed, 17 Apr 2013 12:30:47 +0000 (14:30 +0200)]
rt2x00: provide separate information about TXWI & RXWI sizes

On new 2800 hardware sizes of TXWI & RXIW can be different than TXD
& RXD sizes, so we need to difference between them. Let's define
winfo_size as size of in buffer descriptor (TXWI & RXWI), and desc_size
of as size of additional descriptor - in separate DMA coherent buffer
for PCI hardware (TXD & RXD) and yet another in buffer descriptor for
USB hardware (TXINFO & RXINFO).

Change is rt2x00 wild, but should affect only 2800 driver.

Patch also fix beaconing for 5592usb AP mode.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: cleanup rt2800_init_rfcsr
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:20 +0000 (14:08 +0200)]
rt2800: cleanup rt2800_init_rfcsr

This procedure is simple switch now and return no error any longer.

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_normal_mode_setup_3xxx subroutine
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:19 +0000 (14:08 +0200)]
rt2800: add rt2800_normal_mode_setup_3xxx subroutine

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_led_open_drain_enable subroutine
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:18 +0000 (14:08 +0200)]
rt2800: add rt2800_led_open_drain_enable subroutine

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RF_R27 setup to individual rfcsr init subroutines
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:17 +0000 (14:08 +0200)]
rt2800: move RF_R27 setup to individual rfcsr init subroutines

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: add rt2800_rx_filter_calibration procedure
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:16 +0000 (14:08 +0200)]
rt2800: add rt2800_rx_filter_calibration procedure

Add procedure for both bands filter calibration and use it on individual
chipset init rfcsr subroutines.

Remove "Set back to initial state" code for 3290 since vendor driver
DPO_RT3290_LinuxSTA_V2600_20120508 does not include it.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RFCSR6_R2 & LDO_CFG0 setup to 3572 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:15 +0000 (14:08 +0200)]
rt2800: move RFCSR6_R2 & LDO_CFG0 setup to 3572 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move GPIO_SWITCH setup to 3390 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:14 +0000 (14:08 +0200)]
rt2800: move GPIO_SWITCH setup to 3390 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move 30xx common rf init code
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:13 +0000 (14:08 +0200)]
rt2800: move 30xx common rf init code

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move RFCSR29_RSSI_GAIN to 3290 specific rfcsr init
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:12 +0000 (14:08 +0200)]
rt2800: move RFCSR29_RSSI_GAIN to 3290 specific rfcsr init

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2800: move rf init calibration code
Stanislaw Gruszka [Wed, 17 Apr 2013 12:08:11 +0000 (14:08 +0200)]
rt2800: move rf init calibration code

Add separate function for rf init calibration code and use it
on all init rf subroutines.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>