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 36 /** \file public_event_mbox.h 37 * \brief Public header for the Event Mailbox FW<->Driver interface. 38 * 39 */ 40 41 #ifndef PUBLIC_EVENT_MBOX_H 42 #define PUBLIC_EVENT_MBOX_H 43 44 /****************************************************************************** 45 46 EVENT MBOX 47 48 The event mechanism is based on a pair of event buffers (buffers "A" and "B") in fixed locations 49 in the device's memory. The host processes one buffer (buffer "A") while the other buffer 50 (buffer "B") continues to collect events. When the host is finished, it begins processing the 51 other buffer ("B") while the first buffer ("A") collects, and so on. 52 If the host is not processing events, an interrupt is issued to the host signaling that a 53 buffer is ready. The interrupt that the host receives indicates the appropriate event structure 54 buffer. Once the host finishes processing events from one buffer, 55 it signals with an acknowledge interrupt (bit 0 in the INT_TRIG register) that the event buffer 56 is free. This interrupt triggers the device to send the next event structure if there are any 57 collected events in it. 58 59 Note: Only one instance (the last) of each type of event is collected. 60 61 ******************************************************************************/ 62 63 64 #include "public_types.h" 65 #include "public_commands.h" 66 67 68 69 /************************************************************************* 70 71 Events Enumeration 72 73 **************************************************************************/ 74 typedef enum 75 { 76 RESERVED1_EVENT_ID = BIT_0, 77 RESERVED2_EVENT_ID = BIT_1, 78 MEASUREMENT_START_EVENT_ID = BIT_2, 79 SCAN_COMPLETE_EVENT_ID = BIT_3, 80 CALIBRATION_COMPLETE_EVENT_ID = BIT_4, 81 ROAMING_TRIGGER_LOW_RSSI_EVENT_ID = BIT_5, 82 PS_REPORT_EVENT_ID = BIT_6, 83 SYNCHRONIZATION_TIMEOUT_EVENT_ID = BIT_7, 84 HEALTH_REPORT_EVENT_ID = BIT_8, 85 ACI_DETECTION_EVENT_ID = BIT_9, 86 DEBUG_REPORT_EVENT_ID = BIT_10, 87 MAC_STATUS_EVENT_ID = BIT_11, 88 DISCONNECT_EVENT_COMPLETE_ID = BIT_12, 89 JOIN_EVENT_COMPLETE_ID = BIT_13, 90 CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT_14, 91 BSS_LOSE_EVENT_ID = BIT_15, 92 ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID = BIT_16, 93 MEASUREMENT_COMPLETE_EVENT_ID = BIT_17, 94 AP_DISCOVERY_COMPLETE_EVENT_ID = BIT_18, 95 SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT_19, 96 PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT_20, 97 RESET_BSS_EVENT_ID = BIT_21, 98 REGAINED_BSS_EVENT_ID = BIT_22, 99 ROAMING_TRIGGER_REGAINED_RSSI_EVENT_ID = BIT_23, 100 ROAMING_TRIGGER_LOW_SNR_EVENT_ID = BIT_24, 101 ROAMING_TRIGGER_REGAINED_SNR_EVENT_ID = BIT_25, 102 103 DBG_EVENT_ID = BIT_26, 104 SOFT_GEMINI_SENSE_EVENT_ID = BIT_27, 105 SOFT_GEMINI_PREDICTION_EVENT_ID = BIT_28, 106 SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT_29, 107 108 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT_30, 109 110 EVENT_MBOX_ALL_EVENT_ID = MAX_POSITIVE32 111 } EventMBoxId_e; 112 113 /************************************************************************* 114 115 Specific Event Parameters 116 117 **************************************************************************/ 118 typedef enum 119 { 120 SCHEDULED_SCAN_COMPLETED_OK = 0, 121 SCHEDULED_SCAN_TSF_ERROR = 1 122 } ScheduledScanReportStatus_enum; 123 124 125 typedef enum 126 { 127 CHANNEL_SWITCH_COMPLETE_OK, 128 CHANNEL_SWITCH_TSF_ERROR 129 } ChannelSwitchReportStatus_enum; 130 131 132 typedef enum 133 { 134 ENTER_POWER_SAVE_FAIL = 0, 135 ENTER_POWER_SAVE_SUCCESS = 1, 136 EXIT_POWER_SAVE_FAIL = 2, 137 EXIT_POWER_SAVE_SUCCESS = 3, 138 POWER_SAVE_STATUS_NUMBER 139 } EventsPowerSave_enum; 140 141 typedef enum 142 { 143 TEST1_DBG_EVENT_ID = 0, 144 TEST2_DBG_EVENT_ID = 0x11, 145 LAST_DBG_EVENT_ID= 0xff 146 }dbgEventId_enum; 147 148 #ifdef HOST_COMPILE 149 typedef uint8 ScheduledScanReportStatus_e; 150 typedef uint8 ChannelSwitchReportStatus_e; 151 typedef uint8 EventsPowerSave_e; 152 typedef uint8 dbgEventId_e; 153 #else 154 typedef ScheduledScanReportStatus_enum ScheduledScanReportStatus_e; 155 typedef ChannelSwitchReportStatus_enum ChannelSwitchReportStatus_e; 156 typedef EventsPowerSave_enum EventsPowerSave_e; 157 typedef dbgEventId_enum dbgEventId_e; 158 #endif 159 160 161 #define MAX_EVENT_REPORT_PARAMS 5 162 typedef struct 163 { 164 dbgEventId_e dbgEventId; /*uint8*/ 165 uint8 numberOfRelevantParams; 166 uint16 reservedPad16; 167 uint32 eventReportP1; 168 uint32 eventReportP2; 169 uint32 eventReportP3; 170 }dbgEventRep_t; 171 172 173 174 /************************************************************************* 175 176 The Event Mailbox structure in memory 177 178 **************************************************************************/ 179 typedef struct EventMailBox_t 180 { 181 /* Events Bit Mask */ 182 uint32 eventsVector; 183 uint32 eventsMask; 184 uint32 reserved1; 185 uint32 reserved2; 186 187 /* Events Data */ 188 int8 averageRssiLevel; /* Average RSSI value. */ 189 /* [ROAMING_TRIGGER_LOW_RSSI_EVENT_ID].*/ 190 191 uint8 psStatus; /* refer to EventsPowerSave_enum.*/ 192 /* [PS_REPORT_EVENT_ID].*/ 193 194 uint8 channelSwitchStatus; /* Status of channel switch. Refer to*/ 195 /* ChannelSwitchReportStatus_enum.*/ 196 /* [CHANNEL_SWITCH_COMPLETE_EVENT_ID]*/ 197 198 uint8 scheduledScanStatus; /* Status of scheduled scan. Refer to */ 199 /* ScheduledScanReportStatus_enum.*/ 200 /* [SCHEDULED_SCAN_COMPLETE_EVENT_ID]*/ 201 202 uint16 scheduledScanAttendedChannels; /* Channels scanned by the Scheduled Scan. */ 203 /* [SCHEDULED_SCAN_COMPLETE_EVENT_ID]*/ 204 205 uint16 healthReport; /* Bit 0 is set in case of a fatal error in the device.*/ 206 /* [HEALTH_REPORT_EVENT_ID].*/ 207 208 uint16 badFFTCorrelationCounter; /* [ACI_DETECTION_EVENT_ID]*/ 209 210 uint8 softGeminiSenseInfo; /* Contains the type of the BT Coexistence sense event.*/ 211 /* [SOFT_GEMINI_SENSE_EVENT_ID]*/ 212 213 uint8 softGeminiProtectiveInfo; /* Contains information from the BT activity prediction */ 214 /* machine [SOFT_GEMINI_PREDICTION_EVENT_ID]*/ 215 216 uint32 reserved; 217 uint32 debugReport[2]; /* [DBG_EVENT_ID]*/ 218 219 /* 16 Header + 24 data = 40 bytes till here include new fields */ 220 221 uint32 consFcsErrCnt; /* The number of FCS errors since the last event. */ 222 /* If this number is larger then the last recorded */ 223 /* number plus a threshold (20, by default), and no Rx*/ 224 /* packet has been received in the last 500 ms, than the*/ 225 /* MAC Rx module is reset. After 2 such resets (by */ 226 /* default), the driver performs a full recovery */ 227 /* process. */ 228 /* [MAC_STATUS_EVENT_ID]*/ 229 230 dbgEventRep_t dbgEventRep; /* refer to dbgEventRep_t*/ 231 /* [DBG_EVENT_ID]*/ 232 233 uint8 averageSNRLevel; /* [ROAMING_TRIGGER_LOW_SNR_EVENT_ID]*/ 234 uint8 padding[19]; /* for alignment to 32 bits boundry*/ 235 } EventMailBox_t; 236 237 #endif /* PUBLIC_EVENT_MBOX_H*/ 238 239 240