Commit Graph

224 Commits

Author SHA1 Message Date
Namita Nair
e8dd9fd84a qcacmn: Handle mem leak when ipa_register_ready_cb() fails
Currently g_instances_added is not decremented correctly
in scenarios where IPA callback fails. This prevents
freeing the g_ipa_config memory during deinit, causing a
memory leak. This change will ensure that the instance
count is decremented correctly as part of deinit
in both success and failure scenarios.

Change-Id: I40fd14f6f441d1314eebf8c5d33616c824398a6f
CRs-Fixed: 3472760
2023-04-27 04:08:41 -07:00
Namita Nair
e92b9d5b61 qcacmn: Fix memory leak in ipa_config_mem_alloc
Currently when ucfg_ipa_uc_ol_init() fails,
the wlan_ipa_cleanup() is not called. As a result
g_instances_added is not decremented. This
change performs the cleanup if ucfg_ipa_uc_ol_init()
fails.

Change-Id: I22a83f08c51e10246fa99dff2a06c9ec486f605e
CRs-Fixed: 3456523
2023-04-18 12:11:03 -07:00
Jia Ding
e5050154f1 qcacmn: Add WLAN IPA RX exception packet to pm queue
Below signature is seen in driver logs.
Target is suspended (via send_process_dhcp_ind_cmd_tlv:244)
cds_trigger_recovery_handler: critical host timeout trigger
fw recovery for reason code 34

Suspend/Resume test is run with SAP started and a ref-client
is associated with the SAP. One DHCP-Req packet is received
from ref-client before driver completes the resume process.
With SAP_DHCP_FW_IND feature enabled, driver will send one
WMI cmd to target for such DHCP packets received.

With IPA_OFFLOAD enabled, such DHCP packets are received from
the RX exception callback from IPA driver. Hence add support
to queue these DHCP packets onto pm_queue_head skb queue when
WLAN IPA component is still in suspended state. When IPA component
is resumed from suspend state, pm_queue_head skb queue will be
drained to pass up queued RX exception packets to stack.

For QCA_IPA_LL_TX_FLOW_CONTROL enabled platforms, such as WIN
chipsets, suspend/resume is not supported. Hence wrap fixes
only for !QCA_IPA_LL_TX_FLOW_CONTROL.

Change-Id: I823005d9b58d1d62eec2c044621e1c1423aa3537
CRs-Fixed: 3457254
2023-04-15 12:07:00 -07:00
Namita Nair
59a36d8e87 qcacmn: Handle deprecated interface calls to IPA
As IPA has moved out of the kernel, ipa_uc_reg_rdyCB
interface call from WLAN is not needed anymore
as ipa_wdi_init_per_inst() initialization call will
handle this. This change will add support to retain
this call only for legacy devices.

Change-Id: Icb479562e091d388e03ef5a38b3e95d4dbf06271
CRs-Fixed: 3459071
2023-04-08 13:33:12 -07:00
Namita Nair
72beba762d qcacmn: INI support for optional wifi dp
This change can enable/disable optional
wifi datapath feature from INI.

Change-Id: If380ee1e367f144f258a1e452cb3ab0cab2e33bc
CRs-Fixed: 3424492
2023-04-05 16:53:13 -07:00
Namita Nair
9293b993f1 qcacmn: Handle return status when IPA UC not loaded
Currently if IPA UC is not loaded when opt wifi dp
is enabled, the return status is not handled correctly.
This causes the qdf_event_create to happen for ipa ctx
which later triggers an assert during ipa cleanup.
This fix will handle this scenario.

Change-Id: Ie0a38bd6745f54a37be422e1d352f6c2a7960bbc
CRs-Fixed: 3444783
2023-04-03 04:31:26 -07:00
Namita Nair
bf8fcc25af qcacmn: Disable autonomy for opt wifi dp based on WLANflag
Currently IPA autonomy is disabled for opt wifi dp
feature inorder to set default packet routing
to HOST REO rings instead of IPA. The check currently
depends on the feature flag set from IPA.
But this does not handle the case if feature is
enabled from WLAN but disabled from IPA, as autonomy
will get enabled in this scenario and default packet
routing is set to IPA.
This fix will check if opt_wifi_dp feature is
enabled from WLAN and disable autonomy to
ensure the default routing is always set to
HOST REO rings.

