aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-07 16:04:29 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:14 +0100
commit166c9fc82708f1965265251225632d3e3b20f529 (patch)
tree91ad71821f0703fb07edbcb978eb216becaf42c7 /src
parent7b579978749c4c21acd711b1b48b1579bc225d48 (diff)
edge: Support EGPRS in write_packet_downlink_assignment
Add an use_egprs parameter to write_packet_downlink_assignment and add the EGPRS related fields if it is set to true. The window size is fixed at 64 blocks, link quality measurement reports have been disabled, and the other optional fields are not present. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r--src/encoding.cpp22
-rw-r--r--src/encoding.h8
-rw-r--r--src/tbf.cpp3
3 files changed, 25 insertions, 8 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index acd8f43..fdc8d0a 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -269,12 +269,15 @@ void Encoding::write_packet_uplink_assignment(
/* generate downlink assignment */
-void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_t old_tfi,
- uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf, uint8_t poll,
- uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts)
+void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block,
+ uint8_t old_tfi, uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf,
+ uint8_t poll, uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts,
+ bool use_egprs)
{
// Packet downlink assignment TS 44.060 11.2.7
+ PDA_AdditionsR99_t *pda_r99;
+
uint8_t tn;
block->PAYLOAD_TYPE = 0x1; // RLC/MAC control block that does not include the optional octets of the RLC/MAC control header
@@ -338,7 +341,18 @@ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_
block->u.Packet_Downlink_Assignment.Exist_TBF_Starting_Time = 0x0; // TBF Starting TIME = off
block->u.Packet_Downlink_Assignment.Exist_Measurement_Mapping = 0x0; // Measurement_Mapping = off
- block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x0; // AdditionsR99 = off
+ if (!use_egprs) {
+ block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x0; // AdditionsR99 = off
+ return;
+ }
+ block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x1; // AdditionsR99 = on
+ pda_r99 = &block->u.Packet_Downlink_Assignment.AdditionsR99;
+ pda_r99->Exist_EGPRS_Params = 1;
+ pda_r99->EGPRS_WindowSize = 0; /* 64, see TS 44.060, table 12.5.2.1 */
+ pda_r99->LINK_QUALITY_MEASUREMENT_MODE = 0x0; /* no meas, see TS 44.060, table 11.2.7.2 */
+ pda_r99->Exist_BEP_PERIOD2 = 0; /* No extra EGPRS BEP PERIOD */
+ pda_r99->Exist_Packet_Extended_Timing_Advance = 0;
+ pda_r99->Exist_COMPACT_ReducedMA = 0;
}
/* generate paging request */
diff --git a/src/encoding.h b/src/encoding.h
index ce17d6f..ff62bc9 100644
--- a/src/encoding.h
+++ b/src/encoding.h
@@ -50,9 +50,11 @@ public:
struct gprs_rlcmac_ul_tbf *tbf, uint8_t poll, uint8_t alpha,
uint8_t gamma, int8_t ta_idx, int8_t use_egprs);
- static void write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_t old_tfi,
- uint8_t old_downlink, struct gprs_rlcmac_tbf *tbf, uint8_t poll,
- uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts);
+ static void write_packet_downlink_assignment(RlcMacDownlink_t * block,
+ uint8_t old_tfi, uint8_t old_downlink,
+ struct gprs_rlcmac_tbf *tbf, uint8_t poll, uint8_t alpha,
+ uint8_t gamma, int8_t ta_idx, uint8_t ta_ts,
+ bool use_egprs);
static void encode_rbb(const char *show_rbb, uint8_t *rbb);
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 0da0557..8fac767 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -871,7 +871,8 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn)
RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t);
Encoding::write_packet_downlink_assignment(mac_control_block, m_tfi,
(direction == GPRS_RLCMAC_DL_TBF), new_dl_tbf,
- poll_ass_dl, bts_data()->alpha, bts_data()->gamma, -1, 0);
+ poll_ass_dl, bts_data()->alpha, bts_data()->gamma, -1, 0,
+ is_egprs_enabled());
LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++\n");
encode_gsm_rlcmac_downlink(ass_vec, mac_control_block);
LOGPC(DCSN1, LOGL_NOTICE, "\n");