event.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * This file is part of wl12xx
  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 __WL12XX_EVENT_H__
  22. #define __WL12XX_EVENT_H__
  23. #include "../wlcore/wlcore.h"
  24. enum {
  25. MEASUREMENT_START_EVENT_ID = BIT(8),
  26. MEASUREMENT_COMPLETE_EVENT_ID = BIT(9),
  27. SCAN_COMPLETE_EVENT_ID = BIT(10),
  28. WFD_DISCOVERY_COMPLETE_EVENT_ID = BIT(11),
  29. AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12),
  30. RESERVED1 = BIT(13),
  31. PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14),
  32. ROLE_STOP_COMPLETE_EVENT_ID = BIT(15),
  33. RADAR_DETECTED_EVENT_ID = BIT(16),
  34. CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17),
  35. BSS_LOSE_EVENT_ID = BIT(18),
  36. REGAINED_BSS_EVENT_ID = BIT(19),
  37. MAX_TX_RETRY_EVENT_ID = BIT(20),
  38. DUMMY_PACKET_EVENT_ID = BIT(21),
  39. SOFT_GEMINI_SENSE_EVENT_ID = BIT(22),
  40. CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID = BIT(23),
  41. SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24),
  42. PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25),
  43. INACTIVE_STA_EVENT_ID = BIT(26),
  44. PEER_REMOVE_COMPLETE_EVENT_ID = BIT(27),
  45. PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28),
  46. PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29),
  47. BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30),
  48. REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(31),
  49. };
  50. struct wl12xx_event_mailbox {
  51. __le32 events_vector;
  52. __le32 events_mask;
  53. __le32 reserved_1;
  54. __le32 reserved_2;
  55. u8 number_of_scan_results;
  56. u8 scan_tag;
  57. u8 completed_scan_status;
  58. u8 reserved_3;
  59. u8 soft_gemini_sense_info;
  60. u8 soft_gemini_protective_info;
  61. s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
  62. u8 change_auto_mode_timeout;
  63. u8 scheduled_scan_status;
  64. u8 reserved4;
  65. /* tuned channel (roc) */
  66. u8 roc_channel;
  67. __le16 hlid_removed_bitmap;
  68. /* bitmap of aged stations (by HLID) */
  69. __le16 sta_aging_status;
  70. /* bitmap of stations (by HLID) which exceeded max tx retries */
  71. __le16 sta_tx_retry_exceeded;
  72. /* discovery completed results */
  73. u8 discovery_tag;
  74. u8 number_of_preq_results;
  75. u8 number_of_prsp_results;
  76. u8 reserved_5;
  77. /* rx ba constraint */
  78. u8 role_id; /* 0xFF means any role. */
  79. u8 rx_ba_allowed;
  80. u8 reserved_6[2];
  81. /* Channel switch results */
  82. u8 channel_switch_role_id;
  83. u8 channel_switch_status;
  84. u8 reserved_7[2];
  85. u8 ps_poll_delivery_failure_role_ids;
  86. u8 stopped_role_ids;
  87. u8 started_role_ids;
  88. u8 reserved_8[9];
  89. } __packed;
  90. int wl12xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
  91. bool *timeout);
  92. int wl12xx_process_mailbox_events(struct wl1271 *wl);
  93. #endif