summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2011-11-06 20:35:48 +0100
committerHarald Welte <laforge@gnumonks.org>2011-11-12 23:23:36 +0100
commit5ac44784b6d725ef34f851d6124190fa848cfe27 (patch)
treeba6361165467890948827b629774be68c6c849da
parenta42b6995163840edb95667bac0a51d3e801b9a2a (diff)
gsm/lapdm: Make T200 timer depends on the link type (SACCH is slower)
This is part of a set of commit to fix LAPDm to handle datalink connection on ACCH (SAPI 3) This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4). Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r--include/osmocom/gsm/lapdm.h2
-rw-r--r--src/gsm/lapdm.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h
index cc9c63f..adffbeb 100644
--- a/include/osmocom/gsm/lapdm.h
+++ b/include/osmocom/gsm/lapdm.h
@@ -127,7 +127,7 @@ const char *get_rsl_name(int value);
extern const char *lapdm_state_names[];
/* initialize a LAPDm entity */
-void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode);
+void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode, int t200);
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode);
/* deinitialize a LAPDm entity */
diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index c77e313..f17560c 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -116,7 +116,7 @@ static int send_rslms_dlsap(struct osmo_dlsap_prim *dp,
struct lapd_msg_ctx *lctx);
static void lapdm_dl_init(struct lapdm_datalink *dl,
- struct lapdm_entity *entity)
+ struct lapdm_entity *entity, int t200)
{
memset(dl, 0, sizeof(*dl));
dl->entity = entity;
@@ -127,18 +127,19 @@ static void lapdm_dl_init(struct lapdm_datalink *dl,
dl->dl.n200_est_rel = N200_EST_REL;
dl->dl.n200 = N200;
dl->dl.t203_sec = 0; dl->dl.t203_usec = 0;
+ dl->dl.t200_sec = t200; dl->dl.t200_usec = 0;
}
/*! \brief initialize a LAPDm entity and all datalinks inside
* \param[in] le LAPDm entity
* \param[in] mode \ref lapdm_mode (BTS/MS)
*/
-void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode)
+void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode, int t200)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(le->datalink); i++)
- lapdm_dl_init(&le->datalink[i], le);
+ lapdm_dl_init(&le->datalink[i], le, t200);
lapdm_entity_set_mode(le, mode);
}
@@ -152,9 +153,9 @@ void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode)
*/
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode)
{
- lapdm_entity_init(&lc->lapdm_acch, mode);
+ lapdm_entity_init(&lc->lapdm_acch, mode, 2);
/* FIXME: this depends on chan type */
- lapdm_entity_init(&lc->lapdm_dcch, mode);
+ lapdm_entity_init(&lc->lapdm_dcch, mode, 1);
}
/*! \brief flush and release all resoures in LAPDm entity */