comparison gsm-fw/g23m-gsm/rr/rr_em.h @ 673:2f7df7a314f8

gsm-fw/g23m-gsm subtree: initial import from LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 28 Sep 2014 23:20:04 +0000
parents
children
comparison
equal deleted inserted replaced
672:0dc6f9e8e980 673:2f7df7a314f8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Engineering Mode (EM) Declarations + Macros
18 |
19 +-----------------------------------------------------------------------------
20 */
21 #ifndef RR_EM_H
22 #define RR_EM_H
23
24 #ifdef FF_EM_MODE
25
26
27 /* ------------ data declarations for EM ---------------- */
28
29 /*This value is used for function dat_em_nc_info_req to avoid a magic number*/
30
31 #define EM_MAX_NUM_NC 6
32
33 /*
34 * Buffer is by one bigger than max. number of prims, because it
35 * needs always one termination entry.
36 * To optimize the buffersize, the data is packed in the buffer as follows:
37 * type, length, value
38 * Value is the combination of the additional parameters as defined in 8443.601, coded as UBYTE.
39 */
40 #define EM_RR_SEM_SIZE 220
41
42 /*
43 * EM_MAX_RR_EVENTS defines maximum number of event traces for the engineering mode.
44 * The number is increased by one to ensure that the event numbers defined in the
45 * corresponding document are the same as in the sources.
46 */
47 #define EM_MAX_RR_EVENTS 38
48
49 /*
50 * The offset is used to indicate the source entity the event trace is from.
51 * L1/ALR = 0x00, DL = 0x2D, RR = 0x37, MM = 0x5F, CC = 0x78, SS = 0xAF, SMS = 0xBE, SIM = E1
52 */
53 #define RR_OFFSET 0x37
54
55 /*
56 * Definitions for the additional parameters used for the event tracing.
57 */
58 #define EM_NORMAL 1
59 #define EM_EXTENDED 2
60 #define EM_REJECT 3
61 #define EM_RECONNECT 4
62 #define EM_TCH_CLOSE 0
63 #define EM_TCH_OPEN 1
64 /*
65 #define EM_PLMN_SEARCH_STARTED 0
66 #define EM_PLMN_SEARCH_FINISHED 1
67 #define EM_SEARCH_STARTED 0
68 */
69 #define EM_SEARCH_FAILED 1
70 #define EM_SEARCH_PASSED 2
71 #define EM_STATUS_RX 0
72 #define EM_STATUS_TX 1
73
74 /*
75 * Type is combination of entity index(upper nibble) plus event number(lower nibble).
76 * Bit 8 7 6 5 4 3 2 1
77 * | entity | event number |
78 */
79
80 #define RR_V_1 (1 + RR_OFFSET)
81 #define RR_V_2 (2 + RR_OFFSET)
82 #define RR_V_3 (3 + RR_OFFSET)
83
84 #define RR_V_5 (5 + RR_OFFSET)
85 #define RR_V_6 (6 + RR_OFFSET)
86 #define RR_V_7 (7 + RR_OFFSET)
87 #define RR_V_8 (8 + RR_OFFSET)
88 #define RR_V_9 (9 + RR_OFFSET)
89 #define RR_V_10 (10+ RR_OFFSET)
90 #define RR_V_11 (11+ RR_OFFSET)
91 #define RR_V_12 (12+ RR_OFFSET)
92 #define RR_V_13 (13+ RR_OFFSET)
93 #define RR_V_14 (14+ RR_OFFSET)
94 #define RR_V_15 (15+ RR_OFFSET)
95 #define RR_V_16 (16+ RR_OFFSET)
96 #define RR_V_17 (17+ RR_OFFSET)
97 #define RR_V_18 (18+ RR_OFFSET)
98 #define RR_V_19 (19+ RR_OFFSET)
99 #define RR_V_20 (20+ RR_OFFSET)
100 #define RR_V_21 (21+ RR_OFFSET)
101 #define RR_V_22 (22+ RR_OFFSET)
102 #define RR_V_23 (23+ RR_OFFSET)
103 #define RR_V_24 (24+ RR_OFFSET)
104 #define RR_V_25 (25+ RR_OFFSET)
105 #define RR_V_26 (26+ RR_OFFSET)
106 #define RR_V_27 (27+ RR_OFFSET)
107 #define RR_V_28 (28+ RR_OFFSET)
108 #define RR_V_29 (29+ RR_OFFSET)
109 #define RR_V_30 (30+ RR_OFFSET)
110 #define RR_V_31 (31+ RR_OFFSET)
111 #define RR_V_32 (32+ RR_OFFSET)
112 #define RR_V_33 (33+ RR_OFFSET)
113 #define RR_V_34 (34+ RR_OFFSET)
114 #define RR_V_35 (35+ RR_OFFSET)
115 #define RR_V_36 (36+ RR_OFFSET)
116 #define RR_V_37 (37+ RR_OFFSET)
117
118 EXTERN BOOL rr_v[EM_MAX_RR_EVENTS];
119 EXTERN USHORT em_assign_fail_rr_cause;
120 EXTERN USHORT em_handover_fail_rr_cause;
121
122
123 /*#define TRACE_EVENT_EM(s) TRACE_EVENT(s)
124 #define TRACE_EVENT_EM_P1(s,a1) TRACE_EVENT_P1(s,a1)
125 #define TRACE_EVENT_EM_P2(s,a1,a2) TRACE_EVENT_P2(s,a1,a2)
126 #define TRACE_EVENT_EM_P3(s,a1,a2,a3) TRACE_EVENT_P3(s,a1,a2,a3)
127 #define TRACE_EVENT_EM_P4(s,a1,a2,a3,a4) TRACE_EVENT_P4(s,a1,a2,a3,a4)
128 #define TRACE_EVENT_EM_P5(s,a1,a2,a3,a4,a5) TRACE_EVENT_P5(s,a1,a2,a3,a4,a5)
129 #define TRACE_EVENT_EM_P6(s,a1,a2,a3,a4,a5,a6) TRACE_EVENT_P6(s,a1,a2,a3,a4,a5,a6)
130 #define TRACE_EVENT_EM_P8(s,a1,a2,a3,a4,a5,a6,a7,a8) TRACE_EVENT_P8(s,a1,a2,a3,a4,a5,a6,a7,a8)*/
131 #define TRACE_EVENT_EM(s) TRACE_USER_CLASS (TC_USER8,s)
132 #define TRACE_EVENT_EM_P1(s,a1) TRACE_USER_CLASS_P1(TC_USER8,s,a1)
133 #define TRACE_EVENT_EM_P2(s,a1,a2) TRACE_USER_CLASS_P2(TC_USER8,s,a1,a2)
134 #define TRACE_EVENT_EM_P3(s,a1,a2,a3) TRACE_USER_CLASS_P3(TC_USER8,s,a1,a2,a3)
135 #define TRACE_EVENT_EM_P4(s,a1,a2,a3,a4) TRACE_USER_CLASS_P4(TC_USER8,s,a1,a2,a3,a4)
136 #define TRACE_EVENT_EM_P5(s,a1,a2,a3,a4,a5) TRACE_USER_CLASS_P5(TC_USER8,s,a1,a2,a3,a4,a5)
137 #define TRACE_EVENT_EM_P6(s,a1,a2,a3,a4,a5,a6) TRACE_USER_CLASS_P6(TC_USER8,s,a1,a2,a3,a4,a5,a6)
138 #define TRACE_EVENT_EM_P8(s,a1,a2,a3,a4,a5,a6,a7,a8) TRACE_USER_CLASS_P8(TC_USER8,s,a1,a2,a3,a4,a5,a6,a7,a8)
139
140 /*---------Functions ---------*/
141
142 EXTERN void dat_em_sc_info_req (T_EM_SC_INFO_REQ *em_sc_info_req);
143 EXTERN void dat_em_nc_info_req (T_EM_NC_INFO_REQ *em_nc_info_req);
144 EXTERN void dat_em_loc_pag_info_req (T_EM_LOC_PAG_INFO_REQ *em_loc_pag_info_req);
145 EXTERN void dat_em_plmn_info_req (T_EM_PLMN_INFO_REQ *em_plmn_info_req);
146 EXTERN void dat_em_cip_hop_dtx_info_req (T_EM_CIP_HOP_DTX_INFO_REQ *em_cip_hop_dtx_info_req);
147 EXTERN void dat_em_mobdata_power_info_req (T_EM_POWER_INFO_REQ *em_power_info_req);
148 EXTERN void dat_em_mobdata_id_info_req (T_EM_IDENTITY_INFO_REQ *em_identity_info_req);
149 EXTERN void dat_em_mobdata_version_info_req (T_EM_SW_VERSION_INFO_REQ *em_sw_version_info_req);
150 EXTERN void dat_em_amr_info_req (T_EM_AMR_INFO_REQ *em_amr_info_req);
151 EXTERN void dat_em_get_hchn (USHORT* channel_array, USHORT* channel2_array, UBYTE v_start, UBYTE maio2);
152 EXTERN UBYTE em_get_first_codec (UBYTE acs);
153 EXTERN void em_init_rr_event_trace (void);
154 EXTERN void rr_em_rr_event_req (T_EM_RR_EVENT_REQ *em_rr_event_req);
155 EXTERN void rr_em_pco_trace_req (T_EM_PCO_TRACE_REQ *em_pco_trace_req);
156
157 #if !defined (WIN32)
158 EXTERN CHAR* sim_version();
159 EXTERN CHAR* sms_version();
160 EXTERN CHAR* ss_version ();
161 EXTERN CHAR* cc_version ();
162 EXTERN CHAR* mm_version ();
163 EXTERN CHAR* rr_version ();
164 EXTERN CHAR* dl_version ();
165 EXTERN CHAR* l1_version ();
166 #endif
167
168 /*---------FMM--------------*/
169 EXTERN void dat_em_fmm_reselection_start_ind (void);
170 EXTERN void dat_em_fmm_reselection_end_ind (void);
171 EXTERN void dat_em_fmm_sc_info_req (T_EM_FMM_SC_INFO_REQ *em_fmm_sc_info_req);
172 EXTERN void dat_em_fmm_nc_info_req (T_EM_FMM_NC_INFO_REQ *em_fmm_nc_info_req);
173
174 /*
175 * If all entities are linked into one module this definitions
176 * prefixes all this functions with the enity name
177 */
178 #ifdef OPTION_MULTITHREAD
179 #define em_write_buffer_2 _ENTITY_PREFIXED(em_write_buffer_2)
180 #define em_write_buffer_3 _ENTITY_PREFIXED(em_write_buffer_3)
181 #define em_write_buffer_3a _ENTITY_PREFIXED(em_write_buffer_3a)
182 #define em_write_buffer_4 _ENTITY_PREFIXED(em_write_buffer_4)
183 #define em_write_buffer_4a _ENTITY_PREFIXED(em_write_buffer_4a)
184 #define em_write_buffer_4b _ENTITY_PREFIXED(em_write_buffer_4b)
185 #define em_write_buffer_4c _ENTITY_PREFIXED(em_write_buffer_4c)
186 #define em_write_buffer_5 _ENTITY_PREFIXED(em_write_buffer_5)
187 #define em_write_buffer_5c _ENTITY_PREFIXED(em_write_buffer_5c)
188 #define em_write_buffer_8 _ENTITY_PREFIXED(em_write_buffer_8)
189 #define em_write_buffer_9 _ENTITY_PREFIXED(em_write_buffer_9)
190 #endif
191
192 EXTERN UBYTE em_write_buffer_2 (UBYTE event_no);
193 EXTERN UBYTE em_write_buffer_3 (UBYTE event_no, UBYTE value);
194 EXTERN UBYTE em_write_buffer_3a (UBYTE event_no, USHORT value);
195 EXTERN UBYTE em_write_buffer_4 (UBYTE event_no, UBYTE value1, UBYTE value2);
196 EXTERN UBYTE em_write_buffer_4a (UBYTE event_no, UBYTE value, USHORT cs);
197 EXTERN UBYTE em_write_buffer_4b (UBYTE event_no, UBYTE value, T_plmn plmn);
198 EXTERN UBYTE em_write_buffer_4c (UBYTE event_no, UBYTE value1, T_plmn plmn[MAX_PLMN]);
199 EXTERN UBYTE em_write_buffer_5 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3);
200 EXTERN UBYTE em_write_buffer_5c (UBYTE event_no, UBYTE value1, UBYTE value2, T_plmn plmn);
201 EXTERN UBYTE em_write_buffer_8 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3, UBYTE value4,
202 UBYTE value5, UBYTE value6);
203 EXTERN UBYTE em_write_buffer_9 (UBYTE event_no, UBYTE value1, UBYTE value2, UBYTE value3, UBYTE value4,
204 UBYTE value5, UBYTE value6, UBYTE value7);
205
206 /*
207 * Semaphore handling
208 * called by ACI
209 */
210 /*lint -esym(759,em_rr_sem)*/
211 /*lint -esym(759,em_rr_sem_read)*/
212 /*lint -esym(759,em_rr_sem_reset)*/
213 EXTERN UBYTE em_rr_sem (UBYTE length, UBYTE * data);
214 EXTERN void em_rr_sem_reset (void);
215 EXTERN void em_rr_sem_read (void);
216 EXTERN void em_rr_sem_init (void);
217 EXTERN void em_rr_sem_exit (void);
218 EXTERN void em_init_get_hchn (void);
219
220
221 /*------Macro Definition---*/
222
223 #define RR_EM_SET_ASSIGN_FAIL_CAUSE(x) (em_assign_fail_rr_cause = x)
224 #define RR_EM_SET_HANDOVER_FAIL_CAUSE(x) (em_handover_fail_rr_cause = x)
225 #define RR_EM_GET_HOPPING_CHANNEL(w,x,y,z) dat_em_get_hchn(w,x,y,z)
226
227 /*-----------------------Event Macro Definition -----------*/
228
229 #define EM_PLMN_SRCH_STARTED\
230 /* Search for service by MM - started */\
231 if (rr_v[1]) {\
232 rr_v[1] = em_write_buffer_3 (RR_V_1 , FULL_SERVICE);\
233 }
234
235 #define EM_CELL_SELECTION\
236 /* Search for full service by RR started */\
237 if (rr_v[2]) {\
238 rr_v[2] = em_write_buffer_2 (RR_V_2 );\
239 }
240
241 #define EM_NET_SEARCH_FAILED\
242 /* Search for service by MM/RR - failed */\
243 if (rr_v[3] ) {\
244 rr_v[3] = em_write_buffer_4 (RR_V_3 , EM_SEARCH_FAILED,\
245 abort_ind->op.service);\
246 }
247
248 #define EM_PLMN_SRCH_PASSED\
249 /* Search for service by MM/RR - passed */\
250 if (rr_v[3] ) {\
251 rr_v[3] = em_write_buffer_5c (RR_V_3 , EM_SEARCH_PASSED,\
252 rr_activate_cnf->op.service,\
253 rr_activate_cnf->plmn);\
254 }
255
256 #define EM_HPLMN_SEARCH_PASSED\
257 /* Search for HPLMN passed */\
258 if (rr_v[5])\
259 {\
260 T_plmn plmn_temp;\
261 plmn_temp.v_plmn = TRUE;\
262 memcpy(plmn_temp.mcc, rr_data->nc_data[CR_INDEX].lai.mcc, SIZE_MCC);\
263 memcpy(plmn_temp.mnc, rr_data->nc_data[CR_INDEX].lai.mnc, SIZE_MNC);\
264 rr_v[5] = em_write_buffer_4b (RR_V_5, EM_SEARCH_PASSED, plmn_temp);\
265 }
266
267 #define EM_HPLMN_SEARCH_FAILED\
268 /* Search for HPLMN failed */\
269 if (rr_v[5]) {\
270 rr_v[5] = em_write_buffer_3 (RR_V_5, EM_SEARCH_FAILED);\
271 }
272
273 #define EM_NET_SEARCH_STARTED\
274 /* Net search - started */\
275 if (rr_v[6]) {\
276 rr_v[6] = em_write_buffer_2 (RR_V_6 );\
277 }
278
279 #define EM_NET_SEARCH_PASSED\
280 /* Net search - passed */\
281 if (rr_v[7]) {\
282 rr_v[7] = em_write_buffer_4c (RR_V_7 , abort_ind->plmn_avail, abort_ind->plmn);\
283 }
284
285 #define EM_IDLE_MODE\
286 /* Idle */\
287 if (rr_v[8]) {\
288 rr_v[8] = em_write_buffer_4a (RR_V_8, rr_data->ms_data.rr_service,\
289 idle_req->arfcn);\
290 }
291
292 #define EM_CELL_RESEL_STARTED\
293 /* Cell Reselection started */\
294 if (rr_v[9]) {\
295 rr_v[9] = em_write_buffer_3 (RR_V_9 , rr_data->sc_data.selection_type);\
296 }
297
298 #define EM_CELL_RESEL_FINISHED\
299 /* Cell reselection finished */\
300 if (rr_v[10]) {\
301 rr_v[10] = em_write_buffer_3a (RR_V_10, rr_data->nc_data[SC_INDEX].arfcn);\
302 }
303
304 #define EM_PAGING_IND\
305 /* Paging */\
306 if (rr_v[11]) {\
307 rr_v[11] = em_write_buffer_4 (RR_V_11, mph_paging_ind->identity_type,\
308 mph_paging_ind->channel_needed);\
309 }
310
311 #define EM_DOWNLINK_FAILURE\
312 /* Downlink failure */\
313 if (rr_v[12]) {\
314 rr_v[12] = em_write_buffer_2 (RR_V_12);\
315 }
316
317 #define EM_CHANNEL_REQUEST_SENT\
318 /* Channel request*/\
319 if (rr_v[13]) {\
320 rr_v[13] = em_write_buffer_5 (RR_V_13, mph_random_access_cnf->frame_no.t1,\
321 mph_random_access_cnf->frame_no.t2,\
322 mph_random_access_cnf->frame_no.t3);\
323 }
324
325 #define EM_IMMEDIATE_ASSIGNMENT\
326 /* Immediate Assignment */\
327 if (rr_v[14]) {\
328 if (imm_assign->chan_desc.hop EQ H_NO)\
329 rr_v[14] = em_write_buffer_9 (RR_V_14, EM_NORMAL,\
330 imm_assign->chan_desc.chan_type,\
331 imm_assign->chan_desc.tn,\
332 imm_assign->chan_desc.tsc,\
333 imm_assign->chan_desc.hop,\
334 (UBYTE)(imm_assign->chan_desc.arfcn>>8),\
335 (UBYTE)(imm_assign->chan_desc.arfcn));\
336 else\
337 rr_v[14] = em_write_buffer_9 (RR_V_14, EM_NORMAL,\
338 imm_assign->chan_desc.chan_type,\
339 imm_assign->chan_desc.tn,\
340 imm_assign->chan_desc.tsc,\
341 imm_assign->chan_desc.hop,\
342 imm_assign->chan_desc.maio,\
343 imm_assign->chan_desc.hsn);\
344 }
345
346 #define EM_IMMEDIATE_ASSIGNMENT_EXT\
347 /* Immediate Assignment */\
348 if (rr_v[14]) {\
349 if (p_chan_desc->hop EQ H_NO)\
350 rr_v[14] = em_write_buffer_9 (RR_V_14, EM_EXTENDED,\
351 p_chan_desc->chan_type,p_chan_desc->tn,\
352 p_chan_desc->tsc, p_chan_desc->hop,\
353 (UBYTE)(p_chan_desc->arfcn>>8),\
354 (UBYTE)(p_chan_desc->arfcn));\
355 else\
356 rr_v[14] = em_write_buffer_9 (RR_V_14, EM_EXTENDED,\
357 p_chan_desc->chan_type,p_chan_desc->tn,\
358 p_chan_desc->tsc, p_chan_desc->hop,\
359 p_chan_desc->maio, p_chan_desc->hsn);\
360 }
361
362 #define EM_IMMEDIATE_ASSIGNMENT_REJECT\
363 /* Immediate Assignment reject */\
364 if (rr_v[15])\
365 rr_v[15] = em_write_buffer_3 (RR_V_15, t3122);
366
367 #define EM_DL_ESTABLISH_CNF\
368 /* Layer 2 connection establishment */\
369 if (rr_v[16]) {\
370 rr_v[16] = em_write_buffer_3 (RR_V_16, dl_establish_cnf->ch_type);\
371 }
372
373 #define EM_L2_CONNECTION_ESTABLISHED\
374 /* Layer 2 connection establishment */\
375 if (rr_v[16]) {\
376 rr_v[16] = em_write_buffer_3 (RR_V_16, dl_establish_cnf->ch_type);\
377 }
378
379 #define EM_EARLY_CLASSMARK_SENDING\
380 /* Early classmark sending */\
381 if (rr_v[17]) {\
382 rr_v[17] = em_write_buffer_2 (RR_V_17);\
383 }
384
385 #define EM_CLASSMARK_ENQUIRY\
386 /* Classmark interrogation */\
387 if (rr_v[18])\
388 rr_v[18] = em_write_buffer_2 (RR_V_18);
389
390 #define EM_ASSIGNMENT_RECEIVED\
391 /* Assignment received */\
392 if (rr_v[19]) {\
393 if (dedicated_req->ch_type.h EQ H_NO)\
394 rr_v[19] = em_write_buffer_8 (RR_V_19,\
395 dedicated_req->ch_type.ch,\
396 dedicated_req->ch_type.tn,\
397 dedicated_req->ch_type.tsc,\
398 dedicated_req->ch_type.h,\
399 (UBYTE)(dedicated_req->ch_type.arfcn>>8),\
400 (UBYTE)(dedicated_req->ch_type.arfcn));\
401 else\
402 rr_v[19] = em_write_buffer_8 (RR_V_19,\
403 dedicated_req->ch_type.ch,\
404 dedicated_req->ch_type.tn,\
405 dedicated_req->ch_type.tsc,\
406 dedicated_req->ch_type.h,\
407 dedicated_req->ch_type.maio,\
408 dedicated_req->ch_type.hsn);\
409 }
410
411 #define EM_ASS_FAILURE_RECONNECT_SUCCESS\
412 /* Assignment failure reconnect */\
413 if (rr_v[20]) {\
414 rr_v[20] = em_write_buffer_4a (RR_V_20, EM_RECONNECT, em_assign_fail_rr_cause);\
415 }
416
417 #define EM_ASS_FAILURE_RECONNECT_FAILED2\
418 /* Assignment failure reconnect */\
419 if (rr_v[20]) {\
420 rr_v[20] = em_write_buffer_4a (RR_V_20, EM_RECONNECT,\
421 em_assign_fail_rr_cause);\
422 }
423
424 #define EM_ASS_FAILURE_RECONNECT_FAILED\
425 /* Assignment failure, loss of call */\
426 if (rr_v[21]) {\
427 rr_v[21] = em_write_buffer_2 (RR_V_21);\
428 }
429
430 #define EM_ASSIGNMENT_COMPLETE\
431 /* Assignment complete */\
432 if (rr_v[22]) {\
433 rr_v[22] = em_write_buffer_2 (RR_V_22);\
434 }
435
436 #define EM_HANDOVER_CMD\
437 /* Handover */\
438 if (rr_v[23]) {\
439 if (handov_cmd->chan_desc_after.hop EQ H_NO)\
440 rr_v[23] = em_write_buffer_9 (RR_V_23, rr_data->ms_data.ho_type.si,\
441 dedicated_req->ch_type.ch,\
442 dedicated_req->ch_type.tn,\
443 dedicated_req->ch_type.tsc,\
444 dedicated_req->ch_type.h,\
445 (UBYTE)(dedicated_req->ch_type.arfcn>>8),\
446 (UBYTE)(dedicated_req->ch_type.arfcn));\
447 else\
448 rr_v[23] = em_write_buffer_9 (RR_V_23, rr_data->ms_data.ho_type.si,\
449 dedicated_req->ch_type.ch,\
450 dedicated_req->ch_type.tn,\
451 dedicated_req->ch_type.tsc,\
452 dedicated_req->ch_type.h,\
453 dedicated_req->ch_type.maio,\
454 dedicated_req->ch_type.hsn);\
455 }
456
457 #define EM_HO_FAILURE_RECONNECT_SUCCESS\
458 /* Handover failure reconnect */\
459 if (rr_v[24]) {\
460 rr_v[24] = em_write_buffer_4a (RR_V_24, EM_RECONNECT,\
461 em_handover_fail_rr_cause);\
462 }
463
464 #define EM_DL_RELEASE_IND\
465 switch (GET_STATE (STATE_DAT))\
466 {\
467 case DAT_HANDOVER:\
468 case DAT_HANDOVER_5:\
469 /* Handover failure reject */\
470 if (rr_v[24] ) {\
471 rr_v[24] = em_write_buffer_4a (RR_V_24, EM_REJECT,\
472 em_handover_fail_rr_cause);\
473 }\
474 break;\
475 case DAT_CHAN_ASS:\
476 case DAT_CHAN_ASS_2:\
477 /* Assignment failure reject */\
478 if (rr_v[20] ) {\
479 rr_v[20] = em_write_buffer_4a (RR_V_20, EM_REJECT,\
480 em_assign_fail_rr_cause);\
481 }\
482 break;\
483 default:\
484 break;\
485 }
486
487
488
489 #define EM_HO_FAILURE_RECONNECT_FAILED2\
490 /* Handover failure reconnect */\
491 if (rr_v[24]) {\
492 rr_v[24] = em_write_buffer_4a (RR_V_24, EM_RECONNECT,\
493 em_handover_fail_rr_cause);\
494 }
495
496 #define EM_HO_FAILURE_RECONNECT_FAILED\
497 /* Handover failure, loss of call */\
498 if (rr_v[25]) {\
499 rr_v[25] = em_write_buffer_2 (RR_V_25);\
500 } /* rr_v[25] */
501
502 #define EM_HANDOVER_COMPLETE\
503 /* Handover complete */\
504 if (rr_v[26]) {\
505 rr_v[26] = em_write_buffer_2 (RR_V_26);\
506 }
507
508 #define EM_FREQ_REDEF\
509 /* Freq redefinition */\
510 if (rr_v[27]) {\
511 rr_v[27] = em_write_buffer_8 (RR_V_27, freq_redef_req->ch_type.ch,\
512 freq_redef_req->ch_type.tn,\
513 freq_redef_req->ch_type.tsc,\
514 freq_redef_req->ch_type.tsc,\
515 freq_redef_req->ch_type.maio,\
516 freq_redef_req->ch_type.hsn);\
517 }
518
519 #define EM_CIPHERING_CMD\
520 /* Cipher mode setting */\
521 if (rr_v[28])\
522 rr_v[28] = em_write_buffer_2 (RR_V_28);
523
524
525 #define EM_CHANNEL_MODE_MODIFY\
526 /* Channel mode modify started */\
527 if (rr_v[29]) {\
528 rr_v[29] = em_write_buffer_3 (RR_V_29, chan_mod->chan_mode);\
529 }
530
531 #define EM_CHANNEL_MODE_MODIFY_ACK\
532 /* Channel mode modify result */\
533 if (rr_v[30]) {\
534 rr_v[30] = em_write_buffer_3 (RR_V_30, chan_mod_ack->chan_mode);\
535 }
536
537 #define EM_CHANNEL_RELEASE\
538 /* Channel release */\
539 if (rr_v[31])\
540 rr_v[31] = em_write_buffer_3a (RR_V_31, chan_rel->rr_cause);
541
542 #define EM_RADIO_LINK_FAILURE\
543 /* Radio link failure */\
544 if (rr_v[32]) {\
545 rr_v[32] = em_write_buffer_2 (RR_V_32);\
546 }
547
548 #define EM_L2_CONNECTION_LOST\
549 /* Loss of layer 2 connection */\
550 if (rr_v[33])\
551 {\
552 rr_v[33] = em_write_buffer_3a (RR_V_33, dl_release_ind->cs);\
553 }
554
555 #define EM_RR_STATUS_SEND\
556 /* Status sent */\
557 if (rr_v[34]) {\
558 rr_v[34] = em_write_buffer_4a (RR_V_34, EM_STATUS_TX, rr_status->rr_cause);\
559 }
560
561 #define EM_RR_STATUS_RECEIVED\
562 /* Status received */\
563 if (rr_v[34])\
564 rr_v[34] = em_write_buffer_3 (RR_V_34, EM_STATUS_RX);
565
566 #define EM_TCH_LOOP_CLOSED\
567 /* TCH loop closed */\
568 if (rr_v[35])\
569 rr_v[35] = em_write_buffer_3 (RR_V_35, EM_TCH_CLOSE);
570
571 #define EM_TCH_LOOP_OPEN\
572 /* TCH loop opened */\
573 if (rr_v[35])\
574 rr_v[35] = em_write_buffer_3 (RR_V_35, EM_TCH_OPEN);
575
576 #define EM_TEST_INTERFACE\
577 /* Test interface */\
578 if (rr_v[36])\
579 rr_v[36] = em_write_buffer_2 (RR_V_36);
580
581 #define EM_DEACTIVATION\
582 /* Deactivation */\
583 if (rr_v[37]) {\
584 rr_v[37] = em_write_buffer_2 (RR_V_37);\
585 }
586
587 /*-------FMM------------*/
588 #ifdef GPRS
589
590 #define EM_FMM_RESEL_START_IND \
591 /*inform FMM1251 that reselection has started*/\
592 dat_em_fmm_reselection_start_ind()
593
594 #define EM_FMM_RESEL_END_IND \
595 /*inform fmmm1251 about successfull reselection*/\
596 dat_em_fmm_reselection_end_ind()
597
598 #else /*no GPRS*/
599
600 #define EM_FMM_RESEL_START_IND /*for Microtec FMM1251 */
601 #define EM_FMM_RESEL_END_IND /*for Microtec FMM1251 */
602
603 #endif /*GPRS*/
604
605 #else /*FF_EM_MODE not defined*/
606
607
608
609 #define RR_EM_SET_ASSIGN_FAIL_CAUSE(x)
610 #define RR_EM_SET_HANDOVER_FAIL_CAUSE(x)
611 #define RR_EM_GET_HOPPING_CHANNEL(w,x,y,z)
612 #define EM_PLMN_SRCH_STARTED /* Event 1 */
613 #define EM_CELL_SELECTION /* Event 2 */
614 #define EM_NET_SEARCH_FAILED /* Event 3 */
615 #define EM_PLMN_SRCH_PASSED /* Event 3 */
616 #define EM_HPLMN_SEARCH_STARTED /* Event 4 */
617 #define EM_HPLMN_SEARCH_PASSED /* Event 5 */
618 #define EM_HPLMN_SEARCH_FAILED /* Event 5 */
619 #define EM_NET_SEARCH_STARTED /* Event 6 */
620 #define EM_NET_SEARCH_PASSED /* Event 7 */
621 #define EM_IDLE_MODE /* Event 8 */
622 #define EM_CELL_RESEL_STARTED /* Event 9*/
623 #define EM_CELL_RESEL_FINISHED /* Event 10*/
624 #define EM_PAGING_IND /* Event 11*/
625 #define EM_DOWNLINK_FAILURE /* Event 12*/
626 #define EM_CHANNEL_REQUEST_SENT /* Event 13*/
627 #define EM_IMMEDIATE_ASSIGNMENT /* Event 14*/
628 #define EM_IMMEDIATE_ASSIGNMENT_EXT /* Event 14*/
629 #define EM_IMMEDIATE_ASSIGNMENT_REJECT /* Event 15*/
630 #define EM_DL_ESTABLISH_CNF /* Event 16*/
631 #define EM_L2_CONNECTION_ESTABLISHED /* Event 16*/
632 #define EM_EARLY_CLASSMARK_SENDING /* Event 17*/
633 #define EM_CLASSMARK_ENQUIRY /* Event 18*/
634 #define EM_ASSIGNMENT_RECEIVED /* Event 19*/
635 #define EM_ASS_FAILURE_RECONNECT_SUCCESS /* Event 20*/
636 #define EM_DL_RELEASE_IND /* Event 24 or Event 20 */
637 #define EM_ASS_FAILURE_RECONNECT_FAILED2 /* Event 20*/
638 #define EM_ASS_FAILURE_RECONNECT_FAILED /* Event 21*/
639 #define EM_ASSIGNMENT_COMPLETE /* Event 22*/
640 #define EM_HANDOVER_CMD /* Event 23*/
641 #define EM_HO_FAILURE_RECONNECT_SUCCESS /* Event 24*/
642 #define EM_HO_FAILURE_RECONNECT_FAILED2 /* Event 24*/
643 #define EM_HO_FAILURE_RECONNECT_FAILED /* Event 25*/
644 #define EM_HANDOVER_COMPLETE /* Event 26*/
645 #define EM_FREQ_REDEF /* Event 27*/
646 #define EM_CIPHERING_CMD /* Event 28*/
647 #define EM_CHANNEL_MODE_MODIFY /* Event 29*/
648 #define EM_CHANNEL_MODE_MODIFY_ACK /* Event 30*/
649 #define EM_CHANNEL_RELEASE /* Event 31*/
650 #define EM_RADIO_LINK_FAILURE /* Event 32*/
651 #define EM_L2_CONNECTION_LOST /* Event 33*/
652 #define EM_RR_STATUS_SEND /* Event 34*/
653 #define EM_RR_STATUS_RECEIVED /* Event 34*/
654 #define EM_TCH_LOOP_CLOSED /* Event 35*/
655 #define EM_TCH_LOOP_OPEN /* Event 36*/
656 #define EM_TEST_INTERFACE /* Event 37*/
657 #define EM_DEACTIVATION /* Event 38*/
658
659 #define EM_FMM_RESEL_START_IND /*for Microtec FMM1251 */
660 #define EM_FMM_RESEL_END_IND /*for Microtec FMM1251 */
661
662 #endif /*FF_EM_MODE*/
663 #endif /* RR_EM_H */
664