Commit Graph

1281 Commits

Author SHA1 Message Date
Rahul Gusain
7af5b194e4 qcacmn: Bypass the peer check for NAN in crypto set keys
Currently, host driver installs keys for STA, SAP and P2P
iface. A peer validation is present to do so in these modes
in crpto API(target_if_crypto_set_key). NAN vdev also needs
same support for NAN pairing protocol but doesn't have a peer
as such.
So, bypass peer validation for NAN vdev.

Change-Id: Ief003d096da6f241ff13329c49a32cd896dec9db
CRs-Fixed: 3257754
2022-08-27 19:54:38 -07:00
Sreeramya Soratkal
057bd5f570 qcacmn: Remove unused local variables in spectral module
Remove unused local variables in the Spectral module to
address the compiler warnings.

CRs-Fixed: 3272706
Change-Id: I91c806a9bd6413eb559992a0b184d8bd9c4ea4d0
2022-08-26 14:21:26 -07:00
Pavankumar Nandeshwar
63ab2d8c33 qcacmn: Hif and tgt_if changes for Umac post reset at host
Hif and tgt if layer changes to handle Umac post reset
and post reset complete events from firmware.

Change-Id: I08bbd90741708fe76b2db0371ccfda7bfe7b0b2d
CRs-Fixed: 3267222
2022-08-21 00:38:00 -07:00
Sham Muthayyan
1e28e45ce7 qcacmn: Add WMI health monitor events
Add WMI health monitor events to send the health
monitor data to application.

Change-Id: I792b733822b03518dc964f38fe4a158132b0ac49
CRs-Fixed: 3266229
2022-08-21 00:37:39 -07:00
Yu Wang
67011a392c qcacmn: add support for CoAP
Add support for Constrained Application Protocol.

Change-Id: I425206a990778cf946a4805192eff4d54562a945
CRs-Fixed: 3254128
2022-08-17 23:14:34 -07:00
Shreedhar Parande
4854e732d7 qcacmn: Get UL-MUMIMO support from Target
Read UL-MUMIMO from target cap flag

CRs-Fixed: 3255924
Change-Id: I02d7644b3dc43c757d8363d8de0f66c856c041ce
2022-08-12 20:58:39 -07:00
Nidhi Jain
ebb31019a3 qcacmn: Update max data length for waikiki
This is used in streamfs buffer size.
This is done in consideration with using upto
504 tones in place of 512 tones for CFR.

Change-Id: I7e45697e47f4b818b472b1bd8e91d785e676c506
CRs-Fixed: 3260185
2022-08-04 05:51:29 -07:00
Shiva Krishna Pittala
8641a158f3 qcacmn: Hook the UMAC reset in the target attach path
Call UMAC reset initialization API from soc_attach_target().
FW exposes a service bit for this feature, use that to conditionally
enable this feature. Also, add default log levels for this feature.

CRs-Fixed: 3253464
Change-Id: Ia7c9cf07a7ab7b000ebe452ab074a82173b70129
2022-08-03 07:35:26 -07:00
Naveen S
e86fc7ebe9 qcacmn: Removing error value return on event registration failure
WMI_SPECTRAL_CAPABILITIES_EVENTID registration returns QDF_STATUS_E_FAILURE
on failure which is not required as it is causing crash on failure where
event registration is failing i.e., Hawkeye + Swift

Change-Id: Id11d76941b12d0ee249d8f6e86612b351b732d78
CRs-Fixed: 3255827
2022-08-03 01:34:40 -07:00
Shiva Krishna Pittala
caa7965659 qcacmn: Update the Detector ID to mode table based on FW_PARAMS event
Currently, we are hardcoding the detector ID to mode table for different
chipsets. Starting QCN9224, the target sends information regarding the
detectors participating in that Spectral session in the FW_PARAMS event.
Use that to update the Detector ID to mode table.

Change-Id: Ic09358e0c3b9ac0166b39f5ce445a83697146d4a
CRs-Fixed: 3253076
2022-07-27 01:59:24 -07:00
Shiva Krishna Pittala
98b4eee3ac qcacmn: Add support to build Spectral detector list for split-PHY mode
Currently, the Spectral detector list building logic assumes that only
5 GHz or 6 GHz participates in SBS modes. With Split-PHY mode in QCN9224,
even a 2.4 GHz radio can participate in SBS mode.
So, consider this case as well while building the detector list.

Change-Id: I99c841584c52785e94c8ee1b0d59494cbdd37f42
CRs-Fixed: 3252986
2022-07-27 01:59:16 -07:00
Shreedhar Parande
e6b1ed7180 qcacmn: Read EML and MLD Cap from target
Extract EML and MLD Capabilities from Target via
wmi_service_ready_ext2_event. These values can be
used while advertising EML and MLD Capabilities.

Add helper function to get EML related delays in
Micro Secs from values got from EML and MLD advertisments.

Send EML Capabilities received from node to Target
via WMI_PEER_ASSOC.

CRs-Fixed: 3225495
Change-Id: Ibfa2ff8dbf11d4293125331376a7986e611d5f63
2022-07-23 19:14:48 -07:00
Shiva Krishna Pittala
3567bb3b57 qcacmn: Add support to process Spectral capabilities event
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the target SW to
indicate the different capabilities of the Spectral HW.
Add support to process this event and extract the capabilities.

Change-Id: I03b3236b6def98d24e77b2a9ea51ee866e62e6fe
CRs-Fixed: 3238450
2022-07-22 07:00:18 -07:00
Pragaspathi Thilagaraj
728ff15ea3 qcacmn: Don't allow PASN peer create if peer del all is not supported
Firmware advertises WMI_SERVICE_DELETE_ALL_PEER_SUPPORT
capability to indicate vdev peer delete all command support.
PASN peer relies on the WMI_VDEV_DELETE_ALL_PEER_CMDID
command to delete the PASN peers before vdev delete.

So allow PASN peer create only on targets that advertise
WMI_SERVICE_DELETE_ALL_PEER_SUPPORT.

Change-Id: Ib94d9e14e34dd1e5c25bf6946e0d59fe83fd6dd3
CRs-Fixed: 3229438
2022-07-18 16:00:32 -07:00
Edayilliam Jayadev
62e885aa1b qcacmn: Log raw snapshot values
Log raw values of management Rx REO snapshots for debug purposes.

CRs-Fixed: 3242558
Change-Id: Idf30985691226e835190bd3305f29e2d43e654b5
2022-07-18 02:51:36 -07:00
Aditya Kodukula
ec13c2ea39 qcacmn: Add infra to support DBAM feature
Add infra to support Dedicated Bluetooth Antenna Mode (DBAM)
feature. It is used to switch between dedicated antenna for
BT and shared antenna for WLAN and BT.

Change-Id: I21688093674ef9b63ee811df9168a31bd71c56b5
CRs-Fixed: 3239895
2022-07-17 23:12:37 -07:00
Pragaspathi Thilagaraj
38b8236ddc qcacmn: Add support for initiate pasn auth vendor command
Add support for initiate pasn authentication using the vendor
command: QCA_NL80211_VENDOR_SUBCMD_PASN
Fill the below required attributes to initiate PASN:
QCA_WLAN_VENDOR_ATTR_PASN_ACTION
QCA_WLAN_VENDOR_ATTR_PASN_PEERS
QCA_WLAN_VENDOR_ATTR_PASN_PEER_MAC_ADDR
QCA_WLAN_VENDOR_ATTR_PASN_PEER_SRC_ADDR

Change-Id: If33f54eafe5986b4571cc21a80fb0b61578db116
CRs-Fixed: 3232261
2022-07-14 04:12:51 -07:00
Subrat Mishra
1ecf591ecf qcacmn: Fix TWT configuration for 2.4 GHz PHYB mode MAC
Fix TWT configuration for 2.4 GHz PHYB mode MAC.

Change is macro protected. Wlan resource config sets twt_ap_pdev_count
to number of Radios per psoc. But for 2.4 GHz vap coming up in PHYB
mode needs the value 2 if only one radio is enabled per psoc. WAR is
done from host driver to enabled TWT certification process. Actual fix
must be done from Firmware code.

Change-Id: Id29692097ee555c94c54f53d7540eb108fbe98e0
CRs-Fixed: 3238210
2022-07-12 14:02:02 -07:00
Amruta Kulkarni
34afd4b92f qcacmn: Define runtime pm lock for roaming
Define new runtime pm lock to be used during roaming.

Change-Id: Ia0d440d432b655c1e7fe41bdb12e4ad5207e7ad1
CRs-Fixed: 3239693
2022-07-12 02:30:48 -07:00
Jayachandran Sreekumaran
1b244cfcb0 qcacmn: target_if support for spatial reuse feature
Add target_if support for spatial reuse feature

Change-Id: If0ad6e459e7b7d215d5016c8c7c0e94df5d36649
CRs-Fixed: 3213486
2022-07-11 23:13:02 -07:00
Pragaspathi Thilagaraj
f0cac26bbb qcacmn: Add support to delete all pasn peers
Add support to delete all pasn peers

Change-Id: I2c3d95cb8994693d8944d69624d2db0992f2f03d
CRs-Fixed: 3158523
2022-07-06 23:08:01 -07:00
Pragaspathi Thilagaraj
b7fa703306 qcacmn: Add support to send PASN commands
Add support to send below PASN commands:
WMI_RTT_PASN_AUTH_STATUS_CMD
WMI_RTT_PASN_DEAUTH_CMD
WMI_VDEV_SET_LTF_KEY_SEED_CMDID

Change-Id: I5a50a634317d0a692feee5be5a36da22b4c5d713
CRs-Fixed: 3154530
2022-07-06 23:07:52 -07:00
Srinivas Girigowda
6d056b9959 qcacmn: Add support for Mango device id
Add support for Mango device id.

Change-Id: I2b32a39e258caab408723db77f132af364dc6b04
CRs-Fixed: 3232512
2022-07-02 09:55:56 -07:00
Edayilliam Jayadev
a4ef0b598c qcacmn: Increase read retry limit
Increase the snapshot read retry limit.

CRs-Fixed: 3230957
Change-Id: I65fc132c689a3cd2af726c131e2488cad88c9685
2022-06-29 11:24:46 -07:00
Edayilliam Jayadev
5cc707a17c qcacmn: Invalidate mgmt Rx REO snapshots
Invalidate management Rx REO snapshots which are stale.

CRs-Fixed: 3229249
Change-Id: I8a1b534af0b8371bbc6809cf7eeb8655b6028773
2022-06-29 11:24:40 -07:00
Shwetha G K
e36320f58f qcacmn: Update streamfs buf size for waikiki
Update streamfs buffer size for waikiki

CRs-Fixed: 3224877
Change-Id: I86a622ca8ea938915bcec00320918b87b2a4a74e
2022-06-27 23:30:19 -07:00
abhinav kumar
f55ec57e32 qcacmn: Support vendor handoff service bit info from FW
Add change to fetch and save the WMI service capability
bit of FW to support vendor handoff control feature
using service bit.

Change-Id: I6bc85f2807032bf84d391f34c814c91de906ab42
CRs-Fixed: 3225147
2022-06-23 08:51:02 -07:00
Shwetha G K
f803ff0a76 qcacmn: Allow CFR init/deinit on waikiki
Allow CFR init and deinit on Waikiki target.

CRs-Fixed: 3217568
Change-Id: I7bce63d0c15c11e99c4b294574515b9cc0f7b95a
2022-06-16 11:52:43 -07:00
Yu Wang
a9461beb20 qcacmn: refine the APIs for reap timer of monitor status ring
Since more than one components depend on reap timer of
monitor status ring, add bitmap to record the trigger
sources of the timer and refine the APIs/calling functions
accordingly.

With this change:
When a new start request comes, if the source is
CDP_MON_REAP_SOURCE_ANY, skip bit set, and start timer
if any bit has been set in the bitmap; while for the
other sources, set the bit and start timer if the bitmap
is empty before that.

When a new stop request comes, if the source is
CDP_MON_REAP_SOURCE_ANY, skip bit clear, and stop timer
if any bit has been set in the bitmap; while for the
other sources, clear the bit and stop timer if the bitmap
is empty after that.

Change-Id: Idaa7837c4b93b247ff2236aa5072d309fa9548c2
CRs-Fixed: 3190347
2022-06-13 22:54:46 -07:00
Madhvapathi Sriram
f4bfa6616b qcacmn: Add method to configure TID queues flush
This enables the option to configure when a peer's
TID queue needs to be flushed. This is required to
discard packets that are no longer useful to the application.

Change-Id: I558debff043fc0c8038e5f5f2c815b64c90e1561
CRs-Fixed: 3130422
2022-06-09 19:37:26 -07:00
Divya R
33e3e1d6a8 qcacmn: Initialize the chan_params structure
chan_params structure is uninitialized, due to which variables
inside the chan_params structure have garbage values.
To avoid this, initialize the chan_params structure.

Change-Id: Ic09c0a2d24c2a1eac8f076c7bbd4d25d147370fd
CRs-Fixed: 3205502
2022-06-01 01:45:37 -07:00
Debasis Das
c5d3129015 qcacmn: Handle failure during wmi event handler registration
For legacy targets, MLO-specific event-handlers are not
supported.As this is not fatal, the caller of the
wmi_event_handler_register API should not treat this as
failure.

Change-Id: Ic6a36c933b46cfcbe860f573af290cac4667de44
CRs-Fixed: 3181774
2022-05-26 03:53:18 -07:00
Edayilliam Jayadev
0130242aed qcacmn: Set/Get mgmt Rx REO feature capability
Set/Get the management Rx REO feature capability to psoc
using the correct APIs.

