Expect ms object to exist before calling tbf_alloc_ul_tbf()

It's really non-sense from architectural point of view to pass an
optional pointer to the MS holding the TBF and creating it otherwise.
TBFs shouldn't be creating MS they belong too.

This simple change requiring so many code line changes really exhibits
how badly entangled the object relationship is.

Another commit will follow doing the same for dl tbf.

Change-Id: I010aa5877902816ae246e09ad5ad87946f96855c
This commit is contained in:
Pau Espin 2020-05-08 17:44:33 +02:00 committed by pespin
parent f094b46d1c
commit 17402a5902
8 changed files with 105 additions and 103 deletions

View File

@ -753,6 +753,7 @@ int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit,
uint8_t tsc = 0, ta = qta2ta(qta);
uint8_t egprs_ms_class = egprs_mslot_class_from_ra(ra, is_11bit);
bool failure = false;
GprsMs *ms;
rach_frame();
@ -792,9 +793,10 @@ int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit,
"Uplink (AGCH)\n");
}
} else {
ms = ms_alloc(0, egprs_ms_class);
// Create new TBF
/* FIXME: Copy and paste with other routines.. */
tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, egprs_ms_class, true);
tbf = tbf_alloc_ul_tbf(&m_bts, ms, -1, true);
if (!tbf) {
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending "

View File

@ -118,8 +118,7 @@ static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, stru
bts->channel_request_description();
/* This call will register the new TBF with the MS on success */
gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(),
tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms());
gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->ms(), tbf->trx->trx_no, tbf->tlli(), tbf->ta());
/* schedule uplink assignment or reject */
if (ul_tbf) {
@ -552,19 +551,17 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
struct gprs_rlcmac_ul_tbf *ul_tbf = NULL;
struct gprs_rlcmac_dl_tbf *dl_tbf = NULL;
uint32_t tlli = request->ID.u.TLLI;
uint8_t ms_class = 0;
uint8_t egprs_ms_class = 0;
uint8_t ta = GSM48_TA_INVALID;
GprsMs *ms = bts()->ms_by_tlli(tlli);
if (!ms)
ms = bts()->ms_alloc(0, 0); /* ms class updated later */
/* Keep the ms, even if it gets idle temporarily */
GprsMs::Guard guard(ms);
if (ms) {
ul_tbf = ms->ul_tbf();
dl_tbf = ms->dl_tbf();
ta = ms->ta();
}
ul_tbf = ms->ul_tbf();
dl_tbf = ms->dl_tbf();
ta = ms->ta();
/* We got a RACH so the MS was in packet idle mode and thus
* didn't have any active TBFs */
@ -597,20 +594,23 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
bts()->sba()->free_sba(sba);
}
if (request->Exist_MS_Radio_Access_capability2) {
uint8_t ms_class, egprs_ms_class;
ms_class = Decoding::get_ms_class_by_capability(
&request->MS_Radio_Access_capability2);
ms->set_ms_class(ms_class);
egprs_ms_class =
Decoding::get_egprs_ms_class_by_capability(
&request->MS_Radio_Access_capability2);
ms->set_egprs_ms_class(egprs_ms_class);
}
if (!ms_class)
if (!ms->ms_class())
LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n");
if (egprs_ms_class)
if (ms->egprs_ms_class())
LOGP(DRLCMAC, LOGL_NOTICE,
"MS supports EGPRS multislot class %d.\n",
egprs_ms_class);
ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class,
egprs_ms_class, tlli, ta, ms);
ms->egprs_ms_class());
ul_tbf = tbf_alloc_ul(bts_data(), ms, trx_no(), tlli, ta);
if (!ul_tbf) {
handle_tbf_reject(bts_data(), ms, tlli,
@ -626,10 +626,6 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
/* schedule uplink assignment */
TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS);
/* get capabilities */
if (ul_tbf->ms())
ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class);
/* get measurements */
if (ul_tbf->ms()) {
get_meas(meas, request);

View File

@ -415,17 +415,15 @@ void gprs_rlcmac_tbf::update_ms(uint32_t tlli, enum gprs_rlcmac_tbf_direction di
ms()->confirm_tlli(tlli);
}
gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class,
uint32_t tlli, uint8_t ta, GprsMs *ms)
gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx,
uint32_t tlli, uint8_t ta)
{
struct gprs_rlcmac_ul_tbf *tbf;
/* FIXME: Copy and paste with tbf_new_dl_assignment */
/* create new TBF, use same TRX as DL TBF */
/* use multislot class of downlink TBF */
tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class,
false);
tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, false);
if (!tbf) {
LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n");
/* FIXME: send reject */
@ -979,13 +977,14 @@ static void setup_egprs_mode(gprs_rlcmac_bts *bts, GprsMs *ms)
}
}
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class,
uint8_t egprs_ms_class, bool single_slot)
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot)
{
struct gprs_rlcmac_ul_tbf *tbf;
int rc;
if (egprs_ms_class == 0 && bts->egprs_enabled) {
OSMO_ASSERT(ms != NULL);
if (ms->egprs_ms_class() == 0 && bts->egprs_enabled) {
LOGP(DTBF, LOGL_NOTICE, "Not accepting non-EGPRS phone in EGPRS-only mode\n");
bts->bts->tbf_failed_egprs_only();
return NULL;
@ -993,26 +992,21 @@ struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs
LOGP(DTBF, LOGL_DEBUG, "********** UL-TBF starts here **********\n");
LOGP(DTBF, LOGL_INFO, "Allocating UL TBF: MS_CLASS=%d/%d\n",
ms_class, egprs_ms_class);
ms->ms_class(), ms->egprs_ms_class());
tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf);
if (!tbf)
return NULL;
talloc_set_destructor(tbf, ul_tbf_dtor);
new (tbf) gprs_rlcmac_ul_tbf(bts->bts);
if (!ms)
ms = bts->bts->ms_alloc(ms_class, egprs_ms_class);
if (egprs_ms_class > 0 && bts->egprs_enabled) {
if (ms->egprs_ms_class() > 0 && bts->egprs_enabled) {
tbf->enable_egprs();
setup_egprs_mode(bts, ms);
LOGPTBF(tbf, LOGL_INFO, "Enabled EGPRS, mode %s\n", mode_name(ms->mode()));
}
rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot);
rc = setup_tbf(tbf, ms, use_trx, ms->ms_class(), ms->egprs_ms_class(), single_slot);
/* if no resource */
if (rc < 0) {

View File

@ -346,12 +346,10 @@ private:
};
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class,
uint32_t tlli, uint8_t ta, GprsMs *ms);
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts, GprsMs *ms,
int8_t use_trx, uint32_t tlli, uint8_t ta);
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class,
uint8_t egprs_ms_class, bool single_slot);
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, bool single_slot);
struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class,
uint8_t egprs_ms_class, bool single_slot);

