Commit Graph

207 Commits

Author SHA1 Message Date
Hariharan Basuthkar
67b1ed5682 qca-wifi: Add regulatory APIs for REGULATORY_CHAN_BLOCKED
Add regulatory APIs to check, set and clear the flag
REGULATORY_CHAN_BLOCKED.

Change-Id: If049526fd788747575b24b3aa5aaa84c7b1d6fb9
CRs-Fixed: 2837859
2020-12-20 23:21:08 -08:00
Vijay Krishnan
24b4852dda qca-wifi: Move WIN specific DFS features to WIN code
Move the WIN only DFS features from common code to WIN specific
Component dev. The following features are moved.
1. WIN Hardware mode switch.
2. StaDFS
3. dfs_set_nol
4. nol_history

CRs-Fixed: 2834312
Change-Id: Ia68f5620a9321199b8e5cb0934fc044b9da7ff4a
2020-12-17 06:12:28 -08:00
Linux Build Service Account
04ad11773a Merge "qca-wifi: Move DFS_BANGRADAR from common code to WIN code" 2020-12-16 01:13:34 -08:00
Vijay Krishnan
48c59f9c03 qca-wifi: Move QCA_SUPPORT_DFS_CHAN_POSTNOL to WIN
The macro QCA_SUPPORT_DFS_CHAN_POSTNOL is specific to WIN alone.
Therefore move the macro QCA_SUPPORT_DFS_CHAN_POSTNOL and
associated code from common-code to Component dev repository.

CRs-Fixed: 2829535
Change-Id: I208a499cba1912ddd06c2b43dfcd9fc78732dac9
2020-12-12 18:13:37 -08:00
Vijay Krishnan
d3dc1a400d qca-wifi: Move DFS_BANGRADAR from common code to WIN code
Bangradar is used to simulate actual radar. For partial-offlload the
simulation happens within the host itself. For full-offload a WMI
command is sent to the FW and it responds with radar found event.

CRs-Fixed: 2829436
Change-Id: I5a2c7e50df2ee06d236e45a47608c9c53f57ba99
2020-12-12 18:11:24 -08:00
Santosh Anbu
1c6b4c25cf qca-wifi: Replace the blacklist manager enum
With changes in the enum definition due to introduction of force
rejecting a candidate, replace the blacklist manager return value
to force removal

Change-Id: I3c7d77fd541ff4eb164dc2acb430eb182d5a0eb8
2020-12-10 23:06:12 -08:00
Shreedhar Parande
2a6d9d7bfa qca-wifi: Enhancement of auto channel zerowait using RCAC
If user configures DFS channel, use intermediate channel to
bring up VAPs. Parallely start RCAC on configured DFS channel.
Once minimal RCAC run is done on configured RCAC channel, switch
channel from intermediate channel to DFS channel using CSA.
When user configures new channel using iwconfig, start the RCAC
state machine if newly configured channel is DFS by staying in
current channel until RCAC minimal run is complete on newly
configured DFS channel. Once the minimal RCAC is complete,
switch to the user configured channel using CSA.

Change-Id: I4a54344fddeb49534a78d70a377a6393d26140d6
2020-12-09 00:54:24 -08:00
Vignesh U
3dc03f2b08 qca-wifi: Deliver PreCAC events to the user space
Deliver the PreCAC event PRECAC_STARTED when the zero cac timer and
the ADFS timer are started.

Deliver the PreCAC event PRECAC_COMPLETED when the dfs channels are
marked as PreCAC Done in the PreCAC tree.

Change-Id: I47b2ab6914df0bdaad7d426a88ae05b65155eeb0
CRs-Fixed: 2823532
2020-12-03 14:51:56 +05:30
Linux Build Service Account
41d6602fa6 Merge "qca-wifi: Move QCA_DFS_RCSA_SUPPORT macro to component-dev" 2020-12-02 21:08:42 -08:00
Linux Build Service Account
9fc3cab1a6 Merge "qca-wifi: Split dfs_zero_cac.c into multiple files" 2020-12-02 21:08:41 -08:00
Vijay Krishnan
7a27a3dc97 qca-wifi: Move QCA_DFS_RCSA_SUPPORT macro to component-dev
The macro QCA_DFS_RCSA_SUPPORT is WIN specific. Hence moving the macro
and associated code to a new file named dfs_rcsa.c to the component-dev
git repository.

CRs-Fixed: 2822597
Change-Id: Ie99a62c934937c5ff7bf528ecdc37eb7efdb6b50
2020-12-01 15:23:03 +05:30
Vijay Krishnan
6ee85bd7d4 qca-wifi: Split dfs_zero_cac.c into multiple files
To enhance code-readability, split dfs_zero_cac.c file into multiple
smaller and logically coherent files. The new files are:
dfs_agile_sm.c, dfs_precac_list.c, dfs_precac_forest.h

CRs-Fixed: 2822588
Change-Id: If3e599cc3d895b3fbc6b114de6b69dd3afff3b6f
2020-12-01 15:22:50 +05:30
Vignesh Mohan
a9b8585838 qca-wifi: Introduce regulatory APIs to access channel information
As part of the componentization of channel lists across WIN
components, the existing version of channel list in WIN umac is
removed. Introduce APIs in the regulatory that provide the
required information directly from the regulatory
channel lists.

Introduce the following APIs:
1. wlan_reg_get_txpow_ant_gain
    To get the txpower and antenna gain specified in the regulatory,
    for a given channel.
2. wlan_reg_get_chan_flags
    To get the channel flags (if channel DFS for example), from
    regulatory for the given channel.
3. wlan_reg_get_max_phymode_and_chwidth
    To get the maximum 80211 mode and channel width supported
    by the channel in the given regulatory.
4. wlan_reg_is_phymode_chwidth_allowed
    To check if the given 80211 mode and channel width is supported
    by the channel in the given regulatory.
5. reg_update_max_phymode_chwidth_for_pdev
    To update the maximum 80211 mode and channel width for the
    regulatory, inside regulatory object.
6. reg_modify_chan_list_for_max_chwidth
    Update the regulatory channel list with maximum bandwidth
    for each channel based on the availability of it's
    adjacent channels.

Change-Id: Idb390c10d8901d9e21d4642481168704d7e36333
2020-11-26 14:37:59 +05:30
Vignesh U
b8e1892a63 qca-wifi: Disable radar detection after radar found on precac chan
When radar is detected on a zero-wait-precac channel, the precac channel
changes but the phyerror buffers for the previous precac channel keep
coming, affecting the newly configured precac channel and creating false
detects.

Consider, a Cascade AP operating in home channel 36VHT80 and the precac
channel is 52VHT80. When the radar is injected on channel 52VHT80, the
precac channel changes to the next precac channel 100VHT80 but still
continues to receive the queued phyerror buffers, causing radar detects
on channel 100VHT80(false detects with respect to channel 100VHT80).

Disable radar detection after radar got detected on the precac channel.

CRs-Fixed: 2812335
Change-Id: I1e06c53f00e596d9142f3aeb25a00b9da088538b
2020-11-07 11:56:56 +05:30
Santosh Anbu
ecc59f3524 qca-wifi: Increase restart request timer to 20s
In independent repeater scenario where STA vdev takes longer for
auth/assoc, and the AP vdevs are waiting on restart request may lead
to restart timeout.

Hence increase restart timeout to 20s which is higher than auth/assoc
timeout.

Change-Id: I5d2a0859e368feda4e1c6d3824eefdbc248b9bac
2020-10-31 01:45:16 -07:00
Vignesh U
692f5fc7ee qca-wifi: Add ADFS compile-time macros
For a 16-MB profile, while insmoding "umac.ko" unknown symbol error for
function "dfs_translate_radar_params_for_agile_chan" is seen.

The actual definition of function
"dfs_translate_radar_params_for_agile_chan" is present in the
dfs_zero_cac.c which is not compiled for a 16-MB profile. Therefore,
the unknown symbol error is seen.

Add ADFS compile-time macros
QCA_SUPPORT_AGILE_DFS and QCA_SUPPORT_ADFS_RCAC to the declaration of the
ADFS specific function dfs_translate_radar_params_for_agile_chan().
As the macros are not present in 16-MB profile, the function becomes an
empty function in the zero_cac.h and definition of the function
dfs_translate_radar_params_for_agile_chan() is present (though empty)
in the umac.ko.

Change-Id: I873231c703796c4ff17ec9a15fe2df7ddde1b8dc
CRs-Fixed: 2801858
2020-10-22 20:16:51 +05:30
Linux Build Service Account
2ffb194f4f Merge "qca-wifi: Remove the redundant radar on Agile Detector check" 2020-10-09 07:36:13 -07:00
Linux Build Service Account
303a9f7a0d Merge "qca-wifi: Introduce radar param translation for 160/165Mhz Agile channel" 2020-10-08 12:06:50 -07:00
Vignesh U
75d8aabc74 qca-wifi: Remove the redundant radar on Agile Detector check
The following sanity check for processing the radar on agile channel
(dfs_process_radar_ind_on_agile_chan) is already present in the caller,
(dfs_process_radar_ind) where the radar action is classified based on
radar found params:
i) is dfs agile precac enabled?
ii) is rcac enabled?
iii) is a valid agile channel configured?

These checks are not enough when radar is detected on Zero Wait DFS
channel. But this is taken care in the parent function

Remove these redundant checks as they are already present in the parent
function flow dfs_is_radarsource_agile().

CRs-Fixed: 2764058
Change-Id: Ia67d6ee28f5f04e149c1049bd5642f04e6a4bc70
2020-10-01 15:21:21 +05:30
Vignesh Mohan
a556ec02b6 qca-wifi: Use agile width to calculate desired RCAC channel
If user configured frequency is provided for RCAC, instead of using
the current channel width to determine the channel, use the mapped
agile channel width instead. This is because, incases of the current
channel width being 165MHz for example, agile channel can only be
160MHz (indicated by the agile_chwidth variable).

Change-Id: I4634a4baf25efa3341ed0232ccf5c55b300bbbe7
2020-10-01 05:04:18 +05:30
Vignesh U
3a9b82683c qca-wifi: Introduce radar param translation for 160/165Mhz Agile channel
The radar parameter received from FW for Pine is based on the 160MHz
channel center. In Host a preprocessing to convert this radar parameters
based on 160MHz channel center into parameters based on 80MHz channel
center is done. This translation is present for the current channel but is
absent for the agile channel.

Also, for the 165MHz agile channel, the radar parameters are always sent
to host based on the left 80MHz center frequency 5690MHz.

Introduce a radar parameter translation function for 160/165MHz Agile
channel such that

1) If the radar hit frequency is left to the center of 160MHz center
frequency, then the segment id should be primary segment. The offset
frequeny that was with respect to the 160MHz channel center should be
converted into offset frequency based on the left 80MHz center by adding
40MHz on the offset received.

2) If the radar hit frequency is right to the center of 160MHz center
frequency, then the segment id should besecondary segment. The offset
frequeny that was with respect to the 160MHz channel center should be
converted offset frequency based on the right 80MHz center by subtracting
40MHz on the offset received.

3) If the radar hit frequency is on the left 80MHz segment of the
165MHz channel then do nothing because, the radar paramters are sent by
FW with respect to the left 80MHz center frequency of the 165MHz channel.

4) If the radar hit frequency is on the right 80MHz segment of the
165MHz channel then the segment id should be secondary segment id and the
offset should be converted to be based on the right 80MHz center frequency
5775MHz by subtracting 85MHz.

Change-Id: I47471e65c5831c0aa9c2c36338021a55d4dc7c7b
CRs-Fixed: 2784515
2020-09-30 12:59:28 +05:30
nobelj
a54788cb56 qca-wifi: populate vdev extension statistics
populated fils discovery, unsolicited probe response from
vdev extension stats and populated to APSTATS.

Change-Id: Ia7c18a07428a73d445b8a85169a4dd8f053d9cc6
2020-09-01 07:51:54 -07:00
Linux Build Service Account
00a8d99304 Merge "qca-wifi: Conditionally define dfs_precac_status_for_channel" 2020-08-30 15:04:49 -07:00
Linux Build Service Account
51bd15af71 Merge "qca-wifi: Create framework for RNR 6Ghz operations" 2020-08-28 22:05:14 -07:00
Ananya Barat
3ddbe0fad7 qca-wifi: Conditionally define dfs_precac_status_for_channel
When ATH_SUPPORT_ZERO_CAC_DFS is not defined the function
dfs_precac_status_for_channel has 2 definitions, one in dfs_zero_cac.h
and the other in dfs_zero_cac.c.

Fix this by putting the definition in dfs_zero_cac.c under
ATH_SUPPORT_ZERO_CAC_DFS.

Change-Id: I767b7f3bbfe43cb976648c7761cd8e24e4773783
2020-08-28 03:04:20 -07:00
Linux Build Service Account
de97309d97 Merge "qca-wifi: Add mac filtering support for connection manager" 2020-08-27 08:07:59 -07:00
sumedh baikady
6bca4d3976 qca-wifi: Create framework for RNR 6Ghz operations
For handling 6Ghz RNR related operations create
new file.
The helper functions are used to update and maintain
global context of lower band vdev count, 6Ghz vdev
count and pointer to 6Ghz pdev.
This will provide global access to 6Ghz pdev and
avoid finding this pdev through iterations over
SoC and Pdevs.
Finding lower band vdev count can be tricky as
it involves iteration over SoC, Pdev and Vdev.
Keeping global counter optimizes the approach to
access without multiple iterations.

Change-Id: Ic9782e517d8a87d4806b93dd4779cd54366316cb
2020-08-27 01:44:19 -07:00
Santosh Anbu
f922099fab qca-wifi: Add mac filtering support for connection manager
Enable blacklist manager code for compilation

Change-Id: I70c95a571a6b33c99f92ba56c68023e4e7931372
2020-08-26 18:59:29 +05:30
Linux Build Service Account
fd562dfe74 Merge "qca-wifi: Activate deferred start send to FW" 2020-08-26 00:07:02 -07:00
Linux Build Service Account
1b1fc968c0 Merge "qca-wifi: add fils stat variables to apstats" 2020-08-25 21:35:57 -07:00
Santosh Anbu
f434bda1f6 qca-wifi: Activate deferred start send to FW
Start cmd send to FW is deferred when restart is in progress and
activated when restart is sent to FW.
There can be scenario where this restart is cancelled if the VDEV
is brought down as part of STOP cmd, during which the deferred start
cmd is not activated.

Add change to activate the deferred start on cancellation of multi
vdev restart

Change-Id: Ie202454f67943761219933be5b91a28ecba15c13
2020-08-25 08:56:48 -07:00
Himanshu Batra
183f29faa1 Revert "qca-wifi: Add mac filtering support for connection manager"
Revert "qca-wifi: Add mac filtering support for connection manager"
Change-Id: Iebe124bb9d1d222a9ca9f7340fd371ce9a3a2473
2020-08-25 21:05:18 +05:30
Ruben Columbus
0479f052dd qca-wifi: add fils stat variables to apstats
use vdev_cp_stats api to set values for fils stats
for later use.
create new macro for fils to use it in get_priv_int api.

Change-Id: Ia8ce7646c9cfd7904fe7826ca6d3d36aa2f4c14e
2020-08-24 12:28:26 -07:00
Ruben Columbus
272a0a20aa qca-wifi: add new variables for 5G/6G apstats
add new cs_ type variables to be used with vdev_cp_stats api.
apstats will use updated values and show them when getting called.

