summaryrefslogtreecommitdiff
path: root/community/ndiswrapper
diff options
context:
space:
mode:
Diffstat (limited to 'community/ndiswrapper')
-rw-r--r--community/ndiswrapper/PKGBUILD51
-rw-r--r--community/ndiswrapper/linux33.patch50
-rw-r--r--community/ndiswrapper/ndiswrapper.install17
3 files changed, 118 insertions, 0 deletions
diff --git a/community/ndiswrapper/PKGBUILD b/community/ndiswrapper/PKGBUILD
new file mode 100644
index 000000000..873b2ab9b
--- /dev/null
+++ b/community/ndiswrapper/PKGBUILD
@@ -0,0 +1,51 @@
+# $Id: PKGBUILD 79177 2012-10-31 07:25:04Z tpowa $
+# Maintainer: Thorsten Töpper <atsutane-tu@freethoughts.de>
+# Contributor: SpepS <dreamspepser at yahoo dot it>
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+
+_extramodules=extramodules-3.6-ARCH
+pkgname=ndiswrapper
+pkgver=1.57
+pkgrel=26
+pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors."
+license=('GPL')
+arch=('i686' 'x86_64')
+url="http://ndiswrapper.sourceforge.net"
+install=ndiswrapper.install
+depends=('linux>=3.6' 'linux<3.7' 'wireless_tools' 'perl')
+makedepends=('linux-headers')
+provides=("$pkgname-utils" "$pkgname-bin")
+replaces=("$pkgname-utils" "$pkgname-bin")
+source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"
+ "linux33.patch")
+options=('!strip')
+md5sums=('7a401dc540938bf07893c67f418b6152'
+ '061e59a934ca3ae4be55a86d86b2c1f5')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ _kver="$(cat /usr/lib/modules/${_extramodules}/version)"
+
+ # modinfo path fix
+ sed -i "/modinfo/s/s/usr\//" driver/Makefile
+ patch -i "$srcdir/linux33.patch" -N -p0
+
+ # make sure we point to the right build directory
+ sed -i "/^KBUILD/ s,.*,KBUILD = $(readlink -f /usr/lib/modules/$_kver/build)," driver/Makefile
+
+ make KVERS=$_kver
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ _kver="$(cat /usr/lib/modules/${_extramodules}/version)"
+
+ make INST_DIR="usr/lib/modules/$_extramodules" \
+ KVERS=$_kver DESTDIR="$pkgdir/" install
+
+ gzip "$pkgdir/usr/lib/modules/$_extramodules/$pkgname.ko"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/ndiswrapper/linux33.patch b/community/ndiswrapper/linux33.patch
new file mode 100644
index 000000000..3998c8450
--- /dev/null
+++ b/community/ndiswrapper/linux33.patch
@@ -0,0 +1,50 @@
+--- driver/ndis.c 2011-12-31 21:30:16.000000000 +0100
++++ driver/ndis.c.new 2012-04-08 11:14:16.746614153 +0200
+@@ -2654,9 +2654,15 @@
+ (ULONG *idle, ULONG *kernel_user, ULONG *index)
+ {
+ int cpu = smp_processor_id();
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
++ *idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE];
++ *kernel_user = kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM] +
++ kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
++#else
+ *idle = kstat_cpu(cpu).cpustat.idle;
+ *kernel_user = kstat_cpu(cpu).cpustat.system +
+ kstat_cpu(cpu).cpustat.user;
++#endif
+ *index = cpu;
+ }
+
+--- driver/wrapndis.c 2011-12-31 21:30:16.000000000 +0100
++++ driver/wrapndis.c.new 2012-04-08 11:13:00.574116936 +0200
+@@ -1684,6 +1684,7 @@
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+ static u32 ndis_get_rx_csum(struct net_device *dev)
+ {
+ struct ndis_device *wnd = netdev_priv(dev);
+@@ -1735,18 +1736,21 @@
+ else
+ return -EOPNOTSUPP;
+ }
++#endif
+
+ static struct ethtool_ops ndis_ethtool_ops = {
+ .get_drvinfo = ndis_get_drvinfo,
+ .get_link = ndis_get_link,
+ .get_wol = ndis_get_wol,
+ .set_wol = ndis_set_wol,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+ .get_tx_csum = ndis_get_tx_csum,
+ .get_rx_csum = ndis_get_rx_csum,
+ .set_tx_csum = ndis_set_tx_csum,
+ .set_rx_csum = ndis_set_rx_csum,
+ .get_sg = ndis_get_sg,
+ .set_sg = ndis_set_sg,
++#endif
+ };
+
+ static int notifier_event(struct notifier_block *notifier, unsigned long event,
diff --git a/community/ndiswrapper/ndiswrapper.install b/community/ndiswrapper/ndiswrapper.install
new file mode 100644
index 000000000..ef505811a
--- /dev/null
+++ b/community/ndiswrapper/ndiswrapper.install
@@ -0,0 +1,17 @@
+post_install()
+{
+ post_upgrade
+}
+
+post_upgrade()
+{
+ EXTRAMODULES='extramodules-3.6-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_remove()
+{
+ post_upgrade
+}
+
+# vim:set ts=2 sw=2 et: