FreeCalypso > hg > fc-magnetite
annotate src/g23m-gprs/upm/upm_sndcp_control.c @ 301:a963c5c35f8d
targets/fcdev3b.conf: set DISABLE_SLEEP=1 until we find and fix the hw bug
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 31 Oct 2017 03:38:03 +0000 |
parents | 2cf312e56ee7 |
children |
rev | line source |
---|---|
197
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /*---------------------------------------------------------------------------- |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 | Project : 3G PS |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | Module : UPM |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 +----------------------------------------------------------------------------- |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 | Copyright 2003 Texas Instruments. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | All rights reserved. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 | This file is confidential and a trade secret of Texas |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | Instruments . |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | The receipt of or possession of this file does not convey |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | any rights to reproduce or disclose its contents or to |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | manufacture, use, or sell anything it may describe, in |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | whole, or in part, without the specific written consent of |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | Texas Instruments. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 +----------------------------------------------------------------------------- |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 | Purpose: SNDCP Control state machine implementation in the UPM entity. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | For design details, see: |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 | 8010.939 UPM Detailed Specification |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 +---------------------------------------------------------------------------*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /*==== DECLARATION CONTROL =================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 /*==== INCLUDES =============================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 #include "upm.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #include "upm_sndcp_control.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #include "upm_sndcp_output_handler.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "upm_aci_output_handler.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "upm_sm_output_handler.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "upm_mm_output_handler.h" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /*==== CONSTS ===============================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 /*==== TYPES ================================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 typedef void (*T_UPM_SNDCP_CONTROL_TRANSITION_FUNC)(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 typedef struct { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #ifdef DEBUG |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 T_UPM_SNDCP_CONTROL_EVENT event; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #endif /* DEBUG */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 T_UPM_SNDCP_CONTROL_TRANSITION_FUNC func; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 } T_UPM_SNDCP_CONTROL_TRANSITION; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 /*==== LOCALS ===============================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 static void state_event_error (struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 static void ignored (struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 static void handle_passive_activate(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 static void handle_active_activate(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 static void handle_passive_activate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 static void handle_active_activate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 static void handle_deactivate (struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 static void handle_sn_deactivate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 static void handle_modify_llc_link(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 static void handle_sn_modify_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 static void handle_mmpm_sequence_ind(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 static void handle_status_ind (struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 /*********************************************************************** |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 * State/Transition Table |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 static const T_UPM_SNDCP_CONTROL_TRANSITION |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 transition[UPM_SNDCP_CONTROL_NUMBER_OF_STATES] |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 [UPM_LINK_CONTROL_NUMBER_OF_EVENTS] = |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 { /* S0: UPM SNDCP INACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 M_TRANSITION(UPM_P_SN_MODIFY_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 M_TRANSITION(UPM_P_SN_STATUS_IND, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, handle_passive_activate), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, handle_active_activate), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, state_event_error) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 }, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 { /* S1: UPM SNDCP AWAIT ACTIVATE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, handle_passive_activate_cnf), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 M_TRANSITION(UPM_P_SN_MODIFY_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 M_TRANSITION(UPM_P_SN_STATUS_IND, handle_status_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, handle_deactivate) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 }, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 { /* S2: UPM SNDCP ACTIVATING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, handle_active_activate_cnf), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 M_TRANSITION(UPM_P_SN_MODIFY_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 M_TRANSITION(UPM_P_SN_STATUS_IND, handle_status_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, handle_deactivate) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 }, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 { /* S3: UPM SNDCP ACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 M_TRANSITION(UPM_P_SN_MODIFY_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 M_TRANSITION(UPM_P_SN_STATUS_IND, handle_status_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, handle_mmpm_sequence_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, handle_modify_llc_link), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, handle_deactivate) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 }, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 { /* S4: UPM SNDCP MODIFYING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 M_TRANSITION(UPM_P_SN_MODIFY_CNF, handle_sn_modify_cnf), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 M_TRANSITION(UPM_P_SN_STATUS_IND, handle_status_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, handle_mmpm_sequence_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, handle_deactivate) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 }, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 { /* S5: UPM SNDCP DEACTIVATING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 M_TRANSITION(UPM_P_SN_ACTIVATE_CNF, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 M_TRANSITION(UPM_P_SN_DEACTIVATE_CNF, handle_sn_deactivate_cnf), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 M_TRANSITION(UPM_P_SN_MODIFY_CNF, ignored), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 M_TRANSITION(UPM_P_SN_STATUS_IND, handle_status_ind), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 M_TRANSITION(UPM_P_MMPM_SEQUENCE_IND, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 M_TRANSITION(UPM_I_SNDCP_AWAIT_ESTABLISH, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 M_TRANSITION(UPM_I_SNDCP_ESTABLISH_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 M_TRANSITION(UPM_I_SNDCP_MODIFY_LLC_LINK, state_event_error), |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 M_TRANSITION(UPM_I_SNDCP_RELEASE_LLC_LINK, ignored) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 }; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 /*==== PRIVATE FUNCTIONS ====================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 | Function : state_event_error |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 | Description : General function used to report state event errors. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 | Parameters : ptr_context_data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 static void state_event_error(/*@unused@*/ struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 (void)TRACE_ERROR("UPM SNDCP Control: STATE EVENT ERROR!"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 | Function : ignored |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 | Description : General function used for transitions that shall be ignored |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 | Parameters : ptr_context_data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 static void ignored (/*@unused@*/ struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 (void)TRACE_FUNCTION("UPM SNDCP Control: Event ignored."); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
170 | Function : handle_passive_activate |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 | Description : Handle UPM_I_SNDCP_AWAIT_ESTABLISH in S0 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
173 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 | data - Pointer to compression parameters |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 static void handle_passive_activate(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 (void)TRACE_FUNCTION("handle_passive_activate"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 /* Send SN_ACTIVATE_REQ with establish flag == FALSE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 send_sn_activate_req(ptr_context_data, (T_NAS_comp_params *)data, FALSE); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 /* Go to state UPM SNDCP AWAIT ACTIVATE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 ptr_context_data->sndcp_control_state = UPM_SNDCP_AWAIT_ACTIVATE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 #ifndef UPM_WITHOUT_USER_PLANE |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 /* Suspend Uplink Data */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 upm_uplink_data_control(ptr_context_data, UPM_I_UPLINK_DATA_SUSPEND, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 (void *)UPM_LINK); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 #endif /* UPM_WITHOUT_USER_PLANE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 | Function : handle_active_activate |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 | Description : Handle UPM_I_SNDCP_ESTABLISH_LLC_LINK in S0 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 | data - Pointer to compression parameters |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 static void handle_active_activate(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 (void)TRACE_FUNCTION("handle_active_activate"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 /* Send SN_ACTIVATE_REQ with establish flag == TRUE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 send_sn_activate_req(ptr_context_data, (T_NAS_comp_params *)data, TRUE); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 /* Go to state UPM SNDCP ACTIVATING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 ptr_context_data->sndcp_control_state = UPM_SNDCP_ACTIVATING; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 | Function : handle_passive_activate_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 | Description : Handle UPM_P_SN_ACTIVATE_CNF in S1 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 static void handle_passive_activate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 (void)TRACE_FUNCTION("handle_passive_activate_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 /* Go to state UPM SNDCP ACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 ptr_context_data->sndcp_control_state = UPM_SNDCP_ACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 #ifndef UPM_WITHOUT_USER_PLANE |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 /* Resume Uplink Data */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 upm_uplink_data_control(ptr_context_data, UPM_I_UPLINK_DATA_RESUME, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 (void *)UPM_LINK); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 #endif /* UPM_WITHOUT_USER_PLANE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 /* Report link establishment to Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 upm_link_control(ptr_context_data, UPM_I_SNDCP_LLC_LINK_ESTABLISHED, NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 | Function : handle_active_activate_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 | Description : Handle UPM_P_SN_ACTIVATE_CNF in S2 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 static void handle_active_activate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 (void)TRACE_FUNCTION("handle_active_activate_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 /* Go to state UPM SNDCP ACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 ptr_context_data->sndcp_control_state = UPM_SNDCP_ACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 /* Report link establishment to Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 upm_link_control(ptr_context_data, UPM_I_SNDCP_LLC_LINK_ESTABLISHED, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 ((T_SN_ACTIVATE_CNF*)data)); /*To pass comp params*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 | Function : handle_deactivate |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 | Description : Handle UPM_I_SNDCP_RELEASE_LLC_LINK in S1, S2, S3, or S4. |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 | data - Local flag (rel_ind) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 static void handle_deactivate(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void *data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 U32 rel_ind = (U32)data; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 (void)TRACE_FUNCTION("handle_deactivate"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 /* SN_DEACTIVATE_REQ no longer sent in dispatcher function, so send here. */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 send_sn_deactivate_req( ptr_context_data->nsapi, (U8)rel_ind); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
282 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
283 /* Go to state UPM SNDCP DEACTIVATING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 ptr_context_data->sndcp_control_state = UPM_SNDCP_DEACTIVATING; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
286 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
287 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 | Function : handle_sn_deactivate_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 | Description : Handle UPM_P_SN_DEACTIVATE_CNF in S5 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 static void handle_sn_deactivate_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 (void)TRACE_FUNCTION("handle_sn_deactivate_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 /* Go to state UPM SNDCP INACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 ptr_context_data->sndcp_control_state = UPM_SNDCP_INACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 /* Report LLC link release to Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 upm_link_control(ptr_context_data, UPM_I_SNDCP_LLC_LINK_RELEASED, NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 | Function : handle_modify_llc_link |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 | Description : Handle UPM_I_SNDCP_MODIFY_LLC_LINK |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
314 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 static void handle_modify_llc_link(struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 (void)TRACE_FUNCTION("handle_modify_llc_link"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 /* At this point, relevant flags in Context Data have been set by Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 /* Send SN_MODIFY_REQ */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 send_sn_modify_req(ptr_context_data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 /* Go to state UPM SNDCP MODIFYING */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 ptr_context_data->sndcp_control_state = UPM_SNDCP_MODIFYING; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 | Function : handle_sn_modify_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 | Description : Handle UPM_P_SN_MODIFY_CNF in S4 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 | data - Not used |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 static void handle_sn_modify_cnf(struct T_CONTEXT_DATA *ptr_context_data, /*@unused@*/ /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 (void)TRACE_FUNCTION("handle_sn_modify_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 /* Go to state UPM SNDCP ACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 ptr_context_data->sndcp_control_state = UPM_SNDCP_ACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 /* Report LLC link modification completion to Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 upm_link_control(ptr_context_data, UPM_I_SNDCP_LLC_LINK_MODIFIED, NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 | Function : handle_mmpm_sequence_ind |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
357 | Description : Handle UPM_P_MMPM_SEQUENCE_IND |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
358 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
359 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
360 | data - sequence number |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 static void handle_mmpm_sequence_ind(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
364 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
365 U32 seq_no = (U32)data; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 (void)TRACE_FUNCTION("handle_mmpm_sequence_ind"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 /* Set sequence number for this NSAPI */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 upm_set_sequence_number(ptr_context_data, (U8)seq_no); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 #ifndef UPM_WITHOUT_USER_PLANE |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 /* Uplink Data Control should discard data older than the sequence number |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 * given in data for this NSAPI. */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 upm_uplink_data_control(ptr_context_data, UPM_I_UPLINK_DATA_DISCARD, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 #endif /* UPM_WITHOUT_USER_PLANE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 | Function : handle_status_ind |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 | Description : Handle UPM_P_SN_STATUS_IND |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 | Parameters : ptr_context_data - Context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 | data - SN_STATUS_IND primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 static void handle_status_ind(struct T_CONTEXT_DATA *ptr_context_data, /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 (void)TRACE_FUNCTION("handle_status_ind"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 TRACE_ASSERT( data != NULL ); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 /* If cause is any other than NO_PEER_RESPONSE, SNDCP Control should |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 * deactivate SNDCP. */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 /*lint -e613 (Possible use of null pointer 'unknown-name' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 if ( (((T_SN_STATUS_IND *)data)->ps_cause.ctrl_value != CAUSE_is_from_llc || |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 ((T_SN_STATUS_IND *)data)->ps_cause.value.llc_cause |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 !=(U16)CAUSE_LLC_NO_PEER_RES ) && |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 (((T_SN_STATUS_IND *)data)->ps_cause.ctrl_value != CAUSE_is_from_sndcp || |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 ((T_SN_STATUS_IND *)data)->ps_cause.value.sn_cause |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 != (U16)CAUSE_SN_NO_PEER_RESPONSE ) ) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
404 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 /* Go to state UPM SNDCP INACTIVE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 ptr_context_data->sndcp_control_state = UPM_SNDCP_INACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 /*lint +e613 (Possible use of null pointer 'unknown-name' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 /* Report link release to Link Control */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 upm_link_control(ptr_context_data, UPM_I_SNDCP_LLC_LINK_RELEASED, data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
413 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
414 /*==== PUBLIC FUNCTIONS =====================================================*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
415 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
416 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
417 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
418 | Function : upm_sndcp_dispatch_mmpm_sequence_ind |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 | Description : Helper function for Dispatcher. Dispatches MMPM_SEQUENCE_IND |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
421 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
422 | Parameters : ptr_prim_data - Pointer to primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 void upm_sndcp_dispatch_mmpm_sequence_ind(T_MMPM_SEQUENCE_IND *ptr_prim_data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 int entries; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 T_MMPM_npdu_list *entry; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
430 (void)TRACE_FUNCTION("upm_sndcp_dispatch_mmpm_sequence_ind"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
431 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 entries = (int)ptr_prim_data->c_npdu_list; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 entry = ptr_prim_data->npdu_list; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 /* Loop over NSAPIs in primitive, and store sequence numbers. */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
436 while (entries > 0) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
437 struct T_CONTEXT_DATA *context; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
439 context = upm_get_context_data_from_nsapi(entry->nsapi); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
440 if (context != NULL) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 upm_sndcp_control(context, UPM_P_MMPM_SEQUENCE_IND, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 (void *)entry->receive_n_pdu_number_val); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 } else { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 (void)TRACE_ERROR("Received sequence numbers for non-existent context!"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 entries--; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 send_sn_sequence_req(ptr_prim_data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
455 | Function : upm_sndcp_dispatch_sn_status_ind |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
456 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 | Description : Helper function for Dispatcher. Dispatches SN_STATUS_IND |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 | Parameters : ptr_prim_data - Pointer to primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
460 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
461 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 void upm_sndcp_dispatch_sn_status_ind(T_SN_STATUS_IND *prim) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 int nsapi; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 struct T_CONTEXT_DATA *context; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
466 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
467 (void)TRACE_FUNCTION("upm_sndcp_dispatch_sn_status_ind"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
468 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
469 /* If cause is any other than NO_PEER_RESPONSE, SNDCP Control should |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
470 * deactivate SNDCP and inform Session Management. */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
471 if ( (prim->ps_cause.ctrl_value != CAUSE_is_from_llc || |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
472 prim->ps_cause.value.llc_cause != (U16)CAUSE_LLC_NO_PEER_RES ) && |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 (prim->ps_cause.ctrl_value != CAUSE_is_from_sndcp || |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 prim->ps_cause.value.sn_cause != (U16)CAUSE_SN_NO_PEER_RESPONSE ) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 ) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 /* Alert state machine */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 for (nsapi = (int)NAS_NSAPI_5; nsapi < NAS_SIZE_NSAPI; nsapi++) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
478 if ( (prim->nsapi_set & upm_nsapi2nsapi_set(nsapi)) != 0 ) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
479 context = upm_get_context_data_from_nsapi(nsapi); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
480 if (context != NULL) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
481 upm_sndcp_control(context, UPM_P_SN_STATUS_IND, prim); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
482 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 /* Release context data if applicable (link and DTI both down) */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 upm_check_for_released_context_and_release(context); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
487 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
488 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
489 /* Inform Session Management -- Once for all NSAPIs affected */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 send_sm_status_req(prim->nsapi_set, (T_PS_sapi)prim->sapi, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 prim->ps_cause.ctrl_value, prim->ps_cause.value.sn_cause); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 /* No action if cause is NO_PEER_RESPONSE */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 | Function : upm_sndcp_dispatch_sn_sequence_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 | Description : Helper function for Dispatcher. Dispatches SN_SEQUENCE_CNF |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 | Parameters : ptr_prim_data - Pointer to primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 void upm_sndcp_dispatch_sn_sequence_cnf(T_SN_SEQUENCE_CNF *prim) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 (void)TRACE_FUNCTION("upm_sndcp_dispatch_sn_sequence_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 /* No action needed but forwarding sequence numbers to MM */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
510 send_mmpm_sequence_res(prim); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
511 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 | Function : upm_sndcp_dispatch_sn_count_cnf |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 | Description : Helper function for Dispatcher. Dispatches SN_COUNT_CNF |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 | Parameters : prim - Pointer to primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 void upm_sndcp_dispatch_sn_count_cnf(T_SN_COUNT_CNF *prim) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 (void)TRACE_FUNCTION("upm_sndcp_dispatch_sn_count_cnf"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 /* No action needed but forwarding as UPM_COUNT_CNF */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 send_upm_count_cnf(prim->nsapi, prim->octets_uplink, prim->octets_downlink, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 prim->packets_uplink, prim->packets_downlink); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
533 | Function : upm_sndcp_dispatch_upm_count_req |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 | Description : Helper function for Dispatcher. Dispatches UPM_COUNT_REQ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 | Parameters : prim - Pointer to primitive |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
538 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
539 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 void upm_sndcp_dispatch_upm_count_req(T_UPM_COUNT_REQ *prim) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 (void)TRACE_FUNCTION("upm_sndcp_dispatch_upm_count_req"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 /* No action needed but forwarding as SN_COUNT_REQ */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
545 send_sn_count_req(prim->nsapi, prim->reset); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
546 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 | Function : upm_sndcp_control_init |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 | Description : SNDCP Control state machine initialization function |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
553 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
554 | Parameters : ptr_context_data - Pointer to context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 void upm_sndcp_control_init(struct T_CONTEXT_DATA *ptr_context_data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 (void)TRACE_FUNCTION("upm_sndcp_control_init"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
561 TRACE_ASSERT(ptr_context_data != NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
562 /*lint -e613 (Possible use of null pointer 'ptr_context_data' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 ptr_context_data->sndcp_control_state = UPM_SNDCP_INACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
564 ptr_context_data->gprs_data.pkt_flow_id = (U8)PS_PKT_FLOW_ID_NOT_PRES; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
565 /*lint +e613 (Possible use of null pointer 'ptr_context_data' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
569 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
570 | Function : upm_sndcp_control_exit |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 | Description : SNDCP Control state machine exit function |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 | Parameters : ptr_context_data - Pointer to context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 void upm_sndcp_control_exit(struct T_CONTEXT_DATA *ptr_context_data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
579 (void)TRACE_FUNCTION("upm_sndcp_control_exit"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
580 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 TRACE_ASSERT(ptr_context_data != NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
582 /*lint -e613 (Possible use of null pointer 'ptr_context_data' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
583 ptr_context_data->sndcp_control_state = UPM_SNDCP_INACTIVE; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 ptr_context_data->gprs_data.pkt_flow_id = (U8)PS_PKT_FLOW_ID_NOT_PRES; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
585 /*lint +e613 (Possible use of null pointer 'ptr_context_data' in left argument to operator '->') */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
586 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
587 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
588 /* |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
589 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
590 | Function : upm_sndcp_control |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
591 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
592 | Description : SNDCP Control state machine |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 | |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 | Parameters : ptr_context_data - Pointer to context data |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
595 | event - Internal event (see upm_sndcp_control.h) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
596 | data - Event dependent parameter |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
597 +------------------------------------------------------------------------------ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
598 */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 void upm_sndcp_control (struct T_CONTEXT_DATA *ptr_context_data, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 T_UPM_SNDCP_CONTROL_EVENT event, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
601 /*@null@*/ void* data) |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
602 { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
603 #ifdef DEBUG |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
604 T_UPM_SNDCP_CONTROL_STATE old_state; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
605 /*@observer@*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 static const char *state_name[UPM_SNDCP_CONTROL_NUMBER_OF_STATES] = { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
607 "S0_UPM_SNDCP_INACTIVE", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
608 "S1_UPM_SNDCP_AWAIT_ACTIVATE", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
609 "S2_UPM_SNDCP_ACTIVATING", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 "S3_UPM_SNDCP_ACTIVE", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 "S4_UPM_SNDCP_MODIFYING", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 "S5_UPM_SNDCP_DEACTIVATING" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 }; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 /*@observer@*/ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 static const char *event_name[UPM_LINK_CONTROL_NUMBER_OF_EVENTS] = { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 "UPM_P_SN_ACTIVATE_CNF", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
617 "UPM_P_SN_DEACTIVATE_CNF", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
618 "UPM_P_SN_MODIFY_CNF", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 "UPM_P_SN_STATUS_IND", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
620 "UPM_P_MMPM_SEQUENCE_IND", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
621 "UPM_I_SNDCP_AWAIT_ESTABLISH", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
622 "UPM_I_SNDCP_ESTABLISH_LLC_LINK", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
623 "UPM_I_SNDCP_MODIFY_LLC_LINK", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
624 "UPM_I_SNDCP_RELEASE_LLC_LINK" |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 }; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
626 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
627 TRACE_ASSERT(ptr_context_data != NULL); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 TRACE_ASSERT(event < UPM_SNDCP_CONTROL_NUMBER_OF_EVENTS); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 old_state = ptr_context_data->sndcp_control_state; |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 if (transition[(U16)old_state][(U16)event].event != event) { |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 (void)TRACE_ERROR("Event table error in upm_sndcp_control!"); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 #endif /* DEBUG */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 transition[(U16)ptr_context_data->sndcp_control_state][(U16)event].func(ptr_context_data, data); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
638 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
639 #ifdef DEBUG |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
640 (void)TRACE_EVENT_P4("SNDCP #%d: %s => %s to %s", |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 ptr_context_data->nsapi, |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 event_name[(U16)event], |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 state_name[(U16)old_state], |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
644 state_name[(U16)ptr_context_data->sndcp_control_state]); |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
645 #endif /* DEBUG */ |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
646 } |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
647 |
2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
648 /*==== END OF FILE ==========================================================*/ |