host/trxcon/scheduler: use GSM_MACBLOCK_LEN definition

Change-Id: Ie3b27ecb62d6f0e84f2e3ec0c1558e32bb213d33
This commit is contained in:
Vadim Yanitskiy 2017-12-16 15:04:41 +07:00
parent 3d872d0eae
commit d2c13e3d20
2 changed files with 8 additions and 5 deletions

View File

@ -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);

View File

@ -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;