aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-05-09 10:33:42 +0200
committerHarald Welte <laforge@osmocom.org>2020-05-11 08:40:01 +0200
commita684b84f11f2b441139bdbc16792cc54656e20f2 (patch)
treea3ca9cc2d1e1913f0c5d6d83797479c1f7259d37
parent6913b9a4e4f6d3b28790e85613b8a54219ad6138 (diff)
subchan_demux: Use ubit_t where appropriate
the subchan_demux code predates ubit_t; let's use it to clarify certain pointers refer to arrays of unpacked bits. Change-Id: I944f05473954920d57e12d5514cf928fc78f2ea4
-rw-r--r--include/osmocom/abis/subchan_demux.h4
-rw-r--r--src/subchan_demux.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/include/osmocom/abis/subchan_demux.h b/include/osmocom/abis/subchan_demux.h
index 3978d73..dac072c 100644
--- a/include/osmocom/abis/subchan_demux.h
+++ b/include/osmocom/abis/subchan_demux.h
@@ -85,7 +85,7 @@ struct subch_txq_entry {
unsigned int bit_len; /*!< \brief total number of bits in 'bits' */
unsigned int next_bit; /*!< \brief next bit to be transmitted */
- uint8_t bits[0]; /*!< \brief one bit per byte */
+ ubit_t bits[0]; /*!< \brief one bit per byte */
};
/*! \brief one sub-channel inside a multiplexer */
@@ -102,7 +102,7 @@ struct subch_mux {
int subchan_mux_init(struct subch_mux *mx);
int subchan_mux_out(struct subch_mux *mx, uint8_t *data, int len);
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
int len);
/* }@ */
diff --git a/src/subchan_demux.c b/src/subchan_demux.c
index 9275fda..55503db 100644
--- a/src/subchan_demux.c
+++ b/src/subchan_demux.c
@@ -200,7 +200,7 @@ static int alloc_add_idle_frame(struct subch_mux *mx, int sch_nr)
/* return the requested number of bits from the specified subchannel */
static int get_subch_bits(struct subch_mux *mx, int subch,
- uint8_t *bits, int num_requested)
+ ubit_t *bits, int num_requested)
{
struct mux_subch *sch = &mx->subch[subch];
int num_bits = 0;
@@ -258,7 +258,7 @@ static uint8_t compact_bits(const uint8_t *bits)
/* obtain a single output byte from the subchannel muxer */
static int mux_output_byte(struct subch_mux *mx, uint8_t *byte)
{
- uint8_t bits[8];
+ ubit_t bits[8];
int rc;
/* combine two bits of every subchan */
@@ -310,11 +310,11 @@ static void tx_queue_evict(struct mux_subch *sch, int num_evict)
/*! \brief enqueue some data into the tx_queue of a given subchannel
* \param[in] mx subchannel muxer instance
* \param[in] s_nr subchannel number
- * \param[in] data pointer to buffer with data
- * \param[in] len length of \a data
+ * \param[in] data pointer to buffer with data (unpacked bits)
+ * \param[in] len length of data (in unpacked bits)
* \returns 0 in case of success, <0 in case of error
*/
-int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const uint8_t *data,
+int subchan_mux_enqueue(struct subch_mux *mx, int s_nr, const ubit_t *data,
int len)
{
struct mux_subch *sch = &mx->subch[s_nr];