Commit | Line | Data |
---|---|---|
8fc8598e JC |
1 | NIC_SELECT = RTL8192U |
2 | ||
3 | KVER := $(shell uname -r) | |
4 | MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/$(NIC_SELECT) | |
5 | ||
6 | CC = gcc | |
7 | ifneq ($(shell uname -r|cut -d. -f1,2), 2.4) | |
8138d416 TD |
8 | ccflags-y := -I$(TOPDIR)/drivers/net/wireless |
9 | ccflags-y += -O2 | |
10 | ccflags-y += -DJACKSON_NEW_8187 -DJACKSON_NEW_RX | |
8fc8598e JC |
11 | |
12 | #it will fail to compile in suse linux enterprise 10 sp2. This flag is to solve this problem. | |
13 | ifeq ($(shell uname -r | cut -d. -f1,2,3,4), 2.6.16.60-0) | |
8138d416 | 14 | ccflags-y := -DOPENSUSE_SLED |
8fc8598e JC |
15 | endif |
16 | ||
17 | ifeq ($(NIC_SELECT),RTL8192U) | |
8138d416 TD |
18 | #ccflags-y := -DUSB_TX_DRIVER_AGGREGATION_ENABLE |
19 | #ccflags-y := -DUSB_RX_AGGREGATION_SUPPORT | |
8fc8598e | 20 | endif |
8138d416 | 21 | #ccflags-y := -DJOHN_NOCPY |
8fc8598e | 22 | #flags to enable or disble 80211D feature |
8138d416 | 23 | ccflags-y += -DENABLE_DOT11D |
8fc8598e JC |
24 | ieee80211-rsl-objs := ieee80211_rx.o \ |
25 | ieee80211_softmac.o \ | |
26 | ieee80211_tx.o \ | |
27 | ieee80211_wx.o \ | |
28 | ieee80211_module.o \ | |
29 | ieee80211_softmac_wx.o\ | |
30 | rtl819x_HTProc.o\ | |
31 | rtl819x_TSProc.o\ | |
32 | rtl819x_BAProc.o\ | |
33 | dot11d.o | |
34 | ||
35 | ieee80211_crypt-rsl-objs := ieee80211_crypt.o | |
36 | ieee80211_crypt_tkip-rsl-objs := ieee80211_crypt_tkip.o | |
37 | ieee80211_crypt_ccmp-rsl-objs := ieee80211_crypt_ccmp.o | |
38 | ieee80211_crypt_wep-rsl-objs := ieee80211_crypt_wep.o | |
39 | ||
40 | obj-m +=ieee80211-rsl.o | |
41 | obj-m +=ieee80211_crypt-rsl.o | |
42 | obj-m +=ieee80211_crypt_wep-rsl.o | |
43 | obj-m +=ieee80211_crypt_tkip-rsl.o | |
44 | obj-m +=ieee80211_crypt_ccmp-rsl.o | |
45 | ||
46 | KSRC := /lib/modules/$(KVER)/build | |
47 | INSTALL_PREFIX := | |
48 | ||
49 | all: modules | |
50 | ||
51 | modules: | |
52 | $(MAKE) -C $(KSRC) M=$(PWD) CC=$(CC) modules | |
53 | ||
54 | install: modules | |
55 | rm -fr $(MODDESTDIR) | |
56 | mkdir -p $(MODDESTDIR) | |
57 | @install -p -m 644 ieee80211_crypt-rsl.ko $(MODDESTDIR) | |
58 | @install -p -m 644 ieee80211_crypt_wep-rsl.ko $(MODDESTDIR) | |
59 | @install -p -m 644 ieee80211_crypt_tkip-rsl.ko $(MODDESTDIR) | |
60 | @install -p -m 644 ieee80211_crypt_ccmp-rsl.ko $(MODDESTDIR) | |
61 | @install -p -m 644 ieee80211-rsl.ko $(MODDESTDIR) | |
62 | depmod -a | |
63 | uninstall: | |
64 | rm -fr $(MODDESTDIR) | |
65 | depmod -a | |
66 | ||
67 | else | |
68 | LD := ld | |
69 | KSRC := /lib/modules/$(KVER)/build | |
70 | CONFIG_FILE := $(KSRC)/include/linux/autoconf.h | |
71 | ||
72 | CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall | |
73 | CFLAGS += -I$(KSRC)/include -I. | |
74 | #Kernel 2.4.31 | |
75 | CFLAGS += -DMODVERSIONS -DEXPORT_SYMTAB -include $(KSRC)/include/linux/modversions.h | |
76 | #Kernel 2.4.20 | |
77 | #CFLAGS += -D__NO_VERSION__ -DEXPORT_SYMTAB | |
78 | #CFLAGS += -DENABLE_DOT11D | |
79 | SMP := $(shell $(CC) $(MODCFLAGS) -E -dM $(CONFIG_FILE) | \ | |
80 | grep CONFIG_SMP | awk '{print $$3}') | |
81 | ifneq ($(SMP),1) | |
82 | SMP := 0 | |
83 | endif | |
84 | ifeq ($(SMP),1) | |
85 | CFLAGS += -D__SMP__ | |
86 | endif | |
87 | ||
88 | #CFLAGS += -DJOHN_NOCPY | |
89 | ||
90 | OBJS := ${patsubst %.c, %.o, ${wildcard *.c}} | |
91 | all:${OBJS} ieee80211_crypt-rsl.o michael_mic-rsl.o aes-rsl.o ieee80211_crypt_wep-rsl.o ieee80211_crypt_tkip-rsl.o ieee80211_crypt_ccmp-rsl.o crypto-rsl.o ieee80211-rsl.o | |
92 | ||
93 | ieee80211_crypt-rsl.o: ieee80211_crypt.o | |
94 | mv $^ $@ | |
95 | ||
96 | michael_mic-rsl.o: michael_mic.o | |
97 | mv $^ $@ | |
98 | ||
99 | aes-rsl.o: aes.o | |
100 | mv $^ $@ | |
101 | ||
102 | ieee80211_crypt_wep-rsl.o: ieee80211_crypt_wep.o | |
103 | mv $^ $@ | |
104 | ||
105 | ieee80211_crypt_tkip-rsl.o: ieee80211_crypt_tkip.o | |
106 | mv $^ $@ | |
107 | ||
108 | ieee80211_crypt_ccmp-rsl.o: ieee80211_crypt_ccmp.o | |
109 | mv $^ $@ | |
110 | ||
111 | crypto-rsl.o: arc4.o api.o autoload.o cipher.o compress.o digest.o scatterwalk.o proc.o | |
112 | $(LD) -r $^ -o $@ | |
113 | ||
114 | ieee80211-rsl.o: ieee80211_rx.o ieee80211_tx.o ieee80211_wx.o ieee80211_module.o ieee80211_softmac_wx.o ieee80211_softmac.o rtl819x_HTProc.o rtl819x_TSProc.o rtl819x_BAProc.o dot11d.o | |
115 | $(LD) -r $^ -o $@ | |
116 | install: | |
117 | rm -fr $(MODDESTDIR) | |
118 | mkdir -p $(MODDESTDIR) | |
119 | @install -p -m 644 ieee80211_crypt-rsl.o $(MODDESTDIR) | |
120 | @install -p -m 644 crypto-rsl.o $(MODDESTDIR) | |
121 | @install -p -m 644 michael_mic-rsl.o $(MODDESTDIR) | |
122 | @install -p -m 644 aes-rsl.o $(MODDESTDIR) | |
123 | @install -p -m 644 ieee80211_crypt_wep-rsl.o $(MODDESTDIR) | |
124 | @install -p -m 644 ieee80211_crypt_tkip-rsl.o $(MODDESTDIR) | |
125 | @install -p -m 644 ieee80211_crypt_ccmp-rsl.o $(MODDESTDIR) | |
126 | @install -p -m 644 ieee80211-rsl.o $(MODDESTDIR) | |
127 | /sbin/depmod -a ${shell uname -r} | |
128 | ||
129 | uninstall: | |
130 | rm -fr $(MODDESTDIR) | |
131 | /sbin/depmod -a ${shell uname -r} | |
132 | ||
133 | endif | |
134 | ||
135 | .PHONY: clean | |
136 | clean: | |
137 | rm -fr *.mod.c *.mod *.o .*.cmd *.mod.* *.ko *.o *~ | |
138 | rm -rf .tmp_versions | |
139 | rm -rf Module.symvers |