From 97006ff1bd89b83f730850c068cba6edec0bbd46 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 9 Jul 2022 23:10:32 +0700 Subject: [PATCH] trxcon: make l1ctl_tx_dt_ind() accept const pointers Change-Id: I34f665a39c7d036efd4cbe335084fbe21142a48c Related: OS#5599, OS#3761 --- src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h | 6 ++++-- src/host/trxcon/src/l1ctl.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h index f93908da9..2e7e21903 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/l1ctl.h @@ -18,8 +18,10 @@ int l1ctl_tx_pm_conf(struct l1ctl_link *l1l, uint16_t band_arfcn, int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type); int l1ctl_tx_reset_ind(struct l1ctl_link *l1l, uint8_t type); -int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, - uint8_t *l2, size_t l2_len, bool traffic); +int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, + const struct l1ctl_info_dl *dl_info, + const uint8_t *l2, size_t l2_len, + bool traffic); int l1ctl_tx_dt_conf(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, bool traffic); int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 99b843c32..cb3a06c07 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -3,7 +3,8 @@ * GSM L1 control interface handlers * * (C) 2014 by Sylvain Munaut - * (C) 2016-2017 by Vadim Yanitskiy + * (C) 2016-2022 by Vadim Yanitskiy + * Contributions by sysmocom - s.f.m.c. GmbH * * All Rights Reserved * @@ -135,7 +136,8 @@ int l1ctl_tx_reset_conf(struct l1ctl_link *l1l, uint8_t type) return l1ctl_link_send(l1l, msg); } -static struct l1ctl_info_dl *put_dl_info_hdr(struct msgb *msg, struct l1ctl_info_dl *dl_info) +static struct l1ctl_info_dl *put_dl_info_hdr(struct msgb *msg, + const struct l1ctl_info_dl *dl_info) { size_t len = sizeof(struct l1ctl_info_dl); struct l1ctl_info_dl *dl = (struct l1ctl_info_dl *) msgb_put(msg, len); @@ -207,8 +209,10 @@ int l1ctl_tx_ccch_mode_conf(struct l1ctl_link *l1l, uint8_t mode) /** * Handles both L1CTL_DATA_IND and L1CTL_TRAFFIC_IND. */ -int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, - uint8_t *l2, size_t l2_len, bool traffic) +int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, + const struct l1ctl_info_dl *dl_info, + const uint8_t *l2, size_t l2_len, + bool traffic) { struct msgb *msg; uint8_t *msg_l2; @@ -218,7 +222,7 @@ int l1ctl_tx_dt_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *data, if (msg == NULL) return -ENOMEM; - put_dl_info_hdr(msg, data); + put_dl_info_hdr(msg, dl_info); /* Copy the L2 payload if preset */ if (l2 && l2_len > 0) {