xref: /wlan-driver/qcacld-3.0/components/pmo/dispatcher/src/wlan_pmo_tgt_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 /**
20  * DOC: Implements public API for pmo to interact with target/WMI
21  */
22 
23 #include "wlan_pmo_tgt_api.h"
24 #include "wlan_pmo_hw_filter_public_struct.h"
25 #include "wlan_pmo_obj_mgmt_public_struct.h"
26 #include "wlan_pmo_main.h"
27 
pmo_tgt_conf_hw_filter(struct wlan_objmgr_psoc * psoc,struct pmo_hw_filter_params * req)28 QDF_STATUS pmo_tgt_conf_hw_filter(struct wlan_objmgr_psoc *psoc,
29 				  struct pmo_hw_filter_params *req)
30 {
31 	QDF_STATUS status;
32 	struct wlan_pmo_tx_ops ops;
33 
34 	pmo_enter();
35 
36 	pmo_debug("Send %s hw filter mode 0x%X for vdev_id %u",
37 		  req->enable ? "Enable" : "Disable", req->mode_bitmap,
38 		  req->vdev_id);
39 
40 	ops = GET_PMO_TX_OPS_FROM_PSOC(psoc);
41 	if (!ops.send_conf_hw_filter_req) {
42 		pmo_err("send_conf_hw_filter_req is null");
43 		status = QDF_STATUS_E_NULL_VALUE;
44 		goto exit_with_status;
45 	}
46 
47 	status = ops.send_conf_hw_filter_req(psoc, req);
48 
49 exit_with_status:
50 	pmo_exit();
51 
52 	return status;
53 }
54 
55