Commit Graph

142 Commits

Author SHA1 Message Date
Liangwei Dong
bb0b78c688 qcacmn: Set dfs_set_cfreq2 with correct DFS flag
In MCL code, QCA_DFS_NOL_OFFLOAD is no defined,
which causes the utils_is_dfs_cfreq2_ch always return
"false".
In function vdev_mgr_start_param_update
the "dfs_set_cfreq2" needs to be set correct dfs flag from
utils_is_dfs_cfreq2_ch so that vdev start wmi command will include
correct DFS flag - WMI_CHAN_FLAG_DFS_CFREQ2 for AP home channel.

Move utils_is_dfs_cfreq2_ch function out of WLAN_DFS_FULL_OFFLOAD
and QCA_DFS_NOL_OFFLOAD build flag.

Change-Id: I341db02c4db3ad3b21d8b2c115b2baffc3df3164
CRs-Fixed: 2619273
2020-02-12 09:55:06 -08:00
Amruta Kulkarni
65f217ba99 qcacmn: Cleanup for function wlan_reg_is_dfs_ch()
Replace wlan_reg_is_dfs_ch() with wlan_reg_is_dfs_for_freq()

Change-Id: Idb40beeea3ba07e133f3346b46998ae9ac549ba7
CRs-Fixed: 2615754
2020-02-10 20:36:44 -08:00
Vignesh Mohan
86eba5902e qcacmn: Reinit DFS after HW mode switch (phase 2)
Supported dynamic HW mode switches:
DBS (full band 5G and 2G) <-> DBS_SBS (low band 5G, high band 5G and 2G)

Description of the changes:

1. NOL conversion:
  a. Introduce a temporary NOL list copy structure in DFS psoc obj.
  b. When mode switch is triggered:
    i.   Stop the NOL timers and clear the data, to avoid processing NOL
         expiry during mode switch.
    ii.  Allocate the psoc NOL copy for the target num_radios.
    iii. Store the NOL data of each radio to the target pdev ID
         (pdev ID after mode switch) in the psoc NOL copy,
	 using a unified mux/demux API.
  c. After mode switch is completed:
    i.   Resume NOL by re-initializing the list from the temporary psoc
         copy.
    ii.  Free the psoc copy after mode switch is complete.
    iii. Note: changes are made to support pause and resume of NOL,
         increasing NOL timeout by a few milliseconds.

2. PreCAC list conversion:
  a. When mode switch is triggered:
    i. Stop the existing preCAC timer and send ADFS abort command to FW.
  b. When mode switch is completed:
    i.  Unify/separate the preCAC list if the target mode is DBS/DBS_SBS
        respectively, using a single API.
    ii. Start ADFS again.

3. Radar detection lock:
  a. While detecting radar, acquire a lock to avoid handling user triggered
     mode_switch during this process. Release the lock once radar
     processing is completed and CSA start is triggered.

4. Radar detection/CAC completion defer during mode switch:
  a. While detecting radar or CAC completion, check if mode switch is
     in progress. If yes, defer the processing and wait for mode switch to
     complete before handling the events.
  b. Note: Precedence is Radar over CAC, i.e., if CAC processing is waiting
     and radar is received, CAC completion is no longer handled.

CRs-Fixed: 2580403
Change-Id: I506f3b569bad2e351c6f336e50f203cf5fa8b223
2020-01-11 22:28:17 -08:00
Li Feng
106027ba1b qcacmn: Correct chan num assignment
Correct chan num assignment in utils_dfs_get_channel_list.

Change-Id: I18f09b21de80c19f8b67acfd56f394c0e9949faf
CRs-Fixed: 2584402
2019-12-16 18:21:34 -08:00
Shashikala Prabhu
52ee85cf6f qcacmn: Add support to choose 160MHz random channel for Pine
Pine supports restricted 80+80 MHz only on cfreq=5690 and cfreq=5775. If AP
detects RADAR in this channel, it chooses new 80+80 MHz random channel
which is not supported by Pine because, notion of 80+80 is not present in
current channel in regulatory component. Hence, as a temporary fix we
change the invalid 80+80 MHz channel to 160 MHz or lower.

