--- /dev/null
+Index: src/version.h.in
+===================================================================
+--- src/version.h.in (revision 1748)
++++ src/version.h.in (revision 1750)
+@@ -50,6 +50,7 @@
+ #endif
+
+ /* WLAN_HOSTIF (generally set on the command line, not detected) */
++#define WLAN_NONE 0
+ #define WLAN_PCMCIA 1
+ #define WLAN_ISA 2
+ #define WLAN_PCI 3
+Index: src/include/wlan/wlan_compat.h
+===================================================================
+--- src/include/wlan/wlan_compat.h (revision 1748)
++++ src/include/wlan/wlan_compat.h (revision 1750)
+@@ -568,6 +568,10 @@
+ #define in_atomic() 0
+ #endif
+
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
++#define URB_ASYNC_UNLINK 0
++#endif
++
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
+ #define URB_ASYNC_UNLINK USB_ASYNC_UNLINK
+ #define usb_fill_bulk_urb FILL_BULK_URB
+Index: src/p80211/p80211frm.c
+===================================================================
+--- src/p80211/p80211frm.c (revision 1748)
++++ src/p80211/p80211frm.c (revision 1750)
+@@ -65,6 +65,7 @@
+ #include <linux/string.h>
+ #include <asm/byteorder.h>
+
++#include <wlan/version.h>
+ #include <wlan/wlan_compat.h>
+
+ /*================================================================*/
+Index: src/p80211/p80211conv.c
+===================================================================
+--- src/p80211/p80211conv.c (revision 1748)
++++ src/p80211/p80211conv.c (revision 1750)
+@@ -70,13 +70,12 @@
+
+ #include <asm/byteorder.h>
+
++#include <wlan/version.h>
+ #include <wlan/wlan_compat.h>
+
+-
+ /*================================================================*/
+ /* Project Includes */
+
+-#include <wlan/version.h>
+ #include <wlan/p80211types.h>
+ #include <wlan/p80211hdr.h>
+ #include <wlan/p80211conv.h>
+Index: src/p80211/p80211req.c
+===================================================================
+--- src/p80211/p80211req.c (revision 1748)
++++ src/p80211/p80211req.c (revision 1750)
+@@ -53,8 +53,6 @@
+ /*================================================================*/
+ /* System Includes */
+
+-#define __NO_VERSION__ /* prevent the static definition */
+-
+ #include <linux/config.h>
+ #include <linux/version.h>
+
+@@ -70,12 +68,12 @@
+ #include <net/sock.h>
+ #include <linux/netlink.h>
+
++#include <wlan/version.h>
+ #include <wlan/wlan_compat.h>
+
+ /*================================================================*/
+ /* Project Includes */
+
+-#include <wlan/version.h>
+ #include <wlan/p80211types.h>
+ #include <wlan/p80211hdr.h>
+ #include <wlan/p80211mgmt.h>
+@@ -351,8 +349,13 @@
+ void p80211indicate_init(void)
+ {
+ DBFENTER;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
++ netlink_kernel_create( P80211_NL_SOCK_IND, &p80211ind_rx);
++#else
+ nl_indicate =
+- netlink_kernel_create( P80211_NL_SOCK_IND, &p80211ind_rx);
++ netlink_kernel_create( P80211_NL_SOCK_IND, P80211_NL_MCAST_GRP_MLME, &p80211ind_rx, THIS_MODULE);
++
++#endif
+ if ( nl_indicate == NULL ) {
+ WLAN_LOG_DEBUG(2,"Failed to create indicate netlink i/f.\n");
+ }
+Index: src/p80211/p80211wep.c
+===================================================================
+--- src/p80211/p80211wep.c (revision 1748)
++++ src/p80211/p80211wep.c (revision 1750)
+@@ -56,6 +56,7 @@
+ #include <linux/slab.h>
+ #include <linux/random.h>
+
++#include <wlan/version.h>
+ #include <wlan/wlan_compat.h>
+
+ // #define WEP_DEBUG
+Index: src/p80211/p80211mod.c
+===================================================================
+--- src/p80211/p80211mod.c (revision 1748)
++++ src/p80211/p80211mod.c (revision 1750)
+@@ -70,12 +70,12 @@
+ #include <linux/wireless.h>
+ #include <linux/netdevice.h>
+
++#include <wlan/version.h>
+ #include <wlan/wlan_compat.h>
+
+ /*================================================================*/
+ /* Project Includes */
+
+-#include <wlan/version.h>
+ #include <wlan/p80211types.h>
+ #include <wlan/p80211hdr.h>
+ #include <wlan/p80211mgmt.h>
+Index: src/p80211/Makefile
+===================================================================
+--- src/p80211/Makefile (revision 1748)
++++ src/p80211/Makefile (revision 1750)
+@@ -50,7 +50,7 @@
+
+ ifneq ($(KERNELRELEASE),)
+
+-EXTRA_CFLAGS += -I$(WLAN_SRC)/include $(WLAN_INCLUDE_DEBUG)
++EXTRA_CFLAGS += -I$(WLAN_SRC)/include $(WLAN_INCLUDE_DEBUG) -DWLAN_HOSTIF=WLAN_NONE
+
+ ifeq ($(KERN_25), y)
+
+Index: src/prism2/driver/hfa384x_usb.c
+===================================================================
+--- src/prism2/driver/hfa384x_usb.c (revision 1748)
++++ src/prism2/driver/hfa384x_usb.c (revision 1750)
+@@ -2108,7 +2108,7 @@
+ ctlx->outbuf.rmemreq.offset,
+ ctlx->outbuf.rmemreq.page);
+
+- WLAN_LOG_DEBUG(4,"pktsize=%d\n",
++ WLAN_LOG_DEBUG(4,"pktsize=%ld\n",
+ ROUNDUP64(sizeof(ctlx->outbuf.rmemreq)));
+
+ ctlx->reapable = mode;
+@@ -3131,7 +3131,7 @@
+
+ if (result) {
+ WLAN_LOG_WARNING(
+- "Read from index %d failed, continuing\n",
++ "Read from index %ld failed, continuing\n",
+ i );
+ continue;
+ }
+@@ -4320,7 +4320,7 @@
+ if ( skblen >
+ (sizeof(p80211msg_lnxind_wlansniffrm_t) +
+ WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) ) {
+- WLAN_LOG_DEBUG(1, "overlen frm: len=%d\n",
++ WLAN_LOG_DEBUG(1, "overlen frm: len=%ld\n",
+ skblen - sizeof(p80211msg_lnxind_wlansniffrm_t));
+ }
+
+Index: src/prism2/driver/prism2_cs.c
+===================================================================
+--- src/prism2/driver/prism2_cs.c (revision 1748)
++++ src/prism2/driver/prism2_cs.c (revision 1750)
+@@ -61,7 +61,7 @@
+ ----------------------------------------------------------------*/
+ static void cs_error(client_handle_t handle, int func, int ret)
+ {
+-#if CS_RELEASE_CODE < 0x2911
++#if (defined(CS_RELEASE_CODE) && (CS_RELEASE_CODE < 0x2911))
+ CardServices(ReportError, dev_info, (void *)func, (void *)ret);
+ #else
+ error_info_t err = { func, ret };
+@@ -208,7 +208,7 @@
+ #endif
+ link->conf.IntType = INT_MEMORY_AND_IO;
+ link->priv = wlandev;
+-#if CS_RELEASE_CODE > 0x2911
++#if (defined(CS_RELEASE_CODE) && (CS_RELEASE_CODE < 0x2911))
+ link->irq.Instance = wlandev;
+ #endif
+
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.2-r1.ebuild,v 1.1 2005/11/02 20:44:02 betelgeuse Exp $
+
+inherit eutils linux-mod
+
+MY_P=${P/-modules/}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Kernel modules for Prism2/2.5/3 based 802.11b wireless LAN products"
+HOMEPAGE="http://linux-wlan.org"
+SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.bz2"
+
+LICENSE="MPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86"
+
+IUSE="debug pci pcmcia plx usb"
+
+BUILD_TARGETS="default"
+BUILD_PARAMS="WLAN_SRC=${S}/src"
+
+pkg_setup() {
+ # We have to put this to the global scope inside the function or it will be
+ # reset between functions because the ebuild is sourced many times.
+
+ MODULE_NAMES="p80211(net/wireless:${S}/src/p80211)"
+
+ if use pci; then
+ MODULE_NAMES="${MODULE_NAMES} prism2_pci(net/wireless:${S}/src/prism2/driver)"
+ fi
+
+ if use plx; then
+ MODULE_NAMES="${MODULE_NAMES} prism2_plx(net/wireless:${S}/src/prism2/driver)"
+ fi
+
+ if use pcmcia; then
+ MODULE_NAMES="${MODULE_NAMES} prism2_cs(net/wireless:${S}/src/prism2/driver)"
+ fi
+
+ if use usb; then
+ MODULE_NAMES="${MODULE_NAMES} prism2_usb(net/wireless:${S}/src/prism2/driver)"
+ fi
+
+ linux-mod_pkg_setup
+}
+
+config_by_usevar() {
+ local config=${3}
+ [[ -z ${config} ]] && config=${S}/default.config
+
+ if use ${2}; then
+ echo "${1}=y" >> ${config}
+ else
+ echo "${1}=n" >> ${config}
+ fi
+}
+
+src_unpack() {
+ local config=${S}/default.config
+
+ unpack ${A}
+
+ cd ${S}
+ epatch ${FILESDIR}/${MY_P}-module_param.patch
+ epatch ${FILESDIR}/${PV}-kernel-2.6.14.patch
+
+ cp ${S}/config.in ${config}
+
+ echo "TARGET_ROOT_ON_HOST=${D}" >> ${config}
+ echo "LINUX_SRC=${KERNEL_DIR}" >> ${config}
+ echo "FIRMWARE_DIR=/lib/firmware/" >> ${config}
+
+ if use pcmcia && [[ -n "${PCMCIA_VERSION}" ]]; then
+ echo "PCMCIA_SRC=${PCMCIA_SOURCE_DIR}" >> ${config}
+ fi
+
+ config_by_usevar PRISM2_USB usb
+ config_by_usevar PRISM2_PCI pci
+ config_by_usevar PRISM2_PLX plx
+ config_by_usevar PRISM2_PCMCIA pcmcia
+ config_by_usevar WLAN_DEBUG debug
+
+ if kernel_is gt 2 4; then
+ echo "KERN_25=y" >> ${config}
+ fi
+
+ sed -i -e "s:dep modules:modules:" ${S}/src/p80211/Makefile
+}
+
+src_compile() {
+ set_arch_to_kernel
+ emake default_config || die "emake default_config failed"
+ set_arch_to_portage
+
+ cd ${S}/src/mkmeta
+ emake || die "emake mkmeta failed"
+
+ linux-mod_src_compile
+}