From: Harald Welte Date: Wed, 29 Jun 2011 10:13:51 +0000 (+0200) Subject: LAPDm: Uplink SACCH frames use format B, not format B4 X-Git-Url: http://git.rot13.org/?p=osmocom-bb.git;a=commitdiff_plain;h=7ca604bcd3d635143236458dfeba97829d07b321 LAPDm: Uplink SACCH frames use format B, not format B4 --- diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index 242544d..2679ca0 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -1592,11 +1592,18 @@ static int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, uint8_t cha sapi = 0; } else { if (mctx.link_id & 0x40) { - /* It was received from network on SACCH, thus - * lapdm_fmt must be B4 */ - mctx.lapdm_fmt = LAPDm_FMT_B4; - mctx.n201 = N201_B4; - LOGP(DLLAPDM, LOGL_INFO, "fmt=B4\n"); + /* It was received from network on SACCH */ + + /* If sent by BTS, lapdm_fmt must be B4 */ + if (le->mode == LAPDM_MODE_MS) { + mctx.lapdm_fmt = LAPDm_FMT_B4; + mctx.n201 = N201_B4; + LOGP(DLLAPDM, LOGL_INFO, "fmt=B4\n"); + } else { + mctx.lapdm_fmt = LAPDm_FMT_B; + mctx.n201 = N201_AB_SACCH; + LOGP(DLLAPDM, LOGL_INFO, "fmt=B\n"); + } /* SACCH frames have a two-byte L1 header that * OsmocomBB L1 doesn't strip */ mctx.tx_power_ind = msg->l2h[0] & 0x1f;