Commit Graph

4303 Commits

Author SHA1 Message Date
John W. Linville 3e3cb6caea Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes 2014-03-14 14:33:19 -04:00
Emmanuel Grumbach 82e5a64945 iwlwifi: dvm: take mutex when sending SYNC BT config command
There is a flow in which we send the host command in SYNC
mode, but we don't take priv->mutex.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1046495

Cc: <stable@vger.kernel.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-03-11 13:15:16 +02:00
John W. Linville f3b6a488a6 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	drivers/net/wireless/ath/ath9k/recv.c
	drivers/net/wireless/mwifiex/pcie.c
2014-03-04 13:05:12 -05:00
Oren Givon acfcd9ed58 iwlwifi: fix and add 7265 series HW IDs
Update of the HW IDs for the 7265 series.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-03-04 19:30:06 +02:00
Emmanuel Grumbach 1e9291996c iwlwifi: mvm: don't WARN when statistics are handled late
Since the statistics handler is asynchrous, it can very well
be that we will handle the statistics (hence the RSSI
fluctuation) when we already disassociated.
Don't WARN on this case.

This solves: https://bugzilla.redhat.com/show_bug.cgi?id=1071998

Cc: <stable@vger.kernel.org> [3.10+]
Fixes: 2b76ef1308 ("iwlwifi: mvm: implement reduced Tx power")
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-03-04 19:27:37 +02:00
Johannes Berg 143582c684 iwlwifi: fix TX status for aggregated packets
Only the first packet is currently handled correctly, but then
all others are assumed to have failed which is problematic. Fix
this, marking them all successful instead (since if they're not
then the firmware will have transmitted them as single frames.)

This fixes the lost packet reporting.

Also do a tiny variable scoping cleanup.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[Add the dvm part]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-27 10:28:03 +02:00
Max Stepanov e7eb65cac0 iwlwifi: mvm: change of listen interval from 70 to 10
Some APs reject STA association request if a listen interval value exceeds
a threshold of 10. Thus, for example, Cisco APs may deny STA associations
returning status code 12 (Association denied due to reason outside the scope
of 802.11 standard) in the association response frame.

Fixing the issue by setting the default IWL_CONN_MAX_LISTEN_INTERVAL value
from 70 to 10.

Cc: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-27 08:59:27 +02:00
John W. Linville 0971f7d991 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 2014-02-24 15:05:42 -05:00
Eliad Peller 82b715c211 iwlwifi: mvm: fix a few wd_disable comments
Few minor comments.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-23 21:38:54 +02:00
Eran Harary a2978b1162 iwlwifi: mvm: prepare infrastructure for more TLV flags
We use the TLV flags as a handshake between the firmware
and the driver. These flags allow the firmware to advertise
its capabilities and API version.
Since we are running short of bits, we add a new
infrastructure which is more scalable, yet backward
compatible.

We make now the difference between API changes and the
capabilities. Both can have an index which allows to scale
at will.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-23 21:32:22 +02:00
Inbal Hacohen d6cb37a359 iwlwifi: mvm: remove redundant define in fw.c
This define is a leftover from dvm (in mvm, it
was replaced by MVM_UCODE_ALIVE_TIMEOUT).