Change-Id: I749607236a1dd7b9c7aa93ff889b65adcbb4191c
CRs-Fixed: 2570057
2019-12-06 01:52:32 -08:00
Shashikala Prabhu
6810d038e9 qcacmn: Fix issues in random channel selection algorithm
Remove dummy function dfs_remove_cur_ch_from_list(). This logic is already
implemented in dfs_apply_rules().

In dfs_apply_rules()/dfs_apply_rules_for_freq(), skip all the HT20 channels
of the curent channel when DFS_RANDOM_CH_FLAG_NO_CURR_OPE_CH flag is set.

In dfs_prepare_random_channel_for_freq(), allocate correct size of memory
for leakage_adjusted_lst array.

Use DFS_80_NUM_SUB_CHANNEL macro instead of DFS_80_NUM_SUB_CHANNEL_FREQ to
choose correct 80MHz channel.

Change-Id: Ie318d667ff1b0caef3032b7aa57f0ddfb7e1f1a7
CRs-Fixed: 2570055
2019-12-01 17:42:33 -08:00
bings
5a40049a64 qcacmn: Disable dfs phyerr offload when no sap/go in DFS channel
As FW requires, send WMI_PDEV_DFS_PHYERR_OFFLOAD_DISABLE_CMDID when there
is no beaconing session in DFS channel for FW which supports dfs offload.

Change-Id: I73b86328be6eb132de70bd10406495fbaefcab67
CRs-Fixed: 2554083
2019-11-06 14:06:50 -08:00
Vignesh Mohan
42bc1a9d68 qcacmn: Reset dfs_precac_active flag only for the calling pdev
When tgt_dfs_set_precac_state API is called, the dfs_precac_active
boolean is set to false for all pdevs. This results in preCAC
being stopped for all pdevs in DBS_SBS mode when one of the
pdev becomes inactive.

Reset dfs_precac_active flag only for the calling pdev and
set the global boolean 'precac_state_started' to false only
if all the individual pdev flags are inactive.

Change-Id: I73fcacb911a5eb9028b03aa1c86775a66f2a7fc9
CRs-Fixed: 2556734
2019-11-05 17:48:32 -08:00
Priyadarshnee S
54e3ffe37f qcacmn: Implement a dispatcher API to retrieve precac chan state
Implement a frequency API based dispatcher function to retrieve
the precac channel state of a given channel frequency.

Change-Id: Iefd70c8b6e60a42f8dc95db5f8a2e8c66ae013ea
CRs-Fixed: 2526372
2019-11-01 16:59:56 -07:00
gaurank kathpalia
d68b2f4f19 qcacmn: Use freq instead of channel number to avoid collision
To avoid IEEE channel number space collision,
use freq in structure dfs_acs_info.

Change-Id: I48813d12819f03495f196e634e9fcb422105f304
CRs-Fixed: 2555897
2019-11-01 08:17:46 -07:00
Priyadarshnee S
6e08d66883 qcacmn: Register DFS callbacks
To avoid "channel number" collision that was introduced after
6Ghz band was added to the driver, frequency based DFS callbacks are
registered with dfs_to_mlme structure.

Change-Id: Id937059329e4df25a49397c1c01251f81afc1fe6
CRs-Fixed: 2526372
2019-10-31 02:44:59 -07:00
Priyadarshnee S
38da66f0dc qcacmn: Add frequency APIS in DFS Core, TGT DFS and DFS Utils
To avoid "channel number" collision with the introduction of
6GHZ frequency band, add frequency-based APIs to DFS Core.
Also, do not remove the old IEEE channel-number-based APIs that are still
referenced.

The DFS APIs of Target-IF layer and DFS UTILS in DFS dispatcher layer are
included as a part of this change as they invoke DFS Core APIs and are
dependent.

CRs-Fixed: 2526372
Change-Id: I7a00ca5796e9c81527438c326c2d41de1147ffee
2019-10-27 15:19:17 -07:00
Priyadarshnee S
70e1b6f859 qcacmn: Add frequency APIs in DFS Dispatcher
To avoid "channel number" space collision with the introduction of
6GHZ frequency band, add frequency based APIs in DFS dispatcher.

Change-Id: I349093e134b04ee31d046eb4da108522bc74a51a
CRs-Fixed: 2526372
2019-10-23 05:34:53 -07:00
Manikandan Mohan
d09f45e40f qcacmn: Update for policy manager frequency based APIs
Due to channel number ambiguity with introduction of 6Ghz operation
policy manager APIs are updated to use frequency values instead
of channel number. Update corresponding caller functions to
adapt for frequency usage.

Change-Id: Icf76480cdd0fbd98d9b5f559d9bfdc5d5a35dc7b
CRs-fixed: 2550098
2019-10-22 18:10:18 -07:00
Vignesh U
4898b2aa3c qcacmn: Introduce dfs_prevchan and use it to assess if CAC is required
The decision to do CAC when a vap is coming up should be taken based on
the previous channel and current channel. Introduce previous channel
in DFS structure and update it when the current channel is updated.

Use the previous channel and current channel in DFS structure to
decide whether the CAC should be done or not when the vap is coming
up.

Change-Id: Ia359025d5029713c32696dacee5b89618a1c9707
CRs-Fixed: 2538653
2019-10-19 10:58:59 -07:00
Vignesh Mohan
b07c34cc2d qcacmn: Remove redundant ETSI preCAC APIs
As part of the ETSI preCAC feature, every 20MHz channel that is CACed
and not in NOL is maintained in a list which is then checked during every
channel switch for CAC reuse (avoiding CAC).

With the introduction of preCAC list(Binary Search Forest) for
20, 40 and 80MHz channels which also includes the current channel CAC
information, the ETSI preCAC list has become redundant.

Remove all APIs and changes that support the redundant ETSI preCAC list.

Change-Id: Ie71e2fda3f6f62ec6ea312c3bf0bdfc53a7df003
CRs-Fixed: 2484864
2019-10-10 00:51:50 -07:00
Hangtian Zhu
62547ed826 qcacmn: Enable configurable dfs_pri_multiplier
Enable configurable dfs_pri_multiplier. The ETSI typ2 type3 radar
detection ratio is lower than expected(>80%) while channel loading is
high(>30%). The host improvement for this are:
	1. Add configurable dfs_pri_multiplier, controlled by
	   DFS_PRI_MULTIPLIER. Default value 2, min 1, max 10.
	2. Lower adrastea ETSI type 2/3/4 radar filter rssi_threshold,
	   controlled by DFS_OVERRIDE_RF_THRESHOLD, dfs log shows that
	   QCS405 target report RSSI range [18, 45] while radar power
	   is 3 dbm. By using default rssi_threshold 24 will reject
	   many radar pulses, which leads to low detection ratio.
	3. Calculate deltapri for each searchpri based on dfs_pri_multiplier
	   in dfs_count_the_other_delay_elements(), check deltapri
	   between [1, dfs_pri_multiplier] * refpri and searchpri, if
	   the primargin is desired, mark it as matched pulse.
	4. Pick lowpri as refpri for the radar filter with
	   rf_ignore_pri_window equals to 0 while DFS_PRI_MULTIPLIER is
	   enabled. Observed original findref logic has some problems
	   which selects refpri is bigger than lowpri, which leads to
	   the lowpri pulses pri_match are set to 0, and in this case,
	   radar was not detected. Example for the issue, assume
	   rf->rf_pulseid 34 (ETSI type 2) has 7 pulses with pri:
	   1489, 2978, 2978, 2978, 1489, 2978, 1489 us in this case,
	   highscore is 4 (2978), scoreindex is 5, refpri is 2978, which
	   leads to: index 0, 4, 6 pulses with pri_match 0 in
	   dfs_count_the_other_delay_elements(). The fix is to select
	   lowpri as refpri(1489 in this case).

