Commit Graph

61 Commits

Author SHA1 Message Date
Jia Ding
296729e604 qcacmn: Properly set RPS for WLAN IPA
It is observed on sdxpinn target (first multi-core MDM platform)
that WLAN failed to enable IPA pipes with SAP-SAP mode when first
ref-client connects to the SAP. Indeed with QCA_CONFIG_RPS=y and
qdf_ipa_get_lan_rx_napi()=true, wlan_ipa_uc_handle_first_con()
directly returns false if more than 1 SAP is started.

This obviously breaks IPA data path for MDM platform, where even
4 SAP can be supported with IPA offload. And WLAN data path
forwarding replies fully on IPA hardware. This also means there's
no need to configure RPS for MDM, which is a host kernel networking
feature.

Change-Id: I4c17f61b1b242cdbaed7177201b330d10ec7e61b
CRs-Fixed: 3490817
2023-05-16 14:34:09 -07:00
Namita Nair
b84e6e73fd qcacmn: Enable SAP/GO D3 WOW for OPT_WIFI_DP case
Currently as IPA_OFFLOAD path is enabled for OPT_WIFI_DP
usecase, this causes SAP/GO D3 WOW to be disabled.
This change will add a check to ensure D3 WOW is
enabled when IPA path is set for OPT_WIFI_DP usecase.

Change-Id: Idbbec78dadcba3e8f26b9c01e296869cd7278750
CRs-Fixed: 3496857
2023-05-14 13:38:17 -07:00
Namita Nair
2613f207e0 Revert "qcacmn: WAR for opt_wifi_dp feature to disable IPA(1)"
This reverts Change-Id: I7aad275f4d86a2ffc239f1fe343de31ec2988fad.

Change-Id: I875e8d15430c3f0a0f4bf10d275b203b24023a64
CRs-Fixed: 3483264
2023-05-12 16:39:36 -07:00
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
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
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
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
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
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
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
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
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
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
Huashan Qu
61fda1ca3d qcacld-3.0: Fix KW issues in ipa files
Fix KW issues in ipa files, add ipa_obj null check before use.

Change-Id: Ie6f69fda7d50b8ece9917db43a838e0f3852393f
CRs-Fixed: 2979119
2021-07-01 13:44:16 -07:00
Tiger Yu
8f8a2c9424 qcacld-3.0: Use the global lock instead of the ipa init_deinit_lock
Use the global lock instead of the init_deinit_lock in the ipa_obj to
avoid access the invalid memory with ipa_obj->init_deinit_lock since
the ipa_obj will be freed after driver shutdown.

Change-Id: I98a844456873f60213fae19c237bb08b76b4846c
CRs-Fixed: 2887487
2021-04-27 06:19:06 -07:00
Tiger Yu
a96072211d qcacld-3.0: Add is_2g_iface support in WLAN IPA
With IPA TX two pipes support, TX rings for 2G and 5G traffic
are separated. As a result, WLAN needs to let IPA driver
know if the interface registered to IPA is 2G or 5G so that
IPA could differentiate and designate the interface for the
correct IPA TX pipe.

In this change, a new param is_2g_iface is added for the
event interface between protocol and IPA component. And
this new param is applicable only STA_CONNECT and
AP_CONNECT where wlan will register interface details
including is_2g_iface to IPA driver.

For two pipes implementation, is_2g_iface piggy-backs
session_id when passing it to CDP layer. And CDP layer
needs to decode session_id and is_2g_iface.

Change-Id: I5e02ec6969bb2f77d6b40e89d5a9451a7bb0be9d
CRs-Fixed: 2702704
2021-04-20 03:32:15 -07:00
Vevek Venkatesan
3de08235c3 qcacld-3.0: add checks for deinit in ipa_register_ready_cb
Since stop_modules can happen in parallel due to idle shutdown,
add additional checks whether the IPA deinit happened already
or in-progress, in ipa_register_ready_cb.

