txrx.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef TXRX_H
  27. #define TXRX_H
  28. #include "cds_api.h"
  29. #include "qdf_nbuf.h"
  30. #include "csr_api.h"
  31. #include "sap_api.h"
  32. #include "ol_txrx_osif_api.h"
  33. /* wait on peer deletion timeout value in milliseconds */
  34. #define PEER_DELETION_TIMEOUT 500
  35. enum txrx_wmm_ac {
  36. TXRX_WMM_AC_VO,
  37. TXRX_WMM_AC_VI,
  38. TXRX_WMM_AC_BK,
  39. TXRX_WMM_AC_BE,
  40. TXRX_NUM_WMM_AC
  41. };
  42. struct txrx_rx_metainfo {
  43. u8 up;
  44. u16 dest_staid;
  45. };
  46. enum bt_frame_type {
  47. /* BT-AMP packet of type data */
  48. TXRX_BT_AMP_TYPE_DATA = 0x0001,
  49. /* BT-AMP packet of type activity report */
  50. TXRX_BT_AMP_TYPE_AR = 0x0002,
  51. /* BT-AMP packet of type security frame */
  52. TXRX_BT_AMP_TYPE_SEC = 0x0003,
  53. /* BT-AMP packet of type Link Supervision request frame */
  54. TXRX_BT_AMP_TYPE_LS_REQ = 0x0004,
  55. /* BT-AMP packet of type Link Supervision reply frame */
  56. TXRX_BT_AMP_TYPE_LS_REP = 0x0005,
  57. /* Invalid Frame */
  58. TXRX_BAP_INVALID_FRAME
  59. };
  60. enum wlan_ts_direction {
  61. /* uplink */
  62. WLAN_TX_DIR = 0,
  63. /* downlink */
  64. WLAN_RX_DIR = 1,
  65. /*bidirectional */
  66. WLAN_BI_DIR = 2,
  67. };
  68. enum wlan_sta_state {
  69. /* Transition in this state made upon creation */
  70. WLAN_STA_INIT = 0,
  71. /* Transition happens after Assoc success if second level authentication
  72. is needed */
  73. WLAN_STA_CONNECTED,
  74. /* Transition happens when second level auth is successful and keys are
  75. properly installed */
  76. WLAN_STA_AUTHENTICATED,
  77. /* Transition happens when connectivity is lost */
  78. WLAN_STA_DISCONNECTED,
  79. WLAN_STA_MAX_STATE
  80. };
  81. struct wlan_txrx_stats {
  82. /* Define various txrx stats here */
  83. };
  84. struct ol_txrx_vdev_t;
  85. QDF_STATUS wlan_register_mgmt_client(void *pdev_txrx,
  86. QDF_STATUS (*rx_mgmt)(void *g_cdsctx,
  87. void *buf));
  88. /* If RSSI realm is changed, send notification to Clients, SME, HDD */
  89. typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi,
  90. void *usr_ctx,
  91. int8_t avg_rssi);
  92. struct wlan_txrx_ind_req {
  93. u16 msgType; /* message type is same as the request type */
  94. u16 msgLen; /* length of the entire request */
  95. u8 sessionId; /* sme Session Id */
  96. u8 rssiNotification;
  97. u8 avgRssi;
  98. void *tlCallback;
  99. void *pAdapter;
  100. void *pUserCtxt;
  101. };
  102. /* Rx callback registered with txrx */
  103. typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id,
  104. struct txrx_rx_metainfo *rx_meta_info);
  105. static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi)
  106. {
  107. return 0;
  108. }
  109. static inline int wlan_txrx_enable_uapsd_ac(void *g_cdsctx, u8 sta_id,
  110. enum txrx_wmm_ac ac, u8 tid, u8 up,
  111. u32 srv_int, u32 suspend_int,
  112. enum wlan_ts_direction ts_dir)
  113. {
  114. return 0;
  115. }
  116. static inline int wlan_txrx_disable_uapsd_ac(void *g_cdsctx, u8 sta_id,
  117. enum txrx_wmm_ac ac)
  118. {
  119. return 0;
  120. }
  121. static inline int wlan_change_sta_state(void *g_cdsctx, u8 sta_id,
  122. enum wlan_sta_state state)
  123. {
  124. return 0;
  125. }
  126. static inline int wlan_deregister_mgmt_client(void *g_cdsctx)
  127. {
  128. return 0;
  129. }
  130. static inline void wlan_assoc_failed(u8 staid)
  131. {
  132. }
  133. static inline int wlan_get_ap_stats(void *g_cdsctx, tSap_SoftapStats *buf,
  134. bool reset)
  135. {
  136. return 0;
  137. }
  138. static inline int wlan_get_txrx_stats(void *g_cdsctx,
  139. struct wlan_txrx_stats *stats, u8 sta_id)
  140. {
  141. return 0;
  142. }
  143. static inline int wlan_txrx_update_rssi_bmps(void *g_cdsctx, u8 sta_id,
  144. int8_t rssi)
  145. {
  146. return 0;
  147. }
  148. static inline int wlan_txrx_deregister_rssi_indcb(void *g_cdsctx,
  149. int8_t rssi_val,
  150. u8 trigger_event,
  151. wlan_txrx_rssi_cross_thresh
  152. cb, int mod_id)
  153. {
  154. return 0;
  155. }
  156. static inline int wlan_txrx_register_rssi_indcb(void *g_cdsctx,
  157. int8_t rssi_val,
  158. u8 trigger_event,
  159. wlan_txrx_rssi_cross_thresh cb,
  160. int mod_id, void *usr_ctx)
  161. {
  162. return 0;
  163. }
  164. /* FIXME: The following stubs will be removed eventually */
  165. static inline int wlan_txrx_mc_process_msg(void *g_cdsctx, cds_msg_t *msg)
  166. {
  167. return 0;
  168. }
  169. static inline int wlan_txrx_tx_process_msg(void *g_cdsctx, cds_msg_t *msg)
  170. {
  171. return 0;
  172. }
  173. static inline void wlan_txrx_mc_free_msg(void *g_cdsctx, cds_msg_t *msg)
  174. {
  175. }
  176. static inline void wlan_txrx_tx_free_msg(void *g_cdsctx, cds_msg_t *msg)
  177. {
  178. }
  179. #endif