Change-Id: Ie90db9dc773c6624c912c62599be615042ebe1dd
2020-08-24 11:57:10 -07:00
Linux Build Service Account
3da597e30f Merge "qca-wifi: Add mac filtering support for connection manager" 2020-08-23 04:34:58 -07:00
Vignesh Mohan
e44ac26bc6 qca-wifi: Add APIs to find preCAC status of a given channel
Introduce an API to find the preCAC status of a given channel and
also return 0 if no channels are preCAC completed.

Change-Id: I17171250618dd3a06e710feb31230429fb00e7df
2020-08-17 16:53:50 +05:30
Santosh Anbu
ad3055cf23 qca-wifi: Add mac filtering support for connection manager
Implement mac filtering APIS that will be used by connection manager.
The mac filter will hold the list of bssid that needs to
excluded in candidate selection.

Change-Id: Id72cdfe67703aca1dd77ad5705c5bf57b641ac26
2020-08-14 23:35:19 +05:30
Ananya Barat
74a849e197 qca-wifi: Make the initialization of dfs->dfs_soc_obj unconditional
With the current implementation dfs->dfs_soc_obj was initialized in
function dfs_agile_soc_obj_init under the macro QCA_SUPPORT_AGILE_DFS
and ATH_SUPPORT_ZERO_CAC_DFS both of which are disabled for the low
memory profiles. Remove the initialization from here and unconditionally
initialize it in wlan_dfs_pdev_obj_create_notification.

Change-Id: I207ed4e7d5cb42100e5bf1cbf55cdd9de13f35b8
2020-08-14 08:24:17 -07:00
Linux Build Service Account
1c9444af72 Merge "qca-wifi: Add print before clearing MVR pdev flag" 2020-08-13 07:06:51 -07:00
Himanshu Batra
c0960491d8 qca-wifi: Add print before clearing MVR pdev flag
Add print before clearing MVR pdev flag

Change-Id: I28ff2747874f95aaa0a9b5b1e025c23603354de0
CRs-Fixed: 2751336
2020-08-12 18:45:24 +05:30
Linux Build Service Account
1e7f66ac00 Merge "qca-wifi: Correcting the Stats decrement logic" 2020-08-11 21:37:37 -07:00
Ankit Kumar
3976ff66ae qca-wifi: Correcting the Stats decrement logic
Correcting cp stats macro to call decrement api to do
decrement stats operation.

Change-Id: I3202ed20974cadde6dce27e2cf5ba187ec538ce0
2020-08-11 14:07:28 +05:30
Vignesh U
84f43ea5df qca-wifi: Define radar found action on agile channel
The radar found action on a agile channel is a WIN specific action. It was
combined with the current channel radar detection making the function huge
and difficult to read.

Separate the WIN specific agile radar action and define in it as WIN
specific.

Change-Id: I79ed61ae80a2870dff9775b9435069c50584ca83
CRs-fixed: 2738015
2020-08-07 02:30:48 -07:00
Linux Build Service Account
2c3cc885c5 Merge "qca-wifi-oss: Fix compilation for 16M flash profile" 2020-08-06 19:07:51 -07:00
Ananya Barat
20960a62c4 qca-wifi-oss: Adapt Agile DFS for Wideband (5G-6G)
In case of a current channel being a 5GHz DFS channel, a channel change
may be triggered by a radar detection. The next channel is automatically
selected by a random channel selection algorithm in this case. However,
if the current channel is a 6GHz channel and we need to switch to a 5GHz
channel then 5GHz channel should be provided a user or another channel
selection algorithm. At the time, when the device is starting its
operation on a 6GHz channel , the next 5GHz channel that a user
(or another another channel selection algorithm) is going to select
is unknown. Therefore, the probability that the next channel selected
by a user (or another channel selection algorithm) will match the RCAC
channel returned by random channel selection, is very low. Therefore,
do not select a random channel for RCAC if the current operating channel
is a 6G channel for now.

Change-Id: I9aef64cea1d442fc31b2314da08baba7769650f2 has the following
change :
The macro WLAN_IS_CHAN_MODE_x(_c) checked if mode is 'x' as well as if
the channel was a 5G channel. However with wideband changes this macro
will return true if mode is 'x' for both 5G and 6G channels. Hence adding
a separate 5G check for functions where the channel must be a 5G channel.