Change-Id: Icc1973be3e90d4231addcebab55e621d19c5789c
CRs-Fixed: 2903419
2021-04-01 20:34:02 -07:00
Zhaoyang Liu
8071f3b053 qcacld-3.0: fix build error about function redefinition
Fix the compilation error about redefinition of 'ipa_is_ready'.
This API is defined in <linux/ipa.h>. Rename the function name.

Change-Id: I206a221a5df95494e947483f2d133df6e5053220
CRs-Fixed: 2817997
2020-12-21 04:49:45 -08:00
Chaoli Zhou
13fd5d9173 qcacld-3.0: Enable/Disable intrabss for Rome IPA
In the Rome IPA case, it need wlanhost side to
enble/disable intrabss by WMI_VDEV_PARAM_INTRA_BSS_FWD.
If set to 1, the ip data transfer between two wlan clients
should be:
wlan client1 -> wlan fw -> wlanhost -> wlan fw-> wlan client2.
If set to 0, the ip data transfer between two wlan cleints
should be:
wlan client1 -> wlan fw -> ipa -> wlan fw -> wlan clients2.

Change-Id: I105ddbdb58f2cd01bdf94521bd7934508889de5d
2020-10-13 04:13:15 -07:00
Ananya Gupta
c66323f7a6 qcacld-3.0: Enabling RPS for STA in STA+SAP mode
In STA+SAP mode, RPS is enabled only for SAP interface and
not for STA interface resulting in low throughput as STA RX
will also take the IPA path.
To fix this, enable/disable RPS when SAP is turned on/off
when IPA is enabled

Change-Id: I67c0da2fbbb43bd7b34969bbb05c1127e60d5673
CRs-Fixed: 2783136
2020-10-09 02:14:18 -07:00
Srinivas Girigowda
c2d762bccf qcacld-3.0: components: Remove logs for qdf_mem_malloc() checks
qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

Change-Id: If0b9425f82f9ed793c7639c0ed09eb1f868b6d5c
CRs-Fixed: 2781932
2020-09-25 12:59:42 -07:00
Nisha Menon
fa95593803 qcacld-3.0: IPA SMMU enable check to be moved to IPA ready cb
During probe IPA SMMU S1 enable check will pass only if IPA
registration for ready callback is successful and IPA ready
callback is invoked.
This ensures that IPA APIs are not invoked unless IPA ready
callback is invoked and ipa ready flag is set in the host
driver.

Change-Id: Ie157a2f851bb1e914a098b62ede1280aa0243d19
CRs-Fixed: 2778504
2020-09-20 01:05:50 -07:00
Nisha Menon
947ad877c7 qcacld-3.0: Disable ipa ready registration in FTM mode
In FTM mode do not register callback with IPA driver
to check if IPA is ready.
IPA offload is not supported in FTM mode.

Change-Id: I9d36f3085db72d3ffe9e6080f422618f7a531c01
CRs-Fixed: 2772192
2020-09-15 11:38:32 -07:00
Nisha Menon
57278370bd qcacld-3.0: Map IPA tx buffers as part of IPA ready callback
Register IPA ready callback with IPA driver. The callback
sets ipa_is_ready flag in the host driver and kick starts
the ipa init sequence as part of which the Tx buffers are
mapped to IPA.
None of the IPA APIs are invoked until IPA ready registration
is complete.

Change-Id: I4dda8fd083c71400532139174f834b757e05e5a6
CRs-Fixed: 2752235
2020-09-02 13:51:29 -07:00
Sravan Goud
c3fddc9ae6 qcacld-3.0: Flush pending ipa pending events
At stop adapter flush vdev's pending wlan ipa events
and also increase the ipa resources load/unload timeout
to 500ms as current timeout of 100ms which is less taking
in to account of suspending IPA pipes, WLAN FW pipes and
also waiting separately for the RX and TX suspend ack from
the FW.

