Commit 36f61365 authored by philm's avatar philm

merge kernel-dev to testing

- update kernel to 3.2-series
- extramodules get installed to '/lib/modules/'
- tuxonice tools kept in kernel-dev for now
parent a4a9cbce
......@@ -5,20 +5,21 @@
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# Find the kernel name inside the chroot
_kernver=`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_extramodules=extramodules-`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_kver="$(cat /lib/modules/${_extramodules}/version)"
pkgname=acpi_call
pkgver=20111101
pkgver=20120115
pkgrel=2
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
arch=('i686' 'x86_64')
url=("http://github.com/mkottman/acpi_call")
license=('GPL')
depends=('linux>=3.1' 'linux<3.2' 'linux-headers')
depends=('linux>=3.2' 'linux<3.3' 'linux-headers')
makedepends=('git')
install=acpi_call.install
source=(http://chakra.sourceforge.net/sources/${pkgname}/${pkgname}-${pkgver}.tar.xz)
md5sums=('dc6c7af743a0f0a643195bdc21860af0')
md5sums=('129841dd806887492609214462792413')
# create tarball: source PKGBUILD && mksource
......@@ -40,7 +41,7 @@ build() {
cd ${srcdir}/$pkgname-build
sed \
-e 's/$(shell uname -r)/3.1-CHAKRA/g' \
-e 's/$(shell uname -r)/3.2-CHAKRA/g' \
-i Makefile
make
}
......@@ -56,11 +57,11 @@ package() {
install -Dm644 README \
${pkgdir}/usr/share/$pkgname/README
msg2 "Building module for $_kernver..."
msg2 "Building module for $_kver..."
# KDIR is necessary even when cleaning
make KDIR=/usr/src/linux-${_kernver} clean
make KDIR=/usr/src/linux-${_kernver}
make KDIR=/usr/src/linux-${_kver} clean
make KDIR=/usr/src/linux-${_kver}
install -D -m644 acpi_call.ko ${pkgdir}/lib/modules/${_kernver}/kernel/drivers/acpi/acpi_call.ko
install -D -m644 acpi_call.ko $pkgdir/lib/modules/$_extramodules/acpi_call.ko
}
......@@ -5,40 +5,61 @@
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# Find the kernel name inside the chroot
_kernver=`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_extramodules=extramodules-`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_kver="$(cat /lib/modules/${_extramodules}/version)"
pkgname=broadcom-wl
pkgver=5.100.82.112
pkgrel=3
pkgrel=4
pkgdesc='Broadcom 802.11abgn hybrid Linux networking device driver'
arch=('i686' 'x86_64')
url='http://www.broadcom.com/support/802.11/linux_sta.php'
license=('custom')
depends=('linux>=3.1' 'linux<3.2')
depends=('linux>=3.2' 'linux<3.3')
makedepends=('linux-headers')
[ "$CARCH" = 'x86_64' ] && ARCH=x86_64 || ARCH=x86_32
pkgdesc='Broadcom 802.11abgn hybrid Linux networking device driver'
url='http://www.broadcom.com/support/802.11/linux_sta.php'
arch=('i686' 'x86_64')
license=('custom')
depends=('linux')
makedepends=('linux-headers')
[[ $CARCH = x86_64 ]] && ARCH=x86_64 || ARCH=x86_32
source=("http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_${ARCH}-v${pkgver//./_}.tar.gz"
'modprobe.d'
'linux3.patch'
'linux3.2.patch'
'license.patch'
'semaphore.patch')
sha1sums=('01aa32f9e85621253a3f15cf4361bb80d41da3e8'
'89bf92286ede30dd85304c6c4e42e89cfdc0f60a'
'3e18f905bbe5e8b99a53d6ecb3b80a919f3531f2'
'229f41b7c371842bf9c1c81b03f34ee32fcb3310'
'ea7b67982ddc0f56fd3becb9914fd4458fe7d373'
'105f8e1d48ebe1f25d53859e5ab9326a27435c66')
[ "$CARCH" = 'x86_64' ] && sha1sums[0]='5bd78c20324e6a4aa9f3fafdc6f0155e884d5131'
[[ $CARCH = x86_64 ]] && sha1sums[0]='5bd78c20324e6a4aa9f3fafdc6f0155e884d5131'
backup=('etc/modprobe.d/broadcom-wl.conf')
install=install
build() {
cd "$srcdir"
patch -p1 < license.patch
patch -p1 < semaphore.patch
make -C /lib/modules/$_kernver/build M=`pwd`
}
cd "${srcdir}"
patch -p1 -i linux3.patch
patch -p0 src/wl/sys/wl_linux.c < linux3.2.patch
patch -p1 -i license.patch
patch -p1 -i semaphore.patch
make -C /lib/modules/"${_kver}"/build M=`pwd`
}
package() {
cd "$srcdir"
install -D -m 755 wl.ko "$pkgdir/lib/modules/$_kernver/kernel/drivers/net/wireless/wl.ko"
install -D -m 644 lib/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cd "${srcdir}"
install -D -m 755 wl.ko "${pkgdir}/lib/modules/${_extramodules}/wl.ko"
gzip "${pkgdir}/lib/modules/${_extramodules}/wl.ko"
install -D -m 644 lib/LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -D -m 644 modprobe.d "${pkgdir}"/etc/modprobe.d/broadcom-wl.conf
}
\ No newline at end of file
post_upgrade() {
depmod `uname -r`
cd lib/modules
for i in extramodules-*; do depmod "$(cat "$i/version")"; done
cd ../..
}
post_install() {
cat <<EOF
==> If the modules do not load at boot, add to your /etc/rc.conf:
==> MODULES=(lib80211 wl !b43 !ssb ...)
==>
==> If you have problems with interfaces swapped, read:
==> http://wiki.archlinux.org/index.php/Broadcom_BCM4312#Interfaces_swapped_every_time
EOF
post_upgrade
}
332c332
< .ndo_set_multicast_list = wl_set_multicast_list,
---
> .ndo_set_rx_mode = wl_set_multicast_list,
diff -Naur broadcom-sta-5.100.82.111.orig/Makefile broadcom-sta-5.100.82.111/Makefile
--- broadcom-sta-5.100.82.111.orig/Makefile 2011-10-06 08:16:10.000000000 +0900
+++ broadcom-sta-5.100.82.111/Makefile 2011-10-24 08:54:26.000000000 +0900
@@ -16,7 +16,7 @@
ifneq ($(KERNELRELEASE),)
LINUXVER_GOODFOR_CFG80211:=$(strip $(shell \
- if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "32" ]; then \
+ if [ "$(VERSION)" -ge "3" -o "$(VERSION)" -eq "2" -a "$(PATCHLEVEL)" -ge "6" -a "0$(SUBLEVEL)" -ge "32" ]; then \
echo TRUE; \
else \
echo FALSE; \
@@ -24,7 +24,7 @@
))
LINUXVER_WEXT_ONLY:=$(strip $(shell \
- if [ "$(VERSION)" -ge "2" -a "$(PATCHLEVEL)" -ge "6" -a "$(SUBLEVEL)" -ge "17" ]; then \
+ if [ "$(VERSION)" -ge "3" -o "$(VERSION)" -eq "2" -a "$(PATCHLEVEL)" -ge "6" -a "0$(SUBLEVEL)" -ge "17" ]; then \
echo FALSE; \
else \
echo TRUE; \
blacklist b43
blacklist bcma
blacklist ssb
--- wl/src/wl/sys/wl_linux.c 2010-12-15 03:01:09.000000000 +0100
+++ temp/src/wl/sys/wl_linux.c 2011-03-04 11:02:12.754753700 +0100
@@ -482,7 +482,11 @@
#ifdef WL_ALL_PASSIVE
spin_lock_init(&wl->txq_lock);
#endif
- init_MUTEX(&wl->sem);
+ #ifndef init_MUTEX
+ sema_init(&wl->sem,1);
+ #else
+ init_MUTEX(&wl->sem);
+ #endif
}
if (!(wl->wlc = wlc_attach((void *) wl, vendor, device, unit, wl->piomode,
This diff is collapsed.
......@@ -5,7 +5,7 @@ rm -Rf aufs3-standalone
git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git
cd aufs3-standalone
git branch -r
git checkout origin/aufs3.1
git checkout origin/aufs3.2
# modify what you want
......@@ -15,17 +15,17 @@ git checkout origin/aufs3.1
rm -v $(find . -type f -name '*.orig')
grep -qse 'EXPORT_SYMBOL(' aufs3-standalone.patch && \
sed -i-old -e 's|EXPORT_SYMBOL(|EXPORT_SYMBOL_GPL(|' aufs3-standalone.patch
rm -rf /tmp/linux-3.1
mkdir /tmp/linux-3.1
cp -a fs /tmp/linux-3.1
cp -a include /tmp/linux-3.1
cp -a Documentation /tmp/linux-3.1
rm -rf /tmp/linux-3.2
mkdir /tmp/linux-3.2
cp -a fs /tmp/linux-3.2
cp -a include /tmp/linux-3.2
cp -a Documentation /tmp/linux-3.2
echo "test"
rm /tmp/linux-3.1/include/linux/Kbuild
rm /tmp/linux-3.2/include/linux/Kbuild
cd /tmp
diff -Naur null linux-3.1 | filterdiff | \
sed -e 's|null\(/include/linux/Kbuild\)|linux-3.1-old\1|;s|^--- null.*|--- /dev/null|;\|linux-3.1/include/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-3.1/include/linux/aufs_type.h).patch.bz2
diff -Naur null linux-3.2 | filterdiff | \
sed -e 's|null\(/include/linux/Kbuild\)|linux-3.2-old\1|;s|^--- null.*|--- /dev/null|;\|linux-3.2/include/linux/Kbuild|,${\|@@ -0,0 +1 @@|,$d}' \
| bzip2 > aufs$(sed -ne 's|#define.*AUFS_VERSION.*"\(.*\)"|\1|p' linux-3.2/include/linux/aufs_type.h).patch.bz2
cd $OLDPWD
# the patch is created in /tmp
......
......@@ -8,6 +8,8 @@ cat_patch() {
zcat ${file} ;;
*application/x-bzip*)
bzcat ${file} ;;
*application/x-xz*)
xzcat ${file} ;;
*)
cat ${file} ;;
esac
......
......@@ -8,10 +8,10 @@ pkgbase="linux"
pkgname=('linux' 'linux-headers' 'linux-docs') # Build stock -CHAKRA kernel
# pkgname=linux-custom # Build kernel with a different name
_kernelname=${pkgname#linux}
_basekernel=3.1
pkgver=${_basekernel}.9
_basekernel=3.2
pkgver=${_basekernel}.2
pkgrel=1
_aufs="3.1-20111114"
_aufs="3.2-20120109"
makedepends=('xmlto' 'docbook-xsl')
_patchname="patch-${pkgver}-1-CHAKRA"
arch=(i686 x86_64)
......@@ -21,13 +21,13 @@ options=(!strip)
source=(ftp://ftp.kernel.org/pub/linux/kernel/v3.0/linux-$_basekernel.tar.bz2
http://chakra.sourceforge.net/sources/linux/${_patchname}.bz2
# the main kernel config files
config config.x86_64
config.i686 config.x86_64
# standard config files for mkinitcpio ramdisk
linux.preset)
md5sums=('8d43453f8159b2332ad410b19d86a931'
'e812493bd889c939f045dc9719101904'
'615b6ec95ec750fbe88cd822bb4b2d07'
'8343689380a23165744dceef365efcd8'
md5sums=('7ceb61f87c097fc17509844b71268935'
'6e0c54cd695691021af232f7339bf680'
'b177a7b0973fbdb027878dafb017a73c'
'0e5a07bf3d98a782c4f009b381f98e59'
'b019872ce926de3ec82985fc399832c6')
build() {
......@@ -39,11 +39,8 @@ build() {
# Add -CHAKRA patches
patch -Np1 -i ${srcdir}/${_patchname}
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
# create .config
cat "${srcdir}/config.${CARCH}" > ./.config
if [ "${_kernelname}" != "" ]; then
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
# arg 2: the old package version
KERNEL_NAME=
KERNEL_VERSION=3.1-CHAKRA
KERNEL_VERSION=3.2-CHAKRA
post_install () {
# updating module dependencies
......
......@@ -8,7 +8,7 @@
_kernver="2.6.35-CHAKRA-LTS"
pkgname=ndiswrapper-lts
pkgver=1.56
pkgver=1.57
pkgrel=1
pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors. For kernel26-testing."
license=('GPL')
......@@ -17,22 +17,19 @@ url="http://ndiswrapper.sourceforge.net"
install="ndiswrapper.install"
depends=("ndiswrapper-utils=$pkgver" 'kernel26-lts>=2.6.35' 'kernel26-lts<2.6.36')
makedepends=('kernel26-lts-headers>=2.6.35' 'kernel26-lts-headers<2.6.36')
source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz kernel-2.6.35.patch ndiswrapper-ioctl.patch)
md5sums=('1431f7ed5f8e92e752d330bbb3aed333'
'0a03d613b1fd545a75c5dd1a7c2aaec4'
'a71bd3add8802e1b2fdff55bf6d0577e')
source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz)
md5sums=('7a401dc540938bf07893c67f418b6152')
groups=("kernel26-modules")
build()
{
cd $srcdir/ndiswrapper-$pkgver/driver
patch -Np2 -i $startdir/kernel-2.6.35.patch
cd $srcdir/ndiswrapper-$pkgver/
patch -Np0 -i $startdir/ndiswrapper-ioctl.patch
make KVERS=$_kernver
}
package() {
cd $srcdir/ndiswrapper-$pkgver/driver
make KVERS=$_kernver || return 1
make DESTDIR=$pkgdir KVERS=$_kernver install || return 1
rm $pkgdir/lib/modules/$_kernver/modules.* #wtf?
make DESTDIR=$pkgdir KVERS=$_kernver install
sed -i -e "s/KERNEL_VERSION='.*'/KERNEL_VERSION='${_kernver}'/" $startdir/*.install
# move it to correct kernel directory
......
diff -uNr ndiswrapper-1.56.old/driver/usb.c ndiswrapper-1.56/driver/usb.c
--- ndiswrapper-1.56.old/driver/usb.c 2010-02-10 18:09:32.000000000 -0800
+++ ndiswrapper-1.56/driver/usb.c 2010-07-25 02:29:25.442145846 -0700
@@ -191,9 +191,15 @@
if (wrap_urb->flags & WRAP_URB_COPY_BUFFER) {
USBTRACE("freeing DMA buffer for URB: %p %p",
urb, urb->transfer_buffer);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
usb_buffer_free(IRP_WRAP_DEVICE(irp)->usb.udev,
+ urb->transfer_buffer_length,
+ urb->transfer_buffer, urb->transfer_dma);
+#else
+ usb_free_coherent(IRP_WRAP_DEVICE(irp)->usb.udev,
urb->transfer_buffer_length,
urb->transfer_buffer, urb->transfer_dma);
+#endif
}
if (urb->setup_packet)
kfree(urb->setup_packet);
@@ -303,9 +309,16 @@
|| PageHighMem(virt_to_page(buf))
#endif
)) {
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
urb->transfer_buffer =
- usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
+ usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
+ &urb->transfer_dma);
+#else
+ urb->transfer_buffer =
+ usb_alloc_coherent(wd->usb.udev, buf_len, alloc_flags,
&urb->transfer_dma);
+#endif
if (!urb->transfer_buffer) {
WARNING("couldn't allocate dma buf");
IoAcquireCancelSpinLock(&irp->cancel_irql);
diff -uNr ndiswrapper-1.56.old/driver/wrapndis.c ndiswrapper-1.56/driver/wrapndis.c
--- ndiswrapper-1.56.old/driver/wrapndis.c 2010-02-10 18:09:32.000000000 -0800
+++ ndiswrapper-1.56/driver/wrapndis.c 2010-07-25 02:06:13.184631757 -0700
@@ -936,6 +936,10 @@
EXIT2(return);
}
+#ifndef netdev_mc_count
+#define netdev_mc_count(net_dev) net_dev->mc_count
+#endif
+
static void set_multicast_list(struct ndis_device *wnd)
{
struct net_device *net_dev;
@@ -950,20 +954,26 @@
packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS |
NDIS_PACKET_TYPE_ALL_LOCAL;
} else if (net_dev->flags & IFF_ALLMULTI ||
- net_dev->mc_count > wnd->multicast_size) {
+ netdev_mc_count(net_dev) > wnd->multicast_size) {
packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
TRACE2("0x%08x", packet_filter);
- } else if (net_dev->mc_count > 0) {
+ } else if (netdev_mc_count(net_dev) > 0) {
int i, size;
char *buf;
+#ifndef netdev_for_each_mc_addr
struct dev_mc_list *mclist;
- size = min(wnd->multicast_size, net_dev->mc_count);
- TRACE2("%d, %d", wnd->multicast_size, net_dev->mc_count);
+#else
+ struct netdev_hw_addr *mclist;
+#endif
+
+ size = min(wnd->multicast_size, netdev_mc_count(net_dev));
+ TRACE2("%d, %d", wnd->multicast_size, netdev_mc_count(net_dev));
buf = kmalloc(size * ETH_ALEN, GFP_KERNEL);
if (!buf) {
WARNING("couldn't allocate memory");
EXIT2(return);
}
+#ifndef netdev_for_each_mc_addr
mclist = net_dev->mc_list;
for (i = 0; i < size && mclist; mclist = mclist->next) {
if (mclist->dmi_addrlen != ETH_ALEN)
@@ -972,6 +982,15 @@
TRACE2(MACSTRSEP, MAC2STR(mclist->dmi_addr));
i++;
}
+#else
+ i = 0;
+ netdev_for_each_mc_addr(mclist, net_dev){
+ memcpy(buf + i++ * ETH_ALEN,
+ mclist->addr, ETH_ALEN);
+ TRACE2(MACSTRSEP, MAC2STR(mclist->addr));
+
+ }
+#endif
res = mp_set(wnd, OID_802_3_MULTICAST_LIST, buf, i * ETH_ALEN);
if (res == NDIS_STATUS_SUCCESS && i > 0)
packet_filter |= NDIS_PACKET_TYPE_MULTICAST;
Index: utils/Makefile
===================================================================
--- utils/Makefile.orig 2010-02-11 03:09:32.000000000 +0100
+++ utils/Makefile 2010-09-09 12:53:57.348385587 +0200
@@ -5,7 +5,7 @@ usrsbindir = $(DESTDIR)/usr/sbin
DRIVER_DIR ?= ../driver
CC = gcc
-CFLAGS = -g -Wall -I$(DRIVER_DIR)
+CFLAGS += -I$(DRIVER_DIR)
DISTFILES=Makefile ndiswrapper loadndisdriver.c ndiswrapper-buginfo
Index: utils/loadndisdriver.c
===================================================================
--- utils/loadndisdriver.c.orig 2010-02-11 03:09:32.000000000 +0100
+++ utils/loadndisdriver.c 2010-09-09 12:53:57.348385587 +0200
@@ -505,7 +505,7 @@ static int get_ioctl_device()
int main(int argc, char *argv[0])
{
- int i, ioctl_device, res;
+ int i, ioctl_device=-1, res;
char *cmd;
openlog(PROG_NAME, LOG_PERROR | LOG_CONS, LOG_KERN | LOG_DEBUG);
Index: driver/loader.c
===================================================================
--- driver/loader.c.orig 2010-02-11 03:09:32.000000000 +0100
+++ driver/loader.c 2010-09-09 13:15:48.148260473 +0200
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/miscdevice.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
/*
@@ -750,7 +751,7 @@ struct wrap_device *get_wrap_device(void
}
/* called with loader_mutex is down */
-static int wrapper_ioctl(struct inode *inode, struct file *file,
+static long wrapper_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
struct load_driver *load_driver;
@@ -759,6 +760,7 @@ static int wrapper_ioctl(struct inode *i
int ret;
void __user *addr = (void __user *)arg;
+ lock_kernel();
ENTER1("cmd: %u", cmd);
ret = 0;
@@ -820,6 +822,7 @@ static int wrapper_ioctl(struct inode *i
break;
}
complete(&loader_complete);
+ unlock_kernel();
EXIT1(return ret);
}
@@ -831,7 +834,7 @@ static int wrapper_ioctl_release(struct
static struct file_operations wrapper_fops = {
.owner = THIS_MODULE,
- .ioctl = wrapper_ioctl,
+ .unlocked_ioctl = wrapper_ioctl,
.release = wrapper_ioctl_release,
};
......@@ -7,61 +7,38 @@
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=ndiswrapper
pkgver=1.56
pkgrel=18
# Find the kernel name inside the chroot
_kernver=`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_extramodules=extramodules-`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_kver="$(cat /lib/modules/${_extramodules}/version)"
pkgname=ndiswrapper
pkgver=1.57
pkgrel=2
pkgdesc="Module for NDIS (Windows Network Drivers) drivers supplied by vendors. For linux-testing."
license=('GPL')
arch=(i686 x86_64)
url="http://ndiswrapper.sourceforge.net"
install="ndiswrapper.install"
depends=('linux>=3.1' 'linux<3.2')
depends=('linux>=3.2' 'linux<3.3')
provides=("ndiswrapper-utils=$pkgver")
replaces=('ndiswrapper-utils')
conflicts=('ndiswrapper-utils')
makedepends=('linux-headers')
source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz
kernel-2.6.35.patch
kernel-2.6.36.patch
kernel-2.6.38.patch
kernel-3.1.patch)
build()
{
cd "$srcdir/$pkgname-$pkgver"
# kernel patches
patch -Np1 -i "$srcdir/kernel-2.6.35.patch"
patch -Np1 -i "$srcdir/kernel-2.6.36.patch"
patch -Np1 -i "$srcdir/kernel-2.6.38.patch"
patch -Np1 -i "$srcdir/kernel-3.1.patch"
source=(http://downloads.sourceforge.net/sourceforge/ndiswrapper/ndiswrapper-$pkgver.tar.gz)
md5sums=('7a401dc540938bf07893c67f418b6152')
# fix regex to accept kernel version 3.x
sed -i "/uname/s/\/.*\//\/(\\\d+)\\\.(\\\d+)\//" utils/$pkgname
# fix module dir
sed -i "s|misc|kernel/drivers/net/wireless/$pkgname|" driver/Makefile
build() {
cd "$srcdir/$pkgname-$pkgver"
make KVERS=$_kernver
make KVERS=$_kver
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir/" KVERS=$_kernver install
# remove useless files (they already exist)
rm "$pkgdir"/lib/modules/$_kernver/modules.*
# gzip -9 modules
find "$pkgdir" -name '*.ko' -exec gzip -9 {} \;
}
make INST_DIR="lib/modules/$_extramodules" \
KVERS=$_kver DESTDIR="$pkgdir/" install
md5sums=('1431f7ed5f8e92e752d330bbb3aed333'
'0a03d613b1fd545a75c5dd1a7c2aaec4'
'cc16ed13449f17e90865df688b180b2c'
'2499a87276ae0c8ce39bea6ef942d926'
'993e83a5348740b81d8f9d6e819de8b8')
\ No newline at end of file
gzip "$pkgdir/lib/modules/$_extramodules/$pkgname.ko"
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" ${startdir}/*.install
}
\ No newline at end of file
diff -uNr ndiswrapper-1.56.old/driver/usb.c ndiswrapper-1.56/driver/usb.c
--- ndiswrapper-1.56.old/driver/usb.c 2010-02-10 18:09:32.000000000 -0800
+++ ndiswrapper-1.56/driver/usb.c 2010-07-25 02:29:25.442145846 -0700
@@ -191,9 +191,15 @@
if (wrap_urb->flags & WRAP_URB_COPY_BUFFER) {
USBTRACE("freeing DMA buffer for URB: %p %p",
urb, urb->transfer_buffer);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
usb_buffer_free(IRP_WRAP_DEVICE(irp)->usb.udev,
+ urb->transfer_buffer_length,
+ urb->transfer_buffer, urb->transfer_dma);
+#else
+ usb_free_coherent(IRP_WRAP_DEVICE(irp)->usb.udev,
urb->transfer_buffer_length,
urb->transfer_buffer, urb->transfer_dma);
+#endif
}
if (urb->setup_packet)
kfree(urb->setup_packet);
@@ -303,9 +309,16 @@
|| PageHighMem(virt_to_page(buf))
#endif
)) {
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
urb->transfer_buffer =
- usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
+ usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
+ &urb->transfer_dma);
+#else
+ urb->transfer_buffer =
+ usb_alloc_coherent(wd->usb.udev, buf_len, alloc_flags,
&urb->transfer_dma);
+#endif
if (!urb->transfer_buffer) {
WARNING("couldn't allocate dma buf");
IoAcquireCancelSpinLock(&irp->cancel_irql);
diff -uNr ndiswrapper-1.56.old/driver/wrapndis.c ndiswrapper-1.56/driver/wrapndis.c
--- ndiswrapper-1.56.old/driver/wrapndis.c 2010-02-10 18:09:32.000000000 -0800
+++ ndiswrapper-1.56/driver/wrapndis.c 2010-07-25 02:06:13.184631757 -0700
@@ -936,6 +936,10 @@
EXIT2(return);
}
+#ifndef netdev_mc_count
+#define netdev_mc_count(net_dev) net_dev->mc_count
+#endif
+
static void set_multicast_list(struct ndis_device *wnd)
{
struct net_device *net_dev;
@@ -950,20 +954,26 @@
packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS |
NDIS_PACKET_TYPE_ALL_LOCAL;
} else if (net_dev->flags & IFF_ALLMULTI ||
- net_dev->mc_count > wnd->multicast_size) {
+ netdev_mc_count(net_dev) > wnd->multicast_size) {
packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
TRACE2("0x%08x", packet_filter);
- } else if (net_dev->mc_count > 0) {
+ } else if (netdev_mc_count(net_dev) > 0) {
int i, size;