sched: Clean up param passing and improve logging

Change-Id: If137a2aaac7744e60564ca833a1b5564ed7d93bb
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 527d152..0068eae 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -41,8 +41,9 @@
 	struct gprs_rlcmac_ul_tbf *ul_ack;
 };
 
-static void get_ctrl_msg_tbf_candidates(const struct gprs_rlcmac_bts *bts, uint8_t trx,
-			       uint8_t ts, struct tbf_sched_candidates *tbf_cand)
+static void get_ctrl_msg_tbf_candidates(const struct gprs_rlcmac_bts *bts,
+					const struct gprs_rlcmac_pdch *pdch,
+					struct tbf_sched_candidates *tbf_cand)
 {
 	struct gprs_rlcmac_ul_tbf *ul_tbf;
 	struct gprs_rlcmac_dl_tbf *dl_tbf;
@@ -52,7 +53,7 @@
 		ul_tbf = as_ul_tbf((struct gprs_rlcmac_tbf *)pos->entry);
 		OSMO_ASSERT(ul_tbf);
 		/* this trx, this ts */
-		if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts))
+		if (ul_tbf->trx->trx_no != pdch->trx->trx_no || !ul_tbf->is_control_ts(pdch->ts_no))
 			continue;
 		if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK))
 			tbf_cand->ul_ack = ul_tbf;
@@ -71,7 +72,7 @@
 		dl_tbf = as_dl_tbf((struct gprs_rlcmac_tbf *)pos->entry);
 		OSMO_ASSERT(dl_tbf);
 		/* this trx, this ts */
-		if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts))
+		if (dl_tbf->trx->trx_no != pdch->trx->trx_no || !dl_tbf->is_control_ts(pdch->ts_no))
 			continue;
 		if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS))
 			tbf_cand->dl_ass = dl_tbf;
@@ -480,7 +481,7 @@
 	if (usf_tbf && req_mcs_kind == EGPRS && ms_mode(usf_tbf->ms()) != EGPRS)
 		req_mcs_kind = EGPRS_GMSK;
 
-	get_ctrl_msg_tbf_candidates(bts, trx, ts, &tbf_cand);
+	get_ctrl_msg_tbf_candidates(bts, pdch, &tbf_cand);
 
 	/* Prio 1: select control message */
 	if ((msg = sched_select_ctrl_msg(pdch, fn, block_nr, &tbf_cand))) {