Commit Graph

197024 Commits

Author SHA1 Message Date
Michal Kazior 0579119f7d ath10k: track vif list internally
mac80211 interface interations functions have
peculiar locking issues. This patch introduces
internal (to ath10k) vif list that will be used
for vif iteration purposes.

kvalo: remove extra INIT_LIST_HEAD()

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 15:44:45 +03:00
Michal Kazior 9dad14ae28 ath10k: fix add_interface failure handling
If something failed along add_interface() setup it
was possible to leak a vdev id, vdev and peer.

This could end up with leaked FW state or FW crash
(assuming add_interface() failure wasn't a result of
a crash).

kvalo: rebased, whitespace fixes

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 15:44:45 +03:00
Michal Kazior cc4827b97b ath10k: use workqueue to set WEP TX key
Recent WMI/HTC changes made it possible for WMI
commands to sleep (if there's not enough HTC TX
credits to submit a command). TX path is in an
atomic context so calling WMI commands in it is
wrong.

This simply moves WEP key index update to a worker
and fixes the 'scheduling while atomic' bug.

This still leaves multiple WEP key handling laggy,
i.e. some frames may be TXed with an old/different
key (although recipient should still be able to RX
them).

kvalo: changed the title

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 15:44:45 +03:00
Bartosz Markowski d544943afa ath10k: return better errno for unsupported pdev params
Return -EOPNOTSUPP if given parameter is not supported by firmware.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 11:52:06 +03:00
Bartosz Markowski 34957b25e3 ath10k: rename WMI_CMD_UNDEFINED
Rename WMI_CMD_UNDEFINED to WMI_CMD_UNSUPPORTED. This is more
accurate here. Also return -EOPNOTSUPP instead of -EINVAL in
wmi_cmd_send().

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 11:52:06 +03:00
Bartosz Markowski ebc9abddfb ath10k: do not warn about unsupported vdev param
10.X firmware does not support WMI_VDEV_PARAM_TX_ENCAP_TYPE.
It's a known limitation and we should not warn about this.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-16 11:49:54 +03:00
Kevin Lo b6b561c31d rt2x00: rt2800lib: remove duplicate rf_vals for RF3053
lready have rf_vals_3x with same values.  Hence rf_vals_3053 is removed
in this patch.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Kevin Lo 7122e66002 rt2x00: rt2800lib: fix RF registers for RT5390/RT5392
Update rf registers to use the same values that the MediaTek/Ralink
reference driver DPO_RT5572_LinuxSTA_2.6.1.3_20121022 uses.

References:
  RF5390RegTable in chips/rt5390.c
  RF5392RegTable in chips/rt5390.c

Tested on TP-Link TL-WN727N and D-Link DWA-140 Rev.b3 usb wifi dongles.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Amitkumar Karwar 448a71cc74 mwifiex: use alloc_workqueue() function
It replaces deprecated create_workqueue().

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>
2013-10-14 13:39:59 -04:00
Felix Fietkau e4744ec786 ath9k_hw: remove references to hw->conf
Accessing it to get the current operating channel is racy and in the way
of further channel handling related changes

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Felix Fietkau c648ecb044 ath9k: make ath9k_uses_beacons static
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Felix Fietkau 7f329bbb3d ath9k: remove sc->config.cabqReadyTime
It is not exposed as a configuration option anyway

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Felix Fietkau 45c67f6fec ath9k: move channel change code to ath_set_channel
Preparation for adding the scanning state machine to ath9k

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Felix Fietkau 2297f1c7be ath9k: make ath9k_cmn_update_ichannel static
Rework its wrapper function to make it more generic, using it as a
replacement for previous calls to ath9k_cmn_update_ichannel.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:59 -04:00
Felix Fietkau 6b21fd2027 ath9k_hw: simplify channel flags
There was some duplication between channelFlags and chanmode, as well as
a lot of redundant checks based on the combinations of flags.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Felix Fietkau 81c507a8b0 ath9k_hw: remove IS_CHAN_OFDM()
The hardware is always configured with OFDM support enabled

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Felix Fietkau 1a5e63265f ath9k_hw: remove IS_CHAN_B()
Hardware 802.11b-only mode isn't supported by the driver (the device is
configured for 802.11n/g instead). Simplify the code by removing checks
for it.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Felix Fietkau 8896934c16 ath9k_hw: remove direct accesses to channel mode flags
Use wrappers where available. Simplifies code and helps with further
improvements to the channel data structure

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Felix Fietkau 1a04d59d3e ath9k: use a separate data structure for rx buffers
There's no shared code for handling both rx and tx buffers, and tx
buffers require a lot more metadata than rx buffers.
Using a separate data structure for rx reduces memory usage and improves
cache footprint.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Fengguang Wu 50d60c6322 wcn36xx: fix coccinelle warnings
drivers/net/wireless/ath/wcn36xx/debug.c:27:11-31: WARNING opportunity for simple_open, see also structure on line 106
/c/kernel-tests/src/i386/drivers/net/wireless/ath/wcn36xx/debug.c:27:11-31: WARNING opportunity for simple_open, see also structure on line 148

 This removes an open coded simple_open() function
 and replaces file operations references to the function
 with simple_open() instead.

Generated by: coccinelle/api/simple_open.cocci

CC: Eugene Krasnikov <k.eugene.e@gmail.com>
CC: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Gabor Juhos 7e43f3b066 rt2x00: rt73usb: use rt2x00_has_cap_* helpers
Use the appropriate helper functions instead of
directly accessing the rt2x00dev->cap_flags field
to check device capability flags.

This improves readability of the code a bit.

Compile tested only.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:58 -04:00
Gabor Juhos f3218beef6 rt2x00: rt61pci: use rt2x00_has_cap_* helpers
Use the appropriate helper functions instead of
directly accessing the rt2x00dev->cap_flags field
to check device capability flags.

This improves readability of the code a bit.

Compile tested only.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:57 -04:00
Gabor Juhos c429dfef70 rt2x00: rt2800lib: use rt2x00_has_cap_* helpers
Use the appropriate helper functions instead of
directly accessing the rt2x00dev->cap_flags field
to check device capability flags.

This improves readability of the code a bit.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:57 -04:00
Gabor Juhos 7b8a00dc57 rt2x00: rt2x00lib: use rt2x00_has_cap_* helpers
Use the appropriate helper functions instead of
directly accessing the rt2x00dev->cap_flags field
to check device capability flags.