Signed-off-by: Inbal Hacohen <Inbal.Hacohen@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-23 19:27:27 +02:00
Johannes Berg fde73834ea iwlwifi: nvm: remove reading valid antennas from NVM
These values aren't used as the firmware values should be used,
so reading them is pointless and hides potential errors when
somebody uses these values. Leave them zero to make it clearer
that they can't be used. We can't remove the struct members as
the DVM driver does read the values from EEPROM/OTP and the
structure is shared between drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-23 19:27:26 +02:00
Eyal Shapira 5fc0f76c43 iwlwifi: mvm: add Rx frames statistics via debugfs
Collect statistics regarding rates and aggregations in Rx
frames and export the data via debugfs.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-20 19:22:12 +02:00
Emmanuel Grumbach 1f6bf0786e iwlwifi: mvm: set immediate apply time bit in time events
Newer firmware support a new bit in the policy  that allows
to request to apply the time event immediately. Add this bit
without removing the workarounds we used until now to support
older firmares.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-20 19:19:33 +02:00
Emmanuel Grumbach cfadc3ffcc iwlwifi: pcie: stop the firmware when we restart it
In case the firmware didn't assert but we want to restart
it, e.g. we didn't get the reply for a host command, or the
Tx queues are stuck, we should stop the firmware by
provoking an interrupt. This allows to better debug the
firmware in these bad scenarios.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-20 19:19:14 +02:00
Eytan Lifshitz 1270c416e1 iwlwifi: mvm: fix possible memory leak
iwl_parse_nvm_data() doesn't free allocated memory if it is
fed with invalid parameter. Fix this.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-20 19:18:04 +02:00
Emmanuel Grumbach ec6f678c74 iwlwifi: dvm: clear IWL_STA_UCODE_INPROGRESS when assoc fails
We set IWL_STA_UCODE_INPROGRESS flag when we add a station
and clear it when we send the LQ command for it. But the LQ
command is sent only when the association succeeds.
If the association doesn't succeed, we would leave this flag
set and that wouldn't indicate the station entry as vacant.

This probably fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1065663

Cc: <stable@vger.kernel.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-20 19:16:27 +02:00
Johannes Berg 37e3308cb2 mac80211: allow driver to return error from sched_scan_stop
In order to solve races with sched_scan_stop, it is necessary
for the driver to be able to return an error to propagate that
to cfg80211 so it doesn't send an event.

Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-20 16:09:54 +01:00
John W. Linville 0e028ab0fb Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2014-02-13 14:43:02 -05:00
Emmanuel Grumbach 205e2210da iwlwifi: disable TX AMPDU by default for iwldvm
NICs supported by iwldvm don't handle well TX AMPDU.
Disable it by default, still leave the possibility to
the user to force enable it with a debug parameter.

NICs supported by iwlmvm don't suffer from the same issue,
leave TX AMPDU enabled by default for these.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 15:24:35 +02:00
Emmanuel Grumbach ffa702647c iwlwifi: mvm: don't dump log of second CPU when not relevant
The new API for ALIVE notification was misunderstood.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 13:51:27 +02:00
Johannes Berg 4ed735e759 iwlwifi: remove iwl_fw_valid_(tx|rx)_ant inlines
These inlines are pretty pointless now as they just return a
fixed struct value, remove them - the code even gets shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 13:49:44 +02:00
Eran Harary 77db0a3c27 iwlwifi: mvm: new NVM format in family 8000
Support the changes below:
- Fields and sections structure were changed.
- the NVM file built from DWord instead of Words.
- sections header format was changed.

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-02-13 13:49:37 +02:00
Alexander Bondar 7303dd7f31 iwlwifi: mvm: Enable power save on BSS and P2P client in DCM
New FW enables support for power save on BSS and P2P client MACs
simultaneously when they function on different channels (DCM).
Enable this case in the driver after examining new TLV flag -
IWL_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM. Still power management is not
allowed on both MACs if they function on a same channel.
Remove another redundant TLV flag - IWL_UCODE_TLV_FLAGS_P2P_PS that
is not in use anymore. Remove bound_vif_cnt as redundant.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 13:45:12 +02:00
Eliad Peller f3c221f6ea iwlwifi: mvm: add debugfs for prph reg read/write
Allow reading/writing prph registers.

The address is set in the first argument
of the write operation. second argument
is optional and can be used for writing.

e.g.
echo '0xA01234 0x99' > /sys/kernel/debug/ieee80211/phy0/iwlwifi/iwlmvm/prph_reg
will write 0x99 into reg 0xA01234

