comparison src/cs/layer1/hmacs/macs_cst.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /************* Revision Control System Header *************
2 * GSM Layer 1 software
3 * MACS_CST.H
4 *
5 * Filename macs_cst.h
6 * Copyright 2003 (C) Texas Instruments
7 *
8 ************* Revision Control System Header *************/
9
10 /*********************************************************/
11 /* Copyright 2003 (C) Texas Instruments */
12 /*********************************************************/
13
14 //#define MACS_VERSION 0x01 // MAC-S validated version for 1 Rx - 1 Tx (no polling) - Power measurements in Dynamic mode
15 //#define MACS_VERSION 0x02 // MAC-S validated version for multi-slot - poll responses in dynamic mode
16 //#define MACS_VERSION 0x03 // TFI filtering, fixed allocation mode for 1 Rx - 1 Tx (no PDCH release, no repeat allocation)
17 //#define MACS_VERSION 0x04 // Problem of MAC-S Read phase during Idle frames corrected - new MCU/DSP and new RLC/MAC interfaces (S921_bis v 0.7)
18 //#define MACS_VERSION 0x05 // Fixed allocation mode in multi-slot, control timeslot monitoring, PDCH release
19 //#define MACS_VERSION 0x06 // Tra parameter always respected -> no power between Rx and Tx
20 //#define MACS_VERSION 0x07 // PR field extracting in downlink blocks
21 //#define MACS_VERSION 0x08 // Fixed mode: Repeat allocation and allocation bitmap exhaustion management - BSIC setting in PRACH polling uplink blocks
22 #define MACS_VERSION 0x09 // Dynamic mode / USF granularity = 4 blocks rework
23
24 /*********************************************************/
25 /* Constants used by MAC-S */
26 /*********************************************************/
27
28 /* Data processing */
29 /*-----------------*/
30
31 /* Invalid value */
32 #define INVALID 0xFF // Non-significative value
33
34 /* No received DL blocks */
35 #define NO_DL_BLK 0xFFFFFFFF
36
37 /* USF management */
38 #define MASK_2SLOTS 0x3 // Mask used to read the d_usf_updated_gprs value
39
40 /* Timeslot test mask */
41 #define MASK_SLOT0 128 // Mask used to isolate slot 0 in a 8 bit word
42 #define MASK_ALL_SLOTS 0xFF // Mask used to remove several timeslots
43
44 /* Multi-slot */
45 /*------------*/
46
47 /* Number of timeslot */
48 #define TS_NUMBER 8 // Number of timeslots
49 #define MAX_TS_NB 7 // Highest timeslot number
50
51 /* USF granularity */
52 #define FOUR_BLOCKS 1 // USF monitored on blocks B0, B4, B8
53 #define BLOCK 0 // USF monitored on each block
54
55 /* RX - TX delay */
56 #define RXTX_DELAY 3 // 3 timeslot dealy between downlink and uplink transfer window
57
58
59 /* RLC/MAC header */
60 /*----------------*/
61
62 /* Payload and AC field reading */
63 #define PAYLOAD_SHIFT 6 // Shift number used to isolate the payload type in the RLC/MAC header
64 #define PAYLOAD_MASK 0x0003
65 #define AC_MASK 0x0100 // Mask used to isolate the AC value in the RLC/MAC control block header
66
67 /* Payload type values for downlink RLC/MAC blocks */
68 //TABLE/ PAYLOAD
69 #define DATA_BLOCK 0 //NAME/ DATA
70 #define CTRL_NO_OPTIONAL 1 //NAME/ CTRL OPT
71 #define CTRL_OPTIONAL 2 //NAME/ CTRL NO OPT
72 #define RESERVED 3 //NAME/ RESERVED
73 //END_TABLE/
74
75 /* TFI field in data blocks */
76 #define DATA_TFI_MASK 0x3e00 // Mask used to isolate the TFI field in downlink data block after one right shift
77 #define DATA_TFI_SHIFT 9 // Shift number used to isolate the TFI field in downlink data block header
78
79 /* TFI field in control blocks */
80 #define CTRL_TFI_MASK 0x003e // Mask used to isolate the TFI and D fields
81 #define CTRL_TFI_SHIFT 1 // Shift number used to isolate the TFI field in downlink control block header
82 #define MASK_D 0x0001 // Mask used to isolated the D bit
83
84 /* PR field extracting */
85 #define DATA_PR_SHIFT 14 // Data blocks
86 #define CTRL_PR_SHIFT 6 // Control blocks
87 #define PR_MASK 3 // PR <-> 2 bits
88
89 /* TFI filtering result */
90 /*----------------------*/
91
92 #define TFI_BIT_MASK 0xf9ff
93 #define TFI_BIT_SHIFT 9 // Shift number used to access the TFI filter bit in the block header stored in the NDB
94
95 //TABLE/ TFI RESULT
96 #define TFI_NOT_FILTERED 0 //NAME/ NO FILTERING
97 #define TFI_NOT_PRESENT 1 //NAME/ NO TFI
98 #define TFI_GOOD 2 //NAME/ MS
99 #define TFI_BAD 3 //NAME/ NOT MS
100 //END_TABLE/
101
102 /* "time" values used when processing the power measurement gap */
103 #define RX_SLOT 0xF0
104 #define TX_SLOT 0xF1
105
106 #define MAX_CLASS 12
107
108 /*********************************************************/
109 /* Tables */
110 /*********************************************************/
111
112 #ifdef L1P_ASYN_C
113
114 /* Multi-slot class parameters */
115 /*-----------------------------*/
116 const T_MSCLASS_PARAMETERS MS_CLASS[MAX_CLASS+1] =
117 {
118 /*-------------------------------------------------------------*/
119 /* RX TX SUM TTA TTB TRA TRB */
120 /*-------------------------------------------------------------*/
121 {0 , 0 , 0 , 0 , 0 , 0 , 0}, /* Unused */
122 {1 , 1 , 2 , 3 , 2 , 4 , 2}, /* MS Class 1 */
123 {2 , 1 , 3 , 3 , 2 , 3 , 1}, /* MS Class 2 */
124 {2 , 2 , 3 , 3 , 2 , 3 , 1}, /* MS Class 3 */
125 {3 , 1 , 4 , 3 , 1 , 3 , 1}, /* MS Class 4 */
126 {2 , 2 , 4 , 3 , 1 , 3 , 1}, /* MS Class 5 */
127 {3 , 2 , 4 , 3 , 1 , 3 , 1}, /* MS Class 6 */
128 {3 , 3 , 4 , 3 , 1 , 3 , 1}, /* MS Class 7 */
129 {4 , 1 , 5 , 3 , 1 , 2 , 1}, /* MS Class 8 */
130 {3 , 2 , 5 , 3 , 1 , 2 , 1}, /* MS Class 9 */
131 {4 , 2 , 5 , 3 , 1 , 2 , 1}, /* MS Class 10 */
132 {4 , 3 , 5 , 3 , 1 , 2 , 1}, /* MS Class 11 */
133 {4 , 4 , 5 , 2 , 1 , 2 , 1} /* MS Class 12 */
134 };
135
136 const UWORD8 PR_CONVERSION[2][4] =
137 {
138 /*-----------------------------------------------*/
139 /* PR field 00 01 10 11 */
140 /*-----------------------------------------------*/
141 /* BTS_PWR_CTL_MODE A */ { 1 , 5 , 9 , 0 },
142 /* BTS_PWR_CTL_MODE B */ { 3 , 11 , 19 , 27 }
143 };
144
145 const UWORD8 USF_BLOCK_GRANULARITY[2] =
146 {
147 1, // One block granularity (granularity = 0)
148 4 // Four blocks granularity (granularity = 1)
149 };
150
151 #else
152 extern T_MSCLASS_PARAMETERS MS_CLASS[MAX_CLASS+1];
153 extern UWORD8 PR_CONVERSION[2][4];
154 extern UWORD8 USF_BLOCK_GRANULARITY[2];
155 #endif
156
157 /* Error type */
158 /*------------*/
159
160 #if MACS_STATUS
161 #define NEW_SET_NOT_ON_TDMA3 1 // The new_set have been setted to 1 by Layer 1 during a
162 // TDMA frame that isn't situated just before a new block period
163
164 #define MS_CLASS_TIME_ERROR 2 // Allocated resources doesn't respect the Trb or Ttb
165 // MS Class parameter
166 #define MS_CLASS_SUM_ERROR 3 // Allocated resources doesn't respect the Sum, Rx or
167 // Tx MS Class parameter
168 #define NO_MEAS_MAPPED 4 // No mesurement gap has been found
169 #define POLL_ERROR_MS_CLASS 5 // A poll response isn't transmitted because of a MS
170 // class parameter not respected or measurement gap
171 // not mapped
172 #define POLL_ERROR_DISCONTINUITY 6 // The poll responses have not been transmitted because
173 // of BCCH monitoring / SYNCHRO. change done by Layer 1
174 #define NO_RX_MONITORED 7 // NO timeslot can be monitored according to MS Class and
175 // power measurements
176 #endif
177