If radar is detected on the primary channel, agile DFS is restarted
after vdev start response by triggering a zero second timer.
The timer fires immediately and the existing agile precac channel
is marked as CAC done. Since the agile preCAC channel was never cleared,
it was marked as CAC done.
Reset the agile channel if radar is detected on the primary channel.
In case of radar in agile detector, the channel change will not involve
any zero second timers and the agile channel will be overwritten by a
new channel.
Also, consider the case where radar is detected on the primary
channel. HOST will now select a new primary channel and issue vdev start
to FW. After vdev response, HOST will pick a new agile channel.
Since the agile engine was never stopped, FW may issue OCAC complete
for the old agile channel at this instant. Now, since HOST has picked a
new agile channel, this new agile channel will be marked as CAC done
due to the OCAC complete event from FW, without preCAC being started.
Send OCAC ABORT command after radar detection to properly restart
the agile state machine and avoid any race conditions like above.
CRs-Fixed: 2528567
Change-Id: I455cd513ba612bf48f057583b7529c7c3ef2f6c6
When the current chainmask is updated, the FW ADFS support flags are
sent to DFS object in the API "dfs_set_fw_adfs_support". Update
the DFS flags representing the FW Agile DFS support based on the
new values.
Before starting (or) restarting agile DFS, check if user configuration
and FW Agile support is present and only then start the agile
state machine. If the current operating bandwidth of the pdev is
80P80 or 160MHz, check the FW flag "fw_adfs_support_160" and if
it's false, do not start the agile engine.
Change-Id: I0c44fd9d7d57042f82808979421284be02065c77
CRs-Fixed: 2521654
While checking if ETSI preCAC is already done on a given channel
in this API "dfs_is_etsi_precac_done", dfs_curchan is always used as
the channel to be checked. Since there are APIs such as
"dfs_is_cac_required", which may be called before dfs_curchan is
updated, add the channel structure which is to be checked for
ETSI preCAC in the argument list.
Change-Id: I77cf059f9afd83c850a7603f6197ac2b78fa2586
CRs-Fixed: 2528023
Consider the case where preCAC is running on channel 120 (20MHz)
bandwidth and 116 (20MHz) channel is already preCACed. One possible tree
structure, with the scenario mentioned above, is shown below:
122(1,0)
|
|------- 118(1,0)
| |
| |------- 116(1,0)
| |
| |------- 120(0,0)
|
|------- 126(0,0)
| |
| |------- 124(0,0)
| |
| |------- 128(0,0)
where 122 and 118 have 1 subchannel (116) as CAC done. While the preCAC
is running on 120(20Mhz), the preCAC is restarted with a new channel
of 40MHz bandwidth. If the new channel picked is 118(40Mhz) in which 116
is already CACed, once the preCAC is completed on 118 (40Mhz),
the entire band (with both 20MHz channels) will be marked as CAC done.
In the API "dfs_mark_tree_node_as_cac_done", the number of CACed
subchannel of the parent node is incremented without checking if the
child has been marked. In the above case, after preCAC is completed
on channel 118, each 20 MHz channels in channel 118 (116 and 120) are
marked individually in this API.
While marking the tree for preCAC completion on the subchannel 116,
the number of CACed subchannels is incremented to 2 for 122 and 118, but
124 is already marked. While marking the tree for preCAC completion on
the other subchannel (120), the CACed subchannels count is incremented
to 3 for 122 and since it cannot increment the subchannel count to more
than 2 for 118, it returns, leaving 128 unmarked. The preCAC tree
structure will now look like:
122(3,0)
|
|------- 118(2,0)
| |
| |------- 116(1,0)
| |
| |------- 120(0,0)
|
|------- 126(0,0)
| |
| |------- 124(0,0)
| |
| |------- 128(0,0)
which is wrong.
To fix the above problem, check if a tree node is already marked as
CAC done and only then increment their parent's CACed subchannels count.
This issue is not seen for other cases (e.g. marking NOL channels), since
preCAC can be performed on the same channel again (incase of different
bandwidths) whereas NOL marking is unique.
Change-Id: Ie683a011a86233dd2c1ff8e21aa78638a1d63c2a
CRs-Fixed: 2520790
If radar is found on primary channel, aDFS channel change is triggered
immediately after marking the primary channels as NOL. This may result
in picking the channel that the AP may come up in, for agile DFS.
To avoid running aDFS on the pdev's current channel, restart
agile DFS engine after new channel is selected, in vdev response.
Also, consider the scenario where the device has two DFS pdev objects.
When the API "dfs_prepare_agile_chan" is called to start preCAC, it
uses a round-robin logic to pick a DFS object for preCAC and
the preCAC timer maybe started for a different dfs object than the
one calling it (argument of the function). But the channel width of
the preCAC channel is always fetched from the dfs object calling
the API, which may result in wrong channel width sent in adfs_start
command.
Use temp_dfs structure (indicating the DFS object picked for preCAC)
to fetch the channel width, instead of fetching it from the dfs
object passed as argument to the function.
Change-Id: I243cf978b3caaadb771eb9a5e0cf83f7ac82c876
CRs-Fixed: 2515440
While checking if the current channel overlaps with the
weather channel range, the first sub channel was checked if it is to
the left of weather channel start and the last sub channel was
checked if it is to the right of the weather channel end.
By the above logic, the API returns true only if the entire
weather channel range is within the current channel.
Fix the formula by checking if the first sub channel of the current
channel is to the left of the weather channel end and the last sub
channel is to the right of the weather channel start to find if any
of the current channel is a weather channel.
CRs-Fixed: 2515365
Change-Id: I8ca779f6dd8116a85121185e3ea71bca610f9ba4
While selecting a channel for aDFS, the current channel(s) are skipped
for preCAC (since they are CACed by the primary detector).
If no other channels are found and if the current channel
is the last in the preCAC list, aDFS is started on this channel.
This is because, the channel variable defined in the API locally
is not reset if it is an invalid channel.
Reset the agile channel at the end of the loop if it is one of the
excluded (current) channel.
Change-Id: I48cbfc3c511c05bed86b60eb9e2ca22f9b8e0362
CRs-Fixed: 2515324
Currently single API is used to get dfs_precac_enable and
dfs_agile_precac_enable. This API was wrongly returning value for
dfs_precac_enable since agile capability was set even for Cascade.
Sepate out the GET APIs for getting dfs_precac_enable and
dfs_agile_precac_enable so that getting these flags becomes independent
of each other.
Change-Id: Ie617c04269f91db32f851871880c4df884517a67
CRs-fixed: 2501266
The preCAC list (forest) is built irrespective of the current DFS domain.
But since preCAC feature is only supported by ETSI spec., the list will
not be used by other domains.
Build the preCAC list only for ETSI domain.
Change-Id: I5949fda8b2c51237f80ce5335d9c9453f46ef3a4
CRs-Fixed: 2499643
Add an API to reset Agile DFS config variables. This will make sure that
ADFS config variables are consistent when we dynamically disable/enable
a PDEV.
CRs-Fixed: 2481535
Change-Id: I3842ed45f8a071523c3de1face0463d21da737bb
According to the ETSI speculation, off-channel CAC has a
minimum timeout value of 6 mins (non-weather) and 1 hour (weather). The
maximum timeout value is 4 hours (non-weather) and 24 hours (weather).
Current implementation always took 60 seconds (1 min) as the default
preCAC timeout value. Add changes to implement proper timeout values
based on the channel (weather or non-weather). As part of this change,
add an API to determine if a channel is within this range based on
the edge channels of the given bandwidth.
The API (dfs_start_agile_precac_timer) is called inside
dfs_get_ieeechan_for_agilecac which is used to find the next channel
for agile CAC. Move dfs_start_agile_precac_timer outside
to functionally differentiate each APIs.
Change-Id: Idf3f371b0ab839a746cfba69e86f58202698f3c3
CRs-Fixed: 2482929
While picking a channel to start Agile CAC on, the current channel
width enum is checked if it is non zero and only then a channel is picked.
However, the channel width value of 0 indicates the width is 20MHz.
Check if the channel width value is not CH_WIDTH_INVALID and only then
start Agile CAC.
Change-Id: Id024631fc7b034fe87f2070d150da64cf07c49ae
CRs-Fixed: 2491517
Replace void * tgt_if_handle of objmgr psoc/pdev with
abstract type handles provided by target interface
Change-Id: I903bbae99ec784fe445dc55f954792542d91f380
CRs-Fixed: 2467129
In the current Agile DFS design it is assumed that the agile detector's
bandwidth is always 80Mhz. However, the agile detector inherits the
bandwidth of the current operating channel with the following
mapping:
Current Chan BW --- > AGILE BW
20 20
40 40
80/80+80/160 80
Provide support for Agile DFS on 20/40/80MHz channels based on the
current channel's bandwidth. Maintain a Binary Search Forest,
with each Binary Search Tree (BSTree) rooted by an 80MHz channel
structure. These BSTrees are connected by the preCAC list.
The primary key (identifier) of each node in the BSTree is an IEEE
channel. Each level of the BSTree has a unique bandwidth.
Remove the three existing precac lists: precac_required_list,
precac_done_list, precac nol_list.
Maintain
1) regular CAC and preCAC
2) regular NOL and preCAC NOL
information in the same Binary Search Forest.
Operations available on the preCAC BSF:
1. Allocate nodes of each tree in the forest:
Use level order BST insertion to create and add individual nodes of
the tree.
2. Deallocate nodes of each tree in the forest:
Use an algorithm to add current node's right subtree to the last leaf
node and remove left nodes (from the root) iteratively [O(N)].
3. Print precac tree states:
Use morris preorder tree traversal to print the states of the nodes
in the entire forest.
User space command: radartool -i wifi[x] showprecaclists.
Example: For a HT80 channel list,
[Syntax of each node: <center_channel_ieee>(<CAC_status>,<NOL_status>)]
106(0,0)
|
|------- 102(0,0)
| |
| |------- 100(0,0)
| |
| |------- 104(0,0)
|
|------- 110(0,0)
| |
| |------- 108(0,0)
| |
| |------- 112(0,0)
4. Find a channel for preCAC for a given bandwidth:
Use the current status of the node to find the appropriate channel
from the Forest based on it's bandwidth. [O(N)]
5. Find if channel is preCAC done:
Search the tree (Binary tree search) which has the channel requested
and return the CAC status.
6. Mark/unmark the channel as CAC done:
Given a channel, find all 20MHz subchannels and mark/unmark as CAC
completed.
7. Mark/unmark the channel as NOL:
Given a channel, find all 20MHz subchannels and mark/unmark as NOL.
CRs-Fixed: 2464929
Change-Id: If4a806207025edfd9e9b99de310963bb8a3a5007
When the CAC timer is in progress and radar is detected, a NULL pointer
dereference is observed when the radar detected channels are removed
from etsi required lists and added to NOL.
This issue is seen as the next etsi precac entry in the etsi required
list is freed instead of the current etsi precac entry.
This issue is fixed by freeing the current etsi precac entry in the
etsi precac required list.
Change-Id: I609174b23b0d6d2ea36ca26b011359dcf5876c3a
CRs-Fixed: 2463762
Currently if InterCAC support is enabled:
1. If the user configures a DFS channel in 80MHz mode, the
radio switches to an intermediate channel and the user
desired channel is added on the top of the lists of the
channels to be CACed using AgileDFS.
2. If the user configures a DFS channel in 160MHz mode, the
radio switches to an intermediate channel and the user
desired channel is split into two 80MHz channels and are
added on the top of the list.
3. After agile CAC is completed on the user configured channel,
the radio stays on the intermediate channel.
Change the current channel (and mode) back to user desired
channel, after agile CAC is completed on the desired channel.
Change-Id: Ib3e7757316ebddfc75f1b1f1f4bb8c5debd04d62
CRs-Fixed: 2448224
After NOL timeout, if ETSI PreCAC is supported, add the HT20 Channel
to ETSI PreCAC Required List.
Change-Id: I45812d0f7a9dd20e4fb1f03e6a71548ff2f6e5b4
CRs-Fixed: 2403489
When a channel is marked as radar detected and added to preCAC NOL
list, it is removed only from etsi precac done list, but not from etsi
precac required list. Since a channel that is part of NOL, cannot also be
a part of etsi precac required list, this needs to be corrected.
Therefore, once radar is detected on a channel, remove it from both etsi
precac required list and etsi precac done list.
Change-Id: I4d809a24acd4b73db254790e2698ffc5414cf0fe
CRs-Fixed: 2403489
Agile Dynamic Frequency Selection refers to the mechanism in which DFS
scanning takes place on a separate dedicated synthesizer
(agile DFS sythesizer), while the access point is receiving data on a
separate channel. Once DFS scanning completes in the aDFS
synthesizer, AP can switch its primary channel to this preCAC done
channel, without having to do a Channel Availability Check of 60
seconds
Hawkeye has native support for A-DFS unlike Cascade, which uses a
dedicated radar detector for background scanning. Each radio has two
synthesizers, one of which can be used for A-DFS.
Host driver will configure an A-DFS channel along with maintaining
pre-CAC Done list of channels.
PreCAC list caching of channels is limited to ETSI domain.
Once off channel CAC completes in the agile channel, HOST receives
O-CAC complete indication. O-CAC status included as a apart of event
params has information if the preCAC is successful or not. If RADAR
is found on the agile channel, host receives indication through the
existing radar indication event. HOST identifies the detection as
agile channel radar using the detector id value.
For SBS mode, there can be 2 pdev's which can include DFS channels.
Although the preCAC list is maintained separate for each pdev,
preCAC can only be performed for a single pdev at a time.
This is implemented by making the host timer common
for both pdevs,i.e psoc level timer.
The following commands can be used to set/get preCAC enable,as long
regdomain is ETSI along with agile capability enabled in the target
advertised to host in WMI ready event.
iwpriv wifiX get_preCACEn
iwpriv wifiX preCACEn 0/1
Change-Id: Id8eaf7526942cbf01a9a62a2b109813624ae550f
CRs-Fixed: 2385536
If user configures DFS channel in 160MHz mode,
1. change mode to 80MHz and do PreCAC on primary and
secondary channels of 160MHz.
2. Use intermediate channel to operate.
3. Once PreCAC done on the both primary and secondary channels and is clear
then change mode back to 160MHz.
4. Change the channel from intermediate to configured DFS channel.
Use Broadcast and Unicast OMN frame to notify mode change.
Change-Id: I451e35516ab4a44adea52a1342b5ea76d6e3d04f
CRs-fixed: 2395431