summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-10-30 16:11:35 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2012-10-30 16:11:35 +0100
commit570c9716c2681490dfdebf2fba32722e25cc9cc6 (patch)
tree62c2b7f9a75d3b0d53c7524504744501dd5795e6
parent07f83456460a2cdb8d288ac647f04a5bc09dc1cf (diff)
Fix: Change T200 of LAPDm if SAPI 0 and SAPI 3 share bandwidth on SDCCH
We use 1 second on FACCH and 2 seconds on SACCH when SMS is transfered during a call on TCH. There is no impact on bandwidth, because SAPIs use differen channels. In order to correctly transfer SMS during SDCCH, the T200 must be raised from 1 (SAPI 0) to 2 (SAPI 0 and 3), so T200 will not timeout before receiving acknowledge from BTS. This is because both SAPIs share the same ressource on SDCCH. After release of SAPI 3, T200 is lowered back to 1.
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h5
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c6
-rw-r--r--src/host/layer23/src/mobile/gsm48_rr.c31
3 files changed, 42 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index 38ac361..2012169 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -5,6 +5,11 @@
#define GSM_TA_CM 55385
+#define T200_DCCH 1 /* SDCCH/FACCH */
+#define T200_DCCH_SHARED 2 /* SDCCH shares SAPI 0 and 3 */
+#define T200_ACCH 2 /* SACCH SAPI 3 */
+
+
/* GSM 04.07 9.1.2 */
#define GSM48_RR_EST_REQ 0x10
#define GSM48_RR_EST_IND 0x12
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index d911ab3..dc57c31 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -167,6 +167,12 @@ int mobile_init(struct osmocom_ms *ms)
gsm_settings_arfcn(ms);
lapdm_channel_init(&ms->lapdm_channel, LAPDM_MODE_MS);
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI3].dl.t200_sec =
+ T200_DCCH_SHARED;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI3].dl.t200_usec = 0;
+ ms->lapdm_channel.lapdm_acch.datalink[DL_SAPI3].dl.t200_sec =
+ T200_ACCH;
+ ms->lapdm_channel.lapdm_acch.datalink[DL_SAPI3].dl.t200_usec = 0;
lapdm_channel_set_l1(&ms->lapdm_channel, l1ctl_ph_prim_cb, ms);
gsm_sim_init(ms);
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index bc24469..3648860 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -3284,6 +3284,11 @@ static int gsm48_rr_dl_est(struct osmocom_ms *ms)
gsm48_rr_activate_channel(ms, &rr->cd_now, ma, ma_len);
#endif
+ /* set T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec = 0;
+
/* start establishmnet */
return gsm48_send_rsl(ms, RSL_MT_EST_REQ, nmsg, 0);
}
@@ -3623,6 +3628,11 @@ static int gsm48_rr_tx_ass_cpl(struct osmocom_ms *ms, uint8_t cause)
/* RR_CAUSE */
ac->rr_cause = cause;
+ /* set T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec = 0;
+
return gsm48_send_rsl(ms, RSL_MT_RES_REQ, nmsg, 0);
}
@@ -3990,6 +4000,11 @@ static int gsm48_rr_tx_hando_cpl(struct osmocom_ms *ms, uint8_t cause)
// FIXME: mobile observed time
+ /* set T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec = 0;
+
return gsm48_send_rsl(ms, RSL_MT_RES_REQ, nmsg, 0);
}
@@ -5025,6 +5040,13 @@ static int gsm48_rr_estab_ind_sapi3(struct osmocom_ms *ms, struct msgb *msg)
LOGP(DSUM, LOGL_INFO, "Radio link SAPI3 is established\n");
+ if ((link_id & 0xf8) == 0x00) {
+ /* raise T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH_SHARED;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec= 0;
+ }
+
/* send inication to upper layer */
nmsg = gsm48_rr_msgb_alloc(GSM48_RR_EST_IND);
if (!nmsg)
@@ -5101,6 +5123,11 @@ static int gsm48_rr_rel_ind_sapi3(struct osmocom_ms *ms, struct msgb *msg)
LOGP(DSUM, LOGL_INFO, "Radio link SAPI3 is released\n");
+ /* lower T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec = 0;
+
/* send inication to upper layer */
nmsg = gsm48_rr_msgb_alloc(GSM48_RR_REL_IND);
if (!nmsg)
@@ -5140,6 +5167,10 @@ static int gsm48_rr_est_req_sapi3(struct osmocom_ms *ms, struct msgb *msg)
LOGP(DRR, LOGL_INFO, "Requesting DCCH link, because no TCH "
"(sapi %d)\n", sapi);
rr->sapi3_link_id = 0x00 | sapi; /* SAPI 3, DCCH */
+ /* raise T200 of SAPI 0 */
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_sec =
+ T200_DCCH_SHARED;
+ ms->lapdm_channel.lapdm_dcch.datalink[DL_SAPI0].dl.t200_usec= 0;
} else {
LOGP(DRR, LOGL_INFO, "Requesting ACCH link, because TCH "
"(sapi %d)\n", sapi);