trau_frame: Introduce support for Downlink Time Alignment

In the uplink direction, we provide osmo_trau_frame_dl_ta_us()
to determine the time alignment as requested by the CCU in the BTS.

In the downlink direction, the TRAU frame encoder will perform
time alignment as requested by the user in osmo_trau_frame.dl_ta_usec.

Change-Id: I3981becafc56c9a50119b9ba6bf67aa0391cc76e
diff --git a/include/osmocom/trau/trau_frame.h b/include/osmocom/trau/trau_frame.h
index 6784d1f..5f1d708 100644
--- a/include/osmocom/trau/trau_frame.h
+++ b/include/osmocom/trau/trau_frame.h
@@ -110,6 +110,9 @@
 	enum osmo_trau_frame_type type;
 	enum osmo_trau_frame_direction dir;
 
+	/* timing alignment: 0 = no change; negative: less bits; positive: more bits */
+	int dl_ta_usec;
+
 	ubit_t c_bits[MAX_C_BITS];
 	ubit_t d_bits[MAX_D_BITS];
 	ubit_t t_bits[MAX_T_BITS];
@@ -142,5 +145,7 @@
  *  \return number of bits encoded */
 int osmo_trau_frame_encode(ubit_t *bits, size_t n_bits, const struct osmo_trau_frame *fr);
 
+/*! Determine the time alignment in us requested by CCU in a UL frame */
+int osmo_trau_frame_dl_ta_us(const struct osmo_trau_frame *fr);
 
 /* }@ */