Commit Graph

22063 Commits

Author SHA1 Message Date
Emmanuel Grumbach
a4ca3ed4eb iwlwifi: mvm: really disable TDLS queues
for_each_set_bit expect the size in number of bits and not
in bytes.

Fixes: a0f6bf2a5b ("iwlwifi: mvm: use private TFD queues for TDLS stations")
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:23 +02:00
Ilan Peer
1008e442e3 iwlwifi: mvm: Do not consider invalid HW queues in queue mask
The iwl_mvm_mac_get_queues_mask() added vif->hw_queue[ac] to the
queue mask although it might be set to IEEE80211_INVAL_HW_QUEUE.
Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:22 +02:00
Emmanuel Grumbach
e583b50c07 iwlwifi: mvm: BT Coex - set all the co-running values to 0
With this value, we de-facto disable the feature. Since it
is not working yet, disable it completely.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:21 +02:00
Eran Harary
716e48a650 iwlwifi: mvm: support family 8000 C step
C step functionality in the driver is exactly the same as
B step besides the ucode name that present as iwlwifi-8000C-xx.ucode
instead of iwlwifi-8000B-xx.ucode

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:20 +02:00
Johannes Berg
dad33ecfdb iwlwifi: pcie: init ref_lock
The ref_lock that was recently added is missing initialization
which makes lockdep unhappy and is generally a bad idea.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:19 +02:00
John W. Linville
aa0cb08b95 iwlwifi: mvm: document switch case fall-through in iwl_mvm_send_sta_key
Add a comment indicating that the WLAN_CIPHER_SUITE_WEP104 case falls
through to the WLAN_CIPHER_SUITE_WEP40 case in iwl_mvm_send_sta_key.
This will document that the lack of a break is intentional.

Coverity: CID 1260023

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:19 +02:00
Eyal Shapira
ec41088f2b iwlwifi: mvm: rs: use STBC regardless of power save mode
Tx STBC was used only when in CAM mode or if powersave is disabled.
Effectively this meant we never used STBC as these modes aren't
used on most platforms by default. Change that.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:18 +02:00
Emmanuel Grumbach
6d440b2559 Revert "iwlwifi: mvm: drop non VO frames when flushing"
This is now implemented by mac80211 (commit below).
mac80211 will flush/drop the frames on the queues before
suspending / disconnecting.
It will then send the deauth and wait until the queues are
empty.

commit 3b24f4c653
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Wed Jan 7 15:42:39 2015 +0200

    mac80211: let flush() drop packets when possible

This reverts commit 4e6c48e098.
2015-01-22 17:55:17 +02:00
Emmanuel Grumbach
84bfffa968 iwlwifi: mvm: add support for new LTR command
This new command will give finer granularity to configure
the platform.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:16 +02:00
Emmanuel Grumbach
1c30f12ed2 iwlwifi: mvm: BT Coex - fine tune the MPLUT register
This allow to better preserve the BT performance while
WiFi is running.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:55:15 +02:00
Emmanuel Grumbach
d5234cb2f4 Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Conflicts:
	drivers/net/wireless/iwlwifi/iwl-fw-file.h
	drivers/net/wireless/iwlwifi/mvm/scan.c
2015-01-22 17:55:12 +02:00
Johannes Berg
bd1ba66414 iwlwifi: mvm: move U-APSD decision to authentication
In order to change the usage of U-APSD on the fly later,
move the enabling condition into a new function that is
called when authenticated.

This allows the module parameter to become writable, it
won't take effect immediately but at least on the next
association the new value will be used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:11 +02:00
Emmanuel Grumbach
7fe3016f24 Merge tag 'tags/mac80211-next-for-davem-2015-01-19' into iwlwifi-next
Some further updates for net-next:
 * fix network-manager which was broken by the previous changes
 * fix delete-station events, which were broken by me making the
   genlmsg_end() mistake
 * fix a timer left running during suspend in some race conditions
   that would cause an annoying (but harmless) warning
 * (less important, but in the tree already) remove 80+80 MHz rate
   reporting since the spec doesn't distinguish it from 160 MHz;
   as the bitrate they're both 160 MHz bandwidth
2015-01-22 17:54:10 +02:00
Luciano Coelho
57d7b6a4cd iwlwifi: mvm: ignore temperature updates in the RX statistics notification
If the firmware sends spontaneous DTS notfications with the
temperature (indicated in a TLV), we can ignore the temperature we get
in the RX statistics notifications.  This prevents potentially
handling the same temperature change twice.  It also ignores
notifications with temperature equal to 0 that happens from time to
time.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:09 +02:00
Eyal Shapira
be77c29cef iwlwifi: mvm: rs: cleanup unuseful and overflowing traces
These aren't useful and overflowing so drop them
and also fix a minor typo.

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>
2015-01-22 17:54:09 +02:00
Johannes Berg
93d17cceb2 iwlwifi: mvm: generate statistics debugfs code
There's no need to duplicate the structure field name in the string,
just generate the string in the macro that's there anyway. To keep
the debugfs output the same, rename one (otherwise unused) field.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:08 +02:00
Johannes Berg
d19ac58971 iwlwifi: mvm: move statistics API to new header file
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:07 +02:00
Johannes Berg
75e52472ad iwlwifi: mvm: sync statistics firmware API
The firmware API structs are split differently, synchronize
the struct splits with the current firmware definitions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:06 +02:00
Emmanuel Grumbach
66396583e1 iwlwifi: correctly set the NMI register
When we want to trigger an NMI in the device, we need to set
bit 7 and not bit 0. However, older firmwares don't register
to the interrupt issued by bit 7. Use bit 7 first so that
the correct interrupt will be issued hoping that the firmware
will react. To be on the safe side, set bit 0 in case the
firmware didn't register to the proper interrupt.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:05 +02:00
Liad Kaufman
04fd2c2822 iwlwifi: mvm: add rxf and txf to dump data
When the FW is in error status - try to read the RXF and
TXF (all of them) and add them to the dump data.

This shouldn't happen in non-error statuses, as we don't
want to stop the RXF/TXF while they are running.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:05 +02:00
Ido Yariv
861383249d iwlwifi: mvm: add support for dumping a secondary SRAM
Some HW modules have two SRAMs. In such cases add the secondary SRAM to
the list of dumped segments.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:04 +02:00
Johannes Berg
e39c1b5f5e iwlwifi: mvm: add debugfs file for misbehaving U-APSD AP
As this functionality relies on getting a firmware notification
it is difficult to test. Allow accessing the data for it from
debugfs to be able to trigger all kinds of scenarios to test.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:03 +02:00
Emmanuel Grumbach
0294d9eece iwlwifi: mvm: let the firmware configure the scheduler
A new host command can be used to configure the scheduler
instead of accessing the scheduler's registers from the
driver. This is easier and less error prone since accessing
the hardware at certain moments can lead to races with the
firmware.
Prefer to use the host command whenever it is available.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:02 +02:00
David Spinadel
3cae0734af iwlwifi: mvm: scan dwell time corrections
Use only basic dwell time (10 ms for active scan and 110 for passive),
regardless of the number of the probes and the band, if it is
supported by the FW. The FW will add 3 ms for each probe sent and 10
ms for low band channels.
Add a TLV flag to indicate such support in FW.

This fix is needed to fix few bugs regarding scans that take too much time.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:01 +02:00
Emmanuel Grumbach
d42537bc47 iwlwifi: remove unused TLV capability flags
The driver doesn't support the firmwares that don't have
these capabilities. The code that actually used these
flags has been removed already, but the flags were left
for an unclear reason. Remove them.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:00 +02:00
Eran Harary
2a831e0806 iwlwifi: mvm: add print of he nvm version
Print the nvm version in the log for debugging purposes.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:54:00 +02:00
Haim Dreyfuss
44e9cd7e40 iwlwifi: mvm: set max_out_time equal to frag_passive_dwell in fragmented scan
Fragmented scan should be applied for all channels, passive and active.
When scanning on passive channels the firmware uses frag_passive_dwell
to define the maximum continuous scan time before returning to the
operating channel. On active channels max_out_time is the parameter
used by the firmware to define the maximum time allowed out of the
operating channel. Since active channels' scan should also be fragmented
set max_out_time equal to frag_passive_dwell.
In addition:
- Set max_out_time and suspend_time if the firmware doesn't support
  fragmented scan to avoid unexpected behavior.
- Adjust max_out_time for second level of scan precedence.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:59 +02:00
Emmanuel Grumbach
afe08e1cd5 iwlwifi: mvm: rs: allow to disable MIMO for P2P only
This is to work around interoperability bugs with devices
that don't hanle MIMO properly.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:58 +02:00
Emmanuel Grumbach
e66e0b7076 iwlwifi: mvm: allow to collect debug data from non-sleepable context
iwl_mvm_fw_dbg_collect allows to collect debug data from
the firmware. Most of the firmware interaction is done in
non-sleepable context. It makes little sense to force the
caller of iwl_mvm_fw_dbg_collect to sleep.
Defer the actual collection to a worker so that this
function will be able to be called from any context.

Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:57 +02:00
Liad Kaufman
e93475a0ff iwlwifi: mvm: make sure state isn't in d0i3 when stopping fw monitor
In case platform is in d0i3 - make sure it is awake when
writing the registers to stop the monitor when collecting FW
debug data. Plus, remove unneeded mutex locking currently
done.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:56 +02:00
Alexander Bondar
e5d7464652 iwlwifi: mvm: Add debugfs entry to enable scan offload notification
This option enables scan offload iteration complete notification from
firmware which includes the last iteration's status and the scanned
channels from the current iteration.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:56 +02:00
Oren Givon
9b8a7a9077 iwlwifi: add new config and PCI IDs for 4165 series
Add a new config for 4165 series over PCI and insert support
for two new 4165 series PCI IDs.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:55 +02:00
Liad Kaufman
fb2380a206 iwlwifi: mvm: make sure state isn't in d0i3 when collecting fw dbg
This makes sure that we're not trying to read/write any of
the FW debug data collected during d0i3.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:54 +02:00
Eyal Shapira
bd9993182a iwlwifi: mvm: rs: repeat initial legacy rates in LQ table
Repeating the legacy rates avoids degrading quickly to
lower rates due to collisions which is common when doing
TCP Tx traffic in legacy.
This slightly improves TCP Tx throughput while working
in legacy in different scenarios.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:53 +02:00
Eyal Shapira
9ce578a558 iwlwifi: mvm: don't indicate no BA if STA was in powersave
If Tx failed because the STA was in powersave there's no point
in sending a BAR so avoid indicating AMPDU_NO_BACK to mac80211.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22 17:53:52 +02:00
Kalle Valo
6b03e32d57 Merge commit 'c1e140bf79d817d4a7aa9932eb98b0359c87af33' from mac80211-next
Patch "ath9k: Fix no-ack frame status" needs these mac80211 patches:

commit 5cf16616e1
Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Date:   Wed Dec 10 21:26:11 2014 +0530

    mac80211: Fix accounting of multicast frames

commit 6b127c71fb
Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Date:   Wed Dec 10 21:26:10 2014 +0530

    mac80211: Move IEEE80211_TX_CTL_PS_RESPONSE

Conflicts:
	drivers/net/wireless/ath/wil6210/cfg80211.c
	drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
2015-01-22 14:49:44 +02:00
Eyal Shapira
2cee4762c5 iwlwifi: mvm: validate tid and sta_id in ba_notif
These are coming from the FW and are used to access arrays.
Bad values can cause an out of bounds access so discard
such ba_notifs and warn.

CC: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-20 08:47:16 +02:00
David S. Miller
0c49087462 Some further updates for net-next:
* fix network-manager which was broken by the previous changes
  * fix delete-station events, which were broken by me making the
    genlmsg_end() mistake
  * fix a timer left running during suspend in some race conditions
    that would cause an annoying (but harmless) warning
  * (less important, but in the tree already) remove 80+80 MHz rate
    reporting since the spec doesn't distinguish it from 160 MHz;
    as the bitrate they're both 160 MHz bandwidth
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJUvUZlAAoJEDBSmw7B7bqrfNMQAJT5jjOSjmwW8Zdvujvda/qt
 bFpYa9t0NsN3izzMpjPSrCwPrHN5qE86ZA8TcZrIzejPH4rpltjaXB6JNHZardVo
 deCUWU9xotoPELoE0Xex9mHPEkYYvOaht/P8A/88qP1S2PykMmj9fqNeijyUvwuo
 Jlsh0wKe4Jq6bCmdxvy/bde84ceAQcuh2TKNov1S0tB38tRY9qSu2n6ZGpoMNcEe
 CWuW+23jL1uAvt6Ljk2fTKdLR8iyXykfM0UMX2/4R2PMnJXK/dQqV/eeXTjpxtMk
 UV4aIMcSS19D7HxICKOXOdZLdMMuXaFUnUMlGLBtXZz3n9lZoP7RtVIHoib8VBXZ
 tY7xQrK6YNvwZ4SZZPuv/yr6YWP2+vBM2FUfXjzD+or6uYsej203a5q0RsOY+3Tp
 6Yklr+mQNlrOtpMsHMSgrBUUZsAK1I95ALMVVqaq1hgf1cDvRIDHlOo4A7bjwNFw
 eA3L1o4O1/E/IGp4v6+2Iukc9rIwm11sNr/wuD8dDkZTradUPH1iY6J5sxJNb2Nq
 YdpCnQ/lNXj650+z9/G2omSA6DTTTOtXJPxKR+FOHZVKDpZYtF6TxKb0S79fINps
 6ZlWIna5bUiXF1b6xad1x+vtyjNMgTvkg6mR+WQnvF57Ri8hucbtpv5wpA5bhYUQ
 Fbz9VZF2nfMeIbXfTaWi
 =Bvmr
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-next-for-davem-2015-01-19' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Some further updates for net-next:
 * fix network-manager which was broken by the previous changes
 * fix delete-station events, which were broken by me making the
   genlmsg_end() mistake
 * fix a timer left running during suspend in some race conditions
   that would cause an annoying (but harmless) warning
 * (less important, but in the tree already) remove 80+80 MHz rate
   reporting since the spec doesn't distinguish it from 160 MHz;
   as the bitrate they're both 160 MHz bandwidth

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-19 16:22:19 -05:00
Felix Fietkau
e3f31175a3 ath9k: fix race condition in irq processing during hardware reset
To fix invalid hardware accesses, the commit 872b5d814f ("ath9k: do not
access hardware on IRQs during reset") made the irq handler ignore interrupts
emitted after queueing a hardware reset (which disables the IRQ). This left a
small time window for the IRQ to get re-enabled by the tasklet, which caused
IRQ storms.  Instead of returning IRQ_NONE when ATH_OP_HW_RESET is set, disable
the IRQ entirely for the duration of the reset.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-19 14:32:29 +02:00
Kalle Valo
7b05520160 * one fix for rfkill while scheduled scan is running.
Linus's system hit this issue. WiFi would be unavailable
   after this has happpened because of bad state in cfg80211.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUvBLgAAoJEC0Llv5uNjIBn60QAJlN62JnZu5X6XCnzK8hdTe3
 4AFKf9e+ejBDEfFTcGLA+fX0fDgCaWkY5kYmS0jlqd60u7BUUOENxJGgv1FRGcqr
 fIjN8nfjbr5p6FZk6E+sVvDgs4NJ+tosnZofxwBOflVK9cAON01MsV/SuUHh9A8i
 qBVn9aZHbpjSNPSOIjZgvcOTREE0ckHVYJEpAlR0IXYUKRxY3+XtpmruSnoNNnox
 XKljOQRzMR/LwTIX1De4Uw09NDjWL+u5KpZNuXmaG6Z/4HoKDlqN+ZTJtxSGXo8m
 F6VkTXQPmZc9+7ELzMYn5o5CDaEGejCVxMP7AhYzztCDwrmV0cGMb6wKcJFMbE8M
 l+8VikOGtEnbAWh+vfLyKsB0hMb5SBjxxh2Vu3xpglOLinZKHwdJPAweoCwRgp8Y
 u+Ra21u+giJPeyMTVnzTVO4M0TQ6UuvVP7Zreq51TXaLYrQzObDf+JtRROQMm84k
 llhQ9dwSznVZ7Ub1cYh0wbJ7FVDV7RT0fSbmtmHY9LBSPffdigvZtzVMEYM+kbDm
 72Rqjd/2JqYCvFJpj6j6bpOZUdfT5pmq30eknyGY22wChgC3rkNp2TKHRfVOq2lK
 kSLTgzCAXhI21/UWbSwyKft5w/3u7RdFFNdaZA7KQTgAGYQESf9EHaPq3o+/hlRy
 ofJWo4B2ctiiKl2IC1uW
 =WBj6
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-for-kalle-2015-01-15' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

* one fix for rfkill while scheduled scan is running.
  Linus's system hit this issue. WiFi would be unavailable
  after this has happpened because of bad state in cfg80211.
2015-01-19 09:47:28 +02:00
Emmanuel Grumbach
90ea15c114 iwlwifi: mvm: abort scheduled scan upon RFKILL
When we have an active scheduled scan, and the RFKILL
interrupt kicks in, the stack will cancel the scheduled
scan as part of the down flow. But cancelling scheduled
scan usually implies sending a command to the firwmare
which has been killed as part of the RFKILL interrupt
handling.
Because of that, we returned an error to mac80211 when
it asked to stop the scheduled scan and didn't notify the
end of the scheduled scan. Besides a fat warning, this led
to a situation in which cfg80211 would refuse any new scan
request.

To disentangle this, fake that the scheduled scan has been
stopped without sending the command to the firwmare, return
0 after having properly let cfg80211 know that the scan
has been cancelled.

This is basically the same as:
commit 9b520d8495
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Tue Nov 4 15:54:11 2014 +0200

    iwlwifi: mvm: abort scan upon RFKILL

    This code existed but not for all the different FW APIs
    we support.
    Fix this.

but for the scheduled scan case.

Link: http://permalink.gmane.org/gmane.linux.kernel.wireless.general/133232
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-18 22:04:37 +02:00
Johannes Berg
053c095a82 netlink: make nlmsg_end() and genlmsg_end() void
Contrary to common expectations for an "int" return, these functions
return only a positive value -- if used correctly they cannot even
return 0 because the message header will necessarily be in the skb.

This makes the very common pattern of

  if (genlmsg_end(...) < 0) { ... }

be a whole bunch of dead code. Many places also simply do

  return nlmsg_end(...);

and the caller is expected to deal with it.

This also commonly (at least for me) causes errors, because it is very
common to write

  if (my_function(...))
    /* error condition */

and if my_function() does "return nlmsg_end()" this is of course wrong.

Additionally, there's not a single place in the kernel that actually
needs the message length returned, and if anyone needs it later then
it'll be very easy to just use skb->len there.

Remove this, and make the functions void. This removes a bunch of dead
code as described above. The patch adds lines because I did

-	return nlmsg_end(...);
+	nlmsg_end(...);
+	return 0;

I could have preserved all the function's return values by returning
skb->len, but instead I've audited all the places calling the affected
functions and found that none cared. A few places actually compared
the return value with <= 0 in dump functionality, but that could just
be changed to < 0 with no change in behaviour, so I opted for the more
efficient version.

One instance of the error I've made numerous times now is also present
in net/phonet/pn_netlink.c in the route_dumpit() function - it didn't
check for <0 or <=0 and thus broke out of the loop every single time.
I've preserved this since it will (I think) have caused the messages to
userspace to be formatted differently with just a single message for
every SKB returned to userspace. It's possible that this isn't needed
for the tools that actually use this, but I don't even know what they
are so couldn't test that changing this behaviour would be acceptable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-18 01:03:45 -05:00
David S. Miller
27f097177d Here's a big pile of changes for this round.
We have
  * a lot of regulatory code changes to deal with the
    way newer Intel devices handle this
  * a change to drop packets while disconnecting from
    an AP instead of trying to wait for them
  * a new attempt at improving the tailroom accounting
    to not kick in too much for performance reasons
  * improvements in wireless link statistics
  * many other small improvements and small fixes that
    didn't seem necessary for 3.19 (e.g. in hwsim which
    is testing only code)
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJUt7WEAAoJEDBSmw7B7bqrVBoP/2EViE62HMmXdqG1SZWz8q9o
 Iigq8STC/sT2WCx1pYm+tKuVW4LD2O3mCriGNP8A3RwzDZ6H7sKJYb1gV6QCPV6f
 4+yT5VSAB3D3lHmp/bbyNsmKCBQ5uS4LVgDrokrkbGpacDu94PYS5Wv9t3x6PBVB
 5Xjky6g6A/pSuxTIstSO9k5xkzNjaB1TxvVRz/gJrGcFQVkDFSlVbuTHUVxs8p+p
 k6mwY/2WYijZkswWZVQTJLQlF9vRI7PYkKs5m8gz4pjNU48oFJoyu4IP3Z1Xj/Sm
 zgT1C9rgp0Du74HYO2niGAvLWgKajAZuW5hIacDndUPjYQQBLgGs/bCJGSntM+x9
 XoOdPixdFPT/58ijyYZlmHc8rxPOd2kHsVbwGplp8f195S4VO04D+ejfOaoAUFwX
 v/kMvO3XIFmEH1jjkDAC3OTcRMYVMuENyWl7pFzxHIzPeRiEpQUd9iSdM4yol0F2
 ZyWvKud4U75Sh+aCiDIIBETtdfCRFe12hgKs4COYbI/UYkGPTPrNei/uisopdubT
 JC+7pZOYdSgoX12yVi6ds6DmKE/ZpIQyhIK4wTWgVoszbnfdb9Mw7mJEThwNRjeK
 JJPsbuty7u8HWjXzEqHLoTV3BFv1cgRSJc5Wt0zfME+LzD7iQpEpv+QBAguwwChD
 Osn55Z3FnKEmBdGcOIje
 =vaEW
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-next-for-davem-2015-01-15' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Here's a big pile of changes for this round.

We have
 * a lot of regulatory code changes to deal with the
   way newer Intel devices handle this
 * a change to drop packets while disconnecting from
   an AP instead of trying to wait for them
 * a new attempt at improving the tailroom accounting
   to not kick in too much for performance reasons
 * improvements in wireless link statistics
 * many other small improvements and small fixes that
   didn't seem necessary for 3.19 (e.g. in hwsim which
   is testing only code)

Conflicts:
	drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

Minor overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 19:16:56 -05:00
Johannes Berg
b51f3beecf cfg80211: change bandwidth reporting to explicit field
For some reason, we made the bandwidth separate flags, which
is rather confusing - a single rate cannot have different
bandwidths at the same time.

Change this to no longer be flags but use a separate field
for the bandwidth ('bw') instead.

While at it, add support for 5 and 10 MHz rates - these are
reported as regular legacy rates with their real bitrate,
but tagged as 5/10 now to make it easier to distinguish them.

