Remove support for Linux kernels older than 2.6.13

Linux 2.6.13 introduced Wireless Extension 18 with WPA support.  It was
released in August 2005.  People making changes to MadWifi should not be
required to be software archeologistists to test their changes.
This commit is contained in:
Pavel Roskin 2013-11-12 11:46:06 -05:00
parent 4f4d17ea6e
commit 8c73cc55b1
32 changed files with 25 additions and 528 deletions

16
INSTALL
View File

@ -28,11 +28,11 @@ Requirements
was compiled by gcc 3.4.2). Ignoring this rule will cause "Invalid
module format" errors during module load.
Linux 2.4.x kernels starting with 2.4.22 and 2.6 kernels should work
without problems. Due to quick pace of Linux development, there is no
way compatibility with the future 2.6 kernels can be ensured. However,
the latest 2.6 kernel at the time of the release should be expected to
work. For AHB support, Linux 2.6.19 or newer is required.
Linux kernels starting with version 2.6.13 should work without problems.
Due to quick pace of Linux development, there is no way compatibility
with the future 2.6 kernels can be ensured. However, the latest 2.6
kernel at the time of the release should be expected to work. For AHB
support, Linux 2.6.19 or newer is required.
Automatic module loading support (CONFIG_KMOD) is highly recommended;
otherwise, you'll need to load all required modules manually.
@ -67,17 +67,17 @@ in the top-level MadWifi source directory to build all the modules for
the currently running system.
You MUST do a "make clean" before compiling for a different version of
Linux, e.g. building for 2.6 after building for 2.4.
Linux.
If you want to compile MadWifi for a different kernel, you need to
specify the location of the kernel build tree, e.g.:
$ make KERNELPATH=/usr/src/linux-2.6.3
$ make KERNELPATH=/usr/src/linux-3.12
Note that you can also specify this path by setting an environment
variable; e.g.
$ export KERNELPATH=/usr/src/linux-2.6.3
$ export KERNELPATH=/usr/src/linux-3.12
$ make
If the kernel was built outside the source directory, KERNELPATH should

View File

@ -56,13 +56,7 @@ all: modules tools
.PHONY: modules
modules: configcheck
ifdef LINUX24
for i in $(obj-y); do \
$(MAKE) -C $$i || exit 1; \
done
else
$(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
endif
# conflicts with the 'tools' subdirectory
.PHONY: tools
@ -154,10 +148,10 @@ configcheck: sanitycheck
@# check kernel version
@case $(KERNELRELEASE) in \
2.[456].*) ;; \
2.6.*) ;; \
[3-9].*) ;; \
*) echo "FAILED"; \
echo "Only kernel versions 2.4.x and above are supported."; \
echo "Only kernel versions 2.6.13 and above are supported."; \
echo "You have $(KERNELRELEASE)."; \
exit 1 ;; \
esac

View File

@ -96,19 +96,7 @@ include $(KERNELCONF)
# installed to
KMODPATH := /lib/modules/$(KERNELRELEASE)/net
# Recognize 2.4.x kernels to support the old build system
ifeq ($(filter-out 2.4%,$(KERNELRELEASE)),)
LINUX24 = y
endif
ifndef LINUX24
KMODSUF := ko
else
export-objs = $(foreach m, $(obj-m), $($(m:.o=-objs)))
list-multi = $(obj-m)
KMODSUF := o
endif
NM= nm
#

View File

@ -1,41 +1,9 @@
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
# Linux 2.4 support
O_TARGET := madwifi.o
subdir-$(CONFIG_ATHEROS) += ath ath_hal net80211
subdir-$(CONFIG_ATHEROS_RATE_AMRR) += ath_rate/amrr
subdir-$(CONFIG_ATHEROS_RATE_MINSTREL) += ath_rate/minstrel
subdir-$(CONFIG_ATHEROS_RATE_ONOE) += ath_rate/onoe
subdir-$(CONFIG_ATHEROS_RATE_SAMPLE) += ath_rate/sample
ifeq ($(CONFIG_ATHEROS),y)
obj-$(CONFIG_ATHEROS_RATE_AMRR) += ath_rate/amrr/ath_rate.o
obj-$(CONFIG_ATHEROS_RATE_MINSTREL) += ath_rate/minstrel/ath_rate.o
obj-$(CONFIG_ATHEROS_RATE_ONOE) += ath_rate/onoe/ath_rate.o
obj-$(CONFIG_ATHEROS_RATE_SAMPLE) += ath_rate/sample/ath_rate.o
ifeq ($(strip $(BUS)),AHB)
obj-y += ath/ath_ahb.o
else
obj-y += ath/ath_pci.o
endif
obj-y += ath_hal/ath_hal.o
obj-y += net80211/net80211.o
endif
include $(TOPDIR)/Rules.make
else
# Linux 2.6 support
obj-$(CONFIG_ATHEROS_RATE_AMRR) += ath_rate/amrr/
obj-$(CONFIG_ATHEROS_RATE_MINSTREL) += ath_rate/minstrel/
obj-$(CONFIG_ATHEROS_RATE_ONOE) += ath_rate/onoe/
obj-$(CONFIG_ATHEROS_RATE_SAMPLE) += ath_rate/sample/
obj-$(CONFIG_ATHEROS) += ath/ ath_hal/ net80211/
endif
ifeq ($(CONFIG_ATHEROS_DEBUG),y)
EXTRA_CFLAGS += -DAR_DEBUG -DIEEE80211_DEBUG
endif

5
README
View File

@ -278,11 +278,10 @@ together with WPA/WPA2 or without; consult the wpa_supplicant
documentation for an up to date list.
MadWifi supports the use of the Wireless Extensions ioctls equal to or
greater than WE18 (linux 2.6.15). When using wpa_supplicant with a
greater than WE18 (Linux 2.6.13). When using wpa_supplicant with a
recent linux kernel, it is preferred to use the 'wext' driver backend,
rather than the private MadWifi ioctls. This means that '-D wext'
option should be used with wpa_supplicant when the linux kernel version
is 2.6.15 or above.
option should be used with wpa_supplicant.
NOTE: the in-kernel authenticator is being replaced; to use it you need
to follow the directions in net80211/Makefile.

View File

@ -33,17 +33,5 @@ INCS += -I$(TOP) -I$(HAL) -I$(WLAN)
EXTRA_CFLAGS += $(INCS) $(COPTS)
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_$(BUSNAME).o
ath_$(BUSNAME)-objs := if_ath.o if_ath_radar.o if_ath_hal_extensions.o if_ath_$(BUSNAME).o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) := if_ath.o if_ath_radar.o if_ath_hal_extensions.o if_ath_$(BUSNAME).o
O_TARGET := ath_$(BUSNAME).o
include $(TOPDIR)/Rules.make
export-objs := if_ath_$(BUSNAME).o
list-multi := ath_$(BUSNAME).o
endif

View File

