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

March 2023

  • 1 participants
  • 3642 discussions
[XL] Change in osmo-pcu[master]: support for Ericsson RBS E1 CCU
by fixeria 07 Mar '23

07 Mar '23
Attention is currently required from: neels, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31176 ) Change subject: support for Ericsson RBS E1 CCU ...................................................................... Patch Set 24: (7 comments) File configure.ac: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/4a9491fb_432ad9df PS24, Line 90: PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.4.0) So the E1 CCU feature is configurable via `--enable-er-e1-ccu` and is disabled by default, but you're requiring `libosmo{abis,trau}` unconditionally. Maybe depend on these libraries only if the feature is enabled? File contrib/jenkins.sh: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/9ef8c98e_73a7cf6b PS24, Line 59: PCU_CONFIG="$PCU_CONFIG --enable-werror --enable-sanitize" You should add `--enable-er-e1-ccu` here, so that the conditional code is also built by Jenkins. File contrib/osmo-pcu.spec.in: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/e5acb7d9_eea5f3d8 PS24, Line 36: 1.3.0 You require 1.4.0 in `configure.ac`, but 1.3.0 here? https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/2e962ef1_e28a0ec4 PS24, Line 49: configure Do we want to build RPM and DEB packages with `--enable-er-e1-ccu`? File src/Makefile.am: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/c418f2b4_faf756d3 PS24, Line 218: EXTRA_DIST Why do you put `.[ch]` files to `EXTRA_DIST`? This is unusual. File src/ericsson-rbs/er_ccu_descr.h: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/e449870c_37b3ceaa PS24, Line 3: #include <stdint.h> missing `<stdbool.h>` File src/ericsson-rbs/er_ccu_if.c: https://gerrit.osmocom.org/c/osmo-pcu/+/31176/comment/f54e5d0d_af70b8b2 PS24, Line 412: tall_ccu_ctx = ctx; Either obtain a child ctx here, or simply use `extern void *tall_pcu_ctx;`. -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/31176 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I5c0a76667339ca984a12cbd2052f5d9e5b0f9c4d Gerrit-Change-Number: 31176 Gerrit-PatchSet: 24 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 07 Mar 2023 12:55:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bsc[master]: pcu_sock: activate/deactivate PDCH on pcu reconnect
by laforge 07 Mar '23