In the nl80211 API, the flags are preserved, but the code
now can also clearly only set a single one of the flags.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-15 22:41:32 +01:00
Rickard Strandqvist
d0c102f70a b43legacy: Remove unused b43legacy_radio_set_tx_iq()
Remove the function b43legacy_radio_set_tx_iq() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Rafa? Mi?ecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 15:35:46 +02:00
Johannes Berg
a2bd36c210 orinoco/hermes: select CFG80211_WEXT
It makes no sense to require the user to find and enable
CFG80211_WEXT before the driver can be selected, make the
driver select the needed Kconfig symbol itself.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 15:04:10 +02:00
Sujith Manoharan
edea2acb8b ath9k: Update PCI IDs for AR9565
This patch adds several new PCI IDs for AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:53:26 +02:00
Lorenzo Bianconi
b5939e8c71 ath9k: enable per-packet TPC on AR9002 based chips
Enable per-packet TPC on AR9002 based chips by default

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:47:34 +02:00
Lorenzo Bianconi
9ddad58bee ath9k: add TPC to TX path for AR9002 based chips
Add TPC capability to TX descriptor path for AR9002 based chips. Scale
per-packet TX power according to eeprom power bias, power adjustments for
HT40 mode and open loop CCK rates. Cap per-packet TX power according to
TX power per-rate tables

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:47:16 +02:00
Lorenzo Bianconi
c08267dc9a ath9k: add power per-rate tables for AR9002 chips
Add TX power per-rate tables for MIMO/legacy modes for AR9002 based chips
in order to cap the maximum TX power value per-rate in the TX descriptor path.
Add TX power adjustments for HT40 mode, open loop CCK rates and eeprom power
bias for AR9280 and later chips

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:47:06 +02:00
Julia Lawall
72e121191c adm8211: fix error return code
Return a negative error code on failure.

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

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:44:42 +02:00
Arend van Spriel
4447d815fd ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
Use the helper to get rid of the file operations per debugfs file. The
device driver data contains struct ieee80211_hw pointer and the
struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
be accessed in the seq_file read operation.

Cc: ath9k-devel@lists.ath9k.org
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:38:46 +02:00
Vladimir Kondratiev
bd33273b65 wil6210: relax spinlocks in rx reorder
In the Rx reorder mechanism, nothing is done in the interrupt
context, so there is no need to use 'irq' flavors of spinlock.
Rx done in NAPI context (tasklet), other manipulations - in the
thread context.

Having interrupts enabled makes it better for the OS in general.
Besides, if enslaved under bonding, bridge or team driver, Rx
won't work with interrupts disabled.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:46 +02:00
Vladimir Kondratiev
ff7c5c3bef wil6210: workaround for BACK establishment race
When establishing BACK, WMI may be handled earlier then Rx, in this case
late Rx will be mis-handled.

Detect early Rx and pass it to the stack, bypass reordering

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:44 +02:00
Vladimir Kondratiev
8d3b2f033f wil6210: Tx/Rx descriptors documentation
Sync documentation for the Tx/Rx descriptors with the
firmware/hardware documentation.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:42 +02:00
Vladimir Kondratiev
e4373d8e4a wil6210: fix reordering for MCAST
In the reordering block, Ethernet DA was checked for MCAST, this is wrong.
Check instead MCAST indication from 802.11 MAC header. Hardware saves
this into Rx descriptor.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:41 +02:00
Vladimir Kondratiev
ab95462825 wil6210: RX high threshold interrupt configuration
Rx high threshold interrupt is reported by the hardware in case
when number of not utilized by the HW descriptors in the Rx ring
becomes low.
Introduce module parameter for RX high threshold.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:40 +02:00
Vladimir Kondratiev
78366f69be wil6210: add advanced interrupt moderation
Add advanced interrupt moderation support available since "Sparrow B0".
Legacy interrupt moderation used only one counter to moderate tx, rx,
and misc interrupts.
Advanced interrupt moderation bypasses misc, and handles separately tx
and rx interrupts. In addition it has two timers for each interrupt type.
Max burst duration timer which defines how long to postpone interrupt after
first event (receive event for rx and tx complete event for tx), and
interframe timeout which defines how to determine the end of the burst and
issue interrupt even if the first timer still pending.
Capabilities flags in wil_priv is set on initialization according to
HW. The rest of the code checks for advanced interrupt capability bit
in capabilities flags field.
Debugfs is split accordingly: "legacy" interrupt moderation remains
unchanged, new debugs files added for advanced interrupt moderation
support.
Module params are aligned to support advanced interrupt moderation
(tx & rx). When not available (for legacy interrupt moderation) will
use only rx configuration; Tx configuration will be ignored in this
case.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:38 +02:00
Vladimir Kondratiev
1aeda13be0 wil6210: use HW capabilities mask in reset
Use the proper reset follow based on HW capabilities
detection instead of chip ID.
Remove old hw ID mechanism which was used only for reset flow.
Remove support for Marlon A0.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:35 +02:00
Vladimir Kondratiev
d8cfb80cb7 wil6210: detect HW capabilities
Read relevant information (HW ID for now) once on init
and set capabilities accordingly.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:34 +02:00
Vladimir Kondratiev
49cb5dfb5d wil6210: rework debugfs for BACK
Enable more flexible control over block ack:
- allow addba for any Tx vring
- allow to specify block ack timeout
- allow to delba for Tx or Rx side of any agreement; with reason

Renamed "addba" entry to "back"; it prints short help when read;
write:
 - "add <ringid> <agg_size> <timeout>" to trigger ADDBA
If missing, <timeout> defaults to 0
 - "del_tx <ringid> <reason>" to trigger DELBA for Tx side
 - "del_rx <CID> <TID> <reason>" to trigger DELBA for Rx side
If missing, <reason> set to "STA_LEAVING" (36)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:33 +02:00
Vladimir Kondratiev
54ed90a826 wil6210: fix Tx VRING for STA mode
In STA mode, all Tx should be directed to the same VRING towards the AP.
Thus, look up for the 1-st eligible VRING and use it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:31 +02:00
Vladimir Kondratiev
9419b6a206 wil6210: use bitmap API for "status"
wil->status used as bitmap; use DECLARE_BITMAP for it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:30 +02:00
Vladimir Kondratiev
327755fb8c wil6210: Increase number of associated stations
Change default to support maximum number of associated
stations to an AP

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:28 +02:00
Vladimir Kondratiev
4590d8125e wil6210: consider SNAP header in MTU calculations
When encapsulating 802.3 frames into the 802.11 ones,
8-byte SNAP header added to save ethtype. SNAP is part of
the frame body, thus should be counted in MSDU. So,
MTU = MSDU - SNAP

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:27 +02:00
Vladimir Kondratiev
c44690a157 wil6210: fix max. MPDU size
When configuring Tx/Rx VRING's, driver need to specify max. MPDU size
It should take into account all overhead introduced by 802.3->208.11
transformation.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:25 +02:00
Vladimir Kondratiev
26a359d914 wil6210: delba for responder
Implement delba flow for the responder (Rx) side

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:23 +02:00
Vladimir Kondratiev
cbcf58661b wil6210: control AMSDU on Tx side of Block Ack
When establishing Block Ack as originator (Tx), control
AMSDU flag when sending ADDBA and update status upon
establishment flow completion. To be used in AMSDU flows

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:21 +02:00
Vladimir Kondratiev
995cdd0ebd wil6210: improve debugfs for VRING
When printing VRING on debugfs (file "vrings"),
software head & tail indexes were printed in decimal format
while hardware tail in hexadecimal only.

It is not comfortable to compare indexes in different formats;
on the other hand, hexadecimal output useful to see hardware
glitches.

To serve all purposes, print hardware tail in both decimal and
hexadecimal formats.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:19 +02:00
Vladimir Kondratiev
100106d702 wil6210: fix disconnect 1 STA in AP
When disconnecting single STA in AP, it might be that STA
in question is already disconnected. In this case, need to do nothing.
Previously, it was mis-interpreted as "disconnect all"

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:17 +02:00
Vladimir Kondratiev
56637e7b53 wil6210: improve debugfs for reorder buffer
When printing debugfs for the reorder buffer, include BACK
parameters: window size and timeout

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:14 +02:00
Vladimir Kondratiev
3a3def8dbe wil6210: allow to configure ADDBA request
For manual ADDBA configuration, allow to set desired window size or
disable automatic mechanism.

Introduce module parameter (int) agg_wsize. It can be changed on run time,
will be taken into account on the next connect. Interpretation:
- <0 - disable automatic ADDBA; intended for manual testing through debugfs
- 0 - use automatically calculated window size
- >0 - use this for window size. Clipped by maximum supported by the hardware
with current environment.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:31:06 +02:00
Vladimir Kondratiev
3a124ed645 wil6210: simple ADDBA on originator (Tx) side
Upon Tx vring creation, initiate BACK establishment
with maximum possible window size.

When establishing secure connection, there is EAPOL data exchange
between connection itself and "data port open", where security
is done and non-EAPOL data may be transferred. It is better to
send EAPOL frames using normal ACK because of firmware considerations.

send ADDBA only is 2 conditions met:
- data port open for the corresponded STA
- vring created

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:30:55 +02:00
Vladimir Kondratiev
3277213feb wil6210: ADDBA/DELBA flows
Introduce BACK establishment procedures; decision logic is not implemented
yet; debugfs entry 'addba' used to manually trigger addba/delba for ringid 0.

debugfs usage:
to establish BACK with agg_wsize 16:
  echo 16 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba
to delete BACK:
  echo 0 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba
to change agg_wsize, one need to delete BACK and establish it anew

ADDBA flow for:

- originator

Tx side (initiator) sends WMI_VRING_BA_EN_CMDID providing
agg_wsize and timeout parameters.
Eventually, it gets event confirming BACK agreement - WMI_BA_STATUS_EVENTID
with negotiated parameters. On this event, update Tx vring data
(struct vring_tx_data) and display BACK parameters on debugfs

- recipient

Rx side (recipient) firmware informs driver about ADDBA with
WMI_RCP_ADDBA_REQ_EVENTID, driver process it in service work
queue wq_service. It adjusts parameters and sends response
with WMI_RCP_ADDBA_RESP_CMDID, and final confirmation provided
by firmware with WMI_ADDBA_RESP_SENT_EVENTID. In case of success,
driver updates Rx BACK reorder buffer.

policy for BACK parameters:
- aggregation size (agg_wsize * MPDUsize)) to not exceed 64Kbytes

DELBA flow for:

- originator

driver decides to terminate BACK, it sends WMI_VRING_BA_DIS_CMDID
and updates struct vring_tx_data associated with vring; ignore
WMI_DELBA_EVENTID.

- recipient

firmware informs driver with WMI_DELBA_EVENTID,
driver deletes correspondent reorder buffer

