aboutsummaryrefslogtreecommitdiffstats
path: root/src/links.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-20 16:30:24 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-20 19:07:16 +0100
commita8ce061d86c3b6bd1f21655edf063a0c8c1a94f0 (patch)
treedb18d3e37565b70545d94c05b14876b689d5f471 /src/links.c
parent2d845fca0c2e3561593e2255dbe7f53fdee9e144 (diff)
mtp: Move the link testing into a new file for mtp_link
The link testing should work under the linkset and if the SLTM is failing the link should be taken down and it should be restarted.
Diffstat (limited to 'src/links.c')
-rw-r--r--src/links.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/links.c b/src/links.c
index f5de581..70418fc 100644
--- a/src/links.c
+++ b/src/links.c
@@ -46,12 +46,14 @@ void mtp_link_down(struct mtp_link *link)
was_up = link->available;
link->available = 0;
+ link->was_up = 0;
one_up = is_one_up(link->set);
/* our linkset is now unsuable */
if (was_up && !one_up)
mtp_linkset_down(link->set);
link->clear_queue(link);
+ mtp_link_stop_link_test(link);
mtp_link_set_init_slc(link->set);
}
@@ -61,10 +63,13 @@ void mtp_link_up(struct mtp_link *link)
one_up = is_one_up(link->set);
link->available = 1;
+ link->was_up = 0;
mtp_link_set_init_slc(link->set);
if (!one_up)
mtp_linkset_up(link->set);
+ else
+ mtp_link_start_link_test(link);
}
void mtp_link_set_sccp_down(struct mtp_link_set *link)