xref: /wlan-driver/qcacld-3.0/components/target_if/pmo/src/target_if_pmo_hw_filter.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_non_arp_bcast_fltr.c
20  *
21  * Target interface file for pmo component to
22  * send non arp hw bcast filtering 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 #include "wlan_pmo_hw_filter_public_struct.h"
29 
target_if_pmo_conf_hw_filter(struct wlan_objmgr_psoc * psoc,struct pmo_hw_filter_params * req)30 QDF_STATUS target_if_pmo_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
31 					struct pmo_hw_filter_params *req)
32 {
33 	QDF_STATUS status;
34 	wmi_unified_t wmi_handle;
35 
36 	if (!psoc) {
37 		target_if_err("psoc is NULL");
38 		return QDF_STATUS_E_INVAL;
39 	}
40 
41 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
42 	if (!wmi_handle) {
43 		target_if_err("Invalid wmi handle");
44 		return QDF_STATUS_E_INVAL;
45 	}
46 
47 	status = wmi_unified_conf_hw_filter_cmd(wmi_handle, req);
48 
49 	if (QDF_IS_STATUS_ERROR(status))
50 		target_if_err("Failed to configure HW Filter");
51 
52 	return status;
53 }
54