Change-Id: I1f3ca3298c9ab1f1e2651ad6b4a0a4810f83f8a1
CRs-Fixed: 2531811
2019-10-01 02:16:19 -07:00
Vignesh Mohan
fe0b8b48db qcacmn: Maintain FW ADFS support flags in dfs
Agile DFS support depends on the Firmware's aDFS support. This
information is propagated to the HOST in the WMI ready event as a flag.
This flag was not used by HOST before enabling agile DFS which resulted
in preCAC being enabled for the FW that does not support them.

Also, for certain chainmask configurations, aDFS should be enabled
only if the current pdev is operating in non 160 BW.
Introduce two new flags in the DFS object:
1. dfs_fw_adfs_support_160
2. dfs_fw_adfs_support_non_160

which specify FW support for ADFS for pdevs in 160 BW and non 160 BW
respectively. Make appropriate changes in is_agile_precac_enabled
check that includes fw support for the current operating bandwidth.

Also rename "dfs_agile_precac_enable" to "dfs_agile_precac_ucfg" and
"dfs_precac_enable" to dfs_legacy_precac_ucfg" in the dfs structure
to properly indicate what those booleans represent.

Change-Id: I202ead8ef109c707bfbda488064ecaa72a3f737f
CRs-Fixed: 2521654
2019-09-24 07:37:39 -07:00
Vignesh Mohan
7d7cb84e5e qcacmn: Restructure dfs_check_for_cac_start API
In dfs_check_for_cac_start API, the following checks (in addition
to few more unchanged ones) are done:
  1. If CAC timer is running, is the current channel a subset of the
     CAC started channel (dfs_cac_started_chan).
  2. If CAC timer is not running, is the current channel a subset of the
     last CAC started channel and was the last CAC not aborted.

The variable dfs_cac_started_chan is filled when CAC timer is started. It
is then reset only if, after vdev response, if the new channel is non DFS
or when the next CAC timer is started (with new channel value).

With the above logic, the cases where CAC is not skipped for a DFS
channel (e.g. preCACed channel) is not taken care of.

Consider the following scenario:
 1. The current channel is 100 and the preCAC is completed on all
    channels.
 2. When CAC is started on this channel (100), the dfs_cac_started_chan
    becomes 100.
 3. If radar is found on 100 and the new channel selected is one
    of the preCACed DFS channels, CAC is skipped.
    dfs_cac_started_chan still remains 100.
 4. After NOL timeout, if the radio is switched back to 100, the last
    CAC started channel is 100 and new channel is also 100, which results
    in CAC being skipped.

Rewrite the dfs_check_for_cac_start logic by checking the following:
  1. If CAC timer is running, check if the current channel is a
     subset of dfs_cac_started_chan.
  2. If CAC timer is not running, check if the current channel is a
     subset of previous channel (input).

Clear the dfs_cac_started_chan when the CAC timer stops or expires.

Also, in the API "dfs_is_subset_channel", while checking if one channel
is a subset of another, the DFS subchannels are determined based on the
channel flags. This is handled for two cases:
 1. If secondary channel alone is DFS.
 2. If primary and secondary channels are DFS.

The case "If primary channel alone is DFS" is not handled.

In case of channel 116HT80_80 with secondary 80 being non DFS,
all subchannels are considered as DFS subchannels.

Add a new API "dfs_find_dfs_sub_channels" where all the above
mentioned cases of DFS channels are handled to find proper DFS
subchannels.

Change-Id: I893430ff010746c84ce340323b25c17af25bc45a
CRs-Fixed: 2504840
2019-09-08 06:22:45 -07:00
bings
208ab01f20 qcacmn: Trigger eWNI_SME_DFS_RADAR_FOUND once for one radar
Currently eWNI_SME_DFS_RADAR_FOUND is triggered for every vdev
attached to the pdev in which radar is found. It is incorrect
because when handling one eWNI_SME_DFS_RADAR_FOUND event, every
sap in the DFS channel processes the event.

