Commit Graph

260 Commits

Author SHA1 Message Date
Arif Hussain
1f88428baf qcacmn: Replace instances of unadorned pointer reference in DFS
Replace all instances of %p with %pK in DFS component, so that
kernel pointers are hidden from unprivileged users.

Change-Id: Ia10971516bf962287af9ff8dce873888500a01a1
CRs-fixed: 2133321
2017-11-08 03:01:33 -08:00
Abhijit Pradhan
7383ef9d7e qcacmn: Fix compilation issues for DFS component disable/enable
Header files are included in appropriate places to avoid compilation
errors. To disable/enable DFS component from non-common code at
compile time, use macro QCA_DFS_COMPONENT_ENABLE in config  file.

Change-Id: I0d4fe27ee0d76412c109aa3f64485ea1ac2a5e3a
CRs-Fixed: 2134355
2017-11-05 04:45:51 -08:00
Shashikala Prabhu
0ea0a2466e qcacmn: Add random channel debug bit mask
Add WLAN_DEBUG_DFS_RANDOM_CHAN bit mask to enable/disable
random channel algorithm prints using DFS logging.

Change-Id: I77f01afcf59b8b790404eca8caa68c150a5d3ec2
CRs-Fixed: 2120265
2017-11-04 06:59:54 -07:00
Shashikala Prabhu
2427663f1f qcacmn: Cleanup old random channel function
Removed WIN based random channel selection algorithm.
To choose a new random channel, use converged random
channel  algorithm.

Change-Id: I0ece0cb71ffeb694c9f5264d97a25e49d59b1ae8
CRs-Fixed: 2120265
2017-11-04 06:59:52 -07:00
Shashikala Prabhu
68431d3ea5 qcacmn: Add support to use new random channel algorithm
1) Add support to use new random channel selection algorithm
   from converged DFS component.

2) Move random channel filtering flags from dfs_internal.h to
   dfs_ioctl.h as these flags are common between MLME and DFS
   component.

Change-Id: I5ef789dd9e9c28706f1c581997a646a80caec5ee
CRs-Fixed: 2120265
2017-11-04 06:59:50 -07:00
Abhijit Pradhan
c5fc03dc59 qcacmn: Fix DFS component KW issues
Fix KW issues for DFS component.

Change-Id: I9285c79e33f637d99c765e76dff35609235f1255
CRs-Fixed: 2136241
2017-11-04 06:09:09 -07:00
Shaakir Mohamed
ad25e73cc5 qcacmn: Fix for AP to ignore CAC complete event from firmware during CAC
Fix for AP to ignore the CAC complete event from firmware on WIN side,
during bring up on DFS channel, thereby not beacon during CAC.

Change-Id: I60107a9c571e6c6a64fb16c3f8884a7b7d32150d
CRs-fixed: 2122316
2017-10-25 19:41:16 -07:00
Shaakir Mohamed
f6cb4b8576 qcacmn: Avoid CAC when switching to the same channel
Changes related to If63678a7e9ce00c1166e7f6533e5eaa0b0ae67a5
on modifying declaration of dfs_mlme_start_csa function on mlme side.

Change-Id: Id746faaaa2cdbdb48f80056eec3dd661a30122e5
CRs-fixed: 2117811
2017-10-23 13:43:22 -07:00
Shaakir Mohamed
03a8b15221 qcacmn: Handle dfs pulse information in host side
Adds support to dump dfs pulse information from firmware to host
for debug purpose.

Change-Id: I3b2042f8df6e077eed1a3847cd2d8550794bc6f7
CRs-fixed: 2121833
2017-10-16 05:55:59 -07:00
Shaakir Mohamed
4db22523ff qcacmn: Fix to prevent channel switch to channels in NOL list
This fix prevents channel switch to a DFS channel already in the NOL list
during a doth_chanswitch or chan command, within the NOL time out.
When a DFS channel gets added to NOL list, channel flags update to
indicate a radar set on the channel

Change-Id: Ifddd6e861b408a680ec310d42d6518fbb46d733e
CRs-fixed: 2121225
2017-10-15 15:48:11 -07:00
Shaakir Mohamed
a1a7e163af qcacmn: Add support for bangradar for hawkeye
Add support for bangradar command to send unit test command
to firmware as a hook to simulate radar injection

Change-Id: Ieaa7eab6d452ab864a10beca1478d0e61d605107
CRs-fixed: 2113724
2017-10-15 15:48:09 -07:00
Shaakir Mohamed
6f35bb0636 qcacmn: Add usenol support for full offload
In fulloffload mode, based on the value of the usenol variable decide
whether to add the channel to NOL or not. In future, we need to merge
this code with non-full offload. That will remove redundant code.

Change-Id: I2bb403c3983a4a1eac906e6c13a3ec6a13fdc436
CRs-fixed: 2102829
2017-10-15 15:48:08 -07:00
Arif Hussain
6dfa7ee2a1 qcacmn: Add utils_ prefix to dfs public functions
Add utils_ prefix to all dfs public APIs.

Change-Id: I154c9f9a324c1af815363d3cbf52febd1bed342e
CRs-Fixed: 2124362
2017-10-12 14:22:22 -07:00
Shashikala Prabhu
41eff4f752 qcacmn: Initialize DFS radar table based on dfsdomain
* Initialize the radar table based on dfsdomain for country
  KOREA and CHINA.
* Move UMAC related APIs from lmac_api.c to utils_api.c  file.

Change-Id: I9dc2acdf23fc10469884d23bb91f352d2ac259ca
CRs-Fixed: 2110760
2017-10-12 14:21:55 -07:00
Abhijit Pradhan
77561584ad qcacmn: Define DFS logging APIs
1) Define logging(alert, err, warn, info, debug) on top of
   QDF abstractions for DFS component.
2) Use dfs_info for important prints such as CAC timeout,
   NOL timeout, enable/disable radar etc.
3) For everything else use dfs_debug macro.

Change-Id: Id1efc12dd00e7b3f2b8d5627c65f58e619438c82
CRs-Fixed: 2116421
2017-10-06 10:25:15 -07:00
Arif Hussain
6e26c9c1f8 qcacmn: Implement get current list from reg API
Implement api to get current channel list from regulatory API.

Change-Id: Id0b7aea0c5421fb3033843fd89876a4f1c3528d2
CRs-Fixed: 2062794
2017-10-05 12:18:22 -07:00
Jeff Johnson
878533e29b qcacmn: umac: Replace instances of unadorned %p
Replace instances of unadorned %p in umac.

Change-Id: I7ae33c51405b31df24670dee3c98b6b4f1da9ab4
CRs-Fixed: 2111274
2017-10-03 16:02:30 -07:00
Shashikala Prabhu
76d8384344 qcacmn: Add support to check if DFS is enabled in HE160/HE80_80
Add support to check if DFS is enabled in HE160 and HE80_80.

Change-Id: I06c6f8c816a4aa7f34468b5f902334feb968fbbe
CRs-Fixed: 2104219
2017-10-03 08:24:09 -07:00
Abhijit Pradhan
09e53bd45c qcacmn: Wait for 2secs before sending CSA
Reverse CSA:
===========
Problem:
When Repater detects the RADAR, it sends RCSA to RootAP and
immediately switches to a new channel without waiting for CSA
from Root AP.

Expected behaviour:
When Repeater detects the RADAR, if uplink is present then it sends
RCSA to RootAP and waits for 2secs to receive CSA. If Repeater
does not receive CSA in 2sec, choose a random channel and
bring up the AP vap.

Solution:
In Repeater, if RCSA is sent successfully to RootAP then wait for
2secs to receive CSA from Root else choose a random channel and
bring up the vaps.

Change-Id: Ica204981db85917554c06cd86c0e016df624c45f
CRs-Fixed: 2104219
2017-10-03 08:24:07 -07:00
Shashikala Prabhu
4f8130e8c9 qcacmn: Fix Zero CAC DFS kernel panic
* Moved target type macros to global target_if header file.
* Fixed kernel panic: Channel details were written in  invalid
  memory location.

Change-Id: Ia9134b8dad651e53f57243c45eb93fb86ddd94c5
CRs-Fixed: 2104219
2017-10-03 08:24:05 -07:00
Shashikala Prabhu
bb8b274815 qcacmn: Fix DFS kernel panic
Problem:
During DFS attach the DFS related timers are initialized only if
the DFS is not offloaded.
When user issues a bangradar command for full offload where DFS is
offloaded to FW, HOST is trying to set a un-initialized timer and
leads to a crash.

Solution:
Handle bangradar command in HOST only if the DFS is not offloaded.

Change-Id: I8d23d450ff1941890fdc81cef1425fae8b55ce56
CRs-Fixed: 2108874
2017-09-18 17:45:57 -07:00
Abhijit Pradhan
382c50fff7 qcacmn: refactor DFS code Part-I
Reduced the max indentation level to five.
Spilt functions to several smaller functions.
Only a few functions were split
in this commit. Rest need to be done in future commits.

Change-Id: I1c9dcf3ae12edef6bcce37023f93d062705e0142
CRs-Fixed: 2098511
2017-09-08 16:47:36 -07:00
Shashikala Prabhu
d694b02be9 qcacmn: Add DFS full offload check for dfs radar process
Do not enable/process the DFS radars in HOST when DFS is offloaded to FW.

Change-Id: Ie025a5ba0e3962ebd276c266ea5afb8635f8a536
CRs-Fixed: 2099937
2017-09-02 01:13:13 -07:00
Shashikala Prabhu
76192e12a9 qcacmn: Register a DFS callback function to get AP CAC status
In Repeater AP scenario, when STA vap starts scan, it calls this
registered DFS callback function to get the AP CAC status. If the
AP vap is performing CAC, STA vap does not start SCAN.

Change-Id: Ifa3ad0298f1b04f3fffc915f20ff81ec0cc731bf
CRs-Fixed: 2096259
2017-09-02 00:17:42 -07:00
Shashikala Prabhu
269b020a61 qcacmn: Cancel ZERO CAC NOL timer during wifi down
Analysis:
When AP detects the RADAR, it marks the channels as RADAR found
and adds it to both NOL and precac NOL list and starts NOL and
precac_nol timer.
If the user brings down the radio while the channel is present in
NOL list, only NOL timer gets cancelled. Precac NOL timer expires after
wifi down and leads to a kernel panic.

Solution:
Cancel the zero cac NOL timer during wifi down

Change-Id: Icf932e739910a51d9dc74cf5822133258c0ba3f0
CRs-Fixed: 2096256
2017-09-01 01:11:22 -07:00
Shashikala Prabhu
c2fc6d09c6 qcacmn: Fix DFS kernel panic
Analysis:
dfs_nol_timer_cleanup() calls dfs_nol_update(), which internally
calls a legacy function to update the scan channel list and sends
a WMI command to FW. However, from WIN side dfs_nol_timer_cleanup()
is also called after target stop, which leads to a kernel panic.

Solution:
Call dfs_nol_update() prior to target stop.

Initalize precac channel list during dfs reset.

Change-Id: If856d436ad215efa46cfc166d95bf3ccb4e7bf99
CRs-Fixed: 2096256
2017-09-01 01:11:20 -07:00
bings
ff86e37d20 qcacmn: Fix connection information deleting and restoring
Currently only one connection information corresponding to the
provided mode is deleted and restored, which causes channel
selecting failure in DFS testing with AP+AP concurrency mode.
When radar is found in AP+AP concurrency mode, a new valid channel
should be selected. Before selecting the channel, all existing
connection information of SAP mode should be deleted, otherwise
no valid channel can be selected.

All the connection information corresponding to the provided mode
should be deleted and restored.

Change-Id: Id363dbb2c31485fefcd6915696060923063079bb
CRs-Fixed: 2079597
2017-08-16 03:27:29 -07:00
Arif Hussain
877f3236d8 qcacmn: Refactor dfs cac timer and other logic in dfs component
It is possible to use host based cac timer even for the dfs
offload, So make sure to do all initialization for cac timers.

Also store dfs offload flag in dfs component.

Change-Id: Id30730fb1f84285e225c4221fde9846fbfd960cc
CRs-Fixed: 2069362
2017-08-14 14:58:09 -07:00
Shashikala Prabhu
385c7c0eb0 qcacmn: Initialize zero cac dfs lock
Initialize zero cac dfs precac lock.

