diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-16 15:04:41 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-16 15:45:12 +0700 |
commit | d2c13e3d209565a4bd1c6776e3a5a86f7ea5d857 (patch) | |
tree | 2538049db1481d4135dd5adf5dfe441e4bb9867f | |
parent | 3d872d0eae76b42b0fdf235f2df196c8bc5abb7c (diff) |
host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition
Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
-rw-r--r-- | src/host/trxcon/sched_lchan_common.c | 6 | ||||
-rw-r--r-- | src/host/trxcon/sched_lchan_xcch.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c index 8f061659..925a4415 100644 --- a/src/host/trxcon/sched_lchan_common.c +++ b/src/host/trxcon/sched_lchan_common.c @@ -32,6 +32,8 @@ #include <osmocom/core/logging.h> #include <osmocom/core/bits.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> + #include "l1ctl_proto.h" #include "scheduler.h" #include "sched_trx.h" @@ -106,7 +108,7 @@ int sched_send_data_ind(struct trx_instance *trx, struct trx_ts *ts, memcpy(data->payload, l2, l2_len); /* Put a packet to higher layers */ - l1ctl_tx_data_ind(trx->l1l, data, l2_len == 23 ? + l1ctl_tx_data_ind(trx->l1l, data, l2_len == GSM_MACBLOCK_LEN ? L1CTL_DATA_IND : L1CTL_TRAFFIC_IND); talloc_free(data); @@ -135,7 +137,7 @@ int sched_send_data_conf(struct trx_instance *trx, struct trx_ts *ts, data->frame_nr = htonl(fn); /* Choose a confirmation type */ - conf_type = l2_len == 23 ? + conf_type = l2_len == GSM_MACBLOCK_LEN ? L1CTL_DATA_CONF : L1CTL_TRAFFIC_CONF; l1ctl_tx_data_conf(trx->l1l, data, conf_type); diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c index 0aff9ac5..7d4786db 100644 --- a/src/host/trxcon/sched_lchan_xcch.c +++ b/src/host/trxcon/sched_lchan_xcch.c @@ -32,6 +32,7 @@ #include <osmocom/core/bits.h> #include <osmocom/gsm/gsm_utils.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/coding/gsm0503_coding.h> #include "l1ctl_proto.h" @@ -47,9 +48,9 @@ int rx_data_fn(struct trx_instance *trx, struct trx_ts *ts, sbit_t *bits, int8_t rssi, float toa) { const struct trx_lchan_desc *lchan_desc; + uint8_t l2[GSM_MACBLOCK_LEN], *mask; int n_errors, n_bits_total, rc; sbit_t *buffer, *offset; - uint8_t l2[23], *mask; uint32_t *first_fn; /* Set up pointers */ @@ -111,7 +112,7 @@ 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, 23); + sched_send_data_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN); /* TODO: AGC, TA loops */ return 0; @@ -206,7 +207,7 @@ send_burst: *mask = 0x00; /* Confirm data sending */ - sched_send_data_conf(trx, ts, lchan, fn, 23); + sched_send_data_conf(trx, ts, lchan, fn, GSM_MACBLOCK_LEN); } return 0; |