diff options
author | Max <msuraev@sysmocom.de> | 2016-06-10 15:02:41 +0200 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2016-06-10 15:02:41 +0200 |
commit | f43d24598d5c8769ed94d86e57e7deec8075c93c (patch) | |
tree | fc57e0638020d81a7360aa57b62b3448273f4923 /src/osmo-bts-sysmo/tch.c | |
parent | 9966ec6459d0e8c704f7eca010ba50c3f5953f36 (diff) |
Move to common/ TCH code for adding l1sap header
Move code common for both sysmoBTS and LC15 to common/tch.c to make sure
fix from ef30f50d5d6d5f863fc147d05ccdceb89284934e is applied to both.
Change-Id: I18124f529d3546467a266c04f394150e5466c0c0
Diffstat (limited to 'src/osmo-bts-sysmo/tch.c')
-rw-r--r-- | src/osmo-bts-sysmo/tch.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 2436c061..910c7fea 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -51,6 +51,10 @@ #include "femtobts.h" #include "l1_if.h" +extern int add_l1sap_header(struct gsm_lchan *lchan, struct msgb *rmsg, + struct gsm_bts_trx *trx, uint8_t chan_nr, + uint32_t fn); + /* input octet-aligned, output not octet-aligned */ void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, unsigned int num_nibbles) @@ -595,23 +599,9 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - l1sap->u.tch.fn = data_ind->u32Fn; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(lchan, rmsg, trx, chan_nr, + data_ind->u32Fn); return 0; |