Skip to content

Commit

Permalink
Package: add RTL8812EU driver & wifibroadcast script support for FPV …
Browse files Browse the repository at this point in the history
…firmware
  • Loading branch information
libc0607 committed Apr 10, 2024
1 parent 6c87fe8 commit 29a0dff
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions general/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/osd-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/quirc-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rcjoystick/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rockchip-osdrv-rv11xx/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl88x2eu-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8188eus-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8188fu-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8188fu-openipc/Config.in"
Expand Down
11 changes: 11 additions & 0 deletions general/package/rtl88x2eu-openipc/0001-fix-extra-cflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
-EXTRA_CFLAGS += -O1
+EXTRA_CFLAGS += -Os
#EXTRA_CFLAGS += -O3
+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
#EXTRA_CFLAGS += -Werror
16 changes: 16 additions & 0 deletions general/package/rtl88x2eu-openipc/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
config BR2_PACKAGE_RTL88X2EU_OPENIPC
bool "rtl88x2eu-openipc"
depends on BR2_LINUX_KERNEL
help
A standalone driver for the RTL88X2EU Dual Band
USB Wi-Fi adapter.

Make sure your target kernel has the CONFIG_WIRELESS_EXT
config option enabled.

Note: this package needs a firmware loading mechanism to
load the binary blob for the chip to work.


comment "rtl88x2eu needs a Linux kernel to be built"
depends on !BR2_LINUX_KERNEL
24 changes: 24 additions & 0 deletions general/package/rtl88x2eu-openipc/rtl88x2eu-openipc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
################################################################################
#
# rtl88x2eu-openipc
#
################################################################################

ifeq ($(LOCAL_DOWNLOAD),y)
RTL88X2EU_OPENIPC_SITE_METHOD = git
RTL88X2EU_OPENIPC_SITE = https://github.com/libc0607/rtl88x2eu-20230815
RTL88X2EU_OPENIPC_VERSION = $(shell git ls-remote $(RTL88X2EU_OPENIPC_SITE) HEAD | head -1 | cut -f1)
else
RTL88X2EU_OPENIPC_SITE = https://github.com/libc0607/rtl88x2eu-20230815/archive
RTL88X2EU_OPENIPC_SOURCE = master.tar.gz
endif

RTL88X2EU_OPENIPC_LICENSE = GPL-2.0
RTL88X2EU_OPENIPC_LICENSE_FILES = COPYING

RTL88X2EU_OPENIPC_MODULE_MAKE_OPTS = CONFIG_RTL8822EU=m \
KVER=$(LINUX_VERSION_PROBED) \
KSRC=$(LINUX_DIR)

$(eval $(kernel-module))
$(eval $(generic-package))
10 changes: 10 additions & 0 deletions general/package/wifibroadcast/files/wifibroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set_mcs() {

# "0bda:8813" -> (8814) -> 8814au
# "0846:9052" -> (8811) -> 8821au
# "0bda:a81a" -> 88x2eu

detect_wifi_card() {
echo "Detecting wifi card vendor..."
Expand All @@ -43,6 +44,11 @@ detect_wifi_card() {
modprobe 88XXau rtw_tx_pwr_idx_override="$driver_txpower_override"
;;

"0bda:a81a")
driver="realtek_8812eu"
modprobe 8812eu rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
;;

"0cf3:9271" | "040d:3801")
driver="atheros"
if ! [ "$unit" = "gs" ]; then
Expand Down Expand Up @@ -84,6 +90,10 @@ load_interface() {
if [ "$driver" = "realtek" ]; then
ifconfig "$wlan" up
iwconfig "$wlan" mode monitor
elif [ ${driver} = "realtek_8812eu" ]; then
ifconfig ${wlan} up
iwconfig ${wlan} mode monitor
iw dev ${wlan} set txpower fixed $(expr ${driver_txpower_override} * 50)
elif [ "$driver" = "atheros" ]; then
iwconfig "$wlan" mode monitor
ifconfig "$wlan" up
Expand Down

0 comments on commit 29a0dff

Please sign in to comment.