1 From 529b104aacaa6164d39e955003718bf15edcf08e Mon Sep 17 00:00:00 2001
2 From: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
3 Date: Mon, 1 Jan 2018 16:06:25 +0200
4 Subject: [PATCH 1/2] xpp: move command_timer functions to xbus-core
6 Would allow to later fully initializing the command_timer in xbus-core.c
7 rather than xbus-pcm.c .
9 drivers/dahdi/xpp/xbus-core.c | 30 ++++++++++++++++++++++++++++++
10 drivers/dahdi/xpp/xbus-pcm.c | 30 ------------------------------
11 2 files changed, 30 insertions(+), 30 deletions(-)
13 diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
14 index 4281f1c..ca129cd 100644
15 --- a/drivers/dahdi/xpp/xbus-core.c
16 +++ b/drivers/dahdi/xpp/xbus-core.c
17 @@ -1350,6 +1350,36 @@ err:
21 +static void xbus_command_timer(unsigned long param)
23 + xbus_t *xbus = (xbus_t *)param;
27 + do_gettimeofday(&now);
28 + xbus_command_queue_tick(xbus);
29 + if (!xbus->self_ticking) /* Must be 1KHz rate */
30 + mod_timer(&xbus->command_timer, jiffies + 1);
33 +void xbus_set_command_timer(xbus_t *xbus, bool on)
35 + XBUS_DBG(SYNC, xbus, "%s\n", (on) ? "ON" : "OFF");
37 + if (!timer_pending(&xbus->command_timer)) {
38 + XBUS_DBG(SYNC, xbus, "add_timer\n");
39 + xbus->command_timer.function = xbus_command_timer;
40 + xbus->command_timer.data = (unsigned long)xbus;
41 + xbus->command_timer.expires = jiffies + 1;
42 + add_timer(&xbus->command_timer);
44 + } else if (timer_pending(&xbus->command_timer)) {
45 + XBUS_DBG(SYNC, xbus, "del_timer\n");
46 + del_timer(&xbus->command_timer);
48 + xbus->self_ticking = !on;
51 bool xbus_setflags(xbus_t *xbus, int flagbit, bool on)
54 diff --git a/drivers/dahdi/xpp/xbus-pcm.c b/drivers/dahdi/xpp/xbus-pcm.c
55 index 32f04fa..3f46780 100644
56 --- a/drivers/dahdi/xpp/xbus-pcm.c
57 +++ b/drivers/dahdi/xpp/xbus-pcm.c
58 @@ -353,36 +353,6 @@ static void xpp_set_syncer(xbus_t *xbus, bool on)
59 (syncer) ? syncer->busname : "NO-SYNC");
62 -static void xbus_command_timer(unsigned long param)
64 - xbus_t *xbus = (xbus_t *)param;
68 - do_gettimeofday(&now);
69 - xbus_command_queue_tick(xbus);
70 - if (!xbus->self_ticking) /* Must be 1KHz rate */
71 - mod_timer(&xbus->command_timer, jiffies + 1);
74 -void xbus_set_command_timer(xbus_t *xbus, bool on)
76 - XBUS_DBG(SYNC, xbus, "%s\n", (on) ? "ON" : "OFF");
78 - if (!timer_pending(&xbus->command_timer)) {
79 - XBUS_DBG(SYNC, xbus, "add_timer\n");
80 - xbus->command_timer.function = xbus_command_timer;
81 - xbus->command_timer.data = (unsigned long)xbus;
82 - xbus->command_timer.expires = jiffies + 1;
83 - add_timer(&xbus->command_timer);
85 - } else if (timer_pending(&xbus->command_timer)) {
86 - XBUS_DBG(SYNC, xbus, "del_timer\n");
87 - del_timer(&xbus->command_timer);
89 - xbus->self_ticking = !on;
93 * Called when the Astribank replies to a sync change request