Change-Id: I3673d7dbeefcadb45132ea300f4ec3ac22743b86
CRs-Fixed: 3450862
2023-04-02 06:53:35 -07:00
Namita Nair
d33baafbe5 qcacmn: WAR for opt_wifi_dp feature to disable IPA(1)
IPA_OFFLOAD will be enabled by  default for MSM.
This is a WAR to disable IPA offload during compile
time, based on the IPA_WDI_OPT_DPATH feature flag from IPA.
If the flag is not defined in the IPA test
module file, IPA offload path will be disabled.
This is a WAR, and will be fixed once a Kernel config is
available to enable or disable the optional wifi datapath
feature.

Change-Id: I7aad275f4d86a2ffc239f1fe343de31ec2988fad
CRs-Fixed: 3431972
2023-04-02 01:23:12 -07:00
Namita Nair
42381bb34d qcacmn: Handle RTPM counter for opt wifi dp
Inorder to keep the PCIe link up during
optional wifi dp transfer the
hif_force_wake_request() is called during
filter addition. This increments the rtpm_get counter.
Now if Wifi is disconnected before releasing the
filters, the corresponding hif_force_wake_release()
call is not made. This causes a mismatch in RTPM GET and
PUT calls and triggers an assert during hdd_wlan_stop_modules().
This change adds a cleanup call to release the force wake
and reduce the rtpm_put counter to prevent the assert.

Change-Id: Idd778275a015922376cf7eb0a7c3d92e75881fe8
CRs-Fixed: 3441186
2023-04-01 01:20:02 -07:00
Namita Nair
4e3bb0b849 qcacmn: Fix 2nd filter is null in opt wifi dp
Currently if IPA wants to add 2 filters and
send the filter params in 2 separate add
requests, HOST does not handle this correctly.
This causes the second filter params to be 0.
This change updates the correct index to be accessed.

Change-Id: Ib0a4853d46585d9529e990177fb8da20382c2fdb
CRs-Fixed: 3441196
2023-03-30 09:01:34 -07:00
Namita Nair
51e4b595d7 qcacmn: Fix filter delete check in opt wifi dp
If only a single filter is installed,
then the ip version of the second filter
param will not be set. Hence fix the check
for ip version in htt layer as it is already
verified when received from the IPA layer.

Change-Id: I05dff71aa27a254023599df0cbab51bafd0c4f82
CRs-Fixed: 3441760
2023-03-28 16:13:18 -07:00
Namita Nair
c016d7b5d9 qcacmn: Fix pipes_down flag in IPA offload
Currently pipes_down flag is not set to false
during wlan_ipa_uc_enable_pipes() because
autonomy is disabled for optional wifi dp
feature. This causes a crash while trying
to disable pipes during teardown.
This change will update the check and
set pipes_down flag to false during pipe enable.

Change-Id: I41f7e6fc942764c5ab5d3437185af9f90fb39280
CRs-Fixed: 3436012
2023-03-21 17:32:55 -07:00
Devender Kumar
f230d96802 qcacmn: Properly set WDI version for WIN chipset
Set WDI version based on SOC architecture, set WDI
version to IPA_WDI_4 for QCA_WIFI_QCN9224 chipset,
else IPA_WDI_3.

Change-Id: Ib80435e5098cfbcb9f90d4ac9cfe81ea183f308a
CRs-Fixed: 3383949
2023-03-15 22:39:08 -07:00
Namita Nair
f27ac75cff qcacmn: Fix inc/wlan_ipa_core.h documentation
Fix documentation issues in inc/wlan_ipa_core.h
identified by kernel-doc script.

Change-Id: Ibd4867f8553326078d08f2fde9469ee74a1ec963
CRs-Fixed: 3424480
2023-03-09 12:58:36 -08:00
Namita Nair
cb79729a9b qcacmn: Fix spelling of ipa_ctxt
Fix spelling of ipa_ctx to ipa_ctxt.

