wdi_event.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright (c) 2013-2014 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 _WDI_EVENT_H_
  27. #define _WDI_EVENT_H_
  28. #include "athdefs.h"
  29. #include "cdf_nbuf.h"
  30. #define WDI_EVENT_BASE 0x100 /* Event starting number */
  31. enum WDI_EVENT {
  32. WDI_EVENT_TX_STATUS = WDI_EVENT_BASE,
  33. WDI_EVENT_RX_DESC,
  34. WDI_EVENT_RX_DESC_REMOTE,
  35. WDI_EVENT_RATE_FIND,
  36. WDI_EVENT_RATE_UPDATE,
  37. WDI_EVENT_RX_PEER_INVALID,
  38. /* End of new event items */
  39. WDI_EVENT_LAST
  40. };
  41. struct wdi_event_rx_peer_invalid_msg {
  42. cdf_nbuf_t msdu;
  43. struct ieee80211_frame *wh;
  44. uint8_t vdev_id;
  45. };
  46. #define WDI_NUM_EVENTS (WDI_EVENT_LAST - WDI_EVENT_BASE)
  47. #define WDI_EVENT_NOTIFY_BASE 0x200
  48. enum WDI_EVENT_NOTIFY {
  49. WDI_EVENT_SUB_DEALLOCATE = WDI_EVENT_NOTIFY_BASE,
  50. /* End of new notification types */
  51. WDI_EVENT_NOTIFY_LAST
  52. };
  53. /* Opaque event callback */
  54. typedef void (*wdi_event_cb)(void *pdev, enum WDI_EVENT event, void *data);
  55. /* Opaque event notify */
  56. typedef void (*wdi_event_notify)(enum WDI_EVENT_NOTIFY notify,
  57. enum WDI_EVENT event);
  58. /**
  59. * @typedef wdi_event_subscribe
  60. * @brief Used by consumers to subscribe to WDI event notifications.
  61. * @details
  62. * The event_subscribe struct includes pointers to other event_subscribe
  63. * objects. These pointers are simply to simplify the management of
  64. * lists of event subscribers. These pointers are set during the
  65. * event_sub() function, and shall not be modified except by the
  66. * WDI event management SW, until after the object's event subscription
  67. * is canceled by calling event_unsub().
  68. */
  69. typedef struct wdi_event_subscribe_t {
  70. wdi_event_cb callback; /* subscriber event callback structure head */
  71. void *context; /* subscriber object that processes the event callback */
  72. struct {
  73. /* private - the event subscriber SW shall not use this struct */
  74. struct wdi_event_subscribe_t *next;
  75. struct wdi_event_subscribe_t *prev;
  76. } priv;
  77. } wdi_event_subscribe;
  78. #endif