wip crap..
This commit is contained in:
parent
46ed6bb11d
commit
4229bb3843
|
@ -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 "
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ void gprs_llc::init()
|
|||
{
|
||||
INIT_LLIST_HEAD(&queue);
|
||||
m_queue_size = 0;
|
||||
m_avg_queue_delay = 0;
|
||||
reset();
|
||||
}
|
||||
|
||||
|
|
18
src/tbf.cpp
18
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, "
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue