From 8b4640ec19d95735363c635b84ca814d9c35ab76 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 7 Jun 2023 23:06:24 +0700 Subject: [PATCH] l1ctl_proto: add 'start_fn' field to UL/DL TBF CFG.req messages Change-Id: Ibb6a05165fe1c81268fb0e3674adae4065e78171 Related: OS#5500 --- include/l1ctl_proto.h | 2 ++ .../layer23/include/osmocom/bb/common/l1ctl.h | 5 +++-- src/host/layer23/src/common/l1ctl.c | 17 +++++++++++------ src/host/layer23/src/modem/grr.c | 4 +++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h index 3512424fa..f0bc56d21 100644 --- a/include/l1ctl_proto.h +++ b/include/l1ctl_proto.h @@ -350,6 +350,7 @@ struct l1ctl_gprs_ul_tbf_cfg_req { uint8_t tbf_ref; uint8_t slotmask; uint8_t padding[2]; + uint32_t start_fn; /* TBF Starting Time (absolute Fn) */ } __attribute__((packed)); /* payload of L1CTL_GPRS_DL_TBF_CFG_REQ */ @@ -358,6 +359,7 @@ struct l1ctl_gprs_dl_tbf_cfg_req { uint8_t slotmask; uint8_t dl_tfi; uint8_t padding[1]; + uint32_t start_fn; /* TBF Starting Time (absolute Fn) */ } __attribute__((packed)); /* part of L1CTL_GPRS_{UL,DL}_BLOCK_{REQ,IND} */ diff --git a/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/src/host/layer23/include/osmocom/bb/common/l1ctl.h index 25bc6e8e3..40b31591b 100644 --- a/src/host/layer23/include/osmocom/bb/common/l1ctl.h +++ b/src/host/layer23/include/osmocom/bb/common/l1ctl.h @@ -81,10 +81,11 @@ int l1ctl_tx_gprs_ul_block_req(struct osmocom_ms *ms, uint32_t fn, uint8_t tn, /* Transmit L1CTL_GPRS_UL_TBF_CFG_REQ */ int l1ctl_tx_gprs_ul_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, - uint8_t slotmask); + uint8_t slotmask, uint32_t start_fn); /* Transmit L1CTL_GPRS_DL_TBF_CFG_REQ */ int l1ctl_tx_gprs_dl_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, - uint8_t slotmask, uint8_t dl_tfi); + uint8_t slotmask, uint32_t start_fn, + uint8_t dl_tfi); #endif diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index b2ad505e3..38510d839 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -1011,7 +1011,7 @@ int l1ctl_tx_gprs_ul_block_req(struct osmocom_ms *ms, uint32_t fn, uint8_t tn, /* Transmit L1CTL_GPRS_UL_TBF_CFG_REQ */ int l1ctl_tx_gprs_ul_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, - uint8_t slotmask) + uint8_t slotmask, uint32_t start_fn) { struct l1ctl_gprs_ul_tbf_cfg_req *req; struct msgb *msg; @@ -1024,17 +1024,20 @@ int l1ctl_tx_gprs_ul_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, *req = (struct l1ctl_gprs_ul_tbf_cfg_req) { .tbf_ref = tbf_ref, .slotmask = slotmask, + .start_fn = htonl(start_fn), }; - DEBUGP(DL1C, "Tx GPRS UL TBF CFG (tbf_ref=%u, slotmask=0x%02x)\n", - tbf_ref, slotmask); + DEBUGP(DL1C, "Tx GPRS UL TBF CFG: " + "tbf_ref=%u, slotmask=0x%02x, start_fn=%u\n", + tbf_ref, slotmask, start_fn); return osmo_send_l1(ms, msg); } /* Transmit L1CTL_GPRS_DL_TBF_CFG_REQ */ int l1ctl_tx_gprs_dl_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, - uint8_t slotmask, uint8_t dl_tfi) + uint8_t slotmask, uint32_t start_fn, + uint8_t dl_tfi) { struct l1ctl_gprs_dl_tbf_cfg_req *req; struct msgb *msg; @@ -1047,11 +1050,13 @@ int l1ctl_tx_gprs_dl_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref, *req = (struct l1ctl_gprs_dl_tbf_cfg_req) { .tbf_ref = tbf_ref, .slotmask = slotmask, + .start_fn = htonl(start_fn), .dl_tfi = dl_tfi, }; - DEBUGP(DL1C, "Tx GPRS DL TBF CFG (tbf_ref=%u, slotmask=0x%02x, dl_tfi=%u)\n", - tbf_ref, slotmask, dl_tfi); + DEBUGP(DL1C, "Tx GPRS DL TBF CFG: " + "tbf_ref=%u, slotmask=0x%02x, start_fn=%u, dl_tfi=%u)\n", + tbf_ref, slotmask, start_fn, dl_tfi); return osmo_send_l1(ms, msg); } diff --git a/src/host/layer23/src/modem/grr.c b/src/host/layer23/src/modem/grr.c index 12d7059c9..e4fd23ca2 100644 --- a/src/host/layer23/src/modem/grr.c +++ b/src/host/layer23/src/modem/grr.c @@ -661,7 +661,8 @@ static void grr_st_packet_transfer_action(struct osmo_fsm_inst *fi, const struct osmo_gprs_rlcmac_l1ctl_prim *lp = data; l1ctl_tx_gprs_ul_tbf_cfg_req(ms, lp->cfg_ul_tbf_req.ul_tbf_nr, - lp->cfg_ul_tbf_req.ul_slotmask); + lp->cfg_ul_tbf_req.ul_slotmask, + 0xffffffff /* TODO: start Fn */); break; } case GRR_EV_PDCH_DL_TBF_CFG_REQ: @@ -670,6 +671,7 @@ static void grr_st_packet_transfer_action(struct osmo_fsm_inst *fi, l1ctl_tx_gprs_dl_tbf_cfg_req(ms, lp->cfg_dl_tbf_req.dl_tbf_nr, lp->cfg_dl_tbf_req.dl_slotmask, + 0xffffffff, /* TODO: start Fn */ lp->cfg_dl_tbf_req.dl_tfi); break; }