Trigger eWNI_SME_DFS_RADAR_FOUND once for one radar detection.

Change-Id: I72f8a2a34b670bd86f07d0caabf2ee8f96c962be
CRs-Fixed: 2504793
2019-08-16 02:58:00 -07:00
Shreedhar Parande
45d12fa2de qcacmn: Separate GET APIs for precac and agile precac flags
Currently a single API(dfs_get_precac_enable) is used to get
dfs_precac_enable and dfs_agile_precac_enable. This API is
wrongly returning value for dfs_precac_enable since agile
capability is set even for Cascade.

Separate 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: I08b0cbcd29c320a345865e3e9456ce3e809e26a6
CRs-fixed: 2501266
2019-08-12 12:24:17 -07:00
Priyadarshnee S
4ae200caad qcacmn: Add DFS APIs to reset ADFS and reinitialize DFS Timers
Add DFS APIs to
1. reset Agile DFS config
2. reinitialize DFS Timers

Change-Id: I7ede1b961f899f2e713b9be56aa8f5fe29360d66
CRs-Fixed: 2481535
2019-08-02 08:32:45 -07:00
Vignesh U
2810202a98 qcacmn: Add support to inject synthetic radar pulses
Add structure definitions, function declarations and
definitions supporting radartool to inject synthetic
radar pulses.

Change-Id: Ie7af0437bd2d6051bc3cb80b6e88f4337eefe77b
CRs-Fixed: 2484584
2019-08-01 01:40:21 -07:00
Vignesh Mohan
a1a1945c1c qcacmn: Configure agile preCAC timeout values
Send proper minimum and maximum agile preCAC timeout values to the target
as part of starting agile DFS detector. Add a common agile preCAC
parameter structure with the timeout values, channel and width fields
which are to be sent as part of configuring agile detector.

Change-Id: If5f5b179aa12a6c549cb9a4402aa10e957129d78
CRs-Fixed: 2482929
2019-07-23 13:55:29 -07:00
Shashikala Prabhu
41e5f80e2f qcacmn: Do not print DFS error message for 2.4 GHz pdev
For a 2.4 GHz pdev, dfs object is NULL and hence 'dfs is NULL' print is
in tgt_dfs_set_agile_precac_state().

To fix this, add non 5 GHz pdev check before dfs NULL check.

Change-Id: I32cf622d7b769ce841d30de538527639b87f459b
CRs-Fixed: 2490145
2019-07-23 13:55:25 -07:00
Vignesh Mohan
242d8ded04 qcacmn: Provide 20/40/80MHz Agile DFS support
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.

Modify the following APIs to support the new framework.
 1. Pick a channel for preCAC / Agile CAC.
    (dfs_get_chan_from_precac_list, dfs_find_chan_for_agile_precac)
 2. Reset the preCAC lists. (dfs_reset_precaclists)
 3. If preCAC is done on a channel. (dfs_is_precac_done_on_ht20_40_80_chan,
    dfs_is_precac_done_on_ht8080_ht160_chan)
 4. Mark the channel as preCAC done / NOL. (dfs_mark_precac_nol,
    dfs_mark_precac_done)

CRs-Fixed: 2464929
Change-Id: I6029ed919bd2275f46c4712ce1637ede4995557f
2019-07-12 00:53:33 -07:00
Vignesh Mohan
d01178025b qcacmn: Reset agile precac frequency during channel change
During abrupt channel change (e.g. iwconfig), the vap is brought
down and then brought back up. Now if the Agile detector is running
during this period, the detector is turned off as part of vap down.
When the vap comes back up, as part of starting the Agile detector,
a status of OCAC_SUCCESS and frequency of dfs->dfs_agile_precac_freq
is sent to the API (dfs_start_agile_precac_timer). The
dfs_agile_precac_freq variable was meant to be 0 as part of starting
the timer but since it was never cleared, that freq was moved to
Agile CAC done state immediately.

