mirror of https://gerrit.osmocom.org/libosmocore
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>
This commit is contained in:
parent
a42b699516
commit
5ac44784b6
|
@ -127,7 +127,7 @@ const char *get_rsl_name(int value);
|
||||||
extern const char *lapdm_state_names[];
|
extern const char *lapdm_state_names[];
|
||||||
|
|
||||||
/* initialize a LAPDm entity */
|
/* 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);
|
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode);
|
||||||
|
|
||||||
/* deinitialize a LAPDm entity */
|
/* deinitialize a LAPDm entity */
|
||||||
|
|
|
@ -116,7 +116,7 @@ static int send_rslms_dlsap(struct osmo_dlsap_prim *dp,
|
||||||
struct lapd_msg_ctx *lctx);
|
struct lapd_msg_ctx *lctx);
|
||||||
|
|
||||||
static void lapdm_dl_init(struct lapdm_datalink *dl,
|
static void lapdm_dl_init(struct lapdm_datalink *dl,
|
||||||
struct lapdm_entity *entity)
|
struct lapdm_entity *entity, int t200)
|
||||||
{
|
{
|
||||||
memset(dl, 0, sizeof(*dl));
|
memset(dl, 0, sizeof(*dl));
|
||||||
dl->entity = entity;
|
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_est_rel = N200_EST_REL;
|
||||||
dl->dl.n200 = N200;
|
dl->dl.n200 = N200;
|
||||||
dl->dl.t203_sec = 0; dl->dl.t203_usec = 0;
|
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
|
/*! \brief initialize a LAPDm entity and all datalinks inside
|
||||||
* \param[in] le LAPDm entity
|
* \param[in] le LAPDm entity
|
||||||
* \param[in] mode \ref lapdm_mode (BTS/MS)
|
* \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;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(le->datalink); 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);
|
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)
|
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 */
|
/* 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 */
|
/*! \brief flush and release all resoures in LAPDm entity */
|
||||||
|
|
Loading…
Reference in New Issue