profile/common/kernel-common.git
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 16 Jan 2014 17:54:17 +0000 (12:54 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoiwlwifi: mvm: don't use highest rate in VHT MCS Set
Eyal Shapira [Sun, 5 Jan 2014 17:27:24 +0000 (19:27 +0200)]
iwlwifi: mvm: don't use highest rate in VHT MCS Set

Keeping this as 0 is ok according to spec section 9.7.11
as this means the limits are according to the Tx/Rx
supported MCS x NSS bitmap. Initially we've set these as
there were concerns of interop issues but these turned out
to be false.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings
David Spinadel [Thu, 9 Jan 2014 07:55:38 +0000 (09:55 +0200)]
iwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix theoretical uninitialized function return value
Eytan Lifshitz [Tue, 7 Jan 2014 10:50:45 +0000 (12:50 +0200)]
iwlwifi: mvm: fix theoretical uninitialized function return value

If we try to write NVM that do not exist, the function will return
uninitialized value. fixed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: add inline helper for packet lengths
Johannes Berg [Wed, 8 Jan 2014 12:16:33 +0000 (13:16 +0100)]
iwlwifi: add inline helper for packet lengths

Add an inline helper function for getting an RX packet's
length or payload length and use it throughout the code
(most of which I did using an spatch.)

While at it, adjust some code, and remove a bogus comment
from the dvm calibration code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: change beamformee STS cap
Eyal Shapira [Mon, 6 Jan 2014 18:16:48 +0000 (20:16 +0200)]
iwlwifi: change beamformee STS cap

All beamformee supporting chips have the ability to support
VHT NDP in up to 4 STSs. So change the published beamformee
STS cap accordingly to 3 as it should be Nsts-1.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation
Emmanuel Grumbach [Mon, 6 Jan 2014 11:38:55 +0000 (13:38 +0200)]
iwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation

The request of SMPS issued by the Thermal Throttling code
was not reset when we disassociated - fix that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove unused flags from add station command
Emmanuel Grumbach [Wed, 1 Jan 2014 08:05:55 +0000 (10:05 +0200)]
iwlwifi: mvm: remove unused flags from add station command

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: use array indexing instead of treating it as a pointer
Johannes Berg [Mon, 6 Jan 2014 08:29:40 +0000 (09:29 +0100)]
iwlwifi: mvm: use array indexing instead of treating it as a pointer

It's a bit strange to treat an array as a pointer, so use proper
array indexing instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix SRAM dump debugfs handler
Emmanuel Grumbach [Mon, 6 Jan 2014 07:05:54 +0000 (09:05 +0200)]
iwlwifi: mvm: fix SRAM dump debugfs handler

If the length isn't set it means we want all the SRAM.
Also - this is perfectly valid to partially dump starting
at offset 0.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix a theoretical out of bounds access
Eyal Shapira [Sun, 5 Jan 2014 19:04:19 +0000 (21:04 +0200)]
iwlwifi: mvm: rs: fix a theoretical out of bounds access

Discovered by klocwork

Array 'iwl_rate_mcs' of size 15 may use index value(s) -1
  * rs.c:2562: index = iwl_hwrate_to_plcp_idx(rate)
    * rs.c:2562: Result of function call 'iwl_hwrate_to_plcp_idx(rate)' is '[-1,14]'
  * rs.c:2565: Array 'iwl_rate_mcs' size is 15.
  * rs.c:2565: Possible attempt to access element -1 of array 'iwl_rate_mcs'.

While at it stop using index = -1 and always use IWL_RATE_INVALID

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: send all the NVM sections to the NIC
Emmanuel Grumbach [Sun, 5 Jan 2014 13:09:44 +0000 (15:09 +0200)]
iwlwifi: mvm: send all the NVM sections to the NIC

Some NIC comes with more than the 4 NVM (non volative
memory) sections described in the nvm_to_read array.
These NICs usually get their NVM from an external file
fetched from userland during init.
We already parsed the file, but sent to the NIC only 4 NVM
sections whereas there could be more sections in the file.
Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix tx seq_ctrl debug print
Eliad Peller [Tue, 31 Dec 2013 16:54:06 +0000 (18:54 +0200)]
iwlwifi: mvm: fix tx seq_ctrl debug print

Since seq_number is incremented right after using
it, so printed seq_ctrl was actually the next
one to be used.

Fix it by incrementing the seq_number only later,
before saving it.

Additionally, use the IEEE80211_SEQ_TO_SN macro
in order to print the actual sequence number.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: enable oscillator for L1 exit
Emmanuel Grumbach [Tue, 24 Dec 2013 12:15:41 +0000 (14:15 +0200)]
iwlwifi: pcie: enable oscillator for L1 exit

Enabling the oscillator consumes slightly more power (100uA)
but allows to make sure that we exit from L1 on time.

Not doing so might lead to a PCIe specification violation
since we might wake up from L1 at the wrong time.
This issue has been identified on 3160 and 7260 only.
On older NICs L1 off is not enabled, on newer NICs (7265),
the issue is fixed.

When the bug occurs the user sees that the NIC has
disappeared from the PCI bridge, any access to the device
returns 0xff.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=64541

and has been extensively discussed here:
http://markmail.org/thread/mfmpzqt3r333n4bo

Cc: stable@vger.kernel.org [3.10+]
Fixes: 99cd47142399 ("iwlwifi: add 7000 series device configuration")
Reported-and-tested-by: wzyboy <wzyboy@wzyboy.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agop54: clamp properly instead of just truncating
Dan Carpenter [Mon, 13 Jan 2014 19:05:23 +0000 (22:05 +0300)]
p54: clamp properly instead of just truncating

The call to clamp_t() first truncates the variable signed 8 bit and as a
result, the actual clamp is a no-op.

Fixes: 0d78156eef1d ('p54: improve site survey')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmsmac: delete useless variable
Julia Lawall [Mon, 13 Jan 2014 16:17:26 +0000 (17:17 +0100)]
brcmsmac: delete useless variable

Delete a variable that is at most only assigned to a constant, but never
used otherwise.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier i;
constant c;
@@

-T i;
<... when != i
-i = c;
...>
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Process GTT interrupts
Sujith Manoharan [Mon, 13 Jan 2014 08:25:11 +0000 (13:55 +0530)]
ath9k: Process GTT interrupts

Global Transmission Timeout interrupts are generated by
the HW when transmission of a frame fails - this is done
based on the threshold programmed in the AR_GTXTO register.

Currently, even though the interrupt is enabled for all chips,
it is not handled in the driver. This patch handles GTT events
for AR9003 and above chips, checking if the MAC/BB has hung
after successive GTT interrupts crosses a threshold (5).

This can be enabled for the older chips in the AR9002 family once
appropriate HW hang checks are implemented for them.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove debug print in ISR
Sujith Manoharan [Mon, 13 Jan 2014 02:10:56 +0000 (07:40 +0530)]
ath9k: Remove debug print in ISR

There is no need to do this and we can avoid
an unused variable warning when CONFIG_ATH9K_WOW is
not selected.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add a debugfs file "node_recv"
Sujith Manoharan [Mon, 13 Jan 2014 01:59:30 +0000 (07:29 +0530)]
ath9k: Add a debugfs file "node_recv"

This would be useful when debugging RX performance issues.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use a separate debugfs file for PHY errors
Sujith Manoharan [Mon, 13 Jan 2014 01:59:29 +0000 (07:29 +0530)]
ath9k: Use a separate debugfs file for PHY errors

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Show only active TIDs in node_aggr
Sujith Manoharan [Mon, 13 Jan 2014 01:59:28 +0000 (07:29 +0530)]
ath9k: Show only active TIDs in node_aggr

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add an option for station statistics
Sujith Manoharan [Mon, 13 Jan 2014 01:59:27 +0000 (07:29 +0530)]
ath9k: Add an option for station statistics

Also, rename node_stat to node_aggr.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43legacy: Fix unload oops if firmware is not available
Larry Finger [Sun, 12 Jan 2014 21:11:39 +0000 (15:11 -0600)]
b43legacy: Fix unload oops if firmware is not available

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: Fix unload oops if firmware is not available
Larry Finger [Sun, 12 Jan 2014 21:11:38 +0000 (15:11 -0600)]
b43: Fix unload oops if firmware is not available

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

To be able to access the completion structure at teardown, it had to be moved
into the b43_wldev structure.

This patch also fixes a typo in a comment.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: Fix lockdep splat
Larry Finger [Sun, 12 Jan 2014 21:11:37 +0000 (15:11 -0600)]
b43: Fix lockdep splat

In https://bugzilla.kernel.org/show_bug.cgi?id=67561, a locking dependency is reported
when b43 is used with hostapd, and rfkill is used to kill the radio output.

The lockdep splat (in part) is as follows:

======================================================
[ INFO: possible circular locking dependency detected ]
3.12.0 #1 Not tainted
-------------------------------------------------------
rfkill/10040 is trying to acquire lock:
 (rtnl_mutex){+.+.+.}, at: [<ffffffff8146f282>] rtnl_lock+0x12/0x20

but task is already holding lock:
 (rfkill_global_mutex){+.+.+.}, at: [<ffffffffa04832ca>] rfkill_fop_write+0x6a/0x170 [rfkill]

--snip--

Chain exists of:
  rtnl_mutex --> misc_mtx --> rfkill_global_mutex

The fix is to move the initialization of the hardware random number generator
outside the code range covered by the rtnl_mutex.

Reported-by: yury <urykhy@gmail.com>
Tested-by: yury <urykhy@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: add missing endian conversion for fw_tsf
Amitkumar Karwar [Fri, 10 Jan 2014 22:30:41 +0000 (14:30 -0800)]
mwifiex: add missing endian conversion for fw_tsf

It is u64 data received from firmware. Little endian to cpu
conversion is required here.

Cc: <stable@vger.kernel.org> # 3.5+
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>
10 years agowl12xx: fix tx power setting
Alex Gal [Fri, 10 Jan 2014 20:21:13 +0000 (15:21 -0500)]
wl12xx: fix tx power setting

The driver ignores BSS_CHANGED_TXPOWER changes.
Fix this by calling ACX_TX_POWER when appropriate.

Signed-off-by: Alex Gal <a.gal@motsai.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: add USB8897 support
Yogesh Ashok Powar [Fri, 10 Jan 2014 03:36:55 +0000 (19:36 -0800)]
mwifiex: add USB8897 support

Adding new device IDs and assigning generic function/variable
names instead of using device-id specific names.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: rtl8192cu: Add new device ID
Larry Finger [Thu, 9 Jan 2014 16:27:27 +0000 (10:27 -0600)]
rtlwifi: rtl8192cu: Add new device ID

Reported-by: Jan Prinsloo <janroot@gmail.com>
Tested-by: Jan Prinsloo <janroot@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agocfg80211: make regulatory_hint() remove REGULATORY_CUSTOM_REG
Luis R. Rodriguez [Sat, 14 Dec 2013 19:09:06 +0000 (20:09 +0100)]
cfg80211: make regulatory_hint() remove REGULATORY_CUSTOM_REG

The REGULATORY_CUSTOM_REG can be used during early init with
the goal of overriding the wiphy's default regulatory settings
in case the alpha2 of the device is not known. In the case that
the alpha2 becomes known lets avoid having drivers having to
clear the REGULATORY_CUSTOM_REG flag by doing it for them
when regulatory_hint() is used.

Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath: fix warning on usage of REGULATORY_CUSTOM_REG
Luis R. Rodriguez [Sat, 14 Dec 2013 19:09:05 +0000 (20:09 +0100)]
ath: fix warning on usage of REGULATORY_CUSTOM_REG

ath wants to first apply the custom regd and only later
will it revert to not using it if an alpha2 regulatory
domain is found. Since the wireless core now enforces
usage of the REGULATORY_CUSTOM_REG strictly when
wiphy_apply_custom_regulatory() is used this makes
ath adhere to the expected behaviour but also updates
the wiphy after its done with the custom usage.

This fixes this warning:

[    5.488733] ath: phy0: ASPM enabled: 0x43
[    5.488735] ath: EEPROM regdomain: 0x0
[    5.488736] ath: EEPROM indicates default country code should be used
[    5.488736] ath: doing EEPROM country->regdmn map search
[    5.488737] ath: country maps to regdmn code: 0x3a
[    5.488737] ath: Country alpha2 being used: US
[    5.488738] ath: Regpair used: 0x3a
[    5.488738] ------------[ cut here ]------------
[    5.488745] WARNING: CPU: 0 PID: 161 at
/home/sujith/dev/wireless-testing/net/wireless/reg.c:1361
wiphy_apply_custom_regulatory+0x17a/0x1b0 [cfg80211]()
[    5.488746] wiphy should have REGULATORY_CUSTOM_REG

The wireless core can *later* lift this flag for us for when
using the regulatory_hint() to make this fix more generic.

Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Mon, 13 Jan 2014 19:40:59 +0000 (14:40 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

10 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath
John W. Linville [Mon, 13 Jan 2014 19:40:03 +0000 (14:40 -0500)]
Merge branch 'for-linville' of git://github.com/kvalo/ath

10 years agoMerge tag 'nfc-next-3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 13 Jan 2014 19:36:42 +0000 (14:36 -0500)]
Merge tag 'nfc-next-3.14-1' of git://git./linux/kernel/git/sameo/nfc-next

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

"This is the first NFC pull request for 3.14

It includes:

* A new NFC driver for Marvell's 8897, and a few NCI fixes and
  improvements needed to support this chipset.

* An LLCP fix for how we were setting the default MIU on a p2p link. If
  there is no explicit MIU extension announced at connection time, we
  must use the default one and not the one announced at LLCP link
  establishement time.

* A pn544 EEPROM config update. Some of the currently EEPROM configured
  values are overwriting the firmware ones while other should not be set
  by the driver itself.

* Some NFC digital stack fixes and improvements. Asynchronous functions
  are better documented, RF technologies and CRC functions are set upon
  PSL_REQ reception, and a few minor bugs are fixed.

* Minor and miscelaneous pn533, mei_phy and port100 fixes."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiwlwifi: mvm: don't set the drain bit when we flush the AP station
Emmanuel Grumbach [Thu, 2 Jan 2014 08:01:46 +0000 (10:01 +0200)]
iwlwifi: mvm: don't set the drain bit when we flush the AP station

When we disassociate in managed mode, we flush the queues
after mac80211 has already removed the station.
During that time, the pointer to ieee80211_sta to the
fw_id_to_mac_id map is -EINVAL. In that case we should not
set the station as being drained when the last Tx of this
station has exited the shared Tx queue since we are
flushing all the queues anyway.
The draining logic is meant to be used in GO / AP mode only.
In GO / AP mode, we set -EBUSY in the fw_id_to_mac_id map.

This is why testing the ieee80211_sta pointer in the
fw_id_to_mac_id map with IS_ERR isn't enough to set the
station as draining, we need to check that it is -EBUSY.

The only impact of the bug was a print:

Drained sta 1, but it is internal?

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: rs: fix handling of column switch error
Eyal Shapira [Tue, 7 Jan 2014 16:19:35 +0000 (18:19 +0200)]
iwlwifi: mvm: rs: fix handling of column switch error

If we can't switch to a column because no rates are supported
in that column this led to a state where the search cycle
got stuck and never ended. This in turn also led to aggregation
not being turned on. Fix this by marking a column as
visited if we can't switch to it.

Reported-and-tested-by: Karl Beldan <karl.beldan@gmail.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix missing cleanup in .start() error path
Eliad Peller [Sun, 5 Jan 2014 10:41:12 +0000 (12:41 +0200)]
iwlwifi: mvm: fix missing cleanup in .start() error path

Cleanup of iwl_mvm_leds was missing in case of error,
resulting in the following warning:

WARNING: at lib/kobject.c:196 kobject_add_internal+0x1f4/0x210()
kobject_add_internal failed for phy0-led with -EEXIST, don't try to register things with the same name in the same directory.

which prevents further reloads of the driver.

Cc: stable@vger.kernel.org [3.10+]
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: update power after binding in start_ap_ibss()
Ilan Peer [Tue, 31 Dec 2013 19:19:55 +0000 (21:19 +0200)]
iwlwifi: mvm: update power after binding in start_ap_ibss()

The power settings need to be updated after a binding flow is done
and before quota calculations. This was missing in the start_ap_ibss()
flow. Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: clear ap_ibss_active in case of failure
Ilan Peer [Tue, 31 Dec 2013 19:05:50 +0000 (21:05 +0200)]
iwlwifi: mvm: clear ap_ibss_active in case of failure

The state variable was not set to false in case of a failure to
complete the start_ap_ibss() flow.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agomac80211_hwsim: restore regulatory testing functionality
Johannes Berg [Fri, 10 Jan 2014 12:37:38 +0000 (13:37 +0100)]
mac80211_hwsim: restore regulatory testing functionality

Restore the original regulatory testing functionality and also
make it more flexible by allowing the parameters to be specified
when creating a dynamic radio.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: allow creating/destroying radios on the fly
Johannes Berg [Mon, 6 Jan 2014 22:29:20 +0000 (23:29 +0100)]
mac80211_hwsim: allow creating/destroying radios on the fly

Add new commands to the hwsim generic netlink family to allow
creating and destroying radios on the fly. The number of channels
a radio supports can be specified when it's created, if it isn't
the module parameter will be used as default.

This should be extended in the future to allow other parameters
to be specified, e.g.
 * list of channels
 * interface combinations, particularly P2P_DEVICE support
 * regtest
 * and pretty much all other hardware capabilities

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: register netlink even with multi-channel
Johannes Berg [Tue, 7 Jan 2014 22:28:08 +0000 (23:28 +0100)]
mac80211_hwsim: register netlink even with multi-channel

Reject wmediumd registrations when any devices have multi-channel
capability, but register the generic netlink family unconditionally
to make it possible to add new commands that shouldn't depend on
the number of (default) channels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: verify wmediumd socket
Johannes Berg [Tue, 7 Jan 2014 22:21:34 +0000 (23:21 +0100)]
mac80211_hwsim: verify wmediumd socket

There can't be two wmediumd instances controlling hwsim,
so reject registration from a second one and verify in
the commands that it's the correct instance calling.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: shuffle code to prepare for dynamic radios
Johannes Berg [Mon, 6 Jan 2014 22:12:12 +0000 (23:12 +0100)]
mac80211_hwsim: shuffle code to prepare for dynamic radios

This will make the next patch, adding support for netlink,
smaller and more readable. The code is not modified here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: minor netlink cleanups
Johannes Berg [Mon, 6 Jan 2014 22:03:02 +0000 (23:03 +0100)]
mac80211_hwsim: minor netlink cleanups

Use u8 pointer instead of the struct mac_address and do
some other small cleanups.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: assign index from separate counter
Johannes Berg [Mon, 6 Jan 2014 21:56:30 +0000 (22:56 +0100)]
mac80211_hwsim: assign index from separate counter

To later allow dynamic registration, assign the index for the
struct device and MAC address from a new free-running counter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: minimize rctbl module parameter usage
Johannes Berg [Mon, 6 Jan 2014 21:53:42 +0000 (22:53 +0100)]
mac80211_hwsim: minimize rctbl module parameter usage

Check the flag that the module parameter sets instead, so
later radios can use different parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: refactor radio cleanup
Johannes Berg [Mon, 6 Jan 2014 21:43:11 +0000 (22:43 +0100)]
mac80211_hwsim: refactor radio cleanup

Refactor the radio cleanup into a new function to later
allow deleting a single radio from the list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: refactor radio registration
Johannes Berg [Mon, 6 Jan 2014 21:39:27 +0000 (22:39 +0100)]
mac80211_hwsim: refactor radio registration

In order to support dynamic radio registration in the future,
refactor the actual registration into a new function with only
minor cleanups. Since it had to change anyway, also clean up
the init error paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: remove regtest for now
Johannes Berg [Mon, 6 Jan 2014 21:26:23 +0000 (22:26 +0100)]
mac80211_hwsim: remove regtest for now

The regtest thing worked based on the radio loop, but with
more dynamic radio registration that loop won't really exist
as is. We can add it back later with proper dynamic code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: prepare for different channel support
Johannes Berg [Mon, 6 Jan 2014 21:11:06 +0000 (22:11 +0100)]
mac80211_hwsim: prepare for different channel support

Prepare the code to support, in theory, different devices
with a different number of channels supported. Right now
this doesn't really change anything, but will allow for
dynamic device registration in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: clean up netlink exit code
Johannes Berg [Mon, 6 Jan 2014 20:55:14 +0000 (21:55 +0100)]
mac80211_hwsim: clean up netlink exit code

There's no need to print a message, and genl_unregister_family()
can't really fail so remove the error message there as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoieee80211: add definition for SMS4 key len
Avinash Patil [Fri, 10 Jan 2014 19:08:55 +0000 (11:08 -0800)]
ieee80211: add definition for SMS4 key len

Add SMS4 key length definition to ieee80211_key_len enum.
It's used by WAPI.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath10k: add set_bitrate_mask callback
Janusz Dziedzic [Wed, 8 Jan 2014 08:08:33 +0000 (09:08 +0100)]
ath10k: add set_bitrate_mask callback

Add set_bitrate_mask callback. Currently
ath10k HW is limited to handle only single
fixed rate setting or limit number of used
spatial streams.

Example:
iw wlanX set bitrates legacy-5 ht-mcs-5 vht-mcs-5 2:9
will setup VHT, nss=2, mcs=9

iw wlanX set bitrates legacy-5 18 ht-mcs-5 vht-mcs-5
will setup legacy, 18Mbps

iw wlanX set bitrates legacy-5 ht-mcs-5 3 vht-mcs-5
will setup HT, nss=1, mcs=3

iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9
will setup nss=1

iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9 2:0-9
will setup nss=2

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add debugfs file to control firmware dbglog
Kalle Valo [Fri, 3 Jan 2014 10:59:31 +0000 (12:59 +0200)]
ath10k: add debugfs file to control firmware dbglog

Firmware dbglogs can be now enabled through fw_dbglog file. To enable all
possible log messages run:

echo 0xffffffff > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog

And to put back firmare defaults use 0x0:

echo 0x0 > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add trace event for WMI_DEBUG_MESG_EVENTID
Kalle Valo [Fri, 3 Jan 2014 10:59:26 +0000 (12:59 +0200)]
ath10k: add trace event for WMI_DEBUG_MESG_EVENTID

Send firmware WMI debug logs to user space for further processing.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: handle WMI debug print events
Kalle Valo [Fri, 3 Jan 2014 10:59:20 +0000 (12:59 +0200)]
ath10k: handle WMI debug print events

Firmware can send simple ascii strings as debug messages using
WMI_DEBUG_PRINT_EVENTID, print those with ATH10K_DBG_WMI log level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: track number of existing peers
Bartosz Markowski [Thu, 2 Jan 2014 13:38:33 +0000 (14:38 +0100)]
ath10k: track number of existing peers

To not exceed number of allowed clients (AP mode), make sure to
check how many of them are already on the peers list.

10.X firmware support up to 127 peers, non-AP centric firmwares 16.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: disable STA kickout in FW
Marek Puzyniak [Mon, 30 Dec 2013 08:07:51 +0000 (09:07 +0100)]
ath10k: disable STA kickout in FW

Currently ath10k is not using STA KICKOUT firmware functionality.
In order to avoid unwanted WMI_PEER_STA_KICKOUT_EVENT event this functionality
should be disabled when not used.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add DFS_CERTIFIED option
Janusz Dziedzic [Mon, 23 Dec 2013 06:38:27 +0000 (08:38 +0200)]
ath10k: add DFS_CERTIFIED option

Add Kconfig option that allow DFS functionality.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agomac80211: handle MMPDUs at EOSP correctly
Johannes Berg [Wed, 8 Jan 2014 23:00:38 +0000 (00:00 +0100)]
mac80211: handle MMPDUs at EOSP correctly

If a uAPSD service period ends with an MMPDU, we currently just
send that MMPDU, but it obviously won't get the EOSP bit set as
it doesn't have a QoS header. This contradicts the standard, so
add a QoS-nulldata frame after the MMPDU to properly terminate
the service period with a frame that has EOSP set.

Also fix a bug wrt. the TID for the MMPDU, it shouldn't be set
to 0 unconditionally but use the actual TID that was assigned.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: reset TX info flags when frame will be reprocessed
Johannes Berg [Thu, 9 Jan 2014 00:45:28 +0000 (01:45 +0100)]
mac80211: reset TX info flags when frame will be reprocessed

The temporary TX info flags need to be cleared if the frame will
be processed through the TX handlers again, otherwise it can get
messed up. This fixes a bug that happened when an aggregation
session was stopped while the station was sleeping - some frames
might get transmitted marked as aggregation erroneously without
this fix.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: release multiple ACs in uAPSD, fix more-data bug
Johannes Berg [Wed, 8 Jan 2014 16:45:07 +0000 (17:45 +0100)]
mac80211: release multiple ACs in uAPSD, fix more-data bug

When a response for PS-Poll or a uAPSD trigger frame is sent, the
more-data bit should be set according to 802.11-2012 11.2.1.5 h),
meaning that it should indicate more data on the relevant ACs
(delivery-enabled or nondelivery-enabled for uAPSD or PS-Poll.)

In, for example, the following scenario:
 * 1 frame on VO queue (either in driver or in mac80211)
 * at least 1 frame on VI queue (in the driver)
 * both VO/VI are delivery-enabled
 * uAPSD trigger frame received

The more-data flag to the driver would not be set, even though
it should be.

While fixing this, I noticed that we should really release frames
from multiple ACs where there's data buffered in the driver for
the corresponding TIDs.

To address all this, restructure the code a bit to consider all
ACs if we only release driver frames or only buffered frames.
This also addresses the more-data bug described above as now the
TIDs will all be marked as released, so the driver will have to
check the number of frames.

While at it, clarify some code and comments and remove the found
variable, replacing it with the appropriate sw/hw release check.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: fix PS-Poll driver release TID
Johannes Berg [Thu, 9 Jan 2014 10:05:31 +0000 (11:05 +0100)]
mac80211: fix PS-Poll driver release TID

Using ffs() for the PS-Poll release TID is wrong, it will cause
frames to be released in order 0 1 2 3 4 5 6 7 instead of the
correct 7 6 5 4 3 0 2 1. Fix this by adding a new function that
implements "highest priority TID" properly.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoieee80211: add definition for TDLS wide band extended capability
Avinash Patil [Thu, 9 Jan 2014 23:22:57 +0000 (15:22 -0800)]
ieee80211: add definition for TDLS wide band extended capability

Seventh bit of 8th byte of extended capabilities specifies wide
bandwidth support for TDLS links. Add this definition to ieee80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: add sanity check for retry limit in wext-compat
Ujjal Roy [Thu, 9 Jan 2014 15:46:14 +0000 (21:16 +0530)]
cfg80211: add sanity check for retry limit in wext-compat

Block setting the wrong values through iwconfig retry
command. Add sanity checking before sending the retry
limit to the driver.

Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath9k: Disable cross-band FCC
Sujith Manoharan [Thu, 9 Jan 2014 03:21:15 +0000 (08:51 +0530)]
ath9k: Disable cross-band FCC

Fast Channel Change across bands was enabled for
AR9462 recently, but this is causing baseband issues.
Disable it until this feature is tested well. Also,
remove the feature bit for AR9565 since it is
a single-band card and doesn't support this feature.

Cc: stable@vger.kernel.org
Reported-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use correct channel for RX packets
Sujith Manoharan [Thu, 9 Jan 2014 03:21:14 +0000 (08:51 +0530)]
ath9k: Use correct channel for RX packets

Accessing the current channel definition in mac80211
when processing RX packets is problematic because it
could have been updated when a scan is issued. Since a
channel change involves flushing the existing packets
in the RX queue before a chip-reset is done, they would
be processed using the wrong band/channel information.

To avoid this, use the current channel information
maintained in the driver.

Cc: stable@vger.kernel.org
Reported-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update WB335 PCI IDs
Sujith Manoharan [Thu, 9 Jan 2014 03:21:13 +0000 (08:51 +0530)]
ath9k: Update WB335 PCI IDs

* Add new AR9565 1.0/1.0.1/1.1 IDs
* Change Dell/Lenovo/Samsung cards to 2-Antenna with diversity.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: use a function to replace two copies of a code fragment
Bing Zhao [Wed, 8 Jan 2014 23:45:57 +0000 (15:45 -0800)]
mwifiex: use a function to replace two copies of a code fragment

Instead of having two copies of the code for device tree cfgdata
downloading, add a function to improve the code.

Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: fix potential buffer overflow in dt configuration
Bing Zhao [Wed, 8 Jan 2014 23:45:56 +0000 (15:45 -0800)]
mwifiex: fix potential buffer overflow in dt configuration

If cfgdata length exceeds the command buffer size we will end up
getting buffer overflow problem. Fix it by checking the buffer
size less the command header length.

Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: prefetch head of packet
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:49 +0000 (11:50 +0200)]
wil6210: prefetch head of packet

As soon as skb is ready to be reaped, prefetch 1-st cache line.
This accelerates data access that is performed later, during the
packet classification by the driver and IP stack.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: Fix IP version indication for Tx csum offload
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:48 +0000 (11:50 +0200)]
wil6210: Fix IP version indication for Tx csum offload

Bit DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS should be set for IPv4
only. Don't set it for IPv6

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: interrupt moderation
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:47 +0000 (11:50 +0200)]
wil6210: interrupt moderation

Use hardware capabilities to limit IRQ generation to about 15 per msec
It corresponds to about 7 packets/IRQ when running iperf with default
parameters at 1.3Gbps

Do not enable this feature in the sniffer (monitor)  mode, because
interrupt moderation cause timestamp accuracy deterioration.
For the sniffer flow, it is important to get precise timestamp.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add support for bcm43362 device
Arend van Spriel [Wed, 8 Jan 2014 09:49:33 +0000 (10:49 +0100)]
brcmfmac: add support for bcm43362 device

This patch adds support for the bcm43362 1x1 11n chipset. This
chipset is used in AP6210 wifi module found on Cubieboard [1].

[1] http://cubieboard.org/

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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>
10 years agowl1251: fix NULL pointer dereference
Pavel Machek [Tue, 7 Jan 2014 12:13:28 +0000 (13:13 +0100)]
wl1251: fix NULL pointer dereference

