event.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * This file is part of wl18xx
  3. *
  4. * Copyright (C) 2012 Texas Instruments. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #ifndef __WL18XX_EVENT_H__
  22. #define __WL18XX_EVENT_H__
  23. #include "../wlcore/wlcore.h"
  24. enum {
  25. SCAN_COMPLETE_EVENT_ID = BIT(8),
  26. RADAR_DETECTED_EVENT_ID = BIT(9),
  27. CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(10),
  28. BSS_LOSS_EVENT_ID = BIT(11),
  29. MAX_TX_FAILURE_EVENT_ID = BIT(12),
  30. DUMMY_PACKET_EVENT_ID = BIT(13),
  31. INACTIVE_STA_EVENT_ID = BIT(14),
  32. PEER_REMOVE_COMPLETE_EVENT_ID = BIT(15),
  33. PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(16),
  34. BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(17),
  35. REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18),
  36. DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19),
  37. PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20),
  38. RX_BA_WIN_SIZE_CHANGE_EVENT_ID = BIT(21),
  39. SMART_CONFIG_SYNC_EVENT_ID = BIT(22),
  40. SMART_CONFIG_DECODE_EVENT_ID = BIT(23),
  41. TIME_SYNC_EVENT_ID = BIT(24),
  42. };
  43. enum wl18xx_radar_types {
  44. RADAR_TYPE_NONE,
  45. RADAR_TYPE_REGULAR,
  46. RADAR_TYPE_CHIRP
  47. };
  48. struct wl18xx_event_mailbox {
  49. __le32 events_vector;
  50. u8 number_of_scan_results;
  51. u8 number_of_sched_scan_results;
  52. __le16 channel_switch_role_id_bitmap;
  53. s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
  54. /* bitmap of removed links */
  55. __le32 hlid_removed_bitmap;
  56. /* rx ba constraint */
  57. __le16 rx_ba_role_id_bitmap; /* 0xfff means any role. */
  58. __le16 rx_ba_allowed_bitmap;
  59. /* bitmap of roc completed (by role id) */
  60. __le16 roc_completed_bitmap;
  61. /* bitmap of stations (by role id) with bss loss */
  62. __le16 bss_loss_bitmap;
  63. /* bitmap of stations (by HLID) which exceeded max tx retries */
  64. __le32 tx_retry_exceeded_bitmap;
  65. /* bitmap of inactive stations (by HLID) */
  66. __le32 inactive_sta_bitmap;
  67. /* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */
  68. u8 rx_ba_role_id;
  69. u8 rx_ba_link_id;
  70. u8 rx_ba_win_size;
  71. u8 padding;
  72. /* smart config */
  73. u8 sc_ssid_len;
  74. u8 sc_pwd_len;
  75. u8 sc_token_len;
  76. u8 padding1;
  77. u8 sc_ssid[32];
  78. u8 sc_pwd[64];
  79. u8 sc_token[32];
  80. /* smart config sync channel */
  81. u8 sc_sync_channel;
  82. u8 sc_sync_band;
  83. /* time sync msb*/
  84. u16 time_sync_tsf_msb;
  85. /* radar detect */
  86. u8 radar_channel;
  87. u8 radar_type;
  88. /* time sync lsb*/
  89. u16 time_sync_tsf_lsb;
  90. } __packed;
  91. int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
  92. bool *timeout);
  93. int wl18xx_process_mailbox_events(struct wl1271 *wl);
  94. #endif