aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-21 17:19:53 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:12 +0100
commit2e3a81e4b3454ec5aa3b332215044008ed8014aa (patch)
tree6717731982c247a1da324f398d0a3bbc8871bf63 /src
parent5c75480e9075b4f60deb220a09507ee41f2479fb (diff)
rlc: Use a pointer instead of repeated selector chains
Currently the same selector chain is used several times in the same function. This commit adds a pointer to Packet_Uplink_Ack_Nack and uses that instead. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r--src/encoding.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 1b6e295..b57117f 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -437,6 +437,7 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
uint8_t final)
{
// Packet Uplink Ack/Nack TS 44.060 11.2.28
+ Packet_Uplink_Ack_Nack_t *acknack;
LOGP(DRLCMACUL, LOGL_DEBUG, "Encoding Ack/Nack for %s "
"(final=%d)\n", tbf_name(tbf), final);
@@ -446,14 +447,16 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
block->SP = final; // RRBP field is valid, if it is final ack
block->USF = 0x0; // Uplink state flag
- block->u.Packet_Uplink_Ack_Nack.MESSAGE_TYPE = 0x9; // Packet Downlink Assignment
- block->u.Packet_Uplink_Ack_Nack.PAGE_MODE = 0x0; // Normal Paging
- block->u.Packet_Uplink_Ack_Nack.UPLINK_TFI = tbf->tfi(); // Uplink TFI
+ acknack = &block->u.Packet_Uplink_Ack_Nack;
- block->u.Packet_Uplink_Ack_Nack.UnionType = 0x0; // PU_AckNack_GPRS = on
+ acknack->MESSAGE_TYPE = 0x9; // Packet Downlink Assignment
+ acknack->PAGE_MODE = 0x0; // Normal Paging
+ acknack->UPLINK_TFI = tbf->tfi(); // Uplink TFI
+
+ /* PU_AckNack_GPRS = on */
+ acknack->UnionType = 0x0;
write_packet_uplink_ack_gprs(bts,
- &block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct,
- tbf, final);
+ &acknack->u.PU_AckNack_GPRS_Struct, tbf, final);
}
unsigned Encoding::write_packet_paging_request(bitvec * dest)