Fix broadcom_sta for linux-3.4 and clean nix source.

Idea from Kevin Quick, implementation from Gentoo. Also cleaned and
added a minor license patch from Gentoo. Builds for many x86_64 kernels.
This commit is contained in:
Vladimír Čunát 2012-07-19 11:42:40 +02:00
parent 0b9284c8da
commit 196f5cb265
4 changed files with 29 additions and 19 deletions

View file

@ -7,7 +7,7 @@ in
stdenv.mkDerivation {
name = "broadcom-sta-${version}-${kernel.version}";
src = fetchurl {
url = "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_${bits}-v${version}.tar.gz";
sha256 = if bits == "32"
@ -16,12 +16,10 @@ stdenv.mkDerivation {
};
buildInputs = [ kernel ];
patches = [ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch ];
#++ stdenv.lib.optional
#(! builtins.lessThan (builtins.compareVersions kernel.version "2.6.37") 0)
#[ ./mutex-sema.patch ];
NIX_CFLAGS_COMPILE = "-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
patches =
[ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
./linux-3.4.patch ./license.patch
];
makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build";

View file

@ -0,0 +1,12 @@
diff -Naur hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c
--- hybrid-portsrc-x86_32-v5_10_91_9.orig/src/wl/sys/wl_linux.c 2009-04-23 02:48:59.000000000 +0900
+++ hybrid-portsrc-x86_32-v5_10_91_9/src/wl/sys/wl_linux.c 2009-05-08 00:48:20.000000000 +0900
@@ -163,6 +163,8 @@
static void wl_free_if(wl_info_t *wl, wl_if_t *wlif);
static void wl_get_driver_info(struct net_device *dev, struct ethtool_drvinfo *info);
+MODULE_LICENSE("MIXED/Proprietary");
+
static struct pci_device_id wl_id_table[] = {
{ PCI_VENDOR_ID_BROADCOM, 0x4311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_BROADCOM, 0x4312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },

View file

@ -0,0 +1,12 @@
--- broadcom-sta.orig/src/wl/sys/wl_linux.c
+++ broadcom-sta.new/src/wl/sys/wl_linux.c
@@ -40,7 +40,9 @@
#include <linux/pci_ids.h>
#define WLC_MAXBSSCFG 1
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
#include <asm/system.h>
+#endif
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/pgtable.h>

View file

@ -1,12 +0,0 @@
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,