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
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 @@
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 @@
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 @@
/* 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 @@
/* 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 @@
/*! \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];