xref: /wlan-driver/qcacld-3.0/components/target_if/pmo/src/target_if_pmo_arp.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 /**
19  * DOC: target_if_pmo_arp.c
20  *
21  * Target interface file for pmo component to
22  * send arp offload related cmd and process event.
23  */
24 
25 #include "target_if.h"
26 #include "target_if_pmo.h"
27 #include "wmi_unified_api.h"
28 
target_if_pmo_send_arp_offload_req(struct wlan_objmgr_vdev * vdev,struct pmo_arp_offload_params * arp_offload_req,struct pmo_ns_offload_params * ns_offload_req)29 QDF_STATUS target_if_pmo_send_arp_offload_req(
30 		struct wlan_objmgr_vdev *vdev,
31 		struct pmo_arp_offload_params *arp_offload_req,
32 		struct pmo_ns_offload_params *ns_offload_req)
33 {
34 	uint8_t vdev_id;
35 	struct wlan_objmgr_psoc *psoc;
36 	QDF_STATUS status;
37 	wmi_unified_t wmi_handle;
38 
39 	if (!vdev) {
40 		target_if_err("vdev ptr passed is NULL");
41 		return QDF_STATUS_E_INVAL;
42 	}
43 
44 	psoc = wlan_vdev_get_psoc(vdev);
45 	vdev_id = wlan_vdev_get_id(vdev);
46 	if (!psoc) {
47 		target_if_err("psoc handle is NULL");
48 		return QDF_STATUS_E_INVAL;
49 	}
50 
51 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
52 	if (!wmi_handle) {
53 		target_if_err("Invalid wmi handle");
54 		return QDF_STATUS_E_INVAL;
55 	}
56 
57 	status = wmi_unified_enable_arp_ns_offload_cmd(wmi_handle,
58 						       arp_offload_req,
59 						       ns_offload_req,
60 						       vdev_id);
61 	if (status != QDF_STATUS_SUCCESS)
62 		target_if_err("Failed to enable ARP NDP/NSffload");
63 
64 	return status;
65 }
66 
67 
68