@ -359,20 +359,6 @@ static struct notifier_block ath_event_block = {
.notifier_call = ath_rcv_dev_event
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(beacon_cal, "i");
MODULE_PARM(countrycode, "i");
MODULE_PARM(maxvaps, "i");
MODULE_PARM(outdoor, "i");
MODULE_PARM(xchanmode, "i");
MODULE_PARM(rfkill, "i");
#ifdef ATH_CAP_TPC
MODULE_PARM(hal_tpc, "i");
#endif
MODULE_PARM(autocreate, "s");
MODULE_PARM(ratectl, "s");
MODULE_PARM(intmit, "i");
#else
#include <linux/moduleparam.h>
module_param(beacon_cal, int, 0600);
module_param(countrycode, int, 0600);
@ -386,7 +372,6 @@ module_param(hal_tpc, int, 0600);
module_param(autocreate, charp, 0600);
module_param(ratectl, charp, 0600);
module_param(intmit, int, 0600);
#endif
MODULE_PARM_DESC(countrycode, "Override default country code. Default is 0.");
MODULE_PARM_DESC(maxvaps, "Maximum VAPs. Default is 4.");
MODULE_PARM_DESC(outdoor, "Enable/disable outdoor use. Default is 0.");
@ -405,11 +390,7 @@ MODULE_PARM_DESC(intmit, "Enable interference mitigation by default. Default is
static int ath_debug = 0;
#ifdef AR_DEBUG
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(ath_debug, "i");
#else
module_param(ath_debug, int, 0600);
#endif
MODULE_PARM_DESC(ath_debug, "Load-time driver debug output enable");
static void ath_printrxbuf(const struct ath_buf *, int);
static void ath_printtxbuf(const struct ath_buf *, int);
@ -417,11 +398,7 @@ static void ath_printtxbuf(const struct ath_buf *, int);
static int ieee80211_debug = 0;
#ifdef AR_DEBUG
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(ieee80211_debug, "i");
#else
module_param(ieee80211_debug, int, 0600);
#endif
MODULE_PARM_DESC(ieee80211_debug, "Load-time 802.11 debug output enable");
#endif /* defined(AR_DEBUG) */

View File

@ -65,13 +65,9 @@
#include "ah_devid.h"
#include "if_ath_pci.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
/*
* PCI initialization uses Linux 2.4.x version and
* older kernels do not support this
*/
#error Atheros PCI version requires at least Linux kernel version 2.4.0
#endif /* kernel < 2.4.0 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13))
#error Atheros PCI version requires at least Linux kernel version 2.6.13
#endif /* kernel < 2.6.13 */
struct ath_pci_softc {
struct ath_softc aps_sc;
@ -350,7 +346,6 @@ static struct pci_driver ath_pci_driver = {
.suspend = ath_pci_suspend,
.resume = ath_pci_resume,
#endif /* CONFIG_PM */
/* Linux 2.4.6 has save_state and enable_wake that are not used here */
};
int
@ -364,11 +359,9 @@ ath_ioctl_ethtool(struct ath_softc *sc, int cmd, void __user *addr)
info.cmd = cmd;
strncpy(info.driver, dev_info, sizeof(info.driver) - 1);
strncpy(info.version, version, sizeof(info.version) - 1);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,22)
/* include the device name so later versions of kudzu DTRT */
strncpy(info.bus_info, pci_name((struct pci_dev *)sc->sc_bdev),
sizeof(info.bus_info) - 1);
#endif
return copy_to_user(addr, &info, sizeof(info)) ? -EFAULT : 0;
}

View File

@ -44,25 +44,15 @@
#define bus_map_single pci_map_single
#define bus_unmap_single pci_unmap_single
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
#define bus_dma_sync_single pci_dma_sync_single_for_cpu
#define PCI_SAVE_STATE(a,b) pci_save_state(a)
#define PCI_RESTORE_STATE(a,b) pci_restore_state(a)
#else
#define bus_dma_sync_single pci_dma_sync_single
#define PCI_SAVE_STATE(a,b) pci_save_state(a, b)
#define PCI_RESTORE_STATE(a,b) pci_restore_state(a, b)
#endif
#define bus_alloc_consistent pci_alloc_consistent
#define bus_free_consistent pci_free_consistent
#define BUS_DMA_FROMDEVICE PCI_DMA_FROMDEVICE
#define BUS_DMA_TODEVICE PCI_DMA_TODEVICE
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
#define pm_message_t u32
#endif
#ifndef PCI_D0
#define PCI_D0 0
#endif

View File

@ -79,17 +79,6 @@ typedef void *TQUEUE_ARG;
#endif /* !DECLARE_TASKLET */
#include <linux/sched.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)) && !defined(INIT_WORK)
#include <linux/tqueue.h>
#define work_struct tq_struct
#define schedule_work(t) schedule_task((t))
#define flush_scheduled_work() flush_scheduled_tasks()
#define ATH_INIT_WORK(t, f) do { \
memset((t), 0, sizeof(struct tq_struct)); \
(t)->routine = (void (*)(void *)) (f); \
(t)->data = (void *)(t); \
} while (0)
#else
#include <linux/workqueue.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
@ -98,8 +87,6 @@ typedef void *TQUEUE_ARG;
#define ATH_INIT_WORK(_t, _f) INIT_WORK((_t), (_f));
#endif
#endif /* KERNEL_VERSION < 2.5.41 */
/*
* Guess how the interrupt handler should work.
*/
@ -125,50 +112,10 @@ typedef void irqreturn_t;
#define SET_NETDEV_DEV(ndev, pdev)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask,
void (*setup)(struct net_device *))
{
struct net_device *dev;
int alloc_size;
/* ensure 32-byte alignment of the private area */
alloc_size = sizeof (*dev) + sizeof_priv + 31;
dev = (struct net_device *)kzalloc(alloc_size, GFP_KERNEL);
if (dev == NULL) {
printk(KERN_ERR "alloc_dev: Unable to allocate device memory.\n");
return NULL;
}
if (sizeof_priv)
dev->priv = (void *)(((long)(dev + 1) + 31) & ~31);
setup(dev);
strcpy(dev->name, mask);
return dev;
}
/* Avoid name collision - some vendor kernels backport alloc_netdev() */
#undef alloc_netdev
#define alloc_netdev(s,m,d) _alloc_netdev(s, m, d)
/* Some vendors backport PDE, so make it a macro here */
#undef PDE
#define PDE(inode) ((struct proc_dir_entry *)(inode)->u.generic_ip)
#endif
/*
* Deal with the sysctl handler api changing.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
#define ATH_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
f(ctl_table *ctl, int write, struct file *filp, \
void __user *buffer, size_t *lenp)
#define ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos) \
proc_dointvec(ctl, write, filp, buffer, lenp)
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#define ATH_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
f(ctl_table *ctl, int write, struct file *filp, \
void __user *buffer, size_t *lenp, loff_t *ppos)

View File

@ -130,10 +130,6 @@ ath_hal-objs += \
endif
endif
ifdef LINUX24
export-objs := ah_os.o
endif
INCS += -I$(HAL)
EXTRA_CFLAGS+= $(INCS) $(COPTS)

View File

@ -100,16 +100,4 @@ ath_hal-objs += \
ar5312/ar5315_gpio.o
endif
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_hal.o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += $(ath_hal-objs)
O_TARGET := ath_hal.o
include $(TOPDIR)/Rules.make
export-objs := ah_os.o
list-multi := ath_hal.o
endif

View File

@ -144,12 +144,10 @@ struct ath_hal_rf *const *ah_rfs_ptrs[] = { \
* or the replacements is that we may be byte-swapping data twice, so we try to
* avoid it.
*
* We use raw access for Linux prior to 2.6.12. For newer version, we need to
* use ioread32() and iowrite32(), which would take care of indirect access to
* the registers.
* We use use ioread32() and iowrite32(), which should take care of indirect
* access to the registers.
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)) && \
(AH_BYTE_ORDER == AH_BIG_ENDIAN) && \
#if (AH_BYTE_ORDER == AH_BIG_ENDIAN) && \
!defined(CONFIG_GENERIC_IOMAP) && \
!defined(CONFIG_PARISC) && \
!(defined(CONFIG_PPC64) && \
@ -184,42 +182,22 @@ struct ath_hal_rf *const *ah_rfs_ptrs[] = { \
#if (AH_BYTE_ORDER == AH_BIG_ENDIAN)
# define is_reg_le(__reg) ((0x4000 <= (__reg) && (__reg) < 0x5000) || \
(0x7000 <= (__reg) && (__reg) < 0x8000))
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
if (is_reg_le(_reg)) \
iowrite32((_val), (_ah)->ah_sh + (_reg)); \
else \
iowrite32be((_val), (_ah)->ah_sh + (_reg)); \
} while (0)
# define _OS_REG_READ(_ah, _reg) \
# define _OS_REG_READ(_ah, _reg) \
(is_reg_le(_reg) ? \
ioread32((_ah)->ah_sh + (_reg)) : \
ioread32be((_ah)->ah_sh + (_reg)))
# else /* Linux < 2.6.12 */
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
writel(is_reg_le(_reg) ? \
(_val) : cpu_to_le32(_val), \
(_ah)->ah_sh + (_reg)); \
} while (0)
# define _OS_REG_READ(_ah, _reg) \
(is_reg_le(_reg) ? \
readl((_ah)->ah_sh + (_reg)) : \
cpu_to_le32(readl((_ah)->ah_sh + (_reg))))
# endif /* Linux < 2.6.12 */
#else /* Little endian */
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
iowrite32((_val), (_ah)->ah_sh + (_reg)); \
} while (0)
# define _OS_REG_READ(_ah, _reg) \
# define _OS_REG_READ(_ah, _reg) \
ioread32((_ah)->ah_sh + (_reg))
# else /* Linux < 2.6.12 */
# define _OS_REG_WRITE(_ah, _reg, _val) do { \
writel((_val), (_ah)->ah_sh + (_reg)); \
} while (0)
# define _OS_REG_READ(_ah, _reg) \
readl((_ah)->ah_sh + (_reg))
# endif /* Linux < 2.6.12 */
#endif /* Little endian */
/*

View File

@ -7,13 +7,7 @@ include $(TOP)/Makefile.inc
.PHONY: modules
modules:
ifdef LINUX24
for i in $(obj-y); do \
$(MAKE) -C $$i || exit 1; \
done
else
$(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
endif
.PHONY: install
install:

View File

@ -19,17 +19,5 @@ INCS = -include $(COMPAT)/compat.h -I$(COMPAT)
INCS += -I$(TOP) -I$(ATH) -I$(HAL)
EXTRA_CFLAGS += $(INCS) $(COPTS)
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_rate_amrr.o
ath_rate_amrr-objs := amrr.o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) := amrr.o
export-objs := amrr.o
list-multi := ath_rate_amrr.o
O_TARGET := ath_rate.o
include $(TOPDIR)/Rules.make
endif

View File

@ -19,17 +19,5 @@ INCS = -include $(COMPAT)/compat.h -I$(COMPAT)
INCS += -I$(TOP) -I$(ATH) -I$(HAL)
EXTRA_CFLAGS += $(INCS) $(COPTS)
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_rate_minstrel.o
ath_rate_minstrel-objs := minstrel.o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) := minstrel.o
export-objs := minstrel.o
list-multi := ath_rate_minstrel.o
O_TARGET := ath_rate.o
include $(TOPDIR)/Rules.make
endif

View File

@ -156,17 +156,10 @@ static void ath_rate_ctl_reset(struct ath_softc *, struct ieee80211_node *);
* last timer period. */
static void ath_rate_statistics(void *arg, struct ieee80211_node *ni);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(ath_lookaround_rate, "i");
MODULE_PARM(ath_ewma_level, "i");
MODULE_PARM(ath_segment_size, "i");
#else
#include <linux/moduleparam.h>
module_param(ath_lookaround_rate, int, 0600);
module_param(ath_ewma_level, int, 0600);
module_param(ath_segment_size, int, 0600);
#endif
MODULE_PARM_DESC(ath_lookaround_rate, " % of packets sent to fill statistics "
"table (10) ");
MODULE_PARM_DESC(ath_ewma_level, " scaling % used in ewma rolloff "

View File

@ -19,17 +19,5 @@ INCS = -include $(COMPAT)/compat.h -I$(COMPAT)
INCS += -I$(TOP) -I$(ATH) -I$(HAL)
EXTRA_CFLAGS += $(INCS) $(COPTS)
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_rate_onoe.o
ath_rate_onoe-objs := onoe.o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) := onoe.o
export-objs := onoe.o
list-multi := ath_rate_onoe.o
O_TARGET := ath_rate.o
include $(TOPDIR)/Rules.make
endif