This improves readability of the code a bit.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:57 -04:00
Gabor Juhos a44d01419c rt2x00: add rt2x00_has_cap_* helpers
The rt2x00 code directly accesses the 'cap_flags'
field of 'struct rt2x00_dev' when checking presence
of a given capability flag. The direct access needs
long expressions which lowers readability of the code.

Add a few helper functions which can be used to test
device capabilities without directly accessing the
cap_flags filed.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:57 -04:00
Gabor Juhos 42f920c90d rt2x00: cleanup indentation in rt2800.h
Adjust whitespaces to move badly aligned constants
to the right column.

The patch contains no functional changes.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-14 13:39:57 -04:00
Avinash Patil 9612bd1ee3 mwifiex: inform cfg80211 about disconnect for P2P client interface
This patch adds missing cfg80211_disconnected event for P2P client
interface upon successful deauthenticate command, deauthenticate
event or disassociate event from FW.

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>
2013-10-14 13:24:26 -04:00
Avinash Patil e8041ceede mwifiex: inform cfg80211 about disconnect if device is removed
If device is surprise removed, commands sent to FW including
deauthenticate command fail as bus writes fail.
We update our media_connected status to false and inform cfg80211
about disconnection only when command is successful. Since cfg80211
assumes device is still connected, it results into following
WARN_ON during unload:

WARNING: CPU: 0 PID: 18245 at net/wireless/core.c:937
         cfg80211_netdev_notifier_call+0x175/0x4d0 [cfg80211]()

Avoid this by emitting cfg80211_disconnected event even if the
deauthenticate command fails.

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>
2013-10-14 13:24:25 -04:00
Marcel Holtmann 3932eb335a Bluetooth: Declare ath3k_table[] and ath3k_blist_tbl[] as const
The ath3k_table[] and ath3k_blist_tbl[] USB device tables can be
declared as const.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:05:24 +02:00
Marcel Holtmann e8549384d0 Bluetooth: Declare bpa10x_table[] as const
The bpa10x_table[] device table can be declared as const

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:05:22 +02:00
Marcel Holtmann 9712d59ab6 Bluetooth: Declare bfusb_table[] as const
The bfusb_table[] device table can be declared as const

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:05:20 +02:00
Marcel Holtmann 54265202f1 Bluetooth: Declare btusb_table[] and blacklist_table[] as const
The btusb_table[] and blacklist_table[] USB device tables can be
declared as const.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:05:18 +02:00
Marcel Holtmann 602987758b Bluetooth: Remove pointless parameter check in vhci_send_frame()
The hdev parameter of vhci_send_frame() is always valid. If it were
not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:00:38 +02:00
Marcel Holtmann 52bc423a7e Bluetooth: Remove pointless parameter check in hci_uart_send_frame()
The hdev parameter of hci_uart_send_frame() is always valid. If it
were not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:00:24 +02:00
Marcel Holtmann 03b31868a4 Bluetooth: Remove pointless parameter check in dtl1_hci_send_frame()
The hdev parameter of dtl1_hci_send_frame() is always valid. If it
were not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:00:08 +02:00
Marcel Holtmann 6b5924bfea Bluetooth: Remove pointless parameter check in btuart_hci_send_frame()
The hdev parameter of btuart_hci_send_frame() is always valid. If it
were not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 17:00:02 +02:00
Marcel Holtmann 7648d28f28 Bluetooth: Remove pointless parameter check in btmrvl_send_frame()
The hdev parameter of btmrvl_send_frame() is always valid. If it were
not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 16:59:51 +02:00
Marcel Holtmann 2e17455835 Bluetooth: Remove pointless parameter check in bt3c_hci_send_frame()
The hdev parameter of bt3c_hci_send_frame() is always valid. If it
were not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 16:57:27 +02:00
Marcel Holtmann 3c69454afa Bluetooth: Remove pointless parameter check in bluecard_hci_send_frame()
The hdev parameter of bluecard_hci_send_frame() is always valid. If it
were not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 16:57:15 +02:00
Marcel Holtmann aae2627712 Bluetooth: Remove pointless parameter check in bfusb_send_frame()
The hdev parameter of bfusb_send_frame() is always valid. If it were
not valid, then it would have crashed earlier in the call chain.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 16:52:37 +02:00
Marcel Holtmann 7bd8f09f69 Bluetooth: Add hdev parameter to hdev->send driver callback
Instead of masking hdev inside the skb->dev parameter, hand it
directly to the driver as a parameter to hdev->send. This makes
the driver interface more clear and simpler.

This patch fixes all drivers to accept and handle the new parameter
of hdev->send callback. Special care has been taken for bpa10x
and btusb drivers that require having skb->dev set to hdev for
the URB transmit complete handlers.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 15:28:03 +02:00
Eran Harary e2d6f4e71d iwlwifi: support Signed firmware image and Dual CPUs
Support Signed firmware based on code signing system (CSS)
protocol and dual CPUs download,
the code recognize if there are more than one CPU and
if we need to operate the signed protocol according to
the ucode binary image

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 15:05:02 +02:00
Alexander Bondar 2a3115434a iwlwifi: mvm: fix scan request's suspend time parameter
This fix is related to a scan request when associated (bgscan).
FW expects suspend time parameter in micro seconds while the driver
provides a value in time units. This bug leads to a high traffic
latency when scan is requested while traffic is in progress.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 15:04:34 +02:00
Johannes Berg 5023d96616 iwlwifi: mvm: add IBSS support
At the firmware level, IBSS support has similar programming
requirements as AP/GO support, so use the same functions with
just small differences.

With IBSS only a single virtual interface can be used, so no
changes in the advertised interface combinations are needed.

For now, don't use hardware crypto for the GTKs in IBSS mode,
the firmware should support it though.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 10:14:08 +02:00
Eran Harary c4aee085c0 iwlwifi: Support 7265 devices
7265 is a very similar device to 7260, so just add
the definitions based on 7260 for it.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 10:01:28 +02:00
Stanislaw Gruszka f39a52bfaf iwlwifi: don't WARN on bad firmware state
When we restart firmware and it is marked as not alive, we can still get
calls from mac80211. Don't WARN on in this situation as this triggers
automatic bug reports with no valuable information.

This continuation of:

