diff options
author | Harald Welte <laforge@osmocom.org> | 2020-05-07 23:09:16 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-05-10 19:11:44 +0200 |
commit | 5226e5b926ccff2856f2fa065748b956ccd14f52 (patch) | |
tree | 352a4d406e0a0c26b0413cf36443abfde677e12e | |
parent | eb55e2f8d95f83379b209c4390543b64895a5253 (diff) |
subchan_demux: Use 'ubit_t' for unpacked bit buffer; use const
Change-Id: Ia082b9fddf03d02afd007825a1588a3ef0dbedae
-rw-r--r-- | include/osmocom/abis/e1_input.h | 2 | ||||
-rw-r--r-- | include/osmocom/abis/subchan_demux.h | 5 | ||||
-rw-r--r-- | src/e1_input.c | 2 | ||||
-rw-r--r-- | src/subchan_demux.c | 2 | ||||
-rw-r--r-- | src/trau_frame.c | 2 |
5 files changed, 7 insertions, 6 deletions
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 @@ int e1inp_ts_config_sign(struct e1inp_ts *ts, struct e1inp_line *line); /* 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 subch_demux { 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 @@ int abis_rsl_sendmsg(struct msgb *msg) /* 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; |