xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_wds.h (revision e226cebdd2ec2ac7fa21fdaaf5f22e7edcf3c812)
1 /*
2  * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
3  *
4  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5  *
6  *
7  * Permission to use, copy, modify, and/or distribute this software for
8  * any purpose with or without fee is hereby granted, provided that the
9  * above copyright notice and this permission notice appear in all
10  * copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19  * PERFORMANCE OF THIS SOFTWARE.
20  */
21 
22 /*
23  * This file was originally distributed by Qualcomm Atheros, Inc.
24  * under proprietary terms before Copyright ownership was assigned
25  * to the Linux Foundation.
26  */
27  /**
28  * @file cdp_txrx_wds.h
29  * @brief Define the host data path WDS API functions
30  * called by the host control SW and the OS interface module
31  */
32 #ifndef _CDP_TXRX_WDS_H_
33 #define _CDP_TXRX_WDS_H_
34 #include "cdp_txrx_handle.h"
35 /**
36  * @brief set the wds rx filter policy of the device
37  * @details
38  *  This flag sets the wds rx policy on the vdev. Rx frames not compliant
39  *  with the policy will be dropped.
40  *
41  * @param vdev - the data virtual device object
42  * @param val - the wds rx policy bitmask
43  * @return - void
44  */
45 static inline void
46 cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
47 	struct cdp_vdev *vdev,
48 	u_int32_t val)
49 {
50 	if (!soc || !soc->ops || !soc->ops->wds_ops) {
51 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
52 			"%s invalid instance", __func__);
53 		return;
54 	}
55 
56 	if (soc->ops->wds_ops->txrx_set_wds_rx_policy)
57 		return soc->ops->wds_ops->txrx_set_wds_rx_policy(vdev, val);
58 	return;
59 }
60 
61 /**
62  * cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev
63  * @soc - data path soc handle
64  * @vdev - data path vap handle
65  * @val - value to be set in wds_en flag
66  *
67  *  This flag enables WDS source port learning feature on a vdev
68  *
69  * return 1 on success
70  */
71 static inline int
72 cdp_vdev_set_wds(ol_txrx_soc_handle soc, void *vdev, uint32_t val)
73 {
74 	if (soc->ops->wds_ops->vdev_set_wds)
75 		return soc->ops->wds_ops->vdev_set_wds(vdev, val);
76 	return 0;
77 }
78 #endif
79