CRs-Fixed: 3201829
Change-Id: Id925be4a6930a1a3ec05bfdd67ef6518a5cb2cea
2022-05-24 16:01:21 -07:00
Amith Ajith
70e862a7ef qcacmn: Set global_tbl_lookup to true if country opclass is global
In function reg_freq_width_to_chan_op_class_auto, global_tbl_lookup is set
to false for 2.4 GHz and 5 GHz without considering the global opclass set
by user command. This results in wrong opclass information in eCSA.

Add an api to check if global opclass is set and update global_tbl_lookup
accordingly in reg_freq_width_to_chan_op_class_auto.

Change-Id: I069131d6068fb546f2b59f1e752a3c8c50f15759
CRs-Fixed: 3168817
2022-05-24 09:39:08 -07:00
Manoj Ekbote
298e39a2e2 qcacmn: Re-organize TWT session stats event handling
Re-arrange code for registration and handling of TWT session
event.

Change-Id: I0b4388a3d85cb387c2f5160fc13bbedb1d246da3
CRs-Fixed: 3150694
2022-05-18 14:31:39 -07:00
Edayilliam Jayadev
bcc93ce051 qcacmn: Increase read retry limit for mgmt Rx REO
Increase the retry limit for reading management Rx reorder
snapshots.

CRs-Fixed: 3193277
Change-Id: I4474e4be5d15a0c5bd4d0c613b314950ddb26c6f
2022-05-16 03:50:02 -07:00
Liangwei Dong
28ceb47c1d qcacmn: populate num_max_active_vdev in WMI init
Set num_max_active_vdevs to WMI init command and
extract it from WMI ready event.

Change-Id: I6d6377c03214fcab74c675839f136301ebf27834
CRs-Fixed: 3183010
2022-05-15 20:51:00 -07:00
Kai Chen
627746d6bb qcacmn: AFC device deployment type support
Add init sequence handling to support AFC device deployment type
Set AFC device deployment type to regulatory private obj

Change-Id: Ib041d2010552412aaaa41395915d948aa2ea2bba
CRs-Fixed: 3190288
2022-05-10 22:12:35 -07:00
Shiva Krishna Pittala
80edcddb01 qcacmn: Spectral init path changes for QCN9224
Add the Spectral init path changes required for Waikiki.

Change-Id: I6c6bb826ff4ce02988560100b187fe1acffa3f7d
CRs-Fixed: 3160798
2022-05-05 01:21:04 -07:00
Edayilliam Jayadev
cecf753cac qcacmn: Fix compilation issues in mgmt Rx REO
Fix compilation issues in mgmt Rx REO feature.

CRs-Fixed: 3179407
Change-Id: I19e475b9f4eb5615d9ae63a85af3daf3ea1434ba
2022-05-03 12:41:07 -07:00
Pragaspathi Thilagaraj
7738bad9e9 qcacmn: Add support to manage Wifi pos vdev private object
Add support to manage Wifi pos vdev private object. Add new peer
type in enum wlan_peer_type. Add rx_ops and register the rx_ops
for PASN peer create/peer delete request.
Register 11az PASN related WMI events in target if.

Change-Id: I2a5e4d8d7c9b9562d9ab02b287957e93ee6f4758
CRs-Fixed: 3154521
2022-04-30 22:49:55 -07:00
Edayilliam Jayadev
f1373c7ace qcacmn: Extract reo params only if FW feature flag is enabled
Extract management Rx REO params only if FW feature flag is enabled.

CRs-Fixed: 3182774
Change-Id: I3051a54af9d9671edd7833a23444f72602c35e88
2022-04-28 10:40:54 -07:00
Edayilliam Jayadev
ff6d633d72 qcacmn: Add WAR to consistently read mgmt Rx REO snapshots
Read the management Rx reorder snapshots back to back to get a
consistent value.

CRs-Fixed: 3181479
Change-Id: I5ff73db5d4be362d7449494f3630a11da0456f0e
2022-04-28 10:40:43 -07:00
Ashish Kumar Dhanotiya
e9c9acf630 qcacmn: Add 11d offload APIs under correct feature flag
Currently host driver defines 11d offload APIs under
HOST_11D_SCAN feature flag which is not correct.
Add 11d offload APIs under TARGET_11D_SCAN feature flag.

Change-Id: I0d3205b215c9fc363a71c4e7a6b54e40fb10a964
CRs-Fixed: 3183200
2022-04-28 03:12:44 -07:00
sumedh baikady
324dcd5688 qcacmn: Add target check for reo shared qaddr enabling
Enable REO shared qref for 11be targets.
Fix a compilation issue in printing dma_paddr type. 

Change-Id: Ib8568a82e96016ea367c8e0122d862e3d6e70d00
CRs-Fixed: 3178147
2022-04-26 14:59:37 -07:00
Edayilliam Jayadev
94d603ee9b qcacmn: Add support for multiple snapshot versions
Add support for multiple version of management Rx reorder
shared snapshots.

CRs-Fixed: 3171325
Change-Id: Idae8d3f8179dc4a60730033e55d5744324133839
2022-04-26 10:00:35 -07:00
Shiva Krishna Pittala
d7826cc02e qcacmn: Don't unregister a DDMA module if it was not registered earlier
When we try to unregister a module that was not registered earlier, we will
try to unmap the buffers that were not allocated. As a result, we end up
with invalid memory access. Fix this issue by checking if the module was
registered before unregistering it.

Change-Id: I97c4ee7a6690c6cba2a7d1a919a39fcb12ebb692
CRs-Fixed: 3179498
2022-04-26 07:03:57 -07:00
Vishal Miskin
36da36e010 qcacmn: Populate TWT target API to set pdev param
Populate TWT target API to set pdev param

Change-Id: Id82ee089825293c05bace5ead97727c8c79845db
CRs-Fixed: 3168199
2022-04-26 07:03:52 -07:00
abhinav kumar
5cb3946000 qcacmn: Support multi-client service bit info from FW
Add change to fetch and save the WMI service capability
bit of FW to support multi-client low latency feature
using service bit.

Change-Id: Ifce82c06fc913668949ed06634da1eebcea80397
CRs-Fixed: 3180932
2022-04-25 05:38:28 -07:00
Manoj Ekbote
3ba452b700 qcacmn: Use pdev specific WMI handle for TWT cmds
While pushing WMI cmds for TWT enable/disable, use separate
CE instance for each pdev.

Change-Id: I63e77996f9face7e319fbd8abf580d13ce1c05a1
CRs-Fixed: 3162042
2022-04-25 01:48:12 -07:00
Pragaspathi Thilagaraj
4abe857789 qcacmn: Add support for per candidate roam frame capability
Firmware advertises per candidate roam frame capability to
indicate:
1. Firmware sends auth/assoc frames for each candidate to
which roaming was attempted.
2. Fill the frame info TLV with authentication algo = 3
for authentication frames.

Add support for the roam per candidate frame info capability

Change-Id: I95c23031ab0fbc21fb9d8db3bd54004e4d1ac234
CRs-Fixed: 3172311
2022-04-22 08:39:58 -07:00
Shiva Krishna Pittala
eb29b7fac2 qcacmn: Don't use packmode_fftbin_size_adj WAR for QCA9574
packmode_fftbin_size_adj is used when the reported FFT bin length from
HW is twice the actual size. This issue is fixed in HW from Pine onwards.
So, don't use this WAR on QCA9574.

Change-Id: I43a4bcb6f238fac6a14c1f6459d7ad24a7a99b2d
CRs-Fixed: 3165085
2022-04-22 06:10:19 -07:00
narayan subramhanyan
802a169c36 qcacmn: Update cfr metadata version for Alder
Update cfr metadata version for Alder as agc gain table index
is reported newly on this target

Change-Id: Ie9b4933068163d461676a9005ba8c706730717e8
CRs-Fixed: 3170137
2022-04-12 16:39:48 -07:00
sumedh baikady
52181cceb1 qcacmn: Fix Reo qref issues
1. Since peer id is reused for reconnection in MLO case,
old entries for queue desc addr is cleared. Clear the reo
internal storage and reset it back on client connection.

2. Send Qref feature WMI cmd to FW to enable the feature.

Change-Id: I6705ce121c8c25d9a2ace039dab21312fa5ea4b1
CRs-Fixed: 3156642
2022-04-12 06:31:36 -07:00
Bing Sun
37a48b157f qcacmn: provide is_create_punc_bitmap when generateing puncture
Puncture is one of 11be feature. Even 11be compile macro is defined,
Dut can start AP with non-11be mode. Regulatory component has no idea
whether it should consider puncture or not. Puncture should be a
configurable parameter from caller.
When updating channel state, puncture should be considered for 11BE
AP. is_create_punc_bitmap should be set in struct ch_params and pass
it to reg_get_5g_bonded_channel_state_for_pwrmode.

Change-Id: I96fb131f2df201a827ab7d98ca099a38b008e0d3
CRs-Fixed: 3160259
2022-04-08 01:57:29 -07:00
Edayilliam Jayadev
44b985cc97 qcacmn: Fix MLO global shared memory parsing
Fix issues in MLO global shared memory parsing.

CRs-Fixed: 3111721
Change-Id: Iba229e5c5176c4d1b0ad6a2a676c0cce8488a5c0
2022-03-30 10:52:25 -07:00
Edayilliam Jayadev
b4d1204cad qcacmn: Validate the MLO HW link info from global shmem
Validate the MLO HW link related info obtained from the global shared
memory arena of management Rx reorder feature.

CRs-Fixed: 3111549
Change-Id: I6fd7812dc49bfa8428b2ffbf66ae978592734bc0
2022-03-30 08:23:38 -07:00
Shwetha G K
73a570940f qcacmn: API for completion of MLO setup sequence
Add API to invoke call back API registered post MLO
setup sequence completion.

CRs-Fixed: 3153531
Change-Id: I16552ff46929c985ff4b7a62f47cc667fe6f132e
2022-03-29 21:56:30 -07:00
Manoj Ekbote
52cb1a0916 qcacmn: Change the return value for non-TLV targets
When non-TLV targets are used, the WMI event table is not populated.
So, it shouldn't be treated as fatal and WMI event register/unregister
functions can return NOSUPPORT instead of FAILURE.
Handle this value in TWT code.

Change-Id: I5bc8e7aae2e572c84ea0333c967cff527d5cbcc3
CRs-Fixed: 3145077
2022-03-29 12:22:35 -07:00
Shwetha G K
91fd67b612 qcacmn: Update cfr metadata version for Pine & HKv2
Update cfr metadata version for Pine and HKv2 as agc gain
table index is reported newly on these targets.

CRs-Fixed: 3158325
Change-Id: I17fe5a78ec44e1528e6187535a803c729734dd18
2022-03-28 10:48:05 -07:00
Shwetha G K
5672e51446 qcacmn: Add host timestamp to cfr header
Include a UTC timestamp when constructing the CFR header,
represented as a 64-bit nanoseconds value. This will allow
for better correlation with ground truth data.

CRs-Fixed: 3156846
Change-Id: Ic5308bcd591d641e715ded8e4b75d447160dbbce
2022-03-26 09:11:59 -07:00
Liangwei Dong
3c555431b1 qcacmn: Add API to get MAC-PHY number from target IF
Add API target_if_get_active_mac_phy_number to get max
active MAC-PHY pairs from target IF.
The API will loop through all HW mode and get max MAC-PHY
number in all HW modes.

Change-Id: I2755197c043f9d2df6f8aaf6bf50093a2d1b1596
CRs-Fixed: 3154072
2022-03-23 23:01:02 -07:00
Pragaspathi Thilagaraj
aa27094cab qcacmn: Add support to set 11az ext feature flags
Add support to set 11az ext feature flags
Read the firmware capability for 11az features and
advertise the corresponding wiphy flags.

Change-Id: I85f6cc2f65a5d9892830f66a726cffc823093bca
CRs-Fixed: 3150584
2022-03-23 19:42:26 -07:00
Pragaspathi Thilagaraj
8d44eccea7 qcacmn: Add new wifi_pos target_if files
Add below new target_if layer files for TX ops and
RX ops separately:
target_if_wifi_pos_tx_ops.c
target_if_wifi_pos_rx_ops.c

Change-Id: I0746881b5fd429bb0a003dbcfea11691a90e9c34
CRs-Fixed: 3139459
2022-03-23 19:42:19 -07:00
Shiva Krishna Pittala
aeb2ffde14 qcacmn: Add stats in Spectral report processing path
Add the following stats.
 - Number of Spectral events received from the target
 - Number of consume_spectral_report() invocations
 - Number of fill_samp_msg() invocations
 - Number of SAMP messages that are ready to be sent to the user-space
 - Number of SAMP messages queued to the user-space

Change-Id: I53fda4b309620043a77bc2bc87573941d7fb0bcb
CRs-Fixed: 3156151
2022-03-23 13:01:40 -07:00
Shwetha G K
8b4151516b qcacmn: Add crash info in global shmem arena
Changes to add chip crash info in global shared mem arena
and expose the respective APIs to qca_ol.
Also add APIs to process global link info tlvs in order
to offset to crash info.

CRs-Fixed: 3121465
Change-Id: Idabf9fb8d4755bdd755897b3c09d2e28259a6f46
2022-03-23 06:28:36 -07:00
Shwetha G K
5b9b6ffee5 qcacmn: Separate global shmem generic APIs from REO
Changes to move the global shared memory arena init deinit
APIs from MGMT RX REO cmponent to MLO component.

CRs-Fixed: 3121467
Change-Id: Ie5ca50780ffb3343d225b6cf6acfa569463d5a3e
2022-03-23 06:28:21 -07:00
Shreedhar Parande
1758b401e1 qcacmn: Add support to RSSI DBm conversion API
Add WMI PSOC rssi Dbm conversion support service id.

Change-Id: I0fe9e7519926b26372a222529d66345e1a3c5655
CRs-Fixed: 3152182
2022-03-21 05:35:53 -07:00
Priyadarshnee Srinivasan
4f3cbf6b28 qcacmn: DFS random channel selection for 11BE
Enable the wmi_service to fetch the radar found cfreq from
wmi_service_radar_found_chan_freq_eq_center_freq.

Add changes in DFS random channel selection algorithm
(1) To find a channel of input width 320MHZ. Since 320MHZ in 5G
is 240MHZ (320 - 80 punctured), there are 12 valid 20MHZ subchannels
possible in 240MHZ. Validate the continuity of 240MHZ channel before
declaring the channel to be found.
(2) To find a fallback channel for the input channel
width of CH_WIDTH_320MHZ. The fallback channel of 320MHHZ is
160MHZ.

CRs-Fixed: 3149475
Change-Id: I03cac7f090de20efd912402b5e4df543b47aafed
2022-03-14 22:31:26 -07:00
Wu Gao
ecf1416b42 qcacmn: Check cookie and avoid to read out of bound
Read out of bound due to invalid cookie and cause device broken. This
change checks cookie before using it as index of DBR buffer pool.

Change-Id: I1abc7d771cc62a7dd2dfe98784bf8ef2710f26ca
CRs-Fixed: 3144133
2022-03-10 17:09:21 -08:00
Jhalak Naik
055dfbe881 qcacmn: Add Host support for Spectral FFT recapture
Add support to receive the fft_recapture arg value
from spectraltool, handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scans.

Change-Id: Ied637704d25bb15bff2139a215da7481d4f80e4f
CRs-Fixed: 3140890
2022-03-09 06:51:27 -08:00
Jhalak Naik
24174b7be8 qcacmn: Add support for Spectral FFT recapture config
Add support to handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scan.

Change-Id: I6b92fcd674ae95bcd0a23892ef9ccc6ba487d6ad
CRs-Fixed: 3140890
2022-03-04 13:45:00 -08:00
Subrat Dash
b657bc4223 qcacmn: Bypass cds to create AST entry for WDS station
The qcacld driver does not register ol_if_ops callbacks
to handle wds AST request.

Call target if APIs directly to add, delete, and update
the AST entries for the WDS stations.

Change-Id: Ib4d5e1fdd6598e3390dbd2be0f24a72ccf01f202
CRs-Fixed: 3133839
2022-03-01 14:55:35 -08:00
Abhijit Pradhan
3f95481d0e qcacmn: Add powermode APIs under a new macro
Use  CONFIG_REG_ 6G_PWR_MODE for the new API.
Use "_for_pwrmode" as suffix for the new functions.

Change-Id: I9b84944a59062277b76bc48877c47ea5afada0ec
CRs-Fixed: 3133023
2022-02-28 12:57:10 -08:00
Hariharan Basuthkar
e7b559d010 qcacmn: Replace reg curchan with 6g ap power based chan list
The consumers of the current channel list may want to search through 6G
channels that are not part of current channel list and belong to channel
list of different power mode.

Therefore, replace the regulatory current channel list with that of 6G
power based channel list.

Change-Id: Ie2ff8bbfb50a5f95f584b134b18246cb28b1c406
CRs-Fixed: 3110987
2022-02-28 12:57:03 -08:00
Manoj Ekbote
e78a527ac1 qcacmn: TWT componentization changes
Include relevant header for MAX_SESSIONS and use
the correct build flag to retrieve session params.

CRs-Fixed: 3136148
Change-Id: I28ef98a67cbe479c5d8be93c49f9ae6ce63ba982
2022-02-28 09:10:11 -08:00
Venkateswara Swamy Bandaru
804b9e2382 qcacmn: Add EHT PPE threshold support
Add support for EHT PPE threshold's. Store 2G and 5G thresholds received
in service ready. Fill peer PPE thresholds for EHT peer.

Change-Id: Id5c8310cbf34c59a3d88072b37ce3f871354ed17
CRs-Fixed: 3128586
2022-02-21 22:41:33 -08:00
Srinivas Dasari
f8921a74b9 qcacmn: Wait for RSO stop response from firmware
Firmware doesn't expect any vdev commands from host while RSO stop
is happening. It sends a response to the RSO_STOP command once
it's done with cleanup. Host needs to run a timer and wait for a
maximum of 6 seconds for the response. Host can stop the timer and
allow the commands to firmware in the below cases,
1. RSO_STOP response with success status
2. RSO_STOP response with HO_FAIL status followed by
   HO_FAIL event: Host needs to wait till HO_FAIL event is
   received

If firmware doesn't send any response in the 6 seconds wait, issue
a recovery to help to check the firmware state.

Change-Id: I4577f9b0aac71c0c86bd32b59e69d9527bf107b9
CRs-Fixed: 3106032
2022-02-18 23:21:21 -08:00
Bing Sun
091c383271 qcacmn: Get pdev for dfs if pdev id is not 0
MCL host only has one pdev with pdev id as 0. If pdev id indicated
from FW is bigger than 0, MCL will not get pdev. Get pdev with pdev
id 0 in this case.

Change-Id: Ie43fc2d78d31ebaa3f32076704d81439f1d46830
2022-02-17 15:42:29 -08:00
narayan subramhanyan
893d63c744 qcacmn: Legacy Qwrap RE code cleanup
Remove Legacy Qwrap max client mode code as part of Legacy
RE code cleanup. Old change (same code changes as new) was
reverted as some PF checks were missing/skipped before merge
due to an IT issue

Safe to merge now as IT issue has been resolved and all PF
checks are enabled again before merge.

Change-Id: I2f6ae57a27d50c31115d89e57281dc1f7094d71d
CRs-Fixed: 3125196
2022-02-17 06:24:59 -08:00
Shiva Krishna Pittala
0878b6eaf9 qcacmn: Fix FFT bin values for pack mode 0
While copying FFT bins from the target, Spectral Host driver reads
one DWORD (32-bits) at a time and extracts FFT bins out of those DWORDs.
This extraction uses standard bit shift and mask operations as below.

    #define QDF_GET_BITS(_val, _index, _num_bits) \
                    (((_val) >> (_index)) & ((1 << (_num_bits)) - 1))

For a chipset that uses pack mode 0 i.e., packs 1 FFT bin per DWORD,
_num_bits in the above operation will be 32. So, we try to left shift the
integer constant '1' by 32. If the integer constant is represented by
32-bit integer, we could have issues in the result of shift operation.
As per C standard, the result of shifting an operand by a count greater
than or equal to width (in bits) of the operand is undefined.
This is because some platforms could optimize the shift operation by
masking the shift count to 5 bits. That means, the shift actually
performed is 32 & 31, which is 0.

Fix this by using 64-bit integer constant '1' in the above operation.

Change-Id: Ic7fe4de7917f3069d78a2ff29d86009cbf381e3f
CRs-Fixed: 3125158
2022-02-14 12:46:05 -08:00
Naveen S
8b6625530d qcacmn: Removal of pre lithium wlan driver support in 12.x Software
Code related to IPQ4019 is removed

Change-Id: I64ef452cafe64840576f40a8f35bc617b9978c96
2022-02-14 07:12:47 -08:00
Jhalak Naik
2588f440fb qcacmn: Fix synchronisation between process and tasklet contexts
Currently, qdf_spin_lock/qdf_spin_unlock is used to protect
spectral_lock. This can lead to a deadlock when the process
context is holding the lock and gets pre-empted by the tasklet.
To avoid this use qdf_spin_lock_bh/qdf_spin_unlock_bh.

Change-Id: Ibd2be7b7f3faf2dea9d7df8d6468c7a8fda512f2
CRs-Fixed: 3124199
2022-02-13 22:01:54 -08:00
Santosh Anbu
9a6e313fed qcacmn: Support Multi AST delete service bit info from FW
Add change to fetch and save the WMI service capability of FW to
support multi AST delete using service bit.

Change-Id: I038073085dca1370bafe691b6b0ba8c4476be7a2
CRs-Fixed: 3118892
2022-02-12 03:16:12 -08:00
Bing Sun
ab4cfe87b0 qcacmn: Handle wmi event wmi_vdev_quiet_offload_eventid
Extract information from wmi event wmi_vdev_quiet_offload_eventid and
send it to mlme

Change-Id: I49ef7f2811c5975a95e8e33050977c49e2b104e4
CRs-Fixed: 3101974
2022-02-11 02:57:33 -08:00
Srinivas Girigowda
75335f0708 qcacmn: Add support for WMI_TWT_SESSION_STATS_EVENT
Add support for WMI_TWT_SESSION_STATS_EVENT.

Change-Id: I7bee07360824ca599c82d9dc3f1709acb00466d8
CRs-Fixed: 3085541
2022-02-11 00:25:41 -08:00
Srinivas Girigowda
fd35443a0a qcacmn: Add support for TWT disable operation
Add support for TWT disable operation.

Change-Id: I302ac6a3898f53ea25030d9a15d8d14988287b27
CRs-Fixed: 3085373
2022-02-11 00:25:20 -08:00
Srinivas Girigowda
2d0aea5c1d qcacmn: Add support for TWT enable operation
Add support for TWT enable operation.

Change-Id: I638a4a78bf33d7185d8eab1f6735c3db0abfcd53
CRs-Fixed: 3085373
2022-02-11 00:25:12 -08:00
Srinivas Girigowda
724bbb16c1 qcacmn: TWT init and register WMI events
Initialize TWT tx/rx ops and register WMI events.

Change-Id: Iaf10d5870be89360c74a829dbfdb461d3ee67b8c
CRs-Fixed: 3085369
2022-02-11 00:25:06 -08:00
Srinivas Girigowda
fb22b66fd2 qcacmn: Populate TWT target capabilities
Read TWT target capabilities and update the TWT object manager
data structure.

Change-Id: I03a4b8f367ccc749443139cbedb3c76e4ef8cd39
CRs-Fixed: 3085366
2022-02-11 00:25:00 -08:00
Srinivas Girigowda
ff60609e39 qcacmn: target_if: Add TWT componentization structs and skeleton code
Add TWT componentization structs and skeleton code.

Change-Id: Ibddef3798149268f1799734664c5fbf679ee7a51
CRs-Fixed: 3085341
2022-02-11 00:24:48 -08:00
Kiran Venkatappa
94a233e8e6 qcacmn: Move mlo setup trigger to end of WMI ready handler
MLO setup trigger is required to trigger setup sequence with FW. Move it
to end of the function to ensure that it is always called and skipped
due to goto

Change-Id: I49d096f6e9c4ae0d9ad0de5e1ab32eaaaa3fee2e
CRs-Fixed: 3124260
2022-02-07 16:41:40 -08:00
Rahul Gusain
949beb6cad qcacmn: Send fils discovery template to wmi layer
Add support to send Fils discovery template via target if

Add func to compute shortssid with the help of shortssid table

Change-Id: I78fa50641ee5ae0c338719c4cec91573a212f396
CRs-Fixed: 3114903
2022-02-07 12:27:04 -08:00
Sanchana Balu
68fbc4f63c Revert "qcacmn: Legacy Qwrap RE code cleanup"
This reverts commit 6a4add6d36.

Change-Id: Ia22e2f91207f8047fd7ee7c4736c4bc7fb0978e0
Signed-off-by: Sanchana Balu <quic_sbalu@quicinc.com>
2022-02-02 20:54:33 +05:30
narayan
6a4add6d36 qcacmn: Legacy Qwrap RE code cleanup
Remove Legacy Qwrap max client mode code as part of
Legacy RE code cleanup

Change-Id: I86f5eda074e934409d947dec93227145b056b47b
CRs-Fixed: 3112205
2022-02-01 19:44:30 -08:00
Wu Gao
8d1d470a91 qcacmn: Enable spectral scan support for HMT
This change enables spectral scan support for HMT.

Change-Id: I031dd2392b39aebb9281e7dbf42132b5dc150f25
CRs-Fixed: 3118332
2022-02-01 08:55:51 -08:00
Jithender Miryala
102c051570 qcacmn: removal of pre-lithium Spooftest code
Add spoof test code under the macros : Spoof and partial offload

Change-Id: I17c2c911b41cefc9160885cd028cdebb0225d0da
2022-01-31 22:57:49 -08:00
Priyadarshnee Srinivasan
d0b50dd6b8 qcacmn: 802.11BE 5G 240MHZ regulatory changes
Firmware sends the following reg rule to build 5G 240MHZ channels
240MHZ reg rule:
start: 5490, end: 5730, max_bw: 240.
However, 240MHZ is not one of the standard IEEE channel width.
Hence the channel finding APIs will fail to find a channel of 240MHZ BW.

240MHZ is considered as a punctured 320MHZ channel (320 - 80).
Hence convert the max bw of 240MHZ reg rule to 320MHZ within the host
so that channel can be built.

Also, change the 5G 240MHZ bonded pair's end freq to 5720. Since there is a
5MHZ bandwidth gap between channel 144 and 149, the bonded pair is
restricted to 5720MHZ on 5G.

Change-Id: Iee8dad0317f7ecb95843faa3d0779b854b8f48fa
CRs-Fixed: 3106866
2022-01-31 22:57:44 -08:00
Subrat Dash
3947f3f64f qcacmn: Add target if interface APIs for WDS DP OL ops
Add target_if layer APIs to send wmi commands to add, delete,
and update AST. The dp_ol_if_ops functions call into target_if
layer for DP-CP interaction.

CRs-Fixed: 2997266
Change-Id: Ie392576e3e46d47f658b741f48732d069ee2847d
2022-01-31 05:40:04 -08:00
Wu Gao
137c2dde1f qcacmn: Fix invalid memory node access for DBR
Memory node pointer to unaligned vaddr, and it free the vaddr firstly
and then remove the memory node, which cause invalid memory access.
This change remove memory node firstly, and then free the unaligned
vaddr.

Change-Id: I3b81c1eb4df7c786a3deec456294107ee3b8f226
CRs-Fixed: 3118545
2022-01-28 06:30:04 -08:00
Shiva Krishna Pittala
a9948f7e23 qcacmn: Fix fft end bin index for Spectral report modes 0 and 1
For reports modes 0 and 1, the number of FFT bins in a detector will be 0.
We calculate end_bin_idx as start_bin_idx + num_bins - 1.
When start_bin_idx is 0 for these report modes, end_bin_idx will be -1.
Since bin indices are unsigned integers, end_bin_idx becomes a very big
value and we will try to copy unintended large number of bytes.
Fix this by forcing end_bin_idx to start_bin_idx when num_bins is 0.

Change-Id: I11e5dd673fc95a1ce3823ef977fd70c34a4ec67e
CRs-Fixed: 3096955
2022-01-28 00:54:00 -08:00
Wu Gao
a6d46ebc8b qcacmn: Populate additional params to CFR info for QCA6750
HAL changes to populate agc gain, CFO, rx_start_ts, mcs_rate and
gi_type to CFR info for QCA6750.

Change-Id: I164324b1e929399a8dacf88f3012970c65d5d653
CRs-Fixed: 3115256
2022-01-27 03:12:49 -08:00
Wu Gao
cf7bae960f qcacmn: Add CFR supports for KIWI
This change adds CFR supports for KIWI.

Change-Id: I895eeae41c7f8bba4a35ee46a2ad6a1eadf82f9b
CRs-Fixed: 3114230
2022-01-27 00:53:46 -08:00
Jhalak Naik
8f5372788b qcacmn: Add the spectral detector map valid flag per scan mode
For per-session detector map, maintain a different
det_map_valid flag for Normal and Agile spectral scan
mode.

Change-Id: I5a2a0253624a393feba966641d518e59a48f4a8a
2022-01-26 23:23:12 -08:00
narayan
1a3cc5efc1 qcacmn: Legacy CFR code cleanup
Remove legacy CFR routines and code as part of legacy
CFR code cleanup.

Change-Id: I652da06ea7813013f46d509981e83c4b3581074c
CRs-Fixed: 3113932
2022-01-24 14:41:07 -08:00
abhinav kumar
6c158c59d4 qcacmn: Get per channel pno scan config service capability
Firmware advertises the service capability bit
WMI_SERVICE_PNO_SCAN_CONFIG_PER_CHANNEL when it supports per
channel scan config flags. Get this and cache in psoc.

If firmware supports WMI_SERVICE_PNO_SCAN_CONFIG_PER_CHANNEL,
it uses the upper-12 bits(bit-20 to bit 32) of channel_list
for flags and lower 20-bits(bit-0 to bit-19) for frequency.
If firmware doesn't support it, then channel_list holds the
frequency value only. Fill the flags and frequency accordingly.

Change-Id: I30d36a3c164e23cf0395129e5b93d186b81aa8a6
Crs-Fixed: 3103921
2022-01-20 14:13:40 -08:00
Kiran Venkatappa
9d402b668b qcacmn: MLO Teardown sequence
Trigger MLO teardown and wait for response before proceeding with soc
power down.

Change-Id: Ie1d00408862459b0e5240ef3151a0d969ab65e80
CRs-Fixed: 3102143
2022-01-14 20:53:14 -08:00
Rachit Kankane
dffef9958a qcacmn: enable SON target_if
Add WLAN_FEATURE_SON to enable SON target_if

Change-Id: Ib4bca0eb5813d1fdd7becf6705ab7129a26e26e5
CRs-Fixed: 3102441
2022-01-13 03:03:20 -08:00
Shiva Krishna Pittala
a739a0cabb qcacmn: Add support to extract FFT size capabilities
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicate different capabilities of the Spectral HW.
Add support to extract the FFT size capabilities from this event.

Change-Id: I9640fa51e4249b9d1c2d9d3ac5da7f1d56c9d006
CRs-Fixed: 3098880
2022-01-09 23:10:04 -08:00
Shiva Krishna Pittala
861c4e29aa qcacmn: Add support to extract sscan bandwidth capabilities
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicate different capabilities of the Spectral HW.
Add support to extract the sscan bandwidth capabilities from this event.

Change-Id: I6ff6e5a8d80271fa62a430c986f53a321d46c66b
CRs-Fixed: 3098832
2022-01-06 10:40:06 -08:00
Shashikala Prabhu
3090d55051 qcacmn: Compute the remaining max channel switch time
As per the spec,
"A STA affiliated with a non-AP MLD, that operates on Link2, transmits a
(Re)Association Request frame to AP2 requesting Link1 as one of the links
for multi-link setup. Since the (Re)Association Response frame is
transmitted by AP2 after the last Beacon frame on the initial operating
class/channel on Link1 and before the first beacon on the initial
operating class/channel is transmitted, AP2 includes the Max Channel
Switch Time element in the per-STA profile corresponding to AP1 in the
(Re)Association Response frame it transmits. The value carried in Max
Channel Switch Time element provides an estimate of time until the first
TBTT on the new channel on Link1."

Hence, calculate the remaining max channel switch time using the below
steps.

When host receives the CSA complete event with the CSA count 1, calculate
the Max channel switch time for each vdev by adding the below values,
	a) Host triggers the channel switch when CSA complete event is
	   received with the CSA count 0. The time difference between
	   CSA count 1 and CSA count 0 is one beacon interval. Hence, add
	   one beacon interval.
	b) Add the channel change time. The total time required to receive
	   CSA event handler from FW with CSA count 0, plus, the time required
	   to process the CSA complete event, plus, the time required to send
	   multi-vdev restart request for all the vdevs in the new channel and
	   send updated beacon template (only for non-DFS channel) is
	   approximately 1 second (added a few milliseconds as delta and
	   considered 16 AP vaps here).
	c) Add DFS CAC duration of the new channel if the new channel is DFS.
	d) Add one beacon interval time (time required to send the beacon on
	   the new channel after VDEV up).
	e) Store the sum of the above time values in max_chan_switch_time of
	   the vdev_mlme object.
	f) Save the current time when host receives CSA complete event with CSA
	   count as 1 in the last_bcn_ts_ms of the vdev_mlme object.

Calculate the remaining channels switch time using the below formula.
- Remaining channel switch time is equal to the time when the last beacon
  sent on the CSA triggered channel plus max channel switch time minus
  current time.

Reset the max channel switch time and the last beacon sent time after
sending the VDEV UP command to FW.

Change-Id: I7c03bfae5e159419a6c9462591aeb2d6c5b4fb87
CRs-Fixed: 3076245
2022-01-03 09:04:19 -08:00
Ashish
0d31a3986e qcacmn: Add support to query BMISS stats from fw
Currently there is no support to read bmiss stats from fw.
With this change, add support to read bmiss stats from fw.

Change-Id: I75dee16fffac88303f22742eda1985dc15c6ec15
CRs-Fixed: 3097302
2022-01-03 02:19:51 -08:00
Yu Wang
384fc6eb86 qcacmn: hold large memory for DBR ring
To avoid memory allocation failure during idle restart,
hold the memories with large size for DBR ring during
the entire lifetime of PSOC.

Change-Id: Idfe5f0e895cc088509b5a62ae07191aed32864f2
CRs-Fixed: 3099522
2021-12-31 02:14:27 -08:00
sandhu
ad2829718c qcacmn: Remove IP from files
remove IP from code

Change-Id: If119a4af213b10aadb9f1344e50b0342e72405c2
CRs-Fixed: 3073864
2021-12-29 04:28:58 -08:00
Kiran Venkatappa
31d1d1ac4a qcacmn: Skip mlo setup triggers if soc in not mlo capable
Skip sending triggers for MLO setup if a soc is not mlo capable to avoid
inconsistent MLO setup exchange with target.

Change-Id: Ie17dcd03e2fcf778795d964a55e4a400adacfb33
CRs-Fixed: 3100309
2021-12-28 14:42:43 -08:00
Shiva Krishna Pittala
a9547b0f25 qcacmn: Add support to extract fixed params from Spectral Caps event
WMI_SPECTRAL_CAPABILITIES_EVENTID event will be sent by the FW to
indicated the different capabilities of the Spectral HW block.
Add support to extract the fixed parameters from this event.

Change-Id: Ib13108f078de008b6a76a25a010e85a7fdb6f5fe
CRs-Fixed: 3098203
2021-12-28 06:43:12 -08:00
Bapiraju Alla
76caeb9b44 qcacmn: Use target if component for VDEV manager response path
Currently, VDEV manager responses are using legacy path instead of
target_if, vdev_mgr and os_if components. As the driver implementation
is planned for converged model, legacy implementation will be moved to
the respective components.

To avoid rework, Use target_if, vdev_mgr and os_if components to process
the FW responses corresponding to the vdev manager.

Change-Id: I778f6de93481fc730383e8f8e1c604f173947d69
CRs-Fixed: 3093776
2021-12-23 00:54:35 -08:00
Himanshu Batra
78fb9d70d7 qcacmn: IPA changes to support SDX+Pine
IPA changes to support SDX+Pine.

Change-Id: I66ad2a2c3e2f142c54df3e35c867ee827ac1d687
CRs-Fixed: 3079952
2021-12-20 22:44:55 -08:00
Wu Gao
28ed233c3c qcacmn: Populate additional params to CFR info for QCA6490
HAL changes to populate agc gain, CFO, rx_start_ts, mcs_rate and
gi_type to CFR info for QCA6490.

Change-Id: I6f6f47c87d40bd661162f764fb3a360230a56457
CRs-Fixed: 3086667
2021-12-14 15:13:42 -08:00
Yu Wang
f13b79ec7f qcacmn: implement mlo manager APIs for mlo link set active cmd
Add interface for sending mlo link set active cmd and
register the response handler.

Change-Id: Icd7cf3294cddec1aa4a417e29a22fcd6fbea0dfb
CRs-Fixed: 3036846
2021-12-14 01:43:34 -08:00
Bapiraju Alla
ca4b3fabf6 qcacmn: Add support to dynamic MAC address update
Currently, MAC address update is supported only when interface is down.
Because of this framework needs to issue interface down and interface
up to update the MAC address.

This is resulting in connection time increase when MAC address
randomization is enabled for every new connection.

To optimize the connection time, add support to update the MAC address
without bringing the interface to down state.

Change-Id: Ic3eff6a9571f885292021b2c178d26b0eace5042
CRs-Fixed: 3063475
2021-12-09 13:42:05 -08:00
Venkateswara Swamy Bandaru
d2d8b77ec4 qcacmn: Add support for 11be D1.2 eht mcs map
Add support for 11be D1.2 eht mac map.

Change-Id: Ie5e0934f01c5614c0d2788d9b56b2e755ea23b1d
CRs-Fixed: 3081122
2021-12-05 22:53:43 -08:00
Yu Wang
a9ed2d6a47 qcacmn: implement target_if APIs for MLO
Implement target_if APIs for MLO.

Change-Id: I29c6ea51e29f4ea200e3f47960168dfa9a8c42cc
CRs-Fixed: 3036844
2021-12-03 00:54:14 -08:00
Chaithanya Garrepalli
65137277e8 qcacmn: chages to save soc list in mlo setup
Changes to save SOC list in MLO setup

Change-Id: I185bf26b1dac6eced03931c213297564abe74747
2021-11-23 21:59:34 -08:00
Chaithanya Garrepalli
c42af1f62f qcacmn: Rx path changes for multichip MLO
Rx patch changes for multichip MLO

1. Create ini for rx ring mask for each chip
2. Configure hash based routing for each chip based
   on lmac_peer_id_msb
3. Peer setup changes to configure lmac_peer_id_msb
   to enable hash based routing
4. Rx Replenish changes to provide buffers back to owner
   SOC of reo ring

Change-Id: Ibbe6e81f9e62d88d9bb289a082dd14b4362252c4
2021-11-23 19:28:20 -08:00
Kiran Venkatappa
3e3ed9ca89 qcacmn: MLO setup, teardown sequence changes
MLO setup, teardown sequence changes

Change-Id: I76d14cd66c373b3b734a17e44f3655ffd17893c5
CRs-Fixed: 3059859
2021-11-23 16:57:00 -08:00
Shashikala Prabhu
a117c19fda qcacmn: Add support to extract the channel info from RTT measreq
Add support to extract the freq, cfreq1, cfreq2, PHY mode, Destination
macaddr, and channel BW values from the RTT measurement request buffer
received from the LOWI application. Pass these values to a registered
callback. Users can use these values to make some decisions on the RTT
scan.

Change-Id: Idb2232c07bbfa2946dc01e75908b9a6036597ecf
CRs-Fixed: 3060685
2021-11-22 15:09:55 -08:00
Linux Build Service Account
4b3dbe14dc Merge /local/mnt/workspace/naveen1/srcs/qcacld-3.0 into wlan-cmn.driver.lnx.2.0
* /local/mnt/workspace/naveen1/srcs/qcacld-3.0: (2021 commits)
  Merge /local/mnt/workspace/naveen1/srcs/qcacld-3.0 into wlan-cmn.driver.lnx.2.0
  qcacld-3.0: Send correct PCL to fw for STA+STA roaming
  qcacld-3.0: Log BSSID for roam result
  qcacld-3.0: Fix roam failed for SAP CSA concurrency
  qcacld-3.0: Fix EAP length and roam candidate info
  qcacld-3.0: Use API p2p_status_update to update p2p conn status
  qcacld-3.0: Fix token and reason code copy in cm_roam_btm_query_event
  qcacld-3.0: Handle user initiate CSA in p2p go+go concurrency
  qcacld-3.0: Do GRO en/dis based on qdisc only for standalone STA
  qcacld-3.0: Fill validity timer in BTM Request event
  qcacld-3.0: Use correct attribute for BTM response target BSSID
  qcacld-3.0: Enable self bss roam ini by default
  qcacld-3.0: Fix 11be support compilation issue
  qcacld-3.0: Update SBS Freq Info during service ready ext2 evt
  qcacld-3.0: Consider original BW setting for SAP force SCC
  qcacld-3.0: Fix BTM logging
  qcacld-3.0: Support to deliver mlme event to SON
  qcacld-3.0: Add the Full Power Down feature support
  qcacld-3.0: Add vendor attribute to configure ARP/NS offload
  qcacld-3.0: Add ini support for tx_retry_multiplier
  ...
