aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 16:39:52 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:38 +0100
commitbe80c3670ec03f9fd15a8a2b82b77398751910b1 (patch)
tree4b73cc63e653e9d6d19a0afe8c348ff92f1b4bca /src
parent2647a337a8343ab1cbb9bb17f918df2db98864e7 (diff)
edge: Support EGPRS in IMM ASSIGNMENT
Tell the MS to use EGPRS if EGPRS is enabled on the TBF. Note that only downlink TBF will be supported so far. Thus single-phase uplink assignments may not work properly. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r--src/encoding.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 7cabb71..e3e1245 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -72,6 +72,14 @@ static int write_ia_rest_downlink(
bitvec_write_field(dest, wp,0x0,1); // P0 not present
// bitvec_write_field(dest, wp,0x1,1); // P0 not present
// bitvec_write_field(dest, wp,0xb,4);
+ if (tbf->is_egprs_enabled()) {
+ /* see GMS 44.018, 10.5.2.16 */
+ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32;
+ bitvec_write_field_lh(dest, wp, 1, 1); // "H"
+ bitvec_write_field(dest, wp, ws_enc,5); // EGPRS Window Size
+ bitvec_write_field(dest, wp, 0x0,2); // LINK_QUALITY_MEASUREMENT_MODE
+ bitvec_write_field(dest, wp, 0,1); // BEP_PERIOD2 not present
+ }
return 0;
}
@@ -82,6 +90,8 @@ static int write_ia_rest_uplink(
uint8_t usf, uint32_t fn,
uint8_t alpha, uint8_t gamma, int8_t ta_idx)
{
+ OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled());
+
// GMS 04.08 10.5.2.37b 10.5.2.16
bitvec_write_field_lh(dest, wp, 3, 2); // "HH"
bitvec_write_field(dest, wp, 0, 2); // "0" Packet Uplink Assignment
@@ -126,6 +136,17 @@ static int write_ia_rest_uplink(
return 0;
}
+static int write_ia_rest_egprs_uplink(
+ gprs_rlcmac_ul_tbf *tbf,
+ bitvec * dest, unsigned& wp,
+ uint8_t usf, uint32_t fn,
+ uint8_t alpha, uint8_t gamma, int8_t ta_idx)
+{
+ LOGP(DRLCMACUL, LOGL_ERROR,
+ "EGPRS Packet Uplink Assignment is not yet implemented\n");
+ return -EINVAL;
+}
+
/*
* Immediate assignment, sent on the CCCH/AGCH
* see GSM 04.08, 9.1.18 and GSM 44.018, 9.1.18 + 10.5.2.16
@@ -185,6 +206,10 @@ int Encoding::write_immediate_assignment(
rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, wp,
polling, fn,
alpha, gamma, ta_idx);
+ else if (as_ul_tbf(tbf) && as_ul_tbf(tbf)->is_egprs_enabled())
+ rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, wp,
+ usf, fn,
+ alpha, gamma, ta_idx);
else
rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp,
usf, fn,