Change-Id: I0b12c765d0476a78cddcaca2b0153f7510e56c6c
CRs-Fixed: 2080572
2017-08-04 15:35:42 -07:00
Shashikala Prabhu
8c01b66c0e qcacmn: Fix DFS kernel panic
Due to dfs and 'ic' flag mismatch, ieee80211_find_channel()
was returning channel as NULL.

Change-Id: I2c8a09b5a1018d7daf2a925bcad7063a6b0e2988
CRs-Fixed: 2067959
2017-07-23 13:57:16 -07:00
Abhijit Pradhan
fe7233a795 qcacmn: Fix DFS kernel panic
As part of DFS component destroy, "ic" is accessed to reset
NOL list and PRECAC channel list, but "ic" is already deleted
as part of MLME component destroy. And therefore invalid memory
access happens.

Reset NOL list and PRECAC channel list before "ic" deletion.

Change-Id: I1dbf273f1ea51945493140bfce9bfa116ad0c488
CRs-Fixed: 2071164
2017-07-21 17:07:00 -07:00
Abhijit Pradhan
c5152c7904 qcacmn: DFS code cleanup
* Remove nif and sif keyword.
* Combine nif_dfs_detach and sif_dfs_detach.
* Combine nif_dfs_attach and dfs_attach.

Change-Id: Ibf4638a64fac976846bfcb1eae91f3f3bb3e994e
CRs-Fixed: 2071164
2017-07-21 17:06:59 -07:00
Amar Singhal
3162e0daad qcacmn: Modify reg-domain to pdev level
In worst case, different pdevs can be in different countries and
hence different reg-domains. Also there could be differences due
to front-haul and back-haul.

Change-Id: Ib9e998b5f7de4e42a1736d07e9e5602d8506e7b6
CRs-Fixed: 2048784
2017-07-10 09:36:58 -07:00
Arif Hussain
23473930ae qcacmn: Add more channel flags in nol logic
Add more channel flags support in nol channel
marking logic.

Change-Id: I2c931fec773c2f6138fff8ee757c4c99b056d56d
CRs-Fixed: 2069388
2017-07-08 23:41:10 -07:00
Vivek
5ec0bd3636 qcacmn: Remove psoc/pdev locks for trivial APIs
Remove psoc/pdev locks from trivial API's. This follows the changes from
which the lock requirement from few simple APIs are removed.

Change-Id: Ib5769c2234c8d57f485c0eef5a4e3c61fa170508
CRs-Fixed: 2060880
2017-06-26 23:32:19 -07:00
Abhijit Pradhan
dc45ced7ba qcacmn: Fix DFS kernel panic
Panic:-
As part of component destory, DFS component resets ic member
But ic is deleted as part of MLME destroy before destorying
the DFS component.

Solution:-
Reset the ic variables before destroying the components.

Change-Id: I0b120b43b1f3e7d326876d9cf206f37f6ce74ce8
CRs-Fixed: 2060245
2017-06-19 12:43:27 -07:00
Abhijit Pradhan
7dc39001a5 qcacmn: Avoid using "ic_" prefix in common component code
In DFS component the prefix "ic_ " was being used to represent ieee80211
channel related variables. Now  use prefix "dfs_ch_" instead of "ic_".

Change-Id: I2f739dc22ad89b7e410c06462876a22c2a615883
CRs-Fixed: 2056957
2017-06-10 03:28:24 -07:00
Baila, Shashikala Prabhu
43ee7b0343 qcacmn: DFS: Get DFS domain from regulatory component
Get the dfs domain from reg component instead of using it from
offload or lmac layer.

Change-Id: I3007ac483c44723b13a0af22df6eb56deac4c7ed
CRs-Fixed: 2047212
2017-05-16 07:26:53 -07:00
Abhijit Pradhan
0c80b53ac7 qcacmn: Fix DFS nol memory leak
Problem:- If the driver is unloaded before a nol timer fires, the unload
function frees the NOl element. But the memory associated with the nol timer
argument which has a one-to-one mapping with nol still remains in the system
since the nol timer argument memory is freed in the timer function.

