summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
AgeCommit message (Collapse)Author
2015-10-05iwlwifi: dvm: fix D3 firmware PN programmingJohannes Berg
The code to send the RX PN data (for each TID) to the firmware has a devastating bug: it overwrites the data for TID 0 with all the TID data, leaving the remaining TIDs zeroed. This will allow replays to actually be accepted by the firmware, which could allow waking up the system. Cc: <stable@vger.kernel.org> [3.1+] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: fix D3 CCMP TX PN assignmentJohannes Berg
When going into/coming out of D3, the TX PN must be programmed into and restored from the firmware respectively. The restore was broken due to my previous commit to move PN assignment into the driver. Sending the PN to the firmware still worked since we now use the counter that's shared with mac80211, but accessing it through the mac80211 API makes no sense now. Fix this by reading/writing the counter directly. This actually simplifies the code since we don't need to round-trip through the key_seq structure. Fixes: ca8c0f4bede6 ("iwlwifi: mvm: move TX PN assignment for CCMP to the driver") Cc: <stable@vger.kernel.org> [4.1+] Reported-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: fix tof.h header guardNicolas Iooss
Commit ce7929186a39 ("iwlwifi: mvm: add basic Time of Flight (802.11mc FTM) support") created drivers/net/wireless/iwlwifi/mvm/tof.h with a broken header guard: #ifndef __tof #define __tof_h__ ... #endif /* __tof_h__ */ Use __tof_h__ in the first line. Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: Correctly update MAC context on add/del stationIlan Peer
Commit "iwlwifi: mvm: don't ask beacons when AP vif and no assoc sta" directly called iwl_mvm_mac_ctxt_cmd_ap() to update the MAC context when adding/removing a station. However, this ignores the case that the vif is actually a P2P GO. Fix this by calling iwl_mvm_mac_ctxt_changed() that handles P2P GO case as well. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: fix default disabled aggs in staLiad Kaufman
For the ADD_STA command, when the flag for aggregation disabling is set, there is a bitmap indicated what TIDs are disabling aggregations and what aren't. Currently, by default, all TIDs allow for aggregations since the value we begin with is 0. Change this default value to 0xffff so all TIDs don't allow aggregations until explicitly turned on. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: enable tracing by defaultJohannes Berg
Tracing, if disabled at runtime, has very low overhead with great returns on debugging. It therefore makes sense to have it enabled by default (if the kernel enables EVENT_TRACING). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: correct skip-over-DTIM implementationJohannes Berg
The formula used in D0i3 should also be used in D3, instead of the hardcoded value. Additionally, the formula is actually wrong - if the calculation yields 0 then 1 should be used instead of disabling entirely. Also need to add 1 since the firmware needs 3 to skip 2, etc. To make all this clearer, centralize the calculation into a single function. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: nvm: force 1x1 antenna in Series 8000Moshe Harel
This is a workaround to an OTP bug. In Series 8000 1x1, the OTP 0xA052 defines 2x2 antenna configuration. This workaround overrides the decision based on HW id and MIMO disabled bit which is correct in the OTP and set to disabled. Signed-off-by: Moshe Harel <moshe.harel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: move DTS command and notification to new groupAviya Erenfeld
Move the DTS measurement command and notification from short command header to the new PHY command group for firmware supporting the extended command headers. Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-04debugfs: Pass bool pointer to debugfs_create_bool()Viresh Kumar
Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument, when all it needs is a boolean pointer. It would be better to update this API to make it accept 'bool *' instead, as that will make it more consistent and often more convenient. Over that bool takes just a byte. That required updates to all user sites as well, in the same commit updating the API. regmap core was also using debugfs_{read|write}_file_bool(), directly and variable types were updated for that to be bool as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-22mac80211: allow to transmit A-MSDU within A-MPDUEmmanuel Grumbach
Advertise the capability to send A-MSDU within A-MPDU in the AddBA request sent by mac80211. Let the driver know about the peer's capabilities. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-09-21iwlwifi: mvm: add debug print for d0i3 exit indicationEliad Peller
In order to verify d0i3 flow, add debug print to indicate d0i3 exit was completed (right after tx was re-enabled), along with the wakeup reasons. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: configure wowlan configuration only if connectedEliad Peller
Recent fw version added assert to make sure wowlan configuration is configured only when a station is connected. Change the driver behavior to pass this configuration only if we indeed have ap station id (i.e. connected). Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: move RX API into its own fileJohannes Berg
The RX API is currently mixed up into the general fw-api.h file, but we're going to need to extend it significantly in the future, so move it to its own file. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove some unused defines from RX APIJohannes Berg
Remove some unused values from the RX API; these were used with older firmware API that didn't have the RX energy API, support for which was removed a long time ago. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove pointless cfg_phy_cnt length checkJohannes Berg
Since the driver can never configure the data here, this field will always be reported as 0 by the firmware. Even if this was not the case, however, it wouldn't matter since the extra data would be added beyond the end of the phy_info structure we use in the driver, so wouldn't harm anything in this code either. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove useless debug message from RXJohannes Berg
This message is useless - it's in the good case that always happens so enabling it doesn't really help. Just remove it. There are other ways to debug this (e.g. tracing) so there's no need to add a message in the bad case. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: make sure AP is operating for ToFJohannes Berg
It's possible for an AP interface to be UP but not actually operating (i.e. not beaconing etc.) - in this case it can't actually do ToF, so check for it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove IWL_UCODE_TLV_API_STATS_V10 TLV flagEmmanuel Grumbach
This flag is set in all supported firmwares. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove IWL_UCODE_TLV_API_ASYNC_DTM TLV flagEmmanuel Grumbach
This flag is set in all supported firmwares. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove IWL_UCODE_TLV_API_SINGLE_SCAN_EBS TLV flagEmmanuel Grumbach
All the supported firmwares have this flag set. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove IWL_UCODE_TLV_API_TX_POWER_DEV TLV flagEmmanuel Grumbach
All the supported firmwares use the new API. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21iwlwifi: mvm: remove IWL_UCODE_TLV_API_HDC_PHASE_0 TLV flagEmmanuel Grumbach
All the supported firwmares support the new API. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: remove SCD_QUEUE_CONFIG TLV flagLiad Kaufman
We don't support firmwares that don't use the new API. This also allows to use all the SCD queues, so increase the reported number of queues to 31. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: don't load -12.ucode anymoreEmmanuel Grumbach
-13.ucode has been published long ago. Deprecate old versions of the firmware. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: don't NUL-terminate low-latency debugfs fileJohannes Berg
There's obviously no reason to write a NUL-terminating byte into the debugfs file. Apparently nobody tried to use this from a tool that doesn't strip NUL bytes though, so we never noticed. Fix it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: make sure d0i3 exit work runs before suspendingLuciano Coelho
If we are in d0i3 when entering suspend, we leave d0i3 so that mac80211 can call us to remove connections or whatever before going to suspend. We do this by calling pm_runtime_resume() early in the slave transport flow and reactivating it later, when the wiphy suspend flow runs. The problem is that we queue a work in order to leave d0i3. If this work hasn't run yet when the wiphy suspend flow is called, we have a race and entering d0i3 fails (because we're still holding the IWL_MVM_REF_EXIT_WORK reference). To solve this, simply flush the d0i3_exit_work at the beginning of the iwl_mvm_suspend() function. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: don't ask for beacons when AP vif and no assoc staGregory Greenman
When in AP mode, we need beacons from other APs for HT protection. However, when there's no any associated station we will not do any Tx and thus don't really need beacons. On the other hand, these beacons will cause a lot of unnecessary wakeups which increase our power consumption. Handle this by asking FW to pass beacons only when there's at least one associated station. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: Deinline iwl_{read,write}(8,32}Emmanuel Grumbach
With CONFIG_IWLWIFI_DEVICE_TRACING=y, these functions are rather large, too big for inlining. With this .config: http://busybox.net/~vda/kernel_config, after uninlining these functions have sizes and callsite counts as follows: iwl_read32 475 bytes, 51 callsites iwl_write32 477 bytes, 90 callsites iwl_write8 493 bytes, 3 callsites Reduction in size is about 74,000 bytes: text data bss dec hex filename 90758147 17226024 36659200 144643371 89f152b vmlinux0 90687995 17221928 36659200 144569123 89df323 vmlinux.after Reported-by: Denys Vlasenko <dvlasenk@redhat.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: add debugfs hook to send ECHO_CMD to the firmwareEmmanuel Grumbach
ECHO_CMD is a simple command that can be sent to the firmware just to check that it is alive. This command is useful for debug purpose, provide a debugfs hook to send it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: fix statistics variables typeSara Sharon
When receiving statistics notification there is a field of average energy. This is defines as signed 8 bit, while FW refers to it as unsigned. when the energy is higher than 127 this causes in iwl_mvm_stat_iterator a wrong computation of the signal int sig = -stats->general.beacon_filter_average_energy; resulting in incorrect CQM event (change from low to high). While at it - update the rest of the fields to the correct type. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28iwlwifi: mvm: remove netdetect debugfs entryLuciano Coelho
This debugfs entry was implemented just as a proof-of-concept before the full support for netdetect via cfg80211/mac80211 was implemented. Now that we have a proper way to enable netdetect from userspace, this entry is redundant and should be removed to avoid unnecessary maintenance work. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-23iwlwifi: mvm: bump firmware API to 17Emmanuel Grumbach
The driver is now able to handle -17.ucode. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-23iwlwifi: mvm: support new TX power commandJohannes Berg
Add support for the new (bigger) TX power command. This doesn't actually take advantage of the new capabilities (to set per-chain TX power limits) but makes the code compatible with newer firmware images expecting the larger command. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-23iwlwifi: mvm: split debug message to avoid exceeding 110 charactersAyala Beker
split long debug messages that may result warning in tracing. Fixes: 1a84e7716086 ("iwlwifi: mvm: add debug info to schedule scan complete message.") Signed-off-by: Ayala Beker <ayala.beker@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-23iwlwifi: correctly size command string arraysJohannes Berg
The command string array is assumed to be indexable by a full u8, so it must have 256 entries (0-255), not just 255. A recent firmware change (apparently) started using the command 0xff for a notification to the host, causing the driver to crash in debug message/tracing code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-23iwlwifi: mvm: update wakeup reason enumSara Sharon
when waking from d0i3 there is a wakeup reason. Enum in driver is not up to date with FW api - fix it. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-23iwlwifi: mvm: catch underflow error earlierDan Carpenter
My static checker complains that we don't check for underflows in iwl_dbgfs_fw_dbg_conf_write(). This is harmless because we have a sanity check in iwl_mvm_start_fw_dbg_conf(), but we may as well make this unsigned and silence the underflow warning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-18iwlwifi: mvm: fix a race in D0i3 vs. Tx pathEmmanuel Grumbach
When we enter D0i3, we must stop TXing otherwise the sequence number we use might conflict with the firmware's internal TX. In order to do so, we have IWL_MVM_STATUS_IN_D0I3 which should prevent any Tx while we enter D0i3. There is a bug in this code since we may Tx even if IWL_MVM_STATUS_IN_D0I3 is set. This can happen as long as mvm->d0i3_ap_sta_id is not set. To make sure that we don't have any packet in the Tx path while we set mvm->d0i3_ap_sta_id, call synchronize_net only after we already set mvm->d0i3_ap_sta_id. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-18iwlwifi: mvm: don't disconnect on beacon loss in D0I3David Spinadel
Currently if we wake up during D0I3 due to beacon loss we disconnect immediately. This behaviour causes redundant disconnection, which could be prevented by polling as it is usually done in mac80211. Instead, we prefer reporting beacon loss and let mac80211 try polling before disconnection. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-18iwlwifi: out-of-bounds access in iwl_init_sband_channelsAdrien Schildknecht
KASan error report: ================================================================== BUG: KASan: out of bounds access in iwl_init_sband_channels+0x207/0x260 [iwlwifi] at addr ffff8800c2d0aac8 Read of size 4 by task modprobe/329 ================================================================== Both loops of this function compare data from the 'chan' array and then check if the index is valid. The 2 conditions should be inverted to avoid an out-of-bounds access. Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-18iwlwifi: bump mvm firmware API to 16Emmanuel Grumbach
The driver is now able to handle -16.ucode. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-18iwlwifi: rs: disable MIMO only if allowed in configurationAlexander Bondar
Fix bug where MIMO is disabled for low latency TX on P2P VIF regardless of configuration. Make it dependent on IWL_MVM_RS_DISABLE_P2P_MIMO compilation option. Change configuration so that MIMO will be disabled only in SDIO platforms. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16iwlwifi: mvm: Enable power management on low-latency bssAvri Altman
Currently the driver disable power management on all low-latency interfaces, while it should disable it on WiDi interfaces only. Non-P2P interfaces that runs voice and video traffic should enable power management. Signed-off-by: Avri Altman <avri.altman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16iwlwifi: mvm: support TDLS wider-bandwidthArik Nemtsov
When TDLS support is declared by the FW, set the bit indicating wider-BW support as well. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16iwlwifi: mvm: fix a range check in debugfs codeDan Carpenter
The &mvm->tof_data.range_req.ap[] array has IWL_MVM_TOF_MAX_APS elements so the check should be >= instead of >. Also the test can underflow so I have changed "i" to unsigned. Fixes: ce7929186a39 ('wlwifi: mvm: add basic Time of Flight (802.11mc FTM) support') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16iwlwifi: convert hex_dump_to_buffer() to %*phAndy Shevchenko
There is no need to use hex_dump_to_buffer() in the cases like this: hexdump_to_buffer(buf, len, 16, 1, outbuf, outlen, false); /* len <= 16 */ sprintf("%s\n", outbuf); since it maybe easily converted to simple: sprintf("%*ph\n", len, buf); Note: it seems in one case the output is groupped by 2 bytes and looks like a typo. Thus, patch changes that to plain byte stream. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16iwlwifi: pass NAPI struct from transport layerJohannes Berg
The mac80211 patch to pass the NAPI struct only changed iwlwifi to store the NAPI struct, but we can do better: pass it directly from the lower transport layer to the opmode during RX, and then on to mac80211 from there. When we add multiple RX queues, we can then pass the appropriate NAPI struct properly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-08-16Merge tag 'mac80211-next-for-davem-2015-08-14' into nextEmmanuel Grumbach
Another pull request for the next cycle, this time with quite a bit of content: * mesh fixes/improvements from Alexis, Bob, Chun-Yeow and Jesse * TDLS higher bandwidth support (Arik) * OCB fixes from Bertold Van den Bergh * suspend/resume fixes from Eliad * dynamic SMPS support for minstrel-HT (Krishna Chaitanya) * VHT bitrate mask support (Lorenzo Bianconi) * better regulatory support for 5/10 MHz channels (Matthias May) * basic support for MU-MIMO to avoid the multi-vif issue (Sara Sharon) along with a number of other cleanups.
2015-08-16iwlwifi: mvm: add debug info to schedule scan complete message.Ayala Beker
Add more information to schedule scan complete message. Signed-off-by: Ayala Beker <ayala.beker@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>