Commit Graph

140 Commits

Author SHA1 Message Date
Vignesh Mohan
4974032991 qcacmn: Add dfs tgt API to set Sub Channel Marking
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
2018-11-23 10:13:16 -08:00
Vignesh U
c008454014 qcacmn: Add support to enable/disable NOL subchannel marking
Add DFS function to enable or disable NOL subchannel marking.

Change-Id: Ibb6dbdb373af5b328c813c3b80b0f2296f644406
CRs-Fixed: 2334258
2018-11-23 10:13:13 -08:00
Shashikala Prabhu
62ce2260e9 qcacmn: Use regdb component to set/get NOL-History channel list
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
2018-11-05 13:31:52 -08:00
Shashikala Prabhu
80d0451982 qcacmn: Add API to clear CAC started channel
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
2018-10-21 23:14:24 -07: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
Vignesh U
aea8656c81 qcacmn: Update nol properly
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
2018-10-10 09:18:09 -07:00
Shashikala Prabhu
c80456220e qcacmn: Move dfs cac start condition checks to dfs component
Move dfs-cac-start-condition checks to dfs component from MLME component.

Change-Id: Iaab45ce8e298a237b110f3046593fc5801e1673e
CRs-Fixed: 2299517
2018-10-08 22:20:18 -07:00
Abhijit Pradhan
9da501e634 qcacmn: Use regdb channels to fill etsi precac required list
Use regdb channels to fill etsi precac required list.

Change-Id: I4b9462c0c69150cf2288e17be0c46029d89e4765
CRs-Fixed: 2318558
2018-10-06 00:01:40 -07:00
bings
eeeeaded77 qcacmn: Use malloc to prevent stack overflow
For large local variable, it is better to use malloc to prevent the stack
overflow.

Change-Id: Ibf5f516132410122b730bfc1407ea14e0f26d630
CRs-Fixed: 2318354
2018-09-21 17:46:08 -07:00
gaurank kathpalia
f6e13db4b6 qcacmn: Add src, and dst id support in DFS
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
2018-09-17 02:58:15 -07:00
Shashikala Prabhu
6b4d64dbfa qcacmn: Add APIs to skip DFS CAC
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
2018-09-11 16:42:17 -07:00
Shashikala Prabhu
a5b0851b36 qcacmn: Do not print DFS error message for non 5 GHz pdev
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
2018-09-07 17:22:56 -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
Abhijit Pradhan
01abdac6a0 qcacmn: Free dfs timers during wifi driver unload
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
2018-08-08 09:12:03 -07:00
Shashikala Prabhu
ce86ecdfd3 qcacmn: Add a public API to check if channel is in NOL
Add necessary wrapper functions so that other components/umac
can check if a HT20 channel is in NOL.

Change-Id: Ie2cda1fe8f71d829e261ebdcf4563a4c2ff352ae
CRs-Fixed: 2180879
2018-08-02 18:30:08 -07:00
Shreedhar Parande
62f2bb9136 qcacmn: PreCAC auto channel switch support
Changes to switch to the preferred preCAC channel after the
preCAC is done.
User can configure non-DFS channel as an intermediate
channel to reduce AP bringup time, and configure the DFS
channel as usual. PreCAC Logic will use the intermediate
channel as the home channel and will prioritize the DFS channel
to start preCAC first and switch automatically after the preCAC
timeout.
Command to configure intermediate non-DFS channel
iwpriv wifiX interCACChan <non-DFS channel num>
Assumption:
Intermediate channel should be configured before configuring
the DFS channel as operating channel.

Change-Id: I1dc00fa395aec53bfe5a6361095cd7d77ced503c
CRs-Fixed: 2272085
2018-07-12 01:33:19 -07:00
Shashikala Prabhu
e874411d1e qcacmn: Configure Allowed Channels and ACS Allowed Channels
Description:-
'wifitool athX setprimarychans ch1 ch2 ... chn' will restart athX if
current channel is not in primary allowed channel list.
'wifitool athX getprimarychans' to get primary allowed channel list.
The channel selected by ACS, random channel selection will be ignored
if it's not present in primary allowed channel list.
When user sets the channel using iwconfig or doth_chanswitch, if the
channel is not present in the primary allowed channel list then HOST
does not honour the channel change.

Change-Id: If37592d4246334a3c8fb17d44aaead7a6f9e969e
CRs-Fixed: 2264102
2018-06-28 23:38:59 -07:00
Abhijit Pradhan
56fe2450b5 qcacmn: Cleanup DFS function and corresponding function pointer
Remove the function lmac_is_mode_offload and corresponding function pointer
dfs_is_mode_offload since it is not used by the DFS component.

