Commit Graph

12 Commits

Author SHA1 Message Date
Shashikala Prabhu
ee42cb1f26 qcacmn: Use chan freq for restricted 80+80 MHz boundary check
Instead of channel number, use channel frequency for restricted 80+80MHz
boundary  check.

Change-Id: I2fa65c3b1d102acd6b64b4c6e1583d2bc29484d1
CRs-Fixed: 2645155
2020-03-27 15:00:05 -07:00
Vignesh Mohan
2b0ff06748 qcacmn: Add support for Bangradar with detector ID
Provide support for bangradar with detector ID as one of the parameters.
Add the parameter as part of the packed arguments to be sent to FW.

Also add APIs for basic sanity check of bangradar params and packing
bangradar params inside an 32 bit unsigned integer.

CRs-Fixed: 2646549
Change-Id: Ie781bc9421b7ac0d407eb01814c9242c7f988884
2020-03-23 23:13:52 -07: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
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
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 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
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
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
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
Priyadarshnee S
d3173ca81c qcacmn: Handle scan failure and vdev start caused by NOL violation
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
2018-10-18 02:17:07 -07:00
Shaakir Mohamed
cbc53dd023 qcacmn: Add support for reduced BW-Agile DFS
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
2018-08-21 01:51:26 -07:00
Shashikala Prabhu
2a9f2a0525 qcacmn: Rename dfs_ioctl.h as wlan_dfs_ioctl.h
Rename dfs_ioctl.h file as wlan_dfs_ioctl.h and
move it from cmn_services directory to dfs dispatcher.

Change-Id: I75e0337bd84b71cf77975656423f78f9b016285f
CRs-Fixed: 2127833
2017-11-21 07:32:05 -08:00