• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** \file healthMonitor.c
2  *  \brief Firmware Recovery Mechanizem
3  *
4  */
5 /****************************************************************************
6 **+-----------------------------------------------------------------------+**
7 **|                                                                       |**
8 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
9 **| All rights reserved.                                                  |**
10 **|                                                                       |**
11 **| Redistribution and use in source and binary forms, with or without    |**
12 **| modification, are permitted provided that the following conditions    |**
13 **| are met:                                                              |**
14 **|                                                                       |**
15 **|  * Redistributions of source code must retain the above copyright     |**
16 **|    notice, this list of conditions and the following disclaimer.      |**
17 **|  * Redistributions in binary form must reproduce the above copyright  |**
18 **|    notice, this list of conditions and the following disclaimer in    |**
19 **|    the documentation and/or other materials provided with the         |**
20 **|    distribution.                                                      |**
21 **|  * Neither the name Texas Instruments nor the names of its            |**
22 **|    contributors may be used to endorse or promote products derived    |**
23 **|    from this software without specific prior written permission.      |**
24 **|                                                                       |**
25 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
26 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
27 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
28 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
29 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
30 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
31 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
32 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
33 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
34 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
35 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
36 **|                                                                       |**
37 **+-----------------------------------------------------------------------+**
38 ****************************************************************************/
39 
40 /****************************************************************************/
41 /*                                                                          */
42 /*      MODULE:     healthMonitor.h                                         */
43 /*      PURPOSE:    Driver interface to OS abstraction layer                */
44 /*                                                                          */
45 /****************************************************************************/
46 
47 #ifndef HEALTHMONITOR_H
48 #define HEALTHMONITOR_H
49 
50 #include "paramOut.h"
51 #include "whalCtrl_api.h"
52 
53 
54 /* Config manager state machine defintions */
55 typedef enum healthMonitorState_e
56 {
57     HEALTH_MONITOR_STATE_DISCONNECTED = 0,
58     HEALTH_MONITOR_STATE_CONNECTED
59 
60 } healthMonitorState_e;
61 
62 
63 typedef struct
64 {
65     /* handles to other modules */
66     TI_HANDLE            hOs;                    /**< handle to the OS object */
67     TI_HANDLE            hReport;                /**< handle to the report object */
68     TI_HANDLE            hHalCtrl;               /**< handle to the HAL CTRL object */
69     TI_HANDLE            hSiteMgr;               /**< handle to the site manager object */
70     TI_HANDLE            hScr;                   /**< handle to the SCR object */
71     TI_HANDLE            hSoftGemini;            /**< handle to the Soft Gemini object */
72     TI_HANDLE            hTnetwDrv;              /**< handle to the TNETW driver object */
73     TI_HANDLE            hMemMgr;                /**< handle to the memory manager object */
74     TI_HANDLE            hConfigMgr;             /**< handle to the config manager object */
75     TI_HANDLE            hTxData;                /**< handle to the TX data object */
76     TI_HANDLE            hHealtheCheckTimer;     /**< periodic health check timer handle */
77     TI_HANDLE            hCurrBss;               /**< handle to the currBss object */
78     TI_HANDLE            hFailTimer;             /**< failure event timer */
79     TI_HANDLE            hRsn;                   /**< handle to the RSN */
80     TI_HANDLE            hRecoveryMgr;           /**< handle to the Recovery Mgr object */
81 
82     /* Management variables */
83     UINT32               numOfHealthTests;       /**< number of health tests performed counter */
84     healthMonitorState_e state;                  /**< health monitor state */
85     BOOL                 bFullRecoveryEnable;    /**< full recovery enable flag */
86     BOOL                 bSuspended;             /**< suspend periodic test flag */
87     UINT32               timerInterval;          /**< health check interval */
88     BOOL                 bRunSoftRecovery;       /**< soft recovery flag */
89     BOOL                 recoveryTriggerEnabled [MAX_FAILURE_EVENTS];
90                                                  /**< recovery enable flags per trigger type */
91     UINT32               failureEvent;           /**< current recovery trigger */
92     UINT32               keepAliveIntervals;     /**< number of health monitor timer intervals at which keep alive should be sent */
93     UINT32               currentKeepAliveCounter;/**< counting how many timer intervals had passed w/o a keep alive */
94 
95     /* Recoveries Statistics */
96     UINT32               recoveryTriggersNumber [MAX_FAILURE_EVENTS];
97                                                  /**< Number of times each recovery trigger occured */
98     UINT32               numOfRecoveryPerformed; /**< number of recoveries performed */
99 
100     ACXRoamingStatisticsTable_t statTable;       /**< needed by TX Power Adjust, to retrieve current rssi when beacon filter in ON */
101 
102 } healthMonitor_t;
103 
104 
105 
106 TI_HANDLE healthMonitor_create         (TI_HANDLE hOs);
107 TI_STATUS healthMonitor_config         (TI_HANDLE hHealthMonitor,
108                                         TI_HANDLE hReport,
109                                         TI_HANDLE hHalCtrl,
110                                         TI_HANDLE hSiteMgr,
111                                         TI_HANDLE hScr,
112                                         TI_HANDLE hSoftGemini,
113                                         TI_HANDLE hTnetwDrv,
114                                         TI_HANDLE hMemMgr,
115                                         TI_HANDLE hConfigMgr,
116                                         TI_HANDLE hTxData,
117                                         TI_HANDLE hCurrBss,
118                                         TI_HANDLE hRsn,
119                                         healthMonitorInitParams_t *healthMonitorInitParams,
120                                         TI_HANDLE hRecoveryMgr);
121 TI_STATUS healthMonitor_unload         (TI_HANDLE hHealthMonitor);
122 void healthMonitor_performTest         (TI_HANDLE hHealthMonitor);
123 void healthMonitor_setState            (TI_HANDLE hHealthMonitor, healthMonitorState_e state);
124 void healthMonitor_suspendPeriodicTest (TI_HANDLE hHealthMonitor);
125 void healthMonitor_resumePeriodicTest  (TI_HANDLE hHealthMonitor);
126 void healthMonitor_sendFailureEvent    (TI_HANDLE hHealthMonitor, failureEvent_e failureEvent);
127 void healthMonitor_printFailureEvents  (TI_HANDLE hHealthMonitor);
128 
129 #endif
130