Change-Id: Ia622ab84f15089826c23502f365b11e742277ca8
CRs-Fixed: 2660807
2020-04-16 03:10:40 -07:00
Jia Ding
fa750c6013 qcacld-3.0: Support per AP isolation in WLAN IPA
AP isolation a.k.a intra-bss forwarding is a per AP attribute. Issue in
current IPA implementation is that it does not support per AP control.
In a SAP-SAP configuration, latter SAP configuration will always overwrite
first SAP's isolation configuration.

Fix is to add vdev id parameter from protocol layer so that IPA component
could configure AP isolation on a per AP basis.

Change-Id: I9c96cdcda03eb10b4c2984a757e52d77b5bf6790
CRs-Fixed: 2624757
2020-02-25 21:58:03 -08:00
Vevek Venkatesan
8390aa8117 qcacld-3.0: cdp: Converge cdp_ipa_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- ipa_get_resource
- ipa_set_doorbell_paddr
- ipa_set_active
- ipa_register_op_cb
- ipa_get_stat
- ipa_tx_data_frame
- ipa_uc_get_share_stats
- ipa_uc_set_quota
- ipa_enable_autonomy
- ipa_disable_autonomy
- ipa_setup
- ipa_enable_pipes
- ipa_disable_pipes
- ipa_rx_intrabss_fwd

Change-Id: I678d7a7de7132417ff6051b0fd6da5d14426d21e
CRs-Fixed: 2540861
2019-11-21 06:12:04 -08:00
Mohit Khanna
99b68ed049 qcacld-3.0: Wait for IPA TX Completions on IPA disablement
In DBS scenario(SAP + STA) when all SPA clients disconnect, while STA is
still connected, IPA pipes are disabled on the lithium target. At this
time, its possible that some packets TX from IPA over WLAN are still
pending. If these completions come after IPA pipes are disabled, it can
lead to a NOC error, since the GSI doorbell register for WBM2SW2 ring
may be clock gated (after IPA pipes are disabled).

To avoid this situation, wait for some time before disabling IPA pipes.
IPA pipes are disabled after a timeout, when system suspend call tries
to suspend the bus. A driver unload or a softap tear-down will also
disable the pipes.

Change-Id: I542049fa19d0dcf5c31d9b8a2d836388847dd6c1
CRs-Fixed: 2553670
2019-11-08 15:54:58 -08:00
Sravan Kumar Kairam
d42125f4f4 qcacld-3.0: Support stats quota for sta + sap ipa offload
Implement metering stats quota to support ipa offload sta plus
sap wifi sharing use cases.

Change-Id: Ic9d5ad817ffb4d671a43f3f3aebb2d8cce293873
CRs-Fixed: 2517696
2019-10-19 17:46:02 -07:00
Alok Kumar
44343fc057 qcacld-3.0: During wlan IPA suspend, force the BW voting to high
During wlan IPA suspend, force the bandwidth voting to high
when CFG_DP_IPA_ENABLE_FORCE_VOTING is enabled.

Change-Id: I9b368081f9c0919f5fecfacf318ad1a714cc33cf
CRs-Fixed: 2521815
2019-09-26 22:04:50 -07:00
Vevek Venkatesan
98a10c3eef qcacld-3.0: cleanup IPA STA iface, if STA disconnect failed
If STA disconnect failed for any reason, cleanup IPA STA iface
if not already done.

Change-Id: I27ff33324bc4724e8470af9a0c434fa03e8aa5c3
CRs-Fixed: 2505563
2019-08-22 07:31:12 -07:00
Rakshith Suresh Patkar
6956929357 qcacld-3.0: Cleanup sta_id from IPA [PEER_ID_PHASE1]
Local sta_id or peer_id is being cleaned up across DP, HDD
and PS/WMA. So, any references to local peer_id/sta_id will
be replaced by peer mac address and all interactions
between the layers will be based on peer mac address.

Change-Id: I78230bf1e1ec090e83245bff04953fa2e03b91cd
CRs-Fixed: 2504013
2019-08-09 07:37:21 -07:00
Vevek Venkatesan
24018994a5 qcacld-3.0: abstract Linux identifiers from IPA component
Abstract Linux based OS identifiers from IPA component in
HDD/OSIF layer.

Change-Id: I82a5db8c796d47d552757b1a450df10c72061177
2019-05-31 02:29:49 -07:00
Vevek Venkatesan
9d39916b5f qcacld-3.0: fix CFI failure by abstracting the callback
Abstract the callback hdd_softap_ipa_start_xmit by
hdd_softap_ipa_start_xmit, to match the return type of
wlan_ipa_softap_xmit pointer, to fix a CFI failure.

Change-Id: If1cb1a80801558d5c7831ec89ad5281b0bbe36f3
2019-05-28 08:19:59 -07:00
Wu Gao
73643858e5 qcacld-3.0: Format ini descriptions
Some ini descriptions are different to common, and some of them
include wrong information, so correct them and use unified form.

Change-Id: I36348fb26a03cab254fd309d792125b8a21ad02f
CRs-Fixed: 2402446
2019-02-24 21:34:47 -08:00
Jianmin Zhu
147f2d9b11 qcacld-3.0: Fix asymmetry of ipa pdev create and destroy handler
Fix asymmetry of ipa create and destroy handler

Change-Id: I89f5ca112ef3cc6b46fef8273800c668936f9c2f
CRs-Fixed: 2353796
2018-11-22 04:18:12 -08:00
jitiphil
be719aafaa qcacld-3.0: Add IPA CFG items and APIs
Add IPA related INI config to IPA component.

Change-Id: I5bea63b83ddac62504ef38019aa4034c4e18bca7
CRs-Fixed: 2320921
2018-10-05 19:58:00 -07:00
jitiphil
17d6f6a529 qcacld-3.0: Handle FW rejuvenate scenario
Upon driver reinitialize after a FW rejuvenate,
data packets are not going through IPA path.

Check for FW rejuvenate scenario during driver
recovery and send appropriate message to IPA
driver.

Change-Id: I8c1d7ba78227684cd5653a5927aa4d4c2ce5d354
Crs-Fixed: 2287293
2018-10-04 08:13:09 -07:00
Sravan Kumar Kairam
f3c95eb167 qcacld-3.0: Send IPA UC disconnect events during SSR
Currently during SSR IPA events such as AP DISCONNECT/
STA DISCONNECT are not sent and also wlan ipa interafces
are not deregistered. After SSR when host sends AP CONNECT/
STA CONNECT and register interafce IPACM will reject as for
previous events before SSR there are no disconnect events.
This leads to data come via exception path instead taking
IPA HW route as interface headers are not registered.

In this fix send IPA UC disconnect events and deregister
interafces during SSR.

Change-Id: I6e617261ec53b7d572023613d212eae057b13b03
CRs-Fixed: 2315828
2018-09-20 14:54:40 -07:00
Dustin Brown
287b458034 qcacld-3.0: Reduce hdd/ipa info logs
A number of HDD and IPA logs are generally unnecessary and have been
identified as contributing to log spam. Reduce these log messages to the
debug level.

Change-Id: I2f92bb4caec5adc65fdad0146298aa5f88b43def
CRs-Fixed: 2288430
2018-07-31 19:01:18 -07:00
Sravan Kumar Kairam
4dc849ea8e qcacld-3.0: Clean up IPA interface when SAP stop bss fails
In case of rmmod if stop bss fails SAP IPA interface is not
deleted. So again at next driver load IPA will be holding the
stale IPA header and new IPA header will not be added at IPA
interface creation. In this change clean IPA interface when SAP
stop bss fails.

Change-Id: I3a1bf891752308ba1a29d6768f24880d8514d5bf
CRs-Fixed: 2224307
2018-06-20 04:05:36 -07:00