Skip to content

Commit

Permalink
Add RTL8733BU FPV driver & wifibroadcast script support for FPV
Browse files Browse the repository at this point in the history
  • Loading branch information
libc0607 committed Apr 27, 2024
1 parent b1a7471 commit 6c452ec
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions general/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8189es-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8189fs-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8192eu-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8733bu-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8733bu-openipc-fpv/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtl8812au-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rtw-hostapd/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/rubyfpv/Config.in"
Expand Down
11 changes: 11 additions & 0 deletions general/package/rtl8733bu-openipc-fpv/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/rtl8733bu-openipc-fpv/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
config BR2_PACKAGE_RTL8733BU_OPENIPC_FPV
bool "rtl8733bu-openipc-fpv"
depends on BR2_LINUX_KERNEL
help
A standalone driver for the RTL8733BU 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 "rtl8733bu needs a Linux kernel to be built"
depends on !BR2_LINUX_KERNEL
24 changes: 24 additions & 0 deletions general/package/rtl8733bu-openipc-fpv/rtl8733bu-openipc-fpv.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
################################################################################
#
# rtl8733bu-openipc-fpv
#
################################################################################

ifeq ($(LOCAL_DOWNLOAD),y)
RTL8733BU_OPENIPC_FPV_SITE_METHOD = git
RTL8733BU_OPENIPC_FPV_SITE = https://github.com/libc0607/rtl8733bu-20230626
RTL8733BU_OPENIPC_FPV_VERSION = $(shell git ls-remote $(RTL8733BU_OPENIPC_FPV_SITE) HEAD | head -1 | cut -f1)
else
RTL8733BU_OPENIPC_FPV_SITE = https://github.com/libc0607/rtl8733bu-20230626/archive
RTL8733BU_OPENIPC_FPV_SOURCE = master.tar.gz
endif

RTL8733BU_OPENIPC_FPV_LICENSE = GPL-2.0
RTL8733BU_OPENIPC_FPV_LICENSE_FILES = COPYING

RTL8733BU_OPENIPC_FPV_MODULE_MAKE_OPTS = CONFIG_RTL8733BU=m \
KVER=$(LINUX_VERSION_PROBED) \
KSRC=$(LINUX_DIR)

$(eval $(kernel-module))
$(eval $(generic-package))
7 changes: 6 additions & 1 deletion general/package/wifibroadcast/files/wifibroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ detect_wifi_card() {
driver="realtek_8812eu"
modprobe 8812eu rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
;;
"0bda:f72b")
driver="realtek_8733bu"
modprobe 8733bu rtw_regd_src=1 rtw_tx_pwr_by_rate=0 rtw_tx_pwr_lmt_enable=0
;;
"0cf3:9271" | "040d:3801")
driver="atheros"
Expand Down Expand Up @@ -83,7 +88,7 @@ load_interface() {
if [ "$driver" = "realtek" ]; then
ifconfig "$wlan" up
iwconfig "$wlan" mode monitor
elif [ "$driver" = "realtek_8812eu" ]; then
elif [ "$driver" = "realtek_8812eu" ] || [ "$driver" = "realtek_8733bu" ]; then
ifconfig "$wlan" up
iwconfig "$wlan" mode monitor
iw dev "$wlan" set txpower fixed $((driver_txpower_override * 50))
Expand Down

0 comments on commit 6c452ec

Please sign in to comment.