mwlwifi: add pending patch to fix compilation with kernel 6.6.109+
authorStefan Kalscheuer <[email protected]>
Sat, 31 May 2025 15:07:40 +0000 (17:07 +0200)
committerRobert Marko <[email protected]>
Thu, 16 Oct 2025 11:32:35 +0000 (13:32 +0200)
commita8afcd8fc26fa7b348867f03ed3821167a9e68a8
treeb782dd470e6606db2e4b4ae4348d74b5060ec844
parent0c4f3b1246dae22d8cb299907fb200a212a4719a
mwlwifi: add pending patch to fix compilation with kernel 6.6.109+

Building against recent kernel versions (noticed with 6.12) and -Werror
can fail because a macro MAX(a,b) is already defined in minmax.h or
kernel.h before 5.10.

Initially noticed on 6.12, but it now happens after the kernel bump to
6.6.109 as well (upstream commit 6183c65)

In file included from ../mwlwifi-2025.02.06~db97edf2/hif/fwcmd.h:23,
                 from ../mwlwifi-2025.02.06~db97edf2/core.c:25:
../mwlwifi-2025.02.06~db97edf2/hif/hostcmd.h:1124: error: "MAX" redefined [-Werror]
 1124 | #define MAX(a, b) (((a) > (b)) ? (a) : (b))
      |         ^~~
In file included from usr/include/mac80211-backport/linux/minmax.h:4,
                 from ./include/linux/kernel.h:27,
                 from usr/include/mac80211-backport/linux/kernel.h:3,
                 from ./include/linux/skbuff.h:13,
                 from usr/include/mac80211-backport/linux/skbuff.h:3,
                 from ./include/linux/if_ether.h:19,
                 from usr/include/mac80211-backport/linux/if_ether.h:3,
                 from ./include/linux/etherdevice.h:20,
                 from usr/include/mac80211-backport/linux/etherdevice.h:3,
                 from ../mwlwifi-2025.02.06~db97edf2/core.c:18:
./include/linux/minmax.h:315: note: this is the location of the previous definition
  315 | #define MAX(a, b) __cmp(max, a, b)
      |         ^~~

Add a pending upstream patch which replaces the MAX(a,b) macro to avoid
conflicts and allow compilation with 6.12 backports

(cherry picked from commit 822bceb1d12bdb08688051ead06e0c4462e7d123)

Signed-off-by: Stefan Kalscheuer <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20420
Signed-off-by: Robert Marko <[email protected]>
package/kernel/mwlwifi/Makefile
package/kernel/mwlwifi/patches/030-remove-MAX-a-b-macro-to-avoid-conflict-with-kernel.h.patch [new file with mode: 0644]