i460_mux: add callback to notify empty tx queue

There is no way for the API user to know if the TX queue of the
multiplexer runs empty. However, this is criticil since an empty TX
queue will cause dropout of a TRAU frame, which can have quite severe
effects to the receiving end. Lets add a callback that allows the APU
user to insert appropiate idle frames or silent frames into the queue
before it runs empty.

Change-Id: I88a87724235fe50d55ce6215bb385c044072226e
Related: OS#2547
diff --git a/include/osmocom/gsm/i460_mux.h b/include/osmocom/gsm/i460_mux.h
index 2e33b37..dd752db 100644
--- a/include/osmocom/gsm/i460_mux.h
+++ b/include/osmocom/gsm/i460_mux.h
@@ -52,9 +52,13 @@
 	void *user_data;
 };
 
+typedef void (*in_cb_queue_empty_t)(void *user_data);
+
 struct osmo_i460_subchan_mux {
 	/*! list of to-be-transmitted message buffers */
 	struct llist_head tx_queue;
+	in_cb_queue_empty_t in_cb_queue_empty;
+	void *user_data;
 };
 
 struct osmo_i460_subchan {
@@ -87,6 +91,14 @@
 		/* opaque user data pointer to pass to out_cb */
 		void *user_data;
 	} demux;
+
+	struct {
+		/* call-back function whenever the muxer requires more input data from the sub-channels,
+		 * but has nothing enqueued yet. A typical function would then call osmo_i460_mux_enqueue() */
+		in_cb_queue_empty_t in_cb_queue_empty;
+		/* opaque user data pointer to pass to in_cb */
+		void *user_data;
+	} mux;
 };
 
 void osmo_i460_demux_in(struct osmo_i460_timeslot *ts, const uint8_t *data, size_t data_len);