Change-Id: I87b00c64039078e17744f90fd865b5d034755ea4
CRs-Fixed: 3423178
2023-03-06 20:22:06 -08:00
Jeff Johnson
b46eae96f7 qcacmn: Fix IPA documentation
The kernel-doc script identified some documentation issues in the
top-level ipa folder, so fix them.

Change-Id: Ie128c65a495bab06c5207fff768a111de6bab958
CRs-Fixed: 3420684
2023-03-02 23:54:20 -08:00
Namita Nair
a33b4b04bb qcacmn: Fix opt dpath compilation error for OWRT SI
Currently, there is a compilation error on the
OWRT SI in the alternate code path when optional
dp feature is not enabled.
The caller wlan_ipa_wdi_init_set_opt_wifi_dp() passes an
argument of incompatible type. This change fixes the
compilation issue.

Change-Id: I1f2eecbb67bfb2ef17ee73ce2faedb85827b4bbc
CRs-Fixed: 3417214
2023-02-28 16:57:41 -08:00
Namita Nair
0103de1889 qcacmn: Fix single filter addition opt wifi dp
Currently when filter addition request for two
filters is sent one by one, filter handle
is not set correctly. This change handles
the condition to assign the correct filter handle.

Change-Id: I1e3ae07ee7718cf533784861003a47e6678b51be
CRs-Fixed: 3410387
2023-02-28 16:57:32 -08:00
Namita Nair
aab63b2b96 qcacmn: Add optional wifi datapath feature ipa layer
This change adds the optional wifi datapath feature
to transfer data to and from modem via WLAN.
By using the existing path between WLAN and IPA, this
change registers new interfaces between IPA and WLAN
to reserve, add, delete and release rx filters,
which are required for setting up CCE filter rules.
These filters help to determine which packets need
to be routed to IPA specific REO rings.

Change-Id: I17c2ab77ae343f15d6b79fa02bb70ed62294089c
CRs-Fixed: 3403314
2023-02-28 16:57:22 -08:00
Gaurav Saini
a64c2fbb26 qcacmn: Fix potential warnings
As per kernel doc, this file does not have proper 
comments and spelling mistake are present, due to 
which WLAN Automated code review for kernel-doc 
checker is giving error.

Fix is updating the comments based on Kernel-doc 
guidelines and correct the spelling mistake.

Change-Id: I7f8b8505b9810de2678ecfa893be78c0451cf612
CRs-Fixed: 3368472
2023-01-07 06:42:10 -08:00
Amrit
6d1cdea120 qcacmn: Add support to get rx mcast and bcast stats
Add support to get rx multicast and broadcast stats
in IPA Architecture

Change-Id: Id7cf7bb09534833af7fe620cdbd4ed452d9e4613
CRs-Fixed: 3346858
2022-12-26 03:24:51 -08:00
Chaoli Zhou
b9b7e87a10 qcacmn: Fix compile error for ROME IPA
Fix compile error for ROME IPA in the kernel-5.4.

Change-Id: I2e8a3d5f4b08ab4802c7d0d229747c389b055a69
CRs-Fixed: 3345160
2022-12-05 16:47:55 -08:00
Jeff Johnson
b861d604e2 qcacmn: ipa: Fix misspellings
Fix misspellings in ipa/...

Change-Id: I115ce0ff378e8203cdc2614f1547f5822f5b5eae
CRs-Fixed: 3304689
2022-10-06 21:31:46 -07:00
Rajesh Chauhan
bcb0f547dd qcacmn: ipa: change prototype of functions to pass dev_addr as const
In kernel 5.17, net_device->dev_addr is changed to const unsigned char*.
Modify prototype of below functions to pass dev_addr as const:

 - ucfg_ipa_wlan_evt()
 - ipa_wlan_evt()
 - wlan_ipa_wlan_evt()
 - __wlan_ipa_wlan_evt()
 - wlan_ipa_cleanup_iface()
 - wlan_ipa_send_msg()
 - wlan_ipa_setup_iface()
 - wlan_ipa_save_bssid_iface_ctx()
 - wlan_ipa_uc_find_add_assoc_sta()
 - wlan_ipa_set_peer_id()
 - wlan_ipa_set_sap_client_auth()

Change-Id: Ib2cbe8de724bc09abf82fa49c0ea08c268be34c0
CRs-Fixed: 3304829
2022-10-03 23:11:27 -07:00
Devender Kumar
1c3e98b8f0 qcacmn: Debug framework for SMMU buffer tracker
To support SMMU debug framework for IPA offload, change the
caller IPA component where SMMU map and unmap are done.

CRs-Fixed: 3255423
Change-Id: I5276c0b41c8e315940e8d4f5d3082d45b08b571b
2022-09-13 03:24:48 -07:00
Jia Ding
c6704fac9a qcacmn: Properly set WDI version for KIWI family
Set WDI version to IPA_WDI_3_V2 for KIWI and KIWI_V2 chipsets.

Change-Id: I2cda2c32f2d56f06c8a8ee84002c2dff2ea28a12
CRs-Fixed: 3247917
2022-09-09 23:53:37 -07:00
Jia Ding
e2701283b3 qcacmn: Update frag_header and ipa_header for KIWI family
Size of struct frag_header and struct ipa_header are passed to IPA
driver as destination mac address offset. Hence properly update
the definitions for KIWI family chipset so that correct offset can
be updated to IPA driver.

Change-Id: I3efdb8f4a7b4d79cf71fa5f82f3dfd356cb2b970
CRs-Fixed: 3275933
2022-08-26 00:36:01 -07:00
Devender Kumar
f07e41c395 qcacmn: EasyMesh requires 7 vap per radio
Change the Max number of session id support by IPA
to 7 as EasyMesh requires 7 vap per radio.

CRs-Fixed: 3259857
Change-Id: I24a98e10e46d3720b6e210d023c750d056786bbf
2022-08-03 22:50:07 -07:00
Devender Kumar
71cf1a4856 qcacmn: Fix for peer authorize check
When EasyMesh feature is enable at compile time but not at runtime,
then the peer authorization is not proper.
Fix is to check for peer authentication irrespective of feature enable
at compile or runtime.

CRs-Fixed: 3252225
Change-Id: I5790e054c838114318f6e819a164b0a8c7b94c83
2022-07-27 07:23:02 -07:00
Devender Kumar
6e12b33067 qcacmn: Create a new API to update wdi hdr type for IPA
Create a new API to update wdi hdr type for IPA and Fix
the return type for cdp call.

CRs-Fixed: 3246990
Change-Id: Ic8adb1f46bfeda6598a01ffdda27339cfa04ee9d
2022-07-25 14:02:17 -07:00
Himanshu Batra
7c3316638a qcacmn: Changes to support for vlan tagged traffic in IPA offload
IPA component changes to support for vlan tagged traffic in IPA offload

Change-Id: Ie28474537332d31f1ed1403ee0b774563a16a3ab
CRs-Fixed: 3229801
2022-07-21 11:02:26 -07:00
Devender Kumar
3035192763 qcacmn: Easymesh feature support
Current IPA/WLAN driver does not support the WDS feature.
Packets are dropped if they came via end-node which is not
in direct connection with root AP.

Fix is to enable WDS support and update the same to IPA
driver and create/update AST entries for end-node in
roaming, new src port learn case. Send WDS support to IPA
at wdi init and AP client connect event.

CRs-Fixed: 3226348
Change-Id: I26211613334b33d0d601629405597be329a56774
2022-07-13 02:37:14 -07:00
Devender Kumar
0fd34e472b qcacmn: Fix for netdev iface deregistration
IPA driver is not able to deregister the netdev iface
as the WLAN driver is unregistering the netdev before
giving event to the IPA driver, hence IPA driver is unable
to map the local iface mapping.
FIX is to pass the netdev interface id to IPA driver
so that IPA can get the correct netdev.

