wl1271_event.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
  5. * Copyright (C) 2008-2009 Nokia Corporation
  6. *
  7. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * 02110-1301 USA
  22. *
  23. */
  24. #ifndef __WL1271_EVENT_H__
  25. #define __WL1271_EVENT_H__
  26. /*
  27. * Mbox events
  28. *
  29. * The event mechanism is based on a pair of event buffers (buffers A and
  30. * B) at fixed locations in the target's memory. The host processes one
  31. * buffer while the other buffer continues to collect events. If the host
  32. * is not processing events, an interrupt is issued to signal that a buffer
  33. * is ready. Once the host is done with processing events from one buffer,
  34. * it signals the target (with an ACK interrupt) that the event buffer is
  35. * free.
  36. */
  37. enum {
  38. MEASUREMENT_START_EVENT_ID = BIT(8),
  39. MEASUREMENT_COMPLETE_EVENT_ID = BIT(9),
  40. SCAN_COMPLETE_EVENT_ID = BIT(10),
  41. SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT(11),
  42. AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12),
  43. PS_REPORT_EVENT_ID = BIT(13),
  44. PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14),
  45. DISCONNECT_EVENT_COMPLETE_ID = BIT(15),
  46. JOIN_EVENT_COMPLETE_ID = BIT(16),
  47. CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17),
  48. BSS_LOSE_EVENT_ID = BIT(18),
  49. REGAINED_BSS_EVENT_ID = BIT(19),
  50. ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID = BIT(20),
  51. SOFT_GEMINI_SENSE_EVENT_ID = BIT(22),
  52. SOFT_GEMINI_PREDICTION_EVENT_ID = BIT(23),
  53. SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24),
  54. PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25),
  55. DBG_EVENT_ID = BIT(26),
  56. HEALTH_CHECK_REPLY_EVENT_ID = BIT(27),
  57. PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28),
  58. PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29),
  59. BA_SESSION_TEAR_DOWN_EVENT_ID = BIT(30),
  60. EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
  61. };
  62. struct event_debug_report {
  63. u8 debug_event_id;
  64. u8 num_params;
  65. u16 pad;
  66. u32 report_1;
  67. u32 report_2;
  68. u32 report_3;
  69. } __attribute__ ((packed));
  70. #define NUM_OF_RSSI_SNR_TRIGGERS 8
  71. struct event_mailbox {
  72. u32 events_vector;
  73. u32 events_mask;
  74. u32 reserved_1;
  75. u32 reserved_2;
  76. u8 dbg_event_id;
  77. u8 num_relevant_params;
  78. u16 reserved_3;
  79. u32 event_report_p1;
  80. u32 event_report_p2;
  81. u32 event_report_p3;
  82. u8 number_of_scan_results;
  83. u8 scan_tag;
  84. u8 reserved_4[2];
  85. u32 compl_scheduled_scan_status;
  86. u16 scheduled_scan_attended_channels;
  87. u8 soft_gemini_sense_info;
  88. u8 soft_gemini_protective_info;
  89. s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
  90. u8 channel_switch_status;
  91. u8 scheduled_scan_status;
  92. u8 ps_status;
  93. u8 reserved_5[29];
  94. } __attribute__ ((packed));
  95. int wl1271_event_unmask(struct wl1271 *wl);
  96. void wl1271_event_mbox_config(struct wl1271 *wl);
  97. int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
  98. #endif