This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgHello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/6223
to look at the new patch set (#2).
Simplify TS alloc: don't use PDCH for free TFI
Don't use PDCH from free TFI lookup routine. This allows for simpler
function which can be moved to mslot_class.c alongside with other
similar helpers.
Change-Id: Ie154866900453d232a890f7b9a30911b451525a1
Related: OS#2282
---
M src/bts.h
M src/gprs_rlcmac_ts_alloc.cpp
M src/mslot_class.c
M src/mslot_class.h
4 files changed, 21 insertions(+), 19 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/23/6223/2
diff --git a/src/bts.h b/src/bts.h
index 5679b98..f69f738 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -30,6 +30,7 @@
#include <osmocom/core/gsmtap.h>
#include <osmocom/gsm/l1sap.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
+ #include <mslot_class.h>
}
#include "poll_controller.h"
@@ -44,7 +45,6 @@
#define LLC_CODEL_DISABLE 0
#define LLC_CODEL_USE_DEFAULT (-1)
#define MAX_GPRS_CS 9
-#define NO_FREE_TFI 0xffffffff
/* see bts->gsmtap_categ_mask */
enum pcu_gsmtap_category {
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 77c76f9..70b321c 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -58,23 +58,6 @@
return was_set;
}
-static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir)
-{
- uint32_t tfi_map = pdch->assigned_tfi(dir);
- int8_t tfi;
-
- if (tfi_map == NO_FREE_TFI)
- return -1;
-
- /* look for USF, don't use USF=7 */
- for (tfi = 0; tfi < 32; tfi++) {
- if (!(tfi_map & (1 << tfi)))
- return tfi;
- }
-
- return -1;
-}
-
static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask,
const char *mask_reason = NULL)
{
@@ -183,7 +166,7 @@
/* We have found a candidate */
/* Make sure that a TFI is available */
if (free_tfi) {
- tfi = find_free_tfi(pdch, dir);
+ tfi = find_free_tfi(pdch->assigned_tfi(dir));
if (tfi < 0) {
LOGP(DRLCMAC, LOGL_DEBUG,
"- Skipping TS %d, because "
diff --git a/src/mslot_class.c b/src/mslot_class.c
index dad94ae..d403f00 100644
--- a/src/mslot_class.c
+++ b/src/mslot_class.c
@@ -230,6 +230,22 @@
return -1;
}
+/* look for USF, don't use USF=7 */
+int8_t find_free_tfi(uint32_t tfi_map)
+{
+ int8_t tfi;
+
+ if (tfi_map == NO_FREE_TFI)
+ return -1;
+
+ for (tfi = 0; tfi < 32; tfi++) {
+ if (!(tfi_map & (1 << tfi)))
+ return tfi;
+ }
+
+ return -1;
+}
+
void masked_override_with(char *buf, uint8_t mask, char set_char)
{
int i;
diff --git a/src/mslot_class.h b/src/mslot_class.h
index d8b024b..445455f 100644
--- a/src/mslot_class.h
+++ b/src/mslot_class.h
@@ -36,6 +36,8 @@
#define DEFAULT_MSLOT_CLASS 12
+#define NO_FREE_TFI 0xffffffff
+
enum { MASK_TT = 0, MASK_TR = 1 };
/* multislot class selection routines */
@@ -52,5 +54,6 @@
/* multislot allocation helper routines */
void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask);
int8_t find_free_usf(uint8_t usf_map);
+int8_t find_free_tfi(uint32_t tfi_map);
void masked_override_with(char *buf, uint8_t mask, char set_char);
void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask);
--
To view, visit https://gerrit.osmocom.org/6223
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie154866900453d232a890f7b9a30911b451525a1
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder