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
[S] Change in osmo-hnbgw[master]: mgw_fsm: fix typp
by dexter 20 Mar '23

20 Mar '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31987 ) Change subject: mgw_fsm: fix typp ...................................................................... mgw_fsm: fix typp Change-Id: I16ee37bbfda01b541ad7a6f5269689c4b9e92c8c --- M src/osmo-hnbgw/mgw_fsm.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/87/31987/1 diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c index cddc64e..0b129b5 100644 --- a/src/osmo-hnbgw/mgw_fsm.c +++ b/src/osmo-hnbgw/mgw_fsm.c @@ -680,7 +680,7 @@ } /* The RTP stream negotiation usually begins with a RAB-AssignmentRequest and ends with an IU-Release, however - * it may also be thet the MSC decides to release the RAB with a dedicated RAB-AssignmentRequest that contains + * it may also be that the MSC decides to release the RAB with a dedicated RAB-AssignmentRequest that contains * a ReleaseList. In this case an FSM will already be present. */ if (map->mgw_fi) { /* A RAB Release might be in progress, handle it */ -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/31987 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I16ee37bbfda01b541ad7a6f5269689c4b9e92c8c Gerrit-Change-Number: 31987 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-hnbgw[master]: mgw_fsm: fix log line
by dexter 20 Mar '23

20 Mar '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31988 ) Change subject: mgw_fsm: fix log line ...................................................................... mgw_fsm: fix log line The function name mentioned in the log line does not match the actual function name. Change-Id: Iefc005f10e3c8f165c5686781747460a10ada1e0 --- M src/osmo-hnbgw/mgw_fsm.c 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/88/31988/1 diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c index 0b129b5..2ba3af4 100644 --- a/src/osmo-hnbgw/mgw_fsm.c +++ b/src/osmo-hnbgw/mgw_fsm.c @@ -699,7 +699,7 @@ * will block all incoming RAB assignments that try to assign more (or less) than one RAB. */ if (ranap_rab_ass_req_ies_get_count(&message->msg.raB_AssignmentRequestIEs) != 1) { LOGP(DMGW, LOGL_ERROR, - "mgw_fsm_alloc_and_handle_rab_ass_req() rua_ctx_id=%d, RAB-AssignmentRequest with more than one RAB assignment -- abort!\n", + "handle_rab_ass_req() rua_ctx_id=%d, RAB-AssignmentRequest with more than one RAB assignment -- abort!\n", map->rua_ctx_id); tx_release_req(map); return -1; -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/31988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Iefc005f10e3c8f165c5686781747460a10ada1e0 Gerrit-Change-Number: 31988 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-hnbgw[master]: mgw_fsm: refactor helper function handle_rab_release()
by dexter 20 Mar '23

