From 47aaf962fbd358f5b66a2d349160f25c521e6393 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 9 Mar 2018 15:24:20 +0700 Subject: trxcon/scheduler: enforce lchan handlers to set message type Since this change, each lchan handler shall manually indicate a type of both message indications and confirmations. Change-Id: I02e0b87d61c127d2f6f5b9532909af78332bf707 --- src/host/trxcon/sched_lchan_common.c | 14 ++++++-------- src/host/trxcon/sched_lchan_tchf.c | 11 +++++------ src/host/trxcon/sched_lchan_xcch.c | 6 +++--- src/host/trxcon/sched_trx.h | 8 ++++---- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c index 1858619b..47b01621 100644 --- a/src/host/trxcon/sched_lchan_common.c +++ b/src/host/trxcon/sched_lchan_common.c @@ -82,9 +82,9 @@ const uint8_t sched_nb_training_bits[8][26] = { }, }; -int sched_send_data_ind(struct trx_instance *trx, struct trx_ts *ts, +int sched_send_dt_ind(struct trx_instance *trx, struct trx_ts *ts, struct trx_lchan_state *lchan, uint8_t *l2, size_t l2_len, - bool dec_failed, int bit_error_count) + int bit_error_count, bool dec_failed, bool traffic) { const struct trx_lchan_desc *lchan_desc; struct l1ctl_info_dl dl_hdr; @@ -107,14 +107,13 @@ int sched_send_data_ind(struct trx_instance *trx, struct trx_ts *ts, dl_hdr.fire_crc = dec_failed ? 2 : 0; /* Put a packet to higher layers */ - l1ctl_tx_dt_ind(trx->l1l, &dl_hdr, l2, l2_len, - l2_len != GSM_MACBLOCK_LEN); + l1ctl_tx_dt_ind(trx->l1l, &dl_hdr, l2, l2_len, traffic); return 0; } -int sched_send_data_conf(struct trx_instance *trx, struct trx_ts *ts, - struct trx_lchan_state *lchan, uint32_t fn, size_t l2_len) +int sched_send_dt_conf(struct trx_instance *trx, struct trx_ts *ts, + struct trx_lchan_state *lchan, uint32_t fn, bool traffic) { const struct trx_lchan_desc *lchan_desc; struct l1ctl_info_dl dl_hdr; @@ -131,8 +130,7 @@ int sched_send_data_conf(struct trx_instance *trx, struct trx_ts *ts, dl_hdr.band_arfcn = htons(trx->band_arfcn); dl_hdr.frame_nr = htonl(fn); - l1ctl_tx_dt_conf(trx->l1l, &dl_hdr, - l2_len != GSM_MACBLOCK_LEN); + l1ctl_tx_dt_conf(trx->l1l, &dl_hdr, traffic); return 0; } diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c index b023126a..25c9b10b 100644 --- a/src/host/trxcon/sched_lchan_tchf.c +++ b/src/host/trxcon/sched_lchan_tchf.c @@ -147,8 +147,8 @@ int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts, l2_len = sched_bad_frame_ind(l2, rsl_cmode, tch_mode); } else if (rc == GSM_MACBLOCK_LEN) { /* FACCH received, forward it to the higher layers */ - sched_send_data_ind(trx, ts, lchan, - l2, GSM_MACBLOCK_LEN, false, n_errors); + sched_send_dt_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN, + n_errors, false, false); /* Send BFI instead of stolen TCH frame */ l2_len = sched_bad_frame_ind(l2, rsl_cmode, tch_mode); @@ -159,8 +159,8 @@ int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts, /* Send a traffic frame to the higher layers */ if (l2_len > 0) - sched_send_data_ind(trx, ts, lchan, - l2, l2_len, false, n_errors); + sched_send_dt_ind(trx, ts, lchan, l2, l2_len, + n_errors, rc < 4, true); return 0; } @@ -273,8 +273,7 @@ send_burst: /* If we have sent the last (4/4) burst */ if (*mask == 0x0f) { /* Confirm data / traffic sending */ - sched_send_data_conf(trx, ts, lchan, fn, - lchan->prim->payload_len); + sched_send_dt_conf(trx, ts, lchan, fn, PRIM_IS_TCH(lchan->prim)); /* Forget processed primitive */ sched_prim_drop(lchan); diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c index b2cbd223..f3516741 100644 --- a/src/host/trxcon/sched_lchan_xcch.c +++ b/src/host/trxcon/sched_lchan_xcch.c @@ -109,8 +109,8 @@ int rx_data_fn(struct trx_instance *trx, struct trx_ts *ts, } /* Send a L2 frame to the higher layers */ - sched_send_data_ind(trx, ts, lchan, - l2, GSM_MACBLOCK_LEN, rc != 0, n_errors); + sched_send_dt_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN, + n_errors, rc != 0, false); return 0; } @@ -190,7 +190,7 @@ send_burst: *mask = 0x00; /* Confirm data sending */ - sched_send_data_conf(trx, ts, lchan, fn, GSM_MACBLOCK_LEN); + sched_send_dt_conf(trx, ts, lchan, fn, false); } return 0; diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h index d9e0c8ed..80b8dd29 100644 --- a/src/host/trxcon/sched_trx.h +++ b/src/host/trxcon/sched_trx.h @@ -312,8 +312,8 @@ int sched_trx_handle_tx_burst(struct trx_instance *trx, extern const uint8_t sched_nb_training_bits[8][26]; size_t sched_bad_frame_ind(uint8_t *l2, uint8_t rsl_cmode, uint8_t tch_mode); -int sched_send_data_ind(struct trx_instance *trx, struct trx_ts *ts, +int sched_send_dt_ind(struct trx_instance *trx, struct trx_ts *ts, struct trx_lchan_state *lchan, uint8_t *l2, size_t l2_len, - bool dec_failed, int bit_error_count); -int sched_send_data_conf(struct trx_instance *trx, struct trx_ts *ts, - struct trx_lchan_state *lchan, uint32_t fn, size_t l2_len); + int bit_error_count, bool dec_failed, bool traffic); +int sched_send_dt_conf(struct trx_instance *trx, struct trx_ts *ts, + struct trx_lchan_state *lchan, uint32_t fn, bool traffic); -- cgit v1.2.3