123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- #
- # Copyright (C) 2007-2015 OpenWrt.org
- #
- # This is free software, licensed under the GNU General Public License v2.
- # See /LICENSE for more information.
- #
- include $(TOPDIR)/rules.mk
- include $(INCLUDE_DIR)/kernel.mk
- PKG_NAME:=mac80211
- PKG_VERSION:=4.19.66-1
- PKG_RELEASE:=1
- PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.66/
- PKG_HASH:=1f3c6a58cb45b247f6e473d1b52236bfbb41cb3e11e38a74526727e911b51a02
- PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
- PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
- PKG_BUILD_PARALLEL:=1
- PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
- PKG_DRIVERS = \
- adm8211 \
- lib80211 \
- mac80211-hwsim
-
- PKG_CONFIG_DEPENDS:= \
- CONFIG_PACKAGE_kmod-mac80211 \
- CONFIG_PACKAGE_MAC80211_DEBUGFS \
- CONFIG_PACKAGE_MAC80211_MESH \
- CONFIG_PACKAGE_MAC80211_TRACING \
- CONFIG_PACKAGE_IWLWIFI_DEBUG \
- CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
- CONFIG_PACKAGE_RTLWIFI_DEBUG \
- include $(INCLUDE_DIR)/package.mk
- WMENU:=Wireless Drivers
- define KernelPackage/mac80211/Default
- SUBMENU:=$(WMENU)
- URL:=https://wireless.wiki.kernel.org/
- MAINTAINER:=Felix Fietkau <nbd@nbd.name>
- endef
- config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
- config-y:= \
- WLAN \
- NL80211_TESTMODE \
- CFG80211_WEXT \
- CFG80211_CERTIFICATION_ONUS \
- MAC80211_RC_MINSTREL \
- MAC80211_RC_MINSTREL_HT \
- MAC80211_RC_MINSTREL_VHT \
- MAC80211_RC_DEFAULT_MINSTREL \
- WLAN_VENDOR_ADMTEK \
- WLAN_VENDOR_ATH \
- WLAN_VENDOR_ATMEL \
- WLAN_VENDOR_BROADCOM \
- WLAN_VENDOR_CISCO \
- WLAN_VENDOR_INTEL \
- WLAN_VENDOR_INTERSIL \
- WLAN_VENDOR_MARVELL \
- WLAN_VENDOR_MEDIATEK \
- WLAN_VENDOR_RALINK \
- WLAN_VENDOR_REALTEK \
- WLAN_VENDOR_RSI \
- WLAN_VENDOR_ST \
- WLAN_VENDOR_TI \
- WLAN_VENDOR_ZYDAS \
- config-$(call config_package,cfg80211) += CFG80211
- config-$(call config_package,mac80211) += MAC80211
- config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
- include ath.mk
- PKG_CONFIG_DEPENDS += \
- $(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS))
- define KernelPackage/cfg80211
- $(call KernelPackage/mac80211/Default)
- TITLE:=cfg80211 - wireless configuration API
- DEPENDS+= +iw +wireless-regdb
- ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
- FILES:= \
- $(PKG_BUILD_DIR)/compat/compat.ko \
- $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
- endef
- define KernelPackage/cfg80211/description
- cfg80211 is the Linux wireless LAN (802.11) configuration API.
- endef
- define KernelPackage/mac80211
- $(call KernelPackage/mac80211/Default)
- TITLE:=Linux 802.11 Wireless Networking Stack
- # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
- DEPENDS+= +kmod-cfg80211 +hostapd-common
- KCONFIG:=\
- CONFIG_AVERAGE=y
- FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
- ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
- MENU:=1
- endef
- define KernelPackage/mac80211/config
- if PACKAGE_kmod-mac80211
- config PACKAGE_MAC80211_DEBUGFS
- bool "Export mac80211 internals in DebugFS"
- select KERNEL_DEBUG_FS
- default y
- help
- Select this to see extensive information about
- the internal state of mac80211 in debugfs.
- config PACKAGE_MAC80211_TRACING
- bool "Enable tracing (mac80211 and supported drivers)"
- select KERNEL_FTRACE
- select KERNEL_ENABLE_DEFAULT_TRACERS
- default n
- help
- Select this to enable tracing of mac80211 and
- related wifi drivers (using trace-cmd).
- config PACKAGE_MAC80211_MESH
- bool "Enable 802.11s mesh support"
- default y
- endif
- endef
- define KernelPackage/mac80211/description
- Generic IEEE 802.11 Networking Stack (mac80211)
- endef
- define KernelPackage/adm8211
- $(call KernelPackage/mac80211/Default)
- TITLE:=ADMTek 8211 support
- DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/admtek/adm8211.ko
- AUTOLOAD:=$(call AutoProbe,adm8211)
- endef
- define KernelPackage/lib80211
- $(call KernelPackage/mac80211/Default)
- TITLE:=802.11 Networking stack
- DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash
- FILES:= \
- $(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
- $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
- $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
- $(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
- AUTOLOAD:=$(call AutoProbe, \
- lib80211 \
- lib80211_crypt_wep \
- lib80211_crypt_ccmp \
- lib80211_crypt_tkip \
- )
- endef
- define KernelPackage/lib80211/description
- Kernel modules for 802.11 Networking stack
- Includes:
- - lib80211
- - lib80211_crypt_wep
- - lib80211_crypt_tkip
- - lib80211_crytp_ccmp
- endef
- define KernelPackage/mac80211-hwsim
- $(call KernelPackage/mac80211/Default)
- TITLE:=mac80211 HW simulation device
- DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
- FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
- AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
- endef
- ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
- config-y += \
- CFG80211_DEBUGFS \
- MAC80211_DEBUGFS
- endif
- ifdef CONFIG_PACKAGE_MAC80211_TRACING
- config-y += \
- IWLWIFI_DEVICE_TRACING
- endif
- config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
- config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
- config-$(call config_package,adm8211) += ADM8211
- config-$(call config_package,rsi91x) += RSI_91X
- config-$(call config_package,rsi91x-usb) += RSI_USB
- config-$(call config_package,rsi91x-sdio) += RSI_SDIO
- config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
- MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
- $(KERNEL_MAKE_FLAGS) \
- EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
- KLIB_BUILD="$(LINUX_DIR)" \
- MODPROBE=true \
- KLIB=$(TARGET_MODULES_DIR) \
- KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
- KBUILD_LDFLAGS_MODULE_PREREQ=
- define ConfigVars
- $(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
- ))
- endef
- define mac80211_config
- $(call ConfigVars,m)$(call ConfigVars,y)
- endef
- $(eval $(call shexport,mac80211_config))
- define Build/Prepare
- rm -rf $(PKG_BUILD_DIR)
- mkdir -p $(PKG_BUILD_DIR)
- $(PKG_UNPACK)
- $(Build/Patch)
- rm -rf \
- $(PKG_BUILD_DIR)/include/linux/ssb \
- $(PKG_BUILD_DIR)/include/linux/bcma \
- $(PKG_BUILD_DIR)/include/net/bluetooth
- rm -f \
- $(PKG_BUILD_DIR)/include/linux/cordic.h \
- $(PKG_BUILD_DIR)/include/linux/crc8.h \
- $(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
- $(PKG_BUILD_DIR)/include/linux/wl12xx.h \
- $(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
- $(PKG_BUILD_DIR)/include/net/ieee80211.h \
- $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h
- echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
- endef
- ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
- define Build/Compile/kmod
- rm -rf $(PKG_BUILD_DIR)/modules
- +$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
- endef
- endif
- #do not Build/Configure for EXTERNAL KERNEL
- ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
- ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
- define Build/Configure
- cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
- cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
- cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
- endef
- endif
- endif
- define Build/Patch
- $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
- $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
- endef
- define Quilt/Refresh/Package
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
- endef
- define Build/Compile
- $(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
- $(MAKE) $(MAKE_OPTS) allnoconfig
- $(call Build/Compile/kmod)
- endef
- define Build/InstallDev
- mkdir -p \
- $(1)/usr/include/mac80211 \
- $(1)/usr/include/mac80211-backport \
- $(1)/usr/include/mac80211/ath \
- $(1)/usr/include/net/mac80211
- $(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
- $(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
- $(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
- $(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
- rm -f $(1)/usr/include/mac80211-backport/linux/module.h
- endef
- define KernelPackage/cfg80211/install
- $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
- $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
- $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
- $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
- $(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
- endef
- $(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
- $(eval $(call KernelPackage,cfg80211))
- $(eval $(call KernelPackage,mac80211))
|