-
Notifications
You must be signed in to change notification settings - Fork 11
fix build compatibility with Linux 6.12+ and hardened kernels with strict type checks #7
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
base: main
Are you sure you want to change the base?
Conversation
…rict type checks
This patch updates the Morse driver to build successfully with Linux kernel
version 6.12 and later, addressing API changes and stricter type checks
introduced in newer kernel releases.
Key changes:
- Fixed `morse_firmware_init()` enum–int type mismatch causing
`-Werror=enum-int-mismatch` failures.
- Updated mac80211 compatibility for new API signatures:
- `sta_rc_update` now uses `ieee80211_link_sta` (6.13+)
- `set_frag_threshold` and `set_rts_threshold` updated to accept
`(struct ieee80211_hw *, int, u32)`
- Added support for `morse_mac_ops_config()` and `morse_wiphy_set_wiphy_params()`
variants with `radio_idx` argument (6.17+)
- Adjusted `get_elements_from_s1g_beacon()` and related logic to align with
new `ieee80211_is_s1g_short_beacon()` behavior (requires `variable_len` in 6.12+).
- Replaced deprecated timer APIs (`del_timer_sync`) with `timer_delete_sync`
where required (6.15+), and introduced `timer_container_of()` for 6.16+.
- Fixed missing `mmrc_osal.h` include error by adding APF stub functions when
`CONFIG_ANDROID` is disabled.
- Added kernel version guards and minor cleanup for conditional compilation
across 6.12–6.17 transitions.
This ensures forward compatibility while maintaining backward support for
older kernel versions.
Signed-off-by: Govind Singh <govind.sk85@gmail.com>
|
@morse-arienjudge Can we have this patch merged in the next version of the Morse driver? |
|
Also i am curious if there is a roadmap to have this up streamed in Linux kernel. |
|
Hi @govindsi Thanks for raising this fix - many members of the community have been asking about it. It's unlikely this will make it into the next release (which was tagged internally a little while ago), but I've notified the responsible teams and hope to improve the process so subsequent driver releases consider latest versions of LTS kernels, rather than the tagged versions you may see in https://github.com/MorseMicro/rpi-linux and https://github.com/MorseMicro/linux Regarding our upstream efforts. We're working on this and we had started with kernel changes first. We have enough S1G support in the kernel now to begin pushing a basic, minimal driver. There isn't a hard timeline on this, but we're aiming to submit a driver to the kernel staging directory before the end of the year. This will need to be supported by accompanying changes to hostap/wpa_supplicant which will follow shortly after. This driver will only support basic functionality at first as per kernel requirements. |
|
Just wanted to thank you for this. I've been keeping my own patch for the AREDN Project (arednmesh.org) which uses the latest OpenWRT builds. But this is much nicer than what I've been doing. One question - should you be using MAC80211_VERSION_CODE rather than LINUX_VERSION_CODE in some places? In the latest OpenWRT I needed to make a couple of these changes to get it to compile. |
|
Thanks @aanon4 for the feedback. |
| return 0; | ||
|
|
||
| #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
| if (!ieee80211_is_s1g_beacon(frame_control) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@govindsi why was the behavior negated for new kernel versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mic92 , yes, this shall be corrected. Thanks for pointing out
|
Hi, We are looking at this internally. Unfortunately the changes in this patchset incorrectly parse the beacons and will lead to a failure during association. The above does not take into account optional elements in S1G beacon that may precede the elements based on the flags set in the frame control. For more information on this please see the following patch, which was backported to 6.12.34. For this to be done right it should make use of where Additionally, as @Mic92 pointed out - the inversion of the lachlan |
|
@donnaskiez Does this mean we might be looking at the 2.10-dev release shortly with these patches? |
@donnaskiez , thanks for review comments. Is there a release timeline when we can expect all compatibility fixes. |
|
for what its worth, I have a set of patches for 1.16 at https://github.com/Gateworks/morse_driver/tree/1.16.4-gateworks which are compatible to 6.18. Much of them are similar to yours but I did handle the changes to ieee80211_is_s1g_short_beacon differently due to just not being able to get an adaptation to the upstream changes to work and also to make it more kernel version agnostic due to the upstream patches being backported to 6.12.y and 6.15.y. I also have a different solution to the crc7_be_byte API going away as your solution is not endianness safe and failed for my le platform. I'm told from MorseMicro that 6.18 support won't come until their 1.18 release but I have no idea what the timeline is on that (I assume not for a while as they are currently validated 1.17) Tim |
This patch updates the Morse driver to build successfully with Linux kernel version 6.12 and later, addressing API changes and stricter type checks introduced in newer kernel releases.
Key changes:
morse_firmware_init()enum–int type mismatch causing-Werror=enum-int-mismatchfailures.sta_rc_updatenow usesieee80211_link_sta(6.13+)set_frag_thresholdandset_rts_thresholdupdated to accept(struct ieee80211_hw *, int, u32)morse_mac_ops_config()andmorse_wiphy_set_wiphy_params()variants withradio_idxargument (6.17+)get_elements_from_s1g_beacon()and related logic to align with newieee80211_is_s1g_short_beacon()behavior (requiresvariable_lenin 6.12+).del_timer_sync) withtimer_delete_syncwhere required (6.15+), and introducedtimer_container_of()for 6.16+.mmrc_osal.hinclude error by adding APF stub functions whenCONFIG_ANDROIDis disabled.This ensures forward compatibility while maintaining backward support for older kernel versions.