07 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31497 ) Change subject: pcu_sock: activate/deactivate PDCH on pcu reconnect ...................................................................... pcu_sock: activate/deactivate PDCH on pcu reconnect When the PCU is disconnected while the BSC keeps running the PDCH should be closed. Also the PDCH should be reopened when the PCU is reconnected. Change-Id: I9ea0c53a5e68a51c781ef43bae71f947cdb95678 Related: OS#5198 --- M doc/timeslot.msc M include/osmocom/bsc/pcu_if.h M include/osmocom/bsc/timeslot_fsm.h M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/timeslot_fsm.c 5 files changed, 116 insertions(+), 13 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/timeslot.msc b/doc/timeslot.msc index 02e7bb3..0fd1458 100644 --- a/doc/timeslot.msc +++ b/doc/timeslot.msc @@ -1,5 +1,5 @@ msc { - bts [label="MS/BTS"], bsc[label="BSC"], bsc_ts[label="BSC timeslot FSM"], bsc_lchan[label="BSC lchan FSM"]; + bts [label="MS/BTS"], bsc[label="BSC"], bsc_ts[label="BSC timeslot FSM"], bsc_lchan[label="BSC lchan FSM"], pcu_sock[label="PCU socket"]; bsc_ts abox bsc_ts [label="NOT_INITIALIZED"]; @@ -88,6 +88,24 @@ bsc_ts rbox bsc_ts [label="Continue at 'IN_USE' above"]; ...; ...; + bts rbox bsc_lchan [label="on PCU disconnect (Ericsson RBS) + for all timeslots in state PDCH:" ]; + bsc_ts abox bsc_ts [label="PDCH"]; + bsc_ts <- pcu_sock [label="TS_EV_PDCH_DEACT"]; + bts note bsc_ts [label="PDCH release, see WAIT_PDCH_DEACT above"]; + ...; + bsc_ts abox bsc_ts [label="UNUSED"]; + ...; + ...; + bts rbox bsc_lchan [label="on PCU reconnect (Ericsson RBS) + for all timeslots in state UNUSED:" ]; + bsc_ts abox bsc_ts [label="UNUSED"]; + bsc_ts <- pcu_sock [label="TS_EV_PDCH_ACT"]; + bts note bsc_ts [label="PDCH activation, see WAIT_PDCH_ACT above"]; + ...; + bsc_ts abox bsc_ts [label="PDCH"]; + ...; + ...; bts rbox bsc_lchan [label="on erratic event"]; bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_ERROR"]; diff --git a/include/osmocom/bsc/pcu_if.h b/include/osmocom/bsc/pcu_if.h index 3c34cdf..2a2afa8 100644 --- a/include/osmocom/bsc/pcu_if.h +++ b/include/osmocom/bsc/pcu_if.h @@ -14,6 +14,9 @@ struct llist_head upqueue; /* queue for sending messages */ }; +/* Check if BTS has a PCU connection */ +bool pcu_connected(struct gsm_bts *bts); + /* PCU relevant information has changed; Inform PCU (if connected) */ void pcu_info_update(struct gsm_bts *bts); diff --git a/include/osmocom/bsc/timeslot_fsm.h b/include/osmocom/bsc/timeslot_fsm.h index cea1e4c..c1b61b8 100644 --- a/include/osmocom/bsc/timeslot_fsm.h +++ b/include/osmocom/bsc/timeslot_fsm.h @@ -36,10 +36,18 @@ TS_EV_RSL_DOWN, TS_EV_LCHAN_REQUESTED, TS_EV_LCHAN_UNUSED, + + /* RSL responses received from the BTS: */ TS_EV_PDCH_ACT_ACK, TS_EV_PDCH_ACT_NACK, TS_EV_PDCH_DEACT_ACK, TS_EV_PDCH_DEACT_NACK, + + /* BSC co-located PCU disconnects from PCU socket, deactivate PDCH */ + TS_EV_PDCH_DEACT, + + /* BSC co-located PCU (re)connects to PCU socket, activate PDCH */ + TS_EV_PDCH_ACT, }; void ts_fsm_alloc(struct gsm_bts_trx_ts *ts); @@ -52,3 +60,6 @@ bool ts_usable_as_pchan(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch); void ts_set_pchan_is(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config pchan_is); + +void ts_pdch_act(struct gsm_bts_trx_ts *ts); +void ts_pdch_deact(struct gsm_bts_trx_ts *ts); diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 1d5e56c..51b59c6 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -44,6 +44,7 @@ #include <osmocom/bsc/gsm_04_08_rr.h> #include <osmocom/bsc/bts.h> #include <osmocom/bsc/bts_sm.h> +#include <osmocom/bsc/timeslot_fsm.h> static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); @@ -58,11 +59,14 @@ [PCU_IF_SAPI_PCH_DT] = "PCH_DT", }; -/* Check if BTS has a PCU connection */ -static bool pcu_connected(struct gsm_bts *bts) +bool pcu_connected(struct gsm_bts *bts) { struct pcu_sock_state *state = bts->pcu_state; + /* BSC co-located PCU is only supported for Ericsson RBS */ + if (!is_ericsson_bts(bts)) + return false; + if (!state) return false; if (state->conn_bfd.fd <= 0) @@ -751,8 +755,7 @@ struct osmo_fd *bfd = &state->conn_bfd; struct gsm_bts *bts; struct gsm_bts_trx *trx; - struct gsm_bts_trx_ts *ts; - int i, j; + int j; /* FIXME: allow multiple BTS */ bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); @@ -773,15 +776,14 @@ #endif /* release PDCH */ - for (i = 0; i < 8; i++) { - trx = gsm_bts_trx_num(bts, i); - if (!trx) - break; - for (j = 0; j < 8; j++) { - ts = &trx->ts[j]; + llist_for_each_entry(trx, &bts->trx_list, list) { + for (j = 0; j < ARRAY_SIZE(trx->ts); j++) { + struct gsm_bts_trx_ts *ts = &trx->ts[j]; + /* BSC co-located PCU applies only to Ericsson RBS, which supports only GSM_PCHAN_OSMO_DYN. + * So we need to deact only on this pchan kind. */ if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED - && ts->pchan_is == GSM_PCHAN_PDCH) { - printf("l1sap_chan_rel(trx,gsm_lchan2chan_nr(ts->lchan));\n"); + && ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) { + ts_pdch_deact(ts); } } } @@ -908,9 +910,15 @@ struct pcu_sock_state *state = (struct pcu_sock_state *)bfd->data; struct osmo_fd *conn_bfd = &state->conn_bfd; struct sockaddr_un un_addr; + struct gsm_bts *bts; + struct gsm_bts_trx *trx; + int j; socklen_t len; int rc; + /* FIXME: allow multiple BTS */ + bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); + len = sizeof(un_addr); rc = accept(bfd->fd, (struct sockaddr *) &un_addr, &len); if (rc < 0) { @@ -939,6 +947,18 @@ LOGP(DPCU, LOGL_NOTICE, "PCU socket connected to external PCU\n"); + /* activate PDCH */ + llist_for_each_entry(trx, &bts->trx_list, list) { + for (j = 0; j < ARRAY_SIZE(trx->ts); j++) { + struct gsm_bts_trx_ts *ts = &trx->ts[j]; + /* (See comment in pcu_sock_close above) */ + if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED + && ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) { + ts_pdch_act(ts); + } + } + } + return 0; } diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 28e2aaa..16d7360 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -341,6 +341,11 @@ return; } + if (!pcu_connected(bts)) { + LOG_TS(ts, LOGL_DEBUG, "PCU not connected: not activating PDCH.\n"); + return; + } + osmo_fsm_inst_state_chg(fi, TS_ST_WAIT_PDCH_ACT, CHAN_ACT_DEACT_TIMEOUT, T_CHAN_ACT_DEACT); } @@ -408,6 +413,10 @@ /* ignored. */ return; + case TS_EV_PDCH_ACT: + ts_fsm_unused_pdch_act(fi); + return; + default: OSMO_ASSERT(false); } @@ -531,6 +540,10 @@ } } + case TS_EV_PDCH_DEACT: + ts_fsm_pdch_deact(fi); + return; + case TS_EV_LCHAN_UNUSED: /* ignored */ return; @@ -889,6 +902,7 @@ .in_event_mask = 0 | S(TS_EV_LCHAN_REQUESTED) | S(TS_EV_LCHAN_UNUSED) + | S(TS_EV_PDCH_ACT) , .out_state_mask = 0 | S(TS_ST_WAIT_PDCH_ACT) @@ -921,6 +935,7 @@ .in_event_mask = 0 | S(TS_EV_LCHAN_REQUESTED) | S(TS_EV_LCHAN_UNUSED) + | S(TS_EV_PDCH_DEACT) , .out_state_mask = 0 | S(TS_ST_WAIT_PDCH_DEACT) @@ -992,6 +1007,8 @@ OSMO_VALUE_STRING(TS_EV_PDCH_ACT_NACK), OSMO_VALUE_STRING(TS_EV_PDCH_DEACT_ACK), OSMO_VALUE_STRING(TS_EV_PDCH_DEACT_NACK), + OSMO_VALUE_STRING(TS_EV_PDCH_DEACT), + OSMO_VALUE_STRING(TS_EV_PDCH_ACT), {} }; @@ -1105,3 +1122,23 @@ return true; } + +void ts_pdch_act(struct gsm_bts_trx_ts *ts) +{ + /* We send the activation event only when the timeslot is UNUSED. In all other cases the timeslot FSM + * will automatically handle the activation at some later point. */ + if (ts->fi->state != TS_ST_UNUSED) + return; + + osmo_fsm_inst_dispatch(ts->fi, TS_EV_PDCH_ACT, NULL); +} + +void ts_pdch_deact(struct gsm_bts_trx_ts *ts) +{ + /* We send the deactivation event only when the timeslot is active as PDCH. The timeslot FSM will check + * if the PCU is available before activating the PDCH again. */ + if (ts->fi->state != TS_ST_PDCH) + return; + + osmo_fsm_inst_dispatch(ts->fi, TS_EV_PDCH_DEACT, NULL); +} -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31497 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I9ea0c53a5e68a51c781ef43bae71f947cdb95678 Gerrit-Change-Number: 31497 Gerrit-PatchSet: 13 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bsc[master]: pcu_sock: improve logging
by laforge 07 Mar '23