commit 8ca95995e6
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Sep 15 11:37:17 2013 +0300

    iwlwifi: don't WARN on host commands sent when firmware is dead

which remove WARN_ONCE from one place, but those warnings are also
triggered from other functions.

Patch also adds unlikely() statement.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:59:32 +02:00
Johannes Berg 9439eac79f iwlwifi: pcie: poke device when commands don't complete quickly
In certain corner cases in the firmware implementation, powersave
transitions can cause the firmware to miss the fact that commands
were added to the queue/FIFO and thus never processes them. Since
the commands really are in the queue, try to poke the firmware in
such cases (by grabbing NIC access, which wakes up the NIC) so it
notices the new command and processes it.

Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:59:15 +02:00
Emmanuel Grumbach ffa6c7077c iwlwifi: mvm: BT Coex - update integration with rate control
Remove code that is not needed and always allow MIMO when
in tight mode. In loose mode, we should avoid MIMO since BT
can use the other antenna to Rx while we Tx.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:58:52 +02:00
Emmanuel Grumbach e9fff7767e iwlwifi: mvm: BT Coex - remove duplicate code in rate control
The code limiting the AMPDU length due to BT traffic was
duplicated. Remove the redundant code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:58:44 +02:00
Emmanuel Grumbach 5961257a9b iwlwifi: mvm: BT Coex - start AMPDU even when BT is active
Tests have shown that we should start AMPDU even when BT
is active. So remove that constraint.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:58:36 +02:00
Emmanuel Grumbach da8f836391 iwlwifi: mvm: BT Coex - tune SMPS parameters
Tests have shown that we should go SMSP_STATIC when BT
traffic is high, and stay in dynamic if BT traffic is low.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:58:21 +02:00
Emmanuel Grumbach 8e484f0baf iwlwifi: mvm: BT Coex - track bandwidth changes in HT
BT Coex needs to be updated when the bandwidth is modified
by the AP.
While at it, remove the vif parameter from
bt_coex_vif_change since it was unused.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:57:53 +02:00
Johannes Berg 6d9d32b89a iwlwifi: mvm: keep connection to AP after WoWLAN
Until now, after WoWLAN, we weren't able to keep the
connection to the AP because the firmware didn't give
us the right information. Since the firmware API has
been changed to include all the information we need,
change the driver to work with the new API (if it is
available) and program all the relevant information
in mac80211 to keep the connection.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:57:53 +02:00
Johannes Berg 04a4e1fdd2 Merge remote-tracking branch 'wireless-next/master' into HEAD 2013-10-11 09:57:47 +02:00
Eytan Lifshitz 19e737c984 iwlwifi: mvm: add support for NICs which have only 16 Tx queues.
Some NICs embedded in platforms that have only 16 Tx queues,
this affect the mapping of the Tx queues.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:58 +02:00
Eytan Lifshitz 81a67e32c4 iwlwifi: mvm: prevent the NIC to be powered at driver load time.
Some NICs aren't allowed to be powered up at driver load time.
Fix it, and move the external NVM loading from driver load time to
driver up time (parsing the external nvm file remains at driver load time).

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:58 +02:00
Alexander Bondar 64b928c4e2 iwlwifi: mvm: Add device wide power command
FW starts using legacy power table command (0x77) for device wide power
settings. Currently this command contains only option flags field.
It can configure the following: CAM (Continuous Active Mode) and
POWER_SAVE_ENABLE debug option. Send this command when firmware is
loaded - D0 and D3.
Note: Setting this command is important to avoid unwanted FW behavior.
It particularly fixes a bug when a device does not drop to low power
after disassociation from AP.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:57 +02:00
Emmanuel Grumbach 42550a53db iwlwifi: pcie: restart the driver when a command times out
This should really not happen. If it does, restarting is the
only way to recover since the driver and the firmware might
very well be out of sync. Moreover, iwl_op_mode_nic_error
will print data that might help debugging.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:57 +02:00
Emmanuel Grumbach d1d5e3cda0 iwlwifi: mvm: BT Coex - set the proper LUT for single ant devices
Single shared antenna devices need a special LUT.
Address this need.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:56 +02:00
Emmanuel Grumbach 9145d15128 iwlwifi: mvm: BT Coex - don't limit agg size in loose scheme
In loose BT Coex scheme, the aggregation size doesn't need to
be limited.

To avoid triggering it, remove a lockdep assertion - we need
to compute the AMPDU size limit from rate control code which
can't take mvm->mutex. This means that there is a race but in
the worst case, we will have a wrong AMPDU size limit which
is not a big issue.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-11 09:56:25 +02:00
Marcel Holtmann e1a2617069 Bluetooth: Provide hdev parameter to hci_recv_frame() driver callback
To avoid casting skb->dev into hdev, just let the drivers provide
the hdev directly when calling hci_recv_frame() function.

This patch also fixes up all drivers to provide the hdev.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 09:45:34 +02:00
Marcel Holtmann 8909f6d2c4 Bluetooth: Remove unused h4_check_data_len() function
The function h4_check_data_len() is actually not used. So just
remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-11 07:51:09 +02:00
Marcel Holtmann e93ac9c063 Bluetooth: Remove unused btmrvl_ioctl() callback
The btmrvl_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:11:35 +02:00
Marcel Holtmann 3c7288422f Bluetooth: Remove unused dtl1_hci_ioctl() callback
The dtl1_hci_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:11:00 +02:00
Marcel Holtmann 71f3903047 Bluetooth: Remove unused btuart_hci_ioctl() callback
The btuart_hci_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:10:37 +02:00
Marcel Holtmann 69b7e17057 Bluetooth: Remove unused bt3c_hci_ioctl() callback
The bt3c_hci_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:10:16 +02:00
Marcel Holtmann 87d82ee257 Bluetooth: Remove unused bluecard_hci_ioctl() callback
The bluecard_hci_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:10:00 +02:00
Marcel Holtmann 19cf55a234 Bluetooth: Remove unused bfusb_ioctl() callback
The bfusb_ioctl() function is not used and thus remove it.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:09:49 +02:00
Marcel Holtmann 014f7bc787 Bluetooth: Use hci_conn_num() instead of direct connection hash access
When changing the alternate setting for the ISOC endpoints, use the
hci_conn_num() helper function to count currently established SCO
and eSCO connections and store the the value. This avoids direct
access to the connection hash.

