dp_wrap_struct.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef _DP_WRAP_STRUCT_H_
  17. #define _DP_WRAP_STRUCT_H_
  18. #if ATH_SUPPORT_WRAP
  19. #if !WLAN_QWRAP_LEGACY
  20. #include <wbuf.h>
  21. #define WRAP_DEV_HASHSIZE 32 /*dev hash table size*/
  22. /*device table simple hash function*/
  23. #define WRAP_DEV_HASH(addr) \
  24. (((const u_int8_t *)(addr))[QDF_MAC_ADDR_SIZE - 1] % WRAP_DEV_HASHSIZE)
  25. #define qwrap_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_WRAP, ## params)
  26. #define qwrap_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_WRAP, ## params)
  27. #define qwrap_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_WRAP, ## params)
  28. #define qwrap_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_WRAP, ## params)
  29. #define qwrap_trace(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_WRAP, ## params)
  30. #define WRAP_ISOLATION_DEFVAL 0
  31. typedef rwlock_t wrap_devt_lock_t;
  32. /*wrap device table*/
  33. typedef struct dp_wrap_devt {
  34. struct dp_wrap_pdev *wrap_pdev;
  35. /*back ptr to wrap pdev*/
  36. wrap_devt_lock_t wdt_lock;
  37. /*lock for dev table*/
  38. TAILQ_HEAD(, dp_wrap_vdev) wdt_dev; /*head for device list*/
  39. ATH_LIST_HEAD(, dp_wrap_vdev) wdt_hash[WRAP_DEV_HASHSIZE];
  40. /*head for device hash*/
  41. TAILQ_HEAD(, dp_wrap_vdev) wdt_dev_vma; /*head for device list*/
  42. ATH_LIST_HEAD(, dp_wrap_vdev) wdt_hash_vma[WRAP_DEV_HASHSIZE];
  43. /*head for device hash*/
  44. } dp_wrap_devt_t;
  45. /*wrap pdev struct*/
  46. typedef struct dp_wrap_pdev {
  47. struct dp_wrap_devt wp_devt; /*wrap device table*/
  48. u_int8_t wp_isolation;
  49. int wp_use_cnt; /*wrap pdev use cnt*/
  50. struct wlan_objmgr_vdev *mpsta_vdev;
  51. struct wlan_objmgr_vdev *wrap_vdev;
  52. struct net_device *mpsta_dev;
  53. u_int8_t nwrapvaps; /* Number of active WRAP APs */
  54. u_int8_t npstavaps;
  55. } dp_pdev_wrap_t;
  56. /*wrap vdev struct*/
  57. typedef struct dp_wrap_vdev {
  58. struct dp_wrap_pdev *wrap_pdev; /*back ptr to wrap pdev*/
  59. struct net_device *dev;
  60. struct wlan_objmgr_vdev *vdev;
  61. bool is_wrap;
  62. bool is_mpsta;
  63. bool is_psta;
  64. bool is_wired_psta;
  65. bool mat_enabled;
  66. unsigned char wrap_dev_oma[ETH_ALEN]; /* dev oma mac address */
  67. unsigned char wrap_dev_vma[ETH_ALEN]; /* dev vma mac address */
  68. TAILQ_ENTRY(dp_wrap_vdev) wrap_dev_list; /*wrap oma dev list entry*/
  69. LIST_ENTRY(dp_wrap_vdev) wrap_dev_hash; /*wrap oma hash list entry*/
  70. TAILQ_ENTRY(dp_wrap_vdev) wrap_dev_list_vma; /*wrap vma dev list*/
  71. LIST_ENTRY(dp_wrap_vdev) wrap_dev_hash_vma; /*wrap vma hash list */
  72. void (*wlan_vdev_xmit_queue)(struct net_device *dev, wbuf_t wbuf);
  73. } dp_vdev_wrap_t;
  74. #endif
  75. #endif
  76. #endif