6 obj := $(firstword $(obj) $(SUBDIRS) .)
9 ifeq ($(strip $(BUS)),AHB)
11 @@ -57,7 +56,24 @@ COPTS += -DDFS_DOMAIN_ETSI -DDFS_DOMAIN_
12 include $(TOP)/Makefile.inc
14 obj-m += ath_$(BUSNAME).o
15 -ath_$(BUSNAME)-objs := if_ath.o if_ath_radar.o if_ath_$(BUSNAME).o
16 +ath_objs := if_ath.o if_ath_radar.o if_ath_$(BUSNAME).o
17 +ath_$(BUSNAME)-objs := $(ath_objs)
19 +ifneq ($(SINGLE_MODULE),)
20 +include $(TOP)/net80211/Makefile
21 +include $(TOP)/ath_rate/sample/Makefile
22 +include $(TOP)/ath_rate/minstrel/Makefile
23 +RC_DECLARE=$(foreach R,$(ATH_RATE),extern void ath_rate_$(R)_init(void);extern void ath_rate_$(R)_exit(void);)
24 +RC_INIT=$(foreach R,$(ATH_RATE),ath_rate_$(R)_init();)
25 +RC_EXIT=$(foreach R,$(ATH_RATE),ath_rate_$(R)_exit();)
27 +ath_$(BUSNAME)-objs += $(patsubst %,../net80211/%,$(wlan-objs) $(foreach var,wep tkip ccmp acl xauth scan_sta scan_ap,$(wlan_$(var)-objs))) $(foreach RC,$(ATH_RATE),$(patsubst %,../ath_rate/$(RC)/%,$(ath_rate_$(RC)-objs)))
29 + ath_$(BUSNAME)-linkobjs := $(ath_objs) $(wlan-objs) $(foreach var,wep tkip ccmp acl xauth scan_sta scan_ap,$(wlan_$(var)-objs)) $(foreach RC,$(ATH_RATE),$(ath_rate_$(RC)-objs))
32 +EXTRA_CFLAGS += -DSINGLE_MODULE -DRC_INIT="$(RC_INIT)" -DRC_EXIT="$(RC_EXIT)" -DRC_DECLARE="$(RC_DECLARE)"
35 INCS += -I$(TOP) -I$(ATH_HAL) -I$(HAL) -I$(WLAN)
37 @@ -72,13 +88,8 @@ install:
38 test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH)
39 install -m 0644 ath_$(BUSNAME).$(KMODSUF) $(DESTDIR)/$(KMODPATH)
42 - rm -f *~ *.o *.ko *.mod.c .*.cmd
43 - rm -f .depend .version .*.o.flags .*.o.d
44 - rm -rf .tmp_versions
46 ath_$(BUSNAME).o: $(ath_$(BUSNAME)-objs)
47 - $(LD) $(LDOPTS) -o ath_$(BUSNAME).$(KMODSUF) -r $(ath_$(BUSNAME)-objs)
48 + $(LD) $(LDOPTS) -o ath_$(BUSNAME).$(KMODSUF) -r $(if $(ath_$(BUSNAME)-linkobjs),$(ath_$(BUSNAME)-linkobjs),$(ath_$(BUSNAME)-objs))
50 if_ath_hal.h: $(HAL)/ah.h
51 $(TOP)/scripts/if_ath_hal_generator.pl $< $@
52 --- a/net80211/ieee80211_acl.c
53 +++ b/net80211/ieee80211_acl.c
54 @@ -281,16 +281,6 @@ acl_getpolicy(struct ieee80211vap *vap)
62 -MODULE_AUTHOR("Errno Consulting, Sam Leffler");
63 -MODULE_DESCRIPTION("802.11 wireless support: MAC-based ACL policy");
64 -#ifdef MODULE_LICENSE
65 -MODULE_LICENSE("Dual BSD/GPL");
68 static const struct ieee80211_aclator mac = {
70 .iac_attach = acl_attach,
71 @@ -303,6 +293,18 @@ static const struct ieee80211_aclator ma
72 .iac_getpolicy = acl_getpolicy,
80 +MODULE_AUTHOR("Errno Consulting, Sam Leffler");
81 +MODULE_DESCRIPTION("802.11 wireless support: MAC-based ACL policy");
82 +#ifdef MODULE_LICENSE
83 +MODULE_LICENSE("Dual BSD/GPL");
88 init_ieee80211_acl(void)
90 --- a/net80211/ieee80211_crypto_ccmp.c
91 +++ b/net80211/ieee80211_crypto_ccmp.c
92 @@ -686,6 +686,8 @@ ccmp_decrypt(struct ieee80211_key *key,
101 --- a/net80211/ieee80211_crypto_tkip.c
102 +++ b/net80211/ieee80211_crypto_tkip.c
103 @@ -1046,6 +1046,8 @@ tkip_decrypt(struct tkip_ctx *ctx, struc
112 --- a/net80211/ieee80211_crypto_wep.c
113 +++ b/net80211/ieee80211_crypto_wep.c
114 @@ -497,6 +497,8 @@ wep_decrypt(struct ieee80211_key *key, s
120 MODULE_AUTHOR("Errno Consulting, Sam Leffler");
121 MODULE_DESCRIPTION("802.11 wireless support: WEP cipher");
122 #ifdef MODULE_LICENSE
123 --- a/net80211/ieee80211_linux.c
124 +++ b/net80211/ieee80211_linux.c
125 @@ -1015,6 +1015,10 @@ static struct notifier_block ieee80211_e
126 static char *version = RELEASE_VERSION;
127 static char *dev_info = "wlan";
129 +extern void ieee80211_auth_setup(void);
133 MODULE_AUTHOR("Errno Consulting, Sam Leffler");
134 MODULE_DESCRIPTION("802.11 wireless LAN protocol support");
135 #ifdef MODULE_VERSION
136 @@ -1024,8 +1028,6 @@ MODULE_VERSION(RELEASE_VERSION);
137 MODULE_LICENSE("Dual BSD/GPL");
140 -extern void ieee80211_auth_setup(void);
145 --- a/net80211/ieee80211_scan_ap.c
146 +++ b/net80211/ieee80211_scan_ap.c
147 @@ -763,15 +763,6 @@ action_tasklet(IEEE80211_TQUEUE_ARG data
148 (*ss->ss_ops->scan_default)(vap, &as->as_selbss);
154 -MODULE_AUTHOR("Errno Consulting, Sam Leffler");
155 -MODULE_DESCRIPTION("802.11 wireless support: default ap scanner");
156 -#ifdef MODULE_LICENSE
157 -MODULE_LICENSE("Dual BSD/GPL");
160 static const struct ieee80211_scanner ap_default = {
161 .scan_name = "default",
162 .scan_attach = ap_attach,
163 @@ -789,6 +780,16 @@ static const struct ieee80211_scanner ap
164 .scan_default = ap_default_action,
172 +MODULE_AUTHOR("Errno Consulting, Sam Leffler");
173 +MODULE_DESCRIPTION("802.11 wireless support: default ap scanner");
174 +#ifdef MODULE_LICENSE
175 +MODULE_LICENSE("Dual BSD/GPL");
179 init_scanner_ap(void)
180 --- a/net80211/ieee80211_scan_sta.c
181 +++ b/net80211/ieee80211_scan_sta.c
182 @@ -1208,6 +1208,8 @@ action_tasklet(IEEE80211_TQUEUE_ARG data
183 ieee80211_start_scan(vap, ss->ss_flags, ss->ss_duration, ss->ss_nssid, ss->ss_ssid);
191 @@ -1217,6 +1219,7 @@ MODULE_DESCRIPTION("802.11 wireless supp
192 MODULE_LICENSE("Dual BSD/GPL");
197 init_scanner_sta(void)
199 --- a/net80211/ieee80211_xauth.c
200 +++ b/net80211/ieee80211_xauth.c
202 #include <net80211/ieee80211_var.h>
207 -MODULE_AUTHOR("Errno Consulting, Sam Leffler");
208 -MODULE_DESCRIPTION("802.11 wireless support: external (user mode) authenticator");
209 -#ifdef MODULE_LICENSE
210 -MODULE_LICENSE("Dual BSD/GPL");
214 * One module handles everything for now. May want
215 * to split things up for embedded applications.
217 @@ -85,6 +76,18 @@ static const struct ieee80211_authentica
218 .ia_node_leave = NULL,
226 +MODULE_AUTHOR("Errno Consulting, Sam Leffler");
227 +MODULE_DESCRIPTION("802.11 wireless support: external (user mode) authenticator");
228 +#ifdef MODULE_LICENSE
229 +MODULE_LICENSE("Dual BSD/GPL");
234 init_ieee80211_xauth(void)
236 --- a/net80211/Makefile
237 +++ b/net80211/Makefile
239 # Makefile for the 802.11 WLAN modules.
241 obj := $(firstword $(obj) $(SUBDIRS) .)
244 +include $(TOP)/Makefile.inc
246 +ifeq ($(SINGLE_MODULE),)
249 # There is one authenticator mechanism: an in-kernel implementation
251 @@ -59,29 +63,8 @@ MOD_INSTALL := wlan.o wlan_wep.o wlan_tk
253 obj-m += $(MOD_INSTALL)
255 -wlan-objs := if_media.o \
257 - ieee80211.o ieee80211_beacon.o ieee80211_crypto.o \
258 - ieee80211_crypto_none.o ieee80211_input.o ieee80211_node.o \
259 - ieee80211_output.o ieee80211_power.o ieee80211_proto.o \
260 - ieee80211_scan.o ieee80211_wireless.o ieee80211_linux.o \
261 - ieee80211_monitor.o ieee80211_rate.o
262 -wlan_wep-objs := ieee80211_crypto_wep.o
263 -wlan_tkip-objs := ieee80211_crypto_tkip.o
264 -wlan_ccmp-objs := ieee80211_crypto_ccmp.o
265 -wlan_acl-objs := ieee80211_acl.o
266 -wlan_xauth-objs := ieee80211_xauth.o
267 -wlan_scan_sta-objs :=ieee80211_scan_sta.o
268 -wlan_scan_ap-objs := ieee80211_scan_ap.o
270 -include $(TOP)/Makefile.inc
272 INCS += -I$(TOP) -I$(ATH_HAL) -I$(HAL)
274 -EXTRA_CFLAGS+=$(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
276 --include $(TOPDIR)/Rules.make
279 $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
281 @@ -108,8 +91,28 @@ install:
282 f=`basename $$i .o`; \
283 install -m 0644 $$f.$(KMODSUF) $(DESTDIR)/$(KMODPATH); \
289 +wlan-objs := if_media.o \
291 + ieee80211.o ieee80211_beacon.o ieee80211_crypto.o \
292 + ieee80211_crypto_none.o ieee80211_input.o ieee80211_node.o \
293 + ieee80211_output.o ieee80211_power.o ieee80211_proto.o \
294 + ieee80211_scan.o ieee80211_wireless.o ieee80211_linux.o \
295 + ieee80211_monitor.o ieee80211_rate.o
296 +wlan_wep-objs := ieee80211_crypto_wep.o
297 +wlan_tkip-objs := ieee80211_crypto_tkip.o
298 +wlan_ccmp-objs := ieee80211_crypto_ccmp.o
299 +wlan_acl-objs := ieee80211_acl.o
300 +wlan_xauth-objs := ieee80211_xauth.o
301 +wlan_scan_sta-objs :=ieee80211_scan_sta.o
302 +wlan_scan_ap-objs := ieee80211_scan_ap.o
305 +EXTRA_CFLAGS+=$(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
307 +-include $(TOPDIR)/Rules.make
311 - -rm -f *~ *.o *.ko *.mod.c
312 - -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd
313 - -rm -rf .tmp_versions
315 +++ b/net80211/module.h
317 +#ifdef SINGLE_MODULE
323 +#define module_init(...)
324 +#define module_exit(...)
326 +#undef MODULE_AUTHOR
327 +#undef MODULE_LICENSE
328 +#undef MODULE_VERSION
329 +#undef MODULE_DESCRIPTION
330 +#define MODULE_AUTHOR(...)
331 +#define MODULE_LICENSE(...)
332 +#define MODULE_VERSION(...)
333 +#define MODULE_DESCRIPTION(...)
338 @@ -13780,3 +13780,5 @@ cleanup_ath_buf(struct ath_softc *sc, st
344 --- a/net80211/ieee80211.c
345 +++ b/net80211/ieee80211.c
347 #include <linux/config.h>
349 #include <linux/version.h>
350 +#include <linux/init.h>
351 #include <linux/module.h>
352 #include <linux/skbuff.h>
353 #include <linux/netdevice.h>
354 @@ -2015,3 +2016,65 @@ ieee80211_build_sc_ie(struct ieee80211co
355 int ath_debug_global = 0;
356 EXPORT_SYMBOL(ath_debug_global);
358 +#ifdef SINGLE_MODULE
359 +typedef void (*initfunc)(void);
361 +extern void init_ieee80211_acl(void);
362 +extern void init_crypto_ccmp(void);
363 +extern void init_crypto_tkip(void);
364 +extern void init_crypto_wep(void);
365 +extern void init_wlan(void);
366 +extern void init_scanner_ap(void);
367 +extern void init_scanner_sta(void);
368 +extern void init_ieee80211_xauth(void);
370 +extern void exit_ieee80211_acl(void);
371 +extern void exit_crypto_ccmp(void);
372 +extern void exit_crypto_tkip(void);
373 +extern void exit_crypto_wep(void);
374 +extern void exit_wlan(void);
375 +extern void exit_scanner_ap(void);
376 +extern void exit_scanner_sta(void);
377 +extern void exit_ieee80211_xauth(void);
379 +static __initdata initfunc net80211_init[] = {
381 + init_ieee80211_acl,
385 + init_ieee80211_xauth,
390 +static __exitdata initfunc net80211_exit[] = {
396 + exit_ieee80211_xauth,
397 + exit_ieee80211_acl,
401 +void net80211_init_module(void)
404 + for (i = 0; i < sizeof(net80211_init)/sizeof(net80211_init[0]); i++) {
405 + if (net80211_init[i])
406 + net80211_init[i]();
410 +void net80211_exit_module(void)
413 + for (i = 0; i < sizeof(net80211_exit)/sizeof(net80211_exit[0]); i++) {
414 + if (net80211_exit[i])
415 + net80211_exit[i]();
420 --- a/ath/if_ath_ahb.c
421 +++ b/ath/if_ath_ahb.c
422 @@ -447,10 +447,18 @@ MODULE_SUPPORTED_DEVICE("Atheros WLAN ca
423 MODULE_LICENSE("Dual BSD/GPL");
426 +#ifdef SINGLE_MODULE
433 printk(KERN_INFO "%s: %s\n", dev_info, version);
434 +#ifdef SINGLE_MODULE
435 + net80211_init_module();
438 platform_driver_register(&ahb_wmac_driver);
439 ath_sysctl_register();
441 @@ -463,6 +471,10 @@ exit_ath_ahb(void)
443 ath_sysctl_unregister();
444 platform_driver_unregister(&ahb_wmac_driver);
445 +#ifdef SINGLE_MODULE
447 + net80211_exit_module();
449 printk(KERN_INFO "%s: driver unloaded\n", dev_info);
451 module_exit(exit_ath_ahb);
452 --- a/ath/if_ath_pci.c
453 +++ b/ath/if_ath_pci.c
454 @@ -415,11 +415,19 @@ MODULE_SUPPORTED_DEVICE("Atheros WLAN ca
455 MODULE_LICENSE("Dual BSD/GPL");
458 +#ifdef SINGLE_MODULE
465 printk(KERN_INFO "%s: %s\n", dev_info, version);
467 +#ifdef SINGLE_MODULE
468 + net80211_init_module();
471 if (pci_register_driver(&ath_pci_driver) < 0) {
472 printk(KERN_ERR "%s: No devices found, driver not installed.\n", dev_info);
474 @@ -434,6 +442,10 @@ exit_ath_pci(void)
476 ath_sysctl_unregister();
477 pci_unregister_driver(&ath_pci_driver);
478 +#ifdef SINGLE_MODULE
480 + net80211_exit_module();
483 printk(KERN_INFO "%s: driver unloaded\n", dev_info);
485 --- a/ath_rate/minstrel/Makefile
486 +++ b/ath_rate/minstrel/Makefile
488 # Makefile for the Atheros Rate Control Support.
490 obj := $(firstword $(obj) $(SUBDIRS) .)
493 -obj-m += ath_rate_minstrel.o
494 ath_rate_minstrel-objs := minstrel.o
496 include $(TOP)/Makefile.inc
497 @@ -50,6 +48,10 @@ INCS += -I$(TOP) -I$(ATH) -I$(ATH_HAL) -
499 EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
501 +ifeq ($(SINGLE_MODULE),)
503 +obj-m += ath_rate_minstrel.o
505 -include $(TOPDIR)/Rules.make
508 @@ -59,10 +61,9 @@ install:
509 test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH)
510 install -m 0644 ath_rate_minstrel.$(KMODSUF) $(DESTDIR)/$(KMODPATH)
513 - -rm -f *~ *.o *.ko *.mod.c
514 - -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd
515 - -rm -rf .tmp_versions
517 ath_rate_minstrel.o: $(ath_rate_minstrel-objs)
518 $(LD) $(LDOPTS) -o ath_rate_minstrel.$(KMODSUF) -r $(ath_rate_minstrel-objs)
523 --- a/ath_rate/minstrel/minstrel.c
524 +++ b/ath_rate/minstrel/minstrel.c
525 @@ -945,6 +945,8 @@ static struct ieee80211_rate_ops ath_rat
526 .dynamic_proc_register = ath_rate_dynamic_proc_register,
529 +#include <net80211/module.h>
531 MODULE_AUTHOR("John Bicket/Derek Smithies");
532 MODULE_DESCRIPTION("Minstrel Rate bit-rate selection algorithm for Atheros devices");
533 #ifdef MODULE_VERSION
534 --- a/net80211/ieee80211_var.h
535 +++ b/net80211/ieee80211_var.h
537 #include <net80211/ieee80211_power.h>
538 #include <net80211/ieee80211_proto.h>
539 #include <net80211/ieee80211_scan.h>
543 * - Atheros chips use 6 bits when power is specified in whole dBm units, with
544 @@ -740,6 +741,8 @@ void ieee80211_dfs_action(struct ieee802
545 void ieee80211_expire_channel_excl_restrictions(struct ieee80211com *);
546 void ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs);
547 int ieee80211_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
548 +void net80211_init_module(void);
549 +void net80211_exit_module(void);
552 * Iterate through ic_channels to enumerate all distinct ic_ieee channel numbers.
553 --- a/net80211/ieee80211_linux.h
554 +++ b/net80211/ieee80211_linux.h
555 @@ -521,7 +521,10 @@ extern struct sk_buff * ieee80211_getmgt
556 #define IF_DRAIN(_q) skb_queue_drain(_q)
557 extern void skb_queue_drain(struct sk_buff_head *q);
559 -#ifndef __MOD_INC_USE_COUNT
560 +#ifdef SINGLE_MODULE
561 +#define _MOD_DEC_USE(_m) do {} while(0)
562 +#define _MOD_INC_USE(_m, _err) do {} while(0)
563 +#elif !defined(__MOD_INC_USE_COUNT)
564 #define _MOD_INC_USE(_m, _err) \
565 if (!try_module_get(_m)) { \
566 printk(KERN_WARNING "%s: try_module_get failed\n", \
567 --- a/ath_rate/sample/Makefile
568 +++ b/ath_rate/sample/Makefile
570 # Makefile for the Atheros Rate Control Support.
572 obj := $(firstword $(obj) $(SUBDIRS) .)
575 -obj-m += ath_rate_sample.o
576 ath_rate_sample-objs := sample.o
578 include $(TOP)/Makefile.inc
579 @@ -50,6 +48,9 @@ INCS += -I$(TOP) -I$(ATH) -I$(ATH_HAL) -
581 EXTRA_CFLAGS+= $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
583 +ifeq ($(SINGLE_MODULE),)
584 +obj-m += ath_rate_sample.o
586 -include $(TOPDIR)/Rules.make
589 @@ -59,10 +60,9 @@ install:
590 test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH)
591 install -m 0644 ath_rate_sample.$(KMODSUF) $(DESTDIR)/$(KMODPATH)
594 - -rm -f *~ *.o *.ko *.mod.c
595 - -rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd
596 - -rm -rf .tmp_versions
598 ath_rate_sample.o: $(ath_rate_sample-objs)
599 $(LD) $(LDOPTS) -o ath_rate_sample.$(KMODSUF) -r $(ath_rate_sample-objs)
609 obj := $(firstword $(obj) $(SUBDIRS) .)
611 +export TOP:=$(if $(wildcard $(firstword $(SUBDIRS))/Makefile.inc),$(firstword $(SUBDIRS)),$(CURDIR))
613 ifneq (svnversion.h,$(MAKECMDGOALS))
614 include $(TOP)/Makefile.inc
615 @@ -54,7 +54,7 @@ all: modules tools
616 modules: configcheck svnversion.h
618 for i in $(obj-y); do \
619 - $(MAKE) -C $$i || exit 1; \
620 + $(MAKE) -C $$i TOP="$(TOP)" || exit 1; \
623 $(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
624 @@ -89,7 +89,7 @@ install-modules: modules
625 sh scripts/find-madwifi-modules.sh -r $(KERNELRELEASE) $(DESTDIR)
627 for i in $(obj-y); do \
628 - $(MAKE) -C $$i install || exit 1; \
629 + $(MAKE) -C $$i install TOP="$(TOP)" || exit 1; \
632 (export KMODPATH=$(KMODPATH); /sbin/depmod -ae $(KERNELRELEASE))
633 @@ -114,12 +114,21 @@ reinstall-tools: uninstall-tools install
634 reinstall-modules: uninstall-modules install-modules
637 - for i in $(obj-y); do \
638 - $(MAKE) -C $$i clean; \
640 - -$(MAKE) -C $(TOOLS) clean
641 - rm -rf .tmp_versions
642 + -find $(obj-y) -name '*~' \
644 + -or -name '*.o.d' \
645 + -or -name '*.o.cmd' \
646 + -or -name '*.o.flags' \
648 + -or -name '*.ko.cmd' \
649 + -or -name '*.mod.c' \
650 + -or -name '.depend' \
651 + -or -name '.version' \
652 + -or -name '.symvers' | \
654 rm -f *.symvers svnversion.h
655 + rm -rf .tmp_versions
656 + make -C tools clean
659 @echo "The following settings will be used for compilation:"
660 @@ -135,18 +144,6 @@ info:
661 @echo "KMODPATH : $(KMODPATH)"
662 @echo "KMODSUF : $(KMODSUF)"
665 - @echo -n "Checking requirements... "
667 - @# check if specified rate control is available
668 - @if [ ! -d $(ATH_RATE) ]; then \
670 - echo "Selected rate control $(ATH_RATE) not available."; \
678 sh scripts/make-release.bash
679 @@ -155,7 +152,7 @@ release:
681 bash scripts/madwifi-unload
683 -configcheck: sanitycheck
685 @echo -n "Checking kernel configuration... "
687 @# check version of kernel
690 @@ -68,6 +68,9 @@ endif
694 +# build net80211 and ath_ahb/ath_pci into a single module
695 +export SINGLE_MODULE=1
697 # KERNELRELEASE is the target kernel's version. It's always taken from
698 # the kernel build tree. Kernel Makefile doesn't always know the exact
699 # kernel version (especially for vendor stock kernels), so we get it
700 @@ -100,6 +103,7 @@ export ARCH
701 include $(TOP)/ath_hal/ah_target.inc
703 COPTS += -DTARGET='"$(TARGET)"'
704 +COPTS += -DCONFIG_ATHEROS_RATE_DEFAULT='"$(firstword $(ATH_RATE))"'
706 # KMODPATH nominates the directory where the modules will be
708 @@ -141,7 +145,7 @@ ATH= $(TOP)/ath
710 # Path to the rate control algorithms.
712 -ATH_RATE= $(TOP)/ath_rate
715 # Path to the userspace utilities.
717 --- a/ath_rate/sample/sample.c
718 +++ b/ath_rate/sample/sample.c
719 @@ -991,6 +991,8 @@ static struct ieee80211_rate_ops ath_rat
720 .dynamic_proc_register = ath_rate_dynamic_proc_register,
723 +#include <net80211/module.h>
725 MODULE_AUTHOR("John Bicket");
726 MODULE_DESCRIPTION("SampleRate bit-rate selection algorithm for Atheros devices");
727 #ifdef MODULE_VERSION
728 @@ -1000,18 +1002,17 @@ MODULE_VERSION(RELEASE_VERSION);
729 MODULE_LICENSE("Dual BSD/GPL");
733 -init_ath_rate_sample(void)
734 +static int __init ath_rate_sample_init(void)
736 printk(KERN_INFO "%s: %s\n", dev_info, version);
737 return ieee80211_rate_register(&ath_rate_ops);
739 -module_init(init_ath_rate_sample);
740 +module_init(ath_rate_sample_init);
743 -exit_ath_rate_sample(void)
744 +ath_rate_sample_exit(void)
746 ieee80211_rate_unregister(&ath_rate_ops);
747 printk(KERN_INFO "%s: unloaded\n", dev_info);
749 -module_exit(exit_ath_rate_sample);
750 +module_exit(ath_rate_sample_exit);
751 --- a/net80211/if_media.h
752 +++ b/net80211/if_media.h
754 #define _NET_IF_MEDIA_H_
756 #include <net80211/ieee80211_linux.h>
760 * Prototypes and definitions for BSD/OS-compatible network interface
762 +++ b/net80211/symbol.h
764 +#ifdef SINGLE_MODULE
765 +#undef EXPORT_SYMBOL
766 +#define EXPORT_SYMBOL(...)
768 --- a/ath_rate/Makefile
769 +++ b/ath_rate/Makefile
771 obj := $(firstword $(obj) $(SUBDIRS) .)
774 -obj-y := amrr/ onoe/ sample/ minstrel/
775 +obj-y := sample/ minstrel/
777 include $(TOP)/Makefile.inc