In addition use the stored value instead accessing the connection
hash over and over again.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2013-10-10 22:08:02 +02:00
Solomon Peachy 4978705d26 wireless: cw1200: acquire hwbus lock around cw1200_irq_handler() call.
This fixes "lost interrupt" problems that occurred on SPI-based systems.
cw1200_irq_handler() expects the hwbus to be locked, but on the
SPI-path, that lock wasn't taken (unlike in the SDIO-path, where the
generic SDIO-code takes care of acquiring the lock).

Cc: stable@vger.kernel.org
Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 14:05:42 -04:00
Mark Cave-Ayland 9473ca6e92 rtlwifi: rtl8192cu: Fix error in pointer arithmetic
An error in calculating the offset in an skb causes the driver to read
essential device info from the wrong locations. The main effect is that
automatic gain calculations are nonsense.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [2.6.39+]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 14:05:41 -04:00
Gabor Juhos e25aa82a89 rt2x00: rt2800lib: fix VGC adjustment for RT3572 and RT3593
The Ralink DPO_RT5572_LinuxSTA_2.6.1.3_20121022
reference driver uses different RSSI threshold
and VGC adjustment values for the RT3572 and
RT3593 chipsets.

Update the rt2800_link_tuner function to use the
same values. Also change the comment in the function
to make it more generic.

References:

  RT35xx_ChipAGCAdjust function in chips/rt35xx.c
  RSSI_FOR_MID_LOW_SENSIBILITY constant in include/chip/rtmp_phy.h
  RT3593_R66_MID_LOW_SENS_GET macro in include/chip/rt3593.h
  RT3593_R66_NON_MID_LOW_SEMS_GET macro in include/chips/rt3593.h

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:53:07 -04:00
Gabor Juhos 0beb1bbf19 rt2x00: rt2800lib: fix VGC adjustment for RT5592
In commit 3d81535ea5
(rt2800: 5592: add chip specific vgc calculations)
the rt2800_link_tuner function has been modified to
adjust VGC level for the RT5592 chipset.

On the RT5592 chipset, the VGC level must be adjusted
only if rssi is greater than -65. However the current
code adjusts the VGC value by 0x10 regardless of the
actual chipset if the rssi value is between -80 and
-65.

Fix the broken behaviour by reordering the if-else
statements.

Cc: stable@vger.kernel.org
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:53:07 -04:00
Gabor Juhos 1dc254ac9f rt2x00: use generic EWMA functions for average RSSI calculations
Remove the local MOVING_AVERAGE implementation, and use
the generic EWMA functions instead.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:49:29 -04:00
Kevin Lo 8f78b0bb87 rt2x00: rt2800lib: no need to toggle RF R30 bit 7 twice
In rt2800_config_channel_rf3xxx(), there's no need to toggle
RF R30 bit 7 twice.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:49:28 -04:00
Michael Opdenacker a9b1d9ac8c net: p54spi: remove deprecated IRQF_DISABLED
This patch proposes to remove the use of the IRQF_DISABLED flag

It's a NOOP since 2.6.35 and it will be removed one day.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:49:28 -04:00
Stanislaw Gruszka fdbdd25c47 rt2x00: do not pause queue on flush
Pausing queue on flush make no sense since txdone procedure un-pause
queue. Before flush procedure we have to assure queue is stopped,
i.e. on receive path h/w RX is disabled, on transmit path queue is
disabled in mac80211. That conditions are true except one function:
rt2x00usb_watchdog_tx_dma(), so add stop/start queue there.

Note stop/start queue can be racy if we do this from multiple paths,
but currently we stop TX queues only on rt2x00lib_disable_radio(),
which also stop/sync watchdog, hance we have no race condition.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:49:28 -04:00
Gabor Juhos 733aec6a5b rt2x00: rt2800lib: fix default VGC values for RT3572 for the 5GHz band
The rt2x00 driver uses 0x22 as a default VGC value
in VGC adjustment for the RT3572 chipset. In the
Ralink DPO_RT5572_LinuxSTA_2.6.1.3_20121022 driver,
this value is only used for initialization. During
VGC adjustment, the reference driver uses different
values.

Update the 'rt2800_get_default_vgc' function to
synchronize the values with the reference driver.
Also add the missing AGC initialization code into
the 'rt2800_config_channel' function.

References:
  RT35xx_SetAGCInitValue in chip/rt35xx.c
  RT35xx_ChipAGCAdjust in chip/rt35xx.c

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:49:28 -04:00
Gabor Juhos 271f1a4d70 rt2x00: rt2800lib: fix VGC programming for RT3572 and RT3593
According to the DPO_RT5572_LinuxSTA_2.6.1.3_20121022
reference driver, programming of the 'BBP 66' register
on the RT3572 and RT3593 chipsets must be done via the
'rt2800_bbp_write_with_rx_chain' function. This ensures
that value is correclty set for all RX chains.

References:
  RT35xx_ChipAGCAdjust and RT35xx_SetAGCInitValue functions
  in chips/rt35xx.c

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:48:06 -04:00
Gabor Juhos 0ffd2a9a44 rt2x00: rt2800lib: fix default VGC values for RT3593
Update the rt2800_get_default_vgc function to use the same VGC
values that the DPO_RT5572_LinuxSTA_2.6.1.3_20121022 reference
driver uses.

References:
  RT35xx_ChipAGCAdjust in chips/rt35xx.c
  RT3593_R66_MID_LOW_SENS_GET macro in include/chip/rt3593.h
  RT3593_R66_NON_MID_LOW_SEMS_GET macro in include/chips/rt3593.h

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:48:06 -04:00
Gabor Juhos cdabcb2bd9 rt2x00: rt2800lib: remove TXPOWER_DELTA entry from extended EEPROM map
The TXPOWER_DELTA field of the regular EEPROM
stores the TX power compensation value for HT40.
The extended EEPROM has no such field, it stores
separate TX power values for HT20 and for HT40.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:01 -04:00
Gabor Juhos a750db9e5c rt2x00: rt2800lib: remove TXMIXER_GAIN entries from the extended EEPROM map
The comments are indicating that the TXMIXER_GAIN_BG
and TXMIXED_GAIN_A entries are overlapping with the
RSSI_BG2 and RSSI_A2 entries in the extended EEPROM
map. This is not correct, because the upper byte of
the RSSI_BG2 and RSSI_A2 entries are reserved. There
are no TX mixer gain values are stored at all in the
extended EEPROM.

