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

February 2023

  • 1 participants
  • 2601 discussions
[M] Change in osmo-bsc[master]: bssmap_handle_ass_req_ct_speech: refactor
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31543 ) Change subject: bssmap_handle_ass_req_ct_speech: refactor ...................................................................... bssmap_handle_ass_req_ct_speech: refactor Move the translation from osmo_sockaddr_to_str_and_uint into bssmap_handle_ass_req_tp_rtp_addr, which will be used by bssmap_handle_ass_req_ct_data in a future patch too. Pass pointers to variables in req, instead of duplicating variables and filling it in later (like in bssmap_handle_ass_req_ct_sign). Related: OS#4393 Change-Id: I6bb16b26d89056dffa50bd8296fefe9315c587ca --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 43 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/43/31543/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 1a7c56e..c8083e1 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -814,10 +814,12 @@ return 0; } -static int bssmap_handle_ass_req_tp_rtp_addr(struct tlv_parsed *tp, bool aoip, struct sockaddr_storage *rtp_addr, - uint8_t *cause) +static int bssmap_handle_ass_req_tp_rtp_addr(struct tlv_parsed *tp, bool aoip, char *msc_rtp_addr, + size_t msc_rtp_addr_len, uint16_t *msc_rtp_port, uint8_t *cause) { + struct sockaddr_storage rtp_addr; int rc; + unsigned int rc2; if (TLVP_PRESENT(tp, GSM0808_IE_AOIP_TRASP_ADDR)) { if (!aoip) { @@ -827,7 +829,7 @@ return -1; } /* Decode AoIP transport address element */ - rc = gsm0808_dec_aoip_trasp_addr(rtp_addr, + rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, TLVP_VAL(tp, GSM0808_IE_AOIP_TRASP_ADDR), TLVP_LEN(tp, GSM0808_IE_AOIP_TRASP_ADDR)); if (rc < 0) { @@ -835,6 +837,14 @@ *cause = GSM0808_CAUSE_INCORRECT_VALUE; return -1; } + + rc2 = osmo_sockaddr_to_str_and_uint(msc_rtp_addr, msc_rtp_addr_len, msc_rtp_port, + (const struct sockaddr *)&rtp_addr); + if (!rc2 || rc >= msc_rtp_addr_len) { + LOGP(DMSC, LOGL_ERROR, "Assignment request: RTP address is too long\n"); + *cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; + return -1; + } return 0; } @@ -918,33 +928,26 @@ struct gsm0808_channel_type *ct, struct assignment_request *req, uint8_t *cause) { - uint16_t cic = 0; bool aoip = gscon_is_aoip(conn); - bool use_osmux = false; - uint8_t osmux_cid = 0; - struct sockaddr_storage rtp_addr; int rc; - if (bssmap_handle_ass_req_tp_cic(tp, aoip, &cic, cause) < 0) - return -1; - - if (bssmap_handle_ass_req_tp_rtp_addr(tp, aoip, &rtp_addr, cause) < 0) - return -1; - - if (bssmap_handle_ass_req_tp_osmux(conn, tp, &use_osmux, &osmux_cid, cause) < 0) - return -1; - - if (bssmap_handle_ass_req_tp_codec_list(conn, tp, aoip, cause) < 0) - return -1; - *req = (struct assignment_request){ .assign_for = ASSIGN_FOR_BSSMAP_REQ, .aoip = aoip, - .msc_assigned_cic = cic, - .use_osmux = use_osmux, - .osmux_cid = osmux_cid, }; + if (bssmap_handle_ass_req_tp_cic(tp, aoip, &req->msc_assigned_cic, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_rtp_addr(tp, aoip, req->msc_rtp_addr, sizeof(req->msc_rtp_addr), &req->msc_rtp_port, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_osmux(conn, tp, &req->use_osmux, &req->osmux_cid, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_codec_list(conn, tp, aoip, cause) < 0) + return -1; + /* Match codec information from the assignment command against the * local preferences of the BSC and BTS */ rc = select_codecs(req, ct, conn); @@ -953,18 +956,6 @@ return -1; } - if (aoip) { - unsigned int rc = osmo_sockaddr_to_str_and_uint(req->msc_rtp_addr, - sizeof(req->msc_rtp_addr), - &req->msc_rtp_port, - (const struct sockaddr *)&rtp_addr); - if (!rc || rc >= sizeof(req->msc_rtp_addr)) { - LOGP(DMSC, LOGL_ERROR, "Assignment request: RTP address is too long\n"); - *cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; - return -1; - } - } - return 0; } @@ -1000,7 +991,7 @@ struct gsm0808_channel_type ct; uint8_t cause; int rc; - struct assignment_request req = {}; + struct assignment_request req; if (!conn) { LOGP(DMSC, LOGL_ERROR, -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31543 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I6bb16b26d89056dffa50bd8296fefe9315c587ca Gerrit-Change-Number: 31543 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: bssmap_handle_ass_req_ct_speech: split up
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31542 ) Change subject: bssmap_handle_ass_req_ct_speech: split up ...................................................................... bssmap_handle_ass_req_ct_speech: split up Allow reusing common code in an upcoming bssmap_handle_ass_req_ct_data. It won't use _osmux for now (maybe in the future?), but splitting it out as well makes it consistent. Related: OS#4393 Change-Id: I4d9a4df314b1e56b9c1f90c9d7914332b70b56f8 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 92 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/42/31542/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index d0ff1cf..1a7c56e 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -796,28 +796,29 @@ return nc > 0 ? 0 : -EINVAL; } -static int bssmap_handle_ass_req_ct_speech(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, - struct gsm0808_channel_type *ct, struct assignment_request *req, - uint8_t *cause) +static int bssmap_handle_ass_req_tp_cic(struct tlv_parsed *tp, bool aoip, uint16_t *cic, uint8_t *cause) { - uint16_t cic = 0; - bool aoip = gscon_is_aoip(conn); - bool use_osmux = false; - uint8_t osmux_cid = 0; - struct sockaddr_storage rtp_addr; - int rc; - if (TLVP_PRESENT(tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) { /* CIC is permitted in both AoIP and SCCPlite */ - cic = osmo_load16be(TLVP_VAL(tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)); - } else { - if (!aoip) { - /* no CIC but SCCPlite: illegal */ - LOGP(DMSC, LOGL_ERROR, "SCCPlite MSC, but no CIC in ASSIGN REQ?\n"); - *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; - return -1; - } + *cic = osmo_load16be(TLVP_VAL(tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)); + return 0; } + + if (!aoip) { + /* no CIC but SCCPlite: illegal */ + LOGP(DMSC, LOGL_ERROR, "SCCPlite MSC, but no CIC in ASSIGN REQ?\n"); + *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; + return -1; + } + + return 0; +} + +static int bssmap_handle_ass_req_tp_rtp_addr(struct tlv_parsed *tp, bool aoip, struct sockaddr_storage *rtp_addr, + uint8_t *cause) +{ + int rc; + if (TLVP_PRESENT(tp, GSM0808_IE_AOIP_TRASP_ADDR)) { if (!aoip) { /* SCCPlite and AoIP transport address: illegal */ @@ -826,7 +827,7 @@ return -1; } /* Decode AoIP transport address element */ - rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, + rc = gsm0808_dec_aoip_trasp_addr(rtp_addr, TLVP_VAL(tp, GSM0808_IE_AOIP_TRASP_ADDR), TLVP_LEN(tp, GSM0808_IE_AOIP_TRASP_ADDR)); if (rc < 0) { @@ -834,7 +835,10 @@ *cause = GSM0808_CAUSE_INCORRECT_VALUE; return -1; } - } else if (aoip) { + return 0; + } + + if (aoip) { /* no AoIP transport level address but AoIP transport: illegal */ LOGP(DMSC, LOGL_ERROR, "AoIP transport address missing in ASSIGN REQ, " "audio would not work; rejecting\n"); @@ -842,14 +846,22 @@ return -1; } + return 0; +} + +static int bssmap_handle_ass_req_tp_osmux(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, + bool *use_osmux, uint8_t *osmux_cid, uint8_t *cause) +{ + int rc; + if (TLVP_PRESENT(tp, GSM0808_IE_OSMO_OSMUX_CID)) { if (conn->sccp.msc->use_osmux == OSMUX_USAGE_OFF) { LOGP(DMSC, LOGL_ERROR, "MSC using Osmux but we have it disabled.\n"); *cause = GSM0808_CAUSE_INCORRECT_VALUE; return -1; } - use_osmux = true; - rc = gsm0808_dec_osmux_cid(&osmux_cid, + *use_osmux = true; + rc = gsm0808_dec_osmux_cid(osmux_cid, TLVP_VAL(tp, GSM0808_IE_OSMO_OSMUX_CID), TLVP_LEN(tp, GSM0808_IE_OSMO_OSMUX_CID)); if (rc < 0) { @@ -857,15 +869,26 @@ *cause = GSM0808_CAUSE_INCORRECT_VALUE; return -1; } - } else { - if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ONLY) { - LOGP(DMSC, LOGL_ERROR, "MSC not using Osmux but we are forced to use it.\n"); - *cause = GSM0808_CAUSE_INCORRECT_VALUE; - return -1; - } else if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ON) - LOGP(DMSC, LOGL_NOTICE, "MSC not using Osmux but we have Osmux enabled.\n"); + return 0; } + if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ONLY) { + LOGP(DMSC, LOGL_ERROR, "MSC not using Osmux but we are forced to use it.\n"); + *cause = GSM0808_CAUSE_INCORRECT_VALUE; + return -1; + } + + if (conn->sccp.msc->use_osmux == OSMUX_USAGE_ON) + LOGP(DMSC, LOGL_NOTICE, "MSC not using Osmux but we have Osmux enabled.\n"); + + return 0; +} + +static int bssmap_handle_ass_req_tp_codec_list(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, bool aoip, + uint8_t *cause) +{ + int rc; + /* Decode speech codec list. First set len = 0. */ conn->codec_list = (struct gsm0808_speech_codec_list){}; /* Check for speech codec list element */ @@ -888,6 +911,32 @@ return -1; } + return 0; +} + +static int bssmap_handle_ass_req_ct_speech(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, + struct gsm0808_channel_type *ct, struct assignment_request *req, + uint8_t *cause) +{ + uint16_t cic = 0; + bool aoip = gscon_is_aoip(conn); + bool use_osmux = false; + uint8_t osmux_cid = 0; + struct sockaddr_storage rtp_addr; + int rc; + + if (bssmap_handle_ass_req_tp_cic(tp, aoip, &cic, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_rtp_addr(tp, aoip, &rtp_addr, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_osmux(conn, tp, &use_osmux, &osmux_cid, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_codec_list(conn, tp, aoip, cause) < 0) + return -1; + *req = (struct assignment_request){ .assign_for = ASSIGN_FOR_BSSMAP_REQ, .aoip = aoip, -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31542 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I4d9a4df314b1e56b9c1f90c9d7914332b70b56f8 Gerrit-Change-Number: 31542 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: lchan.h: remove enum lchan_csd_mode
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31545 ) Change subject: lchan.h: remove enum lchan_csd_mode ...................................................................... lchan.h: remove enum lchan_csd_mode It looks like the idea was to translate the CSD rate from BSSAP to lchan_csd_mode before translating it to RSL. But instead we can just directly translate the BSSAP value to the RSL value. The previous code was not used yet (nothing wrote to csd_mode). Related: OS#4393 Change-Id: Ice914744da3a2084e82d125848fb69404b8e8a36 --- M include/osmocom/bsc/lchan.h M src/osmo-bsc/abis_rsl.c 2 files changed, 24 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/31545/1 diff --git a/include/osmocom/bsc/lchan.h b/include/osmocom/bsc/lchan.h index 4fcfa20..1fd1771 100644 --- a/include/osmocom/bsc/lchan.h +++ b/include/osmocom/bsc/lchan.h @@ -44,24 +44,14 @@ enum channel_rate chan_t_to_chan_rate(enum gsm_chan_t chan_t); -enum lchan_csd_mode { - LCHAN_CSD_M_NT, - LCHAN_CSD_M_T_1200_75, - LCHAN_CSD_M_T_600, - LCHAN_CSD_M_T_1200, - LCHAN_CSD_M_T_2400, - LCHAN_CSD_M_T_9600, - LCHAN_CSD_M_T_14400, - LCHAN_CSD_M_T_29000, - LCHAN_CSD_M_T_32000, -}; - struct channel_mode_and_rate { enum gsm48_chan_mode chan_mode; enum channel_rate chan_rate; uint16_t s15_s0; - /* only used for GSM48_CMODE_DATA_* */ - enum lchan_csd_mode csd_mode; + /* only used for GSM48_CMODE_DATA_*, + * see 3GPP TS 48.058 § 9.3.6 Channel Mode octet 6 */ + bool data_transparent; + uint8_t data_rate; }; /* Channel Request reason */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index ee2e2d3..f92de5e 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -460,55 +460,10 @@ case GSM48_CMODE_DATA_14k5: case GSM48_CMODE_DATA_12k0: case GSM48_CMODE_DATA_6k0: - switch (ch_mode_rate->csd_mode) { - case LCHAN_CSD_M_NT: - /* non-transparent CSD with RLP */ - switch (ch_mode_rate->chan_mode) { - case GSM48_CMODE_DATA_14k5: - cm->chan_rate = RSL_CMOD_SP_NT_14k5; - break; - case GSM48_CMODE_DATA_12k0: - cm->chan_rate = RSL_CMOD_SP_NT_12k0; - break; - case GSM48_CMODE_DATA_6k0: - cm->chan_rate = RSL_CMOD_SP_NT_6k0; - break; - default: - LOGP(DRSL, LOGL_ERROR, - "unsupported lchan->tch_mode %u\n", - ch_mode_rate->chan_mode); - return -EINVAL; - } - break; - /* transparent data services below */ - case LCHAN_CSD_M_T_1200_75: - cm->chan_rate = RSL_CMOD_CSD_T_1200_75; - break; - case LCHAN_CSD_M_T_600: - cm->chan_rate = RSL_CMOD_CSD_T_600; - break; - case LCHAN_CSD_M_T_1200: - cm->chan_rate = RSL_CMOD_CSD_T_1200; - break; - case LCHAN_CSD_M_T_2400: - cm->chan_rate = RSL_CMOD_CSD_T_2400; - break; - case LCHAN_CSD_M_T_9600: - cm->chan_rate = RSL_CMOD_CSD_T_9600; - break; - case LCHAN_CSD_M_T_14400: - cm->chan_rate = RSL_CMOD_CSD_T_14400; - break; - case LCHAN_CSD_M_T_29000: - cm->chan_rate = RSL_CMOD_CSD_T_29000; - break; - case LCHAN_CSD_M_T_32000: - cm->chan_rate = RSL_CMOD_CSD_T_32000; - break; - default: - LOGP(DRSL, LOGL_ERROR, "unsupported csd_mode %u\n", ch_mode_rate->csd_mode); - return -EINVAL; - } + /* 3GPP TS 48.058 § 9.3.6 Channel Mode octet 6 */ + cm->chan_rate = ch_mode_rate->data_rate; + if (!ch_mode_rate->data_transparent) + cm->chan_rate |= 0x40; break; default: LOGP(DRSL, LOGL_ERROR, "unsupported channel mode %u\n", ch_mode_rate->chan_mode); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ice914744da3a2084e82d125848fb69404b8e8a36 Gerrit-Change-Number: 31545 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: channel_mode_from_lchan: add GSM48_CMODE_DATA_3k6
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31546 ) Change subject: channel_mode_from_lchan: add GSM48_CMODE_DATA_3k6 ...................................................................... channel_mode_from_lchan: add GSM48_CMODE_DATA_3k6 Related: OS#4393 Change-Id: Id9ec34f77c96d3a209c6f78d2addf1ea0dfa228d --- M src/osmo-bsc/abis_rsl.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/31546/1 diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index f92de5e..6d1dbf2 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -460,6 +460,7 @@ case GSM48_CMODE_DATA_14k5: case GSM48_CMODE_DATA_12k0: case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: /* 3GPP TS 48.058 § 9.3.6 Channel Mode octet 6 */ cm->chan_rate = ch_mode_rate->data_rate; if (!ch_mode_rate->data_transparent) -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31546 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Id9ec34f77c96d3a209c6f78d2addf1ea0dfa228d Gerrit-Change-Number: 31546 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: bssmap_handle_ass_req_tp_codec_list: tweak log msg
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31550 ) Change subject: bssmap_handle_ass_req_tp_codec_list: tweak log msg ...................................................................... bssmap_handle_ass_req_tp_codec_list: tweak log msg Remove "speech mode" from the log message, as it is relevant for CSD too. According to 3GPP TS 48.008 § 3.2.1.1 note 13 the IE shall be included for AoIP unless channel type is signalling. Related: OS#4393 Change-Id: Idfab0b7f6e97a6b67d140f967ddfe9b29818586e --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/31550/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 59195ca..5226cbc 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -976,7 +976,7 @@ } if (aoip && !conn->codec_list.len) { - LOGP(DMSC, LOGL_ERROR, "%s: AoIP speech mode Assignment Request:" + LOGP(DMSC, LOGL_ERROR, "%s: AoIP Assignment Request:" " Missing or empty Speech Codec List IE\n", bsc_subscr_name(conn->bsub)); *cause = GSM0808_CAUSE_INFORMATION_ELEMENT_OR_FIELD_MISSING; return -1; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31550 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Idfab0b7f6e97a6b67d140f967ddfe9b29818586e Gerrit-Change-Number: 31550 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31549 ) Change subject: rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD ...................................................................... rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD Omit the A-bis/IP specific RSL_IE_IPAC_SPEECH_MODE, as it doesn't make sense for circuit switched data. Related: OS#4393 Change-Id: I6641b713177276bcf798f08123e1dd2e88ffdce6 --- M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/lchan_rtp_fsm.c 2 files changed, 58 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/31549/1 diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 76b245c..ae0bf31 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2744,16 +2744,25 @@ dh->c.msg_discr = ABIS_RSL_MDISC_IPACCESS; dh->chan_nr = chan_nr; - /* 0x1- == receive-only, 0x-1 == EFR codec */ - msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode); + if (lchan->abis_ip.rtp_payload == RTP_PT_CSDATA) + LOG_LCHAN(lchan, LOGL_DEBUG, + "Sending IPACC CRCX to BTS: RTP_PAYLOAD=%d (CSD) osmux_use=%d osmux_loc_cid=%d\n", + lchan->abis_ip.rtp_payload, + lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid); + else { + /* 0x1- == receive-only, 0x-1 == EFR codec */ + msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode); + + LOG_LCHAN(lchan, LOGL_DEBUG, + "Sending IPACC CRCX to BTS: speech_mode=0x%02x RTP_PAYLOAD=%d osmux_use=%d osmux_loc_cid=%d\n", + lchan->abis_ip.speech_mode, lchan->abis_ip.rtp_payload, + lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid); + } + msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD, lchan->abis_ip.rtp_payload); if (lchan->abis_ip.osmux.use) msgb_tlv_put(msg, RSL_IE_OSMO_OSMUX_CID, 1, &lchan->abis_ip.osmux.local_cid); - LOG_LCHAN(lchan, LOGL_DEBUG, - "Sending IPACC CRCX to BTS: speech_mode=0x%02x RTP_PAYLOAD=%d osmux_use=%d osmux_loc_cid=%d\n", - lchan->abis_ip.speech_mode, lchan->abis_ip.rtp_payload, - lchan->abis_ip.osmux.use, lchan->abis_ip.osmux.local_cid); msg->dst = rsl_chan_link(lchan); @@ -2787,7 +2796,8 @@ att_ip = (uint32_t *)msgb_put(msg, sizeof(uint32_t)); *att_ip = htonl(dest_ip); msgb_tv16_put(msg, RSL_IE_IPAC_REMOTE_PORT, dest_port); - msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode); + if (lchan->abis_ip.rtp_payload != RTP_PT_CSDATA) + msgb_tv_put(msg, RSL_IE_IPAC_SPEECH_MODE, lchan->abis_ip.speech_mode); msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD, lchan->abis_ip.rtp_payload); if (lchan->abis_ip.rtp_payload2) msgb_tv_put(msg, RSL_IE_IPAC_RTP_PAYLOAD2, lchan->abis_ip.rtp_payload2); @@ -2810,14 +2820,23 @@ if (!msg) return -EINVAL; - LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:" - " %s:%u rtp_payload=%u rtp_payload2=%u conn_id=%u speech_mode=0x%02x\n", - ip_to_a(lchan->abis_ip.connect_ip), - lchan->abis_ip.connect_port, - lchan->abis_ip.rtp_payload, - lchan->abis_ip.rtp_payload2, - lchan->abis_ip.conn_id, - lchan->abis_ip.speech_mode); + if (lchan->abis_ip.rtp_payload == RTP_PT_CSDATA) + LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:" + " %s:%u rtp_payload=%u (CSD) rtp_payload2=%u conn_id=%u\n", + ip_to_a(lchan->abis_ip.connect_ip), + lchan->abis_ip.connect_port, + lchan->abis_ip.rtp_payload, + lchan->abis_ip.rtp_payload2, + lchan->abis_ip.conn_id); + else + LOG_LCHAN(lchan, LOGL_DEBUG, "Sending IPACC MDCX to BTS:" + " %s:%u rtp_payload=%u rtp_payload2=%u conn_id=%u speech_mode=0x%02x\n", + ip_to_a(lchan->abis_ip.connect_ip), + lchan->abis_ip.connect_port, + lchan->abis_ip.rtp_payload, + lchan->abis_ip.rtp_payload2, + lchan->abis_ip.conn_id, + lchan->abis_ip.speech_mode); return abis_rsl_sendmsg(msg); } diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 8b61f1e..d128463 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -307,15 +307,6 @@ return; } - val = ipacc_speech_mode(lchan->activate.ch_mode_rate.chan_mode, lchan->type); - if (val < 0) { - lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s", - get_value_string(gsm48_chan_mode_names, lchan->activate.ch_mode_rate.chan_mode), - gsm_chan_t_name(lchan->type)); - return; - } - lchan->abis_ip.speech_mode = val; - val = ipacc_payload_type(lchan->activate.ch_mode_rate.chan_mode, lchan->type); if (val < 0) { lchan_rtp_fail("Cannot determine Abis/IP payload type for tch_mode=%s type=%s", @@ -325,6 +316,17 @@ } lchan->abis_ip.rtp_payload = val; + if (lchan->abis_ip.rtp_payload != RTP_PT_CSDATA) { + val = ipacc_speech_mode(lchan->activate.ch_mode_rate.chan_mode, lchan->type); + if (val < 0) { + lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s", + get_value_string(gsm48_chan_mode_names, lchan->activate.ch_mode_rate.chan_mode), + gsm_chan_t_name(lchan->type)); + return; + } + lchan->abis_ip.speech_mode = val; + } + /* recv-only */ ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31549 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I6641b713177276bcf798f08123e1dd2e88ffdce6 Gerrit-Change-Number: 31549 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: bssmap_handle_ass_req_ct_data: implement
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31547 ) Change subject: bssmap_handle_ass_req_ct_data: implement ...................................................................... bssmap_handle_ass_req_ct_data: implement Handle assignment requests for CSD. In this initial version, the code for non-transparent data mode is a stub. Related: OS#5763 Change-Id: I350bea15fd2158eb6edc9bc92f2dca48930736e9 --- M TODO-RELEASE M include/osmocom/bsc/codec_pref.h M src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c 4 files changed, 235 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/31547/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..d38d67e 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmogsm >1.8.0 circuit switched data stuff (gsm0808_enc/dec_channel_type etc.) diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h index adefe04..5944a4a 100644 --- a/include/osmocom/bsc/codec_pref.h +++ b/include/osmocom/bsc/codec_pref.h @@ -17,6 +17,10 @@ RATE_PREF_FR, }; +int match_codec_pref_data(struct channel_mode_and_rate *ch_mode_rate, + const struct gsm0808_channel_type *ct, + const bool full_rate); + int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, const struct gsm0808_channel_type *ct, const struct gsm0808_speech_codec_list *scl, diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index 0cf98c6..fd369b2 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -87,6 +87,82 @@ } } +static int gsm0808_data_rate_transp_to_gsm0858(enum gsm0808_data_rate_transp rate) +{ + switch (rate) { + case GSM0808_DATA_RATE_TRANSP_32000: + return RSL_CMOD_CSD_T_32000; + case GSM0808_DATA_RATE_TRANSP_28800: + return RSL_CMOD_CSD_T_29000; + case GSM0808_DATA_RATE_TRANSP_14400: + return RSL_CMOD_CSD_T_14400; + case GSM0808_DATA_RATE_TRANSP_09600: + return RSL_CMOD_CSD_T_9600; + case GSM0808_DATA_RATE_TRANSP_04800: + return RSL_CMOD_CSD_T_4800; + case GSM0808_DATA_RATE_TRANSP_02400: + return RSL_CMOD_CSD_T_2400; + case GSM0808_DATA_RATE_TRANSP_01200: + return RSL_CMOD_CSD_T_1200; + case GSM0808_DATA_RATE_TRANSP_00600: + return RSL_CMOD_CSD_T_600; + case GSM0808_DATA_RATE_TRANSP_01200_75: + return RSL_CMOD_CSD_T_1200_75; + default: + LOGP(DMSC, LOGL_ERROR, "Unsupported transparent data rate 0x%x\n", rate); + return -1; + } +} + +static int gsm0808_data_rate_transp_to_gsm0804(enum gsm0808_data_rate_transp rate) +{ + switch (rate) { + case GSM0808_DATA_RATE_TRANSP_14400: + return GSM48_CMODE_DATA_14k5; + case GSM0808_DATA_RATE_TRANSP_09600: + return GSM48_CMODE_DATA_12k0; + case GSM0808_DATA_RATE_TRANSP_04800: + return GSM48_CMODE_DATA_6k0; + case GSM0808_DATA_RATE_TRANSP_02400: + case GSM0808_DATA_RATE_TRANSP_01200: + case GSM0808_DATA_RATE_TRANSP_00600: + case GSM0808_DATA_RATE_TRANSP_01200_75: + return GSM48_CMODE_DATA_3k6; + default: + LOGP(DMSC, LOGL_ERROR, "Unsupported transparent data rate 0x%x\n", rate); + return -1; + } +} + +static int gsm0808_data_rate_non_transp_to_gsm0804(enum gsm0808_data_rate_non_transp rate) +{ + LOGP(DMSC, LOGL_ERROR, "%s is not implemented\n", __func__); /* FIXME */ + return -1; +} + +static int gsm0808_data_rate_non_transp_to_gsm0858(enum gsm0808_data_rate_non_transp rate, bool full_rate) +{ + switch (rate) { + case GSM0808_DATA_RATE_NON_TRANSP_12000_6000: + if (full_rate) + return RSL_CMOD_CSD_NT_12k0; + return RSL_CMOD_CSD_NT_6k0; + case GSM0808_DATA_RATE_NON_TRANSP_14500: + return RSL_CMOD_CSD_NT_14k5; + case GSM0808_DATA_RATE_NON_TRANSP_12000: + return RSL_CMOD_CSD_NT_12k0; + case GSM0808_DATA_RATE_NON_TRANSP_06000: + return RSL_CMOD_CSD_NT_6k0; + case GSM0808_DATA_RATE_NON_TRANSP_43500: + return RSL_CMOD_CSD_NT_43k5; + case GSM0808_DATA_RATE_NON_TRANSP_29000: + return RSL_CMOD_CSD_NT_28k8; + default: + LOGP(DMSC, LOGL_ERROR, "Unsupported non-transparent data rate 0x%x\n", rate); + return -1; + } +} + /* Look up a matching permitted speech value for a given msc audio codec pref */ static enum gsm0808_permitted_speech audio_support_to_gsm88(const struct gsm_audio_support *audio) { @@ -309,6 +385,50 @@ return 0; } +static enum gsm48_chan_mode match_non_transp_data_rate(const struct gsm0808_channel_type *ct, bool full_rate) +{ + /* FIXME: Handle ct->data_rate_allowed too if it is set. Find the best + * match by comparing the preferred ct->data_rate + all allowed + * ct->data_rate_allowed against what's most suitable for the BTS. */ + + return gsm0808_data_rate_non_transp_to_gsm0858(ct->data_rate, full_rate); +} + +/*! Match the codec preferences from local config with codec preference IEs + * received from the MSC and the BTS' codec configuration. + * \param[out] ch_mode_rate resulting codec and rate information + * \param[in] ct GSM 08.08 channel type received from MSC. + * \param[in] full_rate true means FR is preferred, false means HR + * \returns 0 on success, -1 in case no match was found */ +int match_codec_pref_data(struct channel_mode_and_rate *ch_mode_rate, + const struct gsm0808_channel_type *ct, + const bool full_rate) +{ + *ch_mode_rate = (struct channel_mode_and_rate){}; + ch_mode_rate->chan_rate = full_rate ? CH_RATE_FULL : CH_RATE_HALF; + ch_mode_rate->data_transparent = ct->data_transparent; + + if (ct->data_transparent) { + ch_mode_rate->data_rate = gsm0808_data_rate_transp_to_gsm0858(ct->data_rate); + if (ch_mode_rate->data_rate == -1) + return -1; + + ch_mode_rate->chan_mode = gsm0808_data_rate_transp_to_gsm0804(ct->data_rate); + if (ch_mode_rate->chan_mode == -1) + return -1; + } else { + ch_mode_rate->data_rate = match_non_transp_data_rate(ct, full_rate); + if (ch_mode_rate->data_rate == -1) + return -1; + + ch_mode_rate->chan_mode = gsm0808_data_rate_non_transp_to_gsm0804(ct->data_rate); + if (ch_mode_rate->chan_mode == -1) + return -1; + } + + return 0; +} + /*! Match the codec preferences from local config with codec preference IEs * received from the MSC and the BTS' codec configuration. * \param[out] ch_mode_rate resulting codec and rate information diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c8083e1..59195ca 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -674,6 +674,67 @@ * lchan is requested. The preferred lchan will be requested first. If we * find an alternate setting here, this one will be tried secondly if our * primary choice fails. */ +static int select_codecs_data(struct assignment_request *req, struct gsm0808_channel_type *ct, + struct gsm_subscriber_connection *conn) +{ + int rc, i, nc = 0; + + switch (ct->ch_rate_type) { + case GSM0808_DATA_FULL_BM: + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, true); + nc += (rc == 0) ? 1 : 0; + break; + case GSM0808_DATA_HALF_LM: + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, false); + nc += (rc == 0) ? 1 : 0; + break; + case GSM0808_DATA_FULL_PREF_NO_CHANGE: + case GSM0808_DATA_FULL_PREF: + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, true); + nc += (rc == 0) ? 1 : 0; + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, false); + nc += (rc == 0) ? 1 : 0; + break; + case GSM0808_DATA_HALF_PREF_NO_CHANGE: + case GSM0808_DATA_HALF_PREF: + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, false); + nc += (rc == 0) ? 1 : 0; + rc = match_codec_pref_data(&req->ch_mode_rate_list[nc], ct, true); + nc += (rc == 0) ? 1 : 0; + break; + default: + rc = -EINVAL; + break; + } + + if (!nc) { + LOGP(DMSC, LOGL_ERROR, "No supported data codec found for channel_type =" + " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[%s] }\n", + ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); + return -EINVAL; + } + + for (i = 0; i < nc; i++) { + DEBUGP(DMSC, "Found matching data codec (pref=%d): %s %s for channel_type =" + " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", + i, + req->ch_mode_rate_list[i].chan_rate == CH_RATE_FULL ? "full rate" : "half rate", + get_value_string(gsm48_chan_mode_names, req->ch_mode_rate_list[i].chan_mode), + ct->ch_indctr, ct->ch_rate_type, osmo_hexdump(ct->perm_spch, ct->perm_spch_len)); + } + + req->n_ch_mode_rate = nc; + + return 0; +} + +/* Select a preferred and an alternative codec rate depending on the available + * capabilities. This decision does not include the actual channel load yet, + * this is also the reason why the result is a preferred and an alternate + * setting. The final decision is made in assignment_fsm.c when the actual + * lchan is requested. The preferred lchan will be requested first. If we + * find an alternate setting here, this one will be tried secondly if our + * primary choice fails. */ static int select_codecs(struct assignment_request *req, struct gsm0808_channel_type *ct, struct gsm_subscriber_connection *conn) { @@ -924,6 +985,38 @@ return 0; } +static int bssmap_handle_ass_req_ct_data(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, + struct gsm0808_channel_type *ct, struct assignment_request *req, + uint8_t *cause) +{ + bool aoip = gscon_is_aoip(conn); + int rc; + + *req = (struct assignment_request){ + .assign_for = ASSIGN_FOR_BSSMAP_REQ, + .aoip = aoip, + }; + + if (bssmap_handle_ass_req_tp_cic(tp, aoip, &req->msc_assigned_cic, cause) < 0) + return -1; + + if (bssmap_handle_ass_req_tp_rtp_addr(tp, aoip, req->msc_rtp_addr, sizeof(req->msc_rtp_addr), &req->msc_rtp_port, cause) < 0) + return -1; + + /* According to 3GPP TS 48.008 § 3.2.1.1 note 13, the codec list IE + * shall be included for aoip unless channel type is signalling. */ + if (bssmap_handle_ass_req_tp_codec_list(conn, tp, aoip, cause) < 0) + return -1; + + rc = select_codecs_data(req, ct, conn); + if (rc < 0) { + *cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL; + return -1; + } + + return 0; +} + static int bssmap_handle_ass_req_ct_speech(struct gsm_subscriber_connection *conn, struct tlv_parsed *tp, struct gsm0808_channel_type *ct, struct assignment_request *req, uint8_t *cause) @@ -1023,12 +1116,12 @@ bssmap_handle_ass_req_lcls(conn, &tp); /* Currently we only support a limited subset of all - * possible channel types, such as multi-slot or CSD */ + * possible channel types, such as multi-slot */ switch (ct.ch_indctr) { case GSM0808_CHAN_DATA: - LOGP(DMSC, LOGL_ERROR, "Unsupported channel type, currently only speech is supported!\n"); - cause = GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP; - goto reject; + if (bssmap_handle_ass_req_ct_data(conn, &tp, &ct, &req, &cause) < 0) + goto reject; + break; case GSM0808_CHAN_SPEECH: if (bssmap_handle_ass_req_ct_speech(conn, &tp, &ct, &req, &cause) < 0) goto reject; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31547 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I350bea15fd2158eb6edc9bc92f2dca48930736e9 Gerrit-Change-Number: 31547 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: abis_rsl: ipacc_payload_type: handle CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31548 ) Change subject: abis_rsl: ipacc_payload_type: handle CSD ...................................................................... abis_rsl: ipacc_payload_type: handle CSD Depends: libsmo-abis Ibf0bfb577faa5c82e10706b42ede8b72dd611655 Change-Id: Ie561d87ecdc161b9a69eb7683889f0395524faa8 --- M TODO-RELEASE M src/osmo-bsc/abis_rsl.c 2 files changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/31548/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d38d67e..0d04a57 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmogsm >1.8.0 circuit switched data stuff (gsm0808_enc/dec_channel_type etc.) +libosmo-abis >1.4.0 osmo_ortp.h: add RTP_PT_CSDATA diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 6d1dbf2..76b245c 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2624,6 +2624,11 @@ int ipacc_payload_type(enum gsm48_chan_mode tch_mode, enum gsm_chan_t type) { switch (gsm48_chan_mode_to_non_vamos(tch_mode)) { + case GSM48_CMODE_DATA_14k5: + case GSM48_CMODE_DATA_12k0: + case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: + return RTP_PT_CSDATA; case GSM48_CMODE_SPEECH_V1: switch (type) { case GSM_LCHAN_TCH_F: -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31548 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ie561d87ecdc161b9a69eb7683889f0395524faa8 Gerrit-Change-Number: 31548 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: assignment_fsm: chan mode check: support CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31551 ) Change subject: assignment_fsm: chan mode check: support CSD ...................................................................... assignment_fsm: chan mode check: support CSD Replace check_requires_voice_stream, which used to iterate over ch_mode_rate_list and verify that all entries are either for speech or signalling. Instead verify in check_chan_mode_rate_against_ch_indctr, that all entries of ch_mode_rate_list have a chan_mode that matches the ch_indctr (data, speech, signalling; called "speech / data indicator" in 3GPP TS 48.008 § 3.2.2.11). This ensures that all of them are either data, speech or signalling and not mixed. Related: OS#4393 Change-Id: Iee5cbfee84d7f2ad59ee2d5a19891a2b59bbafff --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/osmo_bsc_bssap.c 3 files changed, 49 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/51/31551/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 8c4dcce..b77a16e 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -163,6 +163,9 @@ /* The TSC to use if 'use' is true, otherwise automatically determine the TSC value to use. Valid range is 0 to * 7, as described in 3GPP TS 45.002. */ struct optional_val tsc; + + /* The "speech / data indicator" from 3GPP TS 48.008 § 3.2.2.11 Channel Type (speech/data/signalling). */ + enum gsm0808_chan_indicator ch_indctr; }; /* State of an ongoing Assignment, while the assignment_fsm is still busy. This serves as state separation to keep the diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index d382f10..d23d726 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -369,62 +369,53 @@ OSMO_ASSERT(osmo_fsm_register(&assignment_fsm) == 0); } -static int check_requires_voice(bool *requires_voice, enum gsm48_chan_mode chan_mode) +static int chan_mode_to_ch_indctr(enum gsm48_chan_mode chan_mode) { - *requires_voice = false; - switch (gsm48_chan_mode_to_non_vamos(chan_mode)) { + case GSM48_CMODE_DATA_14k5: + case GSM48_CMODE_DATA_12k0: + case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: + return GSM0808_CHAN_DATA; case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_EFR: case GSM48_CMODE_SPEECH_AMR: - *requires_voice = true; - break; + return GSM0808_CHAN_SPEECH; case GSM48_CMODE_SIGN: - *requires_voice = false; - break; + return GSM0808_CHAN_SIGN; default: return -EINVAL; } - - return 0; } -/* Check if the incoming assignment request requires a voice stream or not, - * we will look at the preferred and the alternate channel mode and also make - * sure that both are consistent. */ -static int check_requires_voice_stream(struct gsm_subscriber_connection *conn) +/* Check if the incoming assignment request has a channel mode that is + * inconsistent with ch_indctr, e.g. GSM48_CMODE_DATA_14k5 and + * GSM0808_CHAN_SPEECH */ +static int check_chan_mode_rate_against_ch_indctr(struct gsm_subscriber_connection *conn) { - bool requires_voice_pref = false, requires_voice_alt; struct assignment_request *req = &conn->assignment.req; struct osmo_fsm_inst *fi = conn->fi; - int i, rc; - - /* When the assignment request indicates that there is an alternate - * rate available (e.g. "Full or Half rate channel, Half rate - * preferred..."), then both must be either voice or either signalling, - * a mismatch is not permitted */ + int i; + uint8_t ch_indctr; for (i = 0; i < req->n_ch_mode_rate; i++) { - rc = check_requires_voice(&requires_voice_alt, req->ch_mode_rate_list[i].chan_mode); - if (rc < 0) { + ch_indctr = chan_mode_to_ch_indctr(req->ch_mode_rate_list[i].chan_mode); + if (ch_indctr < 0) { assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, "Channel mode not supported (prev level %d): %s", i, gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode)); return -EINVAL; } - if (i==0) - requires_voice_pref = requires_voice_alt; - else if (requires_voice_alt != requires_voice_pref) { + if (ch_indctr != req->ch_indctr) { assignment_fail(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_NOT_SUPP, - "Requested a mix of Signalling and non-Signalling channel modes: %s != %s", - gsm48_chan_mode_name(req->ch_mode_rate_list[0].chan_mode), - gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode)); + "Channel mode %s has ch_indctr %d, channel type has ch_indctr %d", + gsm48_chan_mode_name(req->ch_mode_rate_list[i].chan_mode), + ch_indctr, req->ch_indctr); return -EINVAL; } } - conn->assignment.requires_voice_stream = requires_voice_pref; return 0; } @@ -470,6 +461,8 @@ .present = (tsc >= 0), .val = tsc, }, + + .ch_indctr = chan_mode_to_ch_indctr(lchan->current_ch_mode_rate.chan_mode), }; if (to_lchan) @@ -528,10 +521,9 @@ assignment_count(CTR_ASSIGNMENT_ATTEMPTED); - /* Check if we need a voice stream. If yes, set the appropriate struct - * members in conn */ - if (check_requires_voice_stream(conn) < 0) + if (check_chan_mode_rate_against_ch_indctr(conn) < 0) return; + conn->assignment.requires_voice_stream = (req->ch_indctr != GSM0808_CHAN_SIGN); if (!req->target_lchan && reuse_existing_lchan(conn)) { /* The already existing lchan is suitable for this mode */ diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 5226cbc..48f0b87 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -1135,6 +1135,8 @@ goto reject; } + req.ch_indctr = ct.ch_indctr; + return osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_ASSIGNMENT_START, &req); reject: -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31551 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Iee5cbfee84d7f2ad59ee2d5a19891a2b59bbafff Gerrit-Change-Number: 31551 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: lchan_select: chan_mode_to_chan_type: support CSD
by osmith 27 Feb '23

27 Feb '23
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31552 ) Change subject: lchan_select: chan_mode_to_chan_type: support CSD ...................................................................... lchan_select: chan_mode_to_chan_type: support CSD Related: OS#4393 Change-Id: I6b02d7edbf268a7f07134b54a7289529b2485122 --- M src/osmo-bsc/lchan_select.c 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/52/31552/1 diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index 2388e24..1e12d96 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -184,6 +184,10 @@ /* fall through */ case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_AMR: + case GSM48_CMODE_DATA_14k5: + case GSM48_CMODE_DATA_12k0: + case GSM48_CMODE_DATA_6k0: + case GSM48_CMODE_DATA_3k6: switch (chan_rate) { case CH_RATE_HALF: return GSM_LCHAN_TCH_H; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31552 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I6b02d7edbf268a7f07134b54a7289529b2485122 Gerrit-Change-Number: 31552 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • ...
  • 261
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.