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