lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • 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
gerrit-log@lists.osmocom.org

July 2023

  • 1 participants
  • 3051 discussions
[S] Change in osmo-bts[master]: ASCI: Retrieve NCH position from System Information 1
by laforge 21 Jul '23

21 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33296 ) Change subject: ASCI: Retrieve NCH position from System Information 1 ...................................................................... ASCI: Retrieve NCH position from System Information 1 When BCCH INFO is received via RSL message, the rest octet of the System Information 1 message is parsed to get the position of the NCH. The position is stored in the gsm_bts structure. If the position is not present int the rest octet, the stored value is set to negative. Change-Id: I799a27179d478d4ff577d8bc47ae524834851e85 Related: OS#5781 --- M include/osmo-bts/bts.h M include/osmo-bts/bts_trx.h M src/common/bts.c M src/common/rsl.c M src/common/sysinfo.c M tests/paging/paging_test.c 6 files changed, 43 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 191a9f4..eb0c663 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -295,6 +295,7 @@ /* Advanced Speech Call Items (VBS/VGCS) + NCH related bits */ struct { + int pos_nch; /* position of the NCH or < 0, if not available */ struct llist_head notifications; } asci; diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h index ab90cc5..72522eb 100644 --- a/include/osmo-bts/bts_trx.h +++ b/include/osmo-bts/bts_trx.h @@ -58,6 +58,7 @@ void trx_operability_update(struct gsm_bts_trx *trx); uint8_t num_agch(const struct gsm_bts_trx *trx, const char * arg); +int pos_nch(const struct gsm_bts_trx *trx, const char *arg); bool trx_ms_pwr_ctrl_is_osmo(const struct gsm_bts_trx *trx); #define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args) diff --git a/src/common/bts.c b/src/common/bts.c index a611a9d..b4a5f80 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -404,6 +404,7 @@ bts->smscb_queue_tgt_len = 2; bts->smscb_queue_hyst = 2; + bts->asci.pos_nch = -ENOTSUP; INIT_LLIST_HEAD(&bts->asci.notifications); INIT_LLIST_HEAD(&bts->bsc_oml_hosts); diff --git a/src/common/rsl.c b/src/common/rsl.c index e072022..c7450c5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -640,6 +640,10 @@ } break; case SYSINFO_TYPE_1: + /* Get the position of the NCH, if enabled. */ + trx->bts->asci.pos_nch = pos_nch(trx, "BCCH INFO"); + pcu_tx_si(trx->bts, SYSINFO_TYPE_1, true); + break; case SYSINFO_TYPE_2: case SYSINFO_TYPE_13: pcu_tx_si(trx->bts, osmo_si, true); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index b0f1ebf..f1aee10 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -164,6 +164,26 @@ return 1; } +/* Returns position of the NCH accroding to SI1 rest octets. See Table 10.5.2.32.1 of TS 44.018. + * Returns < 0, if not present. */ +int pos_nch(const struct gsm_bts_trx *trx, const char *arg) +{ + const struct gsm_bts *b = trx->bts; + const struct gsm48_system_information_type_1 *si1; + + if (GSM_BTS_HAS_SI(b, SYSINFO_TYPE_1)) { + si1 = GSM_BTS_SI(b, SYSINFO_TYPE_1); + if (si1->rest_octets[0] & 0x80) { + /* H <NCH Position : bit (5)> */ + return (si1->rest_octets[0] >> 2) & 0x1f; + } + return -ENOTSUP; + } + LOGP(DL1P, LOGL_NOTICE, "%s: Unable to determine actual NCH Position " + "value as SI1 is not available yet.\n", arg); + return -EINVAL; +} + /* re-generate SI3 restoctets with GPRS indicator depending on the PCU socket connection state */ void regenerate_si3_restoctets(struct gsm_bts *bts) { diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 05013d0..26f5728 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -134,6 +134,7 @@ si3.control_channel_desc.bs_ag_blks_res = bs_ag_blks_res; trx.bts = &bts; bts.si_valid |= 0x8; + bts.asci.pos_nch = -1; memcpy(&bts.si_buf[SYSINFO_TYPE_3][0], &si3, sizeof(si3)); return &trx; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33296 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I799a27179d478d4ff577d8bc47ae524834851e85 Gerrit-Change-Number: 33296 Gerrit-PatchSet: 9 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bts[master]: ASCI: Add support for rest octets in Paging request type 2 and 3
by laforge 21 Jul '23

