libosmogsm
0.11.0-dirty
Osmocom GSM library
|
00001 00003 #pragma once 00004 00005 #include <osmocom/core/prim.h> 00006 00008 enum osmo_ph_prim { 00009 PRIM_PH_DATA, 00010 PRIM_PH_RACH, 00011 PRIM_PH_CONN, 00012 PRIM_PH_EMPTY_FRAME, 00013 PRIM_PH_RTS, 00014 PRIM_MPH_INFO, 00015 PRIM_TCH, 00016 PRIM_TCH_RTS, 00017 }; 00018 00019 extern const struct value_string osmo_ph_prim_names[]; 00020 00022 enum osmo_mph_info_type { 00023 PRIM_INFO_TIME, 00024 PRIM_INFO_MEAS, 00025 PRIM_INFO_ACTIVATE, 00026 PRIM_INFO_DEACTIVATE, 00027 PRIM_INFO_MODIFY, 00028 PRIM_INFO_ACT_CIPH, 00029 PRIM_INFO_DEACT_CIPH, 00030 }; 00031 00033 enum osmo_ph_pres_info_type { 00034 PRES_INFO_INVALID = 0, 00035 PRES_INFO_HEADER = 1, 00036 PRES_INFO_FIRST = 3, 00037 PRES_INFO_SECOND = 5, 00038 PRES_INFO_BOTH = 7, 00039 PRES_INFO_UNKNOWN 00040 }; 00041 00043 struct ph_rach_req_param { 00044 uint8_t ra; 00045 uint8_t ta; 00046 uint8_t tx_power; 00047 uint8_t is_combined_ccch; 00048 uint16_t offset; 00049 }; 00050 00052 enum ph_burst_type { 00053 GSM_L1_BURST_TYPE_NONE = 0, 00054 GSM_L1_BURST_TYPE_ACCESS_0, 00055 GSM_L1_BURST_TYPE_ACCESS_1, 00056 GSM_L1_BURST_TYPE_ACCESS_2 00057 }; 00058 00060 struct ph_rach_ind_param { 00061 uint8_t chan_nr; 00062 uint16_t ra; 00063 uint8_t acc_delay; 00064 uint32_t fn; 00065 uint8_t is_11bit; 00066 enum ph_burst_type burst_type; 00067 /* elements added on 2018-02-26 */ 00068 int8_t rssi; 00069 uint16_t ber10k; 00070 int16_t acc_delay_256bits;/* !< Burst TA Offset in 1/256th bits */ 00071 }; 00072 00074 struct ph_data_param { 00075 uint8_t link_id; 00076 uint8_t chan_nr; 00077 uint32_t fn; 00078 int8_t rssi; 00079 uint16_t ber10k; 00080 union { 00081 int16_t ta_offs_qbits; /* !< Burst TA Offset in quarter bits */ 00082 int16_t ta_offs_256bits; 00083 }; 00084 int16_t lqual_cb; /* !< Link quality in centiBel */ 00085 enum osmo_ph_pres_info_type pdch_presence_info; 00086 }; 00087 00089 struct ph_tch_param { 00090 uint8_t chan_nr; 00091 uint32_t fn; 00092 int8_t rssi; 00093 uint8_t marker; 00094 uint16_t ber10k; 00095 int16_t lqual_cb; /* !< Link quality in centiBel */ 00096 }; 00097 00099 struct ph_conn_ind_param { 00100 uint32_t fn; 00101 }; 00102 00104 struct info_time_ind_param { 00105 uint32_t fn; 00106 }; 00107 00109 struct info_meas_ind_param { 00110 uint8_t chan_nr; 00111 uint32_t fn; 00112 uint16_t ber10k; 00113 union { 00114 int16_t ta_offs_qbits; 00115 int16_t ta_offs_256bits; 00116 }; 00117 int16_t c_i_cb; 00118 uint8_t is_sub:1; 00119 uint8_t inv_rssi; 00120 }; 00121 00123 struct info_act_req_param { 00124 uint8_t chan_nr; 00125 uint8_t sacch_only; 00126 }; 00127 00129 struct info_act_cnf_param { 00130 uint8_t chan_nr; 00131 uint8_t cause; 00132 }; 00133 00135 struct info_ciph_req_param { 00136 uint8_t chan_nr; 00137 uint8_t downlink; 00138 uint8_t uplink; 00139 }; 00140 00142 struct mph_info_param { 00143 enum osmo_mph_info_type type; 00144 union { 00145 struct info_time_ind_param time_ind; 00146 struct info_meas_ind_param meas_ind; 00147 struct info_act_req_param act_req; 00148 struct info_act_cnf_param act_cnf; 00149 struct info_ciph_req_param ciph_req; 00150 } u; 00151 }; 00152 00154 struct osmo_phsap_prim { 00155 struct osmo_prim_hdr oph; 00156 union { 00157 struct ph_data_param data; 00158 struct ph_tch_param tch; 00159 struct ph_rach_req_param rach_req; 00160 struct ph_rach_ind_param rach_ind; 00161 struct ph_conn_ind_param conn_ind; 00162 struct mph_info_param info; 00163 } u; 00164 };