--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl-kernel-source.prerm
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl-kernel-source.prerm
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007-2008 Mario Limonciello
+# Copyright (C) 2009 Alberto Milone
+
+#DEBHELPER#
+
+CVERSION=`dpkg-query -W -f='${Version}' bcmwl-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+case "$1" in
+    remove|upgrade)
+		echo "Removing all DKMS Modules"
+		dkms remove -m bcmwl -v $CVERSION --all > /dev/null
+		echo "Done."
+        ;;
+esac
+
+#DEBHELPER#
--- bcmwl-5.60.246.2+bdcom.orig/debian/control
+++ bcmwl-5.60.246.2+bdcom/debian/control
@@ -0,0 +1,22 @@
+Source: bcmwl
+Section: admin
+Priority: optional
+Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Alberto Milone <alberto.milone@canonical.com>
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 5), cdbs
+Vcs-Bzr: https://code.launchpad.net/~broadcom-sta-hackers/broadcom-sta/ubuntu
+
+Package: bcmwl-kernel-source
+Architecture: i386 amd64 lpia
+Depends: ${misc:Depends}, dkms, linux-libc-dev, libc6-dev, linux-headers-generic [i386 amd64] | linux-headers, linux-headers-lpia [lpia]
+Description: Broadcom 802.11 Linux STA wireless driver source
+ These package contains Broadcom 802.11 Linux STA wireless driver
+ for use with Broadcom's BCM4311-, BCM4312-, BCM4321-, and
+ BCM4322-based hardware.
+
+Package: bcmwl-modaliases
+Architecture: i386 amd64 lpia
+Description: Modaliases for the Broadcom 802.11 Linux STA driver
+ The modaliases provide a list of pci id's which makes it possible to
+ detect the model of a wireless card.
--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl-kernel-source.install.in
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl-kernel-source.install.in
@@ -0,0 +1,7 @@
+src/lib/wlc_hybrid.o_shipped_#ARCH#	usr/src/bcmwl-#VERSION#/lib
+src/lib/*.txt		usr/src/bcmwl-#VERSION#/lib
+src/src/*			usr/src/bcmwl-#VERSION#/src
+Makefile			usr/src/bcmwl-#VERSION#
+debian/dkms.conf	usr/src/bcmwl-#VERSION#
+debian/patches/*	usr/src/bcmwl-#VERSION#/patches
+
--- bcmwl-5.60.246.2+bdcom.orig/debian/rules
+++ bcmwl-5.60.246.2+bdcom/debian/rules
@@ -0,0 +1,38 @@
+#!/usr/bin/make -f
+# Copyright (C) 2009 Alberto Milone
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+DRIVER_NAME := bcmwl
+VERSION := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2 | cut -d- -f1 | cut -d\: -f2)
+PKG_kernel_src  := bcmwl-kernel-source
+PKG_modaliases := bcmwl-modaliases
+ARCH := $(shell dpkg --print-architecture)
+ifeq ($(ARCH),amd64)
+ARCH_SUFFIX=x86_64
+else
+ARCH_SUFFIX=i386
+endif
+
+
+configure/$(PKG_kernel_src)::
+	#Replace important strings
+	for i in dkms.conf \
+		$(PKG_kernel_src).install \
+		$(PKG_modaliases).install; do \
+		sed -e "s|#VERSION#|$(VERSION)|"   \
+			-e "s|#ARCH#|$(ARCH_SUFFIX)|"   \
+			debian/$$i.in > debian/$$i;      \
+	done
+	# Generate the modaliases
+	$(SHELL) $(CURDIR)/debian/bcmwl_supported \
+		$(CURDIR)/src/src/wl/sys/wl_linux.c wl $(PKG_kernel_src) \
+		> $(CURDIR)/debian/bcmwl
+
+clean::
+	rm -f debian/dkms.conf \
+	debian/$(PKG_kernel_src).install \
+	debian/$(PKG_modaliases).install
+	rm -Rf $(CURDIR)/$(PKG_kernel_src)
+	rm -f $(CURDIR)/debian/bcmwl
+
--- bcmwl-5.60.246.2+bdcom.orig/debian/dkms.conf.in
+++ bcmwl-5.60.246.2+bdcom/debian/dkms.conf.in
@@ -0,0 +1,13 @@
+PACKAGE_NAME="bcmwl"
+PACKAGE_VERSION="#VERSION#"
+CLEAN="rm -f *.*o"
+
+BUILT_MODULE_NAME[0]="wl"
+MAKE[0]="make -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build"
+DEST_MODULE_LOCATION[0]="/updates"
+PATCH[0]="0001-MODULE_LICENSE.patch"
+PATCH[1]="0002-Makefile.patch"
+PATCH[2]="0005-add-scan-events.patch"
+PATCH[3]="0006-fix-reentrant-scan.patch"
+PATCH[4]="0007-fix-send-event-stack.patch"
+AUTOINSTALL="yes"
--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl-kernel-source.postrm
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl-kernel-source.postrm
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007-2008 Mario Limonciello
+# Copyright (C) 2009 Alberto Milone
+
+#DEBHELPER#
+
+BLACKLIST_FILE=/etc/modprobe.d/blacklist-bcm43.conf
+
+case "$1" in
+	remove|purge)
+		# Remove blacklist file
+		rm -f $BLACKLIST_FILE
+		
+		# Update initramfs
+		/usr/sbin/update-initramfs -u
+		;;
+esac
+
+#DEBHELPER#
--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl-modaliases.install.in
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl-modaliases.install.in
@@ -0,0 +1 @@
+debian/bcmwl		usr/share/jockey/modaliases
--- bcmwl-5.60.246.2+bdcom.orig/debian/compat
+++ bcmwl-5.60.246.2+bdcom/debian/compat
@@ -0,0 +1 @@
+5
--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl-kernel-source.postinst
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl-kernel-source.postinst
@@ -0,0 +1,59 @@
+#!/bin/sh
+# Copyright (C) 2002-2005 Flavio Stanchina
+# Copyright (C) 2005-2006 Aric Cyr
+# Copyright (C) 2007 Mario Limonciello
+# Copyright (C) 2009 Alberto Milone
+
+CVERSION=`dpkg-query -W -f='${Version}' bcmwl-kernel-source | awk -F "-" '{print $1}' | cut -d\: -f2`
+MODULES_DIR=$(ls /lib/modules/)
+CURRENT_KERNEL=$(uname -r)
+BLACKLIST_FILE=/etc/modprobe.d/blacklist-bcm43.conf
+PACKAGE_NAME=bcmwl
+#DEBHELPER#
+
+ARCH=`dpkg --print-architecture`
+case $ARCH in
+    amd64)
+        ARCH="x86_64"
+        ;;
+    lpia)
+        ARCH="i686"
+        ;;
+    i386)
+        ARCH="i686"
+        ;;
+    *)
+        echo "WARNING: unsupported arch: $ARCH"
+        ARCH="$ARCH"
+        ;;
+esac
+
+case "$1" in
+	configure)
+	# Build the kernel module
+	/usr/lib/dkms/common.postinst $PACKAGE_NAME $CVERSION /usr/share/$PACKAGE_NAME $ARCH $2 || exit $?
+	
+	# Create a blacklist file
+	if [ ! -f $BLACKLIST_FILE ]; then
+		cat > $BLACKLIST_FILE <<EOF
+# Warning: This file is autogenerated by $PACKAGE_NAME. All changes to this file will be lost.
+blacklist b43
+blacklist b43legacy
+blacklist ssb
+blacklist bcm43xx
+EOF
+		# If b44 is loaded, append these additional lines
+		if lsmod | grep b44 > /dev/null; then
+			cat >> $BLACKLIST_FILE <<EOF
+blacklist b44
+install wl modprobe -r b43 b44 b43legacy ssb; modprobe --ignore-install wl $CMDLINE_OPTS; modprobe --ignore-install b44
+EOF
+		fi
+	fi
+	
+	# Update initramfs
+	/usr/sbin/update-initramfs -u
+	;;
+esac
+
+#DEBHELPER#
--- bcmwl-5.60.246.2+bdcom.orig/debian/changelog
+++ bcmwl-5.60.246.2+bdcom/debian/changelog
@@ -0,0 +1,215 @@
+bcmwl (5.60.246.2+bdcom-0ubuntu1~maverick1common0omsk4) lucid; urgency=low
+
+  * remove 0008-timer-fix.patch as a previous hack that is now fixed in driver
+
+ -- Kyle Nitzsche <kyle.nitzsche@canonical.com>  Mon, 15 Nov 2010 12:10:35 -0500
+
+bcmwl (5.60.246.2+bdcom-0ubuntu1~maverick1common0omsk3) lucid; urgency=low
+
+  * add 0008-timer-fix.patch from omsk
+  * add this patch and the four in entry 5.60.246.2+bdcom-0ubuntu1~maverick1\
+    common0omsk1 to debian/dkms.conf.in
+
+ -- Kyle Nitzsche <kyle.nitzsche@canonical.com>  Tue, 09 Nov 2010 21:08:57 -0500
+
+bcmwl (5.60.246.2+bdcom-0ubuntu1~maverick1common0omsk2) lucid; urgency=low
+
+  * fix series to lucid
+
+ -- Kyle Nitzsche <kyle.nitzsche@canonical.com>  Tue, 09 Nov 2010 11:46:32 -0500
+
+bcmwl (5.60.246.2+bdcom-0ubuntu1~maverick1common0omsk1) maverick; urgency=low
+
+  * add omsk patches [LP: 637441]:
+    - 0005-add-scan-events.patch
+    - 0006-fix-reentrant-scan.patch
+    - 0007-fix-send-event-stack.patch
+
+ -- Kyle Nitzsche <kyle.nitzsche@canonical.com>  Tue, 09 Nov 2010 10:26:13 -0500
+
+bcmwl (5.60.246.2+bdcom-0ubuntu1~maverick1) maverick; urgency=low
+
+  * Backport 5.60.246.2+bdcom-0ubuntu1 from Natty.
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Thu, 21 Oct 2010 14:57:17 +0200
+
+bcmwl (5.60.246.2+bdcom-0ubuntu1) natty; urgency=low
+
+  * Remove 0003-autoconf.h.patch as it's no longer needed.
+  * Remove 0004-mclist.patch as it's no longer needed.
+  * New upstream release:
+   - Add support for kernels up to 2.6.36.
+   - Prevent the system from hanging when using the F2 hot key to
+     enable/disable wireless quickly while wireless is still in the
+     process of re-association with AP (LP: #611575).
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Thu, 21 Oct 2010 13:25:16 +0200
+
+bcmwl (5.60.48.36+bdcom-0ubuntu5) maverick; urgency=low
+
+  * debian/patches/0004-mclist.patch:
+   - Switch over to multicast iterator functions for kernels v2.6.35 and
+     later.  This fixes module building on v2.6.35-1.1.  Conditionalise
+     the patch to support older kernels.  (LP: #590924)
+
+ -- Andy Whitcroft <apw@canonical.com>  Tue, 08 Jun 2010 11:19:05 +0100
+
+bcmwl (5.60.48.36+bdcom-0ubuntu4) maverick; urgency=low
+
+  * debian/patches/0003-autoconf.h.patch:
+    - Do not #include <linux/autoconf.h> in kernels that include it
+      automatically (2.6.15 or higher).  This fixes building on 2.6.33
+      which moved that file to <generated/autoconf.h>.  (LP: #580594)
+
+ -- Anders Kaseorg <andersk@mit.edu>  Fri, 14 May 2010 21:23:45 -0400
+
+bcmwl (5.60.48.36+bdcom-0ubuntu3) lucid; urgency=low
+
+  * Fix control file to support -generic-pae kernel install (LP: #567607) 
+
+ -- Jerone Young <jerone.young@canonical.com>  Tue, 20 Apr 2010 18:44:53 -0500
+
+bcmwl (5.60.48.36+bdcom-0ubuntu2) lucid; urgency=low
+
+  * debian/bcmwl-kernel-source.postinst:
+    - Do not exit after using DKMS if there are no errors.
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Mon, 15 Feb 2010 15:57:31 +0100
+
+bcmwl (5.60.48.36+bdcom-0ubuntu1) lucid; urgency=low
+
+  * New upstream release (LP: #432780):
+    - Support up to linux kernel 2.6.31. 2.6.32 support is there
+      also but not tested (although reports from users suggests it
+      works fine).
+    - Support for hidden networks.
+    - Support for rfkill in kernels < 2.6.31.
+    - Setting power level via 'iwconfig eth1 txpower X' is now
+      operational
+    - Add support for 4313.
+    - Additional channels in both 2.4 and 5 Ghz bands.
+    - Fix issue with tkip group keys that caused the following
+      message to repeat often:
+      TKIP: RX tkey->key_idx=2 frame keyidx=1 priv=ffff8800cf80e840
+    - Fix a continuous assoc/disassoc loop (in Ubuntu 8.04)
+      with suspend/resume with WPA2 and wpa_supplicant.
+    - Fix bug affecting Ubuntu 8.04 which prevented from pinging when
+      Linux STA is IBSS creator with WEP.
+    - Fix bug affecting Ubuntu 9.04 which prevented from connecting to
+      hidden networks after suspend/resume.
+    - Fix bug which prevented the driver from associating to AP with
+      when transitioning from AES to TKIP encryption.
+  * debian/patches/0002-Makefile.patch:
+    - Refresh patch.
+  * debian/patches/0003-DEV_WL_IF.patch,
+    0004-broadcom-sta-5.10.91.9-linux-2.6.30.patch,
+    0005-NET_DEVICE_OPS.patch,
+    0006-broadcom-sta-5.10.91.9-linux-2.6.32.patch:
+    - Drop patches as they are now part of the upstream code.
+  * debian/dkms.conf.in:
+    - Remove the lines about the above mentioned patches.
+  * debian/bcmwl-kernel-source.postinst:
+    - Make use of /usr/lib/dkms/common.postinst (LP: #497149).
+  * Bump compat to 5.
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Sun, 14 Feb 2010 19:58:58 +0100
+
+bcmwl (5.10.91.9+bdcom-0ubuntu5) lucid; urgency=low
+
+  [ Michael Casadevall ]
+  * debian/patches/0006-broadcom-sta-5.10.91.9-linux-2.6.32.patch:
+    - Fix the build for 2.6.32-HEAD (LP: #458757)
+
+  [ Alberto Milone ] 
+  * debian/dkms.conf.in:
+    - Make sure that Michael's patch is applied only for 2.6.32
+      kernels.
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Wed, 18 Nov 2009 12:48:41 +0100
+
+bcmwl (5.10.91.9+bdcom-0ubuntu4) karmic; urgency=low
+
+  * debian/patches/0005-NET_DEVICE_OPS.patch:
+    - Don’t break build for <= 2.6.30.  (LP: #394279)
+
+ -- Anders Kaseorg <andersk@mit.edu>  Wed, 01 Jul 2009 11:05:25 -0400
+
+bcmwl (5.10.91.9+bdcom-0ubuntu3) karmic; urgency=low
+
+  * Update for new net_device_ops API (fixes build for 2.6.31).
+
+ -- Soren Hansen <soren@ubuntu.com>  Tue, 30 Jun 2009 22:55:18 -0700
+
+bcmwl (5.10.91.9+bdcom-0ubuntu2) karmic; urgency=low
+
+  * debian/rules, debian/bcmwl-kernel-source.install.in:
+    - Install only the binary compiled for the target
+      architecture.
+
+ -- Alberto Milone <alberto.milone@canonical.com>  Fri, 19 Jun 2009 19:19:02 +0200
+
+bcmwl (5.10.91.9+bdcom-0ubuntu1) karmic; urgency=low
+
+  * debian/control:
+    - Add misc:Depends.
+    - Update Standards-Version.
+    - Depend on linux-headers-generic for i386 and amd64
+      and on linux-headers-lpia for lpia.
+    - Limit architectures to i386 amd64 and lpia.
+    - Set Vcs-Bzr.
+    - Add new package bcmwl-modaliases.
+    - Change maintainer to Ubuntu Core Devs and set
+      original maintainer to myself.
+  * debian/copyright:
+    - Add license from the binary library.
+  * debian/rules
+    - Switch to CDBS.
+    - Do not apply any patches.
+    - Automatically generate debian/dkms.conf and
+      debian/bcmwl-kernel-source.install.
+    - Call debian/bcmwl_supported to install
+      modalias file in /usr/share/jockey/modaliases (LP: #381682)
+  * src/patches:
+    - Move patches directory to debian/patches.
+  * debian/patches/0002-Makefile.patch:
+    - Replace dpkg-architecture with dpkg --print-architecture
+      so as not to depend on dpkg-dev.
+  * debian/dkms.conf.in:
+    - Handle patches here so that different patches 
+      can be applied to different kernel versions.
+  * Separate source from debian/.
+  * debian/bcmwl-kernel-source.postinst:
+    - Cover the use case of buildd machines and build the
+      module for the right kernel on 1st installation.
+    - Create a blacklist file containing b43, b43legacy, ssb
+      bcm43xx and add workaround for b44 so that it is loaded
+      after wl (provided that b44 is used).
+    - Update initramfs.
+  * debian/bcmwl-kernel-source.postrm:
+    - Remove blacklist file.
+    - Update initramfs.
+  * debian/patches:
+    - Add 0004-broadcom-sta-5.10.91.9-linux-2.6.30.patch.
+  * debian/dkms.conf.in:
+    - Make sure that patch 0004 is applied only to
+      2.6.30 kernels.
+ 
+ -- Alberto Milone <alberto.milone@canonical.com>  Fri, 19 Jun 2009 13:12:39 +0200
+
+bcmwl (5.10.91.9-3) karmic; urgency=low
+
+  * Fixed build errors with 2.6.30
+
+ -- Tim Gardner <tim.gardner@canonical.com>  Tue, 12 May 2009 15:29:06 -0600
+
+bcmwl (5.10.91.9-2) karmic; urgency=low
+
+  * Add src/lib/LICENSE.txt to copyright notice. 
+
+ -- Tim Gardner <tim.gardner@canonical.com>  Mon, 11 May 2009 16:04:29 +0000
+
+bcmwl (5.10.91.9-1) karmic; urgency=low
+
+  * Initial release
+
+ -- Tim Gardner <tim.gardner@canonical.com>  Fri, 5 Sep 2008 18:15:32 -0400
--- bcmwl-5.60.246.2+bdcom.orig/debian/copyright
+++ bcmwl-5.60.246.2+bdcom/debian/copyright
@@ -0,0 +1,279 @@
+This package was debianized by Tim Gardner <tim.gardner@canonical.com> on
+Fri, 8 May 2009 12:03:09 -0400
+
+Upstream Author(s): 
+
+    Broadcom Corporation, http://www.broadcom.com
+
+Copyright: 
+
+    Copyright 2008, Broadcom Corporation
+
+
+License:
+
+License for the content of src/:
+    
+    Copyright 2008, Broadcom Corporation
+    All Rights Reserved.
+    
+        Unless you and Broadcom execute a separate written software license
+    agreement governing use of this software, this software is licensed to you
+    under the terms of the GNU General Public License version 2, available at
+    http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"), with the
+    following added to such license:
+        As a special exception, the copyright holders of this software give you
+    permission to link this software with independent modules, regardless of the
+    license terms of these independent modules, and to copy and distribute the
+    resulting executable under terms of your choice, provided that you also meet,
+    for each linked independent module, the terms and conditions of the license
+    of that module. An independent module is a module which is not derived from
+    this software.
+    
+    THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
+    KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
+    SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+    FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+
+
+License for lib/wlc_hybrid.o_shipped_i386, lib/wlc_hybrid.o_shipped_x86_64:
+
+    Copyright 2008, Broadcom Corporation
+    All Rights Reserved.
+    
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal in the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+    
+    The above copyright notice and this permission notice (including the next
+    paragraph) shall be included in all copies or substantial portions of the
+    Software.
+    
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+    OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+    SOFTWARE LICENSE AGREEMENT
+
+    Unless you and Broadcom Corporation ("Broadcom") execute a separate written
+    software license agreement governing use of the accompanying software, this
+    software is licensed to you under the terms of this Software License 
+    Agreement ("Agreement").  
+
+    ANY USE, REPRODUCTION OR DISTRIBUTION OF THE SOFTWARE CONSTITUTES YOUR
+    ACCEPTANCE OF THIS AGREEMENT.
+
+    1.    DEFINITIONS.
+
+    1.1.  "Broadcom Product" means any of the proprietary integrated circuit 
+          product(s) sold by Broadcom with which the Software was designed to be
+          used, or their successors.
+
+    1.2.  "Licensee" means you or if you are accepting on behalf of an entity 
+          then the entity and its affiliates exercising rights under, and 
+          complying with all of the terms of this Agreement.
+
+    1.3.  "Software" shall mean that software made available by Broadcom to 
+          Licensee in binary code form with this Agreement.
+
+    2.    LICENSE GRANT; OWNERSHIP
+
+    2.1.  License Grants.  Subject to the terms and conditions of this Agreement,
+          Broadcom hereby grants to Licensee a non-exclusive, non-transferable, 
+          royalty-free license (i) to use and integrate the Software in conjunction
+          with any other software; and (ii) to reproduce and distribute the Software
+          complete, unmodified and only for use with a Broadcom Product.
+
+    2.2.  Restriction on Modification.  If and to the extent that the Software is 
+          designed to be compliant with any published communications standard 
+          (including, without limitation, DOCSIS, HomePNA, IEEE, and ITU standards),
+          Licensee may not make any modifications to the Software that would cause 
+          the Software or the accompanying Broadcom Products to be incompatible with
+          such standard.  
+
+    2.3.  Restriction on Distribution.  Licensee shall only distribute the Software 
+          (a) under the terms of this Agreement and a copy of this Agreement 
+          accompanies such distribution, and (b) agrees to defend and indemnify 
+          Broadcom and its licensors from and against any damages, costs, liabilities,
+          settlement amounts and/or expenses (including attorneys' fees) incurred in 
+          connection with any claim, lawsuit or action by any third party that arises
+          or results from the use or distribution of any and all Software by the 
+          Licensee except as contemplated herein. 
+
+    2.4.  Proprietary Notices.  Licensee shall not remove, efface or obscure any 
+          copyright or trademark notices from the Software.  Licensee shall include 
+          reproductions of the Broadcom copyright notice with each copy of the 
+          Software, except where such Software is embedded in a manner not readily 
+          accessible to the end user.  Licensee acknowledges that any symbols, 
+          trademarks, tradenames, and service marks adopted by Broadcom to identify 
+          the Software belong to Broadcom and that Licensee shall have no rights 
+          therein.
+
+    2.5.  Ownership.  Broadcom shall retain all right, title and interest, including
+          all intellectual property rights, in and to the Software.  Licensee hereby 
+          covenants that it will not assert any claim that the Software created by 
+          or for Broadcom infringe any intellectual property right owned or controlled
+          by Licensee.
+
+    2.6.  No Other Rights Granted; Restrictions.  Apart from the license rights 
+          expressly set forth in this Agreement, Broadcom does not grant and Licensee
+          does not receive any ownership right, title or interest nor any security 
+          interest or other interest in any intellectual property rights relating to 
+          the Software, nor in any copy of any part of the foregoing.  Licensee shall 
+          not (i) use, license, sell or otherwise distribute the Software except as 
+          provided in this Agreement, (ii) attempt to reverse engineer, decompile or 
+          disassemble any portion of the Software; or (iii) use the Software or other 
+          material in violation of any applicable law or regulation, including but not
+          limited to any regulatory agency, such as FCC, rules.
+
+    3.    NO WARRANTY OR SUPPORT
+
+    3.1.  No Warranty. THE SOFTWARE IS OFFERED "AS IS," AND BROADCOM GRANTS AND LICENSEE
+          RECEIVES NO WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, BY STATUTE, 
+          COMMUNICATION OR CONDUCT WITH LICENSEE, OR OTHERWISE.  BROADCOM SPECIFICALLY
+          DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A SPECIFIC 
+          PURPOSE OR NONINFRINGEMENT CONCERNING THE SOFTWARE OR ANY UPGRADES TO OR 
+          DOCUMENTATION FOR THE SOFTWARE.  WITHOUT LIMITATION OF THE ABOVE, BROADCOM 
+          GRANTS NO WARRANTY THAT THE SOFTWARE IS ERROR-FREE OR WILL OPERATE WITHOUT 
+          INTERRUPTION, AND GRANTS NO WARRANTY REGARDING ITS USE OR THE RESULTS 
+          THEREFROM INCLUDING, WITHOUT LIMITATION, ITS CORRECTNESS, ACCURACY OR 
+          RELIABILITY.
+
+    3.2.  No Support.  Nothing in this agreement shall obligate Broadcom to provide any
+          support for the Software. Broadcom may, but shall be under no obligation to, 
+          correct any defects in the Software and/or provide updates to licensees of the
+          Software.  Licensee shall make reasonable efforts to promptly report to Broadcom
+          any defects it finds in the Software, as an aid to creating improved revisions 
+          of the Software.
+
+    3.3.  Dangerous Applications.  The Software is not designed, intended, or certified 
+          for use in components of systems intended for the operation of weapons, weapons
+          systems, nuclear installations, means of mass transportation, aviation, 
+          life-support computers or equipment (including resuscitation equipment and 
+          surgical implants), pollution control, hazardous substances management, or for 
+          any other dangerous application in which the failure of the Software could 
+          create a situation where personal injury or death may occur.  Licensee 
+          understands that use of the Software in such applications is fully at the risk 
+          of Licensee.
+
+    4.    TERM AND TERMINATION
+
+    4.1.  Termination.  This Agreement will automatically terminate if Licensee fails to 
+          comply with any of the terms and conditions hereof. In such event, Licensee must
+          destroy all copies of the Software and all of its component parts.
+
+    4.2.  Effect Of Termination.  Upon any termination of this Agreement, the rights and
+          licenses granted to Licensee under this Agreement shall immediately terminate.
+
+    4.3.  Survival.  The rights and obligations under this Agreement which by their nature 
+          should survive termination will remain in effect after expiration or termination
+          of this Agreement.
+
+    5.    CONFIDENTIALITY
+
+    5.1.  Obligations.  Licensee acknowledges and agrees that any documentation relating to
+          the Software, and any other information (if such other information is identified 
+          as confidential or should be recognized as confidential under the circumstances) 
+          provided to Licensee by Broadcom hereunder (collectively, "Confidential 
+          Information") constitute the confidential and proprietary information of Broadcom,
+          and that Licensee's protection thereof is an essential condition to Licensee's use
+          and possession of the Software.  Licensee shall retain all Confidential 
+          Information in strict confidence and not disclose it to any third party or use it
+          in any way except under a written agreement with terms and conditions at least as 
+          protective as the terms of this Section.  Licensee will exercise at least the same 
+          amount of diligence in preserving the secrecy of the Confidential Information as 
+          it uses in preserving the secrecy of its own most valuable confidential information,
+          but in no event less than reasonable diligence.  Information shall not be 
+          considered Confidential Information if and to the extent that it: (i) was in the 
+          public domain at the time it was disclosed or has entered the public domain through 
+          no fault of Licensee; (ii) was known to Licensee, without restriction, at the time 
+          of disclosure as proven by the files of Licensee in existence at the time of 
+          disclosure; or (iii) becomes known to Licensee, without restriction, from a source 
+          other than Broadcom without breach of this Agreement by Licensee and otherwise not 
+          in violation of Broadcom's rights.
+
+    5.2.  Return of Confidential Information.  Notwithstanding the foregoing, all documents 
+          and other tangible objects containing or representing Broadcom Confidential 
+          Information and all copies thereof which are in the possession of Licensee shall 
+          be and remain the property of Broadcom, and shall be promptly returned to Broadcom 
+          upon written request by Broadcom or upon termination of this Agreement.
+
+    6.    LIMITATION OF LIABILITY
+          TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ANY OF 
+          BROADCOM'S LICENSORS HAVE ANY LIABILITY FOR ANY INDIRECT, INCIDENTAL, SPECIAL, OR 
+          CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER FOR 
+          BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR OTHERWISE, ARISING OUT OF THIS 
+          AGREEMENT, INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS, EVEN IF SUCH PARTY HAS 
+          BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Broadcom's 
+          liability whether in contract, tort (including negligence), or otherwise, exceed 
+          the amount paid by Licensee for Software under this Agreement.  THESE LIMITATIONS 
+          SHALL APPLY NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
+
+    7.    MISCELLANEOUS
+
+    7.1.  Assignment. This Agreement shall be binding upon and inure to the benefit of the 
+          parties and their respective successors and assigns, provided, however that 
+          Licensee may not assign this Agreement or any rights or obligation hereunder, 
+          directly or indirectly, by operation of law or otherwise, without the prior written 
+          consent of Broadcom, and any such attempted assignment shall be void.  
+          Notwithstanding the foregoing, Licensee may assign this Agreement to a successor 
+          to all or substantially all of its business or assets to which this Agreement 
+          relates that is not a competitor of Broadcom.
+
+    7.2.  Governing Law; Venue.  This Agreement shall be governed by the laws of California 
+          without regard to any conflict-of-laws rules, and the United Nations Convention on 
+          Contracts for the International Sale of Goods is hereby excluded.  The sole 
+          jurisdiction and venue for actions related to the subject matter hereof shall be 
+          the state and federal courts located in the County of Orange, California, and both 
+          parties hereby consent to such jurisdiction and venue.
+
+    7.3.  Severability.  All terms and provisions of this Agreement shall, if possible, be 
+          construed in a manner which makes them valid, but in the event any term or 
+          provision of this Agreement is found by a court of competent jurisdiction to be 
+          illegal or unenforceable, the validity or enforceability of the remainder of this 
+          Agreement shall not be affected if the illegal or unenforceable provision does not 
+          materially affect the intent of this Agreement.  If the illegal or unenforceable 
+          provision materially affects the intent of the parties to this Agreement, this 
+          Agreement shall become terminated.
+
+    7.4.  Equitable Relief.  Licensee hereby acknowledges that its breach of this Agreement 
+          would cause irreparable harm and significant injury to Broadcom that may be 
+          difficult to ascertain and that a remedy at law would be inadequate.  Accordingly, 
+          Licensee agrees that Broadcom shall have the right to seek and obtain immediate 
+          injunctive relief to enforce obligations under the Agreement in addition to any 
+          other rights and remedies it may have. 
+
+    7.5.  Export Regulations. The parties agree that they shall each comply, at their own 
+          expense, with the U.S. Foreign Corrupt Practices Act and all  import and export 
+          laws, restrictions, national security controls and regulations of the United 
+          States and any applicable foreign agency or authority.  The parties shall not 
+          import, export or re-export, or authorize the export or re-export of the Software 
+          or any other product, technology, or information that it obtains or learns 
+          hereunder, or any copy or direct product thereof, in violation of any of such 
+          laws, restrictions, or regulations or without any license or approval required 
+          thereunder.  Any and all obligations of the parties to provide the Software or 
+          any other product, technology, or information hereunder shall be subject in all 
+          respects to such laws, restrictions, and regulations.
+
+    7.6.  Waiver.  The waiver of, or failure to enforce, any breach or default hereunder 
+          shall not constitute the waiver of any other or subsequent breach or default.
+
+    7.7.  Entire Agreement.  This Agreement sets forth the entire Agreement between the 
+          parties and supersedes any and all prior proposals, agreements and 
+          representations between them, whether written or oral concerning the Software.
+          This Agreement may be changed only by mutual agreement of the parties in writing. 
+
+
+The Debian packaging is (C) 2009, Canonical Ltd and is licensed
+under the GPL, see `/usr/share/common-licenses/GPL'.
+
+
--- bcmwl-5.60.246.2+bdcom.orig/debian/bcmwl_supported
+++ bcmwl-5.60.246.2+bdcom/debian/bcmwl_supported
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+set -e
+
+# This is a nasty kluge, but it seems to work. Better check the output when
+# upgrading to a new release of the bcmwl driver, though.
+
+[ -n "$1" ] || {
+  echo "USAGE: $0 path/to/bcmwl/wlc_hybrid.o bcmwl" >&2
+  exit 1
+}
+
+echo "# Listing generated by bcmwl_supported. Do not edit manually."
+
+device_ids() {
+	local filename="$1"
+	grep PCI_VENDOR_ID_BROADCOM, $filename |
+	while read line; do
+		id=${line#*, }
+		id=${id%%,*}
+		id=${id#*0x}
+		echo $id
+	done
+}
+
+
+seen_ids=' '
+
+while [ -n "$1" ]; do
+  filename="$1"; shift
+  modname="$1";  shift
+  pkgname="$1";  shift
+
+  orig_ids="$(device_ids "$filename")"
+  if [ -z "$orig_ids" ]; then
+    echo "WARNING: No IDs were found from $filename" >&2
+  fi
+
+  for id in $orig_ids; do
+    case "$seen_ids" in
+      *" $id "*)
+        # Already seen the ID.
+        ;;
+      *)
+        # Not seen it yet.
+        seen_ids="${seen_ids}${id} "
+
+        printf "alias pci:v%08Xd%08Xsv*sd*bc*sc*i* %s %s\n" \
+          0x14E4 "0x$id" "$modname" "$pkgname"
+        ;;
+    esac
+  done
+done | sort
+
+
--- bcmwl-5.60.246.2+bdcom.orig/debian/patches/0006-fix-reentrant-scan.patch
+++ bcmwl-5.60.246.2+bdcom/debian/patches/0006-fix-reentrant-scan.patch
@@ -0,0 +1,25 @@
+diff -Nur -x '*.orig' -x '*~' bcmwl-5.60.48.36+bdcom/src/src/wl/sys/wl_iw.c bcmwl-5.60.48.36+bdcom.new/src/src/wl/sys/wl_iw.c
+--- src.orig/src/wl/sys/wl_iw.c	2010-02-05 20:59:15.000000000 -0500
++++ src/src/wl/sys/wl_iw.c	2010-05-26 10:33:34.860299752 -0400
+@@ -921,6 +921,7 @@
+ 
+ 	if ((error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci))))
+ 		return error;
++	/* check for scan in progress */
+ 	ci.scan_channel = dtoh32(ci.scan_channel);
+ 	if (ci.scan_channel)
+ 		return -EAGAIN;
+@@ -932,6 +933,13 @@
+ 	list->buflen = htod32(buflen);
+ 	if ((error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, buflen))) {
+ 		kfree(list);
++		if (error == BCME_NORESOURCE) {
++			WL_ERROR(("wl_iw_get_scan: BCME_NORESOURCE; returning EAGAIN"));
++			return -EAGAIN;
++               } else if (error == BCME_NOTUP) {
++			WL_ERROR(("wl_iw_get_scan: BCME_NOTUP; returning EAGAIN"));
++			return -EAGAIN;
++               }
+ 		return error;
+ 	}
+ 	list->buflen = dtoh32(list->buflen);
--- bcmwl-5.60.246.2+bdcom.orig/debian/patches/0005-add-scan-events.patch
+++ bcmwl-5.60.246.2+bdcom/debian/patches/0005-add-scan-events.patch
@@ -0,0 +1,13 @@
+diff -Nur -x '*.orig' -x '*~' bcmwl-5.60.48.36+bdcom/src/src/wl/sys/wl_iw.c bcmwl-5.60.48.36+bdcom.new/src/src/wl/sys/wl_iw.c
+--- src.orig/src/wl/sys/wl_iw.c	2010-02-05 20:59:15.000000000 -0500
++++ src/src/wl/sys/wl_iw.c	2010-05-26 10:26:50.932299471 -0400
+@@ -2432,6 +2432,9 @@
+ 		}
+ 		return;
+ 	}
++	case WLC_E_SCAN_COMPLETE:
++		cmd = SIOCGIWSCAN;
++		break;
+ #endif 
+ 
+ 	default:
--- bcmwl-5.60.246.2+bdcom.orig/debian/patches/0001-MODULE_LICENSE.patch
+++ bcmwl-5.60.246.2+bdcom/debian/patches/0001-MODULE_LICENSE.patch
@@ -0,0 +1,12 @@
+index 0f81236..c9968df 100644
+--- src/src/wl/sys/wl_linux.c.orig
++++ src/src/wl/sys/wl_linux.c
+@@ -163,6 +163,8 @@ struct wl_if *wl_alloc_if(wl_info_t *wl, int iftype, uint unit, struct wlc_if* w
+ 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 }, 
--- bcmwl-5.60.246.2+bdcom.orig/debian/patches/0007-fix-send-event-stack.patch
+++ bcmwl-5.60.246.2+bdcom/debian/patches/0007-fix-send-event-stack.patch
@@ -0,0 +1,12 @@
+diff -Nur -x '*.orig' -x '*~' bcmwl-5.60.48.36+bdcom/src/wl/sys/wl_iw.c bcmwl-5.60.48.36+bdcom.new/src/wl/sys/wl_iw.c
+--- bcmwl-5.60.48.36+bdcom/src/wl/sys/wl_iw.c	2010-02-05 20:59:15.000000000 -0500
++++ bcmwl-5.60.48.36+bdcom.new/src/wl/sys/wl_iw.c	2010-06-11 14:38:09.082192453 -0400
+@@ -2439,7 +2439,7 @@
+ 		break;
+ 	}
+ 		if (cmd)
+-			wireless_send_event(dev, cmd, &wrqu, extra);
++			wireless_send_event(dev, cmd, &wrqu, NULL);
+ 
+ #if WIRELESS_EXT > 14
+ 
--- bcmwl-5.60.246.2+bdcom.orig/debian/patches/0002-Makefile.patch
+++ bcmwl-5.60.246.2+bdcom/debian/patches/0002-Makefile.patch
@@ -0,0 +1,25 @@
+diff -Nur src.orig/Makefile src/Makefile
+--- src.orig/Makefile	2010-02-06 02:59:15.000000000 +0100
++++ src/Makefile	2010-02-14 16:16:10.819815931 +0100
+@@ -13,6 +13,12 @@
+ #
+ # $Id: Makefile_kbuild_portsrc,v 1.5.4.1 2009/08/13 21:37:18 Exp $
+ 
++ifeq ($(shell dpkg --print-architecture),amd64)
++BINARCH = x86_64
++else
++BINARCH = i386
++endif
++
+ obj-m              += wl.o
+ 
+ wl-objs            := 
+@@ -24,7 +30,7 @@
+ EXTRA_CFLAGS       += -I$(src)/src/include
+ EXTRA_CFLAGS       += -I$(src)/src/wl/sys -I$(src)/src/wl/phy
+ 
+-EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped
++EXTRA_LDFLAGS      := $(src)/lib/wlc_hybrid.o_shipped_$(BINARCH)
+ 
+ all:
+ 	KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
