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 -----
  • 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

April 2023

  • 1 participants
  • 2252 discussions
[M] Change in osmo-ci[master]: jobs/osmocom-obs-rhizomatica: add new jobs
by osmith 06 Apr '23

06 Apr '23
Attention is currently required from: neels. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/32230 ) Change subject: jobs/osmocom-obs-rhizomatica: add new jobs ...................................................................... Patch Set 2: (1 comment) File jobs/osmocom-obs-rhizomatica.yml: https://gerrit.osmocom.org/c/osmo-ci/+/32230/comment/0b69ac7f_45ce51c9 PS2, Line 48: --feed "master" \ > does it show in the naming/the URL no, that is set by PROJ. > is it freely choosable It must be master for this type of repository. The --feed argument used to describe the feed we are uploading to (nightly, latest, master). It tells the update_obs_project.py script: * which git reference it should try to upload (latest: the last release tag, master/nightly: the last commit on the given git branch, by default the "master" git branch) * whether it should store the current git as text file in OBS and compare it ahead of time, and skip the package if it didn't change (master only) Now that we have additional repositories (wireshark, rhizomatica), it isn't necessarily the actual feed we are uploading to. It only describes the characteristics named above. So the name is historic here, it probably makes sense to give it another name to avoid confusion. I'll do that later in a follow-up patch. -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/32230 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I9d59f517eb4ecfd721ef1dba4519a874590f756e Gerrit-Change-Number: 32230 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Apr 2023 14:05:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp_vty: add warnings for deprecated config options
by dexter 06 Apr '23

06 Apr '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32238 ) Change subject: mgcp_vty: add warnings for deprecated config options ...................................................................... mgcp_vty: add warnings for deprecated config options We normally warn in case someone uses a deprecated config option Change-Id: I182f6579930a4e5ed79c8eb87501578ce7e89c15 --- M src/libosmo-mgcp/mgcp_vty.c 1 file changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/38/32238/1 diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 7a828c3..784894c 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -511,6 +511,7 @@ BIND_STR "Bind local ports on start up\n" "Bind on demand\n" "Bind on startup\n") { + vty_out(vty, "%% Deprecated 'bind early (0|1)' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -721,6 +722,7 @@ "sdp audio-payload number <0-255>", SDP_STR AUDIO_STR "Number\n" "Payload number\n") { + vty_out(vty, "%% Deprecated 'sdp audio-payload number <0-255>' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -734,6 +736,7 @@ "sdp audio-payload name NAME", SDP_STR AUDIO_STR "Name\n" "Payload name\n") { + vty_out(vty, "%% Deprecated 'sdp audio-payload name NAME' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -794,6 +797,7 @@ "loop (0|1)", "Loop audio for all endpoints on main trunk\n" "Don't Loop\n" "Loop\n") { + vty_out(vty, "%% Deprecated 'loop (0|1)' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -1088,6 +1092,7 @@ "sdp audio-payload number <0-255>", SDP_STR AUDIO_STR "Number\n" "Payload Number\n") { + vty_out(vty, "%% Deprecated 'sdp audio-payload number <0-255>' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -1100,6 +1105,7 @@ "sdp audio-payload name NAME", SDP_STR AUDIO_STR "Payload\n" "Payload Name\n") { + vty_out(vty, "%% Deprecated 'sdp audio-payload name NAME' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -1112,6 +1118,7 @@ "loop (0|1)", "Loop audio for all endpoints on this trunk\n" "Don't Loop\n" "Loop\n") { + vty_out(vty, "%% Deprecated 'loop (0|1)' config no longer has any effect%s", VTY_NEWLINE); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32238 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I182f6579930a4e5ed79c8eb87501578ce7e89c15 Gerrit-Change-Number: 32238 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-mgw[master]: mgcp_network: fix apidoc
by dexter 06 Apr '23

06 Apr '23
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32237 ) Change subject: mgcp_network: fix apidoc ...................................................................... mgcp_network: fix apidoc Change-Id: I358e21e9a9ab33beb07a9adfd4a53145aadb997d --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/32237/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index e54b8ad..1238c74 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -1130,12 +1130,11 @@ /*! Send RTP/RTCP data to a specified destination connection. * \param[in] endp associated endpoint (for configuration, logging). * \param[in] is_rtp flag to specify if the packet is of type RTP or RTCP. - * \param[in] spoofed source address (set to NULL to disable). - * \param[in] buf buffer that contains the RTP/RTCP data. - * \param[in] len length of the buffer that contains the RTP/RTCP data. + * \param[in] addr spoofed source address (set to NULL to disable). + * \param[in] msg message buffer that contains the RTP/RTCP data. * \param[in] conn_src associated source connection. * \param[in] conn_dst associated destination connection. - * \returns 0 on success, -1 on ERROR. */ + * \returns 0 on success, negative on ERROR. */ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct osmo_sockaddr *addr, struct msgb *msg, struct mgcp_conn_rtp *conn_src, struct mgcp_conn_rtp *conn_dst) -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I358e21e9a9ab33beb07a9adfd4a53145aadb997d Gerrit-Change-Number: 32237 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by dexter 06 Apr '23

06 Apr '23
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 to look at the new patch set (#5). Change subject: mgcp_codec: fix codec decision ...................................................................... mgcp_codec: fix codec decision Unfortunately OsmoMGW was never really tested with multiple different codecs on either side of the connection. While OsmoMSC and OsmoBSC only assign exactly one codec on each side this has never been a problem, however it might become a problem when a call againt assigns multiple codecs on one side. This has been observed in a setup where OsmoMGW had one leg towards an external call agent. Also due to recent upgrades to the TTCN3 tests we are now able to simulate different codecs on both sides to pinpoint issues. Testing has shown that OsmoMGW has difficulties with multiple codecs. The reason for this is that the function that makes the codec decision was not fully finished. So let's finish the codec decision function and let's also use that decision when patching the payload type of outgoing RTP packets. Related: OS#5461 Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 --- M include/osmocom/mgcp/mgcp_codec.h M include/osmocom/mgcp/mgcp_trunk.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 8 files changed, 289 insertions(+), 261 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/32218/5 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 5 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by dexter 06 Apr '23

06 Apr '23
Attention is currently required from: pespin. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... Patch Set 5: (3 comments) File src/libosmo-mgcp/mgcp_codec.c: https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/932b783e_30d440a2 PS2, Line 440: conn->end.codec = mgcp_codec_find_same(conn, found_same_codec_opposite); > Ah I see what you mean, you are looking the codec in each conn list. […] The data is not duplicated. Its just that each endpoint holds two connections and each connections has a codec list. This is the list that had been issued by the call agent during CRCX/MDCX. We can not put both into one list since then we would lose the info which side supports what. File src/libosmo-mgcp/mgcp_network.c: https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/f8e569a8_0e2f5fe9 PS4, Line 509: return; > so you decided to drop the return code while still logging an ERROR. […] The caller is not doing anything meaningful with it but maybe it is better to drop the packet than sending it with a wrong PT. https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/5f1a8dad_f78b9f05 PS4, Line 1166: mgcp_patch_pt(conn_dst, msg); > all this code path failing looks buggy. […] Technically nothing has changed but I can see mgcp_send() might need some refactoring. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 5 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Apr 2023 14:05:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ci[master]: jobs/osmocom-obs-rhizomatica: add new jobs
by neels 06 Apr '23

06 Apr '23
Attention is currently required from: osmith. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/32230 ) Change subject: jobs/osmocom-obs-rhizomatica: add new jobs ...................................................................... Patch Set 2: (1 comment) File jobs/osmocom-obs-rhizomatica.yml: https://gerrit.osmocom.org/c/osmo-ci/+/32230/comment/9eb4abeb_0a2b4b08 PS2, Line 48: --feed "master" \ I'm wondering about this "master" name: does it show in the naming/the URL, and is it freely choosable? because this is not the origin/master feed, but based on a custom rhizomatica branch, right? Could this be confusing, vs origin/master? -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/32230 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I9d59f517eb4ecfd721ef1dba4519a874590f756e Gerrit-Change-Number: 32230 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Apr 2023 13:54:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by pespin 06 Apr '23

06 Apr '23
Attention is currently required from: dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... Patch Set 4: (3 comments) File src/libosmo-mgcp/mgcp_network.c: https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/f8984686_c8f541bf PS4, Line 509: return; so you decided to drop the return code while still logging an ERROR. WHY? https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/59799fe7_89329e4d PS4, Line 1166: mgcp_patch_pt(conn_dst, msg); all this code path failing looks buggy. Looks like it was buggy before, but now it looks even worse? File src/libosmo-mgcp/mgcp_vty.c: https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/0471b13a_8cc51dee PS4, Line 703: "allow-transcoding", "Allow transcoding\n") These are still missing the deprecated warnings? -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Apr 2023 12:20:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by pespin 06 Apr '23

06 Apr '23
Attention is currently required from: dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... Patch Set 4: (1 comment) File src/libosmo-mgcp/mgcp_codec.c: https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/eae3fd85_ed27682e PS2, Line 440: conn->end.codec = mgcp_codec_find_same(conn, found_same_codec_opposite); > The problem is that it is not possible to assign codec_conn_dst to conn_src->end. […] Ah I see what you mean, you are looking the codec in each conn list. Now the question I have is: why do we have codec structs holding the same data duplicated (allocated several times) for each connection? Wouldn't it make more sense to have them defined in 1 global place and then have a pointer to that global struct here in all conns? I'm not saying it has to be done in this commit, just pointing out some possibilities for improvement. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 06 Apr 2023 12:17:42 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-bts[master]: Merge gsm_network into gsm_bts_sm and place gsm_bts under it
by pespin 06 Apr '23

06 Apr '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/32236 ) Change subject: Merge gsm_network into gsm_bts_sm and place gsm_bts under it ...................................................................... Merge gsm_network into gsm_bts_sm and place gsm_bts under it This way the data model in TS 12.21 (Figure 1) is followed, where there's a BTS Site Manager containing one or more BTS. In our case we only support 1 BTS (cell) so far. Change-Id: Ideb0d458ec631008223f861cf8b46d09524a1a21 Related: OS#5994 --- M include/osmo-bts/Makefile.am M include/osmo-bts/bts.h A include/osmo-bts/bts_sm.h M include/osmo-bts/gsm_data.h M include/osmo-bts/pcu_if.h M include/osmo-bts/vty.h M src/common/Makefile.am M src/common/abis_osmo.c M src/common/bts.c M src/common/bts_shutdown_fsm.c A src/common/bts_sm.c M src/common/main.c M src/common/nm_bts_sm_fsm.c M src/common/oml.c M src/common/pcu_sock.c M src/common/vty.c M src/osmo-bts-oc2g/oc2gbts_vty.c M src/osmo-bts-omldummy/main.c M tests/agch/agch_test.c M tests/cipher/cipher_test.c M tests/handover/handover_test.c M tests/meas/meas_test.c M tests/misc/misc_test.c M tests/paging/paging_test.c M tests/tx_power/tx_power_test.c 25 files changed, 270 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/32236/1 diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index 91ff852..f24da53 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -4,6 +4,7 @@ bts.h \ bts_model.h \ bts_shutdown_fsm.h \ + bts_sm.h \ bts_trx.h \ gsm_data.h \ logging.h \ diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 6a4d23e..b792fe9 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -119,11 +119,6 @@ } pf; }; -/* BTS Site Manager */ -struct gsm_bts_sm { - struct gsm_abis_mo mo; -}; - /* GPRS NSVC; ip.access specific NM Object */ struct gsm_gprs_nse; struct gsm_gprs_nsvc { @@ -161,7 +156,7 @@ /* One BTS */ struct gsm_bts { - /* list header in net->bts_list */ + /* list header in g_bts_sm->bts_list */ struct llist_head list; /* number of the BTS in network */ @@ -211,7 +206,7 @@ /* CCCH is on C0 */ struct gsm_bts_trx *c0; - struct gsm_bts_sm site_mgr; + struct gsm_bts_sm *site_mgr; /* bitmask of all SI that are present/valid in si_buf */ uint32_t si_valid; @@ -399,10 +394,6 @@ #define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i)) #define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0]) -static inline struct gsm_bts *gsm_bts_sm_get_bts(struct gsm_bts_sm *site_mgr) { - return (struct gsm_bts *)container_of(site_mgr, struct gsm_bts, site_mgr); -} - static inline struct gsm_bts *gsm_gprs_nse_get_bts(struct gsm_gprs_nse *nse) { return (struct gsm_bts *)container_of(nse, struct gsm_bts, gprs.nse); @@ -413,8 +404,8 @@ return (struct gsm_bts *)container_of(cell, struct gsm_bts, gprs.cell); } -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num); +struct gsm_bts *gsm_bts_alloc(struct gsm_bts_sm *bts_sm, uint8_t bts_num); +struct gsm_bts *gsm_bts_num(const struct gsm_bts_sm *bts_sm, int num); int bts_init(struct gsm_bts *bts); void bts_shutdown(struct gsm_bts *bts, const char *reason); diff --git a/include/osmo-bts/bts_sm.h b/include/osmo-bts/bts_sm.h new file mode 100644 index 0000000..60ee87c --- /dev/null +++ b/include/osmo-bts/bts_sm.h @@ -0,0 +1,21 @@ +#pragma once + +#include <osmocom/core/linuxlist.h> +#include <osmocom/gsm/gsm23003.h> + +#include <osmo-bts/oml.h> + +struct pcu_sock_state; + +/* BTS Site Manager */ +struct gsm_bts_sm { + struct gsm_abis_mo mo; + struct llist_head bts_list; + unsigned int num_bts; + struct osmo_plmn_id plmn; + struct pcu_sock_state *pcu_state; +}; + +extern struct gsm_bts_sm *g_bts_sm; + +struct gsm_bts_sm *gsm_bts_sm_alloc(void *talloc_ctx); diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 5bf6f02..b20f3ea 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -41,12 +41,6 @@ #define GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT 41 #define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91 -struct gsm_network { - struct llist_head bts_list; - unsigned int num_bts; - struct osmo_plmn_id plmn; - struct pcu_sock_state *pcu_state; -}; /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 6cdc682..5d304ea 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -3,6 +3,8 @@ #include <osmo-bts/pcuif_proto.h> +struct gsm_bts_sm; + extern int pcu_direct; #define PCUIF_HDR_SIZE (sizeof(struct gsm_pcu_if) - sizeof(((struct gsm_pcu_if *)0)->u)) @@ -23,7 +25,7 @@ int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed); int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len); int pcu_tx_susp_req(struct gsm_lchan *lchan, uint32_t tlli, const uint8_t *ra_id, uint8_t cause); -int pcu_sock_send(struct gsm_network *net, struct msgb *msg); +int pcu_sock_send(struct gsm_bts_sm *bts_sm, struct msgb *msg); int pcu_sock_init(const char *path); void pcu_sock_exit(void); diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h index 7835156..4716f7c 100644 --- a/include/osmo-bts/vty.h +++ b/include/osmo-bts/vty.h @@ -25,8 +25,6 @@ int bts_vty_init(void *ctx); -struct gsm_network *gsmnet_from_vty(struct vty *v); - extern struct vty_app_info bts_vty_info; extern struct gsm_bts *g_bts; diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f082543..830f940 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -33,6 +33,7 @@ oml.c \ osmux.c \ bts.c \ + bts_sm.c \ bts_trx.c \ rsl.c \ vty.c \ diff --git a/src/common/abis_osmo.c b/src/common/abis_osmo.c index 46dc5fa..777ebd7 100644 --- a/src/common/abis_osmo.c +++ b/src/common/abis_osmo.c @@ -30,8 +30,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/pcu_if.h> #include <osmo-bts/pcuif_proto.h> - -extern struct gsm_network bts_gsmnet; +#include <osmo-bts/bts_sm.h> #define OM_HEADROOM_SIZE 128 @@ -106,7 +105,7 @@ /* Trim Abis lower layers: */ msgb_pull_to_l2(msg); /* we simply forward it to PCUIF: */ - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } /* incoming IPA/OSMO extension Abis message from BSC */ diff --git a/src/common/bts.c b/src/common/bts.c index e86473e..fcd2f3f 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -44,6 +44,7 @@ #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> #include <osmo-bts/bts_model.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/dtx_dl_amr_fsm.h> #include <osmo-bts/pcuif_proto.h> #include <osmo-bts/rsl.h> @@ -61,11 +62,6 @@ static void bts_update_agch_max_queue_length(struct gsm_bts *bts); -struct gsm_network bts_gsmnet = { - .bts_list = { &bts_gsmnet.bts_list, &bts_gsmnet.bts_list }, - .num_bts = 0, -}; - void *tall_bts_ctx; /* Table 3.1 TS 04.08: Values of parameter S */ @@ -212,10 +208,6 @@ static int gsm_bts_talloc_destructor(struct gsm_bts *bts) { - if (bts->site_mgr.mo.fi) { - osmo_fsm_inst_free(bts->site_mgr.mo.fi); - bts->site_mgr.mo.fi = NULL; - } if (bts->mo.fi) { osmo_fsm_inst_free(bts->mo.fi); bts->mo.fi = NULL; @@ -231,9 +223,9 @@ return 0; } -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) +struct gsm_bts *gsm_bts_alloc(struct gsm_bts_sm *bts_sm, uint8_t bts_num) { - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); + struct gsm_bts *bts = talloc_zero(bts_sm, struct gsm_bts); struct gsm_gprs_nse *nse = &bts->gprs.nse; int i; @@ -243,8 +235,9 @@ talloc_set_destructor(bts, gsm_bts_talloc_destructor); /* add to list of BTSs */ - llist_add_tail(&bts->list, &bts_gsmnet.bts_list); + llist_add_tail(&bts->list, &bts_sm->bts_list); + bts->site_mgr = bts_sm; bts->nr = bts_num; bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); @@ -257,12 +250,6 @@ LOGL_INFO, NULL); osmo_fsm_inst_update_id_f(bts->shutdown_fi, "bts%d", bts->nr); - /* NM SITE_MGR */ - bts->site_mgr.mo.fi = osmo_fsm_inst_alloc(&nm_bts_sm_fsm, bts, &bts->site_mgr, - LOGL_INFO, "bts_sm"); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - /* NM BTS */ bts->mo.fi = osmo_fsm_inst_alloc(&nm_bts_fsm, bts, bts, LOGL_INFO, NULL); @@ -310,14 +297,14 @@ return bts; } -struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num) +struct gsm_bts *gsm_bts_num(const struct gsm_bts_sm *bts_sm, int num) { struct gsm_bts *bts; - if (num >= net->num_bts) + if (num >= bts_sm->num_bts) return NULL; - llist_for_each_entry(bts, &net->bts_list, list) { + llist_for_each_entry(bts, &bts_sm->bts_list, list) { if (bts->nr == num) return bts; } @@ -382,8 +369,7 @@ bts->radio_link_timeout.oml = 32; bts->radio_link_timeout.current = bts->radio_link_timeout.oml; - /* Start with the site manager */ - oml_mo_state_init(&bts->site_mgr.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); + /* Start with the BTS */ oml_mo_state_init(&bts->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); oml_mo_state_init(&bts->gprs.nse.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); oml_mo_state_init(&bts->gprs.cell.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); @@ -417,7 +403,7 @@ /* TRX0 was allocated early during gsm_bts_alloc, not later through VTY */ bts_model_trx_init(bts->c0); - bts_gsmnet.num_bts++; + g_bts_sm->num_bts++; if (!initialized) { osmo_signal_register_handler(SS_GLOBAL, bts_signal_cbfn, NULL); @@ -456,7 +442,7 @@ LOGP(DOML, LOGL_INFO, "Main link established, sending NM Status.\n"); /* BTS SITE MGR becomes Offline (tx SW ACT Report), BTS, NSE, etc. is DEPENDENCY */ - osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SW_ACT, NULL); + osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_SW_ACT, NULL); osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_SW_ACT, NULL); osmo_fsm_inst_dispatch(bts->gprs.nse.mo.fi, NM_EV_SW_ACT, NULL); for (i = 0; i < ARRAY_SIZE(bts->gprs.nse.nsvc); i++) { diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c index 55e0b19..eb432a9 100644 --- a/src/common/bts_shutdown_fsm.c +++ b/src/common/bts_shutdown_fsm.c @@ -29,6 +29,7 @@ #include <osmo-bts/gsm_data.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/nm_common_fsm.h> #define X(s) (1 << (s)) @@ -60,7 +61,7 @@ switch(event) { case BTS_SHUTDOWN_EV_START: /* Firt announce to NM objects that we are starting a shutdown procedure: */ - osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SHUTDOWN_START, NULL); + osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_SHUTDOWN_START, NULL); count = count_trx_operational(bts); if (count) { @@ -164,7 +165,7 @@ { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; - osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SHUTDOWN_FINISH, NULL); + osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_SHUTDOWN_FINISH, NULL); if (bts->shutdown_fi_exit_proc) { LOGPFSML(fi, LOGL_NOTICE, "Shutdown process completed successfully, exiting process\n"); diff --git a/src/common/bts_sm.c b/src/common/bts_sm.c new file mode 100644 index 0000000..a5ddd3a --- /dev/null +++ b/src/common/bts_sm.c @@ -0,0 +1,67 @@ +/* BTS support code common to all supported BTS models */ + +/* (C) 2023 by sysmocom - s.m.f.c. GmbH <info(a)sysmocom.de> + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <osmocom/core/talloc.h> +#include <osmocom/core/linuxlist.h> +#include <osmocom/core/fsm.h> + +#include <osmo-bts/bts_sm.h> +#include <osmo-bts/bts.h> +#include <osmo-bts/nm_common_fsm.h> + +struct gsm_bts_sm *g_bts_sm; + +static int gsm_bts_sm_talloc_destructor(struct gsm_bts_sm *bts_sm) +{ + struct gsm_bts *bts; + + while ((bts = llist_first_entry_or_null(&bts_sm->bts_list, struct gsm_bts, list))) + talloc_free(bts); + + if (bts_sm->mo.fi) { + osmo_fsm_inst_free(bts_sm->mo.fi); + bts_sm->mo.fi = NULL; + } + + return 0; +} + +struct gsm_bts_sm *gsm_bts_sm_alloc(void *talloc_ctx) +{ + struct gsm_bts_sm *bts_sm = talloc_zero(talloc_ctx, struct gsm_bts_sm); + + if (!bts_sm) + return NULL; + + talloc_set_destructor(bts_sm, gsm_bts_sm_talloc_destructor); + + INIT_LLIST_HEAD(&bts_sm->bts_list); + + /* NM SITE_MGR */ + bts_sm->mo.fi = osmo_fsm_inst_alloc(&nm_bts_sm_fsm, bts_sm, bts_sm, + LOGL_INFO, "bts_sm"); + gsm_mo_init(&bts_sm->mo, NULL, NM_OC_SITE_MANAGER, + 0xff, 0xff, 0xff); + + oml_mo_state_init(&bts_sm->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); + + return bts_sm; +} diff --git a/src/common/main.c b/src/common/main.c index 074ab22..ed11956 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -49,6 +49,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/vty.h> #include <osmo-bts/l1sap.h> #include <osmo-bts/bts_model.h> @@ -292,7 +293,13 @@ if (vty_test_mode) fprintf(stderr, "--- VTY test mode: not connecting to BSC, not exiting ---\n"); - g_bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) { + fprintf(stderr, "Failed to create BTS Site Manager structure\n"); + exit(1); + } + + g_bts = gsm_bts_alloc(g_bts_sm, 0); if (!g_bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/src/common/nm_bts_sm_fsm.c b/src/common/nm_bts_sm_fsm.c index f775265..50f658b 100644 --- a/src/common/nm_bts_sm_fsm.c +++ b/src/common/nm_bts_sm_fsm.c @@ -32,6 +32,7 @@ #include <osmo-bts/gsm_data.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/rsl.h> #include <osmo-bts/nm_common_fsm.h> #include <osmo-bts/phy_link.h> @@ -44,9 +45,11 @@ static void ev_dispatch_children(struct gsm_bts_sm *site_mgr, uint32_t event) { - struct gsm_bts *bts = gsm_bts_sm_get_bts(site_mgr); - osmo_fsm_inst_dispatch(bts->gprs.nse.mo.fi, event, NULL); - osmo_fsm_inst_dispatch(bts->mo.fi, event, NULL); + struct gsm_bts *bts; + llist_for_each_entry(bts, &site_mgr->bts_list, list) { + osmo_fsm_inst_dispatch(bts->gprs.nse.mo.fi, event, NULL); + osmo_fsm_inst_dispatch(bts->mo.fi, event, NULL); + } } ////////////////////////// diff --git a/src/common/oml.c b/src/common/oml.c index 7a237f1..937fe73 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -46,6 +46,7 @@ #include <osmo-bts/oml.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/signal.h> #include <osmo-bts/phy_link.h> #include <osmo-bts/nm_common_fsm.h> @@ -132,6 +133,7 @@ int oml_mo_send_msg(const struct gsm_abis_mo *mo, struct msgb *msg, uint8_t msg_type) { struct abis_om_fom_hdr *foh; + struct gsm_bts *bts; msg->l3h = msgb_push(msg, sizeof(*foh)); foh = (struct abis_om_fom_hdr *) msg->l3h; @@ -139,8 +141,22 @@ foh->obj_class = mo->obj_class; memcpy(&foh->obj_inst, &mo->obj_inst, sizeof(foh->obj_inst)); - /* FIXME: This assumption may not always be correct */ - msg->trx = mo->bts->c0; + /* Find and set OML TRX on msg: */ + switch (mo->obj_class) { + case NM_OC_SITE_MANAGER: + /* Pick the first BTS: */ + bts = gsm_bts_num(g_bts_sm, 0); + break; + default: + /* Other objects should have a valid BTS available: */ + bts = gsm_bts_num(g_bts_sm, mo->obj_inst.bts_nr); + } + if (!bts) { + LOGPFOH(DOML, LOGL_NOTICE, foh, + "Sending FOM failed (no related BTS object found)\n"); + return -EINVAL; + } + msg->trx = bts->c0; DEBUGPFOH(DOML, foh, "Tx %s\n", get_value_string(abis_nm_msgtype_names, foh->msg_type)); @@ -1740,7 +1756,7 @@ mo = &trx->ts[obj_inst->ts_nr].mo; break; case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; + mo = &g_bts_sm->mo; break; case NM_OC_GPRS_NSE: mo = &bts->gprs.nse.mo; @@ -1807,7 +1823,7 @@ obj = &trx->ts[obj_inst->ts_nr]; break; case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; + obj = g_bts_sm; break; case NM_OC_GPRS_NSE: obj = &bts->gprs.nse; diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index bce067a..36520fb 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -38,6 +38,7 @@ #include <osmo-bts/pcu_if.h> #include <osmo-bts/pcuif_proto.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/rsl.h> #include <osmo-bts/signal.h> #include <osmo-bts/l1sap.h> @@ -46,7 +47,6 @@ uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx); -extern struct gsm_network bts_gsmnet; int pcu_direct = 0; static int avail_lai = 0, avail_nse = 0, avail_cell = 0, avail_nsvc[2] = {0, 0}; @@ -231,7 +231,6 @@ int pcu_tx_info_ind(void) { - struct gsm_network *net = &bts_gsmnet; struct msgb *msg; struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_info_ind *info_ind; @@ -244,7 +243,7 @@ LOGP(DPCU, LOGL_INFO, "Sending info\n"); /* FIXME: allow multiple BTS */ - bts = llist_entry(net->bts_list.next, struct gsm_bts, list); + bts = llist_entry(g_bts_sm->bts_list.next, struct gsm_bts, list); nse = &bts->gprs.nse; rlcc = &bts->gprs.cell.rlc_cfg; @@ -266,9 +265,9 @@ info_ind->bsic = bts->bsic; /* RAI */ - info_ind->mcc = net->plmn.mcc; - info_ind->mnc = net->plmn.mnc; - info_ind->mnc_3_digits = net->plmn.mnc_3_digits; + info_ind->mcc = g_bts_sm->plmn.mcc; + info_ind->mnc = g_bts_sm->plmn.mnc; + info_ind->mnc_3_digits = g_bts_sm->plmn.mnc_3_digits; info_ind->lac = bts->location_area_code; info_ind->rac = bts->gprs.rac; @@ -358,13 +357,12 @@ info_ind_fill_trx(&info_ind->trx[trx->nr], trx); } - return pcu_sock_send(net, msg); + return pcu_sock_send(g_bts_sm, msg); } static int pcu_if_signal_cb(unsigned int subsys, unsigned int signal, void *hdlr_data, void *signal_data) { - struct gsm_network *net = &bts_gsmnet; struct gsm_gprs_nsvc *nsvc; struct gsm_bts *bts; struct gsm48_system_information_type_3 *si3; @@ -380,7 +378,7 @@ break; si3 = (struct gsm48_system_information_type_3 *) bts->si_buf[SYSINFO_TYPE_3]; - osmo_plmn_from_bcd(si3->lai.digits, &net->plmn); + osmo_plmn_from_bcd(si3->lai.digits, &g_bts_sm->plmn); bts->location_area_code = ntohs(si3->lai.lac); bts->cell_identity = ntohs(si3->cell_identity); avail_lai = 1; @@ -436,7 +434,7 @@ ai_req->len = len; memcpy(ai_req->data, app_data, ai_req->len); - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, @@ -463,7 +461,7 @@ rts_req->ts_nr = ts->nr; rts_req->block_nr = block_nr; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn, @@ -498,7 +496,7 @@ memcpy(data_ind->data, data, len); data_ind->len = len; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_rach_ind(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, @@ -527,7 +525,7 @@ rach_ind->trx_nr = trx_nr; rach_ind->ts_nr = ts_nr; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_time_ind(uint32_t fn) @@ -549,7 +547,7 @@ time_ind->fn = fn; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_interf_ind(const struct gsm_bts_trx *trx, uint32_t fn) @@ -582,12 +580,12 @@ interf_ind->interf[tn] = -1 * lchan->meas.interf_meas_avg_dbm; } - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) { - struct pcu_sock_state *state = bts_gsmnet.pcu_state; + struct pcu_sock_state *state = g_bts_sm->pcu_state; struct msgb *msg; struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_pag_req *pag_req; @@ -615,19 +613,18 @@ pag_req->chan_needed = chan_needed; memcpy(pag_req->identity_lv, identity_lv, identity_lv[0] + 1); - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) { - struct gsm_network *net = &bts_gsmnet; struct gsm_bts *bts; struct msgb *msg; struct gsm_pcu_if *pcu_prim; struct gsm_pcu_if_data *data_cnf; /* FIXME: allow multiple BTS */ - bts = llist_entry(net->bts_list.next, struct gsm_bts, list); + bts = llist_entry(g_bts_sm->bts_list.next, struct gsm_bts, list); LOGP(DPCU, LOGL_DEBUG, "Sending PCH confirm\n"); @@ -642,7 +639,7 @@ memcpy(data_cnf->data, data, len); data_cnf->len = len; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } /* forward data from a RR GPRS SUSPEND REQ towards PCU */ @@ -659,7 +656,7 @@ memcpy(pcu_prim->u.susp_req.ra_id, ra_id, sizeof(pcu_prim->u.susp_req.ra_id)); pcu_prim->u.susp_req.cause = cause; - return pcu_sock_send(&bts_gsmnet, msg); + return pcu_sock_send(g_bts_sm, msg); } static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type, @@ -897,14 +894,14 @@ return -EINVAL; \ } \ } while (0) -static int pcu_rx(struct gsm_network *net, uint8_t msg_type, +static int pcu_rx(struct gsm_bts_sm *bts_sm, uint8_t msg_type, struct gsm_pcu_if *pcu_prim, size_t prim_len) { int rc = 0; struct gsm_bts *bts; size_t exp_len; - if ((bts = gsm_bts_num(net, pcu_prim->bts_nr)) == NULL) { + if ((bts = gsm_bts_num(bts_sm, pcu_prim->bts_nr)) == NULL) { LOGP(DPCU, LOGL_ERROR, "Received PCU Prim for non-existent BTS %u\n", pcu_prim->bts_nr); return -EINVAL; } @@ -951,15 +948,15 @@ */ struct pcu_sock_state { - struct gsm_network *net; + struct gsm_bts_sm *bts_sm; 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 */ }; -int pcu_sock_send(struct gsm_network *net, struct msgb *msg) +int pcu_sock_send(struct gsm_bts_sm *bts_sm, struct msgb *msg) { - struct pcu_sock_state *state = net->pcu_state; + struct pcu_sock_state *state = bts_sm->pcu_state; struct osmo_fd *conn_bfd; struct gsm_pcu_if *pcu_prim = (struct gsm_pcu_if *) msg->data; @@ -994,7 +991,7 @@ unsigned int tn; /* FIXME: allow multiple BTS */ - bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list); + bts = llist_entry(state->bts_sm->bts_list.next, struct gsm_bts, list); LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n"); oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_MAJOR, OSMO_EVT_PCU_VERS, @@ -1073,7 +1070,7 @@ return 0; } - rc = pcu_rx(state->net, pcu_prim->msg_type, pcu_prim, rc); + rc = pcu_rx(state->bts_sm, pcu_prim->msg_type, pcu_prim, rc); /* as we always synchronously process the message in pcu_rx() and * its callbacks, we can free the message here. */ @@ -1187,7 +1184,7 @@ return -ENOMEM; INIT_LLIST_HEAD(&state->upqueue); - state->net = &bts_gsmnet; + state->bts_sm = g_bts_sm; state->conn_bfd.fd = -1; bfd = &state->listen_bfd; @@ -1213,7 +1210,7 @@ osmo_signal_register_handler(SS_GLOBAL, pcu_if_signal_cb, NULL); - bts_gsmnet.pcu_state = state; + g_bts_sm->pcu_state = state; LOGP(DPCU, LOGL_INFO, "Started listening on PCU socket: %s\n", path); @@ -1222,7 +1219,7 @@ void pcu_sock_exit(void) { - struct pcu_sock_state *state = bts_gsmnet.pcu_state; + struct pcu_sock_state *state = g_bts_sm->pcu_state; struct osmo_fd *bfd, *conn_bfd; if (!state) @@ -1236,12 +1233,11 @@ close(bfd->fd); osmo_fd_unregister(bfd); talloc_free(state); - bts_gsmnet.pcu_state = NULL; + g_bts_sm->pcu_state = NULL; } bool pcu_connected(void) { - struct gsm_network *net = &bts_gsmnet; - struct pcu_sock_state *state = net->pcu_state; + struct pcu_sock_state *state = g_bts_sm->pcu_state; if (!state) return false; diff --git a/src/common/vty.c b/src/common/vty.c index bc2afb6..051ad92 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -50,6 +50,7 @@ #include <osmo-bts/phy_link.h> #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/rsl.h> #include <osmo-bts/oml.h> #include <osmo-bts/signal.h> @@ -174,13 +175,6 @@ }, }; -extern struct gsm_network bts_gsmnet; - -struct gsm_network *gsmnet_from_vty(struct vty *v) -{ - return &bts_gsmnet; -} - static struct cmd_node bts_node = { BTS_NODE, "%s(bts)# ", @@ -506,10 +500,9 @@ static int config_write_bts(struct vty *vty) { - struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_bts *bts; - llist_for_each_entry(bts, &net->bts_list, list) + llist_for_each_entry(bts, &g_bts_sm->bts_list, list) config_write_bts_single(vty, bts); osmo_tdef_vty_groups_write(vty, ""); @@ -568,16 +561,15 @@ "BTS Number\n", CMD_ATTR_IMMEDIATE) { - struct gsm_network *gsmnet = gsmnet_from_vty(vty); int bts_nr = atoi(argv[0]); struct gsm_bts *bts; - if (bts_nr >= gsmnet->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% Unknown BTS number %u (num %u)%s", - bts_nr, gsmnet->num_bts, VTY_NEWLINE); + bts_nr, g_bts_sm->num_bts, VTY_NEWLINE); return CMD_WARNING; } else - bts = gsm_bts_num(gsmnet, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); vty->index = bts; vty->index_sub = &bts->description; @@ -1278,7 +1270,7 @@ vty_out(vty, " NM State: "); net_dump_nmstate(vty, &bts->mo.nm_state); vty_out(vty, " Site Mgr NM State: "); - net_dump_nmstate(vty, &bts->site_mgr.mo.nm_state); + net_dump_nmstate(vty, &g_bts_sm->mo.nm_state); if (strnlen(bts->pcu_version, MAX_VERSION_LENGTH)) vty_out(vty, " PCU version %s connected%s", bts->pcu_version, VTY_NEWLINE); @@ -1337,23 +1329,22 @@ SHOW_STR "Display information about a BTS\n" BTS_NR_STR) { - const struct gsm_network *net = gsmnet_from_vty(vty); int bts_nr; if (argc != 0) { /* use the BTS number that the user has specified */ bts_nr = atoi(argv[0]); - if (bts_nr >= net->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); + bts_dump_vty(vty, gsm_bts_num(g_bts_sm, bts_nr)); return CMD_SUCCESS; } /* print all BTS's */ - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) - bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); + for (bts_nr = 0; bts_nr < g_bts_sm->num_bts; bts_nr++) + bts_dump_vty(vty, gsm_bts_num(g_bts_sm, bts_nr)); return CMD_SUCCESS; } @@ -1411,10 +1402,9 @@ SHOW_STR "Display information about a BTS\n" BTS_NR_STR "GPRS/EGPRS configuration\n") { - const struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_bts *bts; - bts = gsm_bts_num(net, atoi(argv[0])); + bts = gsm_bts_num(g_bts_sm, atoi(argv[0])); if (bts == NULL) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); @@ -1430,16 +1420,15 @@ "Various testing commands\n" "Send a test OML failure event report to the BSC\n" BTS_NR_STR) { - const struct gsm_network *net = gsmnet_from_vty(vty); int bts_nr = atoi(argv[0]); const struct gsm_bts *bts; - if (bts_nr >= net->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - bts = gsm_bts_num(net, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MINOR, OSMO_EVT_WARN_SW_WARN, "test message sent from VTY"); return CMD_SUCCESS; @@ -1451,9 +1440,8 @@ "Use infinite timeout (DANGEROUS: only use during testing!)\n" "Number of lost SACCH blocks\n") { - const struct gsm_network *net = gsmnet_from_vty(vty); int bts_nr = atoi(argv[0]); - struct gsm_bts *bts = gsm_bts_num(net, bts_nr); + struct gsm_bts *bts = gsm_bts_num(g_bts_sm, bts_nr); if (!bts) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); @@ -1482,12 +1470,11 @@ "BCCH carrier power reduction operation\n" "Power reduction value (in dB, even numbers only)\n") { - struct gsm_network *net = gsmnet_from_vty(vty); const int bts_nr = atoi(argv[0]); const int red = atoi(argv[1]); struct gsm_bts *bts; - bts = gsm_bts_num(net, atoi(argv[0])); + bts = gsm_bts_num(g_bts_sm, atoi(argv[0])); if (bts == NULL) { vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); return CMD_WARNING; @@ -1637,19 +1624,18 @@ SHOW_STR "Display information about a TRX\n" BTS_TRX_STR) { - const struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_bts *bts = NULL; int bts_nr, trx_nr; if (argc >= 1) { /* use the BTS number that the user has specified */ bts_nr = atoi(argv[0]); - if (bts_nr >= net->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - bts = gsm_bts_num(net, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); } if (argc >= 2) { trx_nr = atoi(argv[1]); @@ -1667,8 +1653,8 @@ return CMD_SUCCESS; } - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) - print_all_trx(vty, gsm_bts_num(net, bts_nr)); + for (bts_nr = 0; bts_nr < g_bts_sm->num_bts; bts_nr++) + print_all_trx(vty, gsm_bts_num(g_bts_sm, bts_nr)); return CMD_SUCCESS; } @@ -1693,7 +1679,6 @@ SHOW_STR "Display information about a TS\n" BTS_TRX_TS_STR) { - const struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_bts *bts = NULL; const struct gsm_bts_trx *trx = NULL; const struct gsm_bts_trx_ts *ts = NULL; @@ -1702,12 +1687,12 @@ if (argc >= 1) { /* use the BTS number that the user has specified */ bts_nr = atoi(argv[0]); - if (bts_nr >= net->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% can't find BTS '%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - bts = gsm_bts_num(net, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); } if (argc >= 2) { trx_nr = atoi(argv[1]); @@ -1748,8 +1733,8 @@ } } else { /* Iterate over all BTS, TRX in each BTS, TS in each TRX */ - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { - bts = gsm_bts_num(net, bts_nr); + for (bts_nr = 0; bts_nr < g_bts_sm->num_bts; bts_nr++) { + bts = gsm_bts_num(g_bts_sm, bts_nr); for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { trx = gsm_bts_trx_num(bts, trx_nr); for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { @@ -2112,7 +2097,6 @@ static int lchan_summary(struct vty *vty, int argc, const char **argv, void (*dump_cb)(struct vty *, const struct gsm_lchan *)) { - const struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_bts *bts = NULL; /* initialize to avoid uninitialized false warnings on some gcc versions (11.1.0) */ const struct gsm_bts_trx *trx = NULL; /* initialize to avoid uninitialized false warnings on some gcc versions (11.1.0) */ const struct gsm_bts_trx_ts *ts = NULL; /* initialize to avoid uninitialized false warnings on some gcc versions (11.1.0) */ @@ -2122,12 +2106,12 @@ if (argc >= 1) { /* use the BTS number that the user has specified */ bts_nr = atoi(argv[0]); - if (bts_nr >= net->num_bts) { + if (bts_nr >= g_bts_sm->num_bts) { vty_out(vty, "%% can't find BTS %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - bts = gsm_bts_num(net, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); if (argc == 1) return dump_lchan_bts(bts, vty, dump_cb); @@ -2168,8 +2152,8 @@ return CMD_SUCCESS; } - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { - bts = gsm_bts_num(net, bts_nr); + for (bts_nr = 0; bts_nr < g_bts_sm->num_bts; bts_nr++) { + bts = gsm_bts_num(g_bts_sm, bts_nr); dump_lchan_bts(bts, vty, dump_cb); } @@ -2195,8 +2179,7 @@ return lchan_summary(vty, argc, argv, lchan_dump_short_vty); } -static struct gsm_lchan *resolve_lchan(const struct gsm_network *net, - const char **argv, int idx) +static struct gsm_lchan *resolve_lchan(const char **argv, int idx) { int bts_nr = atoi(argv[idx+0]); int trx_nr = atoi(argv[idx+1]); @@ -2207,7 +2190,7 @@ struct gsm_bts_trx *trx; struct gsm_bts_trx_ts *ts; - bts = gsm_bts_num(net, bts_nr); + bts = gsm_bts_num(g_bts_sm, bts_nr); if (!bts) return NULL; @@ -2472,11 +2455,10 @@ BTS_T_T_L_STR "RTP settings\n" "Jitter buffer\n" "Size of jitter buffer in (ms)\n") { - struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_lchan *lchan; int jitbuf_ms = atoi(argv[4]), rc; - lchan = resolve_lchan(net, argv, 0); + lchan = resolve_lchan(argv, 0); if (!lchan) { vty_out(vty, "%% Could not resolve logical channel%s", VTY_NEWLINE); return CMD_WARNING; @@ -2505,10 +2487,9 @@ BTS_T_T_L_STR "Set loopback\n", CMD_ATTR_HIDDEN) { - struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_lchan *lchan; - lchan = resolve_lchan(net, argv, 0); + lchan = resolve_lchan(argv, 0); if (!lchan) { vty_out(vty, "%% Could not resolve logical channel%s", VTY_NEWLINE); return CMD_WARNING; @@ -2524,10 +2505,9 @@ NO_STR BTS_T_T_L_STR "Set loopback\n", CMD_ATTR_HIDDEN) { - struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_lchan *lchan; - lchan = resolve_lchan(net, argv, 0); + lchan = resolve_lchan(argv, 0); if (!lchan) { vty_out(vty, "%% Could not resolve logical channel%s", VTY_NEWLINE); return CMD_WARNING; @@ -2550,13 +2530,12 @@ "Enable the power control loop\n", CMD_ATTR_HIDDEN) { - struct gsm_network *net = gsmnet_from_vty(vty); const struct gsm_power_ctrl_params *params; struct lchan_power_ctrl_state *state; const char **args = argv + 4; struct gsm_lchan *lchan; - lchan = resolve_lchan(net, argv, 0); + lchan = resolve_lchan(argv, 0); if (!lchan) { vty_out(vty, "%% Could not resolve logical channel%s", VTY_NEWLINE); return CMD_WARNING; @@ -2587,12 +2566,11 @@ "BS power reduction (in dB) or MS power level\n", CMD_ATTR_HIDDEN) { - struct gsm_network *net = gsmnet_from_vty(vty); struct lchan_power_ctrl_state *state; const char **args = argv + 4; struct gsm_lchan *lchan; - lchan = resolve_lchan(net, argv, 0); + lchan = resolve_lchan(argv, 0); if (!lchan) { vty_out(vty, "%% Could not resolve logical channel%s", VTY_NEWLINE); return CMD_WARNING; diff --git a/src/osmo-bts-oc2g/oc2gbts_vty.c b/src/osmo-bts-oc2g/oc2gbts_vty.c index ae7cd12..47c3f63 100644 --- a/src/osmo-bts-oc2g/oc2gbts_vty.c +++ b/src/osmo-bts-oc2g/oc2gbts_vty.c @@ -412,7 +412,6 @@ DEFUN(trigger_ho_cause, trigger_ho_cause_cmd, "HIDDEN", TRX_STR) { - struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts; struct gsm_bts_trx *trx; struct gsm_bts_trx_ts *ts; @@ -422,7 +421,7 @@ /* uint8_t old_ho_cause; */ /* get BTS pointer */ - bts = gsm_bts_num(net, 0); + bts = gsm_bts_num(g_bts_sm, 0); if (!bts) { vty_out(vty, "Can not get BTS node %s", VTY_NEWLINE); return CMD_WARNING; diff --git a/src/osmo-bts-omldummy/main.c b/src/osmo-bts-omldummy/main.c index c74af74..167d43a 100644 --- a/src/osmo-bts-omldummy/main.c +++ b/src/osmo-bts-omldummy/main.c @@ -10,6 +10,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/oml.h> static void print_usage(const char *prog_name) @@ -117,9 +118,14 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) + exit(1); + + bts = gsm_bts_alloc(g_bts_sm, 0); if (!bts) exit(1); + bts->ip_access.site_id = cmdline.site_id; bts->ip_access.bts_id = 0; diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index 30e7ef1..8ddc0f7 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -23,6 +23,7 @@ #include <osmocom/core/application.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/logging.h> #include <osmo-bts/gsm_data.h> @@ -225,7 +226,8 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(g_bts_sm, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index 9303ed2..cf532a0 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -18,6 +18,7 @@ */ #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/logging.h> #include <osmo-bts/paging.h> #include <osmo-bts/gsm_data.h> @@ -71,7 +72,8 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + bts = gsm_bts_alloc(g_bts_sm, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 231be98..3c46971 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -28,6 +28,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/vty.h> #include <osmo-bts/bts_model.h> #include <osmo-bts/pcu_if.h> @@ -71,7 +72,12 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) { + fprintf(stderr, "Failed to create BTS Site Manager structure\n"); + exit(1); + } + bts = gsm_bts_alloc(g_bts_sm, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c index 4b8aff8..0e89429 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -8,6 +8,7 @@ #include <osmo-bts/gsm_data.h> #include <osmo-bts/logging.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/measurement.h> #include <osmo-bts/rsl.h> @@ -457,7 +458,12 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); osmo_stderr_target->categories[DMEAS].loglevel = LOGL_DEBUG; - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) { + fprintf(stderr, "Failed to create BTS Site Manager structure\n"); + exit(1); + } + bts = gsm_bts_alloc(g_bts_sm, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c index e65fcb4..b1b9820 100644 --- a/tests/misc/misc_test.c +++ b/tests/misc/misc_test.c @@ -21,6 +21,7 @@ */ #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/msg_utils.h> #include <osmo-bts/logging.h> @@ -165,7 +166,8 @@ struct rsl_ie_chan_mode cm; struct gsm_bts *bts; - bts = gsm_bts_alloc(ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(ctx); + bts = gsm_bts_alloc(g_bts_sm, 0); /* Signalling shall be supported regardless of the features */ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm, diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index af8accc..05013d0 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -22,6 +22,7 @@ #include <osmocom/core/application.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/logging.h> #include <osmo-bts/paging.h> #include <osmo-bts/gsm_data.h> @@ -184,7 +185,12 @@ osmo_init_logging2(tall_bts_ctx, &bts_log_info); - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) { + fprintf(stderr, "Failed to create BTS Site Manager structure\n"); + exit(1); + } + bts = gsm_bts_alloc(g_bts_sm, 0); if (bts_init(bts) < 0) { fprintf(stderr, "unable to open bts\n"); exit(1); diff --git a/tests/tx_power/tx_power_test.c b/tests/tx_power/tx_power_test.c index 3724f56..937d7f8 100644 --- a/tests/tx_power/tx_power_test.c +++ b/tests/tx_power/tx_power_test.c @@ -28,6 +28,7 @@ #include <osmo-bts/gsm_data.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_sm.h> #include <osmo-bts/logging.h> #include <osmo-bts/tx_power.h> @@ -252,7 +253,12 @@ log_set_print_category(osmo_stderr_target, 0); log_set_print_category_hex(osmo_stderr_target, 0); - bts = gsm_bts_alloc(tall_bts_ctx, 0); + g_bts_sm = gsm_bts_sm_alloc(tall_bts_ctx); + if (!g_bts_sm) { + fprintf(stderr, "Failed to create BTS Site Manager structure\n"); + exit(1); + } + bts = gsm_bts_alloc(g_bts_sm, 0); if (!bts) { fprintf(stderr, "Failed to create BTS structure\n"); exit(1); -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32236 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ideb0d458ec631008223f861cf8b46d09524a1a21 Gerrit-Change-Number: 32236 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by dexter 06 Apr '23

06 Apr '23
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 to look at the new patch set (#4). Change subject: mgcp_codec: fix codec decision ...................................................................... mgcp_codec: fix codec decision Unfortunately OsmoMGW was never really tested with multiple different codecs on either side of the connection. While OsmoMSC and OsmoBSC only assign exactly one codec on each side this has never been a problem, however it might become a problem when a call againt assigns multiple codecs on one side. This has been observed in a setup where OsmoMGW had one leg towards an external call agent. Also due to recent upgrades to the TTCN3 tests we are now able to simulate different codecs on both sides to pinpoint issues. Testing has shown that OsmoMGW has difficulties with multiple codecs. The reason for this is that the function that makes the codec decision was not fully finished. So let's finish the codec decision function and let's also use that decision when patching the payload type of outgoing RTP packets. Related: OS#5461 Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 --- M include/osmocom/mgcp/mgcp_codec.h M include/osmocom/mgcp/mgcp_trunk.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 8 files changed, 287 insertions(+), 266 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/32218/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • ...
  • 226
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.