07 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31579 ) ( 9 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pcu_sock: improve logging ...................................................................... pcu_sock: improve logging In many places we have a pointer to the BTS object, so we can use LOG_BTS. Change-Id: I4a3ff23ffccf803b1a97e3f2604d3b422c6d6afd Related: OS#5198 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 49 insertions(+), 39 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 187da18..486f364 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -191,7 +191,7 @@ bts_sm = bts->site_mgr; - LOGP(DPCU, LOGL_INFO, "Sending info for BTS %d\n", bts->nr); + LOG_BTS(bts, DPCU, LOGL_INFO, "Sending info for BTS\n"); rlcc = &bts->gprs.cell.rlc_cfg; @@ -417,12 +417,11 @@ /* Bail if no PCU is connected */ if (!pcu_connected(bts)) { - LOGP(DRSL, LOGL_ERROR, "BTS %d CHAN RQD(GPRS) but PCU not " - "connected!\n", bts->nr); + LOG_BTS(bts, DRSL, LOGL_ERROR, "CHAN RQD(GPRS) but PCU not connected!\n"); return -ENODEV; } - LOGP(DPCU, LOGL_INFO, "Sending RACH indication: qta=%d, ra=%d, " + LOG_BTS(bts, DPCU, LOGL_INFO, "Sending RACH indication: qta=%d, ra=%d, " "fn=%d\n", qta, ra, fn); msg = pcu_msgb_alloc(PCU_IF_MSG_RACH_IND, bts->nr); @@ -448,7 +447,7 @@ struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_data_cnf_dt *data_cnf_dt; - LOGP(DPCU, LOGL_INFO, "Sending PCH confirm with direct TLLI\n"); + LOG_BTS(bts, DPCU, LOGL_INFO, "Sending PCH confirm with direct TLLI\n"); msg = pcu_msgb_alloc(PCU_IF_MSG_DATA_CNF_DT, bts->nr); if (!msg) @@ -478,14 +477,14 @@ chan_needed = (p1->cneed2 << 2) | p1->cneed1; rc = osmo_mobile_identity_decode(&mi, p1->data+1, p1->data[0], false); if (rc) { - LOGP(DPCU, LOGL_ERROR, "PCU Sends paging " - "request type %02x (chan_needed=%02x): Unable to decode Mobile Identity\n", + LOG_BTS(bts, DPCU, LOGL_ERROR, "PCU Sends paging " + "request type %02x (chan_needed=%02x): Unable to decode Mobile Identity\n", p1->msg_type, chan_needed); rc = -EINVAL; break; } - LOGP(DPCU, LOGL_ERROR, "PCU Sends paging " - "request type %02x (chan_needed=%02x, mi=%s)\n", + LOG_BTS(bts, DPCU, LOGL_ERROR, "PCU Sends paging " + "request type %02x (chan_needed=%02x, mi=%s)\n", p1->msg_type, chan_needed, osmo_mobile_identity_to_str_c(OTC_SELECT, &mi)); /* NOTE: We will have to add 2 to mi_len and subtract 2 from * the mi pointer because rsl_paging_cmd() will perform the @@ -497,12 +496,12 @@ break; case GSM48_MT_RR_PAG_REQ_2: case GSM48_MT_RR_PAG_REQ_3: - LOGP(DPCU, LOGL_ERROR, "PCU Sends unsupported paging " + LOG_BTS(bts, DPCU, LOGL_ERROR, "PCU Sends unsupported paging " "request type %02x\n", p1->msg_type); rc = -EINVAL; break; default: - LOGP(DPCU, LOGL_ERROR, "PCU Sends unknown paging " + LOG_BTS(bts, DPCU, LOGL_ERROR, "PCU Sends unknown paging " "request type %02x\n", p1->msg_type); rc = -EINVAL; break; @@ -526,8 +525,8 @@ pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(imsi_digit_buf)); - LOGP(DPCU, LOGL_DEBUG, "Calculating paging group: imsi_digit_buf=%s ==> pag_grp=0x%02x\n", - imsi_digit_buf, pag_grp); + LOG_BTS(bts, DPCU, LOGL_DEBUG, "Calculating paging group: imsi_digit_buf=%s ==> pag_grp=0x%02x\n", + imsi_digit_buf, pag_grp); return pag_grp; } @@ -539,7 +538,7 @@ int rc = 0; struct gsm_pcu_if_pch_dt *pch_dt; - LOGP(DPCU, LOGL_DEBUG, "Data request received: sapi=%s arfcn=%d " + LOG_BTS(bts, DPCU, LOGL_DEBUG, "Data request received: sapi=%s arfcn=%d " "block=%d data=%s\n", sapi_string[data_req->sapi], data_req->arfcn, data_req->block_nr, osmo_hexdump(data_req->data, data_req->len)); @@ -559,16 +558,16 @@ * IMMEDIATE ASSIGNMENT towards the PCU using this TLLI as a reference. */ if (data_req->len < sizeof(struct gsm_pcu_if_pch_dt)) { - LOGP(DPCU, LOGL_ERROR, "Received PCU data request with invalid/small length %d\n", - data_req->len); + LOG_BTS(bts, DPCU, LOGL_ERROR, "Received PCU data request with invalid/small length %d\n", + data_req->len); break; } pch_dt = (struct gsm_pcu_if_pch_dt *)data_req->data; pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(pch_dt->imsi)); - LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (TLLI=0x%08x, IMSI=%s, Paging group=0x%02x)\n", - pch_dt->tlli, pch_dt->imsi, pag_grp); + LOG_BTS(bts, DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (TLLI=0x%08x, IMSI=%s, Paging group=0x%02x)\n", + pch_dt->tlli, pch_dt->imsi, pag_grp); /* NOTE: Sending an IMMEDIATE ASSIGNMENT via PCH became necessary with GPRS in order to be able to * assign downlink TBFs directly through the paging channel. However, this method never became part @@ -578,7 +577,7 @@ rc = rsl_ericsson_imm_assign_cmd(bts, pch_dt->tlli, sizeof(pch_dt->data), pch_dt->data, pag_grp); } else { - LOGP(DPCU, LOGL_ERROR, "BTS model does not support sending immediate assignment via PCH!\n"); + LOG_BTS(bts, DPCU, LOGL_ERROR, "BTS model does not support sending immediate assignment via PCH!\n"); rc = -ENOTSUP; } @@ -586,7 +585,7 @@ rc = -EIO; break; default: - LOGP(DPCU, LOGL_ERROR, "Received PCU data request with " + LOG_BTS(bts, DPCU, LOGL_ERROR, "Received PCU data request with " "unsupported sapi %d\n", data_req->sapi); rc = -EINVAL; } @@ -606,7 +605,7 @@ if (enable) { memcpy(si_buf, GSM_BTS_SI(bts, si_type), GSM_MACBLOCK_LEN); len = GSM_MACBLOCK_LEN; - LOGP(DPCU, LOGL_DEBUG, "Updating SI%s to PCU: %s\n", + LOG_BTS(bts, DPCU, LOGL_DEBUG, "Updating SI%s to PCU: %s\n", get_value_string(osmo_sitype_strs, si_type), osmo_hexdump_nospc(si_buf, GSM_MACBLOCK_LEN)); } else { @@ -619,8 +618,8 @@ if (si_type != SYSINFO_TYPE_13) len = 0; - LOGP(DPCU, LOGL_DEBUG, "Revoking SI%s from PCU\n", - get_value_string(osmo_sitype_strs, si_buf[0])); + LOG_BTS(bts, DPCU, LOGL_DEBUG, "Revoking SI%s from PCU\n", + get_value_string(osmo_sitype_strs, si_buf[0])); } /* The low-level data like FN, ARFCN etc will be ignored but we have to @@ -628,8 +627,8 @@ rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, si_buf, len, 0, 0, 0, INT16_MAX); if (rc < 0) - LOGP(DPCU, LOGL_NOTICE, "Failed to send SI%s to PCU: rc=%d\n", - get_value_string(osmo_sitype_strs, si_type), rc); + LOG_BTS(bts, DPCU, LOGL_NOTICE, "Failed to send SI%s to PCU: rc=%d\n", + get_value_string(osmo_sitype_strs, si_type), rc); return rc; } @@ -646,9 +645,9 @@ if (rc < 0) return rc; } else { - LOGP(DPCU, LOGL_INFO, - "SI%s is not available on PCU connection\n", - get_value_string(osmo_sitype_strs, si_types[i])); + LOG_BTS(bts, DPCU, LOGL_INFO, + "SI%s is not available on PCU connection\n", + get_value_string(osmo_sitype_strs, si_types[i])); } } @@ -662,7 +661,7 @@ switch (txt->type) { case PCU_VERSION: - LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n", + LOG_BTS(bts, DPCU, LOGL_INFO, "OsmoPCU version %s connected\n", txt->text); rc = pcu_tx_si_all(bts); if (rc < 0) @@ -672,7 +671,7 @@ LOG_BTS(bts, DPCU, LOGL_ERROR, "PCU external alarm: %s\n", txt->text); break; default: - LOGP(DPCU, LOGL_ERROR, "Unknown TXT_IND type %u received\n", + LOG_BTS(bts, DPCU, LOGL_ERROR, "Unknown TXT_IND type %u received\n", txt->type); return -EINVAL; } @@ -920,13 +919,12 @@ len = sizeof(un_addr); rc = accept(bfd->fd, (struct sockaddr *) &un_addr, &len); if (rc < 0) { - LOGP(DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); + LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); return -1; } if (conn_bfd->fd >= 0) { - LOGP(DPCU, LOGL_NOTICE, "PCU connects but we already have " - "another active connection ?!?\n"); + LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU connects but we already have another active connection ?!?\n"); /* We already have one PCU connected, this is all we support */ osmo_fd_read_disable(&state->listen_bfd); close(rc); @@ -936,14 +934,13 @@ osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, pcu_sock_cb, state, 0); if (osmo_fd_register(conn_bfd) != 0) { - LOGP(DPCU, LOGL_ERROR, "Failed to register new connection " - "fd\n"); + LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); close(conn_bfd->fd); conn_bfd->fd = -1; return -1; } - LOGP(DPCU, LOGL_NOTICE, "PCU socket connected to external PCU\n"); + LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU socket connected to external PCU\n"); /* activate PDCH */ llist_for_each_entry(trx, &bts->trx_list, list) { @@ -979,7 +976,7 @@ rc = osmo_sock_unix_init(SOCK_SEQPACKET, 0, path, OSMO_SOCK_F_BIND); if (rc < 0) { - LOGP(DPCU, LOGL_ERROR, "Could not create unix socket: %s\n", + LOG_BTS(bts, DPCU, LOGL_ERROR, "Could not create unix socket: %s\n", strerror(errno)); talloc_free(state); return -1; @@ -989,14 +986,14 @@ rc = osmo_fd_register(bfd); if (rc < 0) { - LOGP(DPCU, LOGL_ERROR, "Could not register listen fd: %d\n", + LOG_BTS(bts, DPCU, LOGL_ERROR, "Could not register listen fd: %d\n", rc); close(bfd->fd); talloc_free(state); return rc; } - LOGP(DPCU, LOGL_INFO, "Started listening on PCU socket: %s\n", path); + LOG_BTS(bts, DPCU, LOGL_INFO, "Started listening on PCU socket: %s\n", path); bts->pcu_state = state; return 0; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31579 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I4a3ff23ffccf803b1a97e3f2604d3b422c6d6afd Gerrit-Change-Number: 31579 Gerrit-PatchSet: 11 Gerrit-Owner: dexter <pmaier(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-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: pcu_sock: rename rc to fd
by laforge 07 Mar '23

07 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31684 ) Change subject: pcu_sock: rename rc to fd ...................................................................... pcu_sock: rename rc to fd The variable rc holds the return code of accept(), which returns a file descriptor on success. So lets call the variable "fd" to make this clear. Change-Id: Ic8d22c2af18477f110a3a9115434314ebca95b25 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 18 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 486f364..1d7b061 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -911,14 +911,14 @@ struct gsm_bts_trx *trx; int j; socklen_t len; - int rc; + int fd; /* FIXME: allow multiple BTS */ bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); len = sizeof(un_addr); - rc = accept(bfd->fd, (struct sockaddr *) &un_addr, &len); - if (rc < 0) { + fd = accept(bfd->fd, (struct sockaddr *) &un_addr, &len); + if (fd < 0) { LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); return -1; } @@ -927,11 +927,11 @@ LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU connects but we already have another active connection ?!?\n"); /* We already have one PCU connected, this is all we support */ osmo_fd_read_disable(&state->listen_bfd); - close(rc); + close(fd); return 0; } - osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, pcu_sock_cb, state, 0); + osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, pcu_sock_cb, state, 0); if (osmo_fd_register(conn_bfd) != 0) { LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31684 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ic8d22c2af18477f110a3a9115434314ebca95b25 Gerrit-Change-Number: 31684 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> 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
[S] Change in osmo-bsc[master]: pcu_sock: use struct to transfer IMMEDIATE ASSIGNMENT for PCH
by laforge 07 Mar '23