ADDBA request processing requires sending WMI command, therefore
it is processed in work queue context. Same work queue used as for
connect, it get renamed to wq_service

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:30:45 +02:00
Miaoqing Pan
ede6a5e7b8 ath9k: Add QCA956x HW support
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:25:03 +02:00
Miaoqing Pan
df476df180 ath9k: Fix register definitions for QCA956x
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:25:01 +02:00
Miaoqing Pan
635d7c50a0 ath9k: Add initvals for QCA956x
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:24:59 +02:00
Miaoqing Pan
2131fabb4b ath9k: Add HW IDs for QCA956x
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15 14:24:57 +02:00
Kalle Valo
781f51d4c2 * A fix for scan that fixes a firmware assertion
* A fix that improves roaming behavior. Same fix has been tested for
   a while in iwldvm. This is a bit of a work around, but the real fix
   should be in mac80211 and will come later.
 * A fix for BARs that avoids a WARNING.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUtMJGAAoJEC0Llv5uNjIBqoYP/iH29kX1NpmdGRIt3KEASCQn
 mr/JBR4MVBlx4UQJhXQBQnUYmDOzZ1CvQISnVheHZCfZFvbuxEGxh8CxgSmMTEhR
 2BmByuAxDma2XCxla9OIZJCkQt+eu9Wsdy5AcOkkBmnbuNFMWIFILamMAyGBFXwo
 ZAw9b+c+YsywtEYGSiZF07OXGUIs2oLWPQ7iHJLkTAlOQfKG5QSlQ+DB3BqI9kf8
 x8lM7ZuiSEyJkwV7MJogd7NpDUKtbu+mb7KUdvGYffknyakYh5pVN/0aUAnL8Xhj
 zdWQV8v7CjaHP68mliktdD03KXVi609XIV+oKzB4PBJCQDjoYAIqabYY7FuO3iSj
 4a+8lh3O9InkQclOJNzNAJFQlHVs1EbeiWVddLe7X1RyRofO6BgyOxj/G3gnWpQI
 KKRWS4EQyQrXehyygmEVUMMl2Mv4URQoQ0eyWKlkjNnLGjzinuTXAezFcjEhjY/f
 W7XCRACf0w+eLtXKd3etn3T+uGzaKHs8EhapGl6psYjUKMaGLBDvtT8Wie8qkvHM
 JJpxHGyE5nn2i4tdTQWQ5gg1fj8LfFXljcRu1MVq4zzjcqOP4mbLO+yfDFX2iDFQ
 ez2Oy+3IvjJ8Sw4D1y/5/dYmEXDTbkyjb+eBmYxG1ui62RViJUdbmVGwpLsucowT
 qGKlBtY3eEcHSYsEcBV/
 =9GPb
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-for-kalle-2015-01-13' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

* A fix for scan that fixes a firmware assertion
* A fix that improves roaming behavior. Same fix has been tested for
  a while in iwldvm. This is a bit of a work around, but the real fix
  should be in mac80211 and will come later.
* A fix for BARs that avoids a WARNING.
2015-01-15 14:06:07 +02:00
Rajkumar Manoharan
6d48161678 ath10k: fix hwmon temperature input units
To be compliant with the hwmon interface the unit needs to be
millidegree Celsius. Fix that.

Reported-by: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:36:34 +02:00
John W. Linville
f6eaf1e063 ath10k: document switch case fall-through in __ath10k_scan_finish
Add a comment for indicating that the ATH10K_SCAN_RUNNING case falls
through to the ATH10K_SCAN_ABORTING case in __ath10k_scan_finish.  This
will document that the lack of a break is intentional.

Coverity: CID 1260017

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:35:48 +02:00
Michal Kazior
a2fa880032 ath10k: prevent fw reg dump spam
Originally the explicit fw register dump was added
to wait_for_target_init because interrupts are
masked early during power_up.

Due to some changes in power_up/reset sequences
sometimes when fw crashed ath10k would print the
dump more than once via hif_stop -> warm_reset ->
wait_for_target_init, possibly with different
values each.

Prevent this by doing the explicit fw register
dump only during power_up instead of
wait_for_target_init.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:34:54 +02:00
Rajkumar Manoharan
8bdadac13f ath10k: fix duration calculation for quiet param
The duty cycle (% of quiet duration) is used to put the device
in quiet mode for the given period. Currently the quiet duration
is wrongly calculated which results in not enabling quiet mode.
Fix the calculation as below

     duration = (period * duty cycle) / 100

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:33:42 +02:00
Michal Kazior
fbb8f1b729 ath10k: implement support for ap beacon offloading
New firmware revisions support beacon and probe
response templates instead. This means SWBA events
are no longer delivered for these firmware
revisions.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:30:41 +02:00
Michal Kazior
369242b4e3 ath10k: implement p2p bcn ie command
Along beacon template host is expected to setup
p2p information elements as well. Implement wmi
interface for it.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:30:33 +02:00
Michal Kazior
4c4955fe4f ath10k: implement prb tmpl wmi command
New firmware revisions with beacon templates need
probe templates as well because they don't forward
probe requests to host at all.

This is required for new firmware to work with
direct probe requests (notably required by hidden
ssid AP).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:30:21 +02:00
Michal Kazior
be9ce9d8c1 ath10k: implement beacon template command
New firmware revisions may support setting beacon
template. Implement wmi interface for it.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:30:07 +02:00
Michal Kazior
6bf1206289 ath10k: implement new beacon tx status event
This event is delivered to host by firmware if it
supports beacon templates only.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15 12:30:00 +02:00
David S. Miller
3f3558bb51 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/xen-netfront.c

