qca_multi_link.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * Copyright (c) 2020 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 __qca_multi_link_H_
  17. #define __qca_multi_link_H_
  18. #include <qdf_nbuf.h>
  19. #include <qdf_module.h>
  20. #include <qdf_list.h>
  21. #include <qdf_util.h>
  22. #include <linux/netdevice.h>
  23. #include <linux/etherdevice.h>
  24. #include <linux/wireless.h>
  25. #include <net/cfg80211.h>
  26. #include <br_private.h>
  27. #include <ieee80211.h>
  28. #include <ieee80211_defines.h>
  29. #include <qca_multi_link_tbl.h>
  30. #include "if_upperproto.h"
  31. #define QCA_MULTI_LINK_FAST_LANE_LIST_SIZE 6
  32. #define QCA_MULTI_LINK_NO_BACKHAUL_LIST_SIZE 32
  33. /**
  34. * qca_multi_link_needs_enq - rptr return status
  35. * @QCA_MULTI_LINK_ALLOW_VAP_ENQ: Allow the packet to be enqueued
  36. * @QCA_MULTI_LINK_SKIP_VAP_ENQ: SKIP the enqueue
  37. */
  38. typedef enum qca_multi_link_needs_enq {
  39. QCA_MULTI_LINK_ALLOW_VAP_ENQ = 0,
  40. QCA_MULTI_LINK_SKIP_VAP_ENQ,
  41. } qca_multi_link_needs_enq_t;
  42. /**
  43. * enum qca_multi_link_status - rptr return status
  44. * @qca_multi_link_PKT_ALLOW: Allow the packet to be received or transmitted
  45. * @qca_multi_link_PKT_DROP: Drop the packet
  46. * @qca_multi_link_PKT_CONSUMED: The packet is consumed in the repeater processing
  47. */
  48. typedef enum qca_multi_link_status {
  49. QCA_MULTI_LINK_PKT_NONE = 0,
  50. QCA_MULTI_LINK_PKT_ALLOW,
  51. QCA_MULTI_LINK_PKT_DROP,
  52. QCA_MULTI_LINK_PKT_CONSUMED
  53. } qca_multi_link_status_t;
  54. /**
  55. * struct qca_multi_link_list_node - rptr list node
  56. * @list: linked list node
  57. * @wiphy: wiphy pointer
  58. */
  59. struct qca_multi_link_list_node {
  60. qdf_list_node_t node;
  61. struct wiphy *wiphy;
  62. };
  63. typedef struct qca_multi_link_parameters {
  64. bool rptr_processing_enable;
  65. bool loop_detected;
  66. bool always_primary;
  67. bool force_client_mcast_traffic;
  68. bool drop_secondary_mcast;
  69. struct wiphy *primary_wiphy;
  70. uint8_t total_stavaps_up;
  71. qdf_list_t no_backhaul_list;
  72. qdf_list_t fast_lane_list;
  73. } qca_multi_link_parameters_t;
  74. void qca_multi_link_init_module(void);
  75. void qca_multi_link_deinit_module(void);
  76. uint8_t qca_multi_link_get_num_sta(void);
  77. void qca_multi_link_append_num_sta(bool inc_or_dec);
  78. bool qca_multi_link_is_dbdc_processing_reqd(struct net_device *net_dev);
  79. void qca_multi_link_set_drop_sec_mcast(bool val);
  80. void qca_multi_link_set_force_client_mcast(bool val);
  81. void qca_multi_link_set_always_primary(bool val);
  82. void qca_multi_link_set_dbdc_enable(bool val);
  83. struct wiphy *qca_multi_link_get_primary_radio(void);
  84. void qca_multi_link_set_primary_radio(struct wiphy *primary_wiphy);
  85. bool qca_multi_link_add_fastlane_radio(struct wiphy *fl_wiphy);
  86. bool qca_multi_link_remove_fastlane_radio(struct wiphy *fl_wiphy);
  87. bool qca_multi_link_add_no_backhaul_radio(struct wiphy *no_bl_wiphy);
  88. bool qca_multi_link_remove_no_backhaul_radio(struct wiphy *no_bl_wiphy);
  89. bool qca_multi_link_ap_rx(struct net_device *net_dev, qdf_nbuf_t nbuf);
  90. bool qca_multi_link_sta_rx(struct net_device *net_dev, qdf_nbuf_t nbuf,
  91. qca_multi_link_needs_enq_t allow_vap_enq);
  92. bool qca_multi_link_sta_tx(struct net_device *net_dev, qdf_nbuf_t nbuf);
  93. #endif