wl1251: fix NULL pointer dereference

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: add nvs file name to module firmware list
Pavel Machek [Tue, 7 Jan 2014 12:12:20 +0000 (13:12 +0100)]
wl1251: add nvs file name to module firmware list

Add nvs file name to module firmware list

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: enforce changed hw encryption support on monitor state change
David Gnedt [Tue, 7 Jan 2014 12:11:27 +0000 (13:11 +0100)]
wl1251: enforce changed hw encryption support on monitor state change

The firmware doesn't support per packet encryption selection, so disable hw
encryption support completely while a monitor interface is present to support
injection of packets (which shouldn't get encrypted by hw).
To enforce the changed hw encryption support force a disassociation on
non-monitor interfaces.
For disassociation a workaround using hw connection monitor is employed,
which temporary enables hw connection manager flag.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: disable retry and ACK policy for injected packets
David Gnedt [Tue, 7 Jan 2014 12:10:51 +0000 (13:10 +0100)]
wl1251: disable retry and ACK policy for injected packets

Set the retry limit to 0 and disable the ACK policy for injected packets.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: enable tx path in monitor mode if necessary for packet injection
David Gnedt [Tue, 7 Jan 2014 12:10:14 +0000 (13:10 +0100)]
wl1251: enable tx path in monitor mode if necessary for packet injection

If necessary enable the tx path in monitor mode for packet injection using
the JOIN command with BSS_TYPE_STA_BSS and zero BSSID.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: fix channel switching in monitor mode
David Gnedt [Tue, 7 Jan 2014 12:09:42 +0000 (13:09 +0100)]
wl1251: fix channel switching in monitor mode

Use the ENABLE_RX command for channel switching when no interface is present
(monitor mode only).
The advantage of ENABLE_RX is that it leaves the tx data path disabled in
firmware, whereas the usual JOIN command seems to transmit some frames at
firmware level.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: disable power saving in monitor mode
David Gnedt [Tue, 7 Jan 2014 12:09:06 +0000 (13:09 +0100)]
wl1251: disable power saving in monitor mode

Force power saving off while monitor interface is present.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: implement multicast address filtering (fwd)
David Gnedt [Tue, 7 Jan 2014 12:08:30 +0000 (13:08 +0100)]
wl1251: implement multicast address filtering (fwd)

Port multicast address filtering from wl1271 driver.
It sets up the hardware multicast address filter in configure_filter() with
addresses supplied through prepare_multicast().

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: configure hardware en-/decryption for monitor mode
David Gnedt [Tue, 7 Jan 2014 12:07:52 +0000 (13:07 +0100)]
wl1251: configure hardware en-/decryption for monitor mode

Disable hardware encryption (DF_ENCRYPTION_DISABLE) and decryption
(DF_SNIFF_MODE_ENABLE) via wl1251_acx_feature_cfg while monitor interface is
present.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: split RX and TX data path initialisation
David Gnedt [Tue, 7 Jan 2014 12:06:58 +0000 (13:06 +0100)]
wl1251: split RX and TX data path initialisation

Split up data path initialisation into RX and TX data path initialisation
functions. This change is required for channel switching in monitor mode.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: implement hardware ARP filtering
David Gnedt [Tue, 7 Jan 2014 12:06:24 +0000 (13:06 +0100)]
wl1251: implement hardware ARP filtering

Update hardware ARP filter configuration on BSS_CHANGED_ARP_FILTER
notification from mac80211.
Ported from wl1271 driver.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: retry power save entry
David Gnedt [Tue, 7 Jan 2014 12:05:45 +0000 (13:05 +0100)]
wl1251: retry power save entry

Port of the power save entry retry code from wl1251 driver version included
in the Maemo Fremantle kernel.
This tries to enable power save mode up to 3 times before failing.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: fix scan behaviour while not associated
David Gnedt [Tue, 7 Jan 2014 12:04:53 +0000 (13:04 +0100)]
wl1251: fix scan behaviour while not associated

With a dissasociated card I often encoutered very long scan delays.

My guess is that it has something to do with the cards DTIM handling and
another firmware bug mentioned in the TI WLAN driver, which is described as
the card may never end scanning if the channel is overloaded because it
can't send probe requests. I think the firmware somehow also tries to
receive DTIM messages when the BSSID is not set. Therefore most of the time
it waits for DTIM messages and can't do scanning work.

Anyway we can workaround this misbehaviour by setting the HIGH_PRIORITY
bit for scans in disassociated state.

Signed-off-by: David Gnedt <david.gnedt@davizone.at>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agocfg80211: Add a function to get the number of supported channels
Ilan Peer [Thu, 9 Jan 2014 09:37:23 +0000 (11:37 +0200)]
cfg80211: Add a function to get the number of supported channels

Add a utility function to get the number of channels supported by
the device, and update the places in the code that need this data.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
[replace another occurrence in libertas, fix kernel-doc, fix bugs]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoNFC: nfcmrvl: Fix possible memory leak issue
Amitkumar Karwar [Wed, 8 Jan 2014 18:52:27 +0000 (10:52 -0800)]
NFC: nfcmrvl: Fix possible memory leak issue

This patch fixes memory leaks in the error paths of
nfcmrvl_nci_register_dev() routine.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Wed, 8 Jan 2014 18:44:29 +0000 (13:44 -0500)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth-next

10 years agomac80211: remove channel_change_time
Johannes Berg [Mon, 6 Jan 2014 21:24:00 +0000 (22:24 +0100)]
mac80211: remove channel_change_time

This value is no longer used by mac80211, and practically no
driver ever set it to a correct value anyway, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoNFC: digital: Set rf tech and crc functions when receiving a PSL_REQ
Thierry Escande [Mon, 6 Jan 2014 22:34:48 +0000 (23:34 +0100)]
NFC: digital: Set rf tech and crc functions when receiving a PSL_REQ

This patch sets the correct rf tech value and crc functions in target
mode when receiving a PSL_REQ, as done when receiving an ATR_REQ.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: digital: Set current target active on activate_target() call
Thierry Escande [Mon, 6 Jan 2014 22:34:37 +0000 (23:34 +0100)]
NFC: digital: Set current target active on activate_target() call

The curr_protocol field of nfc_digital_dev structure used to determine
if a target is currently active was set too soon, immediately when a
target is found. This is not good since there is no other way than
deactivate_target() to reset curr_protocol and if activate_target() is
not called, the target remains active and it's not possible to put the
device in poll mode anymore.

With this patch curr_protocol is set when nfc core activates a target,
puts a device up, or when an ATR_REQ is received in target mode.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agomac80211: allow to set smps mode to OFF in AP mode
Emmanuel Grumbach [Tue, 7 Jan 2014 11:11:41 +0000 (13:11 +0200)]
mac80211: allow to set smps mode to OFF in AP mode

In managed mode, we should not ask for OFF mode because the
power settings may still require DYNAMIC. In AP mode, this
should be allowed since the default settings is OFF and
AUTOMATIC is not allowed.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: clean up prepare_for_handlers() return value
Johannes Berg [Tue, 7 Jan 2014 15:23:24 +0000 (16:23 +0100)]
mac80211: clean up prepare_for_handlers() return value

Using an int with 0/1 is not very common, make the function
return a bool instead with the same values (false/true).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: simplify code in ieee80211_prepare_and_rx_handle
Emmanuel Grumbach [Tue, 7 Jan 2014 11:10:20 +0000 (13:10 +0200)]
mac80211: simplify code in ieee80211_prepare_and_rx_handle

No need to assign the return value of prepare_for_handlers
to a variable if the only usage is to test it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: clean up garbage in comment
Emmanuel Grumbach [Tue, 7 Jan 2014 11:09:38 +0000 (13:09 +0200)]
mac80211: clean up garbage in comment

Not clear how this landed here.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoBluetooth: Fix 6loWPAN peer lookup
Claudio Takahasi [Tue, 7 Jan 2014 12:07:48 +0000 (09:07 -0300)]
Bluetooth: Fix 6loWPAN peer lookup

This patch fixes peer address lookup for 6loWPAN over Bluetooth Low
Energy links.

ADDR_LE_DEV_PUBLIC, and ADDR_LE_DEV_RANDOM are the values allowed for
"dst_type" field in the hci_conn struct for LE links.

Signed-off-by: Claudio Takahasi <claudio.takahasi@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Fix setting Universal/Local bit
Claudio Takahasi [Tue, 7 Jan 2014 12:07:47 +0000 (09:07 -0300)]
Bluetooth: Fix setting Universal/Local bit

This patch fixes the Bluetooth Low Energy Address type checking when
setting Universal/Local bit for the 6loWPAN network device or for the
peer device connection.

ADDR_LE_DEV_PUBLIC or ADDR_LE_DEV_RANDOM are the values allowed for
"src_type" and "dst_type" in the hci_conn struct. The Bluetooth link
type can be obtainned reading the "type" field in the same struct.

Signed-off-by: Claudio Takahasi <claudio.takahasi@openbossa.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>