blob: 24c253f03540c6eb82dfdfecdd789dd438c2f325 [file] [log] [blame]
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07001/*
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +05302 * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07003 *
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07004 * 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
Yun Park178b9f32017-04-03 08:22:53 -070019/**
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070020 * @file cdp_txrx_wds.h
21 * @brief Define the host data path WDS API functions
22 * called by the host control SW and the OS interface module
23 */
24#ifndef _CDP_TXRX_WDS_H_
25#define _CDP_TXRX_WDS_H_
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080026#include "cdp_txrx_handle.h"
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070027/**
28 * @brief set the wds rx filter policy of the device
29 * @details
30 * This flag sets the wds rx policy on the vdev. Rx frames not compliant
31 * with the policy will be dropped.
32 *
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053033 * @param vdev_id - id of the data virtual device object
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070034 * @param val - the wds rx policy bitmask
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053035 * @return - QDF_STATUS
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070036 */
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053037static inline QDF_STATUS
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053038cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053039 uint8_t vdev_id,
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053040 u_int32_t val)
41{
Leo Changdb6358c2016-09-27 17:00:52 -070042 if (!soc || !soc->ops || !soc->ops->wds_ops) {
43 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
44 "%s invalid instance", __func__);
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053045 return QDF_STATUS_E_FAILURE;
Leo Changdb6358c2016-09-27 17:00:52 -070046 }
47
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053048 if (soc->ops->wds_ops->txrx_set_wds_rx_policy)
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053049 soc->ops->wds_ops->txrx_set_wds_rx_policy(soc, vdev_id, val);
50 return QDF_STATUS_SUCCESS;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053051}
52
Karunakar Dasinenica792542017-01-16 10:08:58 -080053/**
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053054 * @brief set the wds rx filter policy of the device
55 * @details
56 * This flag sets the wds rx policy on the vdev. Rx frames not compliant
57 * with the policy will be dropped.
58 *
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053059 * @param psoc - psoc object
60 * @param vdev_id - id of the data virtual device object
61 * @param peer_mac - peer mac address
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053062 * @param val - the wds rx policy bitmask
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053063 * @return - QDF_STATUS
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053064 */
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053065static inline QDF_STATUS
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053066cdp_set_wds_tx_policy_update(ol_txrx_soc_handle soc,
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053067 uint8_t vdev_id, uint8_t *peer_mac,
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053068 int wds_tx_ucast, int wds_tx_mcast)
69{
70 if (!soc || !soc->ops || !soc->ops->wds_ops) {
71 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
72 "%s invalid instance", __func__);
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053073 return QDF_STATUS_E_FAILURE;
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053074 }
75
76 if (soc->ops->wds_ops->txrx_wds_peer_tx_policy_update)
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053077 soc->ops->wds_ops->txrx_wds_peer_tx_policy_update(
78 soc, vdev_id, peer_mac, wds_tx_ucast,
79 wds_tx_mcast);
80 return QDF_STATUS_SUCCESS;
Tallapragada Kalyan2a5fc622017-12-08 21:07:43 +053081}
82
83/**
Karunakar Dasinenica792542017-01-16 10:08:58 -080084 * cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev
85 * @soc - data path soc handle
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053086 * @vdev_id - id of data path vap handle
Karunakar Dasinenica792542017-01-16 10:08:58 -080087 * @val - value to be set in wds_en flag
88 *
89 * This flag enables WDS source port learning feature on a vdev
90 *
91 * return 1 on success
92 */
93static inline int
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053094cdp_vdev_set_wds(ol_txrx_soc_handle soc, uint8_t vdev_id, uint32_t val)
Karunakar Dasinenica792542017-01-16 10:08:58 -080095{
96 if (soc->ops->wds_ops->vdev_set_wds)
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053097 return soc->ops->wds_ops->vdev_set_wds(soc, vdev_id, val);
Karunakar Dasinenica792542017-01-16 10:08:58 -080098 return 0;
99}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700100#endif