2021-11-22 14:24:18 +05:30
Linux Build Service Account
7735770d6d Merge /local/mnt/workspace/naveen1/srcs/qcacld-3.0 into wlan-cmn.driver.lnx.2.0
Change-Id: I880638078022d6ce6898924b25bb02eb4593080d
Signed-off-by: Linux Build Service Account <lnxbuild@localhost>
2021-11-22 13:37:22 +05:30
Utkarsh Bhatnagar
ade78b2c55 qcacmn: Add legacy cb in service ready ext2 handler
Add wmi service ready legacy cb for service ready ext2
event.

Change-Id: I610d21bfc62f8e0ba3d1787802603fe05bcf0d27
CRs-Fixed: 3073215
2021-11-17 02:36:41 -08:00
Wu Gao
8a7de8863d qcacmn: Add chip type QCA6490 & QCA6750 in cfr meta data header
There is wrong chip type in cfr meta data header if run CFR/CSI with
HSP since doesn't fill it for QCA6490 & QCA6750.

Change-Id: I932c065d33c5eaa33f66ec8a92470f5820472d7b
CRs-Fixed: 3073865
2021-11-17 00:42:48 -08:00
Li Feng
4b233db761 qcacld-3.0: Support to deliver mlme event to SON
Support to deliver below mlme event to SON:
MLME_EVENT_VDEV_STATE,
MLME_EVENT_INST_RSSI,
MLME_EVENT_TX_PWR_CHANGE.

Change-Id: I0535d80cea155f5b94abecfa609d34940e57cdd7
CRs-Fixed: 3054810
2021-11-12 08:52:49 -08:00
Srikanth Marepalli
f3adf737ea qcacld-3.0: Vendor command changes to enable the roam events stats
Add new vendor command to enable the roam events stats from the
driver/FW in both resume and suspend mode.
New roam param is introduced to indicate the FW to enable/disable
the roam stats using the new roam set command.

Change-Id: I6d04f0946e6735613a4cf3d4361bf31052314fa0
CRs-Fixed: 3036518
2021-11-08 09:41:27 -08:00
Bapiraju Alla
b3afe1b27a qcacmn: Print FW CRM sub ID version during driver init
During driver load, print FW CRM sub ID value received in service
ready ext event.

Change-Id: I710508c9c12a476690e0379938c30c916293620f
CRs-Fixed: 3067102
2021-11-03 16:15:30 -07:00
Shwetha G K
0d831d42c4 qcacmn: Waikiki CFR changes
Waikiki CFR changes

CRs-Fixed: 3057989
Change-Id: Ib2028ecede35cc2e531a394f5229a71b84757b9f
2021-11-03 12:54:43 -07:00
Utkarsh Bhatnagar
8d1f8d1b4a qcacmn: Extract SBS Lower Band End freq
Add support for extracting SBS Lower Band
End freq from rx service ready event.

Change-Id: I402d7519507fbce733a000a546473aa00e8844d5
CRs-Fixed: 3065158
2021-11-03 08:23:25 -07:00
Edayilliam Jayadev
31da41ae4e qcacmn: Clamp the FFT bin values before filling SAMP message
Each FFT bin value is represented as an 8 bit integer
in SAMP message. But depending on the configuration,
the FFT bin value reported by HW might exceed 8 bits.
Clamp the FFT bin value between the min and max value
which can be represented by 8 bits. For linear mode,
min and max FFT bin value which can be represented by
8 bit is 0 and U8_MAX respectively. For dBm mode,  min
and max FFT bin value which can be represented by 8 bit
is S8_MIN and S8_MAX respectively.

CRs-Fixed: 3056458
Change-Id: I9ec75f781a130d3ed0d0d9393975fd5874961ce0
2021-11-02 14:56:21 -07:00
narayan
70ade22606 qcacmn: Enable CFR support for QCA9574
Enable CFR host support for QCA9574.

Change-Id: I8d6a0f5b59715f244256854fc2132f33f841f316
CRs-Fixed: 3062447
2021-10-29 08:46:33 -07:00
Srinivas Dasari
32e5171037 qcacld-3.0: Drop the blacklist event if no APs are present
Currently, target_if forwards the blacklist event to upper layers
even if there is no AP info present. This event can be dropped in
target_if to avoid accessing unallocated memory.

Change-Id: Icfaabb0a8e3304882979ffde7f5cd27fd4c8a067
CRs-Fixed: 3057424
2021-10-22 18:19:15 -07:00
Pragaspathi Thilagaraj
671676a37d qcacld-3.0: Enable time sync only on connection/roam
Currently WMI_DBGLOG_TIME_STAMP_SYNC_CMDID command sent
every 1 sec causes RTPM collapse and inturn has power
impact. So to avoid this enable time of the day synchronization
only after connection/roaming.

Send WMI_DBGLOG_TIME_STAMP_SYNC_CMDID as part of RSO
start command.

Change-Id: Iee3cefe1318a6e5507a43cefb9666cc2a439fe06
CRs-Fixed: 3060762
2021-10-22 12:40:33 -07:00
Yu Tian
07b34c28fc qcacld-3.0: Add TX pending indication when sending wake up to FW
FW may experience HWDTIM mode enter and exit, if HOST can't queue
frames fast enough, this will bring 10ms latency for TX under WoW.
This change adds an indication bit to notify FW whether a TX happens
after WoW wakeup, then FW can discard HWDITM and reduce TX latency.
Change-Id: I74f7311fc0639186ee0bca711160bb8c0d5d9fb3
CRs-Fixed: 3055501
2021-10-18 14:51:37 -07:00
Shwetha G K
a731de3964 qcacmn: Report agc tain table index as metadata
Changes to report agc gain table index as part of
CFR meta data to the userspace.

Change-Id: I318c3db2eff7be8b63ce6aaa544f75fe065fb230
2021-10-18 06:13:29 -07:00
Wu Gao
9fba485d3c qcacmn: Check function pointer to avoid NULL point dereference
It calls spectral_process_phyerr of spectral operations without any
check. Which cause null point dereference potentially. So, check this
pointer before calling.

Change-Id: Iae246f847dd41e62b628223652a9527a65b43799
CRs-Fixed: 3055246
2021-10-15 15:32:08 -07:00
Shiva Krishna Pittala
de13832745 qcacmn: Populate and expose 320MHz spectral capabilities
Populate and expose the following 320MHz spectral capabilities.
  - Agile spectral scan support for 320MHz mode.
  - Number of detectors used for spectral scan in 320MHz mode.

Change-Id: Ibea77d4ec8b1d9322ef82d1d48236836ffad24ec
CRs-Fixed: 3053059
2021-10-13 02:57:24 -07:00
Aditya Kodukula
f6c46032eb qcacld-3.0: Add Support to offload icmp feature to fw
Add support to offload icmp feature to fw in case of
suspended state to avoid high power consumption.

Change-Id: I3ff19d71eac530c75be57e6b52b975e755ff2a53
CRs-Fixed: 3042452
2021-10-12 00:08:44 -07:00
Shiva Krishna Pittala
409ffbfda0 qcacmn: Pass report parameters to FFT bin byte swap function
Pass report parameters to FFT bin byte swap function instead of
FFT bin length adjustment WAR.

Change-Id: I02a280bc4e8e0839c894a70258e1f16a784c08a6
CRs-Fixed: 3051559
2021-10-11 02:35:48 -07:00
Srinivas Dasari
213d908fb3 qcacld-3.0: Cleanup ROAM_TARGET_IF_CONVERGENCE usage
wma to target_if convergence code is guarded under the feature
flag ROAM_TARGET_IF_CONVERGENCE and it's is enabled currently.
Remove the flag usage and remove the deprecated code(else part)
also.

Change-Id: I6973d9c366ec6a9c6164dd19f6f4775dd3ebf5f0
CRs-Fixed: 3049942
2021-10-06 00:02:06 -07:00
Vulupala Shashank Reddy
42b8ecfd1d qcacld-3.0: Add tgt support to send beacon report period to FW
Add tgt support in packet capture component to send user
configured beacon report interval to FW.

Change-Id: Ibeb9f9a7f9ad2c2afa6929c492bd1029784b5f9e
CRs-Fixed: 3046224
2021-10-05 05:06:33 -07:00
Vulupala Shashank Reddy
1a9b5a5c4e qcacld-3.0: Add support to send config to FW based on filter
In packet capture component add support to send ctrl and beacon
frames config to FW based on frame filter received from user through
vendor command.

Change-Id: Ie45ea2135e237a156fb60663e3f85cc601490e4a
CRs-Fixed: 3046222
2021-10-05 05:06:28 -07:00
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
Edayilliam Jayadev
3038a860fc qcacmn: Fix compilation issues in MGMT RX REO module
Fix compilation issues in management rx reorder module.

Change-Id: I4eb7e2e3421f107607c6d99aa737fe3643e2ed12
CRs-Fixed: 3046412
2021-10-03 22:55:54 -07:00
Shiva Krishna Pittala
61f4418d7a qcacmn: Add support to process spectral scan detector info tlv
FW sends Spectral scan detector info TLV in WMI_PDEV_SSCAN_FW_PARAM
event to indicate the information of a detector participating in a sscan
session. FW sends one TLV of this type for each detector participating
in a spectral scan session. Add support to process the TLV and update
the spectral host data structures accordingly.

CRs-Fixed: 3044193
Change-Id: Ie17b6ea9336ada7a00e4594fa2f7f49ef3d443e5
2021-09-30 18:16:42 -07:00
Shiva Krishna Pittala
e991ce3cdd qcacmn: Add support to process spectral scan chan info TLV
FW sends Spectral scan chan info TLV in WMI_PDEV_SSCAN_FW_PARAM_EVENTID
event to indicate the channel information for a spectral scan session.
Add support to process the TLV and update the spectral host data structures
accordingly.

CRs-Fixed: 3044162
Change-Id: Ibbf7f6bbbb267123bbdf44bcfffa2cfb1c2926df
2021-09-30 18:16:37 -07:00
Pavankumar Nandeshwar
0a3d522550 qcacmn: tgt_if changes for wds in Beryllium
tgt_if changes for wds in Beryllium code.

Change-Id: Ie18f29f087b532ed983a474faebbc4c2863f1aee
2021-09-30 15:15:30 -07:00
Edayilliam Jayadev
29fe92fbd7 qcacmn: Add fixes in wait count calculation
1. Add fixes in wait count calculation logic.
2. Add necessary debug logs in wait count calculation.

CRs-Fixed: 3026035
Change-Id: I5aad3a5b56ae1db7b00e17240bb768f35cd83abc
2021-09-30 08:38:35 -07:00
Edayilliam Jayadev
9fd7fb390c qcacmn: Add fixes in snapshot read logic
1. Initialize the temporary variable to read snapshot to zero.
2. Read correct number of shared snapshot values.

CRs-Fixed: 3026029
Change-Id: I6f4fc9d1d2bfe4818304be16f7c80830b4fb260b
2021-09-30 08:38:30 -07:00
Edayilliam Jayadev
2a8aff65e1 qcacmn: Export symbols for other modules
Export symbols("mlo_glb_h_shmem_arena_ctx_init" and
"mlo_glb_h_shmem_arena_ctx_deinit") for other modules.

CRs-Fixed: 3026023
Change-Id: I2a7c55f119be531b495a0f42a9b058734feb0ebb
2021-09-30 08:38:26 -07:00
Shiva Krishna Pittala
d36115b849 qcacmn: Big-endian mode changes for Beryllium Spectral
On Beryllium architecture, PHY DMA applies a 32-bit byte swap to assist
in efficient Host reads when connected to a big-endian Host.
This is done to avoid byte swapping at the Host.
So, if the Host reads this data 32-bit word at a time, the byte order
would be intact. Report headers are not a problem because as they are
composed of 32-bit words. For FFT bins, read each DWORD at a time and
extract FFT bins out of that DWORD. Make this change in a generic way to
keep the design uniform across different chipsets and endian modes.

CRs-Fixed: 3042188
Change-Id: Idff1ac7eb5e18c692c9ee8b19b9ae9e6b962d486
2021-09-30 06:27:26 -07:00
Jhalak Naik
b65b4ae703 qcacmn: APIs to convert phy_ch_width to nl80211_chan_width and vice-versa
Add Spectral APIs to convert channel width values
from enum phy_ch_width to nl80211_chan_width and
vice-versa.

CRs-Fixed: 3029184
Change-Id: I60fb7fb04b943b0d70c569ff6587e5e8efd7722b
2021-09-29 15:05:37 -07:00
Shiva Krishna Pittala
8e8df4a411 qcacmn: Populate the list of supported sscan bandwidths and detectors
Populate the list of supported spectral scan bandwidths for different
targets and use that in populating the detector list.

CRs-Fixed: 3042448
Change-Id: I5dac2c845843698bbafac64a01517acfbe120180
2021-09-29 12:42:32 -07:00
Debasis Das
db135c6eac qcacmn: Fix use of uninitialized variable in phyerr processing
Initialize the variable "segid" to prevent the usage of junk value.
Dont dereference the spectral-lmac object if the same is NULL.

