Skip to content

Conversation

@iav
Copy link
Contributor

@iav iav commented Jan 30, 2026

In Linux 6.19, net_device->dev_addr is const unsigned char *. Clang with -Werror,-Wincompatible-pointer-types-discards-qualifiers rejects passing dev_addr to non-const parameters and memcpy into it.

Fix by:

  • Replacing memcpy(dev->dev_addr, ...) with dev_addr_set()
  • Using local buffer + ether_addr_copy for sprdwl_set_mac_addr call that needs mutable addr (the function modifies it in-place)
  • Changing u8 *mac pointer to u8 mac[ETH_ALEN] array in cfg80211.c where dev_addr was assigned to a non-const pointer

Relates to #9049

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • build with clang

  • build with gcc

  • My code follows the style guidelines of this project

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • My changes generate no new warnings

  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Added support for Linux kernel version 6.19 in wireless driver
  • Bug Fixes

    • Improved MAC address handling in wireless driver for enhanced stability

✏️ Tip: You can customize this high-level summary in your review settings.

In Linux 6.19, net_device->dev_addr is const unsigned char *.
Clang with -Werror,-Wincompatible-pointer-types-discards-qualifiers
rejects passing dev_addr to non-const parameters and memcpy into it.

Fix by:
- Replacing memcpy(dev->dev_addr, ...) with dev_addr_set()
- Using local buffer + ether_addr_copy for sprdwl_set_mac_addr call
  that needs mutable addr (the function modifies it in-place)
- Changing u8 *mac pointer to u8 mac[ETH_ALEN] array in cfg80211.c
  where dev_addr was assigned to a non-const pointer

Relates to armbian#9049

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@iav iav requested review from a team and igorpecovnik as code owners January 30, 2026 07:55
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The changes add support for Linux kernel 6.19 to the wireless UWE5622 driver by introducing a conditional patch application in the compilation script and creating a new patch file that refactors MAC address handling to use kernel APIs.

Changes

Cohort / File(s) Summary
Kernel 6.19 Support
lib/functions/compilation/patch/drivers_network.sh
Adds conditional patch logic to apply uwe5622-v6.19.patch for Linux kernel versions 6.19 and later in the driver UWE5622 compilation flow.
MAC Address Refactoring
patch/misc/wireless-uwe5622/uwe5622-v6.19.patch
New patch refactors MAC address handling in cfg80211.c and main.c to use kernel APIs: replaces pointer assignments with fixed-size buffer (u8 mac[ETH_ALEN]), switches from memcpy to ether_addr_copy for buffer operations, and uses dev_addr_set instead of direct dev_addr modification.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop and a skip for kernel six-nineteen,
MAC buffers dance where pointers had been,
ether_addr_copy pirouettes with grace,
New APIs embrace the network's space! ✨
Wireless dreams hop forward with delight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing compilation issues with clang on Linux 6.19 for the uwe5622 wireless driver.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added 02 Milestone: First quarter release size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Framework Framework components Patches Patches related to kernel, U-Boot, ... labels Jan 30, 2026
@iav iav requested a review from EvilOlaf January 30, 2026 07:56
@EvilOlaf
Copy link
Member

Disclaimer: I'm not familiar with compiler changes or clang.
Does this affect building without clang? Or is this even no longer a thing?

@iav
Copy link
Contributor Author

iav commented Jan 30, 2026

It still builds with gcc, for sure.

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Jan 30, 2026
@github-actions
Copy link
Contributor

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions bot removed the Needs review Seeking for review label Jan 30, 2026
@igorpecovnik igorpecovnik merged commit e9f1902 into armbian:main Jan 31, 2026
12 checks passed
@iav iav deleted the fix/uwe5622-v6.19-const-correctness branch January 31, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First quarter release Framework Framework components Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants