aboutsummaryrefslogtreecommitdiffstats
path: root/src/protocol/diag_log_gsm.h
blob: c3b54b974c61bd9f507ab97d7c7c985d7e82a422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#pragma once

#include <stdint.h>

#define GSM(x)	(0x5000 + x)

enum diag_log_code_gsm {
	LOG_GSM_POWER_SCAN_C				= 0x64,
	LOG_GSM_FCCH_DECODE_C				= 0x65,
	LOG_GSM_NCELL_ACQ_C				= 0x75,
	LOG_GSM_AFC_ADJUST_C				= 0x7c,
	LOG_GSM_MON_BURST_C				= 0x82,
	LOG_GSM_BCCH_BURST_METRICS_C			= 0x85,
	LOG_GSM_GL1_HW_CMD_C				= 0x8d,
	LOG_GSM_RR_STATE_C				= 0x12c,
	LOG_GSM_RR_SIGNALING_MESSAGE_C			= 0x12f,


	//= 303,
	LOG_GSM_RR_CONTROL_CHANNEL_PARAMS_C		= 306,

	LOG_GPRS_INDICATORS_C				= 500,
	LOG_GPRS_GENERAL_PARAMS_C			= 501,
	LOG_GPRS_CELL_OPTIONS_C				= 502,
	LOG_GPRS_POWER_CONTROL_PARAMS_C			= 503,
	LOG_GPRS_MOBILE_ALLOCATION_C			= 504,
	LOG_GPRS_PBCCH_DESCRIPTION_C			= 505,
	LOG_GPRS_GRR_STATE_C				= 506,
	LOG_GPRS_RR_CELL_RESELECTION_PARAMS_C		= 507,
	LOG_GPRS_RR_CELL_RESELECTION_MEASMNTS_C		= 508,
	LOG_GPRS_RR_PSI1_C				= 509,
	LOG_GPRS_RR_PSI2_C				= 510,
	LOG_GPRS_RR_PSI3_C				= 511,
	LOG_GPRS_RLC_UL_ABNRML_RLS_COUNTS_C		= 512,
	LOG_GPRS_RLC_UL_EVENT_COUNTS_C			= 513,
	LOG_GPRS_RLC_UL_STATS_C				= 514,
	LOG_EGPRS_RLC_UL_HEADER_C			= 517,
	LOG_EGPRS_RLC_DL_HEADER_C			= 518,
	LOG_EGPRS_RLC_UL_STATS_C			= 519,
	LOG_EGPRS_RLC_DL_STATS_C			= 520,
	LOG_EGPRS_RLC_EPUAN_C				= 521,
	LOG_GPRS_RLC_DL_STATS_C				= 522,
	LOG_GPRS_RLC_UL_ACKNACK_PARAMS_C		= 523,
	LOG_GPRS_RLC_DL_ACKNACK_PARAMS_C		= 524,
	LOG_GPRS_RLC_UL_RELEASE_IND_C			= 525,
	LOG_GPRS_RLC_DL_RELEASE_IND_C			= 526,
	LOG_GPRS_RLC_UL_ACKNACK_PARAMS_VER2_C		= 527,
	LOG_GPRS_RLC_DL_ACKNACK_PARAMS_VER2_C		= 528,
	LOG_EGPRS_RLC_EPDAN_C				= 529,
	LOG_GPRS_LLC_ME_INFO_C				= 530,
	LOG_GPRS_LLC_SAPI_STATES_C			= 531,
	LOG_GPRS_LLC_XID_INFO_C				= 532,
	LOG_GPRS_LLC_PDU_STATS_C			= 533,
	LOG_GPRS_LLC_PERIODIC_STATS_C			= 534,
	LOG_GPRS_LLC_READY_TIMER_STATUS_C		= 535,
	LOG_GPRS_LLC_SEND_UI_FRAME_C			= 536,
	LOG_GPRS_LLC_RECV_UI_FRAME_C			= 537,
	LOG_GPRS_LLC_READY_TIMER_STATUS_VER2_C		= 538,
	LOG_GPRS_SNDCP_ACTIVE_PDP_CONTEXTS_C		= 540,
	LOG_GPRS_SNDCP_PDP_CONTEXT_INFO_C		= 541,
	LOG_GPRS_SNDCP_STATES_C				= 542,
	LOG_GPRS_SNDCP_PDU_STATS_C			= 543,
	LOG_GPRS_SNDCP_UL_TCP_HDR_C			= 544,
	LOG_GPRS_SNDCP_DL_TCP_HDR_C			= 545,
	LOG_GPRS_MAC_SIGNALLING_MESSAGE_C		= 550,
	LOG_GPRS_MAC_STATE_C				= 551,
	LOG_GPRS_MAC_UL_TBF_ESTABLISH_C			= 552,
	LOG_GPRS_MAC_UL_TBF_RELEASE_C			= 553,
	LOG_GPRS_MAC_DL_TBF_ESTABLISH_C			= 554,
	LOG_GPRS_MAC_DL_TBF_RELEASE_C			= 555,
	LOG_EGPRS_MAC_UL_ACKNACK_C			= 556,
	LOG_EGPRS_MAC_DL_ACKNACK_C			= 557,
	LOG_EGPRS_SRB_HARD_DECISIONS_C			= 558,
	LOG_GPRS_SM_GMM_OTA_MESSAGE_C			= 560,
	LOG_GPRS_AIR_INTERFACE_SUMMARY_C		= 561,
	LOG_GPRS_AGC_C					= 562,
	LOG_GPRS_TIMING_ADVANCE_C			= 563,
	LOG_GPRS_POWER_CONTROL_C			= 564,
	LOG_GPRS_TRANSFER_SUMMARY_C			= 565,
	LOG_GPRS_TX_SCHEDULED_RESULTS_C			= 567,
	LOG_GPRS_HW_SCHEDULE_C				= 570,
	LOG_UPLINK_TBF_DATA_BLOCK_COUNT_C		= 575,
	LOG_GPRS_RECEIVE_BURST_METRICS_A_C		= 581,
	LOG_GPRS_RECEIVE_BURST_METRICS_B_C		= 582,
	LOG_GPRS_RECEIVE_BURST_METRICS_C_C		= 583,
	LOG_GPRS_RECEIVE_BURST_METRICS_D_C		= 584,
	LOG_GPRS_RECEIVE_MSG_METRICS_A_C		= 585,
	LOG_GPRS_RECEIVE_MSG_METRICS_B_C		= 586,
	LOG_GPRS_RECEIVE_MSG_METRICS_C_C		= 587,
	LOG_GPRS_RECEIVE_MSG_METRICS_D_C		= 588,
	LOG_GPRS_RECEIVE_MSG_METRICS_A_VER2_C		= 589,
	LOG_GPRS_RECEIVE_MSG_METRICS_B_VER2_C		= 590,
	LOG_GPRS_RECEIVE_MSG_METRICS_C_VER2_C		= 591,
	LOG_GPRS_RECEIVE_MSG_METRICS_D_VER2_C		= 592,
	LOG_GPRS_DLPTCCH_BURST_METRICS_C		= 593,
	LOG_GPRS_DLPTCCH_MSG_METRICS_C			= 594,
};

enum diag_gsm_cmd {
	GSM_DIAG_VERNO_F		= 0,
	GSM_STATUS_F			= 1,
	GSM_TMC_STATE_RETRIEVAL_F	= 2,
	GSM_DIAG_CALL_ORIG_F		= 3,
	GSM_DIAG_CALL_END_F		= 4,
	GSM_GPRS_LOG_PACKET_REQ_F	= 5,
	DIAG_GSM_MAX_F			= 6,
};

/* channel_type | 0x80 == downlink */
enum diag_gsm_rr_chan_type {
	DIAG_GSM_L2_CHAN_TYPE_DCCH	= 0,
	DIAG_GSM_L2_CHAN_TYPE_BCCH	= 1,
	DIAG_GSM_L2_CHAN_TYPE_RACH	= 2,
	DIAG_GSM_L2_CHAN_TYPE_CCCH	= 3,
	DIAG_GSM_L2_CHAN_TYPE_SACCH	= 4,
	DIAG_GSM_L2_CHAN_TYPE_SDCCH	= 5,
	DIAG_GSM_L2_CHAN_TYPE_FACCH_F	= 6,
	DIAG_GSM_L2_CHAN_TYPE_FACCH_H	= 7,
};

/* LOG_GSM_RR_SIGNALING_MESSAGE_C */
struct diag_gsm_rr_msg {
	uint8_t chan_type;
	uint8_t msg_type;
	uint8_t length;
	uint8_t data[0];
} __attribute__((packed));

enum diag_gsm_rr_st {
	DIAG_RR_ST_INACTIVE		= 0,
	DIAG_RR_ST_GOING_ACTIVE		= 1,
	DIAG_RR_ST_GOING_INACTIVE	= 2,
	DIAG_RR_ST_CELL_SELECTION	= 3,
	DIAG_RR_ST_PLMN_LIST_CONSTRUCTION = 4,
	DIAG_RR_ST_IDLE			= 5,
	DIAG_RR_ST_CELL_RESELECTION	= 6,
	DIAG_RR_ST_CONNECTION_PENDING	= 7,
	DIAG_RR_ST_CHOOSE_CELL		= 8,
	DIAG_RR_ST_DATA_TRANSFER	= 9,
	DIAG_RR_ST_NO_CHANNELS		= 10,
	DIAG_RR_ST_CONNECTION_RELEASE	= 11,
	DIAG_RR_ST_EARLY_CAMPED_WAIT_FOR_SI= 12,
	DIAG_RR_ST_W2G_INTERRAT_HO_PROGRESS= 13,
	DIAG_RR_ST_W2G_INTERRAT_RESELECTION_PROGRESS = 14,
	DIAG_RR_ST_W2G_INTERRAT_CC_ORDER_PROGRESS = 15,
	DIAG_RR_ST_G2W_INTERRAT_RESELECTION_PROGRESS = 16,
	DIAG_RR_ST_WAIT_FOR_EARLY_PSCAN	= 17,
	DIAG_RR_ST_GRR			= 18,
	DIAG_RR_ST_G2W_INTERRAT_HO_PROGRESS = 20,
	DIAG_RR_ST_BACKGROUND_PLMN_SEARCH = 21,
	DIAG_RR_ST_W2G_SERVICE_REDIR_IN_PROGRESS = 22,
	DIAG_RR_ST_RESET		= 23,
	DIAG_RR_ST_W2G_BACKGROUND_PLN_SEARCH = 24,
};
extern const struct value_string diag_gsm_rr_st_vals[25];

/* LOG_GSM_RR_STATE_C */
struct diag_gsm_rr_state {
	uint8_t state;
	uint8_t substate;
	uint8_t status;
	uint8_t mode;
} __attribute__((packed));

enum diag_gprs_grr_st {
	DIAG_GRR_ST_NULL	= 0,
	DIAG_GRR_ST_ACQUIRE	= 1,
	DIAG_GRR_ST_CAMPED	= 2,
	DIAG_GRR_ST_CONN_PEND	= 3,
	DIAG_GRR_ST_CELL_RESEL	= 4,
	DIAG_GRR_ST_CELL_RESEL_G2W	= 6,
	DIAG_GRR_ST_BG_PLMN_SEARCH	= 7,
	DIAG_GRR_ST_PCCO	= 8,
};
extern const struct value_string diag_gprs_grr_st_vals[9];

/* LOG_GPRS_GRR_STATE_C */
struct diag_gprs_grr_state {
	uint8_t	active_state;
	uint8_t grr_state;
} __attribute__((packed));


enum diag_gprs_llme_state {
	DIAG_GPRS_LLMES_TLLI_UNASS	= 0,
	DIAG_GPRS_LLMES_TLLI_ASS	= 1,
	DIAG_GPRS_LLMES_TEST_MODE	= 2,
};
const struct value_string diag_gprs_llme_st_vals[4];

/* LOG_GPRS_LLC_ME_INFO_C */
struct diag_gprs_llme_info {
	uint8_t state;
	uint8_t xid_version;
	uint32_t tlli_new;
	uint32_t tlli_old;
	uint8_t enc_alg;
	uint8_t enc_key[8];
	uint32_t input_offset_iov_ui;
} __attribute__((packed));

/* LOG_GPRS_LLC_PDU_STATS_C */
struct diag_gprs_llc_stats {
	uint8_t	sapi;
	uint32_t ack_l3pdu_tx;
	uint32_t ack_octet_tx;
	uint32_t ack_l3pdu_retrans;
	uint32_t ack_octet_retrans;
	uint32_t ack_l3pdu_rx;
	uint32_t ack_octet_rx;
	uint32_t unack_l3pdu_tx;
	uint32_t unack_octet_tx;
	uint32_t unack_l3pdu_rx;
	uint32_t unack_octet_rx;
	uint32_t llpdu_tx;
	uint32_t llpdu_rx;
	uint32_t llpdu_fcs_err;
	uint32_t llpdu_frm_rej;
	uint32_t llpdu_tlli_err;
	uint32_t llpdu_addr_err;
	uint32_t llpdu_short_err;
} __attribute__((packed));

struct msgb *diag_gsm_make_log_pack_req(uint16_t log_code, uint8_t zero_stats, uint8_t addl_info);