summaryrefslogtreecommitdiff
path: root/package/lirc-tools/0003-lircd-Remove-use-of-functions-killed-in-kernel-4.8.0.patch
blob: 9fe5256cebcfce565d7ea4c91204a82b32da7132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From 45c590f64dd79e8e1704d5c94ce3456a5cdbfa5f Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Fri, 19 Aug 2016 04:48:02 +0200
Subject: [PATCH] lircd: Remove use of functions killed in kernel 4.8.0

From 4.8.0 the kernel no longer supports LIRC_NOTIFY_DECODE,
LIRC_SETUP_START/LIRC_SETUP_END and several constants related
to initiating filters. Remove corresponding calls from lircd.

[baruch: move DRVCTL_NOTIFY_DECODE into lircd.cpp]
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Patch status: backported from upstream 31fcc8aa39f62c5c
---
 daemons/lircd.cpp | 53 ++++-------------------------------------------------
 1 file changed, 4 insertions(+), 49 deletions(-)

diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp
index 782b6d3f8342..d778aa19308b 100644
--- a/daemons/lircd.cpp
+++ b/daemons/lircd.cpp
@@ -78,6 +78,8 @@
 #define lirc_gid gid_t
 #endif
 
+#define DRVCTL_NOTIFY_DECODE		7
+
 #ifdef DARWIN
 #include <mach/mach_time.h>
 #define CLOCK_REALTIME 0
@@ -462,50 +464,6 @@ static int setup_timeout(void)
 }
 
 
-static int setup_filter(void)
-{
-	int ret1, ret2;
-	lirc_t min_pulse_supported = 0, max_pulse_supported = 0;
-	lirc_t min_space_supported = 0, max_space_supported = 0;
-
-	if (!(curr_driver->features & LIRC_CAN_SET_REC_FILTER))
-		return 1;
-	if (curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_PULSE,
-				     &min_pulse_supported) == -1 ||
-	    curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_PULSE, &max_pulse_supported) == -1
-	    || curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_SPACE, &min_space_supported) == -1
-	    || curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_SPACE, &max_space_supported) == -1) {
-		log_error("could not get filter range");
-		log_perror_err(__func__);
-	}
-
-	if (setup_min_pulse > max_pulse_supported)
-		setup_min_pulse = max_pulse_supported;
-	else if (setup_min_pulse < min_pulse_supported)
-		setup_min_pulse = 0;    /* disable filtering */
-
-	if (setup_min_space > max_space_supported)
-		setup_min_space = max_space_supported;
-	else if (setup_min_space < min_space_supported)
-		setup_min_space = 0;    /* disable filtering */
-
-	ret1 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_PULSE, &setup_min_pulse);
-	ret2 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_SPACE, &setup_min_space);
-	if (ret1 == -1 || ret2 == -1) {
-		if (curr_driver->
-		    drvctl_func(LIRC_SET_REC_FILTER,
-				setup_min_pulse < setup_min_space ? &setup_min_pulse : &setup_min_space) == -1) {
-			log_error("could not set filter");
-			log_perror_err(__func__);
-			return 0;
-		}
-	}
-	return 1;
-}
-
-
-
-
 static int setup_hardware(void)
 {
 	int ret = 1;
@@ -514,10 +472,7 @@ static int setup_hardware(void)
 		if ((curr_driver->features & LIRC_CAN_SET_REC_CARRIER)
 		    || (curr_driver->features & LIRC_CAN_SET_REC_TIMEOUT)
 		    || (curr_driver->features & LIRC_CAN_SET_REC_FILTER)) {
-			(void)curr_driver->drvctl_func(LIRC_SETUP_START, NULL);
-			ret = setup_frequency() && setup_timeout()
-			      && setup_filter();
-			(void)curr_driver->drvctl_func(LIRC_SETUP_END, NULL);
+				ret = setup_frequency() && setup_timeout();
 		}
 	}
 	return ret;
@@ -2162,7 +2117,7 @@ void loop(void)
 			int reps;
 
 			if (curr_driver->drvctl_func && (curr_driver->features & LIRC_CAN_NOTIFY_DECODE))
-				curr_driver->drvctl_func(LIRC_NOTIFY_DECODE, NULL);
+				curr_driver->drvctl_func(DRVCTL_NOTIFY_DECODE, NULL);
 
 			get_release_data(&remote_name, &button_name, &reps);
 
-- 
2.9.3