[dahdi-commits] dahdi/linux.git branch "next" updated.
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Mon Feb 24 04:49:38 CST 2020
branch "next" has been updated
via 90e8a54e3a482c3cee6afc6b430bb0aab7ee8f34 (commit)
via 26fb7c34cba98c08face72cf29b70dfdc71449c6 (commit)
via 34b9c77c9ab2794d4e912461e4c1080c4b1f6184 (commit)
from c98f59eead28cf66b271b031288542e34e603c43 (commit)
Summary of changes:
.gitignore | 2 ++
docker-compose.yml | 57 ++++++++++++++++++++++++++++++++
drivers/dahdi/dahdi-base.c | 9 +++++
drivers/dahdi/dahdi_dynamic_ethmf.c | 18 +++++++---
drivers/dahdi/wctdm24xxp/xhfc.c | 4 ++-
drivers/dahdi/xpp/card_bri.c | 23 ++++++++++---
drivers/dahdi/xpp/card_fxo.c | 25 ++++++++++----
drivers/dahdi/xpp/card_fxs.c | 35 +++++++++++++++++---
drivers/dahdi/xpp/xbus-core.c | 62 ++++++++++++++++++++++++++++-------
drivers/dahdi/xpp/xpp_dahdi.c | 23 ++++++++++---
drivers/dahdi/xpp/xpp_usb.c | 26 +++++++++++----
include/dahdi/kernel.h | 11 +++++--
test/docker/centos6 | 10 ++++++
test/docker/centos7 | 10 ++++++
test/docker/debianstable | 12 +++++++
test/docker/debiantesting | 12 +++++++
test/docker/fedorarawhide | 11 +++++++
test/test-build.sh | 41 +++++++++++++++++++++++
18 files changed, 345 insertions(+), 46 deletions(-)
create mode 100644 docker-compose.yml
create mode 100644 test/docker/centos6
create mode 100644 test/docker/centos7
create mode 100644 test/docker/debianstable
create mode 100644 test/docker/debiantesting
create mode 100644 test/docker/fedorarawhide
create mode 100755 test/test-build.sh
- Log -----------------------------------------------------------------
commit 90e8a54e3a482c3cee6afc6b430bb0aab7ee8f34
Author: Shaun Ruffell <sruffell at sruffell.net>
Date: Sun Feb 23 19:39:26 2020 -0600
Add docker-compose.yml to be used for compile tests
Ideally this will be expanded in order to simplify compilation tests of
DAHDI on supported distributions.
Signed-off-by: Shaun Ruffell <sruffell at sruffell.net>
diff --git a/.gitignore b/.gitignore
index 2bb0aea..1db8b9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
/.pc
+.cache.mk
*.[oa]
*.mod
*.mod.[oc]
@@ -16,6 +17,7 @@ cscope.*
*.symvers
*.markers
.*.o.d
+*.ur-safe
README.html
modules.order
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..8474a48
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,57 @@
+version: '3'
+services:
+
+ test-centos7:
+ build:
+ context: ./
+ dockerfile: test/docker/centos7
+ volumes:
+ - ./:/source
+ network_mode: "host"
+ security_opt:
+ - label=type:container_runtime_t
+ tty: true
+
+ test-centos6:
+ build:
+ context: ./
+ dockerfile: test/docker/centos6
+ volumes:
+ - ./:/source
+ network_mode: "host"
+ security_opt:
+ - label=type:container_runtime_t
+ tty: true
+
+ test-debianstable:
+ build:
+ context: ./
+ dockerfile: test/docker/debianstable
+ volumes:
+ - ./:/source
+ network_mode: "host"
+ security_opt:
+ - label=type:container_runtime_t
+ tty: true
+
+ test-debiantesting:
+ build:
+ context: ./
+ dockerfile: test/docker/debiantesting
+ volumes:
+ - ./:/source
+ network_mode: "host"
+ security_opt:
+ - label=type:container_runtime_t
+ tty: true
+
+ test-fedorarawhide:
+ build:
+ context: ./
+ dockerfile: test/docker/fedorarawhide
+ volumes:
+ - ./:/source
+ network_mode: "host"
+ security_opt:
+ - label=type:container_runtime_t
+ tty: true
diff --git a/test/docker/centos6 b/test/docker/centos6
new file mode 100644
index 0000000..cab2d90
--- /dev/null
+++ b/test/docker/centos6
@@ -0,0 +1,10 @@
+FROM centos:6
+
+RUN yum update -y
+RUN yum install -y \
+ gcc \
+ git \
+ make \
+ wget
+RUN yum install -y kernel-devel
+CMD ["/source/test/test-build.sh"]
diff --git a/test/docker/centos7 b/test/docker/centos7
new file mode 100644
index 0000000..c7bab9b
--- /dev/null
+++ b/test/docker/centos7
@@ -0,0 +1,10 @@
+FROM centos:7
+
+RUN yum update -y
+RUN yum install -y \
+ gcc \
+ git \
+ make \
+ wget
+RUN yum install -y kernel-devel.x86_64 0:3.10.0-1062.12.1
+CMD ["/source/test/test-build.sh"]
diff --git a/test/docker/debianstable b/test/docker/debianstable
new file mode 100644
index 0000000..ec5dd39
--- /dev/null
+++ b/test/docker/debianstable
@@ -0,0 +1,12 @@
+FROM debian:stable
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update && apt-get install -y \
+ gcc \
+ git \
+ linux-headers-amd64 \
+ make \
+ wget
+
+CMD ["/source/test/test-build.sh"]
diff --git a/test/docker/debiantesting b/test/docker/debiantesting
new file mode 100644
index 0000000..eb38601
--- /dev/null
+++ b/test/docker/debiantesting
@@ -0,0 +1,12 @@
+FROM debian:testing
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update && apt-get install -y \
+ gcc \
+ git \
+ linux-headers-amd64 \
+ make \
+ wget
+
+CMD ["/source/test/test-build.sh"]
diff --git a/test/docker/fedorarawhide b/test/docker/fedorarawhide
new file mode 100644
index 0000000..08df5d8
--- /dev/null
+++ b/test/docker/fedorarawhide
@@ -0,0 +1,11 @@
+FROM fedora:rawhide
+
+RUN dnf update -y && dnf install -y \
+ diffutils \
+ gcc \
+ git \
+ kmod \
+ make \
+ wget
+RUN dnf update -y && dnf install -y kernel-devel
+CMD ["/source/test/test-build.sh"]
diff --git a/test/test-build.sh b/test/test-build.sh
new file mode 100755
index 0000000..cdb2b07
--- /dev/null
+++ b/test/test-build.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -e
+
+if [ "$1" != "" ]; then
+ JOBS=$1
+fi
+
+if command -v apt >/dev/null; then
+ if [ ! -e /root/last-update ]; then
+ date > /root/last-update
+ fi
+ if [ -z "$(find /root/last-update -mmin -60)" ]; then
+ apt-get update && apt-get install -y linux-headers-amd64
+ date > /root/last-update
+ fi
+ KERNELS=$(find /usr/src -maxdepth 1 -type d -name 'linux-headers-*' -not -name '*common*')
+else
+ if command -v dnf > /dev/null ; then
+ dnf update kernel-devel
+ else
+ yum update kernel-devel
+ fi
+ KERNELS=$(find /usr/src/kernels -maxdepth 1 -type d -regextype sed -regex '.*[.]\(el\|fc\).*')
+fi
+
+if [ "$KERNELS" = "" ]; then
+ echo >&2 "Failed to find any kernels"
+ exit 1
+fi
+
+# Copy the source into the container so we can run builds in parallel
+rm -fr /root/code
+cp -fr /source /root/code
+cd /root/code
+
+for KSRC in $KERNELS ; do
+ echo "Building against $KSRC"
+ export KSRC=$KSRC
+ make -s clean
+ make -s -j $(grep -c "^processor" /proc/cpuinfo)
+done
commit 26fb7c34cba98c08face72cf29b70dfdc71449c6
Author: Shaun Ruffell <sruffell at sruffell.net>
Date: Sun Feb 23 19:39:25 2020 -0600
wctdm24xxp: Fix uninitialized variable warning.
gcc 10.x detected the following use of an uninitialized variable:
../drivers/dahdi/wctdm24xxp/xhfc.c: In function 'wctdm_init_b400m':
../drivers/dahdi/wctdm24xxp/xhfc.c:624:5: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
624 | if (*lastreg != (unsigned char)addr) {
| ^
../drivers/dahdi/wctdm24xxp/xhfc.c:2557:20: note: 'x' was declared here
2557 | unsigned char id, x;
|
Signed-off-by: Shaun Ruffell <sruffell at sruffell.net>
diff --git a/drivers/dahdi/wctdm24xxp/xhfc.c b/drivers/dahdi/wctdm24xxp/xhfc.c
index d37fbd5..45339f2 100644
--- a/drivers/dahdi/wctdm24xxp/xhfc.c
+++ b/drivers/dahdi/wctdm24xxp/xhfc.c
@@ -2558,9 +2558,10 @@ static int b400m_probe(struct wctdm *wc, int modpos)
struct b400m *b4;
unsigned long flags;
int chiprev;
+ u8 lastreg = 0;
wctdm_setreg(wc, &wc->mods[modpos], 0x10, 0x10);
- id = xhfc_getreg(wc, &wc->mods[modpos], R_CHIP_ID, &x);
+ id = xhfc_getreg(wc, &wc->mods[modpos], R_CHIP_ID, &lastreg);
/* chip ID high 7 bits must be 0x62, see datasheet */
if ((id & 0xfe) != 0x62)
@@ -2575,6 +2576,7 @@ static int b400m_probe(struct wctdm *wc, int modpos)
/* card found, enabled and main struct allocated. Fill it out. */
b4->wc = wc;
+ b4->lastreg = lastreg;
b4->position = modpos;
/* which B400M in the system is this one? count all of them found so
commit 34b9c77c9ab2794d4e912461e4c1080c4b1f6184
Author: Shaun Ruffell <sruffell at sruffell.net>
Date: Sun Feb 23 19:39:24 2020 -0600
Use proc_ops on kernels >= 5.6
In commit (d56c0d45f0e27 "proc: decouple proc from VFS with "struct proc_ops"")
[1], proc_create_data no longer takes a file_operations structure, but instead
takes a struct proc_ops in order to conserve memory in the kernel.
This change is necessary for DAHDI to work with kernels >= 5.6
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d56c0d45f0e27f814e87a1676b6bd
Signed-off-by: Shaun Ruffell <sruffell at sruffell.net>
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index d05eff9..4fb06d9 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -1015,6 +1015,14 @@ static int dahdi_proc_open(struct inode *inode, struct file *file)
return single_open(file, dahdi_seq_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops dahdi_proc_ops = {
+ .proc_open = dahdi_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations dahdi_proc_ops = {
.owner = THIS_MODULE,
.open = dahdi_proc_open,
@@ -1022,6 +1030,7 @@ static const struct file_operations dahdi_proc_ops = {
.llseek = seq_lseek,
.release = single_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#endif
diff --git a/drivers/dahdi/dahdi_dynamic_ethmf.c b/drivers/dahdi/dahdi_dynamic_ethmf.c
index b729079..022afc7 100644
--- a/drivers/dahdi/dahdi_dynamic_ethmf.c
+++ b/drivers/dahdi/dahdi_dynamic_ethmf.c
@@ -733,12 +733,22 @@ static int ztdethmf_proc_open(struct inode *inode, struct file *file)
return single_open(file, ztdethmf_proc_show, NULL);
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops ztdethmf_proc_fops = {
+ .proc_open = ztdethmf_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = seq_release,
+};
+#else
static const struct file_operations ztdethmf_proc_fops = {
- .open = ztdethmf_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release,
+ .owner = THIS_MODULE,
+ .open = ztdethmf_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#endif
static int __init ztdethmf_init(void)
diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c
index 12efecf..5d819ca 100644
--- a/drivers/dahdi/xpp/card_bri.c
+++ b/drivers/dahdi/xpp/card_bri.c
@@ -153,8 +153,12 @@ static int write_state_register(xpd_t *xpd, __u8 value);
static bool bri_packet_is_valid(xpacket_t *pack);
static void bri_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_bri_info_ops;
+#else
static const struct file_operations proc_bri_info_ops;
#endif
+#endif
static int bri_spanconfig(struct file *file, struct dahdi_span *span,
struct dahdi_lineconfig *lc);
static int bri_chanconfig(struct file *file, struct dahdi_chan *chan,
@@ -1740,13 +1744,22 @@ static int proc_bri_info_open(struct inode *inode, struct file *file)
return single_open(file, proc_bri_info_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_bri_info_ops = {
+ .proc_open = proc_bri_info_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations proc_bri_info_ops = {
- .owner = THIS_MODULE,
- .open = proc_bri_info_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = proc_bri_info_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#endif
static int bri_xpd_probe(struct device *dev)
diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c
index 1dbd299..82dbb7a 100644
--- a/drivers/dahdi/xpp/card_fxo.c
+++ b/drivers/dahdi/xpp/card_fxo.c
@@ -107,9 +107,13 @@ enum fxo_leds {
static bool fxo_packet_is_valid(xpacket_t *pack);
static void fxo_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_fxo_info_ops;
+#else
static const struct file_operations proc_fxo_info_ops;
+#endif
#ifdef WITH_METERING
-static const struct file_operations proc_xpd_metering_ops;
+static const struct proc_ops proc_xpd_metering_ops;
#endif
#endif
static void dahdi_report_battery(xpd_t *xpd, lineno_t chan);
@@ -1484,13 +1488,22 @@ static int proc_fxo_info_open(struct inode *inode, struct file *file)
return single_open(file, proc_fxo_info_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_fxo_info_ops = {
+ .proc_open = proc_fxo_info_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations proc_fxo_info_ops = {
- .owner = THIS_MODULE,
- .open = proc_fxo_info_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = proc_fxo_info_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif
#ifdef WITH_METERING
static int proc_xpd_metering_show(struct seq_file *sfile, void *not_used)
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c
index a3a9233..bb1c169 100644
--- a/drivers/dahdi/xpp/card_fxs.c
+++ b/drivers/dahdi/xpp/card_fxs.c
@@ -160,11 +160,19 @@ enum neon_state {
static bool fxs_packet_is_valid(xpacket_t *pack);
static void fxs_packet_dump(const char *msg, xpacket_t *pack);
#ifdef CONFIG_PROC_FS
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_fxs_info_ops;
+#else
static const struct file_operations proc_fxs_info_ops;
+#endif
#ifdef WITH_METERING
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_xpd_metering_ops;
+#else
static const struct file_operations proc_xpd_metering_ops;
#endif
#endif
+#endif
static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos);
#define PROC_FXS_INFO_FNAME "fxs_info"
@@ -2115,13 +2123,22 @@ static int proc_fxs_info_open(struct inode *inode, struct file *file)
return single_open(file, proc_fxs_info_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_fxs_info_ops = {
+ .proc_open = proc_fxs_info_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations proc_fxs_info_ops = {
- .owner = THIS_MODULE,
- .open = proc_fxs_info_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = proc_fxs_info_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif
#ifdef WITH_METERING
static ssize_t proc_xpd_metering_write(struct file *file,
@@ -2165,12 +2182,20 @@ static int proc_xpd_metering_open(struct inode *inode, struct file *file)
file->private_data = PDE_DATA(inode);
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_xpd_metering_ops = {
+ .proc_open = proc_xpd_metering_open,
+ .proc_write = proc_xpd_metering_write,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations proc_xpd_metering_ops = {
.owner = THIS_MODULE,
.open = proc_xpd_metering_open,
.write = proc_xpd_metering_write,
.release = single_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#endif
#endif
diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c
index fc4ce7b..ed7c0f9 100644
--- a/drivers/dahdi/xpp/xbus-core.c
+++ b/drivers/dahdi/xpp/xbus-core.c
@@ -50,8 +50,15 @@ static const char rcsid[] = "$Id$";
#ifdef PROTOCOL_DEBUG
#ifdef CONFIG_PROC_FS
#define PROC_XBUS_COMMAND "command"
+
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_xbus_command_ops;
+#else
static const struct file_operations proc_xbus_command_ops;
+#endif /* DAHDI_HAVE_PROC_OPS */
+
#endif
+
#endif
/* Command line parameters */
@@ -65,8 +72,15 @@ static DEF_PARM_BOOL(dahdi_autoreg, 0, 0444,
"Register devices automatically (1) or not (0). UNUSED.");
#ifdef CONFIG_PROC_FS
+
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xbus_read_proc_ops;
+#else
static const struct file_operations xbus_read_proc_ops;
-#endif
+#endif /* DAHDI_HAVE_PROC_OPS */
+
+#endif /* CONFIG_PROC_FS */
+
static void transport_init(xbus_t *xbus, struct xbus_ops *ops,
ushort max_send_size,
struct device *transport_device, void *priv);
@@ -1828,13 +1842,22 @@ static int xbus_read_proc_open(struct inode *inode, struct file *file)
return single_open(file, xbus_proc_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xbus_read_proc_ops = {
+ .proc_open = xbus_read_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations xbus_read_proc_ops = {
- .owner = THIS_MODULE,
- .open = xbus_read_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = xbus_read_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#ifdef PROTOCOL_DEBUG
static ssize_t proc_xbus_command_write(struct file *file,
@@ -1927,11 +1950,19 @@ static int proc_xbus_command_open(struct inode *inode, struct file *file)
return 0;
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops proc_xbus_command_ops = {
+ .proc_open = proc_xbus_command_open,
+ .proc_write = proc_xbus_command_write,
+};
+#else
static const struct file_operations proc_xbus_command_ops = {
.owner = THIS_MODULE,
.open = proc_xbus_command_open,
.write = proc_xbus_command_write,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
+
#endif
static int xpp_proc_read_show(struct seq_file *sfile, void *data)
@@ -1961,13 +1992,22 @@ static int xpp_proc_read_open(struct inode *inode, struct file *file)
return single_open(file, xpp_proc_read_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xpp_proc_read_ops = {
+ .proc_open = xpp_proc_read_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations xpp_proc_read_ops = {
- .owner = THIS_MODULE,
- .open = xpp_proc_read_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = xpp_proc_read_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif /* DAHDI_HAVE_PROC_OPS */
#endif
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c
index ecc272b..fd8b835 100644
--- a/drivers/dahdi/xpp/xpp_dahdi.c
+++ b/drivers/dahdi/xpp/xpp_dahdi.c
@@ -103,8 +103,12 @@ int total_registered_spans(void)
}
#ifdef CONFIG_PROC_FS
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xpd_read_proc_ops;
+#else
static const struct file_operations xpd_read_proc_ops;
#endif
+#endif
/*------------------------- XPD Management -------------------------*/
@@ -392,13 +396,22 @@ static int xpd_read_proc_open(struct inode *inode, struct file *file)
return single_open(file, xpd_read_proc_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xpd_read_proc_ops = {
+ .proc_open = xpd_read_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations xpd_read_proc_ops = {
- .owner = THIS_MODULE,
- .open = xpd_read_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = xpd_read_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif
#endif
diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c
index 1a591b1..bae2f57 100644
--- a/drivers/dahdi/xpp/xpp_usb.c
+++ b/drivers/dahdi/xpp/xpp_usb.c
@@ -227,9 +227,14 @@ static void xpp_receive_callback(struct urb *urb);
static int xusb_probe(struct usb_interface *interface,
const struct usb_device_id *id);
static void xusb_disconnect(struct usb_interface *interface);
-#ifdef CONFIG_PROC_FS
+
+#ifdef CONFIG_PROC_FS
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xusb_read_proc_ops;
+#else
static const struct file_operations xusb_read_proc_ops;
#endif
+#endif
/*------------------------------------------------------------------*/
@@ -1108,13 +1113,22 @@ static int xusb_read_proc_open(struct inode *inode, struct file *file)
return single_open(file, xusb_read_proc_show, PDE_DATA(inode));
}
+#ifdef DAHDI_HAVE_PROC_OPS
+static const struct proc_ops xusb_read_proc_ops = {
+ .proc_open = xusb_read_proc_open,
+ .proc_read = seq_read,
+ .proc_lseek = seq_lseek,
+ .proc_release = single_release,
+};
+#else
static const struct file_operations xusb_read_proc_ops = {
- .owner = THIS_MODULE,
- .open = xusb_read_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
+ .owner = THIS_MODULE,
+ .open = xusb_read_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
};
+#endif
#endif
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index cf629eb..dc16f81 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -62,6 +62,8 @@
#define HAVE_NET_DEVICE_OPS
#endif
+#define DAHDI_HAVE_PROC_OPS
+
/* __dev* were removed in 3.8. They still have effect in 2.6.18. */
#ifndef __devinit
# define __devinit
@@ -1369,6 +1371,10 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
/*! Maximum audio mask */
#define DAHDI_FORMAT_AUDIO_MASK ((1 << 16) - 1)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
+
+#undef DAHDI_HAVE_PROC_OPS
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
#ifndef TIMER_DATA_TYPE
@@ -1479,14 +1485,13 @@ static inline void *PDE_DATA(const struct inode *inode)
#endif /* 4.10.0 */
#endif /* 4.11.0 */
#endif /* 4.13.0 */
-#else /* >= 4.15.0 */
+#endif /* 4.15.0 */
+#endif /* 5.6 */
#ifndef TIMER_DATA_TYPE
#define TIMER_DATA_TYPE struct timer_list *
#endif
-#endif /* 4.15.0 */
-
#ifndef dahdi_ktime_equal
static inline int dahdi_ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
{
-----------------------------------------------------------------------
--
dahdi/linux.git
More information about the dahdi-commits
mailing list