diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2018-05-12 02:04:53 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2018-11-05 05:13:57 +0000 |
commit | 219ed20cb5cbda05d5480d7486b228b994e50b9d (patch) | |
tree | 34629be7f718d39c3a11614d4cd2222469009b11 /src/target/firmware/layer1 | |
parent | d350e9f30c3b5f77363124308dfdfbc0ef3bd35c (diff) |
l1ctl_proto.h: use flexible array member for traffic messages
Unlike the DATA messages, traffic frames may have different length.
Instead of having fixed payload (i.e. TCH frame) length, let's
introduce a flexible array member. This would allow one to
calculate the frame length using the MSGB API.
Change-Id: I119fa36c84e95c3003d57c19e25f8146ed45c3c6
Diffstat (limited to 'src/target/firmware/layer1')
-rw-r--r-- | src/target/firmware/layer1/prim_tch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/target/firmware/layer1/prim_tch.c b/src/target/firmware/layer1/prim_tch.c index 2dadaaf4..a8036d2f 100644 --- a/src/target/firmware/layer1/prim_tch.c +++ b/src/target/firmware/layer1/prim_tch.c @@ -338,6 +338,7 @@ static int l1s_tch_resp(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3) struct msgb *msg; struct l1ctl_info_dl *dl; struct l1ctl_traffic_ind *ti; + uint8_t *payload; /* Allocate msgb */ /* FIXME: we actually want all allocation out of L1S! */ @@ -349,15 +350,16 @@ static int l1s_tch_resp(__unused uint8_t p1, __unused uint8_t p2, uint16_t p3) dl = (struct l1ctl_info_dl *) msgb_put(msg, sizeof(*dl)); ti = (struct l1ctl_traffic_ind *) msgb_put(msg, sizeof(*ti)); + payload = (uint8_t *) msgb_put(msg, 33); /* Copy actual data, skipping the information block [0,1,2] */ - dsp_memcpy_from_api(ti->data, &traffic_buf[3], 33, 1); + dsp_memcpy_from_api(payload, &traffic_buf[3], 33, 1); /** * Perform some bit conversations * FIXME: what about other (than FR) codecs? */ - tch_fr_bit_magic(ti, 1); + tch_fr_bit_magic(payload, 1); /* Give message to up layer */ l1_queue_for_l2(msg); |