tbf: Merge handle_ack_nack() into rcvd_dl_ack()

There's no real use in having those 2 methods separately, and only adds
complexity. Let's merge it to have 1 TBF code path handling DL ACK/NACK.

Change-Id: I546d2e46bda96a2f551b28673464e57831c71828
changes/94/25094/3
Pau Espin 2 years ago
parent afe189e802
commit fbc1baa139
  1. 5
      src/pdch.cpp
  2. 23
      src/tbf_dl.cpp
  3. 1
      src/tbf_dl.h
  4. 4
      tests/tbf/TbfTest.err

@ -450,8 +450,6 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
/* Reset N3101 counter: */
tbf->n_reset(N3101);
if (tbf->handle_ack_nack())
LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n");
pdch_ulc_release_fn(ulc, fn);
LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n");
@ -519,9 +517,6 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
/* Reset N3101 counter: */
tbf->n_reset(N3101);
if (tbf->handle_ack_nack())
LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n");
pdch_ulc_release_fn(ulc, fn);
LOGPTBF(tbf, LOGL_DEBUG,

@ -774,22 +774,6 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, enum CodingScheme cs)
return bsn;
}
bool gprs_rlcmac_dl_tbf::handle_ack_nack()
{
bool ack_recovered = false;
state_fsm.state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK);
if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) {
ack_recovered = true;
}
/* reset N3105 */
n_reset(N3105);
t_stop(T3191, "ACK/NACK received");
return ack_recovered;
}
struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
const uint32_t fn, const uint8_t ts,
int index, int index2)
@ -1200,6 +1184,13 @@ int gprs_rlcmac_dl_tbf::rcvd_dl_ack(bool final_ack, unsigned first_bsn,
int rc;
LOGPTBFDL(this, LOGL_DEBUG, "downlink acknowledge\n");
state_fsm.state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK);
state_fsm.state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK);
/* reset N3105 */
n_reset(N3105);
t_stop(T3191, "ACK/NACK received");
rc = update_window(first_bsn, rbb);
if (final_ack) {

@ -52,7 +52,6 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts, enum mcs_kind req_mcs_kind = EGPRS);
void trigger_ass(struct gprs_rlcmac_tbf *old_tbf);
bool handle_ack_nack();
void request_dl_ack();
bool need_control_ts() const;
bool have_data() const;

@ -526,6 +526,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) starting timer T3191 [final blo
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=216, TS=4
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) msg block (BSN 21, CS-1): 0f 01 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) downlink acknowledge
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) ack: (BSN=21)"R"(BSN=21) R=ACK I=NACK
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................'
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) V(B): (V(A)=22)""(V(S)-1=21) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid
@ -535,7 +536,6 @@ TBF(DL-TFI_0){FINISHED}: state_chg to WAIT_RELEASE
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 100000 microsec, cur_fn=2654167
TBF(DL-TFI_0){WAIT_RELEASE}: Received Event ASSIGN_DEL_CCCH
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) free
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) stopping timer T3191 [freeing TBF]
TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE) stopping timer T3193 [freeing TBF]
PDCH(bts=0,trx=0,ts=4) Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE), 0 TBFs, USFs = 00, TFIs = 00000000.
MS(TLLI=0xffeeddcc, IMSI=, TA=0, 45/0,) Detaching TBF: TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT_RELEASE)
@ -3204,10 +3204,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes
Detected FN jump! 2654288 -> 2654379
PDCH(bts=0,trx=0,ts=7) FN=2654379 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++
PDCH(bts=0,trx=0,ts=7) FN=2654379 ------------------------- RX : Uplink Control Block -------------------------
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) RX: [PCU <- BTS] Packet Downlink Ack/Nack
PDCH(bts=0,trx=0,ts=7) Got GPRS DL ACK bitmap: SSN: 0, BSN 0 to 28 - 1 (28 blocks), "RRRRRRRRRRRRRRRRRRRRRRRRRRRR"
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) downlink acknowledge
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) stopping timer T3191 [ACK/NACK received]
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) ack: (BSN=0)"RRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=27) R=ACK I=NACK
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) DL analysis, range=0:28, lost=0, recv=28, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRRRRRRRRR....................................'
TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) V(B): (V(A)=28)""(V(S)-1=27) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid

Loading…
Cancel
Save