Change-Id: Ie55f5c8dc89466fa992451373819d148680318f1
CRs-Fixed: 2252565
2018-06-27 05:33:01 -07:00
Abhijit Pradhan
e556063bc7 qcacmn: Rename a DFS CAC function and corresponding function pointer
Rename the function dfs_mlme_deliver_event_up_afrer_cac() to
dfs_mlme_deliver_event_up_after_cac and rename the function pointer
mlme_deliver_event_up_afrer_ca to mlme_deliver_event_up_after_cac

Change-Id: I29c2094a0b45c9583b897e088ce9938c759e26ba
CRs-Fixed: 2251792
2018-06-25 17:37:30 -07:00
Arif Hussain
ecef5a4024 qcacmn: Add api to get dfs offload service bit in target_if
Add api to get dfs offload service bit in target_if.

Change-Id: I771ae8a2194250769d6e6d609b0a1863012110ea
CRs-Fixed: 2264477
2018-06-25 10:02:30 -07:00
Shaakir Mohamed
a0895b9989 qcacmn: Add support for ETSI pre-CAC cleared list
In ETSI domain, after CAC, channel is added to ETSI CAC cleared list,
so that next time it can skip CAC if channel is already present in this
list. If radar found, remove channel(s) from this list indicating that
when channel(s) is/are selected in future, the CAC needs to be re-done.

Change-Id: If6b31ecda2ab159188e7724bce7d1c2d8375fa3c
CRs-Fixed: 2143266
2018-06-20 21:23:28 -07:00
Naveen Rawat
8d36892372 qcacmn: Fix OOB access in utils_dfs_get_chan_list
Fix out of bound access for array "weight_list" with size 55 bytes
and declared on stack of function utils_dfs_get_chan_list. Same memory
is accessed in function policy_mgr_update_with_safe_channel_list with
index 127, leading to OOB access.

Change-Id: Ib7ba74e0096e90fd197bc563d2e82e497cf83759
CRs-Fixed: 2232833
2018-06-20 14:01:17 -07:00
Shashikala Prabhu
ab1d4c30ca qcacmn: Cleanup dfs unused function
Cleanup dfs_mlme_channel_mark_radar unused function.

Change-Id: I16aeacbca8f44de4dcab5667b6065fbb9b5c39d7
CRs-Fixed: 2245665
2018-06-15 20:10:50 -07:00
Kiran Venkatappa
68cd728ed8 qcacmn: Fix compiler failure with HOST_DFS_SPOOF_TEST not defined
Callbacks are defined for both cases, so remove compiler
flag around callback declaration and assign callback for both
HOST_DFS_SPOOF_TEST enabled and disabled cases.

Change-Id: I5e3cedaaa5be550243ac090da3ab6499c5e83904
CRs-Fixed: 2249806
2018-06-15 12:39:36 -07:00
Shashikala Prabhu
26d9f36f90 qcacmn: Do not print DFS error message for non 5 GHz pdev
In Repeater AP scenario, when STA vap starts scan, it calls the
registered DFS callback function to get the AP CAC status. For a
2 GHz pdev, dfs object is NULL and hence 'dfs is NULL' print is
always seen when user enables the dfs error logs.

Add non 5 GHz pdev check in dfs callback function before dfs NULL check.

Change-Id: Id087d0b126996406f2b6e1b5b34b90a12a18a890
CRs-Fixed: 2245034
2018-06-08 10:12:04 -07:00
Wen Gong
67d105d445 qcacmn: Add DFS master feature flag
Add config flag to enable / disable DFS master feature

Change-Id: Iddd82dd5f117a4d75fda161f5a531aa7eab25016
CRs-Fixed: 2222557
2018-05-24 00:49:52 -07:00
bings
3a7cf9b158 qcacmn: Refine chirp check for ETSI type 4 radar
Currently if the delta peak of the ETSI type 4 radar pulse is 0, it will
be considered as radar false dection, which affects normal dfs ETSI type
4 certification test.

More checks are added when delta peak of the ETSI type 4 radar pulse is 0.
If psidx_diff, the difference in the FFT peak index between the short FFT
and the first long FFT, is greater than 4 and less than 16, it is still
considered as valid ETSI type 4 radar pulse.

Change-Id: Iee9c22e0c208023bb9f0f70121f8269169b63d18
CRs-Fixed: 2173576
2018-05-23 20:45:39 -07:00
Vignesh U
8785b9dd69 qcacmn: Process host DFS confirmation status from firmware
Process firmware status event on radar found and take necessary actions.

Change-Id: I7ddb2b1a45e97a4ea52eb9b2d718f467726aad04
CRs-Fixed: 2211883
2018-05-21 03:53:35 -07:00
Vignesh U
661654d376 qcacmn: Send radar found command to FW
In FCC domain, process the radar pulses and send the summary of radar
found information to FW.

