dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31148 )
Change subject: pcu_l1_if.cpp: handle immediate assignment confirmation ......................................................................
pcu_l1_if.cpp: handle immediate assignment confirmation
The BSC is able to confirm the sending of an immediate assignment via the pch_sock.
Change-Id: Icf7ca34500984239ee877ee71fd9c126b5eb3480 Related: OS#5198 --- M src/bts.cpp M src/bts.h M src/pcu_l1_if.cpp 3 files changed, 48 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/48/31148/1
diff --git a/src/bts.cpp b/src/bts.cpp index 5ec75cf..1c27cb2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -715,6 +715,29 @@ return 0; }
+int bts_rcv_imm_ass_cnf_dt(struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t fn) +{ + GprsMs *ms; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + + ms = bts_ms_by_tlli(bts, tlli, GSM_RESERVED_TMSI); + if (!ms) { + LOGP(DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm (direct TLLI) for unknown MS with TLLI=%08x\n", + fn, tlli); + return -EINVAL; + } + dl_tbf = ms_dl_tbf(ms); + if (!dl_tbf) { + LOGPMS(ms, DTBFDL, LOGL_ERROR, "FN=%u Got IMM.ASS confirm (direct TLLI), but MS has no DL TBF!\n", fn); + return -EINVAL; + } + + LOGP(DRLCMAC, LOGL_DEBUG, "Got IMM.ASS confirm (direct TLLI) for TLLI=%08x\n", tlli); + osmo_fsm_inst_dispatch(dl_tbf->state_fi, TBF_EV_ASSIGN_PCUIF_CNF, NULL); + + return 0; +} + /* Determine the full frame number from a relative frame number */ uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, uint32_t rfn) { diff --git a/src/bts.h b/src/bts.h index 61c5e43..5a37618 100644 --- a/src/bts.h +++ b/src/bts.h @@ -316,6 +316,7 @@ int bts_rcv_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip); int bts_rcv_ptcch_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip); int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t fn); +int bts_rcv_imm_ass_cnf_dt(struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t fn);
void bts_send_gsmtap(struct gprs_rlcmac_bts *bts, enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 3ddd5b5..4850afb 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -545,6 +545,26 @@ return rc; }
+static int pcu_rx_data_cnf_dt(struct gprs_rlcmac_bts *bts, struct gsm_pcu_if_data_cnf_dt *data_cnf_dt) +{ + int rc = 0; + int current_fn = bts_current_frame_number(bts); + + LOGP(DL1IF, LOGL_DEBUG, "Data confirm received: sapi=%d fn=%d cur_fn=%d\n", + data_cnf_dt->sapi, data_cnf_dt->fn, current_fn); + + switch (data_cnf_dt->sapi) { + case PCU_IF_SAPI_PCH: + bts_rcv_imm_ass_cnf_dt(bts, data_cnf_dt->tlli, data_cnf_dt->fn); + break; + default: + LOGP(DL1IF, LOGL_ERROR, "Received PCU data confirm with unsupported sapi %d\n", data_cnf_dt->sapi); + rc = -EINVAL; + } + + return rc; +} + // FIXME: remove this, when changed from c++ to c. int pcu_rx_rts_req_pdtch(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr) @@ -1155,6 +1175,10 @@ CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf); rc = pcu_rx_data_cnf(bts, &pcu_prim->u.data_cnf); break; + case PCU_IF_MSG_DATA_CNF_DT: + CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.data_cnf_dt); + rc = pcu_rx_data_cnf_dt(bts, &pcu_prim->u.data_cnf_dt); + break; case PCU_IF_MSG_RTS_REQ: CHECK_IF_MSG_SIZE(pcu_prim_length, pcu_prim->u.rts_req); rc = pcu_rx_rts_req(bts, &pcu_prim->u.rts_req);