Solution:-
1)Instead of allocating a separate structure as input to the timer function
use the NOL element itself as input since NOL element already has the
information needed by the timer function.
2)A NOL element for which  the timer is yet to fire is freed
by the driver unload (dfs_nol_timer_cleanup).
3)When dfs_nol_timer_cleanup is about to free a NOL element the corresponding
timer may be already running. Therefore, it is required to sync/wait for the
timer to finish before the NOL element can be freed. If we do not wait and
free the NOL element the timer may access an invalid memory location.

Change-Id: I4f37b66777491d92a51ff1ffc2651af1ccf5de29
CRs-Fixed: 2045993
2017-05-16 07:26:50 -07:00
Abhijit Pradhan
b4ebf34ea2 qcacmn: DFS kernel panic fixed
NULL pointer dereference is fixed.

Change-Id: I6c5dce998dd276306a42a14253450965329afd56
CRs-Fixed: 2001106
2017-04-29 00:41:30 -07:00
Arif Hussain
a23b01405b qcacmn: Implement converting freq/chan within dfs
Implement converting freq to chan and chan to freq
within dfs module.

Change-Id: Id9b39dbe90264621b0702a99a8df69fff9af9dd3
CRs-Fixed: 2017481
2017-04-27 18:16:49 -07:00
Arif Hussain
61cbab79c3 qcacmn: Fix frame-larger-than Werror in dfs
Fix Werror=frame-larger-than by reducing size
of DFS_MAX_NOL_CHANNEL from 128 to 80.

Change-Id: I37271a48bf5172c3fb2d568b58e8f7448bf4ed28
CRs-Fixed: 2017481
2017-04-25 01:08:38 -07:00
Arif Hussain
cc21cb2e15 qcacmn: Add acs range support in random channel selection
Add support to conside auto-channel selection range in random channel
selection algorithm.

If acs is enabled, random channel is selected from acs channel range.

Change-Id: I6ccf9ae58aa2d9b63133de3f98030078bf13cf49
CRs-Fixed: 2017481
2017-04-24 17:07:52 -07:00
Arif Hussain
ef4372eeb0 qcacmn: Fix issue in getting channel list in dfs component
Need to pass valid weight list and length to pcl api to
get channel list. So pass valid weight list and length.

Change-Id: Id9582210937da1dd5147aa3e85e0cd0df6b5ac90
CRs-Fixed: 2017481
2017-04-22 01:45:27 -07:00
Arif Hussain
8d88af5f32 qcacmn: Random channel selection public API
Add random channel selection public API.

Change-Id: I5502116fab17716a9d8f2f41ddd67bcbcdd1328c
CRs-Fixed: 2017481
2017-04-20 20:20:48 -07:00
Arif Hussain
c64510ba8b qcacmn: Process DFS events from firmware
Add support to process DFS events from firmware.

Change-Id: I38bea404fdb50d80430c8b14a2a4f6a729d3557e
CRs-Fixed: 2017481
2017-04-20 20:20:46 -07:00
Abhijit Pradhan
b973986b38 qcacmn: dfs memory leak fixed
dfs_detach function was called from ol/lmac layer during ath_detach.
To fix the memory leak dfs_detach function called from dfs pdev
destroy function.

Change-Id: I41602c17ac9ab0b6eb1e9fbe9abe764d00ed0e93
CRs-Fixed: 2001106
2017-04-20 17:50:57 -07:00
Arif Hussain
91ac5ea418 qcacmn: Add random channel selection algorithm
Add random channel selection algorithm in DFS component.

Change-Id: Ic2d3ee3c6156213564a3eb354dfffa1bbc7ff01d
CRs-Fixed: 2017481
2017-04-20 03:16:32 -07:00
Arif Hussain
63acfd2b2e qcacmn: Fix frequency offset signedness in channel marking logic
Change frequency offset to signed, as offset is negative if
radar found in lower frequency compared to center frequency.

Change-Id: Ic33411e5638684c4aacbb424eddc19827ef5e60e
CRs-Fixed: 2017481
2017-04-20 00:04:57 -07:00
Arif Hussain
1b9dcf5a12 qcacmn: Add support to process radar found indication
Add support to process radar found indication,
find and update radar affected channels to nol.

Change-Id: Icb2d601f422e43e9a98840dd22325a571fd92f27
CRs-Fixed: 2017481
2017-04-19 01:13:30 -07:00