event.h 2.5 KB

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