dp_internal.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (c) 2016 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 _DP_INTERNAL_H_
  19. #define _DP_INTERNAL_H_
  20. #if DP_PRINT_ENABLE
  21. #include <stdarg.h> /* va_list */
  22. #include <qdf_types.h> /* qdf_vprint */
  23. enum {
  24. /* FATAL_ERR - print only irrecoverable error messages */
  25. DP_PRINT_LEVEL_FATAL_ERR,
  26. /* ERR - include non-fatal err messages */
  27. DP_PRINT_LEVEL_ERR,
  28. /* WARN - include warnings */
  29. DP_PRINT_LEVEL_WARN,
  30. /* INFO1 - include fundamental, infrequent events */
  31. DP_PRINT_LEVEL_INFO1,
  32. /* INFO2 - include non-fundamental but infrequent events */
  33. DP_PRINT_LEVEL_INFO2,
  34. };
  35. #define dp_print(level, fmt, ...) do { \
  36. if (level <= g_txrx_print_level) \
  37. qdf_print(fmt, ## __VA_ARGS__); \
  38. while (0)
  39. #define DP_PRINT(level, fmt, ...) do { \
  40. dp_print(level, "DP: " fmt, ## __VA_ARGS__); \
  41. while (0)
  42. #else
  43. #define DP_PRINT(level, fmt, ...)
  44. #endif /* DP_PRINT_ENABLE */
  45. extern int dp_peer_find_attach(struct dp_soc *soc);
  46. extern void dp_peer_find_detach(struct dp_soc *soc);
  47. extern void dp_peer_find_hash_add(struct dp_soc *soc, struct dp_peer *peer);
  48. extern void dp_peer_find_hash_remove(struct dp_soc *soc, struct dp_peer *peer);
  49. extern void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer);
  50. extern void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
  51. extern void dp_peer_unref_delete(void *peer_handle);
  52. extern void dp_rx_discard(struct dp_vdev *vdev, struct dp_peer *peer,
  53. unsigned tid, qdf_nbuf_t msdu_list);
  54. extern void *dp_find_peer_by_addr(void *dev,
  55. uint8_t *peer_mac_addr, uint8_t *peer_id);
  56. #ifndef CONFIG_WIN
  57. QDF_STATUS dp_register_peer(void *pdev_handle,
  58. struct ol_txrx_desc_type *sta_desc);
  59. QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id);
  60. void *dp_find_peer_by_addr_and_vdev(void *pdev_handle, void *vdev,
  61. uint8_t *peer_addr, uint8_t *local_id);
  62. uint16_t dp_local_peer_id(void *peer);
  63. void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id);
  64. QDF_STATUS dp_peer_state_update(void *pdev_handle, uint8_t *peer_mac,
  65. enum ol_txrx_peer_state state);
  66. QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id);
  67. void *dp_get_vdev_for_peer(void *peer);
  68. uint8_t *dp_peer_get_peer_mac_addr(void *peer);
  69. int dp_get_peer_state(void *peer_handle);
  70. void dp_local_peer_id_pool_init(struct dp_pdev *pdev);
  71. void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer);
  72. void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer);
  73. #endif
  74. extern int dp_addba_requestprocess_wifi3(void *peer_handle,
  75. uint8_t dialogtoken, uint16_t tid, uint16_t batimeout,
  76. uint16_t buffersize, uint16_t startseqnum);
  77. extern void dp_addba_responsesetup_wifi3(void *peer_handle, uint8_t tid,
  78. uint8_t *dialogtoken, uint16_t *statuscode,
  79. uint16_t *buffersize, uint16_t *batimeout);
  80. extern int dp_delba_process_wifi3(void *peer_handle,
  81. int tid, uint16_t reasoncode);
  82. #endif /* #ifndef _DP_INTERNAL_H_ */