diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-11-16 22:20:39 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-11-17 21:09:55 +0100 |
commit | 814d289200e87489944f894b389139009d80287a (patch) | |
tree | 8c79dc3e307b5f83576f0b4b681df717dd8c03ce | |
parent | 16d065c04392d9c632572e6fad35cf445df6fc3a (diff) |
WIP: introduce PCU_IF_MSG_DATA_CNF_DT (with TLLI)
Change-Id: I6ddcfebcc4f8ceef18c9303a940fbbb003fa9f53
-rw-r--r-- | include/osmocom/pcu/pcuif_proto.h | 17 | ||||
-rw-r--r-- | src/bts.cpp | 22 | ||||
-rw-r--r-- | src/bts.h | 1 | ||||
-rw-r--r-- | src/pcu_l1_if.cpp | 23 |
4 files changed, 63 insertions, 0 deletions
diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index 944f3644..f6e167af 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -8,6 +8,7 @@ /* msg_type */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ #define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ +#define PCU_IF_MSG_DATA_CNF_DT 0x11 /* confirm (with direct tlli) */ #define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ #define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ #define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ @@ -57,6 +58,21 @@ struct gsm_pcu_if_data { int16_t lqual_cb; /* !< \brief Link quality in centiBel */ } __attribute__ ((packed)); +/* 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)); + struct gsm_pcu_if_rts_req { uint8_t sapi; uint8_t spare[3]; @@ -147,6 +163,7 @@ struct gsm_pcu_if { union { struct gsm_pcu_if_data data_req; struct gsm_pcu_if_data data_cnf; + struct gsm_pcu_if_data_cnf_dt data_cnf_dt; struct gsm_pcu_if_data data_ind; struct gsm_pcu_if_rts_req rts_req; struct gsm_pcu_if_rach_ind rach_ind; diff --git a/src/bts.cpp b/src/bts.cpp index b63c162f..ab22f72d 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -508,6 +508,28 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn) return 0; } +int BTS::rcv_imm_ass_cnf_dt(uint32_t tlli, uint32_t fn) +{ + GprsMs *ms; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + + ms = ms_by_tlli(tlli); + if (ms) + dl_tbf = ms->dl_tbf(); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got IMM.ASS confirm, but TLLI=%08x " + "does not exit\n", tlli); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "Got IMM.ASS confirm for TLLI=%08x\n", tlli); + + if (dl_tbf->m_wait_confirm) + tbf_timer_start(dl_tbf, 0, Tassign_agch); + + return 0; +} + int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst_type) { @@ -339,6 +339,7 @@ public: int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); + int rcv_imm_ass_cnf_dt(uint32_t tlli, uint32_t fn); uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority); int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index b8925979..e068c89e 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -271,6 +271,26 @@ static int pcu_rx_data_cnf(struct gsm_pcu_if_data *data_cnf) return rc; } +static int pcu_rx_data_cnf_dt(struct gsm_pcu_if_data_cnf_dt *data_cnf) +{ + int rc = 0; + + LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d fn=%d\n", + data_cnf->sapi, data_cnf->fn); + + switch (data_cnf->sapi) { + case PCU_IF_SAPI_PCH: + BTS::main_bts()->rcv_imm_ass_cnf_dt(data_cnf->tlli, data_cnf->fn); + break; + default: + LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with " + "unsupported sapi %d\n", data_cnf->sapi); + rc = -EINVAL; + } + + return rc; +} + // FIXME: remove this, when changed from c++ to c. extern "C" int pcu_rx_rts_req_pdtch(uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr) @@ -542,6 +562,9 @@ int pcu_rx(uint8_t msg_type, struct gsm_pcu_if *pcu_prim) case PCU_IF_MSG_DATA_CNF: rc = pcu_rx_data_cnf(&pcu_prim->u.data_cnf); break; + case PCU_IF_MSG_DATA_CNF_DT: + rc = pcu_rx_data_cnf_dt(&pcu_prim->u.data_cnf_dt); + break; case PCU_IF_MSG_RTS_REQ: rc = pcu_rx_rts_req(&pcu_prim->u.rts_req); break; |