07 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31578 ) Change subject: pcu_sock: use struct to transfer IMMEDIATE ASSIGNMENT for PCH ...................................................................... pcu_sock: use struct to transfer IMMEDIATE ASSIGNMENT for PCH When the IMMEDIATE ASSIGNMENT is sent from the PCU to the BSC using the "direct TLLI" method, the TLLI (and the last three digits of the IMSI) is prepended to the MAC block. Currently we are taking the fields apart manually using offsets. The code for this is difficult to read and the method is error prone. Let's define a struct that we can just overlay to access the fields directly. Let's also transfer the full IMSI. Change-Id: Id6acbd243adf26169e5e8319dd66bb68dd6a3c22 Related: OS#5198 --- M include/osmocom/bsc/pcuif_proto.h M src/osmo-bsc/pcu_sock.c 2 files changed, 38 insertions(+), 10 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/bsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h index 7e13b5c..ef7fe39 100644 --- a/include/osmocom/bsc/pcuif_proto.h +++ b/include/osmocom/bsc/pcuif_proto.h @@ -3,6 +3,8 @@ #include <osmocom/gsm/l1sap.h> #include <arpa/inet.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gsm/protocol/gsm_23_003.h> #define PCU_SOCK_DEFAULT "/tmp/pcu_bts" @@ -270,6 +272,17 @@ } cgi_ps; } __attribute__ ((packed)); +/* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via PCH. The struct is sent as a data request + * (data_req) under SAPI PCU_IF_SAPI_PCH_DT. */ +struct gsm_pcu_if_pch_dt { + /* TLLI as reference for confirmation */ + uint32_t tlli; + /* IMSI (to derive paging group) */ + char imsi[OSMO_IMSI_BUF_SIZE]; + /* GSM mac-block (with immediate assignment message) */ + uint8_t data[GSM_MACBLOCK_LEN]; +} __attribute__((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 51b59c6..187da18 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -535,9 +535,9 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type, struct gsm_pcu_if_data *data_req) { - uint32_t tlli = -1; uint8_t pag_grp; int rc = 0; + struct gsm_pcu_if_pch_dt *pch_dt; LOGP(DPCU, LOGL_DEBUG, "Data request received: sapi=%s arfcn=%d " "block=%d data=%s\n", sapi_string[data_req->sapi], @@ -558,27 +558,25 @@ /* DT = direct TLLI. A tlli is prefixed so that the BSC/BTS can confirm the sending of the downlink * IMMEDIATE ASSIGNMENT towards the PCU using this TLLI as a reference. */ - if (data_req->len < 8) { + if (data_req->len < sizeof(struct gsm_pcu_if_pch_dt)) { LOGP(DPCU, LOGL_ERROR, "Received PCU data request with invalid/small length %d\n", data_req->len); break; } - /* Extract 4 byte TLLI */ - memcpy(&tlli, data_req->data, 4); + pch_dt = (struct gsm_pcu_if_pch_dt *)data_req->data; + pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(pch_dt->imsi)); - /* Extract 3 byte paging group */ - pag_grp = extract_paging_group(bts, data_req->data + 4); - - LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (tlli=0x%08x, pag_grp=0x%02x)\n", - tlli, pag_grp); + LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (TLLI=0x%08x, IMSI=%s, Paging group=0x%02x)\n", + pch_dt->tlli, pch_dt->imsi, pag_grp); /* NOTE: Sending an IMMEDIATE ASSIGNMENT via PCH became necessary with GPRS in order to be able to * assign downlink TBFs directly through the paging channel. However, this method never became part * of the RSL specs. This means that each BTS vendor has to come up with a proprietary method. At * the moment we only support Ericsson RBS here. */ if (bts->type == GSM_BTS_TYPE_RBS2000) { - rc = rsl_ericsson_imm_assign_cmd(bts, tlli, data_req->len - 7, data_req->data + 7, pag_grp); + rc = rsl_ericsson_imm_assign_cmd(bts, pch_dt->tlli, sizeof(pch_dt->data), + pch_dt->data, pag_grp); } else { LOGP(DPCU, LOGL_ERROR, "BTS model does not support sending immediate assignment via PCH!\n"); rc = -ENOTSUP; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31578 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Id6acbd243adf26169e5e8319dd66bb68dd6a3c22 Gerrit-Change-Number: 31578 Gerrit-PatchSet: 12 Gerrit-Owner: dexter <pmaier(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-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: pcu_sock: cosmetic: remove whitespace after type cast
by laforge 07 Mar '23

