platform/kernel/linux-exynos.git
8 years agoMerge tag 'iwlwifi-next-for-kalle-2015-08-18' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Tue, 18 Aug 2015 14:20:11 +0000 (17:20 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2015-08-18' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* polish the Miracast operation
* fix a few power consumption issues
* scan cleanup
* fixes for D0i3 system state
* add paging for devices that support it
* add again the new RBD allocation model
* add more options to the firmware debug system
* add support for frag SKBs in Tx

8 years agoiwlwifi: mvm: fix a race in D0i3 vs. Tx path
Emmanuel Grumbach [Mon, 17 Aug 2015 12:54:41 +0000 (15:54 +0300)]
iwlwifi: mvm: fix a race in D0i3 vs. Tx path

When we enter D0i3, we must stop TXing otherwise the
sequence number we use might conflict with the firmware's
internal TX. In order to do so, we have
IWL_MVM_STATUS_IN_D0I3 which should prevent any Tx while we
enter D0i3. There is a bug in this code since we may Tx even
if IWL_MVM_STATUS_IN_D0I3 is set. This can happen as long as
mvm->d0i3_ap_sta_id is not set.

To make sure that we don't have any packet in the Tx path
while we set mvm->d0i3_ap_sta_id, call synchronize_net only
after we already set mvm->d0i3_ap_sta_id.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't disconnect on beacon loss in D0I3
David Spinadel [Thu, 6 Aug 2015 07:26:50 +0000 (10:26 +0300)]
iwlwifi: mvm: don't disconnect on beacon loss in D0I3

Currently if we wake up during D0I3 due to beacon loss we disconnect
immediately. This behaviour causes redundant disconnection, which could
be prevented by polling as it is usually done in mac80211.
Instead, we prefer reporting beacon loss and let mac80211 try polling
before disconnection.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: out-of-bounds access in iwl_init_sband_channels
Adrien Schildknecht [Fri, 14 Aug 2015 00:35:32 +0000 (02:35 +0200)]
iwlwifi: out-of-bounds access in iwl_init_sband_channels

KASan error report:
==================================================================
BUG: KASan: out of bounds access in iwl_init_sband_channels+0x207/0x260 [iwlwifi] at addr ffff8800c2d0aac8
Read of size 4 by task modprobe/329
==================================================================

Both loops of this function compare data from the 'chan' array and then
check if the index is valid.

The 2 conditions should be inverted to avoid an out-of-bounds access.

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: bump mvm firmware API to 16
Emmanuel Grumbach [Sun, 16 Aug 2015 07:39:49 +0000 (10:39 +0300)]
iwlwifi: bump mvm firmware API to 16

The driver is now able to handle -16.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: rs: disable MIMO only if allowed in configuration
Alexander Bondar [Tue, 28 Jul 2015 13:50:51 +0000 (16:50 +0300)]
iwlwifi: rs: disable MIMO only if allowed in configuration

Fix bug where MIMO is disabled for low latency TX on P2P VIF
regardless of configuration. Make it dependent on
IWL_MVM_RS_DISABLE_P2P_MIMO compilation option. Change configuration
so that MIMO will be disabled only in SDIO platforms.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agobcma: switch GPIO portions to use GPIOLIB_IRQCHIP
Linus Walleij [Thu, 13 Aug 2015 22:21:45 +0000 (00:21 +0200)]
bcma: switch GPIO portions to use GPIOLIB_IRQCHIP

This switches the BCMA GPIO driver to use GPIOLIB_IRQCHIP to
handle its interrupts instead of rolling its own copy of the
irqdomain handling etc.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: add correct MAC/BB name for ar9561
Miaoqing Pan [Wed, 12 Aug 2015 06:20:46 +0000 (14:20 +0800)]
ath9k: add correct MAC/BB name for ar9561

MAC/BB name is"????" if the MAC/BB is unknown.

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowl18xx: add diversity statistics
Guy Mishol [Tue, 11 Aug 2015 07:02:57 +0000 (10:02 +0300)]
wl18xx: add diversity statistics

Add diversity statistics and sync the driver
statistics acx and debugfs representation
with the current fw api.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowl18xx: update statistics acx and debugfs files
Eliad Peller [Tue, 11 Aug 2015 07:02:56 +0000 (10:02 +0300)]
wl18xx: update statistics acx and debugfs files

Sync the driver statistics acx and debugfs representation
with the current fw api.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agort2x00: adjust EEPROM_SIZE for rt2500usb
Adrien Schildknecht [Mon, 10 Aug 2015 22:25:53 +0000 (00:25 +0200)]
rt2x00: adjust EEPROM_SIZE for rt2500usb

rt2500usb_validate_eeprom() read data up to 0x6e (EEPROM_CALIBRATE_OFFSET)
but only 0x6a bytes has been allocated and read from the eeprom.

This lead to out-of-bound accesses and invalid values for
EEPROM_BBPTUNE_R17 and EEPROM_CALIBRATE_OFFSET.

Change the EEPROM_SIZE to 0x6e in order to retrieve all the fields.

Tested with a rt2570 device.

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwl8k: refactor some conditionals for clarity
John Linville [Mon, 10 Aug 2015 16:05:39 +0000 (12:05 -0400)]
mwl8k: refactor some conditionals for clarity

CC [M]  drivers/net/wireless/mwl8k.o
drivers/net/wireless/mwl8k.c: In function ‘mwl8k_bss_info_changed’:
drivers/net/wireless/mwl8k.c:3290:2: warning: ‘ap_mcs_rates’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  memcpy(cmd->mcs_set, mcs_rates, 16);
  ^
drivers/net/wireless/mwl8k.c:4987:5: note: ‘ap_mcs_rates’ was declared here
  u8 ap_mcs_rates[16];
     ^

The warning was bogus.  But the conditionals were rather complicated,
with multiple redundant checks.  This consolidates the checking and
makes it more readable IMHO.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192cu: Remove and replace routine in hw.c and mac.c
Taehee Yoo [Mon, 6 Apr 2015 18:13:00 +0000 (03:13 +0900)]
rtlwifi: rtl8192cu: Remove and replace routine in hw.c and mac.c

I remove duplicated routines which related rtl92cu_set_hw_reg().

1. rtl92c_set_qos() and HW_VAR_AC_PARAM routine are similar code.
so i replace code with rtlpriv->cfg->ops->set_hw_reg().

2. rtl92c_set_mac_addr() and 'HW_VAR_ETHER_ADDR' case at
rtl92cu_set_hw_reg() routine are similar code.
so i removed rtl92c_set_mac_addr() function.
also it was not used anywhere.

3. remove HW_VAR_ACM_CTRL routine in rtl92cu_set_hw_reg().
if rtl_usb->acm_method is not EACMWAY2_SW, HW_VAR_ACM_CTRL is called
from HW_VAR_AC_PARAM. but it never called. because acm_method is always
EACMWAY2_SW. so i remove acm_method check routine
and HW_VAR_ACM_CTRL routine.

both usb and pci interface is not used HW_VAR_ACM_CTRL.
but i can't test pci interface module, so i didn't modify pci code.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192cu: remove duplicated routine in hw.c and mac.c
Taehee Yoo [Mon, 30 Mar 2015 15:55:32 +0000 (00:55 +0900)]
rtlwifi: rtl8192cu: remove duplicated routine in hw.c and mac.c

rtl92c_set_xxx_filter is same routine with rtl92cu_set_hw_reg.
so i remove those functions that are rtl92c_set_xxx_filter.
(rtl92c_get_xxx_filter is also same reason.)
also i add code updating struct rtl_mac member variable in the
rtl92cu_set_hw_reg.
after that, no more _update_mac_setting is not useful. thus i remove that.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoMerge tag 'mac80211-next-for-davem-2015-08-14' mac80211-next.git
Kalle Valo [Tue, 18 Aug 2015 05:44:22 +0000 (08:44 +0300)]
Merge tag 'mac80211-next-for-davem-2015-08-14' mac80211-next.git

iwlwifi needs new mac80211 patches so merge mac80211-next.git to
wireless-drivers-next.git.

8 years agoMerge ath-next from ath.git. Major changes in ath10k:
Kalle Valo [Mon, 17 Aug 2015 08:23:03 +0000 (11:23 +0300)]
Merge ath-next from ath.git. Major changes in ath10k:

* add support for qca99x0 family of devices
* improve performance of tx_lock
* add support for raw mode (802.11 frame format) and software crypto
  engine enabled via a module parameter

wil6210:

* implement TSO support
* support bootloader v1 and onwards

8 years agoiwlwifi: mvm: Enable power management on low-latency bss
Avri Altman [Wed, 5 Aug 2015 20:07:42 +0000 (23:07 +0300)]
iwlwifi: mvm: Enable power management on low-latency bss

Currently the driver disable power management on all low-latency
interfaces, while it should disable it on WiDi interfaces only.
Non-P2P interfaces that runs voice and video traffic should enable
power management.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: support TDLS wider-bandwidth
Arik Nemtsov [Thu, 30 Apr 2015 15:31:45 +0000 (18:31 +0300)]
iwlwifi: mvm: support TDLS wider-bandwidth

When TDLS support is declared by the FW, set the bit indicating wider-BW
support as well.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: fix a range check in debugfs code
Dan Carpenter [Mon, 10 Aug 2015 21:45:03 +0000 (00:45 +0300)]
iwlwifi: mvm: fix a range check in debugfs code

The &mvm->tof_data.range_req.ap[] array has IWL_MVM_TOF_MAX_APS elements
so the check should be >= instead of >.  Also the test can underflow so
I have changed "i" to unsigned.

Fixes: ce7929186a39 ('wlwifi: mvm: add basic Time of Flight (802.11mc FTM) support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: convert hex_dump_to_buffer() to %*ph
Andy Shevchenko [Thu, 16 Jul 2015 12:42:14 +0000 (15:42 +0300)]
iwlwifi: convert hex_dump_to_buffer() to %*ph

There is no need to use hex_dump_to_buffer() in the cases like this:

hexdump_to_buffer(buf, len, 16, 1, outbuf, outlen, false); /* len <= 16 */
sprintf("%s\n", outbuf);

since it maybe easily converted to simple:

sprintf("%*ph\n", len, buf);

Note: it seems in one case the output is groupped by 2 bytes and looks like a
typo. Thus, patch changes that to plain byte stream.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pass NAPI struct from transport layer
Johannes Berg [Thu, 11 Jun 2015 14:51:24 +0000 (16:51 +0200)]
iwlwifi: pass NAPI struct from transport layer

The mac80211 patch to pass the NAPI struct only changed iwlwifi to
store the NAPI struct, but we can do better: pass it directly from
the lower transport layer to the opmode during RX, and then on to
mac80211 from there.

When we add multiple RX queues, we can then pass the appropriate
NAPI struct properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'mac80211-next-for-davem-2015-08-14' into next
Emmanuel Grumbach [Sun, 16 Aug 2015 07:20:58 +0000 (10:20 +0300)]
Merge tag 'mac80211-next-for-davem-2015-08-14' into next

Another pull request for the next cycle, this time with quite
a bit of content:
 * mesh fixes/improvements from Alexis, Bob, Chun-Yeow and Jesse
 * TDLS higher bandwidth support (Arik)
 * OCB fixes from Bertold Van den Bergh
 * suspend/resume fixes from Eliad
 * dynamic SMPS support for minstrel-HT (Krishna Chaitanya)
 * VHT bitrate mask support (Lorenzo Bianconi)
 * better regulatory support for 5/10 MHz channels (Matthias May)
 * basic support for MU-MIMO to avoid the multi-vif issue (Sara Sharon)
along with a number of other cleanups.

8 years agoiwlwifi: mvm: add debug info to schedule scan complete message.
Ayala Beker [Wed, 22 Jul 2015 10:54:31 +0000 (13:54 +0300)]
iwlwifi: mvm: add debug info to schedule scan complete message.

Add more information to schedule scan complete message.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove partial and full scan lists from lmac sched scan
David Spinadel [Sun, 21 Jun 2015 08:57:36 +0000 (11:57 +0300)]
iwlwifi: mvm: remove partial and full scan lists from lmac sched scan

Lmac sched scan supports partial scans, so we can set some channels to be
scanned on every scan iteration and others to be scanned only on some
iterations. Currently we set all channels to be scanned every iteration,
but still have some configuration of which iterations should be partial
and which should be full.

Remove all partial/full scan configuration to reduce confusions.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: simplify calculating scan dwells and other timing values
David Spinadel [Mon, 22 Jun 2015 10:20:00 +0000 (13:20 +0300)]
iwlwifi: mvm: simplify calculating scan dwells and other timing values

Remove timing values from iwl_mvm_scan_params and use defines and
arrays of values instead.

While at that fix few values and corner cases and align all OSs
to ChromeOS values.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: make sure d3_suspend/resume ops exist
Eliad Peller [Thu, 30 Jul 2015 13:53:27 +0000 (16:53 +0300)]
iwlwifi: make sure d3_suspend/resume ops exist

We added calls to d3_suspend/resume trans ops during the
suspend/resume flow.

However, the wrapper code didn't verify the trans ops were
actually defined, resulting in panic when they were not
(such as in the case of sdio trans)

Fixes: 6dfb36c89dc2 ("iwlwifi: call d3_suspend/resume in d0i3 case as well")

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agomac80211: fix BIT position for TDLS WIDE extended cap
Emmanuel Grumbach [Sun, 19 Jul 2015 13:09:12 +0000 (16:09 +0300)]
mac80211: fix BIT position for TDLS WIDE extended cap

The bit was not according to ieee80211 specification.
Fix that.

Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: use DECLARE_EWMA
Johannes Berg [Mon, 13 Jul 2015 10:26:46 +0000 (12:26 +0200)]
mac80211: use DECLARE_EWMA

Instead of using the out-of-line average calculation, use the new
DECLARE_EWMA() macro to declare a signal EWMA, and use that.

This actually *reduces* the code size slightly (on x86-64) while
also reducing the station info size by 80 bytes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoaverage: provide macro to create static EWMA
Johannes Berg [Mon, 13 Jul 2015 10:17:25 +0000 (12:17 +0200)]
average: provide macro to create static EWMA

Having the EWMA parameters stored in the runtime struct imposes
memory requirements for the constant values that could just be
inlined in the code. This particularly makes sense if there are
a lot of such structs, for example in mac80211 in the station
table where each station has a number of these in an array, and
there can be many stations.

Provide a macro DECLARE_EWMA() that declares the necessary struct
and inline functions to access it with the parameters hard-coded;
using this also means the user no longer needs to 'select AVERAGE'
as it's entirely self-contained.

In the mac80211 case, on x86-64, this actually slightly *reduces*
code size, while also saving 80 bytes of runtime memory per sta.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: unregister genetlink family properly
Su Kang Yin [Fri, 7 Aug 2015 08:54:10 +0000 (16:54 +0800)]
mac80211_hwsim: unregister genetlink family properly

During hwsim_init_netlink(), we should call genl_unregister_family()
if failed on netlink_register_notifier() since the genetlink is
already registered.

Signed-off-by: Su Kang Yin <cantona@cantona.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: add rate mask logic for vht rates
Lorenzo Bianconi [Thu, 6 Aug 2015 21:47:33 +0000 (23:47 +0200)]
mac80211: add rate mask logic for vht rates

Define rc_rateidx_vht_mcs_mask array and rate_idx_match_vht_mcs_mask()
method in order to apply mcs mask for vht rates

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: define rate_control_apply_mask_ratetbl()
Lorenzo Bianconi [Thu, 6 Aug 2015 21:47:32 +0000 (23:47 +0200)]
mac80211: define rate_control_apply_mask_ratetbl()

Define rate_control_apply_mask_ratetbl() in order to apply ratemask in
rate_control_set_rates() for station rate table

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove ieee80211_tx_rate dependency in rate mask code
Lorenzo Bianconi [Thu, 6 Aug 2015 21:47:31 +0000 (23:47 +0200)]
mac80211: remove ieee80211_tx_rate dependency in rate mask code

Remove ieee80211_tx_rate dependency in rate_idx_match_legacy_mask(),
rate_idx_match_mcs_mask() and rate_idx_match_mask() in order to use the
previous logic to define a ratemask in rate_control_set_rates() for
station rate table. Moreover move rate mask definition logic in
rate_control_cap_mask()

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove ieee80211_tx_info from rate_control_apply_mask signature
Lorenzo Bianconi [Thu, 6 Aug 2015 21:47:30 +0000 (23:47 +0200)]
mac80211: remove ieee80211_tx_info from rate_control_apply_mask signature

Remove unnecessary ieee80211_tx_info pointer from rate_control_apply_mask
signature. rate_control_apply_mask() will be used to define a ratemask in
rate_control_set_rates() for station rate table

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Make OCB mode set BSSID
Bertold Van den Bergh [Wed, 5 Aug 2015 14:02:50 +0000 (16:02 +0200)]
mac80211: Make OCB mode set BSSID

Perform the BSS_CHANGED_BSSID action when joining an OCB network.
This is required to set the broadcast BSSID in some network drivers.

Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Only accept data frames in OCB mode
Bertold Van den Bergh [Wed, 5 Aug 2015 14:02:42 +0000 (16:02 +0200)]
mac80211: Only accept data frames in OCB mode

Currently OCB mode accepts frames with bssid==broadcast and type!=beacon.
Some non-data frames are sent matching this, for example probe responses.
This results in unnecessary creation of STA entries.

Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Set txrc.bss to true for OCB interfaces
Bertold Van den Bergh [Wed, 5 Aug 2015 14:02:28 +0000 (16:02 +0200)]
mac80211: Set txrc.bss to true for OCB interfaces

To make mac80211 accept the multicast rate requested by the user the
rate control should be told that it is operating in BSS mode.
Without this, the default rate is selected in rate_control_send_low
(!pubsta and !txrc->bss)

Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonl80211: Allow setting multicast rate on OCB interfaces
Bertold Van den Bergh [Wed, 5 Aug 2015 14:02:21 +0000 (16:02 +0200)]
nl80211: Allow setting multicast rate on OCB interfaces

Allow setting multicast rate on OCB interfaces.
Current behaviour results in EOPNOTSUPP when attempting this.

Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: propagate set_wiphy failure to userspace
Michal Kazior [Mon, 3 Aug 2015 08:55:24 +0000 (10:55 +0200)]
cfg80211: propagate set_wiphy failure to userspace

If driver failed to setup wiphy params (e.g. rts
threshold, fragmentation treshold) userspace
wasn't properly notified about this. This could
lead to user confusion who would think the command
succeeded even if that wasn't the case.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: regulatory: handle 5 and 10 MHz channels properly
Matthias May [Fri, 17 Jul 2015 13:28:39 +0000 (15:28 +0200)]
cfg80211: regulatory: handle 5 and 10 MHz channels properly

The original assumption of 20MHz wide channels hasn't been true since
the addition of support for 5 and 10 MHz channels.
Change the code to no longer disable all channels that don't fit into
the 20MHz grid, but instead set the appropriate flags to disable
operation on specific bandwidths.

Signed-off-by: Matthias May <matthias.may@neratec.com>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoorinoco: Do not call wiphy_unregister() from free_orinocodev()
Jes Sorensen [Thu, 6 Aug 2015 16:46:31 +0000 (12:46 -0400)]
orinoco: Do not call wiphy_unregister() from free_orinocodev()

alloc_orinocodev() would allocate the wiphy entry, but it would only get
registered much later in orinoco_init(). If something failed in the init
process inbetween the call to alloc_orinocodev() and the completion
of orinoco_init(), the drivers would end up calling wiphy_unregister()
with a NULL pointer causing beautiful OOPS fireworks.

Explicitly call wiphy_unregister() instead in the right places.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: claim sdio bus while downloading the firmware
Aniket Nagarnaik [Thu, 6 Aug 2015 07:39:16 +0000 (00:39 -0700)]
mwifiex: claim sdio bus while downloading the firmware

Our 8887 A2 chip can have separate firmware images for
bluetooth and WLAN. We observed an issue during parallel
downloading of these images by btmrvl and mwifiex drivers.

This patch claims sdio bus before starting of the firmware
download in mwifiex and releases it after completion to
fix the problem.

Signed-off-by: Aniket Nagarnaik <aniketn@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix unable to connect hidden SSID AP on DFS channel
chunfan chen [Wed, 5 Aug 2015 13:09:42 +0000 (06:09 -0700)]
mwifiex: fix unable to connect hidden SSID AP on DFS channel

We will check if any hidden SSID found in passive scan channels
and do specific SSID active scan for those channels.

Signed-off-by: chunfan chen <jeffc@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add firmware dump support for SD8997
Zhaoyang Liu [Wed, 5 Aug 2015 13:09:41 +0000 (06:09 -0700)]
mwifiex: add firmware dump support for SD8997

This patch adds firmware dump feature for SD8997 chipset.
The difference here is only one memory type is needed
to save all firmware information. Device dump information
will be uploaded to usersapace file.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add support for 8997 chipset
Zhaoyang Liu [Wed, 5 Aug 2015 13:09:40 +0000 (06:09 -0700)]
mwifiex: add support for 8997 chipset

This patch adds support for 8997 chipset to mwifiex
with SDIO/PCIe/USB interface.

The corresponding firmware image files are located in:
"mrvl/sd8997_uapsta.bin"
"mrvl/pcie8997_uapsta.bin"
"mrvl/usb8997_uapsta.bin"

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: usb: return an error if kmalloc fails
Dan Carpenter [Tue, 4 Aug 2015 07:49:27 +0000 (10:49 +0300)]
mwifiex: usb: return an error if kmalloc fails

The current code returns success if kmalloc fails.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192c-common: Fix two typos
Larry Finger [Mon, 3 Aug 2015 21:15:53 +0000 (16:15 -0500)]
rtlwifi: rtl8192c-common: Fix two typos

In this driver, two variables are masked by one quantity, and then tested
against a second number with more bits that the mask. Accordingly, the
test always fails. To minimize the possibility of such typos, a symbolic
definition of the mask is created and used.

The separate load and mask operations are also combined into a single
statement.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: David Binderman <dcb314@hotmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192ee: Fix firmware header endian issues
Larry Finger [Mon, 3 Aug 2015 20:56:16 +0000 (15:56 -0500)]
rtlwifi: rtl8192ee: Fix firmware header endian issues

This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl888ee: Fix firmware header endian issues
Larry Finger [Mon, 3 Aug 2015 20:56:15 +0000 (15:56 -0500)]
rtlwifi: rtl888ee: Fix firmware header endian issues

This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192de: Fix firmware header endian issues
Larry Finger [Mon, 3 Aug 2015 20:56:14 +0000 (15:56 -0500)]
rtlwifi: rtl8192de: Fix firmware header endian issues

This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8821ae: Fix firmware endian issues
Larry Finger [Mon, 3 Aug 2015 20:56:13 +0000 (15:56 -0500)]
rtlwifi: rtl8821ae: Fix firmware endian issues

This driver is converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8723ae: rtl8723be: rtl8723com: Fix firmware header endian issues
Larry Finger [Mon, 3 Aug 2015 20:56:12 +0000 (15:56 -0500)]
rtlwifi: rtl8723ae: rtl8723be: rtl8723com: Fix firmware header endian issues

The drivers are converted to use the common firmware header struct.
Because the old header definition failed to indicate that the multi-byte
entries should be little endian, several problems were thus exposed.
These are fixed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192ce: rtl8192cu: Fix endian issue
Larry Finger [Mon, 3 Aug 2015 20:56:11 +0000 (15:56 -0500)]
rtlwifi: rtl8192ce: rtl8192cu: Fix endian issue

Commit e996db69833a (rtlwifi: rtl8192c: Add init codes for "fw_version"
and "fw_subversion") added initialization for fw_version, but failed to
note that the variable in the firmware header is little-endian. The
following Sparse warning results:

  CHECK   drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36: warning: incorrect type in assignment (different base types)
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36:    expected unsigned short [unsigned] [usertype] fw_version
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c:242:36:    got restricted __le16 [usertype] version

When fixing this problem, I noticed that several of the drivers contain
nearly identical copies of the firmware header struct, and that only the one
used in rtl8192c{e,u} had correct endian notation. The struct has been
moved into a common header, and the other drivers will be fixed in
subsequant patches.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: dhd_sdio.c: use existing atomic_or primitive
Vineet Gupta [Thu, 9 Jul 2015 08:13:18 +0000 (13:43 +0530)]
brcmfmac: dhd_sdio.c: use existing atomic_or primitive

There's already a generic implementation so use that instead.

Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: match wait_for_completion_timeout return type
Nicholas Mc Guire [Thu, 14 May 2015 16:56:16 +0000 (18:56 +0200)]
ath9k: match wait_for_completion_timeout return type

Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/link.c:197
        int return assigned to unsigned long

Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,

Patch is against 4.1-rc3 (localversion-next is -next-20150514)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: wmi: match wait_for_completion_timeout return type
Nicholas Mc Guire [Thu, 14 May 2015 16:43:41 +0000 (18:43 +0200)]
ath9k_htc: wmi: match wait_for_completion_timeout return type

Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/wmi.c:331
int return assigned to unsigned long

Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m

Patch is against 4.1-rc3 (localversion-next is -next-20150514)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: drv_init: match wait_for_completion_timeout return type
Nicholas Mc Guire [Thu, 14 May 2015 16:25:26 +0000 (18:25 +0200)]
ath9k_htc: drv_init: match wait_for_completion_timeout return type

Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/htc_drv_init.c:81
int return assigned to unsigned long

Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m

Patch is against 4.1-rc3 (localversion-next is -next-20150514)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: match wait_for_completion_timeout return type
Nicholas Mc Guire [Thu, 14 May 2015 15:29:54 +0000 (17:29 +0200)]
ath9k_htc: match wait_for_completion_timeout return type

Return type of wait_for_completion_timeout is unsigned long not int.
As time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/ath9k/htc_hst.c:171
int return assigned to unsigned long
./drivers/net/wireless/ath/ath9k/htc_hst.c:277
int return assigned to unsigned long
./drivers/net/wireless/ath/ath9k/htc_hst.c:206
int return assigned to unsigned long

Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_ATH9K_HTC=m

Patch is against 4.1-rc3 (localversion-next is -next-20150514)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: misspelled code and comments corrected.
Cheolhyun Park [Sun, 12 Apr 2015 16:59:48 +0000 (16:59 +0000)]
rtlwifi: misspelled code and comments corrected.

Signed-off-by: Cheolhyun Park <pch851130@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath10k: fix peer limit enforcement
Michal Kazior [Wed, 5 Aug 2015 10:15:24 +0000 (12:15 +0200)]
ath10k: fix peer limit enforcement

Firmware peer entries are involved in internal
firmware vdev structures. This was not accounted
for and could lead firmware to crash due to asking
it to do more than it could.

Fixes: 039a0051ec1a ("ath10k: allocate fw resources for iface combinations")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: don't remove peer that doesn't exist
Michal Kazior [Wed, 5 Aug 2015 10:15:23 +0000 (12:15 +0200)]
ath10k: don't remove peer that doesn't exist

If peer creation failed during offchannel Tx the
driver attempted to delete the peer nonetheless.
This caused the ar->num_peers counter to be
incorrectly decremented. This subsequently could
cause the counter to drop below 0 and also
eventually lead to firmware crash because host
would think there are less peer entries created in
firmware then there really were.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix hw reconfig on wow failure
Michal Kazior [Wed, 5 Aug 2015 10:08:38 +0000 (12:08 +0200)]
ath10k: fix hw reconfig on wow failure

When WoWLAN resume fails with retval 1 mac80211
will attempt to reconfig the device in a similar
manner when hw restart is requested. This wasn't
handled properly and yielded call trace warnings
and the device ended up not working.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: initialize fw_features var
Michal Kazior [Wed, 5 Aug 2015 04:55:37 +0000 (06:55 +0200)]
ath10k: initialize fw_features var

If firmware did not have any feature flags set the
var would be left with values found on the stack
(i.e. garbage) yielding print string like this:

  (...) features \xffffffa6m:^R\xfffffffbԂ\xffffffc4^E

Fixes: b27bc5a40f91 ("ath10k: dump fw features during probing")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: Enable MU MIMO txbf support for QCA99X0
Vivek Natarajan [Tue, 4 Aug 2015 05:15:12 +0000 (10:45 +0530)]
ath10k: Enable MU MIMO txbf support for QCA99X0

This patch enables MU-MIMO transmit beamforming support
for QCA99X0 chipsets.

Signed-off-by: Vivek Natarajan <nataraja@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: Support different txbf configuration schemes
Vivek Natarajan [Tue, 4 Aug 2015 05:15:11 +0000 (10:45 +0530)]
ath10k: Support different txbf configuration schemes

qca61x4 uses the vdev param as a sole sufficient configuration
for txbf while qca99x0 enables txbf during peer assoc by
combining the vdev param value with peer assoc's vht capabilities

This patch gets the appropriate txbf configuration scheme
before passing the wmi command to enable the same in the firmware.

Signed-off-by: Vivek Natarajan <nataraja@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: reject 11b tx fragmentation configuration
Michal Kazior [Mon, 3 Aug 2015 09:16:43 +0000 (11:16 +0200)]
ath10k: reject 11b tx fragmentation configuration

Even though there's a WMI enum for fragmentation
threshold no known firmware actually implements
it. Moreover it is not possible to rely frame
fragmentation to mac80211 because firmware clears
the "more fragments" bit in frame control making
it impossible for remote devices to reassemble
frames.

Hence implement a dummy callback just to say
fragmentation isn't supported. This effectively
prevents mac80211 from doing frame fragmentation
in software.

This fixes Tx becoming broken after setting
fragmentation threshold.

Fixes: 1010ba4c5d1c ("ath10k: unregister and remove frag_threshold callback")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: remove futile fragmentation threshold config
Michal Kazior [Mon, 3 Aug 2015 09:16:42 +0000 (11:16 +0200)]
ath10k: remove futile fragmentation threshold config

Commit 1010ba4c5d1c ("ath10k: unregister and
remove frag_threshold callback") didn't remove all
instances of (futile) fragmentation threshold
configuration. No known firmware supports the
parameter so don't even bother setting it.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agomac80211: remove always true condition
Dan Carpenter [Mon, 27 Jul 2015 08:11:11 +0000 (11:11 +0300)]
mac80211: remove always true condition

The outside if statement checks that IEEE80211_TX_INTFL_MLME_CONN_TX is
set so this condition is always true.  Checking twice upsets the static
checkers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove ieee80211_aes_cmac_calculate_k1_k2()
Johannes Berg [Wed, 8 Jul 2015 12:41:48 +0000 (15:41 +0300)]
mac80211: remove ieee80211_aes_cmac_calculate_k1_k2()

The iwlwifi driver was the only driver that used this, but as
it turns out it never needed it, so we can remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiwlwifi: mvm: don't set K1/K2 for AES-CMAC
Johannes Berg [Fri, 19 Jun 2015 08:20:10 +0000 (10:20 +0200)]
iwlwifi: mvm: don't set K1/K2 for AES-CMAC

According to firmware engineers, the firmware has never required
these fields and the values have always been calculated, they were
just leftovers from a previous implementation.

Therefore remove the unnecessary calculation.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Allow compile test of GPIO consumers if !GPIOLIB
Geert Uytterhoeven [Sun, 2 Aug 2015 09:09:54 +0000 (11:09 +0200)]
rfkill: Allow compile test of GPIO consumers if !GPIOLIB

The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoath: Make ath_opmode_to_string understand OCB mode
Bertold Van den Bergh [Mon, 3 Aug 2015 13:45:41 +0000 (15:45 +0200)]
ath: Make ath_opmode_to_string understand OCB mode

Make ath_opmode_to_string return "OCB" for NL80211_IFTYPE_OCB. Currently
it will return "UNKNOWN".

Signed-off-by: Bertold Van den Bergh <bertold.vandenbergh@esat.kuleuven.be>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobcma: fix access to host_pdev for PCIe devices
Hauke Mehrtens [Sun, 2 Aug 2015 18:26:52 +0000 (20:26 +0200)]
bcma: fix access to host_pdev for PCIe devices

bus->host_pdev is part of a union so bus->host_pdev != NULL is probably
also true for PCIe devices, because there it accesses bus->host_pci. If
we access the dev member at the offset defined in struct
platform_device in struct pci_dev instead we probably get something
else.

This patch adds a new function which returns the host dev struct and
NULL if we do not have a host dev. When this gets registered on MIPS
brcm47xx we do not have a host dev in some situations.
This function could also be used in other places.

This problem was introduced in this commit:
commit cae761b5a6bdc597ba476a040fdcd5b4bc559b85
Author: Rafa? Mi?ecki <zajec5@gmail.com>
Date:   Sun Jun 28 17:17:13 2015 +0200

    bcma: populate bus DT subnodes as platform_device-s

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomt7601u: lock out rx path and tx status reporting
Jakub Kicinski [Fri, 31 Jul 2015 13:04:49 +0000 (15:04 +0200)]
mt7601u: lock out rx path and tx status reporting

mac80211 requires that rx path does not run concurrently with
tx status reporting.  Add a spinlock which will ensure that.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomt7601u: fix tx status reporting contexts
Jakub Kicinski [Fri, 31 Jul 2015 13:04:48 +0000 (15:04 +0200)]
mt7601u: fix tx status reporting contexts

mac80211 requires that rx path does not run concurrently with
tx status reporting.  Since rx path is run in driver tasklet,
tx status cannot be reported directly from interrupt context
(there would be no way to lock it out).

Add tasklet for tx and move all possible code from irq handler
there.

Note: tx tasklet is needed because workqueue is queued very
      rarely and that kills TCP performance.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomt7601u: use correct ieee80211_rx variant
Jakub Kicinski [Fri, 31 Jul 2015 13:04:47 +0000 (15:04 +0200)]
mt7601u: use correct ieee80211_rx variant

Rx is run inside a tasklet so ieee80211_rx() should be used
instead of ieee80211_rx_ni().

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomt7601u: fix dma from stack address
Jakub Kicinski [Fri, 31 Jul 2015 13:04:46 +0000 (15:04 +0200)]
mt7601u: fix dma from stack address

DMA to variables located on the stack is a bad idea.
For simplicity and to avoid frequent allocations create
a buffer inside the device structure.  Protect this
buffer with vendor_req_mutex.  Don't protect vendor
requests which don't use this buffer.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowlcore: add p2p device support
Eliad Peller [Thu, 30 Jul 2015 19:38:22 +0000 (22:38 +0300)]
wlcore: add p2p device support

When starting a p2p mgmt interface, enable its device role. This
allows us to keep the sta role disabled and scan on the dev role.

In general, p2p management interfaces cannot send vif-specific commands
to FW, as the vif role id is invalid. Only off-channel data and scans
happen on this vif, so most ops are not relevant.

If the vif is a p2p mgmt vif, block some mac80211 ops.

Configure rate policies for p2p mgmt interface, as
otherwise p2p packets come out with arbitrary rates.

Since wpa_supplicant currently doesn't support standalone
p2p device mode (without another attached managed interface),
add p2p device to the allowed interface combinations without
decreasing the allowed station count.

Moreover, increase the station count in some cases, as AP
mode usually starts as station interface, and the AP interface
is now different from the p2p management one).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowlcore: add generic_cfg_feature command definitions
Eliad Peller [Thu, 30 Jul 2015 19:38:21 +0000 (22:38 +0300)]
wlcore: add generic_cfg_feature command definitions

Add definitions and function prototypes for generic_cfg
command.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowl18xx: use long intervals in sched scan
Eliad Peller [Thu, 30 Jul 2015 19:38:20 +0000 (22:38 +0300)]
wl18xx: use long intervals in sched scan

Add support for long intervals on sched scan.

If configured, the original request interval will
be used num_short_interval times, and then the
long interval will be used.

While on it, fix the scan command field names
to reflect the expected value is in ms (rather
than secs).

These values will be taken from the conf file,
so bump its version accordingly.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowlcore/wl18xx : add time sync event handling
Machani, Yaniv [Thu, 30 Jul 2015 19:38:19 +0000 (22:38 +0300)]
wlcore/wl18xx : add time sync event handling

Added support for a new time sync event
the event data contains the WiLink TSF value.
To trigger the event, a HW modification is required,
so as a supporting firmware binary.

Signed-off-by: Yaniv Machani <yanivma@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: correct TDLS link delete failure message priority
Amitkumar Karwar [Tue, 28 Jul 2015 14:22:20 +0000 (07:22 -0700)]
mwifiex: correct TDLS link delete failure message priority

Commit d8d2f19feb16 ("mwifiex: silence TDLS link delete failure
for nonexistent link") lowers the priority of error message when
TDLS link is already deleted. But it had got increased by
commit acebe8c10a6e ("mwifiex: change dbg print func to
mwifiex_dbg")

Reported-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: fix build with CONFIG_ATH9K_STATION_STATISTICS=y
Felix Fietkau [Thu, 6 Aug 2015 10:44:30 +0000 (12:44 +0200)]
ath9k: fix build with CONFIG_ATH9K_STATION_STATISTICS=y

kbuild bot reported that commit 592fa228f213 ("ath9k: remove struct
ath_atx_ac") broke the build when CONFIG_ATH9K_STATION_STATISTICS is y.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 592fa228f213 ("ath9k: remove struct ath_atx_ac")
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoMerge tag 'iwlwifi-next-for-kalle-2015-08-04' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Thu, 6 Aug 2015 07:27:59 +0000 (10:27 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2015-08-04' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* Deprecate -10.ucode
* Clean ups towards multiple Rx queues
* Add support for longer CMD IDs. This will be required by new
firmwares since we are getting close to the u8 limit.
* bugfixes for the D0i3 power state
* Add basic support for FTM
* More random that doesn't really stand out

8 years agowlcore: add antenna diversity reading comments
Guy Mishol [Mon, 27 Jul 2015 14:25:49 +0000 (17:25 +0300)]
wlcore: add antenna diversity reading comments

add comments to the antenna diversity reading

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add missing skb_push() in mwifiex_check_uap_capabilties
Amitkumar Karwar [Mon, 27 Jul 2015 12:02:27 +0000 (05:02 -0700)]
mwifiex: add missing skb_push() in mwifiex_check_uap_capabilties

For PCIe/USB chipsets, preallocated skb buffers are reused for
event handling. mwifiex_check_uap_capabilties() performs
skb_pull(). This patch adds missing skb_push() to restore skb's
data pointer/length.

This bug was introduced by commit debfc6008169 ("mwifiex: update
AP WMM settings from BSS_START event")

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowl18xx: add dynamic fw traces
Guy Mishol [Mon, 27 Jul 2015 06:46:02 +0000 (09:46 +0300)]
wl18xx: add dynamic fw traces

add option to dynamically configure the fw
which debug traces to open

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: corrections in PCIe event skb handling
Amitkumar Karwar [Wed, 22 Jul 2015 11:53:45 +0000 (04:53 -0700)]
mwifiex: corrections in PCIe event skb handling

Preallocated event SKBs are getting reused for PCIe chipset.
Their physical addresses are shared with firmware so that
firmware can write data into them.

This patch makes sure that SKB is cleared and length is set to
default while submitting it to firmware.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix system crash observed during initialisation
Zhaoyang Liu [Wed, 22 Jul 2015 11:53:44 +0000 (04:53 -0700)]
mwifiex: fix system crash observed during initialisation

System crash was observed if one of the driver initialisation
commands is timed out. The reason is our timeout handler triggers
firmware dump, meanwhile driver initialisation error paths have
already freed the adapter structure.

Firmware hasn't yet completely initialized. So collecting firmware
dump is not needed in this case. Command timeout handler is
modified in this patch to fix the crash issue.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix command timeout for PCIe chipsets
Zhaoyang Liu [Wed, 22 Jul 2015 11:53:43 +0000 (04:53 -0700)]
mwifiex: fix command timeout for PCIe chipsets

When WLAN interface is up and running, driver unload and
load was causing command timeout error.

We enable Rx data by updating RX ring read pointer in
init_fw_port(). It should be done when FW is completely
intialialised. Command timeout is fixed in this patch by
moving init_fw_port() call to mwifiex_init_fw_complete().

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: using right aid value for tdls action frame
Xinming Hu [Wed, 22 Jul 2015 11:53:42 +0000 (04:53 -0700)]
mwifiex: using right aid value for tdls action frame

Variable pos is u8 here, so memcpy is needed to store u16 aid.
At the same time, aid should be platform independent, upper layer
utility(wpa_supplicant,etc.,) parse it as le16, so keep it le16
here.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: remove the sched field in struct ath_atx_tid
Felix Fietkau [Wed, 22 Jul 2015 11:06:14 +0000 (13:06 +0200)]
ath9k: remove the sched field in struct ath_atx_tid

Use list_empty(&tid->list) instead

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: remove struct ath_atx_ac
Felix Fietkau [Wed, 22 Jul 2015 11:06:13 +0000 (13:06 +0200)]
ath9k: remove struct ath_atx_ac

struct ath_atx_ac contains a list of active TIDs belonging to one WMM AC.
This patch changes the code to track active station TIDs in the txq directly.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: add fast-xmit support
Felix Fietkau [Wed, 22 Jul 2015 11:06:12 +0000 (13:06 +0200)]
ath9k: add fast-xmit support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: setup rxfilter when offchannel
Janusz.Dziedzic@tieto.com [Tue, 21 Jul 2015 09:11:43 +0000 (11:11 +0200)]
ath9k: setup rxfilter when offchannel

Setup rxfiler correctly for offchannel ctx.

This fix problem we didn't configure rxfilter, next
didn't receive probe requests and next failed
p2p_find. This was seen when ath9k loaded with
use_chanctx=1

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: setup rxfilter for all chanctx
Janusz.Dziedzic@tieto.com [Tue, 21 Jul 2015 09:11:42 +0000 (11:11 +0200)]
ath9k: setup rxfilter for all chanctx

While mac80211 setup this per HW, set same
rxfilter configuration for all chanctx.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: handle RoC cancel correctly
Janusz.Dziedzic@tieto.com [Tue, 21 Jul 2015 09:11:41 +0000 (11:11 +0200)]
ath9k: handle RoC cancel correctly

In case we will get ROC cancel from mac80211 we
should not call ieee80211_remain_on_channel_expired().

In other case I hit such warning on MIPS and
p2p negotiation failed (tested with use_chanctx=1).

ath: phy0: Starting RoC period
ath: phy0: Channel definition created: 2412 MHz
ath: phy0: Assigned next_chan to 2412 MHz
ath: phy0: Offchannel duration for chan 2412 MHz : 506632
ath: phy0: ath_chanctx_set_next: current: 2412 MHz, next: 2412 MHz
ath: phy0: Stopping current chanctx: 2412
ath: phy0: Flush timeout: 200
ath: phy0: ath_chanctx_set_next: Set channel 2412 MHz
ath: phy0: Set channel: 2412 MHz width: 0
ath: phy0: Reset to 2412 MHz, HT40: 0 fastcc: 0
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_TSF_TIMER, state: ATH_CHANCTX_STATE_IDLE
ath: phy0: ath_offchannel_channel_change: offchannel state: ATH_OFFCHANNEL_ROC_START
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_SWITCH, state: ATH_CHANCTX_STATE_IDLE
ath: phy0: Cancel RoC
ath: phy0: RoC aborted
ath: phy0: RoC request on vif: 00:03:7f:4e:a0:cd, type: 1 duration: 500
ath: phy0: Starting RoC period
ath: phy0: Channel definition created: 2412 MHz
ath: phy0: Assigned next_chan to 2412 MHz
ath: phy0: Offchannel duration for chan 2412 MHz : 506705
ath: phy0: ath_chanctx_set_next: current: 2412 MHz, next: 2412 MHz
ath: phy0: ath_offchannel_channel_change: offchannel state: ATH_OFFCHANNEL_ROC_START
ath: phy0: cur_chan: 2412 MHz, event: ATH_CHANCTX_EVENT_SWITCH, state: ATH_CHANCTX_STATE_IDLE
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3312 at drivers/net/wireless/ath/ath9k/main.c:2319
Modules linked in: ath9k ath9k_common ath9k_hw ath mac80211 cfg80211

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: advertise p2p dev support when chanctx
Janusz.Dziedzic@tieto.com [Tue, 21 Jul 2015 09:11:40 +0000 (11:11 +0200)]
ath9k: advertise p2p dev support when chanctx

Advertise p2p device support when ath9k loaded with
use_chanctx=1.

This will fix problem, when first interface is an AP
and next we would like to run p2p_find.
Before p2p find (scan phase) failed with EOPNOTSUPP.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: simplify mwifiex_complete_cmd
Andreas Fenkart [Fri, 17 Jul 2015 07:13:06 +0000 (09:13 +0200)]
mwifiex: simplify mwifiex_complete_cmd

600f5d909a54("mwifiex: cleanup ioctl wait queue and abstraction layer")
introduced the wakeup_interruptible suppression in mwifiex_complete_cmd
b1a47aa5e1e1("mwifiex: fix system hang issue in cmd timeout error case")
then added wakup_interruptible to mwifiex_cmd_timeout_func the single
place setting a status of ETIMEDOUT.
Instead of doing extra work, using the standard call-chain will have the
same effect:
mwifiex_cancel_pending_ioctl
-> mwifiex_recycle_cmd_node
-> mwifiex_insert_cmd_to_free_q
-> mwifiex_complete_cmd
-> wake_up_interruptible

The difference is that previously the condition was not set to true,
but that's probably just an oversight in b1a47aa5e1e1 and shouldn't
have any consequence

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: remove CMD_F_CANCELED flag
Andreas Fenkart [Fri, 17 Jul 2015 07:13:05 +0000 (09:13 +0200)]
mwifiex: remove CMD_F_CANCELED flag

CMD_F_CANCELED was used to abort mwifiex_process_cmdresp in
case it already started or starts processing the cmd.
But this was probably not working the way intended:
- it is racy: mwifiex_process_cmdresp might already have passed that
  test and is continuing to use the cmd node being recycled
- mwifiex_process_cmdresp repeatedly uses adapter->curr_cmd which
  we just set to NULL
- mwifiex_recycle_cmd_node will clear the flag

The reason why it probably works is that mwifiex_cancel_pending_ioctl
is only called from mwifiex_cmd_timeout_func, where the there is little
chance of a command response still arriving

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>