cat /sys/kernel/debug/ieee80211/phy0/iwlwifi/iwlmvm/prph_reg
will show its current value (probably 0x99)

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-02-13 13:45:11 +02:00
Johannes Berg 63f7535d6e iwlwifi: mvm: use IEEE80211_TX_CTRL_PORT_CTRL_PROTO flag
Instead of checking the SKB protocol against EAP, check the
IEEE80211_TX_CTRL_PORT_CTRL_PROTO flag that more generally
indicates whether or not the frame is a port control frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 10:27:24 +02:00
Emmanuel Grumbach 7b1dd048b5 iwlwifi: mvm: propagate LDPC / STBC status to radiotap
This will allow to get sniffer captures with correct
settings for these HT / VHT capabilities.
Also set the corresponding HAVE_MCS / VHT_KNOWN bits in
the registration to mac80211.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 10:27:24 +02:00
Johannes Berg e5209263df iwlwifi: make various things const
There are a number of things in the .data section that should
really be in .rodata, for example all ops structs and strings.
Mark everything const that can be, leaving the .data section
pretty much empty.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 10:18:43 +02:00
Eliad Peller 5045388cee iwlwifi: pcie: clean iwl_pcie_[rt]xq_inc_wr_ptr a bit
The various code blocks in iwl_pcie_[rt]xq_inc_wr_ptr
finally do the same things, so just merge them
all and make the functions cleaner.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-13 10:16:19 +02:00
John W. Linville 841577c3d3 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2014-02-12 15:24:14 -05:00
Ariej Marjieh 3281bd4c43 iwlwifi: change number of PAPD groups in PHY DB
The number of the PAPD group was increased in new devices.
Since we might now get empty entries on older devices, don't
warn if an entry is empty.

Signed-off-by: Ariej Marjieh <ariej.marjieh@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:12:26 +02:00
Eran Harary 01a9ca510b iwlwifi: mvm: support alive notification api version2
Alive notification ver2 support error table information
for 2 CPUs.
This is useful to fetch the error information in case of
firmware assert.

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-02-06 21:12:26 +02:00
Ariej Marjieh 9d91356bdc iwlwifi: 8000: add 11n only SKU of 8000 devices
The 8000 family includes devices that don't support 11ac.
Add an iwl_cfg structure for them.

Signed-off-by: Ariej Marjieh <ariej.marjieh@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:11:30 +02:00
Ariej Marjieh 15ef413792 iwlwifi: mvm: remove upper limit for error log base pointer
Newer NIC have different memory layout in their SRAM,
so change the checks in iwl_mvm_dump_nic_error_log
accordingly.

Signed-off-by: Ariej Marjieh <ariej.marjieh@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:11:22 +02:00
Ilan Peer 2c3e62a148 iwlwifi: mvm: modify the tsf_id master/slave logic
For TSF master/slave synchronization, the FW does not require
exact match in the beacon interval between the master interface
and the slave one, but instead requires that the beacon interval
of one interface is the module of the other.

Modify the tsf_id selection to align with the above.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:11:21 +02:00
Eliad Peller b92e661b40 iwlwifi: mvm: reserve sta_id 0 to station
The d3/d0i3 fw code requires the sta_id to be 0
(this is used to determine the rates and keys
to use in arp offloading).

Reserve sta_id 0 to station interface in order
to comply with this requirement.

Change some functions prototypes in order to
make the allocation function know about
the interface type.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:11:21 +02:00
Emmanuel Grumbach b800040db5 iwlwifi: mvm: fix typo in WARNING in rs.c
The current WARNING isn't very helpful.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-06 21:02:23 +02:00
Emmanuel Grumbach 1b8d242adb mac80211: move VHT related RX_FLAG to another variable
ieee80211_rx_status.flags is full. Define a new vht_flag
variable to be able to set more VHT related flags and make
room in flags.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath10k]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-06 09:34:10 +01:00
Johannes Berg ea73cbce4e nl80211: fix scheduled scan RSSI matchset attribute confusion
The scheduled scan matchsets were intended to be a list of filters,
with the found BSS having to pass at least one of them to be passed
to the host. When the RSSI attribute was added, however, this was
broken and currently wpa_supplicant adds that attribute in its own
matchset; however, it doesn't intend that to mean that anything
that passes the RSSI filter should be passed to the host, instead
it wants it to mean that everything needs to also have higher RSSI.

