123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- #
- # 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:=6.1.24
- PKG_RELEASE:=4
- # PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
- PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
- PKG_HASH:=5d39aca7e34c33cb9b3e366117b2e86841b7bdd37933679d6b1e61be6b150648
- 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 = \
- mac80211-hwsim
- PKG_CONFIG_DEPENDS:= \
- CONFIG_PACKAGE_kmod-mac80211 \
- CONFIG_PACKAGE_CFG80211_TESTMODE \
- 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 \
- CFG80211_CERTIFICATION_ONUS \
- MAC80211_RC_MINSTREL \
- MAC80211_RC_MINSTREL_HT \
- MAC80211_RC_MINSTREL_VHT \
- MAC80211_RC_DEFAULT_MINSTREL \
- WLAN_VENDOR_ATH
- config-$(call config_package,cfg80211) += CFG80211
- config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE
- 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 +iwinfo +wireless-regdb +USE_RFKILL:kmod-rfkill
- 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/cfg80211/config
- if PACKAGE_kmod-cfg80211
- config PACKAGE_CFG80211_TESTMODE
- bool "Enable testmode command support"
- default n
- help
- This is typically used for tests and calibration during
- manufacturing, or vendor specific debugging features
- endif
- 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 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +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/mac80211-hwsim
- $(call KernelPackage/mac80211/Default)
- TITLE:=mac80211 HW simulation device
- DEPENDS+= +kmod-mac80211 +@DRIVER_11AX_SUPPORT +@DRIVER_11AC_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,mac80211-hwsim) += MAC80211_HWSIM
- config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
- C_DEFINES=
- ifeq ($(BUILD_VARIANT),smallbuffers)
- C_DEFINES+= -DCONFIG_ATH10K_SMALLBUFFERS
- endif
- MAKE_OPTS:= \
- $(subst -C $(LINUX_DIR),-C "$(PKG_BUILD_DIR)",$(KERNEL_MAKEOPTS)) \
- EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES)" \
- 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/mhi.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),)
- 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
- 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)/ath5k,ath5k/)
- $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/)
- $(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)/ath5k,ath5k/)
- $(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/)
- 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))
|