summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2015-03-22 12:28:21 +0000
committerPacho Ramos <pacho@gentoo.org>2015-03-22 12:28:21 +0000
commitf9b6627600c2cd5034a11edc850b842e7986c3e6 (patch)
tree149f08a2e867aad29c565a632a23cdf2fb4d75ef
parentVersion bump, drop old (diff)
downloadgentoo-2-f9b6627600c2cd5034a11edc850b842e7986c3e6.tar.gz
gentoo-2-f9b6627600c2cd5034a11edc850b842e7986c3e6.tar.bz2
gentoo-2-f9b6627600c2cd5034a11edc850b842e7986c3e6.zip
Fix build with recent kernels (#543702 by Toralf Förster, fixes by Roger), drop old
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
-rw-r--r--net-dialup/martian-modem/ChangeLog13
-rw-r--r--net-dialup/martian-modem/files/martian-modem-20100123-linux-3.10.patch70
-rw-r--r--net-dialup/martian-modem/files/martian-modem-20100123-linux-3.8.patch87
-rw-r--r--net-dialup/martian-modem/martian-modem-20100123-r1.ebuild (renamed from net-dialup/martian-modem/martian-modem-20100123.ebuild)29
4 files changed, 186 insertions, 13 deletions
diff --git a/net-dialup/martian-modem/ChangeLog b/net-dialup/martian-modem/ChangeLog
index b80f054e77de..daafb1a770e4 100644
--- a/net-dialup/martian-modem/ChangeLog
+++ b/net-dialup/martian-modem/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-dialup/martian-modem
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/ChangeLog,v 1.2 2013/03/03 19:32:05 pacho Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/ChangeLog,v 1.3 2015/03/22 12:28:21 pacho Exp $
+
+*martian-modem-20100123-r1 (22 Mar 2015)
+
+ 22 Mar 2015; Pacho Ramos <pacho@gentoo.org>
+ +files/martian-modem-20100123-linux-3.10.patch,
+ +files/martian-modem-20100123-linux-3.8.patch,
+ +martian-modem-20100123-r1.ebuild, -martian-modem-20100123.ebuild:
+ Fix build with recent kernels (#543702 by Toralf Förster, fixes by Roger),
+ drop old
03 Mar 2013; Pacho Ramos <pacho@gentoo.org> metadata.xml:
Add to proxy-maintainers herd
diff --git a/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.10.patch b/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.10.patch
new file mode 100644
index 000000000000..27daed03792e
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.10.patch
@@ -0,0 +1,70 @@
+diff -urN martian-full-20100123.orig/kmodule/martian.c martian-full-20100123/kmodule/martian.c
+--- martian-full-20100123.orig/kmodule/martian.c 2015-03-21 16:21:21.228514759 -0400
++++ martian-full-20100123/kmodule/martian.c 2015-03-21 16:29:23.402126727 -0400
+@@ -184,8 +184,12 @@
+ static int martian_open (struct inode *inode, struct file *filp)
+ {
+ // allow single open
+- struct proc_dir_entry *entry = PDE (inode);
+- struct martian *mdev = (struct martian *) entry->data;
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
++ struct martian *mdev = (struct martian *) PDE_DATA (inode);
++ #else
++ struct proc_dir_entry *entry = PDE (inode);
++ struct martian *mdev = (struct martian *) entry->data;
++ #endif
+
+ if (test_and_set_bit (MARTIAN_STATE_OPEN, &mdev->state)) {
+ // already opened
+@@ -736,20 +740,37 @@
+ // create proc entry for this device
+ name[ strlen(name) - 1 ] = '0' + dev_idx;
+
+- mdev->entry = create_proc_entry (name, 0400, NULL);
+- if (! mdev->entry) {
+- MERROR ("martian: failed to create /proc/%s\n", name);
+- ret = -ENOMEM;
+- goto err_free_irq;
+- }
+-
+- martian_init_mcb(mdev);
+-
+- // set an index
+- mdev->index = dev_idx;
+-
+- mdev->entry->proc_fops = & martian_fops;
+- mdev->entry->data = mdev;
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
++ // initialize data before 3.10-style proc create call
++ martian_init_mcb(mdev);
++
++ // set an index
++ mdev->index = dev_idx;
++
++ mdev->entry = proc_create_data (name, 0400, NULL, & martian_fops, mdev);
++ if (! mdev->entry) {
++ MERROR ("martian: failed to create /proc/%s\n", name);
++ ret = -ENOMEM;
++ goto err_free_irq;
++ }
++
++ #else
++
++ mdev->entry = create_proc_entry (name, 0400, NULL);
++ if (! mdev->entry) {
++ MERROR ("martian: failed to create /proc/%s\n", name);
++ ret = -ENOMEM;
++ goto err_free_irq;
++ }
++
++ martian_init_mcb(mdev);
++
++ // set an index
++ mdev->index = dev_idx;
++
++ mdev->entry->proc_fops = & martian_fops;
++ mdev->entry->data = mdev;
++ #endif
+
+ pr_info("martian: added device %x:%x "
+ "BaseAddress = 0x%x, CommAddres = 0x%x, irq = %d%s\n",
diff --git a/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.8.patch b/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.8.patch
new file mode 100644
index 000000000000..077936857047
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem-20100123-linux-3.8.patch
@@ -0,0 +1,87 @@
+diff -urN martian-full-20100123.orig/kmodule/martian.c martian-full-20100123/kmodule/martian.c
+--- martian-full-20100123.orig/kmodule/martian.c 2015-03-21 16:15:55.498819336 -0400
++++ martian-full-20100123/kmodule/martian.c 2015-03-21 16:17:03.769752308 -0400
+@@ -592,7 +592,7 @@
+
+ static int dev_idx = 0;
+
+-static void __devinit
++static void
+ martian_configure_isr (struct martian *mdev)
+ {
+ struct martian_common *mcb = mdev->common;
+@@ -614,7 +614,7 @@
+ mcb->dp_bamil_rd7 = 0xff;
+ }
+
+-static void __devinit
++static void
+ martian_configure_params (struct martian *mdev)
+ {
+ mdev->params.dsp_mars = mdev->metrics.dsp_mars;
+@@ -792,7 +792,7 @@
+
+ /***** PCI Driver Interface *****/
+
+-static int __devinit
++static int
+ martian_device_gatherinfo (const struct pci_dev *dev, const struct pci_device_id *ent, struct martian_metrics *metrics)
+ {
+ int bar;
+@@ -997,7 +997,7 @@
+ return 0;
+ }
+
+-static int __devinit
++static int
+ mars_device_probe (struct pci_dev *dev, const struct pci_device_id *ent)
+ {
+ int ret;
+@@ -1036,7 +1036,7 @@
+ }
+
+
+-static void __devexit mars_remove (struct pci_dev *dev)
++static void mars_remove (struct pci_dev *dev)
+ {
+ martian_del (pci_get_drvdata (dev));
+ pci_disable_device (dev);
+@@ -1048,7 +1048,7 @@
+ struct pci_driver martian_driver = {
+ .name = "martian",
+ .probe = mars_device_probe,
+- .remove = __devexit_p (mars_remove),
++ .remove = mars_remove,
+ .id_table = martian_ids
+ };
+
+@@ -1062,7 +1062,7 @@
+
+ #define SERIAL_DRIVER "serial"
+
+-static void __devinit detach_from_serial_class (unsigned int class, unsigned int mask)
++static void detach_from_serial_class (unsigned int class, unsigned int mask)
+ {
+ struct pci_dev *dev = NULL;
+ const struct pci_device_id *entry;
+@@ -1083,7 +1083,7 @@
+ }
+ }
+
+-static void __devinit detach_from_serial(void)
++static void detach_from_serial(void)
+ {
+ detach_from_serial_class (PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00);
+ detach_from_serial_class (PCI_CLASS_COMMUNICATION_MODEM << 8, 0xffff00);
+diff -urN martian-full-20100123.orig/kmodule/martian_ids.c martian-full-20100123/kmodule/martian_ids.c
+--- martian-full-20100123.orig/kmodule/martian_ids.c 2015-03-21 16:15:48.461826345 -0400
++++ martian-full-20100123/kmodule/martian_ids.c 2015-03-21 16:17:17.167739363 -0400
+@@ -8,7 +8,7 @@
+ .subvendor = (_subvendor), \
+ .subdevice = PCI_ANY_ID
+
+-__devinitdata static struct pci_device_id martian_ids[] = {
++static struct pci_device_id martian_ids[] = {
+ { PCI_DEVICE (PCI_VENDOR_ID_ATT, 0x440) },
+ { PCI_DEVICE (PCI_VENDOR_ID_ATT, 0x441) },
+ { PCI_DEVICE (PCI_VENDOR_ID_ATT, 0x442) },
diff --git a/net-dialup/martian-modem/martian-modem-20100123.ebuild b/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild
index e3a31bea4771..caace7e74b88 100644
--- a/net-dialup/martian-modem/martian-modem-20100123.ebuild
+++ b/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/martian-modem-20100123.ebuild,v 1.1 2012/12/15 16:41:36 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/martian-modem-20100123-r1.ebuild,v 1.1 2015/03/22 12:28:21 pacho Exp $
EAPI=5
inherit linux-mod eutils
@@ -31,20 +31,27 @@ MODULE_NAMES="martian_dev(ltmodem::kmodule)"
CONFIG_CHECK="SERIAL_8250"
SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support."
-pkg_setup() {
- linux-mod_pkg_setup
-
- if kernel_is 2 4; then
- eerror "This driver works only with 2.6 kernels!"
- die "unsupported kernel detected"
- fi
-}
-
src_prepare() {
# Exclude Makefile kernel version check, we used kernel_is above.
# TODO: More exactly, martian-modem-full-20100123 is for >kernel-2.6.20!
epatch "${FILESDIR}/${P}-makefile.patch"
+ # Per Gentoo Bug #543702, CONFIG_HOTPLUG is going away as an option. As of
+ # Linux Kernel 3.8, the __dev* markings need to be removed. This patch removes
+ # the use of __devinit, __devexit_p, and __devexit as the type cast simply isn't
+ # needed any longer.
+ if kernel_is -ge 3 8; then
+ epatch "${FILESDIR}/${P}-linux-3.8.patch"
+ fi
+
+ # Per Gentoo Bug #543702, "proc_dir_entry" and "create_proc_entry" Linux
+ # Kernel header definition was moved and only accessible internally as of
+ # Linux Kernel 3.10. This patch originates from Paul McClay (2014.05.28)
+ # and posted to Ubuntu Launchpad.
+ if kernel_is -ge 3 10; then
+ epatch "${FILESDIR}/${P}-linux-3.10.patch"
+ fi
+
# fix compile on amd64
sed -i -e "/^HOST.*$/s:uname -i:uname -m:" modem/Makefile || die "sed failed"