Commit Graph

44 Commits

Author SHA1 Message Date
Vignesh U
350da55314 qcacmn: Find radar found frequency for 11BE Chipset
The "wmi_pdev_dfs_radar_detection_event" has an unused field "chan_freq".
It currently holds the value of primary 20MHz channel. With the
introduction of 11BE chipsets, this field is changed to hold the value of
the center frequency of the channel width on which the radar is found.

This new change is indicated by a wmi service
"wmi_is_radar_found_chan_freq_eq_center_freq".

For the Chipsets that support this service, the radar found frequency
can be calculated by mere addition of the fields "chan_freq" and
"freq_offset" field.

Change-Id: I8d2ce0023e2feb6e749ca8d7d5f547fafc0fdf98
2021-10-04 13:53:50 -07:00
Shiva Krishna Pittala
29817dce94 qcacmn: Move REGDMN and wireless modes to reg_services_public_struct.h
There is a requirement to use REGDMN and wireless modes in UMAC layer of
the cmndev component. As the WMI_HOST_REGDMN modes currently are defined in
WMI layer, we can't use them directly in the UMAC layer. Hence move them
to the reg_services_public_struct.h and rename them as HOST_REGDMN modes.
Replace all WMI_HOST_REGDMN instances with HOST_REGDMN. Wireless modes are
currently defined in WIN component, use them to cmndev component.

CRs-Fixed: 3044590
Change-Id: Iee5fa1745a1a44b834334746b10bdbb6f6563a0a
2021-09-27 22:22:23 -07:00
Huashan Qu
88c125a678 qcacmn: Rename QCA_MCL_DFS_SUPPORT to MOBILE_DFS_SUPPORT
Rename QCA_MCL_DFS_SUPPORT to MOBILE_DFS_SUPPORT.

Change-Id: Ic209f76e3a9b1a7a524d7036a0fef7ca044d4ca8
CRs-Fixed: 3038271
2021-09-23 21:35:24 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
Hariharan Basuthkar
547c60d7d7 qcacmn: Change return type to QDF_STATUS
wmi_unified_register_event has a return type of QDF_STATUS.
Handle the same return type in the following callers:

1. target_if_dfs_reg_ocac_event
2. target_if_dfs_reg_offload_events
3. target_if_reg_phyerr_events_dfs2

Change-Id: I622f6f6c4ff3b428a6407b6526e823083cc1fd8a
CRs-Fixed: 2767507
2020-09-17 18:34:10 -07:00
Neha Bisht
466c04dee9 qcacmn: remove dependency of public files from wlan_objmgr_psoc_obj.h
Remove dependency of wlan_lmac_if_def headerfile from
wlan_objmgr_psoc_obj.h

Change-Id: Ida8472e6f05a90b3930b5a13a2bf89ea8b3e938f
2020-05-15 10:41:46 -07:00
Priyadarshnee S
4c6b5c6f69 qcacmn: DFS API support for Rolling CAC
An extension of preCAC feature is Rolling CAC. The distinct difference
between these features is that the FW runs the off channel CAC
timer for a "finite" time for preCAC and runs the timer for "infinite"
time on an off channel. Hence the infrastructure built for
preCAC feature is being modified to accommodate RCAC feature as well.
Following are the modifications done:

1. Add an enum to represent various off-channel CAC modes.
2. Remove the 'static' declaration of few APIS so as to re-use them.
3. Add 'dfs_rcac_ch_params' to DFS PDEV object to store the RCAC
channel params so as to use the channel params after radar detect.
4. Rename DFS APIs to match its functionality.

CRs-Fixed: 2670419
Change-Id: I0bf0d33955706941cffb4e9cf6fcebfb465a6c74
2020-04-28 03:59:10 -07:00
Vignesh U
6933f411c1 qcacmn: Add support to configure 165MHz Agile channel
The FW has updated the wmi command wmi_vdev_adfs_ch_cfg_cmd_fixed_param to
configure the Agile channel to enable the 165MHz channel as an Agile
channel by enabling 2 center frequencies.