View File

@ -19,17 +19,5 @@ INCS = -include $(COMPAT)/compat.h -I$(COMPAT)
INCS += -I$(TOP) -I$(ATH) -I$(HAL)
EXTRA_CFLAGS += $(INCS) $(COPTS)
ifneq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) += ath_rate_sample.o
ath_rate_sample-objs := sample.o
endif
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
obj-$(CONFIG_ATHEROS) := sample.o
export-objs := sample.o
list-multi := ath_rate_sample.o
O_TARGET := ath_rate.o
include $(TOPDIR)/Rules.make
endif

View File

@ -166,12 +166,6 @@ static inline void *_kzalloc(size_t size, gfp_t flags)
#define ATH_REGISTER_SYSCTL_TABLE(t) register_sysctl_table(t)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
#define __user
#define __kernel
#define __iomem
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs)
{
@ -191,12 +185,6 @@ typedef unsigned long resource_size_t;
#define IRQF_SHARED SA_SHIRQ
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) || \
((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && \
((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3))))
#define netdev_priv(_netdev) ((_netdev)->priv)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
#define skb_end_pointer(_skb) ((_skb)->end)
#define skb_tail_pointer(_skb) ((_skb)->tail)
@ -232,10 +220,6 @@ typedef unsigned long resource_size_t;
#define __skb_queue_after(_list, _old, _new) __skb_append(_old, _new, _list)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define request_module(_fmt, _modname) request_module(_modname)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#ifndef spin_lock_irqsave_nested
#define spin_lock_irqsave_nested(_lock, _flags, _subclass) \