Minor overlapping changes in xen-netfront.c, mostly to do
with some buffer management changes alongside the split
of stats into TX and RX.

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-15 00:53:17 -05:00
Rajkumar Manoharan
a4031afbdc ath10k: fix config_enabled check for hwmon
Because of wrong macro check in commit 96bba98393 ("ath10k: fix build error
when hwmon is off"), hwmon never be enabled. Fix that.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:23:28 +02:00
Vasanthakumar Thiagarajan
5de6dfc82f ath10k: Fix potential Rx ring corruption
When replenishing Rx buffers driver updates the address of the
buffer and the index of rx buffer in rx ring to the firmware.
Change in order by CPU can cause rx ring corruption. Add memory
barrier before updating rx buffer index to guarantee the order.

This could fix some instances of rx ring corruption due to done
bit in rx attention flag not set.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:22:08 +02:00
Nicholas Mc Guire
38e2a64417 ath10k: fixup wait_for_completion_timeout return handling
wait_for_completion_timeout does not return negative values so the tests
for <= 0 are not needed and the case differentiation in the error handling
path unnecessary.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:19:59 +02:00
Michal Kazior
49274332a4 ath10k: fill max_num_vdevs for wmi-tlv
Recent commit
30c78167bc ("ath10k:
set max_num_vdevs based on wmi op version")
skipped wmi-tlv case and left max_num_vdevs reset.
Make sure it is properly set.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:18:33 +02:00
Sujith Manoharan
c3ebfede46 ath10k: Remove unused htt->max_throughput_mbps
htt->max_throughput_mbps is not used anywhere.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:17:01 +02:00
Julia Lawall
8be3b69259 ath10k: fix error return code
Return a negative error code on failure.

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

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:15:57 +02:00
Rajkumar Manoharan
da2aedcadb ath10k: add support to send delba
This per-station debugfs entry helps to send delba in manual mode
for debugging purpose. It accepts tid, initiator and reason code
as inputs.

To send delba,

echo 0 1 37 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
	     stations/XX:XX:XX:XX:XX:XX/delba

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:13:47 +02:00
Rajkumar Manoharan
8e68d55f5e ath10k: add support to send addba response
This per-station debugfs entry helps to send addba response in
manual mode for debugging purpose. It accepts tid and status code
as input arguments.

To send addba response,

echo 0 25 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
	   stations/XX:XX:XX:XX:XX:XX/addba_resp

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:13:32 +02:00
Rajkumar Manoharan
8bf8f190fe ath10k: add support to send addba request
This per-station debugfs entry helps to send addba request in manual
mode. Need to pass two configuration parameters (tid, buffer size)
as input.

To send addba,

echo 1 32 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
	   stations/XX:XX:XX:XX:XX:XX/addba

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:13:21 +02:00
Rajkumar Manoharan
f5045988b9 ath10k: Implement sta_add_debugfs
Add per station debugfs files when a station is added to mac80211's
station list. This helps to group peer specific debugfs entries
altogether. Right now this callback adds support to test aggregation
procedures (addba/addba_resp/delba) manually.

To enable automatic aggregation in target,
echo 0 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
	stations/XX:XX:XX:XX:XX:XX/aggr_mode

For manual mode,
echo 1 >/sys/kernel/debug/ieee80211/phyX/netdev:wlanX/
	stations/XX:XX:XX:XX:XX:XX/aggr_mode

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:13:13 +02:00
Rajkumar Manoharan
50abef85e7 ath10k: add wmi support for delba_send
Add WMI support for sending delba request. This command is used for
debugging purpose.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:13:01 +02:00
Rajkumar Manoharan
11597413b2 ath10k: add wmi support for addba_set_resp
Add WMI support for sending addba response manually. This command
is used for debugging purpose.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:12:46 +02:00
Rajkumar Manoharan
65c0893d91 ath10k: add wmi support for addba_send
Add WMI support for sending addba request. This command is meant
for debugging purpose.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:12:40 +02:00
Rajkumar Manoharan
dc8ab27861 ath10k: add wmi support for addba_clear_resp
Add WMI support for clearing addba response before switching aggregation
mode (auto/manual) for debugging purpose.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13 16:12:32 +02:00
Eyal Shapira
9b3b43d8d1 iwlwifi: mvm: set the tx cmd tid for BAR frame correctly
BAR tx cmd tid was set to non qos (8). This is wrong as BAR
should be sent with the tid of the BA session.
This led to a corruption in the firmware. The visible
effect of this from the driver side is the BA notification
that comes back after the BAR. It was botched and led to the
WARNING below.

------------[ cut here ]------------
WARNING: CPU: 2 PID: 17707 at /home/tester/workspace_hostap/iwlwifi/drivers/net/wireless/iwlwifi/mvm/tx.c:976 iwl_mvm_rx_ba_notif+0x4ba/0x4d0 [iwlmvm]()
Q 4500, tid 8, flow 65535
Modules linked in: iwlmvm(O) mac80211(O) iwlwifi(O) cfg80211(O) compat(O) netconsole configfs ctr ccm arc4 autofs4 microcode bnep rfcomm snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_codec_generic snd_hda_intel joydev snd_hda_codec uvcvideo videobuf2_core snd_hwdep videodev snd_pcm videobuf2_vmalloc videobuf2_memops i915 snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device drm_kms_helper dell_wmi dell_laptop drm btusb bluetooth snd psmouse i2c_algo_bit sparse_keymap wmi soundcore 6lowpan_iphc dcdbas serio_raw video lpc_ich ppdev mac_hid parport_pc nfsd nfs_acl auth_rpcgss nfs fscache binfmt_misc lockd sunrpc lp parport msdos sdhci_pci sdhci mmc_core ahci libahci e1000e ptp pps_core [last unloaded: compat]
CPU: 2 PID: 17707 Comm: irq/46-iwlwifi Tainted: G        W  O 3.14.17-patched #4
Hardware name: Dell Inc. Latitude E6430/0CPWYR, BIOS A09 12/13/2012
 00000000 00000000 ebd49d6c c1616221 f985dbdc ebd49d9c c1044e44 f9861df4
 ebd49dc8 0000452b f985dbdc 000003d0 f98395da f98395da ebd49f10 eaf3d8a4
 0000ffff ebd49db4 c1044f03 00000009 ebd49dac f9861df4 ebd49dc8 ebd49e64
Call Trace:
 [<c1616221>] dump_stack+0x41/0x52
 [<c1044e44>] warn_slowpath_common+0x84/0xa0
 [<f98395da>] ? iwl_mvm_rx_ba_notif+0x4ba/0x4d0 [iwlmvm]
 [<f98395da>] ? iwl_mvm_rx_ba_notif+0x4ba/0x4d0 [iwlmvm]
 [<c1044f03>] warn_slowpath_fmt+0x33/0x40
 [<f98395da>] iwl_mvm_rx_ba_notif+0x4ba/0x4d0 [iwlmvm]
 [<c10e3952>] ? ring_buffer_unlock_commit+0xa2/0xd0
 [<c10e9767>] ? trace_buffer_unlock_commit+0x37/0x50
 [<f98568a3>] ? iwl_tm_mvm_send_rx+0x53/0x90 [iwlmvm]
 [<f98327a8>] iwl_mvm_rx_dispatch+0x108/0x130 [iwlmvm]
 [<f9eac7e7>] iwl_pcie_irq_handler+0xf17/0x15b0 [iwlwifi]
 [<c10994c1>] irq_thread_fn+0x21/0x50
 [<c109926c>] irq_thread+0xec/0x110
 [<c10994a0>] ? irq_thread_dtor+0xb0/0xb0
 [<c10993f0>] ? irq_finalize_oneshot.part.34+0xc0/0xc0
 [<c1099180>] ? wake_threads_waitq+0x40/0x40
 [<c1062fdb>] kthread+0x9b/0xb0
 [<c1627137>] ret_from_kernel_thread+0x1b/0x28
 [<c1062f40>] ? flush_kthread_worker+0x90/0x90
---[ end trace 5e0f67374816db17 ]---

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>
2015-01-13 08:53:23 +02:00
Emmanuel Grumbach
4e6c48e098 iwlwifi: mvm: drop non VO frames when flushing
This change has already been implemented in iwldvm:

commit a260e7b3f0307878b99d57ed1406cf2d497923b8
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Sun Oct 5 09:11:14 2014 +0300

    iwlwifi: dvm: drop non VO frames when flushing

Since I added the flush() callback implementation in mvm,
we got reports that the queues are stuck while roaming
or suspending.
This commit above helped much for iwldvm, implement the
same behavior for iwlmvm.

CC: <stable@vger.kernel.org> [3.16+]
Fixes: c5b0e7c056 ("iwlwifi: mvm: implement mac80211's flush callback")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-12 16:34:26 +02:00
Sujith Manoharan
b6c8e287f6 ath10k: Enable RX batching
This feature allows the FW to batch RX indications,
reducing the rate of host interrupt generation, which
in turn reduces CPU load. Currently, this is enabled
only for the 10.2 firmware.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-12 13:56:02 +02:00
Sujith Manoharan
f6603ff2b7 ath10k: Fix DMA burst size
A value of zero indicates that 128B is the maximum
DMA request size for read/writes. But PCI cards based
on AR9880 can support 256B, so enable this for
the 10.2 firmware.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-12 13:51:57 +02:00
David Spinadel
1f9c418fd9 iwlwifi: mvm: fix EBS on single scan
EBS error detection isn't supported by all FWs, so turn it on
only if the FW advertises such support.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-12 09:56:19 +02:00
Kalle Valo
350b193ebd Merge ath-next from ath.git
Major changes in ath10k:

* Device tree support

* Major restructuring how to handle different WMI interface versions

* Add WMI TLV interface in preparation for new firmware interface support

* Support new firmware branch 10.2.4

* Add thermal cooling interface

* Add hwmon interface to read temparture from the device

And of course lots of small fixes and cleanups.
2015-01-09 18:45:35 +02:00
Kalle Valo
96bba98393 ath10k: fix build error when hwmon is off
kbuild reported a linking error:

ERROR: "devm_hwmon_device_register_with_groups"
[drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined!

Fix it by returning early and letting the compiler to optimise out the function
call.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-09 18:12:36 +02:00
Larry Finger
ed0fb7eb2b rtlwifi: Move macro definitions to core
Several of the drivers still were defining their own copies of various
macros. These are all moved into the core.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:20 +02:00
Larry Finger
9259ee7920 rtlwifi: rtl8821ae: Convert driver to use common DM table initialization
Convert driver to use routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:19 +02:00
Larry Finger
ac2f0baefa rtlwifi: rtl8723be: Convert driver to use common DM table initialization
Convert driver rtl8723be to use routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:17 +02:00
Larry Finger
3592c54b6c rtlwifi: rtl8723ae: Convert driver to use common DM table initialization
Convert driver rtl8723ae to use common routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:16 +02:00
Larry Finger
153cb55731 rtlwifi: rtl8192ee: Convert driver to use common DM table initialization
Convert driver rtl8192ee to use the common routine to initialize
dm_digtable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:15 +02:00
Larry Finger
8b17c1f3a5 rtlwifi: rtl8192de: Convert driver to use common DM table initialization
This patch converts driver rtl8192de to use the common routine to
initialize dm_digtable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:14 +02:00
Larry Finger
3424a00fd5 rtlwifi: rtl8192c-common: Convert driver to use common DM table initialization
These changes convert both rtl8192ce and rtl8192cu to use the new routine.
Some additional definitions are needed in the core, thus several of the
headers for other drivers are affected, but no other executable code is
changed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:12 +02:00
Larry Finger
b5d4478dc3 rtlwifi: rtl8188ee: Convert driver to use the common DM table init routine
The previous patch created a routine in rtlwifi to initialize dm_digtable.
Driver rtl8188ee is converted to use that routine.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:11 +02:00
Larry Finger
6f8214b690 rtlwifi: Create new routine to initialize the DM tables
Each of the drivers contains a routine that initializes the dm_digtable
member of the driver's private area. As a first step toward reducing the
size of the drivers, a copy of this driver is created in rtlwifi, and the
definitions of the parameters are moved there.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:10 +02:00
Larry Finger
3f0c1cfa73 rtlwifi: rtl8723be: Improve modinfo output
The description of the power-save variables for this driver is not as
clear as for the others. The wording is changed to match the others.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:09 +02:00
Larry Finger
1f6969fb23 rtlwifi: Unify variable naming for all drivers
Some drivers refer to a particular quantity in the driver's private
are by one name, while others use a different name. These differences
are removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:07 +02:00
Arend van Spriel
8bd61f8d87 brcmfmac: get rid of duplicate SDIO device identifiers
Instead of defining SDIO device identifier in brcm80211 code use
the defintions in linux/mmc/sdio_ids.h directly.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:06 +02:00
Eliad Peller
86f2db86d4 wl18xx: declare radar_detect_widths support for ap interfaces
After having all the dfs infrastructure in place, declare
radar_detect_widths support for the ap interfaces combination.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:05 +02:00
Guy Mishol
1cd91b2c4d wlcore: add dfs region to reg domain update cmd
Add dfs region to the reg domain channel update command.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:03 +02:00
Eliad Peller
4ce9fad35a wlcore: allow using dfs channels
Since we are going to support dfs channels, there
is no reason to mark them as NO_IR (having
the DFS flag is enough anyway).

Additionally, when setting the regdomain configuration,
enable usable dfs channels.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:02 +02:00
Eliad Peller
830513abc6 wlcore: add dfs master restart calls
call wlcore_cmd_dfs_master_restart when starting
the ap on a new channel (after csa is done).

Add a new WLVIF_FLAG_BEACON_DISABLED flag to
indicate that dfs_master_restart command
is required.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:01 +02:00
Eliad Peller
534719f445 wlcore: add support for ap csa
Support ap csa support by implementing the channel_switch_beacon()
mac80211 op.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:48:00 +02:00
Eliad Peller
e7d323243f wl18xx: add debugfs file to emulate radar event
Add debugfs file to emulate radar detection through
a special fw cmd (which in turn will generate radar
event)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:58 +02:00
Eliad Peller
750e9d15e2 wl18xx: add radar detection implementation
Add support for CAC start/stop commands, and pass
radar detection events from the fw to mac80211.

Bump fw name (to wl18xx-fw-4.bin) and min fw version
(to 8.9.*.*.11), and align event mailbox accordingly.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:57 +02:00
Kobi L
e2f1e50f62 wlcore: enable sleep during AP mode operation
Enable ELP authorization in AP mode and enable the use
of the wakeup bit in the ELP register.

Introduce AP role sleep configuration which is disabled
by default. When configured, it allows the AP to sleep
when ELP is authorized for it.

Signed-off-by: Kobi Leibovitch <kobi.lev100@gmail.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:56 +02:00
Eliad Peller
b8714d1b6a wlcore: enable AP wowlan
configure wowlan when host is suspended in AP mode,
since the FW can now wake the host up on Rx.

Signed-off-by: Kobi Leibovitch <kobi.lev100@gmail.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:54 +02:00
Ram Amrani
6d5a748d48 wlcore: add ability to reduce FW interrupts during suspend
Add the ability to mask FW interrupts on RX BA activity, PSM
entry/exit and fast-link notifications. This is used when the host
is suspended in order to decrease redundant wake ups.

Signed-off-by: Ram Amrani <ramrani@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:53 +02:00
Eliad Peller
7d3b29e5c8 wlcore/wl18xx: handle rc updates in a separate work
sta_rc_update runs in atomic context. thus, a new work
should be scheduled in order to configure the fw
with the required configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:52 +02:00
Eliad Peller
16129d1d59 wlcore: fix sparse warning
Use kstrtoul_from_user() for reading the user value,
and fix the following sparse warning:

drivers/net/wireless/ti/wlcore/debugfs.c:937:15: error: incompatible
types in comparison expression (different type sizes)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:51 +02:00
Eliad Peller
d6b984816b wlcore: fix WLCORE_VENDOR_ATTR_GROUP_KEY policy
The attribute type is binary data (with max length).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09 15:47:49 +02:00
Johannes Berg
a809ca5e03 mac80211_hwsim: fix PS debugfs file locking
The functions called within the iterators must be called with
tasklets disabled, so use atomic iteration like the rest of
the code and disable tasklets around the whole operation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-09 11:29:50 +01:00
Johannes Berg
319090bf6c cfg80211: remove enum station_info_flags
This is really just duplicating the list of information that's
already available in the nl80211 attribute, so remove the list.
Two small changes are needed:
 * remove STATION_INFO_ASSOC_REQ_IES complete, but the length
   (assoc_req_ies_len) can be used instead
 * add NL80211_STA_INFO_RX_DROP_MISC which exists internally
   but not in nl80211 yet

This gets rid of the duplicate maintenance of the two lists.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-08 15:28:10 +01:00
Johannes Berg
2b9a7e1bac mac80211: allow drivers to provide most station statistics
In many cases, drivers can filter things like beacons that will
skew statistics reported by mac80211. To get correct statistics
in these cases, call drivers to obtain statistics and let them
override all values, filling values from mac80211 if the driver
didn't provide them. Not all of them make sense for the driver
to fill, so some are still always done by mac80211.

Note that this doesn't currently allow a driver to say "I know
this value is wrong, don't report it at all", or to sum it up
with a mac80211 value (as could be useful for "dropped misc"),
that can be added if it turns out to be needed.

This also gets rid of the get_rssi() method as is can now be
implemented using sta_statistics().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-08 15:28:06 +01:00
Johannes Berg
4ed20bebf5 cfg80211: remove "channel" from survey names
All of the survey data is (currently) per channel anyway,
so having the word "channel" in the name does nothing. In
the next patch I'll introduce global data to the survey,
where the word "channel" is actually confusing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-08 15:27:52 +01:00
Ido Yariv
db12847ca8 mac80211: Re-fix accounting of the tailroom-needed counter
When hw acceleration is enabled, the GENERATE_IV or PUT_IV_SPACE flags
only require headroom space. Therefore, the tailroom-needed counter can
safely be decremented for most drivers.

The older incarnation of this patch (ca34e3b5) assumed that the above
holds true for all drivers. As reported by Christopher Chavez and
researched by Christian Lamparter and Larry Finger, this isn't a valid
assumption for p54 and cw1200.

Drivers that still require tailroom for ICV/MIC even when HW encryption
is enabled can use IEEE80211_KEY_FLAG_RESERVE_TAILROOM to indicate it.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Cc: Christopher Chavez <chrischavez@gmx.us>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-07 14:39:32 +01:00
Julia Lawall
6383539b97 mwifiex: tdls: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:17 +02:00
Julia Lawall
e4a1c3f88e mwifiex: 11n_rxreorder: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:15 +02:00
Julia Lawall
c6c33e7724 mwifiex: main: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:13 +02:00
Julia Lawall
99a1b74395 orinoco_usb: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:12 +02:00
Julia Lawall
1a94ace406 iwl3945: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:08 +02:00
Julia Lawall
af68b87f72 iwl4965: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:07 +02:00
Julia Lawall
0be01bf297 cw1200: queue: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:04 +02:00
Julia Lawall
dabefea693 cw1200: main: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:45:02 +02:00
Julia Lawall
983988ec0a wireless: cw1200: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:44:59 +02:00
Fred Chou
b9d305cc47 rt2x00: use helper to check capability/requirement
Use rt2x00_has_cap_flag macro to check rt2x00dev->cap_flags.

Signed-off-by: Fred Chou <fred.chou.nd@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:41:42 +02:00
Chen Gang
c20e7789be wil6210: use 'uint64_t' instead of 'cycles_t' to avoid warnings
do_div() checks the type strictly. 'cycles_t' may be 32-bit under quite
a few architectures (parisc, arm, avr32 ...). So use 'uint64_t' instead
of, the related warning (with allmodconfig under parisc):

    CC [M]  drivers/net/wireless/ath/wil6210/debugfs.o
  In file included from arch/parisc/include/generated/asm/div64.h:1:0,
                   from include/linux/kernel.h:124,
                   from include/linux/list.h:8,
                   from include/linux/module.h:9,
                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
  drivers/net/wireless/ath/wil6210/debugfs.c: In function ‘wil_vring_debugfs_show’:
  include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast
    (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                              ^
  drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
      do_div(idle, total);
      ^
  In file included from include/uapi/linux/stddef.h:1:0,
                   from include/linux/stddef.h:4,
                   from ./include/uapi/linux/posix_types.h:4,
                   from include/uapi/linux/types.h:13,
                   from include/linux/types.h:5,
                   from include/linux/list.h:4,
                   from include/linux/module.h:9,
                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
  include/asm-generic/div64.h:44:18: warning: right shift count >= width of type [-Wshift-count-overflow]
    if (likely(((n) >> 32) == 0)) {   \
                    ^
  include/linux/compiler.h:159:40: note: in definition of macro ‘likely’
   # define likely(x) __builtin_expect(!!(x), 1)
                                          ^
  drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
      do_div(idle, total);
      ^
  In file included from arch/parisc/include/generated/asm/div64.h:1:0,
                   from include/linux/kernel.h:124,
                   from include/linux/list.h:8,
                   from include/linux/module.h:9,
                   from drivers/net/wireless/ath/wil6210/debugfs.c:17:
  include/asm-generic/div64.h:48:22: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [-Wincompatible-pointer-types]
     __rem = __div64_32(&(n), __base); \
                        ^
  drivers/net/wireless/ath/wil6210/debugfs.c:107:4: note: in expansion of macro ‘do_div’
      do_div(idle, total);
      ^
  include/asm-generic/div64.h:35:17: note: expected ‘uint64_t * {aka long long unsigned int *}’ but argument is of type ‘cycles_t * {aka long unsigned int *}’
   extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
                   ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-07 10:39:58 +02:00
Maithili Hinge
8a40084e7b mwifiex: Add support for wowlan disconnect
This patch adds support for wowlan disconnect.

Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:20:32 +02:00
Maithili Hinge
468133c54f mwifiex: Move code for wowlan magic-packet and patterns to a function
This patch moves code for wowlan magic-packet and patterns to a function
mwifiex_set_mef_filter.

Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:20:28 +02:00
Amitkumar Karwar
ca5b20e6b4 mwifiex: Increase priority of firmware download message
When driver is loaded, it is important to know if FW was already
active or it is freshly downloaded. This patch increases the
priority of these messages.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:20:22 +02:00
Amitkumar Karwar
b420166fa8 mwifiex: do not release lock during list_for_each_entry_safe()
As we are releasing the lock, during next iteration we may end
up getting page fault if other thread has already deleted that
node.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:20:14 +02:00
Amitkumar Karwar
fc647467c1 mwifiex: wakeup pending wait queues
Wakeup pending wait queues in unload path. This will help to avoid
soft lockup issues in corner cases.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:19:49 +02:00
Amitkumar Karwar
4636187da6 mwifiex: add wakeup timer based recovery mechanism
If host fails to wakeup the firmware, we will trigger card reset
after 3 second timeout.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:19:44 +02:00
Marc Yang
b4f1b177be mwifiex: increase delay during card reset
200ms is the requirement to allow VDD1.1 and VDD1.8 to
drop to have proper reset.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:19:38 +02:00
Marc Yang
9d2e85e001 mwifiex: Adjust calling place of mwifiex_terminate_workqueue
Workqueue needs to be flushed early when removing card, otherwise
soft lockup issue may happen because main_process is triggered by
interrupt while card is being removed.

Signed-off-by: Marc Yang <yangyang@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>
2015-01-06 21:19:31 +02:00
Amitkumar Karwar
7197325b17 mwifiex: remove redundant flag MWIFIEX_HW_STATUS_FW_READY
This flag is never set but checked at two places. We will get rid of
this code.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:19:22 +02:00
Avinash Patil
4f3dfdfb4c mwifiex: get supported BA stream info from FW
This patch adds support to get number of BA streams
supported information from FW. Some newer chips(e.g. 8897 series)
support 4 BA streams for TX; so driver should not disallow BA stream
setup just after 2 streams have been established.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:09:30 +02:00
Xinming Hu
84b313b35f mwifiex: make tx packet 64 byte DMA aligned
This patch adds support for DMA alignment of 64 bytes for TX packets.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:09:27 +02:00
Xinming Hu
2ab87d5d67 mwifiex: do not send key material cmd when delete wep key
This patch fixes memory corruption reported by community developer.

"Memory corruption occurs in mwifiex_ret_802_11_key_material_v1()
when a short command response is received without a key length
causing non initialised memory to be interpreted as the key
length resulting in a memcpy() overwriting the part of the
driver's private data structure beyond the key area."

For v1 key material API firmwares, there is no need to send
command to delete WEP key. WEP encryption/decryption is controlled
by mac_control command.

This patch avoids sending key material command in del_key case.

Reported-by: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:09:25 +02:00
Avinash Patil
bd7d0d103a mwifiex: enable -D__CHECK_ENDIAN__ for sparse by default
Enable the endian checks by default.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:09:20 +02:00
Arend van Spriel
8b3a38daff brcmfmac: Add support for bcm43340/1 wireless chipsets
This patch adds support for the bcm43340 and bcm43341 wireless
chipsets. These two chipsets are identical from wireless parts
perspective. As such they use the same firmware image.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
[arend@broadcom.com: squash to single commit, remove 43341 chipid]
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: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 21:06:42 +02:00
Avinash Patil
0b4155d1cc mwifiex: module parameter for deep sleep configuration
This patch adds module parameter for auto deepsleep configuration.
By default, module_param is 0 and auto deep sleep is enabled.
If mwifiex driver is loaded with disable_auto_ds=1, deep sleep
configuration would not be downloaded to FW and FW would not enter
deepsleep upon initializing.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:37 +02:00
Xinming Hu
809c6ea8ab mwifiex: save sdio register values before firmware dump
This patch saves sdio registers value before firmware dump,
this can be used to find out reason for FW dump.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:30 +02:00
Xinming Hu
11cd07a969 mwifiex: save driver information to file when firmware dump
This patch adds support to dump driver information to a file
when firmware dump happens. This information can be used to
root casue FW crash.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:25 +02:00
Xinming Hu
bb5097fec9 mwifiex: move debug_data dump function to common utililty file
mwifiex_debug_info also need be save to file when firmware dump happens.
Move its dump implementation function to commmon utilility file, thus it
can be reused in firmware dump function.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:22 +02:00
Xinming Hu
617543033e mwifiex: move pm_wakeup_card_complete definition to usb.c
Move mwifiex_pm_wakeup_card_complete handler to source file.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:18 +02:00
Xinming Hu
cbf6e05527 mwifiex: add rx histogram statistics support
This patch add a new debugfs item histogram used for reporting
rx data packet statitics(rx rate, snr, noise floor, signal strenth)
to userspace.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:54:11 +02:00
Xinming Hu
d35b639228 mwifiex: add bcn_rcv_cnt and bcn_miss_cnt in getlog debugfs
This patch add receive beacon count and miss beacon count statistics
in debugfs getlog item.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:53:59 +02:00
Xinming Hu
72df63100d mwifiex: report tdls peers in debugfs
This patch add provision to show TDLS peer table in debugfs file.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:53:23 +02:00
Wolfram Sang
c0c3163a72 ath5k: drop owner assignment from platform_drivers
This platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:40:27 +02:00
Arend van Spriel
9802776982 brcmfmac: enable 802.11d support in firmware
When the driver gets beacon info containing a country IE from user-space
upon .start_ap() callback, it will enable regulatory 802.11d support.

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: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:30:16 +02:00
Hante Meuleman
6b89dcb35b brcmfmac: signal completion of 802.1x.
Use cfg80211 change_station to signal the completion of 802.1x
to firmware. This allows FW to take appropriate actions.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:29:57 +02:00
Arend van Spriel
63db1a499c brcmfmac: follow user-space regulatory domain selection
When user-space uses a valid ISO-3166-1 country code for its
regulatory domain selection, the driver will try to configure
the firmware to use the same.

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: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:29:42 +02:00
Hante Meuleman
d2e2472cd1 brcmfmac: Change error log in standard log for rxbufpost.
When there is no room in the ring for rxbufpost an error is logged,
however this happens quite frequently and can be considered normal
and is certainly recoverable. This patch changes the erorr into
a normal msgbuf log.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:29:04 +02:00
Hante Meuleman
118eb304d0 brcmfmac: Fix WEP configuration for AP mode.
When a device is configured for AP mode and it is configured for
WEP then the keys are plumbed first, followed by AP configuration.
During configuration a down command is given to the firmware which
will clear the configured keys. This patch reprograms the WEP keys
after AP has been brought up.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:28:53 +02:00
Arend van Spriel
f714e58e19 brcmfmac: remove unused/duplicate defines in chip.c
The source file chip.c contained some duplicate defines and
some unused ones. Removing them.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:28:39 +02:00
Hante Meuleman
83297aaa8f brcmfmac: Fix incorrect casting of 64 bit physical address.
The physical addresses being used by pcie and msgbuf were using
a cast to long, which incorrectly caused it to limit the address
to 32bit. Now explicit u64 is used where needed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-06 20:27:29 +02:00
Kalle Valo
64bb1b944b * more work on d0i3 power state
* enhancements to the firmware debugging infrastructure
 * support for 2 concurrent channel contexts
 * fixes / cleanups in the rate control
 * general cleanups
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUoq8jAAoJEC0Llv5uNjIBvI8QAKHh50//nq9RELVEbB07fSnn
 MX4+WGYkF1y9AfhqHOCtXi2/97Tw5S3qQXZEhB369nT0b3MdDKI3jJDJPmY5VDoL
 fUZdAh49cZyP+1DZFlGOOjIH2nID5vL8E3Pbe+ZQaEycioDL9nn1wNsdGrrQ7YYJ
 GGLIW8+ast65/VFSuC2h4T5OV/vkkqvrtTcUwhWLEw7IYE5z1PnDP33MPvlAHQtA
 WuG+Iq0Hsb+gBexwcYHytVKkgJc3/7DhJeLIN/tWb+mEn2ygosUpzJm8Z54qzVmr
 W28FvukswwBwMbf5N/FeTvuvG7uaatHo2IcGnTph+j0GXB6IbJbOW+O+OOOjTl4o
 1Gq+H7XtHd8gxqHX1vBljzz406vi5fbrdSeZaFs5YYCkGjYTBv3Xhaa9n6kzGp1k
 I6iB7oPDSUj2E+M0kpalQLpLOYur5I13nt8dV57Hq5rZSdr/SAIdWZapTblLG046
 7mAg+hCuMjN2LODNAFgviqZlhz6EPS8f6DfuVrc5J7j6lyxhH2t8gO3/ZMVR/bU7
 BNrSj7UNpvh0+U0YhxosIboU7AZNlufXuXukk3Q5TFWgQ1SeCzMU87sKAm/si89+
 O6tgIpImHcofV7KDygv3i3ucEg7rzZbW9HAnGHFEuiRbJLZfa3kPwj0ULic+o9bc
 4pISXjv0iPGYq1QUhygB
 =gLE1
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2014-12-30' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* more work on d0i3 power state
* enhancements to the firmware debugging infrastructure
* support for 2 concurrent channel contexts
* fixes / cleanups in the rate control
* general cleanups
2015-01-06 19:36:11 +02:00
Kalle Valo
c702674f99 * fix for 7265D NVM check
* fixes for scan: fix long scanning times and network
 	discovery
 * new firmware API for iwlmvm supported devices
 * fixes in rate control
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJUqlO7AAoJEC0Llv5uNjIBld4P/jZWAsekBIq05qfCLD//SXAN
 3PFlJZmgpQro4TeXlbPidVcU+ufZrCJiDDJ7iPCoipJ8VeJ7R8MBdPAW4IqjBFj1
 j+H0i42p0ak5LnLHosNcx6Ild7GsYWu017hEvWZM8kC3DHJi34/TKfHE9p4BGdFb
 IzvZkN+DH4D9c5NXjSNNXqdr8ru2SKAWU/TRT3PJiprc93PDuXkFwZfRmowl3jF/
 W697P2B8X09NFhNC1zQiAdlDRWImu+U7/R4Zj33TVGTJLXy48fVOL5gwUEmBK6hi
 3Jp4ETwudpddVuM5KkFc9AgVVSQxPn2NVx0b8RwFHgkuFSHJSnYtMNHUlzCEQT5n
 MAg1vvHlzqV5n0YTYfnJelyzgul8uzWmVzLKvkaCpcWHHtnPiAWRWd0j57FYO3O0
 mUaYArHnifHUPtXhl5vEt3haAXYpmp8eQ6Pr0irBvVIcdW85DSudnaI55uF+LRN7
 ig9o/0ARZQYASo6Ypio3w1tSwJEkL4vk9bsvWkCbsVHjqHAkUnutqb89dmP6mH1z
 cmUaSUnE5TK1IBdLLBFsEwzKUFQ+CbW7WGv8DFDiuaHeZzIIDrTHlJwdoaAGkVC2
 8Xla8Nds/6DMwe042pzDyvSG5Ud1dLf1I8Gbg7CywXwZSA8fIa97P9oj7Ta9EH6G
 wFQ4zZGhdgvtW8sHF1JO
 =OVam
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-for-kalle-2015-01-05' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes

* fix for 7265D NVM check
* fixes for scan: fix long scanning times and network
	discovery
* new firmware API for iwlmvm supported devices
* fixes in rate control
2015-01-05 12:07:04 +02:00
Emmanuel Grumbach
91f491fd7d iwlwifi: bump firmware API for mvm devices to 12
This allows 3160 / 7260 / 7265 / 7265D / 8000 devices to
use the latest version of the firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:37 +02:00
David Spinadel
720daf20cc iwlwifi: mvm: scan dwell time corrections
Use only basic dwell time (10 ms for active scan and 110 for passive),
regardless of the number of the probes and the band, if it is
supported by the FW. The FW will add 3 ms for each probe sent and 10
ms for low band channels.
Add a TLV flag to indicate such support in FW.

This fix is needed to fix few bugs regarding scans that take too much time.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:37 +02:00
David Spinadel
7e2a38831d iwlwifi: mvm: add a flag to enable match found notification
Add a flag that enables match found notification to align with
FW API change.

Cc: <stable@vger.kernel.org> [3.17+]
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:36 +02:00
Eyal Shapira
a9dc5060bf iwlwifi: mvm: fix out of bounds access to tid_to_mac80211_ac
When tid_tspec was set to IWL_TID_NON_QOS (8) this led to an
out of bounds access to the tid_to_mac80211_ac array whose size
is 7. Fix this.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:35 +02:00
Eyal Shapira
c93edc6393 iwlwifi: mvm: fix Rx with both chains
commit 5c90422439
"iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it"
broke Rx with 2 chains for diversity.
This had an impact on throughput where we're using only a single
stream (11a/b/g APs, single stream APs, static SMPS).

Fixes: 5c90422439 ("iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it")
Cc: Stable <stable@vger.kernel.org>  [3.16+]
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:34 +02:00
Emmanuel Grumbach
a443f5e16b iwlwifi: 7000: fix reported firmware name for 7265D
We were advertising iwlwifi-7265-X.ucode instead of
iwlwifi-7265D-X.ucode. Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:02:34 +02:00
Arik Nemtsov
2b0e2b0f7b iwlwifi: pcie: correctly define 7265-D cfg
The trans cfg was not replaced for 7265-D cards. This led to a check of
the min-NVM version against a 7265-C card, causing very-old 7265-D cards
to operate incorrectly with the driver.

Fixes: 3fd0d3c170 ("iwlwifi: pcie: support 7265-D devices")
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-05 11:01:41 +02:00
Larry Finger
e9538cf4f9 rtlwifi: Fix error when accessing unmapped memory in skb
These drivers use 9100-byte receive buffers, thus allocating an skb requires
an O(3) memory allocation. Under heavy memory loads and fragmentation, such
a request can fail. Previous versions of the driver have dropped the packet
and reused the old buffer; however, the new version introduced a bug in that
it released the old buffer before trying to allocate a new one. The previous
method is implemented here. The skb is unmapped before any attempt is made to
allocate another.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>  [v3.18]
Reported-by: Eric Biggers <ebiggers3@gmail.com>
Cc: Eric Biggers <ebiggers3@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-05 10:05:44 +02:00
David S. Miller
c2f471f9c3 Changes:
* ath9k: enable Transmit Power Control (TPC) for ar9003 chips
 
 * rtlwifi: cleanup and updates from the vendor driver
 
 * rsi: fix memory leak related to firmware image
 
 * ath: parameter fix for FCC DFS pattern
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQEcBAABAgAGBQJUpqFFAAoJEG4XJFUm622brwUH/iLBBtWvqbhFMKDlA9eUG0hD
 z+LQkPtNR5gLYk11Qne7H8BjILDWgzdQcbyAUEpCnuplDThCDfj+8JB51gfNGpqU
 pv9XwVO2Nf0afh4+hJBkBREI0vAJDod860AG+PV3E5G/WZZyt2MDxF9mk3IbvKVd
 APR7cnUxsAltxjr7IWvPFY43wtbRJHbGM8EUVGkXDBaARaPipTJ7GqhwUyv45jCo
 LRnW0VQ5njMZZD6DfteB9BiE+2GfZF9Ay4aOzRVJGc83NMHDBQxD7VSHVrBBgCt1
 L+Ikz8O0UHG9TsoAGZqEcJ12o2iGWjVFm4TecEYsuhRA1fJmXJOispl/lnudZus=
 =ZbEI
 -----END PGP SIGNATURE-----

Merge tag 'wireless-drivers-next-for-davem-2015-01-02' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Changes:

* ath9k: enable Transmit Power Control (TPC) for ar9003 chips

* rtlwifi: cleanup and updates from the vendor driver

* rsi: fix memory leak related to firmware image

* ath: parameter fix for FCC DFS pattern

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-02 16:40:44 -05:00
Eyal Shapira
834437dab9 iwlwifi: mvm: rs: organize and cleanup consts
Organize and cleanup the consts used by rs.
This is part of making some of these configurable.

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>
2014-12-28 20:16:53 +02:00
Haim Dreyfuss
c3f8d0a3af iwlwifi: mvm: Alter passive scan fragmentation parameters in case of multi-MAC
Make passive scan fragmentation depends on the number of active
interfaces. In case of single-MAC, make passive scan less fragmented.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:13:40 +02:00
Eran Harary
ff29862464 iwlwifi: mvm: call to pcie_apply_destination also on family 8000 B step
In order to config the FW and to allocate monitor buffer driver should
run the function iwl_pcie_apply_destination immediately after FW sections
are loaded.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:13:40 +02:00
Haim Dreyfuss
a1ed402576 iwlwifi: mvm: Configure EBS scan ratio
This configuration defines the ratio between number of scan iterations
where EBS is involved to those where it is not.
This configuration was left unconfigured due to inaccurate documentation.
Fix documentation as well.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:06:14 +02:00
Eliad Peller
d9f1fc209f iwlwifi: mvm: ask the fw to wakeup (from d0i3) on sysassert
Set the wakeup flag (of the d3 command) to configure the fw
to wakeup when sysassert happens while in d0i3.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:05:49 +02:00
Liad Kaufman
b48217670f iwlwifi: tlv: add support for IWL_UCODE_TLV_SDIO_ADMA_ADDR TLV
A new TLV supplies the ADMA address for SDIO mode, allowing
the driver to configure the default base address to be this
(as given in the FW), rather than hardcoding the values to
use until the FW sends the ALIVE message.

Use the value given by the FW in the IWL_UCODE_TLV_SDIO_ADMA_ADDR
TLV for setting the default SDTM base address until the FW sends
the ALIVE message. If it isn't given in the FW - use the current
hardcoded values.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:05:09 +02:00
Johannes Berg
9d8ce6afe1 iwlwifi: mvm: use iwl_mvm_sta_from_mac80211() consistently
A number of places (still) use a direct operation, use
iwl_mvm_sta_from_mac80211() consistently. In one place
also move it into the variable initializer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:04:34 +02:00
Johannes Berg
5b530e95a9 iwlwifi: mvm: use iwl_mvm_vif_from_mac80211() consistently
There are a few places not using it, use it at those places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:04:00 +02:00
Emmanuel Grumbach
a70393fc4e iwlwifi: remove useless extern definition of iwl4265_2ac_sdio_cfg
This device was renamed, but the external definition remained there.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:23 +02:00
Eliad Peller
744cb69564 iwlwifi: mvm: clean refs before stop_device()
Some implementations (i.e. mini_rpm) assume the references
are managed only while the device is started.

Move the stale reference cleanup before stopping the
device in order to make them happy.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:23 +02:00
Julia Lawall
bd9c504bfd iwlwifi: dvm: main: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:22 +02:00
Julia Lawall
c1dc8288fe iwlwifi: dvm: tt: Use setup_timer
Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.data = d;
-t.function = f;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:22 +02:00
Emmanuel Grumbach
2624a5ca76 iwlwifi: mvm: support 2 different channels
The driver and the firmware now support 2 different channels
at the same time. Advertise this capability to the stack.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:21 +02:00
Eliad Peller
37948fcfd0 iwlwifi: mvm: wait for d0i3 exit on hw restart
On hw restart, make sure to wait for d0i3 exit
(by checking the IN_D0I3 status bit).

This is needed in order to avoid the stale
d0i3_exit_work from doing harm (e.g. unref
cleared reference).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:21 +02:00
Eliad Peller
b0677f7133 iwlwifi: mvm: consider d0i3_disable in iwl_mvm_is_d0i3_supported()
Consider the iwlwifi module param d0i3_disable when
considering whether d0i3 is supported.

(There is currently no need to differentiate between
supported and enabled, so keep the function as-is)

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:20 +02:00
Eliad Peller
6735943faf iwlwifi: mvm: support IWL_D0I3_MODE_ON_SUSPEND d0i3 mode
Enter d0i3 on suspend, and exit d0i3. Wait for the
command responses in both cases.

Use this mode in case of pcie trans.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:20 +02:00
Eliad Peller
0f8f93d6c8 iwlwifi: support multiple d0i3 modes
Allow configuring additional d0i3 mode, in which the
fw will be configured to enter d0i3 only on suspend
(while keeping the wake_lock accounting as usual)

The d0i3 mode to use will be determined by the
underlying trans layer.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:19 +02:00
Eliad Peller
9174244947 iwlwifi: mvm: allow both d0i3 and d3 wowlan configuration modes
d3 and d0i3 shouldn't be mutually exclusive. Set supported
wowlan triggers by looking for each of them, and check
on suspend/resume which flow should be used ("any" trigger
is supported by d0i3, and all the others by d3)

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:19 +02:00
Eliad Peller
7616f334e6 iwlwifi: pcie: add basic reference accounting
Implement the ref/unref trans ops and track both tx and
host command queues (and hold references while they
are not empty).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:18 +02:00
Emmanuel Grumbach
a549b29622 iwlwifi: mvm: convert the SRAM dump to the generic memory dump
This allows to add the offset. The type of the generic
memory dump will let the parser know that this is SRAM.

Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:17 +02:00
Emmanuel Grumbach
e06d8437cd iwlwifi: mvm: change SMEM dump to general purpose memory dump
Instead of adding a dump type for each type of memory, change
the SMEM type to be a general purpose memory dump. Add the
type of the memory and its offset in the device in the dump
itself. This will allow an external parser to know where
this memory came from.

Note that since this type isn't really in use yet, this is
not a real problem.

Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:17 +02:00
Liad Kaufman
addfaada8f iwlwifi: mvm: add smem content to dump data
In NICs that have SMEM - add its content to the dump data
for later debug.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:16 +02:00
Eran Harary
363039be5b iwlwifi: mvm: support additional nvm_file in family 8000 B step
nvm_file in family 8000 B step and A step differ. This means
that the driver should support 2 file name as default.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:16 +02:00
Eyal Shapira
6a028d9a26 iwlwifi: mvm: rs: fix max rate allowed if no rate is allowed
In case the rate mask for one of the modulations was zero the
max rate idx for that modulation was set to 32 (BITS_PER_LONG).
This is bad as it would later lead to an out of bounds access
to the expected tpt table. In most cases there was no real effect
as the expected tpt was set to 0 and this led to avoiding the
modulation effectively.
Fix the out of bounds access and explicitly skip the modulation
in case there's no rate allowed in it.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:15 +02:00
Luciano Coelho
19789abbe5 iwlwifi: mvm: clear tt values when entering CT-kill
Clear the thermal throttling values when entering CT-kill, since
everything will be reinitialized anyway when we exit CT-kill.

Additionally, clear the dynamic_smps value in the initialization
funciton, for consistency.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:15 +02:00
Ido Yariv
435da2ce52 iwlwifi: mvm: Set the HW step in the core dump
The HW step member was left out of the core dump information. Fix this.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:14 +02:00
Emmanuel Grumbach
f1a6854242 iwlwifi: mvm: allow RSSI compensation
The firmware is able to compensate the rssi when we hear
the frame on a different channel.
This is true for an offset up to 3 channels.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:14 +02:00
Emmanuel Grumbach
8c23f95cca iwlwifi: mvm: add debugfs to trigger fw debug logs collection
This allows to collect the logs even if the firmware hasn't
crashed. Of course, crashing the firmware is an option, but
this is easier and nicer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:13 +02:00
Emmanuel Grumbach
b7aaeae478 iwlwifi: pcie: let the Manageability Engine know when we leave
When the driver is unload, the Manageability Engine should
know about that - send an event to inform it about this
event.

Reviewed-by: Reuven Borok <reuven.borok@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:13 +02:00
Moshe Harel
a054427244 iwlwifi: mvm: support LnP 1x1 antenna configuration
The antenna configuration has to be read also from OTP
Currently read only from FW image
Guideline: An antenna exists only if appears both in FW image & NVM

Signed-off-by: Moshe Harel <moshe.harel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 20:00:12 +02:00
Dor Shaish
7074cc4280 Revert "iwlwifi: use correct fw file in 8000 b-step"
Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 19:59:51 +02:00
Liad Kaufman
f53bf4c758 iwlwifi: mvm: add fw runtime stack to dump data
The allocation of the DCCM between the data and the stack
can theoretically change without notice to the driver, but
the total size is HW-fixed. Since the stack CCM (runtime
stack) has also data important to the FW - this patch allows
pulling the whole DCCM in one piece and adds it to the dump
data.

If the size isn't known - just use the data part of the
DCCM as it appears in the FW TLVs.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 10:17:41 +02:00
Johannes Berg
e32ec12fd1 iwlwifi: remove MODULE_VERSION
The module version "in-tree:" or "in-tree:d" is useless; there
should be better (functional) ways to detect whether debugging
is enabled and other than that the version says nothing.

Therefore remove the driver version completely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28 10:17:40 +02:00
Lorenzo Bianconi
354f473ee2 ath9k: fix typo
Fix typo

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 19:14:44 +02:00
Lorenzo Bianconi
8718389b1c ath9k: add debugfs support for hw TPC
Add tpc entry to ath9k debugfs in order to enable/disable hw TPC

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 19:14:27 +02:00
Lorenzo Bianconi
a9abe3023a ath9k: enable TPC by default
Enable hw TPC by default on AR9003 based chips

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 19:13:55 +02:00
Rickard Strandqvist
b30b2e0f3d rtlwifi: rtl8723be: phy.c: Remove unused function
Remove the function rtl8723be_phy_get_txpower_level() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:58:48 +02:00
Rickard Strandqvist
9898b77536 rtlwifi: rtl8192ee: trx.c: Remove unused function
Remove the function rtl92ee_get_available_desc() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:54:13 +02:00
Larry Finger
fd3cb22ad8 rtlwifi: rtl8821ae: Switch to use common rate control routine
With this change, all of the drivers now use the common routine. As this
driver has VHT capability, an additional parameter is needed, thus all the
drivers had to be modified.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:34:29 +02:00
Larry Finger
a160ba06c1 rtlwifi: rtl8192de: Rework calls to rate-control routine
The code uses macros to determine the parameters that are passed to the
rate setting routine. A simpler method is implemented.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:33:55 +02:00
Larry Finger
6a7fd77707 rtlwifi: rtl8192cu: Rework calls to rate-control routine
The code uses macros to determine the parameters that are passed to the
rate setting routine. A simpler method is implemented.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:33:33 +02:00
Larry Finger
5a0791d0f5 rtlwifi: rtl8821ae: Add VHT rate descriptors
Device RTL8821AE is the first if the rtlwifi devices to implement 802.11ac
capability. As a result, VHT rate descriptors are needed. In addition, the
driver is converted to use the descriptors in rtlwifi.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:33:05 +02:00
Larry Finger
e0e776a3c8 rtlwifi: Convert all drivers to use a common set of rate descriptors
This common set of rate descriptors is renamed to be DESC_RATExx.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:32:39 +02:00
Larry Finger
7b7d0d60a5 rtlwifi: rtl8192ee: Convert driver to use common rate-mapping code
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:32:09 +02:00
Larry Finger
8d3fc3a64b rtlwifi: rtl8723ae: Modify driver to use rate-mapping routine in core
This driver is also converted to use the rate-mapping code in the core.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:31:52 +02:00
Larry Finger
5b243feff3 rtlwifi: rtl8188ee: Switch to use common rate-mapping routine
This driver duplicates a routine found in the core.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:31:33 +02:00
Larry Finger
7e0dde9248 rtlwifi: rtl8723be: Switch to use common rate-mapping routine
This driver currently has its owm version of this routine that duplicates
a routine in rtlwifi.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:31:13 +02:00
Larry Finger
f1f21770b1 rtlwifi: Remove extraneous argument for rate mapping
Four of the drivers (92ce, 92cu, 92de, and 92se) supply an argument to the
rate-mapping routine that is never used, thus it can be removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:30:54 +02:00
Larry Finger
99057920a2 rtlwifi: rtl8192ce: Improve RF sleep routine
These changes match those of the latest vendor driver.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:30:27 +02:00
Larry Finger
ff6ee6b0ce rtlwifi: rtl8192ce: Update rate setting routines
These changes were found in the latest vendor driver.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:30:12 +02:00
Larry Finger
9d62c5531b rtlwifi: rtl8192ce: Update setting of the media status
This patch applies changes found in the latest vendor driver.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:29:49 +02:00
Larry Finger
1ed03272b5 rtlwifi: rtl8192ce: Add code to set the keep-alive operation
This change helps the device maintain a connection.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:29:32 +02:00
Larry Finger
f091282fd3 rtlwifi: rtl8821ae: Fix typos in power-sequence macro
Two of the macros that control power sequencing have values to be set that
contain bits that are not covered by the associated mask.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:29:12 +02:00
Troy Tan
fe89707f0a rtlwifi: rtl8821ae: Simplify loading of WOWLAN firmware
The existing method for loading both normal and WOWLAN firmware for the
device duplicates a lot of code. This solution is much cleaner.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 18:28:56 +02:00
Peter Oh
a844bae38b ath: fix incorrect PPB on FCC radar type 5
The minimum number of pulses per burst on FCC radar type 5 is 1.
Use this number for correct radar detection.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 17:28:28 +02:00
Alexey Khoroshilov
eae79b4f3e rsi: fix memory leak in rsi_load_ta_instructions()
Memory allocated by kmemdup() in rsi_load_ta_instructions() is leaked.
But duplication of firmware data here is useless,
so the patch removes kmemdup() at all.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 17:26:08 +02:00
Rickard Strandqvist
18e0c0bf3a rtlwifi: rtl8192de: fw.c: Remove unused function
Remove the function rtl92d_set_fw_pwrmode_cmd() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 17:13:57 +02:00
Mika Westerberg
8975842bed brcmfmac: Do not crash if platform data is not populated
The driver looks for pdata->oob_irq_supported to find out if wowl can be
supported. However, not all platforms populate pdata in which case we crash
the kernel because of NULL pointer dereference.

Fixes: 330b4e4be9 ("brcmfmac: Add wowl support for SDIO devices.")
Reported-by: Christophe Prigent <christophe.prigent@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-24 15:26:46 +02:00