aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-07-23 17:58:55 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-07-23 18:25:43 +0200
commit642c7d3f5b3a199cf69b88d21056cbfffd748595 (patch)
treeecda6a45ae3472ec65306fdf7a0a680efc0f5369
parenta1503fa3567e2837d809cd77b857bd617448f2fd (diff)
Fix: We don't use timer to define when assignment is complete on PACCH
Instead we use the event of sending assignment message. Then we set the TBF state to 'FLOW'.
-rw-r--r--src/gprs_rlcmac.h3
-rw-r--r--src/gprs_rlcmac_data.cpp28
2 files changed, 26 insertions, 5 deletions
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 55aef9d..8a8351d 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -93,8 +93,7 @@ extern struct gprs_rlcmac_bts *gprs_rlcmac_bts;
#define RLC_MAX_WS 64 /* max window size */
#define RLC_MAX_LEN 54 /* CS-4 including spare bits */
-#define Tassign_agch 0,500000/* wait for assignment, before transmitting DL */
-#define Tassign_pacch 0,100000/* wait for assignment, before transmitting DL */
+#define Tassign_agch 0,800000/* FIXME: we need a confirm from BTS */
enum gprs_rlcmac_tbf_state {
GPRS_RLCMAC_NULL = 0, /* new created TBF */
diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp
index 2f67bd0..4109161 100644
--- a/src/gprs_rlcmac_data.cpp
+++ b/src/gprs_rlcmac_data.cpp
@@ -174,11 +174,31 @@ int gprs_rlcmac_rcv_control_block(bitvec *rlc_block, uint8_t trx, uint8_t ts,
if (tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) {
LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [UPLINK] DOWNLINK ASSIGNED TFI: %u TLLI: 0x%08x \n", tbf->tfi, tbf->tlli);
tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE;
+ if (tbf->direction == GPRS_RLCMAC_UL_TBF)
+ tbf = tbf_by_tlli(tbf->tlli,
+ GPRS_RLCMAC_DL_TBF);
+ if (!tbf) {
+ LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL "
+ "TBF is gone\n");
+ break;
+ }
+ tbf_new_state(tbf, GPRS_RLCMAC_FLOW);
+ tbf_assign_control_ts(tbf);
break;
}
if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) {
LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [DOWNLINK] UPLINK ASSIGNED TFI: %u TLLI: 0x%08x \n", tbf->tfi, tbf->tlli);
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE;
+ if (tbf->direction == GPRS_RLCMAC_DL_TBF)
+ tbf = tbf_by_tlli(tbf->tlli,
+ GPRS_RLCMAC_UL_TBF);
+ if (!tbf) {
+ LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL "
+ "TBF is gone\n");
+ break;
+ }
+ tbf_new_state(tbf, GPRS_RLCMAC_FLOW);
+ tbf_assign_control_ts(tbf);
break;
}
LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK "
@@ -236,7 +256,7 @@ uplink_request:
ul_tbf->tlli_valid = 1; /* no contention resolution */
ul_tbf->contention_resolution_done = 1;
ul_tbf->ta = tbf->ta; /* use current TA */
- tbf_new_state(ul_tbf, GPRS_RLCMAC_FLOW);
+ tbf_new_state(ul_tbf, GPRS_RLCMAC_ASSIGN);
tbf_timer_start(ul_tbf, 3169, bts->t3169, 0);
/* schedule uplink assignment */
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
@@ -821,6 +841,8 @@ struct msgb *gprs_rlcmac_send_packet_uplink_assignment(
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK;
#else
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE;
+ tbf_new_state(new_tbf, GPRS_RLCMAC_FLOW);
+ tbf_assign_control_ts(new_tbf);
#endif
return msg;
@@ -1420,6 +1442,8 @@ struct msgb *gprs_rlcmac_send_packet_downlink_assignment(
tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK;
#else
tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE;
+ tbf_new_state(new_tbf, GPRS_RLCMAC_FLOW);
+ tbf_assign_control_ts(new_tbf);
#endif
return msg;
@@ -1474,8 +1498,6 @@ void gprs_rlcmac_trigger_downlink_assignment(gprs_rlcmac_tbf *tbf,
tbf->ta = old_tbf->ta;
/* change state */
tbf_new_state(tbf, GPRS_RLCMAC_ASSIGN);
- /* start timer */
- tbf_timer_start(tbf, 0, Tassign_pacch);
#endif
} else {
LOGP(DRLCMAC, LOGL_DEBUG, "Send dowlink assignment for TBF=%d on PCH, no TBF exist (IMSI=%s)\n", tbf->tfi, imsi);