hal_rx_flow_info.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2019-2020 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. #ifndef __HAL_RX_FLOW_DEFINES_H
  19. #define __HAL_RX_FLOW_DEFINES_H
  20. #define HAL_FST_HASH_KEY_SIZE_BYTES 40
  21. #define HAL_OFFSET(block, field) block ## _ ## field ## _OFFSET
  22. #define HAL_RX_FST_ENTRY_SIZE (NUM_OF_DWORDS_RX_FLOW_SEARCH_ENTRY * 4)
  23. /**
  24. * struct hal_rx_flow - Rx Flow parameters to be sent to HW
  25. * @tuple_info: Rx Flow 5-tuple (src & dest IP, src & dest ports, L4 protocol)
  26. * @reo_destination_handler: REO destination for this flow
  27. * @reo_destination_indication: REO indication for this flow
  28. * @fse_metadata: Flow metadata or tag passed to HW for marking packets
  29. */
  30. struct hal_rx_flow {
  31. struct hal_flow_tuple_info tuple_info;
  32. uint8_t reo_destination_handler;
  33. uint8_t reo_destination_indication;
  34. uint32_t fse_metadata;
  35. };
  36. /**
  37. * struct hal_rx_fst - HAL RX Flow search table context
  38. * @base_vaddr: Virtual Base address of HW FST
  39. * @base_paddr: Physical Base address of HW FST
  40. * @key: Pointer to 320-bit Key read from cfg
  41. * @shifted_key: Pointer to left-shifted 320-bit Key used for Toeplitz Hash
  42. * @max_entries : Max number of entries in flow searchh table
  43. * @max_skid_length : Max search length if there is hash collision
  44. * @hash_mask: Hash mask to apply to index into FST
  45. * @key_cache: Toepliz Key Cache configured key
  46. * @add_flow_count: Add flow count
  47. * @del_flow_count: Delete flow count
  48. */
  49. struct hal_rx_fst {
  50. uint8_t *base_vaddr;
  51. qdf_dma_addr_t base_paddr;
  52. uint8_t *key;
  53. #ifndef WLAN_SUPPORT_RX_FISA
  54. uint8_t shifted_key[HAL_FST_HASH_KEY_SIZE_BYTES];
  55. uint32_t key_cache[HAL_FST_HASH_KEY_SIZE_BYTES][1 << 8];
  56. #endif
  57. uint16_t max_entries;
  58. uint16_t max_skid_length;
  59. uint16_t hash_mask;
  60. uint32_t add_flow_count;
  61. uint32_t del_flow_count;
  62. };
  63. #endif /* HAL_RX_FLOW_DEFINES_H */