Change-Id: Ib30f57927a9718315fd90f5c44d47dae38bf36f0
CRs-Fixed: 2211883
2018-05-21 03:53:32 -07:00
Krunal Soni
3370ea52d1 qcacmn: Fix uninitialize variables in few policy manager APIs
Few variables are left uninitialized and they are being used
with some random value.

Fix by initializing to default value.

CRs-Fixed: 2232791
Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a
2018-05-07 06:37:09 -07:00
Edayilliam Jayadev
2703fafbe2 qcacmn: Use new phymode for vht in 2G
Today for VHT in 2G, we are sending WMI_HOST_MODE_11NG_HT20/40
as phymode values to FW. Change this to WMI_HOST_MODE_11AC_VHT40/20_2G
which are dedicated phymodes defined for VHT operation in 2G.
This change is applicable only for tlv based chipsets.

CRs-Fixed: 2205265
Change-Id: I9482bfd1834285a21b5a45b6c039a13e9cd80479
2018-03-29 06:57:55 -07:00
Manikandan Mohan
b5387d4102 qcacmn: Fix export symbol for multi drivers compilation
Update dfs module files to use qdf_export_symbol to facilitate
multiple driver module compilation support.

Change-Id: Ib1b9605b7c017b1f366fe01b8f7e1ca0379fe217
CRs-fixed: 2197751
2018-03-19 19:58:18 -07:00
Arif Hussain
c8fe4680ae qcacmn: Fix sending dfs offload enable command sequence
Currently dfs offload command is sent during event registration
when psoc object is created. Dfs offload command is sent by accessing
pdev object, as pdev object during this time may not be created
or maybe in logically deleted state and sending command may fail.
This failure may cause wifi_dfs_psoc_enable and thereby effecting
other module objects.

To fix this, avoid using pdev objects during psoc enable, and send
pdev object specific command when pdev is created.

Change-Id: Ia10d493267259d0fbd918453e532b4f244029163
CRs-Fixed: 2179845
2018-02-23 06:05:56 -08:00
bings
0c590ceba4 qcacmn: Move dfs leakage from qcacld to qcacmn
Move dfs leakage from qcacld to dfs module of qcacmn.

Change-Id: I17276fedf575f1a4029265be58d8fd088c1d956d
CRs-Fixed: 2177679
2018-02-04 21:43:31 -08:00
Srinivas Pitla
ee54aea6d8 qcacmn: Add target_if changes to DFS
Use target_if APIs to get dfs offload capability

Change-Id: Ic23770b0407e33e4b031bbbc4a8224663ac57e32
CRs-Fixed: 2177109
2018-02-03 15:11:02 -08:00
bings
276c0f1969 qcacmn: Use new APIs to get and set DFS Non-Occupancy-List(NOL)
Current driver is using pld_wlan_set_dfs_nol() and pld_wlan_get_dfs_nol()
directly through eSAP_DFS_NOL_SET and eSAP_DFS_NOL_GET case statements
respectively within HDD module. These methods are obsoleted as per
new driver design.

Use DFS component's utils_dfs_init_nol() and utils_dfs_save_nol() APIs
instead to get and set DFS NOL respectively.

Change-Id: I63e8adac3f99c2052c26e6b01d19071f098e0a4f
CRs-Fixed: 2178580
2018-02-02 05:45:45 -08:00
bings
5fc318cedb qcacmn: Do not switch channel in DFS testing mode
If gDisableDFSChSwitch is configured as 1, channel should not be
changed even radar is found.

Set usenol as 0 when gDisableDFSChSwitch is configured as 1.

Change-Id: I05c4afea3eb9af9c541b2324a2d50ea59c05f7d7
CRs-Fixed: 2168792
2018-01-31 21:49:35 -08:00
bings
c83573954f qcacmn: Extend radar event structure for ETSI chirp radar detection
The pulse_delta_peak of chirp radar is not zero, which is one more radar
detection rule for ETSI chirp. Driver need delta peak related information
from FW for ETSI chirp radar detection.

Two more fields pulse_delta_peak and pulse_delta_diff are added in
wmi_dfs_radar_event_fixed_param.

Change-Id: Ief8dbea1c1336f45a24195853d5e1356bf3cad27
CRs-Fixed: 2179933
2018-01-30 09:25:49 -08:00
bings
9c524f5fc4 qcacmn: Restore WMI_DFS_RADAR_EVENTID for Rome FW
Currently WMI handler for WMI_PHYERR_EVENTID is used to handle DFS and
spectral scan phy errors; but Rome FW still uses WMI_PHYERR_EVENTID
and WMI_DFS_RADAR_EVENTID and does not have spectral scan phy errors.

Restore WMI_PHYERR_EVENTID and WMI_DFS_RADAR_EVENTID as Rome FW
requirement.