View File

@ -44,36 +44,3 @@ wlan_xauth-objs := ieee80211_xauth.o
wlan_acl-objs := ieee80211_acl.o
wlan_scan_sta-objs := ieee80211_scan_sta.o
wlan_scan_ap-objs := ieee80211_scan_ap.o
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
export-objs := if_media.o \
ieee80211.o ieee80211_beacon.o ieee80211_crypto.o \
ieee80211_crypto_none.o ieee80211_input.o ieee80211_node.o \
ieee80211_output.o ieee80211_power.o ieee80211_proto.o \
ieee80211_scan.o ieee80211_wireless.o ieee80211_linux.o \
ieee80211_crypto_wep.o ieee80211_crypto_tkip.o \
ieee80211_crypto_ccmp.o ieee80211_xauth.o ieee80211_rate.o \
ieee80211_skb.o
list-multi := wlan.o wlan_wep.o wlan_tkip.o wlan_ccmp.o wlan_acl.o \
$(MOD_AUTH) $(MOD_SCAN)
O_TARGET := net80211.o
include $(TOPDIR)/Rules.make
wlan.o: $(wlan-objs)
$(LD) -o wlan.o -r $(wlan-objs)
wlan_wep.o: $(wlan_wep-objs)
$(LD) -o wlan_wep.o -r $(wlan_wep-objs)
wlan_tkip.o: $(wlan_tkip-objs)
$(LD) -o wlan_tkip.o -r $(wlan_tkip-objs)
wlan_ccmp.o: $(wlan_ccmp-objs)
$(LD) -o wlan_ccmp.o -r $(wlan_ccmp-objs)
wlan_xauth.o: $(wlan_xauth-objs)
$(LD) -o wlan_xauth.o -r $(wlan_xauth-objs)
wlan_acl.o: $(wlan_acl-objs)
$(LD) -o wlan_acl.o -r $(wlan_acl-objs)
wlan_scan_sta.o: $(wlan_scan_sta-objs)
$(LD) -o wlan_scan_sta.o -r $(wlan_scan_sta-objs)
wlan_scan_ap.o: $(wlan_scan_ap-objs)
$(LD) -o wlan_scan_ap.o -r $(wlan_scan_ap-objs)
endif

