Bug 287695 - Compile error in BWN
Summary: Compile error in BWN
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 14.3-RELEASE
Hardware: amd64 Any
: --- Affects Many People
Assignee: Bjoern A. Zeeb
URL:
Keywords:
Depends on:
Blocks: broadcom-native-wifi-PRs
  Show dependency treegraph
 
Reported: 2025-06-20 23:05 UTC by tom.mcclean@gmail.com
Modified: 2025-07-13 19:36 UTC (History)
1 user (show)

See Also:
bz: mfc-stable14+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tom.mcclean@gmail.com 2025-06-20 23:05:28 UTC
Compilation of kernel fails with error in BWN driver on 14.3-RELEASE.

To reproduce, as root:
1. Back up existing source tree to /usr/src.original
2. Download a fresh copy of 14.3-RELEASE source tree, extract archive to /usr/src
3. copy /usr/src/sys/amd64/conf/GENERIC to /usr/src/sys/amd64/conf/WIRELESS
4. edit /usr/src/sys/amd64/conf/WIRELESS to 
4a. uncomment line 297, 
4b. insert new line 298 "options BWN_GPL_PHY", 
4c. insert new line 299 "options BWN_DEBUG".
5. "cd /usr/src/"
6. "make buildkernel KERNCONF=WIRELESS"

compilation fails with error message 

/usr/src/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c:250:11: error: comparison of different enumeration types ('bwn_phy_band_t' and 'bwn_band_t') [-Werror,-Wenum-compare]
  250 |         if (band == BWN_BAND_2G) {
      |             ~~~~ ^  ~~~~~~~~~~~
1 error generated.
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-06-22 00:03:34 UTC
Just to be clear bwn and BWN_DEBUG compile, it is BWN_GPL_PHY which causes the error.
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-06-22 00:20:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2f16c8d4fa0f5788d52d74fa875c386c475249ec

commit 2f16c8d4fa0f5788d52d74fa875c386c475249ec
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-06-22 00:15:38 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-06-22 00:19:42 +0000

    bwn(4): BWN_GPL_PHY: make compile again

    compiler complains about error: comparison of different enumeration types
    ('bwn_phy_band_t' and 'bwn_band_t');  so use the correct enum value.

    Sponsored by:   The FreeBSD Foundation
    PR:             287695
    Reported by:    (tom.mcclean gmail.com)
    MFC after:      3 days

 sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-06-22 00:24:29 UTC
Hi,

thanks for reporting.

I'll merge the fix in a few days to stable/14.  You may need to manually cherry-pick the one line change to your releng/14.3-derived branch to make it compile.
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-07-13 19:32:03 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=48c4eac328eaffe4eed0461d75e6c2bb463b3efc

commit 48c4eac328eaffe4eed0461d75e6c2bb463b3efc
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-06-22 00:15:38 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-07-13 19:25:02 +0000

    bwn(4): BWN_GPL_PHY: make compile again

    compiler complains about error: comparison of different enumeration types
    ('bwn_phy_band_t' and 'bwn_band_t');  so use the correct enum value.

    Sponsored by:   The FreeBSD Foundation
    PR:             287695
    Reported by:    (tom.mcclean gmail.com)

    (cherry picked from commit 2f16c8d4fa0f5788d52d74fa875c386c475249ec)

 sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 5 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-07-13 19:36:11 UTC
Thanks a lot for reporting.  The fix is in main and stable/14.