aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-04 20:41:51 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-18 12:09:47 +0100
commit4229bb38436f85be794f81e84c153fd530c226f5 (patch)
treebe6e2422a43d552954a7b0a504446b9d70437225
parent46ed6bb11db8ef0073b98c9b0cec5bc6ab8a8c5b (diff)
-rw-r--r--src/encoding.cpp8
-rw-r--r--src/gprs_bssgp_pcu.cpp2
-rw-r--r--src/llc.cpp1
-rw-r--r--src/tbf.cpp18
-rw-r--r--tests/types/TypesTest.cpp6
5 files changed, 32 insertions, 3 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 94799868..87d9c670 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -25,6 +25,10 @@
#include <tbf.h>
#include <gprs_debug.h>
+extern "C" {
+#include <osmocom/core/utils.h>
+}
+
// GSM 04.08 9.1.18 Immediate assignment
int Encoding::write_immediate_assignment(
struct gprs_rlcmac_bts *bts,
@@ -385,7 +389,7 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
tbf->dir.ul.window.update_rbb(&tbf->dir.ul.v_n, rbb);
LOGP(DRLCMACUL, LOGL_DEBUG, "Encoding Ack/Nack for %s "
- "(final=%d)\n", tbf_name(tbf), final);
+ "(final=%d) SSN=%u\n", tbf_name(tbf), final, tbf->dir.ul.window.ssn());
block->PAYLOAD_TYPE = 0x1; // RLC/MAC control block that does not include the optional octets of the RLC/MAC control header
block->RRBP = 0x0; // N+13
@@ -403,6 +407,8 @@ void Encoding::write_packet_uplink_ack(struct gprs_rlcmac_bts *bts,
encode_rbb(rbb, block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.RECEIVED_BLOCK_BITMAP);
+ printf("RBB=%s\n", osmo_hexdump(block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.RECEIVED_BLOCK_BITMAP, ARRAY_SIZE(block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.RECEIVED_BLOCK_BITMAP)));
+
/* rbb is not NULL terminated */
rbb[64] = 0;
LOGP(DRLCMACUL, LOGL_DEBUG, "- V(N): \"%s\" R=Received "
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 93069adb..eeebe3f7 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -430,7 +430,7 @@ int gprs_bssgp_tx_fc_bvc(void)
}
/* FIXME: use real values */
printf("FOR FLOW CONTROL: %zu\n", the_pcu.bts->bts->dl_octets_sent_reset());
- return bssgp_tx_fc_bvc(the_pcu.bctx, 1, 6553500, 400 / 8, 50000, 400 / 8,
+ return bssgp_tx_fc_bvc(the_pcu.bctx, 1, 2250*5 , 400, 2250*5, 400,
NULL, NULL);
}
diff --git a/src/llc.cpp b/src/llc.cpp
index c79f609e..86eb26e7 100644
--- a/src/llc.cpp
+++ b/src/llc.cpp
@@ -78,6 +78,7 @@ void gprs_llc::init()
{
INIT_LLIST_HEAD(&queue);
m_queue_size = 0;
+ m_avg_queue_delay = 0;
reset();
}
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 824aef0c..35d78375 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -99,6 +99,16 @@ int gprs_rlcmac_tbf::append_data(const uint8_t ms_class,
} else {
/* the TBF exists, so we must write it in the queue
* we prepend lifetime in front of PDU */
+
+ /* hack.. honor the force_llc_lifetime.. */
+ if (pdu_delay_csec != 0xffff) {
+ if ((((pdu_delay_csec / 100) * 1000) - 1000) <= m_llc.m_avg_queue_delay) {
+ printf("SILENTLY dropping frame with brute force: %u\n",
+ m_llc.m_avg_queue_delay);
+ return -ENOMEM;
+ }
+ }
+
struct timeval *tv;
struct msgb *llc_msg = msgb_alloc(len + sizeof(*tv) * 2,
"llc_pdu_queue");
@@ -1668,8 +1678,14 @@ void gprs_rlcmac_tbf::maybe_schedule_uplink_acknack(const rlc_ul_header *rh)
if (rh->si || rh->ti || state_is(GPRS_RLCMAC_FINISHED)
|| (dir.ul.rx_counter % SEND_ACK_AFTER_FRAMES) == 0) {
if (rh->si) {
+ char rbb[65];
+ dir.ul.window.update_rbb(&dir.ul.v_n, rbb);
+ rbb[64] = '\0';
LOGP(DRLCMACUL, LOGL_NOTICE, "- Scheduling Ack/Nack, "
- "because MS is stalled.\n");
+ "because MS is stalled: V(Q)=%u V(R)=%u\n V(N)=%s",
+ dir.ul.window.v_q(), dir.ul.window.v_r(), rbb);
+
+ //abort();
}
if (rh->ti) {
LOGP(DRLCMACUL, LOGL_DEBUG, "- Scheduling Ack/Nack, "
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 51aebeef..b8251bc5 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -393,6 +393,12 @@ int main(int argc, char **argv)
test_rlc_v_b();
test_rlc_v_n();
test_rlc_dl_ul_basic();
+
+
+ char rbb[65];
+ uint8_t data[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f };
+ Decoding::extract_rbb(data, rbb);
+ printf("%s\n", rbb);
return EXIT_SUCCESS;
}