mtp: Create a method for a link failure to restart the link.
Make sure that a failed link will be restarted by calling the
reset method which should take the link down.
diff --git a/src/mtp_link.c b/src/mtp_link.c
index 20f4785..5423b33 100644
--- a/src/mtp_link.c
+++ b/src/mtp_link.c
@@ -78,7 +78,7 @@
} else {
LOGP(DINP, LOGL_ERROR, "Two missing SLTAs. Restart link: %p\n", link);
bsc_del_timer(&link->t2_timer);
- link->reset(link);
+ mtp_link_failure(link);
}
}
@@ -148,3 +148,9 @@
return 0;
}
+
+void mtp_link_failure(struct mtp_link *link)
+{
+ LOGP(DINP, LOGL_ERROR, "Link has failed. Resetting it: 0x%p\n", link);
+ link->reset(link);
+}