Remove unused mlme function to get dfs object and replace
it with the dfs equivalent.
Change-Id: I3ffadb77072fa119957469e0bf97fa4a80f99ac9
CRs-Fixed: 2368988
Fix Enhanced Bangradar to add only the subchannels into NOL
based on its parameters during call, and not the entire set
of current subchannels.
Current implementation of enhanced bangradar sets bangradar entry,
in DFS, to 1. Since bangradar does not use subchannel marking,
enhanced bangradar did not work either.
Introduce a new boolean entry in DFS structure that does not follow
bangradar and does subchannel marking.
Change-Id: Idf44b80a6cae3f1c8a3c7b430a233e3fd29ba0c5
CRs-Fixed: 2368100
The radar affected subchannels list that is sent along with RCSA
was not built properly due to unreliable (contained 0s) subchannels
list provided by subchannel marking function.
The implementation used a single iterated loop to traverse through the
subchannel array elements, not counting 0s as possible inputs.
Search through each element of the list to find if the subchannel
is present and break if successful.
Change-Id: I5cd5ce7b6a334247c7d8733ee8433f957480c1dd
CRs-Fixed: 2364640
The cfg tool command to enable/disable subchannel
marking called a WMI to be sent to FW without checking
if dfs is offloaded to FW.
This added fail prints in log for partial offload and direct
attach even if subchannel marking was set.
Fix the cfg command to send a WMI to FW only if dfs is offloaded.
Change-Id: Ifae574ed6aeb49c4058d89374fdcc81b8d43a5bc
CRs-Fixed: 2334258
AP is configured to operate in Channel 100(HT80), and Zero Wait DFS
is enabled. Once PreCAC is complete on DFS Channels,inject radar in
Channel 100 and AP moves to another DFS channel 116 and beacons
immediately but station associated to AP still does a scan again.
When the station receives the Channel Switch Announcement from AP, it
dissociates from the AP and scans again.
Maximum Switch time Information Element can be used by the Station to
to know if the AP has done PreCAC on target channel. Maximum Switch Time
IE is part of AP's beacon and is the sum of CAC timeout on the target
channel and 1 beacon interval.
If PreCAC is done on target channel, the CAC timeout is zero and Maximum
Switch time IE is equal to 1 beacon interval. This element is sent to
Station along with Channel Switch Announcement. The Station receives the
maximum channel switch time element. If the value of maximum channel switch
time element is less then or equal to beacon interval, the station
associates with the AP seamlessly without dissociation. If the value of
the Maximum Channel Switch Time IE is greater than 1 beacon interval, then,
the Station has to dissociate from the AP since, ZeroCAC has not been done
by the AP.
Change-Id: I0301a68c1731cc268b9a6900258261034476446b
CRs-Fixed: 2330817
Update NOL list based on the external radar information sent
from the action frame and store in DFS structure.
Add an utility - dispatcher function that can be called by UMAC
with NOL IE information.
In the DFS structure,
1). If subchannel marking is disabled, add all the current
channel's subchannels to NOL, do not update the NOL IE
structures inside dfs, and send a flag saying not to
propagate the NOL IE to uplink.
This is because, in case of cascading repeaters, one
of the repeaters (RE1) in the cascading system might have
subchannel marking disabled. In that case, sending the
same NOL IE to uplink results in RE1 and its BSS to disconnect.
2). If subchannel marking is enabled, add those subhannels to NOL,
and update flags saying NOL and RCSA IE should be sent.
Change-Id: I3f3e14a59503cd1a15573c988a984a20117aa814
CRs-Fixed: 2328377
Calculate the bitmap of subchannels that are affected by
radar and store in dfs structure along with flags
Algorithm:
1). Given the radar affected subchannels list, create a
NOL bitmap, where
1 - Radar hit on Subchannel.
0 - Subchannel not affected.
2). Along with the NOL bitmap, send the Minimum Bandwidth
for each subchannel and the Channel list's starting
channel's centre frequency.
Example:
Mode : 100HT80, if radar affected subchannels are 100, 104
and 108.
NOL bandwidth: 20.
NOL start frequency: 5500.
NOL Bitmap: 11100000.
3). During precac (precac timer running), if radar hits
at secondary segment, the umac code that sends rcsa
is still called, but add a new flag to not send rcsa, and
in rootAP, channel change is not triggered, only NOL
is updated.
Add APIs that can be called from mlme to fetch the NOL and IE
flags information from DFS structure during RCSA framing.
If subchannel marking is disabled, the new NOL bitmap has no meaning
and is hence, not sent.
CRs-Fixed: 2328377
Change-Id: I3114ff5ca2704c316c9dc83220740fac9a6a00a1
When x_psoc_create_handle return failed, need free all resources
before return, x_psoc_destroy_handler has no chance to be called
any more.
Change-Id: I4b9999dbc2597c4ea860f08a6f3334f7f5728146
CRs-Fixed: 2353795
Introduce dfs_tgt API to send the WMI command to enable/disable
"Subchannel Marking" in Firmware (only in Full Offload)
Change-Id: If739409521c8704b612e52dfc8ed6b86ffe32bca
CRs-Fixed: 2334258
Changes configured to operate in Channel 100(HT80), if bin5 chirp
radar is injected at center frequency at 5530 MHz, instead of adding
channel 108(HT20), it adds channel 116(HT20) of adjacent 80 MHz band
to NOL list.
We have the following variable assignments in function
dfs_pulses_within_window:
dfs->dfs_min_sidx = pl->pl_elems[*index].p_sidx
dfs->dfs_max_sidx = pl->pl_elems[*index].p_sidx
Since the variable pl->pl_elems[*index].p_sidx is of signed type
and variables dfs->dfs_min_sidx/dfs->dfs_max_sidx are of unsigned type,
if the value of the variable pl->pl_elems[*index].p_sidx is negative,
the values of the variables dfs->dfs_min_sidx/dfs->dfs_max_sidx become
very large unsigned value.
When sidx is converted to frequency offset, the frequency offset
also becomes very large and it is greater than 40Mhz(half of HT80).
In this case, 50MHz is added to center frequency 5530 MHz, which
becomes 5580MHz(channel 116(HT20)). This results in the channel
116(HT20) of adjacent 80 MHz band to be added to NOL list.
Change the type of the variables dfs->dfs_min_sidx/dfs->dfs_max_sidx
from unsigned to signed so that assignments do not alter the actual
value of the frequency offset.
Change-Id: I13995888b618d9dd8a91447d5dffe27aa2e27a27
CRs-Fixed: 2342743
In case of STADFS feature, when STA vap detects the RADAR, it marks the
channel as RADAR and adds the RADAR found channel to both NOL and
NOL-HISTORY list.
After nol expiry, STA vap does the CAC before connecting to the RootAP if
the RootAP channel is present in the STA NOL-HISTORY.
Set nol_history_flag in regulatory component current channel list when STA
vap detects the RADAR.
Change-Id: I8d01f5830e6b4dd634b71c551ac347bc7d3d5c4c
CRs-Fixed: 2337921
Consider an AP up in channel 100 in VHT80 mode. On injecting radar
in channel 104, the current implementation displays "Radar found on channel
100", which is the primary beaconning channel. The requirement is to
display radar found information on the exact subchannel of the VHT channel
where radar was detected (which is channel 104 in this example).
Hence, using the radar found frequency offset to display the exact freq
offset from the centre frequency where radar was detected. This display
is only valid for real HW pulses injection. For bangradar, the frequency
offset is not available and therefore exact subchannel cannot be
calculated.
CRs-Fixed: 2321778
Change-Id: I49cdcd4f13dc1fbf12bc4a33048c13bc8ea3973f
Currently radar event log is cleared only during dfs_detach which happens
during wifi unload. On issuing "wifi or wifi down" command, the logs are
not cleared. During Spoof Radar Detection, the log counter values are
spuriuos due to accumulation of phyerror events. This accumulation of
events is either due to false radar detection or logs of the previous wifi
cycle. Hence resetting the dfs radar log counters in the below cases:
1) During vap delete
2) During CC/ Regdomain change.
3) After false radar detect.
CRs-Fixed: 2244562
Change-Id: I74745f61c634bab7f9c1a78ef8dea8da2ab1a997
When a DFS pulse is being processed, a channel change change can happen.
And the channel change initializes the radar filters which means
it frees and allocates the DFS filtering data structures.
This may result in memory violation (NULL Pointer dereference).
To avoid the memory violation lock the filter initialization and
DFS pulse processing.
Change-Id: I37c80d409433a9f97bd1f5e78b2b1e780b130290
CRs-Fixed: 2317455
Add API to clear CAC started channel in the DFS component.
Also, when AP detects the RADAR in DFS channel and restarts the AP vap in
NON-DFS channel, call MLME state machine to clear the DFS_WAIT flag and
move the state to RUN. Since MLME state machine is per vap, move the
NON-DFS check in dfs_clear_cac_started_chan() to MLME and call
dfs_mlme_proc_cac() per vap.
Change-Id: I67033aa6ea819b6ed5d39a3911191d2051f731fc
Acked-by: Shashikala Prabhu <pshashik@codeaurora.org>
CRs-Fixed: 2324561
Consider STA vap to be up in chan 100 VHT80 mode and stadfs enabled.
Say Radar is injected on chan 100 and 100 is added to NOL list and
IEEE80211_CHAN_SET_RADAR is set on it. On NOL timer expiry, during the
process of nol delete, dfs nol count is decremented. So it reads 0 now.
After this decrement, dfs_nol_update() is called and it returns without
calling dfs_mlme_clist_update as nol count is zero.
As dfs_mlme_clist_update is not invoked, IEEE80211_CHAN_CLR_RADAR flag is
not set. After NOL timeout, STA vap fails to associate with Root on VHT80
mode as 100 VHT80 is not available (chan 100’s RADAR flag not cleared).
CRs-Fixed: 2327546
Change-Id: Ic83ec2ac49e0fb7e887c3c7be2f8eefc419cb7c5
This commit includes the following changes:
Send usenol pdev param to FW.
Set and get dfs_disable_radar_marking flag.
Handle scan failure due to NOL violation.
Change-Id: I814f6381145f98eccf465af730734238c60d8896
CRs-Fixed: 2328894
* Move dfs DA files to a DA specific directory.
The new DA specific directory will be under a new git root.
* DA:- Direct Attach.
Change-Id: I413d736d60a071374baf45ca6b13c793ab8dcbfd
CRs-Fixed: 2305115
When second segment bangradar is issued, the primary channels are
added to NOL. During preCAC, when a bangradar or real radar is injected in
the second segment, no channels are added to NOL.
dfs_seg_id is updated by enhanced bangradar even when the command is not
issued. During preCAC, the second segment frequency stored in current
channel is invalid and it is stored in dfs itself.
Correct the condition for enhanced bangradar command. Update dfs_seg_id and
radar found segment id. Move the portion of code that update radar_found
parameters when enhanced bangradar command is issued. This portion checks
for radar found segment id that would not have been updated yet. Use proper
second segment frequency to add to NOL during preCAC.
Change-Id: I5e1f1004b45bc30b5da7bfa174a5c03bdea4fa71
CRs-Fixed: 2303458
In macro TAILQ_FOREACH_SAFE, var and tvar point to current head and the
next element respectively. If we unlock the spinlock inside the for loop
and then lock it again, there is a chance (race) that the next element is
pointed to by another thread of execution and both of them may try to
remove the same element at the same time. This may lead to panic.
Instead of using TAILQ_FOREACH_SAFE macro remove the element from the list
one by one using a while loop from the head of the list. Do not lock the
entire while loop, instead lock only during the removal of element from the
list.
This is required because we want to wait for the dfs_remove_from_nol timer
to complete. But the wait should not be done from inside the lock because
the same lock is used by the dfs_remove_from_nol timer.
Change-Id: If820dbb1789b7fcfc33c133b3f90968377bfbf3c
CRs-Fixed: 2322831
Redefine dfs filter type to avoid prealloc problem by making one
large chunk into multiple smaller chunks.
With current data structure, dfs attach was requesting huge chunk
of memory from the heap which results in failure.
Fix is to modify the data structure so that one large chunk
is made as multiple smaller chunks.
Change-Id: Iaa8d0b1b6e4b192b37e165c936920baa5d10a23b
CRs-Fixed: 2323927
Consider AP is brought up in channel 100 VHT80 mode. When "bangradar" cmd
is issued, all the HT20 channels 100, 104, 108, 112 must be added to NOL.
It is found that only chans 100, 104 are added to NOL. This is because
dfs_find_radar_affected_subchans() does not find out all the radar affected
HT20 (4 in this eg) sub-channels.
dfs_find_radar_affected_subchans() is invoked as dfs_use_nol_subchannel
_marking is set to true by default. Also, dfs_find_radar_affected_subchans
finds the frequency offsets of the radar_found channel from
radar_found->freq_offset variable which is updated only in case of real
HW radar. For bangradar, this freq_offset takes to some scrap value.
As the radar found frequency offsets are wrong, the radar found channels
are computed incorrectly and it leads to chaos in NOL addition.
dfs_find_radar_affected_subchans() is used to compute radar found
frequency offsets only in case of real HW radar. For bangradar,
dfs_get_bonding_channels() is used to compute the radar found sub-channels.
Change-Id: Ie190e9266bcb696a07e389736df1258409abf08b
CRs-Fixed: 2313201
When user sets the usenol to 0 and inject the radar, host sends RADAR found
WMI command to firmware. Firmware sends status code as 2 and starts a
2 minutes timer to receive channel change request from host. Since usenol
was set to 0, host does not change the channel. This leads to firmware
timer expiry and sends status code 1 to block all the DFS channels. This is
not desired.
Do not send the RADAR found WMI command to firmware when usenol is 0.
Change-Id: I5884eb343cc419d4c9f5bda3e6eaa7c95c4d4af5
CRs-Fixed: 2276722
For large local variable, it is better to use malloc to prevent the stack
overflow.
Change-Id: Ibf5f516132410122b730bfc1407ea14e0f26d630
CRs-Fixed: 2318354
etsi-precac done list will be updated only after CAC finishes on
the primary channel. This list will not get updated for preCAC on
secondary channel. When channel change happens from intermediate
channel(non-DFS) to weather radar channel after preCAC done, preCAC timeout
for rest of the non-erather radar DFS channels were taken as 10min
since that channel will not be present in etsi-precac done list.
In order to fix this, consider primary channel's CAC timeout only
if neither CAC nor preCAC is done on primary channel.
Change-Id: I274b0f07d7d04644e79262fcecf61036ff79f96e
CRs-fixed: 2312912
In DFS component 0 byte memory is allocated when dfs_nol_count is 0.
We see a print 'allocating 0 bytes at this location' during wifi unload.
Change-Id: I5d6ad36875d634ee5ae6a138656bdb3f538bcdbe
CRs-Fixed: 2316513
In the scheduler_post_message, src_id is now added to
know the source module of the msg. The present scheduler
doesn't know about the same which is scheduler_post_msg.
Replace the scheduler_post_msg with scheduler_post_message.
Change-Id: I954a56eb960e8caab25f0734da2f8badf77cad3a
CRs-Fixed: 2306020
Skip CAC if cac is already started on the same channel or the new channel
is subset of CAC started channel.
Change-Id: I8f6121f1f8d034acf3f0514a60401a3232becaa2
CRs-Fixed: 2309911
For a 2GHz pdev, dfs object is NULL and hence 'dfs is NULL' print is
always seen in some of the dfs functions when user enables the dfs
error logs.
To fix this, add non 5 GHz pdev check before dfs NULL check.
Change-Id: I4702d8c487d5533a2a99b4560471a38992ea9177
CRs-Fixed: 2296853
On NOL timer expiry, timer callback handler dfs_remove_from_nol is called.
It acquires dfs_nol_lock at various instances while accessing the elements
of NOL list like deleting an NOL element, printing or copying the elements
of NOL. Also, there is a thread scheduled in the callback handler
dfs_nol_elem_free_work to free the NOL element memory after all operations.
This thread does a del_timer_sync and hence waits for the timer handler to
complete operation before freeing the NOL timer element.
Consider a case where nol timer expires on channel (say chan 100) and
the timer handler is called on core1 of CPU. After all cleanup operations,
the thread to free NOL timer element is scheduled and acquires an NOL lock.
The lock will be released only after del_timer_sync succeeds in its
operation for which the handler (dfs_remove_from_nol) must have finished
executing on other CPUs.
While the Lock is held by Core1, nol timer expires on another channel
(say chan 120) and timer handler function dfs_remove_from_nol is called
from CPU Core0. In the handler, the same NOL lock is tried to be acquired.
Since it is already held by cleanup thread, it spins. del_timer_sync fails
to succeed in its timer cleanup as the handler function dfs_remove_from_nol
is executing on another CPU. It waits for the handler to finish execution
and handler waits for the lock acquired by the thread. It runs into
a deadlock.
Release the NOL lock before calling del_timer_sync. This will give a
chance for the handler to execute. Acquire the lock again when the next
element is removed from the free list.
CRs-Fixed: 2301063
Change-Id: I822714edee3269ccbb93838e3892796219e1b88e
Add DFS coverage for channel plus width combinations
for overlapping channels in ETSI domain.
Change-Id: Id55f6b42a7ae3bad45c334ff5163a9458b825cd6
CRs-Fixed: 2291635
Maximum among primary CAC timeout and secondary timeout was used to
determime preCAC timeout. Due to this the non-weather radar channels
were also using 600sec as preCAC timeout.
To fix this, CAC on primary channel is done, then use secondary
preCAC timeout.
CRs-fixed: 2303360
Change-Id: If229957d8778a0a7794650e2908da8353fb9e090
Change a few memory allocations of the DFS module from dynamic to
statically allocated memory from .bss segment to avoid any possible
runtime memory allocation failure because of the requested contiguous
memory of a large size.
The static allocation will not work for Multiple RADIO based boards as
it will use the same memory for all the radios.
Change-Id: I93b30a0a3f2f7d91466c930c12e9fae60699605a
CRs-Fixed: 2302097
When the beaconing channel is not affected by radar,
reduce bandwidth of the AP while retaining the beaconing (control) channel.
Since all subchannels were in ISM there is no need to perform CAC.
Random channel selection is run if primary beaconing channel is affected
by radar, wherein CAC will be run for new primary and secondary.
Change-Id: I3c141a02449361e2290086f4c15f7b3eb08c6115
CRs-Fixed: 2284350
Reduce log level for few prints to debug to avoid flooding
of prints to console.
Change-Id: I514585cc87d51ead15fb1f40d45f62023628d9bb
CRs-Fixed: 2296839
1. Rename XXX_timer_free() dfs functions as XXX_timer_detach().
2. Remove the code to free precac_nol_list from
dfs_zero_cac_timer_detach(). This is the redundant code since
dfs_reset() already frees the precac_nol_list.
Change-Id: I878f396795ce0e5c04af379a6db253d07ca66a83
CRs-Fixed: 2262081
When the variable 'false_radar_found' is 1 a set of dfs variables are
supposed to be reset. The reset of the variables are done from within
dfs_radarfound_action_fcc() and dfs_radarfound_action_generic().
However, neither the function dfs_radarfound_action_fcc() nor the
function dfs_radarfound_action_generic() is called when
'false_radar_found' is 1. Therefore, remove resetting of the dfs
variables from the two functions and perform resetting of the
dfs independent of the radar found action.
Change-Id: I120dd8dc7abe13aa9dcaa7a29c10deea06cb8043
CRs-Fixed: 2289775
All the dfs timers that are initialized with qdf_timer_init()
must be freed with qdf_timer_free() to avoid the timer leaks.
Change-Id: I5425f0a84d0e252e3a1dc9b835f1b655fe79a691
CRs-Fixed: 2262081
Add necessary wrapper functions so that other components/umac
can check if a HT20 channel is in NOL.
Change-Id: Ie2cda1fe8f71d829e261ebdcf4563a4c2ff352ae
CRs-Fixed: 2180879
Some dfs domains do not support bin5 radars and bin5 tables
will be null for these domains. So do not log error if number
of bin5 radars are zero.
Change-Id: If9cceae38fa71d1b9b2413f490976ab9f5156086
CRs-Fixed: 2285127