xref: /wlan-dirver/qca-wifi-host-cmn/iot_sim/dispatcher/src/wlan_iot_sim_tgt_api.c (revision 6d768494e5ce14eb1603a695c86739d12ecc6ec2)
1 /*
2  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #include <wlan_iot_sim_tgt_api.h>
18 #include <wlan_iot_sim_utils_api.h>
19 
20 QDF_STATUS tgt_send_simulation_cmd(struct wlan_objmgr_pdev *pdev,
21 				   struct simulation_test_params *param)
22 {
23 	struct wlan_objmgr_psoc *psoc = NULL;
24 	struct wlan_lmac_if_tx_ops *tx_ops;
25 
26 	psoc = wlan_pdev_get_psoc(pdev);
27 
28 	if (!psoc) {
29 		iot_sim_err("psoc is NULL");
30 		return QDF_STATUS_E_NULL_VALUE;
31 	}
32 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
33 	if (!tx_ops) {
34 		iot_sim_err("tx_ops is NULL");
35 		return QDF_STATUS_E_NULL_VALUE;
36 	}
37 	return tx_ops->iot_sim_tx_ops.iot_sim_send_cmd(pdev, param);
38 }
39