Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 1 | /* |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 2 | * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved. |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 3 | * |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 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 | |
Yun Park | 178b9f3 | 2017-04-03 08:22:53 -0700 | [diff] [blame] | 19 | /** |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 20 | * @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 Manchala | f2a125a | 2016-11-28 18:10:11 -0800 | [diff] [blame] | 26 | #include "cdp_txrx_handle.h" |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 27 | /** |
| 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 Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 33 | * @param vdev_id - id of the data virtual device object |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 34 | * @param val - the wds rx policy bitmask |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 35 | * @return - QDF_STATUS |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 36 | */ |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 37 | static inline QDF_STATUS |
Nandha Kishore Easwaran | e5444bc | 2016-10-20 13:23:23 +0530 | [diff] [blame] | 38 | cdp_set_wds_rx_policy(ol_txrx_soc_handle soc, |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 39 | uint8_t vdev_id, |
Nandha Kishore Easwaran | e5444bc | 2016-10-20 13:23:23 +0530 | [diff] [blame] | 40 | u_int32_t val) |
| 41 | { |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 42 | 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 Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 45 | return QDF_STATUS_E_FAILURE; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Nandha Kishore Easwaran | e5444bc | 2016-10-20 13:23:23 +0530 | [diff] [blame] | 48 | if (soc->ops->wds_ops->txrx_set_wds_rx_policy) |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 49 | soc->ops->wds_ops->txrx_set_wds_rx_policy(soc, vdev_id, val); |
| 50 | return QDF_STATUS_SUCCESS; |
Nandha Kishore Easwaran | e5444bc | 2016-10-20 13:23:23 +0530 | [diff] [blame] | 51 | } |
| 52 | |
Karunakar Dasineni | ca79254 | 2017-01-16 10:08:58 -0800 | [diff] [blame] | 53 | /** |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 54 | * @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 Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 59 | * @param psoc - psoc object |
| 60 | * @param vdev_id - id of the data virtual device object |
| 61 | * @param peer_mac - peer mac address |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 62 | * @param val - the wds rx policy bitmask |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 63 | * @return - QDF_STATUS |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 64 | */ |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 65 | static inline QDF_STATUS |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 66 | cdp_set_wds_tx_policy_update(ol_txrx_soc_handle soc, |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 67 | uint8_t vdev_id, uint8_t *peer_mac, |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 68 | 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 Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 73 | return QDF_STATUS_E_FAILURE; |
Tallapragada Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | if (soc->ops->wds_ops->txrx_wds_peer_tx_policy_update) |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 77 | 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 Kalyan | 2a5fc62 | 2017-12-08 21:07:43 +0530 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | /** |
Karunakar Dasineni | ca79254 | 2017-01-16 10:08:58 -0800 | [diff] [blame] | 84 | * cdp_vdev_set_wds() - Set/unset wds_enable flag in vdev |
| 85 | * @soc - data path soc handle |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 86 | * @vdev_id - id of data path vap handle |
Karunakar Dasineni | ca79254 | 2017-01-16 10:08:58 -0800 | [diff] [blame] | 87 | * @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 | */ |
| 93 | static inline int |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 94 | cdp_vdev_set_wds(ol_txrx_soc_handle soc, uint8_t vdev_id, uint32_t val) |
Karunakar Dasineni | ca79254 | 2017-01-16 10:08:58 -0800 | [diff] [blame] | 95 | { |
| 96 | if (soc->ops->wds_ops->vdev_set_wds) |
Pavankumar Nandeshwar | e54c584 | 2019-09-29 16:01:09 +0530 | [diff] [blame] | 97 | return soc->ops->wds_ops->vdev_set_wds(soc, vdev_id, val); |
Karunakar Dasineni | ca79254 | 2017-01-16 10:08:58 -0800 | [diff] [blame] | 98 | return 0; |
| 99 | } |
Dhanashri Atre | fe5662c | 2016-03-25 12:57:53 -0700 | [diff] [blame] | 100 | #endif |