Change in libosmo-abis[master]: subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon May 11 17:22:44 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/18177 )

Change subject: subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const
......................................................................

subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const

Change-Id: Ia082b9fddf03d02afd007825a1588a3ef0dbedae
---
M include/osmocom/abis/e1_input.h
M include/osmocom/abis/subchan_demux.h
M src/e1_input.c
M src/subchan_demux.c
M src/trau_frame.c
5 files changed, 7 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved



diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 4362f50..a38bab8 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -273,7 +273,7 @@
 /* configure and initialize one timeslot dedicated to TRAU frames. */
 int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line,
                          int (*trau_rcv_cb)(struct subch_demux *dmx, int ch,
-					uint8_t *data, int len, void *_priv));
+					    const ubit_t *data, int len, void *_priv));
 
 /* configure and initialize one timeslot dedicated to RAW frames */
 int e1inp_ts_config_raw(struct e1inp_ts *ts, struct e1inp_line *line,
diff --git a/include/osmocom/abis/subchan_demux.h b/include/osmocom/abis/subchan_demux.h
index 4e2f464..3978d73 100644
--- a/include/osmocom/abis/subchan_demux.h
+++ b/include/osmocom/abis/subchan_demux.h
@@ -22,6 +22,7 @@
 
 #include <stdint.h>
 #include <osmocom/core/linuxlist.h>
+#include <osmocom/core/bits.h>
 
 /*! \defgroup subchan_demux
  *  \brief E1 sub-channel multiplexer/demultiplexer
@@ -44,7 +45,7 @@
 /*! \brief one subchannel inside the demultplexer */
 struct demux_subch {
 	/*! \brief bit-buffer for output bits */
-	uint8_t out_bitbuf[TRAU_FRAME_BITS];
+	ubit_t out_bitbuf[TRAU_FRAME_BITS];
 	/*! \brief next bit to be written in out_bitbuf */
 	uint16_t out_idx;
 	/*! \brief number of consecutive zeros that we have received (for sync) */
@@ -61,7 +62,7 @@
 	struct demux_subch subch[NR_SUBCH];
 	/*! \brief callback to be called once we have received a
 	 *  complete frame on a given subchannel */
-	int (*out_cb)(struct subch_demux *dmx, int ch, uint8_t *data, int len,
+	int (*out_cb)(struct subch_demux *dmx, int ch, const ubit_t *data, int len,
 		      void *);
 	/*! \brief user-provided data, transparently passed to out_cb() */
 	void *data;
diff --git a/src/e1_input.c b/src/e1_input.c
index 379cc53..b3341e7 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -297,7 +297,7 @@
 /* Timeslot */
 int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line,
 			 int (*trau_rcv_cb)(struct subch_demux *dmx, int ch,
-					uint8_t *data, int len, void *_priv))
+					const ubit_t *data, int len, void *_priv))
 {
 	if (ts->type == E1INP_TS_TYPE_TRAU && ts->line && line)
 		return 0;
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index d15c4b8..9275fda 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -40,7 +40,7 @@
 
 void *tall_tqe_ctx;
 
-static inline void append_bit(struct demux_subch *sch, uint8_t bit)
+static inline void append_bit(struct demux_subch *sch, ubit_t bit)
 {
 	sch->out_bitbuf[sch->out_idx++] = bit;
 }
diff --git a/src/trau_frame.c b/src/trau_frame.c
index 717bc32..eaced3d 100644
--- a/src/trau_frame.c
+++ b/src/trau_frame.c
@@ -37,7 +37,7 @@
  *  \file trau_frame.c
  */
 
-static uint32_t get_bits(const uint8_t *bitbuf, int offset, int num)
+static uint32_t get_bits(const ubit_t *bitbuf, int offset, int num)
 {
 	int i;
 	uint32_t ret = 0;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/18177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ia082b9fddf03d02afd007825a1588a3ef0dbedae
Gerrit-Change-Number: 18177
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200511/625182a2/attachment.htm>


More information about the gerrit-log mailing list