View File

@ -470,12 +470,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct net_device *dev,
* alloc_etherdev or similar so we arrange for the
* space to be reclaimed accordingly.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
/* In 2.4 things are done differently... */
dev->features |= NETIF_F_DYNALLOC;
#else
dev->destructor = free_netdev;
#endif
vap->iv_ic = ic;
vap->iv_dev = dev; /* back pointer */

View File

@ -492,60 +492,7 @@ extern void skb_queue_drain(struct sk_buff_head *q);
#define _MOD_DEC_USE(_m) MOD_DEC_USE_COUNT
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
static __inline u_int64_t
get_jiffies_64(void)
{
return (u_int64_t) jiffies; /* XXX not right */
}
#endif
/* msecs_to_jiffies appeared in 2.6.7 and 2.4.29 */
#include <linux/delay.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && \
LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) || \
LINUX_VERSION_CODE < KERNEL_VERSION(2,4,29)
/* The following definitions and inline functions are
* copied from the kernel src, include/linux/jiffies.h */
#ifndef MSEC_PER_SEC
#define MSEC_PER_SEC (1000L)
#endif
#ifndef MAX_JIFFY_OFFSET
#define MAX_JIFFY_OFFSET ((~0UL >> 1)-1)
#endif
static __inline unsigned int jiffies_to_msecs(const unsigned long j)
{
#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
return (MSEC_PER_SEC / HZ) * j;
#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
#else
return (j * MSEC_PER_SEC) / HZ;
#endif
}
static __inline unsigned long msecs_to_jiffies(const unsigned int m)
{
if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
return MAX_JIFFY_OFFSET;
#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
return (m + (MSEC_PER_SEC / HZ) - 1) / (MSEC_PER_SEC / HZ);
#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
return m * (HZ / MSEC_PER_SEC);
#else
return (m * HZ + MSEC_PER_SEC - 1) / MSEC_PER_SEC;
#endif
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,7)
#include <linux/jiffies.h>
#endif
#ifndef CLONE_KERNEL
/*
@ -589,13 +536,7 @@ static __inline unsigned long msecs_to_jiffies(const unsigned int m)
/*
* Deal with the sysctl handler api changing.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
#define IEEE80211_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
f(ctl_table *ctl, int write, struct file *filp, \
void __user *buffer, size_t *lenp)
#define IEEE80211_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos) \
proc_dointvec(ctl, write, filp, buffer, lenp)
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
#define IEEE80211_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
f(ctl_table *ctl, int write, struct file *filp, \
void __user *buffer, size_t *lenp, loff_t *ppos)
@ -630,11 +571,6 @@ void ieee80211_proc_cleanup(struct ieee80211vap *);
#endif
void ieee80211_vlan_vattach(struct ieee80211vap *);
void ieee80211_vlan_vdetach(struct ieee80211vap *);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define free_netdev(dev) kfree(dev)
#endif
int ieee80211_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
void ieee80211_ioctl_vattach(struct ieee80211vap *);
void ieee80211_ioctl_vdetach(struct ieee80211vap *);

View File

@ -47,82 +47,7 @@
#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/delay.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
/* Copied from Linux lib/sort.c */
static void u32_swap(void *a, void *b, int size)
{
u32 t = *(u32 *)a;
*(u32 *)a = *(u32 *)b;
*(u32 *)b = t;
}
static void generic_swap(void *a, void *b, int size)
{
char t;
do {
t = *(char *)a;
*(char *)a++ = *(char *)b;
*(char *)b++ = t;
} while (--size > 0);
}
/**
* sort - sort an array of elements
* @base: pointer to data to sort
* @num: number of elements
* @size: size of each element
* @cmp: pointer to comparison function
* @swap: pointer to swap function or NULL
*
* This function does a heapsort on the given array. You may provide a
* swap function optimized to your element type.
*
* Sorting time is O(n log n) both on average and worst-case. While
* qsort is about 20% faster on average, it suffers from exploitable
* O(n*n) worst-case behavior and extra memory requirements that make
* it less suitable for kernel use.
*/
void sort(void *base, size_t num, size_t size,
int (*cmp)(const void *, const void *),
void (*swap)(void *, void *, int size))
{
/* pre-scale counters for performance */
int i = (num/2 - 1) * size, n = num * size, c, r;
if (!swap)
swap = (size == 4 ? u32_swap : generic_swap);
/* heapify */
for ( ; i >= 0; i -= size) {
for (r = i; r * 2 + size < n; r = c) {
c = r * 2 + size;
if (c < n - size && cmp(base + c, base + c + size) < 0)
c += size;
if (cmp(base + r, base + c) >= 0)
break;
swap(base + r, base + c, size);
}
}
/* sort */
for (i = n - size; i > 0; i -= size) {
swap(base, base + i, size);
for (r = 0; r * 2 + size < i; r = c) {
c = r * 2 + size;
if (c < i - size && cmp(base + c, base + c + size) < 0)
c += size;
if (cmp(base + r, base + c) >= 0)
break;
swap(base + r, base + c, size);
}
}
}
#else
#include <linux/sort.h>
#endif
#include "if_media.h"