Remove the initialization of these entries from the
extended EEPROM map to reflect this.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:01 -04:00
Hauke Mehrtens 7d9b3589df brcmsmac: add support for a BCM4313 with PCI id 0x4313
There are some BCM4313 out there with a PCI id of 0x4313. These devices
are missing a sprom and are only used on routers or other embedded
devices. We found one connected to a BCM63XX SoC.

This devices was found by someone in this ticket:
https://dev.openwrt.org/ticket/13551

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:00 -04:00
Hauke Mehrtens b9f54bd03f bcma: add PCI id 0x4313
This PCI id is used by some BCM4313 cards without a sprom. I have seen
such a card on a router connected to some BCM63XX SoC via PCIe. There
are cards out there with the same PCI id and a BCM4311, which is a pre
ieee80211n chip only supporting ieee80211a, these are still not
supported by b43 and not detected by ssb.

This devices was found by someone in this ticket:
https://dev.openwrt.org/ticket/13551

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:00 -04:00
Hauke Mehrtens dfa0415bcb bcma: reject PCI cards in bcma.
bcma currently only supports PCIe cards and no PCI cards, reject them
if we find them. I have never heard of any PCI card using the AI bus
(bcma), all of them are using ssb instead.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:00 -04:00
Felipe Balbi 9f55c62013 net: wireless: wl1251: update firmware path
TI firmwares are located under ti-connectivity
directory. Update path to make sure driver can
find and load firmware blob.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:46:00 -04:00
Kirill Tkhai 21cf502a28 rt2x00_pci: Fix interrupt handler name (visible at /proc/interrupts)
Currently driver name is wrong. PCI device address is visible at
/proc/interrupts instead of the name:

 43:    124      0      0      0   PCI-MSI-edge    rtsx_pci
 44:    384      0      0      0   PCI-MSI-edge    snd_hda_intel
 45:  25096      0      0      0   PCI-MSI-edge    0000:01:00.0
                                                   ^^^^^^^^^^^^

So, pass the right name. rt2x00_ops->name contains KBUILD_MODNAME
and good for that, so pass it.

Handler names will be "rt2500pci", "rt2500pci" etc.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: Ivo van Doorn <IvDoorn@gmail.com>
CC: Gertjan van Wingerde <gwingerde@gmail.com>
CC: Helmut Schaa <helmut.schaa@googlemail.com>
CC: linux-wireless@vger.kernel.org
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:43:35 -04:00
Eugene Krasnikov 8e84c25821 wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware
This is a mac80211 driver for Qualcomm WCN3660/WCN3680 devices. So
far WCN3660/WCN3680 is available only on MSM platform.

Firmware can be found here:
https://www.codeaurora.org/cgit/external/hisense/platform/vendor/qcom-opensource/wlan/prima/tree/firmware_bin?h=8130_CS

Wiki page is available here:
http://wireless.kernel.org/en/users/Drivers/wcn36xx

A lot people made a contribution to this driver. Here is the list in
alphabetical order:

Eugene Krasnikov <k.eugene.e@gmail.com>
Kalle Valo <kvalo@qca.qualcomm.com>
Olof Johansson <dev@skyshaper.net>
Pontus Fuchs <pontus.fuchs@gmail.com>
Yanbo Li <yanbol@qti.qualcomm.com>

Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:43:35 -04:00
Peter Senna Tschudin c856197d6e mwifiex: Change variable type to bool
The variables cancel_scan_cmd, enable_data, hs_activate and valid are
only assigned the values true and false. Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-10 13:41:37 -04:00
Fengguang Wu e05634ee6c ath10k: remove unneded semicolon from ath10k_core_fetch_firmware_api_n()
drivers/net/wireless/ath/ath10k/core.c:507:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-09 17:16:15 +03:00
Kalle Valo 60631c5c10 ath10k: fix ath10k_debug_start() locking
ath10k_debug_start() was not called with conf_mutex, fix that. Also there was a
deadlock in ath10k_debug_stop(), rename it to ath10k_debug_destroy() and call
it only when the device is destroyed.

Reported-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-09 17:14:55 +03:00
Sujith Manoharan a24b88b560 ath10k: Fix bug in max. VHT A-MPDU size
For VHT peers, the maximum A-MPDU size has to be calculated
from the VHT capabilities element and not the HT-cap. The formula
is the same, but a higher value is used in VHT, allowing larger
aggregates to be transmitted.

The patch contains a workaround for some Netgear/Linksys APs that
report Rx A-MPDU factor incorrectly.

Tested-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-08 22:10:22 +03:00
Michal Kazior 0d1a28f241 ath10k: fix RX performance when using AP 10.X FW
Due to oversight AP 10.X support was merged with
Ethernet RX decap mode.

Only Native Wifi RX decap mode guarantees IP
header is properly aligned and avoids sk_buff data
realignment (which is very expensive
performance-wise) in mac80211.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-08 15:22:33 +03:00
Michal Kazior 9bab1cc010 ath10k: fix possible memory leak in new FW loading
Some failpaths did `return` instead of a `goto`
leaking requested firmware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-08 15:13:53 +03:00
Michal Kazior fd9c4864a7 ath10k: fix printf format string
size_t corresponds to %zu not %d. Compiler was
complaining about it.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-08 15:13:53 +03:00
Johannes Berg d107babca2 iwlwifi: pcie: fix merge damage
The merge b35c8097 seems to have lost commit eabc4ac5d,
put the code back.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-07 13:34:43 -04:00
Felix Fietkau ec30326ea7 ath9k: fix tx queue scheduling after channel changes
Otherwise, if queues are full during a scan, tx scheduling does not
resume after switching back to the home channel.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-07 13:34:43 -04:00
John W. Linville c1a305abf7 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes 2013-10-07 13:25:18 -04:00
Michal Kazior 3efcb3b40c ath10k: remove num_sends_allowed
The value provided by num_sends_allowed is now
derived from CE source ringbuffer state.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:28:02 +03:00
Michal Kazior 2e761b5a52 ath10k: remove ce_sendlist_send
It is completely pointless to keep this function
around. It doesn't do anything different than
ce_send except it introduces more overhead.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:28:02 +03:00
Michal Kazior ddb6ad77b4 ath10k: split vdev_id calculation from tx function
Tidy up ath10k_tx().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:28:02 +03:00
Michal Kazior 42c3aa6f6a ath10k: split tid calculation from tx function
Tidy up ath10k_tx().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:28:01 +03:00
Bartosz Markowski c322892fa7 ath10k: extend the max_scan time
It was observed few times, the artificial max_scan limit we
are using mainly to detect FW hangs, can be not enough for
instance while being associated and during heavy traffic.

What we do if the FW won't return with scan results within
the max_time time is a scan abort.

This is especially visible with 10.X fw which in combination
with dual band HW (scanning 32 channels) can end up with
hw_scan close to 10 seconds.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:23:53 +03:00
Bartosz Markowski 8acd3c97ff ath10k: enable 10.x firmware branch support
Since the WMI API has been added and we can detect from the
FW IEs what firmware variant we deal with, turn on support
for 10.x firmware branch in ath10k_wmi_attach().

kvalo: improve the commit log

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-10-07 15:22:06 +03:00
Thierry Escande 7227c0216d NFC: port100: Add target mode support
This implements the target NFC digital operations tg_configure_hw(),
tg_listen(), tg_listen_mdaa(), and tg_send_cmd().

The target mode supports NFC-A technology at 106kbits/s and NFC-F
technologies at 212 and 424kbits/s.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Cc: Stephen Tiedemann <stephen.tiedemann@gmail.com>
Tested-by: Cho, Yu-Chen <acho@suse.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-10-07 14:11:20 +02:00
Thierry Escande 9f7b57f28c NFC: port100: Add initiator mode support
This patch implements the initiator NFC operations in_configure_hw()
and in_send_cmd(). It also implements the switch_rf() operation.

The initiator mode supports NFC-A technology at 106kbits/s and NFC-F
technologies at 212 and 424kbits/s.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Cc: Stephen Tiedemann <stephen.tiedemann@gmail.com>
Tested-by: Cho, Yu-Chen <acho@suse.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-10-07 14:11:14 +02:00
Thierry Escande 0347a6ab30 NFC: port100: Commands mechanism implementation
This patch implements the command handling mechanism. The digital stack
serializes all commands sent to the driver. This means that the digital
stack waits for the reply of the current command before sending a new
one. So there is no command queue managed at driver level.

All Port-100 commands are asynchronous. If the command has been sent
successfully to the device, it replies with an ACK frame. Then the
command response is received (or actually no-response in case of
timeout or error) and a command complete work on the system workqueue
is responsible for sending the response (or the error) back to the
digital stack.

The digital stack requires some commands to be synchronous, mainly
hardware configuration ones. These commands use the asynchronous
command path but are made synchronous by using a completion object.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Cc: Stephen Tiedemann <stephen.tiedemann@gmail.com>
Tested-by: Cho, Yu-Chen <acho@suse.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-10-07 14:10:52 +02:00
Thierry Escande 562d4d59b8 NFC: Sony Port-100 Series driver
This adds support for the Sony NFC USB dongle RC-S380, based on the
Port-100 chip. This dongle is an analog frontend and does not implement
the digital layer. This driver uses the nfc_digital module which is an
implementation of the NFC Digital Protocol stack.

This patch is a skeleton. It only registers the dongle against the NFC
digital protocol stack. All NFC digital operation functions are stubbed
out.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Cc: Stephen Tiedemann <stephen.tiedemann@gmail.com>
Tested-by: Cho, Yu-Chen <acho@suse.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-10-07 14:09:33 +02:00
Xose Vazquez Perez 274dede8c5 wireless: rt2x00: rt2800usb: add new devices
0411,0241  RT5572  BUFFALO WI-U2-300D Wireless LAN Adapter
0789,0170  RT3572  Logitec LAN-W300AN/U2
0846,9013  RT3573  NETGEAR Adaptador USB Inalambrico Movistar
0df6,006e  RT3573  Sitecom WiFi USB adapter N900
2001,3c1f  RT3573  D-Link DWA-162 Wireless N900 Dual Band Adapter
2001,3c20  RT5372  D-Link DWA-140 Wireless N USB Adapter(rev.D)
2001,3c21  RT5572  D-Link DWA-160 Xtreme N Dual Band USB Adapter(rev.C)
2001,3c22  RT5372  D-Link DWA-132 Wireless N USB Adapter(rev.B)
2001,3c23  RT5372  D-Link GO-USB-N300 Wireless N Easy USB Adapter
2019,ab29  ?       Planex GW-USMirco300
20f4,724a  RT5572  TRENDnet N600 Wireless Dual Band USB Adapter

Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:57:34 -04:00
Larry Finger d41200ad5f rtlwifi: rtl8188ee: Convert driver to use new rtl_phy_scan_operation_backup() routine
Now that rtl_phy_scan_operation_backup() exists, convert rtl8188ee to use it.
Routine rtl88e_phy_scan_operation_backup() is no longer used and is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:40:02 -04:00
Larry Finger 3fc0165657 rtlwifi: rtl8723ae: Convert driver to use new rtl_phy_scan_operation_backup() routine
Now that rtl_phy_scan_operation_backup() exists, convert rtl8723ae to use it.
Routine rtl8723ae_phy_scan_operation_backup() is no longer used and is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:39:09 -04:00
Larry Finger 6483033ad8 rtlwifi: rtl8192ce: Convert driver to use new rtl_phy_scan_operation_backup() routine
Now that rtl_phy_scan_operation_backup() exists, convert rtl8192de to use it.
Routine rtl92d_phy_scan_operation_backup() is no longer used and is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:37:57 -04:00
Larry Finger 0d1cdce2f5 rtlwifi: rtl8192c: Remove rtl8192c_phy_scan_operation_backup()
Drivers rtl8192ce and rtl8192cu no longer rely on this routine. It is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:36:51 -04:00
Larry Finger 3764eb72a5 rtlwifi: rtl8192ce: Convert driver to use new rtl_phy_scan_operation_backup() routine
Now that rtl_phy_scan_operation_backup() exists, convert rtl8192ce to use it.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:36:51 -04:00
Larry Finger 5784935dd7 rtlwifi: rtl8192cu: Convert to use new rtl_phy_scan_operation_backup() routine
Now that the routine exists in driver rtlwifi, convert rtl8192cu to use it.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:30 -04:00
Larry Finger 4f4826da8c rtlwifi: Implement a common rtl_phy_scan_operation_backup() routine
Several of the drivers supported by rtlwifi individually implement the same
routine that supports scans. As a first step, create this routine in
driver rtlwifi.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:30 -04:00
Larry Finger c6d3729984 rtlwifi: Remove all remaining references to variable 'noise' in rtl_stats struct
This completes removal of all places that reference variable 'noise'
in the rtl_stats struct. The definition of the struct is unchanged.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:29 -04:00
Larry Finger dab3df5e88 rtlwifi: rtl8188ee: Fix smatch warning in rtl8188ee/hw.c
Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
drivers/net/wireless/rtlwifi/rtl8188ee/hw.c:149 _rtl88ee_set_fw_clock_on() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8188ee/hw.c:149 _rtl88ee_set_fw_clock_on() info: ignoring unreachable code.

This info message is the result of a real error due to a missing break statement
in a "while (1)" loop.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [3.10+]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:29 -04:00
Larry Finger 354d0f3c40 rtlwifi: Fix smatch warnings in usb.c
Smatch displays the following:
  CHECK   drivers/net/wireless/rtlwifi/usb.c
drivers/net/wireless/rtlwifi/usb.c:458 _rtl_usb_rx_process_agg() warn: assigning (-98) to unsigned variable 'stats.noise'
drivers/net/wireless/rtlwifi/usb.c:503 _rtl_usb_rx_process_noagg() warn: assigning (-98) to unsigned variable 'stats.noise'
drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/usb.c:596 _rtl_rx_get_padding() info: ignoring unreachable code.

The variable 'stats.noise' is not used, thus the initializers are removed.
The unreachable code info is fixed by including the appropriate section inside
#ifdef .. #endif constructions.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:29 -04:00
Larry Finger a3557d4d48 rtlwifi: Fix smatch warning in pci.c
Smatch reports the following:
  CHECK   drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/pci.c:739 _rtl_pci_rx_interrupt() warn: assigning (-98) to unsigned variable 'stats.noise'

The variable 'stats.noise' is not used. That initializer is removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:28 -04:00
Larry Finger d0df71dcd9 rtlwifi: rtl8192_common: Fix smatch errors and warnings in rtl8192c/dm_common.c
Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:551 rtl92c_dm_pwdb_monitor() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:551 rtl92c_dm_pwdb_monitor() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:870 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:870 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:882 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:883 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:891 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c:892 rtl92c_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'txpwr_level' 2 <= 2

The unreachable code message is fixed by deleting the code that follows a return.

The errors are fixed by increasing the size of txpwr_level.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:28 -04:00
Larry Finger 61800b2761 rtlwifi: rtl8192cu: Fix smatch warning in rtl8192cu/trx.c
Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c:367 _rtl_rx_process() warn: assigning (-98) to unsigned variable 'stats.noise'

This variable is unused, thus the initializer is removed, as well as a
comment referring to that variable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:27 -04:00
Larry Finger 857c007730 rtlwifi: rtl8192de: Fix smatch warnings in rtl8192de/hw.c
Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192de/hw.c
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.
drivers/net/wireless/rtlwifi/rtl8192de/hw.c:1200 rtl92de_set_qos() info: ignoring unreachable code.

The dead code is deleted.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:27 -04:00
Larry Finger adb250b9d2 rtlwifi: rtl8192du: Fix smatch errors in /rtl8192de/dm.c
Smatch lists the following:
  CHECK   drivers/net/wireless/rtlwifi/rtl8192de/dm.c
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1054 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'ofdm_index' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1056 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'ofdm_index' 2 <= 2
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1126 rtl92d_dm_txpower_tracking_callback_thermalmeter() debug: remove_pools: nr_children over 4000 (4596). (rtlpriv->dbg.global_debuglevel merged)
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1126 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1129 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1132 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1135 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1138 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1141 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1144 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1147 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch1ch13' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1151 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1154 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1157 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1160 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1163 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1166 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1169 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255
drivers/net/wireless/rtlwifi/rtl8192de/dm.c:1172 rtl92d_dm_txpower_tracking_callback_thermalmeter() error: buffer overflow 'cckswing_table_ch14' 33 <= 255

This patch fixes several off-by-one errors. It also removes a comment
referencing variable 'noise' in the rts_stats struct.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:27 -04:00
Stanislaw Gruszka 3b9b74baa1 rt2800: add support for radio chip RF3070
Add support for new RF chip ID: 3070. It seems to be the same as 5370,
maybe vendor just put wrong value on the eeprom, but add this id anyway
since devices with it showed on the marked.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:26 -04:00
Arend van Spriel 05f3820b2e brcmfmac: rework rx path bus interface
The brcmfmac has common and bus specific part. The rx function api
was using sk_buff_head. Changed to sk_buff instead.

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>
2013-10-03 16:24:26 -04:00
Hante Meuleman f2c44fe7c8 brcmfmac: Use fw filename and nvram based of devid for sdio.
SDIO firmware download routines uses one name for firmware file
and nvram file for all sdio devices. This is not user friendly.
Use fw filename and nvram filename based upon chip id and revision.

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:25 -04:00
Arend van Spriel 5af47fb394 brcmfmac: fix sparse error 'bad constant expression'
The definition of BRCMF_EVENTING_MASK_LEN results in a sparse
error message

.../fweh.c:331:22: error: bad constant expression
.../fweh.c:388:22: error: bad constant expression
.../dhd_common.c:256:22: error: bad constant expression

This is caused by the use of roundup() in BRCMF_EVENTING_MASK_LEN
and it is used to allocate an array variable on the stack. Better
use DIV_ROUND_UP() macro.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
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>
2013-10-03 16:24:25 -04:00
Franky Lin 5491c11c67 brcmfmac: reserve memory for bus layer in sk_buff::cb
Bus layer need to share sk_buff::cb with firmware signal feature. Reserve
necessary memory so they won't overwrite each other.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:25 -04:00
Franky Lin 7434785652 brcmfmac: add valid core index check in related functions
Perform a valid check for core index to avoid illegal address access.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:24 -04:00
Franky Lin fe0401582e brcmfmac: add BCM4339 SDIO interface support
BCM4339 is an a/b/g/n/ac 1x1 WiFi chip. This patch adds support for it through
SDIO interface.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:24 -04:00
Franky Lin 4cd0ea456b brcmfmac: sync firmware event list
Update event list to keep sync with firmware development. Use calculated event
mask length instead of hard-coded value.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-10-03 16:24:23 -04:00
John W. Linville 0d4f55bc37 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2013-10-03 16:19:07 -04:00
John W. Linville 75ae83d686 Merge tag 'for-linville-20131001' of git://github.com/kvalo/ath 2013-10-03 16:16:34 -04:00
John W. Linville c21a7d661f Merge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx 2013-10-03 16:15:35 -04:00
Hans de Goede b1a8014471 Bluetooth: revert: "Bluetooth: Add missing reset_resume dev_pm_ops"
Many btusb devices have 2 modes, a hid mode and a bluetooth hci mode. These
devices default to hid mode for BIOS use. This means that after having been
reset they will revert to HID mode, and are no longer usable as a HCI.

Therefor it is a very bad idea to just blindly make reset_resume point to
the regular resume handler. Note that the btusb driver has no clue how to
switch these devices from hid to hci mode, this is done in userspace through
udev rules, so the proper way to deal with this is to not have a reset-resume
handler and instead let the usb-system re-enumerate the device, and re-run
the udev rules.

I must also note, that the commit message for the commit causing this
problem has a very weak motivation for the change:

"Add missing reset_resume dev_pm_ops. Missing reset_resume results in the
following message after power management device test. This change sets
reset_resume to btusb_resume().

[ 2506.936134] btusb 1-1.5:1.0: no reset_resume for driver btusb?
[ 2506.936137] btusb 1-1.5:1.1: no reset_resume for driver btusb?"

Making a change solely to silence a warning while also changing important
behavior (normal resume handling versus re-enumeration) requires a commit
message with a proper explanation why it is safe to do so, which clearly lacks
here, and unsurprisingly it turns out to not be safe to make this change.

Reverting the commit in question fixes bt no longer working on my Dell
E6430 after a suspend/resume, and I believe it likely also fixes the
following bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=988481
https://bugzilla.redhat.com/show_bug.cgi?id=1010649
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1213239

This reverts commit 502f769662.

Cc: Shuah Khan <shuah.kh@samsung.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
2013-10-02 16:01:49 -03:00
Jingoo Han 5d3c2f7d34 wireless: iwlwifi: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:46 +02:00
Emmanuel Grumbach c90ca50741 iwlwifi: pcie: dump_stack upon timeout of SYNC cmd
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:46 +02:00
Eytan Lifshitz ff116373f6 iwlwifi: mvm: change the name of init_ucode_run flag
In RF KILL the init ucode is running, but don't complete
all its tasks, so we need to run the init ucode again.
Change the flag name to init_ucode_complete, to be more appropriate.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:45 +02:00
Johannes Berg f7fc598931 iwlwifi: mvm: implement new IPv6 offload API
The firmware API for IPv6 NDP/NS offload has changed again.
Implement support for the new API; this requires calculating
the solicited node address for each "target" address as it's
no longer ignored by the firmware.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:45 +02:00
Emmanuel Grumbach f6fc57756b iwlwifi: mvm: BT Coex - Correctly enable and treat rssi events
Rssi events were enabled on interfaces using 5.2GHz.
Interfaces on 5.2GHz were taken into account while
determining the ACK / CTS kill mask. Fix that.

The last rssi notified to BT Coex was reset every BT Coex
Notification. Since we get a lot of these notifications
from the firmware, we reset the rssi all the time which
means that the bt_rssi_event is called all the time.
Fix that by puting the rssi we pull upon BT Coex
notification into iwl_mvm_vif_bf_data.last_bt_coex_event

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:44 +02:00
Emmanuel Grumbach 2de13caebc iwlwifi: mvm: BT Coex - adapt debugfs to new API
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:43 +02:00
Emmanuel Grumbach 39149911ba iwlwifi: mvm: don't use reduced Tx power when not applicable
When we have only one antenna for BT and WiFi, reduced Tx
power is irrelevant.
Also, in loose scheme, we should not use reduced Tx power
nor set the control mask to Tx power.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:43 +02:00
Djalal Harouni 0e9d84ea89 iwlwifi: mvm: make debugfs write() operations write up to count bytes
Some debugfs write() operations of the MVM Firmware will ignore the
count argument, and will copy more bytes than what was specified.
Fix this by getting the right count of bytes.

This will honor restrictions put on the number of bytes to write and
avoid strcmp() calls on garbage data.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:42 +02:00
Eyal Shapira 6a524f487c iwlwifi: mvm: remove GF support in rs
mvm doesn't support HT GF so drop all relevant code in rs.

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>
2013-10-02 18:00:42 +02:00
Eyal Shapira d310e4059f iwlwifi: mvm: support VHT in rs
Enable rs algorithm to use VHT rates and use 80Mhz.
This enables reaching VHT rates which wasn't possible.

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>
2013-10-02 18:00:41 +02:00
Emmanuel Grumbach 4515f30fb6 iwlwifi: mvm: BT Coex - use data from firmware
The data in MailBox comes direclty from the BT core.
We should use the data processed by the WiFi fw that is
appended to the MailBox in the BT Coex notification.
Also decide on whether the Coex type based on the input
from the the firmware and not hard coded.

Also fix the SMPS SISO threshold to 2 (it was 3).

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:41 +02:00
Emmanuel Grumbach 18bc6996c7 iwlwifi: mvm: BT Coex - no need to send envelopes
This was due to a fw remainder of old implementation.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:40 +02:00
Emmanuel Grumbach dac94da8db iwlwifi: mvm: new BT Coex API
This is the new API for BT Coex. The full functionality
will be implemented in further patches.

Note: this disables BT Coex for the currently existing
fw (-7 version).

There is also a new command - the channel inhibition command.

This command tells BT what channels to avoid in order to
minimise the interaction between BT and WiFi.
We can tell BT about 2 channels, primary and secondary.
BT will not tune to primary at all and will avoid secondary
as much as possible.

This also means that we need to track vifs that AP / GO.
So rename iwl_mvm_bt_coex_vif_assoc to
iwl_mvm_bt_coex_vif_change to better reflect its real
meaning.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:40 +02:00
David Spinadel 35a000b7c1 iwlwifi: mvm: support sched scan if supported by the fw
Add support for scheduled scan according to firmware support.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-02 18:00:39 +02:00