annotate gsm-fw/ccd/fdd_ci.c @ 648:970d6199f2c5

gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 04 Sep 2014 05:48:57 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
648
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 | Project : CCD
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 | Modul : fdd_ci.c
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 | Copyright 2004 Texas Instruments Deutschland GmbH
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 | All rights reserved.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 |
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 | Instruments Deutschland GmbH
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 | Texas Instruments Deutschland GmbH.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 | Purpose : Definition of encoding and decoding functions for FDD_CI type
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 +-----------------------------------------------------------------------------
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23 * standard definitions like GLOBAL, UCHAR, ERROR etc.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 #include "typedefs.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 #include "header.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 * Types and functions for bit access and manipulation
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 #include "ccd_globs.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33 * Function prototypes of CCD-CCDDATA interface
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
34 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
35 #include "ccddata.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
36
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
37
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
38 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
39 * Prototypes of ccd internal functions
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
40 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 #include "ccd.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42 #include "bitfun.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
43
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45 * Declaration of coder/decoder tables
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47 #include "ccdtable.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 #if !(defined (CCD_TEST))
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 #include "vsi.h"
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 #endif
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 #ifndef RUN_INT_RAM
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 /* Attention: static data, only used in cdc_fdd_ci_decode */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 static const U8 params_bSize[17] =
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 0,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 10,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 19, 28,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 36, 44, 52, 60,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 67, 74, 81, 88, 95, 102, 109, 116,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 122
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 };
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 +--------------------------------------------------------------------+
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 | PROJECT : CCD MODULE : cdc_fdd_ci_decode |
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 +--------------------------------------------------------------------+
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 PURPOSE : Decoding of the FDD_CELL_INFORMATION Field reusing
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 RANGE 1024 format of frequency list information.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 The IE is preceded by FDD_Indic0(1 bit) and made of the
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 following two IEs:
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 1) NR_OF_FDD_CELLS(5 bit field),
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 2) FDD_CELL_INFORMATION information parameters
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 FDD_Indic0 indicates if the parameter value '0000000000'
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 is a member of the set.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 FDD_CELL_INFORMATION or "Scrambling Codes and Diversity
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 Field" is a bit filed of length
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
81 p(Number_of_Scrambling_Codes_and_Diversity),
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
82 whereas the function p(x) is defined by the table below
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
83 with n = Number_of_Scrambling_Codes_and_Diversity.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 n p n p n p n p
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 0 0 5 44 10 81 15 116
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 1 10 6 52 11 88 16 122
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 2 19 7 60 12 95 17-31 0
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
88 3 28 8 67 13 102
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 4 36 9 74 14 109
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91 The message is sent from net to MS and a MS supporting
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
92 enhanced measurements has to understand it.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
93
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
94 The space this IE takes in the C-structure is made of a
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
95 counter for the number of decoded parameter and an array
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
96 of them.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
97 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 SHORT cdc_fdd_ci_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 U8 ListSize = 0;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 U16 ListBitLen = 0;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103 ULONG cix_ref, num_prolog_steps, prolog_step_ref;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
104 short *w;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 #ifdef DEBUG_CCD
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 TRACE_CCD (globs, "cdc_fdd_ci_decode()");
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108 #ifdef CCD_SYMBOLS
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 TRACE_CCD (globs, "decoding list %s with range 1024 format",
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 ccddata_get_alias((USHORT) e_ref, 1));
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 #else
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 TRACE_CCD (globs, "decoding elem %d with range 1024 format", melem[e_ref].elemRef);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 #endif
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 #endif
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 globs->SeekTLVExt = FALSE;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 cix_ref = melem[e_ref].calcIdxRef;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 num_prolog_steps = calcidx[cix_ref].numPrologSteps;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 prolog_step_ref = calcidx[cix_ref].prologStepRef;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 * if this element have a defined Prolog
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 * we have to process it before decoding the bitstream
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 if (num_prolog_steps)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 ccd_performOperations (num_prolog_steps, prolog_step_ref, globs);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 * First read NR_OF_FDD_CELLS (5 bits).
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 globs->pstructOffs = melem[e_ref].structOffs;;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 bf_readBits (5, globs);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 ListSize = globs->pstruct[globs->pstructOffs++];
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 /* If n=0 there is nothing to do for this IE. */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 if (!ListSize)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 return 1;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 /* Read the corresponding bit number or suppose the maximum length. */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 if (ListSize <= 16)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147 ListBitLen = params_bSize [ListSize];
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 else
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 /* If n>17 there is nothing to do for this IE. */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 return 1;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 * Bit size for params is bigger than the size of unread bits in the
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 * message buffer. Danger: buffer overwriting!
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 if ( ListBitLen > globs->maxBitpos - globs->bitpos)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 ccd_recordFault (globs, ERR_ELEM_LEN, BREAK, (USHORT) e_ref,
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 globs->pstruct + globs->pstructOffs);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 ListBitLen = (U16)(globs->maxBitpos - globs->bitpos);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 * Use dynamic memory for calculation instead of global memory or stack.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
168 MALLOC (w, 257 * sizeof (U16));
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170 /* Decode the W-parameter. */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 cdc_decode_param (param_1024, w, ListBitLen, globs);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174 * Decode and set the remaining channel number according the
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 * algorithm described in GSM 4.08.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 cdc_decode_frequencies (1023, &w[0], 0, FDD_CI_LIST, globs);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 /* Free the dynamic allocated memory. */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 MFREE (w);
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 return 1;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 #endif /* !RUN_INT_RAM */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 #ifndef RUN_INT_RAM
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 /*
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 +--------------------------------------------------------------------+
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 | PROJECT : CCD MODULE : cdc_fdd_ci_encode |
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 +--------------------------------------------------------------------+
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 PURPOSE : Encoding function is not needed, since this message is
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 sent only from net to MS.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 It could be only useful for testing procedure if there
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 were an encoder function at this place.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 This will be a future work.
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 SHORT cdc_fdd_ci_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs)
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 {
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 #ifdef DEBUG_CCD
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 TRACE_CCD (globs, "cdc_fdd_ci_encode()");
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 #endif
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 #ifdef TARGET_WIN32
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 /* TBD */
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 #endif
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 return 1;
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 }
970d6199f2c5 gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210 #endif /* !RUN_INT_RAM */