aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-09 13:43:50 +0100
committerHarald Welte <laforge@gnumonks.org>2016-01-16 17:47:59 +0100
commit2bf00d772905942b0baef20c84d2d320f3f647f8 (patch)
tree4514b1fd6b80622cc8b6977a8dfb69d244a7a208 /src/osmo-bts-trx
parent12992d86dc443a0d03efcb19ee8ab812506df950 (diff)
TRX: mark scheduler data structures as 'const'
Those are read-only tables which should end up in the text segment and not in writable data.
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/l1_if.h2
-rw-r--r--src/osmo-bts-trx/scheduler.c42
2 files changed, 22 insertions, 22 deletions
diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h
index 278537e1..b8e8da61 100644
--- a/src/osmo-bts-trx/l1_if.h
+++ b/src/osmo-bts-trx/l1_if.h
@@ -156,7 +156,7 @@ struct trx_l1h {
uint8_t mf_index[8]; /* selected multiframe index */
uint32_t mf_last_fn[8]; /* last received frame */
uint8_t mf_period[8]; /* period of multiframe */
- struct trx_sched_frame *mf_frames[8]; /* pointer to frame layout */
+ const struct trx_sched_frame *mf_frames[8]; /* pointer to frame layout */
/* Channel states for all channels on all timeslots */
struct trx_chan_state chan_states[8][_TRX_CHAN_MAX];
diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c
index 5bd540cd..4b731a72 100644
--- a/src/osmo-bts-trx/scheduler.c
+++ b/src/osmo-bts-trx/scheduler.c
@@ -1737,7 +1737,7 @@ struct trx_sched_frame {
uint8_t ul_bid;
};
-static struct trx_sched_frame frame_bcch[51] = {
+static const struct trx_sched_frame frame_bcch[51] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_FCCH, 0, TRXC_RACH, 0 },
{ TRXC_SCH, 0, TRXC_RACH, 0 },
@@ -1762,7 +1762,7 @@ static struct trx_sched_frame frame_bcch[51] = {
{ TRXC_IDLE, 0, TRXC_RACH, 0 },
};
-static struct trx_sched_frame frame_bcch_sdcch4[102] = {
+static const struct trx_sched_frame frame_bcch_sdcch4[102] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_FCCH, 0, TRXC_SDCCH4_3, 0 },
{ TRXC_SCH, 0, TRXC_SDCCH4_3, 1 },
@@ -1869,7 +1869,7 @@ static struct trx_sched_frame frame_bcch_sdcch4[102] = {
{ TRXC_IDLE, 0, TRXC_SDCCH4_2, 3 },
};
-static struct trx_sched_frame frame_sdcch8[102] = {
+static const struct trx_sched_frame frame_sdcch8[102] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_SDCCH8_0, 0, TRXC_SACCH8_5, 0 },
{ TRXC_SDCCH8_0, 1, TRXC_SACCH8_5, 1 },
@@ -1976,7 +1976,7 @@ static struct trx_sched_frame frame_sdcch8[102] = {
{ TRXC_IDLE, 0, TRXC_SACCH8_4, 3 },
};
-static struct trx_sched_frame frame_tchf_ts0[104] = {
+static const struct trx_sched_frame frame_tchf_ts0[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2012,7 +2012,7 @@ static struct trx_sched_frame frame_tchf_ts0[104] = {
{ TRXC_IDLE, 0, TRXC_IDLE, 0 },
};
-static struct trx_sched_frame frame_tchf_ts1[104] = {
+static const struct trx_sched_frame frame_tchf_ts1[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2048,7 +2048,7 @@ static struct trx_sched_frame frame_tchf_ts1[104] = {
{ TRXC_SACCHTF, 3, TRXC_SACCHTF, 3 },
};
-static struct trx_sched_frame frame_tchf_ts2[104] = {
+static const struct trx_sched_frame frame_tchf_ts2[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2084,7 +2084,7 @@ static struct trx_sched_frame frame_tchf_ts2[104] = {
{ TRXC_IDLE, 0, TRXC_IDLE, 0 },
};
-static struct trx_sched_frame frame_tchf_ts3[104] = {
+static const struct trx_sched_frame frame_tchf_ts3[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2120,7 +2120,7 @@ static struct trx_sched_frame frame_tchf_ts3[104] = {
{ TRXC_SACCHTF, 2, TRXC_SACCHTF, 2 },
};
-static struct trx_sched_frame frame_tchf_ts4[104] = {
+static const struct trx_sched_frame frame_tchf_ts4[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2156,7 +2156,7 @@ static struct trx_sched_frame frame_tchf_ts4[104] = {
{ TRXC_IDLE, 0, TRXC_IDLE, 0 },
};
-static struct trx_sched_frame frame_tchf_ts5[104] = {
+static const struct trx_sched_frame frame_tchf_ts5[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2192,7 +2192,7 @@ static struct trx_sched_frame frame_tchf_ts5[104] = {
{ TRXC_SACCHTF, 1, TRXC_SACCHTF, 1 },
};
-static struct trx_sched_frame frame_tchf_ts6[104] = {
+static const struct trx_sched_frame frame_tchf_ts6[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2228,7 +2228,7 @@ static struct trx_sched_frame frame_tchf_ts6[104] = {
{ TRXC_IDLE, 0, TRXC_IDLE, 0 },
};
-static struct trx_sched_frame frame_tchf_ts7[104] = {
+static const struct trx_sched_frame frame_tchf_ts7[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
{ TRXC_TCHF, 0, TRXC_TCHF, 0 }, { TRXC_TCHF, 1, TRXC_TCHF, 1 }, { TRXC_TCHF, 2, TRXC_TCHF, 2 }, { TRXC_TCHF, 3, TRXC_TCHF, 3 },
@@ -2264,7 +2264,7 @@ static struct trx_sched_frame frame_tchf_ts7[104] = {
{ TRXC_SACCHTF, 0, TRXC_SACCHTF, 0 },
};
-static struct trx_sched_frame frame_tchh_ts01[104] = {
+static const struct trx_sched_frame frame_tchh_ts01[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
@@ -2300,7 +2300,7 @@ static struct trx_sched_frame frame_tchh_ts01[104] = {
{ TRXC_SACCHTH_1, 3, TRXC_SACCHTH_1, 3 },
};
-static struct trx_sched_frame frame_tchh_ts23[104] = {
+static const struct trx_sched_frame frame_tchh_ts23[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
@@ -2336,7 +2336,7 @@ static struct trx_sched_frame frame_tchh_ts23[104] = {
{ TRXC_SACCHTH_1, 2, TRXC_SACCHTH_1, 2 },
};
-static struct trx_sched_frame frame_tchh_ts45[104] = {
+static const struct trx_sched_frame frame_tchh_ts45[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
@@ -2372,7 +2372,7 @@ static struct trx_sched_frame frame_tchh_ts45[104] = {
{ TRXC_SACCHTH_1, 1, TRXC_SACCHTH_1, 1 },
};
-static struct trx_sched_frame frame_tchh_ts67[104] = {
+static const struct trx_sched_frame frame_tchh_ts67[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
{ TRXC_TCHH_0, 0, TRXC_TCHH_0, 0 }, { TRXC_TCHH_1, 0, TRXC_TCHH_1, 0 }, { TRXC_TCHH_0, 1, TRXC_TCHH_0, 1 }, { TRXC_TCHH_1, 1, TRXC_TCHH_1, 1 },
@@ -2408,7 +2408,7 @@ static struct trx_sched_frame frame_tchh_ts67[104] = {
{ TRXC_SACCHTH_1, 0, TRXC_SACCHTH_1, 0 },
};
-static struct trx_sched_frame frame_pdch[104] = {
+static const struct trx_sched_frame frame_pdch[104] = {
/* dl_chan dl_bid ul_chan ul_bid */
{ TRXC_PDTCH, 0, TRXC_PDTCH, 0 }, { TRXC_PDTCH, 1, TRXC_PDTCH, 1 }, { TRXC_PDTCH, 2, TRXC_PDTCH, 2 }, { TRXC_PDTCH, 3, TRXC_PDTCH, 3 },
{ TRXC_PDTCH, 0, TRXC_PDTCH, 0 }, { TRXC_PDTCH, 1, TRXC_PDTCH, 1 }, { TRXC_PDTCH, 2, TRXC_PDTCH, 2 }, { TRXC_PDTCH, 3, TRXC_PDTCH, 3 },
@@ -2453,12 +2453,12 @@ struct trx_sched_multiframe {
/*! \brief repeats how many frames */
uint8_t period;
/*! \brief pointer to scheduling structure */
- struct trx_sched_frame *frames;
+ const struct trx_sched_frame *frames;
/*! \brife human-readable name */
const char *name;
};
-static struct trx_sched_multiframe trx_sched_multiframes[] = {
+static const struct trx_sched_multiframe trx_sched_multiframes[] = {
{ GSM_PCHAN_NONE, 0xff, 0, NULL, "NONE"},
{ GSM_PCHAN_CCCH, 0xff, 51, frame_bcch, "BCCH+CCCH" },
{ GSM_PCHAN_CCCH_SDCCH4, 0xff, 102, frame_bcch_sdcch4, "BCCH+CCCH+SDCCH/4+SACCH/4" },
@@ -2676,7 +2676,7 @@ int trx_sched_set_cipher(struct trx_l1h *l1h, uint8_t chan_nr, int downlink,
/* process ready-to-send */
static int trx_sched_rts(struct trx_l1h *l1h, uint8_t tn, uint32_t fn)
{
- struct trx_sched_frame *frame;
+ const struct trx_sched_frame *frame;
uint8_t offset, period, bid;
trx_sched_rts_func *func;
enum trx_chan_type chan;
@@ -2714,7 +2714,7 @@ static int trx_sched_rts(struct trx_l1h *l1h, uint8_t tn, uint32_t fn)
static const ubit_t *trx_sched_dl_burst(struct trx_l1h *l1h, uint8_t tn,
uint32_t fn)
{
- struct trx_sched_frame *frame;
+ const struct trx_sched_frame *frame;
uint8_t offset, period, bid;
trx_sched_dl_func *func;
enum trx_chan_type chan;
@@ -2770,7 +2770,7 @@ if (0) if (chan != TRXC_IDLE) // hack
int trx_sched_ul_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t current_fn,
sbit_t *bits, int8_t rssi, float toa)
{
- struct trx_sched_frame *frame;
+ const struct trx_sched_frame *frame;
uint8_t offset, period, bid;
trx_sched_ul_func *func;
enum trx_chan_type chan;