Use final_ack_sent and contention_resolution_done to define ongoing UL TBF
Both flags can be used to determine wether assignment must be sent on PCH or on AGCH. Before contention resolution is done, mobile will ignore downlink assinment. When final uplink acknowledge was sent, the mobile will go back to PCH after reception of akcnowledge.
This commit is contained in:
parent
4b55962e55
commit
08e93cdc3f
|
@ -177,9 +177,8 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
|
|||
|
||||
/* check for uplink data, so we copy our informations */
|
||||
tbf = tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
|
||||
if (tbf && tbf->contention_resolution_done
|
||||
&& (tbf->state != GPRS_RLCMAC_FINISHED
|
||||
|| tbf->ul_ack_state != GPRS_RLCMAC_UL_ACK_WAIT_ACK)) {
|
||||
if (tbf && tbf->dir.ul.contention_resolution_done
|
||||
&& !tbf->dir.ul.final_ack_sent) {
|
||||
use_trx = tbf->trx;
|
||||
first_ts = tbf->first_ts;
|
||||
ta = tbf->ta;
|
||||
|
|
|
@ -139,7 +139,6 @@ struct gprs_rlcmac_tbf {
|
|||
uint8_t tfi;
|
||||
uint32_t tlli;
|
||||
uint8_t tlli_valid;
|
||||
uint8_t contention_resolution_done; /* set after done */
|
||||
uint8_t trx;
|
||||
uint16_t arfcn;
|
||||
uint8_t tsc;
|
||||
|
@ -187,6 +186,8 @@ struct gprs_rlcmac_tbf {
|
|||
int32_t rx_counter; /* count all received blocks */
|
||||
uint8_t n3103; /* N3103 counter */
|
||||
uint8_t usf[8]; /* list USFs per PDCH (timeslot) */
|
||||
uint8_t contention_resolution_done; /* set after done */
|
||||
uint8_t final_ack_sent; /* set if we sent final ack */
|
||||
} ul;
|
||||
} dir;
|
||||
uint8_t rlc_block[RLC_MAX_SNS/2][RLC_MAX_LEN]; /* block history */
|
||||
|
|
|
@ -256,7 +256,7 @@ uplink_request:
|
|||
}
|
||||
ul_tbf->tlli = tbf->tlli;
|
||||
ul_tbf->tlli_valid = 1; /* no contention resolution */
|
||||
ul_tbf->contention_resolution_done = 1;
|
||||
ul_tbf->dir.ul.contention_resolution_done = 1;
|
||||
ul_tbf->ta = tbf->ta; /* use current TA */
|
||||
tbf_new_state(ul_tbf, GPRS_RLCMAC_ASSIGN);
|
||||
tbf_timer_start(ul_tbf, 3169, bts->t3169, 0);
|
||||
|
@ -586,13 +586,14 @@ struct msgb *gprs_rlcmac_send_uplink_ack(struct gprs_rlcmac_tbf *tbf,
|
|||
|
||||
/* now we must set this flag, so we are allowed to assign downlink
|
||||
* TBF on PACCH. it is only allowed when TLLI is aknowledged. */
|
||||
tbf->contention_resolution_done = 1;
|
||||
tbf->dir.ul.contention_resolution_done = 1;
|
||||
|
||||
if (final) {
|
||||
tbf->poll_state = GPRS_RLCMAC_POLL_SCHED;
|
||||
tbf->poll_fn = (fn + 13) % 2715648;
|
||||
/* waiting for final acknowledge */
|
||||
tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_WAIT_ACK;
|
||||
tbf->dir.ul.final_ack_sent = 1;
|
||||
} else
|
||||
tbf->ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE;
|
||||
|
||||
|
@ -1432,7 +1433,7 @@ struct msgb *gprs_rlcmac_send_packet_downlink_assignment(
|
|||
if (tbf->direction == GPRS_RLCMAC_UL_TBF) {
|
||||
/* be sure to check first, if contention resolution is done,
|
||||
* otherwise we cannot send the assignment yet */
|
||||
if (!tbf->contention_resolution_done) {
|
||||
if (!tbf->dir.ul.contention_resolution_done) {
|
||||
LOGP(DRLCMAC, LOGL_DEBUG, "Cannot assign DL TBF now, "
|
||||
"because contention resolution is not "
|
||||
"finished.\n");
|
||||
|
|
Loading…
Reference in New Issue