07 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31685 ) Change subject: pcu_sock: cosmetic: remove whitespace after type cast ...................................................................... pcu_sock: cosmetic: remove whitespace after type cast Change-Id: Iddc1bd703b4a200202ffa87d24a167e3fe39da18 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 1d7b061..7160210 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -917,7 +917,7 @@ bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); len = sizeof(un_addr); - fd = accept(bfd->fd, (struct sockaddr *) &un_addr, &len); + fd = accept(bfd->fd, (struct sockaddr *)&un_addr, &len); if (fd < 0) { LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); return -1; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iddc1bd703b4a200202ffa87d24a167e3fe39da18 Gerrit-Change-Number: 31685 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> 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-pcu[master]: pcu_l1_if: get rid of strange paging group calculation
by fixeria 07 Mar '23

07 Mar '23
Attention is currently required from: pespin, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31650 ) Change subject: pcu_l1_if: get rid of strange paging group calculation ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/31650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I40d7fc14c9591b3de091e425faaf325421c70a0e Gerrit-Change-Number: 31650 Gerrit-PatchSet: 7 Gerrit-Owner: dexter <pmaier(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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 07 Mar 2023 12:30:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: pcu_sock: only allow Ericsson RBS to connect to external PCU
by fixeria 07 Mar '23

07 Mar '23
Attention is currently required from: laforge, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31687 ) Change subject: pcu_sock: only allow Ericsson RBS to connect to external PCU ...................................................................... Patch Set 2: Code-Review-1 (1 comment) File src/osmo-bsc/pcu_sock.c: https://gerrit.osmocom.org/c/osmo-bsc/+/31687/comment/6dc41cd7_c6193fdd PS2, Line 964: return -EINVAL; So when this condition is true, osmo-bsc would fail to start printing: %% Error creating PCU socket `%s' for BTS %u But nothing specific *why* it failed. Please print something here. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I18d190d661b06015419078382915c4606be01b04 Gerrit-Change-Number: 31687 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 07 Mar 2023 12:23:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bsc[master]: pcu_sock: activate/deactivate PDCH on pcu reconnect
by fixeria 07 Mar '23

07 Mar '23
Attention is currently required from: neels, dexter. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31497 ) Change subject: pcu_sock: activate/deactivate PDCH on pcu reconnect ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31497 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I9ea0c53a5e68a51c781ef43bae71f947cdb95678 Gerrit-Change-Number: 31497 Gerrit-PatchSet: 12 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 07 Mar 2023 12:18:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-pcu[master]: pcu_l1_if: get rid of strange paging group calculation
by laforge 07 Mar '23

07 Mar '23
Attention is currently required from: dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/31650 ) Change subject: pcu_l1_if: get rid of strange paging group calculation ...................................................................... Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/31650 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: I40d7fc14c9591b3de091e425faaf325421c70a0e Gerrit-Change-Number: 31650 Gerrit-PatchSet: 7 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 07 Mar 2023 12:11:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • ...
  • 365
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.