diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-03-24 18:36:24 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-03-24 18:41:45 +0100 |
commit | 679a8d0b75fe2db44cacdcd56b11aec3803ca521 (patch) | |
tree | 482f72354bc4705b2f7f202474dd0c76e32c0e18 | |
parent | bc4b0bbe123c673880be370162c25aabebbae15a (diff) |
mtp: Allow to skip SLTM on links (e.g. m3ua)
For M3UA links we can't send SLTM messages but we can
assume that the link is fine. Add a flag that a link
can set in case SLTM should be skipped. The linkset will
then directly wait for routable DPCs and bring the
SCCP part up.
-rw-r--r-- | include/mtp_data.h | 6 | ||||
-rw-r--r-- | src/mtp_layer3.c | 4 | ||||
-rw-r--r-- | src/mtp_link.c | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/include/mtp_data.h b/include/mtp_data.h index b6d031c..9d53f24 100644 --- a/include/mtp_data.h +++ b/include/mtp_data.h @@ -144,6 +144,9 @@ struct mtp_link { int (*reset)(struct mtp_link *data); int (*clear_queue)(struct mtp_link *data); + /* for M3UA and others.. */ + int skip_link_test; + /* private data */ enum ss7_link_type type; void *data; @@ -190,4 +193,7 @@ struct mtp_link_set *mtp_link_set_num(struct bsc_data *bsc, int num); struct mtp_link *mtp_link_alloc(struct mtp_link_set *set); struct mtp_link *mtp_link_num(struct mtp_link_set *set, int num); +/* linkset handling */ +int mtp_link_verified(struct mtp_link *link); + #endif diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index 92e8f41..238a3f1 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -231,7 +231,7 @@ static int send_tfa(struct mtp_link *link, int opc) return 0; } -static int linkset_up(struct mtp_link *link) +int mtp_link_verified(struct mtp_link *link) { struct mtp_link_set *set = link->set; @@ -394,7 +394,7 @@ static int mtp_link_regular_msg(struct mtp_link *link, struct mtp_level_3_hdr *h case MTP_TST_MSG_SLTA: /* If this link is proven set it up */ if (mtp_link_slta(link, l3_len, mng) == 0) - linkset_up(link); + mtp_link_verified(link); break; } break; diff --git a/src/mtp_link.c b/src/mtp_link.c index 3a2683a..9b84e63 100644 --- a/src/mtp_link.c +++ b/src/mtp_link.c @@ -132,6 +132,15 @@ void mtp_link_start_link_test(struct mtp_link *link) return; } + if (link->skip_link_test) { + LOGP(DINP, LOGL_ERROR, "Skipping starting linktest on %d/%s of %d/%s.\n", + link->nr, link->name, link->set->nr, link->set->name); + link->sltm_pending = 0; + link->was_up = 1; + mtp_link_verified(link); + return; + } + mtp_sltm_t2_timeout(link); } |