cdp_txrx_fse.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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. #ifndef _CDP_TXRX_FSE_H_
  19. #define _CDP_TXRX_FSE_H_
  20. #include <cdp_txrx_cmn_struct.h>
  21. #include <cdp_txrx_cmn.h>
  22. #ifdef WLAN_SUPPORT_RX_FLOW_TAG
  23. static inline QDF_STATUS
  24. cdp_fse_flow_add(ol_txrx_soc_handle soc,
  25. uint32_t *src_ip, uint32_t src_port,
  26. uint32_t *dest_ip, uint32_t dest_port,
  27. uint8_t protocol, uint8_t version)
  28. {
  29. if (!soc || !soc->ops) {
  30. dp_cdp_debug("Invalid Instance");
  31. QDF_BUG(0);
  32. return QDF_STATUS_E_FAILURE;
  33. }
  34. if (!soc->ops->fse_ops ||
  35. !soc->ops->fse_ops->fse_rule_add) {
  36. return QDF_STATUS_E_FAILURE;
  37. }
  38. return soc->ops->fse_ops->fse_rule_add(soc,
  39. src_ip, src_port,
  40. dest_ip, dest_port,
  41. protocol, version);
  42. }
  43. static inline QDF_STATUS
  44. cdp_fse_flow_delete(ol_txrx_soc_handle soc,
  45. uint32_t *src_ip, uint32_t src_port,
  46. uint32_t *dest_ip, uint32_t dest_port,
  47. uint8_t protocol, uint8_t version)
  48. {
  49. if (!soc || !soc->ops) {
  50. dp_cdp_debug("Invalid Instance");
  51. QDF_BUG(0);
  52. return QDF_STATUS_E_FAILURE;
  53. }
  54. if (!soc->ops->fse_ops ||
  55. !soc->ops->fse_ops->fse_rule_delete) {
  56. return QDF_STATUS_E_FAILURE;
  57. }
  58. return soc->ops->fse_ops->fse_rule_delete(soc,
  59. src_ip, src_port,
  60. dest_ip, dest_port,
  61. protocol, version);
  62. }
  63. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  64. #endif /* _CDP_TXRX_FSE_H_ */