# Makefile for the prism54 softmac driver # assign those variables so that they are not overwritten when this # makefile is called again from the kernel tree KVER ?= $(shell uname -r) KDIR ?= /lib/modules/$(KVER)/build #CC = gcc # PWD must be overriden to allow make -C to work MKPWD ?= $(shell pwd) KMINOR ?= $(shell echo $(KVER) | cut -d'.' -f2) KMINOR_MIN := 6 KRELEASE ?= $(shell echo $(KVER) | cut -d'.' -f3 | cut -d'-' -f1) KRELEASE_MIN := 13 KOUT ?= $(KDIR) #autotest for madwifi stack presence. Can be overridden on the command line MADWIFI ?= $(shell test -d $(MKPWD)/../madwifi-bsd && echo 1 || echo 0) #for now bail out if compiling for 2.4 ifneq ($(KMINOR),$(KMINOR_MIN)) $(error Please use kernel version >= 2.$(KMINOR_MIN).$(KRELEASE_MIN)) endif ifneq ($(shell test $(KRELEASE) -ge $(KRELEASE_MIN) && echo OK),OK) $(warning Please use kernel version >= 2.$(KMINOR_MIN).$(KRELEASE_MIN)) endif ifneq ($(MADWIFI),0) # Default path for finding madwifi MADWIFI_PATH ?= $(MKPWD)/../madwifi-bsd # Add madwifi to the include path # needed for net80211 MADWIFI_INCS := -include $(MADWIFI_PATH)/include/compat.h MADWIFI_INCS += -I$(MADWIFI_PATH)/include/ MADWIFI_INCS += -I$(MADWIFI_PATH) MADWIFI_COPTS := -D__linux__ -DMADWIFI EXTRA_CFLAGS += $(MADWIFI_INCS) $(MADWIFI_COPTS) else #the default case is now to build with ieee80211_softmac SOFTMAC_PATH ?= $(MKPWD)/../softmac EXTRA_CFLAGS += -isystem $(SOFTMAC_PATH)/include endif EXTRA_CFLAGS += -I$(MKPWD) -Wall -Werror .PHONY: modules clean load unload debian modules: ifeq ($(KDIR),$(KOUT)) $(MAKE) -C $(KDIR) SUBDIRS=$(MKPWD) MODVERSION=$(MKPWD)/symbols MKPWD=$(MKPWD) $@ else mkdir -p $(MKPWD)/tmp cp $(KOUT)/.config $(MKPWD)/tmp/ $(MAKE) -C $(KDIR) SUBDIRS=$(MKPWD) O=$(MKPWD)/tmp/ $@ endif clean: rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_* symbols/* obj-m += islsm.o islsm-objs := islsm_netdev.o islsm_ioctl.o islsm_output.o islsm_bra.o \ islsm_input.o islsm_alloc_skb.o islsm_log.o islsm_pda.o ifeq ($(MAEMO),1) #MAEMO builds for now don't have uart and device support obj-m += islsm_spi.o islsm_spi-objs := islspi_init.o islspi_io.o else obj-m += islsm_device.o islsm_pci.o islsm_usb.o EXTRA_CFLAGS += -DPCIUART islsm_device-objs := islsm_sysfs.o islsm_uart.o islsm_usb-objs := islusb_init.o islusb_transport.o islusb_3887.o islusb_net2280.o islsm_pci-objs := islpci_hotplug.o islpci_dev.o isl_38xx.o endif #no verbosity VERBOSITY ?= 0 #functions #VERBOSITY ?= 3 #full verbosity #VERBOSITY ?= 65535 #in / out raw packets #VERBOSITY ?= 96 #detailed out packets, summary for input packets #VERBOSITY ?= 1344 load: modules @(modprobe firmware_class || true) && \ (modprobe relayfs || true) && \ (modprobe crc32 || true) && \ (modprobe crc-ccitt || true) && \ insmod islsm.ko && \ echo "$(VERBOSITY)" > /sys/module/islsm/parameters/debug && \ insmod islsm_device.ko && \ insmod islsm_pci.ko && \ insmod islsm_usb.ko unload: @rmmod islsm_pci; \ rmmod islsm_usb; \ rmmod islsm_device; \ rmmod islsm || true #track the sizes size: modules uname -r > sizes.txt && \ ls -hs --block-size=1 *.ko >> sizes.txt && \ tla commit #debian package build for Maemo debian: dpkg-buildpackage -rfakeroot -uc -us -sa -D