Change-Id: I16761f6da947619a5969ac8dcd09498d508ad715
CRs-Fixed: 2160954
2018-01-27 00:10:32 -08:00
Abhijit Pradhan
6744161372 qcacmn: Add locks to protect DFS NOL list
Add locks to prevent concurrent access of DFS NOL list
from different  contexts.

Change-Id: Ib94bb08bcf3e0cac80b2f8e6be7ab4fd54c53a68
CRs-Fixed: 2156892
2018-01-08 01:18:36 -08:00
Shashikala Prabhu
6c3778275a qcacmn: Fix 2GHz association failure
Problem:
When a STA vap in repeater AP starts scan it checks for
is_cac_in_progress variable. If this variable is set true, then
STA does not scan. is_cac_in_progress is set true/false when dfs
is not NULL. Since DFS is NULL for 2G radio, is_cac_in_progress
has some random number and hence scan is cancelled by the HOST.

Solution:
Initialize is_cac_in_progress to false in
dfs_scan_serialization_comp_info_cb(). Set this variable to true
if dfs is not NULL and AP is performing CAC.

Change-Id: I3e04bfaf05001f7f76f67605fb2c6d35c3113683
CRs-Fixed: 2166300
2018-01-03 15:26:44 -08:00
Arif Hussain
5e7ad9b03f qcacmn: Add null pointer validation and fix initialization in dfs
Add validation check for memory allocation and initialize variable
before using.

Change-Id: If5215f4f034ea57884b252f8467c4e2ca227c952
CRs-Fixed: 2160749
2017-12-26 13:24:37 -08:00
Shashikala Prabhu
153b2881cf qcacmn: Do not allocate DFS object for 2GHz radio
DFS is applicable only for 5GHz radio. Therefore, do not
allocate DFS object for 2GHz  radio.

Change-Id: I5e8aec0c876e7862890fae689950bfbb4eae5255
CRs-Fixed: 2153493
2017-12-22 23:24:41 -08:00
Shashikala Prabhu
a072dc55f7 qcacmn: Replace substring IEEE80211 by WLAN in DFS component
Replace substring IEEE80211 by WLAN in DFS component

Change-Id: I77bcbe0fc34514928a14c6208e33083ef17834af
CRs-Fixed: 2148682
2017-12-04 21:32:40 -08:00
Shashikala Prabhu
fbeb761ef0 qcacmn: Fix RADAR found on wrong channel
Problem 1:
When HOST receives RADAR found indication from target on wrong
channel ex: channel 68. Host does not add the channel to NOL,
but calls random channel function to choose new channel. It
leads to target assert and HOST crash.

Solution 1:
If channel is wrong, do not add it to NOL and do not call
random channel function.

Problem 2:
When Host receives RADAR indication from target, HOST prints
excess information. It floods the console log.

Solution 2:
Add debug bit mask for excess information.

Change-Id: Ib367ee80705d6b789e4e6823682e2f3c3096c9d9
CRs-Fixed: 2148940
2017-12-04 21:32:38 -08:00
Abhijit Pradhan
9ae09aeace qcacmn: Have same dfs action for Fulloffload and legacy
After RADAR detection the function should be used for
1)FullOffload
2)Legacy [ partial offload and Direct attach]
chipsets.

Change-Id: Id99f9f25dc5a9f751f9ad74c07a78fb980673300
CRs-Fixed: 2126916
2017-11-21 23:25:41 -08: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
Abhijit Pradhan
f9df7db9b5 qcacmn: Avoid functions with a very long list of arguments
To avoid passing multiple parameters to MLME functions from DFS
component, use a common structure between these components and
pass the structure instead of long list of parameters.
Define the common structure in cmn_services directory to access
it in both the components.

Change-Id: I02dde0780eebbce0886685d1f72a62c84e5b4eeb
CRs-Fixed: 2146000
2017-11-21 07:32:03 -08:00
Shashikala Prabhu
d9bf209f70 qcacmn: ETSI 302-502 Radar Pattern for ETSI11
According to the updates of Regdomain_23 submitted on 2017-5-18,
added two pulses (ETSI 302-502) in the static ETSI radar table for
ETSI11 regdomain.These two pulses are applicable only for 5.8GHz
(greater than 5.725 GHz)  channels.

Change-Id: I2f1e5535040ced9847eedff65dbe892e4d0fb056
CRs-Fixed: 2145124
2017-11-17 07:21:06 -08:00
Arif Hussain
f3b138c625 qcacmn: dfs: Replace instances of unadorned %p
Replace instances of unadorned %p in dfs.

Change-Id: I5a586d8e57fb0809bc1c7549ce78ac587bd0d142
CRs-Fixed: 2133316
2017-11-11 03:25:30 -08:00