Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put some Realtek wireless drivers back to the kernel #7012

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

igorpecovnik
Copy link
Member

@igorpecovnik igorpecovnik commented Jul 30, 2024

Description

Enable wifi drivers on user request https://forum.armbian.com/topic/43134-drivers-for-rtl8812au-on-odroid-m1/#comment-198064

They were disabled here:
#6202
due to the size?

How Has This Been Tested?

  • Compile test
  • Tested on hardware

Checklist:

  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the size/large PR with 250 lines or more label Jul 30, 2024
@igorpecovnik igorpecovnik added Build Executing build train (permission needed) and removed size/large PR with 250 lines or more labels Jul 30, 2024
@github-actions github-actions bot added the Hardware Hardware related like kernel, U-Boot, ... label Jul 30, 2024
@pyavitz
Copy link
Collaborator

pyavitz commented Jul 30, 2024

In my own personal builds I've started pulling from; https://github.com/lwfinger/rtw88 as it now has RTL88XXAU support.

Basically we pull it in, remove the original from the source-tree, copy in the new and add our own Makefile Kconfig. Another benefit would be less patching on our end.

@igorpecovnik igorpecovnik added 11 Milestone: Fourth quarter release Work in progress Unfinished / work in progress labels Aug 12, 2024
@igorpecovnik
Copy link
Member Author

I assume this #6703 also fixes it?

@pyavitz
Copy link
Collaborator

pyavitz commented Aug 12, 2024

I attempted to add the lwfinger RTW88 to Armbian not long after this post, but ran into some .ymal fail. If I recall correctly?. I never did figure out what that was about and got busy doing something else.

@alexl83
Copy link
Contributor

alexl83 commented Aug 14, 2024

In my own personal builds I've started pulling from; https://github.com/lwfinger/rtw88 as it now has RTL88XXAU support.

Basically we pull it in, remove the original from the source-tree, copy in the new and add our own Makefile Kconfig. Another benefit would be less patching on our end.

Hy @pyavitz - would you be so kind to share your code, I'd be interested to in pulling rtw88 from our beloved Larry Finger's git repo during build-time - perhaps an extension?

@pyavitz
Copy link
Collaborator

pyavitz commented Aug 15, 2024

Probs better off just adding this; https://lore.kernel.org/linux-wireless/[email protected]/T/#t

or waiting till the next LTS? Thats a lot of patching.

@pyavitz
Copy link
Collaborator

pyavitz commented Aug 15, 2024

In my own personal builds I've started pulling from; https://github.com/lwfinger/rtw88 as it now has RTL88XXAU support.
Basically we pull it in, remove the original from the source-tree, copy in the new and add our own Makefile Kconfig. Another benefit would be less patching on our end.

Hy @pyavitz - would you be so kind to share your code, I'd be interested to in pulling rtw88 from our beloved Larry Finger's git repo during build-time - perhaps an extension?

I tried replacing the function in drivers_network.sh with this

