Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 1 | /* AllocTest.cpp |
| 2 | * |
| 3 | * Copyright (C) 2013 by Holger Hans Peter Freyther |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | #include "gprs_rlcmac.h" |
| 21 | #include "gprs_debug.h" |
| 22 | #include "tbf.h" |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 23 | #include "bts.h" |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 24 | |
| 25 | #include <string.h> |
| 26 | #include <stdio.h> |
| 27 | |
| 28 | extern "C" { |
| 29 | #include <osmocom/core/application.h> |
| 30 | #include <osmocom/core/msgb.h> |
| 31 | #include <osmocom/core/talloc.h> |
| 32 | #include <osmocom/core/utils.h> |
| 33 | } |
| 34 | |
| 35 | /* globals used by the code */ |
| 36 | void *tall_pcu_ctx; |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 37 | int16_t spoof_mnc = 0, spoof_mcc = 0; |
| 38 | |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 39 | static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 40 | GprsMs *ms, gprs_rlcmac_tbf_direction dir, |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 41 | uint8_t tfi, uint8_t trx, |
| 42 | uint8_t ms_class, uint8_t single_slot) |
| 43 | { |
| 44 | if (dir == GPRS_RLCMAC_UL_TBF) |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 45 | return tbf_alloc_ul_tbf(bts, ms, tfi, trx, ms_class, single_slot); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 46 | else |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 47 | return tbf_alloc_dl_tbf(bts, ms, tfi, trx, ms_class, single_slot); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 48 | } |
| 49 | |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 50 | static void test_alloc_a(gprs_rlcmac_tbf_direction dir, |
| 51 | uint8_t slots, const int count) |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 52 | { |
| 53 | int tfi; |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 54 | int i; |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 55 | uint8_t used_trx; |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 56 | BTS the_bts; |
| 57 | struct gprs_rlcmac_bts *bts; |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 58 | struct gprs_rlcmac_tbf *tbfs[33] = { 0, }; |
| 59 | |
| 60 | printf("Testing alloc_a direction(%d)\n", dir); |
| 61 | |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 62 | bts = the_bts.bts_data(); |
| 63 | bts->alloc_algorithm = alloc_algorithm_a; |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 64 | |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 65 | struct gprs_rlcmac_trx *trx = &bts->trx[0]; |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 66 | for (i = 0; i < 8; i += 1) |
| 67 | if (slots & (1 << i)) |
| 68 | trx->pdch[i].enable(); |
| 69 | |
| 70 | OSMO_ASSERT(count >= 0 && count <= (int)ARRAY_SIZE(tbfs)); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 71 | |
| 72 | /** |
| 73 | * Currently alloc_a will only allocate from the first |
| 74 | * PDCH and all possible usf's. We run out of usf's before |
| 75 | * we are out of tfi's. Observe this and make sure that at |
| 76 | * least this part is working okay. |
| 77 | */ |
| 78 | for (int i = 0; i < count; ++i) { |
Holger Hans Peter Freyther | 70ddde6 | 2013-10-26 19:17:58 +0200 | [diff] [blame] | 79 | tfi = the_bts.tfi_find_free(dir, &used_trx, 0); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 80 | OSMO_ASSERT(tfi >= 0); |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 81 | tbfs[i] = tbf_alloc(bts, NULL, dir, tfi, used_trx, 0, 0); |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 82 | OSMO_ASSERT(tbfs[i] != NULL); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | /* Now check that there are still some TFIs */ |
Holger Hans Peter Freyther | 70ddde6 | 2013-10-26 19:17:58 +0200 | [diff] [blame] | 86 | tfi = the_bts.tfi_find_free(dir, &used_trx, 0); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 87 | switch (dir) { |
| 88 | case GPRS_RLCMAC_UL_TBF: |
| 89 | OSMO_ASSERT(tfi >= 0); |
| 90 | break; |
| 91 | case GPRS_RLCMAC_DL_TBF: |
| 92 | OSMO_ASSERT(tfi < 0); |
| 93 | break; |
| 94 | } |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 95 | OSMO_ASSERT(!tbf_alloc(bts, NULL, dir, tfi, used_trx, 0, 0)); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 96 | |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 97 | for (size_t i = 0; i < ARRAY_SIZE(tbfs); ++i) |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 98 | if (tbfs[i]) |
| 99 | tbf_free(tbfs[i]); |
| 100 | |
Holger Hans Peter Freyther | 70ddde6 | 2013-10-26 19:17:58 +0200 | [diff] [blame] | 101 | tfi = the_bts.tfi_find_free(dir, &used_trx, 0); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 102 | OSMO_ASSERT(tfi >= 0); |
| 103 | |
Holger Hans Peter Freyther | 34bd8bd | 2013-10-19 21:10:38 +0200 | [diff] [blame] | 104 | tbfs[tfi] = tbf_alloc(bts, NULL, dir, tfi, used_trx, 0, 0); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 105 | OSMO_ASSERT(tbfs[tfi]); |
| 106 | tbf_free(tbfs[tfi]); |
| 107 | } |
| 108 | |
| 109 | static void test_alloc_a() |
| 110 | { |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 111 | /* slots 2 - 3 */ |
| 112 | test_alloc_a(GPRS_RLCMAC_DL_TBF, 0x0c, 32); |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 113 | test_alloc_a(GPRS_RLCMAC_UL_TBF, 0x0c, 14); |
Jacob Erlbeck | fa464bb | 2015-06-29 12:45:11 +0200 | [diff] [blame] | 114 | |
| 115 | /* slots 1 - 5 */ |
| 116 | test_alloc_a(GPRS_RLCMAC_DL_TBF, 0x1e, 32); |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 117 | test_alloc_a(GPRS_RLCMAC_UL_TBF, 0x1e, 28); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 118 | } |
| 119 | |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 120 | static void dump_assignment(struct gprs_rlcmac_tbf *tbf, const char *dir) |
| 121 | { |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 122 | for (size_t i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 123 | if (tbf->pdch[i]) |
| 124 | printf("PDCH[%d] is used for %s\n", i, dir); |
| 125 | printf("PDCH[%d] is control_ts for %s\n", tbf->control_ts, dir); |
| 126 | printf("PDCH[%d] is first common for %s\n", tbf->first_common_ts, dir); |
| 127 | } |
| 128 | |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 129 | static void test_alloc_b(int ms_class) |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 130 | { |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 131 | printf("Going to test multislot assignment MS_CLASS=%d\n", ms_class); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 132 | /* |
| 133 | * PDCH is on TS 6,7,8 and we start with a UL allocation and |
| 134 | * then follow two DL allocations (once single, once normal). |
| 135 | * |
| 136 | * Uplink assigned and still available.. |
| 137 | */ |
| 138 | { |
| 139 | BTS the_bts; |
| 140 | struct gprs_rlcmac_bts *bts; |
| 141 | struct gprs_rlcmac_trx *trx; |
| 142 | int tfi; |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 143 | uint8_t trx_no; |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 144 | |
| 145 | gprs_rlcmac_tbf *ul_tbf, *dl_tbf; |
| 146 | |
| 147 | printf("Testing UL then DL assignment.\n"); |
| 148 | |
| 149 | bts = the_bts.bts_data(); |
| 150 | bts->alloc_algorithm = alloc_algorithm_b; |
| 151 | |
| 152 | trx = &bts->trx[0]; |
| 153 | trx->pdch[5].enable(); |
| 154 | trx->pdch[6].enable(); |
| 155 | trx->pdch[7].enable(); |
| 156 | |
| 157 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 158 | OSMO_ASSERT(tfi >= 0); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 159 | ul_tbf = tbf_alloc_ul_tbf(bts, NULL, tfi, trx_no, ms_class, 1); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 160 | OSMO_ASSERT(ul_tbf); |
| 161 | dump_assignment(ul_tbf, "UL"); |
| 162 | |
| 163 | /* assume final ack has not been sent */ |
| 164 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 165 | OSMO_ASSERT(tfi >= 0); |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 166 | dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), tfi, trx_no, ms_class, 0); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 167 | OSMO_ASSERT(dl_tbf); |
| 168 | dump_assignment(dl_tbf, "DL"); |
| 169 | |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 170 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 171 | |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 172 | tbf_free(dl_tbf); |
| 173 | tbf_free(ul_tbf); |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * Test with the other order.. first DL and then UL |
| 178 | */ |
| 179 | { |
| 180 | BTS the_bts; |
| 181 | struct gprs_rlcmac_bts *bts; |
| 182 | struct gprs_rlcmac_trx *trx; |
| 183 | int tfi; |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 184 | uint8_t trx_no; |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 185 | |
Daniel Willmann | 351a573 | 2014-08-07 12:57:44 +0200 | [diff] [blame] | 186 | gprs_rlcmac_ul_tbf *ul_tbf; |
| 187 | gprs_rlcmac_dl_tbf *dl_tbf; |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 188 | |
| 189 | printf("Testing DL then UL assignment followed by update\n"); |
| 190 | |
| 191 | bts = the_bts.bts_data(); |
| 192 | bts->alloc_algorithm = alloc_algorithm_b; |
| 193 | |
| 194 | trx = &bts->trx[0]; |
| 195 | trx->pdch[5].enable(); |
| 196 | trx->pdch[6].enable(); |
| 197 | trx->pdch[7].enable(); |
| 198 | |
| 199 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 200 | OSMO_ASSERT(tfi >= 0); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 201 | dl_tbf = tbf_alloc_dl_tbf(bts, NULL, tfi, trx_no, ms_class, 1); |
Jacob Erlbeck | 767193e | 2015-05-20 12:06:46 +0200 | [diff] [blame] | 202 | dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 203 | OSMO_ASSERT(dl_tbf); |
| 204 | dump_assignment(dl_tbf, "DL"); |
| 205 | |
| 206 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 207 | OSMO_ASSERT(tfi >= 0); |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 208 | ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), tfi, trx_no, ms_class, 0); |
Jacob Erlbeck | 767193e | 2015-05-20 12:06:46 +0200 | [diff] [blame] | 209 | ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); |
Daniel Willmann | 7e994e3 | 2014-08-07 15:49:21 +0200 | [diff] [blame] | 210 | ul_tbf->m_contention_resolution_done = 1; |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 211 | OSMO_ASSERT(ul_tbf); |
| 212 | dump_assignment(ul_tbf, "UL"); |
| 213 | |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 214 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 215 | |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 216 | /* now update the dl_tbf */ |
| 217 | dl_tbf->update(); |
| 218 | dump_assignment(dl_tbf, "DL"); |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 219 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 220 | |
| 221 | tbf_free(dl_tbf); |
| 222 | tbf_free(ul_tbf); |
| 223 | } |
| 224 | |
| 225 | /* Andreas osmocom-pcu example */ |
| 226 | { |
| 227 | BTS the_bts; |
| 228 | struct gprs_rlcmac_bts *bts; |
| 229 | struct gprs_rlcmac_trx *trx; |
| 230 | int tfi; |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 231 | uint8_t trx_no; |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 232 | |
| 233 | gprs_rlcmac_tbf *ul_tbf, *dl_tbf; |
| 234 | |
| 235 | printf("Testing jolly example\n"); |
| 236 | |
| 237 | bts = the_bts.bts_data(); |
| 238 | bts->alloc_algorithm = alloc_algorithm_b; |
| 239 | |
| 240 | trx = &bts->trx[0]; |
| 241 | trx->pdch[1].enable(); |
| 242 | trx->pdch[2].enable(); |
| 243 | trx->pdch[3].enable(); |
| 244 | trx->pdch[4].enable(); |
| 245 | |
| 246 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 247 | OSMO_ASSERT(tfi >= 0); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 248 | ul_tbf = tbf_alloc_ul_tbf(bts, NULL, tfi, trx_no, ms_class, 0); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 249 | OSMO_ASSERT(ul_tbf); |
| 250 | dump_assignment(ul_tbf, "UL"); |
| 251 | |
| 252 | /* assume final ack has not been sent */ |
| 253 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 254 | OSMO_ASSERT(tfi >= 0); |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 255 | dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), tfi, trx_no, ms_class, 0); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 256 | OSMO_ASSERT(dl_tbf); |
| 257 | dump_assignment(dl_tbf, "DL"); |
| 258 | |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 259 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 260 | |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 261 | tbf_free(dl_tbf); |
| 262 | tbf_free(ul_tbf); |
| 263 | } |
| 264 | } |
| 265 | |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 266 | #define ENABLE_PDCH(ts_no, enable_flag, trx) \ |
| 267 | if (enable_flag) \ |
| 268 | trx->pdch[ts_no].enable(); |
| 269 | |
| 270 | static void test_alloc_b(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7, int ms_class) |
| 271 | { |
| 272 | /* we can test the allocation failures differently */ |
| 273 | if (!ts0 && !ts1 && !ts2 && !ts3 && !ts4 && !ts5 && !ts6 && !ts7) |
| 274 | return; |
| 275 | |
| 276 | printf("Mass test: TS0(%c%c%c%c%c%c%c%c)TS7 MS_Class=%d\n", |
| 277 | ts0 ? 'O' : 'x', |
| 278 | ts1 ? 'O' : 'x', |
| 279 | ts2 ? 'O' : 'x', |
| 280 | ts3 ? 'O' : 'x', |
| 281 | ts4 ? 'O' : 'x', |
| 282 | ts5 ? 'O' : 'x', |
| 283 | ts6 ? 'O' : 'x', |
| 284 | ts7 ? 'O' : 'x', ms_class); |
| 285 | fflush(stdout); |
| 286 | |
| 287 | { |
| 288 | BTS the_bts; |
| 289 | struct gprs_rlcmac_bts *bts; |
| 290 | struct gprs_rlcmac_trx *trx; |
| 291 | int tfi; |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 292 | uint8_t trx_no; |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 293 | |
| 294 | gprs_rlcmac_tbf *ul_tbf, *dl_tbf; |
| 295 | |
| 296 | bts = the_bts.bts_data(); |
| 297 | bts->alloc_algorithm = alloc_algorithm_b; |
| 298 | |
| 299 | trx = &bts->trx[0]; |
| 300 | ENABLE_PDCH(0, ts0, trx); |
| 301 | ENABLE_PDCH(1, ts1, trx); |
| 302 | ENABLE_PDCH(2, ts2, trx); |
| 303 | ENABLE_PDCH(3, ts3, trx); |
| 304 | ENABLE_PDCH(4, ts4, trx); |
| 305 | ENABLE_PDCH(5, ts5, trx); |
| 306 | ENABLE_PDCH(6, ts6, trx); |
| 307 | ENABLE_PDCH(7, ts7, trx); |
| 308 | |
| 309 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 310 | |
| 311 | OSMO_ASSERT(tfi >= 0); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 312 | ul_tbf = tbf_alloc_ul_tbf(bts, NULL, tfi, trx_no, ms_class, 1); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 313 | OSMO_ASSERT(ul_tbf); |
| 314 | |
| 315 | /* assume final ack has not been sent */ |
| 316 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 317 | OSMO_ASSERT(tfi >= 0); |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 318 | dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), tfi, trx_no, ms_class, 0); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 319 | OSMO_ASSERT(dl_tbf); |
| 320 | |
| 321 | /* verify that both are on the same ts */ |
| 322 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 323 | |
| 324 | tbf_free(dl_tbf); |
| 325 | tbf_free(ul_tbf); |
| 326 | } |
| 327 | |
| 328 | /** |
| 329 | * Test with the other order.. first DL and then UL |
| 330 | */ |
| 331 | { |
| 332 | BTS the_bts; |
| 333 | struct gprs_rlcmac_bts *bts; |
| 334 | struct gprs_rlcmac_trx *trx; |
| 335 | int tfi; |
Jacob Erlbeck | 1f33294 | 2015-05-04 08:21:17 +0200 | [diff] [blame] | 336 | uint8_t trx_no; |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 337 | |
Daniel Willmann | 351a573 | 2014-08-07 12:57:44 +0200 | [diff] [blame] | 338 | gprs_rlcmac_ul_tbf *ul_tbf; |
| 339 | gprs_rlcmac_dl_tbf *dl_tbf; |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 340 | |
| 341 | bts = the_bts.bts_data(); |
| 342 | bts->alloc_algorithm = alloc_algorithm_b; |
| 343 | |
| 344 | trx = &bts->trx[0]; |
| 345 | ENABLE_PDCH(0, ts0, trx); |
| 346 | ENABLE_PDCH(1, ts1, trx); |
| 347 | ENABLE_PDCH(2, ts2, trx); |
| 348 | ENABLE_PDCH(3, ts3, trx); |
| 349 | ENABLE_PDCH(4, ts4, trx); |
| 350 | ENABLE_PDCH(5, ts5, trx); |
| 351 | ENABLE_PDCH(6, ts6, trx); |
| 352 | ENABLE_PDCH(7, ts7, trx); |
| 353 | |
| 354 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 355 | OSMO_ASSERT(tfi >= 0); |
Daniel Willmann | 48aa0b0 | 2014-07-16 18:54:10 +0200 | [diff] [blame] | 356 | dl_tbf = tbf_alloc_dl_tbf(bts, NULL, tfi, trx_no, ms_class, 1); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 357 | OSMO_ASSERT(dl_tbf); |
Jacob Erlbeck | 767193e | 2015-05-20 12:06:46 +0200 | [diff] [blame] | 358 | dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 359 | |
| 360 | tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 361 | OSMO_ASSERT(tfi >= 0); |
Jacob Erlbeck | e2e004e | 2015-06-18 17:16:26 +0200 | [diff] [blame] | 362 | ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), tfi, trx_no, ms_class, 0); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 363 | OSMO_ASSERT(ul_tbf); |
Jacob Erlbeck | 767193e | 2015-05-20 12:06:46 +0200 | [diff] [blame] | 364 | ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); |
Daniel Willmann | 7e994e3 | 2014-08-07 15:49:21 +0200 | [diff] [blame] | 365 | ul_tbf->m_contention_resolution_done = 1; |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 366 | |
| 367 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 368 | |
| 369 | /* now update the dl_tbf */ |
| 370 | dl_tbf->update(); |
| 371 | OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); |
| 372 | |
Jacob Erlbeck | befc760 | 2015-06-02 12:33:30 +0200 | [diff] [blame] | 373 | OSMO_ASSERT(ul_tbf->ms_class() == ms_class); |
| 374 | OSMO_ASSERT(dl_tbf->ms_class() == ms_class); |
| 375 | |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 376 | tbf_free(dl_tbf); |
| 377 | tbf_free(ul_tbf); |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | static void test_all_alloc_b() |
| 382 | { |
| 383 | /* it is a bit crazy... */ |
| 384 | for (uint8_t ts0 = 0; ts0 < 2; ++ts0) |
| 385 | for (uint8_t ts1 = 0; ts1 < 2; ++ts1) |
| 386 | for (uint8_t ts2 = 0; ts2 < 2; ++ts2) |
| 387 | for (uint8_t ts3 = 0; ts3 < 2; ++ts3) |
| 388 | for (uint8_t ts4 = 0; ts4 < 2; ++ts4) |
| 389 | for (uint8_t ts5 = 0; ts5 < 2; ++ts5) |
| 390 | for (uint8_t ts6 = 0; ts6 < 2; ++ts6) |
| 391 | for (uint8_t ts7 = 0; ts7 < 2; ++ts7) |
| 392 | for (int ms_class = 0; ms_class < 30; ++ms_class) |
| 393 | test_alloc_b(ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ms_class); |
| 394 | } |
| 395 | |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 396 | static void test_alloc_b() |
| 397 | { |
| 398 | for (int i = 0; i < 30; ++i) |
| 399 | test_alloc_b(i); |
Holger Hans Peter Freyther | f3eec04 | 2013-12-26 10:19:18 +0100 | [diff] [blame] | 400 | |
| 401 | test_all_alloc_b(); |
Holger Hans Peter Freyther | c7b998c | 2013-12-25 19:25:10 +0100 | [diff] [blame] | 402 | } |
| 403 | |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 404 | typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, |
| 405 | struct GprsMs *ms, |
| 406 | struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single); |
| 407 | |
| 408 | static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx) |
| 409 | { |
| 410 | return (mask & tx & rx) ? 'C' : |
| 411 | (mask & tx) ? 'U' : |
| 412 | (mask & rx) ? 'D' : |
| 413 | '.'; |
| 414 | } |
| 415 | |
| 416 | enum test_mode { |
| 417 | TEST_MODE_UL_ONLY, |
| 418 | TEST_MODE_DL_ONLY, |
| 419 | TEST_MODE_UL_AND_DL, |
| 420 | TEST_MODE_DL_AND_UL, |
| 421 | TEST_MODE_DL_AFTER_UL, |
| 422 | TEST_MODE_UL_AFTER_DL, |
| 423 | }; |
| 424 | |
| 425 | static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, |
| 426 | enum test_mode mode) |
| 427 | { |
| 428 | struct gprs_rlcmac_bts *bts; |
| 429 | int tfi; |
| 430 | uint8_t trx_no; |
| 431 | |
| 432 | bts = the_bts->bts_data(); |
| 433 | |
| 434 | gprs_rlcmac_tbf *tbf = NULL; |
| 435 | |
| 436 | /* Allocate what is needed first */ |
| 437 | switch (mode) { |
| 438 | case TEST_MODE_UL_ONLY: |
| 439 | case TEST_MODE_DL_AFTER_UL: |
| 440 | case TEST_MODE_UL_AND_DL: |
| 441 | tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); |
| 442 | if (tfi < 0) |
| 443 | return NULL; |
| 444 | tbf = tbf_alloc_ul_tbf(bts, ms, tfi, trx_no, ms_class, 0); |
| 445 | if (tbf == NULL) |
| 446 | return NULL; |
| 447 | break; |
| 448 | case TEST_MODE_DL_ONLY: |
| 449 | case TEST_MODE_UL_AFTER_DL: |
| 450 | case TEST_MODE_DL_AND_UL: |
| 451 | tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); |
| 452 | tbf = tbf_alloc_dl_tbf(bts, ms, tfi, trx_no, ms_class, 0); |
| 453 | if (tbf == NULL) |
| 454 | return NULL; |
| 455 | } |
| 456 | |
| 457 | OSMO_ASSERT(tbf); |
| 458 | OSMO_ASSERT(tbf->ms()); |
| 459 | OSMO_ASSERT(ms == NULL || ms == tbf->ms()); |
| 460 | ms = tbf->ms(); |
| 461 | |
| 462 | GprsMs::Guard guard(ms); |
| 463 | |
Jacob Erlbeck | 14376a7 | 2015-07-07 11:31:28 +0200 | [diff] [blame^] | 464 | /* Continue with what is needed next */ |
| 465 | switch (mode) { |
| 466 | case TEST_MODE_UL_ONLY: |
| 467 | case TEST_MODE_DL_ONLY: |
| 468 | /* We are done */ |
| 469 | break; |
| 470 | |
| 471 | case TEST_MODE_DL_AFTER_UL: |
| 472 | case TEST_MODE_UL_AND_DL: |
| 473 | ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_DL_ONLY); |
| 474 | break; |
| 475 | |
| 476 | case TEST_MODE_UL_AFTER_DL: |
| 477 | case TEST_MODE_DL_AND_UL: |
| 478 | ms = alloc_tbfs(the_bts, ms, ms_class, TEST_MODE_UL_ONLY); |
| 479 | break; |
| 480 | } |
| 481 | |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 482 | /* Optionally delete the TBF */ |
| 483 | switch (mode) { |
| 484 | case TEST_MODE_DL_AFTER_UL: |
| 485 | case TEST_MODE_UL_AFTER_DL: |
| 486 | tbf_free(tbf); |
| 487 | break; |
| 488 | |
| 489 | default: |
| 490 | break; |
| 491 | } |
| 492 | |
Jacob Erlbeck | 14376a7 | 2015-07-07 11:31:28 +0200 | [diff] [blame^] | 493 | return ms; |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 494 | } |
| 495 | |
| 496 | static void test_successive_allocation(algo_t algo, unsigned min_class, |
| 497 | unsigned max_class, enum test_mode mode, |
| 498 | unsigned expect_num, const char *text) |
| 499 | { |
| 500 | BTS the_bts; |
| 501 | struct gprs_rlcmac_bts *bts; |
| 502 | struct gprs_rlcmac_trx *trx; |
| 503 | unsigned counter; |
| 504 | unsigned ms_class = min_class; |
| 505 | |
| 506 | printf("Going to test assignment with many TBF, %s\n", text); |
| 507 | |
| 508 | bts = the_bts.bts_data(); |
| 509 | bts->alloc_algorithm = algo; |
| 510 | |
| 511 | trx = &bts->trx[0]; |
| 512 | trx->pdch[3].enable(); |
| 513 | trx->pdch[4].enable(); |
| 514 | trx->pdch[5].enable(); |
| 515 | trx->pdch[6].enable(); |
| 516 | trx->pdch[7].enable(); |
| 517 | |
| 518 | for (counter = 0; 1; counter += 1) { |
| 519 | gprs_rlcmac_tbf *ul_tbf, *dl_tbf; |
| 520 | uint8_t ul_slots = 0; |
| 521 | uint8_t dl_slots = 0; |
| 522 | unsigned i; |
| 523 | int tfi = -1; |
| 524 | GprsMs *ms; |
| 525 | |
| 526 | ms = alloc_tbfs(&the_bts, NULL, ms_class, mode); |
| 527 | if (!ms) |
| 528 | break; |
| 529 | |
| 530 | ul_tbf = ms->ul_tbf(); |
| 531 | dl_tbf = ms->dl_tbf(); |
| 532 | |
| 533 | if (ul_tbf) { |
| 534 | ul_slots = 1 << ul_tbf->first_common_ts; |
| 535 | tfi = ul_tbf->tfi(); |
| 536 | } else if (dl_tbf) { |
| 537 | ul_slots = 1 << dl_tbf->first_common_ts; |
| 538 | tfi = dl_tbf->tfi(); |
| 539 | } |
| 540 | |
| 541 | for (i = 0; dl_tbf && i < ARRAY_SIZE(dl_tbf->pdch); i += 1) |
| 542 | if (dl_tbf->pdch[i]) |
| 543 | dl_slots |= 1 << i; |
| 544 | |
| 545 | printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", |
| 546 | tfi, ms_class, |
| 547 | get_dir_char(0x01, ul_slots, dl_slots), |
| 548 | get_dir_char(0x02, ul_slots, dl_slots), |
| 549 | get_dir_char(0x04, ul_slots, dl_slots), |
| 550 | get_dir_char(0x08, ul_slots, dl_slots), |
| 551 | get_dir_char(0x10, ul_slots, dl_slots), |
| 552 | get_dir_char(0x20, ul_slots, dl_slots), |
| 553 | get_dir_char(0x40, ul_slots, dl_slots), |
| 554 | get_dir_char(0x80, ul_slots, dl_slots)); |
| 555 | |
| 556 | ms_class += 1; |
| 557 | if (ms_class > max_class) |
| 558 | ms_class = min_class; |
| 559 | } |
| 560 | |
| 561 | printf(" Successfully allocated %d UL TBFs\n", counter); |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 562 | OSMO_ASSERT(counter == expect_num); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | static void test_successive_allocation() |
| 566 | { |
| 567 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 568 | 32, "algorithm A (UL and DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 569 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 570 | 32, "algorithm B class 10 (UL and DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 571 | test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 572 | 32, "algorithm B class 12 (UL and DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 573 | test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, |
Jacob Erlbeck | ed46afd | 2015-07-01 12:19:40 +0200 | [diff] [blame] | 574 | 32, "algorithm B class 1-12 (UL and DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 575 | test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 576 | 32, "algorithm B class 1-29 (UL and DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 577 | |
| 578 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 579 | 32, "algorithm A (DL and UL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 580 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 581 | 32, "algorithm B class 10 (DL and UL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 582 | |
| 583 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 584 | 32, "algorithm A (DL after UL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 585 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 586 | 32, "algorithm B class 10 (DL after UL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 587 | |
| 588 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, |
Jacob Erlbeck | 14376a7 | 2015-07-07 11:31:28 +0200 | [diff] [blame^] | 589 | 7, "algorithm A (UL after DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 590 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 591 | 32, "algorithm B class 10 (UL after DL)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 592 | |
| 593 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 594 | 32, "algorithm A (UL only)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 595 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, |
Jacob Erlbeck | 16c6ecc | 2015-06-30 13:40:18 +0200 | [diff] [blame] | 596 | 32, "algorithm B class 10 (UL only)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 597 | |
| 598 | test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 599 | 32, "algorithm A (DL ONLY)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 600 | test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, |
Jacob Erlbeck | ec47875 | 2015-06-19 16:35:38 +0200 | [diff] [blame] | 601 | 32, "algorithm B class 10 (DL ONLY)"); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 602 | } |
| 603 | |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 604 | int main(int argc, char **argv) |
| 605 | { |
| 606 | tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile AllocTest context"); |
| 607 | if (!tall_pcu_ctx) |
| 608 | abort(); |
| 609 | |
| 610 | msgb_set_talloc_ctx(tall_pcu_ctx); |
| 611 | osmo_init_logging(&gprs_log_info); |
| 612 | log_set_use_color(osmo_stderr_target, 0); |
| 613 | log_set_print_filename(osmo_stderr_target, 0); |
Jacob Erlbeck | 9ec49e2 | 2015-06-29 13:00:20 +0200 | [diff] [blame] | 614 | if (getenv("LOGL_DEBUG")) |
| 615 | log_set_log_level(osmo_stderr_target, LOGL_DEBUG); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 616 | |
| 617 | test_alloc_a(); |
Holger Hans Peter Freyther | 4af3053 | 2013-12-25 19:16:55 +0100 | [diff] [blame] | 618 | test_alloc_b(); |
Jacob Erlbeck | e565564 | 2015-06-29 12:19:52 +0200 | [diff] [blame] | 619 | test_successive_allocation(); |
Holger Hans Peter Freyther | bfdd5f2 | 2013-10-16 17:29:31 +0200 | [diff] [blame] | 620 | return EXIT_SUCCESS; |
| 621 | } |
| 622 | |
| 623 | /* |
| 624 | * stubs that should not be reached |
| 625 | */ |
| 626 | extern "C" { |
| 627 | void l1if_pdch_req() { abort(); } |
| 628 | void l1if_connect_pdch() { abort(); } |
| 629 | void l1if_close_pdch() { abort(); } |
| 630 | void l1if_open_pdch() { abort(); } |
| 631 | } |