2 # Copyright (C) 2007-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
15 # PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
16 PKG_SOURCE_URL
:=http
://mirror2.openwrt.org
/sources
/
17 PKG_HASH
:=7f3d96c2573183cd79d6a3ebe5e1b7b73c19d1326d443c85b69c4181f14e6e2b
19 PKG_SOURCE
:=backports-
$(PKG_VERSION
).
tar.xz
20 PKG_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/backports-
$(PKG_VERSION
)
23 PKG_MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
28 rsi91x rsi91x-usb rsi91x-sdio\
31 PKG_CONFIG_DEPENDS
:= \
32 CONFIG_PACKAGE_kmod-mac80211 \
33 CONFIG_PACKAGE_CFG80211_TESTMODE \
34 CONFIG_PACKAGE_MAC80211_DEBUGFS \
35 CONFIG_PACKAGE_MAC80211_MESH \
36 CONFIG_PACKAGE_MAC80211_TRACING \
37 CONFIG_PACKAGE_IWLWIFI_DEBUG \
38 CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
39 CONFIG_PACKAGE_RTLWIFI_DEBUG \
41 include $(INCLUDE_DIR
)/package.mk
43 WMENU
:=Wireless Drivers
45 define KernelPackage
/mac80211
/Default
47 URL
:=https
://wireless.wiki.kernel.org
/
48 MAINTAINER
:=Felix Fietkau
<nbd@nbd.name
>
51 config_package
=$(if
$(CONFIG_PACKAGE_kmod-
$(1)),m
)
55 CFG80211_CERTIFICATION_ONUS \
56 MAC80211_RC_MINSTREL \
57 MAC80211_RC_MINSTREL_HT \
58 MAC80211_RC_MINSTREL_VHT \
59 MAC80211_RC_DEFAULT_MINSTREL \
63 WLAN_VENDOR_BROADCOM \
66 WLAN_VENDOR_INTERSIL \
68 WLAN_VENDOR_MEDIATEK \
76 config-
$(call config_package
,cfg80211
) += CFG80211
77 config-
$(CONFIG_PACKAGE_CFG80211_TESTMODE
) += NL80211_TESTMODE
79 config-
$(call config_package
,mac80211
) += MAC80211
80 config-
$(CONFIG_PACKAGE_MAC80211_MESH
) += MAC80211_MESH
89 PKG_CONFIG_DEPENDS
+= \
90 $(patsubst %,CONFIG_PACKAGE_kmod-
%,$(PKG_DRIVERS
))
92 define KernelPackage
/cfg80211
93 $(call KernelPackage
/mac80211
/Default
)
94 TITLE
:=cfg80211
- wireless configuration API
95 DEPENDS
+= +iw
+iwinfo
+wireless-regdb
+USE_RFKILL
:kmod-rfkill
96 ABI_VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
98 $(PKG_BUILD_DIR
)/compat
/compat.ko \
99 $(PKG_BUILD_DIR
)/net
/wireless
/cfg80211.ko
102 define KernelPackage
/cfg80211
/description
103 cfg80211 is the Linux wireless LAN
(802.11) configuration API.
106 define KernelPackage
/cfg80211
/config
107 if PACKAGE_kmod-cfg80211
109 config PACKAGE_CFG80211_TESTMODE
110 bool
"Enable testmode command support"
113 This is typically used for tests and calibration during
114 manufacturing
, or vendor specific debugging features
120 define KernelPackage
/mac80211
121 $(call KernelPackage
/mac80211
/Default
)
122 TITLE
:=Linux
802.11 Wireless Networking Stack
123 # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
124 DEPENDS
+= +kmod-cfg80211
+kmod-crypto-cmac
+kmod-crypto-ccm
+kmod-crypto-gcm
+hostapd-common
127 FILES
:= $(PKG_BUILD_DIR
)/net
/mac80211
/mac80211.ko
128 ABI_VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
132 define KernelPackage
/mac80211
/config
133 if PACKAGE_kmod-mac80211
135 config PACKAGE_MAC80211_DEBUGFS
136 bool
"Export mac80211 internals in DebugFS"
137 select KERNEL_DEBUG_FS
140 Select this to see extensive information about
141 the internal state of mac80211 in debugfs.
143 config PACKAGE_MAC80211_TRACING
144 bool
"Enable tracing (mac80211 and supported drivers)"
146 select KERNEL_ENABLE_DEFAULT_TRACERS
149 Select this to enable tracing of mac80211 and
150 related wifi drivers
(using trace-cmd
).
152 config PACKAGE_MAC80211_MESH
153 bool
"Enable 802.11s mesh support"
159 define KernelPackage
/mac80211
/description
160 Generic IEEE
802.11 Networking Stack
(mac80211
)
163 define KernelPackage
/mac80211-hwsim
164 $(call KernelPackage
/mac80211
/Default
)
165 TITLE
:=mac80211 HW simulation device
166 DEPENDS
+= +kmod-mac80211
+@DRIVER_11AX_SUPPORT
+@DRIVER_11AC_SUPPORT
167 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/mac80211_hwsim.ko
168 AUTOLOAD
:=$(call AutoProbe
,mac80211_hwsim
)
172 define KernelPackage
/mt7601u
173 $(call KernelPackage
/mac80211
/Default
)
174 TITLE
:=MT7601U-based USB dongles Wireless Driver
175 DEPENDS
+= +kmod-mac80211 @USB_SUPPORT
+kmod-usb-core
+mt7601u-firmware
176 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/mediatek
/mt7601u
/mt7601u.ko
177 AUTOLOAD
:=$(call AutoProbe
,mt7601u
)
180 define KernelPackage
/rsi91x
181 $(call KernelPackage
/mac80211
/Default
)
182 TITLE
:=Redpine Signals Inc
91x WLAN driver support
183 DEPENDS
+= +kmod-mac80211
+rs9113-firmware
184 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rsi
/rsi_91x.ko
187 define KernelPackage
/rsi91x-usb
188 $(call KernelPackage
/mac80211
/Default
)
189 TITLE
:=Redpine Signals USB bus support
190 DEPENDS
+=@USB_SUPPORT
+kmod-usb-core
+kmod-mac80211
+kmod-rsi91x
+rs9113-firmware
191 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rsi
/rsi_usb.ko
192 AUTOLOAD
:=$(call AutoProbe
,rsi_usb
)
195 define KernelPackage
/rsi91x-sdio
196 $(call KernelPackage
/mac80211
/Default
)
197 TITLE
:=Redpine Signals SDIO bus support
198 DEPENDS
+= +kmod-mac80211
+kmod-mmc
+kmod-rsi91x
+rs9113-firmware
199 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/rsi
/rsi_sdio.ko
200 AUTOLOAD
:=$(call AutoProbe
,rsi_sdio
)
204 define KernelPackage
/wlcore
205 $(call KernelPackage
/mac80211
/Default
)
206 TITLE
:=TI common driver part
207 DEPENDS
+= +kmod-mmc
+kmod-mac80211
209 $(PKG_BUILD_DIR
)/drivers
/net
/wireless
/ti
/wlcore
/wlcore.ko \
210 $(PKG_BUILD_DIR
)/drivers
/net
/wireless
/ti
/wlcore
/wlcore_sdio.ko
211 AUTOLOAD
:=$(call AutoProbe
,wlcore wlcore_sdio
)
214 define KernelPackage
/wlcore
/description
215 This module contains some common parts needed by TI Wireless drivers.
218 define KernelPackage
/wl12xx
219 $(call KernelPackage
/mac80211
/Default
)
220 TITLE
:=Driver for TI WL12xx
221 URL
:=https
://wireless.wiki.kernel.org
/en
/users
/drivers
/wl12xx
222 DEPENDS
+= +kmod-wlcore
+wl12xx-firmware
223 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/ti
/wl12xx
/wl12xx.ko
224 AUTOLOAD
:=$(call AutoProbe
,wl12xx
)
227 define KernelPackage
/wl12xx
/description
228 Kernel modules for TI WL12xx
231 define KernelPackage
/wl18xx
232 $(call KernelPackage
/mac80211
/Default
)
233 TITLE
:=Driver for TI WL18xx
234 URL
:=https
://wireless.wiki.kernel.org
/en
/users
/drivers
/wl18xx
235 DEPENDS
+= +kmod-wlcore
+wl18xx-firmware
236 FILES
:=$(PKG_BUILD_DIR
)/drivers
/net
/wireless
/ti
/wl18xx
/wl18xx.ko
237 AUTOLOAD
:=$(call AutoProbe
,wl18xx
)
240 define KernelPackage
/wl18xx
/description
241 Kernel modules for TI WL18xx
245 ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
251 ifdef CONFIG_PACKAGE_MAC80211_TRACING
253 IWLWIFI_DEVICE_TRACING
256 config-
$(call config_package
,mac80211-hwsim
) += MAC80211_HWSIM
257 config-
$(call config_package
,mt7601u
) += MT7601U
258 config-y
+= WL_MEDIATEK
260 config-
$(call config_package
,wlcore
) += WLCORE WLCORE_SDIO
261 config-
$(call config_package
,wl12xx
) += WL12XX
262 config-
$(call config_package
,wl18xx
) += WL18XX
263 config-y
+= WL_TI WILINK_PLATFORM_DATA
264 config-
$(call config_package
,rsi91x
) += RSI_91X
265 config-
$(call config_package
,rsi91x-usb
) += RSI_USB
266 config-
$(call config_package
,rsi91x-sdio
) += RSI_SDIO
268 config-
$(CONFIG_LEDS_TRIGGERS
) += MAC80211_LEDS
272 ifeq ($(BUILD_VARIANT
),smallbuffers
)
273 C_DEFINES
+= -DCONFIG_ATH10K_SMALLBUFFERS
277 $(subst -C
$(LINUX_DIR
),-C
"$(PKG_BUILD_DIR)",$(KERNEL_MAKEOPTS
)) \
278 EXTRA_CFLAGS
="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES)" \
279 KLIB_BUILD
="$(LINUX_DIR)" \
281 KLIB
=$(TARGET_MODULES_DIR
) \
282 KERNEL_SUBLEVEL
=$(lastword
$(subst .
, ,$(KERNEL_PATCHVER
))) \
283 KBUILD_LDFLAGS_MODULE_PREREQ
=
286 $(subst $(space
),,$(foreach opt
,$(config-
$(1)),CPTCFG_
$(opt
)=$(1)
290 define mac80211_config
291 $(call ConfigVars
,m
)$(call ConfigVars
,y
)
293 $(eval
$(call shexport
,mac80211_config
))
296 rm -rf
$(PKG_BUILD_DIR
)
297 mkdir
-p
$(PKG_BUILD_DIR
)
301 $(PKG_BUILD_DIR
)/include/linux
/ssb \
302 $(PKG_BUILD_DIR
)/include/linux
/bcma \
303 $(PKG_BUILD_DIR
)/include/net
/bluetooth
306 $(PKG_BUILD_DIR
)/include/linux
/cordic.h \
307 $(PKG_BUILD_DIR
)/include/linux
/crc8.h \
308 $(PKG_BUILD_DIR
)/include/linux
/eeprom_93cx6.h \
309 $(PKG_BUILD_DIR
)/include/linux
/wl12xx.h \
310 $(PKG_BUILD_DIR
)/include/linux
/mhi.h \
311 $(PKG_BUILD_DIR
)/include/net
/ieee80211.h \
312 $(PKG_BUILD_DIR
)/backport-include
/linux
/bcm47xx_nvram.h
314 echo
'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR
)/compat_version
317 ifneq ($(CONFIG_PACKAGE_kmod-cfg80211
),)
318 define Build
/Compile
/kmod
319 rm -rf
$(PKG_BUILD_DIR
)/modules
320 +$(MAKE
) $(PKG_JOBS
) $(MAKE_OPTS
) modules
324 #do not Build/Configure for EXTERNAL KERNEL
325 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE
)),"")
326 ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI
)),"")
327 define Build
/Configure
328 cmp
$(PKG_BUILD_DIR
)/include/linux
/ath9k_platform.h
$(LINUX_DIR
)/include/linux
/ath9k_platform.h
329 cmp
$(PKG_BUILD_DIR
)/include/linux
/ath5k_platform.h
$(LINUX_DIR
)/include/linux
/ath5k_platform.h
330 cmp
$(PKG_BUILD_DIR
)/include/linux
/rt2x00_platform.h
$(LINUX_DIR
)/include/linux
/rt2x00_platform.h
336 $(if
$(QUILT
),rm -rf
$(PKG_BUILD_DIR
)/patches
; mkdir
-p
$(PKG_BUILD_DIR
)/patches
)
337 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/build
,build
/)
338 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/subsys
,subsys
/)
339 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath
,ath
/)
340 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath5k
,ath5k
/)
341 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath9k
,ath9k
/)
342 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath10k
,ath10k
/)
343 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath11k
,ath11k
/)
344 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/rt2x00
,rt2x00
/)
345 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/mwl
,mwl
/)
346 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/brcm
,brcm
/)
347 $(call PatchDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/rtl
,rtl
/)
348 $(if
$(QUILT
),touch
$(PKG_BUILD_DIR
)/.quilt_used
)
351 define Quilt
/Refresh
/Package
352 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/build
,build
/)
353 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/subsys
,subsys
/)
354 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath
,ath
/)
355 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath5k
,ath5k
/)
356 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath9k
,ath9k
/)
357 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath10k
,ath10k
/)
358 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/ath11k
,ath11k
/)
359 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/rt2x00
,rt2x00
/)
360 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/mwl
,mwl
/)
361 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/brcm
,brcm
/)
362 $(call Quilt
/RefreshDir
,$(PKG_BUILD_DIR
),$(PATCH_DIR
)/rtl
,rtl
/)
366 $(SH_FUNC
) var2file
"$(call shvar,mac80211_config)" $(PKG_BUILD_DIR
)/.config
367 $(MAKE
) $(MAKE_OPTS
) allnoconfig
368 $(call Build
/Compile
/kmod
)
371 define Build
/InstallDev
373 $(1)/usr
/include/mac80211 \
374 $(1)/usr
/include/mac80211-backport \
375 $(1)/usr
/include/mac80211
/ath \
376 $(1)/usr
/include/net
/mac80211
377 $(CP
) $(PKG_BUILD_DIR
)/net
/mac80211
/*.h
$(PKG_BUILD_DIR
)/include/* $(1)/usr
/include/mac80211
/
378 $(CP
) $(PKG_BUILD_DIR
)/backport-include
/* $(1)/usr
/include/mac80211-backport
/
379 $(CP
) $(PKG_BUILD_DIR
)/net
/mac80211
/rate.h
$(1)/usr
/include/net
/mac80211
/
380 $(CP
) $(PKG_BUILD_DIR
)/drivers
/net
/wireless
/ath
/*.h
$(1)/usr
/include/mac80211
/ath
/
381 rm -f
$(1)/usr
/include/mac80211-backport
/linux
/module.h
385 define KernelPackage
/cfg80211
/install
386 $(INSTALL_DIR
) $(1)/lib
/wifi
$(1)/lib
/netifd
/wireless
387 $(INSTALL_DATA
) .
/files
/lib
/wifi
/mac80211.sh
$(1)/lib
/wifi
388 $(INSTALL_BIN
) .
/files
/lib
/netifd
/wireless
/mac80211.sh
$(1)/lib
/netifd
/wireless
389 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/ieee80211
390 $(INSTALL_DATA
) .
/files
/mac80211.hotplug
$(1)/etc
/hotplug.d
/ieee80211
/10-wifi-detect
393 $(eval
$(foreach drv
,$(PKG_DRIVERS
),$(call KernelPackage
,$(drv
))))
394 $(eval
$(call KernelPackage
,cfg80211
))
395 $(eval
$(call KernelPackage
,mac80211
))