Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 1 | /* alloc_algo.h |
| 2 | * |
| 3 | * Copyright (C) 2022 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de> |
| 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 | |
| 16 | #pragma once |
| 17 | |
| 18 | #include <stdbool.h> |
| 19 | #include <stdint.h> |
| 20 | |
Pau Espin Pedrol | a6a972e | 2023-04-20 19:23:50 +0200 | [diff] [blame^] | 21 | #include "tbf.h" |
| 22 | |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 23 | struct gprs_rlcmac_bts; |
Pau Espin Pedrol | a6a972e | 2023-04-20 19:23:50 +0200 | [diff] [blame^] | 24 | struct GprsMs; |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 25 | struct gprs_rlcmac_tbf; |
| 26 | |
| 27 | #ifdef __cplusplus |
| 28 | extern "C" { |
| 29 | #endif |
| 30 | |
Pau Espin Pedrol | a6a972e | 2023-04-20 19:23:50 +0200 | [diff] [blame^] | 31 | struct alloc_resources_req { |
| 32 | /* BTS where to allocate resources */ |
| 33 | struct gprs_rlcmac_bts *bts; |
| 34 | /* MS for which to allocate resources */ |
| 35 | struct GprsMs *ms; |
| 36 | /* Direction of the TBF for which we are allocating resources */ |
| 37 | enum gprs_rlcmac_tbf_direction direction; |
| 38 | /* Whether to allocate only a single (1) TS */ |
| 39 | bool single; |
| 40 | /* Whether to allocate on a specific TRX (>=0) or not (-1) */ |
| 41 | int8_t use_trx; |
| 42 | /* FIXME: this will be removed in the future, tbf struct will be filled |
| 43 | * in by caller of alloc_algorithm(). */ |
| 44 | struct gprs_rlcmac_tbf *tbf; |
| 45 | }; |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 46 | |
Pau Espin Pedrol | a6a972e | 2023-04-20 19:23:50 +0200 | [diff] [blame^] | 47 | int alloc_algorithm_a(const struct alloc_resources_req *req); |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 48 | |
Pau Espin Pedrol | a6a972e | 2023-04-20 19:23:50 +0200 | [diff] [blame^] | 49 | int alloc_algorithm_b(const struct alloc_resources_req *req); |
| 50 | |
| 51 | int alloc_algorithm_dynamic(const struct alloc_resources_req *req); |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 52 | int gprs_alloc_max_dl_slots_per_ms(const struct gprs_rlcmac_bts *bts, uint8_t ms_class); |
| 53 | |
| 54 | #ifdef __cplusplus |
| 55 | } |
| 56 | #endif |