With WLAN_IS_CHAN_MODE_x(_c) now a 6G channel will pass
the checks in dfs_is_precac_done which would cause regression. Hence a
5G check has been added to prevent this.

Change-Id: Iee5e965f0bc99565cb5ea77d88998d5530f24153
2020-08-06 03:57:52 -07:00
Ananya Barat
9df9627c7e qca-wifi-oss: Fix compilation for 16M flash profile
For the 16M low memory profile a few feature macros were disabled which
led to unavailability of a few APIs.

Add empty definitions for these APIs when the corresponding feature
macros are disabled.

Change-Id: I1f7790196ae8383eac40f5869992fd06ede3e5dc
2020-08-06 02:51:38 -07:00
Linux Build Service Account
45a75f3aa5 Merge "qca-wifi: FR47702 TWT stats, add TWT stats in control path stats" 2020-08-05 06:06:20 -07:00
Ananya Barat
9fe151a881 qca-wifi-oss: Design a unified SM for Agile PreCAC and RCAC
Following is the list of changes :-

1. Add an API dfs_agile_precac_cleanup to reset all dfs variables
   while going from running to init state.
2. Add a parameter is_chan_found to dfs_prepare_agile_precac_chan and
   make it true if a channel is available for PrCAC/RCAC.
3. Post event done to Agile SM when firmware returns ocac complete for
   a particular agile channel.
4. Post event done if preCAC timer expires from driver for a particular
   agile channel.
5. Remove the zero second timer mechanism of starting of Agile PreCAC,
   instead regulate it completely using the Agile SM.
6. Add API dfs_is_agile_cac_enabled which checks if either PreCAC/RCAC
   is enabled. Events are not posted to the Agile SM if none of these
   are enabled.
7. Add API dfs_abort_agile_precac used to send abort to F/W for that
   specific DFS index.
8. Add API dfs_init_agile_start_evt_handler to handle the start event in
   init state of Agile SM. This checks if a channel is available for
   PreCAC/RCAC.
9. In init and running state of the SM handle events for both PreCAC and
   RCAC, while complete state is for RCAC alone.

10. Following is the algorithm implemented in the  Agile SM :

   The Agile SM is per psoc, create it when the psoc is created.
				|
   On receiving the VAP start resp, send a start event to the SM in
   init state. In the start event handler check if a PreCAC/RCAC channel
   is available and if found configure the agile channel params and send
   a WMI to F/W.
				|
   A OCAC complete is received on completion of CAC by F/W or the host
   timer might expire. In either case mark the channel as CAC done.
   Check if interCAC was running and the channel is the des chan, if so
   a primary channel change is automatically triggered.
				|
   In the event of mode switch/scan start/VAP down/primary channel change
   while PreCAC is running a stop event is received. Clear all dfs
   structures and go to init state.
			        |
   On receiving a radar in the Agile channel, go to the init state and
   set event as start. Radar in primary channel is taken care of by
   ensuing VAP down up.
				|
   When no other channels are pending PreCAC, clean all dfs structures
   and remain in the init state. PreCAC uses only init and running
   states of the SM.

Change-Id: I231c79d381c7c3e192bea8ebff1ee6b5dc4a3cfa
2020-08-02 10:20:30 +05:30
Ananya Barat
490187bdcd qca-wifi: Rename the RCAC State Machine events, states & APIs
Both (ETSI) PreCAC and RCAC are going to use use the same state
machine. The state machine drives the Agile engine and not very specific
to RCAC or PreCAC, therefore let the state machine be called agile state
machine and change the names of all the associated variables accordingly.

In this preparatory change, modify names of all APIs, states and events
to make them common to Agile RCAC and Agile PreCAC

Change-Id: I83835e0295bc97e1099c0e01fc6b2fce62437872
2020-08-01 15:36:55 +05:30
Linux Build Service Account
d17b128635 Merge "qca-wifi: Fix channel sync issue in RESTART sequence" 2020-07-30 01:11:04 -07:00