For a 160MHz and 80MHz channel, the parameter center_freq1 will be the
center of the respective channels. For the 165MHz channel(restricted 80p80)
the parameter center_freq1 will be the center of the left 80MHz channel
(5690MHz) and the parameter center_freq2 will be the center of the right
80MHz channel (5775MHz)..

Update the ADFS parameters across UMAC, TARGET_IF and WMI layes to
update the Agile channel configuration command.

Change-Id: Ie480af9a6bb8dad87dd783ab06e17b449605b1c9
CRs-Fixed: 2642555
2020-03-24 02:42:43 -07:00
Basamma Yakkanahalli
9def5df14a qcacmn: device ID and target type checks for ipq5018 target
Initial changes for ipq5018 compilation.
Added device ID and target type checks for ipq5018 traget.

Change-Id: Ib86a371fbe66749fcb6d114e7a4a9931b684e03d
2020-03-20 23:45:43 -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
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
gaurank kathpalia
18495feac0 qcacmn: Use proper macro instead of config_mcl
Use proper macro instead of config_mcl to compile
the API target_process_bang_radar_cmd.

Change-Id: I3a2fca998d69f2a29243b9ecd2a290af9602d6c2
CRs-Fixed: 2490649
2019-07-19 02:48:26 -07:00
Akshay Kosigi
c36e354311 qcacmn: Fix for removal of void pointer usage
Add changes to remove usage of void pointer for wmi_handle
Instead use an opaque pointer(set 2)

Change-Id: I06a89adaf15c6b398dbc901518aa83927b7ca16a
CRs-Fixed: 2479298
2019-07-02 09:47:56 -07:00
Basamma Yakkanahalli
b85768e4e5 qcacmn: Remove HK header dependencies for ipq6018 compilation
Add target specific HW header for ipq6018 compilation.
Remove the 8074 header dependencies for 6018 compilation.

Change-Id: I8e45e3e039a4596c6722538405dcd381918fa6b1
2019-05-02 01:25:01 -07:00
Priyadarshnee S
457b26718a qcacmn: Correct issues in DFS Full Offload featurization
Change I498ac1f8cd1d6423032d7b3b8c233656c5f0bf22 ("qcacmn: Have separate
macros for DA/PO/FO to reduce the code size") introduced featurization of
the DFS logic. Two functions, target_if_dfs_reg_offload_events() and
dfs_fill_emulate_bang_radar_test(), were not correctly featurized,
resulting in compilation failures when WLAN_DFS_FULL_OFFLOAD is not
enabled. To prevent these failures properly featurize the functions.

CRs-Fixed: 2366596
Change-Id: I4bcecf95d92cb3ebe2ff893c17755385dda11429
2019-04-05 18:45:40 -07:00
Shaakir Mohamed
14ac61de4d qcacmn: Add target interface support for Agile DFS feature
Add target interface support for Agile DFS feature. This includes:
	1)target interface to send agile dfs request command
	2)target interace to send  off-channel cac abort command

Change-Id: Ica0cecd08dc1cd90fe71a618afe749b50dc1cb6d
CRs-Fixed: 2385536
2019-03-14 14:28:26 -07:00
bings
9b58b7ad56 qcacmn: Remove CONFIG_MCL for target_process_bang_radar_cmd
target_process_bang_radar_cmd should be defined with meaningful body only
when WLAN_DFS_FULL_OFFLOAD is defined.

This is for CONFIG_MCL cleanup

Change-Id: Id038231e6aa967c68674f40ef4247ac023313b71
CRs-Fixed: 2411981
2019-03-12 00:56:24 -07:00
Jeff Johnson
94f016c5f2 qcacmn: Fix BLOCK_COMMENT_STYLE issues in target_if/dfs
A few instances of violating "Block comments should align the * on
each line" have been identified in target_if/dfs, so fix them.

Change-Id: Ic198912225b8bec587e30d00d7a2a5f76e03d366
CRs-Fixed: 2359528
2018-12-02 14:59:56 -08:00
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
Priyadarshnee S
8bf0fa04eb qcacmn: Target if Changes to send usenol pdev param
Add changes in target interface layer to send usenol pdev param to FW.

Change-Id: I5526066f34ae27234f9542fdd54901e6eb915fdb
CRs-Fixed: 2328894
2018-10-18 02:17:34 -07:00
Shashikala Prabhu
70da943414 qcacmn: Add wmi wrapper function to get target pdev id from host
Add wmi wrapper function to convert host pdev id to target  pdev id.

Change-Id: I3824a7556bf0b740d069602e9ee5a572c427c49c
CRs-Fixed: 2316715
2018-10-02 13:48:38 -07:00
Arif Hussain
d5a4e64886 qcacmn: Add validation code for wmi handler in dfs module
Add validation code for get_wmi_unified_hdl_from_psoc() return
to avoid null pointer access.

Change-Id: I05a8c135df5197356c77df4997d978c0209b0dfd
CRs-Fixed: 2317012
2018-09-21 00:27:19 -07:00
Tushnim Bhattacharyya
680c3e8340 qcacmn: Fix NULL pointer dereference in dfs
In target_if_radar_event_handler, target_if_dfs_cac_complete_event_handler
& target_if_dfs_radar_detection_event_handler wmi_handle is derived &
dereferenced with out a NULL check. Add a NULL check for wmi_handle
before it is dereferenced.

Change-Id: I6dde5132a6a2e31a25654bd818a90e1c164a4a74
CRs-Fixed: 2305505
2018-09-06 01:42:04 -07:00
Frank Liu
c2241bc64f qcacmn: Remove phyerr filter offload check
Currently if ini config dfsPhyerrFilterOffload is set zero on Rome
attached Platform, wlan interface will fail when do interface up.
This makes no sense, since ini configure can be set to zero, also
in this case host can handle the phyerr event instead.

Remove this check in target_if_reg_phyerr_events_dfs2.

Change-Id: Ie33072c8d40925eb550bd820462fc9ab93f0e0c0
CRs-Fixed: 2286382
2018-08-08 22:52:02 -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
Vignesh U
4159e623b5 qcacmn: Add target_if changes for host DFS confirmation check
Register for host dfs check event.

Change-Id: I7d6a87e9a6d7e4a4b7a127e05d230b876581bb12
CRs-Fixed: 2211883
2018-05-21 03:53:27 -07:00
Akshay Kosigi
dbbf2c45da qcacmn: Replace ucfg prefix with lmac
Replace functions with ucfg as prefix in init_deinit_ucfg file with lmac as
prefix

Change-Id: I90d77dd5ddae4854ea68eeb67dc1b4fc356c2fe3
CRs-Fixed: 2182449
2018-05-11 22:40:16 -07:00
Akshay Kosigi
2a216edab0 qcacmn: Replace void pointers with appropriate/common structure types
Void pointer usage may lead to memory corruption due to
wrong pointer is typecasted. Hence define structure for all, and modules
internally typecasting based on their type

Change-Id: I6271ed8aa3f94254fd85f41962f23ea36895154e
CRs-Fixed: 2182452
2018-05-11 22:40:13 -07:00
Abhijit Pradhan
ed8c9d3bc8 qcacmn: Have separate macros for DA/PO/FO to reduce the code size
Since, an AP may have any combinations of DA,PO, and FO chips on it,
having support for all chips always is redundant. Therefore, enable the
chip specific code as and when required.
DA:- Direct attach
PO:- Partial offload
FO:- Full offload
WLAN_DFS_DIRECT_ATTACH    :- enable/disable DA specific DFS code.
WLAN_DFS_PARTIAL_OFFLOAD  :- enable/disable PO specific DFS code.
WLAN_DFS_FULL_OFFLOAD     :- enable/disable FO specific DFS code.

