Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1 | #ifndef _REST_OCTETS_H |
| 2 | #define _REST_OCTETS_H |
| 3 | |
| 4 | #include <sys/types.h> |
| 5 | #include <openbsc/gsm_04_08.h> |
| 6 | |
| 7 | /* generate SI1 rest octets */ |
| 8 | int rest_octets_si1(u_int8_t *data, u_int8_t *nch_pos); |
| 9 | |
| 10 | struct gsm48_si_selection_params { |
| 11 | u_int16_t penalty_time:5, |
| 12 | temp_offs:3, |
| 13 | cell_resel_off:6, |
| 14 | cbq:1, |
| 15 | present:1; |
| 16 | }; |
| 17 | |
| 18 | struct gsm48_si_power_offset { |
| 19 | u_int8_t power_offset:2, |
| 20 | present:1; |
| 21 | }; |
| 22 | |
| 23 | struct gsm48_si3_gprs_ind { |
| 24 | u_int8_t si13_position:1, |
| 25 | ra_colour:3, |
| 26 | present:1; |
| 27 | }; |
| 28 | |
| 29 | struct gsm48_lsa_params { |
| 30 | u_int32_t prio_thr:3, |
| 31 | lsa_offset:3, |
| 32 | mcc:12, |
| 33 | mnc:12; |
| 34 | unsigned int present; |
| 35 | }; |
| 36 | |
| 37 | struct gsm48_si_ro_info { |
| 38 | struct gsm48_si_selection_params selection_params; |
| 39 | struct gsm48_si_power_offset power_offset; |
| 40 | u_int8_t si2ter_indicator; |
| 41 | u_int8_t early_cm_ctrl; |
| 42 | struct { |
| 43 | u_int8_t where:3, |
| 44 | present:1; |
| 45 | } scheduling; |
| 46 | struct gsm48_si3_gprs_ind gprs_ind; |
| 47 | |
| 48 | /* SI 4 specific */ |
| 49 | struct gsm48_lsa_params lsa_params; |
| 50 | u_int16_t cell_id; |
| 51 | u_int8_t break_ind; /* do we have SI7 + SI8 ? */ |
| 52 | }; |
| 53 | |
| 54 | |
| 55 | /* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ |
| 56 | int rest_octets_si3(u_int8_t *data, const struct gsm48_si_ro_info *si3); |
| 57 | |
| 58 | /* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ |
| 59 | int rest_octets_si4(u_int8_t *data, const struct gsm48_si_ro_info *si4); |
| 60 | |
| 61 | enum pbcch_carrier_type { |
| 62 | PBCCH_BCCH, |
| 63 | PBCCH_ARFCN, |
| 64 | PBCCH_MAIO |
| 65 | }; |
| 66 | |
| 67 | /* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ |
| 68 | enum gprs_nmo { |
| 69 | GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ |
| 70 | GPRS_NMO_II = 1, /* all paging on CCCH */ |
| 71 | GPRS_NMO_III = 2, /* no paging coordination */ |
| 72 | }; |
| 73 | |
Harald Welte | da0586a | 2010-04-18 14:49:05 +0200 | [diff] [blame^] | 74 | /* TS 04.60 12.24 */ |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 75 | struct gprs_cell_options { |
| 76 | enum gprs_nmo nmo; |
| 77 | /* T3168: wait for packet uplink assignment message */ |
| 78 | u_int32_t t3168; /* in milliseconds */ |
| 79 | /* T3192: wait for release of the TBF after reception of the final block */ |
| 80 | u_int32_t t3192; /* in milliseconds */ |
| 81 | u_int32_t drx_timer_max;/* in seconds */ |
| 82 | u_int32_t bs_cv_max; |
Harald Welte | da0586a | 2010-04-18 14:49:05 +0200 | [diff] [blame^] | 83 | |
| 84 | u_int8_t ext_info_present; |
| 85 | struct { |
| 86 | u_int8_t egprs_supported; |
| 87 | u_int8_t use_egprs_p_ch_req; |
| 88 | u_int8_t bep_period; |
| 89 | u_int8_t pfc_supported; |
| 90 | u_int8_t dtm_supported; |
| 91 | u_int8_t bss_paging_coordination; |
| 92 | } ext_info; |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | /* TS 04.60 Table 12.9.2 */ |
| 96 | struct gprs_power_ctrl_pars { |
| 97 | u_int8_t alpha; |
| 98 | u_int8_t t_avg_w; |
| 99 | u_int8_t t_avg_t; |
| 100 | u_int8_t pc_meas_chan; |
| 101 | u_int8_t n_avg_i; |
| 102 | }; |
| 103 | |
| 104 | struct gsm48_si13_info { |
| 105 | struct gprs_cell_options cell_opts; |
| 106 | struct gprs_power_ctrl_pars pwr_ctrl_pars; |
| 107 | u_int8_t bcch_change_mark; |
| 108 | u_int8_t si_change_field; |
| 109 | u_int8_t pbcch_present; |
| 110 | |
| 111 | union { |
| 112 | struct { |
| 113 | u_int8_t rac; |
| 114 | u_int8_t spgc_ccch_sup; |
| 115 | u_int8_t net_ctrl_ord; |
| 116 | u_int8_t prio_acc_thr; |
| 117 | } no_pbcch; |
| 118 | struct { |
| 119 | u_int8_t psi1_rep_per; |
| 120 | u_int8_t pb; |
| 121 | u_int8_t tsc; |
| 122 | u_int8_t tn; |
| 123 | enum pbcch_carrier_type carrier_type; |
| 124 | u_int16_t arfcn; |
| 125 | u_int8_t maio; |
| 126 | } pbcch; |
| 127 | }; |
| 128 | }; |
| 129 | |
| 130 | /* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ |
| 131 | int rest_octets_si13(u_int8_t *data, const struct gsm48_si13_info *si13); |
| 132 | |
| 133 | #endif /* _REST_OCTETS_H */ |