[libpri-commits] rmudgett: branch 1.4 r2109 - /branches/1.4/q921.c
SVN commits to the libpri project
libpri-commits at lists.digium.com
Wed Nov 10 17:47:49 CST 2010
Author: rmudgett
Date: Wed Nov 10 17:47:45 2010
New Revision: 2109
URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2109
Log:
Minor MDL handler changes.
* Clear mdl_error in case we could not schedule the handler callback.
* Change MDL handlers to not return the handled state since the caller did
not care.
Modified:
branches/1.4/q921.c
Modified: branches/1.4/q921.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q921.c?view=diff&rev=2109&r1=2108&r2=2109
==============================================================================
--- branches/1.4/q921.c (original)
+++ branches/1.4/q921.c Wed Nov 10 17:47:45 2010
@@ -1777,9 +1777,8 @@
}
}
-static int q921_mdl_handle_network_error(struct q921_link *link, char error)
-{
- int handled = 0;
+static void q921_mdl_handle_network_error(struct q921_link *link, char error)
+{
struct pri *ctrl;
switch (error) {
@@ -1788,7 +1787,6 @@
case 'G':
case 'H':
q921_mdl_remove(link);
- handled = 1;
break;
case 'A':
case 'B':
@@ -1803,13 +1801,10 @@
pri_error(ctrl, "Network MDL can't handle error of type %c\n", error);
break;
}
-
- return handled;
-}
-
-static int q921_mdl_handle_cpe_error(struct q921_link *link, char error)
-{
- int handled = 0;
+}
+
+static void q921_mdl_handle_cpe_error(struct q921_link *link, char error)
+{
struct pri *ctrl;
switch (error) {
@@ -1818,7 +1813,6 @@
case 'G':
case 'H':
q921_mdl_remove(link);
- handled = 1;
break;
case 'A':
case 'B':
@@ -1833,13 +1827,10 @@
pri_error(ctrl, "CPE MDL can't handle error of type %c\n", error);
break;
}
-
- return handled;
-}
-
-static int q921_mdl_handle_ptp_error(struct q921_link *link, char error)
-{
- int handled = 0;
+}
+
+static void q921_mdl_handle_ptp_error(struct q921_link *link, char error)
+{
struct pri *ctrl;
ctrl = link->ctrl;
@@ -1860,8 +1851,6 @@
ctrl->schedev = 1;
ctrl->ev.gen.e = PRI_EVENT_DCHAN_DOWN;
-
- handled = 1;
break;
case 'A':
case 'B':
@@ -1878,8 +1867,6 @@
pri_error(ctrl, "PTP MDL can't handle error of type %c\n", error);
break;
}
-
- return handled;
}
static void q921_restart_ptp_link_if_needed(struct q921_link *link)
@@ -2031,6 +2018,10 @@
}
link->mdl_error = error;
link->mdl_timer = pri_schedule_event(ctrl, 0, q921_mdl_handle_error_callback, link);
+ if (!link->mdl_timer) {
+ /* Timer allocation failed */
+ link->mdl_error = 0;
+ }
}
static pri_event *q921_ua_rx(struct q921_link *link, q921_h *h)
More information about the libpri-commits
mailing list