event.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 __EVENT_H__
  25. #define __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. RSSI_SNR_TRIGGER_0_EVENT_ID = BIT(0),
  39. RSSI_SNR_TRIGGER_1_EVENT_ID = BIT(1),
  40. RSSI_SNR_TRIGGER_2_EVENT_ID = BIT(2),
  41. RSSI_SNR_TRIGGER_3_EVENT_ID = BIT(3),
  42. RSSI_SNR_TRIGGER_4_EVENT_ID = BIT(4),
  43. RSSI_SNR_TRIGGER_5_EVENT_ID = BIT(5),
  44. RSSI_SNR_TRIGGER_6_EVENT_ID = BIT(6),
  45. RSSI_SNR_TRIGGER_7_EVENT_ID = BIT(7),
  46. EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
  47. };
  48. /* events the driver might want to wait for */
  49. enum wlcore_wait_event {
  50. WLCORE_EVENT_ROLE_STOP_COMPLETE,
  51. WLCORE_EVENT_PEER_REMOVE_COMPLETE,
  52. WLCORE_EVENT_DFS_CONFIG_COMPLETE
  53. };
  54. enum {
  55. EVENT_ENTER_POWER_SAVE_FAIL = 0,
  56. EVENT_ENTER_POWER_SAVE_SUCCESS,
  57. };
  58. #define NUM_OF_RSSI_SNR_TRIGGERS 8
  59. struct wl1271;
  60. int wl1271_event_unmask(struct wl1271 *wl);
  61. int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
  62. void wlcore_event_soft_gemini_sense(struct wl1271 *wl, u8 enable);
  63. void wlcore_event_sched_scan_completed(struct wl1271 *wl,
  64. u8 status);
  65. void wlcore_event_ba_rx_constraint(struct wl1271 *wl,
  66. unsigned long roles_bitmap,
  67. unsigned long allowed_bitmap);
  68. void wlcore_event_channel_switch(struct wl1271 *wl,
  69. unsigned long roles_bitmap,
  70. bool success);
  71. void wlcore_event_beacon_loss(struct wl1271 *wl, unsigned long roles_bitmap);
  72. void wlcore_event_dummy_packet(struct wl1271 *wl);
  73. void wlcore_event_max_tx_failure(struct wl1271 *wl, unsigned long sta_bitmap);
  74. void wlcore_event_inactive_sta(struct wl1271 *wl, unsigned long sta_bitmap);
  75. void wlcore_event_roc_complete(struct wl1271 *wl);
  76. void wlcore_event_rssi_trigger(struct wl1271 *wl, s8 *metric_arr);
  77. #endif