PageRenderTime 123ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/drivers/net/wireless/tiwlan1251/common/src/hal/FirmwareApi/public_event_mbox.h

http://github.com/CyanogenMod/cm-kernel
C Header | 239 lines | 107 code | 40 blank | 92 comment | 0 complexity | 558abbf2f6f6b961e22e6e745c2ad25a MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.0
  1. /****************************************************************************
  2. **+-----------------------------------------------------------------------+**
  3. **| |**
  4. **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
  5. **| All rights reserved. |**
  6. **| |**
  7. **| Redistribution and use in source and binary forms, with or without |**
  8. **| modification, are permitted provided that the following conditions |**
  9. **| are met: |**
  10. **| |**
  11. **| * Redistributions of source code must retain the above copyright |**
  12. **| notice, this list of conditions and the following disclaimer. |**
  13. **| * Redistributions in binary form must reproduce the above copyright |**
  14. **| notice, this list of conditions and the following disclaimer in |**
  15. **| the documentation and/or other materials provided with the |**
  16. **| distribution. |**
  17. **| * Neither the name Texas Instruments nor the names of its |**
  18. **| contributors may be used to endorse or promote products derived |**
  19. **| from this software without specific prior written permission. |**
  20. **| |**
  21. **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
  22. **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
  23. **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
  24. **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
  25. **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
  26. **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
  27. **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
  28. **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
  29. **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
  30. **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
  31. **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
  32. **| |**
  33. **+-----------------------------------------------------------------------+**
  34. ****************************************************************************/
  35. /** \file public_event_mbox.h
  36. * \brief Public header for the Event Mailbox FW<->Driver interface.
  37. *
  38. */
  39. #ifndef PUBLIC_EVENT_MBOX_H
  40. #define PUBLIC_EVENT_MBOX_H
  41. /******************************************************************************
  42. EVENT MBOX
  43. The event mechanism is based on a pair of event buffers (buffers "A" and "B") in fixed locations
  44. in the device's memory. The host processes one buffer (buffer "A") while the other buffer
  45. (buffer "B") continues to collect events. When the host is finished, it begins processing the
  46. other buffer ("B") while the first buffer ("A") collects, and so on.
  47. If the host is not processing events, an interrupt is issued to the host signaling that a
  48. buffer is ready. The interrupt that the host receives indicates the appropriate event structure
  49. buffer. Once the host finishes processing events from one buffer,
  50. it signals with an acknowledge interrupt (bit 0 in the INT_TRIG register) that the event buffer
  51. is free. This interrupt triggers the device to send the next event structure if there are any
  52. collected events in it.
  53. Note: Only one instance (the last) of each type of event is collected.
  54. ******************************************************************************/
  55. #include "public_types.h"
  56. #include "public_commands.h"
  57. /*************************************************************************
  58. Events Enumeration
  59. **************************************************************************/
  60. typedef enum
  61. {
  62. RESERVED1_EVENT_ID = BIT_0,
  63. RESERVED2_EVENT_ID = BIT_1,
  64. MEASUREMENT_START_EVENT_ID = BIT_2,
  65. SCAN_COMPLETE_EVENT_ID = BIT_3,
  66. CALIBRATION_COMPLETE_EVENT_ID = BIT_4,
  67. ROAMING_TRIGGER_LOW_RSSI_EVENT_ID = BIT_5,
  68. PS_REPORT_EVENT_ID = BIT_6,
  69. SYNCHRONIZATION_TIMEOUT_EVENT_ID = BIT_7,
  70. HEALTH_REPORT_EVENT_ID = BIT_8,
  71. ACI_DETECTION_EVENT_ID = BIT_9,
  72. DEBUG_REPORT_EVENT_ID = BIT_10,
  73. MAC_STATUS_EVENT_ID = BIT_11,
  74. DISCONNECT_EVENT_COMPLETE_ID = BIT_12,
  75. JOIN_EVENT_COMPLETE_ID = BIT_13,
  76. CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT_14,
  77. BSS_LOSE_EVENT_ID = BIT_15,
  78. ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID = BIT_16,
  79. MEASUREMENT_COMPLETE_EVENT_ID = BIT_17,
  80. AP_DISCOVERY_COMPLETE_EVENT_ID = BIT_18,
  81. SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT_19,
  82. PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT_20,
  83. RESET_BSS_EVENT_ID = BIT_21,
  84. REGAINED_BSS_EVENT_ID = BIT_22,
  85. ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID = BIT_23,
  86. ROAMING_TRIGGER_LOW_SNR_EVENT_ID = BIT_24,
  87. ROAMING_TRIGGER_REGAINED_SNR_EVENT_ID = BIT_25,
  88. DBG_EVENT_ID = BIT_26,
  89. SOFT_GEMINI_SENSE_EVENT_ID = BIT_27,
  90. SOFT_GEMINI_PREDICTION_EVENT_ID = BIT_28,
  91. SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT_29,
  92. PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT_30,
  93. EVENT_MBOX_ALL_EVENT_ID = MAX_POSITIVE32
  94. } EventMBoxId_e;
  95. /*************************************************************************
  96. Specific Event Parameters
  97. **************************************************************************/
  98. typedef enum
  99. {
  100. SCHEDULED_SCAN_COMPLETED_OK = 0,
  101. SCHEDULED_SCAN_TSF_ERROR = 1
  102. } ScheduledScanReportStatus_enum;
  103. typedef enum
  104. {
  105. CHANNEL_SWITCH_COMPLETE_OK,
  106. CHANNEL_SWITCH_TSF_ERROR
  107. } ChannelSwitchReportStatus_enum;
  108. typedef enum
  109. {
  110. ENTER_POWER_SAVE_FAIL = 0,
  111. ENTER_POWER_SAVE_SUCCESS = 1,
  112. EXIT_POWER_SAVE_FAIL = 2,
  113. EXIT_POWER_SAVE_SUCCESS = 3,
  114. POWER_SAVE_STATUS_NUMBER
  115. } EventsPowerSave_enum;
  116. typedef enum
  117. {
  118. TEST1_DBG_EVENT_ID = 0,
  119. TEST2_DBG_EVENT_ID = 0x11,
  120. LAST_DBG_EVENT_ID= 0xff
  121. }dbgEventId_enum;
  122. #ifdef HOST_COMPILE
  123. typedef uint8 ScheduledScanReportStatus_e;
  124. typedef uint8 ChannelSwitchReportStatus_e;
  125. typedef uint8 EventsPowerSave_e;
  126. typedef uint8 dbgEventId_e;
  127. #else
  128. typedef ScheduledScanReportStatus_enum ScheduledScanReportStatus_e;
  129. typedef ChannelSwitchReportStatus_enum ChannelSwitchReportStatus_e;
  130. typedef EventsPowerSave_enum EventsPowerSave_e;
  131. typedef dbgEventId_enum dbgEventId_e;
  132. #endif
  133. #define MAX_EVENT_REPORT_PARAMS 5
  134. typedef struct
  135. {
  136. dbgEventId_e dbgEventId; /*uint8*/
  137. uint8 numberOfRelevantParams;
  138. uint16 reservedPad16;
  139. uint32 eventReportP1;
  140. uint32 eventReportP2;
  141. uint32 eventReportP3;
  142. }dbgEventRep_t;
  143. /*************************************************************************
  144. The Event Mailbox structure in memory
  145. **************************************************************************/
  146. typedef struct EventMailBox_t
  147. {
  148. /* Events Bit Mask */
  149. uint32 eventsVector;
  150. uint32 eventsMask;
  151. uint32 reserved1;
  152. uint32 reserved2;
  153. /* Events Data */
  154. int8 averageRssiLevel; /* Average RSSI value. */
  155. /* [ROAMING_TRIGGER_LOW_RSSI_EVENT_ID].*/
  156. uint8 psStatus; /* refer to EventsPowerSave_enum.*/
  157. /* [PS_REPORT_EVENT_ID].*/
  158. uint8 channelSwitchStatus; /* Status of channel switch. Refer to*/
  159. /* ChannelSwitchReportStatus_enum.*/
  160. /* [CHANNEL_SWITCH_COMPLETE_EVENT_ID]*/
  161. uint8 scheduledScanStatus; /* Status of scheduled scan. Refer to */
  162. /* ScheduledScanReportStatus_enum.*/
  163. /* [SCHEDULED_SCAN_COMPLETE_EVENT_ID]*/
  164. uint16 scheduledScanAttendedChannels; /* Channels scanned by the Scheduled Scan. */
  165. /* [SCHEDULED_SCAN_COMPLETE_EVENT_ID]*/
  166. uint16 healthReport; /* Bit 0 is set in case of a fatal error in the device.*/
  167. /* [HEALTH_REPORT_EVENT_ID].*/
  168. uint16 badFFTCorrelationCounter; /* [ACI_DETECTION_EVENT_ID]*/
  169. uint8 softGeminiSenseInfo; /* Contains the type of the BT Coexistence sense event.*/
  170. /* [SOFT_GEMINI_SENSE_EVENT_ID]*/
  171. uint8 softGeminiProtectiveInfo; /* Contains information from the BT activity prediction */
  172. /* machine [SOFT_GEMINI_PREDICTION_EVENT_ID]*/
  173. uint32 reserved;
  174. uint32 debugReport[2]; /* [DBG_EVENT_ID]*/
  175. /* 16 Header + 24 data = 40 bytes till here include new fields */
  176. uint32 consFcsErrCnt; /* The number of FCS errors since the last event. */
  177. /* If this number is larger then the last recorded */
  178. /* number plus a threshold (20, by default), and no Rx*/
  179. /* packet has been received in the last 500 ms, than the*/
  180. /* MAC Rx module is reset. After 2 such resets (by */
  181. /* default), the driver performs a full recovery */
  182. /* process. */
  183. /* [MAC_STATUS_EVENT_ID]*/
  184. dbgEventRep_t dbgEventRep; /* refer to dbgEventRep_t*/
  185. /* [DBG_EVENT_ID]*/
  186. uint8 averageSNRLevel; /* [ROAMING_TRIGGER_LOW_SNR_EVENT_ID]*/
  187. uint8 padding[19]; /* for alignment to 32 bits boundry*/
  188. } EventMailBox_t;
  189. #endif /* PUBLIC_EVENT_MBOX_H*/