This is semantically problematic because we have a list of filters
like [ SSID1, SSID2, SSID3, RSSI ] with no real indication which
one should be OR'ed and which one AND'ed.

To fix this, move the RSSI filter attribute into each matchset. As
we need to stay backward compatible, treat a matchset with only the
RSSI attribute as a "default RSSI filter" for all other matchsets,
but only if there are other matchsets (an RSSI-only matchset by
itself is still desirable.)

To make driver implementation easier, keep a global min_rssi_thold
for the entire request as well. The only affected driver is ath6kl.

I found this when I looked into the code after Raja Mani submitted
a patch fixing the n_match_sets calculation to disregard the RSSI,
but that patch didn't address the semantic issue.

Reported-by: Raja Mani <rmani@qti.qualcomm.com>
Acked-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-04 21:58:12 +01:00
Johannes Berg cc01f9b55f mac80211: remove module handling from rate control ops
There's not a single rate control algorithm actually in
a separate module where the module refcount would be
required. Similarly, there's no specific rate control
module.

Therefore, all the module handling code in rate control
is really just dead code, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-04 21:48:26 +01:00
Johannes Berg 631ad703ba mac80211: make rate control ops const
Change the code to allow making all the rate control ops
const, nothing ever needs to change them. Also change all
drivers to make use of this and mark the ops const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-04 21:48:21 +01:00
Emmanuel Grumbach e5e7aa8e25 iwlwifi: mvm: refactor power code
The main complexity of the power code is that it needs to
take into account the firmware limitations.
These limitations state that we need to have a global
picture of the vifs present in the system to be able to
decide if we can enable power management on a specific vif.

Even device power save (as opposed to vif power management)
must be disabled in certain circumstances (monitor vif).

Refactor the current code to make this clearer by defining
a function that explicitely computes these constraints.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:57 +02:00
Emmanuel Grumbach 6345061fda iwlwifi: mvm: remove iwl_mvm_power_mac_disable
Its logic can be implemented with
iwl_mvm_power_mac_update_mode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:57 +02:00
Emmanuel Grumbach c1cb92fc1e iwlwifi: mvm: remove support for legacy power API
If the driver detects old firmware, we disable support for
power management.
This greatly simplifies the code.

Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:56 +02:00
Emmanuel Grumbach 474b50c308 iwlwifi: mvm: store latest power command for debugfs read
Instead of re-building the power command upon debugfs read,
store the latest command sent to the firmware.
This reduces the code complexity by reducing the number of
entries in the power code.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:55 +02:00
Emmanuel Grumbach 06280a2ba9 iwlwifi: mvm: don't send the beacon filtering command from iterator
The firmware doesn't allow per-vif beacon filtering: we can
use beacon filtering for one vif only. So remember which
vif has beacon filtering enabled in the iterator, and send
the command outside the iterator.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:55 +02:00
Emmanuel Grumbach dcefeec05b iwlwifi: mvm: don't look at power commmand to decide if power is enabled
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:54 +02:00
Emmanuel Grumbach d623d24a77 iwlwifi: mvm: clean up in power code
Reduce indentation where it is possible.
Make a function static - it wasn't used outside its file
anyway.
Remove the unneeded pm_prevent state.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:53 +02:00
Emmanuel Grumbach 8e305d171a iwlwifi: mvm: remove duplicate assignment to ap_ibss_active
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:53 +02:00
Johannes Berg 863230dadc iwlwifi: mvm: clean up iwl_mvm_bss_info_changed_ap_ibss
Remove the enum abuse (using an enum to store a set of values),
the unneeded ret variable and unnecessary if nesting.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-02-03 22:43:52 +02:00