lists.osmocom.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
List overview
Download
gerrit-log
July 2022
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
gerrit-log@lists.osmocom.org
3 participants
2175 discussions
Start a n
N
ew thread
Change in osmo-remsim[master]: bankd: log BankID:SlotNr in every log line
by pespin
Attention is currently required from: laforge. pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-remsim/+/28561
) Change subject: bankd: log BankID:SlotNr in every log line ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-remsim/+/28561
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I84879609781a301338dacde7ff495632e3af08b9 Gerrit-Change-Number: 28561 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 12 Jul 2022 08:48:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: send proper slot type in TRXC SETSLOT messages
by pespin
Attention is currently required from: fixeria. pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28566
) Change subject: trxcon: send proper slot type in TRXC SETSLOT messages ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28566
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I42f5620b50beb7df0a3463d70c1f48d041006371 Gerrit-Change-Number: 28566 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 12 Jul 2022 08:22:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: make l1ctl_tx_dt_ind() accept const pointers
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28553
) Change subject: trxcon: make l1ctl_tx_dt_ind() accept const pointers ...................................................................... trxcon: make l1ctl_tx_dt_ind() accept const pointers Change-Id: I34f665a39c7d036efd4cbe335084fbe21142a48c Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h M src/host/trxcon/src/l1ctl.c 2 files changed, 13 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h index f93908d..2e7e219 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h @@ -18,8 +18,10 @@ int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type); int l1ctl_tx_reset_ind(struct l1ctl_link *l1l, uint8_t type); -int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, - uint8_t *l2, size_t l2_len, bool traffic); +int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, + const struct l1ctl_info_dl *dl_info, + const uint8_t *l2, size_t l2_len, + bool traffic); int l1ctl_tx_dt_conf(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, bool traffic); int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 99b843c..cb3a06c 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -3,7 +3,8 @@ * GSM L1 control interface handlers * * (C) 2014 by Sylvain Munaut <tnt(a)246tNt.com> - * (C) 2016-2017 by Vadim Yanitskiy <axilirator(a)gmail.com> + * (C) 2016-2022 by Vadim Yanitskiy <axilirator(a)gmail.com> + * Contributions by sysmocom - s.f.m.c. GmbH * * All Rights Reserved * @@ -135,7 +136,8 @@ return l1ctl_link_send(l1l, msg); } -static struct l1ctl_info_dl *put_dl_info_hdr(struct msgb *msg, struct l1ctl_info_dl *dl_info) +static struct l1ctl_info_dl *put_dl_info_hdr(struct msgb *msg, + const struct l1ctl_info_dl *dl_info) { size_t len = sizeof(struct l1ctl_info_dl); struct l1ctl_info_dl *dl = (struct l1ctl_info_dl *) msgb_put(msg, len); @@ -207,8 +209,10 @@ /** * Handles both L1CTL_DATA_IND and L1CTL_TRAFFIC_IND. */ -int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, - uint8_t *l2, size_t l2_len, bool traffic) +int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, + const struct l1ctl_info_dl *dl_info, + const uint8_t *l2, size_t l2_len, + bool traffic) { struct msgb *msg; uint8_t *msg_l2; @@ -218,7 +222,7 @@ if (msg == NULL) return -ENOMEM; - put_dl_info_hdr(msg, data); + put_dl_info_hdr(msg, dl_info); /* Copy the L2 payload if preset */ if (l2 && l2_len > 0) { 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28553
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I34f665a39c7d036efd4cbe335084fbe21142a48c Gerrit-Change-Number: 28553 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: use abstract API for RACH primitives
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28552
) Change subject: trxcon: use abstract API for RACH primitives ...................................................................... trxcon: use abstract API for RACH primitives Using L1CTL specific structures as the primitive payload was a beautiful hack in the early days of trxcon. But since we're going to separate the scheduler into an interface independent library, we have to introduce and use an abstract API. Change-Id: I84597d44ea7d74b8840a919ecb09988ba1980a73 Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h M src/host/trxcon/src/l1ctl.c M src/host/trxcon/src/sched_lchan_rach.c M src/host/trxcon/src/sched_prim.c 4 files changed, 78 insertions(+), 49 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h index fa7296a..03dfec3 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h @@ -55,6 +55,12 @@ L1SCHED_BURST_8PSK, }; +enum l1sched_ts_prim_type { + L1SCHED_PRIM_DATA, + L1SCHED_PRIM_RACH8, + L1SCHED_PRIM_RACH11, +}; + /** * These types define the different channels on a multiframe. * Each channel has queues and can be activated individually. @@ -299,6 +305,8 @@ struct l1sched_ts_prim { /*! Link to queue of TS */ struct llist_head list; + /*! Type of primitive */ + enum l1sched_ts_prim_type type; /*! Logical channel type */ enum l1sched_lchan_type chan; /*! Payload length */ @@ -307,6 +315,16 @@ uint8_t payload[0]; }; +/*! Represents a RACH (8-bit or 11-bit) primitive */ +struct l1sched_ts_prim_rach { + /*! RA value */ + uint16_t ra; + /*! Training Sequence (only for 11-bit RA) */ + uint8_t synch_seq; + /*! Transmission offset (how many frames to skip) */ + uint8_t offset; +}; + /*! One scheduler instance */ struct l1sched_state { /*! Clock state */ @@ -359,6 +377,7 @@ /* Primitive management functions */ struct l1sched_ts_prim *l1sched_prim_push(struct trx_instance *trx, + enum l1sched_ts_prim_type type, uint8_t chan_nr, uint8_t link_id, const uint8_t *pl, size_t pl_len); @@ -379,12 +398,11 @@ #define L1SCHED_CHAN_IS_SACCH(chan) \ (l1sched_lchan_desc[chan].link_id & L1SCHED_CH_LID_SACCH) -/* FIXME: we need a better way to identify / distinguish primitives */ #define L1SCHED_PRIM_IS_RACH11(prim) \ - (prim->payload_len == sizeof(struct l1ctl_ext_rach_req)) + (prim->type == L1SCHED_PRIM_RACH11) #define L1SCHED_PRIM_IS_RACH8(prim) \ - (prim->payload_len == sizeof(struct l1ctl_rach_req)) + (prim->type == L1SCHED_PRIM_RACH8) #define L1SCHED_PRIM_IS_RACH(prim) \ (L1SCHED_PRIM_IS_RACH8(prim) || L1SCHED_PRIM_IS_RACH11(prim)) diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index a6fae33..99b843c 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -504,32 +504,37 @@ static int l1ctl_rx_rach_req(struct l1ctl_link *l1l, struct msgb *msg, bool ext) { - struct l1ctl_ext_rach_req *ext_req; - struct l1ctl_rach_req *req; struct l1ctl_info_ul *ul; struct l1sched_ts_prim *prim; - size_t len; + struct l1sched_ts_prim_rach rach; + enum l1sched_ts_prim_type prim_type; int rc; ul = (struct l1ctl_info_ul *) msg->l1h; /* Is it extended (11-bit) RACH or not? */ if (ext) { - ext_req = (struct l1ctl_ext_rach_req *) ul->payload; - ext_req->offset = ntohs(ext_req->offset); - ext_req->ra11 = ntohs(ext_req->ra11); - len = sizeof(*ext_req); + const struct l1ctl_ext_rach_req *req = (void *)ul->payload; + + rach = (struct l1sched_ts_prim_rach) { + .ra = ntohs(req->ra11), + .synch_seq = req->synch_seq, + .offset = ntohs(req->offset), + }; LOGP(DL1C, LOGL_NOTICE, "Received extended (11-bit) RACH request " "(offset=%u, synch_seq=%u, ra11=0x%02hx)\n", - ext_req->offset, ext_req->synch_seq, ext_req->ra11); + rach.offset, rach.synch_seq, rach.ra); } else { - req = (struct l1ctl_rach_req *) ul->payload; - req->offset = ntohs(req->offset); - len = sizeof(*req); + const struct l1ctl_rach_req *req = (void *)ul->payload; + + rach = (struct l1sched_ts_prim_rach) { + .ra = req->ra, + .offset = ntohs(req->offset), + }; LOGP(DL1C, LOGL_NOTICE, "Received regular (8-bit) RACH request " - "(offset=%u, ra=0x%02x)\n", req->offset, req->ra); + "(offset=%u, ra=0x%02x)\n", rach.offset, rach.ra); } /* The controlling L1CTL side always does include the UL info header, @@ -544,7 +549,9 @@ * Push this primitive to the transmit queue. * Indicated timeslot needs to be configured. */ - prim = l1sched_prim_push(l1l->trx, ul->chan_nr, ul->link_id, ul->payload, len); + prim_type = ext ? L1SCHED_PRIM_RACH11 : L1SCHED_PRIM_RACH8; + prim = l1sched_prim_push(l1l->trx, prim_type, ul->chan_nr, ul->link_id, + (const uint8_t *)&rach, sizeof(rach)); if (prim == NULL) rc = -ENOMEM; @@ -713,7 +720,8 @@ chan_nr, link_id, payload_len); /* Push this primitive to transmit queue */ - prim = l1sched_prim_push(l1l->trx, chan_nr, link_id, ul->payload, payload_len); + prim = l1sched_prim_push(l1l->trx, L1SCHED_PRIM_DATA, + chan_nr, link_id, ul->payload, payload_len); if (prim == NULL) rc = -ENOMEM; diff --git a/src/host/trxcon/src/sched_lchan_rach.c b/src/host/trxcon/src/sched_lchan_rach.c index ffec1d0..d322030 100644 --- a/src/host/trxcon/src/sched_lchan_rach.c +++ b/src/host/trxcon/src/sched_lchan_rach.c @@ -76,63 +76,56 @@ struct l1sched_lchan_state *lchan, struct l1sched_burst_req *br) { - struct l1ctl_ext_rach_req *ext_req = NULL; - struct l1ctl_rach_req *req = NULL; - enum rach_synch_seq_t synch_seq; + struct l1sched_ts_prim_rach *rach; uint8_t *burst_ptr = br->burst; uint8_t payload[36]; + uint8_t ra_buf[2]; int i, rc; + rach = (struct l1sched_ts_prim_rach *)lchan->prim->payload; + + /* Delay sending according to offset value */ + if (rach->offset-- > 0) + return 0; + /* Is it extended (11-bit) RACH or not? */ if (L1SCHED_PRIM_IS_RACH11(lchan->prim)) { - ext_req = (struct l1ctl_ext_rach_req *) lchan->prim->payload; - synch_seq = ext_req->synch_seq; - /* Check requested synch. sequence */ - if (synch_seq >= RACH_SYNCH_SEQ_NUM) { - LOGP(DSCHD, LOGL_ERROR, "Unknown RACH synch. sequence=0x%02x\n", synch_seq); + if (rach->synch_seq >= RACH_SYNCH_SEQ_NUM) { + LOGP(DSCHD, LOGL_ERROR, "Unknown RACH synch. sequence=0x%02x\n", + rach->synch_seq); /* Forget this primitive */ l1sched_prim_drop(lchan); return -ENOTSUP; } - /* Delay sending according to offset value */ - if (ext_req->offset-- > 0) - return 0; - /* Encode extended (11-bit) payload */ - rc = gsm0503_rach_ext_encode(payload, ext_req->ra11, trx->bsic, true); + rc = gsm0503_rach_ext_encode(payload, rach->ra, trx->bsic, true); if (rc) { LOGP(DSCHD, LOGL_ERROR, "Could not encode extended RACH burst " - "(ra=%u bsic=%u)\n", ext_req->ra11, trx->bsic); + "(ra=%u bsic=%u)\n", rach->ra, trx->bsic); /* Forget this primitive */ l1sched_prim_drop(lchan); return rc; } } else if (L1SCHED_PRIM_IS_RACH8(lchan->prim)) { - req = (struct l1ctl_rach_req *) lchan->prim->payload; - synch_seq = RACH_SYNCH_SEQ_TS0; - - /* Delay sending according to offset value */ - if (req->offset-- > 0) - return 0; + rach->synch_seq = RACH_SYNCH_SEQ_TS0; /* Encode regular (8-bit) payload */ - rc = gsm0503_rach_ext_encode(payload, req->ra, trx->bsic, false); + rc = gsm0503_rach_ext_encode(payload, rach->ra, trx->bsic, false); if (rc) { LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst " - "(ra=%u bsic=%u)\n", req->ra, trx->bsic); + "(ra=%u bsic=%u)\n", rach->ra, trx->bsic); /* Forget this primitive */ l1sched_prim_drop(lchan); return rc; } } else { - LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu or %zu), " - "so dropping...\n", lchan->prim->payload_len, - sizeof(*req), sizeof(*ext_req)); + LOGP(DSCHD, LOGL_ERROR, "Primitive has unexpected " + "type=0x%02x\n", lchan->prim->type); l1sched_prim_drop(lchan); return -EINVAL; } @@ -144,7 +137,7 @@ /* BN8-48: chosen synch. (training) sequence */ for (i = 0; i < RACH_SYNCH_SEQ_LEN; i++) - *(burst_ptr++) = rach_synch_seq_bits[synch_seq][i] == '1'; + *(burst_ptr++) = rach_synch_seq_bits[rach->synch_seq][i] == '1'; /* BN49-84: encrypted bits (the payload) */ memcpy(burst_ptr, payload, RACH_PAYLOAD_LEN); @@ -156,17 +149,23 @@ LOGP(DSCHD, LOGL_NOTICE, "Scheduled %s RACH (%s) on fn=%u, tn=%u, lchan=%s\n", L1SCHED_PRIM_IS_RACH11(lchan->prim) ? "extended (11-bit)" : "regular (8-bit)", - get_value_string(rach_synch_seq_names, synch_seq), br->fn, + get_value_string(rach_synch_seq_names, rach->synch_seq), br->fn, ts->index, l1sched_lchan_desc[lchan->type].name); /* Confirm RACH request */ l1ctl_tx_rach_conf(trx->l1l, trx->band_arfcn, br->fn); + if (L1SCHED_PRIM_IS_RACH11(lchan->prim)) { + ra_buf[0] = (uint8_t)(rach->ra >> 3); + ra_buf[1] = (uint8_t)(rach->ra & 0x07); + } else { + ra_buf[0] = (uint8_t)(rach->ra); + } + /* Optional GSMTAP logging */ l1sched_gsmtap_send(lchan->type, br->fn, ts->index, - trx->band_arfcn | ARFCN_UPLINK, 0, 0, - L1SCHED_PRIM_IS_RACH11(lchan->prim) ? (uint8_t *) &ext_req->ra11 : &req->ra, - L1SCHED_PRIM_IS_RACH11(lchan->prim) ? 2 : 1); + trx->band_arfcn | ARFCN_UPLINK, 0, 0, + &ra_buf[0], L1SCHED_PRIM_IS_RACH11(lchan->prim) ? 2 : 1); /* Forget processed primitive */ l1sched_prim_drop(lchan); diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index f9b4213..55a23d1 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -40,11 +40,13 @@ * * @param ctx parent talloc context * @param pl_len prim payload length + * @param type prim payload type * @param chan_nr RSL channel description (used to set a proper chan) * @param link_id RSL link description (used to set a proper chan) * @return allocated primitive or NULL */ static struct l1sched_ts_prim *prim_alloc(void *ctx, size_t pl_len, + enum l1sched_ts_prim_type type, uint8_t chan_nr, uint8_t link_id) { enum l1sched_lchan_type lchan_type; @@ -68,6 +70,7 @@ /* Init primitive header */ prim->payload_len = pl_len; prim->chan = lchan_type; + prim->type = type; return prim; } @@ -84,6 +87,7 @@ * @return queued primitive or NULL */ struct l1sched_ts_prim *l1sched_prim_push(struct trx_instance *trx, + enum l1sched_ts_prim_type type, uint8_t chan_nr, uint8_t link_id, const uint8_t *pl, size_t pl_len) { @@ -101,7 +105,7 @@ return NULL; } - prim = prim_alloc(ts, pl_len, chan_nr, link_id); + prim = prim_alloc(ts, pl_len, type, chan_nr, link_id); if (prim == NULL) return NULL; @@ -156,7 +160,7 @@ }; /* Allocate a new primitive */ - prim = prim_alloc(lchan, GSM_MACBLOCK_LEN, + prim = prim_alloc(lchan, GSM_MACBLOCK_LEN, L1SCHED_PRIM_DATA, l1sched_lchan_desc[lchan->type].chan_nr, L1SCHED_CH_LID_SACCH); OSMO_ASSERT(prim != NULL); -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28552
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I84597d44ea7d74b8840a919ecb09988ba1980a73 Gerrit-Change-Number: 28552 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: fix uint8_t used for length in l1sched_prim_alloc()
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28550
) Change subject: trxcon: fix uint8_t used for length in l1sched_prim_alloc() ...................................................................... trxcon: fix uint8_t used for length in l1sched_prim_alloc() Using uint8_t makes it impossible to allocate primitives with payload of size 255 - sizeof(struct l1sched_ts_prim) and greater. Change-Id: Ic19b8433118798f57500119f1caf10e117e5db19 Related: OS#5599, OS#3761 --- M src/host/trxcon/src/sched_prim.c 1 file changed, 1 insertion(+), 6 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index a8e77fc..398cb9e 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -49,7 +49,6 @@ { enum l1sched_lchan_type lchan_type; struct l1sched_ts_prim *prim; - uint8_t len; /* Determine lchan type */ lchan_type = l1sched_chan_nr2lchan_type(chan_nr, link_id); @@ -59,12 +58,8 @@ return NULL; } - /* How much memory do we need? */ - len = sizeof(struct l1sched_ts_prim); /* Primitive header */ - len += pl_len; /* Requested payload size */ - /* Allocate a new primitive */ - prim = talloc_zero_size(ctx, len); + prim = talloc_zero_size(ctx, sizeof(*prim) + pl_len); if (prim == NULL) { LOGP(DSCH, LOGL_ERROR, "Failed to allocate memory\n"); return NULL; -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28550
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ic19b8433118798f57500119f1caf10e117e5db19 Gerrit-Change-Number: 28550 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: allocate a prim in l1sched_prim_push()
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28551
) Change subject: trxcon: allocate a prim in l1sched_prim_push() ...................................................................... trxcon: allocate a prim in l1sched_prim_push() Make l1sched_prim_alloc() private and call it from l1sched_prim_push(). This makes the API more convinient, because both functions are always used together. Change-Id: Ia9c0170fb06efcef569e987b57ab9ab7f7c7e847 Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h M src/host/trxcon/src/l1ctl.c M src/host/trxcon/src/sched_prim.c 3 files changed, 29 insertions(+), 52 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h index cb82cfb..fa7296a 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h @@ -358,10 +358,9 @@ enum l1sched_lchan_type chan); /* Primitive management functions */ -struct l1sched_ts_prim *l1sched_prim_alloc(void *ctx, size_t pl_len, - uint8_t chan_nr, uint8_t link_id); -int l1sched_prim_push(struct trx_instance *trx, - struct l1sched_ts_prim *prim, uint8_t chan_nr); +struct l1sched_ts_prim *l1sched_prim_push(struct trx_instance *trx, + uint8_t chan_nr, uint8_t link_id, + const uint8_t *pl, size_t pl_len); #define L1SCHED_TCH_MODE_IS_SPEECH(mode) \ (mode == GSM48_CMODE_SPEECH_V1 \ diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 734fa77..a6fae33 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -540,27 +540,14 @@ ul->chan_nr = RSL_CHAN_RACH; } - /* Init a new primitive */ - prim = l1sched_prim_alloc(l1l->trx, len, ul->chan_nr, ul->link_id); - if (prim == NULL) { - rc = -ENOMEM; - goto exit; - } - /** * Push this primitive to the transmit queue. * Indicated timeslot needs to be configured. */ - rc = l1sched_prim_push(l1l->trx, prim, ul->chan_nr); - if (rc) { - talloc_free(prim); - goto exit; - } + prim = l1sched_prim_push(l1l->trx, ul->chan_nr, ul->link_id, ul->payload, len); + if (prim == NULL) + rc = -ENOMEM; - /* Fill in the payload */ - memcpy(prim->payload, ul->payload, len); - -exit: msgb_free(msg); return rc; } @@ -725,24 +712,11 @@ "link_id=0x%02x, len=%zu)\n", traffic ? "TRAFFIC" : "DATA", chan_nr, link_id, payload_len); - /* Init a new primitive */ - prim = l1sched_prim_alloc(l1l->trx, payload_len, chan_nr, link_id); - if (prim == NULL) { - rc = -ENOMEM; - goto exit; - } - /* Push this primitive to transmit queue */ - rc = l1sched_prim_push(l1l->trx, prim, chan_nr); - if (rc) { - talloc_free(prim); - goto exit; - } + prim = l1sched_prim_push(l1l->trx, chan_nr, link_id, ul->payload, payload_len); + if (prim == NULL) + rc = -ENOMEM; - /* Fill in the payload */ - memcpy(prim->payload, ul->payload, payload_len); - -exit: msgb_free(msg); return rc; } diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index 398cb9e..f9b4213 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -44,8 +44,8 @@ * @param link_id RSL link description (used to set a proper chan) * @return allocated primitive or NULL */ -struct l1sched_ts_prim *l1sched_prim_alloc(void *ctx, size_t pl_len, - uint8_t chan_nr, uint8_t link_id) +static struct l1sched_ts_prim *prim_alloc(void *ctx, size_t pl_len, + uint8_t chan_nr, uint8_t link_id) { enum l1sched_lchan_type lchan_type; struct l1sched_ts_prim *prim; @@ -77,13 +77,17 @@ * timeslot, whose index is parsed from chan_nr. * * @param trx TRX instance - * @param prim to be enqueued primitive * @param chan_nr RSL channel description - * @return zero in case of success, otherwise a error number + * @param link_id RSL link description + * @param pl Payload data + * @param pl_len Payload length + * @return queued primitive or NULL */ -int l1sched_prim_push(struct trx_instance *trx, - struct l1sched_ts_prim *prim, uint8_t chan_nr) +struct l1sched_ts_prim *l1sched_prim_push(struct trx_instance *trx, + uint8_t chan_nr, uint8_t link_id, + const uint8_t *pl, size_t pl_len) { + struct l1sched_ts_prim *prim; struct l1sched_ts *ts; uint8_t tn; @@ -94,19 +98,19 @@ ts = trx->ts_list[tn]; if (ts == NULL || ts->mf_layout == NULL) { LOGP(DSCH, LOGL_ERROR, "Timeslot %u isn't configured\n", tn); - return -EINVAL; + return NULL; } - /** - * Change talloc context of primitive - * from trx to the parent ts - */ - talloc_steal(ts, prim); + prim = prim_alloc(ts, pl_len, chan_nr, link_id); + if (prim == NULL) + return NULL; + + memcpy(&prim->payload[0], pl, pl_len); /* Add primitive to TS transmit queue */ llist_add_tail(&prim->list, &ts->tx_prims); - return 0; + return prim; } /** @@ -152,9 +156,9 @@ }; /* Allocate a new primitive */ - prim = l1sched_prim_alloc(lchan, GSM_MACBLOCK_LEN, - l1sched_lchan_desc[lchan->type].chan_nr, - L1SCHED_CH_LID_SACCH); + prim = prim_alloc(lchan, GSM_MACBLOCK_LEN, + l1sched_lchan_desc[lchan->type].chan_nr, + L1SCHED_CH_LID_SACCH); OSMO_ASSERT(prim != NULL); /* Check if the MR cache is populated (verify LAPDm header) */ -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28551
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ia9c0170fb06efcef569e987b57ab9ab7f7c7e847 Gerrit-Change-Number: 28551 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: rename l1sched_prim_init() to l1sched_prim_alloc()
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28560
) Change subject: trxcon: rename l1sched_prim_init() to l1sched_prim_alloc() ...................................................................... trxcon: rename l1sched_prim_init() to l1sched_prim_alloc() The current function name is confusing, because l1sched_prim_init() is not only initializing a primitive, but also allocating it on heap. Let's use '_alloc' instead of '_init' to reflect that. Change-Id: Ie1bebb6829ba9f640455685fcd7309b6aa442ef0 Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h M src/host/trxcon/src/l1ctl.c M src/host/trxcon/src/sched_prim.c 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h index d8f51a5..b1eee39 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h @@ -358,7 +358,7 @@ enum l1sched_lchan_type chan); /* Primitive management functions */ -int l1sched_prim_init(void *ctx, struct l1sched_ts_prim **prim, +int l1sched_prim_alloc(void *ctx, struct l1sched_ts_prim **prim, size_t pl_len, uint8_t chan_nr, uint8_t link_id); int l1sched_prim_push(struct trx_instance *trx, struct l1sched_ts_prim *prim, uint8_t chan_nr); diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 980ac49..0d5bcb9 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -541,7 +541,7 @@ } /* Init a new primitive */ - rc = l1sched_prim_init(l1l->trx, &prim, len, ul->chan_nr, ul->link_id); + rc = l1sched_prim_alloc(l1l->trx, &prim, len, ul->chan_nr, ul->link_id); if (rc) goto exit; @@ -724,7 +724,7 @@ chan_nr, link_id, payload_len); /* Init a new primitive */ - rc = l1sched_prim_init(l1l->trx, &prim, payload_len, + rc = l1sched_prim_alloc(l1l->trx, &prim, payload_len, chan_nr, link_id); if (rc) goto exit; diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index 64517f5..bf36e7a 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -44,7 +44,7 @@ * @param link_id RSL link description (used to set a proper chan) * @return zero in case of success, otherwise a error number */ -int l1sched_prim_init(void *ctx, struct l1sched_ts_prim **prim, +int l1sched_prim_alloc(void *ctx, struct l1sched_ts_prim **prim, size_t pl_len, uint8_t chan_nr, uint8_t link_id) { enum l1sched_lchan_type lchan_type; @@ -161,7 +161,7 @@ }; /* Allocate a new primitive */ - rc = l1sched_prim_init(lchan, &prim, GSM_MACBLOCK_LEN, + rc = l1sched_prim_alloc(lchan, &prim, GSM_MACBLOCK_LEN, l1sched_lchan_desc[lchan->type].chan_nr, L1SCHED_CH_LID_SACCH); OSMO_ASSERT(rc == 0); -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28560
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ie1bebb6829ba9f640455685fcd7309b6aa442ef0 Gerrit-Change-Number: 28560 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: return prim pointer from l1sched_prim_alloc()
by fixeria
fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28549
) Change subject: trxcon: return prim pointer from l1sched_prim_alloc() ...................................................................... trxcon: return prim pointer from l1sched_prim_alloc() Returning prim pointer is more convinient from the API point of view. Change-Id: I0fa41cf55e90d191d032bca1754941cca763b03e Related: OS#5599, OS#3761 --- M src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h M src/host/trxcon/src/l1ctl.c M src/host/trxcon/src/sched_prim.c 3 files changed, 27 insertions(+), 27 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h index b1eee39..cb82cfb 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h @@ -358,8 +358,8 @@ enum l1sched_lchan_type chan); /* Primitive management functions */ -int l1sched_prim_alloc(void *ctx, struct l1sched_ts_prim **prim, - size_t pl_len, uint8_t chan_nr, uint8_t link_id); +struct l1sched_ts_prim *l1sched_prim_alloc(void *ctx, size_t pl_len, + uint8_t chan_nr, uint8_t link_id); int l1sched_prim_push(struct trx_instance *trx, struct l1sched_ts_prim *prim, uint8_t chan_nr); diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 0d5bcb9..734fa77 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -541,9 +541,11 @@ } /* Init a new primitive */ - rc = l1sched_prim_alloc(l1l->trx, &prim, len, ul->chan_nr, ul->link_id); - if (rc) + prim = l1sched_prim_alloc(l1l->trx, len, ul->chan_nr, ul->link_id); + if (prim == NULL) { + rc = -ENOMEM; goto exit; + } /** * Push this primitive to the transmit queue. @@ -724,10 +726,11 @@ chan_nr, link_id, payload_len); /* Init a new primitive */ - rc = l1sched_prim_alloc(l1l->trx, &prim, payload_len, - chan_nr, link_id); - if (rc) + prim = l1sched_prim_alloc(l1l->trx, payload_len, chan_nr, link_id); + if (prim == NULL) { + rc = -ENOMEM; goto exit; + } /* Push this primitive to transmit queue */ rc = l1sched_prim_push(l1l->trx, prim, chan_nr); diff --git a/src/host/trxcon/src/sched_prim.c b/src/host/trxcon/src/sched_prim.c index bf36e7a..a8e77fc 100644 --- a/src/host/trxcon/src/sched_prim.c +++ b/src/host/trxcon/src/sched_prim.c @@ -2,7 +2,8 @@ * OsmocomBB <-> SDR connection bridge * TDMA scheduler: primitive management * - * (C) 2017 by Vadim Yanitskiy <axilirator(a)gmail.com> + * (C) 2017-2022 by Vadim Yanitskiy <axilirator(a)gmail.com> + * Contributions by sysmocom - s.f.m.c. GmbH * * All Rights Reserved * @@ -38,17 +39,16 @@ * and filling some meta-information (e.g. lchan type). * * @param ctx parent talloc context - * @param prim external prim pointer (will point to the allocated prim) * @param pl_len prim payload length * @param chan_nr RSL channel description (used to set a proper chan) * @param link_id RSL link description (used to set a proper chan) - * @return zero in case of success, otherwise a error number + * @return allocated primitive or NULL */ -int l1sched_prim_alloc(void *ctx, struct l1sched_ts_prim **prim, - size_t pl_len, uint8_t chan_nr, uint8_t link_id) +struct l1sched_ts_prim *l1sched_prim_alloc(void *ctx, size_t pl_len, + uint8_t chan_nr, uint8_t link_id) { enum l1sched_lchan_type lchan_type; - struct l1sched_ts_prim *new_prim; + struct l1sched_ts_prim *prim; uint8_t len; /* Determine lchan type */ @@ -56,7 +56,7 @@ if (!lchan_type) { LOGP(DSCH, LOGL_ERROR, "Couldn't determine lchan type " "for chan_nr=%02x and link_id=%02x\n", chan_nr, link_id); - return -EINVAL; + return NULL; } /* How much memory do we need? */ @@ -64,20 +64,17 @@ len += pl_len; /* Requested payload size */ /* Allocate a new primitive */ - new_prim = talloc_zero_size(ctx, len); - if (new_prim == NULL) { + prim = talloc_zero_size(ctx, len); + if (prim == NULL) { LOGP(DSCH, LOGL_ERROR, "Failed to allocate memory\n"); - return -ENOMEM; + return NULL; } /* Init primitive header */ - new_prim->payload_len = pl_len; - new_prim->chan = lchan_type; + prim->payload_len = pl_len; + prim->chan = lchan_type; - /* Set external pointer */ - *prim = new_prim; - - return 0; + return prim; } /** @@ -129,7 +126,6 @@ struct l1sched_ts_prim *prim; uint8_t *mr_src_ptr; bool cached; - int rc; /* "Dummy" Measurement Report */ static const uint8_t meas_rep_dummy[] = { @@ -161,9 +157,10 @@ }; /* Allocate a new primitive */ - rc = l1sched_prim_alloc(lchan, &prim, GSM_MACBLOCK_LEN, - l1sched_lchan_desc[lchan->type].chan_nr, L1SCHED_CH_LID_SACCH); - OSMO_ASSERT(rc == 0); + prim = l1sched_prim_alloc(lchan, GSM_MACBLOCK_LEN, + l1sched_lchan_desc[lchan->type].chan_nr, + L1SCHED_CH_LID_SACCH); + OSMO_ASSERT(prim != NULL); /* Check if the MR cache is populated (verify LAPDm header) */ cached = (lchan->sacch.mr_cache[2] != 0x00 -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28549
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I0fa41cf55e90d191d032bca1754941cca763b03e Gerrit-Change-Number: 28549 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
2 years, 11 months
1
0
0
0
Change in osmocom-bb[master]: trxcon: fix uint8_t used for length in l1sched_prim_alloc()
by fixeria
fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/osmocom-bb/+/28550
) Change subject: trxcon: fix uint8_t used for length in l1sched_prim_alloc() ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/28550
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ic19b8433118798f57500119f1caf10e117e5db19 Gerrit-Change-Number: 28550 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 12 Jul 2022 08:21:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
Change in osmo-ci[master]: ansible/hosts: Replace failed OBS/qemu with real arm machine
by pespin
Attention is currently required from: laforge. pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-ci/+/28567
) Change subject: ansible/hosts: Replace failed OBS/qemu with real arm machine ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/28567
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I5f3ffe451d029ba459575881bf88f2527fe9fd15 Gerrit-Change-Number: 28567 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 12 Jul 2022 08:20:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
2 years, 11 months
1
0
0
0
← Newer
1
...
178
179
180
181
182
183
184
...
218
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
Results per page:
10
25
50
100
200