aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/epl/EplNmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/epl/EplNmt.h')
-rw-r--r--drivers/staging/epl/EplNmt.h224
1 files changed, 103 insertions, 121 deletions
diff --git a/drivers/staging/epl/EplNmt.h b/drivers/staging/epl/EplNmt.h
index 7b9e58e31f1..4c11e5bc74a 100644
--- a/drivers/staging/epl/EplNmt.h
+++ b/drivers/staging/epl/EplNmt.h
@@ -66,7 +66,6 @@
66 66
67 2006/06/09 k.t.: start of the implementation 67 2006/06/09 k.t.: start of the implementation
68 68
69
70****************************************************************************/ 69****************************************************************************/
71 70
72#ifndef _EPLNMT_H_ 71#ifndef _EPLNMT_H_
@@ -79,18 +78,18 @@
79//--------------------------------------------------------------------------- 78//---------------------------------------------------------------------------
80 79
81// define super-states and masks to identify a super-state 80// define super-states and masks to identify a super-state
82#define EPL_NMT_GS_POWERED 0x0008 // super state 81#define EPL_NMT_GS_POWERED 0x0008 // super state
83#define EPL_NMT_GS_INITIALISATION 0x0009 // super state 82#define EPL_NMT_GS_INITIALISATION 0x0009 // super state
84#define EPL_NMT_GS_COMMUNICATING 0x000C // super state 83#define EPL_NMT_GS_COMMUNICATING 0x000C // super state
85#define EPL_NMT_CS_EPLMODE 0x000D // super state 84#define EPL_NMT_CS_EPLMODE 0x000D // super state
86#define EPL_NMT_MS_EPLMODE 0x000D // super state 85#define EPL_NMT_MS_EPLMODE 0x000D // super state
87 86
88#define EPL_NMT_SUPERSTATE_MASK 0x000F // mask to select state 87#define EPL_NMT_SUPERSTATE_MASK 0x000F // mask to select state
89 88
90#define EPL_NMT_TYPE_UNDEFINED 0x0000 // type of NMT state is still undefined 89#define EPL_NMT_TYPE_UNDEFINED 0x0000 // type of NMT state is still undefined
91#define EPL_NMT_TYPE_CS 0x0100 // CS type of NMT state 90#define EPL_NMT_TYPE_CS 0x0100 // CS type of NMT state
92#define EPL_NMT_TYPE_MS 0x0200 // MS type of NMT state 91#define EPL_NMT_TYPE_MS 0x0200 // MS type of NMT state
93#define EPL_NMT_TYPE_MASK 0x0300 // mask to select type of NMT state (i.e. CS or MS) 92#define EPL_NMT_TYPE_MASK 0x0300 // mask to select type of NMT state (i.e. CS or MS)
94 93
95//--------------------------------------------------------------------------- 94//---------------------------------------------------------------------------
96// typedef 95// typedef
@@ -106,143 +105,126 @@
106// --> there are masks defined to indentify the 105// --> there are masks defined to indentify the
107// super-states 106// super-states
108 107
109typedef enum 108typedef enum {
110{ 109 kEplNmtGsOff = 0x0000,
111 kEplNmtGsOff = 0x0000, 110 kEplNmtGsInitialising = 0x0019,
112 kEplNmtGsInitialising = 0x0019, 111 kEplNmtGsResetApplication = 0x0029,
113 kEplNmtGsResetApplication = 0x0029, 112 kEplNmtGsResetCommunication = 0x0039,
114 kEplNmtGsResetCommunication = 0x0039, 113 kEplNmtGsResetConfiguration = 0x0079,
115 kEplNmtGsResetConfiguration = 0x0079, 114 kEplNmtCsNotActive = 0x011C,
116 kEplNmtCsNotActive = 0x011C, 115 kEplNmtCsPreOperational1 = 0x011D,
117 kEplNmtCsPreOperational1 = 0x011D, 116 kEplNmtCsStopped = 0x014D,
118 kEplNmtCsStopped = 0x014D, 117 kEplNmtCsPreOperational2 = 0x015D,
119 kEplNmtCsPreOperational2 = 0x015D, 118 kEplNmtCsReadyToOperate = 0x016D,
120 kEplNmtCsReadyToOperate = 0x016D, 119 kEplNmtCsOperational = 0x01FD,
121 kEplNmtCsOperational = 0x01FD, 120 kEplNmtCsBasicEthernet = 0x011E,
122 kEplNmtCsBasicEthernet = 0x011E, 121 kEplNmtMsNotActive = 0x021C,
123 kEplNmtMsNotActive = 0x021C, 122 kEplNmtMsPreOperational1 = 0x021D,
124 kEplNmtMsPreOperational1 = 0x021D, 123 kEplNmtMsPreOperational2 = 0x025D,
125 kEplNmtMsPreOperational2 = 0x025D, 124 kEplNmtMsReadyToOperate = 0x026D,
126 kEplNmtMsReadyToOperate = 0x026D, 125 kEplNmtMsOperational = 0x02FD,
127 kEplNmtMsOperational = 0x02FD, 126 kEplNmtMsBasicEthernet = 0x021E
128 kEplNmtMsBasicEthernet = 0x021E
129
130} tEplNmtState; 127} tEplNmtState;
131 128
132// NMT-events 129// NMT-events
133typedef enum 130typedef enum {
134{ 131 // Events from DLL
135 // Events from DLL 132 // Events defined by EPL V2 specification
136 // Events defined by EPL V2 specification 133 kEplNmtEventNoEvent = 0x00,
137 kEplNmtEventNoEvent = 0x00,
138// kEplNmtEventDllMePres = 0x01, 134// kEplNmtEventDllMePres = 0x01,
139 kEplNmtEventDllMePresTimeout = 0x02, 135 kEplNmtEventDllMePresTimeout = 0x02,
140// kEplNmtEventDllMeAsnd = 0x03, 136// kEplNmtEventDllMeAsnd = 0x03,
141// kEplNmtEventDllMeAsndTimeout = 0x04, 137// kEplNmtEventDllMeAsndTimeout = 0x04,
142 kEplNmtEventDllMeSoaSent = 0x04, 138 kEplNmtEventDllMeSoaSent = 0x04,
143 kEplNmtEventDllMeSocTrig = 0x05, 139 kEplNmtEventDllMeSocTrig = 0x05,
144 kEplNmtEventDllMeSoaTrig = 0x06, 140 kEplNmtEventDllMeSoaTrig = 0x06,
145 kEplNmtEventDllCeSoc = 0x07, 141 kEplNmtEventDllCeSoc = 0x07,
146 kEplNmtEventDllCePreq = 0x08, 142 kEplNmtEventDllCePreq = 0x08,
147 kEplNmtEventDllCePres = 0x09, 143 kEplNmtEventDllCePres = 0x09,
148 kEplNmtEventDllCeSoa = 0x0A, 144 kEplNmtEventDllCeSoa = 0x0A,
149 kEplNmtEventDllCeAsnd = 0x0B, 145 kEplNmtEventDllCeAsnd = 0x0B,
150 kEplNmtEventDllCeFrameTimeout = 0x0C, 146 kEplNmtEventDllCeFrameTimeout = 0x0C,
151 147
152 // Events triggered by NMT-Commands 148 // Events triggered by NMT-Commands
153 kEplNmtEventSwReset = 0x10, // NMT_GT1, NMT_GT2, NMT_GT8 149 kEplNmtEventSwReset = 0x10, // NMT_GT1, NMT_GT2, NMT_GT8
154 kEplNmtEventResetNode = 0x11, 150 kEplNmtEventResetNode = 0x11,
155 kEplNmtEventResetCom = 0x12, 151 kEplNmtEventResetCom = 0x12,
156 kEplNmtEventResetConfig = 0x13, 152 kEplNmtEventResetConfig = 0x13,
157 kEplNmtEventEnterPreOperational2= 0x14, 153 kEplNmtEventEnterPreOperational2 = 0x14,
158 kEplNmtEventEnableReadyToOperate= 0x15, 154 kEplNmtEventEnableReadyToOperate = 0x15,
159 kEplNmtEventStartNode = 0x16, // NMT_CT7 155 kEplNmtEventStartNode = 0x16, // NMT_CT7
160 kEplNmtEventStopNode = 0x17, 156 kEplNmtEventStopNode = 0x17,
161 157
162 // Events triggered by higher layer 158 // Events triggered by higher layer
163 kEplNmtEventEnterResetApp = 0x20, 159 kEplNmtEventEnterResetApp = 0x20,
164 kEplNmtEventEnterResetCom = 0x21, 160 kEplNmtEventEnterResetCom = 0x21,
165 kEplNmtEventInternComError = 0x22, // NMT_GT6, internal communication error -> enter ResetCommunication 161 kEplNmtEventInternComError = 0x22, // NMT_GT6, internal communication error -> enter ResetCommunication
166 kEplNmtEventEnterResetConfig = 0x23, 162 kEplNmtEventEnterResetConfig = 0x23,
167 kEplNmtEventEnterCsNotActive = 0x24, 163 kEplNmtEventEnterCsNotActive = 0x24,
168 kEplNmtEventEnterMsNotActive = 0x25, 164 kEplNmtEventEnterMsNotActive = 0x25,
169 kEplNmtEventTimerBasicEthernet = 0x26, // NMT_CT3; timer triggered state change (NotActive -> BasicEth) 165 kEplNmtEventTimerBasicEthernet = 0x26, // NMT_CT3; timer triggered state change (NotActive -> BasicEth)
170 kEplNmtEventTimerMsPreOp1 = 0x27, // enter PreOp1 on MN (NotActive -> MsPreOp1) 166 kEplNmtEventTimerMsPreOp1 = 0x27, // enter PreOp1 on MN (NotActive -> MsPreOp1)
171 kEplNmtEventNmtCycleError = 0x28, // NMT_CT11, NMT_MT6; error during cycle -> enter PreOp1 167 kEplNmtEventNmtCycleError = 0x28, // NMT_CT11, NMT_MT6; error during cycle -> enter PreOp1
172 kEplNmtEventTimerMsPreOp2 = 0x29, // enter PreOp2 on MN (MsPreOp1 -> MsPreOp2 if kEplNmtEventAllMandatoryCNIdent) 168 kEplNmtEventTimerMsPreOp2 = 0x29, // enter PreOp2 on MN (MsPreOp1 -> MsPreOp2 if kEplNmtEventAllMandatoryCNIdent)
173 kEplNmtEventAllMandatoryCNIdent = 0x2A, // enter PreOp2 on MN if kEplNmtEventTimerMsPreOp2 169 kEplNmtEventAllMandatoryCNIdent = 0x2A, // enter PreOp2 on MN if kEplNmtEventTimerMsPreOp2
174 kEplNmtEventEnterReadyToOperate = 0x2B, // application ready for the state ReadyToOp 170 kEplNmtEventEnterReadyToOperate = 0x2B, // application ready for the state ReadyToOp
175 kEplNmtEventEnterMsOperational = 0x2C, // enter Operational on MN 171 kEplNmtEventEnterMsOperational = 0x2C, // enter Operational on MN
176 kEplNmtEventSwitchOff = 0x2D, // enter state Off 172 kEplNmtEventSwitchOff = 0x2D, // enter state Off
177 kEplNmtEventCriticalError = 0x2E, // enter state Off because of critical error 173 kEplNmtEventCriticalError = 0x2E, // enter state Off because of critical error
178 174
179} tEplNmtEvent; 175} tEplNmtEvent;
180 176
181
182// type for argument of event kEplEventTypeNmtStateChange 177// type for argument of event kEplEventTypeNmtStateChange
183typedef struct 178typedef struct {
184{ 179 tEplNmtState m_NewNmtState;
185 tEplNmtState m_NewNmtState; 180 tEplNmtEvent m_NmtEvent;
186 tEplNmtEvent m_NmtEvent;
187 181
188} tEplEventNmtStateChange; 182} tEplEventNmtStateChange;
189 183
190
191// structure for kEplEventTypeHeartbeat 184// structure for kEplEventTypeHeartbeat
192typedef struct 185typedef struct {
193{ 186 unsigned int m_uiNodeId; // NodeId
194 unsigned int m_uiNodeId; // NodeId 187 tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN)
195 tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN) 188 WORD m_wErrorCode; // EPL error code in case of NMT state NotActive
196 WORD m_wErrorCode; // EPL error code in case of NMT state NotActive
197 189
198} tEplHeartbeatEvent; 190} tEplHeartbeatEvent;
199 191
200 192typedef enum {
201typedef enum 193 kEplNmtNodeEventFound = 0x00,
202{ 194 kEplNmtNodeEventUpdateSw = 0x01, // application shall update software on CN
203 kEplNmtNodeEventFound = 0x00, 195 kEplNmtNodeEventCheckConf = 0x02, // application / Configuration Manager shall check and update configuration on CN
204 kEplNmtNodeEventUpdateSw = 0x01, // application shall update software on CN 196 kEplNmtNodeEventUpdateConf = 0x03, // application / Configuration Manager shall update configuration on CN (check was done by NmtMn module)
205 kEplNmtNodeEventCheckConf = 0x02, // application / Configuration Manager shall check and update configuration on CN 197 kEplNmtNodeEventVerifyConf = 0x04, // application / Configuration Manager shall verify configuration of CN
206 kEplNmtNodeEventUpdateConf = 0x03, // application / Configuration Manager shall update configuration on CN (check was done by NmtMn module) 198 kEplNmtNodeEventReadyToStart = 0x05, // issued if EPL_NMTST_NO_STARTNODE set
207 kEplNmtNodeEventVerifyConf = 0x04, // application / Configuration Manager shall verify configuration of CN 199 // application must call EplNmtMnuSendNmtCommand(kEplNmtCmdStartNode) manually
208 kEplNmtNodeEventReadyToStart= 0x05, // issued if EPL_NMTST_NO_STARTNODE set 200 kEplNmtNodeEventNmtState = 0x06,
209 // application must call EplNmtMnuSendNmtCommand(kEplNmtCmdStartNode) manually 201 kEplNmtNodeEventError = 0x07, // NMT error of CN
210 kEplNmtNodeEventNmtState = 0x06,
211 kEplNmtNodeEventError = 0x07, // NMT error of CN
212 202
213} tEplNmtNodeEvent; 203} tEplNmtNodeEvent;
214 204
215 205typedef enum {
216typedef enum 206 kEplNmtNodeCommandBoot = 0x01, // if EPL_NODEASSIGN_START_CN not set it must be issued after kEplNmtNodeEventFound
217{ 207 kEplNmtNodeCommandSwOk = 0x02, // application updated software on CN successfully
218 kEplNmtNodeCommandBoot = 0x01, // if EPL_NODEASSIGN_START_CN not set it must be issued after kEplNmtNodeEventFound 208 kEplNmtNodeCommandSwUpdated = 0x03, // application updated software on CN successfully
219 kEplNmtNodeCommandSwOk = 0x02, // application updated software on CN successfully 209 kEplNmtNodeCommandConfOk = 0x04, // application / Configuration Manager has updated configuration on CN successfully
220 kEplNmtNodeCommandSwUpdated = 0x03, // application updated software on CN successfully 210 kEplNmtNodeCommandConfReset = 0x05, // application / Configuration Manager has updated configuration on CN successfully
221 kEplNmtNodeCommandConfOk = 0x04, // application / Configuration Manager has updated configuration on CN successfully 211 // and CN needs ResetConf so that the configuration gets actived
222 kEplNmtNodeCommandConfReset = 0x05, // application / Configuration Manager has updated configuration on CN successfully 212 kEplNmtNodeCommandConfErr = 0x06, // application / Configuration Manager failed on updating configuration on CN
223 // and CN needs ResetConf so that the configuration gets actived 213 kEplNmtNodeCommandStart = 0x07, // if EPL_NMTST_NO_STARTNODE set it must be issued after kEplNmtNodeEventReadyToStart
224 kEplNmtNodeCommandConfErr = 0x06, // application / Configuration Manager failed on updating configuration on CN
225 kEplNmtNodeCommandStart = 0x07, // if EPL_NMTST_NO_STARTNODE set it must be issued after kEplNmtNodeEventReadyToStart
226 214
227} tEplNmtNodeCommand; 215} tEplNmtNodeCommand;
228 216
229 217typedef enum {
230typedef enum 218 kEplNmtBootEventBootStep1Finish = 0x00, // PreOp2 is possible
231{ 219 kEplNmtBootEventBootStep2Finish = 0x01, // ReadyToOp is possible
232 kEplNmtBootEventBootStep1Finish = 0x00, // PreOp2 is possible 220 kEplNmtBootEventCheckComFinish = 0x02, // Operational is possible
233 kEplNmtBootEventBootStep2Finish = 0x01, // ReadyToOp is possible 221 kEplNmtBootEventOperational = 0x03, // all mandatory CNs are Operational
234 kEplNmtBootEventCheckComFinish = 0x02, // Operational is possible 222 kEplNmtBootEventError = 0x04, // boot process halted because of an error
235 kEplNmtBootEventOperational = 0x03, // all mandatory CNs are Operational
236 kEplNmtBootEventError = 0x04, // boot process halted because of an error
237 223
238} tEplNmtBootEvent; 224} tEplNmtBootEvent;
239 225
240
241//--------------------------------------------------------------------------- 226//---------------------------------------------------------------------------
242// function prototypes 227// function prototypes
243//--------------------------------------------------------------------------- 228//---------------------------------------------------------------------------
244 229
245 230#endif // #ifndef _EPLNMT_H_
246#endif // #ifndef _EPLNMT_H_
247
248