Makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. #
  2. # Copyright (C) 2007-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=mac80211
  10. PKG_VERSION:=4.19-rc5-1
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19-rc5/
  13. PKG_HASH:=5b61e64ea79d22bbac9e8612d5d5485974f223de00d4ec250b0faf4b7baf9957
  14. PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
  15. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
  16. PKG_BUILD_PARALLEL:=1
  17. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  18. PKG_DRIVERS = \
  19. lib80211 \
  20. mac80211-hwsim \
  21. PKG_CONFIG_DEPENDS:= \
  22. CONFIG_PACKAGE_kmod-mac80211 \
  23. CONFIG_PACKAGE_MAC80211_DEBUGFS \
  24. CONFIG_PACKAGE_MAC80211_MESH \
  25. CONFIG_PACKAGE_MAC80211_TRACING \
  26. CONFIG_PACKAGE_IWLWIFI_DEBUG \
  27. CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
  28. CONFIG_PACKAGE_RTLWIFI_DEBUG \
  29. include $(INCLUDE_DIR)/package.mk
  30. WMENU:=Wireless Drivers
  31. define KernelPackage/mac80211/Default
  32. SUBMENU:=$(WMENU)
  33. URL:=https://wireless.wiki.kernel.org/
  34. MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  35. endef
  36. config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
  37. config-y:= \
  38. WLAN \
  39. NL80211_TESTMODE \
  40. CFG80211_WEXT \
  41. CFG80211_CERTIFICATION_ONUS \
  42. MAC80211_RC_MINSTREL \
  43. MAC80211_RC_MINSTREL_HT \
  44. MAC80211_RC_MINSTREL_VHT \
  45. MAC80211_RC_DEFAULT_MINSTREL \
  46. WLAN_VENDOR_ADMTEK \
  47. WLAN_VENDOR_ATH \
  48. WLAN_VENDOR_ATMEL \
  49. WLAN_VENDOR_BROADCOM \
  50. WLAN_VENDOR_CISCO \
  51. WLAN_VENDOR_INTEL \
  52. WLAN_VENDOR_INTERSIL \
  53. WLAN_VENDOR_MARVELL \
  54. WLAN_VENDOR_MEDIATEK \
  55. WLAN_VENDOR_RALINK \
  56. WLAN_VENDOR_REALTEK \
  57. WLAN_VENDOR_RSI \
  58. WLAN_VENDOR_ST \
  59. WLAN_VENDOR_TI \
  60. WLAN_VENDOR_ZYDAS \
  61. config-$(call config_package,cfg80211) += CFG80211
  62. config-$(call config_package,mac80211) += MAC80211
  63. config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
  64. include ath.mk
  65. PKG_CONFIG_DEPENDS += \
  66. $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS))
  67. define KernelPackage/cfg80211
  68. $(call KernelPackage/mac80211/Default)
  69. TITLE:=cfg80211 - wireless configuration API
  70. DEPENDS+= +iw +wireless-regdb
  71. FILES:= \
  72. $(PKG_BUILD_DIR)/compat/compat.ko \
  73. $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
  74. endef
  75. define KernelPackage/cfg80211/description
  76. cfg80211 is the Linux wireless LAN (802.11) configuration API.
  77. endef
  78. define KernelPackage/mac80211
  79. $(call KernelPackage/mac80211/Default)
  80. TITLE:=Linux 802.11 Wireless Networking Stack
  81. # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
  82. DEPENDS+= +kmod-cfg80211 +hostapd-common
  83. KCONFIG:=\
  84. CONFIG_AVERAGE=y
  85. FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
  86. MENU:=1
  87. endef
  88. define KernelPackage/mac80211/config
  89. if PACKAGE_kmod-mac80211
  90. config PACKAGE_MAC80211_DEBUGFS
  91. bool "Export mac80211 internals in DebugFS"
  92. select KERNEL_DEBUG_FS
  93. default y
  94. help
  95. Select this to see extensive information about
  96. the internal state of mac80211 in debugfs.
  97. config PACKAGE_MAC80211_TRACING
  98. bool "Enable tracing (mac80211 and supported drivers)"
  99. select KERNEL_FTRACE
  100. select KERNEL_ENABLE_DEFAULT_TRACERS
  101. default n
  102. help
  103. Select this to enable tracing of mac80211 and
  104. related wifi drivers (using trace-cmd).
  105. config PACKAGE_MAC80211_MESH
  106. bool "Enable 802.11s mesh support"
  107. default y
  108. endif
  109. endef
  110. define KernelPackage/mac80211/description
  111. Generic IEEE 802.11 Networking Stack (mac80211)
  112. endef
  113. define KernelPackage/adm8211
  114. $(call KernelPackage/mac80211/Default)
  115. TITLE:=ADMTek 8211 support
  116. DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
  117. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/admtek/adm8211.ko
  118. AUTOLOAD:=$(call AutoProbe,adm8211)
  119. endef
  120. define KernelPackage/airo
  121. $(call KernelPackage/mac80211/Default)
  122. TITLE:=Cisco Aironet driver
  123. DEPENDS+=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-cfg80211 @TARGET_x86
  124. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/cisco/airo.ko
  125. AUTOLOAD:=$(call AutoProbe,airo)
  126. endef
  127. define KernelPackage/airo/description
  128. Kernel support for Cisco Aironet cards
  129. endef
  130. define KernelPackage/hermes
  131. $(call KernelPackage/mac80211/Default)
  132. TITLE:=Hermes 802.11b chipset support
  133. DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +kmod-crypto-michael-mic
  134. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco.ko
  135. AUTOLOAD:=$(call AutoProbe,orinoco)
  136. endef
  137. define KernelPackage/hermes/description
  138. Kernel support for Hermes 802.11b chipsets
  139. endef
  140. define KernelPackage/hermes-pci
  141. $(call KernelPackage/mac80211/Default)
  142. TITLE:=Intersil Prism 2.5 PCI support
  143. DEPENDS:=@PCI_SUPPORT +kmod-hermes
  144. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_pci.ko
  145. AUTOLOAD:=$(call AutoProbe,orinoco_pci)
  146. endef
  147. define KernelPackage/hermes-pci/description
  148. Kernel modules for Intersil Prism 2.5 PCI support
  149. endef
  150. define KernelPackage/hermes-plx
  151. $(call KernelPackage/mac80211/Default)
  152. TITLE:=PLX9052 based PCI adaptor
  153. DEPENDS:=@PCI_SUPPORT +kmod-hermes
  154. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_plx.ko
  155. AUTOLOAD:=$(call AutoProbe,orinoco_plx)
  156. endef
  157. define KernelPackage/hermes-plx/description
  158. Kernel modules for Hermes in PLX9052 based PCI adaptors
  159. endef
  160. define KernelPackage/hermes-pcmcia
  161. $(call KernelPackage/mac80211/Default)
  162. TITLE:=Hermes based PCMCIA adaptors
  163. DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes +kmod-pcmcia-core
  164. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_cs.ko
  165. AUTOLOAD:=$(call AutoProbe,orinoco_cs)
  166. endef
  167. define KernelPackage/hermes-pcmcia/description
  168. Kernel modules for Hermes based PCMCIA adaptors
  169. endef
  170. define KernelPackage/lib80211
  171. $(call KernelPackage/mac80211/Default)
  172. TITLE:=802.11 Networking stack
  173. DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash
  174. FILES:= \
  175. $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
  176. $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
  177. $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
  178. $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
  179. AUTOLOAD:=$(call AutoProbe, \
  180. lib80211 \
  181. lib80211_crypt_wep \
  182. lib80211_crypt_ccmp \
  183. lib80211_crypt_tkip \
  184. )
  185. endef
  186. define KernelPackage/lib80211/description
  187. Kernel modules for 802.11 Networking stack
  188. Includes:
  189. - lib80211
  190. - lib80211_crypt_wep
  191. - lib80211_crypt_tkip
  192. - lib80211_crytp_ccmp
  193. endef
  194. define KernelPackage/mac80211-hwsim
  195. $(call KernelPackage/mac80211/Default)
  196. TITLE:=mac80211 HW simulation device
  197. DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
  198. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
  199. AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
  200. endef
  201. define KernelPackage/mt7601u
  202. $(call KernelPackage/mac80211/Default)
  203. TITLE:=MT7601U-based USB dongles Wireless Driver
  204. DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware
  205. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
  206. AUTOLOAD:=$(call AutoProbe,mt7601u)
  207. endef
  208. define KernelPackage/p54/Default
  209. $(call KernelPackage/mac80211/Default)
  210. TITLE:=Prism54 Drivers
  211. endef
  212. define KernelPackage/p54/description
  213. Kernel module for Prism54 chipsets (mac80211)
  214. endef
  215. define KernelPackage/p54-common
  216. $(call KernelPackage/p54/Default)
  217. DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-lib-crc-ccitt
  218. TITLE+= (COMMON)
  219. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko
  220. endef
  221. define KernelPackage/p54-pci
  222. $(call KernelPackage/p54/Default)
  223. TITLE+= (PCI)
  224. DEPENDS+= @PCI_SUPPORT +kmod-p54-common +p54-pci-firmware
  225. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54pci.ko
  226. AUTOLOAD:=$(call AutoProbe,p54pci)
  227. endef
  228. define KernelPackage/p54-usb
  229. $(call KernelPackage/p54/Default)
  230. TITLE+= (USB)
  231. DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common +p54-usb-firmware
  232. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54usb.ko
  233. AUTOLOAD:=$(call AutoProbe,p54usb)
  234. endef
  235. define KernelPackage/p54-spi
  236. $(call KernelPackage/p54/Default)
  237. TITLE+= (SPI)
  238. DEPENDS+= @TARGET_omap24xx +kmod-p54-common +p54-spi-firmware
  239. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54spi.ko
  240. AUTOLOAD:=$(call AutoProbe,p54spi)
  241. endef
  242. define KernelPackage/rsi91x
  243. $(call KernelPackage/mac80211/Default)
  244. TITLE:=Redpine Signals Inc 91x WLAN driver support
  245. DEPENDS+= +kmod-mac80211 +rs9113-firmware
  246. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
  247. endef
  248. define KernelPackage/rsi91x-usb
  249. $(call KernelPackage/mac80211/Default)
  250. TITLE:=Redpine Signals USB bus support
  251. DEPENDS+= +kmod-mac80211 +kmod-usb2 +kmod-rsi91x +rs9113-firmware
  252. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_usb.ko
  253. AUTOLOAD:=$(call AutoProbe,rsi_usb)
  254. endef
  255. define KernelPackage/rsi91x-sdio
  256. $(call KernelPackage/mac80211/Default)
  257. TITLE:=Redpine Signals SDIO bus support
  258. DEPENDS+= +kmod-mac80211 +kmod-mmc +kmod-rsi91x +rs9113-firmware
  259. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_sdio.ko
  260. AUTOLOAD:=$(call AutoProbe,rsi_sdio)
  261. endef
  262. define KernelPackage/wlcore
  263. $(call KernelPackage/mac80211/Default)
  264. TITLE:=TI common driver part
  265. DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT
  266. FILES:= \
  267. $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
  268. $(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
  269. AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
  270. endef
  271. define KernelPackage/wlcore/description
  272. This module contains some common parts needed by TI Wireless drivers.
  273. endef
  274. define KernelPackage/wl12xx
  275. $(call KernelPackage/mac80211/Default)
  276. TITLE:=Driver for TI WL12xx
  277. URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
  278. DEPENDS+= +kmod-wlcore +wl12xx-firmware
  279. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
  280. AUTOLOAD:=$(call AutoProbe,wl12xx)
  281. endef
  282. define KernelPackage/wl12xx/description
  283. Kernel modules for TI WL12xx
  284. endef
  285. define KernelPackage/wl18xx
  286. $(call KernelPackage/mac80211/Default)
  287. TITLE:=Driver for TI WL18xx
  288. URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl18xx
  289. DEPENDS+= +kmod-wlcore +wl18xx-firmware
  290. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
  291. AUTOLOAD:=$(call AutoProbe,wl18xx)
  292. endef
  293. define KernelPackage/wl18xx/description
  294. Kernel modules for TI WL18xx
  295. endef
  296. define KernelPackage/zd1211rw
  297. $(call KernelPackage/mac80211/Default)
  298. TITLE:=Zydas ZD1211 support
  299. DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
  300. FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko
  301. AUTOLOAD:=$(call AutoProbe,zd1211rw)
  302. endef
  303. ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
  304. config-y += \
  305. CFG80211_DEBUGFS \
  306. MAC80211_DEBUGFS
  307. endif
  308. ifdef CONFIG_PACKAGE_MAC80211_TRACING
  309. config-y += \
  310. IWLWIFI_DEVICE_TRACING
  311. endif
  312. config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
  313. config-$(call config_package,airo) += AIRO
  314. config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
  315. config-$(call config_package,mt7601u) += MT7601U
  316. config-y += WL_MEDIATEK
  317. config-$(call config_package,p54-common) += P54_COMMON
  318. config-$(call config_package,p54-pci) += P54_PCI
  319. config-$(call config_package,p54-usb) += P54_USB
  320. config-$(call config_package,p54-spi) += P54_SPI
  321. config-$(call config_package,hermes) += HERMES
  322. config-$(call config_package,hermes-pci) += PCI_HERMES
  323. config-$(call config_package,hermes-plx) += PLX_HERMES
  324. config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
  325. config-y += HERMES_PRISM
  326. config-$(call config_package,adm8211) += ADM8211
  327. config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
  328. config-$(call config_package,wl12xx) += WL12XX
  329. config-$(call config_package,wl18xx) += WL18XX
  330. config-y += WL_TI WILINK_PLATFORM_DATA
  331. config-$(call config_package,zd1211rw) += ZD1211RW
  332. config-$(call config_package,rsi91x) += RSI_91X
  333. config-$(call config_package,rsi91x-usb) += RSI_USB
  334. config-$(call config_package,rsi91x-sdio) += RSI_SDIO
  335. config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
  336. MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
  337. $(KERNEL_MAKE_FLAGS) \
  338. EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
  339. KLIB_BUILD="$(LINUX_DIR)" \
  340. MODPROBE=true \
  341. KLIB=$(TARGET_MODULES_DIR) \
  342. KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
  343. KBUILD_LDFLAGS_MODULE_PREREQ=
  344. define ConfigVars
  345. $(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
  346. ))
  347. endef
  348. define mac80211_config
  349. $(call ConfigVars,m)$(call ConfigVars,y)
  350. endef
  351. $(eval $(call shexport,mac80211_config))
  352. define Build/Prepare
  353. rm -rf $(PKG_BUILD_DIR)
  354. mkdir -p $(PKG_BUILD_DIR)
  355. $(PKG_UNPACK)
  356. $(Build/Patch)
  357. rm -rf \
  358. $(PKG_BUILD_DIR)/include/linux/ssb \
  359. $(PKG_BUILD_DIR)/include/linux/bcma \
  360. $(PKG_BUILD_DIR)/include/net/bluetooth
  361. rm -f \
  362. $(PKG_BUILD_DIR)/include/linux/cordic.h \
  363. $(PKG_BUILD_DIR)/include/linux/crc8.h \
  364. $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
  365. $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
  366. $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
  367. $(PKG_BUILD_DIR)/include/net/ieee80211.h \
  368. $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h
  369. echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
  370. endef
  371. ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
  372. define Build/Compile/kmod
  373. rm -rf $(PKG_BUILD_DIR)/modules
  374. +$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
  375. endef
  376. endif
  377. #do not Build/Configure for EXTERNAL KERNEL
  378. ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
  379. ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
  380. define Build/Configure
  381. cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
  382. cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
  383. cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
  384. endef
  385. endif
  386. endif
  387. define Build/Patch
  388. $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
  389. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
  390. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
  391. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
  392. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
  393. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
  394. $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
  395. $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
  396. endef
  397. define Quilt/Refresh/Package
  398. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
  399. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
  400. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
  401. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
  402. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
  403. $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
  404. endef
  405. define Build/Compile
  406. $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
  407. $(MAKE) $(MAKE_OPTS) allnoconfig
  408. $(call Build/Compile/kmod)
  409. endef
  410. define Build/InstallDev
  411. mkdir -p \
  412. $(1)/usr/include/mac80211 \
  413. $(1)/usr/include/mac80211-backport \
  414. $(1)/usr/include/mac80211/ath \
  415. $(1)/usr/include/net/mac80211
  416. $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
  417. $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
  418. $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
  419. $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
  420. rm -f $(1)/usr/include/mac80211-backport/linux/module.h
  421. endef
  422. define KernelPackage/b43/install
  423. rm -rf $(1)/lib/firmware/
  424. ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
  425. tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
  426. else
  427. tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
  428. endif
  429. $(INSTALL_DIR) $(1)/lib/firmware/
  430. ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
  431. $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
  432. $(INSTALL_DIR) $(1)/lib/firmware/b43-open/
  433. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
  434. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
  435. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
  436. else
  437. b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
  438. endif
  439. ifneq ($(CONFIG_B43_FW_SQUASH),)
  440. b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
  441. endif
  442. endef
  443. define KernelPackage/cfg80211/install
  444. $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
  445. $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
  446. $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
  447. $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
  448. $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
  449. endef
  450. define KernelPackage/zd1211rw/install
  451. $(INSTALL_DIR) $(1)/lib/firmware/zd1211
  452. $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
  453. endef
  454. $(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
  455. $(eval $(call KernelPackage,cfg80211))
  456. $(eval $(call KernelPackage,mac80211))