20 Mar '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/31989 ) Change subject: mgw_fsm: refactor helper function handle_rab_release() ...................................................................... mgw_fsm: refactor helper function handle_rab_release() the function handle_rab_release() is difficult to read and it is not immediately clear what happens and why. Lets split this up and add some comments to improve this. Related: OS#5916 Change-Id: I3595502b98ea5febbde7f2fab3999e2533766b48 --- M src/osmo-hnbgw/mgw_fsm.c 1 file changed, 47 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/89/31989/1 diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c index 2ba3af4..252188f 100644 --- a/src/osmo-hnbgw/mgw_fsm.c +++ b/src/osmo-hnbgw/mgw_fsm.c @@ -633,30 +633,42 @@ }; /* The MSC may ask to release a specific RAB within a RAB-AssignmentRequest */ -static int handle_rab_release(struct hnbgw_context_map *map, struct msgb *ranap_msg, ranap_message *message) +static int release_mgw_fsm(struct hnbgw_context_map *map, struct msgb *ranap_msg) { - bool rab_release_req; struct osmo_fsm_inst *fi = map->mgw_fi; - struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; int rc; - /* Check if the RAB that is handled by this FSM is addressed by the release request */ - rab_release_req = ranap_rab_ass_req_ies_check_release(&message->msg.raB_AssignmentRequestIEs, - mgw_fsm_priv->rab_id); - if (!rab_release_req) - return -EINVAL; - - LOGPFSML(map->mgw_fi, LOGL_NOTICE, "MSC asked to release RAB-ID %u\n", mgw_fsm_priv->rab_id); - /* Forward the unmodifed RAB-AssignmentRequest to HNB, so that the HNB is informed about the RAB release as * well */ LOGPFSML(fi, LOGL_DEBUG, "forwarding unmodified RAB-AssignmentRequest to HNB\n"); rc = map_rua_dispatch(map, MAP_RUA_EV_TX_DIRECT_TRANSFER, ranap_msg); + if (rc < 0) { + LOGPFSML(fi, LOGL_DEBUG, "cannot forward RAB-AssignmentRequest to HNB\n"); + return -EINVAL; + } /* Release the FSM normally */ osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0); + return 0; +} - return rc; +/* Check if the message contains a RAB-ReleaseItem that matches the RAB-ID that is managed by the given context map */ +static bool is_our_rab_release(struct hnbgw_context_map *map, ranap_message *message) { + + bool rab_release_req; + struct osmo_fsm_inst *fi = map->mgw_fi; + struct mgw_fsm_priv *mgw_fsm_priv = fi->priv; + + /* Check if the RAB that is handled by this FSM is addressed by the release request */ + rab_release_req = ranap_rab_ass_req_ies_check_release(&message->msg.raB_AssignmentRequestIEs, + mgw_fsm_priv->rab_id); + if (!rab_release_req) { + LOGPFSML(map->mgw_fi, LOGL_ERROR, "RAB-AssignmentRequest does not contain any RAB-RelaseItem with RAB-ID %u\n", mgw_fsm_priv->rab_id); + return false; + } + LOGPFSML(map->mgw_fi, LOGL_NOTICE, "MSC asked to release RAB-ID %u\n", mgw_fsm_priv->rab_id); + + return true; } /*! Allocate MGW FSM and handle RANAP RAB AssignmentRequest. @@ -671,7 +683,6 @@ static bool initialized = false; struct mgw_fsm_priv *mgw_fsm_priv; char fsm_name[255]; - int rc; /* Initialize FSM if not done yet */ if (!initialized) { @@ -683,13 +694,16 @@ * it may also be that the MSC decides to release the RAB with a dedicated RAB-AssignmentRequest that contains * a ReleaseList. In this case an FSM will already be present. */ if (map->mgw_fi) { - /* A RAB Release might be in progress, handle it */ - rc = handle_rab_release(map, ranap_msg, message); - if (rc >= 0) - return rc; + /* Check if the RAB-AssignmentRequest contains a RAB-ReleaseItem that matches the RAB-ID we are + * managing in this HNBGW context map. */ + if (is_our_rab_release(map, message)) + return release_mgw_fsm(map, ranap_msg); - LOGPFSML(map->mgw_fi, LOGL_ERROR, - "mgw_fsm_alloc_and_handle_rab_ass_req() unable to handle RAB-AssignmentRequest!\n"); + /* The RAB-ReleaseItem in the incoming message should match the RAB ID we are managing. A mismatch may + * mean that there is an inconsistency between the HNBGW and the MSC state and the MGW FSM on the HNBGW + * side may serve an abandonned connection, which we will now close. However we must also assume that + * the incoming message may still contain a RAB-Assignment for a new RTP stream, so we still must + * continue with the message evaluation. */ osmo_fsm_inst_state_chg(map->mgw_fi, MGW_ST_FAILURE, 0, 0); OSMO_ASSERT(map->mgw_fi == NULL); } -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/31989 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I3595502b98ea5febbde7f2fab3999e2533766b48 Gerrit-Change-Number: 31989 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-bts[master]: contrib: Add BER testing tool
by Jenkins Builder 20 Mar '23

