Treat a single connected STA in PSM as a slow link and regulate Tx speed
according to slow link priority/stop thresholds.
This allows us to avoid flooding the FW, while delivering decent
throughput to a peer in forced-PSM.
[Small simplification of the if statements -- Luca]
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Update the 18xx FW status private part to include Tx related link
priorities. Introduce new HW ops to determine link priority per chip
family.
For 18xx the changes are:
- Suspended links are at most low priority and Tx for them is stopped
beyond the suspend threshold.
- Active links now get their thresholds directly from FW
- There's a new "stop" threshold for active links, at which point a link
stops receiving new packets.
Update the min 18xx FW version required to make sure suspended links
bitmap is advertised by the FW.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wl->num_rx_desc was mistakenly initialized with WL18XX_NUM_TX_DESCRIPTORS
but it should use WL18XX_NUM_RX_DESCRIPTORS instead.
This bug was passed unnoticed because currently both RX and TX descriptors
are initialized to the same value (32).
Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Even passive scans on DFS channels require us to send probe requests, so
configure the probe-req in this case.
Also use this opportunity to prevent the code from crashing in case no
SSIDs are sent from above. This will likely happen in the DFS case
introduced. Even a passive scan might need the probe request configured
because of DFS channels.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Treat Rx error code as a bitmask. This allows sending MIC failures
when other error bit are on.
Align Rx descriptor status mask to the FW definition.
Ease debugging in case FW reports failure to decrypt on packets.
Discard corrupted packets early in Rx path to avoid reporting other
abnormalities with corrupted packets that also have other failure bytes on.
Namely - we don't want to get a MIC failure on a corrupted packet.
This is mandated by the WiFi specification - see
section 11.4.2.4.1 in 802.11-2012.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
There's a limit on scan dwell times of max 30ms in order
to avoid degrading voip traffic which could be going on
while scanning. However these dwell times increase the
chance of missing out on nearby APs leading to partial
scan results. Allow configuration of longer dwell times
in case there no active interface (i.e. no STA associated
or AP up).
[Arik - count started vifs using an in-driver function]
[Fixed some new checkpatch warnings regarding comments in the
networking subsystem. -- Luca]
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Require each incoming packet to have a valid vif. The injected Tx code
path was buggy (and unused), so disallow it altogether.
Cleanup a few places and add a warning so we can better discover
anomalies (corrupted skbs?) masquerading as injected Tx.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
ACX_PEER_CAP command is just ACX_PEER_HT_CAP, but allows
configuring the peer's support rates as well.
this is needed because we start the station role when
the remote rates are not known yet.
the two commands should be unified in future fw versions,
but for now add a new set_peer_cap per-hw op, that will
use ACX_PEER_CAP for 18xx, and ACX_PEER_HT_CAP for 12xx.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Obtain the last Tx rate from the FW status and translate it to
the mac80211 rate+flag format before sending it up via the Tx status.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Prioritize EDCA by choosing the AC before anything else. Use the
fast/slow link bitmap in FW to improve the scheduling algorithm for
the multi-link scenario.
Set packet thresholds to determine if a given link is high or low
priority according to its speed. A slow link will be given high priority
if the amount of packets queued for it in the FW is lower than the
slow-threshold. Similarly, a fast link will be given high priority if
the number of its packets queued in FW is smaller than the high-threshold.
The improved algorithm:
1. Choose optimal AC according to FW utilization
2. Traversing the VIFs in a round-robin fashion, try to choose a high
priority link. Links are traversed in a round-robin fashion inside a
VIF.
3. If no high priority links are found, choose the first non-empty
(low priority) link found in the round robin.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Move FW-allocation tracking code to the fw_status function and track
allocations made by all links. These will be incorporated in the
improved Tx scheduling algorithm.
Manually zero the system link counters on op_stop, as this link is not
allocated the normal way.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
This accounting will help find a vif that has data in a specific AC.
Otherwise we have to traverse all the links, which can be lengthy for
the AP case.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
This allows us to pass only the link as a parameter to various functions
and deduce the wlvif. Note that this member will be NULL for global
links.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
When a link is allocated, sometimes the "freed packets" counter in FW
is non zero, but we always assumed it is. This caused us to incorrectly
account FW allocated blocks in some cases.
When operating in AP mode, this bug caused some stations to never
come back from PSM.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wlcore allocates two static structs wl1271_band_2ghz & wl1271_band_5ghz
which are used/modified by Reg-Domain e.g. some channel might be marked
as passive at some point. Make sure we don't keep stale settings around
if the HW is unregistered/registered during operation.
[Arik - use Tx-power constant and tweak commit message]
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Make sure free_link is always called when removing an interface. This
ensures all skbs belonging to this interface are returned to mac80211.
Otherwise these dangling skbs might crash the system on the next
call to wl1271_tx_reset_link_queues(). This happens on recovery/stop or
an unsuccessful Tx flush.
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Otherwise we risk contention for private members of our global structure
while op_stop_locked is running.
Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Sometimes the driver can perform a recovery while Tx is
active, this will trigger unnecessary warning which might
delay the recovery for more than 100 mS.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The 18xx fw supports greenfield so add the
IEEE80211_HT_CAP_GRN_FLD flag to the supported
ht capabilities flags.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
When removing an interface currently performing a ROC operation, clear
the current ROC state. This is useful especially during recovery and
keeps mac80211 in sync to our state.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
all the current firmwares support elp, so
we can safely remove WLCORE_QUIRK_NO_ELP.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Under some circumstances, that fw might be asked to
remove a rx ba sessions it doesn't know about. In
this case, instead of triggering a recovery, accept
the error code (CMD_STATUS_NO_RX_BA_SESSION) and
ignore it.
[Arik - indicate failure up when the BA session cannot be setup]
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Currently, each fw command/acx that return a status code
different than CMD_STATUS_SUCCESS will trigger a recovery
in the driver.
However, it is a valid for some fw commands to fail (e.g.
due to temporary lack of resources), so add new functions
that allow passing bitmap of valid error return values.
(make the current wl1271_cmd_send/wl1271_cmd_configure
wrappers around the new functions, in order to avoid
changing the whole driver)
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
First set (low, medium and high TX power values) is used
for STA-HP background role. The 2nd set is used for other roles.
Update other mac/phy parameters according to new FW.
Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Conflicts:
drivers/net/wireless/ti/wl18xx/main.c
Update mac/phy paramters according to the default HP SISO boards.
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The 12xx FW doesn't support non-zero session ids for AP-mode. Introduce
an appropriate quirk to make sure the session id is always zero when
needed.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
For wl18xx, only the chip ID and the minor version number are
relevant. Ignore the other numbers which are either not used or
relate to internal projects or internal branches.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Previously we were only checking the single-role firmware version.
Now add code to check for the firmware versions separately for each
firmware type.
Signed-off-by: Luciano Coelho <coelho@ti.com>
The firmware type and the project number fields in the firmware
version number, cannot be checked as if they increase sequentially,
because the former is the firmware type and the latter is an internal
project number. There's no guarantee that these numbers will remain
incremental, so use WLCORE_FW_VER_IGNORE.
Signed-off-by: Luciano Coelho <coelho@ti.com>
The firmwares version string contain 5 integers. We used to consider
all the digits (except for the first one, which indicates the chip) as
linearly increasing version numbers. This is not correct, because
some of the integers indicate type of firmware (eg. single-role
vs. multi-role) or the internal project it was created for.
Besides, this varies a bit from chip to chip, so we need to make the
firmware version checks more flexible (eg. allow the lower driver to
ignore some of the integers). Additionally, we need to change the
code so that we only check for a linearly increasing number on the
fields where this actually makes sense.
Signed-off-by: Luciano Coelho <coelho@ti.com>
We don't distinguish between STA and AP firmwares anymore, so the
firmware version checking and quirks setting in wl12xx isn't needed
anymore.
Remove implementation of .identify_fw in wl12xx and deprecated
definitions. Don't remove the op entirely from wlcore, because it may
be needed for more fine-grained checking later.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Move wl12xx-specific chip ID macros to the wl12xx driver and rename
them to 127X and 128X for clarity since both the "1" (2.4GHz) and the
"3" (2.4GHz and 5GHz) variants use the same chip ID.
Signed-off-by: Luciano Coelho <coelho@ti.com>
add support for recovery settings including bug_on_recovery and
no_recovery options.
These options can now be set using wl18xx-conf.bin file and wlconf
tool.
Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
It's sometimes useful to gather information about the firmware
stability in long test runs, especially to see if problems are
recurring frequently or not. With this commit we count the number of
times a hardware recovery was issued and print it out during recovery
and in the driver_state in debugfs.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Adapt the new mac80211 BSS_CHANGED_PS notification,
and do the ps handling in mac80211's per-vif
callback (.bss_info_changed), rather than in
the per-device (.config) callback.
Make sure to configure it only after association.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
mask out CCK rates from the AP's local rates
when the interace is p2p interface (GO).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Try an opportunistic ROC when a STA is first added and stop the ROC when
the STA is removed or successfully authenticated. This would ensure we
don't miss auth/assoc/EAPOL packets during connection
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
18xx chips are capable of staying on 2 channels at the same time.
Introduce a chip-family specific parameter to set the number of channels
in the interface-combinations published by the driver.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Due to a bug, the fw asserts on fw log stop when dbg-pins are used.
Don't stop the fw log in this case.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
We support changing the channel BW when we started the STA role on
a 40Mhz bandwidth. Otherwise a reconnection is required.
Save the started channel width and use it when channel width updates
arrive.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Allow configuring different dwell times to the different
scan types (regular and scheduled).
Add new configuration entry (dwell_time_dfs) to
conf_scan_settings, in order to allow setting
different values for normal scan and scheduled scan.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
we have done updating the driver to the new fw
api, so make the driver operational again.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The interface might go down before we got the SCHED_STOPPED
event, so make sure to call ieee80211_sched_scan_stopped()
if the scanned interface is removed.
Replace sched_scanning with sched_vif in order to save
the scanned interface.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
In 18xx the calibration process of the PHY Cortex domain
requires to perform an active calibration of the channel
before it can be used for transmission. To fulfill world
wide regulatory restrictions, fw should be always
synchronized/updated with current CRDA configuration.
Add a new "CMD_DFS_CHANNEL_CONFIG" command to update the
fw with current reg-domain, this command passes a bit map
of channels that are allowed to be used for transmission.
The driver shall update the fw during initialization and
after each change in the current reg-domain
configuration. The driver will save the channel number of
incoming beacons during the scan process, as they might
be a result of the passive scan on
"IEEE80211_CHAN_PASSIVE_SCAN" channel and will update the
fw accordingly once the scan is finished, the purpose of
this is to be ready in case of the authentication request
on one of these disabled (uncalibrated) channels.
The new command requires to wait for the fw completion
event "DFS_CHANNELS_CONFIG_COMPLETE_EVENT".
No scan commands (including the sched scan) can be
executed concurrently with the "CMD_DFS_CHANNEL_CONFIG",
wl->mutex ensures that.
[Arik - move reset of reg_ch_conf_last to safe place inside
op_stop_locked]
[Eliad - adjust to new event waiting api]
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
A new session_id is generated on link allocation.
it is saved in a global array and used later, on tx.
The new fw api adds new bcast/global_session_id
fields to start_role(ap) command, and a new session_id
field to add_peer command. align the driver with it.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
New fields were added to start_role(ap) and
set_peer_state commands, so the fw will be
able to know whether the sta/ap supports
wmm (the fw uses it in order to choose the
AC for some of its internally-generated frames)
For sta, take this value right from bss_conf->qos.
For ap, check for wmm support by looking for the
WMM IE in the configured beacon.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The event mailbox in wl18xx has a different
(non-compatible) structure.
Create common functions in wlcore to handle the
events, and call them from the chip-specific
event mailbox parsers.
This way, each driver (wl12xx/wl18xx) extracts
the event mailbox by itself according to its
own structure, and then calls the common
wlcore functions to handle it.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Some fields were added to the channel_switch and
stop_channel_switch commands. Unfortunately,
the new 18xx channel_switch struct is not backward
compatible with the 12xx channel switch struct.
Add a new channel_switch op to wlcore, and update
the driver accordingly.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>