broadcom-wl: add support for a8xx broadcom devices
[openwrt/staging/wigyori.git] / package / kernel / broadcom-wl / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=broadcom-wl
12 PKG_VERSION:=5.10.56.27.3
13 PKG_RELEASE:=7
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2
16 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
17
18 PKG_MD5SUM.mipsel:=3363e3a6b3d9d73c49dea870c7834eac
19 PKG_MD5SUM.mips:=f8de63debc75333d6b4e28193eb051ff
20 PKG_MD5SUM:=$(PKG_MD5SUM.$(ARCH))
21
22 PKG_USE_MIPS16:=0
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/broadcom-wl/Default
27 SECTION:=kernel
28 CATEGORY:=Kernel modules
29 DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mini
30 SUBMENU:=Proprietary BCM43xx WiFi driver
31 SUBMENUDEP:=@TARGET_brcm47xx||TARGET_brcm63xx
32 endef
33
34 define KernelPackage/brcm-wl/Default
35 $(call Package/broadcom-wl/Default)
36 SECTION:=kernel
37 DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools
38 TITLE:=Kernel driver for BCM43xx chipsets
39 FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko
40 AUTOLOAD:=$(call AutoLoad,30,wl_glue wl)
41 endef
42
43 define KernelPackage/brcm-wl/Default/description
44 This package contains the proprietary wireless driver for the Broadcom
45 BCM43xx chipset.
46 endef
47
48 define KernelPackage/brcm-wl
49 $(call KernelPackage/brcm-wl/Default,)
50 TITLE+= (normal version)
51 endef
52
53 define KernelPackage/brcm-wl/description
54 $(call KernelPackage/brcm-wl/Default/description)
55 endef
56
57 define KernelPackage/brcm-wl-mini
58 $(call KernelPackage/brcm-wl/Default,-mini)
59 TITLE+= (Legacy version)
60 endef
61
62 define KernelPackage/brcm-wl-mini/description
63 $(call KernelPackage/brcm-wl/Default/description)
64 endef
65
66 define Package/wlc
67 $(call Package/broadcom-wl/Default)
68 TITLE:=wl driver setup utility
69 endef
70
71 define Package/wlc/description
72 This package contains an utility for initializing the proprietary Broadcom
73 wl driver.
74 endef
75
76 define Package/wl
77 $(call Package/broadcom-wl/Default)
78 TITLE:=Proprietary Broadcom wl driver config utility
79 endef
80
81 define Package/wl/description
82 This package contains the proprietary utility (wl) for configuring the
83 proprietary Broadcom wl driver.
84 endef
85
86 define Package/nas
87 $(call Package/broadcom-wl/Default)
88 TITLE:=Proprietary Broadcom WPA/WPA2 authenticator
89 endef
90
91 define Package/nas/description
92 This package contains the proprietary WPA/WPA2 authenticator (nas) for the
93 proprietary Broadcom wl driver.
94 endef
95
96 MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
97 CROSS_COMPILE="$(TARGET_CROSS)" \
98 ARCH="$(LINUX_KARCH)" \
99 PATH="$(TARGET_PATH)" \
100 SUBDIRS="$(PKG_BUILD_DIR)/kmod" \
101
102 define Build/Prepare
103 $(call Build/Prepare/Default)
104 $(CP) $(PKG_BUILD_DIR)/driver $(PKG_BUILD_DIR)/driver-mini
105 $(CP) ./src/glue $(PKG_BUILD_DIR)/glue
106 endef
107
108 define Build/Compile
109 # Compile the kernel part
110 $(MAKE_KMOD) \
111 SUBDIRS="$(PKG_BUILD_DIR)/driver" \
112 MODFLAGS="-DMODULE -mlong-calls" \
113 modules
114
115 $(MAKE_KMOD) \
116 SUBDIRS="$(PKG_BUILD_DIR)/driver-mini" \
117 MODFLAGS="-DMODULE -mlong-calls" \
118 BUILD_TYPE="wl_apsta_mini" \
119 modules
120
121 # Compile glue driver
122 $(MAKE_KMOD) -C "$(LINUX_DIR)" \
123 SUBDIRS="$(PKG_BUILD_DIR)/glue" \
124 modules
125
126 # Compile libshared
127 $(MAKE) -C $(PKG_BUILD_DIR)/shared \
128 $(TARGET_CONFIGURE_OPTS) \
129 CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/driver/include" \
130 all
131
132 $(TARGET_CC) -o $(PKG_BUILD_DIR)/wlc \
133 -I$(PKG_BUILD_DIR)/shared -I$(PKG_BUILD_DIR)/driver/include \
134 ./src/wlc.c $(PKG_BUILD_DIR)/shared/libshared.a
135
136 $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas \
137 $(PKG_BUILD_DIR)/nas_exe.o \
138 $(PKG_BUILD_DIR)/shared/libshared.a
139
140 $(TARGET_CC) -o $(PKG_BUILD_DIR)/wl \
141 $(PKG_BUILD_DIR)/wl_exe.o \
142 $(PKG_BUILD_DIR)/shared/libshared.a
143 endef
144
145 define Build/InstallDev
146 $(INSTALL_DIR) $(1)/usr/lib
147 $(CP) $(PKG_BUILD_DIR)/shared/libshared.a $(1)/usr/lib/
148 endef
149
150 define Package/wlc/install
151 $(CP) ./files/* $(1)/
152 $(INSTALL_DIR) $(1)/sbin
153 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc $(1)/sbin/
154 endef
155
156 define Package/wlc/postinst
157 #!/bin/sh
158 [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/wlunbind enable || true
159 endef
160
161 define Package/wl/install
162 $(INSTALL_DIR) $(1)/usr/sbin
163 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
164 endef
165
166 define Package/nas/install
167 $(INSTALL_DIR) $(1)/usr/sbin
168 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
169 ln -sf nas $(1)/usr/sbin/nas4not
170 ln -sf nas $(1)/usr/sbin/nas4wds
171 endef
172
173 $(eval $(call KernelPackage,brcm-wl))
174 $(eval $(call KernelPackage,brcm-wl-mini))
175 $(eval $(call BuildPackage,wlc))
176 $(eval $(call BuildPackage,wl))
177 $(eval $(call BuildPackage,nas))