xref: /wlan-driver/qca-wifi-host-cmn/ipa/dispatcher/src/wlan_ipa_tgt_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2018, 2020-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2021,2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name /**
20*5113495bSYour Name  * DOC: Implements public API for ipa to interact with target/WMI
21*5113495bSYour Name  */
22*5113495bSYour Name 
23*5113495bSYour Name #include "wlan_ipa_tgt_api.h"
24*5113495bSYour Name #include "wlan_ipa_main.h"
25*5113495bSYour Name #include "wlan_ipa_public_struct.h"
26*5113495bSYour Name #include <wlan_objmgr_global_obj.h>
27*5113495bSYour Name #include <wlan_objmgr_pdev_obj.h>
28*5113495bSYour Name #include <wlan_lmac_if_def.h>
29*5113495bSYour Name 
tgt_ipa_uc_offload_enable_disable(struct wlan_objmgr_pdev * pdev,struct ipa_uc_offload_control_params * req)30*5113495bSYour Name QDF_STATUS tgt_ipa_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev,
31*5113495bSYour Name 				struct ipa_uc_offload_control_params *req)
32*5113495bSYour Name {
33*5113495bSYour Name 	struct wlan_objmgr_psoc *psoc;
34*5113495bSYour Name 	struct wlan_lmac_if_tx_ops *tx_ops;
35*5113495bSYour Name 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
36*5113495bSYour Name 
37*5113495bSYour Name 	IPA_ENTER();
38*5113495bSYour Name 
39*5113495bSYour Name 	psoc = wlan_pdev_get_psoc(pdev);
40*5113495bSYour Name 	if (!psoc) {
41*5113495bSYour Name 		ipa_err("NULL psoc");
42*5113495bSYour Name 		return QDF_STATUS_E_NULL_VALUE;
43*5113495bSYour Name 	}
44*5113495bSYour Name 
45*5113495bSYour Name 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
46*5113495bSYour Name 	if (!tx_ops)
47*5113495bSYour Name 		return QDF_STATUS_E_NULL_VALUE;
48*5113495bSYour Name 
49*5113495bSYour Name 	if (tx_ops->ipa_ops.ipa_uc_offload_control_req)
50*5113495bSYour Name 		status = tx_ops->ipa_ops.ipa_uc_offload_control_req(psoc, req);
51*5113495bSYour Name 
52*5113495bSYour Name 	IPA_EXIT();
53*5113495bSYour Name 	return status;
54*5113495bSYour Name }
55*5113495bSYour Name 
56*5113495bSYour Name QDF_STATUS
tgt_ipa_intrabss_enable_disable(struct wlan_objmgr_pdev * pdev,struct ipa_intrabss_control_params * req)57*5113495bSYour Name tgt_ipa_intrabss_enable_disable(struct wlan_objmgr_pdev *pdev,
58*5113495bSYour Name 				struct ipa_intrabss_control_params *req)
59*5113495bSYour Name {
60*5113495bSYour Name 	struct wlan_objmgr_psoc *psoc;
61*5113495bSYour Name 	struct wlan_lmac_if_tx_ops *tx_ops;
62*5113495bSYour Name 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
63*5113495bSYour Name 
64*5113495bSYour Name 	IPA_ENTER();
65*5113495bSYour Name 
66*5113495bSYour Name 	psoc = wlan_pdev_get_psoc(pdev);
67*5113495bSYour Name 	if (!psoc) {
68*5113495bSYour Name 		ipa_err("NULL psoc");
69*5113495bSYour Name 		return QDF_STATUS_E_NULL_VALUE;
70*5113495bSYour Name 	}
71*5113495bSYour Name 
72*5113495bSYour Name 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
73*5113495bSYour Name 	if (!tx_ops)
74*5113495bSYour Name 		return QDF_STATUS_E_NULL_VALUE;
75*5113495bSYour Name 
76*5113495bSYour Name 	if (tx_ops->ipa_ops.ipa_intrabss_control_req)
77*5113495bSYour Name 		status = tx_ops->ipa_ops.ipa_intrabss_control_req(psoc, req);
78*5113495bSYour Name 
79*5113495bSYour Name 	IPA_EXIT();
80*5113495bSYour Name 	return status;
81*5113495bSYour Name }
82*5113495bSYour Name 
83