View File

@ -44,9 +44,11 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts,
uint8_t use_trx,
uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot)
{
if (dir == GPRS_RLCMAC_UL_TBF && !ms)
ms = bts->bts->ms_alloc(ms_class, egprs_ms_class);
if (dir == GPRS_RLCMAC_UL_TBF)
return tbf_alloc_ul_tbf(bts, ms, use_trx,
ms_class, egprs_ms_class, single_slot);
return tbf_alloc_ul_tbf(bts, ms, use_trx, single_slot);
else
return tbf_alloc_dl_tbf(bts, ms, use_trx,
ms_class, egprs_ms_class, single_slot);
@ -205,6 +207,7 @@ static inline bool test_alloc_b_ul_dl(bool ts0, bool ts1, bool ts2, bool ts3, bo
{
BTS the_bts;
struct gprs_rlcmac_bts *bts = the_bts.bts_data();
GprsMs *ms;
gprs_rlcmac_ul_tbf *ul_tbf;
gprs_rlcmac_dl_tbf *dl_tbf;
@ -215,7 +218,8 @@ static inline bool test_alloc_b_ul_dl(bool ts0, bool ts1, bool ts2, bool ts3, bo
enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7);
ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true);
ms = the_bts.ms_alloc(ms_class, 0);
ul_tbf = tbf_alloc_ul_tbf(bts, ms, -1, true);
if (!ul_tbf)
return false;
@ -247,6 +251,7 @@ static inline bool test_alloc_b_dl_ul(bool ts0, bool ts1, bool ts2, bool ts3, bo
{
BTS the_bts;
struct gprs_rlcmac_bts *bts = the_bts.bts_data();
GprsMs *ms;
gprs_rlcmac_ul_tbf *ul_tbf;
gprs_rlcmac_dl_tbf *dl_tbf;
@ -262,14 +267,14 @@ static inline bool test_alloc_b_dl_ul(bool ts0, bool ts1, bool ts2, bool ts3, bo
return false;
dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF);
ms = dl_tbf->ms();
OSMO_ASSERT(dl_tbf->ms());
OSMO_ASSERT(dl_tbf->ms()->current_trx());
ms->set_ms_class(ms_class);
dump_assignment(dl_tbf, "DL", verbose);
ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0,
false);
ul_tbf = tbf_alloc_ul_tbf(bts, ms, ms->current_trx()->trx_no, false);
if (!ul_tbf)
return false;
@ -297,6 +302,7 @@ static inline bool test_alloc_b_jolly(uint8_t ms_class)
{
BTS the_bts;
struct gprs_rlcmac_bts *bts = the_bts.bts_data();
GprsMs *ms;
int tfi;
uint8_t trx_no;
gprs_rlcmac_tbf *ul_tbf, *dl_tbf;
@ -309,7 +315,8 @@ static inline bool test_alloc_b_jolly(uint8_t ms_class)
tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1);
OSMO_ASSERT(tfi >= 0);
ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, false);
ms = the_bts.ms_alloc(ms_class, 0);
ul_tbf = tbf_alloc_ul_tbf(bts, ms, -1, false);
if (!ul_tbf)
return false;
@ -455,6 +462,8 @@ static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class,
struct gprs_rlcmac_bts *bts;
uint8_t trx_no = -1;
OSMO_ASSERT(ms != NULL);
bts = the_bts->bts_data();
gprs_rlcmac_tbf *tbf = NULL;
@ -471,7 +480,8 @@ static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class,
case TEST_MODE_UL_AND_DL:
if (ms && ms->ul_tbf())
tbf_free(ms->ul_tbf());
tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false);
ms->set_ms_class(ms_class);
tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, false);
if (tbf == NULL)
return NULL;
break;
@ -549,6 +559,8 @@ static unsigned alloc_many_tbfs(BTS *the_bts, unsigned min_class,
uint32_t tlli = counter + 0xc0000000;
ms = the_bts->ms_by_tlli(tlli);
if (!ms)
ms = the_bts->ms_alloc(0, 0);
ms = alloc_tbfs(the_bts, ms, ms_class, mode);
if (!ms)

View File

@ -95,8 +95,7 @@ static void test_tbf_tlli_update()
dl_tbf->set_ta(4);
gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(),
dl_tbf->ms(),
0, 0, 0, false);
dl_tbf->ms(), 0, false);
OSMO_ASSERT(ul_tbf != NULL);
ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF);

