As the 3165 device uses the same firmware as 7265-D and currently
all 7000 series (including 3160/3165) use the same API versions
remove IWL3165_UCODE_API_OK and _MIN. We might have to put them
back if firmware support ever splits, but in that case might also
have to add a different MODULE_FIRMWARE statement.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
success_ratio is actually 128 * SR in percentage while
IWL_MVM_RS_SR_NO_DECREASE is 85%. Fix this by using RS_PERCENT().
This bug caused the if branch to be always executed. This in turn
led to always selecting a rate, following a column switch, in which
the expected throughput would exceed the best expected current throughput.
In some scenarios where the success ratio isn't >85% such a rate
could be too aggressive leading us to avoid the new column.
This has the potential of causing sub optimal performance.
Reported-by: Moshe Harel <moshe.harel@intel.com>
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This message isn't very useful and creates clutter.
Remove it.
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
The firmware has always treated these two bits to mean that
powersave is enabled when POWER_SAVE_ENA is set and CAM is
clear; it doesn't use them in any non-combined way.
Therefore, it's pointless to send it two bits, and the API
should be cleaned up. Prepare the driver by removing the CAM
bit and using only POWER_SAVE_ENA to indicate whether PS is
enabled or not.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
When enabling a queue, the default SSN is 0.
Allow determining what that SSN should be, if required. This
can happen, for example, if a queue gets reconfigured.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
"DQA" is shorthand for "dynamic queue allocation", with the
idea of allocating queues per-RA/TID on-demand rather than
using shared queues statically allocated per vif. The goal
of this is to enable future features (like GO PM) and to
improve performance measurements of TX traffic.
When RA/TID streams can't be neatly sorted into different AC
queues, DQA allows sharing queues for the same RA. This means
that DQA allows different ACs may reach the same HW queue.
Update the code to allow such queue sharing by having a mapping
between the HW queue and the mac80211 queues using it (as this
could be more than one queue).
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
As the transport will decide how many queues (and MSI-X vectors)
to allocate, add a field to indicate that to the op-mode so it
can size/allocate its own data structures appropriately.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Upcoming hardware will have the ability to do L3 hashing for RSS,
directing data packets (and perhaps some associated metadata and
management notifications) to different MSI-X vectors.
In this case, it makes no sense to go through the full RX dispatch
since it's already known that only a subset of the possibilities
can come in, requiring a new receive method. In addition this must
know which queue the packet was received on.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Treat PHY RX specially, since it's actually pretty frequent,
doesn't need all the notication etc. code, and will have a
different handler in future hardware.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Return a proper error when wrong parameters are passed to debugfs
tof_range_request.
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
The command needs to have the AP interfaces BSSID (which corresponds
to its address).
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Make some input formats more natural, e.g. bandwidth and periods
are more natural in decimal than in hexadecimal.
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Commit ce7929186a ("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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
split long debug messages that may result warning in tracing.
Fixes: 1a84e77160 ("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>
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>
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>
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>
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>
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>