gnrc/tcp : Move GNRC_TCP_RTO_A_DIV to 'CONFIG_'

This commit is contained in:
Akshai M 2020-05-14 16:54:11 +05:30
parent f25c21988d
commit f704a1e5c9
2 changed files with 8 additions and 6 deletions

View File

@ -135,8 +135,8 @@ extern "C" {
/**
* @brief Alpha value for RTO calculation, default is 1/8
*/
#ifndef GNRC_TCP_RTO_A_DIV
#define GNRC_TCP_RTO_A_DIV (8U)
#ifndef CONFIG_GNRC_TCP_RTO_A_DIV
#define CONFIG_GNRC_TCP_RTO_A_DIV (8U)
#endif
/**

View File

@ -454,10 +454,12 @@ int _pkt_acknowledge(gnrc_tcp_tcb_t *tcb, const uint32_t ack)
}
/* If this is a subsequent sample */
else {
tcb->rtt_var = (tcb->rtt_var / GNRC_TCP_RTO_B_DIV) * (GNRC_TCP_RTO_B_DIV-1);
tcb->rtt_var += abs(tcb->srtt - rtt) / GNRC_TCP_RTO_B_DIV;
tcb->srtt = (tcb->srtt / GNRC_TCP_RTO_A_DIV) * (GNRC_TCP_RTO_A_DIV-1);
tcb->srtt += rtt / GNRC_TCP_RTO_A_DIV;
tcb->rtt_var = (tcb->rtt_var / GNRC_TCP_RTO_B_DIV) * \
(GNRC_TCP_RTO_B_DIV-1);
tcb->rtt_var += abs(tcb->srtt - rtt) / \
GNRC_TCP_RTO_B_DIV;
tcb->srtt = (tcb->srtt / CONFIG_GNRC_TCP_RTO_A_DIV) * (CONFIG_GNRC_TCP_RTO_A_DIV-1);
tcb->srtt += rtt / CONFIG_GNRC_TCP_RTO_A_DIV;
}
}
}