From 564edafa1a0c3c56a9dc49fbccb1c25da8b6cd0c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 12 Apr 2011 15:54:39 +0000 Subject: [PATCH] Get broadcom-sta to work on kernels >= 2.6.37 Patch from http://forums.linuxmint.com/viewtopic.php?f=141&t=57056&start=20#p378103 svn path=/nixpkgs/trunk/; revision=26806 --- pkgs/os-specific/linux/broadcom-sta/default.nix | 5 ++++- pkgs/os-specific/linux/broadcom-sta/mutex-sema.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 pkgs/os-specific/linux/broadcom-sta/mutex-sema.patch diff --git a/pkgs/os-specific/linux/broadcom-sta/default.nix b/pkgs/os-specific/linux/broadcom-sta/default.nix index ba1630d2ed5a..d2c2b5f13077 100644 --- a/pkgs/os-specific/linux/broadcom-sta/default.nix +++ b/pkgs/os-specific/linux/broadcom-sta/default.nix @@ -15,7 +15,10 @@ stdenv.mkDerivation { }; buildInputs = [ kernel ]; - patches = [ ./makefile.patch ]; + patches = [ ./makefile.patch ] + ++ stdenv.lib.optional + (! builtins.lessThan (builtins.compareVersions kernel.version "2.6.37") 0) + [ ./mutex-sema.patch ]; makeFlags = "KDIR=${kernel}/lib/modules/${kernel.version}/build"; diff --git a/pkgs/os-specific/linux/broadcom-sta/mutex-sema.patch b/pkgs/os-specific/linux/broadcom-sta/mutex-sema.patch new file mode 100644 index 000000000000..922c8f2d22dd --- /dev/null +++ b/pkgs/os-specific/linux/broadcom-sta/mutex-sema.patch @@ -0,0 +1,12 @@ +diff -aur old/src/wl/sys/wl_linux.c new/src/wl/sys/wl_linux.c +--- old/src/wl/sys/wl_linux.c 2010-12-25 18:17:33.333343048 +0100 ++++ new/src/wl/sys/wl_linux.c 2010-12-25 18:21:05.856676376 +0100 +@@ -483,7 +483,7 @@ + #ifdef WL_ALL_PASSIVE + spin_lock_init(&wl->txq_lock); + #endif +- init_MUTEX(&wl->sem); ++ sema_init(&wl->sem, 1); + } + + if (!(wl->wlc = wlc_attach((void *) wl, vendor, device, unit, wl->piomode,