Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 1 | #ifndef _PCUIF_PROTO_H |
| 2 | #define _PCUIF_PROTO_H |
| 3 | |
Andreas Eversberg | 570b44b | 2013-03-16 16:15:01 +0100 | [diff] [blame] | 4 | #define PCU_IF_VERSION 0x05 |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 5 | |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 6 | /* msg_type */ |
| 7 | #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ |
Andreas Eversberg | a9be154 | 2012-09-27 09:23:24 +0200 | [diff] [blame] | 8 | #define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 9 | #define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 10 | #define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ |
| 11 | #define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 12 | #define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ |
| 13 | #define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 14 | #define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ |
| 15 | #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 16 | |
| 17 | /* sapi */ |
| 18 | #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 19 | #define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ |
| 20 | #define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 21 | #define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ |
| 22 | #define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ |
| 23 | #define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ |
| 24 | #define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ |
| 25 | |
| 26 | /* flags */ |
| 27 | #define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ |
| 28 | #define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ |
| 29 | #define PCU_IF_FLAG_CS1 (1 << 16) |
| 30 | #define PCU_IF_FLAG_CS2 (1 << 17) |
| 31 | #define PCU_IF_FLAG_CS3 (1 << 18) |
| 32 | #define PCU_IF_FLAG_CS4 (1 << 19) |
| 33 | #define PCU_IF_FLAG_MCS1 (1 << 20) |
| 34 | #define PCU_IF_FLAG_MCS2 (1 << 21) |
| 35 | #define PCU_IF_FLAG_MCS3 (1 << 22) |
| 36 | #define PCU_IF_FLAG_MCS4 (1 << 23) |
| 37 | #define PCU_IF_FLAG_MCS5 (1 << 24) |
| 38 | #define PCU_IF_FLAG_MCS6 (1 << 25) |
| 39 | #define PCU_IF_FLAG_MCS7 (1 << 26) |
| 40 | #define PCU_IF_FLAG_MCS8 (1 << 27) |
| 41 | #define PCU_IF_FLAG_MCS9 (1 << 28) |
| 42 | |
| 43 | struct gsm_pcu_if_data { |
| 44 | uint8_t sapi; |
| 45 | uint8_t len; |
| 46 | uint8_t data[162]; |
| 47 | uint32_t fn; |
| 48 | uint16_t arfcn; |
| 49 | uint8_t trx_nr; |
| 50 | uint8_t ts_nr; |
| 51 | uint8_t block_nr; |
Andreas Eversberg | 570b44b | 2013-03-16 16:15:01 +0100 | [diff] [blame] | 52 | int8_t rssi; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 53 | } __attribute__ ((packed)); |
| 54 | |
| 55 | struct gsm_pcu_if_rts_req { |
| 56 | uint8_t sapi; |
| 57 | uint8_t spare[3]; |
| 58 | uint32_t fn; |
| 59 | uint16_t arfcn; |
| 60 | uint8_t trx_nr; |
| 61 | uint8_t ts_nr; |
| 62 | uint8_t block_nr; |
| 63 | } __attribute__ ((packed)); |
| 64 | |
| 65 | struct gsm_pcu_if_rach_ind { |
| 66 | uint8_t sapi; |
| 67 | uint8_t ra; |
| 68 | int16_t qta; |
| 69 | uint32_t fn; |
| 70 | uint16_t arfcn; |
| 71 | } __attribute__ ((packed)); |
| 72 | |
| 73 | struct gsm_pcu_if_info_trx { |
| 74 | uint16_t arfcn; |
| 75 | uint8_t pdch_mask; /* PDCH channels per TS */ |
| 76 | uint8_t spare; |
| 77 | uint8_t tsc[8]; /* TSC per channel */ |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 78 | uint32_t hlayer1; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 79 | } __attribute__ ((packed)); |
| 80 | |
| 81 | struct gsm_pcu_if_info_ind { |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 82 | uint32_t version; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 83 | uint32_t flags; |
| 84 | struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 85 | uint8_t bsic; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 86 | /* RAI */ |
| 87 | uint16_t mcc, mnc, lac, rac; |
| 88 | /* NSE */ |
| 89 | uint16_t nsei; |
| 90 | uint8_t nse_timer[7]; |
| 91 | uint8_t cell_timer[11]; |
| 92 | /* cell */ |
| 93 | uint16_t cell_id; |
| 94 | uint16_t repeat_time; |
| 95 | uint8_t repeat_count; |
| 96 | uint16_t bvci; |
| 97 | uint8_t t3142; |
| 98 | uint8_t t3169; |
| 99 | uint8_t t3191; |
| 100 | uint8_t t3193_10ms; |
| 101 | uint8_t t3195; |
| 102 | uint8_t n3101; |
| 103 | uint8_t n3103; |
| 104 | uint8_t n3105; |
| 105 | uint8_t cv_countdown; |
| 106 | uint16_t dl_tbf_ext; |
| 107 | uint16_t ul_tbf_ext; |
| 108 | uint8_t initial_cs; |
| 109 | uint8_t initial_mcs; |
| 110 | /* NSVC */ |
| 111 | uint16_t nsvci[2]; |
| 112 | uint16_t local_port[2]; |
| 113 | uint16_t remote_port[2]; |
| 114 | uint32_t remote_ip[2]; |
| 115 | } __attribute__ ((packed)); |
| 116 | |
| 117 | struct gsm_pcu_if_act_req { |
| 118 | uint8_t activate; |
| 119 | uint8_t trx_nr; |
| 120 | uint8_t ts_nr; |
| 121 | uint8_t spare; |
| 122 | } __attribute__ ((packed)); |
| 123 | |
| 124 | struct gsm_pcu_if_time_ind { |
| 125 | uint32_t fn; |
| 126 | } __attribute__ ((packed)); |
| 127 | |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 128 | struct gsm_pcu_if_pag_req { |
| 129 | uint8_t sapi; |
| 130 | uint8_t chan_needed; |
| 131 | uint8_t identity_lv[9]; |
| 132 | } __attribute__ ((packed)); |
| 133 | |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 134 | struct gsm_pcu_if { |
| 135 | /* context based information */ |
| 136 | uint8_t msg_type; /* message type */ |
| 137 | uint8_t bts_nr; /* bts number */ |
| 138 | uint8_t spare[2]; |
| 139 | |
| 140 | union { |
| 141 | struct gsm_pcu_if_data data_req; |
Andreas Eversberg | a9be154 | 2012-09-27 09:23:24 +0200 | [diff] [blame] | 142 | struct gsm_pcu_if_data data_cnf; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 143 | struct gsm_pcu_if_data data_ind; |
| 144 | struct gsm_pcu_if_rts_req rts_req; |
| 145 | struct gsm_pcu_if_rach_ind rach_ind; |
| 146 | struct gsm_pcu_if_info_ind info_ind; |
| 147 | struct gsm_pcu_if_act_req act_req; |
| 148 | struct gsm_pcu_if_time_ind time_ind; |
Andreas Eversberg | 8389fd0 | 2012-07-18 10:06:48 +0200 | [diff] [blame] | 149 | struct gsm_pcu_if_pag_req pag_req; |
Ivan Kluchnikov | ef7f28c | 2012-07-12 14:49:15 +0400 | [diff] [blame] | 150 | } u; |
| 151 | } __attribute__ ((packed)); |
| 152 | |
| 153 | #endif /* _PCUIF_PROTO_H */ |