FreeCalypso > hg > fc-magnetite
annotate src/g23m-gprs/sndcp/sndcp_pdap.c @ 391:1da4c0cc9fc2
scripts/mkcomp-test.sh: default the new CHIPSET etc variables
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Jan 2018 20:18:45 +0000 |
parents | 219afcfc6250 |
children |
rev | line source |
---|---|
183
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 | Project : GPRS (8441) |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 | Modul : sndcp_pdap.c |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 | All rights reserved. |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 | |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 | Purpose : This modul is part of the entity SNDCP and implements all |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 | functions to handles the incoming primitives as described in |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 | the SDL-documentation (PDA-statemachine) |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 +----------------------------------------------------------------------------- |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #define ENTITY_SNDCP |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 /*==== INCLUDES =============================================================*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #include "typedefs.h" /* to get Condat data types */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "vsi.h" /* to get a lot of macros */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "macdef.h" |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "prim.h" /* to get the definitions of used SAP and directions */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "dti.h" |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "sndcp.h" /* to get the global entity definitions */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #include "sndcp_f.h" /* to get the functions to access the global arrays*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "sndcp_sdas.h" /* to get the signals to sda. */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 /*==== CONST ================================================================*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 /*==== LOCAL VARS ===========================================================*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 /*==== PRIVATE FUNCTIONS ====================================================*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /*==== PUBLIC FUNCTIONS =====================================================*/ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 /* |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 +------------------------------------------------------------------------------ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 | Function : pda_ll_data_ind |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 +------------------------------------------------------------------------------ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 | Description : Handles the primitive LL_DATA_IND |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 | |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 | Parameters : *ll_data_ind - Ptr to primitive payload |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 | |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 +------------------------------------------------------------------------------ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 GLOBAL void pda_ll_data_ind ( T_LL_DATA_IND *ll_data_ind ) |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 { |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 UBYTE sapi_index = 0; |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 TRACE_FUNCTION( "pda_ll_data_ind" ); |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 /* |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 * set service instance according to sapi in primitive |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 sndcp_get_sapi_index(ll_data_ind->sapi, &sapi_index); |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 sndcp_data->pda = & sndcp_data->pda_base[sapi_index]; |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 switch( GET_STATE( PDA ) ) |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 { |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 case PDA_DEFAULT: |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 sig_pda_sda_data_ind(ll_data_ind); |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 break; |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 default: |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 if (ll_data_ind != NULL) { |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 PFREE(ll_data_ind); |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 } |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 TRACE_ERROR( "LL_DATA_IND unexpected" ); |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 break; |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 } |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 } /* pda_ll_data_ind() */ |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |