comparison src/g23m-gsm/rr/rr_gprs.h @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Declarations for the Protocol Stack Entity
18 | Radio Resource / GPRS-enhancements
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef RR_GPRS_H
23 #define RR_GPRS_H
24
25 #define EXT_MEAS_START_CR 0x40
26
27 /* intermediate storage for data of paging indication */
28 typedef struct
29 {
30 UBYTE id_type;
31 UBYTE chan_need;
32 } T_PAGING_DATA;
33
34 typedef enum
35 {
36 START_PROC_ACTIVATE_REQ,
37 START_PROC_ENTER_LIMITED,
38 START_PROC_NORMAL_CR,
39 START_PROC_NORMAL_CS,
40 START_PROC_CFG_CHG,
41 START_PROC_GPRS_ACT,
42 START_PROC_NOTHING
43 } T_START_PROC;
44
45 typedef struct
46 {
47 UBYTE rr_sdu[24];
48 UBYTE si13_sdu[24];
49 UBYTE tma_in_progress;
50 ULONG fn;
51 UBYTE req_ref_idx;
52 UBYTE gprs_indic; /* flag MM wants GPRS or not */
53 UBYTE si13_received; /* SI13 has been received */
54 ULONG ptmsi; /* used PTMSI */
55 ULONG ptmsi2; /* used candidate PTMSI */
56 ULONG tlli; /* used tlli */
57 T_p_chan_req_des p_chan_req_des; /* Requested channel characteristics */
58 T_gprs_meas_results gprs_meas_results; /* GPRS Measurement Results */
59 UBYTE mac_req; /* */
60 T_PAGING_DATA pag_dat;
61 UBYTE cs_req; /* */
62 UBYTE gprs_suspend;
63 UBYTE gprs_resump;
64 UBYTE rac;
65 UBYTE page_mode;
66 USHORT split_pg; /* split paging cycle */
67 UBYTE use_c31;
68 UBYTE cr_pbcch_active;
69 UBYTE cr_type;
70 UBYTE cr_orig;
71 T_START_PROC start_proc;
72 UBYTE reconn_cause; /* cause sent with RRGRR_RECONNECT_REQ during PDCH Assignment procedure */
73 UBYTE tbf_est; /* indicate TBF establishment during PDCH Assignment / Cell Change Order */
74 T_DL_DATA_IND *dl_data_ind; /* store DL primitive containing d_change_order until access to new cell */
75 UBYTE bsic; /* BSIC of the new cell during Cell Change Order and CR*/
76 USHORT arfcn; /* ARFCN of the new cell during Cell Change Order and CR */
77 BOOL cco_need_reconnect_cnf; /* Flag indicating the need to send RRGRR-RECONNECT-CNF */
78 T_rai current_rai; /* last rai assigned by the network to GMM */
79 T_add_freq_list add_freq_lists[RRGRR_BA_LIST_SIZE];
80 UBYTE num_add_freq_list;
81 T_RRGRR_EXT_MEAS_REQ *rrgrr_ext_meas_req; /* save the request for GPRS Ext Measurement */
82 T_RRGRR_EXT_MEAS_CNF *rrgrr_ext_meas_cnf; /* compiled result of the GPRS Ext Measurement */
83 T_MPH_EXT_MEAS_CNF *mph_ext_meas_cnf; /* power measurement result during GPRS Ext Measurement */
84 UBYTE mph_ext_meas_num; /* number of carriers used in mph_ext_meas_cnf */
85 UBYTE ext_meas_ctrl; /* indicate a pending Ext Meas stop request */
86 BOOL is_nc2_used_in_si13; /* NC state of SI13: NC2 or !NC2 */
87 UBYTE nc_mode_of_pmo; /* NC mode of Packet Measurement Order */
88 BOOL cr_pcco_active; /* PCCO in BCCH environment, cell not synced */
89 BOOL ready_state; /* TRUE - we are in READY STATE
90 * FALSE - we are in STANDBY STATE
91 * This is actually a GMM state, but has to
92 * stored here for the NC2 handling and for
93 * calculating the C2/C32 values
94 */
95
96 #ifdef REL99
97 BOOL cbch_psi_valid; /* CBCH info on PSI8 received from GRR */
98 T_cbch cbch_psi8; /* This field is in GPRS data as this cbch info
99 * on PSI 8 could be present only when PBCCH
100 * is enabled.
101 */
102 BOOL cbch_info_rxvd_in_ptm; /* This flag is set to indicate that CBCH information was received in
103 * packet transfer mode. MPH_CBCH_COFIG_REQ should be sent to ALR
104 * only in idle mode. When transitioning again to idle mode
105 * if this flag is set, then CBCH info is given to ALR.
106 * During packet transfer mode, CBCH info could be received
107 * in SI4 or PSI8 or may need updateion because of dependent
108 * parameters change in in PSI2 or other SI messages received in PTM.
109 */
110 UBYTE nw_release;
111 #endif
112 UBYTE ba_bcch_modified; /*This flag will be set only when BA(BCCH) is modified by PMO or PCCO*/
113 } T_GPRS_DATA;
114
115 #ifdef OPTION_MULTITHREAD
116 #define hCommGRR _ENTITY_PREFIXED(hCommGRR)
117 #endif
118
119 EXTERN T_HANDLE hCommGRR; /* GRR Communication */
120
121 /*
122 * GPRS functions
123 */
124 void gprs_init_gprs_data (void);
125 void gprs_get_table_n (const T_FUNC** table,
126 USHORT* n);
127
128 /* GPRS support functions for process DATA */
129 BOOL dat_check_gprs_imm_ass (T_MPH_UNITDATA_IND* unitdata,
130 T_D_IMM_ASSIGN* imm_assign,
131 UBYTE index);
132 void dat_check_imm_ass_ext (T_MPH_UNITDATA_IND* unitdata,
133 UBYTE index);
134 UBYTE dat_check_imm_assign_pch (T_MPH_UNITDATA_IND* unitdata,
135 T_D_IMM_ASSIGN* imm_assign);
136 UBYTE dat_check_imm_ass_rej (UBYTE wait_ind);
137 UBYTE dat_check_packet_paging_ind (T_MPH_PAGING_IND* pag_ind);
138 void dat_rrgrr_channel_req (T_RRGRR_CHANNEL_REQ* chan_req);
139
140 void att_check_bsic (T_RRGRR_NCELL_SYNC_REQ* check_bsic);
141 BOOL dat_gprs_start_sabm (void);
142 void dat_rrgrr_suspend_dcch_req (T_RRGRR_SUSPEND_DCCH_REQ* suspend_dcch_req);
143 void dat_rrgrr_suspend_dcch_cnf (void);
144 void dat_rrgrr_reconnect_dcch_req (T_RRGRR_RECONNECT_DCCH_REQ* reconnect_dcch_req);
145 void dat_rrgrr_reconnect_dcch_cnf (UBYTE reconn_state);
146 void dat_rrgrr_resumed_tbf_req (T_RRGRR_RESUMED_TBF_REQ* resumed_tbf_req);
147 void dat_rrgrr_resumed_tbf_cnf (void);
148 void dat_rrgrr_data_ind (T_DL_DATA_IND* dl_data_ind);
149 void dat_rrgrr_change_order (T_DL_DATA_IND* dl_data_ind,
150 T_D_CHANGE_ORDER* d_change_order);
151 void dat_ask_paging_ind (T_MPH_PAGING_IND* pag_ind);
152 void dat_ask_paging_ind_pa_only (T_MPH_PAGING_IND* pag_ind);
153 void dat_stop_dcch_ind (UBYTE stop_cause);
154 void dat_rrgrr_data_req (T_RRGRR_DATA_REQ* data_req);
155 void dat_rrgrr_gprs_data_req (T_RRGRR_GPRS_DATA_REQ* data_req);
156 BOOL dat_check_packet_access (void);
157 void dat_rrgrr_rr_est_req (T_RRGRR_RR_EST_REQ* est_req);
158 void dat_rrgrr_rr_est_rsp (T_RRGRR_RR_EST_RSP* rr_est_rsp);
159 void dat_rrgrr_activate_req (T_RRGRR_ACTIVATE_REQ* act_req);
160 void dat_set_gprs_resump (T_RR_RELEASE_IND* rr_release_ind);
161 void dat_gprs_suspend_req (void);
162 void dat_gprs_set_suspended (void);
163 #ifdef REL99
164 BOOL dat_gprs_cell_in_ptm (void);
165 #endif
166
167
168 /* GPRS support functions for process ATTACHEMENT */
169 void att_signal_gprs_support (void);
170 void att_for_sysinfo_type13 (T_MPH_UNITDATA_IND* data_ind,
171 T_D_SYS_INFO_13* sys_info_13);
172 void att_set_gprs_indication (UBYTE gprs_indic);
173 void att_add_ptmsi (T_MPH_IDENTITY_REQ* mph_identity_req);
174 void att_rrgrr_cr_ind (UBYTE type);
175 void att_rrgrr_cr_req (T_RRGRR_CR_REQ* cr_req);
176 void att_rrgrr_stop_mon_ccch_req (T_RRGRR_STOP_MON_CCCH_REQ* stop_ccch);
177 void att_check_gprs_supp (UBYTE v_gprs_ind,
178 T_gprs_indic* data);
179 void att_rrgrr_start_mon_ccch_req (T_RRGRR_START_MON_CCCH_REQ* start_ccch);
180 void att_rrgrr_start_mon_bcch_req (T_RRGRR_START_MON_BCCH_REQ* start_bcch);
181 BOOL att_check_sync_results (T_MPH_MEASUREMENT_IND* mph_measurement_ind);
182 BOOL att_gprs_is_avail (void);
183 BOOL att_gprs_cell_has_pbcch (void);
184 void att_gprs_stop_pl (void);
185 void att_rrgrr_update_ba_req (T_RRGRR_UPDATE_BA_REQ* ba_req);
186 void att_gprs_cr_rsp (T_RRGRR_CR_RSP* cr_rsp);
187 void att_rrgrr_ext_meas_req (T_RRGRR_EXT_MEAS_REQ* ext_meas_req);
188 UBYTE rr_ext_meas_idx (USHORT arfcn);
189 void att_rrgrr_ext_meas_stop_req (T_RRGRR_EXT_MEAS_STOP_REQ* ext_meas_stop_req);
190 void att_rrgrr_meas_rep_req (T_RRGRR_MEAS_REP_REQ* s);
191 void att_gprs_idle_req (T_MPH_IDLE_REQ* idle_req);
192 BOOL att_gprs_check_ncell (void);
193 void att_start_cell_reselection_pbcch (UBYTE mode);
194 void att_cell_reselection_gprs_failed (void);
195 /*XXX*/
196 void gprs_rrgrr_stop_task (T_RRGRR_STOP_TASK_REQ* stop_task);
197
198 void gprs_rrgrr_fill_from_stored_sdu (T_sdu* to,
199 UBYTE* from);
200 void gprs_rrgrr_store_sdu (UBYTE* to,
201 T_sdu* from);
202 void att_gprs_start_task (T_RRGRR_START_TASK_REQ* start_task);
203 void att_start_cell_selection_gprs (UBYTE originator,U8 search_mode);
204 void att_start_cell_reselection_gprs (UBYTE mode);
205 void gprs_init_data_cr (void);
206 void att_convert_idle_c31_cr (UBYTE index);
207 void att_insert_c31_cr_data_in_cell (UBYTE index);
208 BOOL att_check_cell_c31 (void);
209 void att_check_c31_reselect_decision (UBYTE start_now);
210 BOOL att_check_c31_criterion (UBYTE index);
211 UBYTE att_get_next_best_c32_index (BOOL c31_calculated);
212 void att_calculate_c31_c32 (UBYTE index);
213 void att_rrgrr_standby_ind (T_RRGRR_STANDBY_STATE_IND* stdby);
214 void att_rrgrr_ready_ind (T_RRGRR_READY_STATE_IND* rdy);
215 #ifdef REL99
216 void att_rrgrr_cbch_info_ind (T_RRGRR_CBCH_INFO_IND* cbch_info);
217 #endif
218 void att_gprs_sync_req( T_RRGRR_SYNC_REQ *sync_req);
219 BOOL is_nc2_used (void);
220 #ifdef REL99
221 UBYTE att_gprs_get_nw_release (void);
222 #endif
223
224 /*
225 * States of the GPRS Process
226 * PIM - Packet Idle Mode
227 * PTM - Packet Transfer Mode
228 * PAM - Packet Access Mode
229 */
230 #define GPRS_NULL 0 /* GPRS is not activated by MM */
231 #define GPRS_ACTIVATED 1 /* GPRS is activated by MM
232 * and we are not on a cell */
233 #define GPRS_PIM_BCCH 2 /* RR has camped on a GPRS cell which has no PBCCH
234 * RR is in idle mode
235 */
236 #define GPRS_PAM_BCCH 3 /* GRR has requested the establishment of a TBF over CCCH */
237 #define GPRS_PTM_BCCH 4 /* GRR has established the TBF and transfer data */
238 #define GPRS_DEDI_SDCCH 5 /* GRR has requested a TBF but was assigned a SDCCH for further
239 * signalling */
240 #define GPRS_PIM_PBCCH 6 /* GRR has camped on a GPRS cell which has a PBCCH
241 * RR and GRR are in idle mode */
242 #define GPRS_PAM_PBCCH 7 /* GRR is establishing a TBF */
243 #define GPRS_PTM_PBCCH 8 /* GRR has established a TBF and transfers data */
244 #define GPRS_SUSPENDED_BCCH 9 /* RR is in or on its way to dedicated mode and was in a GPRS_*_BCCH state */
245 #define GPRS_SUSPENDED_PBCCH 10 /* RR is in or on its way to dedicated mode and was in a GPRS_*_PBCCH state */
246
247 EXTERN const char * const
248 STATE_GPRS_NAME[];
249 #define STATE_GPRS_NAME_INIT \
250 "GPRS_NULL", \
251 "GPRS_ACTIVATED", \
252 "GPRS_PIM_BCCH", \
253 "GPRS_PAM_BCCH", \
254 "GPRS_PTM_BCCH", \
255 "GPRS_DEDI_SDCCH", \
256 "GPRS_PIM_PBCCH", \
257 "GPRS_PAM_PBCCH", \
258 "GPRS_PTM_PBCCH", \
259 "GPRS_SUSPENDED_BCCH",\
260 "GPRS_SUSPENDED_PBCCH"
261
262
263 #define ESTCS_GPRS_1P 0x0478
264 #define ESTCS_GPRS_SB 0x0470
265 #define ESTCS_GPRS_PAGING 0x0481
266
267 #define TBF_EST_NONE 0
268 #define TBF_EST_PDCH 1
269 #define TBF_EST_CCO 2
270
271 #ifdef REL99
272 #define RR_GPRS_R97 0
273 #define RR_GPRS_R99 1
274 #define RR_GPRS_R4 2
275 #endif
276
277 #endif /* !RR_GPRS_H */