21 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33298 ) ( 6 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ASCI: Add support for rest octets in Paging request type 2 and 3 ...................................................................... ASCI: Add support for rest octets in Paging request type 2 and 3 Currently the rest octets contain Notification List Number (NLN) and NLN status and the "Channel Needed" (CN3 / CN4) fields for mobile identities. The existing encoding of CN3 / CN4 in Paging request type 3 has been replaced. The missing encoding of CN3 in Paging request type 2 has been added. Change-Id: I6e33a6d38d4c7b124de35b53d219b64bb881ba66 Related: OS#5781 --- M src/common/paging.c 1 file changed, 146 insertions(+), 12 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/paging.c b/src/common/paging.c index edc2c1f..2b20786 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -353,6 +353,33 @@ } r8; }; +/* abstract representation of P2 rest octets; we only implement those parts we need for now */ +struct p2_rest_octets { + struct { + bool present; + uint8_t cn3; + } cneed; + struct { + bool present; + uint8_t nln; + uint8_t nln_status; + } nln_pch; +}; + +/* abstract representation of P3 rest octets; we only implement those parts we need for now */ +struct p3_rest_octets { + struct { + bool present; + uint8_t cn3; + uint8_t cn4; + } cneed; + struct { + bool present; + uint8_t nln; + uint8_t nln_status; + } nln_pch; +}; + /* 3GPP TS 44.018 10.5.2.23 append a segment/page of an ETWS primary notification to given bitvec */ static void append_etws_prim_notif(struct bitvec *bv, bool is_first, uint8_t page_nr, const uint8_t *etws, ssize_t etws_len) @@ -424,6 +451,49 @@ } } +/* 3GPP TS 44.018 10.5.2.24 append P2 Rest Octets to given bit-vector */ +static void append_p2_rest_octets(struct bitvec *bv, const struct p2_rest_octets *p2ro) +{ + /* {L | H <CN3: bit (2)>} */ + if (p2ro->cneed.present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, p2ro->cneed.cn3, 2); + } else + bitvec_set_bit(bv, L); /* no CN3 */ + + /* {L | H < NLN(PCH) : bit (2) <NLN status(PCH) : bit>} */ + if (p2ro->nln_pch.present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, p2ro->nln_pch.nln, 2); + bitvec_set_uint(bv, p2ro->nln_pch.nln_status, 1); + } else + bitvec_set_bit(bv, L); /* no NLN */ + + /* Note: If this needs to be extended in the future, check if it actually fits into rest of P2! */ +} + +/* 3GPP TS 44.018 10.5.2.25 append P3 Rest Octets to given bit-vector */ +static void append_p3_rest_octets(struct bitvec *bv, const struct p3_rest_octets *p3ro) +{ + /* {L | H <CN3: bit (2)> <CN3: bit (2)>} */ + if (p3ro->cneed.present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, p3ro->cneed.cn3, 2); + bitvec_set_uint(bv, p3ro->cneed.cn4, 2); + } else + bitvec_set_bit(bv, L); /* no CN3/CN4 */ + + /* {L | H < NLN(PCH) : bit (2) <NLN status(PCH) : bit>} */ + if (p3ro->nln_pch.present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, p3ro->nln_pch.nln, 2); + bitvec_set_uint(bv, p3ro->nln_pch.nln_status, 1); + } else + bitvec_set_bit(bv, L); /* no NLN */ + + /* Note: If this needs to be extended in the future, check if it actually fits into 3 octets! */ +} + static int fill_paging_type_1(uint8_t *out_buf, const uint8_t *identity1_lv, uint8_t chan1, const uint8_t *identity2_lv, uint8_t chan2, const struct p1_rest_octets *p1ro, @@ -466,10 +536,12 @@ static int fill_paging_type_2(uint8_t *out_buf, const uint8_t *tmsi1_lv, uint8_t cneed1, const uint8_t *tmsi2_lv, - uint8_t cneed2, const uint8_t *identity3_lv) + uint8_t cneed2, const uint8_t *identity3_lv, + const struct p2_rest_octets *p2ro) { struct gsm48_paging2 *pt2 = (struct gsm48_paging2 *) out_buf; uint32_t tmsi; + unsigned int ro_len; uint8_t *cur; int rc; @@ -493,16 +565,32 @@ pt2->l2_plen = L2_PLEN(cur - out_buf); - return cur - out_buf; + /* Pad remaining octets with constant '2B'O */ + ro_len = GSM_MACBLOCK_LEN - (cur - out_buf); + memset(cur, GSM_MACBLOCK_PADDING, ro_len); + + /* Optional P2 Rest Octets */ + if (p2ro) { + struct bitvec bv = { + .data_len = ro_len, + .data = cur, + }; + + append_p2_rest_octets(&bv, p2ro); + } + + return GSM_MACBLOCK_LEN; } static int fill_paging_type_3(uint8_t *out_buf, const uint8_t *tmsi1_lv, uint8_t cneed1, const uint8_t *tmsi2_lv, uint8_t cneed2, - const uint8_t *tmsi3_lv, uint8_t cneed3, - const uint8_t *tmsi4_lv, uint8_t cneed4) + const uint8_t *tmsi3_lv, const uint8_t *tmsi4_lv, + const struct p3_rest_octets *p3ro) { struct gsm48_paging3 *pt3 = (struct gsm48_paging3 *) out_buf; uint32_t tmsi; + unsigned int ro_len; + uint8_t *cur; int rc; memset(out_buf, 0, sizeof(*pt3)); @@ -524,13 +612,25 @@ rc = tmsi_mi_to_uint(&tmsi, tmsi4_lv); if (rc == 0) pt3->tmsi4 = tmsi; + cur = out_buf + 20; /* Cannot use sizeof(*pt3), because it has more octets. */ - /* The structure definition in libosmocore is wrong. It includes as last - * byte some invalid definition of chneed3/chneed4, so we must do this by hand - * here and cannot rely on sizeof(*pt3) */ - out_buf[20] = (0x23 & ~0xf8) | 0x80 | (cneed3 & 3) << 5 | (cneed4 & 3) << 3; + pt3->l2_plen = L2_PLEN(cur - out_buf); - return 21; + /* Pad remaining octets with constant '2B'O */ + ro_len = GSM_MACBLOCK_LEN - (cur - out_buf); + memset(cur, GSM_MACBLOCK_PADDING, ro_len); + + /* Optional P3 Rest Octets */ + if (p3ro) { + struct bitvec bv = { + .data_len = ro_len, + .data = cur, + }; + + append_p3_rest_octets(&bv, p3ro); + } + + return GSM_MACBLOCK_LEN; } static const uint8_t empty_id_lv[] = { 0x01, 0xF0 }; @@ -690,24 +790,39 @@ if (num_pr == 4 && num_imsi == 0) { /* No IMSI: easy case, can use TYPE 3 */ DEBUGP(DPAG, "Tx PAGING TYPE 3 (4 TMSI)\n"); + struct p3_rest_octets p3ro; + memset(&p3ro, 0, sizeof(p3ro)); + p3ro.cneed.present = true; + p3ro.cneed.cn3 = pr[2]->u.normal.chan_needed; + p3ro.cneed.cn4 = pr[3]->u.normal.chan_needed; + p3ro.nln_pch.present = (bts->asci.pos_nch >= 0); + p3ro.nln_pch.nln = bts->asci.nln; + p3ro.nln_pch.nln_status = bts->asci.nln_status; len = fill_paging_type_3(out_buf, pr[0]->u.normal.identity_lv, pr[0]->u.normal.chan_needed, pr[1]->u.normal.identity_lv, pr[1]->u.normal.chan_needed, pr[2]->u.normal.identity_lv, - pr[2]->u.normal.chan_needed, pr[3]->u.normal.identity_lv, - pr[3]->u.normal.chan_needed); + &p3ro); } else if (num_pr >= 3 && num_imsi <= 1) { /* 3 or 4, of which only up to 1 is IMSI */ DEBUGP(DPAG, "Tx PAGING TYPE 2 (2 TMSI,1 xMSI)\n"); + struct p2_rest_octets p2ro; + memset(&p2ro, 0, sizeof(p2ro)); + p2ro.cneed.present = true; + p2ro.cneed.cn3 = pr[2]->u.normal.chan_needed; + p2ro.nln_pch.present = (bts->asci.pos_nch >= 0); + p2ro.nln_pch.nln = bts->asci.nln; + p2ro.nln_pch.nln_status = bts->asci.nln_status; len = fill_paging_type_2(out_buf, pr[0]->u.normal.identity_lv, pr[0]->u.normal.chan_needed, pr[1]->u.normal.identity_lv, pr[1]->u.normal.chan_needed, - pr[2]->u.normal.identity_lv); + pr[2]->u.normal.identity_lv, + &p2ro); if (num_pr == 4) { /* re-add #4 for next time */ llist_add(&pr[3]->list, group_q); -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33298 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I6e33a6d38d4c7b124de35b53d219b64bb881ba66 Gerrit-Change-Number: 33298 Gerrit-PatchSet: 10 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bts[master]: ASCI: Add Notification CHannel (NCH) support
by laforge 21 Jul '23

21 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33297 ) Change subject: ASCI: Add Notification CHannel (NCH) support ...................................................................... ASCI: Add Notification CHannel (NCH) support The location of the NCH is defined by the rest octet of System Information 1. If NCH is defined, the given CCCH blocks are used for NCH instead of AGCH/PCH. The current list of VGCS/VBS call notifications is transmitted on the NCH. If there is no notification, an empty notification is transmitted on the NCH. The Notification List Number (NLN) is used to indicated new notificaitons. Only the last notification (or empty notification) indicates NLN. This way the MS can determine after two equal NLN that the complete list has been recevied. Change-Id: I82fdaba3faaced76267a99ae14a5458a1b41fdaa Related: OS#5781 --- M include/osmo-bts/bts.h M include/osmo-bts/l1sap.h M include/osmo-bts/notification.h M src/common/bts.c M src/common/l1sap.c M src/common/notification.c M tests/agch/agch_test.c M tests/paging/paging_test.c 8 files changed, 153 insertions(+), 26 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index eb0c663..677ff9c 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -296,7 +296,10 @@ /* Advanced Speech Call Items (VBS/VGCS) + NCH related bits */ struct { int pos_nch; /* position of the NCH or < 0, if not available */ + uint8_t nln, nln_status; /* current notification list number and status */ struct llist_head notifications; + int notification_entries; /* current number of entries in the list */ + int notification_count; /* counter to count all entries */ } asci; struct paging_state *paging_state; @@ -407,8 +410,14 @@ int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg); struct msgb *bts_agch_dequeue(struct gsm_bts *bts); int bts_agch_max_queue_length(int T, int bcch_conf); -int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, - int is_ag_res); + +enum ccch_msgt { + CCCH_MSGT_AGCH, + CCCH_MSGT_PCH, + CCCH_MSGT_NCH, +}; + +int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, enum ccch_msgt ccch); int bts_supports_cipher(struct gsm_bts *bts, int rsl_cipher); uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time); void regenerate_si3_restoctets(struct gsm_bts *bts); diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 87e1a99..353fc90 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -146,6 +146,6 @@ int bts_check_for_first_ciphrd(struct gsm_lchan *lchan, uint8_t *data, int len); -int is_ccch_for_agch(struct gsm_bts_trx *trx, uint32_t fn); +enum ccch_msgt get_ccch_msgt(struct gsm_bts_trx *trx, uint32_t fn); #endif /* L1SAP_H */ diff --git a/include/osmo-bts/notification.h b/include/osmo-bts/notification.h index 3d05acc..f8a7b48 100644 --- a/include/osmo-bts/notification.h +++ b/include/osmo-bts/notification.h @@ -55,3 +55,5 @@ const struct asci_notification *bts_asci_notification_get_next(struct gsm_bts *bts); void append_group_call_information(struct bitvec *bv, const uint8_t *gcr, const uint8_t *ch_desc, uint8_t ch_desc_len); + +int bts_asci_notify_nch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf); diff --git a/src/common/bts.c b/src/common/bts.c index b4a5f80..7257f37 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -56,6 +56,7 @@ #include <osmo-bts/nm_common_fsm.h> #include <osmo-bts/power_control.h> #include <osmo-bts/osmux.h> +#include <osmo-bts/notification.h> #define MIN_QUAL_RACH 50 /* minimum link quality (in centiBels) for Access Bursts */ #define MIN_QUAL_NORM -5 /* minimum link quality (in centiBels) for Normal Bursts */ @@ -723,8 +724,7 @@ return; } -int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, - int is_ag_res) +int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt, enum ccch_msgt ccch) { struct msgb *msg = NULL; int rc = 0; @@ -737,17 +737,25 @@ */ compact_agch_queue(bts); - /* Check for paging messages first if this is PCH */ - if (!is_ag_res) + switch (ccch) { + case CCCH_MSGT_NCH: + /* Send NCH message, it has priority over AGCH and does not overlap with PCH. */ + rc = bts_asci_notify_nch_gen_msg(bts, out_buf); + return rc; + case CCCH_MSGT_PCH: + /* Check whether the block may be overwritten by AGCH. */ rc = paging_gen_msg(bts->paging_state, out_buf, gt, &is_empty); - - /* Check whether the block may be overwritten */ - if (!is_empty) - return rc; - - msg = bts_agch_dequeue(bts); - if (!msg) - return rc; + if (!is_empty) + return rc; + /* fall-through */ + case CCCH_MSGT_AGCH: + /* If fallen here and the AGCH queue is empty, return empty PCH message. */ + msg = bts_agch_dequeue(bts); + if (!msg) + return rc; + /* Continue to return AGCH message. */ + break; + } rate_ctr_inc2(bts->ctrs, BTS_CTR_AGCH_SENT); @@ -756,7 +764,7 @@ rc = msgb_l3len(msg); msgb_free(msg); - if (is_ag_res) + if (ccch == CCCH_MSGT_AGCH) bts->agch_queue.agch_msgs++; else bts->agch_queue.pch_msgs++; diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 1c43f8f..268486e 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -902,15 +902,32 @@ return 0; } -/* Check if given CCCH frame number is for a PCH or for an AGCH (this function is +/* Check if given CCCH frame number is for a NCH, PCH or for an AGCH (this function is * only used internally, it is public to call it from unit-tests) */ -int is_ccch_for_agch(struct gsm_bts_trx *trx, uint32_t fn) { +enum ccch_msgt get_ccch_msgt(struct gsm_bts_trx *trx, uint32_t fn) +{ + uint8_t block, first_block, num_blocks; + int rc; + + block = l1sap_fn2ccch_block(fn); + + /* If there is an NCH, check if the block number matches. It has priority over PCH/AGCH. */ + if (trx->bts->asci.pos_nch >= 0) { + rc = osmo_gsm48_si1ro_nch_pos_decode(trx->bts->asci.pos_nch, &num_blocks, &first_block); + if (rc >= 0 && block >= first_block && block < first_block + num_blocks) + return CCCH_MSGT_NCH; + } + /* Note: The number of available access grant channels is set by the * parameter BS_AG_BLKS_RES via system information type 3. This SI is * transferred to osmo-bts via RSL */ - return l1sap_fn2ccch_block(fn) < num_agch(trx, "PH-RTS-IND"); + if (l1sap_fn2ccch_block(fn) < num_agch(trx, "PH-RTS-IND")) + return CCCH_MSGT_AGCH; + + return CCCH_MSGT_PCH; } + /* return the measured average of frame numbers that the RTS clock is running in advance */ int32_t bts_get_avg_fn_advance(const struct gsm_bts *bts) { @@ -1048,7 +1065,6 @@ struct msgb *pp_msg; bool dtxd_facch = false; int rc; - int is_ag_res; chan_nr = rts_ind->chan_nr; link_id = rts_ind->link_id; @@ -1183,8 +1199,7 @@ } } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); - is_ag_res = is_ccch_for_agch(trx, fn); - rc = bts_ccch_copy_msg(trx->bts, p, &g_time, is_ag_res); + rc = bts_ccch_copy_msg(trx->bts, p, &g_time, get_ccch_msgt(trx, fn)); if (rc <= 0) memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } diff --git a/src/common/notification.c b/src/common/notification.c index 1fda519..35dc65f 100644 --- a/src/common/notification.c +++ b/src/common/notification.c @@ -71,6 +71,10 @@ /* add at beginning of "queue" to make sure a new call is notified first */ llist_add(&n->list, &bts->asci.notifications); + bts->asci.notification_entries++; + bts->asci.notification_count = 0; + bts->asci.nln = (bts->asci.nln + 1) % 4; + return 0; } @@ -86,6 +90,10 @@ llist_del(&n->list); talloc_free(n); + bts->asci.notification_entries--; + bts->asci.notification_count = 0; + bts->asci.nln_status = (bts->asci.nln_status + 1) % 2; + return 0; } @@ -100,6 +108,11 @@ llist_del(&n->list); talloc_free(n); } + + bts->asci.notification_entries = 0; + bts->asci.notification_count = 0; + bts->asci.nln_status = (bts->asci.nln_status + 1) % 2; + return 0; } @@ -153,3 +166,60 @@ bitvec_free(gcr_bv); } + +#define L2_PLEN(len) (((len - 1) << 2) | 0x01) + +int bts_asci_notify_nch_gen_msg(struct gsm_bts *bts, uint8_t *out_buf) +{ + struct gsm48_notification_nch *nn = (struct gsm48_notification_nch *) out_buf; + const struct asci_notification *notif; + unsigned int ro_len; + + notif = bts_asci_notification_get_next(bts); + + *nn = (struct gsm48_notification_nch) { + .proto_discr = GSM48_PDISC_RR, + .msg_type = GSM48_MT_RR_NOTIF_NCH, + }; + + nn->l2_plen = L2_PLEN(nn->data - out_buf); + + /* Pad remaining octets with constant '2B'O */ + ro_len = GSM_MACBLOCK_LEN - (nn->data - out_buf); + memset(nn->data, GSM_MACBLOCK_PADDING, ro_len); + + struct bitvec bv = { + .data_len = ro_len, + .data = nn->data, + }; + + /* {0 | 1 < NLN(NCH) : bit (2) >} + * Only send NLN, at the last notifications. + * When the phone receives two NLN with the same value, it knows that all notifications has been received. + * Also send NLN if no notification is available. */ + if (bts->asci.notification_count >= bts->asci.notification_entries - 1) { + bitvec_set_bit(&bv, 1); + bitvec_set_uint(&bv, bts->asci.nln, 2); + } else { + bitvec_set_bit(&bv, 0); + } + + /* Count NLN. */ + if (++bts->asci.notification_count >= bts->asci.notification_entries) + bts->asci.notification_count = 0; + + /* < List of Group Call NCH information > ::= + * { 0 | 1 < Group Call information > < List of Group Call NCH information > } ; */ + if (notif) { + bitvec_set_bit(&bv, 1); + append_group_call_information(&bv, notif->group_call_ref, + notif->chan_desc.present ? notif->chan_desc.value : NULL, + notif->chan_desc.len); + } + bitvec_set_bit(&bv, 0); /* End of list */ + + /* TODO: Additions in Release 6 */ + /* TODO: Additions in Release 7 */ + + return GSM_MACBLOCK_LEN; +} diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index 8ddc0f7..86c5c20 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -159,7 +159,7 @@ if (is_agch) multiframes++; - rc = bts_ccch_copy_msg(bts, out_buf, &g_time, is_agch); + rc = bts_ccch_copy_msg(bts, out_buf, &g_time, (is_agch) ? CCCH_MSGT_AGCH : CCCH_MSGT_PCH); ima = (struct gsm48_imm_ass *)out_buf; switch (ima->msg_type) { case GSM48_MT_RR_IMM_ASS: diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index 26f5728..d48932b 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -144,7 +144,7 @@ * Table 5 of 9 must occur. */ static void test_is_ccch_for_agch(void) { - int is_ag_res; + enum ccch_msgt ccch; int fn; uint8_t bs_ag_blks_res; struct gsm_bts_trx *trx; @@ -172,8 +172,8 @@ /* Try allo possible settings for bs_ag_blks_res */ for (bs_ag_blks_res = 0; bs_ag_blks_res <= 7; bs_ag_blks_res++) { trx = test_is_ccch_for_agch_setup(bs_ag_blks_res); - is_ag_res = is_ccch_for_agch(trx, fn); - printf(" %u", is_ag_res); + ccch = get_ccch_msgt(trx, fn); + printf(" %u", (ccch == CCCH_MSGT_AGCH)); } printf("\n"); } -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33297 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I82fdaba3faaced76267a99ae14a5458a1b41fdaa Gerrit-Change-Number: 33297 Gerrit-PatchSet: 10 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: ASCI: Forward UPLINK RELEASE on dedicated channel to MSC
by laforge 21 Jul '23

21 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33609 ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ASCI: Forward UPLINK RELEASE on dedicated channel to MSC ...................................................................... ASCI: Forward UPLINK RELEASE on dedicated channel to MSC If the phone is (still) on a dedicated channel, it may release the uplink in case of a voice group call. It depends on the MSC how to handle the situation. Currently it releases the call. Generally the phone is assigned to the VGCS/VBS channel before it releases the uplink. Change-Id: Ib91c282ed36e82b38c0e738533e3a421de81a9a8 Related: OS#4852 --- M src/osmo-bsc/gsm_04_08_rr.c 1 file changed, 23 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 6d74e43..78a4f45 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -1170,6 +1170,12 @@ * according to spec */ bsc_dtap(conn, link_id, msg); break; + case GSM48_MT_RR_UPLINK_RELEASE: + /* When the calling phone releases the uplink before it has been assigned to the group + * channel, it will send an UPLINK RELEASE message on the dedicated channel. The MSC + * has to take care of it. (assigning the phone to the group channel) */ + bsc_dtap(conn, link_id, msg); + break; default: /* Drop unknown RR message */ LOG_LCHAN(msg->lchan, LOGL_NOTICE, "Unknown RR message: %s\n", -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33609 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib91c282ed36e82b38c0e738533e3a421de81a9a8 Gerrit-Change-Number: 33609 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bsc[master]: ASCI: Add TX support for UPLINK FREE/BUSY messages
by laforge 21 Jul '23

21 Jul '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33608 ) Change subject: ASCI: Add TX support for UPLINK FREE/BUSY messages ...................................................................... ASCI: Add TX support for UPLINK FREE/BUSY messages Change-Id: Ia27e0ebb5bf7edb1b9f84999cafc028231b9489f Related: OS#4852 --- M include/osmocom/bsc/gsm_04_08_rr.h M src/osmo-bsc/gsm_04_08_rr.c 2 files changed, 57 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h index c0f8d4b..3106e77 100644 --- a/include/osmocom/bsc/gsm_04_08_rr.h +++ b/include/osmocom/bsc/gsm_04_08_rr.h @@ -34,6 +34,8 @@ const uint8_t *apdu_data, ssize_t apdu_data_len); int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t mode); int gsm48_send_uplink_release(struct gsm_lchan *lchan, uint8_t cause); +int gsm48_send_uplink_busy(struct gsm_lchan *lchan); +int gsm48_send_uplink_free(struct gsm_lchan *lchan, uint8_t acc_bit, uint8_t *uic); int gsm48_rx_rr_modif_ack(struct msgb *msg); int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 5c2b0f8..6d74e43 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -770,6 +770,51 @@ return gsm48_sendmsg(msg); } +/* TS 44.018 section 9.1.46 */ +int gsm48_send_uplink_busy(struct gsm_lchan *lchan) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 UL BUSY"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + msg->lchan = lchan; + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_UPLINK_BUSY; + + return gsm48_sendmsg_unit(msg); +} + +/* TS 44.018 section 9.1.47 */ +int gsm48_send_uplink_free(struct gsm_lchan *lchan, uint8_t acc_bit, uint8_t *uic) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 UL FREE"); + struct gsm48_hdr_sh *sh = (struct gsm48_hdr_sh *) msgb_put(msg, sizeof(*sh) + 22); + struct bitvec *bv = bitvec_alloc(22, NULL); + + msg->lchan = lchan; + sh->rr_short_pd = GSM48_PDISC_SH_RR; + sh->msg_type = GSM48_MT_RR_SH_UL_FREE; + sh->l2_header = 0; + + /* < Uplink Access Request bit > */ + bitvec_set_bit(bv, (acc_bit) ? H : L); + + /* { L | H <Uplink Identity Code bit(6) > } */ + if (uic) { + bitvec_set_bit(bv, H); + sh->data[0] = 0x40 | *uic; + } else + bitvec_set_bit(bv, L); + + /* Emergency mode not supported */ + + /* Padding the rest with 0x2B and apply to msg. */ + bitvec_spare_padding(bv, 175); + bitvec_pack(bv, sh->data); + bitvec_free(bv); + + return gsm48_sendmsg_unit(msg); +} + int gsm48_rx_rr_modif_ack(struct msgb *msg) { struct gsm48_hdr *gh = msgb_l3(msg); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ia27e0ebb5bf7edb1b9f84999cafc028231b9489f Gerrit-Change-Number: 33608 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bsc[master]: ASCI: Add TX support for UPLINK FREE/BUSY messages
by laforge 21 Jul '23

