mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-17 09:21:35 +00:00
273 lines
7.8 KiB
Makefile
273 lines
7.8 KiB
Makefile
include $(TOPDIR)/rules.mk
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
PKG_NAME:=mac80211
|
|
PKG_VERSION:=20200628-4.4.60-9a94b73e75
|
|
PKG_RELEASE:=1
|
|
PKG_SOURCE_URL:=https://mirror2.openwrt.org/sources/
|
|
PKG_HASH:=ef279f4301022b4724433af639607687bed9805bfdf0acbe12ee1b8737b8fb1d
|
|
PKG_SOURCE:=backports-$(PKG_VERSION).tar.bz2
|
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
|
|
|
PKG_DRIVERS = \
|
|
lib80211 \
|
|
mac80211-hwsim
|
|
|
|
PKG_CONFIG_DEPENDS:= \
|
|
CONFIG_PACKAGE_kmod-mac80211 \
|
|
CONFIG_PACKAGE_MAC80211_DEBUGFS \
|
|
CONFIG_PACKAGE_MAC80211_MESH \
|
|
CONFIG_PACKAGE_MAC80211_TRACING
|
|
|
|
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 \
|
|
MAC80211_LEDS \
|
|
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/lib80211
|
|
$(call KernelPackage/mac80211/Default)
|
|
TITLE:=802.11 Networking stack
|
|
DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash +kmod-crypto-ccm
|
|
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
|
|
MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
|
|
CROSS_COMPILE="$(KERNEL_CROSS)" \
|
|
ARCH="$(LINUX_KARCH)" \
|
|
EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) -I$(STAGING_DIR)/usr/include/qca-nss-drv" \
|
|
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
|
|
|
|
define Build/Patch
|
|
$(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
|
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/qca,qca/)
|
|
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/pending,pending/)
|
|
$(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
|
|
endef
|
|
|
|
define Quilt/Refresh/Package
|
|
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/qca,qca/)
|
|
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/pending,pending/)
|
|
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
|
|
|
|
define Build/Compile
|
|
$(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
|
|
$(MAKE) $(MAKE_OPTS) olddefconfig
|
|
$(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_DATA) ./files/lib/netifd/mac80211.sh $(1)/lib/netifd
|
|
$(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
|
|
$(INSTALL_BIN) ./files/lib/performance.sh $(1)/lib
|
|
$(INSTALL_BIN) ./files/lib/smp_affinity_settings.sh $(1)/lib
|
|
endef
|
|
|
|
$(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
|
|
$(eval $(call KernelPackage,cfg80211))
|
|
$(eval $(call KernelPackage,mac80211))
|