Skip to content

replace strncpy with strscpy and update compatibility for Linux 6.9+ - #144

Open
rughinnit wants to merge 3 commits into
jwrdegoede:rtl8189fsfrom
rughinnit:fix-kernel-6.12-build
Open

rughinnit wants to merge 3 commits into
jwrdegoede:rtl8189fsfrom
rughinnit:fix-kernel-6.12-build

Conversation

@rughinnit

Copy link
Copy Markdown

In Linux kernel 6.9+ and 6.12, cfg80211_ch_switch_notify requires 4 arguments.

The upper bound check < KERNEL_VERSION(6, 9, 0) in os_dep/linux/ioctl_cfg80211.c caused kernels >= 6.9.0 to fall back to the 3-argument variant, leading to a build error (too few arguments to function 'cfg80211_ch_switch_notify').

Removing the < KERNEL_VERSION(6, 9, 0) check allows Kernel 6.3 through 6.12+ to use the 4-argument signature and build cleanly.

@CGarces

CGarces commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Please review the logic, last PR was compiled fine over kernels from 6.3 to 6.12+
https://github.com/jwrdegoede/rtl8189ES_linux/actions/runs/29415210642
Check che compilation error at
https://github.com/jwrdegoede/rtl8189ES_linux/actions/runs/32575175510/job/97063112639?pr=144

@rughinnit
rughinnit force-pushed the fix-kernel-6.12-build branch 9 times, most recently from 46a0287 to a95c06f Compare August 23, 2026 06:26
@rughinnit

Copy link
Copy Markdown
Author

Sorry, I removed the 4-arg call for kernels 6.3–6.8, which broke the kernel 6.6 CI build. That was my fault.

And those pr wont compile in my armbian build that made by ophub, probably due to gcc 14.2 and Ophub Armbian kernel 6.12.103 may have backported the set_monitor_channel signature change from mainline 6.13 into 6.12. The CI's mainline 6.12.104 headers might still have the old signature. my essential fix is just >= 6.12.0 instead of >= 6.13.0

And also i replaced deprecated/removed strncpy calls with strscpy across all driver files with cfg80211 API Signature Adaptations.

@rughinnit

rughinnit commented Aug 23, 2026 •

Copy link
Copy Markdown
Author

and also it seems like gh workflow build on kernel 6.18.45 and 6.12.104 failed to download, i havent looked at it yet
install: missing destination file operand after '8189fs.ko'
you might want to review the makefile

@CGarces

CGarces commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Hi.

I have reviewed the PR.

  • The logic of cfg80211_ch_switch_notify has the same behaviour, not fix anything, just made the logic for Kernels 6.9+ more clear. I'll keep it but please change the commit message.
  • Please revert the workflow_dispatch change. It's ok for your fork but not needed at upstream.

…6.9+, 6.12+, 7.2+

1. Replace deprecated strncpy with safe strscpy across all driver files
   (hal_com.c, hal_com_phycfg.c, hal_sdio.c, phydm_debug.c, rtw_debug.c,
   rtw_wlan_util.c, os_intfs.c, ioctl_cfg80211.c, ioctl_linux.c, rtw_cfgvendor.c)
   to fix implicit function declaration build errors on Kernel 6.8+, 6.12+, and 7.2+.
   Add a fallback macro for kernels < 4.3 in osdep_service_linux.h.

2. ioctl_cfg80211.c: Clarify cfg80211_ch_switch_notify logic for Kernel 6.9+
   (3 arguments: dev, chandef, flags).

3. ioctl_cfg80211.c: Lower version guard for set_monitor_channel dev
   parameter from KERNEL_VERSION(6, 13, 0) to KERNEL_VERSION(6, 12, 0).

4. ioctl_cfg80211.c: Update remain_on_channel signature for Kernel 7.2+
   by adding const u8 *rx_addr parameter.
@rughinnit
rughinnit force-pushed the fix-kernel-6.12-build branch from a95c06f to d9fb743 Compare August 23, 2026 17:05
@rughinnit

rughinnit commented Aug 23, 2026 •

Copy link
Copy Markdown
Author

Thanks for reviewing my PR.

I revert the workflow dispatch and revise the commit message, will it do?

@CGarces CGarces changed the title ioctl_cfg80211: fix cfg80211_ch_switch_notify signature for Kernel 6.9+ replace strncpy with strscpy and update compatibility for Linux 6.9+ Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants