aboutsummaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-lts/kernel-5.9.patch
blob: 75c23a548f508cdb4669727f5db3e1c382a1972b (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
From 4df746fe3ffd6678f36b16c9b0750fa552da92e4 Mon Sep 17 00:00:00 2001
From: Shaun Ruffell <sruffell@sruffell.net>
Date: Mon, 16 Nov 2020 22:01:21 -0600
Subject: [PATCH] Remove support for 32-bit userspace with 64-bit kernel

I am not aware of anyone who tests in this configuration, and I'm not
sure if it currently works. I'll remove any support for the time being
and can add it back in if someone comes forward needing support for it.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
---
 drivers/dahdi/dahdi-base.c |   34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 4fb06d9..9fb0c79 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -7019,17 +7019,6 @@ static int dahdi_ioctl(struct inode *inode, struct file *file,
 }
 #endif
 
-#ifdef HAVE_COMPAT_IOCTL
-static long dahdi_ioctl_compat(struct file *file, unsigned int cmd,
-		unsigned long data)
-{
-	if (cmd == DAHDI_SFCONFIG)
-		return -ENOTTY; /* Not supported yet */
-
-	return dahdi_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 /**
  * _get_next_channo - Return the next taken channel number from the span list.
  * @span:	The span with which to start the search.
@@ -10285,9 +10274,6 @@ static const struct file_operations dahdi_fops = {
 	.release = dahdi_release,
 #ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_unlocked_ioctl,
-#ifdef HAVE_COMPAT_IOCTL
-	.compat_ioctl = dahdi_ioctl_compat,
-#endif
 #else
 	.ioctl   = dahdi_ioctl,
 #endif
@@ -10301,9 +10287,6 @@ static const struct file_operations dahdi_timer_fops = {
 	.release = dahdi_timer_release,
 #ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_timer_unlocked_ioctl,
-#ifdef HAVE_COMPAT_IOCTL
-	.compat_ioctl = dahdi_timer_unlocked_ioctl,
-#endif
 #else
 	.ioctl   = dahdi_timer_ioctl,
 #endif
@@ -10377,24 +10360,10 @@ static int nodev_ioctl(struct inode *inode, struct file *file,
 }
 #endif
 
-#ifdef HAVE_COMPAT_IOCTL
-static long nodev_ioctl_compat(struct file *file, unsigned int cmd,
-		unsigned long data)
-{
-	if (cmd == DAHDI_SFCONFIG)
-		return -ENOTTY; /* Not supported yet */
-
-	return nodev_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 static const struct file_operations nodev_fops = {
 	.owner   = THIS_MODULE,
 #ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = nodev_unlocked_ioctl,
-#ifdef HAVE_COMPAT_IOCTL
-	.compat_ioctl = nodev_ioctl_compat,
-#endif
 #else
 	.ioctl   = nodev_ioctl,
 #endif
@@ -10409,9 +10378,6 @@ static const struct file_operations dahdi_chan_fops = {
 	.release = dahdi_release,
 #ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_unlocked_ioctl,
-#ifdef HAVE_COMPAT_IOCTL
-	.compat_ioctl = dahdi_ioctl_compat,
-#endif
 #else
 	.ioctl   = dahdi_ioctl,
 #endif
-- 
1.7.9.5

From 6d4c748e0470efac90e7dc4538ff3c5da51f0169 Mon Sep 17 00:00:00 2001
From: Shaun Ruffell <sruffell@sruffell.net>
Date: Mon, 16 Nov 2020 22:01:22 -0600
Subject: [PATCH] Remove checks for HAVE_UNLOCKED_IOCTL for kernel >= 5.9

In upstream commit (4e24566a134ea1674 "fs: remove the HAVE_UNLOCKED_IOCTL and
HAVE_COMPAT_IOCTL defines") [1] the kernel removed these defines.

All supported kernels include support for the unlocked_ioctl now, so
DAHDI can also remove these checks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e24566a134ea167441a1ffa3d439a27c

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
---
 drivers/dahdi/dahdi-base.c      |   44 ---------------------------------------
 drivers/dahdi/dahdi_transcode.c |   11 ----------
 2 files changed, 55 deletions(-)

diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 9fb0c79..bb51e9c 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -53,10 +53,6 @@
 #include <linux/ktime.h>
 #include <linux/slab.h>
 
-#if defined(HAVE_UNLOCKED_IOCTL) && defined(CONFIG_BKL)
-#include <linux/smp_lock.h>
-#endif
-
 #include <linux/ppp_defs.h>
 
 #include <asm/atomic.h>
@@ -4069,14 +4065,6 @@ dahdi_timer_unlocked_ioctl(struct file *file, unsigned int cmd,
 	return 0;
 }
 
-#ifndef HAVE_UNLOCKED_IOCTL
-static int dahdi_timer_ioctl(struct inode *inode, struct file *file,
-		unsigned int cmd, unsigned long data)
-{
-	return dahdi_timer_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 static int dahdi_ioctl_getgains(struct file *file, unsigned long data)
 {
 	int res = 0;
@@ -7011,14 +6999,6 @@ exit:
 	return ret;
 }
 
-#ifndef HAVE_UNLOCKED_IOCTL
-static int dahdi_ioctl(struct inode *inode, struct file *file,
-		unsigned int cmd, unsigned long data)
-{
-	return dahdi_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 /**
  * _get_next_channo - Return the next taken channel number from the span list.
  * @span:	The span with which to start the search.
@@ -10272,11 +10252,7 @@ static const struct file_operations dahdi_fops = {
 	.owner   = THIS_MODULE,
 	.open    = dahdi_open,
 	.release = dahdi_release,
-#ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_unlocked_ioctl,
-#else
-	.ioctl   = dahdi_ioctl,
-#endif
 	.poll    = dahdi_poll,
 	.read    = dahdi_no_read,
 	.write   = dahdi_no_write,
@@ -10285,11 +10261,7 @@ static const struct file_operations dahdi_fops = {
 static const struct file_operations dahdi_timer_fops = {
 	.owner   = THIS_MODULE,
 	.release = dahdi_timer_release,
-#ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_timer_unlocked_ioctl,
-#else
-	.ioctl   = dahdi_timer_ioctl,
-#endif
 	.poll    = dahdi_timer_poll,
 	.read    = dahdi_no_read,
 	.write   = dahdi_no_write,
@@ -10352,21 +10324,9 @@ nodev_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long data)
 	return nodev_common("ioctl");
 }
 
-#ifndef HAVE_UNLOCKED_IOCTL
-static int nodev_ioctl(struct inode *inode, struct file *file,
-		unsigned int cmd, unsigned long data)
-{
-	return nodev_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 static const struct file_operations nodev_fops = {
 	.owner   = THIS_MODULE,
-#ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = nodev_unlocked_ioctl,
-#else
-	.ioctl   = nodev_ioctl,
-#endif
 	.read    = nodev_chan_read,
 	.write   = nodev_chan_write,
 	.poll    = nodev_chan_poll,
@@ -10376,11 +10336,7 @@ static const struct file_operations dahdi_chan_fops = {
 	.owner   = THIS_MODULE,
 	.open    = dahdi_open,
 	.release = dahdi_release,
-#ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_unlocked_ioctl,
-#else
-	.ioctl   = dahdi_ioctl,
-#endif
 	.read    = dahdi_chan_read,
 	.write   = dahdi_chan_write,
 	.poll    = dahdi_chan_poll,
diff --git a/drivers/dahdi/dahdi_transcode.c b/drivers/dahdi/dahdi_transcode.c
index a495dcf..6021aac 100644
--- a/drivers/dahdi/dahdi_transcode.c
+++ b/drivers/dahdi/dahdi_transcode.c
@@ -397,13 +397,6 @@ static long dahdi_tc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne
 	};
 }
 
-#ifndef HAVE_UNLOCKED_IOCTL
-static int dahdi_tc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data)
-{
-	return (int)dahdi_tc_unlocked_ioctl(file, cmd, data);
-}
-#endif
-
 static unsigned int dahdi_tc_poll(struct file *file, struct poll_table_struct *wait_table)
 {
 	int ret;
@@ -427,11 +420,7 @@ static struct file_operations __dahdi_transcode_fops = {
 	.owner =   THIS_MODULE,
 	.open =    dahdi_tc_open,
 	.release = dahdi_tc_release,
-#ifdef HAVE_UNLOCKED_IOCTL
 	.unlocked_ioctl  = dahdi_tc_unlocked_ioctl,
-#else
-	.ioctl   = dahdi_tc_ioctl,
-#endif
 	.read =    dahdi_tc_read,
 	.write =   dahdi_tc_write,
 	.poll =    dahdi_tc_poll,
-- 
1.7.9.5