Clear the dfs_agile_precac_freq as part of vap down in addition to
stopping the Agile precac timer.

Change-Id: Ife117277a5d85911ae310e19a406f88fb9a544f0
CRs-Fixed: 2467077
2019-07-10 01:33:10 -07:00
Liangwei Dong
b2569fd660 qcacmn: Support p2p GO random chan selection
MCL needs the interface type to query policy mgr for PCL
when selecting random channel. The existing API
utils_dfs_get_random_channel doesn't provide the vdev
type. Add new utils_dfs_get_vdev_random_channel
with vdev parameter to support P2P GO random channel
selection.

Change-Id: I0c6841b1692baca92730a6be73653282c98f1682
CRs-Fixed: 2467871
2019-07-09 18:51:18 -07:00
gaurank kathpalia
543c9b4909 qcacmn: Filter the channel list according to acs cfg
Currently the driver checks whether the DFS channel is
in the range of acs channel list given, i.e the start
and end channel, which is not always correct as the channel
range does not imply that all channels in that range are present.

Fix is to explicitly check for the number of channels, and
compare each channel in the acs channel list with the DFS
channel.

Change-Id: Ib17c5e549a2c62652a6333d5d13ca8ff5a7b1674
CRs-Fixed: 2466228
2019-06-14 12:58:24 -07:00
phadiman
b68fa39efd qcacmn: Add DFS Radar Event Notifications
Add event notifications to userspace
    1. Radar Detect
    2. CAC Start
    3. CAC Complete
    4. NOL Start
    5. NOL Complete

CRs-Fixed: 2448199
Change-Id: I5deaa53c922fe4e149e7198b287e31d3876d49d4
2019-05-13 13:11:38 -07:00
Visudha Sathurappan
fbd467f5a6 qcacmn: Fix compilation errors when ATH_SUPPORT_DFS is disabled
Fix compilation errors when disabling ATH_SUPPORT_DFS

Change-Id: I229ae5086070badec899b5b95be3ce389a3247ba
2019-05-08 02:51:43 -07:00
Hariharan Basuthkar
1720fd98a6 qcacmn: After NOL timeout add channels to ETSI PreCAC Required List
After NOL timeout, if ETSI PreCAC is supported, add the HT20 Channel
to ETSI PreCAC Required List. Also, move NOL detach after ETSI PreCAC
detach to avoid channels being added to ETSI PreCAC Required List when
NOL expiry happens after ETSI PreCAC detach.

Change-Id: I9cdb359eb6905f4f4cfb9d1c784865af0bf39119
CRs-Fixed: 2403489
2019-04-22 18:21:14 -07:00
Naga
9dad9767b1 qcacmn: Cleanup duplicate fields in vdev_mlme
Add change to cleanup duplicate fields of
of vdev_mlme, which are also in mlme_channel_param
and their dependencies while updating
vdev_start_param. Cleanup unused mlme_cfg_ids.

Change-Id: Ie32971283a337f04692c0c0bc7f41fff75c090c3
CRs-Fixed: 2407953
2019-04-11 01:14:21 -07:00
Harprit Chhabada
2a1bc9e488 qcacmn: Clean ucfg_mlme components from wlan_hdd_cfg80211_start_bss
Get the tx_leakage_threshold value directly in
tgt_dfs_set_tx_leakage_threshold from
ucfg_mlme_get_sap_tx_leakage_threshold instead
of passing from wlan_hdd_cfg80211_start_bss.

Change-Id: If8f5b85c03c01b984b7c05d72d40baca0e19c3cc
CRs-Fixed: 2418358
2019-04-03 20:28:07 -07:00
Priyadarshnee S
8202412c0d qcacmn: Rename "dfs_freq_is_in_nol" to "dfs_is_freq_in_nol"
Rename "dfs_freq_is_in_nol" to "dfs_is_freq_in_nol"

CRs-Fixed: 2417878
Change-Id: Iedd79e9ea51a84d0458e643ddafa2797ed5f337c
2019-03-26 10:30:24 -07:00
Jeff Johnson
cba07b4883 qcacmn: dfs: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within umac dfs replace any such comparisons with
logical operations performed on the pointer itself.

Change-Id: Ib67c0ebda22f93a353f8f3f1be1e1ab10b15db4a
CRs-Fixed: 2420151
2019-03-22 08:47:30 -07:00
Shaakir Mohamed
7a71538673 qcacmn: Add support for Agile DFS feature
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 receives 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 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 Iron radio has
two synthesizers, one of which can perform A-DFS.
Host driver configures an A-DFS channel along with maintaining
pre-CAC Done list of channels. PreCAC list caching of channels
is currently 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 part of event params
has information if the preCAC is successful or not. HOST also receives
indication through radar indication event handler, upon RADAR detect.
The detection is read as agile channel RADAR using the detector id value.

For SBS mode, there can be 2 pdev's which can comprise of DFS channels.
Although the preCAC list is separate for each pdev, preCAC timer is
limited to a single pdev.

The following commands are to set/get preCAC enable. Prerequisite to
enable preCAC includes regdomain to be in ETSI along with agile capability
enabled in the target.

	iwpriv wifiX get_preCACEn
	iwpriv wifiX preCACEn 0/1

Change-Id: Id9f022f885ccd9200167cdbc779a811d622d09da
CRs-Fixed: 2385536
2019-03-14 14:28:22 -07:00
Madhvapathi Sriram
b73fc282d8 qcacmn: Remove error log for qdf_mem_malloc in umac files
qdf layer already has the error trace

Change-Id: I2ea22fe0e3e59b9d41ac21142615ffb96227abaf
CRs-Fixed: 2376418
2019-03-04 07:30:21 -08:00
Shreedhar Parande
bad46ee2da qcacmn: Enhancement of auto channel switch zerowait PreCAC for 160MHz mode
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: I1f2db0f38b42fce2f407988041edfea9c49c58e1
CRs-fixed: 2395431
2019-03-01 11:14:42 -08:00
Akshay Kosigi
1726ae21c5 qcacmn: Add API to update cmn vdev mlme structures
Add API to update cmn vdev mlme structures,
with the addition of new members to the new mlme
vdev structure,new api's are required to update
those members which will be subsequently used the
new mlme target if layer to send commands to the firmware

Change-Id: I9618613c0ad00f78003cd32951b30b631934ba71
2019-02-24 20:04:41 -08:00
Vignesh Mohan
53d6d1b215 qcacmn: Send all args with unit test command for bangradar
The unit test command being sent to FW for bangradar did not have
enough arguments to perform subchannel marking as expected.

Pack in the existing uint32_t argument the following information
	1). Segment ID (2 bits)
	2). Chirp Information (1 bit)
	3). Frequency Offset (8 bits [can be signed]).
that is being sent in the unit test command structure.

Change-Id: I7cc567f7bdc9367ee0f51080d0c54c55aa3e4a6b
CRs-Fixed: 2342535
2019-01-30 02:32:14 -08:00
Vignesh Mohan
94e1f2308f qcacmn: Unify radar simulation commands
Replace all three radar simulation commands with a single variant which
will perform required functionality based on its number of arguments.

Existing variants of radar simulation commands:

    1). Bangradar:
          Description: Adds all subchannels of segment ID "0" in the
                       current channel to NOL.
          Syntax: radartool -i wifi0 bangradar.

    2). Second Segment Bangradar:
          Description: Adds all subchannels of segment ID "1" of the
                       current channel to NOL.
          Syntax: radartool -i wifi0 secondSegmentBangradar.

    3). Enhanced Bangradar:
          Description: Adds the radar infected subchannels computed based
                       on segment ID (X), chirp information (Y) and
                       frequency offset (Z) to NOL.
          Syntax: radartool -i wifi0 bangradarenh X Y Z.
                  where,
                    X - Segment ID.
                    Y - Is chirp/non chirp.
                    Z - Frequency offset.

