2012-07-12 10:49:15 +00:00
|
|
|
#ifndef _PCUIF_PROTO_H
|
|
|
|
#define _PCUIF_PROTO_H
|
|
|
|
|
2016-08-17 09:47:21 +00:00
|
|
|
#include <osmocom/gsm/l1sap.h>
|
2020-07-28 11:47:18 +00:00
|
|
|
#include <arpa/inet.h>
|
2016-08-17 09:47:21 +00:00
|
|
|
|
2017-08-08 13:03:50 +00:00
|
|
|
#define PCU_SOCK_DEFAULT "/tmp/pcu_bts"
|
|
|
|
|
2020-07-20 17:54:42 +00:00
|
|
|
#define PCU_IF_VERSION 0x0a
|
2017-03-08 17:53:30 +00:00
|
|
|
#define TXT_MAX_LEN 128
|
2012-07-18 08:06:48 +00:00
|
|
|
|
2012-07-12 10:49:15 +00:00
|
|
|
/* msg_type */
|
|
|
|
#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */
|
2012-09-27 07:23:24 +00:00
|
|
|
#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */
|
2018-02-28 01:56:12 +00:00
|
|
|
#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */
|
2017-07-10 22:06:38 +00:00
|
|
|
#define PCU_IF_MSG_SUSP_REQ 0x03 /* BTS forwards GPRS SUSP REQ to PCU */
|
2019-09-05 15:13:33 +00:00
|
|
|
#define PCU_IF_MSG_APP_INFO_REQ 0x04 /* BTS asks PCU to transmit APP INFO via PACCH */
|
2012-07-18 08:06:48 +00:00
|
|
|
#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */
|
2018-02-28 02:03:49 +00:00
|
|
|
#define PCU_IF_MSG_DATA_CNF_DT 0x11 /* confirm (with direct tlli) */
|
2012-07-18 08:06:48 +00:00
|
|
|
#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */
|
2012-07-12 10:49:15 +00:00
|
|
|
#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */
|
|
|
|
#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */
|
2012-07-18 08:06:48 +00:00
|
|
|
#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */
|
2021-06-20 19:00:40 +00:00
|
|
|
#define PCU_IF_MSG_INTERF_IND 0x53 /* interference report */
|
2012-07-18 08:06:48 +00:00
|
|
|
#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */
|
2017-03-08 17:53:30 +00:00
|
|
|
#define PCU_IF_MSG_TXT_IND 0x70 /* Text indication for BTS */
|
2012-07-12 10:49:15 +00:00
|
|
|
|
|
|
|
/* sapi */
|
|
|
|
#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */
|
2012-07-18 08:06:48 +00:00
|
|
|
#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */
|
|
|
|
#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */
|
2012-07-12 10:49:15 +00:00
|
|
|
#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */
|
|
|
|
#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */
|
|
|
|
#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
|
|
|
|
#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
|
2018-02-28 02:03:49 +00:00
|
|
|
#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on AGCH but with additional TLLI */
|
2012-07-12 10:49:15 +00:00
|
|
|
|
|
|
|
/* flags */
|
|
|
|
#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
|
|
|
|
#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */
|
|
|
|
#define PCU_IF_FLAG_CS1 (1 << 16)
|
|
|
|
#define PCU_IF_FLAG_CS2 (1 << 17)
|
|
|
|
#define PCU_IF_FLAG_CS3 (1 << 18)
|
|
|
|
#define PCU_IF_FLAG_CS4 (1 << 19)
|
|
|
|
#define PCU_IF_FLAG_MCS1 (1 << 20)
|
|
|
|
#define PCU_IF_FLAG_MCS2 (1 << 21)
|
|
|
|
#define PCU_IF_FLAG_MCS3 (1 << 22)
|
|
|
|
#define PCU_IF_FLAG_MCS4 (1 << 23)
|
|
|
|
#define PCU_IF_FLAG_MCS5 (1 << 24)
|
|
|
|
#define PCU_IF_FLAG_MCS6 (1 << 25)
|
|
|
|
#define PCU_IF_FLAG_MCS7 (1 << 26)
|
|
|
|
#define PCU_IF_FLAG_MCS8 (1 << 27)
|
|
|
|
#define PCU_IF_FLAG_MCS9 (1 << 28)
|
|
|
|
|
2020-07-28 11:47:18 +00:00
|
|
|
/* NSVC address type */
|
|
|
|
#define PCU_IF_ADDR_TYPE_UNSPEC 0x00 /* No address - empty entry */
|
|
|
|
#define PCU_IF_ADDR_TYPE_IPV4 0x04 /* IPv4 address */
|
|
|
|
#define PCU_IF_ADDR_TYPE_IPV6 0x29 /* IPv6 address */
|
|
|
|
|
2020-10-12 00:27:22 +00:00
|
|
|
#define PCU_IF_NUM_NSVC 2
|
|
|
|
|
2017-03-08 17:53:30 +00:00
|
|
|
enum gsm_pcu_if_text_type {
|
|
|
|
PCU_VERSION,
|
|
|
|
PCU_OML_ALERT,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gsm_pcu_if_txt_ind {
|
|
|
|
uint8_t type; /* gsm_pcu_if_text_type */
|
|
|
|
char text[TXT_MAX_LEN]; /* Text to be transmitted to BTS */
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_data {
|
|
|
|
uint8_t sapi;
|
|
|
|
uint8_t len;
|
|
|
|
uint8_t data[162];
|
|
|
|
uint32_t fn;
|
|
|
|
uint16_t arfcn;
|
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t ts_nr;
|
|
|
|
uint8_t block_nr;
|
2013-03-16 15:15:01 +00:00
|
|
|
int8_t rssi;
|
2018-02-28 01:56:12 +00:00
|
|
|
uint16_t ber10k; /* !< \brief BER in units of 0.01% */
|
|
|
|
int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */
|
|
|
|
int16_t lqual_cb; /* !< \brief Link quality in centiBel */
|
2012-07-12 10:49:15 +00:00
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2018-02-28 02:03:49 +00:00
|
|
|
/* data confirmation with direct tlli (instead of raw mac block with tlli) */
|
|
|
|
struct gsm_pcu_if_data_cnf_dt {
|
|
|
|
uint8_t sapi;
|
|
|
|
uint32_t tlli;
|
|
|
|
uint32_t fn;
|
|
|
|
uint16_t arfcn;
|
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t ts_nr;
|
|
|
|
uint8_t block_nr;
|
|
|
|
int8_t rssi;
|
|
|
|
uint16_t ber10k; /* !< \brief BER in units of 0.01% */
|
|
|
|
int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */
|
|
|
|
int16_t lqual_cb; /* !< \brief Link quality in centiBel */
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_rts_req {
|
|
|
|
uint8_t sapi;
|
|
|
|
uint8_t spare[3];
|
|
|
|
uint32_t fn;
|
|
|
|
uint16_t arfcn;
|
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t ts_nr;
|
|
|
|
uint8_t block_nr;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct gsm_pcu_if_rach_ind {
|
|
|
|
uint8_t sapi;
|
2016-08-17 09:47:21 +00:00
|
|
|
uint16_t ra;
|
2012-07-12 10:49:15 +00:00
|
|
|
int16_t qta;
|
|
|
|
uint32_t fn;
|
|
|
|
uint16_t arfcn;
|
2016-08-17 09:47:21 +00:00
|
|
|
uint8_t is_11bit;
|
|
|
|
uint8_t burst_type;
|
pcuif_proto.h: extend RACH.ind with TRX / TS numbers
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.
Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.
Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).
Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.
Change-Id: If209001885ffb14b64a8e808df3700d85a4b2ef9
Related: OS#1545
2019-10-05 16:21:33 +00:00
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t ts_nr;
|
2012-07-12 10:49:15 +00:00
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2020-07-20 17:54:42 +00:00
|
|
|
struct gsm_pcu_if_info_ts {
|
|
|
|
uint8_t tsc;
|
|
|
|
uint8_t h;
|
|
|
|
uint8_t hsn;
|
|
|
|
uint8_t maio;
|
|
|
|
uint8_t ma_bit_len;
|
|
|
|
uint8_t ma[8];
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_info_trx {
|
|
|
|
uint16_t arfcn;
|
2020-07-20 17:54:42 +00:00
|
|
|
uint8_t pdch_mask; /* PDCH timeslot mask */
|
2012-07-12 10:49:15 +00:00
|
|
|
uint8_t spare;
|
2012-07-18 08:06:48 +00:00
|
|
|
uint32_t hlayer1;
|
2020-07-20 17:54:42 +00:00
|
|
|
struct gsm_pcu_if_info_ts ts[8]; /* timeslots per TRX */
|
2012-07-12 10:49:15 +00:00
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct gsm_pcu_if_info_ind {
|
2012-07-18 08:06:48 +00:00
|
|
|
uint32_t version;
|
2012-07-12 10:49:15 +00:00
|
|
|
uint32_t flags;
|
|
|
|
struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */
|
2012-07-18 08:06:48 +00:00
|
|
|
uint8_t bsic;
|
2012-07-12 10:49:15 +00:00
|
|
|
/* RAI */
|
2018-02-20 23:39:07 +00:00
|
|
|
uint16_t mcc, mnc;
|
|
|
|
uint8_t mnc_3_digits;
|
|
|
|
uint16_t lac, rac;
|
2012-07-12 10:49:15 +00:00
|
|
|
/* NSE */
|
|
|
|
uint16_t nsei;
|
|
|
|
uint8_t nse_timer[7];
|
|
|
|
uint8_t cell_timer[11];
|
2018-02-28 01:56:12 +00:00
|
|
|
/* cell */
|
2012-07-12 10:49:15 +00:00
|
|
|
uint16_t cell_id;
|
|
|
|
uint16_t repeat_time;
|
|
|
|
uint8_t repeat_count;
|
|
|
|
uint16_t bvci;
|
|
|
|
uint8_t t3142;
|
|
|
|
uint8_t t3169;
|
|
|
|
uint8_t t3191;
|
|
|
|
uint8_t t3193_10ms;
|
|
|
|
uint8_t t3195;
|
|
|
|
uint8_t n3101;
|
|
|
|
uint8_t n3103;
|
|
|
|
uint8_t n3105;
|
|
|
|
uint8_t cv_countdown;
|
|
|
|
uint16_t dl_tbf_ext;
|
|
|
|
uint16_t ul_tbf_ext;
|
|
|
|
uint8_t initial_cs;
|
|
|
|
uint8_t initial_mcs;
|
|
|
|
/* NSVC */
|
2020-10-12 00:27:22 +00:00
|
|
|
uint16_t nsvci[PCU_IF_NUM_NSVC];
|
|
|
|
uint16_t local_port[PCU_IF_NUM_NSVC];
|
|
|
|
uint16_t remote_port[PCU_IF_NUM_NSVC];
|
|
|
|
uint8_t address_type[PCU_IF_NUM_NSVC];
|
2020-07-28 11:47:18 +00:00
|
|
|
union {
|
|
|
|
struct in_addr v4;
|
|
|
|
struct in6_addr v6;
|
2020-10-12 00:27:22 +00:00
|
|
|
} remote_ip[PCU_IF_NUM_NSVC];
|
2012-07-12 10:49:15 +00:00
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct gsm_pcu_if_act_req {
|
|
|
|
uint8_t activate;
|
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t ts_nr;
|
|
|
|
uint8_t spare;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct gsm_pcu_if_time_ind {
|
|
|
|
uint32_t fn;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2012-07-18 08:06:48 +00:00
|
|
|
struct gsm_pcu_if_pag_req {
|
|
|
|
uint8_t sapi;
|
|
|
|
uint8_t chan_needed;
|
|
|
|
uint8_t identity_lv[9];
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2019-09-05 15:13:33 +00:00
|
|
|
/* BTS tells PCU to [once] send given application data via PACCH to all UE with active TBF */
|
|
|
|
struct gsm_pcu_if_app_info_req {
|
|
|
|
uint8_t application_type; /* 4bit field, see TS 44.060 11.2.47 */
|
|
|
|
uint8_t len; /* length of data */
|
|
|
|
uint8_t data[162]; /* random size choice; ETWS needs 56 bytes */
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2017-07-10 22:06:38 +00:00
|
|
|
/* BTS tells PCU about a GPRS SUSPENSION REQUEST received on DCCH */
|
|
|
|
struct gsm_pcu_if_susp_req {
|
|
|
|
uint32_t tlli;
|
|
|
|
uint8_t ra_id[6];
|
|
|
|
uint8_t cause;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2021-06-20 19:00:40 +00:00
|
|
|
/* Interference measurements on PDCH timeslots */
|
|
|
|
struct gsm_pcu_if_interf_ind {
|
|
|
|
uint8_t trx_nr;
|
|
|
|
uint8_t spare[3];
|
|
|
|
uint32_t fn;
|
|
|
|
uint8_t interf[8];
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if {
|
|
|
|
/* context based information */
|
|
|
|
uint8_t msg_type; /* message type */
|
|
|
|
uint8_t bts_nr; /* bts number */
|
|
|
|
uint8_t spare[2];
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct gsm_pcu_if_data data_req;
|
2012-09-27 07:23:24 +00:00
|
|
|
struct gsm_pcu_if_data data_cnf;
|
2018-02-28 02:03:49 +00:00
|
|
|
struct gsm_pcu_if_data_cnf_dt data_cnf_dt;
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_data data_ind;
|
2017-07-10 22:06:38 +00:00
|
|
|
struct gsm_pcu_if_susp_req susp_req;
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_rts_req rts_req;
|
|
|
|
struct gsm_pcu_if_rach_ind rach_ind;
|
2017-03-08 17:53:30 +00:00
|
|
|
struct gsm_pcu_if_txt_ind txt_ind;
|
2012-07-12 10:49:15 +00:00
|
|
|
struct gsm_pcu_if_info_ind info_ind;
|
|
|
|
struct gsm_pcu_if_act_req act_req;
|
|
|
|
struct gsm_pcu_if_time_ind time_ind;
|
2012-07-18 08:06:48 +00:00
|
|
|
struct gsm_pcu_if_pag_req pag_req;
|
2019-09-05 15:13:33 +00:00
|
|
|
struct gsm_pcu_if_app_info_req app_info_req;
|
2021-06-20 19:00:40 +00:00
|
|
|
struct gsm_pcu_if_interf_ind interf_ind;
|
2012-07-12 10:49:15 +00:00
|
|
|
} u;
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
#endif /* _PCUIF_PROTO_H */
|