#
# Makefile for the 802.11 NET80211 module.
#
KERNEL_SOURCE ?= /lib/modules/$(shell uname -r)/build

BASEDIR=$(src)/..

EXTRA_CFLAGS+=	-include $(BASEDIR)/include/compat.h -I$(BASEDIR) \
		-I$(BASEDIR)/include $(COPTS)

#
# There are two authenticator mechanisms: an in-kernel implementation
# (wlan_auth+wlan_radius) and an external implementation (wlan_xauth) that
# requires a user process to manage the authentication process.  By default
# the external authenticator is used.  ieee80211_proto.c has a table of module
# names that defines the default module to auto-load for each authentication
# scheme; to get the in-kernel authenticator by default modify it to load
# wlan_auth instead of wlan_xauth or manually load wlan_auth prior to use.
#
MOD_AUTH	:= wlan_xauth.o

ifeq ($(CONFIG_USERMODE),)
ifneq ($(CONFIG_NET_RADIO),)
obj-m += wlan.o wlan_wep.o wlan_tkip.o wlan_ccmp.o \
		   $(MOD_AUTH) wlan_acl.o

wlan-objs	:= if_media.o rc4.o \
		   ieee80211.o ieee80211_crypto.o ieee80211_input.o \
		   ieee80211_node.o ieee80211_output.o ieee80211_proto.o \
		   ieee80211_wireless.o ieee80211_linux.o \
		   ieee80211_crypto_none.o
wlan_wep-objs	:= ieee80211_crypto_wep.o
wlan_tkip-objs	:= ieee80211_crypto_tkip.o
wlan_ccmp-objs	:= ieee80211_crypto_ccmp.o
wlan_xauth-objs	:= ieee80211_xauth.o
wlan_auth-objs	:= ieee80211_dot1x.o
wlan_radius-objs:= ieee80211_radius.o
wlan_acl-objs	:= ieee80211_acl.o
endif
endif

modules modules_install clean:
	$(MAKE) -C $(KERNEL_SOURCE) SUBDIRS=$(shell pwd) $@

install: modules_install

