aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-27 18:10:39 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-15 15:19:42 +0100
commit14e00f8f66faf0c1f551d1d5e4527c51177d6dc8 (patch)
tree97210846ea0dae6ac29692952220acd96b615c79
parent5265f59525157d135c1051f057f836395782c98e (diff)
edge: Extend gprs_rlcmac_dl_tbf::handle by egprs_ms_class
The multislot (MS) class and the EGPRS MS class can also be passed via BSSGP in an MS Radio Access Capability element which can optionally be contained in a DL-UNITDATA PDU. While this case is fully supported for GPRS, the EGPRS MS class in BSSGP messages is ignored. This commit extends gprs_rlcmac_dl_tbf::handle to pass the EGPRS MS class, too. Note, that the EGPRS class is not yet taken from the CSN.1 RA capability and is always set to 0. Note also, that append_data still uses ms_class only. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_bssgp_pcu.cpp4
-rw-r--r--src/tbf.h3
-rw-r--r--src/tbf_dl.cpp6
-rw-r--r--tests/tbf/TbfTest.cpp10
4 files changed, 14 insertions, 9 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index cce184d5..a7391d92 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -148,6 +148,8 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
/* parse ms radio access capability */
uint8_t ms_class = parse_ra_cap_ms_class(tp);
+ /* TODO: Get the EGPRS class from the CSN.1 RA capability */
+ uint8_t egprs_ms_class = 0;
/* get lifetime */
uint16_t delay_csec = 0xffff;
@@ -179,7 +181,7 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
LOGP(DBSSGP, LOGL_INFO, "LLC [SGSN -> PCU] = TLLI: 0x%08x IMSI: %s len: %d\n", tlli, imsi, len);
return gprs_rlcmac_dl_tbf::handle(the_pcu.bts, tlli, tlli_old, imsi,
- ms_class, delay_csec, data, len);
+ ms_class, egprs_ms_class, delay_csec, data, len);
}
int gprs_bssgp_pcu_rx_paging_ps(struct msgb *msg, struct tlv_parsed *tp)
diff --git a/src/tbf.h b/src/tbf.h
index 9775397b..28359269 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -345,7 +345,8 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
static int handle(struct gprs_rlcmac_bts *bts,
const uint32_t tlli, const uint32_t old_tlli,
const char *imsi, const uint8_t ms_class,
- const uint16_t delay_csec, const uint8_t *data, const uint16_t len);
+ const uint8_t egprs_ms_class, const uint16_t delay_csec,
+ const uint8_t *data, const uint16_t len);
int append_data(const uint8_t ms_class,
const uint16_t pdu_delay_csec,
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index d07f3233..3993df3c 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -190,7 +190,8 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
*/
int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts,
const uint32_t tlli, const uint32_t tlli_old, const char *imsi,
- const uint8_t ms_class, const uint16_t delay_csec,
+ const uint8_t ms_class, const uint8_t egprs_ms_class,
+ const uint16_t delay_csec,
const uint8_t *data, const uint16_t len)
{
struct gprs_rlcmac_dl_tbf *dl_tbf = NULL;
@@ -237,11 +238,12 @@ int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts,
if (!dl_tbf) {
rc = tbf_new_dl_assignment(bts, imsi, tlli, tlli_old,
- ms_class, 0, &dl_tbf);
+ ms_class, egprs_ms_class, &dl_tbf);
if (rc < 0)
return rc;
}
+ /* TODO: ms_class vs. egprs_ms_class is not handled here */
rc = dl_tbf->append_data(ms_class, delay_csec, data, len);
dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF);
dl_tbf->assign_imsi(imsi);
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 5ec93573..66fa9825 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -450,7 +450,7 @@ static void test_tbf_exhaustion()
snprintf(imsi, sizeof(imsi), "001001%09d", i);
- rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class,
+ rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class, 0,
delay_csec, buf, sizeof(buf));
if (rc < 0)
@@ -488,7 +488,7 @@ static void test_tbf_dl_llc_loss()
/* Handle LLC frame 1 */
memset(buf, 1, sizeof(buf));
- rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class,
+ rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class, 0,
delay_csec, buf, sizeof(buf));
OSMO_ASSERT(rc >= 0);
@@ -498,7 +498,7 @@ static void test_tbf_dl_llc_loss()
/* Handle LLC frame 2 */
memset(buf, 2, sizeof(buf));
- rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class,
+ rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class, 0,
delay_csec, buf, sizeof(buf));
OSMO_ASSERT(rc >= 0);
@@ -507,7 +507,7 @@ static void test_tbf_dl_llc_loss()
/* Handle LLC frame 3 */
memset(buf, 3, sizeof(buf));
- rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class,
+ rc = gprs_rlcmac_dl_tbf::handle(bts, tlli, 0, imsi, ms_class, 0,
delay_csec, buf, sizeof(buf));
OSMO_ASSERT(rc >= 0);
@@ -693,7 +693,7 @@ static void send_dl_data(BTS *the_bts, uint32_t tlli, const char *imsi,
ms = the_bts->ms_store().get_ms(tlli, 0, imsi);
- gprs_rlcmac_dl_tbf::handle(the_bts->bts_data(), tlli, 0, imsi, 0,
+ gprs_rlcmac_dl_tbf::handle(the_bts->bts_data(), tlli, 0, imsi, 0, 0,
1000, data, data_size);
ms = the_bts->ms_by_imsi(imsi);