summaryrefslogtreecommitdiffstats
path: root/src/host/layer23
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-12-14 04:03:59 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-03-14 22:22:43 +0700
commitd49a748cbbf7d7b5bb77f3d906179da9b462e6d1 (patch)
tree8ad25e1b207893cb28491f8878c70a8981fe8a56 /src/host/layer23
parenta4d255269a7d4e58d2ec0fbb42483495b8c247c9 (diff)
common/l1ctl.c move TCH bit-ordering to the firmware
Previously, TCH frames coming from L1 were reordered to the RTP format. Moreover, the implementation had a few problems: - L1CTL is not the best place for such manipulations; - payloads with other than FR codec were corrupted. Let's use RTP-ordered payloads on the L1CTL interface, performing TCH frame reordering at the firmware. Please note, that actual FR reordering was moved to the firmware as is, without any codec determination. This could be fixed in a separate change. Change-Id: I81ec8ed3c9e72a62b22c1720c299cdc68b733cf1
Diffstat (limited to 'src/host/layer23')
-rw-r--r--src/host/layer23/src/common/l1ctl.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index c90588ea..f4c214d4 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -47,7 +47,6 @@
#include <osmocom/bb/common/l1l2_interface.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/bb/common/logging.h>
-#include <osmocom/codec/codec.h>
extern struct gsmtap_inst *gsmtap_inst;
@@ -71,24 +70,6 @@ static struct msgb *osmo_l1_alloc(uint8_t msg_type)
return msg;
}
-
-static inline int msb_get_bit(uint8_t *buf, int bn)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- return (buf[pos_byte] >> pos_bit) & 1;
-}
-
-static inline void msb_set_bit(uint8_t *buf, int bn, int bit)
-{
- int pos_byte = bn >> 3;
- int pos_bit = 7 - (bn & 7);
-
- buf[pos_byte] |= (bit << pos_bit);
-}
-
-
static int osmo_make_band_arfcn(struct osmocom_ms *ms, uint16_t arfcn)
{
/* TODO: Include the band */
@@ -795,23 +776,12 @@ static int rx_l1_traffic_ind(struct osmocom_ms *ms, struct msgb *msg)
{
struct l1ctl_info_dl *dl;
struct l1ctl_traffic_ind *ti;
- uint8_t fr[33];
- int i, di, si;
/* Header handling */
dl = (struct l1ctl_info_dl *) msg->l1h;
msg->l2h = dl->payload;
ti = (struct l1ctl_traffic_ind *) msg->l2h;
- memset(fr, 0x00, 33);
- fr[0] = 0xd0;
- for (i = 0; i < 260; i++) {
- di = gsm610_bitorder[i];
- si = (i > 181) ? i + 4 : i;
- msb_set_bit(fr, 4 + di, msb_get_bit(ti->data, si));
- }
- memcpy(ti->data, fr, 33);
-
DEBUGP(DL1C, "TRAFFIC IND (%s)\n", osmo_hexdump(ti->data, 33));
/* distribute or drop */
@@ -834,8 +804,6 @@ int l1ctl_tx_traffic_req(struct osmocom_ms *ms, struct msgb *msg,
struct l1ctl_hdr *l1h;
struct l1ctl_info_ul *l1i_ul;
struct l1ctl_traffic_req *tr;
- uint8_t fr[33];
- int i, di, si;
/* Header handling */
tr = (struct l1ctl_traffic_req *) msg->l2h;
@@ -857,13 +825,6 @@ int l1ctl_tx_traffic_req(struct osmocom_ms *ms, struct msgb *msg,
return -EINVAL;
}
- memset(fr, 0x00, 33);
- for (i = 0; i < 260; i++) {
- si = gsm610_bitorder[i];
- di = (i > 181) ? i + 4 : i;
- msb_set_bit(fr, di, msb_get_bit(tr->data, 4 + si));
- }
- memcpy(tr->data, fr, 33);
// printf("TX %s\n", osmo_hexdump(tr->data, 33));
/* prepend uplink info header */