diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-04-05 00:41:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-04-05 00:41:35 +0200 |
commit | a0970249bf4f29f2028b042e2d7229a54ea10e42 (patch) | |
tree | 62749cdcf778833e9469b31a5bd6f2051df94ccb /src/osmo-bts-sysmo/l1_if.c | |
parent | f4d14b3f2ea3d9e98613b7d60fed6f6c0645ba14 (diff) |
osmo-bts-sysmo: Add gsmtap for uplink
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 22b465c3..b1789608 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -113,6 +113,34 @@ static void tx_to_gsmtap(struct femtol1_hdl *fl1h, struct msgb *msg) } } +static void ul_to_gsmtap(struct femtol1_hdl *fl1h, struct msgb *msg) +{ + struct gsm_bts_trx *trx = fl1h->priv; + GsmL1_Prim_t *l1p = msgb_l1prim(msg); + GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; + + if (fl1h->gsmtap) { + uint8_t ss, chan_type; + if (data_ind->subCh == 0x1f) + ss = 0; + else + ss = data_ind->subCh; + + if (!(fl1h->gsmtap_sapi_mask & (1 << data_ind->sapi))) + return; + + chan_type = l1sapi2gsmtap_cht[data_ind->sapi]; + if (chan_type == 255) + return; + + gsmtap_send(fl1h->gsmtap, trx->arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, chan_type, ss, data_ind->u32Fn, + 0, 0, data_ind->msgUnitParam.u8Buffer, + data_ind->msgUnitParam.u8Size); + } +} + + struct wait_l1_conf { struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ @@ -525,6 +553,8 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i struct msgb *msg; int rc = 0; + ul_to_gsmtap(fl1, l1p_msg); + lchan = l1if_hLayer2_to_lchan(fl1->priv, data_ind->hLayer2); if (!lchan) { LOGP(DL1C, LOGL_ERROR, "unable to resolve lchan by hLayer2\n"); |