driver_rtw88() {

	# Upstream wireless RTW88 drivers
	# Quite a few kernel families have KERNEL_DRIVERS_SKIP listing this driver. If so, this won't even be called.

	if linux-version compare "${version}" ge 6.1; then

		# Attach to specific commit (is branch:main)
		local rtw88ver="commit:a96a433dea8484c3ac252b5a6217467e157b9405" # Commit date: May 11, 2024 (please update when updating commit ref)

		display_alert "Adding" "Upstream wireless RTW88 drivers" "info"

		fetch_from_repo "$GITHUB_SOURCE/lwfinger/rtw88" "rtw88" "${rtw88ver}" "yes" # https://github.com/lwfinger/rtw88
		cd "$kerneldir" || exit
		rm -fdr "$kerneldir/drivers/net/wireless/realtek/rtw88"
		mkdir -p "$kerneldir/drivers/net/wireless/realtek/rtw88/"

		cp -fr "${SRC}/cache/sources/rtw88/${rtw88ver#*:}"/* "$kerneldir/drivers/net/wireless/realtek/rtw88/"
		rm -fdr $kerneldir/drivers/net/wireless/realtek/rtw88/{alt_rtl8821ce,dkms,README.md}
		cp -fr ${SRC}/patch/misc/rtw88/{Kconfig,Makefile} $kerneldir/drivers/net/wireless/realtek/rtw88/

		process_patch_file "${SRC}/patch/misc/rtw88/hack/001-rtw88-usb-make-work-queues-high-priority.patch" "applying"
		process_patch_file "${SRC}/patch/misc/rtw88/hack/002-rtw88-decrease-the-log-level-of-tx-report.patch" "applying"
	fi
}

But I get the following sha1 patch fail

Problem with ->/home/patrick/build/armbian/cache/patch/kernel-drivers/sha1_99fd042016c7489192d05ff21a10620c2142301d_meson64_current_00386b88_23d83bc8-01ba4719(:1) <-: Failed to apply patch /home/patrick/build/armbian/cache/patch/kernel-drivers/sha1_99fd042016c7489192d05ff21a10620c2142301d_meson64_current_00386b88_23d83bc8-01ba4719.patch

The Kconfig, Makefile and hack patches I used can be found here; https://github.com/pyavitz/rpi-img-builder/tree/master/patches/wireless/rtw88

@alexl83
Copy link
Contributor

alexl83 commented Aug 15, 2024

In my own personal builds I've started pulling from; https://github.com/lwfinger/rtw88 as it now has RTL88XXAU support.
Basically we pull it in, remove the original from the source-tree, copy in the new and add our own Makefile Kconfig. Another benefit would be less patching on our end.

Hy @pyavitz - would you be so kind to share your code, I'd be interested to in pulling rtw88 from our beloved Larry Finger's git repo during build-time - perhaps an extension?

I tried replacing the function in drivers_network.sh with this

driver_rtw88() {

	# Upstream wireless RTW88 drivers
	# Quite a few kernel families have KERNEL_DRIVERS_SKIP listing this driver. If so, this won't even be called.

	if linux-version compare "${version}" ge 6.1; then

		# Attach to specific commit (is branch:main)
		local rtw88ver="commit:a96a433dea8484c3ac252b5a6217467e157b9405" # Commit date: May 11, 2024 (please update when updating commit ref)

		display_alert "Adding" "Upstream wireless RTW88 drivers" "info"

		fetch_from_repo "$GITHUB_SOURCE/lwfinger/rtw88" "rtw88" "${rtw88ver}" "yes" # https://github.com/lwfinger/rtw88
		cd "$kerneldir" || exit
		rm -fdr "$kerneldir/drivers/net/wireless/realtek/rtw88"
		mkdir -p "$kerneldir/drivers/net/wireless/realtek/rtw88/"

		cp -fr "${SRC}/cache/sources/rtw88/${rtw88ver#*:}"/* "$kerneldir/drivers/net/wireless/realtek/rtw88/"
		rm -fdr $kerneldir/drivers/net/wireless/realtek/rtw88/{alt_rtl8821ce,dkms,README.md}
		cp -fr ${SRC}/patch/misc/rtw88/{Kconfig,Makefile} $kerneldir/drivers/net/wireless/realtek/rtw88/

		process_patch_file "${SRC}/patch/misc/rtw88/hack/001-rtw88-usb-make-work-queues-high-priority.patch" "applying"
		process_patch_file "${SRC}/patch/misc/rtw88/hack/002-rtw88-decrease-the-log-level-of-tx-report.patch" "applying"
	fi
}

But I get the following sha1 patch fail

Problem with ->/home/patrick/build/armbian/cache/patch/kernel-drivers/sha1_99fd042016c7489192d05ff21a10620c2142301d_meson64_current_00386b88_23d83bc8-01ba4719(:1) <-: Failed to apply patch /home/patrick/build/armbian/cache/patch/kernel-drivers/sha1_99fd042016c7489192d05ff21a10620c2142301d_meson64_current_00386b88_23d83bc8-01ba4719.patch

The Kconfig, Makefile and hack patches I used can be found here; https://github.com/pyavitz/rpi-img-builder/tree/master/patches/wireless/rtw88

Thanks! I'll have a look around and see if/what I can cobble up together - otherwise waiting for next LTS makes sense :D

@nicolazilio
Copy link

Hi guys,

Any updates on when this will be merged into main?

Thank you very much in advance!

@igorpecovnik igorpecovnik added Build Executing build train (permission needed) and removed Build Executing build train (permission needed) labels Nov 3, 2024
@igorpecovnik igorpecovnik added Can be closed? Ping developers on stalled issue / PR 02 Milestone: First quarter release and removed 11 Milestone: Fourth quarter release labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Build Executing build train (permission needed) Can be closed? Ping developers on stalled issue / PR Hardware Hardware related like kernel, U-Boot, ... Work in progress Unfinished / work in progress
Development

Successfully merging this pull request may close these issues.

4 participants