View File

@ -1444,9 +1444,9 @@ MSG = 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
Searching for first unallocated TFI: TRX=0
Found TFI=0.
MS requests UL TBF on RACH, so we provide one: ra=0x03 Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -1524,11 +1524,11 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -1606,11 +1606,11 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -1736,11 +1736,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Assignment was on PACCH
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) No downlink ACK received yet
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -1803,11 +1803,11 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -1975,11 +1975,11 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -2059,9 +2059,9 @@ Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344
Searching for first unallocated TFI: TRX=0
Found TFI=0.
MS requests UL TBF on RACH, so we provide one: ra=0x03 Fn=2654275 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -2126,11 +2126,11 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/0
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -3146,13 +3146,13 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
MS supports EGPRS multislot class 1.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/1
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
@ -3238,13 +3238,13 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
MS supports EGPRS multislot class 1.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/1
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
@ -5877,13 +5877,13 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
MS supports EGPRS multislot class 1.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/1
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
@ -6042,13 +6042,13 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
MS supports EGPRS multislot class 1.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/1
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
@ -6180,9 +6180,9 @@ Destroying MS object, TLLI = 0xffeeddcc
=== end test_tbf_epdan_out_of_rx_window ===
=== start test_immediate_assign_rej_multi_block ===
MS requests UL TBF on RACH, so we provide one: ra=0x78 Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6205,9 +6205,9 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0
MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6230,9 +6230,9 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1
MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6255,9 +6255,9 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2
MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6280,9 +6280,9 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3
MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6305,9 +6305,9 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4
MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6330,9 +6330,9 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5
MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6355,9 +6355,9 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6
MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -6387,13 +6387,13 @@ Searching for first unallocated TFI: TRX=0
Found TFI=0.
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
MS supports EGPRS multislot class 1.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=1/1
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS
[UL] Slot Allocation (Algorithm A) for class 1
- Skipping TS 0, because not enabled
@ -7810,9 +7810,9 @@ packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
=== end test_packet_access_rej_epdan ===
=== start test_packet_access_rej_prr ===
MS requests UL TBF on RACH, so we provide one: ra=0x78 Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7835,9 +7835,9 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0
MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7860,9 +7860,9 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1
MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7885,9 +7885,9 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2
MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7910,9 +7910,9 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3
MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7935,9 +7935,9 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4
MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7960,9 +7960,9 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra
TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH)
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5
MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0:
Creating MS object, TLLI = 0x00000000
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=0/0
Creating MS object, TLLI = 0x00000000
[UL] Slot Allocation (Algorithm A) for class 0
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -7986,14 +7986,14 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Upli
- TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6
+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
------------------------- RX : Uplink Control Block -------------------------
Creating MS object, TLLI = 0x00000000
MS requests UL TBF in packet resource request of single block, so we provide one:
MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled!
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11
MS supports EGPRS multislot class 11.
********** UL-TBF starts here **********
Allocating UL TBF: MS_CLASS=11/11
Creating MS object, TLLI = 0x00000000
Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11
Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11
[UL] Slot Allocation (Algorithm A) for class 11
- Skipping TS 0, because not enabled
- Skipping TS 1, because not enabled
@ -8005,7 +8005,6 @@ Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11
- Skipping TS 7, because no USF available
[UL] algo A <single> (suggested TRX: 0): failed to allocate a TS, no USF available
No PDCH resource
Creating MS object, TLLI = 0x00000000
Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed
TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN
Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN)
@ -8014,7 +8013,6 @@ Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for req
TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec, cur_fn=0
Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7)
=== end test_packet_access_rej_prr ===
Destroying MS object, TLLI = 0x00000000
=== start test_packet_access_rej_prr_no_other_tbfs ===
Creating MS object, TLLI = 0x00000000
Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed

View File

@ -674,7 +674,8 @@ static void test_egprs_ul_ack_nack()
the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a;
the_bts.bts_data()->trx[0].pdch[4].enable();
struct gprs_rlcmac_ul_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, true);
GprsMs *ms = the_bts.ms_alloc(1, 1);
struct gprs_rlcmac_ul_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, true);
struct crbb_test crbb_test = {0};
bitvec *rbb = NULL;
unsigned int rbb_size;
@ -779,7 +780,8 @@ void test_immediate_assign_ul0m()
the_bts.bts_data()->trx[0].pdch[4].enable();
the_bts.bts_data()->trx[0].pdch[5].enable();
struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, false);
GprsMs *ms = the_bts.ms_alloc(1, 1);
struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, false);
static uint8_t res[] = { 0x06,
0x3f, /* Immediate Assignment Message Type */
0x10, /* §10.5.2.26 Page Mode and §10.5.2.25b Dedicated mode/TBF */
@ -819,7 +821,8 @@ void test_immediate_assign_ul1s()
the_bts.bts_data()->trx[0].pdch[1].enable();
the_bts.bts_data()->trx[0].pdch[2].enable();
struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), NULL, 0, 1, 1, false);
GprsMs *ms = the_bts.ms_alloc(1, 1);
struct gprs_rlcmac_tbf *tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), ms, 0, false);
static uint8_t res[] = { 0x06,
0x3f, /* Immediate Assignment Message Type */
0x10, /* §10.5.2.26 Page Mode and §10.5.2.25b Dedicated mode/TBF */