This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/20342 )
Change subject: compl l3: cosmetics around Create Layer 3
......................................................................
compl l3: cosmetics around Create Layer 3
Move getting the CGI closer to where it is used.
Use a use_scl pointer to remove a bit of code dup.
Drop logging for tx Compl L3, there is plenty logging later in
osmo_bsc_sigtran_open_conn().
This cosmetically prepares future changes for LCS handling.
Change-Id: If7a7d0fe857797d569968e694bf20818d7472bcd
---
M src/osmo-bsc/gsm_08_08.c
1 file changed, 26 insertions(+), 24 deletions(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index c37b57f..9d22e3f 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -431,8 +431,9 @@
int bsc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg, uint16_t chosen_channel)
{
struct bsc_msc_data *msc;
- struct msgb *resp;
+ struct msgb *create_l3;
struct gsm0808_speech_codec_list scl;
+ struct gsm0808_speech_codec_list *use_scl;
int rc = -2;
struct gsm_bts *bts;
struct osmo_cell_global_id *cgi;
@@ -462,8 +463,6 @@
log_set_context(LOG_CTX_BSC_SUBSCR, conn->bsub);
- LOGP(DMSC, LOGL_INFO, "Tx MSC COMPL L3\n");
-
/* find the MSC link we want to use */
msc = bsc_find_msc(conn, msg, &mi);
if (!msc) {
@@ -477,11 +476,10 @@
goto early_fail;
bts = conn_get_bts(conn);
- cgi = cgi_for_msc(conn->sccp.msc, bts);
-
- if (!bts || !cgi) {
+ if (!bts) {
/* should never happen */
- LOGP(DMSC, LOGL_ERROR, "Compl L3 without lchan\n");
+ LOG_COMPL_L3(pdisc, mtype, LOGL_ERROR, "%s: internal error: Compl L3 without BTS\n",
+ osmo_mobile_identity_to_str_c(OTC_SELECT, &mi));
rc = -1;
goto early_fail;
}
@@ -490,26 +488,30 @@
if (pdisc == GSM48_PDISC_RR && mtype == GSM48_MT_RR_PAG_RESP)
handle_page_resp(conn, msg, &mi);
+ /* Send the Create Layer 3. */
+ use_scl = NULL;
if (gscon_is_aoip(conn)) {
- gen_bss_supported_codec_list(&scl, msc, bts);
+ gen_bss_supported_codec_list(&scl, conn->sccp.msc, bts);
if (scl.len > 0)
- resp = gsm0808_create_layer3_2(msg, cgi, &scl);
- else {
- /* Note: 3GPP TS 48.008 3.2.1.32, COMPLETE LAYER 3 INFORMATION clearly states that
- * Codec List (BSS Supported) shall be included, if the radio access network
- * supports an IP based user plane interface. It may be intentional that the
- * current configuration does not support any voice codecs, in those cases the
- * network does not support an IP based user plane interface, and therefore the
- * Codec List (BSS Supported) IE can be left out in those situations. */
- resp = gsm0808_create_layer3_2(msg, cgi, NULL);
- }
- } else
- resp = gsm0808_create_layer3_2(msg, cgi, NULL);
+ use_scl = &scl;
+ /* For AoIP, we should always pass a Codec List (BSS Supported). But osmo-bsc may be configured to
+ * support no voice codecs -- then omit the Codec List. */
+ }
+ cgi = cgi_for_msc(conn->sccp.msc, bts);
+ if (!cgi) {
+ /* should never happen */
+ LOG_COMPL_L3(pdisc, mtype, LOGL_ERROR, "%s: internal error: BTS without identity\n",
+ osmo_mobile_identity_to_str_c(OTC_SELECT, &mi));
+ goto early_fail;
+ }
+ create_l3 = gsm0808_create_layer3_2(msg, cgi, use_scl);
+ if (!create_l3) {
+ LOG_COMPL_L3(pdisc, mtype, LOGL_ERROR, "%s: Failed to compose Create Layer 3 message\n",
+ osmo_mobile_identity_to_str_c(OTC_SELECT, &mi));
+ goto early_fail;
+ }
+ rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_REQ, create_l3);
- if (resp)
- rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_REQ, resp);
- else
- LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n");
early_fail:
log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
return rc;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/20342
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If7a7d0fe857797d569968e694bf20818d7472bcd
Gerrit-Change-Number: 20342
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201007/d3bdbf0a/attachment.htm>