20 Mar '23
Attention is currently required from: laforge. Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/31967 ) Change subject: contrib: Add BER testing tool ...................................................................... Patch Set 4: (27 comments) File contrib/ber/rtp_ber.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/c65649b2_3cf62e14 PS4, Line 97: static const char *amr_rate_by_ft[] = { static const char * array should probably be static const char * const Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/f8203e4d_340ae594 PS4, Line 237: for (i=0; i<8*payload_len; i++) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/0ad08d0e_cdead8bb PS4, Line 237: for (i=0; i<8*payload_len; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/0df2feb3_00d6c676 PS4, Line 237: for (i=0; i<8*payload_len; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/ebc642ba_6005cfb0 PS4, Line 246: if (ones < 32) // This frames is probably us underrunning Tx, don't use it that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/e43c322a_345511e9 PS4, Line 258: if (as->state == RUNNING) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/91c2a237_d9642ad9 PS4, Line 361: else else should follow close brace '}' Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/9e715f3e_5b669d63 PS4, Line 399: if (as->state == WAIT_CONN) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/fba959be_2962ac7f PS4, Line 420: if (rtp_seq_num_diff(seq_number, as->rx_last_seq) > 1) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/9bc89e79_287f3780 PS4, Line 431: if (d > 1) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/6c0c5344_76f0037b PS4, Line 485: while (1) { braces {} are not necessary for single statement blocks File contrib/ber/rtp_gen_map.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/aa989f59_b5dd0e13 PS4, Line 30: int i,j; space required after that ',' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/3ec680e4_037ff216 PS4, Line 34: for (i=0; i<260; i++) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/8129d2f7_e7897774 PS4, Line 34: for (i=0; i<260; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/399a9e8a_6bc5b281 PS4, Line 34: for (i=0; i<260; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/21c22134_73aab101 PS4, Line 55: for (i=0; i<260; i++) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/8564ed3b_14aac40f PS4, Line 55: for (i=0; i<260; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/277eecd6_8b2c265b PS4, Line 55: for (i=0; i<260; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/a61d4327_b7b571fe PS4, Line 96: for (i=0; i<16; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/cc738cd7_af9484b0 PS4, Line 96: for (i=0; i<16; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/bfcdfe03_8459908c PS4, Line 99: for (i=0; i<244; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/19c13e06_1905671d PS4, Line 99: for (i=0; i<244; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/6e0fd3bb_921dca10 PS4, Line 102: for (i=0; i<4; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/a942c3d3_a10f7a8f PS4, Line 102: for (i=0; i<4; i++) spaces required around that '<' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/f5f980fa_d8c16c11 PS4, Line 116: for (i=0; i<len; i++) that open brace { should be on the previous line Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/530f3e17_1bdc6a19 PS4, Line 116: for (i=0; i<len; i++) spaces required around that '=' (ctx:VxV) Robot Comment from checkpatch (run ID jenkins-gerrit-lint-5273): https://gerrit.osmocom.org/c/osmo-bts/+/31967/comment/2302c469_95b6b413 PS4, Line 116: for (i=0; i<len; i++) spaces required around that '<' (ctx:VxV) -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I1cffa0ae959e29ec61775b13185fd1057ed7485a Gerrit-Change-Number: 31967 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: tnt <tnt(a)246tNt.com> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Mon, 20 Mar 2023 13:15:50 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-bts[master]: contrib: Add BER testing tool
by laforge 20 Mar '23

20 Mar '23
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/31967 to look at the new patch set (#4). Change subject: contrib: Add BER testing tool ...................................................................... contrib: Add BER testing tool This implements RTP based GSM BER testing for osmo-bts, implementing ideas described in https://osmocom.org/projects/osmobts/wiki/BER_Testing In short: The command transmits a PRBS sequence encapsulated in RTP frames, which are sent to the BTS, which transmits that data in the (unimpaired) downlink. The mobile station receives the data and is instructed to loop it back in the (possibly impaired) uplink. The BTS receives that uplink, puts in in RTP frames which end up being received back by this very tool. By correlating the received RTP with the PRBS sequence, this tool can compute the BER (Bit Error Rate) of the (possibly impaired) uplink. Doing this with different RF channel model simulators in the uplink allows to establish BER at different levels and channel conditions. Original code by Sylvain Munaut extended with some comments and Automake integration by Harald Welte. Change-Id: I1cffa0ae959e29ec61775b13185fd1057ed7485a --- M .gitignore M configure.ac M contrib/Makefile.am A contrib/ber/Makefile.am A contrib/ber/README A contrib/ber/rtp_ber.c A contrib/ber/rtp_gen_map.c 7 files changed, 726 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/31967/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/31967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I1cffa0ae959e29ec61775b13185fd1057ed7485a Gerrit-Change-Number: 31967 Gerrit-PatchSet: 4 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: tnt <tnt(a)246tNt.com> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in osmo-bsc[master]: doc: add sample configuration for GPRS with ericsson RBS
by laforge 20 Mar '23

20 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31725 ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: doc: add sample configuration for GPRS with ericsson RBS ...................................................................... doc: add sample configuration for GPRS with ericsson RBS This patch contains a sample configuration for the 64K and the 16K CCU mode. Change-Id: I923608d4edc28b02e882c5f04851a29fc11bad4e Related: OS#5198 --- A doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg A doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg 2 files changed, 208 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg new file mode 100644 index 0000000..681bdf5 --- /dev/null +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-16kbps.cfg @@ -0,0 +1,103 @@ +! +! OpenBSC (0.9.11.308-62d46) configuration saved from vty +!! +! CAUTION: The 16kbps mode of the Ericcson RBS CCU only allows for a very +! minimal GPRS configuration (C1/C2 only). +! +password foo +! +line vty + no login +! +log stderr + logging level lmi info + logging level linp info + logging level nm debug + logging level rsl debug + logging level llapd notice +network + network country code 901 + mobile network code 70 + neci 0 + paging any use tch 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3105 40 + timer t3109 4 + timer t3113 60 + pcu-socket /tmp/pcu_bts + bts 0 + type rbs2000 + band GSM900 + om2000 version-limit oml gen 12 rev 10 + cell_identity 0 + location_area_code 0x0001 + training_sequence_code 7 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + channel allocator mode set-all descending + rach tx integer 9 + rach max transmission 7 + oml e1 line 0 timeslot 1 sub-slot full + oml e1 tei 62 + neighbor-list mode automatic + gprs mode gprs + is-connection-list add 4 512 4 + is-connection-list add 8 516 1 + is-connection-list add 12 517 1 + is-connection-list add 16 518 1 + is-connection-list add 20 519 1 + is-connection-list add 24 520 1 + is-connection-list add 28 521 1 + is-connection-list add 32 522 1 + is-connection-list add 36 523 1 + trx 0 + rf_locked 0 + arfcn 123 + nominal power 44 + max_power_red 0 + rsl e1 line 0 timeslot 1 sub-slot full + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + e1 line 0 timeslot 1 sub-slot full + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 4 sub-slot 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 5 sub-slot 0 + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + e1 line 0 timeslot 6 sub-slot 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 7 sub-slot 0 + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 8 sub-slot 0 + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 9 sub-slot 0 +e1_input + e1_line 0 driver dahdi + e1_line 0 port 2 diff --git a/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg new file mode 100644 index 0000000..30f1ef9 --- /dev/null +++ b/doc/examples/osmo-bsc/ericsson/osmo-bsc.dug20-rus02-1trx-1pdch-64kbps.cfg @@ -0,0 +1,92 @@ +! +! OpenBSC (0.9.11.308-62d46) configuration saved from vty +!! +password foo +! +line vty + no login +! +log stderr + logging level lmi info + logging level linp info + logging level nm debug + logging level rsl debug + logging level llapd notice +network + network country code 901 + mobile network code 70 + neci 0 + paging any use tch 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + timer t3101 10 + timer t3105 40 + timer t3109 4 + timer t3113 60 + pcu-socket /tmp/pcu_bts + bts 0 + type rbs2000 + band GSM900 + om2000 version-limit oml gen 12 rev 10 + cell_identity 0 + location_area_code 0x0001 + training_sequence_code 7 + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + channel allocator mode set-all descending + rach tx integer 9 + rach max transmission 7 + oml e1 line 0 timeslot 1 sub-slot full + oml e1 tei 62 + neighbor-list mode automatic + gprs mode egprs + is-connection-list add 4 712 36 + trx 0 + rf_locked 0 + arfcn 123 + nominal power 44 + max_power_red 0 + rsl e1 line 0 timeslot 1 sub-slot full + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + e1 line 0 timeslot 1 sub-slot full + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 3 sub-slot full + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 4 sub-slot full + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 5 sub-slot full + timeslot 4 + phys_chan_config TCH/F_TCH/H_SDCCH8_PDCH + hopping enabled 0 + e1 line 0 timeslot 6 sub-slot full + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 7 sub-slot full + timeslot 6 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 8 sub-slot full + timeslot 7 + phys_chan_config TCH/F + hopping enabled 0 + e1 line 0 timeslot 9 sub-slot full +e1_input + e1_line 0 driver dahdi + e1_line 0 port 2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31725 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I923608d4edc28b02e882c5f04851a29fc11bad4e Gerrit-Change-Number: 31725 Gerrit-PatchSet: 6 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.c: Call osmo_fd_unregister() before closing and changing lis...
by laforge 20 Mar '23

20 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31982 ) Change subject: pcu_sock.c: Call osmo_fd_unregister() before closing and changing listen_bfd->fd ...................................................................... pcu_sock.c: Call osmo_fd_unregister() before closing and changing listen_bfd->fd Change-Id: I48e0411c4cba9897bc04865d22d8f68ed4fe87a2 --- M src/osmo-bsc/pcu_sock.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 5f61356..165fca4 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -1011,8 +1011,8 @@ if (conn_bfd->fd > 0) pcu_sock_close(state); bfd = &state->listen_bfd; - close(bfd->fd); osmo_fd_unregister(bfd); + close(bfd->fd); talloc_free(state); bts->pcu_state = NULL; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I48e0411c4cba9897bc04865d22d8f68ed4fe87a2 Gerrit-Change-Number: 31982 Gerrit-PatchSet: 1 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-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: pcuif_proto: increment version number
by laforge 20 Mar '23

20 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31597 ) ( 9 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pcuif_proto: increment version number ...................................................................... pcuif_proto: increment version number The co-located PCU support for Ericsson RBS E1 CCU made it necessary to add new features to the PCU socket interface, so let's increase the version number. Change-Id: I8315bd67c7f3eb0d7ee71b64cd4dff889a84fcf1 Depends: osmo-pcu.git I2a78651593323e8b9627c39918d949a33497b70f Related: OS#5198 --- M include/osmocom/bsc/pcuif_proto.h 1 file changed, 16 insertions(+), 1 deletion(-) 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/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h index e92ed49..1dda160 100644 --- a/include/osmocom/bsc/pcuif_proto.h +++ b/include/osmocom/bsc/pcuif_proto.h @@ -8,7 +8,7 @@ #define PCU_SOCK_DEFAULT "/tmp/pcu_bts" -#define PCU_IF_VERSION 0x0a +#define PCU_IF_VERSION 0x0b #define TXT_MAX_LEN 128 /* msg_type */ -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I8315bd67c7f3eb0d7ee71b64cd4dff889a84fcf1 Gerrit-Change-Number: 31597 Gerrit-PatchSet: 14 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-bsc[master]: pcu_sock: handle multiple BTSs with one BSC co-located PCU (in theory)
by laforge 20 Mar '23

20 Mar '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31618 ) Change subject: pcu_sock: handle multiple BTSs with one BSC co-located PCU (in theory) ...................................................................... pcu_sock: handle multiple BTSs with one BSC co-located PCU (in theory) The current PCU implementation has never been tested with multiple BTS attached to it. This is due to the fact that it has been used exclusively in an BTS co-located setup where naturally only one BTS is present. The PCU sock protocol supports multiple BTSs in theory and we should handle this correctly. Related: OS#5198 Change-Id: I0b42c2c130106f6ffca2dd08d079e1a7bda41f0b --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/pcu_if.h M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/timeslot_fsm.c 7 files changed, 143 insertions(+), 98 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index ccca186..20ed089 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -600,10 +600,6 @@ /* osmux config: */ enum osmux_usage use_osmux; - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - struct rate_ctr_group *bts_ctrs; struct osmo_stat_item_group *bts_statg; diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 25e634a..7779449 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1003,6 +1003,10 @@ struct chan_counts chan_counts; struct all_allocated all_allocated; + + /* PCU socket state */ + char *pcu_sock_path; + struct pcu_sock_state *pcu_state; }; struct gsm_audio_support { diff --git a/include/osmocom/bsc/pcu_if.h b/include/osmocom/bsc/pcu_if.h index 2a2afa8..34349dc 100644 --- a/include/osmocom/bsc/pcu_if.h +++ b/include/osmocom/bsc/pcu_if.h @@ -8,14 +8,14 @@ #define PCUIF_HDR_SIZE (sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u)) struct pcu_sock_state { - struct gsm_network *net; + struct gsm_network *net; /* backpointer to GSM network */ struct osmo_fd listen_bfd; /* fd for listen socket */ struct osmo_fd conn_bfd; /* fd for connection to lcr */ struct llist_head upqueue; /* queue for sending messages */ }; /* Check if BTS has a PCU connection */ -bool pcu_connected(struct gsm_bts *bts); +bool pcu_connected(struct gsm_network *net); /* PCU relevant information has changed; Inform PCU (if connected) */ void pcu_info_update(struct gsm_bts *bts); @@ -32,9 +32,9 @@ int pcu_tx_imm_ass_sent(struct gsm_bts *bts, uint32_t tlli); /* Open connection to PCU */ -int pcu_sock_init(const char *path, struct gsm_bts *bts); +int pcu_sock_init(struct gsm_network *net); /* Close connection to PCU */ -void pcu_sock_exit(struct gsm_bts *bts); +void pcu_sock_exit(struct gsm_network *net); #endif /* _PCU_IF_H */ diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 467301b..f1bd7c4 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -67,6 +67,7 @@ #include <osmocom/bsc/bssmap_reset.h> #include <osmocom/bsc/bsc_msc_data.h> #include <osmocom/bsc/lchan.h> +#include <osmocom/bsc/pcu_if.h> #include <inttypes.h> @@ -218,6 +219,9 @@ vty_out(vty, " Last RF Lock Command: %s%s", net->rf_ctrl->last_rf_lock_ctrl_command, VTY_NEWLINE); + + if (net->pcu_sock_path) + vty_out(vty, " PCU Socket Path: %s%s", net->pcu_sock_path, VTY_NEWLINE); } DEFUN(bsc_show_net, bsc_show_net_cmd, "show network", @@ -406,6 +410,9 @@ vty_out(vty, "%s", VTY_NEWLINE); } + if (gsmnet->pcu_sock_path) + vty_out(vty, " pcu-socket %s%s", gsmnet->pcu_sock_path, VTY_NEWLINE); + neighbor_ident_vty_write_network(vty, " "); mgcp_client_pool_config_write(vty, " "); @@ -2460,6 +2467,42 @@ return CMD_SUCCESS; } +DEFUN_ATTR(cfg_net_pcu_sock, + cfg_net_pcu_sock_cmd, + "pcu-socket PATH", + "PCU Socket Path for using OsmoPCU co-located with BSC\n" + "Path in the file system for the unix-domain PCU socket\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + int rc; + + osmo_talloc_replace_string(net, &net->pcu_sock_path, argv[0]); + pcu_sock_exit(net); + rc = pcu_sock_init(net); + if (rc < 0) { + vty_out(vty, "%% Error creating PCU socket `%s'%s", + net->pcu_sock_path, VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_net_no_pcu_sock, + cfg_net_no_pcu_sock_cmd, + "no pcu-socket", + NO_STR "Disable BSC co-located PCU\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_network *net = gsmnet_from_vty(vty); + + pcu_sock_exit(net); + talloc_free(net->pcu_sock_path); + net->pcu_sock_path = NULL; + return CMD_SUCCESS; +} + static struct bsc_msc_data *bsc_msc_data(struct vty *vty) { return vty->index; @@ -3534,6 +3577,8 @@ install_element(GSMNET_NODE, &cfg_net_meas_feed_scenario_cmd); install_element(GSMNET_NODE, &cfg_net_timer_cmd); install_element(GSMNET_NODE, &cfg_net_allow_unusable_timeslots_cmd); + install_element(GSMNET_NODE, &cfg_net_pcu_sock_cmd); + install_element(GSMNET_NODE, &cfg_net_no_pcu_sock_cmd); /* Timer configuration commands (generic osmo_tdef API) */ osmo_tdef_vty_groups_init(GSMNET_NODE, bsc_tdef_group); diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 08166ca..e02c2d5 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -2191,28 +2191,6 @@ return CMD_SUCCESS; } -DEFUN_ATTR(cfg_bts_pcu_sock, - cfg_bts_pcu_sock_cmd, - "pcu-socket PATH", - "PCU Socket Path for using OsmoPCU co-located with BSC (legacy BTS)\n" - "Path in the file system for the unix-domain PCU socket\n", - CMD_ATTR_IMMEDIATE) -{ - struct gsm_bts *bts = vty->index; - int rc; - - osmo_talloc_replace_string(bts, &bts->pcu_sock_path, argv[0]); - pcu_sock_exit(bts); - rc = pcu_sock_init(bts->pcu_sock_path, bts); - if (rc < 0) { - vty_out(vty, "%% Error creating PCU socket `%s' for BTS %u%s", - bts->pcu_sock_path, bts->nr, VTY_NEWLINE); - return CMD_WARNING; - } - - return CMD_SUCCESS; -} - DEFUN_ATTR(cfg_bts_acc_rotate, cfg_bts_acc_rotate_cmd, "access-control-class-rotate <0-10>", @@ -3979,8 +3957,6 @@ bts->early_classmark_allowed_3g && !bts->early_classmark_allowed ? " (forbidden by 2G bit)" : "", VTY_NEWLINE); - if (bts->pcu_sock_path) - vty_out(vty, " PCU Socket Path: %s%s", bts->pcu_sock_path, VTY_NEWLINE); if (is_ipaccess_bts(bts)) vty_out(vty, " Unit ID: %u/%u/0, OML Stream ID 0x%02x%s", bts->ip_access.site_id, bts->ip_access.bts_id, @@ -4618,8 +4594,6 @@ vty_out(vty, " depends-on-bts %d%s", bts_nr, VTY_NEWLINE); } } - if (bts->pcu_sock_path) - vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); ho_vty_write_bts(vty, bts); @@ -4857,7 +4831,6 @@ install_element(BTS_NODE, &cfg_bts_osmux_cmd); install_element(BTS_NODE, &cfg_bts_mgw_pool_target_cmd); install_element(BTS_NODE, &cfg_bts_no_mgw_pool_target_cmd); - install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd); install_element(BTS_NODE, &cfg_bts_acc_rotate_cmd); install_element(BTS_NODE, &cfg_bts_acc_rotate_quantum_cmd); install_element(BTS_NODE, &cfg_bts_acc_ramping_cmd); diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 165fca4..dba502f 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -46,7 +46,7 @@ #include <osmocom/bsc/bts_sm.h> #include <osmocom/bsc/timeslot_fsm.h> -static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); +static int pcu_sock_send(struct gsm_network *net, struct msgb *msg); static const char *sapi_string[] = { [PCU_IF_SAPI_RACH] = "RACH", @@ -59,13 +59,9 @@ [PCU_IF_SAPI_PCH_DT] = "PCH_DT", }; -bool pcu_connected(struct gsm_bts *bts) +bool pcu_connected(struct gsm_network *net) { - 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; + struct pcu_sock_state *state = net->pcu_state; if (!state) return false; @@ -305,7 +301,7 @@ info_ind_fill_trx(&info_ind->trx[trx->nr], trx); } - return pcu_sock_send(bts, msg); + return pcu_sock_send(bts->network, msg); } static int pcu_tx_e1_ccu_ind(struct gsm_bts *bts) @@ -348,7 +344,7 @@ e1_ccu_ind->e1_ts_ss = ts->e1_link.e1_ts_ss; LOG_TRX(trx, DPCU, LOGL_INFO, "Sending E1 CCU info for TS %d\n", e1_ccu_ind->ts_nr); - rc = pcu_sock_send(bts, msg); + rc = pcu_sock_send(bts->network, msg); if (rc < 0) return -EINVAL; } @@ -360,7 +356,7 @@ /* Allow test to overwrite it */ __attribute__((weak)) void pcu_info_update(struct gsm_bts *bts) { - if (pcu_connected(bts)) { + if (pcu_connected(bts->network)) { if (bsc_co_located_pcu(bts)) { /* In cases where the CCU is connected via an E1 line, we transmit the connection parameters for the * PDCH before we announce the other BTS related parameters. */ @@ -403,7 +399,7 @@ memcpy(data_ind->data, data, len); data_ind->len = len; - return pcu_sock_send(bts, msg); + return pcu_sock_send(bts->network, msg); } /* Forward rach indication to PCU */ @@ -415,7 +411,7 @@ struct gsm_pcu_if_rach_ind *rach_ind; /* Bail if no PCU is connected */ - if (!pcu_connected(bts)) { + if (!pcu_connected(bts->network)) { LOG_BTS(bts, DRSL, LOGL_ERROR, "CHAN RQD(GPRS) but PCU not connected!\n"); return -ENODEV; } @@ -436,7 +432,7 @@ rach_ind->is_11bit = is_11bit; rach_ind->burst_type = burst_type; - return pcu_sock_send(bts, msg); + return pcu_sock_send(bts->network, msg); } /* Confirm the sending of an immediate assignment to the pcu */ @@ -457,7 +453,7 @@ data_cnf_dt->sapi = PCU_IF_SAPI_PCH; data_cnf_dt->tlli = tlli; - return pcu_sock_send(bts, msg); + return pcu_sock_send(bts->network, msg); } /* we need to decode the raw RR paging message (see PCU code @@ -693,8 +689,9 @@ int rc = 0; struct gsm_bts *bts; - /* FIXME: allow multiple BTS */ - bts = llist_entry(net->bts_list.next, struct gsm_bts, list); + bts = gsm_bts_num(net, pcu_prim->bts_nr); + if (!bts) + return -EINVAL; switch (msg_type) { case PCU_IF_MSG_DATA_REQ: @@ -719,9 +716,9 @@ * PCU socket interface */ -static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg) +static int pcu_sock_send(struct gsm_network *net, struct msgb *msg) { - struct pcu_sock_state *state = bts->pcu_state; + struct pcu_sock_state *state = net->pcu_state; struct osmo_fd *conn_bfd; struct gsm_pcu_if *pcu_prim = (struct gsm_pcu_if *) msg->data; @@ -746,25 +743,11 @@ return 0; } -static void pcu_sock_close(struct pcu_sock_state *state) +static void pdch_deact_bts(struct gsm_bts *bts) { - struct osmo_fd *bfd = &state->conn_bfd; - struct gsm_bts *bts; struct gsm_bts_trx *trx; int j; - /* FIXME: allow multiple BTS */ - bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); - - LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n"); - - osmo_fd_unregister(bfd); - close(bfd->fd); - bfd->fd = -1; - - /* re-enable the generation of ACCEPT for new connections */ - osmo_fd_read_enable(&state->listen_bfd); - #if 0 /* remove si13, ... */ bts->si_valid &= ~(1 << SYSINFO_TYPE_13); @@ -783,6 +766,27 @@ } } } +} + +static void pcu_sock_close(struct pcu_sock_state *state) +{ + struct osmo_fd *bfd = &state->conn_bfd; + struct gsm_bts *bts; + + LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n"); + + osmo_fd_unregister(bfd); + close(bfd->fd); + bfd->fd = -1; + + /* re-enable the generation of ACCEPT for new connections */ + osmo_fd_read_enable(&state->listen_bfd); + + /* Disable all PDCHs on all BTSs that are served by the PCU */ + llist_for_each_entry(bts, &state->net->bts_list, list) { + if (bsc_co_located_pcu(bts)) + pdch_deact_bts(bts); + } /* flush the queue */ while (!llist_empty(&state->upqueue)) { @@ -900,6 +904,24 @@ return rc; } +static void pdch_act_bts(struct gsm_bts *bts) +{ + struct gsm_bts_trx *trx; + int j; + + /* 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 pdch_deact_bts above) */ + if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED + && ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) { + ts_pdch_act(ts); + } + } + } +} + /* accept connection coming from PCU */ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags) { @@ -907,23 +929,18 @@ 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 fd; - /* FIXME: allow multiple BTS */ - 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); if (fd < 0) { - LOG_BTS(bts, DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); + LOGP(DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); return -1; } if (conn_bfd->fd >= 0) { - LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU connects but we already have another active connection ?!?\n"); + LOGP(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(fd); @@ -933,31 +950,25 @@ 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"); + LOGP(DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); close(conn_bfd->fd); conn_bfd->fd = -1; return -1; } - LOG_BTS(bts, DPCU, LOGL_NOTICE, "PCU socket connected to external PCU\n"); + 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); - } - } + /* Activate all PDCHs on all BTSs that are served by the PCU */ + llist_for_each_entry(bts, &state->net->bts_list, list) { + if (bsc_co_located_pcu(bts)) + pdch_act_bts(bts); } return 0; } /* Open connection to PCU */ -int pcu_sock_init(const char *path, struct gsm_bts *bts) +int pcu_sock_init(struct gsm_network *net) { struct pcu_sock_state *state; struct osmo_fd *bfd; @@ -968,14 +979,14 @@ return -ENOMEM; INIT_LLIST_HEAD(&state->upqueue); - state->net = bts->network; + state->net = net; state->conn_bfd.fd = -1; bfd = &state->listen_bfd; - rc = osmo_sock_unix_init(SOCK_SEQPACKET, 0, path, OSMO_SOCK_F_BIND); + rc = osmo_sock_unix_init(SOCK_SEQPACKET, 0, net->pcu_sock_path, OSMO_SOCK_F_BIND); if (rc < 0) { - LOG_BTS(bts, DPCU, LOGL_ERROR, "Could not create unix socket: %s\n", + LOGP(DPCU, LOGL_ERROR, "Could not create unix socket: %s\n", strerror(errno)); talloc_free(state); return -1; @@ -985,23 +996,23 @@ rc = osmo_fd_register(bfd); if (rc < 0) { - LOG_BTS(bts, DPCU, LOGL_ERROR, "Could not register listen fd: %d\n", + LOGP(DPCU, LOGL_ERROR, "Could not register listen fd: %d\n", rc); close(bfd->fd); talloc_free(state); return rc; } - LOG_BTS(bts, DPCU, LOGL_INFO, "Started listening on PCU socket: %s\n", path); + LOGP(DPCU, LOGL_INFO, "Started listening on PCU socket: %s\n", net->pcu_sock_path); - bts->pcu_state = state; + net->pcu_state = state; return 0; } /* Close connection to PCU */ -void pcu_sock_exit(struct gsm_bts *bts) +void pcu_sock_exit(struct gsm_network *net) { - struct pcu_sock_state *state = bts->pcu_state; + struct pcu_sock_state *state = net->pcu_state; struct osmo_fd *bfd, *conn_bfd; if (!state) @@ -1014,5 +1025,5 @@ osmo_fd_unregister(bfd); close(bfd->fd); talloc_free(state); - bts->pcu_state = NULL; + net->pcu_state = NULL; } diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 790ad77..9618f92 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -341,7 +341,7 @@ return; } - if (bsc_co_located_pcu(bts) && !pcu_connected(bts)) { + if (bsc_co_located_pcu(bts) && !pcu_connected(bts->network)) { LOG_TS(ts, LOGL_DEBUG, "PCU not connected: not activating PDCH.\n"); return; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I0b42c2c130106f6ffca2dd08d079e1a7bda41f0b Gerrit-Change-Number: 31618 Gerrit-PatchSet: 13 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-CC: fixeria <vyanitskiy(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.c: Call osmo_fd_unregister() before closing and changing lis...
by laforge 20 Mar '23

20 Mar '23
Attention is currently required from: pespin, dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31982 ) Change subject: pcu_sock.c: Call osmo_fd_unregister() before closing and changing listen_bfd->fd ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I48e0411c4cba9897bc04865d22d8f68ed4fe87a2 Gerrit-Change-Number: 31982 Gerrit-PatchSet: 1 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: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Mar 2023 12:52:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • ...
  • 365
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.