[S] Change in libosmocore[master]: Add support for sending Bter UI frames at lapdm.c
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32933 ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: Add support for sending Bter UI frames at lapdm.c ...................................................................... Add support for sending Bter UI frames at lapdm.c Bter frames may be used on downlink of a main DCCH or SACCH channel. It applies to SAPI 0 and UI frames only. It includes a short layer 2 header with 2 bits only. All other bits are used for the message. The message size is 23 bytes on main DCCH and 21 bytes on SACCH. The length of the L3 messsage is used to distinguish between Bter frames and other (UI) frames. Note that the L3 message header is different, so that the length of the UI frame will determine which header is used. Change-Id: Ia3a25c009d1ff09f83258bdb226a85b81466d7a1 --- M src/gsm/lapdm.c 1 file changed, 31 insertions(+), 6 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index b7f5769..67e53f8 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -1030,6 +1030,7 @@ uint8_t sapi = link_id & 7; struct tlv_parsed tv; int length, ui_bts; + bool use_b_ter; if (!le) { LOGDL(&dl->dl, LOGL_ERROR, "lapdm_datalink without entity error\n"); @@ -1055,8 +1056,10 @@ } msg->l3h = (uint8_t *) TLVP_VAL(&tv, RSL_IE_L3_INFO); length = TLVP_LEN(&tv, RSL_IE_L3_INFO); + /* check for Bter frame */ + use_b_ter = (length == ((link_id & 0x40) ? 21 : 23) && sapi == 0); /* check if the layer3 message length exceeds N201 */ - if (length + ((link_id & 0x40) ? 4 : 2) + !ui_bts > 23) { + if (length + ((link_id & 0x40) ? 4 : 2) + !ui_bts > 23 && !use_b_ter) { LOGDL(&dl->dl, LOGL_ERROR, "frame too large: %d > N201(%d) " "(discarding)\n", length, ((link_id & 0x40) ? 18 : 20) + ui_bts); @@ -1071,11 +1074,14 @@ msgb_trim(msg, length); /* Push L1 + LAPDm header on msgb */ - msg->l2h = msgb_push(msg, 2 + !ui_bts); - msg->l2h[0] = LAPDm_ADDR(LAPDm_LPD_NORMAL, sapi, dl->dl.cr.loc2rem.cmd); - msg->l2h[1] = LAPDm_CTRL_U(LAPDm_U_UI, 0); - if (!ui_bts) - msg->l2h[2] = LAPDm_LEN(length); + if (!use_b_ter) { + msg->l2h = msgb_push(msg, 2 + !ui_bts); + msg->l2h[0] = LAPDm_ADDR(LAPDm_LPD_NORMAL, sapi, dl->dl.cr.loc2rem.cmd); + msg->l2h[1] = LAPDm_CTRL_U(LAPDm_U_UI, 0); + if (!ui_bts) + msg->l2h[2] = LAPDm_LEN(length); + } else + msg->l2h = msg->data; if (link_id & 0x40) { msg->l2h = msgb_push(msg, 2); msg->l2h[0] = le->tx_power; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ia3a25c009d1ff09f83258bdb226a85b81466d7a1 Gerrit-Change-Number: 32933 Gerrit-PatchSet: 18 Gerrit-Owner: jolly <andreas@eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
laforge