New radar simulation command:
     Bangradar:
     Types of usage:
       1). No arguments:
           Description: Adds all subchannels in the current channel to NOL.
           Syntax: radartool -i wifi0 bangradar.

       2). 1 Argument:
           Description: Adds all subchannels of segment ID "X" of the
                        current channel to NOL.
           Syntax: radartool -i wifi0 bangradar X

       3). 3 Arguments:
           Description: Adds the radar infected subchannels computed based
                        on segment ID (X), chirp information (Y) and
                        frequency offset (Z) to NOL.
           Syntax: radartool -i wifi0 bangradar X Y Z
                  where,
                    X - Segment ID.
                    Y - Is chirp/non chirp.
                    Z - Frequency offset.

All other combinations of arguments will result in error (insufficient
arguments).

Change-Id: I10c86d78bf46c075e65f93ad0f0143f328f5c7be
CRs-Fixed: 2373228
2019-01-24 12:30:31 -08:00
Shashikala Prabhu
7517a8d7b9 qcacmn: Call regdb wrapper functions from other components
Do not call regdb core functions from other components directly.
Instead, call regdb dispatcher  functions.

Also, wlan_objmgr_vdev_obj.h file is removed from reg_services.h file in
Ie43acc03a5c35200f3e43bc978b792d5047eeb77 and reg_services.h is removed
from wlan_reg_services_api.h in I891b14fac7a4eddf2697d2ecdc0ac4a82046f532.
Therefore to fix "'struct wlan_channel' declared inside parameter list"
error in wlan_dfs_utils_api.h file, I have included wlan_objmgr_vdev_obj.h
file before wlan_dfs_utils_api.h in scan, dfs and wmi component.

Change-Id: Id8816f5137c3b1f9200c59fc3f9041980631f22f
CRs-Fixed: 2349173
2019-01-23 15:14:32 -08:00
Hariharan Basuthkar
a12d19d67b qcacmn: Change utils_fill_dfs_chan_info to dfs_fill_chan_info
Change the name of utils_fill_dfs_chan_info to dfs_fill_chan_info since it
is not used by any components other than DFS.

Change-Id: I91e8d2326a830303fbad4564aa13655e50caa4c4
CRs-Fixed: 2375672
2019-01-22 00:18:41 -08:00
Arif Hussain
273e871dc0 qcacmn: Add Japan W53 channel flag support
Add support to exclude/include Japan W53 channels
in random channel selection.

Change-Id: I359d6bb68e2737b64b77f6f3ad27f83fd33d3da8
CRs-Fixed: 2371013
2019-01-01 17:06:14 -08:00
Visudha Sathurappan
bbd9d427a7 qcacmn: Removed unused DFS function
Remove unused mlme function to get dfs object and replace
it with the dfs equivalent.

Change-Id: I3ffadb77072fa119957469e0bf97fa4a80f99ac9
CRs-Fixed: 2368988
2018-12-24 05:44:53 -08:00
Visudha Sathurappan
3b5c6e9899 qcacmn: Clean up of DFS functions
Replace mlme functions to get dfs objects by dfs functions.

Change-Id: Ic8432ce3c210a4c1233fe1c715d00f5abb37ba04
CRs-Fixed: 2363068
2018-12-11 01:43:10 -08:00
Shaakir Mohamed
25737a45e3 qcacmn: Add APIs to enable/disable BW Reduction
Add functions to enable/disable BW-Agile DFS Reduction

Change-Id: I1cc355f06a2027b229ca2001671ddb69c7cff4e6
CRs-Fixed: 2302983
2018-12-06 17:51:18 -08:00
Hariharan Basuthkar
738320eef9 qcacmn: Bring Up STA without dissociation when AP switches to DFS Channel
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
2018-12-05 03:57:51 -08:00
Vignesh Mohan
eba709480e qcacmn: Receive and parse RCSA with subchannel information
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
2018-12-05 00:36:00 -08:00