21 Jul '23
Attention is currently required from: jolly. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33608 ) Change subject: ASCI: Add TX support for UPLINK FREE/BUSY messages ...................................................................... Patch Set 6: (1 comment) Patchset: PS6: > another bogus comment, please ignore another bogus comment, please ignore -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33608 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ia27e0ebb5bf7edb1b9f84999cafc028231b9489f Gerrit-Change-Number: 33608 Gerrit-PatchSet: 6 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Fri, 21 Jul 2023 12:26:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bts[master]: osmo-bts-trx: tx_tch[fh]_fn(): fix NULL pointer dereference
by osmith 21 Jul '23

21 Jul '23
Attention is currently required from: fixeria. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33858 ) Change subject: osmo-bts-trx: tx_tch[fh]_fn(): fix NULL pointer dereference ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33858 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I0e7d5634b5223bc246badbb8e94b620c967ab121 Gerrit-Change-Number: 33858 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jul 2023 08:15:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-dev[master]: ttcn3/ttcn3.sh: add osmo-ggsn
by osmith 21 Jul '23

21 Jul '23
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/33803 ) Change subject: ttcn3/ttcn3.sh: add osmo-ggsn ...................................................................... ttcn3/ttcn3.sh: add osmo-ggsn Order the list alphabetically while at it. Change-Id: Ibdf30a0f87a4cc19c37c6337edff42fd4e56342a --- M ttcn3/ttcn3.sh 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved; Verified diff --git a/ttcn3/ttcn3.sh b/ttcn3/ttcn3.sh index 2a95027..b87d28d 100755 --- a/ttcn3/ttcn3.sh +++ b/ttcn3/ttcn3.sh @@ -40,8 +40,9 @@ local hacks="${DIR_OSMODEV}/src/osmo-ttcn3-hacks" case "$PROJECT" in - bts-*) echo "$hacks/bts" ;; bsc-*) echo "$hacks/bsc" ;; + bts-*) echo "$hacks/bts" ;; + ggsn) echo "$hacks/ggsn_tests" ;; pcu-sns) echo "$hacks/pcu" ;; *) echo "$hacks/$PROJECT" ;; esac -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/33803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ibdf30a0f87a4cc19c37c6337edff42fd4e56342a Gerrit-Change-Number: 33803 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-dev[master]: ttcn3: build osmo-ggsn with --enable-gtp-linux
by osmith 21 Jul '23

21 Jul '23
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/33804 ) Change subject: ttcn3: build osmo-ggsn with --enable-gtp-linux ...................................................................... ttcn3: build osmo-ggsn with --enable-gtp-linux Order the opts files alphabetically while at it. Change-Id: I40c197fc0dc2199dd5a7b0d1d820dee1338c1703 --- A gtp_linux.opts M ttcn3/ttcn3.sh 2 files changed, 36 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved; Verified diff --git a/gtp_linux.opts b/gtp_linux.opts new file mode 100644 index 0000000..67f0840 --- /dev/null +++ b/gtp_linux.opts @@ -0,0 +1 @@ +osmo-ggsn --enable-gtp-linux diff --git a/ttcn3/ttcn3.sh b/ttcn3/ttcn3.sh index b87d28d..99500cf 100755 --- a/ttcn3/ttcn3.sh +++ b/ttcn3/ttcn3.sh @@ -81,6 +81,13 @@ esac } +# Dependencies not mentioned in all.deps +get_extra_libraries() { + case "$PROJECT" in + ggsn) echo "libgtpnl" ;; # needed for --enable-gtp-linux + esac +} + # Programs that need to be built get_programs() { case "$PROJECT" in @@ -123,11 +130,12 @@ ./gen_makefile.py \ default.opts \ + gtp_linux.opts \ iu.opts \ - no_systemd.opts \ - no_doxygen.opts \ no_dahdi.opts \ + no_doxygen.opts \ no_optimization.opts \ + no_systemd.opts \ ttcn3/ttcn3.opts \ werror.opts \ --docker-cmd "$docker_cmd" \ @@ -223,6 +231,19 @@ make -C "$testsuite_dir" } +# Use osmo-dev to build libraries not mentioned in all.deps, for example the +# libgtpnl dependency of osmo-ggsn that is only needed with --enable-gtp-linux. +build_extra_libraries() { + local library + local libraries="$(get_extra_libraries)" + + for library in $libraries; do + set -x + make -C "$DIR_MAKE" "$library" + set +x + done +} + # Use osmo-dev to build one Osmocom program and its dependencies build_osmo_programs() { local program @@ -346,6 +367,7 @@ check_dir_testsuite prepare_local_bin prepare_docker_build_container +build_extra_libraries build_osmo_programs prepare_docker_testsuite_container build_testsuite -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/33804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I40c197fc0dc2199dd5a7b0d1d820dee1338c1703 Gerrit-Change-Number: 33804 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-dev[master]: ttcn3: build osmo-ggsn with --enable-gtp-linux
by osmith 21 Jul '23

21 Jul '23
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/33804 ) Change subject: ttcn3: build osmo-ggsn with --enable-gtp-linux ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/33804 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I40c197fc0dc2199dd5a7b0d1d820dee1338c1703 Gerrit-Change-Number: 33804 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 21 Jul 2023 08:09:30 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • ...
  • 306
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.