txrx.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * Copyright (c) 2013-2017 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 TXRX_H
  19. #define TXRX_H
  20. #include "cds_api.h"
  21. #include "qdf_nbuf.h"
  22. #include "csr_api.h"
  23. #include "sap_api.h"
  24. #include "ol_txrx_osif_api.h"
  25. /* wait on peer deletion timeout value in milliseconds */
  26. #define PEER_DELETION_TIMEOUT 500
  27. enum txrx_wmm_ac {
  28. TXRX_WMM_AC_BE,
  29. TXRX_WMM_AC_BK,
  30. TXRX_WMM_AC_VI,
  31. TXRX_WMM_AC_VO,
  32. TXRX_NUM_WMM_AC
  33. };
  34. struct txrx_rx_metainfo {
  35. u8 up;
  36. u16 dest_staid;
  37. };
  38. enum bt_frame_type {
  39. /* BT-AMP packet of type data */
  40. TXRX_BT_AMP_TYPE_DATA = 0x0001,
  41. /* BT-AMP packet of type activity report */
  42. TXRX_BT_AMP_TYPE_AR = 0x0002,
  43. /* BT-AMP packet of type security frame */
  44. TXRX_BT_AMP_TYPE_SEC = 0x0003,
  45. /* BT-AMP packet of type Link Supervision request frame */
  46. TXRX_BT_AMP_TYPE_LS_REQ = 0x0004,
  47. /* BT-AMP packet of type Link Supervision reply frame */
  48. TXRX_BT_AMP_TYPE_LS_REP = 0x0005,
  49. /* Invalid Frame */
  50. TXRX_BAP_INVALID_FRAME
  51. };
  52. enum wlan_ts_direction {
  53. /* uplink */
  54. WLAN_TX_DIR = 0,
  55. /* downlink */
  56. WLAN_RX_DIR = 1,
  57. /*bidirectional */
  58. WLAN_BI_DIR = 2,
  59. };
  60. enum wlan_sta_state {
  61. /* Transition in this state made upon creation */
  62. WLAN_STA_INIT = 0,
  63. /*
  64. * Transition happens after Assoc success if second level authentication
  65. * is needed
  66. */
  67. WLAN_STA_CONNECTED,
  68. /*
  69. * Transition happens when second level auth is successful and keys are
  70. * properly installed
  71. */
  72. WLAN_STA_AUTHENTICATED,
  73. /* Transition happens when connectivity is lost */
  74. WLAN_STA_DISCONNECTED,
  75. WLAN_STA_MAX_STATE
  76. };
  77. struct wlan_txrx_stats {
  78. /* Define various txrx stats here */
  79. };
  80. struct ol_txrx_vdev_t;
  81. QDF_STATUS wlan_register_mgmt_client(void *pdev_txrx,
  82. QDF_STATUS (*rx_mgmt)(void *g_cdsctx,
  83. void *buf));
  84. /* If RSSI realm is changed, send notification to Clients, SME, HDD */
  85. typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi,
  86. void *usr_ctx,
  87. int8_t avg_rssi);
  88. /* Rx callback registered with txrx */
  89. typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id,
  90. struct txrx_rx_metainfo *rx_meta_info);
  91. static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi)
  92. {
  93. return 0;
  94. }
  95. static inline int wlan_txrx_enable_uapsd_ac(void *g_cdsctx, u8 sta_id,
  96. enum txrx_wmm_ac ac, u8 tid, u8 up,
  97. u32 srv_int, u32 suspend_int,
  98. enum wlan_ts_direction ts_dir)
  99. {
  100. return 0;
  101. }
  102. static inline int wlan_txrx_disable_uapsd_ac(void *g_cdsctx, u8 sta_id,
  103. enum txrx_wmm_ac ac)
  104. {
  105. return 0;
  106. }
  107. static inline int wlan_change_sta_state(void *g_cdsctx, u8 sta_id,
  108. enum wlan_sta_state state)
  109. {
  110. return 0;
  111. }
  112. static inline int wlan_deregister_mgmt_client(void *g_cdsctx)
  113. {
  114. return 0;
  115. }
  116. static inline void wlan_assoc_failed(u8 staid)
  117. {
  118. }
  119. static inline int wlan_get_ap_stats(void *g_cdsctx, tSap_SoftapStats *buf,
  120. bool reset)
  121. {
  122. return 0;
  123. }
  124. static inline int wlan_get_txrx_stats(void *g_cdsctx,
  125. struct wlan_txrx_stats *stats, u8 sta_id)
  126. {
  127. return 0;
  128. }
  129. static inline int wlan_txrx_update_rssi_bmps(void *g_cdsctx, u8 sta_id,
  130. int8_t rssi)
  131. {
  132. return 0;
  133. }
  134. static inline int wlan_txrx_deregister_rssi_indcb(void *g_cdsctx,
  135. int8_t rssi_val,
  136. u8 trigger_event,
  137. wlan_txrx_rssi_cross_thresh
  138. cb, int mod_id)
  139. {
  140. return 0;
  141. }
  142. static inline int wlan_txrx_register_rssi_indcb(void *g_cdsctx,
  143. int8_t rssi_val,
  144. u8 trigger_event,
  145. wlan_txrx_rssi_cross_thresh cb,
  146. int mod_id, void *usr_ctx)
  147. {
  148. return 0;
  149. }
  150. #endif