endif
include $(KERNELCONF)
-# Determine architecture of the kernel.
-include $(TOP)/scripts/get_arch.mk
-export ARCH
-
-# Determine TARGET
-include $(TOP)/ath_hal/ah_target.inc
-export TARGET
-COPTS += -DTARGET='"$(TARGET)"'
-
# KMODPATH nominates the directory where the modules will be
# 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
#
# Path to the HAL source code.
#
ifeq ($(HAL),)
-HAL= $(TOP)/hal
+HAL= $(TOP)/ath_hal
endif
#
-# Path to HAL/OS interface code
-#
-ATH_HAL= $(TOP)/ath_hal
-#
# Path to the 802.11 include files.
#
WLAN= $(TOP)/net80211
#
# Path to the userspace utilities.
#
-TOOLS= $(TOP)/tools
+TOOLS= $(TOP)/tools
-WARNINGS = -Werror
+WARNINGS = -Wall
COPTS+= $(WARNINGS)
INCS= -include $(TOP)/include/compat.h -I$(TOP)/include
-# TARGET defines the target platform architecture. It must match one of
-# the target platforms supported by the HAL. The default target is the
-# host machine architecture. You can override TARGET on the make command
-# line or in the environment. See hal/linux/*.inc for the list of
-# supported targets.
-ifeq (,$(wildcard $(HAL)/public/$(TARGET).inc))
-TARGETS=$(basename $(notdir $(wildcard $(HAL)/public/*.inc)))
-$(error TARGET $(TARGET) is invalid, valid targets are: $(TARGETS))
+ifndef ATH_DEBUG_SPINLOCKS
+export ATH_DEBUG_SPINLOCKS=0
+endif
+
+ifndef IEEE80211_DEBUG_REFCNT
+export IEEE80211_DEBUG_REFCNT=0
+endif
+
+ifndef HAL_DEBUG
+export HAL_DEBUG=0
+endif
+
+ifndef ATH_DEBUG
+export ATH_DEBUG=1
+endif
+
+ifeq ($(strip $(ATH_DEBUG_SPINLOCKS)),1)
+COPTS+= -DATH_DEBUG_SPINLOCKS=1
+endif
+
+ifeq ($(strip $(IEEE80211_DEBUG_REFCNT)),1)
+COPTS+= -DIEEE80211_DEBUG_REFCNT=1
endif
# HAL_DEBUG enables HAL debugging code
# At the moment this consists of wrappers around HAL functions so that
# stack traces are more decipherable.
-
-ifdef HAL_DEBUG
-COPTS+= -fno-inline
+ifeq ($(strip $(HAL_DEBUG)),1)
+COPTS+= -fno-inline -DAH_DEBUG=1
endif
-# Don't let HAL mess with the toolchain - save toolchain variables
-save_CC := $(CC)
-save_LD := $(LD)
-save_STRIP := $(STRIP)
-save_OBJCOPY := $(OBJCOPY)
-save_NM := $(NM)
+include $(TOP)/BuildCaps.inc
-include $(HAL)/public/$(TARGET).inc
+ifeq ($(strip $(ATH_DEBUG)),1)
+EXTRA_CFLAGS += -DAR_DEBUG -DIEEE80211_DEBUG
+endif
-# Restore toolchain variables
-CC := $(save_CC)
-LD := $(save_LD)
-STRIP := $(save_STRIP)
-OBJCOPY := $(save_OBJCOPY)
-NM := $(save_NM)
+ifeq ($(strip $(ATH_DEBUG_SPINLOCKS)),1)
+EXTRA_CFLAGS += -DATH_DEBUG_SPINLOCKS
+endif
-include $(TOP)/BuildCaps.inc
+ifeq ($(strip $(IEEE80211_DEBUG_REFCNT)),1)
+EXTRA_CFLAGS += -DIEEE80211_DEBUG_REFCNT
+endif
# Ensure correct endianess
LDFLAGS += $(LDOPTS)
# Filter out compiler options that are not supported by all compilers
# and that are not needed to ensure compatible architecture and calling
# conventions.
-COPTS := $(filter-out -mshort-load-bytes,$(COPTS))
+COPTS := $(filter-out -mshort-load-bytes -mapcs-32,$(COPTS))
# The following variables will affect developers only, and are used in the