qca-wifi: Check if channel is already marked before marking as CAC done
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
1 file changed