Change-Id: I5206a99017f77e5c94368d91171a7eb05745933c
2021-09-29 08:59:22 -07:00
Shiva Krishna Pittala
e5255c7253 qcacmn: Populate supported FFT sizes for Beryllium Spectral
Beryllium chipsets support FFT sizes as follows for different sscan widths.
    20MHz:-   Min FFT size: 5, Max FFT size: 9
    40MHz:-   Min FFT size: 5, Max FFT size: 10
    > 40MHz:- Min FFT size: 5, Max FFT size: 11
Populate these FFT sizes for Beryllium targets.

CRs-Fixed: 3042443
Change-Id: Id7052e3513b29789e96c351aa4cdede499ef2578
2021-09-28 03:43:28 -07:00
Shiva Krishna Pittala
aead8c4d39 qcacmn: Add support to configure spectral scan bandwidth
Add support to configure spectral scan bandwidth as provided by the user.
Validate the user configured value before applying it. As the spectral scan
bandwidth is an optional parameter, when the user doesn't configure it, use
configure the spectral scan bandwidth to the maximum value supported by the
target for the current operating bandwidth.
Also, populate the spectral scan bandwidths supported for different
operating bandwidths on different targets.

CRs-Fixed: 3042424
Change-Id: I266aa5489b0ce5c149968067a06e1cc65bb4e3b7
2021-09-28 03:43:21 -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
Shiva Krishna Pittala
81f3009593 qcacmn: Add support for run-time enablement of MGMT Rx REO feature
Add INI and WMI service bit based enablement support for
MGMT Rx REO feature.

CRs-Fixed: 3014353
Change-Id: I95650718d69b70f119621a9481dbf1518bc5500b
2021-09-27 17:58:04 -07:00
Shiva Krishna Pittala
b0384b31da qcacmn: Expose the external APIs from MLO global shared memory handling
Expose the following APIs from MLO global shared memory handling
    - APIs required by the REO logic
    - APIs required to invoke the MLO global shared memory parsing

Change-Id: Ia2fb0b0fee5d3904bae8cd70ce3364360d5ea16e
CRs-Fixed: 3014343
2021-09-25 17:22:07 -07:00
Shiva Krishna Pittala
97fe9889b6 qcacmn: Parsing logic for MLO global shared memory arena
MLO global shared memory arena contains MGMT Rx REO snapshots in the
form of TLVs. Parse the shared memory and store the address of these
snapshots. These addresses will be required by the MGMT Rx REO algorithm.

CRs-Fixed: 3035491
Change-Id: Ica1b72cd8cf4083acdeefaee41df0da4a1f57f4f
2021-09-25 15:15:09 -07:00
Kani M
2c41328915 qcacmn: Enable code under WLAN_CONV_CRYPTO_SUPPORTED
This incorporates and enables the code under the flag
WLAN_CONV_CRYPTO_SUPPORTED.

Change-Id: I5be4606fac8dbf172b017cc91ba6e19af03e282b
2021-09-24 18:27:48 -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
Sridhar Selvaraj
04c1a548a5 qcacmn: Convert vdev set mlme enum id to wmi id
Currently when sending multi vdev set param from MLME
vdev set param id is not converted to wmi layer id
resulting in incorrect mlme param update in firmware
for mbss common vap params.

Convert vdev set mlme enum id to wmi layer id when
setting multi vdev param from MLME.

CRs-Fixed: 3039992
Change-Id: Ibaeb974729f1ae9c272e203d1288229aca74b803
2021-09-23 02:11:37 -07:00
Jhalak Naik
0405359a6c qcacmn: Lock Spectral detector list and session info structs
Add locks for detector list, per-session report info
and per-session detector map, to avoid inconsistent
concurrent accesses.
Using spin_lock_bh for locking between Process and
Tasklet context.

CRs-Fixed: 2983801
Change-Id: If709fd91f193072f07b9dae19bf48e6da2d369d3
2021-09-22 05:27:23 -07:00
Jhalak Naik
e59d430af2 qcacmn: Move edge extrabins at the end of bin_pwr array
Move the left band and right band edge extra bins to
the end of the Spectral bin_pwr array.

CRs-Fixed: 3002177
Change-Id: Iea93879763a7e2c56cdb5f4d3d163e2d4b082b26
2021-09-21 04:18:47 -07:00
Srinivas Dasari
e41aca19c2 qcacld-3.0: Don't repost ROAM event to scheduler thread
Currently, the ROAM event is posted to scheduler thread when it's
received from firmware. This is done to avoid processing the
complete event in IRQ context as the same callback gets called
from IRQ context for WOW events(WOW_REASON_LOW_RSSI and
WOW_REASON_HO_FAIL). Posting the ROAM event to scheduler
thread may introduce some additional delay in processing it back
as there would be a context switch.
If this ROAM event carries ROAM_START which is followed by a
ROAM_SYNC event, there is chance to process the ROAM_SYNC
before ROAM_START as ROAM_SYNC would be processed in the same
context whereas ROAM_START needs a context switch. This results
into an invalid connection manager state after processing
ROAM_START event, which results a connection failure.
Same is applicable for ROAM_PMKID_REQ_EVENT and
ROAM_VDEV_DISCONNECT_EVENT. Avoid reposting the same to scheduler
thread.

Change-Id: Ic4fc1b3baf12e4ceee9a0975ebfee77fb88ab6f0
CRs-Fixed: 3033657
2021-09-19 04:50:33 -07:00
Wu Gao
3d6711d61f qcacld-3.0: Correct tx power value
It's 0.5 db unit from halphy, so correct the tx power in host side.

Change-Id: I119f86814310d402a8bf4c200c92a680488e5731
CRs-Fixed: 3030628
2021-09-18 19:26:55 -07:00
Wu Gao
8e18b21f89 qcacmn: Check smode value to avoid OOB read
It doesn't check smode before used as array index, the potential risk
is that OOB read or write once get invalid value from target. So, this
change checks smode value before using.

Change-Id: Ibc0625f43e31bc8b49694cca778726c6528290a8
CRs-Fixed: 3034136
2021-09-17 16:53:36 -07:00
Shiva Krishna Pittala
01c079b17b qcacmn: Add handlers for FW consumed and Host dropped MGMT frames
Consider the management frames that are consumed/dropped in the FW and also
the frames that are received at the Host but dropped in lower layers.
The host has the MGMT Rx REO parameters about these frames via WMI events.

There could be frames waiting in the MGMT Rx REO list for the above-said
frames. If we update the waiting frames with the MGMT Rx REO parameters of
the above-said frames, the waiting frames could be released and sent for
processing. Add the logic for the same.

Change-Id: I6be4577d30c4aefe2e964aefbb56472749a90cb4
CRs-Fixed: 2987941
2021-09-17 05:54:06 -07:00
sheenam monga
a554290f06 qcacmn: Fetch fw cap to support p2p + p2p concurrency
Fetch fw capability to support p2p+p2p concurrency and
store cap info in 29th bit of soc_fw_ext_caps.

Change-Id: Id8e4c0310f8db503a2997e8aed5a6f1ce813dcc7
CRs-Fixed: 3032068
2021-09-16 22:58:23 -07:00
Shiva Krishna Pittala
7c49199b38 qcacmn: Fix uninitialized variable in target_if_process_sfft_report_gen3
Uninitialized detector ID is passed to the get_spectral_mode API. Fix it.

CRs-Fixed: 3033507
Change-Id: Ifa621791c19adef2de41cb53ef8581aabff7725f
2021-09-13 01:02:25 -07:00
Huashan Qu
77f09f7272 qcacmn: Define rp_rssithresh for QCN7605 chip to different value
In dfs test mode, bandwidth detection test on dfs channel fails
with QCN7605 chip, reason is some pulses will be discarded due to
low rssi reported on some frequency channel, it's different halphy
design for QCN7605 chip, so need to define rp_rssithresh for QCN7605
chip to different value.

Fix is define rp_rssithresh for QCN7605 chip to different value for
FCC/ETSI/JP W56 table which are used for dfs certification.

Change-Id: I9132cf82e6d8d97f83ebb4cd8586f8d8ff48066e
CRs-Fixed: 2986947
2021-09-10 22:29:00 -07:00
abhinav kumar
e7d14de594 qcacld-3.0: Add new BT Coex roam trigger reason
Send additional roam trigger TLV for BTC in
WMI_ROAM_ENABLE_DISABLE_TRIGGER_REASON_CMDID
command, to support a new roaming trigger
"WMI_ROAM_TRIGGER_REASON_BTC".

Change-Id: Ib767bd6bcf005c187b0fb58986ad287fe8753c1b
CRs-Fixed: 3009788
2021-09-10 20:09:34 -07:00
Debasis Das
800b5ae375 qcacmn: Fix wrong memory access in spectral phyerr processing
In target_if_process_phyerr_gen2(), initialize variables
to prevent usage of junk values.
In target_if_process_sfft_report_gen3(), add check to
ensure the index doesn't exceed the size of the array.

Change-Id: Ie738d1fc836e1a2ec1358b635a4b6c64a424b894
2021-09-08 06:54:55 -07:00
Shiva Krishna Pittala
ef337fbe1f qcacmn: Unify Spectral cfreq formats across different chipsets
Different chipsets are reporting cfreq1 and cfreq2 in different formats in
Spectral reports. This leads to confusion at the user-interface level.
Convert the cfreq1 and cfreq2 representations as follows before sending the
Spectral report to upper layers.
For a contiguous channel, cfreq1 will represent the center of the entire
span and cfreq2 will be 0. For a discontiguous channel like 80p80, cfreq1
will represent the center of the first segment whereas cfreq2 will
represent the center of the second segment.

CRs-Fixed: 3020790
Change-Id: I86e330c9a3a66701f274e20db2d8bc5934608a6b
2021-09-07 04:28:05 -07:00
Srinivas Dasari
5341815658 qcacld-3.0: Send psoc also in roam events to target_if
target_if expects psoc as part of roam events which is used for
event extraction. Send the same as it's missing currently.

Change-Id: I04729df90d8e64e07427fe47926a8a92a24aaf23
CRs-Fixed: 3027055
2021-09-03 05:50:36 -07:00
Kiran Venkatappa
7aaef9935d qcacmn: Extract hw_link_id and store in target_if pdev context
hw_link_id is unique across psoc to identify pdev in multi-soc ML cases.
Exract hw_link_id from mac_phy_cap and provide APIs in target_if to set
and get this for pdev

Change-Id: I9dcc4c1e4b515e83151ca88f5f026c0dd0b04646
CRs-Fixed: 3023496
2021-09-01 17:13:27 -07:00
Wu Gao
64da7093a2 qcacmn: Not change RSSI of cfr meta data to dBm
Since target already converts RSSI from SNR to dBm for QCA6490 and
WCN7850, so don't convert them again in host side.

Change-Id: Ie35f3821a802f2e65b61f4891f2ca9c632fa1477
CRs-Fixed: 3024119
2021-08-31 20:04:45 -07:00
Hariharan Basuthkar
258d7f4c16 qcacmn: Implement the 6G AFC power event processing
Add regulatory functions to handle the WMI_AFC_EVENTID. This
includes processing the AFC power information received from the FW,
and constructing the AFC channel list in the regulatory component.

Change-Id: I5da8fc7faae847476f88ff35b20e6444115af7f1
CRs-Fixed: 3023789
2021-08-31 14:44:50 -07:00
Srinivas Dasari
0a20c3d448 qcacld-3.0: wma to target_if migration of roam pmkid request evt
Currently, wmi_roam_pmkid_request_event_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I3fad4e4d7ceeb85c632723e161809bf980d5375f
CRs-Fixed: 3014248
2021-08-28 00:29:22 -07:00
Vijay Patil
830b8ca4f7 qcacld-3.0: wma to target_if migration of roam_auth_offload_event
Currently, wmi_roam_auth_offload_event_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I128db23077d423c5e5ecf27636bc3af35cbbc58f
CRs-Fixed: 3010419
2021-08-28 00:29:16 -07:00
Utkarsh Bhatnagar
21d1e86216 qcacld-3.0: Add support to get thermal throttle stats
Add support for sending WMI_REQUEST_THERMAL_STATS_CMDID
to request for the thermal stats via vendor cmd:
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_THERMAL_STATS
This vendor cmd can either be used to clear the thermal
stats or to request for the thermal stats.
Added ini gThermalStatsTempOffset, which can
configure thermal temperature offset value for capturing
thermal stats in  thermal range such as Thermal STATS
starts capturing from temperature threshold to temperature
threshold + offset.
If this ini is set to 0, then the events are disabled.
Also, add support for the FW event where the requested
thermal stats are sent in FW event
WMI_THERM_THROT_STATS_EVENTID().
The following attributes are sent in the events for every
level:
	STATS_MIN_TEMPERATURE
	STATS_MAX_TEMPERATURE
	STATS_DWELL_TIME
	STATS_TEMP_LEVEL_COUNTER

Change-Id: If8acdeec5bde33be346332ccaf39d78d0151203d
CRs-Fixed: 3016818
2021-08-27 10:23:21 -07:00
Sai Pavan Akhil Remella
260d26085b qcacld-3.0: wma to target_if migration of roam_stats_event
Currently, wmi_roam_stats_event_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I5e336b01e1a2183e49b3e6eeb125c7c9fd0fd73c
CRs-Fixed: 3003125
2021-08-24 13:12:34 -07:00
Edayilliam Jayadev
9ccbe5a0fb qcacmn: Add API to get address of mgmt Rx REO snapshots
Add APIs to get address of management rx-reordering snapshots.

CRs-Fixed: 2963485
Change-Id: Idfe13425ad5f95f1a3d92edfc2d6d41aded5aec9
2021-08-23 13:26:36 -07:00
Shiva Krishna Pittala
93c0702c78 qcacmn: Add support for MGMT Rx REO filter config command
WMI_MGMT_RX_REO_FILTER_CONFIGURATION_CMD is used to the configure re-order
criterion for incoming management frames.
Add target_if and tgt layer support for the same command.

Change-Id: I5daaf4d095774d751d98a27fd77dec9daaa6b16a
CRs-Fixed: 2960488
2021-08-21 15:17:33 -07:00
abhinav kumar
86812026a0 qcacmn: Possible Integer overflow in wifi_pos_oem_rsp_handler
API "target_if_wifi_pos_oem_rsp_ev_handler" is the handler for
the event with WMI_OEM_RESPONSE_EVENTID. Host receives
"rsp->dma_len" from fw. The integer overflow occurs if
"oem_rsp->dma_len" is big enough while calculating the total
length of the Oem Data response buffer.

Fix is to add a sanity check for rsp->dma_len to avoid integer
overflow.

Change-Id: Idfbd358f62534eae0147f03505ced5728877a269
CRs-Fixed: 3001191
2021-08-21 15:17:29 -07:00
Shiva Krishna Pittala
361f45dd82 qcacmn: Add APIs to extract MGMT Rx REO params tlv
When MGMT Rx REO feature is enabled, FW will be sending MGMT Rx REO
parameters TLV as part of WMI_MGMT_RX_EVENTID for the frames that require
reordering. Add APIs to extract the same.

Change-Id: I57b132927cf413384d680b5778bfe6a2e2737adf
CRs-Fixed: 2960471
2021-08-21 13:06:43 -07:00
Aditya Kodukula
b10a6039da qcacld-3.0: Support Multicast Domain Name Server Offload
The purpose of the multicast Domain Name System (mDNS) is to resolve
host names to IP addresses within small networks that do not include
a local name server.

It utilizes essentially the same programming interfaces, packet formats
and operating semantics as the unicast DNS, and the advantage is zero
configuration service while no need for central or global server.
Based on mDNS, the DNS-SD (Service Discovery) allows clients to discover
a named list of services by type in a specified domain using standard
DNS queries.

Here, we provide the ability to advertise the available services by
responding to mDNS queries.

Change-Id: Id2a0468d49237c21062cfd1988e34903658cdad9
CRs-Fixed: 3008549
2021-08-20 22:02:01 -07:00
Shiva Krishna Pittala
593e206028 qcacmn: Add target_if layer functionality for FW consumed event handling
Add register and unregister handlers to MGMT Rx FW consumed event handlers.
Add target if layer handlers for the event.

Change-Id: I3b70f86811c562a3be75353585dc1f6cf43c02ac
CRs-Fixed: 2959925
2021-08-20 15:13:17 -07:00
Shiva Krishna Pittala
047ac89481 qcacmn: Revert "qcacmn: Spectral init path changes for QCN9224"
As part of Spectral init, the Host sends DMA ring init command to
HALPHY. QCN9224 M2M emulation setups don't have HALPHY subsystem and
the WMI command need to be cleanly stubbed out in emulation FW image.
Until then, revert this Spectral init change.

Change-Id: I88e3e3995ee1b7103a03e4b6a38ff4117044c63c
CRs-Fixed: 3016633
2021-08-20 04:59:14 -07:00
Shiva Krishna Pittala
fa7d919cbc qcacmn: Drop gen2 spectral samples after spectral scan is stopped
The host can receive some spectral samples even after stopping the scan
as there could be some samples already sitting in the WMI event pipe.
Drop those frames in the driver itself.

CRs-Fixed: 3014336
Change-Id: I8aece67b46aa84e974b538f40ffcb937c855f5a3
2021-08-19 04:59:56 -07:00
Edayilliam Jayadev
ff18a53051 qcacmn: Add API to read mgmt Rx REO snapshots
Add APIs to read management rx-reordering snapshots.

CRs-Fixed: 2955865
Change-Id: I1f36705607b0bae92d422d85223f825ed0b96ef9
2021-08-19 04:59:46 -07:00
Shiva Krishna Pittala
b33b9d857d qcacmn: Populate Spectral detector list for SBS modes
In SBS modes, there are 3 detectors shared between 2 pdevs that are operate
in 5GHz band. Global number space is used for detectors across these pdevs.
Detector list should be following in SBS modes.
For the pdev that use PHYA0:
   detector 0 for normal mode
   detector 2 for agile mode
For the pdev that use PHYA1:
   detector 1 for normal mode
   detector 2 for agile mode
There is no direct way of knowing which pdevs are using PHYA0 or PHYA1.
We need to look at the phy_id of a given pdev and compare against other
pdevs on the same psoc to figure out whether the given pdev is operating
using PHYA1.  Add the necessary support for the same.

CRs-Fixed: 2993772
Change-Id: I034fe64a7a8988e327a60684a0d008f4b22ef395
2021-08-18 07:34:44 -07:00
Sridhar Selvaraj
c9c8ccb8cb qcacmn: Adding multi vdev set param WMI API
Adding multi vdev set param WMI API support to send
vdev param update for multiple VAPs.

Change-Id: I6f331d4179afa2b331abef9b857365c60c0a64b3
2021-08-17 20:19:00 -07:00
Arun Kumar Khandavalli
09cd3e0dd9 qcacmn: fill htt peer data version as part of init cmd
With latest architecture there are different HTT peer
data versions supported by the firmware, supported htt peer
version will be sent in the service ready and need to feedback
to the firmware in the init command.

Change-Id: Icd0470843198387cd7e0192cbe3821d45ef0534e
CRs-Fixed: 3008706
2021-08-12 03:14:29 -07:00
Srinivas Dasari
f0ee389aec qcacld-3.0: Revert "Move cp stats to scheduler thread from kwork"
This reverts change Id8134003e6f7a3e0368b20c496f650e0b7025b9e

Moving cp stats to scheduler thread is breaking the
synchronization in stats collection. Currently, when a get stats
command is issued from framework, host driver sends the same to
firmware and wait for both llstats and get_station related stats.
The expectation is to receive get_stats first and then llstats.
Host driver has a wait for the last llstats event to return the
stats to userspace. As the cp stats(get_station stats) are moved
to scheduler thread, the order of these events can't be ensured
as llstats are still running in kworker thread. llstats event gets
processed before cp stats mostly and stats are returned
immediately to framework. Framework may issue the get stats
command again and the same is sent to firmware, which may result
in synchronization issue in firmware as well.
Moving llstats also to scheduler thread may not be optimal as these
are aggressive and can be queried by framework multiple times with
a milliseconds gap.
So, move back the cp stats to kworker thread to maintain
synchronization.

Change-Id: I8dc518f0de37e7cc203cb1f6e67045d74b304d93
CRs-Fixed: 3002534
2021-08-07 07:22:56 -07:00
Amruta Kulkarni
0dc0939ee2 qcacld-3.0: Roam sync event migration
Wma to target_if migration for ROAM SYNC EVENT

Change-Id: Id2e9d5697f12f709cfdd665dabf1095863d87277
CRs-Fixed: 2990767
2021-08-07 02:58:54 -07:00
Jhalak Naik
4149a48ae9 qcacmn: Use correct start bin index to copy bin_pwr array for SAMP msg
Use lb_edge_bins->start_bin_idx as the bin_pwr array start bin
index, when left band edge extra bins are present.
In all other cases, use the detector start bin index
detector_info->start_bin_idx.

CRs-Fixed: 3005949
Change-Id: Ic91c3eb386d693b3f929c687e269e882b6bd8f59
2021-08-06 17:05:26 -07:00
Jhalak Naik
d66b7693f1 qcacmn: Add check for per-session detector map validity
The per-session detector map is keyed by detector ID
from the Spectral FFT report and is only valid for one
session, ie. start scan to stop scan.

There is a possibility of receiving FFT report with
an invalid detector ID, for a particular session.
Due to this, invalid detector map information may get
accessed.

Verify that detector ID received in Spectral report is
valid for given spectral scan mode and channel width,
by checking the detector list.
Add a validity flag to the per_session_det_map, and check
whether detector map is valid for the detector ID used to
access it.

CRs-Fixed: 2998410
Change-Id: I1f38ae22b458bb1fea62b99422ec60095071b3c6
2021-08-06 17:05:21 -07:00
Shwetha G K
9a723da9a5 qcacmn: Fix CFR pdef ref leak issue
Fix the CFR pdev ref leak issue

Change-Id: I6ba9068ae395fdbab8af4f6117dd31c72281ca5d
CRs-Fixed: 3008801
2021-08-06 14:08:51 -07:00
sheenam monga
727bee12fc qcacmn: Fix possible OOB in wmi_extract_dbr_buf_release_entry
Currently in function wmi_extract_dbr_buf_release_entry,
num_buf_release_entry & num_meta_data_entry are copied
to direct_buf_rx_rsp structure without any validation which
may cause out of bound issue if num_buf_release_entry or
num_meta_data_entries provided in fixed param becomes greater
than actual number of entries.

Fix is to validate num_entries and num_meta_data before populating
param->num_buf_release_entry and param->num_meta_data_entry.

Change-Id: I18050fd4f90f8815d7eceb5f715fdbaa09130d3a
CRs-Fixed: 3000875
2021-08-05 08:29:06 -07:00
Edayilliam Jayadev
ceacfdf8ae qcacmn: Add txops support for MGMT txrx module
1. Add txops APIs in mgmt txrx module
2. Register the txops APIs of mgmt txrx module.

CRs-Fixed: 2927742
Change-Id: I9b226d9f2b85b4ef92527315cb08047563b9ebdd
2021-08-04 05:52:52 -07:00
Edayilliam Jayadev
ac790cc9a2 qcacmn: Add APIs to register event handlers in mgmt rx reo
1. Add target if files for mgmt rx reo module.
2. Add APIs to register/unregister WMI events related to
   management Rx reorder module.

CRs-Fixed: 2927734
Change-Id: Icf3537cfec03f26305ee6d1e08b82e316febf2ad
2021-08-04 05:52:48 -07:00
Wu Gao
edb2db465f qcacmn: Add exit log for target_if_dbr_fill_ring
It takes long time to init DBR, so add more log to trace the time when
exit target_if_dbr_fill_ring.

Change-Id: I9ec76c92db209a44c277b0f9e1840e6dd0132559
CRs-Fixed: 3002654
2021-08-02 07:06:36 -07:00
Shwetha G K
0df8d9a55a qcacmn: Split extract phase tlv functionality
Split the extract phase tlv functionality into two
seprate APIs for code readability. Also add sanity check
for max_aoa_chains.

Change-Id: I2d73ee99cff37872191f8a9258a561d7dbd01808
CRs-Fixed: 2997020
2021-08-02 04:07:10 -07:00
Shwetha G K
8c35189d7f qcacmn: Rename leg_cfr_metadata to legacy_cfr_metadata
Change the naming convention of the leg_cfr_metadata to
legacy_cfr_metadata

CRs-Fixed: 2997929

Change-Id: I0f04459d53130b0338316a6b0d01152c536e1c64
2021-08-02 01:59:15 -07:00
Srinivas Dasari
77d37cd86d qcacld-3.0: wma to target_if migration of roam_scan_ch list_event
Currently, wmi_roam_scan_chan_list_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I8f59f9ebfe1bbdc7ef37ccc1f10178fe8128e912
CRs-Fixed: 2990376
2021-07-30 21:50:44 -07:00
Srinivas Dasari
7478d4e13c qcacld-3.0: wma to target_if migration of vdev_disconnect_event
Currently, wmi_vdev_disconnect_event_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I2486cc3f63c4b35305b60ac55cd0a622c7185323
CRs-Fixed: 2990373
2021-07-30 21:50:40 -07:00
Srinivas Dasari
7ee2314c31 qcacld-3.0: wma to target_if migration of btm_blacklist_event
Currently, wmi_roam_blacklist_event_id data is extracted and
processing is also done in wma. This is not inline with component
model where target_if takes care of data extraction and handover
the extracted data to corresponding component(connection mgr in
this case). Add changes to support the same.

Change-Id: I41d2ef6c228acd8f86f24107c02d11f1a8ac6dea
CRs-Fixed: 2990369
2021-07-30 21:50:35 -07:00
Srinivas Dasari
9bc9dca45c qcacld-3.0: wma to target_if migration of wmi_roam_event
Currently, wmi_roam_event_id data is extracted and processing is
also done in wma. This is not inline with component model where
target_if takes care of data extraction and handover the extracted
data to corresponding component(connection mgr in this case).
Add changes to support the same. As the legacy CSR/LIM is not
yet converged, have a wrapper from connection mgr to wma to call
these legacy APIs.

Change-Id: I0e22bbccfe21200b90771a01f9ee7454f4ecb119
CRs-Fixed: 2990355
2021-07-30 14:29:36 -07:00
Venkateswara Swamy Bandaru
ed74f5b410 qcacmn: EHT capability changes for D1.0
Add storage for EHT mac and phy capabilities as
per 11be D1.0 and update the EHT mac and phy capability
sizes.

Change-Id: I67224b35b701235374772e9975375e695f3ed959
CRs-Fixed: 3000166
2021-07-29 00:08:07 -07:00
Jyoti Kumari
e831cf3415 qcacmn: Handle TWT ack event support in wmi init
In WMI INIT, check whether firmware supports the ack event or
not. If it supports then enable driver support and send it to
firmware during WMI INIT.

Change-Id: Icfdee6bc06e6a393de880b87fdab70665ea7c8b4
CRs-Fixed: 2987898
2021-07-20 16:35:51 -07:00
sheenam monga
c22a0bcc59 qcacmn: Check ext cc event support before pouplating sec chan list
Currently host is populating secondary channel list from master
channel list based on ap power type. In case fw doesn't support
extd cc event then secondary channel list will not have 6g freq,
which may break legacy 6g handling.

Fix is to add validation check for ext cc event support, copy
secondary channel list from ap power type in case ext cc event
is supported by fw else copy secondary channel list from reg
current channel list.

Change-Id: I2e13be2936b624ccbee5e8e426987355076a0062
CRs-Fixed: 2987951
2021-07-19 05:39:03 -07:00
Jyoti Kumari
43c413bc3b qcacmn: Add TWT service bit capability support for ack event
Add TWT service bit capability support to check whether firmware
supports ack event or not. If firmware doesn't support ack event
then service bit capability will become 0 and whenever TWT
command comes, host will not wait for ack event and sends command
in a legacy way.

This support is mainly added to handle new host and old firmware
combination.

Change-Id: I55d373c2e017130b58a4b332da16f0eda8f34eba
CRs-Fixed: 2987749
2021-07-17 08:23:20 -07:00
Shiva Krishna Pittala
207740adea qcacmn: Spectral init path changes for QCN9224
Pdev init path changes for Spectral module for target QCN9224

Change-Id: I33752f06c64c5bae480afc84386250bd8d66b073
CRs-Fixed: 2992497
2021-07-16 12:13:39 -07:00
Shwetha G K
ac4740da88 qcacmn: Derive phase from agc gain & phase delta
Changes to derive chain phase values out of Hardware
reported agc gain and target reported AoA phase calibration
values. AoA for RCC to be supported based on target shared
capability. AoA phase delta & ibf cal values are shared by
target upon every channel change via WMI event.

Change-Id: Ic4fca3731b795e07a511388f6dbb15a46d676a77
2021-07-16 06:19:55 -07:00
Shashikala Prabhu
ea157e3a14 qcacmn: Read AP initiator burst and staggered service bits
Check the below service bits and set in psoc if the service is supported
by  FW.

WMI_SERVICE_RTT_AP_INITIATOR_STAGGERED_MODE_SUPPORTED
WMI_SERVICE_RTT_AP_INITIATOR_BURSTED_MODE_SUPPORTED

Change-Id: I13504958bf31b2d645d915b4db20719bdc9a4133
CRs-Fixed: 2969195
2021-07-14 10:33:01 -07:00
Hariharan Basuthkar
82ee5ef227 qcacmn: Add regulatory support to send AFC cmd to the FW
Add core regulatory APIs to send the WMI_AFC_CMDID to the FW.

Change-Id: I1e2b7d936583a199d1be032895802740ee9f19a1
CRs-Fixed: 2975227
2021-07-14 10:32:56 -07:00
Amruta Kulkarni
425e2ddfbc qcacld-3.0: Roam sync frame event Wma cleanup
Wma to target_if migration for ROAM SYNC FRAME EVENT

Change-Id: I2a56dadf7f45a13a577bdf49bc9514ab2e6dee29
CRs-Fixed: 2968404
2021-07-12 19:12:01 -07:00
Jhalak Naik
b022dda84c qcacmn: Modify Spectral debug print APIs
Modify APIs target_if_dbg_print_samp_msg() and
target_if_dbg_print_samp_param() to use the
new formats for spectral_samp_msg and
target_if_samp_msg_params, respectively.

CRs-Fixed: 2961953
Change-Id: Ib0776c2189e9ca1dc33d38f2a7609aa6d15959ee
2021-07-10 13:31:19 -07:00
Jhalak Naik
8a5bf47771 qcacmn: Add new function free_samp_msg_skb()
Add a new API free_samp_msg_skb(), to free
SAMP msg buffer, if error in phyerr processing
for 160/80p80 MHz modes. Call this API from
reset_160mhz_delivery_state_machine(), to
avoid redundancy.

CRs-Fixed: 2961987
Change-Id: I3a0488997e474fef6f4f57e3fbfd1a163c91ac7b
2021-07-10 13:31:13 -07:00
Jhalak Naik
a66fec0ada qcacmn: Populate target_if_samp_msg_params for Spectral gen2
Add API target_if_spectral_populate_samp_params_gen2() to
populate fields in target_if_samp_msg_params, using
search fft report and target_if_spectral_rfqual_info
fields.

CRs-Fixed: 2961986
Change-Id: Iad970483f6183d2e52d97e6c3ddf8f146845fbe4
2021-07-10 13:31:09 -07:00
Jhalak Naik
9cbb125f8e qcacmn: Refactor target_if_process_phyerr_gen2()
Refactor API target_if_process_phyerr_gen2 for
new SAMP message format.

CRs-Fixed: 2961984
Change-Id: Ife76f4da3256e44a2d3ffe0bdb65da2d3b6b24c7
2021-07-10 13:31:04 -07:00
Jhalak Naik
da7baec68d qcacmn: Modify target_if Spectral APIs to Support GEN2
Modify the below APIs to support Spectral gen2
fields and add appropriate checks:

	1) target_if_spectral_fill_samp_msg()
	2) target_if_populate_fft_bins_info()

CRs-Fixed: 2961981
Change-Id: Ieb63a0215e5585bc8acebe8051dbf0663142fb86
2021-07-10 13:30:57 -07:00
Jhalak Naik
7100c71202 qcacmn: Populate target_if_samp_msg_params for Spectral gen3
Add API target_if_spectral_populate_samp_params_gen3() to
populate fields in target_if_samp_msg_params, using
Spectral report, search fft report and spectral scan
summary report.

CRs-Fixed: 2945300
Change-Id: Idce57af9a198773491f6c6bc7303641ec0fb15a7
2021-07-10 13:30:53 -07:00
Jhalak Naik
e50fe45a74 qcacmn: Modify target_if_samp_msg_params for new SAMP msg
Modify struct target_if_samp_msg_params to only include
fields to fill the new SAMP message format, which
are not present in the per-session report-level
info and detector map structures.

CRs-Fixed: 2961956
Change-Id: I54f69bb63c5b64a59cb83b9f205c74c83475fc14
2021-07-10 13:30:48 -07:00
Jhalak Naik
06764332ef qcacmn: Initialize Spectral scan detector list
Add sscan_detector_list struct to store the number
of detectors and detector list for a given Spectral
scan mode and channel width, based on the target type.

Initialize this struct during target_if_pdev_spectral_init.

CRs-Fixed: 2961954
Change-Id: Ia920438429579c096349a0170d15e288d46cf9a9
2021-07-10 13:30:43 -07:00
Jhalak Naik
555875b09b qcacmn: Populate start and end frequencies in detector map
Add API target_if_spectral_get_start_end_freq to set
start and end frequencies in the per-session
detector level map, based on spectral scan
cfreq1/cfreq2 and operating BW.

API target_if_populate_detector_start_end_freqs handles
population of the start and end frequencies per-detector,
in a session.

CRs-Fixed: 2961957
Change-Id: I68a052db6643d92c22e7ee671f4e46af33c2fa08
2021-07-10 13:30:38 -07:00
Jhalak Naik
86ff67088d qcacmn: Replace numbers with macros in FFT report processing
Replace numerical values with macros, for indicating
position and size of Spectral FFT report fields, in
target_if_consume_sfft_report_gen3().

Change-Id: I81994ebb0d642bc4cbebe2b24aabcae567ae6a9c
CRs-Fixed: 2945319
2021-07-10 13:30:34 -07:00
Jhalak Naik
2ae296f522 qcacmn: Support timestamp verification per-detector
Modify prev_tstamp variable in target_if_spectral
structure to an array and index it based on detector ID.
Also, modify target_if_spectral_verify_ts() to include
detector_id parameter and compare current timestamp with previously
received sample on per-detector level, to check discrepancy.

Change-Id: I9f6382909ac0661323db54f160f1350cb8bd8153
CRs-Fixed: 2945318
2021-07-10 13:30:29 -07:00
Jhalak Naik
d75eec9e92 qcacmn: Add helper function target_if_spectral_get_num_fft_bins()
Add target_if_spectral_get_num_fft_bins() to find the
number of FFT bins, from the Spectral FFT size.
It will adjust the number of FFT bins according to
Spectral report mode.

Change-Id: I8f81f2b784d71387f951c38701af6cf4443246e0
CRs-Fixed: 2945316
2021-07-10 13:30:25 -07:00
Jhalak Naik
f0cbec4348 qcacmn: Add API to get correct center frequency values
Add target_if_get_ieee80211_format_cfreq() to calculate
correct cfreq1/cfreq2 values in-line with IEEE 802.11
standard, for Spectral gen3.

CRs-Fixed: 2965699
Change-Id: I9449a6625883c4534a71c2427c84954625bd2977
2021-07-10 13:30:21 -07:00
Jhalak Naik
7a2dbee636 qcacmn: Populate FFT bins start and end indices
Add API to fill FFT bin start and end indices to the
detector map, depending on the values of cfreq1 and cfreq2.

This is to handle samples where the frequency of
Detector 0 is greater than that of Detector 1.
Fill the start and end indices for bins such that
the bin_pwr array is in increasing order of
frequencies but the order of detectors same as
that sent by the HW.

Add API target_if_update_session_info_from_report_ctx(),
to populate the per-session information in the
consume report context. This includes population of
start and end bin indices on per-detector level,
start and end frequencies on per-detector level
and cfreq1/cfreq2 on per-report level,

Change-Id: I044c6961e5f710089b0192876e8717f9127b497f
CRs-Fixed: 2945315
2021-07-10 13:30:17 -07:00
Jhalak Naik
89adfb27cf qcacmn: Find adjusted timestamps in FFT report processing
Find the last_raw_timestamp and adjusted_timestamp
as part of the FFT report processing API.

Change-Id: Ibc7fd524ca897ead3b4b8ca25ba6e6487154305d
CRs-Fixed: 2945307
2021-07-10 13:30:12 -07:00
Jhalak Naik
4f386f38ab qcacmn: Fill per-session info for report and detector level
Fill per-session information in per_session_det_map and
per_session_report_info, with per-report and per-detector
level information, respectively.

These intermediate structures help in filling the
SAMP message.

Change-Id: Ib194fde3567ce76710e010febf729746fedf7a2c
CRs-Fixed: 2945297
2021-07-10 13:30:07 -07:00
Jhalak Naik
399fdd15c0 qcacmn: Add API to fill the Spectral SAMP message
Add a new API target_if_fill_samp_msg, to populate
the Spectral SAMP message and detector level
information, using  pdev_spectral_det_map
and per_session_report_info. Send the SAMP message
to upper layers when completely filled.

Change-Id: If43494fe4a09dbfeb9aea6cb0fa20b406d81e390
CRs-Fixed: 2945282
2021-07-10 13:30:03 -07:00
Jhalak Naik
7dfea024c8 qcacmn: Modify target_if_consume_spectral_report_gen3()
Refactor target_if_consume_spectral_report_gen3()
and divide the functionality into individual
functions.

This will be under OPTIMIZED_SAMP_MESSAGE flag, which
is unset by default for all profiles, till
development is complete.

Change-Id: I07e753dcaff6e81dfc8739df4e691d871c921581
CRs-Fixed: 2945171
2021-07-10 13:29:59 -07:00
Jhalak Naik
f3008debc9 qcacmn: Modify state machine for 160/80p80 MHz gen3 spectral
A state machine checks if spectral reports are
in order for gen3 spectral 160/80p80. Currently,
this state machine has four states.
Modify this state machine to have only two states and
change associated APIs accordingly.

Change-Id: I754758fdf0529394c63fe371f54db79d52459999
CRs-Fixed: 2945161
2021-07-10 13:29:54 -07:00
Jhalak Naik
a366a6f29e qcacmn: Add structs for Spectral per-detector and per-report info
Define a map with per-detector information, that is
keyed by the detector ID from Spectral FFT report.
Use per-detector information from this map to fill
the Spectral SAMP message.

Define struct per_session_report_info, for per session
info that needs to be filled at report level within
SAMP message.

Change-Id: I9f73bd904cc3d4cac42d21b89b1ceb586da7f911
CRs-Fixed: 2945158
2021-07-10 13:29:50 -07:00
Jhalak Naik
1de0695e47 qcacmn: Modify target_if_process_sfft_report_gen3()
Modify the API to include Validation and
processing of Spectral search FFT report.

This will be under OPTIMIZED_SAMP_MESSAGE flag, which
is unset by default for all profiles, till
development is complete.

Change-Id: I250867e2c002f491f51a36416ea9ca5ae0bc5508
CRs-Fixed: 2945132
2021-07-10 13:29:45 -07:00
Jhalak Naik
40bce64102 qcacmn: Modify target_if_consume_sscan_summary_report_gen3()
Modify target_if_consume_sscan_summary_report_gen3() to
include validation and processing of Spectral summary
report.

This will be under OPTIMIZED_SAMP_MESSAGE flag, which
is unset by default for all profiles, till
development is complete.

Change-Id: Ice88b8e74ed714515f21b9b232aa0088fbb54d1d
CRs-Fixed: 2945124
2021-07-10 13:29:40 -07:00
Yu Wang
98a3fceeb3 qcacmn: Enhance DCS event handler to support AWGN event
Handle DCS-AWGN event and take actions accordingly:
For STA mode, if the interference locates on primary 20MHz,
disconnect from AP; otherwise, find a max interference free width
and trigger channel change.
For SAP mode, if the interference locates on primary 20MHz,
try to select a random interference free channel and trigger channel
change (stop SAP if no channel is selected); otherwise, find a max
interference free width and trigger channel change.

Change-Id: I33e79f454b459b12ad84f8b0f3259403037464ee
CRs-Fixed: 2958675
2021-07-02 19:02:13 -07:00
Li Feng
8f08624111 qcacld-3.0: Set moddtim dynamically in the li offload mode
Extend hdd_config_modulated_dtim() to configure moddtim
dynamically in the both non li offload and li offload mode.

Change-Id: I8669ec618d4aa9cd87c4c234972ca500c98119b6
CRs-Fixed: 2970090
2021-07-01 04:24:12 -07:00