View File

@ -396,7 +396,6 @@ unref_skb(struct sk_buff *skb, int type,
untrack_skb(skb, -1, func, line);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if ((in_irq() || irqs_disabled()) &&
(type == UNREF_USE_KFREE_SKB ||
type == UNREF_USE_DEV_KFREE_SKB)) {
@ -407,7 +406,6 @@ unref_skb(struct sk_buff *skb, int type,
type = UNREF_USE_DEV_KFREE_SKB_ANY;
dump_stack();
}
#endif
switch (type) {
case UNREF_USE_DEV_KFREE_SKB_ANY:
@ -655,9 +653,7 @@ int dev_queue_xmit_debug(struct sk_buff *skb,
struct sk_buff *skb_share_check_debug(struct sk_buff *skb, gfp_t pri,
const char *func, int line)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
might_sleep_if(pri & __GFP_WAIT);
#endif
if (skb_shared(skb)) {
struct sk_buff *nskb = track_skb(
clean_clone_or_copy(skb_clone(skb, pri)),
@ -680,9 +676,7 @@ void kfree_skb_fast_debug(struct sk_buff *skb,
struct sk_buff *skb_unshare_debug(struct sk_buff *skb, gfp_t pri,
const char *func, int line)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
might_sleep_if(pri & __GFP_WAIT);
#endif
if (skb_cloned(skb)) {
struct sk_buff *nskb = track_skb(
clean_clone_or_copy(skb_copy(skb, pri)), 0,

View File

@ -22,4 +22,4 @@ driver as you would normally do. If the kernel is already configured,
run "make oldconfig", and you'll be asked only about Atheros driver.
It's possible to build Madwifi modules when the driver is integrated
into Linux 2.6.x, but most users should not need that.
into the Linux kernel, but most users should not need that.

View File

@ -54,17 +54,6 @@ test -d ${SRC_COMPAT} || die "No compat directory ${SRC_COMPAT}"
WIRELESS=${KERNEL_PATH}/drivers/net/wireless
test -d ${WIRELESS} || die "No wireless directory ${WIRELESS}"
if test -f ${WIRELESS}/Kconfig; then
kbuild=2.6
kbuildconf=Kconfig
else if test -f ${WIRELESS}/Config.in; then
kbuild=2.4
kbuildconf=Config.in
else
die "Kernel build system is not supported"
fi
fi
echo "Copying top-level files"
MADWIFI=${WIRELESS}/madwifi
rm -rf ${MADWIFI}
@ -91,25 +80,11 @@ done
echo "Patching the build system"
if test "$kbuild" = 2.6; then
cp -f Kconfig ${MADWIFI}
sed -i '/madwifi/d;/^endmenu/i\
source "drivers/net/wireless/madwifi/Kconfig"' ${WIRELESS}/Kconfig
sed -i '$a\
obj-$(CONFIG_ATHEROS) += madwifi/
/madwifi/d;' ${WIRELESS}/Makefile
else
cp -f Config.in ${MADWIFI}
sed -i '$a\
source drivers/net/wireless/madwifi/Config.in
/madwifi/d' ${WIRELESS}/Config.in
sed -i '/madwifi/d;/include/i\
subdir-$(CONFIG_ATHEROS) += madwifi\
obj-$(CONFIG_ATHEROS) += madwifi/madwifi.o' ${WIRELESS}/Makefile
DST_DOC=${KERNEL_PATH}/Documentation
grep -q 'CONFIG_ATHEROS' ${DST_DOC}/Configure.help || \
PATCH ${DST_DOC}/Configure.help Configure.help.patch
fi
echo "Done"

View File

@ -6,13 +6,7 @@ obj-y := ccmp/ tkip/ wep/
include $(TOP)/Makefile.inc
modules:
ifdef LINUX24
for i in $(obj-y); do \
$(MAKE) -C $$i || exit 1; \
done
else
$(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
endif
install:
for i in $(obj-y); do \

View File

@ -714,14 +714,9 @@ MODULE_LICENSE("Dual BSD/GPL");
static int tests = -1;
static int debug = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(tests, "i");
MODULE_PARM(debug, "i");
#else
#include <linux/moduleparam.h>
module_param(tests, int, 0600);
module_param(debug, int, 0600);
#endif
MODULE_PARM_DESC(tests, "Specify which tests to run");
MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");

View File

@ -357,14 +357,9 @@ MODULE_LICENSE("Dual BSD/GPL");
static int tests = -1;
static int debug = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(tests, "i");
MODULE_PARM(debug, "i");
#else
#include <linux/moduleparam.h>
module_param(tests, int, 0600);
module_param(debug, int, 0600);
#endif
MODULE_PARM_DESC(tests, "Specify which tests to run");
MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");

View File

@ -302,14 +302,9 @@ MODULE_LICENSE("Dual BSD/GPL");
static int tests = -1;
static int debug = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
MODULE_PARM(tests, "i");
MODULE_PARM(debug, "i");
#else
#include <linux/moduleparam.h>
module_param(tests, int, 0600);
module_param(debug, int, 0600);
#endif
MODULE_PARM_DESC(tests, "Specify which tests to run");
MODULE_PARM_DESC(debug, "Enable IEEE80211_MSG_CRYPTO");

View File

@ -28,9 +28,6 @@ while test "$tries" != "0"; do
state="$6"
expr "$name" : "$PATTERN" >/dev/null || continue
# Compatibility for Linux 2.4.x
test -z "$state" && { use_name="-"; state="Live"; }
if test "$state" != "Live" || test "$use_count" != "0" || \
test "$use_name" != "-"; then
# Don't skip unload in the last run