Change-Id: I6011bc01a56d90287e3a0f93b3cddf9e4b0fff9b
CRs-Fixed: 3165336
2022-06-03 04:41:32 -07:00
Devender Kumar
411e8fc3e0 qcacmn: Fix for IPA init path
After enable and disable of both radio, If second radio is enabled
then the instance_id from wlan driver is passed wrongly to IPA driver
which is in leading to initializion of first radio on IPA driver side.
Fix is to take the instace id based on psoc id and set the prod and cons
pipes based on instance_id instead of IPA given handle.

Change-Id: I26f4f3fbd23284e79a380d212ad07aceac50f053
CRs-Fixed: 3179306
2022-05-05 01:20:56 -07:00
Ananya Gupta
0afac9d12e qcacmn: Enable IPA if enabled in platform driver and ini
Enable IPA only if it is enabled from both platform driver
and ini file.
Change-Id: Ifc4bcd2c5b29b91c0eb72a844906cf11a65686e4
CRs-Fixed: 3148731
2022-04-12 06:31:43 -07:00
Himanshu Batra
5decc2b494 qcacmn: Use correct BW for ipa perf based on radio type
Use correct BW for ipa perf based on radio type

Change-Id: Ieabf287445de79e8c0a80416a39268a7334a82d5
CRs-Fixed: 3160927
2022-04-06 04:39:52 -07:00
Devender Kumar
b64b200ff8 qcacmn: Fix for early free of IPA global varible
With multiple radio supporting IPA offload path, the g_ipa_config
is getting free when doing wifi unload for single radio, which is
leading to an issue of early free of g_ipa_config variable.
Fix is check if all the soc are down and then only free the
global struct for IPA.

Change-Id: If8fbc7a72c91a26e6f9e680711cd58429f8a1e99
CRs-Fixed: 3137091
2022-03-09 05:37:51 -08:00
Devender Kumar
89fb12ba8a qcacmn: Fix for IPA deinit path
While Unloading WIFI ko IPA deinit path is called thrice
and leading to double free issue which is causing kernal
panic, FIX is call the IPA deinit only once for each soc/pdev.

Change-Id: I3b5bd500afabe45cb8d1062e2c82a4b338f28544
CRs-Fixed: 3130590
2022-03-07 23:46:18 -08:00
Devender Kumar
3d525ae1ce qcacmn: Code change in IPA component for 2x_pdev
2x_pdev changes are included mainly related to IPA
init for second pdev/radio and pipe enablement for
second pdev/radio, code changes can support n number
of radio for IPA, add support for new IPA API's.

Change-Id: Iac67e05e0f0098bdc24626fdbe59b89d768154cd
2022-02-16 16:57:01 -08:00
Himanshu Batra
289a751055 qcacmn: Update Quic Copyright year markings
Update Quic Copyright year markings

Change-Id: Idb93456c55e3c2d412a19147bb76ea737fe1eaf4
2022-01-20 11:04:32 -08:00
Jianmin Zhu
03f7a9accb qcacmn: Avoid spin_lock_bh in ipa wlan rx callback
Spin_lock_bh is introduced in ipa wlan rx path by security fix
I0c0bc6e60efa193126ba1e3eca36c5e02f7f76a3,
wlan_ipa_w2i_cb->cdp_peer_state_get->dp_get_peer_state->
dp_peer_find_hash_find->qdf_spin_unlock_bh(&soc->peer_hash_lock),
which make rx pkt aggregation failed, for each rx pkt, once
put into backlog queue, net_rx soft irq is scheduled to handle it.
For each rx msdu, ipa rx work thread, net_rx soft irq and iperf/app
thread are scheduled, which make rx throughput failed to meet KPI.

To avoid spin_lock_bh, don't call cdp_peer_state_get for each rx pkt,
only call 1 time, and save peer auth state in IPA context, for following
pkts, just get peer auth state from IPA context without spin_lock_bh.

Change-Id: I36196bab4626194bda254219c4c44dc4f029cff0
CRs-Fixed: 3098860
2022-01-20 10:01:03 -08:00
Himanshu Batra
003a476648 qcacmn: Use QAL API for RCU lock
Use QAL API for RCU lock to avoid GPL symbol usage in host driver

Change-Id: I0d71cc60072b6e3e3e7b067a522f2bdb38c8f457
2022-01-08 22:53:16 -08:00
Himanshu Batra
0dd1799d92 qcacmn: Increase IPA Max bandwidth to support high BW voting
Increase IPA Max bandwidth to support high BW voting

Change-Id: I80d127601d7c6c6feb214062cee6b35a3553f9de
2021-12-27 22:34:27 -08:00
Will Huang
f920f723a9 qcacmn: Extend IPA max intf number to 4
To support 4 SAP concurrency on sdxlemur, it is required to extend IPA
max interface number to 4.

wlan_ipa_iface_2_client is for legacy chip which support MCC, it is not
useful for nowaday chip, just extend it to 4 interface with same
content as other interface to pass ipa setup.

And Fix a static analyze error about session_id.

Change-Id: I5f2a4a0e3ff943e15ab9907e206b64423002eccb
CRs-Fixed: 3092428
2021-12-23 20:33:37 -08:00
Vevek V
03017ea28c qcacmn: handle_last_discon to disable IPA in dual SAP mode
In dual SAP connection, calls only disable_pipes to disable IPA,
whereas during second SAP disconnection, to enable IPA, calls
wlan_ipa_uc_handle_first_con, which sends ipa_set_active MSG
as true to FW, for both Tx/Rx to resume.
So calling wlan_ipa_uc_handle_last_discon in dual SAP mode,
which sends ipa_set_active MSG as false to FW, to suspend.

Change-Id: I224e94a003030f497e15f242634f15d9c71b9ef0
CRs-Fixed: 3094276
2021-12-22 06:43:27 -08:00
Himanshu Batra
a83d7d4111 qcacmn: Modify IPA object cleanup path
Currently ipa object cleanup is happening as part of pdev destroy.
Move it to deinit API of IPA

Change-Id: Id36648397102fa47ad1d29f99f2f152f40663f36
2021-12-20 22:45:17 -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
Rajeev Kumar
9227d006fc qcacld-3.0: Disable SAP/GO D3 WoW features if IPA is enabled
SAP/GO D3 WoW feature is not supported when IPA is enabled and hence
disable SAP/GO D3 WoW features when IPA is enabled.

Change-Id: Ia3da37087a0ca79c81c546f43a0893e46cf08c3c
CRs-Fixed: 3015104
2021-08-27 15:12:30 -07:00
Jianmin Zhu
5cc430c6ed qcacld-3.0: Fix Dual AP IPA failed when NAPI enabled
Fix AP+AP IPA offload path failure when NAPI over IPA enabled on mdm
platforms by adding QCA_CONFIG_RPS check.

QCA_CONFIG_RPS is same as CONFIG_RPS, default Y, but depend on CONFIG_SMP
as msm-5.4/net/Kconfig.

For AP+AP mode,
For LA,   CONFIG_SMP on,  then QCA_CONFIG_RPS on,  use IPA exception path.
For mdm,  CONFIG_SMP off, then QCA_CONFIG_RPS off,  use IPA offload path.

For IPA napi enable status check, just use qdf_ipa_get_lan_rx_napi,
don't need MACRO IPA_LAN_RX_NAPI_SUPPORT.

Change-Id: I6b16f2a830d4e7829c9e539896ed2977895d367e
CRs-Fixed: 2992393
2021-08-17 11:01:11 -07:00
Jia Ding
1f3afe0e38 qcacld-3.0: Prevent possible use-after-free of ipa_obj
wlan_ipa_uc_loaded_uc_cb is an API that is registered to IPA driver.
Therefore when IPA uC is ready, IPA driver is likely to invoke this CB
into our driver. If it is invoked after a WLAN idle shutdown, ipa_obj
use-after-free will happen because ipa_obj is destroyed as part of
shutdown.

g_ipa_is_ready flag is cleared after ipa_obj is destroyed. Therefore
fix is to add a ipa_cb_is_ready check in wlan_ipa_uc_loaded_uc_cb to
ensure ipa_obj is allocated and not freed.

Change-Id: Id422c0780ab864936d9bc812a6078ea4c20ef2af
CRs-Fixed: 2975057
2021-07-07 09:11:22 -07:00