rtw_event.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. #ifndef _RTW_EVENT_H_
  16. #define _RTW_EVENT_H_
  17. #ifdef CONFIG_H2CLBK
  18. #include <h2clbk.h>
  19. #endif
  20. /*
  21. Used to report a bss has been scanned
  22. */
  23. struct survey_event {
  24. WLAN_BSSID_EX bss;
  25. };
  26. /*
  27. Used to report that the requested site survey has been done.
  28. bss_cnt indicates the number of bss that has been reported.
  29. */
  30. struct surveydone_event {
  31. unsigned int bss_cnt;
  32. };
  33. /*
  34. Used to report the link result of joinning the given bss
  35. join_res:
  36. -1: authentication fail
  37. -2: association fail
  38. > 0: TID
  39. */
  40. struct joinbss_event {
  41. struct wlan_network network;
  42. };
  43. /*
  44. Used to report a given STA has joinned the created BSS.
  45. It is used in AP/Ad-HoC(M) mode.
  46. */
  47. struct stassoc_event {
  48. unsigned char macaddr[6];
  49. };
  50. struct stadel_event {
  51. unsigned char macaddr[6];
  52. unsigned char rsvd[2]; /* for reason */
  53. unsigned char locally_generated;
  54. int mac_id;
  55. };
  56. struct addba_event {
  57. unsigned int tid;
  58. };
  59. struct wmm_event {
  60. unsigned char wmm;
  61. };
  62. #ifdef CONFIG_H2CLBK
  63. struct c2hlbk_event {
  64. unsigned char mac[6];
  65. unsigned short s0;
  66. unsigned short s1;
  67. unsigned int w0;
  68. unsigned char b0;
  69. unsigned short s2;
  70. unsigned char b1;
  71. unsigned int w1;
  72. };
  73. #endif/* CONFIG_H2CLBK */
  74. #define GEN_EVT_CODE(event) event ## _EVT_
  75. struct fwevent {
  76. u32 parmsize;
  77. void (*event_callback)(_adapter *dev, u8 *pbuf);
  78. };
  79. #define C2HEVENT_SZ 32
  80. struct event_node {
  81. unsigned char *node;
  82. unsigned char evt_code;
  83. unsigned short evt_sz;
  84. volatile int *caller_ff_tail;
  85. int caller_ff_sz;
  86. };
  87. struct c2hevent_queue {
  88. volatile int head;
  89. volatile int tail;
  90. struct event_node nodes[C2HEVENT_SZ];
  91. unsigned char seq;
  92. };
  93. #define NETWORK_QUEUE_SZ 4
  94. struct network_queue {
  95. volatile int head;
  96. volatile int tail;
  97. WLAN_BSSID_EX networks[NETWORK_QUEUE_SZ];
  98. };
  99. #endif /* _WLANEVENT_H_ */