Change-Id: I498ac1f8cd1d6423032d7b3b8c233656c5f0bf22
CRs-Fixed: 2199819
2018-03-23 03:18:32 -07:00
Pratik Gandhi
7846150f2b qcacmn: Fix compilation issues for FW header abstraction
fwhdr_abstrct: Fix compilation issues for WIN firmware header abstraction.

Change-Id: Id76a6f29fd41ae559cf377029428224d59bd03fb
CRs-Fixed: 2140921
2018-03-09 07:28:50 -08:00
Arif Hussain
77ba8f42ca qcacmn: Fix possible null pointer de-references in DFS
Add null check to avoid null pointer de-references.

Change-Id: I3d6f6b182669ae4925ed85be2403bb0c18faeff5
CRs-Fixed: 2196070
2018-03-07 16:28:07 -08: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
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
Shashikala Prabhu
8136b58f56 qcacmn: Fix radar detection failure for DA and PO
DFS capability was not set properly for Partial-offload(PO) and
Direct-Attach(DA) radio. Thus radar detection failed.

Change-Id: I5493d7195a57f160792a411653c05bbf220d3561
CRs-Fixed: 2160418
2018-02-01 04:16:49 -08:00
bings
b004c6d432 qcacmn: Refine DFS object allocation for MCL
Currently DFS object can only be allocated if radio supports 5G.

Rome supports 5G and saves its wireless_mode in hal_reg_cap of
psoc->service_param because Rome FW does not support wmi event
wmi_service_ready_ext_event_id.

Check wireless_modes based on different DFS_SUPPORT.

Change-Id: I0120dde4fcf47bd71f6da512fae64dd62f5f46c8
CRs-Fixed: 2179925
2018-01-30 17:43:32 -08:00
bings
0344d1c399 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: I7a5c4f723bedfdeb477ac36ac1290809ca06fb13
CRs-Fixed: 2160418
2018-01-27 00:10:26 -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
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
Jeff Johnson
9d1aa2cc25 qcacmn: target_if: Replace instances of unadorned %p
Replace instances of unadorned %p in target_if.

Change-Id: I1c8a1b98be2d12fcf8e1fadf4a889268dfe37058
CRs-Fixed: 2111274
2017-10-03 16:02:33 -07:00
Arif Hussain
e22618a790 qcacmn: Change soc level pdev id as per new definition
soc level pdev id changed from zero to WMI_HOST_PDEV_ID_SOC (0xFF)
change pdev id in wmi_unified_dfs_phyerr_offload_en_cmd call
according to new definition.

Change-Id: I3c55dc8821c4186190515564b00f54f2427d5702
CRs-Fixed: 2090282
2017-08-14 14:58:11 -07:00
Vivek
b02a649f89 qcacmn: Remove vdev/peer locks for trivial APIs
Remove vdev/peer locks from trivial API's. This follows the changes from
which the lock requirement from few simple APIs are removed.

Change-Id: I9972d51dfd1a42bdedbfd0fd4e67af03d030a1f5
CRs-Fixed: 2060880
2017-06-26 23:32:22 -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
Vivek
57522058e9 qcacmn: Add target information details to target_iflayer
Add a new target_psoc_info structure in the target if layer with the
following members

wmi_handle
target_type
target_version
target_revision

Also update the psoc data member tgt_if_handle to point to target_psoc_info
instead of pointing to WMI handle directly.

Updated all calls to psoc_get_tgt_if_handle to target_if_get_wmi_handle
which inturn calls psoc_get_tgt_if_handle and getting the tgt_if_handle
returns the WMI handle

CRs-Fixed: 2048277

Change-Id: Icb02d5f3c09f7f9bb7eff4d814ef3ce90ddb84bd
2017-06-08 11:34:37 -07:00
Arif Hussain
948ddd56e7 qcacmn: DFS component target interface support
Add support to handle WMI commands and events related
to DFS component.

Change-Id: Ie21cd8cfbe35dfea31ca608d47a5dfe937d753f4
CRs-Fixed: 2017481
2017-04-17 19:26:43 -07:00